From 1b6f7ec6794233fbf7c1cf17dcee34053c08fa9c Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Sat, 7 Dec 2024 22:08:18 +0100 Subject: [PATCH 001/149] qualcommax: ipq807x: add Netgear DEVICE_VARS Add NETGEAR_BOARD_ID and NETGEAR_HW_ID to DEVICE_VARS as multiple devices set them in their recipes, so without them being added to DEVICE_VARS then simply the value from last recipe that gets evaluated is used and images are generated with the wrong ID-s. Link: https://github.com/openwrt/openwrt/pull/17203 Signed-off-by: Robert Marko --- target/linux/qualcommax/image/ipq807x.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/qualcommax/image/ipq807x.mk b/target/linux/qualcommax/image/ipq807x.mk index 34fe92ed54c..ff6963405c6 100644 --- a/target/linux/qualcommax/image/ipq807x.mk +++ b/target/linux/qualcommax/image/ipq807x.mk @@ -1,3 +1,5 @@ +DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID + define Build/asus-fake-ramdisk rm -rf $(KDIR)/tmp/fakerd dd if=/dev/zero bs=32 count=1 > $(KDIR)/tmp/fakerd From 22d2aa65e87130a597e9f9c970bfece4232dba72 Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Sun, 1 Dec 2024 19:17:13 +0100 Subject: [PATCH 002/149] kernel: fallback-sprom: create separate header files Create a separate header files fallback-sprom.h for BCMA and SSB Fallback SPROM Driver to add function prototypes to fallback-sprom.c as well. This prevents missing function prototype errors. Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/17138 Signed-off-by: Robert Marko --- .../files/drivers/bcma/fallback-sprom.c | 1 + .../files/drivers/bcma/fallback-sprom.h | 7 ++++ .../files/drivers/ssb/fallback-sprom.c | 1 + .../files/drivers/ssb/fallback-sprom.h | 7 ++++ .../810-bcma-ssb-fallback-sprom.patch | 41 ++++++++----------- 5 files changed, 34 insertions(+), 23 deletions(-) create mode 100644 target/linux/generic/files/drivers/bcma/fallback-sprom.h create mode 100644 target/linux/generic/files/drivers/ssb/fallback-sprom.h diff --git a/target/linux/generic/files/drivers/bcma/fallback-sprom.c b/target/linux/generic/files/drivers/bcma/fallback-sprom.c index db583fca9cc..6932c3c8f57 100644 --- a/target/linux/generic/files/drivers/bcma/fallback-sprom.c +++ b/target/linux/generic/files/drivers/bcma/fallback-sprom.c @@ -16,6 +16,7 @@ #include #include #include +#include "fallback-sprom.h" #define BCMA_FBS_MAX_SIZE 468 diff --git a/target/linux/generic/files/drivers/bcma/fallback-sprom.h b/target/linux/generic/files/drivers/bcma/fallback-sprom.h new file mode 100644 index 00000000000..363663413dc --- /dev/null +++ b/target/linux/generic/files/drivers/bcma/fallback-sprom.h @@ -0,0 +1,7 @@ +#ifndef _FALLBACK_SPROM_H +#define _FALLBACK_SPROM_H + +int __init bcma_fbs_register(void); +int bcma_get_fallback_sprom(struct bcma_bus *dev, struct ssb_sprom *out); + +#endif /* _FALLBACK_SPROM_H */ diff --git a/target/linux/generic/files/drivers/ssb/fallback-sprom.c b/target/linux/generic/files/drivers/ssb/fallback-sprom.c index b8a4dcedcf4..9c2511febe1 100644 --- a/target/linux/generic/files/drivers/ssb/fallback-sprom.c +++ b/target/linux/generic/files/drivers/ssb/fallback-sprom.c @@ -16,6 +16,7 @@ #include #include #include +#include "fallback-sprom.h" #define SSB_FBS_MAX_SIZE 440 diff --git a/target/linux/generic/files/drivers/ssb/fallback-sprom.h b/target/linux/generic/files/drivers/ssb/fallback-sprom.h new file mode 100644 index 00000000000..3966a18b86d --- /dev/null +++ b/target/linux/generic/files/drivers/ssb/fallback-sprom.h @@ -0,0 +1,7 @@ +#ifndef _FALLBACK_SPROM_H +#define _FALLBACK_SPROM_H + +int __init ssb_fbs_register(void); +int ssb_get_fallback_sprom(struct ssb_bus *dev, struct ssb_sprom *out); + +#endif /* _FALLBACK_SPROM_H */ diff --git a/target/linux/generic/hack-6.6/810-bcma-ssb-fallback-sprom.patch b/target/linux/generic/hack-6.6/810-bcma-ssb-fallback-sprom.patch index a011cf8ffa6..08085d957ae 100644 --- a/target/linux/generic/hack-6.6/810-bcma-ssb-fallback-sprom.patch +++ b/target/linux/generic/hack-6.6/810-bcma-ssb-fallback-sprom.patch @@ -6,15 +6,15 @@ Subject: [PATCH] ssb_sprom: add generic kernel support for Broadcom Fallback SP --- drivers/bcma/Kconfig | 4 ++++ drivers/bcma/Makefile | 1 + - drivers/bcma/bcma_private.h | 4 ++++ + drivers/bcma/bcma_private.h | 1 + drivers/bcma/main.c | 8 ++++++++ drivers/bcma/sprom.c | 23 ++++++++++++++--------- drivers/ssb/Kconfig | 5 +++++ drivers/ssb/Makefile | 1 + drivers/ssb/main.c | 8 ++++++++ drivers/ssb/sprom.c | 12 +++++++++++- - drivers/ssb/ssb_private.h | 4 ++++ - 10 files changed, 60 insertions(+), 10 deletions(-) + drivers/ssb/ssb_private.h | 2 +- + 10 files changed, 54 insertions(+), 11 deletions(-) --- a/drivers/bcma/Kconfig +++ b/drivers/bcma/Kconfig @@ -41,17 +41,14 @@ Subject: [PATCH] ssb_sprom: add generic kernel support for Broadcom Fallback SP obj-$(CONFIG_BCMA) += bcma.o --- a/drivers/bcma/bcma_private.h +++ b/drivers/bcma/bcma_private.h -@@ -38,6 +38,10 @@ int bcma_bus_resume(struct bcma_bus *bus - void bcma_detect_chip(struct bcma_bus *bus); - int bcma_bus_scan(struct bcma_bus *bus); +@@ -8,6 +8,7 @@ -+/* fallback-sprom.c */ -+int __init bcma_fbs_register(void); -+int bcma_get_fallback_sprom(struct bcma_bus *dev, struct ssb_sprom *out); -+ - /* sprom.c */ - int bcma_sprom_get(struct bcma_bus *bus); + #include + #include ++#include "fallback-sprom.h" + #define bcma_err(bus, fmt, ...) \ + dev_err((bus)->dev, "bus%d: " fmt, (bus)->num, ##__VA_ARGS__) --- a/drivers/bcma/main.c +++ b/drivers/bcma/main.c @@ -671,6 +671,14 @@ static int __init bcma_modinit(void) @@ -174,14 +171,12 @@ Subject: [PATCH] ssb_sprom: add generic kernel support for Broadcom Fallback SP /* https://bcm-v4.sipsolutions.net/802.11/IsSpromAvailable */ --- a/drivers/ssb/ssb_private.h +++ b/drivers/ssb/ssb_private.h -@@ -143,6 +143,10 @@ extern int ssb_bus_scan(struct ssb_bus * - extern void ssb_iounmap(struct ssb_bus *ssb); - - -+/* fallback-sprom.c */ -+int __init ssb_fbs_register(void); -+int ssb_get_fallback_sprom(struct ssb_bus *dev, struct ssb_sprom *out); -+ - /* sprom.c */ - extern - ssize_t ssb_attr_sprom_show(struct ssb_bus *bus, char *buf, +@@ -8,7 +8,7 @@ + #include + #include + #include +- ++#include "fallback-sprom.h" + + /* pci.c */ + #ifdef CONFIG_SSB_PCIHOST From 0286dfe394cbad2a736160fec784b024ce4040bd Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 8 Dec 2024 13:36:41 +0100 Subject: [PATCH 003/149] wifi-scripts: fix regression with ucode update nl80211.request with GET_WIPHY for a single wiphy no longer returns an array Signed-off-by: Felix Fietkau --- .../usr/share/ucode/wifi/hostapd.uc | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc index 78b38ff6333..2f6c4ddc40e 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc @@ -438,29 +438,25 @@ function device_extended_features(data, flag) { function device_capabilities(phy) { let idx = +substr(phy, 3, 1);; - let phys = nl80211.request(nl80211.const.NL80211_CMD_GET_WIPHY, nl80211.const.NLM_F_DUMP, { wiphy: idx, split_wiphy_dump: true }); - - for (let phy in phys) { - if (!phy || phy.wiphy != idx) + phy = nl80211.request(nl80211.const.NL80211_CMD_GET_WIPHY, nl80211.const.NLM_F_DUMP, { wiphy: idx, split_wiphy_dump: true }); + if (!phy) + return; + for (let band in phy.wiphy_bands) { + if (!band) continue; - for (let band in phy.wiphy_bands) { - if (!band) + phy_capabilities.ht_capa = band.ht_capa ?? 0; + phy_capabilities.vht_capa = band.vht_capa ?? 0; + for (let iftype in band.iftype_data) { + if (!iftype.iftypes.ap) continue; - phy_capabilities.ht_capa = band.ht_capa ?? 0; - phy_capabilities.vht_capa = band.vht_capa ?? 0; - for (let iftype in band.iftype_data) { - if (!iftype.iftypes.ap) - continue; - phy_capabilities.he_mac_cap = iftype.he_cap_mac; - phy_capabilities.he_phy_cap = iftype.he_cap_phy; - } - break; + phy_capabilities.he_mac_cap = iftype.he_cap_mac; + phy_capabilities.he_phy_cap = iftype.he_cap_phy; } - - phy_features.ftm_responder = device_extended_features(phy.extended_features, NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER); - phy_features.radar_background = device_extended_features(phy.extended_features, NL80211_EXT_FEATURE_RADAR_BACKGROUND); break; } + + phy_features.ftm_responder = device_extended_features(phy.extended_features, NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER); + phy_features.radar_background = device_extended_features(phy.extended_features, NL80211_EXT_FEATURE_RADAR_BACKGROUND); } function generate(config) { From ed34e337a959919048e393f4b80d22aceffc3218 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 8 Dec 2024 13:55:33 +0100 Subject: [PATCH 004/149] wifi-scripts: fix ucode support for referencing wifi devices by phy name Rename phys according to board.json Signed-off-by: Felix Fietkau --- .../lib/netifd/wireless/mac80211.sh | 53 ++++++++++++++++++- .../share/schema/wireless.wifi-device.json | 4 ++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh index 8b55d01e7a8..cfd74240611 100755 --- a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh +++ b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh @@ -8,6 +8,7 @@ import * as supplicant from 'wifi.supplicant'; import * as hostapd from 'wifi.hostapd'; import * as netifd from 'wifi.netifd'; import * as iface from 'wifi.iface'; +import * as nl80211 from 'nl80211'; import * as fs from 'fs'; global.radio = ARGV[2]; @@ -57,7 +58,7 @@ function phy_path_match(phy, path) { return substr(phy_path, -length(path)) == path; } -function find_phy_by_path(phys, path) { +function __find_phy_by_path(phys, path) { if (!path) return null; @@ -73,7 +74,57 @@ function find_phy_by_macaddr(phys, macaddr) { return filter(phys, (phy) => phy_file(phy, "macaddr") == macaddr)[0]; } +function rename_phy_by_name(phys, name) { + let data = json(fs.readfile("/etc/board.json")).wlan; + if (!data) + return; + + data = data[name]; + if (!data) + return; + + let prev_name = __find_phy_by_path(phys, data.path); + if (!prev_name) + return; + + let idx = phy_index(prev_name); + nl80211.request(nl80211.const.NL80211_CMD_SET_WIPHY, 0, { + wiphy: idx, + wiphy_name: name + }); + return true; +} + +function find_phy_by_path(phys, path) { + let name = __find_phy_by_path(phys, path); + if (!name) + return; + + let data = json(fs.readfile("/etc/board.json")).wlan; + if (!data || data[name]) + return name; + + for (let cur_name, cur_data in data) { + if (!phy_path_match(name, cur_data.path)) + continue; + + let idx = phy_index(name); + nl80211.request(nl80211.const.NL80211_CMD_SET_WIPHY, 0, { + wiphy: idx, + wiphy_name: cur_name + }); + + return cur_name; + } + + return name; +} + function find_phy_by_name(phys, name) { + if (index(phys, name) >= 0) + return name; + + rename_phy_by_name(phys, name); return index(phys, name) < 0 ? null : name; } diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json index 0588401c99e..65d33989fe6 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json @@ -547,6 +547,10 @@ "description": "Alternative to phy used to identify the device based paths in /sys/devices", "type": "string" }, + "phy": { + "description": "Name of the phy, as described in board.json", + "type": "string" + }, "radio": { "description": "Index of the phy radio (for multi-radio PHYs)", "type": "number", From cf1909a024a7db28a43dd799dea09358d0ecee87 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 8 Dec 2024 15:10:51 +0100 Subject: [PATCH 005/149] wifi-scripts: fix channels array property parsing in ucode script Since the channels array can contain ranges, its type needs to be string, not number. Signed-off-by: Felix Fietkau --- .../files-ucode/usr/share/schema/wireless.wifi-device.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json index 65d33989fe6..77b7adada89 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json @@ -115,7 +115,7 @@ "description": "Use specific channels, when channel is in “auto” mode. This option allows hostapd to select one of the provided channels when a channel should be automatically selected. Channels can be provided as range using hyphen ('-') or individual channels can be specified by space (' ') separated values", "type": "array", "items": { - "type": "number" + "type": "string" } }, "country": { From 0826b224b5210fc6f0681c9324dca974d507a8f7 Mon Sep 17 00:00:00 2001 From: Pavel Shirov Date: Sat, 7 Dec 2024 15:29:28 +0300 Subject: [PATCH 006/149] kernel: packages: fix building package/devel/perf with -O3 Add patch to fix failure to build package/devel/perf when CONFIG_TARGET_OPTIMIZATION has -O3 enabled with this error: ``` In function 'elf_close', inlined from 'elf_close' at elf.c:41:6, inlined from 'elf_find_func_offset_from_file' at elf.c:267:2: elf.c:45:9: error: 'elf_fd.elf' may be used uninitialized [-Werror=maybe-uninitialized] 45 | elf_end(elf_fd->elf); | ^~~~~~~~~~~~~~~~~~~~ elf.c: In function 'elf_find_func_offset_from_file': elf.c:260:23: note: 'elf_fd.elf' was declared here 260 | struct elf_fd elf_fd; | ^~~~~~ In function 'elf_close', inlined from 'elf_close' at elf.c:41:6, inlined from 'elf_find_func_offset_from_file' at elf.c:267:2: elf.c:46:9: error: 'elf_fd.fd' may be used uninitialized [-Werror=maybe-uninitialized] 46 | close(elf_fd->fd); | ^~~~~~~~~~~~~~~~~ elf.c: In function 'elf_find_func_offset_from_file': elf.c:260:23: note: 'elf_fd.fd' was declared here 260 | struct elf_fd elf_fd; | ^~~~~~ ``` Link: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=fab45b962749 Signed-off-by: Pavel Shirov Link: https://github.com/openwrt/openwrt/pull/17141 Signed-off-by: Hauke Mehrtens --- ...6.12-fix-libbpf-Wmaybe-uninitialized.patch | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 target/linux/generic/backport-6.6/192-v6.12-fix-libbpf-Wmaybe-uninitialized.patch diff --git a/target/linux/generic/backport-6.6/192-v6.12-fix-libbpf-Wmaybe-uninitialized.patch b/target/linux/generic/backport-6.6/192-v6.12-fix-libbpf-Wmaybe-uninitialized.patch new file mode 100644 index 00000000000..638fe4bc4ad --- /dev/null +++ b/target/linux/generic/backport-6.6/192-v6.12-fix-libbpf-Wmaybe-uninitialized.patch @@ -0,0 +1,59 @@ +From fab45b962749184e1a1a57c7c583782b78fad539 Mon Sep 17 00:00:00 2001 +From: Sam James +Date: Tue, 13 Aug 2024 20:49:06 +0100 +Subject: [PATCH] libbpf: Workaround -Wmaybe-uninitialized false positive +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +In `elf_close`, we get this with GCC 15 -O3 (at least): +``` +In function ‘elf_close’, + inlined from ‘elf_close’ at elf.c:53:6, + inlined from ‘elf_find_func_offset_from_file’ at elf.c:384:2: +elf.c:57:9: warning: ‘elf_fd.elf’ may be used uninitialized [-Wmaybe-uninitialized] + 57 | elf_end(elf_fd->elf); + | ^~~~~~~~~~~~~~~~~~~~ +elf.c: In function ‘elf_find_func_offset_from_file’: +elf.c:377:23: note: ‘elf_fd.elf’ was declared here + 377 | struct elf_fd elf_fd; + | ^~~~~~ +In function ‘elf_close’, + inlined from ‘elf_close’ at elf.c:53:6, + inlined from ‘elf_find_func_offset_from_file’ at elf.c:384:2: +elf.c:58:9: warning: ‘elf_fd.fd’ may be used uninitialized [-Wmaybe-uninitialized] + 58 | close(elf_fd->fd); + | ^~~~~~~~~~~~~~~~~ +elf.c: In function ‘elf_find_func_offset_from_file’: +elf.c:377:23: note: ‘elf_fd.fd’ was declared here + 377 | struct elf_fd elf_fd; + | ^~~~~~ +``` + +In reality, our use is fine, it's just that GCC doesn't model errno +here (see linked GCC bug). Suppress -Wmaybe-uninitialized accordingly +by initializing elf_fd.fd to -1 and elf_fd.elf to NULL. + +I've done this in two other functions as well given it could easily +occur there too (same access/use pattern). + +Signed-off-by: Sam James +Signed-off-by: Andrii Nakryiko +Link: https://gcc.gnu.org/PR114952 +Link: https://lore.kernel.org/bpf/14ec488a1cac02794c2fa2b83ae0cef1bce2cb36.1723578546.git.sam@gentoo.org +--- + tools/lib/bpf/elf.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/tools/lib/bpf/elf.c ++++ b/tools/lib/bpf/elf.c +@@ -16,6 +16,9 @@ int elf_open(const char *binary_path, st + int fd, ret; + Elf *elf; + ++ elf_fd->elf = NULL; ++ elf_fd->fd = -1; ++ + if (elf_version(EV_CURRENT) == EV_NONE) { + pr_warn("elf: failed to init libelf for %s\n", binary_path); + return -LIBBPF_ERRNO__LIBELF; From e23b37b2d9a2e766b1ad151f59a04eb68b6a3341 Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Thu, 5 Dec 2024 22:28:45 +0200 Subject: [PATCH 007/149] busybox: Save shell history into /tmp Enable the busybox feature to save shell command history. (.apk size increase 0.5 kB) To prevent flash wear, * save history only at the exit from a shell session, and * set /tmp as the default location for the history file. The history is kept on ramdisk until a reboot, when the history is then lost. If the user wants to save history onto flash, he can change the location definition in /etc/profile.d/busybox-history-file.sh Signed-off-by: Hannu Nyman Link: https://github.com/openwrt/openwrt/pull/17179 Signed-off-by: Hauke Mehrtens --- package/utils/busybox/Config-defaults.in | 4 ++-- package/utils/busybox/Makefile | 4 +++- package/utils/busybox/files/busybox-history-file.sh | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 package/utils/busybox/files/busybox-history-file.sh diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in index 26d3e642ce7..820c498eead 100644 --- a/package/utils/busybox/Config-defaults.in +++ b/package/utils/busybox/Config-defaults.in @@ -255,10 +255,10 @@ config BUSYBOX_DEFAULT_FEATURE_EDITING_HISTORY default 256 config BUSYBOX_DEFAULT_FEATURE_EDITING_SAVEHISTORY bool - default n + default y config BUSYBOX_DEFAULT_FEATURE_EDITING_SAVE_ON_EXIT bool - default n + default y config BUSYBOX_DEFAULT_FEATURE_REVERSE_SEARCH bool default n diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index 4f155b7a250..c2fc609610e 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:=2 +PKG_RELEASE:=3 PKG_FLAGS:=essential PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 @@ -143,6 +143,8 @@ define Package/busybox/install $(INSTALL_DIR) $(1)/etc/init.d $(INSTALL_DIR) $(1)/usr/sbin $(CP) $(PKG_INSTALL_DIR)/* $(1)/ + $(INSTALL_DIR) $(1)/etc/profile.d + $(INSTALL_BIN) ./files/busybox-history-file.sh $(1)/etc/profile.d ifneq ($(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_FEATURE_SYSLOG)$(CONFIG_BUSYBOX_$(BUSYBOX_SYM)_FEATURE_SYSLOGD_CFG),) touch $(1)/etc/syslog.conf endif diff --git a/package/utils/busybox/files/busybox-history-file.sh b/package/utils/busybox/files/busybox-history-file.sh new file mode 100644 index 00000000000..f2860096272 --- /dev/null +++ b/package/utils/busybox/files/busybox-history-file.sh @@ -0,0 +1,2 @@ +export HISTFILE=/tmp/.busybox_ash_history + From d087a79b7b03fe93a221fd6246ce437c5c5325c3 Mon Sep 17 00:00:00 2001 From: Maxim Anisimov Date: Wed, 13 Nov 2024 17:17:17 +0300 Subject: [PATCH 008/149] mediatek/filogic: add Keenetic KN-3811 support Specification: * Mediatek MT7981BA * 256 MB SPI-NAND * 512 MB DDR4 RAM * MT7976CN DBDC AX Wi-Fi * MediaTek MT7531AE (3x LAN Gigabit ports) + Internal Gbe Phy (1x WAN Gigabit port) * 4x LED (power, internet, fn, wifi) * 3x buttons (wps, fn, reset) * 1x USB 3.0 port Serial Interface: * 3 Pins GND, RX, TX * Settings: 115200, 8N1 Notes: * The device supports dual boot mode * Fn led reassigned to wlan 2.4 Flash instruction: The only way to flash OpenWrt image is to use tftp recovery mode in U-Boot: 1. Configure PC with static IP 192.168.1.2/24 and tftp server. 2. Rename "openwrt-mediatek-filogic-keenetic_kn-3811-squashfs-factory.bin" to "KN-3811_recovery.bin" and place it in tftp server directory. 3. Connect PC with ethernet port, press the reset button, power up the device and keep button pressed until status led start blinking. 4. Device will download file from server, write it to flash and reboot. Signed-off-by: Maxim Anisimov Link: https://github.com/openwrt/openwrt/pull/17135 Signed-off-by: Hauke Mehrtens --- .../mediatek/dts/mt7981b-keenetic-kn-3811.dts | 368 ++++++++++++++++++ .../filogic/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 1 + target/linux/mediatek/image/filogic.mk | 20 + 4 files changed, 390 insertions(+) create mode 100644 target/linux/mediatek/dts/mt7981b-keenetic-kn-3811.dts diff --git a/target/linux/mediatek/dts/mt7981b-keenetic-kn-3811.dts b/target/linux/mediatek/dts/mt7981b-keenetic-kn-3811.dts new file mode 100644 index 00000000000..87043ec907a --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-keenetic-kn-3811.dts @@ -0,0 +1,368 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT + +/dts-v1/; + +#include "mt7981.dtsi" + +/ { + model = "Keenetic KN-3811"; + compatible = "keenetic,kn-3811", "mediatek,mt7981"; + + aliases { + label-mac-device = &gmac0; + led-boot = &power_led; + led-failsafe = &power_led; + led-running = &power_led; + led-upgrade = &power_led; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + button-fn { + label = "fn"; + linux,code = ; + gpios = <&pio 5 GPIO_ACTIVE_LOW>; + }; + + button-reset { + label = "reset"; + linux,code = ; + gpios = <&pio 24 GPIO_ACTIVE_LOW>; + }; + + button-wps { + label = "wps"; + linux,code = ; + gpios = <&pio 29 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + /* fn led reassigned to wlan 2.4 */ + led-0 { + color = ; + function = LED_FUNCTION_WLAN_2GHZ; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + power_led: led-1 { + color = ; + function = LED_FUNCTION_POWER; + gpios = <&pio 11 GPIO_ACTIVE_HIGH>; + }; + + led-2 { + color = ; + function = LED_FUNCTION_WAN; + gpios = <&pio 12 GPIO_ACTIVE_LOW>; + }; + + led-3 { + color = ; + function = LED_FUNCTION_WLAN_5GHZ; + gpios = <&pio 34 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; + + usb_vbus: regulator-usb-vbus { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpios = <&pio 6 GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-boot-on; + }; + + virtual_flash { + compatible = "mtd-concat"; + devices = <&firmware1 &storage1 &firmware2 &storage2>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "kernel"; + reg = <0x0 0x600000>; + }; + + partition@400000 { + label = "ubi"; + reg = <0x600000 0x0>; + }; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_factory_4 0>; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "gmii"; + phy-handle = <&int_gbe_phy>; + label = "wan"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_factory_a 0>; + }; +}; + +&mdio_bus { + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <0x1f>; + reset-gpios = <&pio 22 GPIO_ACTIVE_HIGH>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + }; + + port@1 { + reg = <1>; + label = "lan2"; + }; + + port@2 { + reg = <2>; + label = "lan3"; + }; + + port@6 { + reg = <6>; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&pio { + spi0_flash_pins: spi0-pins { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + + conf-pu { + pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; + drive-strength = ; + bias-pull-up = ; + }; + + conf-pd { + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; + drive-strength = ; + bias-pull-down = ; + }; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + /* Winbond W25N02KV (256M) */ + spi_nand@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-nand"; + reg = <0>; + + spi-max-frequency = <52000000>; + spi-tx-buswidth = <4>; + spi-rx-buswidth = <4>; + + spi-cal-enable; + spi-cal-mode = "read-data"; + spi-cal-datalen = <7>; + spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4e 0x41 0x4e 0x44>; + spi-cal-addrlen = <5>; + spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>; + + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* bl2 */ + partition@0 { + label = "preloader"; + reg = <0x0 0x80000>; + read-only; + }; + + /* fip */ + partition@80000 { + label = "u-boot"; + reg = <0x80000 0x200000>; + read-only; + }; + + partition@280000 { + label = "u-config"; + reg = <0x280000 0x80000>; + read-only; + }; + + partition@300000 { + label = "rf-eeprom"; + reg = <0x300000 0x200000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1000>; + }; + + /* lan mac */ + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + + /* wan mac */ + macaddr_factory_a: macaddr@a { + compatible = "mac-base"; + reg = <0xa 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + firmware1: partition@500000 { + label = "firmware_1"; + reg = <0x500000 0x3a00000>; + }; + + partition@3f00000 { + label = "config_1"; + reg = <0x3f00000 0x80000>; + read-only; + }; + + partition@3f80000 { + label = "dump"; + reg = <0x3f80000 0x80000>; + read-only; + }; + + storage1: partition@4000000 { + label = "storage_a"; + reg = <0x4000000 0x3800000>; + }; + + partition@7800000 { + label = "u-state"; + reg = <0x7800000 0x20000>; + read-only; + }; + + partition@7a80000 { + label = "u-config_res"; + reg = <0x7a80000 0x80000>; + read-only; + }; + + partition@7b00000 { + label = "rf-eeprom_res"; + reg = <0x7b00000 0x200000>; + read-only; + }; + + firmware2: partition@7d00000 { + label = "firmware_2"; + reg = <0x7d00000 0x3a00000>; + }; + + partition@b700000 { + label = "config_2"; + reg = <0xb700000 0x80000>; + read-only; + }; + + storage2: partition@b780000 { + label = "storage_b"; + reg = <0xb780000 0x3880000>; + }; + }; + }; +}; + +&wifi { + nvmem-cell-names = "eeprom"; + nvmem-cells = <&eeprom_factory_0>; + status = "okay"; +}; + +&usb_phy { + status = "okay"; +}; + +&xhci { + status = "okay"; + vbus-supply = <&usb_vbus>; +}; 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 ba785644022..78483442d76 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 @@ -33,6 +33,7 @@ mediatek_setup_interfaces() confiabits,mt7981|\ cudy,wr3000-v1|\ jcg,q30-pro|\ + keenetic,kn-3811|\ qihoo,360t7|\ routerich,ax3000|\ routerich,ax3000-ubootmod) diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index a3b76712232..fb67323e7b0 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -115,6 +115,7 @@ case "$board" in jdcloud,re-cp-03) [ "$PHYNBR" = "1" ] && mmc_get_mac_binary factory 0xa > /sys${DEVPATH}/macaddress ;; + keenetic,kn-3811|\ keenetic,kn-3911) [ "$PHYNBR" = "1" ] && \ macaddr_setbit_la "$(mtd_get_mac_binary rf-eeprom 0x4)" > /sys${DEVPATH}/macaddress diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 5498922f6ed..c1b38403a65 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -887,6 +887,26 @@ define Device/jdcloud_re-cp-03 endef TARGET_DEVICES += jdcloud_re-cp-03 +define Device/keenetic_kn-3811 + DEVICE_VENDOR := Keenetic + DEVICE_MODEL := KN-3811 + DEVICE_DTS := mt7981b-keenetic-kn-3811 + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + KERNEL_SIZE := 6144k + IMAGE_SIZE := 233984k + KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | \ + append-squashfs4-fakeroot + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | \ + append-ubi | check-size | zyimage -d 0x803811 -v "KN-3811" + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += keenetic_kn-3811 + define Device/keenetic_kn-3911 DEVICE_VENDOR := Keenetic DEVICE_MODEL := KN-3911 From 477c8a5101f0a6215201d66be25cf11e9803fe2b Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 16 Jun 2024 12:48:40 -0700 Subject: [PATCH 009/149] ath79: gl-e750: use nvmem for mac addresses This is a simple conversion to dts. 68ac3f2cddab states that the 5ghz wifi address is calculated from ART 0 + 2. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/17066 Signed-off-by: Hauke Mehrtens --- target/linux/ath79/dts/qca9531_glinet_gl-e750.dts | 11 ++++++++++- .../etc/hotplug.d/ieee80211/10-fix-wifi-mac | 5 ----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts index ba129155703..e4b5f1ea6c3 100644 --- a/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts +++ b/target/linux/ath79/dts/qca9531_glinet_gl-e750.dts @@ -45,6 +45,13 @@ &pcie0 { status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&macaddr_art_0 2>; + nvmem-cell-names = "mac-address"; + }; }; &usb0 { @@ -90,7 +97,9 @@ #size-cells = <1>; macaddr_art_0: macaddr@0 { + compatible = "mac-base"; reg = <0x0 0x6>; + #nvmem-cell-cells = <1>; }; cal_art_1000: calibration@1000 { @@ -134,7 +143,7 @@ phy-handle = <&swphy4>; - nvmem-cells = <&macaddr_art_0>; + nvmem-cells = <&macaddr_art_0 0>; nvmem-cell-names = "mac-address"; }; diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac b/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac index 5a933df501a..989791b64fc 100644 --- a/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac +++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac @@ -10,11 +10,6 @@ PHYNBR=${DEVPATH##*/phy} board=$(board_name) case $board in - glinet,gl-e750) - # Set mac address for 5g device - [ "$PHYNBR" -eq 0 ] && \ - macaddr_add $(mtd_get_mac_binary art 0x0) 2 > /sys${DEVPATH}/macaddress - ;; zyxel,emg2926-q10a|\ zyxel,nbg6716) ethaddr=$(mtd_get_mac_ascii u-boot-env ethaddr) From 3d8d81883fb2e607590bcb523587e37e1485b3b8 Mon Sep 17 00:00:00 2001 From: Eric Long Date: Mon, 25 Nov 2024 21:26:47 +0800 Subject: [PATCH 010/149] bpftool: turn off libbfd feature in host build libbfd feature is not used when building eBPF program, and it makes bpftool fail to build in a clean environment, since binutils in toolchain have libbfd disabled. Signed-off-by: Eric Long Link: https://github.com/openwrt/openwrt/pull/17073 Signed-off-by: Robert Marko --- package/network/utils/bpftool/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/utils/bpftool/Makefile b/package/network/utils/bpftool/Makefile index f2726d18969..c6cc92e18d1 100644 --- a/package/network/utils/bpftool/Makefile +++ b/package/network/utils/bpftool/Makefile @@ -97,7 +97,7 @@ HOST_MAKE_FLAGS += \ $(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='') \ check_feat=0 \ feature-clang-bpf-co-re=0 \ - feature-libbfd=1 \ + feature-libbfd=0 \ feature-llvm=0 \ feature-libcap=0 \ feature-disassembler-four-args=1 \ From 59dd9cddf9e72d1f9b4ff7e01ae32d2fa99259d9 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 9 Dec 2024 19:19:46 +0100 Subject: [PATCH 011/149] hostapd: fix processing mbssid config option Do not strip the first character from the field name Signed-off-by: Felix Fietkau --- package/network/services/hostapd/files/hostapd.uc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package/network/services/hostapd/files/hostapd.uc b/package/network/services/hostapd/files/hostapd.uc index c1db91e4d4f..76a3d706f7f 100644 --- a/package/network/services/hostapd/files/hostapd.uc +++ b/package/network/services/hostapd/files/hostapd.uc @@ -746,9 +746,10 @@ function iface_load_config(phy, radio, filename) continue; } - if (val[0] == "#num_global_macaddr" || - val[0] == "mbssid") + if (val[0] == "#num_global_macaddr") config[substr(val[0], 1)] = int(val[1]); + else if (val[0] == "mbssid") + config[val[0]] = int(val[1]); push(config.radio.data, line); } From a498a84393a80de9f828b8465906761896ca4940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Niesner?= Date: Sat, 7 Dec 2024 17:55:29 +0100 Subject: [PATCH 012/149] mediatek: filogic: prevent faulty mac address assignment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The vendor U-Boot on the Cudy WR3000 assign random mac addresses on boot and set the 'local-mac-address' property which prevents Openwrt from assigning the correct address from evmem. This patch removes the alias for ethernet0 so that U-Boot doesn't add the property. Related to: a55ab9e1343e ("mediatek: filogic: prevent faulty mac address assignment") Fixes: https://github.com/openwrt/openwrt/issues/15587 Signed-off-by: Ondřej Niesner Link: https://github.com/openwrt/openwrt/pull/17201 Signed-off-by: Hauke Mehrtens --- target/linux/mediatek/dts/mt7981b-cudy-wr3000-v1.dts | 1 - 1 file changed, 1 deletion(-) diff --git a/target/linux/mediatek/dts/mt7981b-cudy-wr3000-v1.dts b/target/linux/mediatek/dts/mt7981b-cudy-wr3000-v1.dts index 1ded8b5a687..8af8ef401f4 100644 --- a/target/linux/mediatek/dts/mt7981b-cudy-wr3000-v1.dts +++ b/target/linux/mediatek/dts/mt7981b-cudy-wr3000-v1.dts @@ -11,7 +11,6 @@ compatible = "cudy,wr3000-v1", "mediatek,mt7981"; aliases { - ethernet0 = &gmac0; label-mac-device = &gmac0; led-boot = &led_status; led-failsafe = &led_status; From f8b93e2d12ef01fc565178c71c39470da798155a Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 8 Dec 2024 16:18:52 +0100 Subject: [PATCH 013/149] mediatek: filogic: Migrate wifi configuration device paths The device path to the devices changed. Migrate the wifi configurations from the old path to the new one. This is needed to migrate Wireless configurations from OpenWrt 23.05 to OpenWrt 24.10. This script is based on these two files: target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate Fixes: 0ef927472148 ("mediatek: filogic: move mt7981 on-SoC blocks to "soc" node in DT") Fixes: https://github.com/openwrt/openwrt/issues/17174 Link: https://github.com/openwrt/openwrt/pull/17210 Signed-off-by: Hauke Mehrtens --- .../etc/hotplug.d/ieee80211/05-wifi-migrate | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate new file mode 100644 index 00000000000..ae3bc643cd5 --- /dev/null +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/05-wifi-migrate @@ -0,0 +1,63 @@ +#!/bin/sh + +# This must run before 10-wifi-detect + + +[ "${ACTION}" = "add" ] || return + + +. /lib/functions.sh + + +check_radio() +{ + local cfg="$1" to="$2" + + config_get path "$cfg" path + + [ "$path" = "$to" ] && PATH_EXISTS=true +} + +do_migrate_radio() +{ + local cfg="$1" from="$2" to="$3" + + config_get path "$cfg" path + + [ "$path" = "$from" ] || return + + uci set "wireless.${cfg}.path=${to}" + WIRELESS_CHANGED=true + + logger -t wifi-migrate "Updated path of wireless.${cfg} from '${from}' to '${to}'" +} + +migrate_radio() +{ + local from="$1" to="$2" + + config_load wireless + + # Check if there is already a section with the target path: In this case, the system + # was already upgraded to a version without this migration script before; better bail out, + # as we can't be sure we don't break more than we fix. + PATH_EXISTS=false + config_foreach check_radio wifi-device "$to" + $PATH_EXISTS && return + + config_foreach do_migrate_radio wifi-device "$from" "$to" +} + + +WIRELESS_CHANGED=false + +case "$(board_name)" in +*) + migrate_radio 'platform/18000000.wifi' 'platform/soc/18000000.wifi' + migrate_radio 'platform/18000000.wifi+1' 'platform/soc/18000000.wifi+1' + ;; +esac + +$WIRELESS_CHANGED && uci commit wireless + +exit 0 From ff5f77ecdd218a9451bd6c531be86c6335fadd7a Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Sat, 7 Dec 2024 17:32:21 +0100 Subject: [PATCH 014/149] iproute2: update to 6.12.0 Release Notes: https://lore.kernel.org/netdev/20241119092743.6a1bdcb7@hermes.local/T/ Allows us to drop 2 upstreamed patches: package/network/utils/iproute2/patches/010-bridge-mst-fix-a-musl-build-issue.patch package/network/utils/iproute2/patches/011-bridge-mst-fix-a-further-musl-build-issue.patch Signed-off-by: Robert Marko Link: https://github.com/openwrt/openwrt/pull/17206 Signed-off-by: Robert Marko --- package/network/utils/iproute2/Makefile | 4 +- ...10-bridge-mst-fix-a-musl-build-issue.patch | 68 ------------------- ...e-mst-fix-a-further-musl-build-issue.patch | 51 -------------- 3 files changed, 2 insertions(+), 121 deletions(-) delete mode 100644 package/network/utils/iproute2/patches/010-bridge-mst-fix-a-musl-build-issue.patch delete mode 100644 package/network/utils/iproute2/patches/011-bridge-mst-fix-a-further-musl-build-issue.patch diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile index 04a4df24c99..73710ae4ef5 100644 --- a/package/network/utils/iproute2/Makefile +++ b/package/network/utils/iproute2/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=iproute2 -PKG_VERSION:=6.11.0 +PKG_VERSION:=6.12.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2 -PKG_HASH:=1f795398a04aeaacd06a8f6ace2cfd913c33fa5953ca99daae83bb5c534611c3 +PKG_HASH:=bbd141ef7b5d0127cc2152843ba61f274dc32814fa3e0f13e7d07a080bef53d9 PKG_BUILD_PARALLEL:=1 PKG_BUILD_DEPENDS:=iptables PKG_LICENSE:=GPL-2.0 diff --git a/package/network/utils/iproute2/patches/010-bridge-mst-fix-a-musl-build-issue.patch b/package/network/utils/iproute2/patches/010-bridge-mst-fix-a-musl-build-issue.patch deleted file mode 100644 index 1630415eb51..00000000000 --- a/package/network/utils/iproute2/patches/010-bridge-mst-fix-a-musl-build-issue.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 6a77abab92516e65f07f8657fc4e384c4541ce0e Mon Sep 17 00:00:00 2001 -From: Dario Binacchi -Date: Sun, 22 Sep 2024 16:50:10 +0200 -Subject: bridge: mst: fix a musl build issue - -This patch fixes a compilation error raised by the bump to version 6.11.0 -in Buildroot using musl as the C library for the cross-compilation -toolchain. - -After setting the CFLGAS - -ifeq ($(BR2_TOOLCHAIN_USES_MUSL),y) -IPROUTE2_CFLAGS += -D__UAPI_DEF_IN6_ADDR=0 -D__UAPI_DEF_SOCKADDR_IN6=0 \ - -D__UAPI_DEF_IPV6_MREQ=0 -endif - -to fix the following errors: - -In file included from ../../../host/mips64-buildroot-linux-musl/sysroot/usr/include/arpa/inet.h:9, - from ../include/libnetlink.h:14, - from mst.c:10: -../../../host/mips64-buildroot-linux-musl/sysroot/usr/include/netinet/in.h:23:8: error: redefinition of 'struct in6_addr' - 23 | struct in6_addr { - | ^~~~~~~~ -In file included from ../include/uapi/linux/if_bridge.h:19, - from mst.c:7: -../include/uapi/linux/in6.h:33:8: note: originally defined here - 33 | struct in6_addr { - | ^~~~~~~~ -../../../host/mips64-buildroot-linux-musl/sysroot/usr/include/netinet/in.h:34:8: error: redefinition of 'struct sockaddr_in6' - 34 | struct sockaddr_in6 { - | ^~~~~~~~~~~~ -../include/uapi/linux/in6.h:50:8: note: originally defined here - 50 | struct sockaddr_in6 { - | ^~~~~~~~~~~~ -../../../host/mips64-buildroot-linux-musl/sysroot/usr/include/netinet/in.h:42:8: error: redefinition of 'struct ipv6_mreq' - 42 | struct ipv6_mreq { - | ^~~~~~~~~ -../include/uapi/linux/in6.h:60:8: note: originally defined here - 60 | struct ipv6_mreq { - -I got this further errors - -../include/uapi/linux/in6.h:72:25: error: field 'flr_dst' has incomplete type - 72 | struct in6_addr flr_dst; - | ^~~~~~~ -../include/uapi/linux/if_bridge.h:711:41: error: field 'ip6' has incomplete type - 711 | struct in6_addr ip6; - | ^~~ - -fixed by including the netinet/in.h header. - -Signed-off-by: Dario Binacchi -Signed-off-by: Stephen Hemminger ---- - bridge/mst.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/bridge/mst.c -+++ b/bridge/mst.c -@@ -4,6 +4,7 @@ - */ - - #include -+#include - #include - #include - diff --git a/package/network/utils/iproute2/patches/011-bridge-mst-fix-a-further-musl-build-issue.patch b/package/network/utils/iproute2/patches/011-bridge-mst-fix-a-further-musl-build-issue.patch deleted file mode 100644 index 1bdab398f73..00000000000 --- a/package/network/utils/iproute2/patches/011-bridge-mst-fix-a-further-musl-build-issue.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 043ef90e2fa94397eb5c85330889ca4146a6d58a Mon Sep 17 00:00:00 2001 -From: Dario Binacchi -Date: Sun, 22 Sep 2024 16:50:11 +0200 -Subject: bridge: mst: fix a further musl build issue - -This patch fixes the following build errors: - -In file included from mst.c:11: -../include/json_print.h:80:30: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration - 80 | _PRINT_FUNC(tv, const struct timeval *) - | ^~~~~~~ -../include/json_print.h:50:37: note: in definition of macro '_PRINT_FUNC' - 50 | type value); \ - | ^~~~ -../include/json_print.h:80:30: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration - 80 | _PRINT_FUNC(tv, const struct timeval *) - | ^~~~~~~ -../include/json_print.h:55:45: note: in definition of macro '_PRINT_FUNC' - 55 | type value) \ - | ^~~~ -../include/json_print.h: In function 'print_tv': -../include/json_print.h:58:48: error: passing argument 5 of 'print_color_tv' from incompatible pointer type [-Wincompatible-pointer-types] - 58 | value); \ - | ^~~~~ - | | - | const struct timeval * -../include/json_print.h:80:1: note: in expansion of macro '_PRINT_FUNC' - 80 | _PRINT_FUNC(tv, const struct timeval *) - | ^~~~~~~~~~~ -../include/json_print.h:50:42: note: expected 'const struct timeval *' but argument is of type 'const struct timeval *' - 50 | type value); \ - | ^ -../include/json_print.h:80:1: note: in expansion of macro '_PRINT_FUNC' - 80 | _PRINT_FUNC(tv, const struct timeval *) - -Signed-off-by: Dario Binacchi -Signed-off-by: Stephen Hemminger ---- - bridge/mst.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/bridge/mst.c -+++ b/bridge/mst.c -@@ -4,6 +4,7 @@ - */ - - #include -+#include - #include - #include - #include From 4234d5ec45b72cb8d53713fab40efc68bedf546e Mon Sep 17 00:00:00 2001 From: Jack Sun Date: Mon, 9 Dec 2024 16:43:49 +0800 Subject: [PATCH 015/149] tools/cmake: update to 3.31.2 Release notes: https://cmake.org/cmake/help/latest/release/3.31.html Refresh patches: - 120-curl-fix-libressl-linking.patch - 130-bootstrap_parallel_make_flag.patch - 150-zstd-libarchive.patch - 160-disable_xcode_generator.patch Signed-off-by: Jack Sun Link: https://github.com/openwrt/openwrt/pull/17056 Signed-off-by: Hauke Mehrtens --- tools/cmake/Makefile | 4 ++-- tools/cmake/patches/120-curl-fix-libressl-linking.patch | 7 ++++--- tools/cmake/patches/130-bootstrap_parallel_make_flag.patch | 2 +- tools/cmake/patches/150-zstd-libarchive.patch | 2 +- tools/cmake/patches/160-disable_xcode_generator.patch | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tools/cmake/Makefile b/tools/cmake/Makefile index 152d295cb3d..a471d53a8e6 100644 --- a/tools/cmake/Makefile +++ b/tools/cmake/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cmake -PKG_VERSION:=3.30.5 +PKG_VERSION:=3.31.2 PKG_VERSION_MAJOR:=$(word 1,$(subst ., ,$(PKG_VERSION))).$(word 2,$(subst ., ,$(PKG_VERSION))) PKG_RELEASE:=1 PKG_CPE_ID:=cpe:/a:kitware:cmake @@ -15,7 +15,7 @@ PKG_CPE_ID:=cpe:/a:kitware:cmake PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/Kitware/CMake/releases/download/v$(PKG_VERSION)/ \ https://cmake.org/files/v$(PKG_VERSION_MAJOR)/ -PKG_HASH:=9f55e1a40508f2f29b7e065fa08c29f82c402fa0402da839fffe64a25755a86d +PKG_HASH:=42abb3f48f37dbd739cdfeb19d3712db0c5935ed5c2aef6c340f9ae9114238a2 HOST_BUILD_PARALLEL:=1 HOST_CONFIGURE_PARALLEL:=1 diff --git a/tools/cmake/patches/120-curl-fix-libressl-linking.patch b/tools/cmake/patches/120-curl-fix-libressl-linking.patch index 19217343d1c..7fda7c59a09 100644 --- a/tools/cmake/patches/120-curl-fix-libressl-linking.patch +++ b/tools/cmake/patches/120-curl-fix-libressl-linking.patch @@ -20,10 +20,11 @@ Signed-off-by: Jo-Philipp Wich --- --- a/Utilities/cmcurl/CMakeLists.txt +++ b/Utilities/cmcurl/CMakeLists.txt -@@ -648,6 +648,14 @@ if(CURL_USE_OPENSSL) +@@ -775,7 +775,14 @@ if(CURL_USE_OPENSSL) endif() - set(SSL_ENABLED ON) + set(_ssl_enabled ON) set(USE_OPENSSL ON) +- + check_library_exists("rt" clock_gettime "" HAVE_LIBRT) + if(HAVE_LIBRT) + list(APPEND OPENSSL_LIBRARIES rt) @@ -34,4 +35,4 @@ Signed-off-by: Jo-Philipp Wich + endif() list(APPEND CURL_LIBS ${OPENSSL_LIBRARIES}) include_directories(${OPENSSL_INCLUDE_DIR}) - + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "openssl") diff --git a/tools/cmake/patches/130-bootstrap_parallel_make_flag.patch b/tools/cmake/patches/130-bootstrap_parallel_make_flag.patch index a2a873fcea9..2409ba666f2 100644 --- a/tools/cmake/patches/130-bootstrap_parallel_make_flag.patch +++ b/tools/cmake/patches/130-bootstrap_parallel_make_flag.patch @@ -1,6 +1,6 @@ --- a/bootstrap +++ b/bootstrap -@@ -1509,7 +1509,10 @@ int main(){ printf("1%c", (char)0x0a); r +@@ -1514,7 +1514,10 @@ int main(){ printf("1%c", (char)0x0a); r ' > "test.c" cmake_original_make_flags="${cmake_make_flags}" if test "x${cmake_parallel_make}" != "x"; then diff --git a/tools/cmake/patches/150-zstd-libarchive.patch b/tools/cmake/patches/150-zstd-libarchive.patch index a6f8e35e6bd..429ef80f54a 100644 --- a/tools/cmake/patches/150-zstd-libarchive.patch +++ b/tools/cmake/patches/150-zstd-libarchive.patch @@ -1,6 +1,6 @@ --- a/Utilities/cmlibarchive/CMakeLists.txt +++ b/Utilities/cmlibarchive/CMakeLists.txt -@@ -656,7 +656,7 @@ IF(ENABLE_ZSTD) +@@ -680,7 +680,7 @@ IF(ENABLE_ZSTD) SET(ZSTD_FIND_QUIETLY TRUE) ENDIF (ZSTD_INCLUDE_DIR) diff --git a/tools/cmake/patches/160-disable_xcode_generator.patch b/tools/cmake/patches/160-disable_xcode_generator.patch index 0e29dedd9b4..f10981cd32e 100644 --- a/tools/cmake/patches/160-disable_xcode_generator.patch +++ b/tools/cmake/patches/160-disable_xcode_generator.patch @@ -1,6 +1,6 @@ --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt -@@ -858,7 +858,7 @@ if(CMake_USE_XCOFF_PARSER) +@@ -888,7 +888,7 @@ if(CMake_USE_XCOFF_PARSER) endif() # Xcode only works on Apple @@ -11,7 +11,7 @@ PRIVATE --- a/Source/cmake.cxx +++ b/Source/cmake.cxx -@@ -134,7 +134,7 @@ +@@ -133,7 +133,7 @@ # include "cmGlobalGhsMultiGenerator.h" #endif From 0d21cc8a92ea3b2cc94efefd60eae968a4296543 Mon Sep 17 00:00:00 2001 From: Isaac de Wolff Date: Sun, 8 Dec 2024 13:52:40 +0100 Subject: [PATCH 016/149] lantiq: grow kernel partition Zyxel P-2812HNU-F1 Change partition table in dts file. Change DEVICE_COMPAT_VERSION Enable automatic build. To take advantage of the bigger kernel partition, the uboot environment has to be changed: setenv nboot 'nand read 0x81000000 0x60000 0x500000; bootm 0x81000000' setenv bootcmd 'run nboot' saveenv Of course you need a u-boot capable of handling this. The u-boot discussed in this forum thread: https://forum.openwrt.org/t/zyxel-p2812hnu-f1-u-boot/100281 should be able to handle kernels up to an uncompressed size of 16MiB. Signed-off-by: Isaac de Wolff Link: https://github.com/openwrt/openwrt/pull/17209 Signed-off-by: Hauke Mehrtens --- .../arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts | 6 +++--- target/linux/lantiq/image/vr9.mk | 7 ++++--- .../lantiq/xrx200/base-files/etc/board.d/05_compat-version | 4 ++++ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts index 247b811b4f9..58a34d6e27c 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_zyxel_p-2812hnu-f1.dts @@ -47,11 +47,11 @@ }; partition@60000 { label = "kernel"; - reg = <0x60000 0x300000>; + reg = <0x60000 0x500000>; }; - partition@360000 { + partition@560000 { label = "ubi"; - reg = <0x360000 0x7ca0000>; + reg = <0x560000 0x7aa0000>; }; }; }; diff --git a/target/linux/lantiq/image/vr9.mk b/target/linux/lantiq/image/vr9.mk index d4bded9cae7..fe5b5a6bb50 100644 --- a/target/linux/lantiq/image/vr9.mk +++ b/target/linux/lantiq/image/vr9.mk @@ -368,16 +368,17 @@ endef TARGET_DEVICES += netgear_dm200 define Device/zyxel_p-2812hnu-f1 - $(Device/dsa-migration) $(Device/NAND) + DEVICE_COMPAT_VERSION := 2.0 + DEVICE_COMPAT_MESSAGE := kernel and ubi partitions had to be resized. \ + Upgrade manually using initramfs, and change u-boot environment to load 5MiB for uImage. DEVICE_VENDOR := Zyxel DEVICE_MODEL := P-2812HNU DEVICE_VARIANT := F1 BOARD_NAME := P2812HNUF1 DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-mbedtls kmod-usb-dwc2 kmod-usb-ledtrig-usbport - KERNEL_SIZE := 3072k + KERNEL_SIZE := 5120k SUPPORTED_DEVICES += P2812HNUF1 - DEFAULT := n endef TARGET_DEVICES += zyxel_p-2812hnu-f1 diff --git a/target/linux/lantiq/xrx200/base-files/etc/board.d/05_compat-version b/target/linux/lantiq/xrx200/base-files/etc/board.d/05_compat-version index 45bef9385bd..5690d848744 100644 --- a/target/linux/lantiq/xrx200/base-files/etc/board.d/05_compat-version +++ b/target/linux/lantiq/xrx200/base-files/etc/board.d/05_compat-version @@ -8,6 +8,10 @@ board_config_update case "$(board_name)" in + zyxel,p-2812hnu-f1) + ucidef_set_compat_version "2.0" + ;; + *) ucidef_set_compat_version "1.1" ;; From 5bc82dede009520be689d9127dfeb841e3f8afaa Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 11 Dec 2024 11:54:34 +0100 Subject: [PATCH 017/149] wifi-scripts: ucode: typo fix Signed-off-by: John Crispin --- .../wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc index 3c15d87d003..69805a4b6f1 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc @@ -101,7 +101,7 @@ export function wpa_key_mgmt(config) { if (config.wpa >= 2 && config.ieee80211r) append_value(config, 'wpa_key_mgmt', 'FT-EAP'); if (config.ieee80211w) - append_value(config, 'wpa_key_mgmt', 'WPA-EAP--SHA256'); + append_value(config, 'wpa_key_mgmt', 'WPA-EAP-SHA256'); break; case 'eap192': From 4c60fba3d809ff30bad1baae03b90b208b7afe0d Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 11 Dec 2024 11:55:21 +0100 Subject: [PATCH 018/149] wifi-scripts: ucode: only set mbssid on ax and be radios Signed-off-by: John Crispin --- .../wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc index 2f6c4ddc40e..f7eaa2741d4 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc @@ -478,7 +478,7 @@ function generate(config) { device_rates(config); /* beacon */ - append_vars(config, [ 'beacon_int', 'beacon_rate', 'rnr_beacon', 'mbssid' ]); + append_vars(config, [ 'beacon_int', 'beacon_rate', 'rnr_beacon' ]); /* wpa_supplicant co-exist */ append_vars(config, [ 'noscan' ]); @@ -510,6 +510,9 @@ function generate(config) { } device_htmode_append(config); + if (config.ieee80211ax || config.ieee80211be) + append_vars(config, [ 'mbssid' ]); + /* 6G power mode */ if (config.band != '6g') append_vars(config, [ 'reg_power_type' ]); From 3ab1a69339cf2f98046480474be712e18919b6db Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 11 Dec 2024 12:02:18 +0100 Subject: [PATCH 019/149] wifi-scripts: ucode: fix parsing of legacy hwmode option Signed-off-by: John Crispin --- .../wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc | 4 ++-- .../wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc index f7eaa2741d4..c7baa8d85bd 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc @@ -17,8 +17,8 @@ let phy_capabilities = {}; /* make sure old style UCI and hwmode and newer band properties are correctly resolved */ function set_device_defaults(config) { /* validate the hw mode */ - if (config.hwmode in [ '11a', '11b', '11g', '11ad' ]) - config.hw_mode = substr(config.hwmode, 2); + if (config.hw_mode in [ '11a', '11b', '11g', '11ad' ]) + config.hw_mode = substr(config.hw_mode, 2); else if (config.channel > 14) config.hw_mode = 'a'; else diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc index 69805a4b6f1..daddb801ef9 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc @@ -6,7 +6,7 @@ import * as fs from 'fs'; export function parse_encryption(config) { let encryption = split(config.encryption, '+', 2); - config.wpa_pairwise = (config.hwmode == 'ad') ? 'GCMP' : 'CCMP'; + config.wpa_pairwise = (config.hw_mode == 'ad') ? 'GCMP' : 'CCMP'; switch(encryption[1]){ case 'tkip+aes': From 7e854bd9430c3f33dbbceb26390bdf476b27dd2d Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 11 Dec 2024 12:06:55 +0100 Subject: [PATCH 020/149] wifi-scripts: ucode: append global options on STA interfaces Signed-off-by: John Crispin --- .../files-ucode/usr/share/ucode/wifi/supplicant.uc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc index 04d7f216aa6..0519e581777 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc @@ -182,9 +182,11 @@ export function generate(config_list, data, interface) { return 1; } - interface.config.country = data.config.country; + interface.config.country = data.config.country_code; interface.config.beacon_int = data.config.beacon_int; + append_vars(interface.config, [ 'country', 'beacon_int' ]); + setup_sta(data.config, interface.config); let file_name = `/var/run/wpa-supplicant-${interface.config.ifname}.conf`; From 3dd1c476d9b3a2fc46f43bd9c2dff9192f6973aa Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 11 Dec 2024 12:27:38 +0100 Subject: [PATCH 021/149] wifi-scripts: ucode: remove debug code Signed-off-by: John Crispin --- .../wifi-scripts/files-ucode/usr/share/ucode/wifi/common.uc | 2 -- 1 file changed, 2 deletions(-) diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/common.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/common.uc index a4d7eb3ed75..2dc11f50b91 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/common.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/common.uc @@ -109,8 +109,6 @@ export function dump_network(file) { if (file) fs.writefile(file, config_data); - printf('%s\n', config_data); - return config_data; }; From 60f9ec2b227e0523ed0c31584b0ff09762b78740 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 11 Dec 2024 14:42:47 +0100 Subject: [PATCH 022/149] wifi-scripts: ucode: change default behaviour of the vlan_no_bridge option Signed-off-by: John Crispin --- .../wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc index 8db3fc34b31..d6ca3b5dd26 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/ap.uc @@ -285,8 +285,8 @@ function iface_vlan(interface, config, vlans) { if (!config.vlan_possible || !config.dynamic_vlan) return; - - config.vlan_no_bridge = !config.vlan_bridge; + + set_default(config, 'vlan_no_bridge', !config.vlan_bridge); append_vars(config, [ 'dynamic_vlan', 'vlan_naming', 'vlan_bridge', 'vlan_no_bridge', From 2bcc49aef93f454950d425b8de69d230b52cc63c Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 11 Dec 2024 12:32:37 +0100 Subject: [PATCH 023/149] procd: update to latest HEAD e2f05de state: set_stdio: chdir back to / in case of failure 30542c9 inittab: Disable implicit controlling TTY. Signed-off-by: John Crispin --- package/system/procd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index b9099a5ba52..70df481a228 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git -PKG_MIRROR_HASH:=56c5f71da3f68036c63ae59d01992785e74027726da5973297895985cd27c215 -PKG_SOURCE_DATE:=2024-11-13 -PKG_SOURCE_VERSION:=7330fa55c5211eb7b3c675d1c7b8281b69b53553 +PKG_MIRROR_HASH:=2c9eb493618e3a695d329cbf7379a165d4c2366a6e00edc63db3271aa059a294 +PKG_SOURCE_DATE:=2024-12-11 +PKG_SOURCE_VERSION:=e2f05deb93949f447d397e8cd3a341bc8e53cd38 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 From d162fd5ed44af7a33c9aefd72479c1c77f3234e4 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Wed, 11 Dec 2024 15:41:21 +0100 Subject: [PATCH 024/149] umdns: update to latest HEAD 93458ac dns: fix response to TYPE_PTR query 68af311 fix unicast response port and timeout a2b4979 service: announce all services in single dns answer 4537734 display announced services in ubus call umdns browse 0b50c29 display more srv attributes in output of ubus browse function Signed-off-by: John Crispin --- package/network/services/umdns/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/services/umdns/Makefile b/package/network/services/umdns/Makefile index 606dc7274fe..ede371231a3 100644 --- a/package/network/services/umdns/Makefile +++ b/package/network/services/umdns/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_URL=$(PROJECT_GIT)/project/mdnsd.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2024-09-17 -PKG_SOURCE_VERSION:=fbaca4b6f530d4b2f361ee15c266aa19a708242b -PKG_MIRROR_HASH:=e3fc47a019ea54722b8d7dfc8158307a9fb4a9d18945a1a6794616e3b80d5d3b +PKG_SOURCE_DATE:=2024-12-11 +PKG_SOURCE_VERSION:=93458ac90911b84c7279070cd350405d203b702d +PKG_MIRROR_HASH:=6e6fe777d19da744116579be612590e1b41a9ef2c8ff2afeaea942d6b3da49ef PKG_MAINTAINER:=John Crispin PKG_LICENSE:=LGPL-2.1 From d6be0a203910795ab964fd324da1ca54371643b8 Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Sat, 7 Dec 2024 23:16:15 +0800 Subject: [PATCH 025/149] qualcommax: ipq60xx: fixes base-files typo * fix caldata file name * fix bootcount file permission Fixes: 9c55866 ("qualcommax: ipq60xx: add Linksys MR7350 support") Signed-off-by: Chukun Pan Link: https://github.com/openwrt/openwrt/pull/17230 Signed-off-by: Robert Marko --- .../hotplug.d/firmware/{11-ath11-caldata => 11-ath11k-caldata} | 0 target/linux/qualcommax/ipq60xx/base-files/etc/init.d/bootcount | 1 - 2 files changed, 1 deletion(-) rename target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/{11-ath11-caldata => 11-ath11k-caldata} (100%) mode change 100644 => 100755 target/linux/qualcommax/ipq60xx/base-files/etc/init.d/bootcount diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11-caldata b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata similarity index 100% rename from target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11-caldata rename to target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/init.d/bootcount b/target/linux/qualcommax/ipq60xx/base-files/etc/init.d/bootcount old mode 100644 new mode 100755 index e8ff90122b2..fbe245d988b --- a/target/linux/qualcommax/ipq60xx/base-files/etc/init.d/bootcount +++ b/target/linux/qualcommax/ipq60xx/base-files/etc/init.d/bootcount @@ -12,4 +12,3 @@ boot() { ;; esac } - From 8108967e27feeacbf5ea08462358bff7516f96ac Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Sun, 8 Dec 2024 23:26:01 +0800 Subject: [PATCH 026/149] qualcommax: use ath11k_patch_mac for MR7350 Use ath11k_patch_mac and ath11k_set_macflag functions instead of fix_wifi_mac script. Signed-off-by: Chukun Pan Link: https://github.com/openwrt/openwrt/pull/17230 Signed-off-by: Robert Marko --- .../etc/hotplug.d/firmware/11-ath11k-caldata | 8 +++++++- .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 18 ------------------ 2 files changed, 7 insertions(+), 19 deletions(-) delete mode 100644 target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata index a5e843ee7b5..3380cc8653f 100644 --- a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata +++ b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata @@ -15,7 +15,13 @@ case "$FIRMWARE" in cambiumnetworks,xe3-4) caldata_extract "0:ART" 0x1000 0x10000 ;; - linksys,mr7350|\ + linksys,mr7350) + caldata_extract "0:art" 0x1000 0x10000 + addr=$(mtd_get_mac_ascii devinfo hw_mac_addr) + ath11k_patch_mac $(macaddr_add $addr 2) 0 + ath11k_patch_mac $(macaddr_add $addr 1) 1 + ath11k_set_macflag + ;; netgear,wax214) caldata_extract "0:art" 0x1000 0x10000 ;; diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac deleted file mode 100644 index a67cc7262b3..00000000000 --- a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ /dev/null @@ -1,18 +0,0 @@ -[ "$ACTION" == "add" ] || exit 0 - -PHYNBR=${DEVPATH##*/phy} - -[ -n $PHYNBR ] || exit 0 - -. /lib/functions.sh -. /lib/functions/system.sh - -board=$(board_name) - -case "$board" in - linksys,mr7350) - addr=$(mtd_get_mac_ascii devinfo hw_mac_addr) - [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress - [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress - ;; -esac From 65a1c666f2eb2511430a9064686b3590e08b1773 Mon Sep 17 00:00:00 2001 From: Rany Hany Date: Mon, 2 Dec 2024 11:30:07 +0000 Subject: [PATCH 027/149] hostapd: add SAE support for wifi-station and optimize PSK file creation Regarding SAE support in wifi-station: Important Note: Unlike PSK wifi-stations, both `mac` and `key` options are required to make it work. With PSK, hostapd used to perform a brute-force match to find which PSK entry to use, but with SAE this is infeasible due to SAE's design. When `mac` is omitted, it will allow any MAC address to use the SAE password if it didn't have a MAC address assigned to it, but this could only be done once. The last wildcard entry would be used. Also, unlike "hostapd: add support for SAE in PPSK option" (commit 913368a), it is not required to set `sae_pwe` to `0`. This gives it a slight advantage over using PPSK that goes beyond not needing RADIUS. Example Configuration: ``` config wifi-vlan option iface default_radio0 option name 999 option vid 999 option network management config wifi-station # Allow user with MAC address 00:11:22:33:44:55 and matching # key "secretadminpass" to access the management network. option iface default_radio0 option vid 999 option mac '00:11:22:33:44:55' option key secretadminpass config wifi-vlan option iface default_radio0 option name 100 option vid 100 option network guest config wifi-station # With SAE, when 'mac' is omitted it will be the fallback in case no # other MAC address matches. It won't be possible for a user that # has a matching MAC to use this network (i.e., 00:11:22:33:44:55 # in this example). option iface default_radio0 option vid 100 option key guestpass ``` Regarding PSK file creation optimization: This patch now conditionally runs `hostapd_set_psk_file` depending on `auth_type`. Previously, `hostapd_set_psk` would always execute `hostapd_set_psk_file`, which would create a new file if `wifi-station` was in use even if PSK was not enabled. This change checks the `auth_type` to ensure that it is appropriate to parse the `wifi-station` entries and create those files. Furthermore, we now only configure `wpa_psk_file` when it is a supported option (i.e., psk or psk-sae is used). Previously, we used to configure it when it was not necessary. While it didn't cause any issues, it would litter `/var/run` with unnecessary files. This patch fixes that case by configuring it depending on the `auth_type`. The new SAE support is aligned with these PSK file changes. Signed-off-by: Rany Hany Link: https://github.com/openwrt/openwrt/pull/17145 Signed-off-by: John Crispin --- .../wifi-scripts/files/lib/netifd/hostapd.sh | 38 +++++++++++++++++-- .../files/lib/netifd/wireless/mac80211.sh | 7 +++- .../network/services/hostapd/files/hostapd.uc | 2 + 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/package/network/config/wifi-scripts/files/lib/netifd/hostapd.sh b/package/network/config/wifi-scripts/files/lib/netifd/hostapd.sh index 817ead71afd..0b2241ea60e 100644 --- a/package/network/config/wifi-scripts/files/lib/netifd/hostapd.sh +++ b/package/network/config/wifi-scripts/files/lib/netifd/hostapd.sh @@ -428,9 +428,36 @@ hostapd_set_psk() { local ifname="$1" rm -f /var/run/hostapd-${ifname}.psk + case "$auth_type" in + psk|psk-sae) ;; + *) return ;; + esac for_each_station hostapd_set_psk_file ${ifname} } +hostapd_set_sae_file() { + local ifname="$1" + local vlan="$2" + local vlan_id="" + + json_get_vars mac vid key + set_default mac "ff:ff:ff:ff:ff:ff" + [ -n "$mac" ] && mac="|mac=$mac" + [ -n "$vid" ] && vlan_id="|vlanid=$vid" + printf '%s%s%s\n' "${key}" "${mac}" "${vlan_id}" >> /var/run/hostapd-${ifname}.sae +} + +hostapd_set_sae() { + local ifname="$1" + + rm -f /var/run/hostapd-${ifname}.sae + case "$auth_type" in + sae|psk-sae) ;; + *) return ;; + esac + for_each_station hostapd_set_sae_file ${ifname} +} + append_iw_roaming_consortium() { [ -n "$1" ] && append bss_conf "roaming_consortium=$1" "$N" } @@ -686,7 +713,7 @@ hostapd_set_bss_options() { wps_not_configured=1 ;; psk|sae|psk-sae) - json_get_vars key wpa_psk_file + json_get_vars key wpa_psk_file sae_password_file if [ "$ppsk" -ne 0 ]; then json_get_vars auth_secret auth_port set_default auth_port 1812 @@ -697,15 +724,20 @@ hostapd_set_bss_options() { append bss_conf "wpa_psk=$key" "$N" elif [ ${#key} -ge 8 ] && [ ${#key} -le 63 ]; then append bss_conf "wpa_passphrase=$key" "$N" - elif [ -n "$key" ] || [ -z "$wpa_psk_file" ]; then + elif [ -n "$key" ] || [ -z "$wpa_psk_file" ] || [ -z "$sae_password_file" ]; then wireless_setup_vif_failed INVALID_WPA_PSK return 1 fi [ -z "$wpa_psk_file" ] && set_default wpa_psk_file /var/run/hostapd-$ifname.psk - [ -n "$wpa_psk_file" ] && { + [ -n "$wpa_psk_file" ] && [ "$auth_type" = "psk" -o "$auth_type" = "psk-sae" ] && { [ -e "$wpa_psk_file" ] || touch "$wpa_psk_file" append bss_conf "wpa_psk_file=$wpa_psk_file" "$N" } + [ -z "$sae_password_file" ] && set_default sae_password_file /var/run/hostapd-$ifname.sae + [ -n "$sae_password_file" ] && [ "$auth_type" = "sae" -o "$auth_type" = "psk-sae" ] && { + [ -e "$sae_password_file" ] || touch "$sae_password_file" + append bss_conf "sae_password_file=$sae_password_file" "$N" + } [ "$eapol_version" -ge "1" -a "$eapol_version" -le "2" ] && append bss_conf "eapol_version=$eapol_version" "$N" set_default dynamic_vlan 0 diff --git a/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh index f65128783fa..c835b46e759 100755 --- a/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh +++ b/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh @@ -669,7 +669,7 @@ mac80211_set_ifname() { mac80211_prepare_vif() { json_select config - json_get_vars ifname mode ssid wds powersave macaddr enable wpa_psk_file vlan_file + json_get_vars ifname mode ssid wds powersave macaddr enable wpa_psk_file sae_password_file vlan_file [ -n "$ifname" ] || { local prefix; @@ -702,7 +702,12 @@ mac80211_prepare_vif() { [ "$mode" == "ap" ] && { + json_select config + wireless_vif_parse_encryption + json_select .. + [ -z "$wpa_psk_file" ] && hostapd_set_psk "$ifname" + [ -z "$sae_password_file" ] && hostapd_set_sae "$ifname" [ -z "$vlan_file" ] && hostapd_set_vlan "$ifname" } diff --git a/package/network/services/hostapd/files/hostapd.uc b/package/network/services/hostapd/files/hostapd.uc index 76a3d706f7f..1593feef6bc 100644 --- a/package/network/services/hostapd/files/hostapd.uc +++ b/package/network/services/hostapd/files/hostapd.uc @@ -10,6 +10,7 @@ hostapd.data.pending_config = {}; hostapd.data.file_fields = { vlan_file: true, wpa_psk_file: true, + sae_password_file: true, accept_mac_file: true, deny_mac_file: true, eap_user_file: true, @@ -365,6 +366,7 @@ function bss_remove_file_fields(config) for (let key in config.hash) new_cfg.hash[key] = config.hash[key]; delete new_cfg.hash.wpa_psk_file; + delete new_cfg.hash.sae_password_file; delete new_cfg.hash.vlan_file; return new_cfg; From 3710323a469212ef0bbc5dc414895f6198edb67e Mon Sep 17 00:00:00 2001 From: Liangbin Lian Date: Sun, 1 Dec 2024 12:45:34 +0800 Subject: [PATCH 028/149] package/firewall: fix config typo change Support-UDP-Traceroute rule from 'enabled false' to 'enabled 0' Signed-off-by: Liangbin Lian Link: https://github.com/openwrt/openwrt/pull/17133 Signed-off-by: John Crispin --- package/network/config/firewall/Makefile | 2 +- package/network/config/firewall/files/firewall.config | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/config/firewall/Makefile b/package/network/config/firewall/Makefile index a4b17f0b531..042883264d3 100644 --- a/package/network/config/firewall/Makefile +++ b/package/network/config/firewall/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=firewall -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firewall3.git diff --git a/package/network/config/firewall/files/firewall.config b/package/network/config/firewall/files/firewall.config index b90ac7af0a3..4c7ef8a96e0 100644 --- a/package/network/config/firewall/files/firewall.config +++ b/package/network/config/firewall/files/firewall.config @@ -138,7 +138,7 @@ config rule option proto udp option family ipv4 option target REJECT - option enabled false + option enabled 0 # include a file with users custom iptables rules config include From cbdfd03e42f5619127d357eaba48b77f62628654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Owoc?= Date: Fri, 6 Dec 2024 17:11:59 +0100 Subject: [PATCH 029/149] base-files: add option to set LED brightness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add option to set LED brightness via uci: config led 'led_blue' option name 'blue' option sysfs 'blue:status' option brightness '1' Signed-off-by: Paweł Owoc Link: https://github.com/openwrt/openwrt/pull/17190 Signed-off-by: John Crispin --- package/base-files/files/etc/init.d/led | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led index 377b9dcf3eb..d292e2a8dd1 100755 --- a/package/base-files/files/etc/init.d/led +++ b/package/base-files/files/etc/init.d/led @@ -51,6 +51,7 @@ load_led() { local delayon local delayoff local interval + local brightness config_get sysfs $1 sysfs config_get name $1 name "$sysfs" @@ -67,6 +68,7 @@ load_led() { config_get message $1 message "" config_get gpio $1 gpio "0" config_get_bool inverted $1 inverted "0" + config_get brightness $1 brightness [ "$2" ] && [ "$sysfs" != "$2" ] && return @@ -105,7 +107,8 @@ load_led() { echo 0 >/sys/class/leds/${sysfs}/brightness [ $default = 1 ] && - cat /sys/class/leds/${sysfs}/max_brightness > /sys/class/leds/${sysfs}/brightness + [ -z "$brightness" ] && brightness=$(cat /sys/class/leds/${sysfs}/max_brightness) + echo $brightness > /sys/class/leds/${sysfs}/brightness led_color_set "$1" "$sysfs" From bf768867dc0eea6b51d2db90a8f1380cc52529c1 Mon Sep 17 00:00:00 2001 From: "Leon M. Busch-George" Date: Sat, 19 Oct 2024 11:43:23 +0200 Subject: [PATCH 030/149] qmi: sort config variables a little and fix minor bugs Group 'local' declarations and 'json_get_vars', sort alphabetically within groups, and split off more generic parameters. - delegate and sourcefilter were not declared as local variables Signed-off-by: Leon M. Busch-George --- .../utils/uqmi/files/lib/netifd/proto/qmi.sh | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh index 8ec577a90b7..b08b2251048 100755 --- a/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh +++ b/package/network/utils/uqmi/files/lib/netifd/proto/qmi.sh @@ -34,17 +34,20 @@ proto_qmi_init_config() { proto_qmi_setup() { local interface="$1" - local dataformat connstat plmn_mode mcc mnc - local device apn v6apn auth username password pincode delay modes pdptype - local profile v6profile dhcp dhcpv6 autoconnect plmn timeout mtu $PROTO_DEFAULT_OPTIONS - local ip4table ip6table - local cid_4 pdh_4 cid_6 pdh_6 - local ip_6 ip_prefix_length gateway_6 dns1_6 dns2_6 + + local connstat dataformat mcc mnc plmn_mode + local cid_4 cid_6 pdh_4 pdh_6 + local dns1_6 dns2_6 gateway_6 ip_6 ip_prefix_length local profile_pdptype - json_get_vars device apn v6apn auth username password pincode delay modes - json_get_vars pdptype profile v6profile dhcp dhcpv6 sourcefilter delegate autoconnect plmn ip4table - json_get_vars ip6table timeout mtu $PROTO_DEFAULT_OPTIONS + local delegate ip4table ip6table mtu sourcefilter $PROTO_DEFAULT_OPTIONS + json_get_vars delegate ip4table ip6table mtu sourcefilter $PROTO_DEFAULT_OPTIONS + + local apn auth delay device modes password pdptype pincode username v6apn + json_get_vars apn auth delay device modes password pdptype pincode username v6apn + + local profile v6profile dhcp dhcpv6 autoconnect plmn timeout + json_get_vars profile v6profile dhcp dhcpv6 autoconnect plmn timeout [ "$timeout" = "" ] && timeout="10" From 650410fca4596328d0ec75cefd7e1b202e896a48 Mon Sep 17 00:00:00 2001 From: "Leon M. Busch-George" Date: Sat, 19 Oct 2024 11:52:51 +0200 Subject: [PATCH 031/149] ncm: sort config variables a little and fix minor bugs Group 'local' declarations and 'json_get_vars', sort alphabetically within groups, and split off more generic parameters. - delegate and sourcefilter were not declared as local variables Signed-off-by: Leon M. Busch-George --- package/network/utils/comgt/files/ncm.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/package/network/utils/comgt/files/ncm.sh b/package/network/utils/comgt/files/ncm.sh index e9412b28feb..761dafb24e3 100644 --- a/package/network/utils/comgt/files/ncm.sh +++ b/package/network/utils/comgt/files/ncm.sh @@ -28,12 +28,13 @@ proto_ncm_init_config() { proto_ncm_setup() { local interface="$1" - local manufacturer initialize setmode connect finalize devname devpath ifpath + local connect context_type devname devpath finalize ifpath initialize manufacturer setmode - local device ifname apn auth username password pincode delay mode pdptype profile $PROTO_DEFAULT_OPTIONS - json_get_vars device ifname apn auth username password pincode delay mode pdptype sourcefilter delegate profile $PROTO_DEFAULT_OPTIONS + local delegate sourcefilter $PROTO_DEFAULT_OPTIONS + json_get_vars delegate sourcefilter $PROTO_DEFAULT_OPTIONS - local context_type + local apn auth delay device ifname mode password pdptype pincode profile username + json_get_vars apn auth delay device ifname mode password pdptype pincode profile username [ "$metric" = "" ] && metric="0" From 821ebce8c115f8670eb0dd83e45efc2a15d3469f Mon Sep 17 00:00:00 2001 From: "Leon M. Busch-George" Date: Sat, 19 Oct 2024 12:03:08 +0200 Subject: [PATCH 032/149] mbim: sort config variables a little and fix minor bugs Group 'local' declarations and 'json_get_vars', sort alphabetically within groups, and split off more generic parameters. - delegate and sourcefilter were not declared as local variables Signed-off-by: Leon M. Busch-George Link: https://github.com/openwrt/openwrt/pull/16734 Signed-off-by: John Crispin --- .../utils/umbim/files/lib/netifd/proto/mbim.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh index 75b914e8aac..01e8628d746 100755 --- a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh +++ b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh @@ -46,10 +46,14 @@ _proto_mbim_setup() { local tid=2 local ret - local device apn pincode delay auth username password allow_roaming allow_partner - local dhcp dhcpv6 pdptype ip4table ip6table mtu $PROTO_DEFAULT_OPTIONS - json_get_vars device apn pincode delay auth username password allow_roaming allow_partner - json_get_vars dhcp dhcpv6 sourcefilter delegate pdptype ip4table ip6table mtu $PROTO_DEFAULT_OPTIONS + local allow_partner allow_roaming apn auth delay device password pincode username + json_get_vars allow_partner allow_roaming apn auth delay device password pincode username + + local dhcp dhcpv6 pdptype + json_get_vars dhcp dhcpv6 pdptype + + local delegate ip4table ip6table mtu sourcefilter $PROTO_DEFAULT_OPTIONS + json_get_vars delegate ip4table ip6table mtu sourcefilter $PROTO_DEFAULT_OPTIONS [ ! -e /proc/sys/net/ipv6 ] && ipv6=0 || json_get_var ipv6 ipv6 From 794291bbdf26ad2be7581fc0c921e4d820937c79 Mon Sep 17 00:00:00 2001 From: David Bentham Date: Tue, 22 Oct 2024 10:46:05 +0100 Subject: [PATCH 033/149] mediatek: add Comfast CF-E395AX support by adding an alternative model name both these devices share the board and same config, just different model number Install instructions are the same as the CF-E393AX commit - https://git.openwrt.org/?p=openwrt/openwrt.git;a=commit;h=d8f4453bf2de9fd9baf3d660ed12e0797ff2cfdb Signed-off-by: David Bentham Link: https://github.com/openwrt/openwrt/pull/16389 Signed-off-by: John Crispin --- target/linux/mediatek/image/filogic.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index c1b38403a65..c18873e697d 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -536,6 +536,8 @@ TARGET_DEVICES += cmcc_rax3000m define Device/comfast_cf-e393ax DEVICE_VENDOR := COMFAST DEVICE_MODEL := CF-E393AX + DEVICE_ALT0_VENDOR := COMFAST + DEVICE_ALT0_MODEL := CF-E395AX DEVICE_DTS := mt7981a-comfast-cf-e393ax DEVICE_DTS_DIR := ../dts DEVICE_DTC_FLAGS := --pad 4096 From 36f309af05241f09b185c6297ef6361316719b50 Mon Sep 17 00:00:00 2001 From: Chuck R Date: Sun, 8 Sep 2024 14:28:06 -0500 Subject: [PATCH 034/149] dnsmasq: pass environment variables to hotplug dnsmasq passes a limited amount of information via DHCP script arguments. Much more information is available through environment variables starting with DNSMASQ_, such as DNSMASQ_INTERFACE. However, when the dhcp-script builds its JSON environment and passes it to hotplug, all of this information is discarded since it is not copied to the JSON environment. Personally, I have a custom-made set of DDNS scripts and rely on environment variables such as DNSMASQ_INTERFACE in order to determine which DNS zones to update. So, not being able to access these variables was detrimental to me. I patched in a quick copy of all DNSMASQ_ variables to the JSON environment so that they can be used in hotplug scripts. In order to do so I also copied /usr/bin/env into dnsmasq's chroot jail. Signed-off-by: Chuck R Link: https://github.com/openwrt/openwrt/pull/16354 Signed-off-by: John Crispin --- package/network/services/dnsmasq/files/dhcp-script.sh | 9 +++++++++ package/network/services/dnsmasq/files/dnsmasq.init | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/package/network/services/dnsmasq/files/dhcp-script.sh b/package/network/services/dnsmasq/files/dhcp-script.sh index 470097bf6bd..f0c8b509020 100755 --- a/package/network/services/dnsmasq/files/dhcp-script.sh +++ b/package/network/services/dnsmasq/files/dhcp-script.sh @@ -8,6 +8,15 @@ json_init json_add_array env hotplugobj="" +oldIFS=$IFS +IFS=$'\n' +for var in $(env); do + if [ "${var}" != "${var#DNSMASQ_}" ]; then + json_add_string "" "${var%%=*}=${var#*=}" + fi +done +IFS=$oldIFS + case "$1" in add | del | old | arp-add | arp-del) json_add_string "" "MACADDR=$2" diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index b864ea90699..2e07e13d367 100755 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -20,7 +20,7 @@ BASEDHCPSTAMPFILE="/var/run/dnsmasq" DHCPBOGUSHOSTNAMEFILE="/usr/share/dnsmasq/dhcpbogushostname.conf" RFC6761FILE="/usr/share/dnsmasq/rfc6761.conf" DHCPSCRIPT="/usr/lib/dnsmasq/dhcp-script.sh" -DHCPSCRIPT_DEPENDS="/usr/share/libubox/jshn.sh /usr/bin/jshn /bin/ubus" +DHCPSCRIPT_DEPENDS="/usr/share/libubox/jshn.sh /usr/bin/jshn /bin/ubus /usr/bin/env" DNSMASQ_DHCP_VER=4 From 1f11912138ce8a77cc0e2faa26942133d393b010 Mon Sep 17 00:00:00 2001 From: Markus Gothe Date: Wed, 12 Jan 2022 17:13:43 +0100 Subject: [PATCH 035/149] ccache: Speed up building. - Disable compression for ccache's cached files. - Disable the hashing of the CWD inside debug information. This increases the cache hits drastically. Signed-off-by: Markus Gothe --- rules.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rules.mk b/rules.mk index 54df407fca4..9db7c72fa49 100644 --- a/rules.mk +++ b/rules.mk @@ -342,6 +342,8 @@ ifneq ($(CONFIG_CCACHE),) TARGET_CXX:= ccache $(TARGET_CXX) HOSTCC:= ccache $(HOSTCC) HOSTCXX:= ccache $(HOSTCXX) + export CCACHE_NOHASHDIR:=true + export CCACHE_NOCOMPRESS:=true export CCACHE_BASEDIR:=$(TOPDIR) export CCACHE_DIR:=$(if $(call qstrip,$(CONFIG_CCACHE_DIR)),$(call qstrip,$(CONFIG_CCACHE_DIR)),$(TOPDIR)/.ccache) export CCACHE_COMPILERCHECK:=%compiler% -dumpmachine; %compiler% -dumpversion From 3859e8eeb82950d8594f60d40e5ee23fd02207c9 Mon Sep 17 00:00:00 2001 From: Markus Gothe Date: Tue, 7 Feb 2023 22:00:33 +0100 Subject: [PATCH 036/149] rules.mk: Update ccache's compiler check. Update the compiler check for ccache so we don't end up with the wrong binaries. Right now the compiler check will not be able to correctly distinguish the compiler used for build ARMv8 binaries from the one used to build ARMv7 binaries. Signed-off-by: Markus Gothe Link: https://github.com/openwrt/openwrt/pull/16290 Signed-off-by: John Crispin --- rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules.mk b/rules.mk index 9db7c72fa49..16d6020e1a0 100644 --- a/rules.mk +++ b/rules.mk @@ -346,7 +346,7 @@ ifneq ($(CONFIG_CCACHE),) export CCACHE_NOCOMPRESS:=true export CCACHE_BASEDIR:=$(TOPDIR) export CCACHE_DIR:=$(if $(call qstrip,$(CONFIG_CCACHE_DIR)),$(call qstrip,$(CONFIG_CCACHE_DIR)),$(TOPDIR)/.ccache) - export CCACHE_COMPILERCHECK:=%compiler% -dumpmachine; %compiler% -dumpversion + export CCACHE_COMPILERCHECK:=%compiler% -v -c endif TARGET_CONFIGURE_OPTS = \ From ebf1866d091d5f4994cf104ab248782f90df2c88 Mon Sep 17 00:00:00 2001 From: Mark Mentovai Date: Fri, 26 Jul 2024 23:28:36 -0400 Subject: [PATCH 037/149] .gitattributes: ignore some whitespace "violations" in .patch files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git's default core.whitespace[1] setting doesn't agree with .patch files. This causes whitespace warnings when running `git apply`, (including via `git am`) and causes red highlighting when viewing diffs to .patch files via `git diff` (including via `git show`) when outputting to a terminal. These types of whitespace “violations” will now be explicitly disabled for .patch files in the repository-wide .gitattributes file to prevent git from suggesting that there’s anything wrong with checked-in .patch files. A .patch file will naturally have `space-before-tab` if a context line (not a +/- line) begins with a tab character (as is common in patches to files that use the tab indent convention), and will also naturally have `trailing-space` if a context line is blank (also common). Neither `indent-with-non-tab` nor `tab-in-indent` are enabled in core.whitespace by default, but could also occur naturally in .patch files, and are also explicitly disabled here for completeness to cover cases where they may be enabled in core.whitespace at the global or system level. These false violations may be flagged frequently in OpenWrt, because the repository contains many .patch files. There are currently just over 5,000 .patch files, representing slightly more than half of all files. [1] https://git-scm.com/book/en/v2/Customizing-Git-Git-Configuration#_core_whitespace Link: https://github.com/openwrt/openwrt/pull/16012 Signed-off-by: Mark Mentovai Link: https://github.com/openwrt/openwrt/pull/16015 Signed-off-by: John Crispin --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index fa1385d99a3..ab4772b9c61 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ * -text +*.patch whitespace=-indent-with-non-tab,-space-before-tab,-tab-in-indent,-trailing-space From d67963943b52bd996368f829d8dea5432de55292 Mon Sep 17 00:00:00 2001 From: Rouven Czerwinski Date: Wed, 17 Jul 2024 21:28:11 +0200 Subject: [PATCH 038/149] ipq40xx: disable SPI DMA for Fritzbox 4040 We have seen hung devices and failures during SPI transactions on Fritzbox devices with a gluon based freifunk network. We have narrowed down that disabling DMA for spi fixes the problem, so disable dma for the SPI controller on the Fritzbox 4040. Signed-off-by: Rouven Czerwinski Link: https://github.com/openwrt/openwrt/pull/15966 Signed-off-by: John Crispin --- .../arch/arm/boot/dts/qcom/qcom-ipq4018-fritzbox-4040.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-fritzbox-4040.dts b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-fritzbox-4040.dts index b3617eb45ee..bcb3b24232c 100644 --- a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-fritzbox-4040.dts +++ b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4018-fritzbox-4040.dts @@ -151,6 +151,8 @@ pinctrl-0 = <&spi_0_pins>; pinctrl-names = "default"; status = "okay"; + /delete-property/ dmas; + /delete-property/ dma-names; cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; flash@0 { From 06c2d5524c0d162ac2af5e55b03e217fcb882cf7 Mon Sep 17 00:00:00 2001 From: Rodrigo Balerdi Date: Tue, 30 Apr 2024 08:25:57 -0300 Subject: [PATCH 039/149] base-files: fix cleanup after settings restore Some devices use file '/tmp/sysupgrade.tar' during settings restore and this potentially big file was not being cleaned up from RAM afterwards. See: do_mount_root() (base-files/files/lib/preinit/80_mount_root) Signed-off-by: Rodrigo Balerdi Link: https://github.com/openwrt/openwrt/pull/15339 Signed-off-by: John Crispin --- package/base-files/files/etc/init.d/done | 1 + 1 file changed, 1 insertion(+) diff --git a/package/base-files/files/etc/init.d/done b/package/base-files/files/etc/init.d/done index 32d6118df76..77d2721f7d8 100755 --- a/package/base-files/files/etc/init.d/done +++ b/package/base-files/files/etc/init.d/done @@ -5,6 +5,7 @@ START=95 boot() { mount_root done rm -f /sysupgrade.tgz && sync + rm -f /tmp/sysupgrade.tar && sync # process user commands [ -f /etc/rc.local ] && { From 5fd86d66c15fc4d6f5076f7d07c91e0690d91531 Mon Sep 17 00:00:00 2001 From: Jonathan Brophy Date: Tue, 10 Sep 2024 21:43:23 +1200 Subject: [PATCH 040/149] kernel: modules: add support for led-group-multicolor This option enables support for monochrome LEDs that are grouped into multicolor LEDs which is useful in the case where LEDs of different colors are physically grouped in a single multi-color LED and driven by a controller that doesn't have multi-color support. Signed-off-by: Jonathan Brophy Link: https://github.com/openwrt/openwrt/pull/16397 Signed-off-by: John Crispin --- package/kernel/linux/modules/leds.mk | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/package/kernel/linux/modules/leds.mk b/package/kernel/linux/modules/leds.mk index 0c42895bb2f..f6f74283eee 100644 --- a/package/kernel/linux/modules/leds.mk +++ b/package/kernel/linux/modules/leds.mk @@ -22,6 +22,25 @@ endef $(eval $(call KernelPackage,leds-gpio)) +define KernelPackage/led-group-multicolor + SUBMENU:=$(LEDS_MENU) + TITLE:=LEDs group multi-color support + KCONFIG:= \ + CONFIG_LEDS_CLASS_MULTICOLOR \ + CONFIG_LEDS_GROUP_MULTICOLOR + FILES:=$(LINUX_DIR)/drivers/leds/rgb/leds-group-multicolor.ko + AUTOLOAD:=$(call AutoProbe,led-group-multi-color) +endef + +define KernelPackage/led-group-multi-color/description + This option enables support for monochrome LEDs that are grouped + into multicolor LEDs which is useful in the case where LEDs of + different colors are physically grouped in a single multi-color LED + and driven by a controller that does not have multi-color support. +endef + +$(eval $(call KernelPackage,led-group-multi-color)) + LED_TRIGGER_DIR=$(LINUX_DIR)/drivers/leds/trigger define KernelPackage/ledtrig-activity @@ -313,4 +332,4 @@ define KernelPackage/leds-lp5562/description LED controllers. endef -$(eval $(call KernelPackage,leds-lp5562)) \ No newline at end of file +$(eval $(call KernelPackage,leds-lp5562)) From 1cea889c96a8df4e91236e269539b086d519a60a Mon Sep 17 00:00:00 2001 From: John Crispin Date: Thu, 12 Dec 2024 13:52:43 +0100 Subject: [PATCH 041/149] kernel: modules: fix led-group-multi-color patch Fixes: 5fd86d6 ("kernel: modules: add support for led-group-multicolor") Signed-off-by: John Crispin --- package/kernel/linux/modules/leds.mk | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/package/kernel/linux/modules/leds.mk b/package/kernel/linux/modules/leds.mk index f6f74283eee..6c619b658ed 100644 --- a/package/kernel/linux/modules/leds.mk +++ b/package/kernel/linux/modules/leds.mk @@ -22,21 +22,20 @@ endef $(eval $(call KernelPackage,leds-gpio)) -define KernelPackage/led-group-multicolor - SUBMENU:=$(LEDS_MENU) - TITLE:=LEDs group multi-color support - KCONFIG:= \ - CONFIG_LEDS_CLASS_MULTICOLOR \ - CONFIG_LEDS_GROUP_MULTICOLOR - FILES:=$(LINUX_DIR)/drivers/leds/rgb/leds-group-multicolor.ko - AUTOLOAD:=$(call AutoProbe,led-group-multi-color) +define KernelPackage/led-group-multi-color + SUBMENU:=$(LEDS_MENU) + TITLE:=LEDs group multi-color support + KCONFIG:=CONFIG_LEDS_CLASS_MULTICOLOR \ + CONFIG_LEDS_GROUP_MULTICOLOR + FILES:=$(LINUX_DIR)/drivers/leds/rgb/leds-group-multicolor.ko + AUTOLOAD:=$(call AutoProbe,led-group-multi-color) endef define KernelPackage/led-group-multi-color/description - This option enables support for monochrome LEDs that are grouped - into multicolor LEDs which is useful in the case where LEDs of - different colors are physically grouped in a single multi-color LED - and driven by a controller that does not have multi-color support. + This option enables support for monochrome LEDs that are grouped + into multicolor LEDs which is useful in the case where LEDs of + different colors are physically grouped in a single multi-color LED + and driven by a controller that does not have multi-color support. endef $(eval $(call KernelPackage,led-group-multi-color)) From 1375a7bae0d5e8dddb6b6cfe0584a399cd6c20b4 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Thu, 12 Dec 2024 15:43:35 +0100 Subject: [PATCH 042/149] Revert "kernel: modules: fix led-group-multi-color patch" This reverts commit 1cea889c96a8df4e91236e269539b086d519a60a. This reverts commit 5fd86d66c15fc4d6f5076f7d07c91e0690d91531. The patch is causing build servers to fail. Revert it for now. Signed-off-by: John Crispin --- package/kernel/linux/modules/leds.mk | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/package/kernel/linux/modules/leds.mk b/package/kernel/linux/modules/leds.mk index 6c619b658ed..0c42895bb2f 100644 --- a/package/kernel/linux/modules/leds.mk +++ b/package/kernel/linux/modules/leds.mk @@ -22,24 +22,6 @@ endef $(eval $(call KernelPackage,leds-gpio)) -define KernelPackage/led-group-multi-color - SUBMENU:=$(LEDS_MENU) - TITLE:=LEDs group multi-color support - KCONFIG:=CONFIG_LEDS_CLASS_MULTICOLOR \ - CONFIG_LEDS_GROUP_MULTICOLOR - FILES:=$(LINUX_DIR)/drivers/leds/rgb/leds-group-multicolor.ko - AUTOLOAD:=$(call AutoProbe,led-group-multi-color) -endef - -define KernelPackage/led-group-multi-color/description - This option enables support for monochrome LEDs that are grouped - into multicolor LEDs which is useful in the case where LEDs of - different colors are physically grouped in a single multi-color LED - and driven by a controller that does not have multi-color support. -endef - -$(eval $(call KernelPackage,led-group-multi-color)) - LED_TRIGGER_DIR=$(LINUX_DIR)/drivers/leds/trigger define KernelPackage/ledtrig-activity @@ -331,4 +313,4 @@ define KernelPackage/leds-lp5562/description LED controllers. endef -$(eval $(call KernelPackage,leds-lp5562)) +$(eval $(call KernelPackage,leds-lp5562)) \ No newline at end of file From 1be18c6daad83bc4198dc7aefd9979b7fe8fbfd4 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Thu, 12 Dec 2024 16:36:50 +0100 Subject: [PATCH 043/149] wifi-scripts: fix failing mesh setup with missing wpa_supplicant The initialization of mesh interfaces currently fail when wpa_supplicant is not installed. This is due to the script calling the wpa_supplicant feature indicator without verifying wpa_supplicant is installed at all. To avoid failing, first check if wpa_supplicant is installed before determining the available featureset. Signed-off-by: David Bauer --- .../config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh index c835b46e759..1fb3edf0558 100755 --- a/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh +++ b/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh @@ -1023,7 +1023,7 @@ mac80211_setup_vif() { json_get_vars $MP_CONFIG_INT $MP_CONFIG_BOOL $MP_CONFIG_STRING wireless_vif_parse_encryption [ -z "$htmode" ] && htmode="NOHT"; - if wpa_supplicant -vmesh; then + if [ -x /usr/sbin/wpa_supplicant ] && wpa_supplicant -vmesh; then mac80211_setup_supplicant || failed=1 else mac80211_setup_mesh From 00860e485b2ef82c1fafc8e011f3a8965e317bca Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 9 Dec 2024 20:09:15 +0100 Subject: [PATCH 044/149] wifi-scripts: add macaddr_base wifi-device option This can be used to configure the base mac address from which all interface mac addresses are derived Signed-off-by: Felix Fietkau --- .../files-ucode/lib/netifd/wireless/mac80211.sh | 2 +- .../usr/share/schema/wireless.wifi-device.json | 4 ++++ .../files-ucode/usr/share/ucode/wifi/hostapd.uc | 2 ++ .../files-ucode/usr/share/ucode/wifi/iface.uc | 4 ++-- .../files-ucode/usr/share/ucode/wifi/supplicant.uc | 2 ++ .../files/lib/netifd/wireless/mac80211.sh | 9 ++++++--- .../wifi-scripts/files/usr/share/hostap/common.uc | 4 +++- package/network/services/hostapd/files/hostapd.uc | 3 +++ .../network/services/hostapd/files/wpa_supplicant.uc | 11 ++++++++--- 9 files changed, 31 insertions(+), 10 deletions(-) diff --git a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh index cfd74240611..93ab404d57c 100755 --- a/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh +++ b/package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh @@ -302,7 +302,7 @@ function setup() { if (mode != "ap") data.config.noscan = true; validate('iface', v.config); - iface.prepare(v.config, data.phy + data.phy_suffix, data.config.num_global_macaddr); + iface.prepare(v.config, data.phy + data.phy_suffix, data.config.num_global_macaddr, data.config.macaddr_base); netifd.set_vif(k, v.config.ifname); break; } diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json index 77b7adada89..4354b4f816a 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/schema/wireless.wifi-device.json @@ -490,6 +490,10 @@ "type": "alias", "default": "bssid" }, + "macaddr_base": { + "type": "string", + "description": "Base MAC address used for deriving interface MAC addresses" + }, "max_amsdu": { "description": "Maximum A-MSDU length of 7935 octects (3839 octets if option set to 0)", "type": "boolean", diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc index c7baa8d85bd..f95f01e8468 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc @@ -544,6 +544,8 @@ export function setup(data) { if (data.config.num_global_macaddr) append('\n#num_global_macaddr', data.config.num_global_macaddr); + if (data.config.macaddr_base) + append('\n#macaddr_base', data.config.macaddr_base); for (let k, interface in data.interfaces) { if (interface.config.mode != 'ap') diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc index daddb801ef9..ed9b2625bb0 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/iface.uc @@ -178,9 +178,9 @@ function macaddr_random() { } let mac_idx = 0; -export function prepare(data, phy, num_global_macaddr) { +export function prepare(data, phy, num_global_macaddr, macaddr_base) { if (!data.macaddr) { - let pipe = fs.popen(`ucode /usr/share/hostap/wdev.uc ${phy} get_macaddr id=${mac_idx} num_global=${num_global_macaddr} mbssid=${data.mbssid ?? 0}`); + let pipe = fs.popen(`ucode /usr/share/hostap/wdev.uc ${phy} get_macaddr id=${mac_idx} num_global=${num_global_macaddr} mbssid=${data.mbssid ?? 0} macaddr_base=${macaddr_base}`); data.macaddr = trim(pipe.read("all"), '\n'); pipe.close(); diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc index 0519e581777..c7bfeb6b9a6 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc @@ -221,6 +221,7 @@ export function setup(config, data) { config, defer: true, num_global_macaddr: data.config.num_global_macaddr, + macaddr_base: data.config.macaddr_base, }); if (ret) @@ -235,5 +236,6 @@ export function start(data) { phy: data.phy, radio: data.config.radio, num_global_macaddr: data.config.num_global_macaddr, + macaddr_base: data.config.macaddr_base, }); }; diff --git a/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh b/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh index 1fb3edf0558..5d9bf8ee09e 100755 --- a/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh +++ b/package/network/config/wifi-scripts/files/lib/netifd/wireless/mac80211.sh @@ -30,6 +30,7 @@ drv_mac80211_init_device_config() { config_add_string tx_burst config_add_string distance config_add_string ifname_prefix + config_add_string macaddr_base config_add_int radio beacon_int chanbw frag rts config_add_int rxantenna txantenna txpower min_tx_power config_add_int num_global_macaddr multiple_bssid @@ -530,6 +531,7 @@ ${hostapd_noscan:+noscan=1} ${tx_burst:+tx_queue_data2_burst=$tx_burst} ${multiple_bssid:+mbssid=$multiple_bssid} #num_global_macaddr=$num_global_macaddr +#macaddr_base=$macaddr_base $base_cfg EOF @@ -577,7 +579,7 @@ mac80211_generate_mac() { local phy="$1" local id="${macidx:-0}" - wdev_tool "$phy$phy_suffix" get_macaddr id=$id num_global=$num_global_macaddr mbssid=${multiple_bssid:-0} + wdev_tool "$phy$phy_suffix" get_macaddr id=$id num_global=$num_global_macaddr mbssid=${multiple_bssid:-0} macaddr_base=${macaddr_base} } get_board_phy_name() ( @@ -939,6 +941,7 @@ wpa_supplicant_set_config() { json_add_string phy "$phy" json_add_int radio "$radio" json_add_int num_global_macaddr "$num_global_macaddr" + json_add_string macaddr_base "$macaddr_base" json_add_boolean defer 1 local data="$(json_dump)" @@ -985,7 +988,7 @@ wpa_supplicant_start() { [ -n "$wpa_supp_init" ] || return 0 - ubus_call wpa_supplicant config_set '{ "phy": "'"$phy"'", "radio": '"$radio"', "num_global_macaddr": '"$num_global_macaddr"' }' > /dev/null + ubus_call wpa_supplicant config_set '{ "phy": "'"$phy"'", "radio": '"$radio"', "num_global_macaddr": '"$num_global_macaddr"', "macaddr_base": "'"$macaddr_base"'" }' > /dev/null } mac80211_setup_supplicant() { @@ -1112,7 +1115,7 @@ drv_mac80211_setup() { rxantenna txantenna \ frag rts beacon_int:100 htmode \ num_global_macaddr:1 multiple_bssid \ - ifname_prefix + ifname_prefix macaddr_base json_get_values basic_rate_list basic_rate json_get_values scan_list scan_list json_select .. diff --git a/package/network/config/wifi-scripts/files/usr/share/hostap/common.uc b/package/network/config/wifi-scripts/files/usr/share/hostap/common.uc index c6bfb62ef3c..fd28b664725 100644 --- a/package/network/config/wifi-scripts/files/usr/share/hostap/common.uc +++ b/package/network/config/wifi-scripts/files/usr/share/hostap/common.uc @@ -213,7 +213,9 @@ const phy_proto = { if (!base_mask) return null; - if (base_mask == "00:00:00:00:00:00" && + if (data.macaddr_base) + base_addr = data.macaddr_base; + else if (base_mask == "00:00:00:00:00:00" && (radio_idx > 0 || idx >= num_global)) { let addrs = split(phy_sysfs_file(phy, "addresses"), "\n"); diff --git a/package/network/services/hostapd/files/hostapd.uc b/package/network/services/hostapd/files/hostapd.uc index 1593feef6bc..053f08cb96b 100644 --- a/package/network/services/hostapd/files/hostapd.uc +++ b/package/network/services/hostapd/files/hostapd.uc @@ -280,6 +280,7 @@ function iface_macaddr_init(phydev, config, macaddr_list) { let macaddr_data = { num_global: config.num_global_macaddr ?? 1, + macaddr_base: config.macaddr_base, mbssid: config.mbssid ?? 0, }; @@ -750,6 +751,8 @@ function iface_load_config(phy, radio, filename) if (val[0] == "#num_global_macaddr") config[substr(val[0], 1)] = int(val[1]); + else if (val[0] == "#macaddr_base") + config[substr(val[0], 1)] = val[1]; else if (val[0] == "mbssid") config[val[0]] = int(val[1]); diff --git a/package/network/services/hostapd/files/wpa_supplicant.uc b/package/network/services/hostapd/files/wpa_supplicant.uc index fbea27628e3..f288121e9d4 100644 --- a/package/network/services/hostapd/files/wpa_supplicant.uc +++ b/package/network/services/hostapd/files/wpa_supplicant.uc @@ -68,7 +68,7 @@ function prepare_config(config, radio) return { config }; } -function set_config(config_name, phy_name, radio, num_global_macaddr, config_list) +function set_config(config_name, phy_name, radio, num_global_macaddr, macaddr_base, config_list) { let phy = wpas.data.config[config_name]; @@ -83,6 +83,7 @@ function set_config(config_name, phy_name, radio, num_global_macaddr, config_lis phy.radio = radio; phy.num_global_macaddr = num_global_macaddr; + phy.macaddr_base = macaddr_base; let values = []; for (let config in config_list) @@ -106,7 +107,10 @@ function start_pending(phy_name) } let macaddr_list = wpas.data.macaddr_list[phy_name]; - phydev.macaddr_init(macaddr_list, { num_global: phy.num_global_macaddr }); + phydev.macaddr_init(macaddr_list, { + num_global: phy.num_global_macaddr, + macaddr_base: phy.macaddr_base, + }); for (let ifname in phy.data) iface_start(phydev, phy.data[ifname]); @@ -210,6 +214,7 @@ let main_obj = { phy: "", radio: 0, num_global_macaddr: 0, + macaddr_base: "", config: [], defer: true, }, @@ -221,7 +226,7 @@ let main_obj = { wpas.printf(`Set new config for phy ${phy}`); try { if (req.args.config) - set_config(phy, req.args.phy, req.args.radio, req.args.num_global_macaddr, req.args.config); + set_config(phy, req.args.phy, req.args.radio, req.args.num_global_macaddr, req.args.macaddr_base, req.args.config); if (!req.args.defer) start_pending(phy); From 97c8a94ec509407105db1b942ae5b8ab92252480 Mon Sep 17 00:00:00 2001 From: Sybil127 Date: Thu, 23 May 2024 17:43:07 +0200 Subject: [PATCH 045/149] wifi-scripts: introduce rxkh_file uci option With rxkh_file, hostapd will read a list of RxKHs from a text file. This also makes it possible for hostapd to dynamically reload RxKHs. RxKHs defined in rxkh_file should be formated as described in hostapd.conf, with one entry per line. R0KH/R1KH format: r0kh= <256-bit key as hex string> r1kh= <256-bit key as hex string> Reworked behavior of the uci options r0kh and r1kh. When rxkh_file is not configured: Instead of appending the RxKHs to the hostapd bss configuration. They will be added to a interface specific file with name /var/run/hostapd-phyX-apX.rxkh. This file will be used as the rxkh_file in the hostapd bss configuration. When rxkh_file is configured: The specified file will be used in the hostapd bss configuration, and will be the only source for configured RxKHs. All RxKHs defined with the uci options r0kh or r1kh will be ignored. Signed-off-by: Sybil127 Signed-off-by: Felix Fietkau --- .../wifi-scripts/files/lib/netifd/hostapd.sh | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/package/network/config/wifi-scripts/files/lib/netifd/hostapd.sh b/package/network/config/wifi-scripts/files/lib/netifd/hostapd.sh index 0b2241ea60e..3285ee4312f 100644 --- a/package/network/config/wifi-scripts/files/lib/netifd/hostapd.sh +++ b/package/network/config/wifi-scripts/files/lib/netifd/hostapd.sh @@ -335,7 +335,7 @@ hostapd_common_add_bss_config() { config_add_boolean ieee80211r pmk_r1_push ft_psk_generate_local ft_over_ds config_add_int r0_key_lifetime reassociation_deadline - config_add_string mobility_domain r1_key_holder + config_add_string mobility_domain r1_key_holder rxkh_file config_add_array r0kh r1kh config_add_int ieee80211w_max_timeout ieee80211w_retry_timeout @@ -592,7 +592,7 @@ hostapd_set_bss_options() { wireless_vif_parse_encryption - local bss_conf bss_md5sum ft_key + local bss_conf bss_md5sum ft_key rxkhs local wep_rekey wpa_group_rekey wpa_pair_rekey wpa_master_rekey wpa_key_mgmt json_get_vars \ @@ -981,7 +981,7 @@ hostapd_set_bss_options() { append bss_conf "reassociation_deadline=$reassociation_deadline" "$N" if [ "$ft_psk_generate_local" -eq "0" ]; then - json_get_vars r0_key_lifetime r1_key_holder pmk_r1_push + json_get_vars r0_key_lifetime r1_key_holder pmk_r1_push rxkh_file json_get_values r0kh r0kh json_get_values r1kh r1kh @@ -1003,12 +1003,20 @@ hostapd_set_bss_options() { append bss_conf "r0_key_lifetime=$r0_key_lifetime" "$N" append bss_conf "pmk_r1_push=$pmk_r1_push" "$N" - for kh in $r0kh; do - append bss_conf "r0kh=${kh//,/ }" "$N" - done - for kh in $r1kh; do - append bss_conf "r1kh=${kh//,/ }" "$N" - done + if [ -z "$rxkh_file" ]; then + set_default rxkh_file /var/run/hostapd-$ifname.rxkh + [ -e "$rxkh_file" ] && rm -f "$rxkh_file" + touch "$rxkh_file" + + for kh in $r0kh; do + append rxkhs "r0kh=${kh//,/ }" "$N" + done + for kh in $r1kh; do + append rxkhs "r1kh=${kh//,/ }" "$N" + done + echo "$rxkhs" > "$rxkh_file" + fi + append bss_conf "rxkh_file=$rxkh_file" "$N" fi fi From 7306ae401cc2cf84210fb74f37aa17049bce2e9f Mon Sep 17 00:00:00 2001 From: Sybil127 Date: Thu, 23 May 2024 18:49:54 +0200 Subject: [PATCH 046/149] hostapd: add support for rxkh_file Initial support for dynamic reload of RxKHs. In order to check if RxKHs need reloading. RxKHs defined in the rxkh_file first has to be parsed and formated, the same way as hostapd will read from the file and also output, with the command GET_RXKHS. Then each list of RxKHs can be hashed and compared. Ucode implementation of hostapds rkh_derive_key() function. Hostapd converts hex keys with 128-bits or more when less than 256-bits to 256-bits, and truncates those that are more than 256-bits. See: https://w1.fi/cgit/hostap/commit/hostapd/config_file.c?id=245fc96e5f4b1c566b7eaa19180c774307ebed79 Signed-off-by: Sybil127 Signed-off-by: Felix Fietkau --- .../network/services/hostapd/files/hostapd.uc | 69 ++++++++++++++++++- .../services/hostapd/src/src/ap/ucode.c | 1 + .../services/hostapd/src/src/utils/ucode.c | 35 ++++++++++ .../services/hostapd/src/src/utils/ucode.h | 1 + 4 files changed, 104 insertions(+), 2 deletions(-) diff --git a/package/network/services/hostapd/files/hostapd.uc b/package/network/services/hostapd/files/hostapd.uc index 053f08cb96b..e345a678f41 100644 --- a/package/network/services/hostapd/files/hostapd.uc +++ b/package/network/services/hostapd/files/hostapd.uc @@ -11,6 +11,7 @@ hostapd.data.file_fields = { vlan_file: true, wpa_psk_file: true, sae_password_file: true, + rxkh_file: true, accept_mac_file: true, deny_mac_file: true, eap_user_file: true, @@ -351,6 +352,64 @@ function bss_reload_psk(bss, config, old_config) hostapd.printf(`Reload WPA PSK file for bss ${config.ifname}: ${ret}`); } +function normalize_rxkhs(txt) +{ + const pat = { + sep: "\x20", + mac: "([[:xdigit:]]{2}:?){5}[[:xdigit:]]{2}", + r0kh_id: "[\x21-\x7e]{1,48}", + r1kh_id: "([[:xdigit:]]{2}:?){5}[[:xdigit:]]{2}", + key: "[[:xdigit:]]{32,}", + r0kh: function() { + return "r0kh=" + this.mac + this.sep + this.r0kh_id; + }, + r1kh: function() { + return "r1kh=" + this.mac + this.sep + this.r1kh_id; + }, + rxkh: function() { + return "(" + this.r0kh() + "|" + this.r1kh() + ")" + this.sep + this.key; + }, + }; + + let rxkhs = filter( + split(txt, "\n"), (line) => match(line, regexp("^" + pat.rxkh() + "$")) + ) ?? []; + + rxkhs = map(rxkhs, function(k) { + k = split(k, " ", 3); + k[0] = lc(k[0]); + if(match(k[0], /^r1kh/)) { + k[1] = lc(k[1]); + } + if(!k[2] = hostapd.rkh_derive_key(k[2])) { + return; + } + return join(" ", k); + }); + + return join("\n", sort(filter(rxkhs, length))); +} + +function bss_reload_rxkhs(bss, config, old_config) +{ + let bss_rxkhs = join("\n", sort(split(bss.ctrl("GET_RXKHS"), "\n"))); + let bss_rxkhs_hash = hostapd.sha1(bss_rxkhs); + + if (is_equal(config.hash.rxkh_file, bss_rxkhs_hash)) { + if (is_equal(old_config.hash.rxkh_file, config.hash.rxkh_file)) + return; + } + + old_config.hash.rxkh_file = config.hash.rxkh_file; + if (!is_equal(old_config, config)) + return; + + let ret = bss.ctrl("RELOAD_RXKHS"); + ret ??= "failed"; + + hostapd.printf(`Reload RxKH file for bss ${config.ifname}: ${ret}`); +} + function remove_file_fields(config) { return filter(config, (line) => !hostapd.data.file_fields[split(line, "=")[0]]); @@ -652,6 +711,7 @@ function iface_reload_config(name, phydev, config, old_config) } bss_reload_psk(bss, config.bss[i], bss_list_cfg[i]); + bss_reload_rxkhs(bss, config.bss[i], bss_list_cfg[i]); if (is_equal(config.bss[i], bss_list_cfg[i])) continue; @@ -780,8 +840,13 @@ function iface_load_config(phy, radio, filename) continue; } - if (hostapd.data.file_fields[val[0]]) - bss.hash[val[0]] = hostapd.sha1(readfile(val[1])); + if (hostapd.data.file_fields[val[0]]) { + if (val[0] == "rxkh_file") { + bss.hash[val[0]] = hostapd.sha1(normalize_rxkhs(readfile(val[1]))); + } else { + bss.hash[val[0]] = hostapd.sha1(readfile(val[1])); + } + } push(bss.data, line); } diff --git a/package/network/services/hostapd/src/src/ap/ucode.c b/package/network/services/hostapd/src/src/ap/ucode.c index 2da2b4dc938..adc7c419148 100644 --- a/package/network/services/hostapd/src/src/ap/ucode.c +++ b/package/network/services/hostapd/src/src/ap/ucode.c @@ -823,6 +823,7 @@ int hostapd_ucode_init(struct hapd_interfaces *ifaces) { "printf", uc_wpa_printf }, { "getpid", uc_wpa_getpid }, { "sha1", uc_wpa_sha1 }, + { "rkh_derive_key", uc_wpa_rkh_derive_key }, { "freq_info", uc_wpa_freq_info }, { "add_iface", uc_hostapd_add_iface }, { "remove_iface", uc_hostapd_remove_iface }, diff --git a/package/network/services/hostapd/src/src/utils/ucode.c b/package/network/services/hostapd/src/src/utils/ucode.c index 29c753c3269..50b87982cee 100644 --- a/package/network/services/hostapd/src/src/utils/ucode.c +++ b/package/network/services/hostapd/src/src/utils/ucode.c @@ -3,6 +3,7 @@ #include "utils/eloop.h" #include "crypto/crypto.h" #include "crypto/sha1.h" +#include "crypto/sha256.h" #include "common/ieee802_11_common.h" #include #include @@ -236,6 +237,40 @@ uc_value_t *uc_wpa_sha1(uc_vm_t *vm, size_t nargs) return ucv_string_new_length(hash_hex, 2 * ARRAY_SIZE(hash)); } +uc_value_t *uc_wpa_rkh_derive_key(uc_vm_t *vm, size_t nargs) +{ + u8 oldkey[16]; + char *oldkey_hex; + u8 key[SHA256_MAC_LEN]; + size_t key_len = sizeof(key); + char key_hex[2 * ARRAY_SIZE(key) + 1]; + uc_value_t *val = uc_fn_arg(0); + int i; + + if (ucv_type(val) != UC_STRING) + return NULL; + + oldkey_hex = ucv_string_get(val); + + if (!hexstr2bin(oldkey_hex, key, key_len)) + return ucv_string_new_length(oldkey_hex, 2 * ARRAY_SIZE(key)); + + if (hexstr2bin(oldkey_hex, oldkey, sizeof(oldkey))) { + wpa_printf(MSG_ERROR, "Invalid RxKH key: '%s'", oldkey_hex); + return NULL; + } + + if (hmac_sha256_kdf(oldkey, sizeof(oldkey), "FT OLDKEY", NULL, 0, key, key_len) < 0) { + wpa_printf(MSG_ERROR, "Invalid RxKH key: '%s'", oldkey_hex); + return NULL; + } + + for (i = 0; i < ARRAY_SIZE(key); i++) + sprintf(key_hex + 2 * i, "%02x", key[i]); + + return ucv_string_new_length(key_hex, 2 * ARRAY_SIZE(key)); +} + uc_vm_t *wpa_ucode_create_vm(void) { static uc_parse_config_t config = { diff --git a/package/network/services/hostapd/src/src/utils/ucode.h b/package/network/services/hostapd/src/src/utils/ucode.h index c083241e079..a273c19b7bc 100644 --- a/package/network/services/hostapd/src/src/utils/ucode.h +++ b/package/network/services/hostapd/src/src/utils/ucode.h @@ -25,6 +25,7 @@ uc_value_t *uc_wpa_udebug_set(uc_vm_t *vm, size_t nargs); uc_value_t *uc_wpa_printf(uc_vm_t *vm, size_t nargs); uc_value_t *uc_wpa_getpid(uc_vm_t *vm, size_t nargs); uc_value_t *uc_wpa_sha1(uc_vm_t *vm, size_t nargs); +uc_value_t *uc_wpa_rkh_derive_key(uc_vm_t *vm, size_t nargs); uc_value_t *uc_wpa_freq_info(uc_vm_t *vm, size_t nargs); #endif From 4a083833399077f54e8ff40a49d688d4c5c9e762 Mon Sep 17 00:00:00 2001 From: Jiale Liu Date: Mon, 15 Apr 2024 00:27:49 +0800 Subject: [PATCH 047/149] base-files: fix luci TZ default show zonename fix default timezone to correct GMT0, origin value 'UTC' is zonename, not timezone. Signed-off-by: Jiale Liu Link: https://github.com/openwrt/openwrt/pull/15128 Signed-off-by: John Crispin --- package/base-files/files/bin/config_generate | 3 ++- package/base-files/files/etc/init.d/system | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate index ca40a62cd4c..fecf82fcaa6 100755 --- a/package/base-files/files/bin/config_generate +++ b/package/base-files/files/bin/config_generate @@ -312,7 +312,8 @@ generate_static_system() { delete system.@system[0] add system system set system.@system[-1].hostname='OpenWrt' - set system.@system[-1].timezone='UTC' + set system.@system[-1].timezone='GMT0' + set system.@system[-1].zonename='UTC' set system.@system[-1].ttylogin='0' set system.@system[-1].log_size='128' set system.@system[-1].urandom_seed='0' diff --git a/package/base-files/files/etc/init.d/system b/package/base-files/files/etc/init.d/system index dcfc2616c6d..cff2d87072f 100755 --- a/package/base-files/files/etc/init.d/system +++ b/package/base-files/files/etc/init.d/system @@ -9,8 +9,8 @@ validate_system_section() { 'hostname:string:OpenWrt' \ 'conloglevel:uinteger' \ 'buffersize:uinteger' \ - 'timezone:string:UTC' \ - 'zonename:string' + 'timezone:string:GMT0' \ + 'zonename:string:UTC' } system_config() { From 3bd2cee9bf85f01732e05e0c8fb070fb18c74095 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 3 Dec 2024 13:37:21 -0800 Subject: [PATCH 048/149] ipq40xx: use PHY to control USB GPIO Instead of using regulator-output to manually control USB GPIO, let the PHY handle it. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/17221 Signed-off-by: John Crispin --- .../arch/arm/boot/dts/qcom/qcom-ipq4019-wia3300-20.dts | 7 ++----- target/linux/ipq40xx/generic/config-default | 1 - 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4019-wia3300-20.dts b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4019-wia3300-20.dts index 644329419d9..85ad382223d 100644 --- a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4019-wia3300-20.dts +++ b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4019-wia3300-20.dts @@ -68,11 +68,6 @@ }; }; - output-usb-power { - compatible = "regulator-output"; - vout-supply = <®_usb>; - }; - reg_usb: regulator-usb { compatible = "regulator-fixed"; @@ -419,6 +414,8 @@ &usb2_hs_phy { status = "okay"; + + phy-supply = <®_usb>; }; &watchdog { diff --git a/target/linux/ipq40xx/generic/config-default b/target/linux/ipq40xx/generic/config-default index 4999ad36223..bd9876a0b64 100644 --- a/target/linux/ipq40xx/generic/config-default +++ b/target/linux/ipq40xx/generic/config-default @@ -3,5 +3,4 @@ CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y CONFIG_MTD_UBI_NVMEM=y CONFIG_MTD_UBI_WL_THRESHOLD=4096 -CONFIG_REGULATOR_USERSPACE_CONSUMER=y CONFIG_UBIFS_FS=y From a2f0cd35ac1d15e69f4897b35c049e175dd06825 Mon Sep 17 00:00:00 2001 From: Andreas Gnau Date: Tue, 28 Feb 2023 16:54:57 +0530 Subject: [PATCH 049/149] dropbear: Name pid file by uci section name Name the pidfile of each dropbear instance according to the corresponding uci section name. This enables a 1:1 mapping between the definition of the service instance and its process. Signed-off-by: Andreas Gnau Link: https://github.com/openwrt/openwrt/pull/15177 Signed-off-by: John Crispin --- package/network/services/dropbear/files/dropbear.init | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/package/network/services/dropbear/files/dropbear.init b/package/network/services/dropbear/files/dropbear.init index 395237f9bc2..11e89340db3 100755 --- a/package/network/services/dropbear/files/dropbear.init +++ b/package/network/services/dropbear/files/dropbear.init @@ -8,7 +8,6 @@ STOP=50 USE_PROCD=1 PROG=/usr/sbin/dropbear NAME=dropbear -PIDCOUNT=0 extra_command "killclients" "Kill ${NAME} processes except servers and yourself" @@ -298,8 +297,7 @@ dropbear_instance() break done - PIDCOUNT="$(( ${PIDCOUNT} + 1))" - local pid_file="/var/run/${NAME}.${PIDCOUNT}.pid" + local pid_file="/var/run/${NAME}.${1}.pid" procd_open_instance procd_set_param command "$PROG" -F -P "$pid_file" From b6c7d8a0d60fddd162c77371e2500f485339e2c7 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 13 Dec 2024 10:56:50 +0100 Subject: [PATCH 050/149] wifi-scripts: fix mesh/sta setup with ucode scripts Ensure that the code doesn't pass macaddr_base with the wrong type (null) to the supplicant setup/start call. Signed-off-by: Felix Fietkau --- .../files-ucode/usr/share/ucode/wifi/supplicant.uc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc index c7bfeb6b9a6..2942767f0b7 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc @@ -221,7 +221,7 @@ export function setup(config, data) { config, defer: true, num_global_macaddr: data.config.num_global_macaddr, - macaddr_base: data.config.macaddr_base, + macaddr_base: data.config.macaddr_base ?? "", }); if (ret) @@ -236,6 +236,6 @@ export function start(data) { phy: data.phy, radio: data.config.radio, num_global_macaddr: data.config.num_global_macaddr, - macaddr_base: data.config.macaddr_base, + macaddr_base: data.config.macaddr_base ?? "", }); }; From 225b84d5832ddcc35ebc73e7cea34e9846cfa6f5 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 13 Dec 2024 11:04:04 +0100 Subject: [PATCH 051/149] hostapd: fix building mini variants Move function and add ifdef to avoid undefined reference to hmac_sha256_kdf. Signed-off-by: Felix Fietkau --- .../services/hostapd/src/src/ap/ucode.c | 39 +++++++++++++++++++ .../services/hostapd/src/src/utils/ucode.c | 34 ---------------- .../services/hostapd/src/src/utils/ucode.h | 1 - 3 files changed, 39 insertions(+), 35 deletions(-) diff --git a/package/network/services/hostapd/src/src/ap/ucode.c b/package/network/services/hostapd/src/src/ap/ucode.c index adc7c419148..e496b8b7aae 100644 --- a/package/network/services/hostapd/src/src/ap/ucode.c +++ b/package/network/services/hostapd/src/src/ap/ucode.c @@ -817,6 +817,45 @@ void hostapd_ucode_sta_connected(struct hostapd_data *hapd, struct sta_info *sta ucv_put(val); } +static uc_value_t * +uc_wpa_rkh_derive_key(uc_vm_t *vm, size_t nargs) +{ +#ifdef CONFIG_IEEE80211R_AP + u8 oldkey[16]; + char *oldkey_hex; + u8 key[SHA256_MAC_LEN]; + size_t key_len = sizeof(key); + char key_hex[2 * ARRAY_SIZE(key) + 1]; + uc_value_t *val = uc_fn_arg(0); + int i; + + if (ucv_type(val) != UC_STRING) + return NULL; + + oldkey_hex = ucv_string_get(val); + + if (!hexstr2bin(oldkey_hex, key, key_len)) + return ucv_string_new_length(oldkey_hex, 2 * ARRAY_SIZE(key)); + + if (hexstr2bin(oldkey_hex, oldkey, sizeof(oldkey))) { + wpa_printf(MSG_ERROR, "Invalid RxKH key: '%s'", oldkey_hex); + return NULL; + } + + if (hmac_sha256_kdf(oldkey, sizeof(oldkey), "FT OLDKEY", NULL, 0, key, key_len) < 0) { + wpa_printf(MSG_ERROR, "Invalid RxKH key: '%s'", oldkey_hex); + return NULL; + } + + for (i = 0; i < ARRAY_SIZE(key); i++) + sprintf(key_hex + 2 * i, "%02x", key[i]); + + return ucv_string_new_length(key_hex, 2 * ARRAY_SIZE(key)); +#else + return NULL; +#endif +} + int hostapd_ucode_init(struct hapd_interfaces *ifaces) { static const uc_function_list_t global_fns[] = { diff --git a/package/network/services/hostapd/src/src/utils/ucode.c b/package/network/services/hostapd/src/src/utils/ucode.c index 50b87982cee..a1762844b5c 100644 --- a/package/network/services/hostapd/src/src/utils/ucode.c +++ b/package/network/services/hostapd/src/src/utils/ucode.c @@ -237,40 +237,6 @@ uc_value_t *uc_wpa_sha1(uc_vm_t *vm, size_t nargs) return ucv_string_new_length(hash_hex, 2 * ARRAY_SIZE(hash)); } -uc_value_t *uc_wpa_rkh_derive_key(uc_vm_t *vm, size_t nargs) -{ - u8 oldkey[16]; - char *oldkey_hex; - u8 key[SHA256_MAC_LEN]; - size_t key_len = sizeof(key); - char key_hex[2 * ARRAY_SIZE(key) + 1]; - uc_value_t *val = uc_fn_arg(0); - int i; - - if (ucv_type(val) != UC_STRING) - return NULL; - - oldkey_hex = ucv_string_get(val); - - if (!hexstr2bin(oldkey_hex, key, key_len)) - return ucv_string_new_length(oldkey_hex, 2 * ARRAY_SIZE(key)); - - if (hexstr2bin(oldkey_hex, oldkey, sizeof(oldkey))) { - wpa_printf(MSG_ERROR, "Invalid RxKH key: '%s'", oldkey_hex); - return NULL; - } - - if (hmac_sha256_kdf(oldkey, sizeof(oldkey), "FT OLDKEY", NULL, 0, key, key_len) < 0) { - wpa_printf(MSG_ERROR, "Invalid RxKH key: '%s'", oldkey_hex); - return NULL; - } - - for (i = 0; i < ARRAY_SIZE(key); i++) - sprintf(key_hex + 2 * i, "%02x", key[i]); - - return ucv_string_new_length(key_hex, 2 * ARRAY_SIZE(key)); -} - uc_vm_t *wpa_ucode_create_vm(void) { static uc_parse_config_t config = { diff --git a/package/network/services/hostapd/src/src/utils/ucode.h b/package/network/services/hostapd/src/src/utils/ucode.h index a273c19b7bc..c083241e079 100644 --- a/package/network/services/hostapd/src/src/utils/ucode.h +++ b/package/network/services/hostapd/src/src/utils/ucode.h @@ -25,7 +25,6 @@ uc_value_t *uc_wpa_udebug_set(uc_vm_t *vm, size_t nargs); uc_value_t *uc_wpa_printf(uc_vm_t *vm, size_t nargs); uc_value_t *uc_wpa_getpid(uc_vm_t *vm, size_t nargs); uc_value_t *uc_wpa_sha1(uc_vm_t *vm, size_t nargs); -uc_value_t *uc_wpa_rkh_derive_key(uc_vm_t *vm, size_t nargs); uc_value_t *uc_wpa_freq_info(uc_vm_t *vm, size_t nargs); #endif From 508bf7ca0fc58d5f9d156bd05b5ae9a6e5b780e3 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 3 Dec 2024 13:29:37 -0800 Subject: [PATCH 052/149] lantiq: use regulator for USB GPIO One is already present. The other one can be implemented in terms of the PHY. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/17250 Signed-off-by: John Crispin --- .../mips/boot/dts/lantiq/ar9_zte_h201l.dts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_zte_h201l.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_zte_h201l.dts index a0e3664b6db..3e8cbcf84bc 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_zte_h201l.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_zte_h201l.dts @@ -96,11 +96,6 @@ gpio-export,output = <1>; gpios = <&gpio 38 GPIO_ACTIVE_HIGH>; }; - usb { - gpio-export,name = "usb"; - gpio-export,output = <1>; - gpios = <&gpio 28 GPIO_ACTIVE_HIGH>; - }; wifi { gpio-export,name = "wifi"; gpio-export,output = <1>; @@ -108,6 +103,18 @@ }; }; + usb_phy: regulator-usb-phy { + compatible = "regulator-fixed"; + + regulator-name = "USB_PHY"; + + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + + gpios = <&gpio 28 GPIO_ACTIVE_HIGH>; + enable-active-high; + }; + usb_vbus: regulator-usb-vbus { compatible = "regulator-fixed"; @@ -166,6 +173,7 @@ &usb_phy0 { status = "okay"; + phy-supply = <&usb_phy>; }; From fb17914f65a430555b908929682d8b36d6e31b12 Mon Sep 17 00:00:00 2001 From: Georgi Valkov Date: Thu, 12 Dec 2024 11:05:15 +0200 Subject: [PATCH 053/149] mac80211: refresh patch for ath12k refresh the following patch for ath12k 001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch Signed-off-by: Georgi Valkov Link: https://github.com/openwrt/openwrt/pull/17246 Signed-off-by: John Crispin --- ...-and-handle-country-code-for-WCN7850.patch | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch b/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch index d370db10471..f368ccd2727 100644 --- a/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch +++ b/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch @@ -121,7 +121,7 @@ Acked-by: Jeff Johnson }; static __le32 ath12k_wmi_tlv_hdr(u32 cmd, u32 len) -@@ -2363,7 +2365,10 @@ int ath12k_wmi_send_scan_start_cmd(struc +@@ -2364,7 +2366,10 @@ int ath12k_wmi_send_scan_start_cmd(struc cmd->scan_id = cpu_to_le32(arg->scan_id); cmd->scan_req_id = cpu_to_le32(arg->scan_req_id); cmd->vdev_id = cpu_to_le32(arg->vdev_id); @@ -133,7 +133,7 @@ Acked-by: Jeff Johnson cmd->notify_scan_events = cpu_to_le32(arg->notify_scan_events); ath12k_wmi_copy_scan_event_cntrl_flags(cmd, arg); -@@ -3083,6 +3088,110 @@ out: +@@ -3084,6 +3089,110 @@ out: return ret; } @@ -244,7 +244,7 @@ Acked-by: Jeff Johnson int ath12k_wmi_send_twt_enable_cmd(struct ath12k *ar, u32 pdev_id) { -@@ -5668,6 +5777,50 @@ static void ath12k_wmi_op_ep_tx_credits( +@@ -5669,6 +5778,50 @@ static void ath12k_wmi_op_ep_tx_credits( wake_up(&ab->wmi_ab.tx_credits_wq); } @@ -295,7 +295,7 @@ Acked-by: Jeff Johnson static void ath12k_wmi_htc_tx_complete(struct ath12k_base *ab, struct sk_buff *skb) { -@@ -7269,6 +7422,9 @@ static void ath12k_wmi_op_rx(struct ath1 +@@ -7270,6 +7423,9 @@ static void ath12k_wmi_op_rx(struct ath1 case WMI_GTK_OFFLOAD_STATUS_EVENTID: ath12k_wmi_gtk_offload_status_event(ab, skb); break; @@ -307,7 +307,7 @@ Acked-by: Jeff Johnson ath12k_dbg(ab, ATH12K_DBG_WMI, "Unknown eventid: 0x%x\n", id); --- a/drivers/net/wireless/ath/ath12k/wmi.h +++ b/drivers/net/wireless/ath/ath12k/wmi.h -@@ -3859,6 +3859,28 @@ struct wmi_init_country_cmd { +@@ -3860,6 +3860,28 @@ struct wmi_init_country_cmd { } cc_info; } __packed; @@ -336,7 +336,7 @@ Acked-by: Jeff Johnson struct wmi_delba_send_cmd { __le32 tlv_header; __le32 vdev_id; -@@ -3944,6 +3966,16 @@ struct ath12k_wmi_eht_rate_set_params { +@@ -3945,6 +3967,16 @@ struct ath12k_wmi_eht_rate_set_params { #define MAX_6G_REG_RULES 5 #define REG_US_5G_NUM_REG_RULES 4 @@ -353,7 +353,7 @@ Acked-by: Jeff Johnson enum wmi_start_event_param { WMI_VDEV_START_RESP_EVENT = 0, WMI_VDEV_RESTART_RESP_EVENT, -@@ -5546,11 +5578,17 @@ int ath12k_wmi_send_bcn_offload_control_ +@@ -5547,11 +5579,17 @@ int ath12k_wmi_send_bcn_offload_control_ u32 vdev_id, u32 bcn_ctrl_op); int ath12k_wmi_send_init_country_cmd(struct ath12k *ar, struct ath12k_wmi_init_country_arg *arg); @@ -485,7 +485,7 @@ Acked-by: Jeff Johnson u32 fw_crash_counter; --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c -@@ -2947,6 +2947,11 @@ static void ath12k_bss_assoc(struct ath1 +@@ -2946,6 +2946,11 @@ static void ath12k_bss_assoc(struct ath1 if (ret) ath12k_warn(ar->ab, "failed to set vdev %i OBSS PD parameters: %d\n", arvif->vdev_id, ret); @@ -497,7 +497,7 @@ Acked-by: Jeff Johnson } static void ath12k_bss_disassoc(struct ath12k *ar, -@@ -3522,7 +3527,7 @@ void __ath12k_mac_scan_finish(struct ath +@@ -3521,7 +3526,7 @@ void __ath12k_mac_scan_finish(struct ath ar->scan_channel = NULL; ar->scan.roc_freq = 0; cancel_delayed_work(&ar->scan.timeout); @@ -506,7 +506,7 @@ Acked-by: Jeff Johnson break; } } -@@ -3783,7 +3788,12 @@ scan: +@@ -3782,7 +3787,12 @@ scan: ret = ath12k_start_scan(ar, &arg); if (ret) { @@ -520,7 +520,7 @@ Acked-by: Jeff Johnson spin_lock_bh(&ar->data_lock); ar->scan.state = ATH12K_SCAN_IDLE; spin_unlock_bh(&ar->data_lock); -@@ -3802,6 +3812,11 @@ exit: +@@ -3801,6 +3811,11 @@ exit: mutex_unlock(&ar->conf_mutex); @@ -532,7 +532,7 @@ Acked-by: Jeff Johnson return ret; } -@@ -5986,7 +6001,7 @@ static int ath12k_mac_start(struct ath12 +@@ -5985,7 +6000,7 @@ static int ath12k_mac_start(struct ath12 /* TODO: Do we need to enable ANI? */ @@ -541,7 +541,7 @@ Acked-by: Jeff Johnson ar->num_started_vdevs = 0; ar->num_created_vdevs = 0; -@@ -6166,6 +6181,9 @@ static void ath12k_mac_stop(struct ath12 +@@ -6165,6 +6180,9 @@ static void ath12k_mac_stop(struct ath12 cancel_delayed_work_sync(&ar->scan.timeout); cancel_work_sync(&ar->regd_update_work); cancel_work_sync(&ar->ab->rfkill_work); @@ -551,7 +551,7 @@ Acked-by: Jeff Johnson spin_lock_bh(&ar->data_lock); list_for_each_entry_safe(ppdu_stats, tmp, &ar->ppdu_stats_info, list) { -@@ -6412,6 +6430,117 @@ static void ath12k_mac_op_update_vif_off +@@ -6411,6 +6429,117 @@ static void ath12k_mac_op_update_vif_off ath12k_mac_update_vif_offload(arvif); } @@ -669,7 +669,7 @@ Acked-by: Jeff Johnson static int ath12k_mac_vdev_create(struct ath12k *ar, struct ieee80211_vif *vif) { struct ath12k_hw *ah = ar->ah; -@@ -6526,6 +6655,7 @@ static int ath12k_mac_vdev_create(struct +@@ -6525,6 +6654,7 @@ static int ath12k_mac_vdev_create(struct arvif->vdev_id, ret); goto err_peer_del; } @@ -677,7 +677,7 @@ Acked-by: Jeff Johnson break; case WMI_VDEV_TYPE_STA: param_id = WMI_STA_PS_PARAM_RX_WAKE_POLICY; -@@ -6564,6 +6694,13 @@ static int ath12k_mac_vdev_create(struct +@@ -6563,6 +6693,13 @@ static int ath12k_mac_vdev_create(struct arvif->vdev_id, ret); goto err_peer_del; } @@ -691,7 +691,7 @@ Acked-by: Jeff Johnson break; default: break; -@@ -6904,6 +7041,11 @@ static void ath12k_mac_op_remove_interfa +@@ -6903,6 +7040,11 @@ static void ath12k_mac_op_remove_interfa ath12k_dbg(ab, ATH12K_DBG_MAC, "mac remove interface (vdev %d)\n", arvif->vdev_id); @@ -703,7 +703,7 @@ Acked-by: Jeff Johnson if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { ret = ath12k_peer_delete(ar, arvif->vdev_id, vif->addr); if (ret) -@@ -7744,6 +7886,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc +@@ -7743,6 +7885,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc ar->num_started_vdevs == 1 && ar->monitor_vdev_created) ath12k_mac_monitor_stop(ar); @@ -718,7 +718,7 @@ Acked-by: Jeff Johnson mutex_unlock(&ar->conf_mutex); } -@@ -8282,6 +8432,14 @@ ath12k_mac_op_reconfig_complete(struct i +@@ -8281,6 +8431,14 @@ ath12k_mac_op_reconfig_complete(struct i ath12k_warn(ar->ab, "pdev %d successfully recovered\n", ar->pdev->pdev_id); @@ -733,7 +733,7 @@ Acked-by: Jeff Johnson if (ab->is_reset) { recovery_count = atomic_inc_return(&ab->recovery_count); -@@ -9331,6 +9489,9 @@ static void ath12k_mac_setup(struct ath1 +@@ -9330,6 +9488,9 @@ static void ath12k_mac_setup(struct ath1 INIT_WORK(&ar->wmi_mgmt_tx_work, ath12k_mgmt_over_wmi_tx_work); skb_queue_head_init(&ar->wmi_mgmt_tx_queue); From 76fabd909e64fe2f6e56e28ded90053d1293b242 Mon Sep 17 00:00:00 2001 From: David Bauer Date: Sat, 7 Dec 2024 14:47:29 +0100 Subject: [PATCH 054/149] wifi-scripts: don't fail on unset PSK Don't fail wireless interface bringup on empty PSK set. This is a valid configuration, resulting in a PSK network which can't be connected to. It does not fail the bringup of the hostapd process. Keep failing the interface setup in case a password with invalid length is used. This is also beneficial when intending to configure a PPSK network. It allows to create a network where no PPSK is yet set. Signed-off-by: David Bauer Link: https://github.com/openwrt/openwrt/pull/17197 Signed-off-by: John Crispin --- package/network/config/wifi-scripts/files/lib/netifd/hostapd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/config/wifi-scripts/files/lib/netifd/hostapd.sh b/package/network/config/wifi-scripts/files/lib/netifd/hostapd.sh index 3285ee4312f..080f15d7a65 100644 --- a/package/network/config/wifi-scripts/files/lib/netifd/hostapd.sh +++ b/package/network/config/wifi-scripts/files/lib/netifd/hostapd.sh @@ -724,7 +724,7 @@ hostapd_set_bss_options() { append bss_conf "wpa_psk=$key" "$N" elif [ ${#key} -ge 8 ] && [ ${#key} -le 63 ]; then append bss_conf "wpa_passphrase=$key" "$N" - elif [ -n "$key" ] || [ -z "$wpa_psk_file" ] || [ -z "$sae_password_file" ]; then + elif [ -n "$key" ]; then wireless_setup_vif_failed INVALID_WPA_PSK return 1 fi From dcef169319a4b90160c1d52ee6c1ddb6c3c6fe2c Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 28 Nov 2024 20:21:20 -0800 Subject: [PATCH 055/149] ath79: usb: remove usb- from reset-names This matches the upstream PHY driver, which removed it. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/17118 Signed-off-by: John Crispin --- target/linux/ath79/dts/ar7100.dtsi | 2 +- target/linux/ath79/dts/ar7240.dtsi | 2 +- target/linux/ath79/dts/ar7241.dtsi | 2 +- target/linux/ath79/dts/ar7242.dtsi | 2 +- target/linux/ath79/dts/ar9132.dtsi | 2 +- target/linux/ath79/dts/ar9330.dtsi | 2 +- target/linux/ath79/dts/ar934x.dtsi | 2 +- target/linux/ath79/dts/qca953x.dtsi | 2 +- target/linux/ath79/dts/qca955x.dtsi | 4 ++-- target/linux/ath79/dts/qca956x.dtsi | 4 ++-- .../ath79/patches-6.6/700-phy-add-ath79-usb-phys.patch | 8 ++++---- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/target/linux/ath79/dts/ar7100.dtsi b/target/linux/ath79/dts/ar7100.dtsi index 5237157458e..bac27d92849 100644 --- a/target/linux/ath79/dts/ar7100.dtsi +++ b/target/linux/ath79/dts/ar7100.dtsi @@ -54,7 +54,7 @@ compatible = "qca,ar7100-usb-phy"; reg = <0x18030000 0x10>; - reset-names = "usb-phy", "usb-host", "usb-ohci-dll"; + reset-names = "phy", "usb-host", "usb-ohci-dll"; resets = <&rst 4>, <&rst 5>, <&rst 6>; #phy-cells = <0>; diff --git a/target/linux/ath79/dts/ar7240.dtsi b/target/linux/ath79/dts/ar7240.dtsi index eb4b2e4aa39..23409b25d6c 100644 --- a/target/linux/ath79/dts/ar7240.dtsi +++ b/target/linux/ath79/dts/ar7240.dtsi @@ -6,7 +6,7 @@ usb_phy: usb-phy { compatible = "qca,ar7200-usb-phy"; - reset-names = "usb-phy", "usb-ohci-dll"; + reset-names = "phy", "usb-ohci-dll"; resets = <&rst 4>, <&rst 3>; #phy-cells = <0>; diff --git a/target/linux/ath79/dts/ar7241.dtsi b/target/linux/ath79/dts/ar7241.dtsi index 8d0e60da402..3dd07400252 100644 --- a/target/linux/ath79/dts/ar7241.dtsi +++ b/target/linux/ath79/dts/ar7241.dtsi @@ -6,7 +6,7 @@ usb_phy: usb-phy { compatible = "qca,ar7200-usb-phy"; - reset-names = "usb-phy", "usb-suspend-override"; + reset-names = "phy", "suspend-override"; resets = <&rst 4>, <&rst 3>; #phy-cells = <0>; diff --git a/target/linux/ath79/dts/ar7242.dtsi b/target/linux/ath79/dts/ar7242.dtsi index aab6c28f7b1..9b4cc9920a7 100644 --- a/target/linux/ath79/dts/ar7242.dtsi +++ b/target/linux/ath79/dts/ar7242.dtsi @@ -6,7 +6,7 @@ usb_phy: usb-phy { compatible = "qca,ar7200-usb-phy"; - reset-names = "usb-phy", "usb-suspend-override"; + reset-names = "phy", "suspend-override"; resets = <&rst 4>, <&rst 3>; #phy-cells = <0>; diff --git a/target/linux/ath79/dts/ar9132.dtsi b/target/linux/ath79/dts/ar9132.dtsi index 71181c46de6..2ea689fac16 100644 --- a/target/linux/ath79/dts/ar9132.dtsi +++ b/target/linux/ath79/dts/ar9132.dtsi @@ -188,7 +188,7 @@ usb_phy: usb-phy { compatible = "qca,ar7200-usb-phy"; - reset-names = "usb-phy", "usb-suspend-override"; + reset-names = "phy", "suspend-override"; resets = <&rst 4>, <&rst 3>; #phy-cells = <0>; diff --git a/target/linux/ath79/dts/ar9330.dtsi b/target/linux/ath79/dts/ar9330.dtsi index 466e0fb25dc..5b53ec1e4f1 100644 --- a/target/linux/ath79/dts/ar9330.dtsi +++ b/target/linux/ath79/dts/ar9330.dtsi @@ -166,7 +166,7 @@ usb_phy: usb-phy { compatible = "qca,ar7200-usb-phy"; - reset-names = "usb-phy", "usb-suspend-override"; + reset-names = "phy", "suspend-override"; resets = <&rst 4>, <&rst 3>; #phy-cells = <0>; diff --git a/target/linux/ath79/dts/ar934x.dtsi b/target/linux/ath79/dts/ar934x.dtsi index 98cd76629f3..c3bdfc916d6 100644 --- a/target/linux/ath79/dts/ar934x.dtsi +++ b/target/linux/ath79/dts/ar934x.dtsi @@ -216,7 +216,7 @@ usb_phy: usb-phy { compatible = "qca,ar9340-usb-phy", "qca,ar7200-usb-phy"; - reset-names = "usb-phy-analog", "usb-phy", "usb-suspend-override"; + reset-names = "phy-analog", "phy", "suspend-override"; resets = <&rst 11>, <&rst 4>, <&rst 3>; #phy-cells = <0>; diff --git a/target/linux/ath79/dts/qca953x.dtsi b/target/linux/ath79/dts/qca953x.dtsi index 0e52a80f6e7..ccfc3380beb 100644 --- a/target/linux/ath79/dts/qca953x.dtsi +++ b/target/linux/ath79/dts/qca953x.dtsi @@ -60,7 +60,7 @@ reg = <0x18030000 0x100>; #phy-cells = <0>; - reset-names = "usb-phy-analog", "usb-phy", "usb-suspend-override"; + reset-names = "phy-analog", "phy", "suspend-override"; resets = <&rst 11>, <&rst 4>, <&rst 3>; status = "disabled"; diff --git a/target/linux/ath79/dts/qca955x.dtsi b/target/linux/ath79/dts/qca955x.dtsi index f8318b8f65d..719b965d1cf 100644 --- a/target/linux/ath79/dts/qca955x.dtsi +++ b/target/linux/ath79/dts/qca955x.dtsi @@ -64,7 +64,7 @@ compatible ="qca,qca9550-usb-phy", "qca,ar7200-usb-phy"; reg = <0x18030000 4>, <0x18030004 4>; - reset-names = "usb-phy-analog", "usb-phy", "usb-suspend-override"; + reset-names = "phy-analog", "phy", "suspend-override"; resets = <&rst 11>, <&rst 4>, <&rst 3>; #phy-cells = <0>; @@ -76,7 +76,7 @@ compatible = "qca,qca9550-usb-phy", "qca,ar7200-usb-phy"; reg = <0x18030010 4>, <0x18030014 4>; - reset-names = "usb-phy-analog", "usb-phy", "usb-suspend-override"; + reset-names = "phy-analog", "phy", "suspend-override"; resets = <&rst2 11>, <&rst2 4>, <&rst2 3>; #phy-cells = <0>; diff --git a/target/linux/ath79/dts/qca956x.dtsi b/target/linux/ath79/dts/qca956x.dtsi index de685d053c7..9581e874219 100644 --- a/target/linux/ath79/dts/qca956x.dtsi +++ b/target/linux/ath79/dts/qca956x.dtsi @@ -254,7 +254,7 @@ usb_phy0: usb-phy { compatible = "qca,qca9560-usb-phy", "qca,ar7200-usb-phy"; - reset-names = "usb-phy", "usb-suspend-override"; + reset-names = "phy", "suspend-override"; resets = <&rst 4>, <&rst 3>; #phy-cells = <0>; @@ -265,7 +265,7 @@ usb_phy1: usb-phy { compatible = "qca,qca9560-usb-phy", "qca,ar7200-usb-phy"; - reset-names = "usb-phy", "usb-suspend-override"; + reset-names = "phy", "suspend-override"; resets = <&rst2 4>, <&rst2 3>; #phy-cells = <0>; diff --git a/target/linux/ath79/patches-6.6/700-phy-add-ath79-usb-phys.patch b/target/linux/ath79/patches-6.6/700-phy-add-ath79-usb-phys.patch index 98c399c9e09..98879927cbe 100644 --- a/target/linux/ath79/patches-6.6/700-phy-add-ath79-usb-phys.patch +++ b/target/linux/ath79/patches-6.6/700-phy-add-ath79-usb-phys.patch @@ -128,7 +128,7 @@ Signed-off-by: John Crispin + if (IS_ERR(priv->io_base)) + return PTR_ERR(priv->io_base); + -+ priv->rst_phy = devm_reset_control_get(&pdev->dev, "usb-phy"); ++ priv->rst_phy = devm_reset_control_get(&pdev->dev, "phy"); + if (IS_ERR(priv->rst_phy)) + return dev_err_probe(&pdev->dev, PTR_ERR(priv->rst_phy), "phy reset is missing"); + @@ -250,17 +250,17 @@ Signed-off-by: John Crispin + if (!priv) + return -ENOMEM; + -+ priv->rst_phy = devm_reset_control_get(&pdev->dev, "usb-phy"); ++ priv->rst_phy = devm_reset_control_get(&pdev->dev, "phy"); + if (IS_ERR(priv->rst_phy)) + return dev_err_probe(&pdev->dev, PTR_ERR(priv->rst_phy), "phy reset is missing"); + + priv->rst_phy_analog = devm_reset_control_get_optional( -+ &pdev->dev, "usb-phy-analog"); ++ &pdev->dev, "phy-analog"); + if (IS_ERR(priv->rst_phy_analog)) + return PTR_ERR(priv->rst_phy_analog); + + priv->suspend_override = devm_reset_control_get_optional( -+ &pdev->dev, "usb-suspend-override"); ++ &pdev->dev, "suspend-override"); + if (IS_ERR(priv->suspend_override)) + return PTR_ERR(priv->suspend_override); + From 787cb9d87edbf3c853328bf26e41dcff2ddde8c8 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 28 Nov 2024 20:44:51 -0800 Subject: [PATCH 056/149] ath79: change phy-names to only usb Both generic-ehci.yaml and generic-ohci.yaml state that phy-names is to only be usb. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/17118 Signed-off-by: John Crispin --- target/linux/ath79/dts/ar7100.dtsi | 4 ++-- target/linux/ath79/dts/ar7240.dtsi | 2 +- target/linux/ath79/dts/ar7241.dtsi | 2 +- target/linux/ath79/dts/ar7242.dtsi | 2 +- target/linux/ath79/dts/ar9330.dtsi | 2 +- target/linux/ath79/dts/ar934x.dtsi | 2 +- target/linux/ath79/dts/qca953x.dtsi | 2 +- target/linux/ath79/dts/qca955x.dtsi | 4 ++-- target/linux/ath79/dts/qca956x.dtsi | 4 ++-- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/target/linux/ath79/dts/ar7100.dtsi b/target/linux/ath79/dts/ar7100.dtsi index bac27d92849..a23b61c935a 100644 --- a/target/linux/ath79/dts/ar7100.dtsi +++ b/target/linux/ath79/dts/ar7100.dtsi @@ -147,7 +147,7 @@ interrupt-parent = <&cpuintc>; interrupts = <3>; - phy-names = "usb-phy"; + phy-names = "usb"; phys = <&usb_phy>; has-synopsys-hc-bug; @@ -170,7 +170,7 @@ interrupt-parent = <&miscintc>; interrupts = <6>; - phy-names = "usb-phy"; + phy-names = "usb"; phys = <&usb_phy>; status = "disabled"; diff --git a/target/linux/ath79/dts/ar7240.dtsi b/target/linux/ath79/dts/ar7240.dtsi index 23409b25d6c..9d6e56b7a47 100644 --- a/target/linux/ath79/dts/ar7240.dtsi +++ b/target/linux/ath79/dts/ar7240.dtsi @@ -29,7 +29,7 @@ resets = <&rst 5>; reset-names = "usb-host"; - phy-names = "usb-phy"; + phy-names = "usb"; phys = <&usb_phy>; status = "disabled"; diff --git a/target/linux/ath79/dts/ar7241.dtsi b/target/linux/ath79/dts/ar7241.dtsi index 3dd07400252..e5813db9782 100644 --- a/target/linux/ath79/dts/ar7241.dtsi +++ b/target/linux/ath79/dts/ar7241.dtsi @@ -32,7 +32,7 @@ has-transaction-translator; caps-offset = <0x100>; - phy-names = "usb-phy"; + phy-names = "usb"; phys = <&usb_phy>; status = "disabled"; diff --git a/target/linux/ath79/dts/ar7242.dtsi b/target/linux/ath79/dts/ar7242.dtsi index 9b4cc9920a7..14609a54f24 100644 --- a/target/linux/ath79/dts/ar7242.dtsi +++ b/target/linux/ath79/dts/ar7242.dtsi @@ -32,7 +32,7 @@ has-transaction-translator; caps-offset = <0x100>; - phy-names = "usb-phy"; + phy-names = "usb"; phys = <&usb_phy>; status = "disabled"; diff --git a/target/linux/ath79/dts/ar9330.dtsi b/target/linux/ath79/dts/ar9330.dtsi index 5b53ec1e4f1..976529bd3ff 100644 --- a/target/linux/ath79/dts/ar9330.dtsi +++ b/target/linux/ath79/dts/ar9330.dtsi @@ -122,7 +122,7 @@ resets = <&rst 5>; reset-names = "usb-host"; - phy-names = "usb-phy"; + phy-names = "usb"; phys = <&usb_phy>; status = "disabled"; diff --git a/target/linux/ath79/dts/ar934x.dtsi b/target/linux/ath79/dts/ar934x.dtsi index c3bdfc916d6..c490f051bb7 100644 --- a/target/linux/ath79/dts/ar934x.dtsi +++ b/target/linux/ath79/dts/ar934x.dtsi @@ -171,7 +171,7 @@ has-transaction-translator; caps-offset = <0x100>; - phy-names = "usb-phy"; + phy-names = "usb"; phys = <&usb_phy>; status = "disabled"; diff --git a/target/linux/ath79/dts/qca953x.dtsi b/target/linux/ath79/dts/qca953x.dtsi index ccfc3380beb..e7feeded7bc 100644 --- a/target/linux/ath79/dts/qca953x.dtsi +++ b/target/linux/ath79/dts/qca953x.dtsi @@ -199,7 +199,7 @@ has-transaction-translator; caps-offset = <0x100>; - phy-names = "usb-phy"; + phy-names = "usb"; phys = <&usb_phy>; status = "disabled"; diff --git a/target/linux/ath79/dts/qca955x.dtsi b/target/linux/ath79/dts/qca955x.dtsi index 719b965d1cf..de27b0e7d2e 100644 --- a/target/linux/ath79/dts/qca955x.dtsi +++ b/target/linux/ath79/dts/qca955x.dtsi @@ -278,7 +278,7 @@ has-transaction-translator; caps-offset = <0x100>; - phy-names = "usb-phy0"; + phy-names = "usb"; phys = <&usb_phy0>; status = "disabled"; @@ -304,7 +304,7 @@ has-transaction-translator; caps-offset = <0x100>; - phy-names = "usb-phy1"; + phy-names = "usb"; phys = <&usb_phy1>; status = "disabled"; diff --git a/target/linux/ath79/dts/qca956x.dtsi b/target/linux/ath79/dts/qca956x.dtsi index 9581e874219..e9f443cbef9 100644 --- a/target/linux/ath79/dts/qca956x.dtsi +++ b/target/linux/ath79/dts/qca956x.dtsi @@ -197,7 +197,7 @@ has-transaction-translator; caps-offset = <0x100>; - phy-names = "usb-phy0"; + phy-names = "usb"; phys = <&usb_phy0>; status = "disabled"; @@ -224,7 +224,7 @@ has-transaction-translator; caps-offset = <0x100>; - phy-names = "usb-phy1"; + phy-names = "usb"; phys = <&usb_phy1>; status = "disabled"; From 481bf5805a5961ba154826d24d40587058066773 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 29 Nov 2024 14:24:38 -0800 Subject: [PATCH 057/149] ath79: usb: remove reset names Upstream uses devm_reset_control_array_get_optional_shared, which does not use names. reset-names is also not specified in the documentation. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/17118 Signed-off-by: John Crispin --- target/linux/ath79/dts/ar7100.dtsi | 2 +- target/linux/ath79/dts/ar7240.dtsi | 1 - target/linux/ath79/dts/ar7241.dtsi | 1 - target/linux/ath79/dts/ar7242.dtsi | 1 - target/linux/ath79/dts/ar9330.dtsi | 1 - target/linux/ath79/dts/ar934x.dtsi | 1 - target/linux/ath79/dts/qca953x.dtsi | 1 - target/linux/ath79/dts/qca955x.dtsi | 2 -- target/linux/ath79/dts/qca956x.dtsi | 2 -- target/linux/ath79/patches-6.6/700-phy-add-ath79-usb-phys.patch | 2 +- 10 files changed, 2 insertions(+), 12 deletions(-) diff --git a/target/linux/ath79/dts/ar7100.dtsi b/target/linux/ath79/dts/ar7100.dtsi index a23b61c935a..1cfe82ded89 100644 --- a/target/linux/ath79/dts/ar7100.dtsi +++ b/target/linux/ath79/dts/ar7100.dtsi @@ -54,7 +54,7 @@ compatible = "qca,ar7100-usb-phy"; reg = <0x18030000 0x10>; - reset-names = "phy", "usb-host", "usb-ohci-dll"; + reset-names = "phy", "host", "usb-ohci-dll"; resets = <&rst 4>, <&rst 5>, <&rst 6>; #phy-cells = <0>; diff --git a/target/linux/ath79/dts/ar7240.dtsi b/target/linux/ath79/dts/ar7240.dtsi index 9d6e56b7a47..d51bd701e57 100644 --- a/target/linux/ath79/dts/ar7240.dtsi +++ b/target/linux/ath79/dts/ar7240.dtsi @@ -27,7 +27,6 @@ interrupts = <3>; resets = <&rst 5>; - reset-names = "usb-host"; phy-names = "usb"; phys = <&usb_phy>; diff --git a/target/linux/ath79/dts/ar7241.dtsi b/target/linux/ath79/dts/ar7241.dtsi index e5813db9782..3eb0b17e79e 100644 --- a/target/linux/ath79/dts/ar7241.dtsi +++ b/target/linux/ath79/dts/ar7241.dtsi @@ -27,7 +27,6 @@ interrupts = <3>; resets = <&rst 5>; - reset-names = "usb-host"; has-transaction-translator; caps-offset = <0x100>; diff --git a/target/linux/ath79/dts/ar7242.dtsi b/target/linux/ath79/dts/ar7242.dtsi index 14609a54f24..414e9676160 100644 --- a/target/linux/ath79/dts/ar7242.dtsi +++ b/target/linux/ath79/dts/ar7242.dtsi @@ -27,7 +27,6 @@ interrupts = <3>; resets = <&rst 5>; - reset-names = "usb-host"; has-transaction-translator; caps-offset = <0x100>; diff --git a/target/linux/ath79/dts/ar9330.dtsi b/target/linux/ath79/dts/ar9330.dtsi index 976529bd3ff..e13e3fd5aa1 100644 --- a/target/linux/ath79/dts/ar9330.dtsi +++ b/target/linux/ath79/dts/ar9330.dtsi @@ -120,7 +120,6 @@ interrupts = <3>; resets = <&rst 5>; - reset-names = "usb-host"; phy-names = "usb"; phys = <&usb_phy>; diff --git a/target/linux/ath79/dts/ar934x.dtsi b/target/linux/ath79/dts/ar934x.dtsi index c490f051bb7..b2106fcdaa0 100644 --- a/target/linux/ath79/dts/ar934x.dtsi +++ b/target/linux/ath79/dts/ar934x.dtsi @@ -166,7 +166,6 @@ interrupts = <3>; resets = <&rst 5>; - reset-names = "usb-host"; has-transaction-translator; caps-offset = <0x100>; diff --git a/target/linux/ath79/dts/qca953x.dtsi b/target/linux/ath79/dts/qca953x.dtsi index e7feeded7bc..0e982016f42 100644 --- a/target/linux/ath79/dts/qca953x.dtsi +++ b/target/linux/ath79/dts/qca953x.dtsi @@ -193,7 +193,6 @@ interrupts = <3>; resets = <&rst 5>; - reset-names = "usb-host"; dr_mode = "host"; has-transaction-translator; diff --git a/target/linux/ath79/dts/qca955x.dtsi b/target/linux/ath79/dts/qca955x.dtsi index de27b0e7d2e..d697b047690 100644 --- a/target/linux/ath79/dts/qca955x.dtsi +++ b/target/linux/ath79/dts/qca955x.dtsi @@ -273,7 +273,6 @@ interrupt-parent = <&intc3>; interrupts = <1>; resets = <&rst 5>; - reset-names = "usb-host"; has-transaction-translator; caps-offset = <0x100>; @@ -299,7 +298,6 @@ interrupt-parent = <&intc3>; interrupts = <2>; resets = <&rst2 5>; - reset-names = "usb-host"; has-transaction-translator; caps-offset = <0x100>; diff --git a/target/linux/ath79/dts/qca956x.dtsi b/target/linux/ath79/dts/qca956x.dtsi index e9f443cbef9..8070fefbb71 100644 --- a/target/linux/ath79/dts/qca956x.dtsi +++ b/target/linux/ath79/dts/qca956x.dtsi @@ -192,7 +192,6 @@ interrupts = <1>; resets = <&rst 5>; - reset-names = "usb-host"; has-transaction-translator; caps-offset = <0x100>; @@ -219,7 +218,6 @@ interrupts = <2>; resets = <&rst2 5>; - reset-names = "usb-host"; has-transaction-translator; caps-offset = <0x100>; diff --git a/target/linux/ath79/patches-6.6/700-phy-add-ath79-usb-phys.patch b/target/linux/ath79/patches-6.6/700-phy-add-ath79-usb-phys.patch index 98879927cbe..b50e4b51a45 100644 --- a/target/linux/ath79/patches-6.6/700-phy-add-ath79-usb-phys.patch +++ b/target/linux/ath79/patches-6.6/700-phy-add-ath79-usb-phys.patch @@ -132,7 +132,7 @@ Signed-off-by: John Crispin + if (IS_ERR(priv->rst_phy)) + return dev_err_probe(&pdev->dev, PTR_ERR(priv->rst_phy), "phy reset is missing"); + -+ priv->rst_host = devm_reset_control_get(&pdev->dev, "usb-host"); ++ priv->rst_host = devm_reset_control_get(&pdev->dev, "host"); + if (IS_ERR(priv->rst_host)) + return dev_err_probe(&pdev->dev, PTR_ERR(priv->rst_host), "host reset is missing"); + From 6b32a5d768847b7d0e9222adecbcb66e367abbfc Mon Sep 17 00:00:00 2001 From: Yaoguang Bai <0xdeadc0de@badguys.club> Date: Tue, 26 Nov 2024 17:18:28 +0800 Subject: [PATCH 058/149] mediatek: filogic: add support for NRadio C8-668GL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NRadio C8-668GL is a Wi-Fi 6 5G cellular router based on MediaTek MT7981B SoC. - **SoC**: MediaTek MT7981B (2x Cortex-A53, 1.3GHz) - **RAM**: Nanya NT5AD512M16C4-JR 1GB DDR4 - **Flash**: ESMT FC51L08SFY3A 8GB eMMC - **Ethernet**: - 1x 2.5GbE (via GMAC0 and GPY211 PHY, shared with MT7531AE) - 3x 10/100/1000 Mbps (via MT7531AE, connected to GMAC0) - 5G Modem: GMAC1 (via GPY211 PHY - RTL8125BG - RM520N-GL) - **Wi-Fi**: MediaTek MT7976CN (2.4GHz/5GHz, 802.11ax, 2x2 MIMO, AX3000) - **Buttons**: Reset, WPS - **LEDs**: Power, 5G, 4G, WiFi - **SIM Slot**: 1x Nano SIM - **5G Modem**: Quectel RM520N-GL (Snapdragon™ X62) - **Power**: 12V/2A DC, 5.5×2.1 connector The MAC addresses are derived from the `fac_mac` field in the `bdinfo` partition, formatted as `fac_mac = HWMAC`. The allocation is as follows: | Vendor | OpenWrt Interface | Address | Notes | |---------|-------------------|---------------|------------------------------------------------| | LAN | br-lan | Label MAC | Default | | WAN | lan4 | Label MAC+1 | Only when lan4 is switched to WAN | | 2.4GHz | phy0-ap0 | Label MAC | | | 5GHz | phy1-ap0 | Label MAC | (Local Admin bit set) | | Modem | eth1 | Label MAC+2 | | 1. Log in to the router via `http://192.168.66.1`/. 2. Upgrade the official firmware to dual-system mode. 3. Select **Burn second system** and upload the `sysupgrade.bin` image. - Download the image from the OpenWrt build system or build it yourself using the OpenWrt buildroot. 4. Wait for 30 seconds and click **Switch system**. 5. The device will reboot and switch to OpenWrt. Set the U-Boot environment variable `boot_system=0` and reboot: ```bash fw_setenv boot_system 0 ``` Power off the router, hold the **WPS button**, and power it back on. 1. Rename the stock firmware file to **`recovery.bin`**. 2. Set your PC's Ethernet IP to **192.168.1.88** and connect it to the lan1 port on the router. 3. Run a TFTP server and place the `recovery.bin` file in its root directory. 4. Power off the router, press and hold the **Reset button**, and power it back on. 5. Release the Reset button when the TFTP server shows activity. 6. Wait for the router to flash the firmware and reboot automatically. - By default, `lan4` is part of `br-lan` and uses the label MAC address. - To query the RM520N-GL module, use the following command: ```bash cat /dev/ttyUSB2 & printf 'ATI\r\n' > /dev/ttyUSB2 ``` Signed-off-by: Yaoguang Bai <0xdeadc0de@badguys.club> Link: https://github.com/openwrt/openwrt/pull/17093 Signed-off-by: John Crispin --- .../uboot-envtools/files/mediatek_filogic | 3 +- .../mediatek/dts/mt7981b-nradio-c8-668gl.dts | 264 ++++++++++++++++++ .../filogic/base-files/etc/board.d/01_leds | 4 + .../filogic/base-files/etc/board.d/02_network | 6 + .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 5 + .../base-files/lib/upgrade/platform.sh | 18 ++ target/linux/mediatek/image/filogic.mk | 13 + 7 files changed, 312 insertions(+), 1 deletion(-) create mode 100644 target/linux/mediatek/dts/mt7981b-nradio-c8-668gl.dts diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic index 5bde699a47a..d0a15e34736 100644 --- a/package/boot/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-envtools/files/mediatek_filogic @@ -57,7 +57,8 @@ acer,vero-w6m|\ glinet,gl-mt2500|\ glinet,gl-mt6000|\ glinet,gl-x3000|\ -glinet,gl-xe3000) +glinet,gl-xe3000|\ +nradio,c8-668gl) local envdev=$(find_mmc_part "u-boot-env") ubootenv_add_uci_config "$envdev" "0x0" "0x80000" ;; diff --git a/target/linux/mediatek/dts/mt7981b-nradio-c8-668gl.dts b/target/linux/mediatek/dts/mt7981b-nradio-c8-668gl.dts new file mode 100644 index 00000000000..d1b74f2ffed --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-nradio-c8-668gl.dts @@ -0,0 +1,264 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; + +#include "mt7981.dtsi" + +/ { + model = "NRadio C8-668GL"; + compatible = "nradio,c8-668gl", "mediatek,mt7981"; + + aliases { + ethernet0 = &gmac0; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n1"; + /* If official system version < 1.9.2.n6.c3, use root=PARTLABEL=rootfs */ + bootargs = "console=ttyS0,115200n1 root=PARTLABEL=rootfs_2nd rootwait"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-export { + compatible = "gpio-export"; + #size-cells = <0>; + + cpepower { + gpio-export,name = "cpe-pwr"; + gpio-export,output = <0>; + gpios = <&pio 31 GPIO_ACTIVE_LOW>; + }; + + cpesel0 { + gpio-export,name = "cpe-sel0"; + gpio-export,output = <1>; + gpios = <&pio 30 GPIO_ACTIVE_HIGH>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + color = ; + function = LED_FUNCTION_POWER; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + }; + + led-cellular-5g { + color = ; + function = LED_FUNCTION_INDICATOR; + function-enumerator = <0>; + gpios = <&pio 11 GPIO_ACTIVE_LOW>; + }; + + led-cellular-4g { + color = ; + function = LED_FUNCTION_INDICATOR; + function-enumerator = <1>; + gpios = <&pio 12 GPIO_ACTIVE_LOW>; + }; + + led-wifi { + color = ; + function = LED_FUNCTION_WLAN; + gpios = <&pio 13 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&mmc0 { + pinctrl-names = "default", "state_uhs"; + pinctrl-0 = <&mmc0_pins_default>; + pinctrl-1 = <&mmc0_pins_uhs>; + bus-width = <8>; + max-frequency = <52000000>; + cap-mmc-highspeed; + vmmc-supply = <®_3p3v>; + non-removable; + status = "okay"; + + card@0 { + compatible = "mmc-card"; + reg = <0>; + + block { + compatible = "block-device"; + partitions { + block-partition-env { + partname = "u-boot-env"; + + nvmem-layout { + compatible = "u-boot,env"; + }; + }; + + block-partition-factory { + partname = "factory"; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1000>; + }; + }; + }; + }; + }; + }; +}; + +&pio { + mmc0_pins_default: mmc0-pins-default { + mux { + function = "flash"; + groups = "emmc_45"; + }; + }; + + mmc0_pins_uhs: mmc0-pins-uhs { + mux { + function = "flash"; + groups = "emmc_45"; + }; + }; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "2500base-x"; + phy-handle = <&phy21>; + }; + + mdio: mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + + phy5: ethernet-phy@5 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <5>; + reset-gpios = <&pio 7 GPIO_ACTIVE_LOW>; + reset-assert-us = <600>; + reset-deassert-us = <20000>; + }; + + phy21: ethernet-phy@21 { + compatible = "ethernet-phy-ieee802.3-c45"; + reg = <21>; + reset-gpios = <&pio 8 GPIO_ACTIVE_LOW>; + reset-assert-us = <600>; + reset-deassert-us = <20000>; + }; + + switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@1 { + reg = <1>; + label = "lan1"; + }; + + port@2 { + reg = <2>; + label = "lan2"; + }; + + port@3 { + reg = <3>; + label = "lan3"; + }; + + port@5 { + reg = <5>; + label = "lan4"; + phy-mode = "2500base-x"; + phy-handle = <&phy5>; + }; + + port@6 { + reg = <6>; + label = "cpu"; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; + }; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&xhci { + status = "okay"; +}; + +&wifi { + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; + status = "okay"; +}; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds index 64df50eb0a1..2496323d873 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds @@ -66,6 +66,10 @@ nokia,ea0326gmp) ucidef_set_led_netdev "lan" "LAN" "green:lan" "br-lan" "link" ucidef_set_led_netdev "wlan" "WLAN" "green:wlan" "phy1-ap0" "link" ;; +nradio,c8-668gl) + ucidef_set_led_netdev "wifi" "WIFI" "blue:wlan" "phy1-ap0" "link" + ucidef_set_led_netdev "5g" "5G" "blue:indicator-0" "eth1" "link" + ;; openembed,som7981) ucidef_set_led_netdev "lanact" "LANACT" "green:lan" "eth1" "rx tx" ucidef_set_led_netdev "lanlink" "LANLINK" "amber:lan" "eth1" "link" 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 78483442d76..2a133813263 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 @@ -43,6 +43,7 @@ mediatek_setup_interfaces() jdcloud,re-cp-03|\ mediatek,mt7981-rfb|\ netcore,n60|\ + nradio,c8-668gl|\ ruijie,rg-x60-pro|\ unielec,u7981-01*|\ zbtlink,zbt-z8102ax|\ @@ -165,6 +166,11 @@ mediatek_setup_macs() lan_mac=$(mtd_get_mac_ascii u-boot-env mac) label_mac=$lan_mac ;; + nradio,c8-668gl) + lan_mac=$(mmc_get_mac_ascii bdinfo "fac_mac ") + wan_mac=$(macaddr_add "$lan_mac" 2) + label_mac=$lan_mac + ;; qihoo,360t7) lan_mac=$(mtd_get_mac_ascii factory lanMac) wan_mac=$(macaddr_add "$lan_mac" 1) diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index fb67323e7b0..41c425e5579 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -136,6 +136,11 @@ case "$board" in [ "$PHYNBR" = "0" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress ;; + nradio,c8-668gl) + hw_mac_addr=$(mmc_get_mac_ascii bdinfo "fac_mac ") + [ "$PHYNBR" = "0" ] && echo "$hw_mac_addr" > /sys${DEVPATH}/macaddress + [ "$PHYNBR" = "1" ] && macaddr_setbit_la $hw_mac_addr > /sys${DEVPATH}/macaddress + ;; openembed,som7981) [ "$PHYNBR" = "1" ] && cat /sys/class/net/eth0/address > /sys${DEVPATH}/macaddress ;; diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index fb48ffc49f0..f3d5cb472e3 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -128,6 +128,12 @@ platform_do_upgrade() { CI_UBIPART="ubi0" nand_do_upgrade "$1" ;; + nradio,c8-668gl) + CI_DATAPART="rootfs_data" + CI_KERNPART="kernel_2nd" + CI_ROOTPART="rootfs_2nd" + emmc_do_upgrade "$1" + ;; ubnt,unifi-6-plus) CI_KERNPART="kernel0" EMMC_ROOT_DEV="$(cmdline_get_var root)" @@ -181,6 +187,17 @@ platform_check_image() { echo "Invalid image type." return 1 } + return 0 + ;; + nradio,c8-668gl) + # tar magic `ustar` + magic="$(dd if="$1" bs=1 skip=257 count=5 2>/dev/null)" + + [ "$magic" != "ustar" ] && { + echo "Invalid image type." + return 1 + } + return 0 ;; *) @@ -212,6 +229,7 @@ platform_copy_config() { glinet,gl-x3000|\ glinet,gl-xe3000|\ jdcloud,re-cp-03|\ + nradio,c8-668gl|\ smartrg,sdg-8612|\ smartrg,sdg-8614|\ smartrg,sdg-8622|\ diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index c18873e697d..1fdb3036776 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -1195,6 +1195,19 @@ define Device/nokia_ea0326gmp endef TARGET_DEVICES += nokia_ea0326gmp +define Device/nradio_c8-668gl + DEVICE_VENDOR := NRadio + DEVICE_MODEL := C8-668GL + DEVICE_DTS := mt7981b-nradio-c8-668gl + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware \ + kmod-usb-serial-option kmod-usb-net-cdc-ether kmod-usb-net-qmi-wwan \ + kmod-usb3 + IMAGE_SIZE := 131072k + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata | check-size +endef +TARGET_DEVICES += nradio_c8-668gl + define Device/openembed_som7981 DEVICE_VENDOR := OpenEmbed DEVICE_MODEL := SOM7981 From c90842b0d1b228df2986ec483ce692db2e7c3032 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 25 Nov 2024 14:33:06 -0800 Subject: [PATCH 059/149] ath79: pqi-air-pen: adjust mac addresses The original ar71xx version of this device used 1002 as mac address for both ethernet and wireless. The ath79 version inexplicably changes this to 2, which seems to be done nowhere else in ath79, indicating it's bogus. Restore previous ar71xx assignment. 1002 is used as an ethernet interface with some other devices as well. Also remove the bogus caldata userspace extraction. The size is bogus and it's already handled in dts. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/17083 Signed-off-by: John Crispin --- target/linux/ath79/dts/ar9330_pqi_air-pen.dts | 8 ++------ .../base-files/etc/hotplug.d/firmware/10-ath9k-eeprom | 3 --- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/target/linux/ath79/dts/ar9330_pqi_air-pen.dts b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts index 121dcbcb0e2..4153de571ab 100644 --- a/target/linux/ath79/dts/ar9330_pqi_air-pen.dts +++ b/target/linux/ath79/dts/ar9330_pqi_air-pen.dts @@ -95,10 +95,6 @@ #address-cells = <1>; #size-cells = <1>; - macaddr_art_2: macaddr@2 { - reg = <0x2 0x6>; - }; - cal_art_1000: calibration@1000 { reg = <0x1000 0x440>; }; @@ -153,6 +149,6 @@ &wmac { status = "okay"; - nvmem-cells = <&macaddr_art_2>, <&cal_art_1000>; - nvmem-cell-names = "mac-address", "calibration"; + nvmem-cells = <&cal_art_1000>; + nvmem-cell-names = "calibration"; }; diff --git a/target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index d424b9fe2ca..796ebc33216 100644 --- a/target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -46,9 +46,6 @@ case "$FIRMWARE" in ubnt,picostation-m) caldata_extract "art" 0x1000 0x1000 ;; - pqi,air-pen) - caldata_extract "art" 0x1000 0x7d2 - ;; *) caldata_die "board $board is not supported yet" ;; From 9e78db022985e1a4efebfcfde27e15068922fdca Mon Sep 17 00:00:00 2001 From: Die Peter Pan Date: Sat, 23 Nov 2024 05:23:57 -0500 Subject: [PATCH 060/149] ramips: mt7620: add support for THA-103AC (Version v1.0R) Hardware * Mediatek MT7620A + Mediatek MT7610EN * 64MB RAM * 8MB NAND (Winbond 25064FVSIG ) Both 2.4GHZ and 5GHZ are working, it is enabled by default since there is no physical ethernet port in the device. All LED's and buttons work. UART: 57600 8N1 3.3V Installation Upload the openwrt-ramips-mt7620-trendnet_tha103ac-initramfs-kernel.bin via the manufacturer firmware upgrade page on the device. Upon reboot wait +- 3 mins until the green power LED is not flashing anymore (do not be tempted to switch the device off while the LED is flashing, unless you are ready for soldering and TTL) and then press the WPS button to enable the default OpenWrt Wifi AP, the BLUE wifi LED will start flash. Then install openwrt-ramips-mt7620-trendnet_tha103ac-squashfs-sysupgrade.bin via OpenWrt. The integrated power monitoring and relay do not work in OpenWrt as the PL7223 chip source/documentation is unavailable. Recovery Mis-configuration can be dealt with using the RESET button to reset to factory, worst case scenario will require some serious work and soldering, there's pads on the PCB for both the UART and ETH0, and I soldered and tested that it does work. You will have to power the board using the header pins GND & 5V, see the 8-pin header socket. Signed-off-by: Die Peter Pan Link: https://github.com/openwrt/openwrt/pull/17114 Signed-off-by: John Crispin --- .../ramips/dts/mt7620a_trendnet_tha103ac.dts | 201 ++++++++++++++++++ target/linux/ramips/image/mt7620.mk | 10 + .../mt7620/base-files/etc/board.d/01_leds | 7 + .../mt7620/base-files/etc/board.d/02_network | 4 +- 4 files changed, 221 insertions(+), 1 deletion(-) create mode 100644 target/linux/ramips/dts/mt7620a_trendnet_tha103ac.dts diff --git a/target/linux/ramips/dts/mt7620a_trendnet_tha103ac.dts b/target/linux/ramips/dts/mt7620a_trendnet_tha103ac.dts new file mode 100644 index 00000000000..c7587550b0d --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_trendnet_tha103ac.dts @@ -0,0 +1,201 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7620a.dtsi" + +#include +#include +#include + +/ { + compatible = "trendnet,tha103ac", "ralink,mt7620a-soc"; + model = "TRENDNET THA-103AC (EU)"; + + aliases { + label-mac-device = ðernet; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + keys: keys { + compatible = "gpio-keys"; + + button_reset { + label = "reset"; + gpios = <&gpio0 9 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + /* wps button reassigned to rfkill */ + button_rfkill { + label = "wifi on/off"; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + color = ; + function = LED_FUNCTION_WPS; + gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; + }; + + led_power: led-1 { + color = ; + function = LED_FUNCTION_POWER; + gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + led-2 { + color = ; + function = LED_FUNCTION_WLAN; + gpios = <&gpio1 14 GPIO_ACTIVE_LOW>; + }; + + led-3 { + color = ; + /* LED_FUNCTION_RSSILOW isn't implemented yet */ + function = "rssilow"; + gpios = <&gpio2 16 GPIO_ACTIVE_LOW>; + }; + + led-4 { + color = ; + /* LED_FUNCTION_RSSIMEDLOW isn't implemented yet */ + function = "rssimedlow"; + gpios = <&gpio2 17 GPIO_ACTIVE_LOW>; + }; + + led-5 { + color = ; + /* LED_FUNCTION_RSSIMEDIUM isn't implemented yet */ + function = "rssimedium"; + gpios = <&gpio2 18 GPIO_ACTIVE_LOW>; + }; + + led-6 { + color = ; + /* LED_FUNCTION_RSSIHIGH isn't implemented yet */ + function = "rssihigh"; + gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x200>; + }; + + eeprom_factory_8000: eeprom@8000 { + reg = <0x8000 0x200>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_28: macaddr@28 { + compatible = "mac-base"; + reg = <0x28 0x6>; + #nvmem-cell-cells = <1>; + }; + + macaddr_factory_8004: macaddr@8004 { + compatible = "mac-base"; + reg = <0x8004 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0x7b0000>; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uartf", "ephy"; + function = "gpio"; + }; +}; + +ðernet { + nvmem-cells = <&macaddr_factory_28 0>; + nvmem-cell-names = "mac-address"; + + mediatek,portmap = "wl"; +}; + +&gpio1 { + status = "okay"; +}; + +&gpio2 { + status = "okay"; +}; + +&wmac { + nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4 0>; + nvmem-cell-names = "eeprom", "mac-address"; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + reg = <0x0000 0 0 0 0>; + ieee80211-freq-limit = <5000000 6000000>; + nvmem-cells = <&eeprom_factory_8000>, <&macaddr_factory_8004 0>; + nvmem-cell-names = "eeprom", "mac-address"; + }; +}; diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index 6cf65ad1194..f12f13d9e93 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -1322,6 +1322,16 @@ define Device/trendnet_tew-810dr endef TARGET_DEVICES += trendnet_tew-810dr +define Device/trendnet_tha103ac + SOC := mt7620a + DEVICE_PACKAGES := kmod-mt76x0e rssileds + DEVICE_VENDOR := TRENDnet + DEVICE_MODEL := THA-103AC + IMAGE_SIZE := 7872k + SUPPORTED_DEVICES += mt7620a_mt7610e +endef +TARGET_DEVICES += trendnet_tha103ac + define Device/vonets_var11n-300 SOC := mt7620n IMAGE_SIZE := 3776k diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds index 261e54f5e19..ff5d3debfd9 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds @@ -249,6 +249,13 @@ tplink,ec220-g5-v2) tplink,re200-v1) ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0" ;; +trendnet,tha103ac) + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "led_rssilow" "RSSILOW" "blue:rssilow" "wlan0" "31" "100" + ucidef_set_led_rssi "led_rssimedlow" "RSSIMEDIUMLOW" "blue:rssimedlow" "wlan0" "41" "100" + ucidef_set_led_rssi "led_rssimedium" "RSSIMEDIUM" "blue:rssimedium" "wlan0" "51" "100" + ucidef_set_led_rssi "led_rssihigh" "RSSIHIGH" "blue:rssihigh" "wlan0" "71" "100" + ;; wavlink,wl-wn535k1) ucidef_set_led_switch "lan1" "lan1" "green:lan1" "switch0" "0x20" ucidef_set_led_switch "lan2" "lan2" "green:lan2" "switch0" "0x04" diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network index 577f77cb933..204a1b0a54f 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network @@ -65,6 +65,7 @@ ramips_setup_interfaces() sercomm,na930|\ tplink,re200-v1|\ tplink,re210-v1|\ + trendnet,tha103ac|\ yukai,bocco|\ zbtlink,zbt-cpe102|\ zte,q7) @@ -340,7 +341,8 @@ ramips_setup_macs() asus,rt-ac54u) lan_mac=$(mtd_get_mac_binary factory 0x22) ;; - dlink,dch-m225) + dlink,dch-m225|\ + trendnet,tha103ac) lan_mac=$(mtd_get_mac_ascii factory lanmac) ;; dlink,dir-510l|\ From 502916468e2871f7f19b14b521a10ebf28394006 Mon Sep 17 00:00:00 2001 From: Chuncheng Chen Date: Thu, 20 Oct 2022 11:43:11 +0800 Subject: [PATCH 061/149] ramips: add support for ASUS 4G-AX56 Specifications: - Device: ASUS 4g-AX56 - SoC: MT7621AT - Flash: 128MB - RAM: 512MB - Switch: 1 WAN, 4 LAN (10/100/1000 Mbps) - WiFi: MT7905 2x2 2.4G + MT7975 2x2 5G - LTE : Fibocom FG621-EA - LEDs: 1x POWER (white, configurable) 1x 2.4G (white, not configurable) 1x 5G (white, not configurable) 1x WAN (white, not configurable) 1x 3G/4G (white, not configurable) 3x signal (white, not configurable) Flash by U-Boot TFTP method: - Configure your PC with IP 192.168.0.2 - Set up TFTP server and put the factory.bin image on your PC - Connect serial port(rate:115200) and turn on AP, then interrupt "U-Boot Boot Menu" by hitting any key Select "2. Upgrade firmware" Press enter when show "Run firmware after upgrading? (Y/n):" Select 0 for TFTP method Input U-Boot's IP address: 192.168.0.1 Input TFTP server's IP address: 192.168.0.2 Input IP netmask: 255.255.255.0 Input file name: openwrt-ramips-mt7621-asus_4g-ax56-squashfs-factory.bin - Restart AP aftre see the log "Firmware upgrade completed!" Notice: - LTE module is disable after flash openwrt image so you must active LTE by following two AT command echo -e "AT+GTAUTOCONNECT=1\r\n" > /dev/ttyUSB0 echo -e "AT+GTRNDIS=1,1\r\n" > /dev/ttyUSB0 - After finish AT command once, you don't need to input command later even if reboot/restore default Signed-off-by: Chuncheng Chen Link: https://github.com/openwrt/openwrt/pull/16752 Signed-off-by: John Crispin --- package/boot/uboot-envtools/files/ramips | 1 + .../linux/ramips/dts/mt7621_asus_4g-ax56.dts | 211 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 14 ++ .../mt7621/base-files/lib/upgrade/platform.sh | 1 + 4 files changed, 227 insertions(+) create mode 100755 target/linux/ramips/dts/mt7621_asus_4g-ax56.dts mode change 100644 => 100755 target/linux/ramips/image/mt7621.mk diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 341687625c8..ace29907da6 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -69,6 +69,7 @@ zte,mf283plus) ;; asus,rt-ax53u|\ asus,rt-ax54|\ +asus,4g-ax56|\ belkin,rt1800|\ elecom,wrc-x1800gs|\ h3c,tx1800-plus|\ diff --git a/target/linux/ramips/dts/mt7621_asus_4g-ax56.dts b/target/linux/ramips/dts/mt7621_asus_4g-ax56.dts new file mode 100755 index 00000000000..159feeb9dc2 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_asus_4g-ax56.dts @@ -0,0 +1,211 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include +#include + +/ { + compatible = "asus,4g-ax56", "mediatek,mt7621-soc"; + model = "ASUS 4G-AX56"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = &gmac0; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + bootargs-override = "console=ttyS0,115200"; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + color = ; + function = LED_FUNCTION_POWER; + gpios = <&gpio 14 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + key-restart { + label = "reset"; + gpios = <&gpio 8 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + key-wps { + label = "wps"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&nand { + status = "okay"; + + mediatek,nmbm; + mediatek,bmt-remap-range = + <0x000000 0x7e0000>, + <0x35e0000 0x7800000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x80000>; + read-only; + }; + + /* + * u-boot gets split here while keeping u-boot read-only, + * which allows safe usage of fw_setenv + */ + partition@80000 { + label = "u-boot-env"; + reg = <0x80000 0x60000>; + }; + + partition@e0000 { + label = "nvram"; + reg = <0xe0000 0x100000>; + read-only; + }; + + partition@1e0000 { + label = "factory"; + reg = <0x1e0000 0x100000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0xe00>; + }; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + + precal_factory_e10: precal@e10 { + reg = <0xe10 0x19c10>; + }; + }; + }; + + partition@2e0000 { + label = "factory2"; + reg = <0x2e0000 0x100000>; + read-only; + }; + + partition@3e0000 { + label = "firmware"; + reg = <0x3e0000 0x3200000>; + + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "kernel"; + reg = <0x0 0x400000>; + }; + + partition@400000 { + label = "ubi"; + reg = <0x400000 0x2e00000>; + }; + }; + + partition@35e0000 { + label = "firmware2"; + reg = <0x35e0000 0x3200000>; + }; + + partition@67e0000 { + label = "jffs2"; + reg = <0x67e0000 0x1020000>; + }; + + /* Last 8M are reserved for NMBM management (bad blocks) */ + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + nvmem-cells = <&eeprom_factory_0>, <&precal_factory_e10>; + nvmem-cell-names = "eeprom", "precal"; + mediatek,disable-radar-background; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; +}; + +&gmac1 { + status = "okay"; + label = "wan"; + phy-handle = <ðphy0>; + + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; +}; + +ðphy0 { + /delete-property/ interrupts; +}; + +&switch0 { + ports { + port@1 { + status = "okay"; + label = "lan1"; + }; + + port@2 { + status = "okay"; + label = "lan2"; + }; + + port@3 { + status = "okay"; + label = "lan3"; + }; + + port@4 { + status = "okay"; + label = "lan4"; + }; + }; +}; + +&state_default { + gpio { + groups = "i2c", "uart2", "uart3", "jtag", "wdt"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk old mode 100644 new mode 100755 index eb7dacefefb..2623d890f61 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -471,6 +471,20 @@ define Device/asus_rt-ax54 endef TARGET_DEVICES += asus_rt-ax54 +define Device/asus_4g-ax56 + $(Device/nand) + $(Device/uimage-lzma-loader) + DEVICE_VENDOR := ASUS + DEVICE_MODEL := 4G-AX56 + IMAGE_SIZE := 51200k + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \ + check-size + DEVICE_PACKAGES := kmod-mt7915-firmware kmod-usb3 kmod-usb-serial-option \ + kmod-usb-net-cdc-ncm +endef +TARGET_DEVICES += asus_4g-ax56 + define Device/beeline_smartbox-flash $(Device/nand) $(Device/uimage-lzma-loader) diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index 17532f795b2..f2325c83254 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -74,6 +74,7 @@ platform_do_upgrade() { asus,rt-ac85p|\ asus,rt-ax53u|\ asus,rt-ax54|\ + asus,4g-ax56|\ beeline,smartbox-flash|\ beeline,smartbox-giga|\ beeline,smartbox-pro|\ From 1306237fab40781f01a5635f1688d28fc68b77f4 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 3 Dec 2024 13:40:28 -0800 Subject: [PATCH 062/149] qualcommax: use PHY regulator for USB GPIO The PHY can handle turning off the GPIOs when turning off all USB ports. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/17192 Signed-off-by: Robert Marko --- target/linux/qualcommax/config-6.6 | 1 - .../arch/arm64/boot/dts/qcom/ipq6000-mr7350.dts | 7 ++----- .../arch/arm64/boot/dts/qcom/ipq8072-aw1000.dts | 17 +++++++++++------ .../arm64/boot/dts/qcom/ipq8074-rt-ax89x.dts | 14 ++++---------- 4 files changed, 17 insertions(+), 22 deletions(-) diff --git a/target/linux/qualcommax/config-6.6 b/target/linux/qualcommax/config-6.6 index 05e2f51bf20..3519557bccb 100644 --- a/target/linux/qualcommax/config-6.6 +++ b/target/linux/qualcommax/config-6.6 @@ -444,7 +444,6 @@ CONFIG_REGMAP_MMIO=y CONFIG_REGULATOR=y # CONFIG_REGULATOR_CPR3 is not set CONFIG_REGULATOR_FIXED_VOLTAGE=y -CONFIG_REGULATOR_USERSPACE_CONSUMER=y # CONFIG_REGULATOR_VQMMC_IPQ4019 is not set CONFIG_RELOCATABLE=y CONFIG_REMOTEPROC=y diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-mr7350.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-mr7350.dts index 5761c3b5827..8714b34499f 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-mr7350.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6000-mr7350.dts @@ -123,11 +123,6 @@ gpio = <&tlmm 61 GPIO_ACTIVE_LOW>; regulator-boot-on; }; - - output-usb0-power { - compatible = "regulator-output"; - vout-supply = <®_usb_vbus>; - }; }; &tlmm { @@ -246,6 +241,8 @@ &qusb_phy_0 { status = "okay"; + + vdd-supply = <®_usb_vbus>; }; &ssphy_0 { diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-aw1000.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-aw1000.dts index c85e9f1993a..1b5f58e51b4 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-aw1000.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-aw1000.dts @@ -57,12 +57,6 @@ gpio-export,output = <1>; gpios = <&tlmm 63 GPIO_ACTIVE_HIGH>; }; - - usb-vbus { - gpio-export,name = "usb_vbus"; - gpio-export,output = <0>; - gpios = <&tlmm 9 GPIO_ACTIVE_LOW>; - }; }; keys { @@ -160,6 +154,15 @@ gpios = <&led_gpio 11 GPIO_ACTIVE_HIGH>; }; }; + + usb_vbus: regulator-usb-vbus { + compatible = "regulator-fixed"; + regulator-name = "usb_vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + gpio = <&tlmm 9 GPIO_ACTIVE_LOW>; + regulator-boot-on; + }; }; &tlmm { @@ -221,6 +224,8 @@ &qusb_phy_1 { status = "okay"; + + vdd-supply = <&usb_vbus>; }; &ssphy_0 { diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-rt-ax89x.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-rt-ax89x.dts index 4af942c2892..781b6478114 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-rt-ax89x.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-rt-ax89x.dts @@ -160,16 +160,6 @@ enable-active-high; regulator-boot-on; }; - - output-usb0-power { - compatible = "regulator-output"; - vout-supply = <&usb0_vbus>; - }; - - output-usb1-power { - compatible = "regulator-output"; - vout-supply = <&usb1_vbus>; - }; }; &cpu0_thermal { @@ -374,6 +364,8 @@ &qusb_phy_0 { status = "okay"; + + vdda-phy-supply = <&usb0_vbus>; }; &ssphy_1 { @@ -382,6 +374,8 @@ &qusb_phy_1 { status = "okay"; + + vdda-phy-supply = <&usb1_vbus>; }; &usb_0 { From 5158e28769cb5e5c6a59bd9a176f55cf2d568742 Mon Sep 17 00:00:00 2001 From: John Audia Date: Tue, 10 Dec 2024 00:19:18 +0100 Subject: [PATCH 063/149] kernel: bump 6.6 to 6.6.64 Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.64 Manually rebased: generic/hack-6.6/780-usb-net-MeigLink_modem_support.patch bcm27xx/patches-6.6/950-0585-drm-vc4-Introduce-generation-number-enum.patch bcm27xx/patches-6.6/950-0610-drm-vc4-hvs-Support-BCM2712-HVS.patch bcm27xx/patches-6.6/950-0829-vc4-hvs-Add-support-for-D0-register-changes.patch Removed upstreamed: bcm27xx/patches-6.6/950-0597-drm-vc4-hdmi-Avoid-hang-with-debug-registers-when-su.patch[1] bcm27xx/patches-6.6/950-0599-drm-vc4-Fix-dlist-debug-not-resetting-the-next-entry.patch[2] bcm27xx/patches-6.6/950-0600-drm-vc4-Remove-incorrect-limit-from-hvs_dlist-debugf.patch[3] bcm27xx/patches-6.6/950-0708-drm-vc4-Correct-logic-on-stopping-an-HVS-channel.patch[4] ramips/patches-6.6/002-01-v6.13-clk-ralink-mtmips-fix-clock-plan-for-Ralink-SoC-RT38.patch[5] ramips/patches-6.6/002-02-v6.13-clk-ralink-mtmips-fix-clocks-probe-order-in-oldest-r.patch[6] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=223ee2567a55e4f80315c768d2969e6a3b9fb23d 2. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=8182b5ca19c6f173b6498d1c6d3e4b034b76bbde 3. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=52c1716f65a558174e381360bd88f18dae4be85c 4. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=9728b508b01a5eeeac79ceb676364c674dd951ac 5. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=f85a1d06afbcc57ac44176db8f9d7a934979952c 6. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.64&id=fbb13732c6ffa9d58cedafabcd5ce8fd7ef8ae5a Build system: x86/64 Build-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Run-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3 Co-authored-by: Mieczyslaw Nalewaj Signed-off-by: John Audia Link: https://github.com/openwrt/openwrt/pull/17217 Signed-off-by: Robert Marko --- include/kernel-6.6 | 4 +- .../901-snand-mtk-bmt-support.patch | 6 +- ...0-0007-drm-vc4-Add-firmware-kms-mode.patch | 2 +- ...vc4-Add-support-for-gamma-on-BCM2711.patch | 12 +- ...gfs-node-that-dumps-the-vc5-gamma-PW.patch | 4 +- ...vs-Force-modeset-on-gamma-lut-change.patch | 6 +- ...nable-gamma-block-only-when-required.patch | 4 +- ...4-Validate-the-size-of-the-gamma_lut.patch | 2 +- ...e-Keep-fractional-source-coords-insi.patch | 2 +- ...igger-of-dlist-update-on-margins-cha.patch | 2 +- ...s-Skip-DebugFS-Registration-for-FKMS.patch | 2 +- ...mi-Allow-hotplug-detect-to-be-forced.patch | 2 +- ...oid-log-spam-for-audio-start-failure.patch | 2 +- ...4-hvs-Defer-dlist-slots-deallocation.patch | 26 ++-- ...ialize-the-dlist-allocation-list-ent.patch | 2 +- ...-the-dlist-allocation-destruction-to.patch | 4 +- ...roy-dlist-allocations-immediately-wh.patch | 2 +- ...ulate-bpc-based-on-max_requested_bpc.patch | 2 +- ...-vc4-Set-AXI-panic-modes-for-the-HVS.patch | 2 +- ...ecessary-and-harmful-HDMI-RGB-format.patch | 2 +- ...-drm-vc4-Limit-max_bpc-to-8-on-Pi0-3.patch | 4 +- ...0-0039-arm64-setup-Fix-build-warning.patch | 2 +- ...oup-Disable-cgroup-memory-by-default.patch | 8 +- ...8xx-Enable-LEDs-and-auto-negotiation.patch | 6 +- ...all-the-downstream-rpi-sound-card-dr.patch | 2 +- ...78xx-Read-initial-EEE-status-from-DT.patch | 2 +- ...Disable-TCP-Segmentation-Offload-TSO.patch | 2 +- ...e-enabling-of-EEE-into-PHY-init-code.patch | 4 +- ...is7xx-Don-t-spin-if-no-data-received.patch | 2 +- ...e-link-events-to-minimize-poll-storm.patch | 6 +- ...xx-EEE-support-is-now-a-PHY-property.patch | 2 +- ...CS_HIGH-if-GPIO-descriptors-are-used.patch | 4 +- ...dmi-Increase-MAI-fifo-dreq-threshold.patch | 4 +- ...7xx-Read-modem-line-state-at-startup.patch | 2 +- ...5-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch | 6 +- ...-drm-vc4-hdmi-Enable-the-audio-clock.patch | 4 +- ...vs-More-logging-for-dlist-generation.patch | 2 +- ...Print-error-if-we-fail-an-allocation.patch | 4 +- ...vc4-Introduce-generation-number-enum.patch | 53 ++++---- ...switch-statement-to-simplify-vc4_hvs.patch | 2 +- ...switch-statement-to-simplify-enablin.patch | 2 +- ...st-if-the-EOF-interrupts-are-enabled.patch | 10 +- ...-drm-vc4-hvs-Create-hw_init-function.patch | 4 +- ...drm-vc4-hvs-Create-cob_init-function.patch | 6 +- ...592-drm-vc4-hvs-Rename-hvs_regs-list.patch | 2 +- ...plane-Change-ptr0_offset-to-an-array.patch | 2 +- ...ge-prototype-of-__vc4_hvs_alloc-to-p.patch | 8 +- ...id-hang-with-debug-registers-when-su.patch | 40 ------ ...-buffer-offset-out-of-the-vc4_plane_.patch | 2 +- ...t-debug-not-resetting-the-next-entry.patch | 34 ----- ...ncorrect-limit-from-hvs_dlist-debugf.patch | 57 -------- ...ble-SCALER_CONTROL-early-in-HVS-init.patch | 8 +- ...0610-drm-vc4-hvs-Support-BCM2712-HVS.patch | 52 ++++---- ...-0622-drm-vc4-Add-additional-warn_on.patch | 24 ++-- ...e-the-clear-of-SCALER_DISPBKGND_FILL.patch | 2 +- ...ect-logic-on-stopping-an-HVS-channel.patch | 52 -------- ...p-WARN-for-HVS-FIFOs-not-being-empty.patch | 2 +- ...-stale-dlists-if-channel-is-disabled.patch | 6 +- ...dd-hvs_dlist_allocs-debugfs-function.patch | 2 +- ...size-of-the-dlist-allocation-that-wa.patch | 2 +- ...-dlist-alloc-immediately-if-it-never.patch | 4 +- ...x-reading-of-frame-count-on-GEN5-Pi4.patch | 4 +- ...-Add-support-for-D0-register-changes.patch | 27 ++-- ...-to-support-D0-alpha-and-csc-changes.patch | 4 +- ...-vc4_hvs_dlist_free_work-to-only-rea.patch | 2 +- ...ale-dlist-entries-if-allocation-fail.patch | 6 +- ...g_fill-if-there-are-no-planes-enable.patch | 2 +- ...ort-for-per-plane-scaling-filter-sel.patch | 4 +- ...equest-for-min-clocks-when-hdmi-outp.patch | 2 +- ...l-command-line-to-disable-memory-cgr.patch | 8 +- .../generic/hack-6.6/204-module_strip.patch | 12 +- .../generic/hack-6.6/253-ksmbd-config.patch | 2 +- .../780-usb-net-MeigLink_modem_support.patch | 5 +- .../hack-6.6/901-debloat_sock_diag.patch | 4 +- .../generic/hack-6.6/902-debloat_proc.patch | 2 +- .../hack-6.6/920-device_tree_cmdline.patch | 2 +- .../203-kallsyms_uncompressed.patch | 2 +- ...ng-with-source-address-failed-policy.patch | 8 +- ...les-ignore-EOPNOTSUPP-on-flowtable-d.patch | 2 +- .../pending-6.6/920-mangle_bootargs.patch | 2 +- .../900-arm-add-cmdline-override.patch | 2 +- ...nor-Use-1-bit-mode-of-spansion-s25fs.patch | 2 +- ...-Add-support-for-dynamic-calibration.patch | 6 +- .../901-arm-add-cmdline-override.patch | 2 +- .../102-powerpc-add-cmdline-override.patch | 2 +- ...ers-ralink-Add-Ralink-System-Tick-Co.patch | 2 +- ...s-fix-clock-plan-for-Ralink-SoC-RT38.patch | 48 ------- ...s-fix-clocks-probe-order-in-oldest-r.patch | 124 ------------------ ...e-to-enable-disable-the-cevt-r4k-irq.patch | 2 +- .../810-uvc-add-iPassion-iP2970-support.patch | 2 +- ...-clocksource-Add-JH7110-timer-driver.patch | 2 +- ...ET_CONFIG_DEVICE_WAIT_MS-waiting-tim.patch | 2 +- ...-precheck-and-delay-for-CQE-pending-.patch | 2 +- ...ove-performance-usb-using-lowmem-for.patch | 2 +- 94 files changed, 242 insertions(+), 590 deletions(-) delete mode 100644 target/linux/bcm27xx/patches-6.6/950-0597-drm-vc4-hdmi-Avoid-hang-with-debug-registers-when-su.patch delete mode 100644 target/linux/bcm27xx/patches-6.6/950-0599-drm-vc4-Fix-dlist-debug-not-resetting-the-next-entry.patch delete mode 100644 target/linux/bcm27xx/patches-6.6/950-0600-drm-vc4-Remove-incorrect-limit-from-hvs_dlist-debugf.patch delete mode 100644 target/linux/bcm27xx/patches-6.6/950-0708-drm-vc4-Correct-logic-on-stopping-an-HVS-channel.patch delete mode 100644 target/linux/ramips/patches-6.6/002-01-v6.13-clk-ralink-mtmips-fix-clock-plan-for-Ralink-SoC-RT38.patch delete mode 100644 target/linux/ramips/patches-6.6/002-02-v6.13-clk-ralink-mtmips-fix-clocks-probe-order-in-oldest-r.patch diff --git a/include/kernel-6.6 b/include/kernel-6.6 index 0cfe052e651..ddbef67f942 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .63 -LINUX_KERNEL_HASH-6.6.63 = d1054ab4803413efe2850f50f1a84349c091631ec50a1cf9e891d1b1f9061835 +LINUX_VERSION-6.6 = .64 +LINUX_KERNEL_HASH-6.6.64 = 065fd93fa6cb422f650fb563f15d3e0107c85009f766405993d795fd39796ab1 diff --git a/target/linux/airoha/patches-6.6/901-snand-mtk-bmt-support.patch b/target/linux/airoha/patches-6.6/901-snand-mtk-bmt-support.patch index de8e8806433..939ec048555 100644 --- a/target/linux/airoha/patches-6.6/901-snand-mtk-bmt-support.patch +++ b/target/linux/airoha/patches-6.6/901-snand-mtk-bmt-support.patch @@ -8,7 +8,7 @@ static int spinand_read_reg_op(struct spinand_device *spinand, u8 reg, u8 *val) { -@@ -1346,6 +1347,7 @@ static int spinand_probe(struct spi_mem +@@ -1347,6 +1348,7 @@ static int spinand_probe(struct spi_mem if (ret) return ret; @@ -16,7 +16,7 @@ ret = mtd_device_register(mtd, NULL, 0); if (ret) goto err_spinand_cleanup; -@@ -1353,6 +1355,7 @@ static int spinand_probe(struct spi_mem +@@ -1354,6 +1356,7 @@ static int spinand_probe(struct spi_mem return 0; err_spinand_cleanup: @@ -24,7 +24,7 @@ spinand_cleanup(spinand); return ret; -@@ -1371,6 +1374,7 @@ static int spinand_remove(struct spi_mem +@@ -1372,6 +1375,7 @@ static int spinand_remove(struct spi_mem if (ret) return ret; diff --git a/target/linux/bcm27xx/patches-6.6/950-0007-drm-vc4-Add-firmware-kms-mode.patch b/target/linux/bcm27xx/patches-6.6/950-0007-drm-vc4-Add-firmware-kms-mode.patch index c755e814359..468420bdee0 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0007-drm-vc4-Add-firmware-kms-mode.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0007-drm-vc4-Add-firmware-kms-mode.patch @@ -220,7 +220,7 @@ Signed-off-by: Dave Stevenson struct vc4_hang_state *hang_state; -@@ -963,6 +967,9 @@ extern struct platform_driver vc4_dsi_dr +@@ -964,6 +968,9 @@ extern struct platform_driver vc4_dsi_dr /* vc4_fence.c */ extern const struct dma_fence_ops vc4_fence_ops; diff --git a/target/linux/bcm27xx/patches-6.6/950-0008-drm-vc4-Add-support-for-gamma-on-BCM2711.patch b/target/linux/bcm27xx/patches-6.6/950-0008-drm-vc4-Add-support-for-gamma-on-BCM2711.patch index a4712310f2b..10a09eb2c0c 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0008-drm-vc4-Add-support-for-gamma-on-BCM2711.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0008-drm-vc4-Add-support-for-gamma-on-BCM2711.patch @@ -83,7 +83,7 @@ Signed-off-by: Maxime Ripard struct drm_device; struct drm_gem_object; -@@ -494,6 +495,17 @@ struct drm_encoder *vc4_find_encoder_by_ +@@ -495,6 +496,17 @@ struct drm_encoder *vc4_find_encoder_by_ return NULL; } @@ -101,7 +101,7 @@ Signed-off-by: Maxime Ripard struct vc4_crtc_data { const char *name; -@@ -538,9 +550,19 @@ struct vc4_crtc { +@@ -539,9 +551,19 @@ struct vc4_crtc { /* Timestamp at start of vblank irq - unaffected by lock delays. */ ktime_t t_vblank; @@ -126,7 +126,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -243,7 +243,8 @@ static void vc4_hvs_lut_load(struct vc4_ +@@ -248,7 +248,8 @@ static void vc4_hvs_lut_load(struct vc4_ static void vc4_hvs_update_gamma_lut(struct vc4_hvs *hvs, struct vc4_crtc *vc4_crtc) { @@ -136,7 +136,7 @@ Signed-off-by: Maxime Ripard struct drm_color_lut *lut = crtc_state->gamma_lut->data; u32 length = drm_color_lut_size(crtc_state->gamma_lut); u32 i; -@@ -257,6 +258,81 @@ static void vc4_hvs_update_gamma_lut(str +@@ -262,6 +263,81 @@ static void vc4_hvs_update_gamma_lut(str vc4_hvs_lut_load(hvs, vc4_crtc); } @@ -218,7 +218,7 @@ Signed-off-by: Maxime Ripard u8 vc4_hvs_get_fifo_frame_count(struct vc4_hvs *hvs, unsigned int fifo) { struct drm_device *drm = &hvs->vc4->base; -@@ -400,7 +476,10 @@ static int vc4_hvs_init_channel(struct v +@@ -405,7 +481,10 @@ static int vc4_hvs_init_channel(struct v /* Reload the LUT, since the SRAMs would have been disabled if * all CRTCs had SCALER_DISPBKGND_GAMMA unset at once. */ @@ -230,7 +230,7 @@ Signed-off-by: Maxime Ripard drm_dev_exit(idx); -@@ -646,7 +725,11 @@ void vc4_hvs_atomic_flush(struct drm_crt +@@ -649,7 +728,11 @@ void vc4_hvs_atomic_flush(struct drm_crt u32 dispbkgndx = HVS_READ(SCALER_DISPBKGNDX(channel)); if (crtc->state->gamma_lut) { diff --git a/target/linux/bcm27xx/patches-6.6/950-0009-drm-vc4-Add-debugfs-node-that-dumps-the-vc5-gamma-PW.patch b/target/linux/bcm27xx/patches-6.6/950-0009-drm-vc4-Add-debugfs-node-that-dumps-the-vc5-gamma-PW.patch index 24d0cd90f6e..863ad82432d 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0009-drm-vc4-Add-debugfs-node-that-dumps-the-vc5-gamma-PW.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0009-drm-vc4-Add-debugfs-node-that-dumps-the-vc5-gamma-PW.patch @@ -17,7 +17,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -143,6 +143,85 @@ static int vc4_hvs_debugfs_dlist(struct +@@ -145,6 +145,85 @@ static int vc4_hvs_debugfs_dlist(struct return 0; } @@ -103,7 +103,7 @@ Signed-off-by: Maxime Ripard /* The filter kernel is composed of dwords each containing 3 9-bit * signed integers packed next to each other. */ -@@ -850,11 +929,15 @@ int vc4_hvs_debugfs_init(struct drm_mino +@@ -854,11 +933,15 @@ int vc4_hvs_debugfs_init(struct drm_mino if (!vc4->hvs) return -ENODEV; diff --git a/target/linux/bcm27xx/patches-6.6/950-0010-drm-vc4-hvs-Force-modeset-on-gamma-lut-change.patch b/target/linux/bcm27xx/patches-6.6/950-0010-drm-vc4-hvs-Force-modeset-on-gamma-lut-change.patch index f49122dec27..b8847230af0 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0010-drm-vc4-hvs-Force-modeset-on-gamma-lut-change.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0010-drm-vc4-hvs-Force-modeset-on-gamma-lut-change.patch @@ -45,7 +45,7 @@ Signed-off-by: Maxime Ripard struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -613,6 +613,9 @@ vc4_crtc_to_vc4_pv_data(const struct vc4 +@@ -614,6 +614,9 @@ vc4_crtc_to_vc4_pv_data(const struct vc4 return container_of_const(data, struct vc4_pv_data, base); } @@ -57,7 +57,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -596,6 +596,36 @@ out: +@@ -599,6 +599,36 @@ out: drm_dev_exit(idx); } @@ -94,7 +94,7 @@ Signed-off-by: Maxime Ripard int vc4_hvs_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state) { struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc); -@@ -626,7 +656,7 @@ int vc4_hvs_atomic_check(struct drm_crtc +@@ -629,7 +659,7 @@ int vc4_hvs_atomic_check(struct drm_crtc if (ret) return ret; diff --git a/target/linux/bcm27xx/patches-6.6/950-0014-drm-vc4-Enable-gamma-block-only-when-required.patch b/target/linux/bcm27xx/patches-6.6/950-0014-drm-vc4-Enable-gamma-block-only-when-required.patch index 76647cbd488..061b37797de 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0014-drm-vc4-Enable-gamma-block-only-when-required.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0014-drm-vc4-Enable-gamma-block-only-when-required.patch @@ -20,7 +20,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -548,8 +548,11 @@ static int vc4_hvs_init_channel(struct v +@@ -553,8 +553,11 @@ static int vc4_hvs_init_channel(struct v dispbkgndx &= ~SCALER_DISPBKGND_GAMMA; dispbkgndx &= ~SCALER_DISPBKGND_INTERLACE; @@ -33,7 +33,7 @@ Signed-off-by: Dave Stevenson (interlace ? SCALER_DISPBKGND_INTERLACE : 0)); /* Reload the LUT, since the SRAMs would have been disabled if -@@ -834,18 +837,25 @@ void vc4_hvs_atomic_flush(struct drm_crt +@@ -837,18 +840,25 @@ void vc4_hvs_atomic_flush(struct drm_crt u32 dispbkgndx = HVS_READ(SCALER_DISPBKGNDX(channel)); if (crtc->state->gamma_lut) { diff --git a/target/linux/bcm27xx/patches-6.6/950-0016-drm-vc4-Validate-the-size-of-the-gamma_lut.patch b/target/linux/bcm27xx/patches-6.6/950-0016-drm-vc4-Validate-the-size-of-the-gamma_lut.patch index fd0823aa136..7280b6e30c4 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0016-drm-vc4-Validate-the-size-of-the-gamma_lut.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0016-drm-vc4-Validate-the-size-of-the-gamma_lut.patch @@ -13,7 +13,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -614,6 +614,16 @@ static int vc4_hvs_gamma_check(struct dr +@@ -617,6 +617,16 @@ static int vc4_hvs_gamma_check(struct dr if (!crtc_state->color_mgmt_changed) return 0; diff --git a/target/linux/bcm27xx/patches-6.6/950-0020-vc4-drm-vc4_plane-Keep-fractional-source-coords-insi.patch b/target/linux/bcm27xx/patches-6.6/950-0020-vc4-drm-vc4_plane-Keep-fractional-source-coords-insi.patch index 46a72e4ed92..17dd4433e1a 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0020-vc4-drm-vc4_plane-Keep-fractional-source-coords-insi.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0020-vc4-drm-vc4_plane-Keep-fractional-source-coords-insi.patch @@ -12,7 +12,7 @@ Signed-off-by: Dom Cobley --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -408,7 +408,7 @@ struct vc4_plane_state { +@@ -409,7 +409,7 @@ struct vc4_plane_state { /* Clipped coordinates of the plane on the display. */ int crtc_x, crtc_y, crtc_w, crtc_h; diff --git a/target/linux/bcm27xx/patches-6.6/950-0024-drm-vc4-Force-trigger-of-dlist-update-on-margins-cha.patch b/target/linux/bcm27xx/patches-6.6/950-0024-drm-vc4-Force-trigger-of-dlist-update-on-margins-cha.patch index 9779cd512c0..06cb7094985 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0024-drm-vc4-Force-trigger-of-dlist-update-on-margins-cha.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0024-drm-vc4-Force-trigger-of-dlist-update-on-margins-cha.patch @@ -42,7 +42,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -626,12 +626,7 @@ struct vc4_crtc_state { +@@ -627,12 +627,7 @@ struct vc4_crtc_state { bool txp_armed; unsigned int assigned_channel; diff --git a/target/linux/bcm27xx/patches-6.6/950-0027-drm-vc4-hvs-Skip-DebugFS-Registration-for-FKMS.patch b/target/linux/bcm27xx/patches-6.6/950-0027-drm-vc4-hvs-Skip-DebugFS-Registration-for-FKMS.patch index ba03cfb7b92..fb8abd20caf 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0027-drm-vc4-hvs-Skip-DebugFS-Registration-for-FKMS.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0027-drm-vc4-hvs-Skip-DebugFS-Registration-for-FKMS.patch @@ -13,7 +13,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -976,6 +976,9 @@ int vc4_hvs_debugfs_init(struct drm_mino +@@ -980,6 +980,9 @@ int vc4_hvs_debugfs_init(struct drm_mino struct vc4_dev *vc4 = to_vc4_dev(drm); struct vc4_hvs *hvs = vc4->hvs; diff --git a/target/linux/bcm27xx/patches-6.6/950-0028-drm-vc4_hdmi-Allow-hotplug-detect-to-be-forced.patch b/target/linux/bcm27xx/patches-6.6/950-0028-drm-vc4_hdmi-Allow-hotplug-detect-to-be-forced.patch index 95b3ec7a248..5785fbf667b 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0028-drm-vc4_hdmi-Allow-hotplug-detect-to-be-forced.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0028-drm-vc4_hdmi-Allow-hotplug-detect-to-be-forced.patch @@ -45,7 +45,7 @@ Signed-off-by: Dom Cobley static const char * const output_format_str[] = { [VC4_HDMI_OUTPUT_RGB] = "RGB", [VC4_HDMI_OUTPUT_YUV420] = "YUV 4:2:0", -@@ -478,7 +484,9 @@ static int vc4_hdmi_connector_detect_ctx +@@ -482,7 +488,9 @@ static int vc4_hdmi_connector_detect_ctx return connector_status_unknown; } diff --git a/target/linux/bcm27xx/patches-6.6/950-0029-vc4_hdmi-Avoid-log-spam-for-audio-start-failure.patch b/target/linux/bcm27xx/patches-6.6/950-0029-vc4_hdmi-Avoid-log-spam-for-audio-start-failure.patch index 0baf803edf8..a73c5e3163f 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0029-vc4_hdmi-Avoid-log-spam-for-audio-start-failure.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0029-vc4_hdmi-Avoid-log-spam-for-audio-start-failure.patch @@ -30,7 +30,7 @@ Signed-off-by: Dom Cobley --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -2400,7 +2400,7 @@ static int vc4_hdmi_audio_startup(struct +@@ -2404,7 +2404,7 @@ static int vc4_hdmi_audio_startup(struct } if (!vc4_hdmi_audio_can_stream(vc4_hdmi)) { diff --git a/target/linux/bcm27xx/patches-6.6/950-0030-drm-vc4-hvs-Defer-dlist-slots-deallocation.patch b/target/linux/bcm27xx/patches-6.6/950-0030-drm-vc4-hvs-Defer-dlist-slots-deallocation.patch index a53dd1fa637..0d052868638 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0030-drm-vc4-hvs-Defer-dlist-slots-deallocation.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0030-drm-vc4-hvs-Defer-dlist-slots-deallocation.patch @@ -98,7 +98,7 @@ Signed-off-by: Maxime Ripard } --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -332,6 +332,9 @@ struct vc4_hvs { +@@ -333,6 +333,9 @@ struct vc4_hvs { struct drm_mm lbm_mm; spinlock_t mm_lock; @@ -108,7 +108,7 @@ Signed-off-by: Maxime Ripard struct drm_mm_node mitchell_netravali_filter; struct debugfs_regset32 regset; -@@ -619,10 +622,16 @@ struct drm_connector *vc4_get_crtc_conne +@@ -620,10 +623,16 @@ struct drm_connector *vc4_get_crtc_conne struct drm_encoder *vc4_get_crtc_encoder(struct drm_crtc *crtc, struct drm_crtc_state *state); @@ -127,7 +127,7 @@ Signed-off-by: Maxime Ripard bool txp_armed; unsigned int assigned_channel; -@@ -1032,6 +1041,8 @@ struct vc4_hvs *__vc4_hvs_alloc(struct v +@@ -1033,6 +1042,8 @@ struct vc4_hvs *__vc4_hvs_alloc(struct v void vc4_hvs_stop_channel(struct vc4_hvs *hvs, unsigned int output); int vc4_hvs_get_fifo_from_output(struct vc4_hvs *hvs, unsigned int output); u8 vc4_hvs_get_fifo_frame_count(struct vc4_hvs *hvs, unsigned int fifo); @@ -138,7 +138,7 @@ Signed-off-by: Maxime Ripard void vc4_hvs_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state); --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -412,6 +412,152 @@ static void vc5_hvs_update_gamma_lut(str +@@ -417,6 +417,152 @@ static void vc5_hvs_update_gamma_lut(str vc5_hvs_lut_load(hvs, vc4_crtc); } @@ -291,7 +291,7 @@ Signed-off-by: Maxime Ripard u8 vc4_hvs_get_fifo_frame_count(struct vc4_hvs *hvs, unsigned int fifo) { struct drm_device *drm = &hvs->vc4->base; -@@ -643,13 +789,12 @@ int vc4_hvs_atomic_check(struct drm_crtc +@@ -646,13 +792,12 @@ int vc4_hvs_atomic_check(struct drm_crtc { struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc); struct vc4_crtc_state *vc4_state = to_vc4_crtc_state(crtc_state); @@ -306,7 +306,7 @@ Signed-off-by: Maxime Ripard /* The pixelvalve can only feed one encoder (and encoders are * 1:1 with connectors.) -@@ -662,12 +807,11 @@ int vc4_hvs_atomic_check(struct drm_crtc +@@ -665,12 +810,11 @@ int vc4_hvs_atomic_check(struct drm_crtc dlist_count++; /* Account for SCALER_CTL0_END. */ @@ -324,7 +324,7 @@ Signed-off-by: Maxime Ripard return vc4_hvs_gamma_check(crtc, state); } -@@ -683,8 +827,9 @@ static void vc4_hvs_install_dlist(struct +@@ -686,8 +830,9 @@ static void vc4_hvs_install_dlist(struct if (!drm_dev_enter(dev, &idx)) return; @@ -335,7 +335,7 @@ Signed-off-by: Maxime Ripard drm_dev_exit(idx); } -@@ -711,8 +856,10 @@ static void vc4_hvs_update_dlist(struct +@@ -714,8 +859,10 @@ static void vc4_hvs_update_dlist(struct spin_unlock_irqrestore(&dev->event_lock, flags); } @@ -347,7 +347,7 @@ Signed-off-by: Maxime Ripard spin_unlock_irqrestore(&vc4_crtc->irq_lock, flags); } -@@ -769,8 +916,7 @@ void vc4_hvs_atomic_flush(struct drm_crt +@@ -772,8 +919,7 @@ void vc4_hvs_atomic_flush(struct drm_crt struct vc4_plane_state *vc4_plane_state; bool debug_dump_regs = false; bool enable_bg_fill = false; @@ -357,7 +357,7 @@ Signed-off-by: Maxime Ripard unsigned int zpos = 0; bool found = false; int idx; -@@ -788,6 +934,9 @@ void vc4_hvs_atomic_flush(struct drm_crt +@@ -791,6 +937,9 @@ void vc4_hvs_atomic_flush(struct drm_crt vc4_hvs_dump_state(hvs); } @@ -367,7 +367,7 @@ Signed-off-by: Maxime Ripard /* Copy all the active planes' dlist contents to the hardware dlist. */ do { found = false; -@@ -821,7 +970,8 @@ void vc4_hvs_atomic_flush(struct drm_crt +@@ -824,7 +973,8 @@ void vc4_hvs_atomic_flush(struct drm_crt writel(SCALER_CTL0_END, dlist_next); dlist_next++; @@ -377,7 +377,7 @@ Signed-off-by: Maxime Ripard if (enable_bg_fill) /* This sets a black background color fill, as is the case -@@ -960,6 +1110,11 @@ static irqreturn_t vc4_hvs_irq_handler(i +@@ -964,6 +1114,11 @@ static irqreturn_t vc4_hvs_irq_handler(i irqret = IRQ_HANDLED; } @@ -389,7 +389,7 @@ Signed-off-by: Maxime Ripard } /* Clear every per-channel interrupt flag. */ -@@ -1014,6 +1169,9 @@ struct vc4_hvs *__vc4_hvs_alloc(struct v +@@ -1018,6 +1173,9 @@ struct vc4_hvs *__vc4_hvs_alloc(struct v spin_lock_init(&hvs->mm_lock); diff --git a/target/linux/bcm27xx/patches-6.6/950-0031-drm-vc4-hvs-Initialize-the-dlist-allocation-list-ent.patch b/target/linux/bcm27xx/patches-6.6/950-0031-drm-vc4-hvs-Initialize-the-dlist-allocation-list-ent.patch index d250dd4e1e1..2fd7aa573de 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0031-drm-vc4-hvs-Initialize-the-dlist-allocation-list-ent.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0031-drm-vc4-hvs-Initialize-the-dlist-allocation-list-ent.patch @@ -19,7 +19,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -452,6 +452,8 @@ vc4_hvs_alloc_dlist_entry(struct vc4_hvs +@@ -457,6 +457,8 @@ vc4_hvs_alloc_dlist_entry(struct vc4_hvs if (!alloc) return ERR_PTR(-ENOMEM); diff --git a/target/linux/bcm27xx/patches-6.6/950-0032-drm-vc4-hvs-Move-the-dlist-allocation-destruction-to.patch b/target/linux/bcm27xx/patches-6.6/950-0032-drm-vc4-hvs-Move-the-dlist-allocation-destruction-to.patch index f6fe9e1a4c2..07fb255e661 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0032-drm-vc4-hvs-Move-the-dlist-allocation-destruction-to.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0032-drm-vc4-hvs-Move-the-dlist-allocation-destruction-to.patch @@ -14,7 +14,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -466,6 +466,18 @@ vc4_hvs_alloc_dlist_entry(struct vc4_hvs +@@ -471,6 +471,18 @@ vc4_hvs_alloc_dlist_entry(struct vc4_hvs return alloc; } @@ -33,7 +33,7 @@ Signed-off-by: Maxime Ripard void vc4_hvs_mark_dlist_entry_stale(struct vc4_hvs *hvs, struct vc4_hvs_dlist_allocation *alloc) { -@@ -553,9 +565,7 @@ static void vc4_hvs_dlist_free_work(stru +@@ -558,9 +570,7 @@ static void vc4_hvs_dlist_free_work(stru if (!vc4_hvs_frcnt_lte(cur->target_frame_count, frcnt)) continue; diff --git a/target/linux/bcm27xx/patches-6.6/950-0033-drm-vc4-hvs-Destroy-dlist-allocations-immediately-wh.patch b/target/linux/bcm27xx/patches-6.6/950-0033-drm-vc4-hvs-Destroy-dlist-allocations-immediately-wh.patch index 6c8689e169c..ecfabf63b92 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0033-drm-vc4-hvs-Destroy-dlist-allocations-immediately-wh.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0033-drm-vc4-hvs-Destroy-dlist-allocations-immediately-wh.patch @@ -27,7 +27,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -490,6 +490,18 @@ void vc4_hvs_mark_dlist_entry_stale(stru +@@ -495,6 +495,18 @@ void vc4_hvs_mark_dlist_entry_stale(stru if (!drm_mm_node_allocated(&alloc->mm_node)) return; diff --git a/target/linux/bcm27xx/patches-6.6/950-0035-drm-vc4-Calculate-bpc-based-on-max_requested_bpc.patch b/target/linux/bcm27xx/patches-6.6/950-0035-drm-vc4-Calculate-bpc-based-on-max_requested_bpc.patch index f0fb3eb7d47..fbaa2619aa5 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0035-drm-vc4-Calculate-bpc-based-on-max_requested_bpc.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0035-drm-vc4-Calculate-bpc-based-on-max_requested_bpc.patch @@ -18,7 +18,7 @@ Signed-off-by: Matthias Reichl --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -2132,7 +2132,7 @@ vc4_hdmi_encoder_compute_config(const st +@@ -2136,7 +2136,7 @@ vc4_hdmi_encoder_compute_config(const st { struct drm_device *dev = vc4_hdmi->connector.dev; struct drm_connector_state *conn_state = &vc4_state->base; diff --git a/target/linux/bcm27xx/patches-6.6/950-0036-drm-vc4-Set-AXI-panic-modes-for-the-HVS.patch b/target/linux/bcm27xx/patches-6.6/950-0036-drm-vc4-Set-AXI-panic-modes-for-the-HVS.patch index 99609473958..13015f1f497 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0036-drm-vc4-Set-AXI-panic-modes-for-the-HVS.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0036-drm-vc4-Set-AXI-panic-modes-for-the-HVS.patch @@ -19,7 +19,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -1363,6 +1363,17 @@ static int vc4_hvs_bind(struct device *d +@@ -1368,6 +1368,17 @@ static int vc4_hvs_bind(struct device *d dispctrl |= VC4_SET_FIELD(2, SCALER_DISPCTRL_PANIC1); dispctrl |= VC4_SET_FIELD(2, SCALER_DISPCTRL_PANIC2); diff --git a/target/linux/bcm27xx/patches-6.6/950-0037-drm-vc4-drop-unnecessary-and-harmful-HDMI-RGB-format.patch b/target/linux/bcm27xx/patches-6.6/950-0037-drm-vc4-drop-unnecessary-and-harmful-HDMI-RGB-format.patch index b9fba16f695..18b5b63b547 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0037-drm-vc4-drop-unnecessary-and-harmful-HDMI-RGB-format.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0037-drm-vc4-drop-unnecessary-and-harmful-HDMI-RGB-format.patch @@ -25,7 +25,7 @@ Signed-off-by: Matthias Reichl --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -1958,9 +1958,6 @@ vc4_hdmi_sink_supports_format_bpc(const +@@ -1962,9 +1962,6 @@ vc4_hdmi_sink_supports_format_bpc(const case VC4_HDMI_OUTPUT_RGB: drm_dbg(dev, "RGB Format, checking the constraints.\n"); diff --git a/target/linux/bcm27xx/patches-6.6/950-0038-drm-vc4-Limit-max_bpc-to-8-on-Pi0-3.patch b/target/linux/bcm27xx/patches-6.6/950-0038-drm-vc4-Limit-max_bpc-to-8-on-Pi0-3.patch index 2b86f419529..b3b1c3d9e43 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0038-drm-vc4-Limit-max_bpc-to-8-on-Pi0-3.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0038-drm-vc4-Limit-max_bpc-to-8-on-Pi0-3.patch @@ -13,7 +13,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -762,7 +762,6 @@ static int vc4_hdmi_connector_init(struc +@@ -766,7 +766,6 @@ static int vc4_hdmi_connector_init(struc drm_connector_attach_colorspace_property(connector); drm_connector_attach_tv_margin_properties(connector); @@ -21,7 +21,7 @@ Signed-off-by: Dave Stevenson connector->polled = (DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT); -@@ -771,8 +770,12 @@ static int vc4_hdmi_connector_init(struc +@@ -775,8 +774,12 @@ static int vc4_hdmi_connector_init(struc connector->doublescan_allowed = 0; connector->stereo_allowed = 1; diff --git a/target/linux/bcm27xx/patches-6.6/950-0039-arm64-setup-Fix-build-warning.patch b/target/linux/bcm27xx/patches-6.6/950-0039-arm64-setup-Fix-build-warning.patch index a53c896daaa..75e552a7ef0 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0039-arm64-setup-Fix-build-warning.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0039-arm64-setup-Fix-build-warning.patch @@ -10,7 +10,7 @@ Signed-off-by: Maxime Ripard --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c -@@ -225,9 +225,9 @@ static void __init request_standard_reso +@@ -229,9 +229,9 @@ static void __init request_standard_reso size_t res_size; kernel_code.start = __pa_symbol(_stext); diff --git a/target/linux/bcm27xx/patches-6.6/950-0065-cgroup-Disable-cgroup-memory-by-default.patch b/target/linux/bcm27xx/patches-6.6/950-0065-cgroup-Disable-cgroup-memory-by-default.patch index 8a06ec387e6..5f2d80b697c 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0065-cgroup-Disable-cgroup-memory-by-default.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0065-cgroup-Disable-cgroup-memory-by-default.patch @@ -17,7 +17,7 @@ Signed-off-by: Phil Elwell --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c -@@ -6060,6 +6060,9 @@ int __init cgroup_init_early(void) +@@ -6063,6 +6063,9 @@ int __init cgroup_init_early(void) return 0; } @@ -27,7 +27,7 @@ Signed-off-by: Phil Elwell /** * cgroup_init - cgroup initialization * -@@ -6093,6 +6096,12 @@ int __init cgroup_init(void) +@@ -6096,6 +6099,12 @@ int __init cgroup_init(void) cgroup_unlock(); @@ -40,7 +40,7 @@ Signed-off-by: Phil Elwell for_each_subsys(ss, ssid) { if (ss->early_init) { struct cgroup_subsys_state *css = -@@ -6733,6 +6742,10 @@ static int __init cgroup_disable(char *s +@@ -6736,6 +6745,10 @@ static int __init cgroup_disable(char *s strcmp(token, ss->legacy_name)) continue; @@ -51,7 +51,7 @@ Signed-off-by: Phil Elwell static_branch_disable(cgroup_subsys_enabled_key[i]); pr_info("Disabling %s control group subsystem\n", ss->name); -@@ -6751,6 +6764,31 @@ static int __init cgroup_disable(char *s +@@ -6754,6 +6767,31 @@ static int __init cgroup_disable(char *s } __setup("cgroup_disable=", cgroup_disable); diff --git a/target/linux/bcm27xx/patches-6.6/950-0081-lan78xx-Enable-LEDs-and-auto-negotiation.patch b/target/linux/bcm27xx/patches-6.6/950-0081-lan78xx-Enable-LEDs-and-auto-negotiation.patch index 8735b061701..fb248b08892 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0081-lan78xx-Enable-LEDs-and-auto-negotiation.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0081-lan78xx-Enable-LEDs-and-auto-negotiation.patch @@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -2883,6 +2883,11 @@ static int lan78xx_reset(struct lan78xx_ +@@ -2884,6 +2884,11 @@ static int lan78xx_reset(struct lan78xx_ int ret; u32 buf; u8 sig; @@ -26,7 +26,7 @@ Signed-off-by: Phil Elwell ret = lan78xx_read_reg(dev, HW_CFG, &buf); if (ret < 0) -@@ -2947,6 +2952,10 @@ static int lan78xx_reset(struct lan78xx_ +@@ -2948,6 +2953,10 @@ static int lan78xx_reset(struct lan78xx_ buf |= HW_CFG_MEF_; @@ -37,7 +37,7 @@ Signed-off-by: Phil Elwell ret = lan78xx_write_reg(dev, HW_CFG, buf); if (ret < 0) return ret; -@@ -3046,6 +3055,9 @@ static int lan78xx_reset(struct lan78xx_ +@@ -3047,6 +3056,9 @@ static int lan78xx_reset(struct lan78xx_ buf |= MAC_CR_AUTO_DUPLEX_ | MAC_CR_AUTO_SPEED_; } } 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 395ec0797c1..a8a58b58fa6 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 -@@ -2197,6 +2197,8 @@ static const struct usb_audio_quirk_flag +@@ -2212,6 +2212,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/bcm27xx/patches-6.6/950-0120-lan78xx-Read-initial-EEE-status-from-DT.patch b/target/linux/bcm27xx/patches-6.6/950-0120-lan78xx-Read-initial-EEE-status-from-DT.patch index 296ceae6c70..7aa05b0abc4 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0120-lan78xx-Read-initial-EEE-status-from-DT.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0120-lan78xx-Read-initial-EEE-status-from-DT.patch @@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -3111,6 +3111,22 @@ static int lan78xx_open(struct net_devic +@@ -3112,6 +3112,22 @@ static int lan78xx_open(struct net_devic netif_dbg(dev, ifup, dev->net, "phy initialised successfully"); diff --git a/target/linux/bcm27xx/patches-6.6/950-0125-net-lan78xx-Disable-TCP-Segmentation-Offload-TSO.patch b/target/linux/bcm27xx/patches-6.6/950-0125-net-lan78xx-Disable-TCP-Segmentation-Offload-TSO.patch index 7738bdb8da8..1b6643508b3 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0125-net-lan78xx-Disable-TCP-Segmentation-Offload-TSO.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0125-net-lan78xx-Disable-TCP-Segmentation-Offload-TSO.patch @@ -38,7 +38,7 @@ Signed-off-by: Dave Stevenson static int lan78xx_read_reg(struct lan78xx_net *dev, u32 index, u32 *data) { u32 *buf; -@@ -3471,8 +3480,14 @@ static int lan78xx_bind(struct lan78xx_n +@@ -3472,8 +3481,14 @@ static int lan78xx_bind(struct lan78xx_n if (DEFAULT_RX_CSUM_ENABLE) dev->net->features |= NETIF_F_RXCSUM; diff --git a/target/linux/bcm27xx/patches-6.6/950-0127-lan78xx-Move-enabling-of-EEE-into-PHY-init-code.patch b/target/linux/bcm27xx/patches-6.6/950-0127-lan78xx-Move-enabling-of-EEE-into-PHY-init-code.patch index f73106ab4bd..f98d2c7dd63 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0127-lan78xx-Move-enabling-of-EEE-into-PHY-init-code.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0127-lan78xx-Move-enabling-of-EEE-into-PHY-init-code.patch @@ -16,7 +16,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -2419,6 +2419,22 @@ static int lan78xx_phy_init(struct lan78 +@@ -2420,6 +2420,22 @@ static int lan78xx_phy_init(struct lan78 mii_adv_to_linkmode_adv_t(fc, mii_adv); linkmode_or(phydev->advertising, fc, phydev->advertising); @@ -39,7 +39,7 @@ Signed-off-by: Phil Elwell if (phydev->mdio.dev.of_node) { u32 reg; int len; -@@ -3120,22 +3136,6 @@ static int lan78xx_open(struct net_devic +@@ -3121,22 +3137,6 @@ static int lan78xx_open(struct net_devic netif_dbg(dev, ifup, dev->net, "phy initialised successfully"); diff --git a/target/linux/bcm27xx/patches-6.6/950-0130-serial-sc16is7xx-Don-t-spin-if-no-data-received.patch b/target/linux/bcm27xx/patches-6.6/950-0130-serial-sc16is7xx-Don-t-spin-if-no-data-received.patch index eceba53aabd..4ef34aeffc0 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0130-serial-sc16is7xx-Don-t-spin-if-no-data-received.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0130-serial-sc16is7xx-Don-t-spin-if-no-data-received.patch @@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c -@@ -773,6 +773,8 @@ static bool sc16is7xx_port_irq(struct sc +@@ -777,6 +777,8 @@ static bool sc16is7xx_port_irq(struct sc if (rxlen) sc16is7xx_handle_rx(port, rxlen, iir); diff --git a/target/linux/bcm27xx/patches-6.6/950-0133-lan78xx-Debounce-link-events-to-minimize-poll-storm.patch b/target/linux/bcm27xx/patches-6.6/950-0133-lan78xx-Debounce-link-events-to-minimize-poll-storm.patch index dc411233dfa..2ca2550acb3 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0133-lan78xx-Debounce-link-events-to-minimize-poll-storm.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0133-lan78xx-Debounce-link-events-to-minimize-poll-storm.patch @@ -29,7 +29,7 @@ See: https://github.com/raspberrypi/linux/issues/2447 static int lan78xx_read_reg(struct lan78xx_net *dev, u32 index, u32 *data) { u32 *buf; -@@ -4455,7 +4460,13 @@ static int lan78xx_probe(struct usb_inte +@@ -4458,7 +4463,13 @@ static int lan78xx_probe(struct usb_inte if (ret < 0) goto out4; @@ -42,5 +42,5 @@ See: https://github.com/raspberrypi/linux/issues/2447 + netif_notice(dev, probe, netdev, "int urb period %d\n", period); + maxp = usb_maxpacket(dev->udev, dev->pipe_intr); - buf = kmalloc(maxp, GFP_KERNEL); - if (!buf) { + + dev->urb_intr = usb_alloc_urb(0, GFP_KERNEL); diff --git a/target/linux/bcm27xx/patches-6.6/950-0134-lan78xx-EEE-support-is-now-a-PHY-property.patch b/target/linux/bcm27xx/patches-6.6/950-0134-lan78xx-EEE-support-is-now-a-PHY-property.patch index df6c7e687fd..b5e0095d97c 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0134-lan78xx-EEE-support-is-now-a-PHY-property.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0134-lan78xx-EEE-support-is-now-a-PHY-property.patch @@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c -@@ -2424,7 +2424,7 @@ static int lan78xx_phy_init(struct lan78 +@@ -2425,7 +2425,7 @@ static int lan78xx_phy_init(struct lan78 mii_adv_to_linkmode_adv_t(fc, mii_adv); linkmode_or(phydev->advertising, fc, phydev->advertising); diff --git a/target/linux/bcm27xx/patches-6.6/950-0204-spi-Force-CS_HIGH-if-GPIO-descriptors-are-used.patch b/target/linux/bcm27xx/patches-6.6/950-0204-spi-Force-CS_HIGH-if-GPIO-descriptors-are-used.patch index 5398d85ef3e..7cbbeebf6de 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0204-spi-Force-CS_HIGH-if-GPIO-descriptors-are-used.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0204-spi-Force-CS_HIGH-if-GPIO-descriptors-are-used.patch @@ -32,7 +32,7 @@ Signed-off-by: Phil Elwell --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c -@@ -3740,6 +3740,7 @@ static int spi_set_cs_timing(struct spi_ +@@ -3747,6 +3747,7 @@ static int spi_set_cs_timing(struct spi_ */ int spi_setup(struct spi_device *spi) { @@ -40,7 +40,7 @@ Signed-off-by: Phil Elwell unsigned bad_bits, ugly_bits; int status = 0; -@@ -3760,6 +3761,14 @@ int spi_setup(struct spi_device *spi) +@@ -3767,6 +3768,14 @@ int spi_setup(struct spi_device *spi) (SPI_TX_DUAL | SPI_TX_QUAD | SPI_TX_OCTAL | SPI_RX_DUAL | SPI_RX_QUAD | SPI_RX_OCTAL))) return -EINVAL; diff --git a/target/linux/bcm27xx/patches-6.6/950-0468-drm-vc4-hdmi-Increase-MAI-fifo-dreq-threshold.patch b/target/linux/bcm27xx/patches-6.6/950-0468-drm-vc4-hdmi-Increase-MAI-fifo-dreq-threshold.patch index a0c1eba9310..f43df7ca3f7 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0468-drm-vc4-hdmi-Increase-MAI-fifo-dreq-threshold.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0468-drm-vc4-hdmi-Increase-MAI-fifo-dreq-threshold.patch @@ -16,7 +16,7 @@ Signed-off-by: Dom Cobley --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -2527,6 +2527,7 @@ static int vc4_hdmi_audio_prepare(struct +@@ -2531,6 +2531,7 @@ static int vc4_hdmi_audio_prepare(struct { struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); struct drm_device *drm = vc4_hdmi->connector.dev; @@ -24,7 +24,7 @@ Signed-off-by: Dom Cobley struct drm_encoder *encoder = &vc4_hdmi->encoder.base; unsigned int sample_rate = params->sample_rate; unsigned int channels = params->channels; -@@ -2585,11 +2586,18 @@ static int vc4_hdmi_audio_prepare(struct +@@ -2589,11 +2590,18 @@ static int vc4_hdmi_audio_prepare(struct VC4_HDMI_AUDIO_PACKET_CEA_MASK); /* Set the MAI threshold */ diff --git a/target/linux/bcm27xx/patches-6.6/950-0475-serial-sc16is7xx-Read-modem-line-state-at-startup.patch b/target/linux/bcm27xx/patches-6.6/950-0475-serial-sc16is7xx-Read-modem-line-state-at-startup.patch index 08c1bd17ce7..0149501e777 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0475-serial-sc16is7xx-Read-modem-line-state-at-startup.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0475-serial-sc16is7xx-Read-modem-line-state-at-startup.patch @@ -16,7 +16,7 @@ Signed-off-by: Phil Elwell --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c -@@ -1206,6 +1206,9 @@ static int sc16is7xx_startup(struct uart +@@ -1210,6 +1210,9 @@ static int sc16is7xx_startup(struct uart SC16IS7XX_IER_MSI_BIT; sc16is7xx_port_write(port, SC16IS7XX_IER_REG, val); diff --git a/target/linux/bcm27xx/patches-6.6/950-0485-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch b/target/linux/bcm27xx/patches-6.6/950-0485-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch index f0c75c6bfaf..8d276e16818 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0485-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0485-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch @@ -75,7 +75,7 @@ Signed-off-by: Jonathan Bell if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c -@@ -3671,6 +3671,48 @@ static int xhci_align_td(struct xhci_hcd +@@ -3679,6 +3679,48 @@ static int xhci_align_td(struct xhci_hcd return 1; } @@ -124,7 +124,7 @@ Signed-off-by: Jonathan Bell /* This is very similar to what ehci-q.c qtd_fill() does */ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb, int slot_id, unsigned int ep_index) -@@ -3827,6 +3869,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd * +@@ -3835,6 +3877,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd * } check_trb_math(urb, enqd_len); @@ -133,7 +133,7 @@ Signed-off-by: Jonathan Bell giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id, start_cycle, start_trb); return 0; -@@ -3962,6 +4006,8 @@ int xhci_queue_ctrl_tx(struct xhci_hcd * +@@ -3970,6 +4014,8 @@ int xhci_queue_ctrl_tx(struct xhci_hcd * /* Event on completion */ field | TRB_IOC | TRB_TYPE(TRB_STATUS) | ep_ring->cycle_state); diff --git a/target/linux/bcm27xx/patches-6.6/950-0578-drm-vc4-hdmi-Enable-the-audio-clock.patch b/target/linux/bcm27xx/patches-6.6/950-0578-drm-vc4-hdmi-Enable-the-audio-clock.patch index 79d040070f0..ab082c6a190 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0578-drm-vc4-hdmi-Enable-the-audio-clock.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0578-drm-vc4-hdmi-Enable-the-audio-clock.patch @@ -18,7 +18,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -3595,6 +3595,7 @@ static int vc4_hdmi_runtime_suspend(stru +@@ -3599,6 +3599,7 @@ static int vc4_hdmi_runtime_suspend(stru { struct vc4_hdmi *vc4_hdmi = dev_get_drvdata(dev); @@ -26,7 +26,7 @@ Signed-off-by: Maxime Ripard clk_disable_unprepare(vc4_hdmi->hsm_clock); return 0; -@@ -3627,6 +3628,10 @@ static int vc4_hdmi_runtime_resume(struc +@@ -3631,6 +3632,10 @@ static int vc4_hdmi_runtime_resume(struc goto err_disable_clk; } diff --git a/target/linux/bcm27xx/patches-6.6/950-0580-drm-vc4-hvs-More-logging-for-dlist-generation.patch b/target/linux/bcm27xx/patches-6.6/950-0580-drm-vc4-hvs-More-logging-for-dlist-generation.patch index 6c0a85d703d..69b36207c6a 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0580-drm-vc4-hvs-More-logging-for-dlist-generation.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0580-drm-vc4-hvs-More-logging-for-dlist-generation.patch @@ -14,7 +14,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -826,11 +826,22 @@ int vc4_hvs_atomic_check(struct drm_crtc +@@ -829,11 +829,22 @@ int vc4_hvs_atomic_check(struct drm_crtc if (hweight32(crtc_state->connector_mask) > 1) return -EINVAL; diff --git a/target/linux/bcm27xx/patches-6.6/950-0581-drm-vc4-hvs-Print-error-if-we-fail-an-allocation.patch b/target/linux/bcm27xx/patches-6.6/950-0581-drm-vc4-hvs-Print-error-if-we-fail-an-allocation.patch index 3b30ea2f479..eeed520f4b2 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0581-drm-vc4-hvs-Print-error-if-we-fail-an-allocation.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0581-drm-vc4-hvs-Print-error-if-we-fail-an-allocation.patch @@ -19,7 +19,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -441,6 +441,8 @@ vc4_hvs_alloc_dlist_entry(struct vc4_hvs +@@ -446,6 +446,8 @@ vc4_hvs_alloc_dlist_entry(struct vc4_hvs unsigned int channel, size_t dlist_count) { @@ -28,7 +28,7 @@ Signed-off-by: Maxime Ripard struct vc4_hvs_dlist_allocation *alloc; unsigned long flags; int ret; -@@ -458,8 +460,10 @@ vc4_hvs_alloc_dlist_entry(struct vc4_hvs +@@ -463,8 +465,10 @@ vc4_hvs_alloc_dlist_entry(struct vc4_hvs ret = drm_mm_insert_node(&hvs->dlist_mm, &alloc->mm_node, dlist_count); spin_unlock_irqrestore(&hvs->mm_lock, flags); diff --git a/target/linux/bcm27xx/patches-6.6/950-0585-drm-vc4-Introduce-generation-number-enum.patch b/target/linux/bcm27xx/patches-6.6/950-0585-drm-vc4-Introduce-generation-number-enum.patch index 0e810a1f4e1..8372ae23fec 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0585-drm-vc4-Introduce-generation-number-enum.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0585-drm-vc4-Introduce-generation-number-enum.patch @@ -22,7 +22,7 @@ Signed-off-by: Maxime Ripard drivers/gpu/drm/vc4/vc4_drv.h | 7 ++- drivers/gpu/drm/vc4/vc4_gem.c | 24 +++++------ drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- - drivers/gpu/drm/vc4/vc4_hvs.c | 50 ++++++++++++---------- + drivers/gpu/drm/vc4/vc4_hvs.c | 52 ++++++++++++---------- drivers/gpu/drm/vc4/vc4_irq.c | 10 ++--- drivers/gpu/drm/vc4/vc4_kms.c | 14 +++--- drivers/gpu/drm/vc4/vc4_perfmon.c | 20 ++++----- @@ -31,7 +31,7 @@ Signed-off-by: Maxime Ripard drivers/gpu/drm/vc4/vc4_v3d.c | 10 ++--- drivers/gpu/drm/vc4/vc4_validate.c | 8 ++-- drivers/gpu/drm/vc4/vc4_validate_shaders.c | 2 +- - 16 files changed, 126 insertions(+), 111 deletions(-) + 16 files changed, 127 insertions(+), 112 deletions(-) --- a/drivers/gpu/drm/vc4/tests/vc4_mock.c +++ b/drivers/gpu/drm/vc4/tests/vc4_mock.c @@ -470,7 +470,7 @@ Signed-off-by: Maxime Ripard switch (args->madv) { --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -2586,7 +2586,7 @@ static int vc4_hdmi_audio_prepare(struct +@@ -2590,7 +2590,7 @@ static int vc4_hdmi_audio_prepare(struct VC4_HDMI_AUDIO_PACKET_CEA_MASK); /* Set the MAI threshold */ @@ -481,7 +481,16 @@ Signed-off-by: Maxime Ripard VC4_SET_FIELD(0x10, VC4_HD_MAI_THR_PANICLOW) | --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -416,7 +416,7 @@ static void vc4_hvs_irq_enable_eof(const +@@ -303,7 +303,7 @@ static void vc4_hvs_lut_load(struct vc4_ + if (!drm_dev_enter(drm, &idx)) + return; + +- if (hvs->vc4->is_vc5) ++ if (hvs->vc4->gen == VC4_GEN_5) + return; + + /* The LUT memory is laid out with each HVS channel in order, +@@ -421,7 +421,7 @@ static void vc4_hvs_irq_enable_eof(const unsigned int channel) { struct vc4_dev *vc4 = hvs->vc4; @@ -490,7 +499,7 @@ Signed-off-by: Maxime Ripard SCALER5_DISPCTRL_DSPEIEOF(channel) : SCALER_DISPCTRL_DSPEIEOF(channel); -@@ -428,7 +428,7 @@ static void vc4_hvs_irq_clear_eof(const +@@ -433,7 +433,7 @@ static void vc4_hvs_irq_clear_eof(const unsigned int channel) { struct vc4_dev *vc4 = hvs->vc4; @@ -499,7 +508,7 @@ Signed-off-by: Maxime Ripard SCALER5_DISPCTRL_DSPEIEOF(channel) : SCALER_DISPCTRL_DSPEIEOF(channel); -@@ -620,7 +620,7 @@ int vc4_hvs_get_fifo_from_output(struct +@@ -625,7 +625,7 @@ int vc4_hvs_get_fifo_from_output(struct u32 reg; int ret; @@ -508,7 +517,7 @@ Signed-off-by: Maxime Ripard return output; /* -@@ -701,7 +701,7 @@ static int vc4_hvs_init_channel(struct v +@@ -706,7 +706,7 @@ static int vc4_hvs_init_channel(struct v dispctrl = SCALER_DISPCTRLX_ENABLE; dispbkgndx = HVS_READ(SCALER_DISPBKGNDX(chan)); @@ -517,7 +526,7 @@ Signed-off-by: Maxime Ripard dispctrl |= VC4_SET_FIELD(mode->hdisplay, SCALER_DISPCTRLX_WIDTH) | VC4_SET_FIELD(mode->vdisplay, -@@ -732,7 +732,7 @@ static int vc4_hvs_init_channel(struct v +@@ -737,7 +737,7 @@ static int vc4_hvs_init_channel(struct v /* Reload the LUT, since the SRAMs would have been disabled if * all CRTCs had SCALER_DISPBKGND_GAMMA unset at once. */ @@ -526,7 +535,7 @@ Signed-off-by: Maxime Ripard vc4_hvs_lut_load(hvs, vc4_crtc); else vc5_hvs_lut_load(hvs, vc4_crtc); -@@ -782,7 +782,7 @@ static int vc4_hvs_gamma_check(struct dr +@@ -785,7 +785,7 @@ static int vc4_hvs_gamma_check(struct dr struct drm_device *dev = crtc->dev; struct vc4_dev *vc4 = to_vc4_dev(dev); @@ -535,7 +544,7 @@ Signed-off-by: Maxime Ripard return 0; if (!crtc_state->color_mgmt_changed) -@@ -1036,7 +1036,7 @@ void vc4_hvs_atomic_flush(struct drm_crt +@@ -1039,7 +1039,7 @@ void vc4_hvs_atomic_flush(struct drm_crt u32 dispbkgndx = HVS_READ(SCALER_DISPBKGNDX(channel)); if (crtc->state->gamma_lut) { @@ -544,7 +553,7 @@ Signed-off-by: Maxime Ripard vc4_hvs_update_gamma_lut(hvs, vc4_crtc); dispbkgndx |= SCALER_DISPBKGND_GAMMA; } else { -@@ -1053,7 +1053,7 @@ void vc4_hvs_atomic_flush(struct drm_crt +@@ -1056,7 +1056,7 @@ void vc4_hvs_atomic_flush(struct drm_crt * should already be disabling/enabling the pipeline * when gamma changes. */ @@ -553,7 +562,7 @@ Signed-off-by: Maxime Ripard dispbkgndx &= ~SCALER_DISPBKGND_GAMMA; } HVS_WRITE(SCALER_DISPBKGNDX(channel), dispbkgndx); -@@ -1069,7 +1069,8 @@ void vc4_hvs_atomic_flush(struct drm_crt +@@ -1073,7 +1073,8 @@ exit: void vc4_hvs_mask_underrun(struct vc4_hvs *hvs, int channel) { @@ -563,7 +572,7 @@ Signed-off-by: Maxime Ripard u32 dispctrl; int idx; -@@ -1077,8 +1078,9 @@ void vc4_hvs_mask_underrun(struct vc4_hv +@@ -1081,8 +1082,9 @@ void vc4_hvs_mask_underrun(struct vc4_hv return; dispctrl = HVS_READ(SCALER_DISPCTRL); @@ -575,7 +584,7 @@ Signed-off-by: Maxime Ripard HVS_WRITE(SCALER_DISPCTRL, dispctrl); -@@ -1087,7 +1089,8 @@ void vc4_hvs_mask_underrun(struct vc4_hv +@@ -1091,7 +1093,8 @@ void vc4_hvs_mask_underrun(struct vc4_hv void vc4_hvs_unmask_underrun(struct vc4_hvs *hvs, int channel) { @@ -585,7 +594,7 @@ Signed-off-by: Maxime Ripard u32 dispctrl; int idx; -@@ -1095,8 +1098,9 @@ void vc4_hvs_unmask_underrun(struct vc4_ +@@ -1099,8 +1102,9 @@ void vc4_hvs_unmask_underrun(struct vc4_ return; dispctrl = HVS_READ(SCALER_DISPCTRL); @@ -597,7 +606,7 @@ Signed-off-by: Maxime Ripard HVS_WRITE(SCALER_DISPSTAT, SCALER_DISPSTAT_EUFLOW(channel)); -@@ -1139,8 +1143,10 @@ static irqreturn_t vc4_hvs_irq_handler(i +@@ -1143,8 +1147,10 @@ static irqreturn_t vc4_hvs_irq_handler(i control = HVS_READ(SCALER_DISPCTRL); for (channel = 0; channel < SCALER_CHANNELS_COUNT; channel++) { @@ -610,7 +619,7 @@ Signed-off-by: Maxime Ripard /* Interrupt masking is not always honored, so check it here. */ if (status & SCALER_DISPSTAT_EUFLOW(channel) && control & dspeislur) { -@@ -1176,7 +1182,7 @@ int vc4_hvs_debugfs_init(struct drm_mino +@@ -1180,7 +1186,7 @@ int vc4_hvs_debugfs_init(struct drm_mino if (!vc4->hvs) return -ENODEV; @@ -619,7 +628,7 @@ Signed-off-by: Maxime Ripard debugfs_create_bool("hvs_load_tracker", S_IRUGO | S_IWUSR, minor->debugfs_root, &vc4->load_tracker_enabled); -@@ -1225,7 +1231,7 @@ struct vc4_hvs *__vc4_hvs_alloc(struct v +@@ -1230,7 +1236,7 @@ struct vc4_hvs *__vc4_hvs_alloc(struct v * between planes when they don't overlap on the screen, but * for now we just allocate globally. */ @@ -628,7 +637,7 @@ Signed-off-by: Maxime Ripard /* 48k words of 2x12-bit pixels */ drm_mm_init(&hvs->lbm_mm, 0, 48 * 1024); else -@@ -1259,7 +1265,7 @@ static int vc4_hvs_bind(struct device *d +@@ -1264,7 +1270,7 @@ static int vc4_hvs_bind(struct device *d hvs->regset.regs = hvs_regs; hvs->regset.nregs = ARRAY_SIZE(hvs_regs); @@ -637,7 +646,7 @@ Signed-off-by: Maxime Ripard struct rpi_firmware *firmware; struct device_node *node; unsigned int max_rate; -@@ -1297,7 +1303,7 @@ static int vc4_hvs_bind(struct device *d +@@ -1302,7 +1308,7 @@ static int vc4_hvs_bind(struct device *d } } @@ -646,7 +655,7 @@ Signed-off-by: Maxime Ripard hvs->dlist = hvs->regs + SCALER_DLIST_START; else hvs->dlist = hvs->regs + SCALER5_DLIST_START; -@@ -1338,7 +1344,7 @@ static int vc4_hvs_bind(struct device *d +@@ -1343,7 +1349,7 @@ static int vc4_hvs_bind(struct device *d SCALER_DISPCTRL_DISPEIRQ(1) | SCALER_DISPCTRL_DISPEIRQ(2); @@ -655,7 +664,7 @@ Signed-off-by: Maxime Ripard dispctrl &= ~(SCALER_DISPCTRL_DMAEIRQ | SCALER_DISPCTRL_SLVWREIRQ | SCALER_DISPCTRL_SLVRDEIRQ | -@@ -1393,7 +1399,7 @@ static int vc4_hvs_bind(struct device *d +@@ -1398,7 +1404,7 @@ static int vc4_hvs_bind(struct device *d /* Recompute Composite Output Buffer (COB) allocations for the displays */ diff --git a/target/linux/bcm27xx/patches-6.6/950-0587-drm-vc4-hvs-Use-switch-statement-to-simplify-vc4_hvs.patch b/target/linux/bcm27xx/patches-6.6/950-0587-drm-vc4-hvs-Use-switch-statement-to-simplify-vc4_hvs.patch index e07e120ed09..db59ab5d5b4 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0587-drm-vc4-hvs-Use-switch-statement-to-simplify-vc4_hvs.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0587-drm-vc4-hvs-Use-switch-statement-to-simplify-vc4_hvs.patch @@ -14,7 +14,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -620,57 +620,63 @@ int vc4_hvs_get_fifo_from_output(struct +@@ -625,57 +625,63 @@ int vc4_hvs_get_fifo_from_output(struct u32 reg; int ret; diff --git a/target/linux/bcm27xx/patches-6.6/950-0588-drm-vc4-hvs-Use-switch-statement-to-simplify-enablin.patch b/target/linux/bcm27xx/patches-6.6/950-0588-drm-vc4-hvs-Use-switch-statement-to-simplify-enablin.patch index 16810d5035d..0875383a028 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0588-drm-vc4-hvs-Use-switch-statement-to-simplify-enablin.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0588-drm-vc4-hvs-Use-switch-statement-to-simplify-enablin.patch @@ -15,7 +15,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -416,24 +416,46 @@ static void vc4_hvs_irq_enable_eof(const +@@ -421,24 +421,46 @@ static void vc4_hvs_irq_enable_eof(const unsigned int channel) { struct vc4_dev *vc4 = hvs->vc4; diff --git a/target/linux/bcm27xx/patches-6.6/950-0589-drm-vc4-hvs-Test-if-the-EOF-interrupts-are-enabled.patch b/target/linux/bcm27xx/patches-6.6/950-0589-drm-vc4-hvs-Test-if-the-EOF-interrupts-are-enabled.patch index c16b1c1ca79..d8d2037350d 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0589-drm-vc4-hvs-Test-if-the-EOF-interrupts-are-enabled.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0589-drm-vc4-hvs-Test-if-the-EOF-interrupts-are-enabled.patch @@ -32,7 +32,7 @@ Signed-off-by: Maxime Ripard struct vc4_hvs { struct vc4_dev *vc4; struct platform_device *pdev; -@@ -327,6 +329,10 @@ struct vc4_hvs { +@@ -328,6 +330,10 @@ struct vc4_hvs { struct clk *core_clk; @@ -43,7 +43,7 @@ Signed-off-by: Maxime Ripard unsigned long max_core_rate; /* Memory manager for CRTCs to allocate space in the display -@@ -359,8 +365,6 @@ struct vc4_hvs { +@@ -360,8 +366,6 @@ struct vc4_hvs { bool vc5_hdmi_enable_4096by2160; }; @@ -54,7 +54,7 @@ Signed-off-by: Maxime Ripard unsigned long core_clock_rate; --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -412,11 +412,14 @@ static void vc5_hvs_update_gamma_lut(str +@@ -417,11 +417,14 @@ static void vc5_hvs_update_gamma_lut(str vc5_hvs_lut_load(hvs, vc4_crtc); } @@ -70,7 +70,7 @@ Signed-off-by: Maxime Ripard switch (vc4->gen) { case VC4_GEN_4: HVS_WRITE(SCALER_DISPCTRL, -@@ -433,13 +436,18 @@ static void vc4_hvs_irq_enable_eof(const +@@ -438,13 +441,18 @@ static void vc4_hvs_irq_enable_eof(const default: break; } @@ -90,7 +90,7 @@ Signed-off-by: Maxime Ripard switch (vc4->gen) { case VC4_GEN_4: HVS_WRITE(SCALER_DISPCTRL, -@@ -456,6 +464,8 @@ static void vc4_hvs_irq_clear_eof(const +@@ -461,6 +469,8 @@ static void vc4_hvs_irq_clear_eof(const default: break; } diff --git a/target/linux/bcm27xx/patches-6.6/950-0590-drm-vc4-hvs-Create-hw_init-function.patch b/target/linux/bcm27xx/patches-6.6/950-0590-drm-vc4-hvs-Create-hw_init-function.patch index bd0b8903695..7ddac057341 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0590-drm-vc4-hvs-Create-hw_init-function.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0590-drm-vc4-hvs-Create-hw_init-function.patch @@ -16,7 +16,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -1281,79 +1281,10 @@ struct vc4_hvs *__vc4_hvs_alloc(struct v +@@ -1286,79 +1286,10 @@ struct vc4_hvs *__vc4_hvs_alloc(struct v return hvs; } @@ -99,7 +99,7 @@ Signed-off-by: Maxime Ripard reg = HVS_READ(SCALER_DISPECTRL); reg &= ~SCALER_DISPECTRL_DSP2_MUX_MASK; -@@ -1435,6 +1366,86 @@ static int vc4_hvs_bind(struct device *d +@@ -1440,6 +1371,86 @@ static int vc4_hvs_bind(struct device *d HVS_WRITE(SCALER_DISPCTRL, dispctrl); diff --git a/target/linux/bcm27xx/patches-6.6/950-0591-drm-vc4-hvs-Create-cob_init-function.patch b/target/linux/bcm27xx/patches-6.6/950-0591-drm-vc4-hvs-Create-cob_init-function.patch index 157a474ce55..6add44807ba 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0591-drm-vc4-hvs-Create-cob_init-function.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0591-drm-vc4-hvs-Create-cob_init-function.patch @@ -16,7 +16,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -1369,6 +1369,77 @@ static int vc4_hvs_hw_init(struct vc4_hv +@@ -1374,6 +1374,77 @@ static int vc4_hvs_hw_init(struct vc4_hv return 0; } @@ -94,7 +94,7 @@ Signed-off-by: Maxime Ripard static int vc4_hvs_bind(struct device *dev, struct device *master, void *data) { struct platform_device *pdev = to_platform_device(dev); -@@ -1376,7 +1447,6 @@ static int vc4_hvs_bind(struct device *d +@@ -1381,7 +1452,6 @@ static int vc4_hvs_bind(struct device *d struct vc4_dev *vc4 = to_vc4_dev(drm); struct vc4_hvs *hvs = NULL; int ret; @@ -102,7 +102,7 @@ Signed-off-by: Maxime Ripard hvs = __vc4_hvs_alloc(vc4, NULL); if (IS_ERR(hvs)) -@@ -1446,59 +1516,9 @@ static int vc4_hvs_bind(struct device *d +@@ -1451,59 +1521,9 @@ static int vc4_hvs_bind(struct device *d if (ret) return ret; diff --git a/target/linux/bcm27xx/patches-6.6/950-0592-drm-vc4-hvs-Rename-hvs_regs-list.patch b/target/linux/bcm27xx/patches-6.6/950-0592-drm-vc4-hvs-Rename-hvs_regs-list.patch index 6719a445223..f354f6acd7f 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0592-drm-vc4-hvs-Rename-hvs_regs-list.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0592-drm-vc4-hvs-Rename-hvs_regs-list.patch @@ -25,7 +25,7 @@ Signed-off-by: Maxime Ripard VC4_REG32(SCALER_DISPCTRL), VC4_REG32(SCALER_DISPSTAT), VC4_REG32(SCALER_DISPID), -@@ -1457,8 +1457,8 @@ static int vc4_hvs_bind(struct device *d +@@ -1462,8 +1462,8 @@ static int vc4_hvs_bind(struct device *d return PTR_ERR(hvs->regs); hvs->regset.base = hvs->regs; diff --git a/target/linux/bcm27xx/patches-6.6/950-0593-drm-vc4-plane-Change-ptr0_offset-to-an-array.patch b/target/linux/bcm27xx/patches-6.6/950-0593-drm-vc4-plane-Change-ptr0_offset-to-an-array.patch index bc72a950217..4fba060928c 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0593-drm-vc4-plane-Change-ptr0_offset-to-an-array.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0593-drm-vc4-plane-Change-ptr0_offset-to-an-array.patch @@ -25,7 +25,7 @@ Signed-off-by: Maxime Ripard #include #include #include -@@ -410,7 +411,7 @@ struct vc4_plane_state { +@@ -411,7 +412,7 @@ struct vc4_plane_state { */ u32 pos0_offset; u32 pos2_offset; diff --git a/target/linux/bcm27xx/patches-6.6/950-0595-drm-vc4-hvs-Change-prototype-of-__vc4_hvs_alloc-to-p.patch b/target/linux/bcm27xx/patches-6.6/950-0595-drm-vc4-hvs-Change-prototype-of-__vc4_hvs_alloc-to-p.patch index 90f5d8a9b22..36c4010b7e9 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0595-drm-vc4-hvs-Change-prototype-of-__vc4_hvs_alloc-to-p.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0595-drm-vc4-hvs-Change-prototype-of-__vc4_hvs_alloc-to-p.patch @@ -36,7 +36,7 @@ Signed-off-by: Maxime Ripard drm = &vc4->base; --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -1047,7 +1047,9 @@ void vc4_irq_reset(struct drm_device *de +@@ -1048,7 +1048,9 @@ void vc4_irq_reset(struct drm_device *de /* vc4_hvs.c */ extern struct platform_driver vc4_hvs_driver; @@ -49,7 +49,7 @@ Signed-off-by: Maxime Ripard u8 vc4_hvs_get_fifo_frame_count(struct vc4_hvs *hvs, unsigned int fifo); --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -1238,7 +1238,9 @@ int vc4_hvs_debugfs_init(struct drm_mino +@@ -1242,7 +1242,9 @@ int vc4_hvs_debugfs_init(struct drm_mino return 0; } @@ -60,7 +60,7 @@ Signed-off-by: Maxime Ripard { struct drm_device *drm = &vc4->base; struct vc4_hvs *hvs; -@@ -1248,6 +1250,7 @@ struct vc4_hvs *__vc4_hvs_alloc(struct v +@@ -1252,6 +1254,7 @@ struct vc4_hvs *__vc4_hvs_alloc(struct v return ERR_PTR(-ENOMEM); hvs->vc4 = vc4; @@ -68,7 +68,7 @@ Signed-off-by: Maxime Ripard hvs->pdev = pdev; spin_lock_init(&hvs->mm_lock); -@@ -1446,16 +1449,17 @@ static int vc4_hvs_bind(struct device *d +@@ -1451,16 +1454,17 @@ static int vc4_hvs_bind(struct device *d struct drm_device *drm = dev_get_drvdata(master); struct vc4_dev *vc4 = to_vc4_dev(drm); struct vc4_hvs *hvs = NULL; diff --git a/target/linux/bcm27xx/patches-6.6/950-0597-drm-vc4-hdmi-Avoid-hang-with-debug-registers-when-su.patch b/target/linux/bcm27xx/patches-6.6/950-0597-drm-vc4-hdmi-Avoid-hang-with-debug-registers-when-su.patch deleted file mode 100644 index 9f58504abb1..00000000000 --- a/target/linux/bcm27xx/patches-6.6/950-0597-drm-vc4-hdmi-Avoid-hang-with-debug-registers-when-su.patch +++ /dev/null @@ -1,40 +0,0 @@ -From db41506f785ad84895a31b01e8bd7c07bceabb3d Mon Sep 17 00:00:00 2001 -From: Dom Cobley -Date: Tue, 5 Sep 2023 19:38:24 +0100 -Subject: [PATCH 0597/1085] drm/vc4: hdmi: Avoid hang with debug registers when - suspended - -Trying to read /sys/kernel/debug/dri/1/hdmi1_regs -when the hdmi is disconnected results in a fatal system hang. - -This is due to the pm suspend code disabling the dvp clock. -That is just a gate of the 108MHz clock in DVP_HT_RPI_MISC_CONFIG, -which results in accesses hanging AXI bus. - -Protect against this. - -Signed-off-by: Dom Cobley ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -185,6 +185,8 @@ static int vc4_hdmi_debugfs_regs(struct - if (!drm_dev_enter(drm, &idx)) - return -ENODEV; - -+ WARN_ON(pm_runtime_resume_and_get(&vc4_hdmi->pdev->dev)); -+ - drm_print_regset32(&p, &vc4_hdmi->hdmi_regset); - drm_print_regset32(&p, &vc4_hdmi->hd_regset); - drm_print_regset32(&p, &vc4_hdmi->cec_regset); -@@ -194,6 +196,8 @@ static int vc4_hdmi_debugfs_regs(struct - drm_print_regset32(&p, &vc4_hdmi->ram_regset); - drm_print_regset32(&p, &vc4_hdmi->rm_regset); - -+ pm_runtime_put(&vc4_hdmi->pdev->dev); -+ - drm_dev_exit(idx); - - return 0; diff --git a/target/linux/bcm27xx/patches-6.6/950-0598-drm-vc4-Move-the-buffer-offset-out-of-the-vc4_plane_.patch b/target/linux/bcm27xx/patches-6.6/950-0598-drm-vc4-Move-the-buffer-offset-out-of-the-vc4_plane_.patch index ae069adc593..7a63bc65b50 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0598-drm-vc4-Move-the-buffer-offset-out-of-the-vc4_plane_.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0598-drm-vc4-Move-the-buffer-offset-out-of-the-vc4_plane_.patch @@ -23,7 +23,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -431,11 +431,6 @@ struct vc4_plane_state { +@@ -432,11 +432,6 @@ struct vc4_plane_state { bool is_unity; bool is_yuv; diff --git a/target/linux/bcm27xx/patches-6.6/950-0599-drm-vc4-Fix-dlist-debug-not-resetting-the-next-entry.patch b/target/linux/bcm27xx/patches-6.6/950-0599-drm-vc4-Fix-dlist-debug-not-resetting-the-next-entry.patch deleted file mode 100644 index bfaecc53caa..00000000000 --- a/target/linux/bcm27xx/patches-6.6/950-0599-drm-vc4-Fix-dlist-debug-not-resetting-the-next-entry.patch +++ /dev/null @@ -1,34 +0,0 @@ -From d64998e5fc5894eb37f142b7259fa3bec091abbc Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Thu, 24 Aug 2023 15:36:21 +0100 -Subject: [PATCH 0599/1085] drm/vc4: Fix dlist debug not resetting the next - entry pointer - -The debug function to display the dlists didn't reset next_entry_start -when starting each display, so resulting in not stopping the -list at the correct place. - -Signed-off-by: Dave Stevenson ---- - drivers/gpu/drm/vc4/vc4_hvs.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/drivers/gpu/drm/vc4/vc4_hvs.c -+++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -110,7 +110,7 @@ static int vc4_hvs_debugfs_dlist(struct - struct vc4_dev *vc4 = to_vc4_dev(dev); - struct vc4_hvs *hvs = vc4->hvs; - struct drm_printer p = drm_seq_file_printer(m); -- unsigned int next_entry_start = 0; -+ unsigned int next_entry_start; - unsigned int i, j; - u32 dlist_word, dispstat; - -@@ -124,6 +124,7 @@ static int vc4_hvs_debugfs_dlist(struct - } - - drm_printf(&p, "HVS chan %u:\n", i); -+ next_entry_start = 0; - - for (j = HVS_READ(SCALER_DISPLISTX(i)); j < 256; j++) { - dlist_word = readl((u32 __iomem *)vc4->hvs->dlist + j); diff --git a/target/linux/bcm27xx/patches-6.6/950-0600-drm-vc4-Remove-incorrect-limit-from-hvs_dlist-debugf.patch b/target/linux/bcm27xx/patches-6.6/950-0600-drm-vc4-Remove-incorrect-limit-from-hvs_dlist-debugf.patch deleted file mode 100644 index a104d30b5a6..00000000000 --- a/target/linux/bcm27xx/patches-6.6/950-0600-drm-vc4-Remove-incorrect-limit-from-hvs_dlist-debugf.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 480184600be75fd78dcff1502092901d32530cc6 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Fri, 1 Sep 2023 13:45:08 +0100 -Subject: [PATCH 0600/1085] drm: vc4: Remove incorrect limit from hvs_dlist - debugfs function - -The debugfs function to dump dlists aborted at 256 bytes, -when actually the dlist memory is generally significantly -larger but varies based on SoC. - -We already have the correct limit in __vc4_hvs_alloc, so -store it for use in the debugfs dlist function. - -Signed-off-by: Dave Stevenson ---- - drivers/gpu/drm/vc4/vc4_drv.h | 1 + - drivers/gpu/drm/vc4/vc4_hvs.c | 5 ++++- - 2 files changed, 5 insertions(+), 1 deletion(-) - ---- a/drivers/gpu/drm/vc4/vc4_drv.h -+++ b/drivers/gpu/drm/vc4/vc4_drv.h -@@ -327,6 +327,7 @@ struct vc4_hvs { - struct platform_device *pdev; - void __iomem *regs; - u32 __iomem *dlist; -+ unsigned int dlist_mem_size; - - struct clk *core_clk; - ---- a/drivers/gpu/drm/vc4/vc4_hvs.c -+++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -110,6 +110,7 @@ static int vc4_hvs_debugfs_dlist(struct - struct vc4_dev *vc4 = to_vc4_dev(dev); - struct vc4_hvs *hvs = vc4->hvs; - struct drm_printer p = drm_seq_file_printer(m); -+ unsigned int dlist_mem_size = hvs->dlist_mem_size; - unsigned int next_entry_start; - unsigned int i, j; - u32 dlist_word, dispstat; -@@ -126,7 +127,7 @@ static int vc4_hvs_debugfs_dlist(struct - drm_printf(&p, "HVS chan %u:\n", i); - next_entry_start = 0; - -- for (j = HVS_READ(SCALER_DISPLISTX(i)); j < 256; j++) { -+ for (j = HVS_READ(SCALER_DISPLISTX(i)); j < dlist_mem_size; j++) { - dlist_word = readl((u32 __iomem *)vc4->hvs->dlist + j); - drm_printf(&p, "dlist: %02d: 0x%08x\n", j, - dlist_word); -@@ -1268,6 +1269,8 @@ struct vc4_hvs *__vc4_hvs_alloc(struct v - HVS_BOOTLOADER_DLIST_END, - (SCALER_DLIST_SIZE >> 2) - HVS_BOOTLOADER_DLIST_END); - -+ hvs->dlist_mem_size = dlist_size; -+ - /* Set up the HVS LBM memory manager. We could have some more - * complicated data structure that allowed reuse of LBM areas - * between planes when they don't overlap on the screen, but diff --git a/target/linux/bcm27xx/patches-6.6/950-0602-drm-vc4-Enable-SCALER_CONTROL-early-in-HVS-init.patch b/target/linux/bcm27xx/patches-6.6/950-0602-drm-vc4-Enable-SCALER_CONTROL-early-in-HVS-init.patch index 56cd010972d..62406a268b8 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0602-drm-vc4-Enable-SCALER_CONTROL-early-in-HVS-init.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0602-drm-vc4-Enable-SCALER_CONTROL-early-in-HVS-init.patch @@ -15,7 +15,7 @@ Signed-off-by: Tim Gover --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -1293,6 +1293,10 @@ static int vc4_hvs_hw_init(struct vc4_hv +@@ -1294,6 +1294,10 @@ static int vc4_hvs_hw_init(struct vc4_hv struct vc4_dev *vc4 = hvs->vc4; u32 dispctrl, reg; @@ -26,7 +26,7 @@ Signed-off-by: Tim Gover reg = HVS_READ(SCALER_DISPECTRL); reg &= ~SCALER_DISPECTRL_DSP2_MUX_MASK; HVS_WRITE(SCALER_DISPECTRL, -@@ -1314,8 +1318,6 @@ static int vc4_hvs_hw_init(struct vc4_hv +@@ -1315,8 +1319,6 @@ static int vc4_hvs_hw_init(struct vc4_hv reg | VC4_SET_FIELD(3, SCALER_DISPDITHER_DSP5_MUX)); dispctrl = HVS_READ(SCALER_DISPCTRL); @@ -35,7 +35,7 @@ Signed-off-by: Tim Gover dispctrl |= SCALER_DISPCTRL_DISPEIRQ(0) | SCALER_DISPCTRL_DISPEIRQ(1) | SCALER_DISPCTRL_DISPEIRQ(2); -@@ -1511,6 +1513,10 @@ static int vc4_hvs_bind(struct device *d +@@ -1512,6 +1514,10 @@ static int vc4_hvs_bind(struct device *d else hvs->dlist = hvs->regs + SCALER5_DLIST_START; @@ -46,7 +46,7 @@ Signed-off-by: Tim Gover /* Upload filter kernels. We only have the one for now, so we * keep it around for the lifetime of the driver. */ -@@ -1520,10 +1526,6 @@ static int vc4_hvs_bind(struct device *d +@@ -1521,10 +1527,6 @@ static int vc4_hvs_bind(struct device *d if (ret) return ret; diff --git a/target/linux/bcm27xx/patches-6.6/950-0610-drm-vc4-hvs-Support-BCM2712-HVS.patch b/target/linux/bcm27xx/patches-6.6/950-0610-drm-vc4-hvs-Support-BCM2712-HVS.patch index 6065fc6e86b..9d19b23d95a 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0610-drm-vc4-hvs-Support-BCM2712-HVS.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0610-drm-vc4-hvs-Support-BCM2712-HVS.patch @@ -341,7 +341,7 @@ Signed-off-by: Maxime Ripard static int vc5_hvs_debugfs_gamma(struct seq_file *m, void *data) { struct drm_info_node *node = m->private; -@@ -435,6 +558,10 @@ static void vc4_hvs_irq_enable_eof(struc +@@ -438,6 +561,10 @@ static void vc4_hvs_irq_enable_eof(struc SCALER5_DISPCTRL_DSPEIEOF(channel)); break; @@ -352,7 +352,7 @@ Signed-off-by: Maxime Ripard default: break; } -@@ -463,6 +590,10 @@ static void vc4_hvs_irq_clear_eof(struct +@@ -466,6 +593,10 @@ static void vc4_hvs_irq_clear_eof(struct ~SCALER5_DISPCTRL_DSPEIEOF(channel)); break; @@ -363,7 +363,7 @@ Signed-off-by: Maxime Ripard default: break; } -@@ -622,26 +753,32 @@ static void vc4_hvs_dlist_free_work(stru +@@ -625,26 +756,32 @@ static void vc4_hvs_dlist_free_work(stru u8 vc4_hvs_get_fifo_frame_count(struct vc4_hvs *hvs, unsigned int fifo) { @@ -410,7 +410,7 @@ Signed-off-by: Maxime Ripard } drm_dev_exit(idx); -@@ -708,6 +845,23 @@ int vc4_hvs_get_fifo_from_output(struct +@@ -711,6 +848,23 @@ int vc4_hvs_get_fifo_from_output(struct default: return -EPIPE; } @@ -434,7 +434,7 @@ Signed-off-by: Maxime Ripard } return -EPIPE; -@@ -782,7 +936,41 @@ static int vc4_hvs_init_channel(struct v +@@ -785,7 +939,41 @@ static int vc4_hvs_init_channel(struct v return 0; } @@ -477,7 +477,7 @@ Signed-off-by: Maxime Ripard { struct drm_device *drm = &hvs->vc4->base; int idx; -@@ -813,6 +1001,42 @@ out: +@@ -814,6 +1002,42 @@ out: drm_dev_exit(idx); } @@ -520,7 +520,7 @@ Signed-off-by: Maxime Ripard static int vc4_hvs_gamma_check(struct drm_crtc *crtc, struct drm_atomic_state *state) { -@@ -907,8 +1131,14 @@ static void vc4_hvs_install_dlist(struct +@@ -908,8 +1132,14 @@ static void vc4_hvs_install_dlist(struct return; WARN_ON(!vc4_state->mm); @@ -537,7 +537,7 @@ Signed-off-by: Maxime Ripard drm_dev_exit(idx); } -@@ -965,7 +1195,11 @@ void vc4_hvs_atomic_enable(struct drm_cr +@@ -966,7 +1196,11 @@ void vc4_hvs_atomic_enable(struct drm_cr vc4_hvs_install_dlist(crtc); vc4_hvs_update_dlist(crtc); @@ -550,7 +550,7 @@ Signed-off-by: Maxime Ripard } void vc4_hvs_atomic_disable(struct drm_crtc *crtc, -@@ -1052,13 +1286,28 @@ void vc4_hvs_atomic_flush(struct drm_crt +@@ -1053,13 +1287,28 @@ void vc4_hvs_atomic_flush(struct drm_crt WARN_ON(!vc4_state->mm); WARN_ON_ONCE(dlist_next - dlist_start != vc4_state->mm->mm_node.size); @@ -583,7 +583,7 @@ Signed-off-by: Maxime Ripard /* Only update DISPLIST if the CRTC was already running and is not * being disabled. -@@ -1210,6 +1459,27 @@ static irqreturn_t vc4_hvs_irq_handler(i +@@ -1212,6 +1461,27 @@ static irqreturn_t vc4_hvs_irq_handler(i return irqret; } @@ -611,7 +611,7 @@ Signed-off-by: Maxime Ripard int vc4_hvs_debugfs_init(struct drm_minor *minor) { struct drm_device *drm = minor->dev; -@@ -1231,7 +1501,10 @@ int vc4_hvs_debugfs_init(struct drm_mino +@@ -1233,7 +1503,10 @@ int vc4_hvs_debugfs_init(struct drm_mino NULL); } @@ -623,7 +623,7 @@ Signed-off-by: Maxime Ripard drm_debugfs_add_file(drm, "hvs_underrun", vc4_hvs_debugfs_underrun, NULL); -@@ -1246,6 +1519,9 @@ struct vc4_hvs *__vc4_hvs_alloc(struct v +@@ -1248,6 +1521,9 @@ struct vc4_hvs *__vc4_hvs_alloc(struct v { struct drm_device *drm = &vc4->base; struct vc4_hvs *hvs; @@ -633,7 +633,7 @@ Signed-off-by: Maxime Ripard hvs = drmm_kzalloc(drm, sizeof(*hvs), GFP_KERNEL); if (!hvs) -@@ -1260,14 +1536,39 @@ struct vc4_hvs *__vc4_hvs_alloc(struct v +@@ -1262,27 +1538,87 @@ struct vc4_hvs *__vc4_hvs_alloc(struct v INIT_LIST_HEAD(&hvs->stale_dlist_entries); INIT_WORK(&hvs->free_dlist_work, vc4_hvs_dlist_free_work); @@ -642,9 +642,10 @@ Signed-off-by: Maxime Ripard - * our 16K), since we don't want to scramble the screen when - * transitioning from the firmware's boot setup to runtime. - */ +- hvs->dlist_mem_size = (SCALER_DLIST_SIZE >> 2) - HVS_BOOTLOADER_DLIST_END; - drm_mm_init(&hvs->dlist_mm, - HVS_BOOTLOADER_DLIST_END, -- (SCALER_DLIST_SIZE >> 2) - HVS_BOOTLOADER_DLIST_END); +- hvs->dlist_mem_size); + switch (vc4->gen) { + case VC4_GEN_4: + case VC4_GEN_5: @@ -678,10 +679,11 @@ Signed-off-by: Maxime Ripard + } + + drm_mm_init(&hvs->dlist_mm, dlist_start, dlist_size); ++ ++ hvs->dlist_mem_size = dlist_size; - hvs->dlist_mem_size = dlist_size; - -@@ -1276,12 +1577,46 @@ struct vc4_hvs *__vc4_hvs_alloc(struct v + /* Set up the HVS LBM memory manager. We could have some more + * complicated data structure that allowed reuse of LBM areas * between planes when they don't overlap on the screen, but * for now we just allocate globally. */ @@ -732,7 +734,7 @@ Signed-off-by: Maxime Ripard vc4->hvs = hvs; -@@ -1378,10 +1713,124 @@ static int vc4_hvs_hw_init(struct vc4_hv +@@ -1379,10 +1715,124 @@ static int vc4_hvs_hw_init(struct vc4_hv return 0; } @@ -858,7 +860,7 @@ Signed-off-by: Maxime Ripard /* * Recompute Composite Output Buffer (COB) allocations for the -@@ -1442,6 +1891,31 @@ static int vc4_hvs_cob_init(struct vc4_h +@@ -1443,6 +1893,31 @@ static int vc4_hvs_cob_init(struct vc4_h HVS_WRITE(SCALER_DISPBASE0, reg); break; @@ -890,7 +892,7 @@ Signed-off-by: Maxime Ripard default: return -EINVAL; } -@@ -1467,10 +1941,16 @@ static int vc4_hvs_bind(struct device *d +@@ -1468,10 +1943,16 @@ static int vc4_hvs_bind(struct device *d return PTR_ERR(hvs); hvs->regset.base = hvs->regs; @@ -910,7 +912,7 @@ Signed-off-by: Maxime Ripard struct rpi_firmware *firmware; struct device_node *node; unsigned int max_rate; -@@ -1484,12 +1964,20 @@ static int vc4_hvs_bind(struct device *d +@@ -1485,12 +1966,20 @@ static int vc4_hvs_bind(struct device *d if (!firmware) return -EPROBE_DEFER; @@ -932,7 +934,7 @@ Signed-off-by: Maxime Ripard max_rate = rpi_firmware_clk_get_max_rate(firmware, RPI_FIRMWARE_CORE_CLK_ID); rpi_firmware_put(firmware); -@@ -1506,14 +1994,51 @@ static int vc4_hvs_bind(struct device *d +@@ -1507,14 +1996,51 @@ static int vc4_hvs_bind(struct device *d dev_err(&pdev->dev, "Couldn't enable the core clock\n"); return ret; } @@ -988,7 +990,7 @@ Signed-off-by: Maxime Ripard if (ret) return ret; -@@ -1530,10 +2055,12 @@ static int vc4_hvs_bind(struct device *d +@@ -1531,10 +2057,12 @@ static int vc4_hvs_bind(struct device *d if (ret) return ret; @@ -1005,7 +1007,7 @@ Signed-off-by: Maxime Ripard return 0; } -@@ -1558,6 +2085,7 @@ static void vc4_hvs_unbind(struct device +@@ -1559,6 +2087,7 @@ static void vc4_hvs_unbind(struct device drm_mm_remove_node(node); drm_mm_takedown(&vc4->hvs->lbm_mm); @@ -1013,7 +1015,7 @@ Signed-off-by: Maxime Ripard clk_disable_unprepare(hvs->core_clk); vc4->hvs = NULL; -@@ -1580,6 +2108,7 @@ static void vc4_hvs_dev_remove(struct pl +@@ -1581,6 +2110,7 @@ static void vc4_hvs_dev_remove(struct pl static const struct of_device_id vc4_hvs_dt_match[] = { { .compatible = "brcm,bcm2711-hvs" }, diff --git a/target/linux/bcm27xx/patches-6.6/950-0622-drm-vc4-Add-additional-warn_on.patch b/target/linux/bcm27xx/patches-6.6/950-0622-drm-vc4-Add-additional-warn_on.patch index 2fc6f3d033e..8dd44970f8b 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0622-drm-vc4-Add-additional-warn_on.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0622-drm-vc4-Add-additional-warn_on.patch @@ -32,7 +32,7 @@ Signed-off-by: Maxime Ripard if (!drm_dev_enter(drm, &idx)) return; -@@ -758,6 +761,8 @@ u8 vc4_hvs_get_fifo_frame_count(struct v +@@ -761,6 +764,8 @@ u8 vc4_hvs_get_fifo_frame_count(struct v u8 field = 0; int idx; @@ -41,7 +41,7 @@ Signed-off-by: Maxime Ripard if (!drm_dev_enter(drm, &idx)) return 0; -@@ -791,6 +796,8 @@ int vc4_hvs_get_fifo_from_output(struct +@@ -794,6 +799,8 @@ int vc4_hvs_get_fifo_from_output(struct u32 reg; int ret; @@ -50,7 +50,7 @@ Signed-off-by: Maxime Ripard switch (vc4->gen) { case VC4_GEN_4: return output; -@@ -880,6 +887,8 @@ static int vc4_hvs_init_channel(struct v +@@ -883,6 +890,8 @@ static int vc4_hvs_init_channel(struct v u32 dispctrl; int idx; @@ -59,7 +59,7 @@ Signed-off-by: Maxime Ripard if (!drm_dev_enter(drm, &idx)) return -ENODEV; -@@ -947,6 +956,8 @@ static int vc6_hvs_init_channel(struct v +@@ -950,6 +959,8 @@ static int vc6_hvs_init_channel(struct v u32 disp_ctrl1; int idx; @@ -68,7 +68,7 @@ Signed-off-by: Maxime Ripard if (!drm_dev_enter(drm, &idx)) return -ENODEV; -@@ -972,9 +983,12 @@ static int vc6_hvs_init_channel(struct v +@@ -975,9 +986,12 @@ static int vc6_hvs_init_channel(struct v static void __vc4_hvs_stop_channel(struct vc4_hvs *hvs, unsigned int chan) { @@ -82,7 +82,7 @@ Signed-off-by: Maxime Ripard if (!drm_dev_enter(drm, &idx)) return; -@@ -1007,6 +1021,8 @@ static void __vc6_hvs_stop_channel(struc +@@ -1008,6 +1022,8 @@ static void __vc6_hvs_stop_channel(struc struct drm_device *drm = &vc4->base; int idx; @@ -91,7 +91,7 @@ Signed-off-by: Maxime Ripard if (!drm_dev_enter(drm, &idx)) return; -@@ -1234,6 +1250,8 @@ void vc4_hvs_atomic_flush(struct drm_crt +@@ -1235,6 +1251,8 @@ void vc4_hvs_atomic_flush(struct drm_crt bool found = false; int idx; @@ -100,7 +100,7 @@ Signed-off-by: Maxime Ripard if (!drm_dev_enter(dev, &idx)) { vc4_crtc_send_vblank(crtc); return; -@@ -1324,6 +1342,8 @@ void vc4_hvs_atomic_flush(struct drm_crt +@@ -1325,6 +1343,8 @@ void vc4_hvs_atomic_flush(struct drm_crt if (crtc->state->color_mgmt_changed) { u32 dispbkgndx = HVS_READ(SCALER_DISPBKGNDX(channel)); @@ -109,7 +109,7 @@ Signed-off-by: Maxime Ripard if (crtc->state->gamma_lut) { if (vc4->gen == VC4_GEN_4) { vc4_hvs_update_gamma_lut(hvs, vc4_crtc); -@@ -1363,6 +1383,8 @@ void vc4_hvs_mask_underrun(struct vc4_hv +@@ -1365,6 +1385,8 @@ void vc4_hvs_mask_underrun(struct vc4_hv u32 dispctrl; int idx; @@ -118,7 +118,7 @@ Signed-off-by: Maxime Ripard if (!drm_dev_enter(drm, &idx)) return; -@@ -1383,6 +1405,8 @@ void vc4_hvs_unmask_underrun(struct vc4_ +@@ -1385,6 +1407,8 @@ void vc4_hvs_unmask_underrun(struct vc4_ u32 dispctrl; int idx; @@ -127,7 +127,7 @@ Signed-off-by: Maxime Ripard if (!drm_dev_enter(drm, &idx)) return; -@@ -1417,6 +1441,8 @@ static irqreturn_t vc4_hvs_irq_handler(i +@@ -1419,6 +1443,8 @@ static irqreturn_t vc4_hvs_irq_handler(i u32 status; u32 dspeislur; @@ -136,7 +136,7 @@ Signed-off-by: Maxime Ripard /* * NOTE: We don't need to protect the register access using * drm_dev_enter() there because the interrupt handler lifetime -@@ -1466,6 +1492,8 @@ static irqreturn_t vc6_hvs_eof_irq_handl +@@ -1468,6 +1494,8 @@ static irqreturn_t vc6_hvs_eof_irq_handl struct vc4_hvs *hvs = vc4->hvs; unsigned int i; diff --git a/target/linux/bcm27xx/patches-6.6/950-0655-vc4-drm-Remove-the-clear-of-SCALER_DISPBKGND_FILL.patch b/target/linux/bcm27xx/patches-6.6/950-0655-vc4-drm-Remove-the-clear-of-SCALER_DISPBKGND_FILL.patch index fa57c12cf62..5b2ac385c16 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0655-vc4-drm-Remove-the-clear-of-SCALER_DISPBKGND_FILL.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0655-vc4-drm-Remove-the-clear-of-SCALER_DISPBKGND_FILL.patch @@ -25,7 +25,7 @@ Signed-off-by: Dom Cobley --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -1304,27 +1304,25 @@ void vc4_hvs_atomic_flush(struct drm_crt +@@ -1305,27 +1305,25 @@ void vc4_hvs_atomic_flush(struct drm_crt WARN_ON(!vc4_state->mm); WARN_ON_ONCE(dlist_next - dlist_start != vc4_state->mm->mm_node.size); diff --git a/target/linux/bcm27xx/patches-6.6/950-0708-drm-vc4-Correct-logic-on-stopping-an-HVS-channel.patch b/target/linux/bcm27xx/patches-6.6/950-0708-drm-vc4-Correct-logic-on-stopping-an-HVS-channel.patch deleted file mode 100644 index 46b5afaa96b..00000000000 --- a/target/linux/bcm27xx/patches-6.6/950-0708-drm-vc4-Correct-logic-on-stopping-an-HVS-channel.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 48016174777294ea86103946f71e25bb04f647a1 Mon Sep 17 00:00:00 2001 -From: Dave Stevenson -Date: Thu, 26 Oct 2023 17:46:13 +0100 -Subject: [PATCH 0708/1085] drm/vc4: Correct logic on stopping an HVS channel - -When factoring out __vc4_hvs_stop_channel, the logic got inverted from - if (condition) - // stop channel -to - if (condition) - goto out - //stop channel - out: -and also changed the exact register writes used to stop the channel. - -Correct the logic so that the channel is actually stopped, and revert -to the original register writes. - -Fixes: 6d01a106b4c8 ("drm/vc4: crtc: Move HVS init and close to a function") -Signed-off-by: Dave Stevenson ---- - drivers/gpu/drm/vc4/vc4_hvs.c | 10 ++++------ - 1 file changed, 4 insertions(+), 6 deletions(-) - ---- a/drivers/gpu/drm/vc4/vc4_hvs.c -+++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -992,13 +992,11 @@ static void __vc4_hvs_stop_channel(struc - if (!drm_dev_enter(drm, &idx)) - return; - -- if (HVS_READ(SCALER_DISPCTRLX(chan)) & SCALER_DISPCTRLX_ENABLE) -+ if (!(HVS_READ(SCALER_DISPCTRLX(chan)) & SCALER_DISPCTRLX_ENABLE)) - goto out; - -- HVS_WRITE(SCALER_DISPCTRLX(chan), -- HVS_READ(SCALER_DISPCTRLX(chan)) | SCALER_DISPCTRLX_RESET); -- HVS_WRITE(SCALER_DISPCTRLX(chan), -- HVS_READ(SCALER_DISPCTRLX(chan)) & ~SCALER_DISPCTRLX_ENABLE); -+ HVS_WRITE(SCALER_DISPCTRLX(chan), SCALER_DISPCTRLX_RESET); -+ HVS_WRITE(SCALER_DISPCTRLX(chan), 0); - - /* Once we leave, the scaler should be disabled and its fifo empty. */ - WARN_ON_ONCE(HVS_READ(SCALER_DISPCTRLX(chan)) & SCALER_DISPCTRLX_RESET); -@@ -1026,7 +1024,7 @@ static void __vc6_hvs_stop_channel(struc - if (!drm_dev_enter(drm, &idx)) - return; - -- if (HVS_READ(SCALER6_DISPX_CTRL0(chan)) & SCALER6_DISPX_CTRL0_ENB) -+ if (!(HVS_READ(SCALER6_DISPX_CTRL0(chan)) & SCALER6_DISPX_CTRL0_ENB)) - goto out; - - HVS_WRITE(SCALER6_DISPX_CTRL0(chan), diff --git a/target/linux/bcm27xx/patches-6.6/950-0709-drm-vc4-Drop-WARN-for-HVS-FIFOs-not-being-empty.patch b/target/linux/bcm27xx/patches-6.6/950-0709-drm-vc4-Drop-WARN-for-HVS-FIFOs-not-being-empty.patch index 0d4f6a4ea90..d43ed3f7d76 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0709-drm-vc4-Drop-WARN-for-HVS-FIFOs-not-being-empty.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0709-drm-vc4-Drop-WARN-for-HVS-FIFOs-not-being-empty.patch @@ -17,7 +17,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -1005,10 +1005,6 @@ static void __vc4_hvs_stop_channel(struc +@@ -1008,10 +1008,6 @@ static void __vc4_hvs_stop_channel(struc SCALER_DISPSTATX_MODE) != SCALER_DISPSTATX_MODE_DISABLED); diff --git a/target/linux/bcm27xx/patches-6.6/950-0710-drm-vc4-Free-all-stale-dlists-if-channel-is-disabled.patch b/target/linux/bcm27xx/patches-6.6/950-0710-drm-vc4-Free-all-stale-dlists-if-channel-is-disabled.patch index 53f2684f3be..6651fac56e1 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0710-drm-vc4-Free-all-stale-dlists-if-channel-is-disabled.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0710-drm-vc4-Free-all-stale-dlists-if-channel-is-disabled.patch @@ -36,7 +36,7 @@ Signed-off-by: Dave Stevenson * someone was waiting it. --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -697,7 +697,8 @@ static void vc4_hvs_schedule_dlist_sweep +@@ -700,7 +700,8 @@ static void vc4_hvs_schedule_dlist_sweep if (!list_empty(&hvs->stale_dlist_entries)) queue_work(system_unbound_wq, &hvs->free_dlist_work); @@ -46,7 +46,7 @@ Signed-off-by: Dave Stevenson spin_unlock_irqrestore(&hvs->mm_lock, flags); } -@@ -712,6 +713,27 @@ static bool vc4_hvs_frcnt_lte(u8 cnt1, u +@@ -715,6 +716,27 @@ static bool vc4_hvs_frcnt_lte(u8 cnt1, u return (s8)((cnt1 << 2) - (cnt2 << 2)) <= 0; } @@ -74,7 +74,7 @@ Signed-off-by: Dave Stevenson /* * Some atomic commits (legacy cursor updates, mostly) will not wait for * the next vblank and will just return once the commit has been pushed -@@ -746,7 +768,8 @@ static void vc4_hvs_dlist_free_work(stru +@@ -749,7 +771,8 @@ static void vc4_hvs_dlist_free_work(stru u8 frcnt; frcnt = vc4_hvs_get_fifo_frame_count(hvs, cur->channel); diff --git a/target/linux/bcm27xx/patches-6.6/950-0711-drm-vc4-Add-hvs_dlist_allocs-debugfs-function.patch b/target/linux/bcm27xx/patches-6.6/950-0711-drm-vc4-Add-hvs_dlist_allocs-debugfs-function.patch index e8e93d5e80a..d8a60aadbfd 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0711-drm-vc4-Add-hvs_dlist_allocs-debugfs-function.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0711-drm-vc4-Add-hvs_dlist_allocs-debugfs-function.patch @@ -50,7 +50,7 @@ Signed-off-by: Dave Stevenson /* The filter kernel is composed of dwords each containing 3 9-bit * signed integers packed next to each other. */ -@@ -1551,6 +1581,8 @@ int vc4_hvs_debugfs_init(struct drm_mino +@@ -1555,6 +1585,8 @@ int vc4_hvs_debugfs_init(struct drm_mino drm_debugfs_add_file(drm, "hvs_underrun", vc4_hvs_debugfs_underrun, NULL); diff --git a/target/linux/bcm27xx/patches-6.6/950-0712-drm-vc4-Log-the-size-of-the-dlist-allocation-that-wa.patch b/target/linux/bcm27xx/patches-6.6/950-0712-drm-vc4-Log-the-size-of-the-dlist-allocation-that-wa.patch index 484d1e36763..65c02feda08 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0712-drm-vc4-Log-the-size-of-the-dlist-allocation-that-wa.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0712-drm-vc4-Log-the-size-of-the-dlist-allocation-that-wa.patch @@ -11,7 +11,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -659,7 +659,8 @@ vc4_hvs_alloc_dlist_entry(struct vc4_hvs +@@ -662,7 +662,8 @@ vc4_hvs_alloc_dlist_entry(struct vc4_hvs dlist_count); spin_unlock_irqrestore(&hvs->mm_lock, flags); if (ret) { diff --git a/target/linux/bcm27xx/patches-6.6/950-0740-drm-vc4-Free-the-dlist-alloc-immediately-if-it-never.patch b/target/linux/bcm27xx/patches-6.6/950-0740-drm-vc4-Free-the-dlist-alloc-immediately-if-it-never.patch index dced86878d1..b28ae3c4a14 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0740-drm-vc4-Free-the-dlist-alloc-immediately-if-it-never.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0740-drm-vc4-Free-the-dlist-alloc-immediately-if-it-never.patch @@ -33,7 +33,7 @@ Signed-off-by: Dave Stevenson struct vc4_crtc_state { --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -697,8 +697,11 @@ void vc4_hvs_mark_dlist_entry_stale(stru +@@ -700,8 +700,11 @@ void vc4_hvs_mark_dlist_entry_stale(stru * Kunit tests run with a mock device and we consider any hardware * access a test failure. Let's free the dlist allocation right away if * we're running under kunit, we won't risk a dlist corruption anyway. @@ -46,7 +46,7 @@ Signed-off-by: Dave Stevenson spin_lock_irqsave(&hvs->mm_lock, flags); vc4_hvs_free_dlist_entry_locked(hvs, alloc); spin_unlock_irqrestore(&hvs->mm_lock, flags); -@@ -1195,6 +1198,7 @@ static void vc4_hvs_install_dlist(struct +@@ -1198,6 +1201,7 @@ static void vc4_hvs_install_dlist(struct return; WARN_ON(!vc4_state->mm); diff --git a/target/linux/bcm27xx/patches-6.6/950-0810-drm-vc4-Fix-reading-of-frame-count-on-GEN5-Pi4.patch b/target/linux/bcm27xx/patches-6.6/950-0810-drm-vc4-Fix-reading-of-frame-count-on-GEN5-Pi4.patch index 849caa45390..8fdd244a002 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0810-drm-vc4-Fix-reading-of-frame-count-on-GEN5-Pi4.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0810-drm-vc4-Fix-reading-of-frame-count-on-GEN5-Pi4.patch @@ -16,7 +16,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -823,10 +823,28 @@ u8 vc4_hvs_get_fifo_frame_count(struct v +@@ -826,10 +826,28 @@ u8 vc4_hvs_get_fifo_frame_count(struct v if (!drm_dev_enter(drm, &idx)) return 0; @@ -47,7 +47,7 @@ Signed-off-by: Dave Stevenson switch (fifo) { case 0: field = VC4_GET_FIELD(HVS_READ(SCALER_DISPSTAT1), -@@ -841,6 +859,7 @@ u8 vc4_hvs_get_fifo_frame_count(struct v +@@ -844,6 +862,7 @@ u8 vc4_hvs_get_fifo_frame_count(struct v SCALER_DISPSTAT2_FRCNT2); break; } diff --git a/target/linux/bcm27xx/patches-6.6/950-0829-vc4-hvs-Add-support-for-D0-register-changes.patch b/target/linux/bcm27xx/patches-6.6/950-0829-vc4-hvs-Add-support-for-D0-register-changes.patch index 3d13a6a09c3..c8c284a1394 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0829-vc4-hvs-Add-support-for-D0-register-changes.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0829-vc4-hvs-Add-support-for-D0-register-changes.patch @@ -169,7 +169,7 @@ Signed-off-by: Dom Cobley next_entry_start = 0; for (j = active_dlist; j < dlist_mem_size; j++) { -@@ -760,7 +819,7 @@ bool vc4_hvs_check_channel_active(struct +@@ -763,7 +822,7 @@ bool vc4_hvs_check_channel_active(struct return 0; if (vc4->gen >= VC4_GEN_6) @@ -178,7 +178,7 @@ Signed-off-by: Dom Cobley else enabled = HVS_READ(SCALER_DISPCTRLX(fifo)) & SCALER_DISPCTRLX_ENABLE; -@@ -825,8 +884,8 @@ u8 vc4_hvs_get_fifo_frame_count(struct v +@@ -828,8 +887,8 @@ u8 vc4_hvs_get_fifo_frame_count(struct v switch (vc4->gen) { case VC4_GEN_6: @@ -189,7 +189,7 @@ Signed-off-by: Dom Cobley break; case VC4_GEN_5: switch (fifo) { -@@ -1037,20 +1096,20 @@ static int vc6_hvs_init_channel(struct v +@@ -1040,20 +1099,20 @@ static int vc6_hvs_init_channel(struct v if (!drm_dev_enter(drm, &idx)) return -ENODEV; @@ -219,12 +219,7 @@ Signed-off-by: Dom Cobley drm_dev_exit(idx); -@@ -1096,18 +1155,18 @@ static void __vc6_hvs_stop_channel(struc - if (!drm_dev_enter(drm, &idx)) - return; - -- if (!(HVS_READ(SCALER6_DISPX_CTRL0(chan)) & SCALER6_DISPX_CTRL0_ENB)) -+ if (!(HVS_READ(SCALER6_DISPX_CTRL0(chan)) & SCALER6(DISPX_CTRL0_ENB))) +@@ -1103,14 +1162,14 @@ static void __vc6_hvs_stop_channel(struc goto out; HVS_WRITE(SCALER6_DISPX_CTRL0(chan), @@ -244,7 +239,7 @@ Signed-off-by: Dom Cobley out: drm_dev_exit(idx); -@@ -1221,8 +1280,8 @@ static void vc4_hvs_install_dlist(struct +@@ -1224,8 +1283,8 @@ static void vc4_hvs_install_dlist(struct if (vc4->gen >= VC4_GEN_6) HVS_WRITE(SCALER6_DISPX_LPTRS(vc4_state->assigned_channel), @@ -255,7 +250,7 @@ Signed-off-by: Dom Cobley else HVS_WRITE(SCALER_DISPLISTX(vc4_state->assigned_channel), vc4_state->mm->mm_node.start); -@@ -1382,11 +1441,11 @@ void vc4_hvs_atomic_flush(struct drm_crt +@@ -1385,11 +1444,11 @@ void vc4_hvs_atomic_flush(struct drm_crt if (enable_bg_fill) HVS_WRITE(SCALER6_DISPX_CTRL1(channel), HVS_READ(SCALER6_DISPX_CTRL1(channel)) | @@ -269,7 +264,7 @@ Signed-off-by: Dom Cobley } else { /* we can actually run with a lower core clock when background * fill is enabled on VC4_GEN_5 so leave it enabled always. -@@ -1656,7 +1715,7 @@ struct vc4_hvs *__vc4_hvs_alloc(struct v +@@ -1660,7 +1719,7 @@ struct vc4_hvs *__vc4_hvs_alloc(struct v * access a register. Use a plausible size then. */ if (!kunit_get_current_test()) @@ -278,7 +273,7 @@ Signed-off-by: Dom Cobley else dlist_size = 4096; -@@ -1890,14 +1949,17 @@ static int vc6_hvs_hw_init(struct vc4_hv +@@ -1894,14 +1953,17 @@ static int vc6_hvs_hw_init(struct vc4_hv const struct vc6_csc_coeff_entry *coeffs; unsigned int i; @@ -300,7 +295,7 @@ Signed-off-by: Dom Cobley for (i = 0; i < 6; i++) { coeffs = &csc_coeffs[i / 3][i % 3]; -@@ -1996,21 +2058,21 @@ static int vc4_hvs_cob_init(struct vc4_h +@@ -2000,21 +2062,21 @@ static int vc4_hvs_cob_init(struct vc4_h reg = 0; top = 3840; @@ -325,7 +320,7 @@ Signed-off-by: Dom Cobley VC4_SET_FIELD(top, SCALER6_DISPX_COB_TOP) | VC4_SET_FIELD(base, SCALER6_DISPX_COB_BASE)); break; -@@ -2041,7 +2103,10 @@ static int vc4_hvs_bind(struct device *d +@@ -2045,7 +2107,10 @@ static int vc4_hvs_bind(struct device *d hvs->regset.base = hvs->regs; @@ -337,7 +332,7 @@ Signed-off-by: Dom Cobley hvs->regset.regs = vc6_hvs_regs; hvs->regset.nregs = ARRAY_SIZE(vc6_hvs_regs); } else { -@@ -2208,6 +2273,7 @@ static void vc4_hvs_dev_remove(struct pl +@@ -2212,6 +2277,7 @@ static void vc4_hvs_dev_remove(struct pl static const struct of_device_id vc4_hvs_dt_match[] = { { .compatible = "brcm,bcm2711-hvs" }, { .compatible = "brcm,bcm2712-hvs" }, diff --git a/target/linux/bcm27xx/patches-6.6/950-0830-vc4-hvs-Updates-to-support-D0-alpha-and-csc-changes.patch b/target/linux/bcm27xx/patches-6.6/950-0830-vc4-hvs-Updates-to-support-D0-alpha-and-csc-changes.patch index d88e6a744cd..0535f63224f 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0830-vc4-hvs-Updates-to-support-D0-alpha-and-csc-changes.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0830-vc4-hvs-Updates-to-support-D0-alpha-and-csc-changes.patch @@ -16,7 +16,7 @@ Signed-off-by: Dom Cobley --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -1888,6 +1888,17 @@ static int vc4_hvs_hw_init(struct vc4_hv +@@ -1892,6 +1892,17 @@ static int vc4_hvs_hw_init(struct vc4_hv #define CFC1_N_MA_CSC_COEFF_C23(x) (0xa03c + ((x) * 0x3000)) #define CFC1_N_MA_CSC_COEFF_C24(x) (0xa040 + ((x) * 0x3000)) @@ -34,7 +34,7 @@ Signed-off-by: Dom Cobley /* 4 S2.22 multiplication factors, and 1 S9.15 addititive element for each of 3 * output components */ -@@ -1958,31 +1969,43 @@ static int vc6_hvs_hw_init(struct vc4_hv +@@ -1962,31 +1973,43 @@ static int vc6_hvs_hw_init(struct vc4_hv HVS_WRITE(SCALER6(PRI_MAP0), 0xffffffff); HVS_WRITE(SCALER6(PRI_MAP1), 0xffffffff); diff --git a/target/linux/bcm27xx/patches-6.6/950-0836-drm-vc4-Optimise-vc4_hvs_dlist_free_work-to-only-rea.patch b/target/linux/bcm27xx/patches-6.6/950-0836-drm-vc4-Optimise-vc4_hvs_dlist_free_work-to-only-rea.patch index ff589278b66..19442e421c3 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0836-drm-vc4-Optimise-vc4_hvs_dlist_free_work-to-only-rea.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0836-drm-vc4-Optimise-vc4_hvs_dlist_free_work-to-only-rea.patch @@ -18,7 +18,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -855,14 +855,19 @@ static void vc4_hvs_dlist_free_work(stru +@@ -858,14 +858,19 @@ static void vc4_hvs_dlist_free_work(stru struct vc4_hvs *hvs = container_of(work, struct vc4_hvs, free_dlist_work); struct vc4_hvs_dlist_allocation *cur, *next; unsigned long flags; diff --git a/target/linux/bcm27xx/patches-6.6/950-0837-drm-vc4-Flush-stale-dlist-entries-if-allocation-fail.patch b/target/linux/bcm27xx/patches-6.6/950-0837-drm-vc4-Flush-stale-dlist-entries-if-allocation-fail.patch index 67be70d9a28..b12ce4c542b 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0837-drm-vc4-Flush-stale-dlist-entries-if-allocation-fail.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0837-drm-vc4-Flush-stale-dlist-entries-if-allocation-fail.patch @@ -19,7 +19,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -693,6 +693,9 @@ static void vc4_hvs_irq_clear_eof(struct +@@ -696,6 +696,9 @@ static void vc4_hvs_irq_clear_eof(struct hvs->eof_irq[channel].enabled = false; } @@ -29,7 +29,7 @@ Signed-off-by: Dave Stevenson static struct vc4_hvs_dlist_allocation * vc4_hvs_alloc_dlist_entry(struct vc4_hvs *hvs, unsigned int channel, -@@ -701,6 +704,7 @@ vc4_hvs_alloc_dlist_entry(struct vc4_hvs +@@ -704,6 +707,7 @@ vc4_hvs_alloc_dlist_entry(struct vc4_hvs struct vc4_dev *vc4 = hvs->vc4; struct drm_device *dev = &vc4->base; struct vc4_hvs_dlist_allocation *alloc; @@ -37,7 +37,7 @@ Signed-off-by: Dave Stevenson unsigned long flags; int ret; -@@ -718,9 +722,26 @@ vc4_hvs_alloc_dlist_entry(struct vc4_hvs +@@ -721,9 +725,26 @@ vc4_hvs_alloc_dlist_entry(struct vc4_hvs dlist_count); spin_unlock_irqrestore(&hvs->mm_lock, flags); if (ret) { diff --git a/target/linux/bcm27xx/patches-6.6/950-0989-drm-vc4-Enable-bg_fill-if-there-are-no-planes-enable.patch b/target/linux/bcm27xx/patches-6.6/950-0989-drm-vc4-Enable-bg_fill-if-there-are-no-planes-enable.patch index 10d7f571194..b34cff057ea 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0989-drm-vc4-Enable-bg_fill-if-there-are-no-planes-enable.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0989-drm-vc4-Enable-bg_fill-if-there-are-no-planes-enable.patch @@ -19,7 +19,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -1400,7 +1400,7 @@ void vc4_hvs_atomic_flush(struct drm_crt +@@ -1403,7 +1403,7 @@ void vc4_hvs_atomic_flush(struct drm_crt struct drm_plane *plane; struct vc4_plane_state *vc4_plane_state; bool debug_dump_regs = false; diff --git a/target/linux/bcm27xx/patches-6.6/950-1257-drm-vc4-Add-support-for-per-plane-scaling-filter-sel.patch b/target/linux/bcm27xx/patches-6.6/950-1257-drm-vc4-Add-support-for-per-plane-scaling-filter-sel.patch index 5b3ae3c9101..52a13c6508d 100644 --- a/target/linux/bcm27xx/patches-6.6/950-1257-drm-vc4-Add-support-for-per-plane-scaling-filter-sel.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1257-drm-vc4-Add-support-for-per-plane-scaling-filter-sel.patch @@ -40,7 +40,7 @@ Signed-off-by: Dave Stevenson static int vc4_hvs_upload_linear_kernel(struct vc4_hvs *hvs, struct drm_mm_node *space, -@@ -2255,14 +2258,19 @@ static int vc4_hvs_bind(struct device *d +@@ -2259,14 +2262,19 @@ static int vc4_hvs_bind(struct device *d if (ret) return ret; @@ -62,7 +62,7 @@ Signed-off-by: Dave Stevenson ret = vc4_hvs_cob_init(hvs); if (ret) -@@ -2288,6 +2296,8 @@ static void vc4_hvs_unbind(struct device +@@ -2292,6 +2300,8 @@ static void vc4_hvs_unbind(struct device if (drm_mm_node_allocated(&vc4->hvs->mitchell_netravali_filter)) drm_mm_remove_node(&vc4->hvs->mitchell_netravali_filter); diff --git a/target/linux/bcm27xx/patches-6.6/950-1323-drm-vc4-Remove-request-for-min-clocks-when-hdmi-outp.patch b/target/linux/bcm27xx/patches-6.6/950-1323-drm-vc4-Remove-request-for-min-clocks-when-hdmi-outp.patch index 9f4cf9d0336..1a1e3439e5e 100644 --- a/target/linux/bcm27xx/patches-6.6/950-1323-drm-vc4-Remove-request-for-min-clocks-when-hdmi-outp.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1323-drm-vc4-Remove-request-for-min-clocks-when-hdmi-outp.patch @@ -50,7 +50,7 @@ Signed-off-by: Dom Cobley return 0; --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -2308,7 +2308,10 @@ static void vc4_hvs_unbind(struct device +@@ -2312,7 +2312,10 @@ static void vc4_hvs_unbind(struct device drm_mm_remove_node(node); drm_mm_takedown(&vc4->hvs->lbm_mm); diff --git a/target/linux/bcm27xx/patches-6.6/950-1349-cgroup-Use-kernel-command-line-to-disable-memory-cgr.patch b/target/linux/bcm27xx/patches-6.6/950-1349-cgroup-Use-kernel-command-line-to-disable-memory-cgr.patch index 46e0aeaf4ce..61dec89382c 100644 --- a/target/linux/bcm27xx/patches-6.6/950-1349-cgroup-Use-kernel-command-line-to-disable-memory-cgr.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1349-cgroup-Use-kernel-command-line-to-disable-memory-cgr.patch @@ -148,7 +148,7 @@ Signed-off-by: Maíra Canal --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c -@@ -6060,9 +6060,6 @@ int __init cgroup_init_early(void) +@@ -6063,9 +6063,6 @@ int __init cgroup_init_early(void) return 0; } @@ -158,7 +158,7 @@ Signed-off-by: Maíra Canal /** * cgroup_init - cgroup initialization * -@@ -6096,12 +6093,6 @@ int __init cgroup_init(void) +@@ -6099,12 +6096,6 @@ int __init cgroup_init(void) cgroup_unlock(); @@ -171,7 +171,7 @@ Signed-off-by: Maíra Canal for_each_subsys(ss, ssid) { if (ss->early_init) { struct cgroup_subsys_state *css = -@@ -6742,10 +6733,6 @@ static int __init cgroup_disable(char *s +@@ -6745,10 +6736,6 @@ static int __init cgroup_disable(char *s strcmp(token, ss->legacy_name)) continue; @@ -182,7 +182,7 @@ Signed-off-by: Maíra Canal static_branch_disable(cgroup_subsys_enabled_key[i]); pr_info("Disabling %s control group subsystem\n", ss->name); -@@ -6779,7 +6766,7 @@ static int __init cgroup_enable(char *st +@@ -6782,7 +6769,7 @@ static int __init cgroup_enable(char *st strcmp(token, ss->legacy_name)) continue; diff --git a/target/linux/generic/hack-6.6/204-module_strip.patch b/target/linux/generic/hack-6.6/204-module_strip.patch index 403ee11513c..9eadd2ce16b 100644 --- a/target/linux/generic/hack-6.6/204-module_strip.patch +++ b/target/linux/generic/hack-6.6/204-module_strip.patch @@ -141,7 +141,7 @@ Signed-off-by: Felix Fietkau if (err) --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c -@@ -1693,7 +1693,9 @@ static void read_symbols(const char *mod +@@ -1666,7 +1666,9 @@ static void read_symbols(const char *mod symname = remove_dot(info.strtab + sym->st_name); handle_symbol(mod, &info, sym, symname); @@ -151,7 +151,7 @@ Signed-off-by: Felix Fietkau } check_sec_ref(mod, &info); -@@ -1866,8 +1868,10 @@ static void add_header(struct buffer *b, +@@ -1839,8 +1841,10 @@ static void add_header(struct buffer *b, buf_printf(b, "BUILD_SALT;\n"); buf_printf(b, "BUILD_LTO_INFO;\n"); buf_printf(b, "\n"); @@ -162,7 +162,7 @@ Signed-off-by: Felix Fietkau buf_printf(b, "\n"); buf_printf(b, "__visible struct module __this_module\n"); buf_printf(b, "__section(\".gnu.linkonce.this_module\") = {\n"); -@@ -1881,8 +1885,10 @@ static void add_header(struct buffer *b, +@@ -1854,8 +1858,10 @@ static void add_header(struct buffer *b, buf_printf(b, "\t.arch = MODULE_ARCH_INIT,\n"); buf_printf(b, "};\n"); @@ -173,7 +173,7 @@ Signed-off-by: Felix Fietkau buf_printf(b, "\n" -@@ -1890,8 +1896,10 @@ static void add_header(struct buffer *b, +@@ -1863,8 +1869,10 @@ static void add_header(struct buffer *b, "MODULE_INFO(retpoline, \"Y\");\n" "#endif\n"); @@ -184,7 +184,7 @@ Signed-off-by: Felix Fietkau if (strstarts(mod->name, "tools/testing")) buf_printf(b, "\nMODULE_INFO(test, \"Y\");\n"); -@@ -2001,11 +2009,13 @@ static void add_depends(struct buffer *b +@@ -1974,11 +1982,13 @@ static void add_depends(struct buffer *b static void add_srcversion(struct buffer *b, struct module *mod) { @@ -198,7 +198,7 @@ Signed-off-by: Felix Fietkau } static void write_buf(struct buffer *b, const char *fname) -@@ -2088,7 +2098,9 @@ static void write_mod_c_file(struct modu +@@ -2061,7 +2071,9 @@ static void write_mod_c_file(struct modu add_exported_symbols(&buf, mod); add_versions(&buf, mod); add_depends(&buf, mod); diff --git a/target/linux/generic/hack-6.6/253-ksmbd-config.patch b/target/linux/generic/hack-6.6/253-ksmbd-config.patch index 9079c66d420..d54b48895ea 100644 --- a/target/linux/generic/hack-6.6/253-ksmbd-config.patch +++ b/target/linux/generic/hack-6.6/253-ksmbd-config.patch @@ -10,7 +10,7 @@ Subject: [PATCH] Kconfig: add tristate for OID and ASNI string --- a/init/Kconfig +++ b/init/Kconfig -@@ -1993,7 +1993,7 @@ config PADATA +@@ -2002,7 +2002,7 @@ config PADATA bool config ASN1 diff --git a/target/linux/generic/hack-6.6/780-usb-net-MeigLink_modem_support.patch b/target/linux/generic/hack-6.6/780-usb-net-MeigLink_modem_support.patch index 66c58dba64e..cefb9c53e89 100644 --- a/target/linux/generic/hack-6.6/780-usb-net-MeigLink_modem_support.patch +++ b/target/linux/generic/hack-6.6/780-usb-net-MeigLink_modem_support.patch @@ -10,7 +10,7 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c -@@ -1084,12 +1084,18 @@ static const struct usb_device_id produc +@@ -1084,6 +1084,11 @@ static const struct usb_device_id produc USB_DEVICE_AND_INTERFACE_INFO(0x03f0, 0x581d, USB_CLASS_VENDOR_SPEC, 1, 7), .driver_info = (unsigned long)&qmi_wwan_info, }, @@ -19,9 +19,10 @@ Subject: [PATCH] net/usb/qmi_wwan: add MeigLink modem support + .driver_info = (unsigned long)&qmi_wwan_info, + }, + + {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0122)}, /* Quectel RG650V */ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0125)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0306)}, /* Quectel EP06/EG06/EM06 */ - {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */ +@@ -1091,6 +1096,7 @@ static const struct usb_device_id produc {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0620)}, /* Quectel EM160R-GL */ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0800)}, /* Quectel RM500Q-GL */ {QMI_MATCH_FF_FF_FF(0x2c7c, 0x0801)}, /* Quectel RM520N */ diff --git a/target/linux/generic/hack-6.6/901-debloat_sock_diag.patch b/target/linux/generic/hack-6.6/901-debloat_sock_diag.patch index acf72f44225..4b1ea3c5ad9 100644 --- a/target/linux/generic/hack-6.6/901-debloat_sock_diag.patch +++ b/target/linux/generic/hack-6.6/901-debloat_sock_diag.patch @@ -105,8 +105,8 @@ Signed-off-by: Felix Fietkau #include #include -@@ -21,23 +20,6 @@ static int (*inet_rcv_compat)(struct sk_ - static DEFINE_MUTEX(sock_diag_table_mutex); +@@ -22,23 +21,6 @@ static const struct sock_diag_inet_compa + static struct workqueue_struct *broadcast_wq; -DEFINE_COOKIE(sock_cookie); diff --git a/target/linux/generic/hack-6.6/902-debloat_proc.patch b/target/linux/generic/hack-6.6/902-debloat_proc.patch index 691a60bcc03..2c3eca2552f 100644 --- a/target/linux/generic/hack-6.6/902-debloat_proc.patch +++ b/target/linux/generic/hack-6.6/902-debloat_proc.patch @@ -246,7 +246,7 @@ Signed-off-by: Felix Fietkau &vmalloc_op, --- a/mm/vmstat.c +++ b/mm/vmstat.c -@@ -2135,10 +2135,12 @@ void __init init_mm_internals(void) +@@ -2136,10 +2136,12 @@ void __init init_mm_internals(void) start_shepherd_timer(); #endif #ifdef CONFIG_PROC_FS diff --git a/target/linux/generic/hack-6.6/920-device_tree_cmdline.patch b/target/linux/generic/hack-6.6/920-device_tree_cmdline.patch index 2a43ffb7ad5..1d78a9dc4de 100644 --- a/target/linux/generic/hack-6.6/920-device_tree_cmdline.patch +++ b/target/linux/generic/hack-6.6/920-device_tree_cmdline.patch @@ -9,7 +9,7 @@ Subject: [PATCH] of/ftd: add device tree cmdline --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c -@@ -1185,6 +1185,9 @@ int __init early_init_dt_scan_chosen(cha +@@ -1186,6 +1186,9 @@ int __init early_init_dt_scan_chosen(cha p = of_get_flat_dt_prop(node, "bootargs", &l); if (p != NULL && l > 0) strscpy(cmdline, p, min(l, COMMAND_LINE_SIZE)); diff --git a/target/linux/generic/pending-6.6/203-kallsyms_uncompressed.patch b/target/linux/generic/pending-6.6/203-kallsyms_uncompressed.patch index c23811ed398..94b22603d8c 100644 --- a/target/linux/generic/pending-6.6/203-kallsyms_uncompressed.patch +++ b/target/linux/generic/pending-6.6/203-kallsyms_uncompressed.patch @@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau --- a/init/Kconfig +++ b/init/Kconfig -@@ -1451,6 +1451,17 @@ config SYSCTL_ARCH_UNALIGN_ALLOW +@@ -1460,6 +1460,17 @@ config SYSCTL_ARCH_UNALIGN_ALLOW the unaligned access emulation. see arch/parisc/kernel/unaligned.c for reference diff --git a/target/linux/generic/pending-6.6/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-6.6/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index f754705dc6d..9cf9117d097 100644 --- a/target/linux/generic/pending-6.6/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-6.6/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -76,7 +76,7 @@ Signed-off-by: Jonas Gorski static inline const char *rtn_type(char *buf, size_t len, unsigned int t) --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c -@@ -180,6 +180,7 @@ static int ipmr_rule_action(struct fib_r +@@ -190,6 +190,7 @@ static int ipmr_rule_action(struct fib_r case FR_ACT_UNREACHABLE: return -ENETUNREACH; case FR_ACT_PROHIBIT: @@ -99,7 +99,7 @@ Signed-off-by: Jonas Gorski tb_id = fib_rule_get_table(rule, arg); --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c -@@ -170,6 +170,8 @@ static int ip6mr_rule_action(struct fib_ +@@ -180,6 +180,8 @@ static int ip6mr_rule_action(struct fib_ return -ENETUNREACH; case FR_ACT_PROHIBIT: return -EACCES; @@ -138,7 +138,7 @@ Signed-off-by: Jonas Gorski static const struct rt6_info ip6_blk_hole_entry_template = { .dst = { .__rcuref = RCUREF_INIT(1), -@@ -1040,6 +1054,7 @@ static const int fib6_prop[RTN_MAX + 1] +@@ -1043,6 +1057,7 @@ static const int fib6_prop[RTN_MAX + 1] [RTN_BLACKHOLE] = -EINVAL, [RTN_UNREACHABLE] = -EHOSTUNREACH, [RTN_PROHIBIT] = -EACCES, @@ -146,7 +146,7 @@ Signed-off-by: Jonas Gorski [RTN_THROW] = -EAGAIN, [RTN_NAT] = -EINVAL, [RTN_XRESOLVE] = -EINVAL, -@@ -1075,6 +1090,10 @@ static void ip6_rt_init_dst_reject(struc +@@ -1078,6 +1093,10 @@ static void ip6_rt_init_dst_reject(struc rt->dst.output = ip6_pkt_prohibit_out; rt->dst.input = ip6_pkt_prohibit; break; 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 cfa3975c386..d1364106406 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 -@@ -8377,7 +8377,7 @@ static int nft_register_flowtable_net_ho +@@ -8417,7 +8417,7 @@ static int nft_register_flowtable_net_ho err = flowtable->data.type->setup(&flowtable->data, hook->ops.dev, FLOW_BLOCK_BIND); diff --git a/target/linux/generic/pending-6.6/920-mangle_bootargs.patch b/target/linux/generic/pending-6.6/920-mangle_bootargs.patch index 1d73cca11e2..36e7c18324b 100644 --- a/target/linux/generic/pending-6.6/920-mangle_bootargs.patch +++ b/target/linux/generic/pending-6.6/920-mangle_bootargs.patch @@ -13,7 +13,7 @@ Signed-off-by: Imre Kaloz --- a/init/Kconfig +++ b/init/Kconfig -@@ -1811,6 +1811,15 @@ config DEBUG_RSEQ +@@ -1820,6 +1820,15 @@ config DEBUG_RSEQ If unsure, say N. diff --git a/target/linux/ipq806x/patches-6.6/900-arm-add-cmdline-override.patch b/target/linux/ipq806x/patches-6.6/900-arm-add-cmdline-override.patch index f8bd1674b80..7ea3c82ffd4 100644 --- a/target/linux/ipq806x/patches-6.6/900-arm-add-cmdline-override.patch +++ b/target/linux/ipq806x/patches-6.6/900-arm-add-cmdline-override.patch @@ -17,7 +17,7 @@ default "" --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c -@@ -1189,6 +1189,17 @@ int __init early_init_dt_scan_chosen(cha +@@ -1190,6 +1190,17 @@ int __init early_init_dt_scan_chosen(cha if (p != NULL && l > 0) strlcat(cmdline, p, min_t(int, strlen(cmdline) + (int)l, COMMAND_LINE_SIZE)); diff --git a/target/linux/layerscape/patches-6.6/400-LF-20-3-mtd-spi-nor-Use-1-bit-mode-of-spansion-s25fs.patch b/target/linux/layerscape/patches-6.6/400-LF-20-3-mtd-spi-nor-Use-1-bit-mode-of-spansion-s25fs.patch index b85053eba9e..008a146cc97 100644 --- a/target/linux/layerscape/patches-6.6/400-LF-20-3-mtd-spi-nor-Use-1-bit-mode-of-spansion-s25fs.patch +++ b/target/linux/layerscape/patches-6.6/400-LF-20-3-mtd-spi-nor-Use-1-bit-mode-of-spansion-s25fs.patch @@ -15,7 +15,7 @@ Signed-off-by: Kuldeep Singh --- a/drivers/mtd/spi-nor/spansion.c +++ b/drivers/mtd/spi-nor/spansion.c -@@ -798,8 +798,8 @@ static const struct flash_info spansion_ +@@ -799,8 +799,8 @@ static const struct flash_info spansion_ MFR_FLAGS(USE_CLSR) }, { "s25fs512s", INFO6(0x010220, 0x4d0081, 256 * 1024, 256) diff --git a/target/linux/mediatek/patches-6.6/432-drivers-spi-Add-support-for-dynamic-calibration.patch b/target/linux/mediatek/patches-6.6/432-drivers-spi-Add-support-for-dynamic-calibration.patch index 19fe984aa61..7ff7b05301a 100644 --- a/target/linux/mediatek/patches-6.6/432-drivers-spi-Add-support-for-dynamic-calibration.patch +++ b/target/linux/mediatek/patches-6.6/432-drivers-spi-Add-support-for-dynamic-calibration.patch @@ -11,7 +11,7 @@ Signed-off-by: SkyLake.Huang --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c -@@ -1370,6 +1370,70 @@ static int spi_transfer_wait(struct spi_ +@@ -1380,6 +1380,70 @@ static int spi_transfer_wait(struct spi_ return 0; } @@ -82,7 +82,7 @@ Signed-off-by: SkyLake.Huang static void _spi_transfer_delay_ns(u32 ns) { if (!ns) -@@ -2215,6 +2279,75 @@ void spi_flush_queue(struct spi_controll +@@ -2225,6 +2289,75 @@ void spi_flush_queue(struct spi_controll /*-------------------------------------------------------------------------*/ #if defined(CONFIG_OF) @@ -158,7 +158,7 @@ Signed-off-by: SkyLake.Huang static void of_spi_parse_dt_cs_delay(struct device_node *nc, struct spi_delay *delay, const char *prop) { -@@ -2354,6 +2487,10 @@ of_register_spi_device(struct spi_contro +@@ -2364,6 +2497,10 @@ of_register_spi_device(struct spi_contro if (rc) goto err_out; diff --git a/target/linux/mediatek/patches-6.6/901-arm-add-cmdline-override.patch b/target/linux/mediatek/patches-6.6/901-arm-add-cmdline-override.patch index 4f4fb9f23e4..7b7c905a0f3 100644 --- a/target/linux/mediatek/patches-6.6/901-arm-add-cmdline-override.patch +++ b/target/linux/mediatek/patches-6.6/901-arm-add-cmdline-override.patch @@ -17,7 +17,7 @@ default "" --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c -@@ -1189,6 +1189,17 @@ int __init early_init_dt_scan_chosen(cha +@@ -1190,6 +1190,17 @@ int __init early_init_dt_scan_chosen(cha if (p != NULL && l > 0) strlcat(cmdline, p, min_t(int, strlen(cmdline) + (int)l, COMMAND_LINE_SIZE)); diff --git a/target/linux/mpc85xx/patches-6.6/102-powerpc-add-cmdline-override.patch b/target/linux/mpc85xx/patches-6.6/102-powerpc-add-cmdline-override.patch index 1aa7c3dbd34..34bb95e4c01 100644 --- a/target/linux/mpc85xx/patches-6.6/102-powerpc-add-cmdline-override.patch +++ b/target/linux/mpc85xx/patches-6.6/102-powerpc-add-cmdline-override.patch @@ -17,7 +17,7 @@ help --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c -@@ -1189,6 +1189,17 @@ int __init early_init_dt_scan_chosen(cha +@@ -1190,6 +1190,17 @@ int __init early_init_dt_scan_chosen(cha if (p != NULL && l > 0) strlcat(cmdline, p, min_t(int, strlen(cmdline) + (int)l, COMMAND_LINE_SIZE)); diff --git a/target/linux/ramips/patches-6.6/001-v6.13-clocksource-drivers-ralink-Add-Ralink-System-Tick-Co.patch b/target/linux/ramips/patches-6.6/001-v6.13-clocksource-drivers-ralink-Add-Ralink-System-Tick-Co.patch index cd2a90826c7..de3438427d7 100644 --- a/target/linux/ramips/patches-6.6/001-v6.13-clocksource-drivers-ralink-Add-Ralink-System-Tick-Co.patch +++ b/target/linux/ramips/patches-6.6/001-v6.13-clocksource-drivers-ralink-Add-Ralink-System-Tick-Co.patch @@ -208,7 +208,7 @@ Signed-off-by: Daniel Lezcano -TIMER_OF_DECLARE(systick, "ralink,cevt-systick", ralink_systick_init); --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig -@@ -732,4 +732,13 @@ config GOLDFISH_TIMER +@@ -733,4 +733,13 @@ config GOLDFISH_TIMER help Support for the timer/counter of goldfish-rtc diff --git a/target/linux/ramips/patches-6.6/002-01-v6.13-clk-ralink-mtmips-fix-clock-plan-for-Ralink-SoC-RT38.patch b/target/linux/ramips/patches-6.6/002-01-v6.13-clk-ralink-mtmips-fix-clock-plan-for-Ralink-SoC-RT38.patch deleted file mode 100644 index 422b6dcfb07..00000000000 --- a/target/linux/ramips/patches-6.6/002-01-v6.13-clk-ralink-mtmips-fix-clock-plan-for-Ralink-SoC-RT38.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 33239152305567b3e9bf052f71fd4baecd626341 Mon Sep 17 00:00:00 2001 -From: Sergio Paracuellos -Date: Tue, 10 Sep 2024 06:40:22 +0200 -Subject: [PATCH 1/3] clk: ralink: mtmips: fix clock plan for Ralink SoC RT3883 - -Clock plan for Ralink SoC RT3883 needs an extra 'periph' clock to properly -set some peripherals that has this clock as their parent. When this driver -was mainlined we could not find any active users of this SoC so we cannot -perform any real tests for it. Now, one user of a Belkin f9k1109 version 1 -device which uses this SoC appear and reported some issues in openWRT: -- https://github.com/openwrt/openwrt/issues/16054 -The peripherals that are wrong are 'uart', 'i2c', 'i2s' and 'uartlite' which -has a not defined 'periph' clock as parent. Hence, introduce it to have a -properly working clock plan for this SoC. - -Fixes: 6f3b15586eef ("clk: ralink: add clock and reset driver for MTMIPS SoCs") -Signed-off-by: Sergio Paracuellos -Link: https://lore.kernel.org/r/20240910044024.120009-2-sergio.paracuellos@gmail.com -Signed-off-by: Stephen Boyd ---- - drivers/clk/ralink/clk-mtmips.c | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - ---- a/drivers/clk/ralink/clk-mtmips.c -+++ b/drivers/clk/ralink/clk-mtmips.c -@@ -267,6 +267,11 @@ static struct mtmips_clk_fixed rt305x_fi - CLK_FIXED("xtal", NULL, 40000000) - }; - -+static struct mtmips_clk_fixed rt3883_fixed_clocks[] = { -+ CLK_FIXED("xtal", NULL, 40000000), -+ CLK_FIXED("periph", "xtal", 40000000) -+}; -+ - static struct mtmips_clk_fixed rt3352_fixed_clocks[] = { - CLK_FIXED("periph", "xtal", 40000000) - }; -@@ -779,8 +784,8 @@ static const struct mtmips_clk_data rt33 - static const struct mtmips_clk_data rt3883_clk_data = { - .clk_base = rt3883_clks_base, - .num_clk_base = ARRAY_SIZE(rt3883_clks_base), -- .clk_fixed = rt305x_fixed_clocks, -- .num_clk_fixed = ARRAY_SIZE(rt305x_fixed_clocks), -+ .clk_fixed = rt3883_fixed_clocks, -+ .num_clk_fixed = ARRAY_SIZE(rt3883_fixed_clocks), - .clk_factor = NULL, - .num_clk_factor = 0, - .clk_periph = rt5350_pherip_clks, diff --git a/target/linux/ramips/patches-6.6/002-02-v6.13-clk-ralink-mtmips-fix-clocks-probe-order-in-oldest-r.patch b/target/linux/ramips/patches-6.6/002-02-v6.13-clk-ralink-mtmips-fix-clocks-probe-order-in-oldest-r.patch deleted file mode 100644 index 3268a18dac7..00000000000 --- a/target/linux/ramips/patches-6.6/002-02-v6.13-clk-ralink-mtmips-fix-clocks-probe-order-in-oldest-r.patch +++ /dev/null @@ -1,124 +0,0 @@ -From d34db686a3d74bd564bfce2ada15011c556269fc Mon Sep 17 00:00:00 2001 -From: Sergio Paracuellos -Date: Tue, 10 Sep 2024 06:40:23 +0200 -Subject: [PATCH 2/3] clk: ralink: mtmips: fix clocks probe order in oldest - ralink SoCs - -Base clocks are the first in being probed and are real dependencies of the -rest of fixed, factor and peripheral clocks. For old ralink SoCs RT2880, -RT305x and RT3883 'xtal' must be defined first since in any other case, -when fixed clocks are probed they are delayed until 'xtal' is probed so the -following warning appears: - - WARNING: CPU: 0 PID: 0 at drivers/clk/ralink/clk-mtmips.c:499 rt3883_bus_recalc_rate+0x98/0x138 - Modules linked in: - CPU: 0 PID: 0 Comm: swapper Not tainted 6.6.43 #0 - Stack : 805e58d0 00000000 00000004 8004f950 00000000 00000004 00000000 00000000 - 80669c54 80830000 80700000 805ae570 80670068 00000001 80669bf8 00000000 - 00000000 00000000 805ae570 80669b38 00000020 804db7dc 00000000 00000000 - 203a6d6d 80669b78 80669e48 70617773 00000000 805ae570 00000000 00000009 - 00000000 00000001 00000004 00000001 00000000 00000000 83fe43b0 00000000 - ... - Call Trace: - [<800065d0>] show_stack+0x64/0xf4 - [<804bca14>] dump_stack_lvl+0x38/0x60 - [<800218ac>] __warn+0x94/0xe4 - [<8002195c>] warn_slowpath_fmt+0x60/0x94 - [<80259ff8>] rt3883_bus_recalc_rate+0x98/0x138 - [<80254530>] __clk_register+0x568/0x688 - [<80254838>] of_clk_hw_register+0x18/0x2c - [<8070b910>] rt2880_clk_of_clk_init_driver+0x18c/0x594 - [<8070b628>] of_clk_init+0x1c0/0x23c - [<806fc448>] plat_time_init+0x58/0x18c - [<806fdaf0>] time_init+0x10/0x6c - [<806f9bc4>] start_kernel+0x458/0x67c - - ---[ end trace 0000000000000000 ]--- - -When this driver was mainlined we could not find any active users of old -ralink SoCs so we cannot perform any real tests for them. Now, one user -of a Belkin f9k1109 version 1 device which uses RT3883 SoC appeared and -reported some issues in openWRT: -- https://github.com/openwrt/openwrt/issues/16054 - -Thus, define a 'rt2880_xtal_recalc_rate()' just returning the expected -frequency 40Mhz and use it along the old ralink SoCs to have a correct -boot trace with no warnings and a working clock plan from the beggining. - -Fixes: 6f3b15586eef ("clk: ralink: add clock and reset driver for MTMIPS SoCs") -Signed-off-by: Sergio Paracuellos -Link: https://lore.kernel.org/r/20240910044024.120009-3-sergio.paracuellos@gmail.com -Signed-off-by: Stephen Boyd ---- - drivers/clk/ralink/clk-mtmips.c | 21 +++++++++++++-------- - 1 file changed, 13 insertions(+), 8 deletions(-) - ---- a/drivers/clk/ralink/clk-mtmips.c -+++ b/drivers/clk/ralink/clk-mtmips.c -@@ -263,10 +263,6 @@ err_clk_unreg: - .rate = _rate \ - } - --static struct mtmips_clk_fixed rt305x_fixed_clocks[] = { -- CLK_FIXED("xtal", NULL, 40000000) --}; -- - static struct mtmips_clk_fixed rt3883_fixed_clocks[] = { - CLK_FIXED("xtal", NULL, 40000000), - CLK_FIXED("periph", "xtal", 40000000) -@@ -371,6 +367,12 @@ static inline struct mtmips_clk *to_mtmi - return container_of(hw, struct mtmips_clk, hw); - } - -+static unsigned long rt2880_xtal_recalc_rate(struct clk_hw *hw, -+ unsigned long parent_rate) -+{ -+ return 40000000; -+} -+ - static unsigned long rt5350_xtal_recalc_rate(struct clk_hw *hw, - unsigned long parent_rate) - { -@@ -682,10 +684,12 @@ static unsigned long mt76x8_cpu_recalc_r - } - - static struct mtmips_clk rt2880_clks_base[] = { -+ { CLK_BASE("xtal", NULL, rt2880_xtal_recalc_rate) }, - { CLK_BASE("cpu", "xtal", rt2880_cpu_recalc_rate) } - }; - - static struct mtmips_clk rt305x_clks_base[] = { -+ { CLK_BASE("xtal", NULL, rt2880_xtal_recalc_rate) }, - { CLK_BASE("cpu", "xtal", rt305x_cpu_recalc_rate) } - }; - -@@ -695,6 +699,7 @@ static struct mtmips_clk rt3352_clks_bas - }; - - static struct mtmips_clk rt3883_clks_base[] = { -+ { CLK_BASE("xtal", NULL, rt2880_xtal_recalc_rate) }, - { CLK_BASE("cpu", "xtal", rt3883_cpu_recalc_rate) }, - { CLK_BASE("bus", "cpu", rt3883_bus_recalc_rate) } - }; -@@ -751,8 +756,8 @@ err_clk_unreg: - static const struct mtmips_clk_data rt2880_clk_data = { - .clk_base = rt2880_clks_base, - .num_clk_base = ARRAY_SIZE(rt2880_clks_base), -- .clk_fixed = rt305x_fixed_clocks, -- .num_clk_fixed = ARRAY_SIZE(rt305x_fixed_clocks), -+ .clk_fixed = NULL, -+ .num_clk_fixed = 0, - .clk_factor = rt2880_factor_clocks, - .num_clk_factor = ARRAY_SIZE(rt2880_factor_clocks), - .clk_periph = rt2880_pherip_clks, -@@ -762,8 +767,8 @@ static const struct mtmips_clk_data rt28 - static const struct mtmips_clk_data rt305x_clk_data = { - .clk_base = rt305x_clks_base, - .num_clk_base = ARRAY_SIZE(rt305x_clks_base), -- .clk_fixed = rt305x_fixed_clocks, -- .num_clk_fixed = ARRAY_SIZE(rt305x_fixed_clocks), -+ .clk_fixed = NULL, -+ .num_clk_fixed = 0, - .clk_factor = rt305x_factor_clocks, - .num_clk_factor = ARRAY_SIZE(rt305x_factor_clocks), - .clk_periph = rt305x_pherip_clks, diff --git a/target/linux/ramips/patches-6.6/311-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch b/target/linux/ramips/patches-6.6/311-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch index d59a71af88b..3162d669e1d 100644 --- a/target/linux/ramips/patches-6.6/311-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch +++ b/target/linux/ramips/patches-6.6/311-MIPS-use-set_mode-to-enable-disable-the-cevt-r4k-irq.patch @@ -96,7 +96,7 @@ Signed-off-by: John Crispin } --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig -@@ -731,10 +731,15 @@ config GOLDFISH_TIMER +@@ -732,10 +732,15 @@ config GOLDFISH_TIMER depends on RTC_DRV_GOLDFISH help Support for the timer/counter of goldfish-rtc diff --git a/target/linux/ramips/patches-6.6/810-uvc-add-iPassion-iP2970-support.patch b/target/linux/ramips/patches-6.6/810-uvc-add-iPassion-iP2970-support.patch index 71adf6600f6..efc2763880f 100644 --- a/target/linux/ramips/patches-6.6/810-uvc-add-iPassion-iP2970-support.patch +++ b/target/linux/ramips/patches-6.6/810-uvc-add-iPassion-iP2970-support.patch @@ -13,7 +13,7 @@ Signed-off-by: John Crispin --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c -@@ -3183,6 +3183,18 @@ static const struct usb_device_id uvc_id +@@ -3229,6 +3229,18 @@ static const struct usb_device_id uvc_id .bInterfaceSubClass = 1, .bInterfaceProtocol = 0, .driver_info = UVC_INFO_META(V4L2_META_FMT_D4XX) }, diff --git a/target/linux/starfive/patches-6.6/0003-clocksource-Add-JH7110-timer-driver.patch b/target/linux/starfive/patches-6.6/0003-clocksource-Add-JH7110-timer-driver.patch index 68b9c38d5bb..b4398ef1468 100644 --- a/target/linux/starfive/patches-6.6/0003-clocksource-Add-JH7110-timer-driver.patch +++ b/target/linux/starfive/patches-6.6/0003-clocksource-Add-JH7110-timer-driver.patch @@ -15,7 +15,7 @@ Signed-off-by: Xingyu Wu --- a/drivers/clocksource/Kconfig +++ b/drivers/clocksource/Kconfig -@@ -641,6 +641,17 @@ config RISCV_TIMER +@@ -642,6 +642,17 @@ config RISCV_TIMER is accessed via both the SBI and the rdcycle instruction. This is required for all RISC-V systems. diff --git a/target/linux/starfive/patches-6.6/0033-PCI-Add-PCIE_RESET_CONFIG_DEVICE_WAIT_MS-waiting-tim.patch b/target/linux/starfive/patches-6.6/0033-PCI-Add-PCIE_RESET_CONFIG_DEVICE_WAIT_MS-waiting-tim.patch index cc50dfe68e8..ff089604681 100644 --- a/target/linux/starfive/patches-6.6/0033-PCI-Add-PCIE_RESET_CONFIG_DEVICE_WAIT_MS-waiting-tim.patch +++ b/target/linux/starfive/patches-6.6/0033-PCI-Add-PCIE_RESET_CONFIG_DEVICE_WAIT_MS-waiting-tim.patch @@ -30,7 +30,7 @@ Acked-by: Bjorn Helgaas --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h -@@ -19,6 +19,22 @@ +@@ -22,6 +22,22 @@ */ #define PCIE_PME_TO_L2_TIMEOUT_US 10000 diff --git a/target/linux/starfive/patches-6.6/0072-drivers-nvme-Add-precheck-and-delay-for-CQE-pending-.patch b/target/linux/starfive/patches-6.6/0072-drivers-nvme-Add-precheck-and-delay-for-CQE-pending-.patch index d602df9e4c3..7b768a9bc5a 100644 --- a/target/linux/starfive/patches-6.6/0072-drivers-nvme-Add-precheck-and-delay-for-CQE-pending-.patch +++ b/target/linux/starfive/patches-6.6/0072-drivers-nvme-Add-precheck-and-delay-for-CQE-pending-.patch @@ -22,7 +22,7 @@ Signed-off-by: Kevin.xie #include "trace.h" #include "nvme.h" -@@ -1062,6 +1063,15 @@ static inline int nvme_poll_cq(struct nv +@@ -1058,6 +1059,15 @@ static inline int nvme_poll_cq(struct nv { int found = 0; diff --git a/target/linux/starfive/patches-6.6/0109-usb-xhci-To-improve-performance-usb-using-lowmem-for.patch b/target/linux/starfive/patches-6.6/0109-usb-xhci-To-improve-performance-usb-using-lowmem-for.patch index 44c6fe61268..febc6bac4e8 100644 --- a/target/linux/starfive/patches-6.6/0109-usb-xhci-To-improve-performance-usb-using-lowmem-for.patch +++ b/target/linux/starfive/patches-6.6/0109-usb-xhci-To-improve-performance-usb-using-lowmem-for.patch @@ -160,7 +160,7 @@ Signed-off-by: minda.chen } --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c -@@ -3664,7 +3664,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd * +@@ -3672,7 +3672,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd * full_len = urb->transfer_buffer_length; /* If we have scatter/gather list, we use it. */ From 15e173bf7e873d004d6c665ee81d54a10ce1f868 Mon Sep 17 00:00:00 2001 From: John Audia Date: Thu, 12 Dec 2024 08:19:59 -0500 Subject: [PATCH 064/149] kernel: bump 6.6 to 6.6.65 Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.65 Update to checksum only/no patches required a rebase. Per the changelog, this is a trivial upstream bump with only 4 commits, 2 of which being reverts. Build system: x86/64 Build-tested: x86/64/AMD Cezanne Run-tested: x86/64/AMD Cezanne Signed-off-by: John Audia Link: https://github.com/openwrt/openwrt/pull/17217 Signed-off-by: Robert Marko --- include/kernel-6.6 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/kernel-6.6 b/include/kernel-6.6 index ddbef67f942..875c715ba4b 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .64 -LINUX_KERNEL_HASH-6.6.64 = 065fd93fa6cb422f650fb563f15d3e0107c85009f766405993d795fd39796ab1 +LINUX_VERSION-6.6 = .65 +LINUX_KERNEL_HASH-6.6.65 = 7ae1476e8b4c86e7754e581d45d6fbce5932bfefce934758a2907d6d79eca3e0 From 91cfc2b296c7fd48a50d7dec0639ae2490106def Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Sun, 17 Nov 2024 22:23:02 +0800 Subject: [PATCH 065/149] mediatek: update leds for openembed som7981 Signed-off-by: Tianling Shen --- .../mediatek/dts/mt7981b-openembed-som7981.dts | 14 ++++++++------ .../filogic/base-files/etc/board.d/01_leds | 2 -- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/target/linux/mediatek/dts/mt7981b-openembed-som7981.dts b/target/linux/mediatek/dts/mt7981b-openembed-som7981.dts index bb0234d8625..27227434a20 100644 --- a/target/linux/mediatek/dts/mt7981b-openembed-som7981.dts +++ b/target/linux/mediatek/dts/mt7981b-openembed-som7981.dts @@ -12,9 +12,10 @@ compatible = "openembed,som7981", "mediatek,mt7981"; aliases { - led-boot = &wlan5g_led; - led-failsafe = &wlan5g_led; - led-upgrade = &wlan5g_led; + led-boot = &act_led; + led-failsafe = &act_led; + led-running = &act_led; + led-upgrade = &act_led; serial0 = &uart0; }; @@ -57,13 +58,14 @@ }; led-2 { - function = LED_FUNCTION_WLAN_2GHZ; + function = LED_FUNCTION_PANIC; color = ; gpios = <&pio 34 GPIO_ACTIVE_LOW>; + panic-indicator; }; - wlan5g_led: led-3 { - function = LED_FUNCTION_WLAN_5GHZ; + act_led: led-3 { + function = LED_FUNCTION_ACTIVITY; color = ; gpios = <&pio 35 GPIO_ACTIVE_LOW>; }; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds index f1bba0a6a89..8da2d0aecb7 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds @@ -80,8 +80,6 @@ nradio,c8-668gl) openembed,som7981) ucidef_set_led_netdev "lanact" "LANACT" "amber:lan" "eth1" "rx tx" ucidef_set_led_netdev "lanlink" "LANLINK" "green:lan" "eth1" "link" - ucidef_set_led_netdev "wlan2g" "WLAN2G" "green:wlan-2ghz" "phy0-ap0" - ucidef_set_led_netdev "wlan5g" "WLAN5G" "red:wlan-5ghz" "phy1-ap0" ;; openwrt,one) ucidef_set_led_netdev "wanact" "WANACT" "mdio-bus:0f:green:wan" "eth0" "rx tx" From 3c7134fa320b823ab7c5f91dd1ad948491d97478 Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Sat, 14 Dec 2024 11:27:09 +0100 Subject: [PATCH 066/149] base-files: fix shell scope error for the default LED brightness This fixes "sh: write error: Invalid argument" for all default!=1 LEDs as an empty $brightness was used. Setting up LEDs via luci also now works again. Fixes cbdfd03e: "base-files: add option to set LED brightness" Signed-off-by: Andre Heider Link: https://github.com/openwrt/openwrt/issues/17269 Signed-off-by: John Crispin --- package/base-files/files/etc/init.d/led | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led index d292e2a8dd1..79fdd452cec 100755 --- a/package/base-files/files/etc/init.d/led +++ b/package/base-files/files/etc/init.d/led @@ -106,9 +106,10 @@ load_led() { [ "$default" = 0 ] && echo 0 >/sys/class/leds/${sysfs}/brightness - [ $default = 1 ] && - [ -z "$brightness" ] && brightness=$(cat /sys/class/leds/${sysfs}/max_brightness) - echo $brightness > /sys/class/leds/${sysfs}/brightness + [ "$default" = 1 ] && { + [ -z "$brightness" ] && brightness="$(cat /sys/class/leds/${sysfs}/max_brightness)" + echo "$brightness" > /sys/class/leds/${sysfs}/brightness + } led_color_set "$1" "$sysfs" From 5a24850de1418510c421d45eb2436bdcb2b243c6 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sat, 14 Dec 2024 12:11:24 +0800 Subject: [PATCH 067/149] ramips: fix 2.4G wmac eeprom offset for TL-WR902AC v4 The eeprom data offset on 2.4GHz wmac is wrong. It is obvious that this is a copy & paste issue. Suggested-by: @cgm999 on https://github.com/openwrt/openwrt/issues/13969 Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/17263 Signed-off-by: Hauke Mehrtens --- target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v4.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v4.dts b/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v4.dts index 946efb9443e..a2dd4ce5cb8 100644 --- a/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v4.dts +++ b/target/linux/ramips/dts/mt7628an_tplink_tl-wr902ac-v4.dts @@ -108,7 +108,7 @@ &wmac { status = "okay"; - nvmem-cells = <&eeprom_factory_28000>, <&macaddr_factory_f100 0>; + nvmem-cells = <&eeprom_factory_20000>, <&macaddr_factory_f100 0>; nvmem-cell-names = "eeprom", "mac-address"; }; From 96eb12e961748373a38738de92f5ef1a87f0cc75 Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Thu, 12 Dec 2024 22:40:08 +0800 Subject: [PATCH 068/149] ath79: fix ath9k calibration data size for AR9132 For ath9k NICs older than AR9287, The eeprom size is 0xeb8. Fixes: https://github.com/openwrt/openwrt/issues/17196 Fixes: 74f2df9dbccd ("ath79: mtd-cal-data removals") Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/17261 Signed-off-by: Hauke Mehrtens --- target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi | 2 +- target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts | 2 +- target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts | 2 +- target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi b/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi index a82546c1c13..474d0fa80f7 100644 --- a/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi +++ b/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi @@ -145,7 +145,7 @@ #size-cells = <1>; cal_art_11000: calibration@11000 { - reg = <0x11000 0x440>; + reg = <0x11000 0xeb8>; }; macaddr_art_1120c: macaddr@1120c { diff --git a/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts b/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts index ed4ca5297e7..3fcc4073fea 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wa901nd-v2.dts @@ -104,7 +104,7 @@ #size-cells = <1>; cal_art_1000: calibration@1000 { - reg = <0x1000 0x440>; + reg = <0x1000 0xeb8>; }; }; }; diff --git a/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts b/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts index 8958ddd3a83..847d4d4c47d 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wr1043nd-v1.dts @@ -131,7 +131,7 @@ #size-cells = <1>; cal_art_1000: calibration@1000 { - reg = <0x1000 0x440>; + reg = <0x1000 0xeb8>; }; }; }; diff --git a/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts b/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts index d3f189479a8..3ad058e9597 100644 --- a/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts +++ b/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts @@ -153,7 +153,7 @@ #size-cells = <1>; cal_art_1000: calibration@1000 { - reg = <0x1000 0x440>; + reg = <0x1000 0xeb8>; }; }; }; From a3c484c3b9468a7bd9190b0fee027bb133cee3d5 Mon Sep 17 00:00:00 2001 From: John Audia Date: Sun, 15 Dec 2024 09:30:52 -0500 Subject: [PATCH 069/149] kernel: generic: tg3: Fix DMA allocations on 57766 devices At the request of rsalvaterra, add this patch to fix an issue affecting tg3 ethernet interfaces[1]. 1. https://github.com/openwrt/openwrt/pull/17271#issuecomment-2543836518 Tested-by: Rui Salvaterra Signed-off-by: John Audia Link: https://github.com/openwrt/openwrt/pull/17282 Signed-off-by: Hauke Mehrtens --- ...Fix-DMA-allocations-on-57766-devices.patch | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 target/linux/generic/pending-6.6/791-tg3-Fix-DMA-allocations-on-57766-devices.patch diff --git a/target/linux/generic/pending-6.6/791-tg3-Fix-DMA-allocations-on-57766-devices.patch b/target/linux/generic/pending-6.6/791-tg3-Fix-DMA-allocations-on-57766-devices.patch new file mode 100644 index 00000000000..a90d77c9f04 --- /dev/null +++ b/target/linux/generic/pending-6.6/791-tg3-Fix-DMA-allocations-on-57766-devices.patch @@ -0,0 +1,31 @@ +From f992b15965177e2f280fb6f41f292214f9a6f8d5 Mon Sep 17 00:00:00 2001 +From: Pavan Chebbi +Date: Tue, 10 Dec 2024 03:28:31 -0800 +Subject: [PATCH] tg3: Fix DMA allocations on 57766 devices + +The coherent DMA mask of 31b may not be accepted if +the DMA mask is configured to use higher memories of +64b. Set the DMA mask also to lower 32b for 57766 +devices. + +Fixes: 614f4d166eee ("tg3: Set coherent DMA mask bits to 31 for BCM57766 chipsets") +Reported-By: Rui Salvaterra +Signed-off-by: Pavan Chebbi +--- + drivers/net/ethernet/broadcom/tg3.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/broadcom/tg3.c ++++ b/drivers/net/ethernet/broadcom/tg3.c +@@ -17731,8 +17731,10 @@ static int tg3_init_one(struct pci_dev * + } else + persist_dma_mask = dma_mask = DMA_BIT_MASK(64); + +- if (tg3_asic_rev(tp) == ASIC_REV_57766) ++ if (tg3_asic_rev(tp) == ASIC_REV_57766) { ++ dma_mask = DMA_BIT_MASK(32); + persist_dma_mask = DMA_BIT_MASK(31); ++ } + + /* Configure DMA attributes. */ + if (dma_mask > DMA_BIT_MASK(32)) { From e63326e26a82cb083eec602b3a2f71d4cd8e2ea4 Mon Sep 17 00:00:00 2001 From: Andrew MacIntyre Date: Fri, 29 Nov 2024 17:06:02 +1100 Subject: [PATCH 070/149] lantiq/xrx200: move 8M flash devices to a small flash subtarget Images for xrx200 8M flash are either not building due to image size (TD-W8970, TD-W8980) or building such that the available free space in the overlayfs is too little to be useful. To keep images for these devices buildable, move them into a small flash variant of the xrx200 subtarget. As these devices are NOR flash only, remove NAND and UBI references from the kernel config to gain some additional image size reduction. The apparent 8M flash devices Arcadyan VGV7510KW22-brn, Arcadyan VGV7519-brn and Lantiq Easy80920-nor seem to exist in order to create special "factory" installation images for these devices (which actually have larger flash: 16MB for the Arcardyan devices; 64MB for the Lantiq device). As a considerable amount of surgery would appear to be required to the uboot-lantiq package structure to separate the "factory" from the "sysupgrade" device recipes for these devices they remain in the xrx200 target - if factory images aren't now created, 23.05.x factory images should suffice for initial installation. Tested on: Netgear DM200, TP-Link TD-W8980, AVM Fritz7490 (xrx200 subtarget: image build only) Fixes: https://github.com/openwrt/openwrt/issues/16761 Signed-off-by: Andrew MacIntyre Link: https://github.com/openwrt/openwrt/pull/17113 Signed-off-by: Hauke Mehrtens --- .../lantiq/dsl-vrx200-firmware-xdsl/Makefile | 8 +- package/kernel/lantiq/ltq-atm/Makefile | 2 +- package/kernel/lantiq/ltq-deu/Makefile | 8 +- package/kernel/lantiq/ltq-ptm/Makefile | 10 +-- package/kernel/lantiq/ltq-vdsl-fw/Makefile | 2 +- .../kernel/lantiq/ltq-vdsl-vr9-mei/Makefile | 4 +- package/kernel/lantiq/ltq-vdsl-vr9/Makefile | 2 +- package/kernel/lantiq/ltq-vectoring/Makefile | 4 +- .../network/config/ltq-vdsl-vr9-app/Makefile | 2 +- target/linux/lantiq/Makefile | 2 +- target/linux/lantiq/image/Makefile | 6 ++ target/linux/lantiq/image/tp-link.mk | 28 ------ target/linux/lantiq/image/tp-link_legacy.mk | 46 ++++++++++ target/linux/lantiq/image/vr9.mk | 37 -------- target/linux/lantiq/image/vr9_legacy.mk | 43 ++++++++++ .../xrx200/base-files/etc/board.d/01_leds | 3 - .../xrx200/base-files/etc/board.d/02_network | 22 +---- .../etc/hotplug.d/firmware/12-ath9k-eeprom | 4 - .../etc/uci-defaults/01_led_migration | 2 - .../base-files/etc/board.d/01_leds | 34 ++++++++ .../base-files/etc/board.d/02_network | 75 ++++++++++++++++ .../base-files/etc/board.d/05_compat-version | 18 ++++ .../etc/hotplug.d/firmware/12-ath9k-eeprom | 23 +++++ .../etc/uci-defaults/01_led_migration | 31 +++++++ .../base-files/lib/upgrade/platform.sh | 16 ++++ target/linux/lantiq/xrx200_legacy/config-6.6 | 86 +++++++++++++++++++ .../xrx200_legacy/profiles/00-default.mk | 9 ++ target/linux/lantiq/xrx200_legacy/target.mk | 22 +++++ 28 files changed, 432 insertions(+), 117 deletions(-) create mode 100644 target/linux/lantiq/image/tp-link_legacy.mk create mode 100644 target/linux/lantiq/image/vr9_legacy.mk create mode 100644 target/linux/lantiq/xrx200_legacy/base-files/etc/board.d/01_leds create mode 100644 target/linux/lantiq/xrx200_legacy/base-files/etc/board.d/02_network create mode 100644 target/linux/lantiq/xrx200_legacy/base-files/etc/board.d/05_compat-version create mode 100644 target/linux/lantiq/xrx200_legacy/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom create mode 100644 target/linux/lantiq/xrx200_legacy/base-files/etc/uci-defaults/01_led_migration create mode 100755 target/linux/lantiq/xrx200_legacy/base-files/lib/upgrade/platform.sh create mode 100644 target/linux/lantiq/xrx200_legacy/config-6.6 create mode 100644 target/linux/lantiq/xrx200_legacy/profiles/00-default.mk create mode 100644 target/linux/lantiq/xrx200_legacy/target.mk diff --git a/package/firmware/lantiq/dsl-vrx200-firmware-xdsl/Makefile b/package/firmware/lantiq/dsl-vrx200-firmware-xdsl/Makefile index 37db950beae..b6e1d11efc6 100644 --- a/package/firmware/lantiq/dsl-vrx200-firmware-xdsl/Makefile +++ b/package/firmware/lantiq/dsl-vrx200-firmware-xdsl/Makefile @@ -40,7 +40,7 @@ define Package/dsl-vrx200-firmware-xdsl-a CATEGORY:=Firmware TITLE:=VRX200 / VR9 CPE xDSL Annex A firmware URL:=http://www.lantiq.com/ - DEPENDS:=@TARGET_lantiq_xrx200 + DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) endef define Package/dsl-vrx200-firmware-xdsl-a/description @@ -52,7 +52,7 @@ define Package/dsl-vrx200-firmware-xdsl-b CATEGORY:=Firmware TITLE:=VRX200 / VR9 CPE xDSL Annex B firmware URL:=http://www.lantiq.com/ - DEPENDS:=@TARGET_lantiq_xrx200 + DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) endef define Package/dsl-vrx200-firmware-xdsl-b/description @@ -64,7 +64,7 @@ define Package/dsl-vrx200-firmware-xdsl-a-patch CATEGORY:=Firmware TITLE:=VRX200 / VR9 CPE xDSL Annex B to Annex A firmware patch URL:=http://www.lantiq.com/ - DEPENDS:=@TARGET_lantiq_xrx200 +dsl-vrx200-firmware-xdsl-b +bspatch + DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) +dsl-vrx200-firmware-xdsl-b +bspatch endef define Package/dsl-vrx200-firmware-xdsl-a-patch/description @@ -76,7 +76,7 @@ define Package/dsl-vrx200-firmware-xdsl-b-patch CATEGORY:=Firmware TITLE:=VRX200 / VR9 CPE xDSL Annex A to Annex B firmware patch URL:=http://www.lantiq.com/ - DEPENDS:=@TARGET_lantiq_xrx200 +dsl-vrx200-firmware-xdsl-a +bspatch + DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) +dsl-vrx200-firmware-xdsl-a +bspatch endef define Package/dsl-vrx200-firmware-xdsl-b-patch/description diff --git a/package/kernel/lantiq/ltq-atm/Makefile b/package/kernel/lantiq/ltq-atm/Makefile index b81f3bb2938..ca19c5052e9 100644 --- a/package/kernel/lantiq/ltq-atm/Makefile +++ b/package/kernel/lantiq/ltq-atm/Makefile @@ -33,7 +33,7 @@ endef KernelPackage/ltq-atm-danube=$(call KernelPackage/ltq-atm-template,danube,(TARGET_lantiq_xway||TARGET_lantiq_xway_legacy)) KernelPackage/ltq-atm-ar9=$(call KernelPackage/ltq-atm-template,ar9,TARGET_lantiq_xway) KernelPackage/ltq-atm-ase=$(call KernelPackage/ltq-atm-template,ase,TARGET_lantiq_ase) -KernelPackage/ltq-atm-vr9=$(call KernelPackage/ltq-atm-template,vr9,TARGET_lantiq_xrx200) +KernelPackage/ltq-atm-vr9=$(call KernelPackage/ltq-atm-template,vr9,(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy)) define Build/Configure endef diff --git a/package/kernel/lantiq/ltq-deu/Makefile b/package/kernel/lantiq/ltq-deu/Makefile index 4e8127afabb..96414bf186f 100644 --- a/package/kernel/lantiq/ltq-deu/Makefile +++ b/package/kernel/lantiq/ltq-deu/Makefile @@ -21,14 +21,14 @@ define KernelPackage/ltq-deu-template TITLE:=deu driver for $(1) URL:=http://www.lantiq.com/ VARIANT:=$(1) - DEPENDS:=@TARGET_lantiq_$(2) +kmod-crypto-manager +kmod-crypto-des + DEPENDS:=@$(2) +kmod-crypto-manager +kmod-crypto-des FILES:=$(PKG_BUILD_DIR)/ltq_deu_$(1).ko AUTOLOAD:=$(call AutoProbe,ltq_deu_$(1)) endef -KernelPackage/ltq-deu-danube=$(call KernelPackage/ltq-deu-template,danube,xway) -KernelPackage/ltq-deu-ar9=$(call KernelPackage/ltq-deu-template,ar9,xway) -KernelPackage/ltq-deu-vr9=$(call KernelPackage/ltq-deu-template,vr9,xrx200) +KernelPackage/ltq-deu-danube=$(call KernelPackage/ltq-deu-template,danube,TARGET_lantiq_xway) +KernelPackage/ltq-deu-ar9=$(call KernelPackage/ltq-deu-template,ar9,TARGET_lantiq_xway) +KernelPackage/ltq-deu-vr9=$(call KernelPackage/ltq-deu-template,vr9,(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy)) define Build/Configure endef diff --git a/package/kernel/lantiq/ltq-ptm/Makefile b/package/kernel/lantiq/ltq-ptm/Makefile index 03b12188747..c3ab47c1b3e 100644 --- a/package/kernel/lantiq/ltq-ptm/Makefile +++ b/package/kernel/lantiq/ltq-ptm/Makefile @@ -22,7 +22,7 @@ define KernelPackage/ltq-ptm-template TITLE:=ptm driver for $(1) URL:=http://www.lantiq.com/ VARIANT:=$(1) - DEPENDS:=@TARGET_lantiq_$(2) + DEPENDS:=@$(2) ifeq ($(1),vr9) DEPENDS+= +PACKAGE_kmod-ltq-ptm-$(1):kmod-ltq-vdsl-vr9-mei else @@ -34,10 +34,10 @@ endif FILES:=$(PKG_BUILD_DIR)/ltq_ptm_$(1).ko endef -KernelPackage/ltq-ptm-danube=$(call KernelPackage/ltq-ptm-template,danube,xway) -KernelPackage/ltq-ptm-ar9=$(call KernelPackage/ltq-ptm-template,ar9,xway) -KernelPackage/ltq-ptm-ase=$(call KernelPackage/ltq-ptm-template,ase,ase) -KernelPackage/ltq-ptm-vr9=$(call KernelPackage/ltq-ptm-template,vr9,xrx200) +KernelPackage/ltq-ptm-danube=$(call KernelPackage/ltq-ptm-template,danube,TARGET_lantiq_xway) +KernelPackage/ltq-ptm-ar9=$(call KernelPackage/ltq-ptm-template,ar9,TARGET_lantiq_xway) +KernelPackage/ltq-ptm-ase=$(call KernelPackage/ltq-ptm-template,ase,TARGET_lantiq_ase) +KernelPackage/ltq-ptm-vr9=$(call KernelPackage/ltq-ptm-template,vr9,(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy)) define Build/Configure endef diff --git a/package/kernel/lantiq/ltq-vdsl-fw/Makefile b/package/kernel/lantiq/ltq-vdsl-fw/Makefile index 88883ffdee0..61833e018c2 100644 --- a/package/kernel/lantiq/ltq-vdsl-fw/Makefile +++ b/package/kernel/lantiq/ltq-vdsl-fw/Makefile @@ -19,7 +19,7 @@ define Package/ltq-vdsl-vr9-vectoring-fw-installer TITLE:=VDSL2 Vectoring Firmware installer SECTION:=net CATEGORY:=Network - DEPENDS:=@TARGET_lantiq_xrx200 +kmod-ltq-vdsl-vr9 + DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) +kmod-ltq-vdsl-vr9 endef define Build/Prepare diff --git a/package/kernel/lantiq/ltq-vdsl-vr9-mei/Makefile b/package/kernel/lantiq/ltq-vdsl-vr9-mei/Makefile index e9c5a681fd0..9b3dac299fe 100644 --- a/package/kernel/lantiq/ltq-vdsl-vr9-mei/Makefile +++ b/package/kernel/lantiq/ltq-vdsl-vr9-mei/Makefile @@ -29,7 +29,7 @@ define KernelPackage/ltq-vdsl-vr9-mei TITLE:=mei driver for vdsl SECTION:=sys SUBMENU:=Network Devices - DEPENDS:=@TARGET_lantiq_xrx200 +kmod-ltq-ifxos +kmod-ltq-vectoring + DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) +kmod-ltq-ifxos +kmod-ltq-vectoring FILES:=$(PKG_BUILD_DIR)/src/drv_mei_cpe.ko AUTOLOAD:=$(call AutoLoad,50,drv_mei_cpe) endef @@ -44,7 +44,7 @@ define Package/ltq-vdsl-vr9-mei-test CATEGORY:=Network TITLE:=Lantiq mei driver test tool URL:=http://www.lantiq.com/ - DEPENDS:=@TARGET_lantiq_xrx200 + DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) endef define Package/ltq-vdsl-vr9-mei-test/description diff --git a/package/kernel/lantiq/ltq-vdsl-vr9/Makefile b/package/kernel/lantiq/ltq-vdsl-vr9/Makefile index ebcb935a739..5a53c050d4b 100644 --- a/package/kernel/lantiq/ltq-vdsl-vr9/Makefile +++ b/package/kernel/lantiq/ltq-vdsl-vr9/Makefile @@ -29,7 +29,7 @@ define KernelPackage/ltq-vdsl-vr9 TITLE:=vdsl driver SECTION:=sys SUBMENU:=Network Devices - DEPENDS:=@TARGET_lantiq_xrx200 +kmod-ltq-vdsl-vr9-mei + DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) +kmod-ltq-vdsl-vr9-mei FILES:=$(PKG_BUILD_DIR)/src/drv_dsl_cpe_api.ko AUTOLOAD:=$(call AutoLoad,51,drv_dsl_cpe_api) endef diff --git a/package/kernel/lantiq/ltq-vectoring/Makefile b/package/kernel/lantiq/ltq-vectoring/Makefile index 6076df77428..ea177942b48 100644 --- a/package/kernel/lantiq/ltq-vectoring/Makefile +++ b/package/kernel/lantiq/ltq-vectoring/Makefile @@ -20,7 +20,7 @@ define KernelPackage/ltq-vectoring CATEGORY:=Kernel modules SUBMENU:=Network Devices TITLE:=driver for sending vectoring error samples - DEPENDS:=@TARGET_lantiq_xrx200 + DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) FILES:=$(PKG_BUILD_DIR)/$(MAKE_PATH)/ltq_vectoring.ko AUTOLOAD:=$(call AutoLoad,49,ltq_vectoring) endef @@ -38,7 +38,7 @@ define KernelPackage/ltq-vectoring-test CATEGORY:=Kernel modules SUBMENU:=Network Devices TITLE:=driver for testing the vectoring driver - DEPENDS:=@TARGET_lantiq_xrx200 +kmod-ltq-vectoring + DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) +kmod-ltq-vectoring FILES:=$(PKG_BUILD_DIR)/$(MAKE_PATH)/ltq_vectoring_test.ko endef diff --git a/package/network/config/ltq-vdsl-vr9-app/Makefile b/package/network/config/ltq-vdsl-vr9-app/Makefile index 51b88231f7e..a73cd4ae62f 100644 --- a/package/network/config/ltq-vdsl-vr9-app/Makefile +++ b/package/network/config/ltq-vdsl-vr9-app/Makefile @@ -29,7 +29,7 @@ define Package/ltq-vdsl-vr9-app CATEGORY:=Network TITLE:=Lantiq VDSL userland tool URL:=http://www.lantiq.com/ - DEPENDS:=@TARGET_lantiq_xrx200 +libpthread +librt +ltq-dsl-base +libubox +libubus + DEPENDS:=@(TARGET_lantiq_xrx200||TARGET_lantiq_xrx200_legacy) +libpthread +librt +ltq-dsl-base +libubox +libubus PROVIDES:=ltq-dsl-app endef diff --git a/target/linux/lantiq/Makefile b/target/linux/lantiq/Makefile index 69fa8276e75..e7a251a505c 100644 --- a/target/linux/lantiq/Makefile +++ b/target/linux/lantiq/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk BOARD:=lantiq BOARDNAME:=Lantiq FEATURES:=squashfs -SUBTARGETS:=xrx200 xway xway_legacy falcon ase +SUBTARGETS:=xrx200 xrx200_legacy xway xway_legacy falcon ase KERNEL_PATCHVER:=6.6 diff --git a/target/linux/lantiq/image/Makefile b/target/linux/lantiq/image/Makefile index 9fdb949392a..307d47a979e 100644 --- a/target/linux/lantiq/image/Makefile +++ b/target/linux/lantiq/image/Makefile @@ -162,6 +162,12 @@ include danube.mk include ar9.mk endif +ifeq ($(SUBTARGET),xrx200_legacy) +DEFAULT_SOC := vr9 +include tp-link_legacy.mk +include vr9_legacy.mk +endif + ifeq ($(SUBTARGET),xrx200) DEFAULT_SOC := vr9 include tp-link.mk diff --git a/target/linux/lantiq/image/tp-link.mk b/target/linux/lantiq/image/tp-link.mk index 751f61589de..c2f5b95dd6a 100644 --- a/target/linux/lantiq/image/tp-link.mk +++ b/target/linux/lantiq/image/tp-link.mk @@ -17,34 +17,6 @@ define Device/lantiqTpLink check-size | append-metadata endef -define Device/tplink_tdw8970 - $(Device/dsa-migration) - $(Device/lantiqTpLink) - DEVICE_MODEL := TD-W8970 - DEVICE_VARIANT := v1 - TPLINK_FLASHLAYOUT := 8Mltq - TPLINK_HWID := 0x89700001 - TPLINK_HWREV := 1 - IMAGE_SIZE := 7680k - DEVICE_PACKAGES:= kmod-ath9k wpad-basic-mbedtls kmod-usb-dwc2 kmod-usb-ledtrig-usbport - SUPPORTED_DEVICES += TDW8970 -endef -TARGET_DEVICES += tplink_tdw8970 - -define Device/tplink_tdw8980 - $(Device/dsa-migration) - $(Device/lantiqTpLink) - DEVICE_MODEL := TD-W8980 - DEVICE_VARIANT := v1 - TPLINK_FLASHLAYOUT := 8Mltq - TPLINK_HWID := 0x89800001 - TPLINK_HWREV := 14 - IMAGE_SIZE := 7680k - DEVICE_PACKAGES:= kmod-ath9k kmod-owl-loader wpad-basic-mbedtls kmod-usb-dwc2 kmod-usb-ledtrig-usbport - SUPPORTED_DEVICES += TDW8980 -endef -TARGET_DEVICES += tplink_tdw8980 - define Device/tplink_vr200 $(Device/dsa-migration) $(Device/lantiqTpLink) diff --git a/target/linux/lantiq/image/tp-link_legacy.mk b/target/linux/lantiq/image/tp-link_legacy.mk new file mode 100644 index 00000000000..d9bcd35d10f --- /dev/null +++ b/target/linux/lantiq/image/tp-link_legacy.mk @@ -0,0 +1,46 @@ +DEVICE_VARS += TPLINK_FLASHLAYOUT TPLINK_HWID TPLINK_HWREV TPLINK_HWREVADD TPLINK_HVERSION + +define Device/dsa-migration + DEVICE_COMPAT_VERSION := 1.1 + DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA +endef + +define Device/lantiqTpLink + DEVICE_VENDOR := TP-Link + TPLINK_HWREVADD := 0 + TPLINK_HVERSION := 2 + KERNEL := kernel-bin | append-dtb | lzma + KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | \ + tplink-v2-header -s -V "ver. 1.0" + IMAGES := sysupgrade.bin + IMAGE/sysupgrade.bin := tplink-v2-image -s -V "ver. 1.0" | \ + check-size | append-metadata +endef + +define Device/tplink_tdw8970 + $(Device/dsa-migration) + $(Device/lantiqTpLink) + DEVICE_MODEL := TD-W8970 + DEVICE_VARIANT := v1 + TPLINK_FLASHLAYOUT := 8Mltq + TPLINK_HWID := 0x89700001 + TPLINK_HWREV := 1 + IMAGE_SIZE := 7680k + DEVICE_PACKAGES:= kmod-ath9k wpad-basic-mbedtls kmod-usb-dwc2 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += TDW8970 +endef +TARGET_DEVICES += tplink_tdw8970 + +define Device/tplink_tdw8980 + $(Device/dsa-migration) + $(Device/lantiqTpLink) + DEVICE_MODEL := TD-W8980 + DEVICE_VARIANT := v1 + TPLINK_FLASHLAYOUT := 8Mltq + TPLINK_HWID := 0x89800001 + TPLINK_HWREV := 14 + IMAGE_SIZE := 7680k + DEVICE_PACKAGES:= kmod-ath9k kmod-owl-loader wpad-basic-mbedtls kmod-usb-dwc2 kmod-usb-ledtrig-usbport + SUPPORTED_DEVICES += TDW8980 +endef +TARGET_DEVICES += tplink_tdw8980 diff --git a/target/linux/lantiq/image/vr9.mk b/target/linux/lantiq/image/vr9.mk index fe5b5a6bb50..e2608213dc5 100644 --- a/target/linux/lantiq/image/vr9.mk +++ b/target/linux/lantiq/image/vr9.mk @@ -5,17 +5,6 @@ define Device/dsa-migration DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA endef -define Device/alphanetworks_asl56026 - $(Device/dsa-migration) - DEVICE_VENDOR := Alpha - DEVICE_MODEL := ASL56026 - DEVICE_ALT0_VENDOR := BT Openreach - DEVICE_ALT0_MODEL := ECI VDSL Modem V-2FUb/I - IMAGE_SIZE := 7488k - DEFAULT := n -endef -TARGET_DEVICES += alphanetworks_asl56026 - define Device/arcadyan_arv7519rw22 $(Device/dsa-migration) DEVICE_VENDOR := Arcadyan @@ -33,16 +22,6 @@ define Device/arcadyan_arv7519rw22 endef TARGET_DEVICES += arcadyan_arv7519rw22 -define Device/arcadyan_vg3503j - $(Device/dsa-migration) - DEVICE_VENDOR := BT Openreach - DEVICE_MODEL := ECI VDSL Modem V-2FUb/R - IMAGE_SIZE := 8000k - SUPPORTED_DEVICES += VG3503J - DEFAULT := n -endef -TARGET_DEVICES += arcadyan_vg3503j - define Device/arcadyan_vgv7510kw22-brn $(Device/dsa-migration) $(Device/lantiqBrnImage) @@ -351,22 +330,6 @@ define Device/lantiq_easy80920-nor endef TARGET_DEVICES += lantiq_easy80920-nor -define Device/netgear_dm200 - $(Device/dsa-migration) - DEVICE_VENDOR := NETGEAR - DEVICE_MODEL := DM200 - IMAGES := sysupgrade.bin factory.img - IMAGE/sysupgrade.bin := append-kernel | \ - pad-offset 64k 64 | append-uImage-fakehdr filesystem | \ - pad-offset 64k 64 | append-uImage-fakehdr filesystem | \ - append-rootfs | pad-rootfs | check-size | append-metadata - IMAGE/factory.img := $$(IMAGE/sysupgrade.bin) | netgear-dni - IMAGE_SIZE := 7872k - NETGEAR_BOARD_ID := DM200 - NETGEAR_HW_ID := 29765233+8+0+64+0+0 -endef -TARGET_DEVICES += netgear_dm200 - define Device/zyxel_p-2812hnu-f1 $(Device/NAND) DEVICE_COMPAT_VERSION := 2.0 diff --git a/target/linux/lantiq/image/vr9_legacy.mk b/target/linux/lantiq/image/vr9_legacy.mk new file mode 100644 index 00000000000..814fb515780 --- /dev/null +++ b/target/linux/lantiq/image/vr9_legacy.mk @@ -0,0 +1,43 @@ +DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID + +define Device/dsa-migration + DEVICE_COMPAT_VERSION := 1.1 + DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA +endef + +define Device/alphanetworks_asl56026 + $(Device/dsa-migration) + DEVICE_VENDOR := Alpha + DEVICE_MODEL := ASL56026 + DEVICE_ALT0_VENDOR := BT Openreach + DEVICE_ALT0_MODEL := ECI VDSL Modem V-2FUb/I + IMAGE_SIZE := 7488k + DEFAULT := n +endef +TARGET_DEVICES += alphanetworks_asl56026 + +define Device/arcadyan_vg3503j + $(Device/dsa-migration) + DEVICE_VENDOR := BT Openreach + DEVICE_MODEL := ECI VDSL Modem V-2FUb/R + IMAGE_SIZE := 8000k + SUPPORTED_DEVICES += VG3503J + DEFAULT := n +endef +TARGET_DEVICES += arcadyan_vg3503j + +define Device/netgear_dm200 + $(Device/dsa-migration) + DEVICE_VENDOR := NETGEAR + DEVICE_MODEL := DM200 + IMAGES := sysupgrade.bin factory.img + IMAGE/sysupgrade.bin := append-kernel | \ + pad-offset 64k 64 | append-uImage-fakehdr filesystem | \ + pad-offset 64k 64 | append-uImage-fakehdr filesystem | \ + append-rootfs | pad-rootfs | check-size | append-metadata + IMAGE/factory.img := $$(IMAGE/sysupgrade.bin) | netgear-dni + IMAGE_SIZE := 7872k + NETGEAR_BOARD_ID := DM200 + NETGEAR_HW_ID := 29765233+8+0+64+0+0 +endef +TARGET_DEVICES += netgear_dm200 diff --git a/target/linux/lantiq/xrx200/base-files/etc/board.d/01_leds b/target/linux/lantiq/xrx200/base-files/etc/board.d/01_leds index dfc647a43e4..815f312dac0 100644 --- a/target/linux/lantiq/xrx200/base-files/etc/board.d/01_leds +++ b/target/linux/lantiq/xrx200/base-files/etc/board.d/01_leds @@ -64,9 +64,6 @@ buffalo,wbmr-300hpd) ucidef_set_led_switch "lan3" "LAN3" "green:lan3" "switch0" "0x20" ucidef_set_led_default "router" "router" "green:router" "1" ;; -netgear,dm200) - ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0" - ;; esac board_config_flush diff --git a/target/linux/lantiq/xrx200/base-files/etc/board.d/02_network b/target/linux/lantiq/xrx200/base-files/etc/board.d/02_network index 27a3c75edc4..6c35c7a4deb 100644 --- a/target/linux/lantiq/xrx200/base-files/etc/board.d/02_network +++ b/target/linux/lantiq/xrx200/base-files/etc/board.d/02_network @@ -11,10 +11,6 @@ lantiq_setup_interfaces() local board="$1" case "$board" in - alphanetworks,asl56026|\ - arcadyan,vg3503j) - ucidef_set_interface_lan "lan1 lan2" - ;; arcadyan,arv7519rw22) ucidef_set_interface_lan "lan1 lan2 lan3 lan4 lan5" ;; @@ -46,14 +42,11 @@ lantiq_setup_interfaces() avm,fritz7490|\ avm,fritz7490-micron|\ buffalo,wbmr-300hpd|\ - tplink,tdw8970|\ - tplink,tdw8980|\ tplink,vr200|\ tplink,vr200v) ucidef_set_interface_lan "lan1 lan2 lan3 lan4" ;; - avm,fritz7412|\ - netgear,dm200) + avm,fritz7412) ucidef_set_interface_lan "lan" ;; *) @@ -95,14 +88,9 @@ lantiq_setup_macs() local wan_mac="" case "$board" in - alphanetworks,asl56026) - lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) - wan_mac=$(mtd_get_mac_ascii u-boot-env wanmac) - ;; arcadyan,arv7519rw22) wan_mac=$(macaddr_add "$(mtd_get_mac_binary boardconfig 0x16)" 1) ;; - arcadyan,vg3503j|\ lantiq,easy80920-nand|\ lantiq,easy80920-nor|\ zyxel,p-2812hnu-f1|\ @@ -148,14 +136,6 @@ lantiq_setup_macs() lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) wan_mac="$lan_mac" ;; - netgear,dm200) - lan_mac=$(mtd_get_mac_binary ART 0x0) - wan_mac=$(macaddr_add "$lan_mac" 1) - ;; - tplink,tdw8970|\ - tplink,tdw8980) - wan_mac=$(macaddr_add "$(mtd_get_mac_binary boardconfig 0xf100)" 1) - ;; tplink,vr200|\ tplink,vr200v) wan_mac=$(macaddr_add "$(mtd_get_mac_binary romfile 0xf100)" 1) diff --git a/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom b/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom index eefc39b30b4..164e2d39caa 100644 --- a/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom +++ b/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom @@ -31,10 +31,6 @@ case "$FIRMWARE" in caldata_extract_ubi "caldata" 0x1000 0x1000 ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary_ubi caldata 0x110c) 2) 0x10c ;; - tplink,tdw8970|\ - tplink,tdw8980) - caldata_extract "boardconfig" 0x21000 0x1000 - ;; *) caldata_die "board $board is not supported yet" ;; diff --git a/target/linux/lantiq/xrx200/base-files/etc/uci-defaults/01_led_migration b/target/linux/lantiq/xrx200/base-files/etc/uci-defaults/01_led_migration index 94f9df78bd5..e3f6a98149f 100644 --- a/target/linux/lantiq/xrx200/base-files/etc/uci-defaults/01_led_migration +++ b/target/linux/lantiq/xrx200/base-files/etc/uci-defaults/01_led_migration @@ -18,9 +18,7 @@ do_internet_led_rename() } case "$(board_name)" in -alphanetworks,asl56026|\ arcadyan,arv7519rw22|\ -arcadyan,vg3503j|\ avm,fritz7360sl|\ bt,homehub-v5a) do_internet_led_rename diff --git a/target/linux/lantiq/xrx200_legacy/base-files/etc/board.d/01_leds b/target/linux/lantiq/xrx200_legacy/base-files/etc/board.d/01_leds new file mode 100644 index 00000000000..dec22b51b55 --- /dev/null +++ b/target/linux/lantiq/xrx200_legacy/base-files/etc/board.d/01_leds @@ -0,0 +1,34 @@ +# +# Copyright (C) 2011-2015 OpenWrt.org +# + +. /lib/functions/leds.sh +. /lib/functions/uci-defaults.sh + +board_config_update + +led_wifi="$(get_dt_led wifi)" +[ -n "$led_wifi" ] && ucidef_set_led_wlan "wifi" "wifi" "$led_wifi" "phy0tpt" + +led_dsl="$(get_dt_led dsl)" +[ -n "$led_dsl" ] && { + led_internet="$(get_dt_led internet)" + if [ -n "$led_internet" ]; then + ucidef_set_led_default "dsl" "dsl" "$led_dsl" "0" + ucidef_set_led_netdev "internet" "internet" "$led_internet" "pppoe-wan" + else + ucidef_set_led_netdev "dsl" "dsl" "$led_dsl" "dsl0" + fi +} + +board=$(board_name) + +case "$board" in +netgear,dm200) + ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/lantiq/xrx200_legacy/base-files/etc/board.d/02_network b/target/linux/lantiq/xrx200_legacy/base-files/etc/board.d/02_network new file mode 100644 index 00000000000..9088de86b10 --- /dev/null +++ b/target/linux/lantiq/xrx200_legacy/base-files/etc/board.d/02_network @@ -0,0 +1,75 @@ +# +# Copyright (C) 2011-2015 OpenWrt.org +# + +. /lib/functions/uci-defaults.sh +. /lib/functions/system.sh +. /lib/functions/lantiq.sh + +lantiq_setup_interfaces() +{ + local board="$1" + + case "$board" in + alphanetworks,asl56026|\ + arcadyan,vg3503j) + ucidef_set_interface_lan "lan1 lan2" + ;; + tplink,tdw8970|\ + tplink,tdw8980) + ucidef_set_interface_lan "lan1 lan2 lan3 lan4" + ;; + netgear,dm200) + ucidef_set_interface_lan "lan" + ;; + *) + ucidef_set_interface_lan 'eth0' + ;; + esac +} + +lantiq_setup_dsl() +{ + local board="$1" + local annex="a" + + lantiq_setup_dsl_helper "$annex" +} + +lantiq_setup_macs() +{ + local board="$1" + local lan_mac="" + local wan_mac="" + + case "$board" in + alphanetworks,asl56026) + lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) + wan_mac=$(mtd_get_mac_ascii u-boot-env wanmac) + ;; + arcadyan,vg3503j) + lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) + wan_mac=$(macaddr_add "$lan_mac" 1) + ;; + netgear,dm200) + lan_mac=$(mtd_get_mac_binary ART 0x0) + wan_mac=$(macaddr_add "$lan_mac" 1) + ;; + tplink,tdw8970|\ + tplink,tdw8980) + wan_mac=$(macaddr_add "$(mtd_get_mac_binary boardconfig 0xf100)" 1) + ;; + esac + + [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac" + [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac" +} + +board_config_update +board=$(board_name) +lantiq_setup_interfaces $board +lantiq_setup_dsl $board +lantiq_setup_macs $board +board_config_flush + +exit 0 diff --git a/target/linux/lantiq/xrx200_legacy/base-files/etc/board.d/05_compat-version b/target/linux/lantiq/xrx200_legacy/base-files/etc/board.d/05_compat-version new file mode 100644 index 00000000000..45bef9385bd --- /dev/null +++ b/target/linux/lantiq/xrx200_legacy/base-files/etc/board.d/05_compat-version @@ -0,0 +1,18 @@ +# +# Copyright (C) 2020 OpenWrt.org +# + +. /lib/functions.sh +. /lib/functions/uci-defaults.sh + +board_config_update + +case "$(board_name)" in + *) + ucidef_set_compat_version "1.1" + ;; +esac + +board_config_flush + +exit 0 diff --git a/target/linux/lantiq/xrx200_legacy/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom b/target/linux/lantiq/xrx200_legacy/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom new file mode 100644 index 00000000000..c10065d5d5d --- /dev/null +++ b/target/linux/lantiq/xrx200_legacy/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom @@ -0,0 +1,23 @@ +#!/bin/sh + +[ -e /lib/firmware/$FIRMWARE ] && exit 0 + +. /lib/functions/caldata.sh + +case "$FIRMWARE" in + "ath9k-eeprom-pci-0000:00:0e.0.bin" | \ + "ath9k-eeprom-pci-0000:01:00.0.bin" | \ + "ath9k-eeprom-pci-0000:02:00.0.bin") + board=$(board_name) + + case "$board" in + tplink,tdw8970|\ + tplink,tdw8980) + caldata_extract "boardconfig" 0x21000 0x1000 + ;; + *) + caldata_die "board $board is not supported yet" + ;; + esac + ;; +esac diff --git a/target/linux/lantiq/xrx200_legacy/base-files/etc/uci-defaults/01_led_migration b/target/linux/lantiq/xrx200_legacy/base-files/etc/uci-defaults/01_led_migration new file mode 100644 index 00000000000..f6f11bc5692 --- /dev/null +++ b/target/linux/lantiq/xrx200_legacy/base-files/etc/uci-defaults/01_led_migration @@ -0,0 +1,31 @@ +# +# Copyright (C) 2013 OpenWrt.org +# + +. /lib/functions/migrations.sh + +do_internet_led_rename() +{ + config_load system + + [ -n $(config_get led_internet name) ] || return + [ -z $(config_get led_dsl name) ] || return + + uci rename system.led_internet=led_dsl + uci set system.led_dsl.name=dsl + + logger -t led-migration "internet led renamed to dsl" +} + +case "$(board_name)" in +alphanetworks,asl56026|\ +arcadyan,vg3503j) + do_internet_led_rename + ;; +esac + +remove_devicename_leds + +migrations_apply system + +exit 0 diff --git a/target/linux/lantiq/xrx200_legacy/base-files/lib/upgrade/platform.sh b/target/linux/lantiq/xrx200_legacy/base-files/lib/upgrade/platform.sh new file mode 100755 index 00000000000..9a613c43b1a --- /dev/null +++ b/target/linux/lantiq/xrx200_legacy/base-files/lib/upgrade/platform.sh @@ -0,0 +1,16 @@ +PART_NAME=firmware +REQUIRE_IMAGE_METADATA=1 + +platform_check_image() { + return 0 +} + +platform_do_upgrade() { + local board=$(board_name) + + case "$board" in + *) + default_do_upgrade "$1" + ;; + esac +} diff --git a/target/linux/lantiq/xrx200_legacy/config-6.6 b/target/linux/lantiq/xrx200_legacy/config-6.6 new file mode 100644 index 00000000000..c8650c4e87f --- /dev/null +++ b/target/linux/lantiq/xrx200_legacy/config-6.6 @@ -0,0 +1,86 @@ +CONFIG_AT803X_PHY=y +CONFIG_BLK_MQ_PCI=y +CONFIG_CONTEXT_TRACKING=y +CONFIG_CONTEXT_TRACKING_IDLE=y +CONFIG_CPU_MIPSR2_IRQ_EI=y +CONFIG_CPU_MIPSR2_IRQ_VI=y +CONFIG_CPU_RMAP=y +CONFIG_CRC16=y +CONFIG_CRYPTO_DEFLATE=y +CONFIG_CRYPTO_HASH_INFO=y +CONFIG_CRYPTO_LZO=y +CONFIG_CRYPTO_ZSTD=y +CONFIG_EXTRA_FIRMWARE="lantiq/xrx200_phy11g_a14.bin lantiq/xrx200_phy11g_a22.bin lantiq/xrx200_phy22f_a14.bin lantiq/xrx200_phy22f_a22.bin" +CONFIG_EXTRA_FIRMWARE_DIR="firmware" +CONFIG_GENERIC_ALLOCATOR=y +CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y +CONFIG_GRO_CELLS=y +CONFIG_HWMON=y +CONFIG_HW_RANDOM=y +CONFIG_ICPLUS_PHY=y +CONFIG_IFX_VPE_EXT=y +CONFIG_INPUT=y +CONFIG_INPUT_EVDEV=y +CONFIG_INTEL_XWAY_PHY=y +CONFIG_IRQ_DOMAIN_HIERARCHY=y +# CONFIG_ISDN is not set +CONFIG_LANTIQ_XRX200=y +CONFIG_LZO_COMPRESS=y +CONFIG_LZO_DECOMPRESS=y +CONFIG_MIPS_MT=y +# CONFIG_MIPS_MT_FPAFF is not set +CONFIG_MIPS_MT_SMP=y +CONFIG_MIPS_NR_CPU_NR_MAP=2 +CONFIG_MIPS_PERF_SHARED_TC_COUNTERS=y +CONFIG_MIPS_VPE_APSP_API=y +CONFIG_MIPS_VPE_APSP_API_MT=y +CONFIG_MIPS_VPE_LOADER=y +CONFIG_MIPS_VPE_LOADER_MT=y +CONFIG_MIPS_VPE_LOADER_TOM=y +CONFIG_NEED_SRCU_NMI_SAFE=y +CONFIG_NET_DEVLINK=y +CONFIG_NET_DSA=y +CONFIG_NET_DSA_LANTIQ_GSWIP=y +CONFIG_NET_DSA_TAG_GSWIP=y +CONFIG_NET_FLOW_LIMIT=y +CONFIG_NET_SWITCHDEV=y +CONFIG_NLS=y +CONFIG_NR_CPUS=2 +CONFIG_PADATA=y +CONFIG_PCI=y +CONFIG_PCIEPORTBUS=y +CONFIG_PCIE_LANTIQ=y +CONFIG_PCI_DOMAINS=y +CONFIG_PCI_LANTIQ=y +CONFIG_PHYLINK=y +CONFIG_PHY_LANTIQ_VRX200_PCIE=y +CONFIG_POWER_RESET_GPIO=y +CONFIG_POWER_SUPPLY=y +CONFIG_POWER_SUPPLY_HWMON=y +CONFIG_QCOM_NET_PHYLIB=y +CONFIG_QUEUED_RWLOCKS=y +CONFIG_QUEUED_SPINLOCKS=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y +CONFIG_RFS_ACCEL=y +CONFIG_RPS=y +CONFIG_SENSORS_LTQ_CPUTEMP=y +CONFIG_SGL_ALLOC=y +CONFIG_SMP=y +CONFIG_SMP_UP=y +CONFIG_SOCK_RX_QUEUE_MAPPING=y +CONFIG_SYNC_R4K=y +CONFIG_SYS_SUPPORTS_SCHED_SMT=y +CONFIG_SYS_SUPPORTS_SMP=y +CONFIG_TREE_RCU=y +CONFIG_TREE_SRCU=y +CONFIG_USB=y +CONFIG_USB_COMMON=y +CONFIG_USB_SUPPORT=y +CONFIG_XPS=y +CONFIG_XXHASH=y +CONFIG_ZLIB_DEFLATE=y +CONFIG_ZLIB_INFLATE=y +CONFIG_ZSTD_COMMON=y +CONFIG_ZSTD_COMPRESS=y +CONFIG_ZSTD_DECOMPRESS=y diff --git a/target/linux/lantiq/xrx200_legacy/profiles/00-default.mk b/target/linux/lantiq/xrx200_legacy/profiles/00-default.mk new file mode 100644 index 00000000000..26bc8b502b0 --- /dev/null +++ b/target/linux/lantiq/xrx200_legacy/profiles/00-default.mk @@ -0,0 +1,9 @@ +define Profile/Default + NAME:=Default Profile + PRIORITY:=1 +endef + +define Profile/Default/Description + Default package set compatible with most boards. +endef +$(eval $(call Profile,Default)) diff --git a/target/linux/lantiq/xrx200_legacy/target.mk b/target/linux/lantiq/xrx200_legacy/target.mk new file mode 100644 index 00000000000..d9a6fff651b --- /dev/null +++ b/target/linux/lantiq/xrx200_legacy/target.mk @@ -0,0 +1,22 @@ +ARCH:=mips +SUBTARGET:=xrx200_legacy +BOARDNAME:=XRX200 Legacy +FEATURES+=atm ramdisk small_flash +CPU_TYPE:=24kc + +DEFAULT_PACKAGES+=kmod-leds-gpio \ + kmod-gpio-button-hotplug \ + ltq-vdsl-vr9-vectoring-fw-installer \ + kmod-ltq-vdsl-vr9-mei \ + kmod-ltq-vdsl-vr9 \ + kmod-ltq-atm-vr9 \ + kmod-ltq-deu-vr9 \ + kmod-ltq-ptm-vr9 \ + ltq-vdsl-vr9-app \ + dsl-vrx200-firmware-xdsl-a \ + dsl-vrx200-firmware-xdsl-b-patch \ + ppp-mod-pppoa + +define Target/Description + Lantiq XRX200 Legacy for boards with small flash +endef From f71ce1c34e43a1722eeadefa89324b23d0463022 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 15 Dec 2024 23:58:27 +0000 Subject: [PATCH 071/149] mediatek: add pending patches fixing video output on MT7623N Add a bunch of fixes for HDMI output and Mali-450 GPU rendering on MT7623N, ie. the BananaPi R2. Signed-off-by: Daniel Golle --- ...701-vdec-fix-conversion-to-mtk_clk_s.patch | 56 +++++++++++ ...701-aud-fix-conversion-to-mtk_clk_si.patch | 92 +++++++++++++++++++ ...tek-mt2701-bdp-add-missing-dummy-clk.patch | 55 +++++++++++ ...atek-mt2701-mm-add-missing-dummy-clk.patch | 56 +++++++++++ ...tek-mt2701-img-add-missing-dummy-clk.patch | 55 +++++++++++ ...y-touch-DISP_REG_OVL_PITCH_MSB-if-AF.patch | 70 ++++++++++++++ 6 files changed, 384 insertions(+) create mode 100644 target/linux/mediatek/patches-6.6/256-clk-mediatek-mt2701-vdec-fix-conversion-to-mtk_clk_s.patch create mode 100644 target/linux/mediatek/patches-6.6/257-clk-mediatek-mt2701-aud-fix-conversion-to-mtk_clk_si.patch create mode 100644 target/linux/mediatek/patches-6.6/258-clk-mediatek-mt2701-bdp-add-missing-dummy-clk.patch create mode 100644 target/linux/mediatek/patches-6.6/259-clk-mediatek-mt2701-mm-add-missing-dummy-clk.patch create mode 100644 target/linux/mediatek/patches-6.6/260-clk-mediatek-mt2701-img-add-missing-dummy-clk.patch create mode 100644 target/linux/mediatek/patches-6.6/870-drm-mediatek-only-touch-DISP_REG_OVL_PITCH_MSB-if-AF.patch diff --git a/target/linux/mediatek/patches-6.6/256-clk-mediatek-mt2701-vdec-fix-conversion-to-mtk_clk_s.patch b/target/linux/mediatek/patches-6.6/256-clk-mediatek-mt2701-vdec-fix-conversion-to-mtk_clk_s.patch new file mode 100644 index 00000000000..e2aed0126f4 --- /dev/null +++ b/target/linux/mediatek/patches-6.6/256-clk-mediatek-mt2701-vdec-fix-conversion-to-mtk_clk_s.patch @@ -0,0 +1,56 @@ +From patchwork Sun Dec 15 22:13:49 2024 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Daniel Golle +X-Patchwork-Id: 13909005 +Date: Sun, 15 Dec 2024 22:13:49 +0000 +From: Daniel Golle +To: Michael Turquette , + Stephen Boyd , Matthias Brugger , + AngeloGioacchino Del Regno , + Alexandre Mergnat , + Geert Uytterhoeven , + Daniel Golle , + Uwe =?iso-8859-1?q?Kleine-K=F6nig?= , + Miles Chen , Chen-Yu Tsai , + Frank Wunderlich , John Crispin , + linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, + stable@vger.kernel.org +Subject: [PATCH 1/5] clk: mediatek: mt2701-vdec: fix conversion to + mtk_clk_simple_probe +Message-ID: + +Precedence: bulk +X-Mailing-List: linux-clk@vger.kernel.org +List-Id: +List-Subscribe: +List-Unsubscribe: +MIME-Version: 1.0 +Content-Disposition: inline + +Commit 973d1607d936 ("clk: mediatek: mt2701: use mtk_clk_simple_probe to +simplify driver") broke DT bindings as the highest index was reduced by +1 because the id count starts from 1 and not from 0. + +Fix this, like for other drivers which had the same issue, by adding a +dummy clk at index 0. + +Fixes: 973d1607d936 ("clk: mediatek: mt2701: use mtk_clk_simple_probe to simplify driver") +Cc: stable@vger.kernel.org +Signed-off-by: Daniel Golle +--- + drivers/clk/mediatek/clk-mt2701-vdec.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/clk/mediatek/clk-mt2701-vdec.c ++++ b/drivers/clk/mediatek/clk-mt2701-vdec.c +@@ -31,6 +31,7 @@ static const struct mtk_gate_regs vdec1_ + GATE_MTK(_id, _name, _parent, &vdec1_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv) + + static const struct mtk_gate vdec_clks[] = { ++ GATE_DUMMY(CLK_DUMMY, "vdec_dummy"), + GATE_VDEC0(CLK_VDEC_CKGEN, "vdec_cken", "vdec_sel", 0), + GATE_VDEC1(CLK_VDEC_LARB, "vdec_larb_cken", "mm_sel", 0), + }; diff --git a/target/linux/mediatek/patches-6.6/257-clk-mediatek-mt2701-aud-fix-conversion-to-mtk_clk_si.patch b/target/linux/mediatek/patches-6.6/257-clk-mediatek-mt2701-aud-fix-conversion-to-mtk_clk_si.patch new file mode 100644 index 00000000000..5d31aec0be7 --- /dev/null +++ b/target/linux/mediatek/patches-6.6/257-clk-mediatek-mt2701-aud-fix-conversion-to-mtk_clk_si.patch @@ -0,0 +1,92 @@ +From patchwork Sun Dec 15 22:14:11 2024 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Daniel Golle +X-Patchwork-Id: 13909006 +Date: Sun, 15 Dec 2024 22:14:11 +0000 +From: Daniel Golle +To: Michael Turquette , + Stephen Boyd , Matthias Brugger , + AngeloGioacchino Del Regno , + Alexandre Mergnat , + Geert Uytterhoeven , + Daniel Golle , + Uwe =?iso-8859-1?q?Kleine-K=F6nig?= , + Miles Chen , Chen-Yu Tsai , + Frank Wunderlich , John Crispin , + linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, + stable@vger.kernel.org +Subject: [PATCH 2/5] clk: mediatek: mt2701-aud: fix conversion to + mtk_clk_simple_probe +Message-ID: + +References: + +Precedence: bulk +X-Mailing-List: linux-clk@vger.kernel.org +List-Id: +List-Subscribe: +List-Unsubscribe: +MIME-Version: 1.0 +Content-Disposition: inline +In-Reply-To: + + +Some of the audio subsystem clocks defined in clk-mt2701.h aren't +actually used by the driver. This broke conversion to +mtk_clk_simple_probe which expects that the highest possible clk id is +defined by the ARRAY_SIZE. + +Add additional dummy clocks to fill the gaps and remain compatible with +the existing DT bindings. + +Fixes: 0f69a423c458 ("clk: mediatek: Switch to mtk_clk_simple_probe() where possible") +Cc: stable@vger.kernel.org +Signed-off-by: Daniel Golle +--- + drivers/clk/mediatek/clk-mt2701-aud.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/clk/mediatek/clk-mt2701-aud.c ++++ b/drivers/clk/mediatek/clk-mt2701-aud.c +@@ -55,10 +55,16 @@ static const struct mtk_gate audio_clks[ + GATE_DUMMY(CLK_DUMMY, "aud_dummy"), + /* AUDIO0 */ + GATE_AUDIO0(CLK_AUD_AFE, "audio_afe", "aud_intbus_sel", 2), ++ GATE_DUMMY(CLK_AUD_LRCK_DETECT, "audio_lrck_detect_dummy"), ++ GATE_DUMMY(CLK_AUD_I2S, "audio_i2c_dummy"), ++ GATE_DUMMY(CLK_AUD_APLL_TUNER, "audio_apll_tuner_dummy"), + GATE_AUDIO0(CLK_AUD_HDMI, "audio_hdmi", "audpll_sel", 20), + GATE_AUDIO0(CLK_AUD_SPDF, "audio_spdf", "audpll_sel", 21), + GATE_AUDIO0(CLK_AUD_SPDF2, "audio_spdf2", "audpll_sel", 22), + GATE_AUDIO0(CLK_AUD_APLL, "audio_apll", "audpll_sel", 23), ++ GATE_DUMMY(CLK_AUD_TML, "audio_tml_dummy"), ++ GATE_DUMMY(CLK_AUD_AHB_IDLE_EXT, "audio_ahb_idle_ext_dummy"), ++ GATE_DUMMY(CLK_AUD_AHB_IDLE_INT, "audio_ahb_idle_int_dummy"), + /* AUDIO1 */ + GATE_AUDIO1(CLK_AUD_I2SIN1, "audio_i2sin1", "aud_mux1_sel", 0), + GATE_AUDIO1(CLK_AUD_I2SIN2, "audio_i2sin2", "aud_mux1_sel", 1), +@@ -76,10 +82,12 @@ static const struct mtk_gate audio_clks[ + GATE_AUDIO1(CLK_AUD_ASRCI2, "audio_asrci2", "asm_h_sel", 13), + GATE_AUDIO1(CLK_AUD_ASRCO1, "audio_asrco1", "asm_h_sel", 14), + GATE_AUDIO1(CLK_AUD_ASRCO2, "audio_asrco2", "asm_h_sel", 15), ++ GATE_DUMMY(CLK_AUD_HDMIRX, "audio_hdmirx_dummy"), + GATE_AUDIO1(CLK_AUD_INTDIR, "audio_intdir", "intdir_sel", 20), + GATE_AUDIO1(CLK_AUD_A1SYS, "audio_a1sys", "aud_mux1_sel", 21), + GATE_AUDIO1(CLK_AUD_A2SYS, "audio_a2sys", "aud_mux2_sel", 22), + GATE_AUDIO1(CLK_AUD_AFE_CONN, "audio_afe_conn", "aud_mux1_sel", 23), ++ GATE_DUMMY(CLK_AUD_AFE_PCMIF, "audio_afe_pcmif_dummy"), + GATE_AUDIO1(CLK_AUD_AFE_MRGIF, "audio_afe_mrgif", "aud_mux1_sel", 25), + /* AUDIO2 */ + GATE_AUDIO2(CLK_AUD_MMIF_UL1, "audio_ul1", "aud_mux1_sel", 0), +@@ -100,6 +108,8 @@ static const struct mtk_gate audio_clks[ + GATE_AUDIO2(CLK_AUD_MMIF_AWB2, "audio_awb2", "aud_mux1_sel", 15), + GATE_AUDIO2(CLK_AUD_MMIF_DAI, "audio_dai", "aud_mux1_sel", 16), + /* AUDIO3 */ ++ GATE_DUMMY(CLK_AUD_DMIC1, "audio_dmic1_dummy"), ++ GATE_DUMMY(CLK_AUD_DMIC2, "audio_dmic2_dummy"), + GATE_AUDIO3(CLK_AUD_ASRCI3, "audio_asrci3", "asm_h_sel", 2), + GATE_AUDIO3(CLK_AUD_ASRCI4, "audio_asrci4", "asm_h_sel", 3), + GATE_AUDIO3(CLK_AUD_ASRCI5, "audio_asrci5", "asm_h_sel", 4), diff --git a/target/linux/mediatek/patches-6.6/258-clk-mediatek-mt2701-bdp-add-missing-dummy-clk.patch b/target/linux/mediatek/patches-6.6/258-clk-mediatek-mt2701-bdp-add-missing-dummy-clk.patch new file mode 100644 index 00000000000..0542bcae4ee --- /dev/null +++ b/target/linux/mediatek/patches-6.6/258-clk-mediatek-mt2701-bdp-add-missing-dummy-clk.patch @@ -0,0 +1,55 @@ +From patchwork Sun Dec 15 22:14:24 2024 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Daniel Golle +X-Patchwork-Id: 13909007 +Date: Sun, 15 Dec 2024 22:14:24 +0000 +From: Daniel Golle +To: Michael Turquette , + Stephen Boyd , Matthias Brugger , + AngeloGioacchino Del Regno , + Alexandre Mergnat , + Geert Uytterhoeven , + Daniel Golle , + Uwe =?iso-8859-1?q?Kleine-K=F6nig?= , + Miles Chen , Chen-Yu Tsai , + Frank Wunderlich , John Crispin , + linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, + stable@vger.kernel.org +Subject: [PATCH 3/5] clk: mediatek: mt2701-bdp: add missing dummy clk +Message-ID: + +References: + +Precedence: bulk +X-Mailing-List: linux-clk@vger.kernel.org +List-Id: +List-Subscribe: +List-Unsubscribe: +MIME-Version: 1.0 +Content-Disposition: inline +In-Reply-To: + + +Add dummy clk for index 0 which was missed during the conversion to +mtk_clk_simple_probe(). + +Fixes: 973d1607d936 ("clk: mediatek: mt2701: use mtk_clk_simple_probe to simplify driver") +Cc: stable@vger.kernel.org +Signed-off-by: Daniel Golle +--- + drivers/clk/mediatek/clk-mt2701-bdp.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/clk/mediatek/clk-mt2701-bdp.c ++++ b/drivers/clk/mediatek/clk-mt2701-bdp.c +@@ -31,6 +31,7 @@ static const struct mtk_gate_regs bdp1_c + GATE_MTK(_id, _name, _parent, &bdp1_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv) + + static const struct mtk_gate bdp_clks[] = { ++ GATE_DUMMY(CLK_DUMMY, "bdp_dummy"), + GATE_BDP0(CLK_BDP_BRG_BA, "brg_baclk", "mm_sel", 0), + GATE_BDP0(CLK_BDP_BRG_DRAM, "brg_dram", "mm_sel", 1), + GATE_BDP0(CLK_BDP_LARB_DRAM, "larb_dram", "mm_sel", 2), diff --git a/target/linux/mediatek/patches-6.6/259-clk-mediatek-mt2701-mm-add-missing-dummy-clk.patch b/target/linux/mediatek/patches-6.6/259-clk-mediatek-mt2701-mm-add-missing-dummy-clk.patch new file mode 100644 index 00000000000..526fdd9d1a2 --- /dev/null +++ b/target/linux/mediatek/patches-6.6/259-clk-mediatek-mt2701-mm-add-missing-dummy-clk.patch @@ -0,0 +1,56 @@ +From patchwork Sun Dec 15 22:14:34 2024 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Daniel Golle +X-Patchwork-Id: 13909008 +Date: Sun, 15 Dec 2024 22:14:34 +0000 +From: Daniel Golle +To: Michael Turquette , + Stephen Boyd , Matthias Brugger , + AngeloGioacchino Del Regno , + Alexandre Mergnat , + Geert Uytterhoeven , + Daniel Golle , + Uwe =?iso-8859-1?q?Kleine-K=F6nig?= , + Miles Chen , Chen-Yu Tsai , + Frank Wunderlich , John Crispin , + linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, + stable@vger.kernel.org +Subject: [PATCH 4/5] clk: mediatek: mt2701-mm: add missing dummy clk +Message-ID: + <9de23440fcba1ffef9e77d58c9f505105e57a250.1734300668.git.daniel@makrotopia.org> +References: + +Precedence: bulk +X-Mailing-List: linux-clk@vger.kernel.org +List-Id: +List-Subscribe: +List-Unsubscribe: +MIME-Version: 1.0 +Content-Disposition: inline +In-Reply-To: + + +Add dummy clk which was missed during the conversion to +mtk_clk_pdev_probe() and is required for the existing DT bindings to +keep working. + +Fixes: 65c10c50c9c7 ("clk: mediatek: Migrate to mtk_clk_pdev_probe() for multimedia clocks") +Cc: stable@vger.kernel.org +Signed-off-by: Daniel Golle +--- + drivers/clk/mediatek/clk-mt2701-mm.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/clk/mediatek/clk-mt2701-mm.c ++++ b/drivers/clk/mediatek/clk-mt2701-mm.c +@@ -31,6 +31,7 @@ static const struct mtk_gate_regs disp1_ + GATE_MTK(_id, _name, _parent, &disp1_cg_regs, _shift, &mtk_clk_gate_ops_setclr) + + static const struct mtk_gate mm_clks[] = { ++ GATE_DUMMY(CLK_DUMMY, "mm_dummy"), + GATE_DISP0(CLK_MM_SMI_COMMON, "mm_smi_comm", "mm_sel", 0), + GATE_DISP0(CLK_MM_SMI_LARB0, "mm_smi_larb0", "mm_sel", 1), + GATE_DISP0(CLK_MM_CMDQ, "mm_cmdq", "mm_sel", 2), diff --git a/target/linux/mediatek/patches-6.6/260-clk-mediatek-mt2701-img-add-missing-dummy-clk.patch b/target/linux/mediatek/patches-6.6/260-clk-mediatek-mt2701-img-add-missing-dummy-clk.patch new file mode 100644 index 00000000000..a86f158106f --- /dev/null +++ b/target/linux/mediatek/patches-6.6/260-clk-mediatek-mt2701-img-add-missing-dummy-clk.patch @@ -0,0 +1,55 @@ +From patchwork Sun Dec 15 22:14:48 2024 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Daniel Golle +X-Patchwork-Id: 13909009 +Date: Sun, 15 Dec 2024 22:14:48 +0000 +From: Daniel Golle +To: Michael Turquette , + Stephen Boyd , Matthias Brugger , + AngeloGioacchino Del Regno , + Alexandre Mergnat , + Geert Uytterhoeven , + Daniel Golle , + Uwe =?iso-8859-1?q?Kleine-K=F6nig?= , + Miles Chen , Chen-Yu Tsai , + Frank Wunderlich , John Crispin , + linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, + stable@vger.kernel.org +Subject: [PATCH 5/5] clk: mediatek: mt2701-img: add missing dummy clk +Message-ID: + +References: + +Precedence: bulk +X-Mailing-List: linux-clk@vger.kernel.org +List-Id: +List-Subscribe: +List-Unsubscribe: +MIME-Version: 1.0 +Content-Disposition: inline +In-Reply-To: + + +Add dummy clk for index 0 which was missed during the conversion to +mtk_clk_simple_probe(). + +Fixes: 973d1607d936 ("clk: mediatek: mt2701: use mtk_clk_simple_probe to simplify driver") +Cc: stable@vger.kernel.org +Signed-off-by: Daniel Golle +--- + drivers/clk/mediatek/clk-mt2701-img.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/clk/mediatek/clk-mt2701-img.c ++++ b/drivers/clk/mediatek/clk-mt2701-img.c +@@ -22,6 +22,7 @@ static const struct mtk_gate_regs img_cg + GATE_MTK(_id, _name, _parent, &img_cg_regs, _shift, &mtk_clk_gate_ops_setclr) + + static const struct mtk_gate img_clks[] = { ++ GATE_DUMMY(CLK_DUMMY, "img_dummy"), + GATE_IMG(CLK_IMG_SMI_COMM, "img_smi_comm", "mm_sel", 0), + GATE_IMG(CLK_IMG_RESZ, "img_resz", "mm_sel", 1), + GATE_IMG(CLK_IMG_JPGDEC_SMI, "img_jpgdec_smi", "mm_sel", 5), diff --git a/target/linux/mediatek/patches-6.6/870-drm-mediatek-only-touch-DISP_REG_OVL_PITCH_MSB-if-AF.patch b/target/linux/mediatek/patches-6.6/870-drm-mediatek-only-touch-DISP_REG_OVL_PITCH_MSB-if-AF.patch new file mode 100644 index 00000000000..4aea9e034ce --- /dev/null +++ b/target/linux/mediatek/patches-6.6/870-drm-mediatek-only-touch-DISP_REG_OVL_PITCH_MSB-if-AF.patch @@ -0,0 +1,70 @@ +From patchwork Sun Dec 15 22:09:41 2024 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Daniel Golle +X-Patchwork-Id: 13908995 +Return-Path: + +Date: Sun, 15 Dec 2024 22:09:41 +0000 +From: Daniel Golle +To: Chun-Kuang Hu , + Philipp Zabel , + David Airlie , Simona Vetter , + Matthias Brugger , + AngeloGioacchino Del Regno , + Justin Green , + Frank Wunderlich , + John Crispin , dri-devel@lists.freedesktop.org, + linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org +Subject: [PATCH] drm/mediatek: only touch DISP_REG_OVL_PITCH_MSB if AFBC is + supported +Message-ID: + <8c001c8e70d93d64d3ee6bf7dc5078d2783d4e32.1734300345.git.daniel@makrotopia.org> +MIME-Version: 1.0 +Content-Disposition: inline +X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 +X-CRM114-CacheID: sfid-20241215_140959_910539_20C140B3 +X-CRM114-Status: UNSURE ( 9.48 ) +X-CRM114-Notice: Please train this message. +X-BeenThere: linux-mediatek@lists.infradead.org +X-Mailman-Version: 2.1.34 +Precedence: list +List-Id: +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +Sender: "Linux-mediatek" +Errors-To: + linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org + +Touching DISP_REG_OVL_PITCH_MSB leads to video overlay on MT2701, MT7623N +and probably other older SoCs being broken. + +Only touching it on hardware which actually supports AFBC like it was +before commit c410fa9b07c3 ("drm/mediatek: Add AFBC support to Mediatek +DRM driver") fixes it. + +Fixes: c410fa9b07c3 ("drm/mediatek: Add AFBC support to Mediatek DRM driver") +Cc: stable@vger.kernel.org +Signed-off-by: Daniel Golle +--- + drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c ++++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c +@@ -478,7 +478,7 @@ void mtk_ovl_layer_config(struct device + &ovl->cmdq_reg, ovl->regs, DISP_REG_OVL_PITCH_MSB(idx)); + mtk_ddp_write_relaxed(cmdq_pkt, hdr_pitch, &ovl->cmdq_reg, ovl->regs, + DISP_REG_OVL_HDR_PITCH(ovl, idx)); +- } else { ++ } else if (ovl->data->supports_afbc) { + mtk_ddp_write_relaxed(cmdq_pkt, + overlay_pitch.split_pitch.msb, + &ovl->cmdq_reg, ovl->regs, DISP_REG_OVL_PITCH_MSB(idx)); From 0634ebed9f74dca6d008b00f9fa00cc1220fa425 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 14 Dec 2024 14:26:25 -0800 Subject: [PATCH 072/149] ath79: fix tl-wa eth1 mac This is using mac-base and so a 0 needs to be added. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/17274 Signed-off-by: Robert Marko --- target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi b/target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi index 1f46e77423c..94d2570c6c1 100644 --- a/target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi +++ b/target/linux/ath79/dts/ar7240_tplink_tl-wa.dtsi @@ -17,7 +17,7 @@ }; ð1 { - nvmem-cells = <&macaddr_uboot_1fc00>; + nvmem-cells = <&macaddr_uboot_1fc00 0>; nvmem-cell-names = "mac-address"; }; From af1740a28b63ecc6683dceb249a1f75af5e9098d Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 16 Dec 2024 13:03:26 +0100 Subject: [PATCH 073/149] unetd: update to Git HEAD (2024-12-16) d22d7db581d5 bpf_skb_utils.h: add missing include to fix build against newer kernel headers bbd3e0eb1419 host: fix peer routes on a node acting as gateway b17164751fc7 unet-tool: add support for generating keys from salt + seed passphrase 041e05870c20 unet-tool: add support for dumping pubkey from signed file b58920d420cb unet-tool: add support for extracting network data from signed bin file f335f5b40b4e unet-cli: add support for generating key from seed 8b1f1d099352 unet-cli: add support for importing networks from signed data 188ba05eadf2 unet-cli: add missing command line help for import 8f15fc306a40 unet-cli: fix add-ssh-host with seed keys 486bc3b86dc2 pex-msg: enable broadcast for global PEX socket e4a24cdfbc1c unet-cli: fix defaults on create Signed-off-by: Felix Fietkau --- package/network/services/unetd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/services/unetd/Makefile b/package/network/services/unetd/Makefile index 018f6b8ea97..7b0bd3c6e7b 100644 --- a/package/network/services/unetd/Makefile +++ b/package/network/services/unetd/Makefile @@ -10,9 +10,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=unetd PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/unetd.git -PKG_SOURCE_DATE:=2024-03-31 -PKG_SOURCE_VERSION:=806457664ab6e952a7f4febb82e891f596fe577c -PKG_MIRROR_HASH:=f469d65fd83721a8da0e5253d1ba871a6734233da6f23b631009b17b3af82455 +PKG_SOURCE_DATE:=2024-12-16 +PKG_SOURCE_VERSION:=e4a24cdfbc1cbdb38f1958440f2a06529df1c7f4 +PKG_MIRROR_HASH:=1959170b25be07b06c198bfd1e072b7ed19b930faad0e886acb6b0d719d25ed1 PKG_LICENSE:=GPL-2.0 PKG_MAINTAINER:=Felix Fietkau From 8a7239009c5f4b28b696042b70ed1f8f89902915 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Sun, 17 Nov 2024 22:47:27 +0100 Subject: [PATCH 074/149] kirkwood: Make the Marvell DSA switch a module Not all Kirkwood systems have the Marvell MV88E6XXX switches. Drop those from the generic config and add them as modules in the systems that have it. This was inferred by inspecting the upstream DTS files for any mv88e* strings and adding the mv88e6xxx kmod package to those that have an upstream device tree with an MV88E6xxx switch and an OpenWrt image target. Signed-off-by: Linus Walleij --- target/linux/kirkwood/config-6.6 | 4 ---- target/linux/kirkwood/image/Makefile | 8 +++++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/target/linux/kirkwood/config-6.6 b/target/linux/kirkwood/config-6.6 index 751d3e6a1b4..e3341523802 100644 --- a/target/linux/kirkwood/config-6.6 +++ b/target/linux/kirkwood/config-6.6 @@ -192,10 +192,6 @@ CONFIG_NEED_KUSER_HELPERS=y CONFIG_NEED_PER_CPU_KM=y CONFIG_NET_DEVLINK=y CONFIG_NET_DSA=y -CONFIG_NET_DSA_MV88E6XXX=y -CONFIG_NET_DSA_TAG_DSA=y -CONFIG_NET_DSA_TAG_DSA_COMMON=y -CONFIG_NET_DSA_TAG_EDSA=y CONFIG_NET_EGRESS=y CONFIG_NET_INGRESS=y CONFIG_NET_SELFTESTS=y diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile index eaced926577..cd9390b62a5 100644 --- a/target/linux/kirkwood/image/Makefile +++ b/target/linux/kirkwood/image/Makefile @@ -132,7 +132,8 @@ define Device/checkpoint_l-50 DEVICE_VENDOR := Check Point DEVICE_MODEL := L-50 DEVICE_PACKAGES := kmod-ath9k kmod-gpio-button-hotplug kmod-mvsdio \ - kmod-rtc-s35390a kmod-usb-ledtrig-usbport wpad-basic-mbedtls + kmod-rtc-s35390a kmod-usb-ledtrig-usbport wpad-basic-mbedtls \ + kmod-dsa-mv88e6xxx IMAGES := sysupgrade.bin endef TARGET_DEVICES += checkpoint_l-50 @@ -193,7 +194,8 @@ define Device/endian_4i-edge-200 DEVICE_MODEL := 4i Edge 200 DEVICE_ALT0_VENDOR := Endian DEVICE_ALT0_MODEL := UTM Mini Firewall - DEVICE_PACKAGES := kmod-ath9k kmod-mvsdio wpad-basic-mbedtls kmod-rtc-mv + DEVICE_PACKAGES := kmod-ath9k kmod-mvsdio wpad-basic-mbedtls kmod-rtc-mv \ + kmod-dsa-mv88e6xxx KERNEL_SIZE := 4096k IMAGES := sysupgrade.bin endef @@ -273,7 +275,7 @@ define Device/linksys $(Device/kernel-size-migration-linksys) DEVICE_VENDOR := Linksys DEVICE_PACKAGES := kmod-mwl8k wpad-basic-mbedtls kmod-gpio-button-hotplug \ - kmod-rtc-mv + kmod-rtc-mv kmod-dsa-mv88e6xxx KERNEL_IN_UBI := KERNEL_SIZE := 4096k UBINIZE_OPTS := -E 5 From f8a16524c4a4070d61a32f6203ea5e26cea125d4 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 17 Dec 2024 14:51:18 +0100 Subject: [PATCH 075/149] unetd: add firewall input rule for global port Ensure that peers can be exchanged over any interface Signed-off-by: Felix Fietkau --- package/network/services/unetd/files/unetd.init | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/package/network/services/unetd/files/unetd.init b/package/network/services/unetd/files/unetd.init index c1124821ee8..7c980e3d0d5 100644 --- a/package/network/services/unetd/files/unetd.init +++ b/package/network/services/unetd/files/unetd.init @@ -13,5 +13,20 @@ start_service() { procd_set_param command "$PROG" -h /var/run/unetd/hosts -u /var/run/unetd/socket procd_set_param respawn procd_set_param limits core="unlimited" + + procd_open_data + json_add_array firewall + + json_add_object "" + json_add_string type rule + json_add_string proto udp + json_add_string src "*" + json_add_int dest_port 51819 + json_add_string target ACCEPT + json_close_object + + json_close_array + procd_close_data + procd_close_instance } From 53e312e19313dd738eabed3a4af5fb42a8f9e8fb Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 17 Dec 2024 20:01:13 +0100 Subject: [PATCH 076/149] netifd: update to Git HEAD (2024-12-17) 058a099f5bc5 interface: fix memleak and reload issue for the zone attribute ea01ed41f321 interface: remove unnecessary NULL checks before free() Signed-off-by: Felix Fietkau --- package/network/config/netifd/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index 95f1f6f7d11..c327f061136 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -1,13 +1,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=netifd -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git -PKG_SOURCE_DATE:=2024-11-27 -PKG_SOURCE_VERSION:=768027c5a7640137857f412f554227abd6160cdd -PKG_MIRROR_HASH:=5f74dc10470c64b42caa2d1fda3b80672293cf39676aa5c0b9f8c89880a15270 +PKG_SOURCE_DATE:=2024-12-17 +PKG_SOURCE_VERSION:=ea01ed41f3212ecbe000422f3c122a01b93fe874 +PKG_MIRROR_HASH:=dbaad26c1f9b15d0caff6ccdf80d85b34d96bda72cbd2b1dc188a04136d96c28 PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 From 3d900bd055b5d8f07a879c9c8c4f7783d35dd4ba Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 17 Dec 2024 21:53:36 +0100 Subject: [PATCH 077/149] procd: update to Git HEAD (2024-12-17) 2e206dbe77ec service: add support for triggers on service/instance data changes 735b48728fca service: remove leftover lines from previous commit 32469644a029 service: allow incremental changes to service properties fd01fb852302 service: fix double free bug when dealing with data Signed-off-by: Felix Fietkau --- package/system/procd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index 70df481a228..7a2276a46d1 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git -PKG_MIRROR_HASH:=2c9eb493618e3a695d329cbf7379a165d4c2366a6e00edc63db3271aa059a294 -PKG_SOURCE_DATE:=2024-12-11 -PKG_SOURCE_VERSION:=e2f05deb93949f447d397e8cd3a341bc8e53cd38 +PKG_MIRROR_HASH:=99139ce325d73f5b250d115703540acfac3bcdc8ee202f2d3aacf3083042bc70 +PKG_SOURCE_DATE:=2024-12-17 +PKG_SOURCE_VERSION:=fd01fb852302a2683d09ee1c2193d7c51e2b0ba8 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 From 8c5826b140b6288b9270d232ecda0d540e380d4e Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 17 Dec 2024 21:21:37 +0100 Subject: [PATCH 078/149] procd: do not overwrite service data by default Allows a running servie to manage its own data if untouched by the init script Signed-off-by: Felix Fietkau --- package/base-files/files/etc/rc.common | 4 ---- package/system/procd/files/procd.sh | 8 +++++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common index d7473038444..abf72ea3372 100755 --- a/package/base-files/files/etc/rc.common +++ b/package/base-files/files/etc/rc.common @@ -100,10 +100,6 @@ service_triggers() { return 0 } -service_data() { - return 0 -} - service_running() { local instance="${1:-*}" diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh index 5dc8ec42b7a..59e002036d9 100644 --- a/package/system/procd/files/procd.sh +++ b/package/system/procd/files/procd.sh @@ -101,9 +101,11 @@ _procd_close_service() { _procd_open_trigger service_triggers _procd_close_trigger - _procd_open_data - service_data - _procd_close_data + type service_data >/dev/null 2>&1 && { + _procd_open_data + service_data + _procd_close_data + } _procd_ubus_call ${1:-set} } From 49d92d3e933c45e3684da2fbf0a198d195635581 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 17 Dec 2024 21:54:14 +0100 Subject: [PATCH 079/149] procd: add support for reload triggers on data change This can be useful to reload the firewall when procd firewall data changes Signed-off-by: Felix Fietkau --- package/system/procd/files/procd.sh | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/package/system/procd/files/procd.sh b/package/system/procd/files/procd.sh index 59e002036d9..0f9405a2220 100644 --- a/package/system/procd/files/procd.sh +++ b/package/system/procd/files/procd.sh @@ -308,6 +308,36 @@ _procd_add_reload_interface_trigger() { _procd_close_trigger } +_procd_add_data_trigger() { + json_add_array + _procd_add_array_data "service.data.update" + + json_add_array + _procd_add_array_data "if" + + json_add_array + _procd_add_array_data "eq" "name" "$1" + shift + json_close_array + + json_add_array + _procd_add_array_data "run_script" "$@" + json_close_array + + json_close_array + _procd_add_timeout + json_close_array +} + +_procd_add_reload_data_trigger() { + local script=$(readlink "$initscript") + local name=$(basename ${script:-$initscript}) + + _procd_open_trigger + _procd_add_data_trigger $1 /etc/init.d/$name reload + _procd_close_trigger +} + _procd_add_config_trigger() { json_add_array _procd_add_array_data "$1" @@ -661,6 +691,7 @@ _procd_wrapper \ procd_add_interface_trigger \ procd_add_mount_trigger \ procd_add_reload_trigger \ + procd_add_reload_data_trigger \ procd_add_reload_interface_trigger \ procd_add_action_mount_trigger \ procd_add_reload_mount_trigger \ From f077e058fd485ab87f0995351a3ddc0a009e4593 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 17 Dec 2024 21:57:44 +0100 Subject: [PATCH 080/149] unetd: update to Git HEAD (2024-12-17) 93461ca4c827 unet-cli: only apply defaults on create 3e5766783d5d unet-tool: add support for confirming password 074d3659ca4a unet-cli: confirm password when creating new seed based key bf3488a3807a unet-cli: add add/set-local-host command 9eb57c528461 unet-cli: add support for setting interface zone a0a2d80f3459 ubus: add firewall rules for network port/pex_port via procd Signed-off-by: Felix Fietkau --- package/network/services/unetd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/services/unetd/Makefile b/package/network/services/unetd/Makefile index 7b0bd3c6e7b..c3875219985 100644 --- a/package/network/services/unetd/Makefile +++ b/package/network/services/unetd/Makefile @@ -10,9 +10,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=unetd PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/unetd.git -PKG_SOURCE_DATE:=2024-12-16 -PKG_SOURCE_VERSION:=e4a24cdfbc1cbdb38f1958440f2a06529df1c7f4 -PKG_MIRROR_HASH:=1959170b25be07b06c198bfd1e072b7ed19b930faad0e886acb6b0d719d25ed1 +PKG_SOURCE_DATE:=2024-12-17 +PKG_SOURCE_VERSION:=a0a2d80f3459425182a9f0e665d8ca8eff97c82f +PKG_MIRROR_HASH:=a6f07d91da40152b2af5b5b9d1d67d87a9991943147e47be6921c092ad7b49a3 PKG_LICENSE:=GPL-2.0 PKG_MAINTAINER:=Felix Fietkau From 03560d470c285e7b77a55e2bcf287b2298d1246e Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Mon, 16 Dec 2024 23:09:26 +0800 Subject: [PATCH 081/149] qualcommax: fix usb regulator supply for RT-AX89X The qusb_phy node looks for the following supply: "vdd", "vdda-pll", "vdda-phy-dpdm" And ssphy node looks for the following supply: "vdda-phy", "vdda-pll" So fix the usb regulator supply for RT-AX89X. Fixes: 1306237 ("qualcommax: use PHY regulator for USB GPIO") Signed-off-by: Chukun Pan Link: https://github.com/openwrt/openwrt/pull/17290 Signed-off-by: Robert Marko --- .../files/arch/arm64/boot/dts/qcom/ipq8074-rt-ax89x.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-rt-ax89x.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-rt-ax89x.dts index 781b6478114..dd5ce8542e5 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-rt-ax89x.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8074-rt-ax89x.dts @@ -365,7 +365,7 @@ &qusb_phy_0 { status = "okay"; - vdda-phy-supply = <&usb0_vbus>; + vdd-supply = <&usb0_vbus>; }; &ssphy_1 { @@ -375,7 +375,7 @@ &qusb_phy_1 { status = "okay"; - vdda-phy-supply = <&usb1_vbus>; + vdd-supply = <&usb1_vbus>; }; &usb_0 { From 2417770b131ae77c56d888748cfe2a8503f2c9bf Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Tue, 10 Dec 2024 23:02:09 +0800 Subject: [PATCH 082/149] linux-firmware: ath11k: add QCA2066 firmware Add QCA2066 firmware package, ath11k is already supported. Signed-off-by: Chukun Pan Link: https://github.com/openwrt/openwrt/pull/17260 Signed-off-by: Robert Marko --- package/firmware/linux-firmware/qca_ath11k.mk | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/package/firmware/linux-firmware/qca_ath11k.mk b/package/firmware/linux-firmware/qca_ath11k.mk index 9fdd6119488..a06bcda420c 100644 --- a/package/firmware/linux-firmware/qca_ath11k.mk +++ b/package/firmware/linux-firmware/qca_ath11k.mk @@ -1,3 +1,11 @@ +Package/ath11k-firmware-qca2066 = $(call Package/firmware-default,QCA2066 ath11k firmware,,LICENCE.atheros_firmware) +define Package/ath11k-firmware-qca2066/install + $(INSTALL_DIR) $(1)/lib/firmware/ath11k/QCA2066/hw2.1 + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/ath11k/QCA2066/hw2.1/* $(1)/lib/firmware/ath11k/QCA2066/hw2.1/ +endef +$(eval $(call BuildPackage,ath11k-firmware-qca2066)) + Package/ath11k-firmware-qca6390 = $(call Package/firmware-default,QCA6390 ath11k firmware,,LICENCE.atheros_firmware) define Package/ath11k-firmware-qca6390/install $(INSTALL_DIR) $(1)/lib/firmware/ath11k/QCA6390/hw2.0 @@ -14,7 +22,7 @@ define Package/ath11k-firmware-wcn6750/install $(INSTALL_DATA) \ $(PKG_BUILD_DIR)/ath11k/WCN6750/hw1.0/Notice.txt $(1)/lib/firmware/ath11k/WCN6750/hw1.0/ $(INSTALL_DATA) \ - $(PKG_BUILD_DIR)/ath11k/WCN6750/hw1.0/sc7280/wpss.mbn $(1)/lib/firmware/ath11k/WCN6750/hw1.0/ + $(PKG_BUILD_DIR)/ath11k/WCN6750/hw1.0/sc7280/wpss.mbn $(1)/lib/firmware/ath11k/WCN6750/hw1.0/ endef $(eval $(call BuildPackage,ath11k-firmware-wcn6750)) From f02df14a997e575b360ed4a9094c3e82490f470d Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Wed, 18 Dec 2024 10:55:01 +0100 Subject: [PATCH 083/149] apk: disable tests Currently if the host system has cmocka installed it will leak the host path and try to use the host cmocka and build tests. This will obviously fail, so backport upstream commit allowing disabling of tests and disable building them. Fixes: openwrt/packages#25456 Link: https://github.com/openwrt/openwrt/pull/17297 Signed-off-by: Robert Marko --- package/system/apk/Makefile | 5 +- ...openwrt-move-layer-db-to-temp-folder.patch | 2 +- .../patches/0002-meson-add-tests-option.patch | 52 +++++++++++++++++++ 3 files changed, 56 insertions(+), 3 deletions(-) create mode 100644 package/system/apk/patches/0002-meson-add-tests-option.patch diff --git a/package/system/apk/Makefile b/package/system/apk/Makefile index c045a990f0a..6ed07384c2f 100644 --- a/package/system/apk/Makefile +++ b/package/system/apk/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=apk -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL=https://gitlab.alpinelinux.org/alpine/apk-tools.git PKG_SOURCE_PROTO:=git @@ -60,7 +60,8 @@ MESON_COMMON_ARGS = \ -Dlua_version=5.1 \ -Ddefault_library=static \ -Durl_backend=wget \ - -Dzstd=false + -Dzstd=false \ + -Dtests=disabled MESON_HOST_ARGS += \ $(MESON_COMMON_ARGS) \ diff --git a/package/system/apk/patches/0001-openwrt-move-layer-db-to-temp-folder.patch b/package/system/apk/patches/0001-openwrt-move-layer-db-to-temp-folder.patch index 2b54f47ab77..aaf36310a03 100644 --- a/package/system/apk/patches/0001-openwrt-move-layer-db-to-temp-folder.patch +++ b/package/system/apk/patches/0001-openwrt-move-layer-db-to-temp-folder.patch @@ -10,7 +10,7 @@ Signed-off-by: Paul Spooren --- a/src/database.c +++ b/src/database.c -@@ -1631,7 +1631,7 @@ const char *apk_db_layer_name(int layer) +@@ -1624,7 +1624,7 @@ const char *apk_db_layer_name(int layer) { switch (layer) { case APK_DB_LAYER_ROOT: return "lib/apk/db"; diff --git a/package/system/apk/patches/0002-meson-add-tests-option.patch b/package/system/apk/patches/0002-meson-add-tests-option.patch new file mode 100644 index 00000000000..075d3a9897f --- /dev/null +++ b/package/system/apk/patches/0002-meson-add-tests-option.patch @@ -0,0 +1,52 @@ +From a6180e4cfa1a98d361ffdce9e48857504997fbe9 Mon Sep 17 00:00:00 2001 +From: Rosen Penev +Date: Tue, 3 Dec 2024 18:12:58 -0800 +Subject: [PATCH] meson: add tests option + +Allows disabling tests when not desired. + +Signed-off-by: Rosen Penev +--- + meson_options.txt | 1 + + test/meson.build | 10 +++++++--- + test/unit/meson.build | 2 +- + 3 files changed, 9 insertions(+), 4 deletions(-) + +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -6,6 +6,7 @@ option('docs', description: 'Build manpa + option('help', description: 'Build help into apk binaries, needs lua', type: 'feature', value: 'auto') + option('lua', description: 'Build luaapk (lua bindings)', type: 'feature', value: 'auto') + option('lua_version', description: 'Lua version to build against', type: 'string', value: '5.3') ++option('tests', description: 'Build tests', type: 'feature', value: 'auto') + option('url_backend', description: 'URL backend', type: 'combo', choices: ['libfetch', 'wget'], value: 'libfetch') + option('uvol_db_target', description: 'Default target for uvol database layer', type: 'string') + option('zstd', description: 'Build with zstd support', type: 'boolean', value: true) +--- a/test/meson.build ++++ b/test/meson.build +@@ -1,10 +1,14 @@ ++enum_sh = find_program('enum.sh', required: get_option('tests')) ++solver_sh = find_program('solver.sh', required: get_option('tests')) ++ ++if not enum_sh.found() or not solver_sh.found() ++ subdir_done() ++endif ++ + cur_dir = meson.current_source_dir() + env = environment() + env.set('APK', apk_exe.full_path()) + +-enum_sh = files('enum.sh') +-solver_sh = files('solver.sh') +- + subdir('unit') + + foreach t : run_command(enum_sh, 'shell', check: true).stdout().strip().split(' ') +--- a/test/unit/meson.build ++++ b/test/unit/meson.build +@@ -1,4 +1,4 @@ +-cmocka_dep = dependency('cmocka', required: false) ++cmocka_dep = dependency('cmocka', required: get_option('tests')) + + if cmocka_dep.found() + From 47c75a25cdeed6fda9608d61926799dbd1b1fef3 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 18 Dec 2024 10:35:21 +0100 Subject: [PATCH 084/149] firewall4: update to Git HEAD (2024-12-18) e00958884416 fw4: do not add physical devices for soft offload dfbcc1cd127c fw4: skip not existing netdev names in flowtable device list 18fc0ead19fa init: use the reload data trigger to reload firewall on procd data changes Fixes: https://github.com/openwrt/openwrt/issues/13410 Signed-off-by: Felix Fietkau --- package/network/config/firewall4/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/config/firewall4/Makefile b/package/network/config/firewall4/Makefile index 6aacc05e365..9b53349275b 100644 --- a/package/network/config/firewall4/Makefile +++ b/package/network/config/firewall4/Makefile @@ -9,9 +9,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firewall4.git -PKG_SOURCE_DATE:=2024-05-21 -PKG_SOURCE_VERSION:=4c01d1ebf99e8ecfa69758a9b4f450ecef7b93cd -PKG_MIRROR_HASH:=bbc5622bc03e3b43116fcc86e3fa2d2372bfc07b3a00d2b3a6efac4f7454a403 +PKG_SOURCE_DATE:=2024-12-18 +PKG_SOURCE_VERSION:=18fc0ead19faf06b8ce7ec5be84957278e942dfa +PKG_MIRROR_HASH:=123d1b5d00cdbbfa77813b3eb694d00949171037a0fa26e6d36a75a37066ba48 PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=ISC From eec6ec4755075cf40add30a00dabeecd07ddb6cf Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 16 Jun 2024 12:40:53 -0700 Subject: [PATCH 085/149] ath79: tplink,deco-s4-v2: use nvmem for cal Userspace handling is deprecated. MAC address stuff needs to remain handled in userspace as it's encrypted. Maybe an NVMEM driver can be written in the future... Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/17276 Signed-off-by: Robert Marko --- target/linux/ath79/dts/qca9563_tplink_deco-s4-v2.dts | 7 ++++++- .../base-files/etc/hotplug.d/firmware/10-ath9k-eeprom | 5 ----- .../base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/target/linux/ath79/dts/qca9563_tplink_deco-s4-v2.dts b/target/linux/ath79/dts/qca9563_tplink_deco-s4-v2.dts index 7cbc77f64b5..147a880de88 100644 --- a/target/linux/ath79/dts/qca9563_tplink_deco-s4-v2.dts +++ b/target/linux/ath79/dts/qca9563_tplink_deco-s4-v2.dts @@ -121,6 +121,10 @@ #address-cells = <1>; #size-cells = <1>; + cal_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + precal_art_5000: pre-calibration@5000 { reg = <0x5000 0x2f20>; }; @@ -146,5 +150,6 @@ &wmac { status = "okay"; - qca,no-eeprom; + nvmem-cells = <&cal_art_1000>; + nvmem-cell-names = "calibration"; }; diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 17639ad439e..675522823f6 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -58,11 +58,6 @@ case "$FIRMWARE" in caldata_extract "art" 0x1000 0x440 ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env mac_addr) ;; - tplink,deco-s4-v2) - caldata_extract "art" 0x1000 0x440 - base_mac=$(mtd_get_mac_encrypted_deco $(find_mtd_part config)) - ath9k_patch_mac $(macaddr_add $base_mac 1) - ;; *) caldata_die "board $board is not supported yet" ;; diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 5155d240a82..b10599cc154 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -110,7 +110,8 @@ case "$board" in base_mac=$(mtd_get_mac_encrypted_deco $(find_mtd_part config)) [ "$PHYNBR" -eq 0 ] && \ macaddr_add $base_mac 2 > /sys${DEVPATH}/macaddress - + [ "$PHYNBR" -eq 1 ] && \ + macaddr_add $base_mac 1 > /sys${DEVPATH}/macaddress ;; trendnet,tew-823dru) # set the 2.4G interface mac address to LAN MAC From 28f534d953b1163548610554981763d24fde6d03 Mon Sep 17 00:00:00 2001 From: John Audia Date: Sat, 14 Dec 2024 15:02:19 -0500 Subject: [PATCH 086/149] kernel: bump 6.6 to 6.6.66 Update patch set for new release and add required kernel option CONFIG_ZRAM_TRACK_ENTRY_ACTIME to generic config Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.66 Manually rebased: bcm27xx/patches-6.6/950-0092-MMC-added-alternative-MMC-driver.patch bcm53xx/patches-6.6/180-usb-xhci-add-support-for-performing-fake-doorbell.patch starfive/patches-6.6/1000-serial-8250_dw-Add-starfive-jh7100-hsuart-compatible.patch Removed upstreamed: bcm27xx/patches-6.6/950-0029-vc4_hdmi-Avoid-log-spam-for-audio-start-failure.patch[1] All other patches automatically rebased. 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.66&id=e0388a95736abd1f5f5a94221dd1ac24eacbd4d7 Build system: x86/64 Build-tested: bcm27xx/bcm2712, flogic/glinet_gl-mt6000, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3, x86/64 Run-tested: bcm27xx/bcm2712, flogic/glinet_gl-mt6000, 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/17271 Signed-off-by: Hauke Mehrtens --- include/kernel-6.6 | 4 +- ...eset-controller-support-for-EN7581-S.patch | 2 +- ...e-clock_register-in-hw_init-callback.patch | 2 +- ...clk-en7523-introduce-chip_scu-regmap.patch | 2 +- .../900-unaligned_access_hacks.patch | 4 +- ...oid-log-spam-for-audio-start-failure.patch | 41 ------------------- ...-vc4-Set-AXI-panic-modes-for-the-HVS.patch | 2 +- ...ci-add-quirk-for-host-controllers-th.patch | 2 +- ...Add-cts-event-workaround-DT-property.patch | 2 +- ...092-MMC-added-alternative-MMC-driver.patch | 6 +-- ...all-the-downstream-rpi-sound-card-dr.patch | 2 +- ...hci_fixup_endpoint-for-interval-adju.patch | 2 +- ...ce-quirks-for-Freeway-Airmouse-T3-an.patch | 4 +- ...-Add-a-timing-for-the-Raspberry-Pi-7.patch | 2 +- ...nel-simple-add-Geekworm-MZP280-Panel.patch | 2 +- ...a-introduce-a-customisable-threshold.patch | 2 +- ...mple-Add-Innolux-AT056tN53V1-5.6-VGA.patch | 2 +- ...ci_sync-Add-fallback-bd-address-prop.patch | 4 +- ...-quirks-add-link-TRB-quirk-for-VL805.patch | 6 +-- ...upstream-TRB_FETCH-quirk-on-VL805-ho.patch | 2 +- ...b-xhci-add-VLI_SS_BULK_OUT_BUG-quirk.patch | 4 +- ...5-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch | 10 ++--- ...wc3-Set-DMA-and-coherent-masks-early.patch | 4 +- ...0-0531-serial-pl011-rp1-uart-support.patch | 4 +- ...vc4-Introduce-generation-number-enum.patch | 2 +- ...-drm-vc4-hvs-Create-hw_init-function.patch | 2 +- ...drm-vc4-hvs-Create-cob_init-function.patch | 6 +-- ...592-drm-vc4-hvs-Rename-hvs_regs-list.patch | 2 +- ...ge-prototype-of-__vc4_hvs_alloc-to-p.patch | 2 +- ...ble-SCALER_CONTROL-early-in-HVS-init.patch | 4 +- ...0610-drm-vc4-hvs-Support-BCM2712-HVS.patch | 16 ++++---- .../950-0757-drm-panel-add-panel-dsi.patch | 4 +- ...-Add-support-for-D0-register-changes.patch | 8 ++-- ...-to-support-D0-alpha-and-csc-changes.patch | 4 +- ...M-pl011-Add-rs485-to-the-RP1-support.patch | 2 +- ...-add-FS-LS-bus-instance-parkmode-dis.patch | 4 +- ...llocate-a-block-for-SD-extension-reg.patch | 4 +- ...ted-write-counts-for-SD-cards-in-CQ-.patch | 2 +- ...th-hci_sync-Fix-crash-on-NULL-parent.patch | 2 +- ...ort-for-per-plane-scaling-filter-sel.patch | 4 +- ...ble-write-caching-on-Samsung-2023-mo.patch | 10 ++--- ...-Also-unregister-pl011_axi_platform_.patch | 2 +- ...equest-for-min-clocks-when-hdmi-outp.patch | 2 +- ...le-cache-on-more-known-bad-Sandisk-c.patch | 2 +- ...MC_QUIRK_BROKEN_ERASE-for-Phison-Int.patch | 2 +- ...erride-of-kernel-s-default-NUMA-poli.patch | 10 ++--- ...support-for-performing-fake-doorbell.patch | 6 +-- ...ansmit-from-devices-with-no-checksum.patch | 2 +- ...169-improve-handling-task-scheduling.patch | 2 +- ...support-for-LED-s-on-RTL8168-RTL8101.patch | 4 +- ...ix-building-with-CONFIG_LEDS_CLASS-m.patch | 2 +- ...-07-v6.9-r8169-simplify-EEE-handling.patch | 4 +- ...-v6.9-r8169-add-support-for-RTL8126A.patch | 4 +- ...ode-by-using-core-provided-pcpu-stat.patch | 4 +- ...-add-LED-support-for-RTL8125-RTL8126.patch | 2 +- ...D-related-deadlock-on-module-removal.patch | 4 +- ...g-conditional-compiling-for-call-to-.patch | 2 +- ...-disable-interrupt-source-RxOverflow.patch | 2 +- ...r8169-add-support-for-RTL8126A-rev.b.patch | 4 +- target/linux/generic/config-6.6 | 1 + .../generic/hack-6.6/259-regmap_dynamic.patch | 2 +- ...-netfilter-add-xt_FLOWOFFLOAD-target.patch | 4 +- .../790-SFP-GE-T-ignore-TX_FAULT.patch | 6 +-- ...vert-driver-core-Set-fw_devlink-on-b.patch | 2 +- .../456-mmc-core-set-card-fwnode_handle.patch | 2 +- ...ow_offload-handle-netdevice-events-f.patch | 6 +-- ...hdog-mediatek-mt7988-add-wdt-support.patch | 4 +- .../810-uvc-add-iPassion-iP2970-support.patch | 2 +- ...sfp-re-probe-modules-on-DEV_UP-event.patch | 2 +- ...14-net-phy-sfp-add-support-for-SMBus.patch | 6 +-- ...c3-add-optional-PHY-interface-clocks.patch | 4 +- ...ove-performance-usb-using-lowmem-for.patch | 8 ++-- ...dd-starfive-jh7100-hsuart-compatible.patch | 8 ++-- 73 files changed, 136 insertions(+), 176 deletions(-) delete mode 100644 target/linux/bcm27xx/patches-6.6/950-0029-vc4_hdmi-Avoid-log-spam-for-audio-start-failure.patch diff --git a/include/kernel-6.6 b/include/kernel-6.6 index 875c715ba4b..1e5dc77de0e 100644 --- a/include/kernel-6.6 +++ b/include/kernel-6.6 @@ -1,2 +1,2 @@ -LINUX_VERSION-6.6 = .65 -LINUX_KERNEL_HASH-6.6.65 = 7ae1476e8b4c86e7754e581d45d6fbce5932bfefce934758a2907d6d79eca3e0 +LINUX_VERSION-6.6 = .66 +LINUX_KERNEL_HASH-6.6.66 = 9d757937c4661c2f512c62641b74ef74eff9bb13dc5dbcbaaa108c21152f1e52 diff --git a/target/linux/airoha/patches-6.6/019-01-v6.11-clk-en7523-Add-reset-controller-support-for-EN7581-S.patch b/target/linux/airoha/patches-6.6/019-01-v6.11-clk-en7523-Add-reset-controller-support-for-EN7581-S.patch index f7cc5159eaf..4d9ff9ef9de 100644 --- a/target/linux/airoha/patches-6.6/019-01-v6.11-clk-en7523-Add-reset-controller-support-for-EN7581-S.patch +++ b/target/linux/airoha/patches-6.6/019-01-v6.11-clk-en7523-Add-reset-controller-support-for-EN7581-S.patch @@ -139,7 +139,7 @@ Signed-off-by: Stephen Boyd return PTR_ERR(pb_base); @@ -428,6 +510,95 @@ static void en7523_register_clocks(struc - clk_data->num = EN7523_NUM_CLOCKS; + clk_data->hws[EN7523_CLK_PCIE] = hw; } +static int en7523_reset_update(struct reset_controller_dev *rcdev, diff --git a/target/linux/airoha/patches-6.6/033-02-v6.13-clk-en7523-move-clock_register-in-hw_init-callback.patch b/target/linux/airoha/patches-6.6/033-02-v6.13-clk-en7523-move-clock_register-in-hw_init-callback.patch index f4cfaa2bf9d..6a76886c1b4 100644 --- a/target/linux/airoha/patches-6.6/033-02-v6.13-clk-en7523-move-clock_register-in-hw_init-callback.patch +++ b/target/linux/airoha/patches-6.6/033-02-v6.13-clk-en7523-move-clock_register-in-hw_init-callback.patch @@ -51,7 +51,7 @@ Signed-off-by: Stephen Boyd void __iomem *base, void __iomem *np_base) { @@ -449,6 +436,49 @@ static void en7523_register_clocks(struc - clk_data->num = EN7523_NUM_CLOCKS; + clk_data->hws[EN7523_CLK_PCIE] = hw; } +static int en7523_clk_hw_init(struct platform_device *pdev, diff --git a/target/linux/airoha/patches-6.6/033-03-v6.13-clk-en7523-introduce-chip_scu-regmap.patch b/target/linux/airoha/patches-6.6/033-03-v6.13-clk-en7523-introduce-chip_scu-regmap.patch index 6c34ca2fa54..31966273f02 100644 --- a/target/linux/airoha/patches-6.6/033-03-v6.13-clk-en7523-introduce-chip_scu-regmap.patch +++ b/target/linux/airoha/patches-6.6/033-03-v6.13-clk-en7523-introduce-chip_scu-regmap.patch @@ -63,7 +63,7 @@ Signed-off-by: Stephen Boyd val >>= desc->div_shift; val &= (1 << desc->div_bits) - 1; -@@ -416,9 +409,12 @@ static void en7523_register_clocks(struc +@@ -418,9 +411,12 @@ static void en7523_register_clocks(struc for (i = 0; i < ARRAY_SIZE(en7523_base_clks); i++) { const struct en_clk_desc *desc = &en7523_base_clks[i]; diff --git a/target/linux/ath79/patches-6.6/900-unaligned_access_hacks.patch b/target/linux/ath79/patches-6.6/900-unaligned_access_hacks.patch index dd57c53a181..969cde5ce27 100644 --- a/target/linux/ath79/patches-6.6/900-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-6.6/900-unaligned_access_hacks.patch @@ -259,7 +259,7 @@ SVN-Revision: 35130 #include #include #include -@@ -893,10 +894,10 @@ static void tcp_v6_send_response(const s +@@ -891,10 +892,10 @@ static void tcp_v6_send_response(const s topt = (__be32 *)(t1 + 1); if (tsecr) { @@ -337,7 +337,7 @@ SVN-Revision: 35130 #endif /* _LINUX_TYPES_H */ --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c -@@ -1508,8 +1508,8 @@ struct sk_buff *inet_gro_receive(struct +@@ -1506,8 +1506,8 @@ struct sk_buff *inet_gro_receive(struct goto out; NAPI_GRO_CB(skb)->proto = proto; diff --git a/target/linux/bcm27xx/patches-6.6/950-0029-vc4_hdmi-Avoid-log-spam-for-audio-start-failure.patch b/target/linux/bcm27xx/patches-6.6/950-0029-vc4_hdmi-Avoid-log-spam-for-audio-start-failure.patch deleted file mode 100644 index a73c5e3163f..00000000000 --- a/target/linux/bcm27xx/patches-6.6/950-0029-vc4_hdmi-Avoid-log-spam-for-audio-start-failure.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 7508b889b8c8058e53ceeec90a1e3cc998897e16 Mon Sep 17 00:00:00 2001 -From: Dom Cobley -Date: Tue, 6 Dec 2022 15:05:56 +0000 -Subject: [PATCH 0029/1085] vc4_hdmi: Avoid log spam for audio start failure - -We regularly get dmesg error reports of: -[ 18.184066] hdmi-audio-codec hdmi-audio-codec.3.auto: ASoC: error at snd_soc_dai_startup on i2s-hifi: -19 -[ 18.184098] MAI: soc_pcm_open() failed (-19) - -Currently I get 30 of these when booting to desktop. -We always say, ignore they are harmless, but removing them would be good. - -A bit of investigation shows, for me, the errors are all generated by second, unused hdmi interface. - -It shows as an alsa device, and pulseaudio attempts to open it (numerous times), generating a kernel -error message each time. - -systemctl --user restart pulseaudio.service generates 6 additional error messages. - -The error messages all come through: -https://github.com/raspberrypi/linux/blob/a009a9c0d79dfec114ee5102ec3d3325a172c952/sound/soc/soc-pcm.c#L39 - -which suggests returning ENOTSUPP, rather that ENODEV will be quiet. And indeed it is. - -Note: earlier kernels do not have the quiet ENOTSUPP, so additional cherry-picks will be needed to backport -Signed-off-by: Dom Cobley ---- - drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/gpu/drm/vc4/vc4_hdmi.c -+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c -@@ -2404,7 +2404,7 @@ static int vc4_hdmi_audio_startup(struct - } - - if (!vc4_hdmi_audio_can_stream(vc4_hdmi)) { -- ret = -ENODEV; -+ ret = -ENOTSUPP; - goto out_dev_exit; - } - diff --git a/target/linux/bcm27xx/patches-6.6/950-0036-drm-vc4-Set-AXI-panic-modes-for-the-HVS.patch b/target/linux/bcm27xx/patches-6.6/950-0036-drm-vc4-Set-AXI-panic-modes-for-the-HVS.patch index 13015f1f497..3ecea01fcd5 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0036-drm-vc4-Set-AXI-panic-modes-for-the-HVS.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0036-drm-vc4-Set-AXI-panic-modes-for-the-HVS.patch @@ -19,7 +19,7 @@ Signed-off-by: Dave Stevenson --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -1368,6 +1368,17 @@ static int vc4_hvs_bind(struct device *d +@@ -1379,6 +1379,17 @@ static int vc4_hvs_bind(struct device *d dispctrl |= VC4_SET_FIELD(2, SCALER_DISPCTRL_PANIC1); dispctrl |= VC4_SET_FIELD(2, SCALER_DISPCTRL_PANIC2); diff --git a/target/linux/bcm27xx/patches-6.6/950-0061-Revert-Revert-xhci-add-quirk-for-host-controllers-th.patch b/target/linux/bcm27xx/patches-6.6/950-0061-Revert-Revert-xhci-add-quirk-for-host-controllers-th.patch index 1135b31d4f6..f8aa2fe5a74 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0061-Revert-Revert-xhci-add-quirk-for-host-controllers-th.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0061-Revert-Revert-xhci-add-quirk-for-host-controllers-th.patch @@ -14,7 +14,7 @@ We don't agree with upstream revert so undo it. --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -490,8 +490,10 @@ static void xhci_pci_quirks(struct devic +@@ -480,8 +480,10 @@ static void xhci_pci_quirks(struct devic pdev->device == 0x3432) xhci->quirks |= XHCI_BROKEN_STREAMS; diff --git a/target/linux/bcm27xx/patches-6.6/950-0083-amba_pl011-Add-cts-event-workaround-DT-property.patch b/target/linux/bcm27xx/patches-6.6/950-0083-amba_pl011-Add-cts-event-workaround-DT-property.patch index 58910b86119..efee03dc801 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0083-amba_pl011-Add-cts-event-workaround-DT-property.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0083-amba_pl011-Add-cts-event-workaround-DT-property.patch @@ -36,7 +36,7 @@ Signed-off-by: Phil Elwell - reg --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c -@@ -2808,6 +2808,11 @@ static int pl011_probe(struct amba_devic +@@ -2815,6 +2815,11 @@ static int pl011_probe(struct amba_devic if (IS_ERR(uap->clk)) return PTR_ERR(uap->clk); diff --git a/target/linux/bcm27xx/patches-6.6/950-0092-MMC-added-alternative-MMC-driver.patch b/target/linux/bcm27xx/patches-6.6/950-0092-MMC-added-alternative-MMC-driver.patch index aebb491f32a..9b86d0e6a32 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0092-MMC-added-alternative-MMC-driver.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0092-MMC-added-alternative-MMC-driver.patch @@ -344,7 +344,7 @@ Signed-off-by: Phil Elwell } --- a/drivers/mmc/core/quirks.h +++ b/drivers/mmc/core/quirks.h -@@ -134,6 +134,14 @@ static const struct mmc_fixup __maybe_un +@@ -143,6 +143,14 @@ static const struct mmc_fixup __maybe_un MMC_FIXUP(CID_NAME_ANY, CID_MANFID_SANDISK_SD, 0x5344, add_quirk_sd, MMC_QUIRK_BROKEN_SD_DISCARD), @@ -2013,10 +2013,10 @@ Signed-off-by: Phil Elwell sdhci_dumpregs(host); --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h -@@ -296,6 +296,7 @@ struct mmc_card { - #define MMC_QUIRK_BROKEN_SD_DISCARD (1<<14) /* Disable broken SD discard support */ +@@ -297,6 +297,7 @@ struct mmc_card { #define MMC_QUIRK_BROKEN_SD_CACHE (1<<15) /* Disable broken SD cache support */ #define MMC_QUIRK_BROKEN_CACHE_FLUSH (1<<16) /* Don't flush cache until the write has occurred */ + #define MMC_QUIRK_BROKEN_SD_POWEROFF_NOTIFY (1<<17) /* Disable broken SD poweroff notify support */ +#define MMC_QUIRK_ERASE_BROKEN (1<<31) /* Skip erase */ bool written_flag; /* Indicates eMMC has been written since power on */ 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 a8a58b58fa6..6ffc9364da8 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 -@@ -2212,6 +2212,8 @@ static const struct usb_audio_quirk_flag +@@ -2233,6 +2233,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/bcm27xx/patches-6.6/950-0161-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch b/target/linux/bcm27xx/patches-6.6/950-0161-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch index f5eea9b47df..942f47a0a36 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0161-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0161-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch @@ -125,7 +125,7 @@ Signed-off-by: Jonathan Bell * non-error returns are a promise to giveback() the urb later * we drop ownership so next owner (or urb unlink) can get it */ -@@ -5328,6 +5431,7 @@ static const struct hc_driver xhci_hc_dr +@@ -5347,6 +5450,7 @@ static const struct hc_driver xhci_hc_dr .endpoint_reset = xhci_endpoint_reset, .check_bandwidth = xhci_check_bandwidth, .reset_bandwidth = xhci_reset_bandwidth, diff --git a/target/linux/bcm27xx/patches-6.6/950-0169-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch b/target/linux/bcm27xx/patches-6.6/950-0169-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch index 6e9ca2261bb..a65d198d21f 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0169-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0169-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch @@ -23,7 +23,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h -@@ -242,6 +242,9 @@ +@@ -243,6 +243,9 @@ #define USB_VENDOR_ID_BAANTO 0x2453 #define USB_DEVICE_ID_BAANTO_MT_190W2 0x0100 @@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell #define USB_VENDOR_ID_BELKIN 0x050d #define USB_DEVICE_ID_FLIP_KVM 0x3201 -@@ -1405,6 +1408,9 @@ +@@ -1406,6 +1409,9 @@ #define USB_VENDOR_ID_XIAOMI 0x2717 #define USB_DEVICE_ID_MI_SILENT_MOUSE 0x5014 diff --git a/target/linux/bcm27xx/patches-6.6/950-0301-drm-panel-simple-Add-a-timing-for-the-Raspberry-Pi-7.patch b/target/linux/bcm27xx/patches-6.6/950-0301-drm-panel-simple-Add-a-timing-for-the-Raspberry-Pi-7.patch index d5cee828b07..e3a07581f82 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0301-drm-panel-simple-Add-a-timing-for-the-Raspberry-Pi-7.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0301-drm-panel-simple-Add-a-timing-for-the-Raspberry-Pi-7.patch @@ -47,7 +47,7 @@ Signed-off-by: Dave Stevenson static const struct display_timing rocktech_rk070er9427_timing = { .pixelclock = { 26400000, 33300000, 46800000 }, .hactive = { 800, 800, 800 }, -@@ -4427,6 +4452,9 @@ static const struct of_device_id platfor +@@ -4452,6 +4477,9 @@ static const struct of_device_id platfor .compatible = "rocktech,rk043fn48h", .data = &rocktech_rk043fn48h, }, { diff --git a/target/linux/bcm27xx/patches-6.6/950-0343-drm-panel-simple-add-Geekworm-MZP280-Panel.patch b/target/linux/bcm27xx/patches-6.6/950-0343-drm-panel-simple-add-Geekworm-MZP280-Panel.patch index d5a071364a0..49493e67a9c 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0343-drm-panel-simple-add-Geekworm-MZP280-Panel.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0343-drm-panel-simple-add-Geekworm-MZP280-Panel.patch @@ -46,7 +46,7 @@ Acked-by: Maxime Ripard static const struct drm_display_mode giantplus_gpg482739qs5_mode = { .clock = 9000, .hdisplay = 480, -@@ -4302,6 +4328,9 @@ static const struct of_device_id platfor +@@ -4327,6 +4353,9 @@ static const struct of_device_id platfor .compatible = "friendlyarm,hd702e", .data = &friendlyarm_hd702e, }, { diff --git a/target/linux/bcm27xx/patches-6.6/950-0359-mm-page_alloc-cma-introduce-a-customisable-threshold.patch b/target/linux/bcm27xx/patches-6.6/950-0359-mm-page_alloc-cma-introduce-a-customisable-threshold.patch index f8baf9befc5..8cf8a05098c 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0359-mm-page_alloc-cma-introduce-a-customisable-threshold.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0359-mm-page_alloc-cma-introduce-a-customisable-threshold.patch @@ -48,7 +48,7 @@ Signed-off-by: David Plowman /* * A cached value of the page's pageblock's migratetype, used when the page is * put on a pcplist. Used to avoid the pageblock migratetype lookup when -@@ -2094,12 +2115,13 @@ __rmqueue(struct zone *zone, unsigned in +@@ -2109,12 +2130,13 @@ __rmqueue(struct zone *zone, unsigned in if (IS_ENABLED(CONFIG_CMA)) { /* * Balance movable allocations between regular and CMA areas by diff --git a/target/linux/bcm27xx/patches-6.6/950-0401-drm-panel-simple-Add-Innolux-AT056tN53V1-5.6-VGA.patch b/target/linux/bcm27xx/patches-6.6/950-0401-drm-panel-simple-Add-Innolux-AT056tN53V1-5.6-VGA.patch index d8376a3fe59..394109d5658 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0401-drm-panel-simple-Add-Innolux-AT056tN53V1-5.6-VGA.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0401-drm-panel-simple-Add-Innolux-AT056tN53V1-5.6-VGA.patch @@ -165,7 +165,7 @@ Signed-off-by: Phil Elwell static const struct drm_display_mode innolux_at070tn92_mode = { .clock = 33333, .hdisplay = 800, -@@ -4352,6 +4384,9 @@ static const struct of_device_id platfor +@@ -4377,6 +4409,9 @@ static const struct of_device_id platfor .compatible = "innolux,at043tn24", .data = &innolux_at043tn24, }, { diff --git a/target/linux/bcm27xx/patches-6.6/950-0441-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch b/target/linux/bcm27xx/patches-6.6/950-0441-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch index cc5e3d1dc30..3f9d802de3c 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0441-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0441-Bluetooth-hci_sync-Add-fallback-bd-address-prop.patch @@ -20,7 +20,7 @@ Signed-off-by: Phil Elwell --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c -@@ -4865,6 +4865,7 @@ static const struct { +@@ -4872,6 +4872,7 @@ static const struct { */ static int hci_dev_setup_sync(struct hci_dev *hdev) { @@ -28,7 +28,7 @@ Signed-off-by: Phil Elwell int ret = 0; bool invalid_bdaddr; size_t i; -@@ -4893,7 +4894,8 @@ static int hci_dev_setup_sync(struct hci +@@ -4900,7 +4901,8 @@ static int hci_dev_setup_sync(struct hci test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks); if (!ret) { if (test_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks) && diff --git a/target/linux/bcm27xx/patches-6.6/950-0482-xhci-quirks-add-link-TRB-quirk-for-VL805.patch b/target/linux/bcm27xx/patches-6.6/950-0482-xhci-quirks-add-link-TRB-quirk-for-VL805.patch index 4a7bfd4f2eb..93e45b54424 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0482-xhci-quirks-add-link-TRB-quirk-for-VL805.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0482-xhci-quirks-add-link-TRB-quirk-for-VL805.patch @@ -24,7 +24,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -493,6 +493,7 @@ static void xhci_pci_quirks(struct devic +@@ -483,6 +483,7 @@ static void xhci_pci_quirks(struct devic if (pdev->vendor == PCI_VENDOR_ID_VIA && pdev->device == 0x3483) { xhci->quirks |= XHCI_LPM_SUPPORT; xhci->quirks |= XHCI_EP_CTX_BROKEN_DCS; @@ -52,9 +52,9 @@ Signed-off-by: Jonathan Bell addr = xhci_trb_virt_to_dma(new_seg, new_deq); --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1662,6 +1662,9 @@ struct xhci_hcd { - #define XHCI_WRITE_64_HI_LO BIT_ULL(47) +@@ -1663,6 +1663,9 @@ struct xhci_hcd { #define XHCI_CDNS_SCTX_QUIRK BIT_ULL(48) + #define XHCI_ETRON_HOST BIT_ULL(49) +/* Downstream VLI fixes */ +#define XHCI_AVOID_DQ_ON_LINK BIT_ULL(56) diff --git a/target/linux/bcm27xx/patches-6.6/950-0483-usb-xhci-borrow-upstream-TRB_FETCH-quirk-on-VL805-ho.patch b/target/linux/bcm27xx/patches-6.6/950-0483-usb-xhci-borrow-upstream-TRB_FETCH-quirk-on-VL805-ho.patch index e76a413d67f..852e6a36735 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0483-usb-xhci-borrow-upstream-TRB_FETCH-quirk-on-VL805-ho.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0483-usb-xhci-borrow-upstream-TRB_FETCH-quirk-on-VL805-ho.patch @@ -22,7 +22,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -494,6 +494,7 @@ static void xhci_pci_quirks(struct devic +@@ -484,6 +484,7 @@ static void xhci_pci_quirks(struct devic xhci->quirks |= XHCI_LPM_SUPPORT; xhci->quirks |= XHCI_EP_CTX_BROKEN_DCS; xhci->quirks |= XHCI_AVOID_DQ_ON_LINK; diff --git a/target/linux/bcm27xx/patches-6.6/950-0484-usb-xhci-add-VLI_SS_BULK_OUT_BUG-quirk.patch b/target/linux/bcm27xx/patches-6.6/950-0484-usb-xhci-add-VLI_SS_BULK_OUT_BUG-quirk.patch index 663a2f93233..add65ee641d 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0484-usb-xhci-add-VLI_SS_BULK_OUT_BUG-quirk.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0484-usb-xhci-add-VLI_SS_BULK_OUT_BUG-quirk.patch @@ -90,7 +90,7 @@ Signed-off-by: Jonathan Bell /* Allow 3 retries for everything but isoc, set CErr = 3 */ --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c -@@ -495,6 +495,7 @@ static void xhci_pci_quirks(struct devic +@@ -485,6 +485,7 @@ static void xhci_pci_quirks(struct devic xhci->quirks |= XHCI_EP_CTX_BROKEN_DCS; xhci->quirks |= XHCI_AVOID_DQ_ON_LINK; xhci->quirks |= XHCI_ZHAOXIN_TRB_FETCH; @@ -100,7 +100,7 @@ Signed-off-by: Jonathan Bell if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1664,6 +1664,7 @@ struct xhci_hcd { +@@ -1665,6 +1665,7 @@ struct xhci_hcd { /* Downstream VLI fixes */ #define XHCI_AVOID_DQ_ON_LINK BIT_ULL(56) diff --git a/target/linux/bcm27xx/patches-6.6/950-0485-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch b/target/linux/bcm27xx/patches-6.6/950-0485-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch index 8d276e16818..9c45bd77e9a 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0485-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0485-usb-xhci-add-XHCI_VLI_HUB_TT_QUIRK.patch @@ -64,7 +64,7 @@ Signed-off-by: Jonathan Bell static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) { struct pci_dev *pdev = to_pci_dev(dev); -@@ -496,6 +508,8 @@ static void xhci_pci_quirks(struct devic +@@ -486,6 +498,8 @@ static void xhci_pci_quirks(struct devic xhci->quirks |= XHCI_AVOID_DQ_ON_LINK; xhci->quirks |= XHCI_ZHAOXIN_TRB_FETCH; xhci->quirks |= XHCI_VLI_SS_BULK_OUT_BUG; @@ -75,7 +75,7 @@ Signed-off-by: Jonathan Bell if (pdev->vendor == PCI_VENDOR_ID_ASMEDIA && --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c -@@ -3679,6 +3679,48 @@ static int xhci_align_td(struct xhci_hcd +@@ -3674,6 +3674,48 @@ static int xhci_align_td(struct xhci_hcd return 1; } @@ -124,7 +124,7 @@ Signed-off-by: Jonathan Bell /* This is very similar to what ehci-q.c qtd_fill() does */ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, struct urb *urb, int slot_id, unsigned int ep_index) -@@ -3835,6 +3877,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd * +@@ -3830,6 +3872,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd * } check_trb_math(urb, enqd_len); @@ -133,7 +133,7 @@ Signed-off-by: Jonathan Bell giveback_first_trb(xhci, slot_id, ep_index, urb->stream_id, start_cycle, start_trb); return 0; -@@ -3970,6 +4014,8 @@ int xhci_queue_ctrl_tx(struct xhci_hcd * +@@ -3979,6 +4023,8 @@ int xhci_queue_ctrl_tx(struct xhci_hcd * /* Event on completion */ field | TRB_IOC | TRB_TYPE(TRB_STATUS) | ep_ring->cycle_state); @@ -144,7 +144,7 @@ Signed-off-by: Jonathan Bell return 0; --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1665,6 +1665,7 @@ struct xhci_hcd { +@@ -1666,6 +1666,7 @@ struct xhci_hcd { /* Downstream VLI fixes */ #define XHCI_AVOID_DQ_ON_LINK BIT_ULL(56) #define XHCI_VLI_SS_BULK_OUT_BUG BIT_ULL(57) diff --git a/target/linux/bcm27xx/patches-6.6/950-0519-usb-dwc3-Set-DMA-and-coherent-masks-early.patch b/target/linux/bcm27xx/patches-6.6/950-0519-usb-dwc3-Set-DMA-and-coherent-masks-early.patch index 7609657162d..fe77f212117 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0519-usb-dwc3-Set-DMA-and-coherent-masks-early.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0519-usb-dwc3-Set-DMA-and-coherent-masks-early.patch @@ -333,7 +333,7 @@ Signed-off-by: Jonathan Bell /* Global Debug LSP MUX Select */ #define DWC3_GDBGLSPMUX_ENDBC BIT(15) /* Host only */ #define DWC3_GDBGLSPMUX_HOSTSELECT(n) ((n) & 0x3fff) -@@ -1061,6 +1064,7 @@ struct dwc3_scratchpad_array { +@@ -1062,6 +1065,7 @@ struct dwc3_scratchpad_array { * @tx_max_burst_prd: max periodic ESS transmit burst size * @tx_fifo_resize_max_num: max number of fifos allocated during txfifo resize * @clear_stall_protocol: endpoint number that requires a delayed status phase @@ -341,7 +341,7 @@ Signed-off-by: Jonathan Bell * @hsphy_interface: "utmi" or "ulpi" * @connected: true when we're connected to a host, false otherwise * @softconnect: true when gadget connect is called, false when disconnect runs -@@ -1298,6 +1302,7 @@ struct dwc3 { +@@ -1299,6 +1303,7 @@ struct dwc3 { u8 tx_max_burst_prd; u8 tx_fifo_resize_max_num; u8 clear_stall_protocol; diff --git a/target/linux/bcm27xx/patches-6.6/950-0531-serial-pl011-rp1-uart-support.patch b/target/linux/bcm27xx/patches-6.6/950-0531-serial-pl011-rp1-uart-support.patch index a36fbd2a597..f916b5709d1 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0531-serial-pl011-rp1-uart-support.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0531-serial-pl011-rp1-uart-support.patch @@ -31,7 +31,7 @@ Signed-off-by: Phil Elwell #ifdef CONFIG_ACPI_SPCR_TABLE static const struct vendor_data vendor_qdt_qdf2400_e44 = { .reg_offset = pl011_std_offsets, -@@ -2979,6 +2993,86 @@ static struct platform_driver arm_sbsa_u +@@ -2986,6 +3000,86 @@ static struct platform_driver arm_sbsa_u }, }; @@ -118,7 +118,7 @@ Signed-off-by: Phil Elwell static const struct amba_id pl011_ids[] = { { .id = 0x00041011, -@@ -3012,6 +3106,8 @@ static int __init pl011_init(void) +@@ -3019,6 +3113,8 @@ static int __init pl011_init(void) if (platform_driver_register(&arm_sbsa_uart_platform_driver)) pr_warn("could not register SBSA UART platform driver\n"); diff --git a/target/linux/bcm27xx/patches-6.6/950-0585-drm-vc4-Introduce-generation-number-enum.patch b/target/linux/bcm27xx/patches-6.6/950-0585-drm-vc4-Introduce-generation-number-enum.patch index 8372ae23fec..f57aa6d1b79 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0585-drm-vc4-Introduce-generation-number-enum.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0585-drm-vc4-Introduce-generation-number-enum.patch @@ -664,7 +664,7 @@ Signed-off-by: Maxime Ripard dispctrl &= ~(SCALER_DISPCTRL_DMAEIRQ | SCALER_DISPCTRL_SLVWREIRQ | SCALER_DISPCTRL_SLVRDEIRQ | -@@ -1398,7 +1404,7 @@ static int vc4_hvs_bind(struct device *d +@@ -1409,7 +1415,7 @@ static int vc4_hvs_bind(struct device *d /* Recompute Composite Output Buffer (COB) allocations for the displays */ diff --git a/target/linux/bcm27xx/patches-6.6/950-0590-drm-vc4-hvs-Create-hw_init-function.patch b/target/linux/bcm27xx/patches-6.6/950-0590-drm-vc4-hvs-Create-hw_init-function.patch index 7ddac057341..afa95ac2586 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0590-drm-vc4-hvs-Create-hw_init-function.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0590-drm-vc4-hvs-Create-hw_init-function.patch @@ -99,7 +99,7 @@ Signed-off-by: Maxime Ripard reg = HVS_READ(SCALER_DISPECTRL); reg &= ~SCALER_DISPECTRL_DSP2_MUX_MASK; -@@ -1440,6 +1371,86 @@ static int vc4_hvs_bind(struct device *d +@@ -1451,6 +1382,86 @@ static int vc4_hvs_bind(struct device *d HVS_WRITE(SCALER_DISPCTRL, dispctrl); diff --git a/target/linux/bcm27xx/patches-6.6/950-0591-drm-vc4-hvs-Create-cob_init-function.patch b/target/linux/bcm27xx/patches-6.6/950-0591-drm-vc4-hvs-Create-cob_init-function.patch index 6add44807ba..00cefef2353 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0591-drm-vc4-hvs-Create-cob_init-function.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0591-drm-vc4-hvs-Create-cob_init-function.patch @@ -16,7 +16,7 @@ Signed-off-by: Maxime Ripard --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -1374,6 +1374,77 @@ static int vc4_hvs_hw_init(struct vc4_hv +@@ -1385,6 +1385,77 @@ static int vc4_hvs_hw_init(struct vc4_hv return 0; } @@ -94,7 +94,7 @@ Signed-off-by: Maxime Ripard static int vc4_hvs_bind(struct device *dev, struct device *master, void *data) { struct platform_device *pdev = to_platform_device(dev); -@@ -1381,7 +1452,6 @@ static int vc4_hvs_bind(struct device *d +@@ -1392,7 +1463,6 @@ static int vc4_hvs_bind(struct device *d struct vc4_dev *vc4 = to_vc4_dev(drm); struct vc4_hvs *hvs = NULL; int ret; @@ -102,7 +102,7 @@ Signed-off-by: Maxime Ripard hvs = __vc4_hvs_alloc(vc4, NULL); if (IS_ERR(hvs)) -@@ -1451,59 +1521,9 @@ static int vc4_hvs_bind(struct device *d +@@ -1462,59 +1532,9 @@ static int vc4_hvs_bind(struct device *d if (ret) return ret; diff --git a/target/linux/bcm27xx/patches-6.6/950-0592-drm-vc4-hvs-Rename-hvs_regs-list.patch b/target/linux/bcm27xx/patches-6.6/950-0592-drm-vc4-hvs-Rename-hvs_regs-list.patch index f354f6acd7f..2ce5289a654 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0592-drm-vc4-hvs-Rename-hvs_regs-list.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0592-drm-vc4-hvs-Rename-hvs_regs-list.patch @@ -25,7 +25,7 @@ Signed-off-by: Maxime Ripard VC4_REG32(SCALER_DISPCTRL), VC4_REG32(SCALER_DISPSTAT), VC4_REG32(SCALER_DISPID), -@@ -1462,8 +1462,8 @@ static int vc4_hvs_bind(struct device *d +@@ -1473,8 +1473,8 @@ static int vc4_hvs_bind(struct device *d return PTR_ERR(hvs->regs); hvs->regset.base = hvs->regs; diff --git a/target/linux/bcm27xx/patches-6.6/950-0595-drm-vc4-hvs-Change-prototype-of-__vc4_hvs_alloc-to-p.patch b/target/linux/bcm27xx/patches-6.6/950-0595-drm-vc4-hvs-Change-prototype-of-__vc4_hvs_alloc-to-p.patch index 36c4010b7e9..e7a63dcfcb5 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0595-drm-vc4-hvs-Change-prototype-of-__vc4_hvs_alloc-to-p.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0595-drm-vc4-hvs-Change-prototype-of-__vc4_hvs_alloc-to-p.patch @@ -68,7 +68,7 @@ Signed-off-by: Maxime Ripard hvs->pdev = pdev; spin_lock_init(&hvs->mm_lock); -@@ -1451,16 +1454,17 @@ static int vc4_hvs_bind(struct device *d +@@ -1462,16 +1465,17 @@ static int vc4_hvs_bind(struct device *d struct drm_device *drm = dev_get_drvdata(master); struct vc4_dev *vc4 = to_vc4_dev(drm); struct vc4_hvs *hvs = NULL; diff --git a/target/linux/bcm27xx/patches-6.6/950-0602-drm-vc4-Enable-SCALER_CONTROL-early-in-HVS-init.patch b/target/linux/bcm27xx/patches-6.6/950-0602-drm-vc4-Enable-SCALER_CONTROL-early-in-HVS-init.patch index 62406a268b8..d694e865722 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0602-drm-vc4-Enable-SCALER_CONTROL-early-in-HVS-init.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0602-drm-vc4-Enable-SCALER_CONTROL-early-in-HVS-init.patch @@ -35,7 +35,7 @@ Signed-off-by: Tim Gover dispctrl |= SCALER_DISPCTRL_DISPEIRQ(0) | SCALER_DISPCTRL_DISPEIRQ(1) | SCALER_DISPCTRL_DISPEIRQ(2); -@@ -1512,6 +1514,10 @@ static int vc4_hvs_bind(struct device *d +@@ -1523,6 +1525,10 @@ static int vc4_hvs_bind(struct device *d else hvs->dlist = hvs->regs + SCALER5_DLIST_START; @@ -46,7 +46,7 @@ Signed-off-by: Tim Gover /* Upload filter kernels. We only have the one for now, so we * keep it around for the lifetime of the driver. */ -@@ -1521,10 +1527,6 @@ static int vc4_hvs_bind(struct device *d +@@ -1532,10 +1538,6 @@ static int vc4_hvs_bind(struct device *d if (ret) return ret; diff --git a/target/linux/bcm27xx/patches-6.6/950-0610-drm-vc4-hvs-Support-BCM2712-HVS.patch b/target/linux/bcm27xx/patches-6.6/950-0610-drm-vc4-hvs-Support-BCM2712-HVS.patch index 9d19b23d95a..390d4454976 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0610-drm-vc4-hvs-Support-BCM2712-HVS.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0610-drm-vc4-hvs-Support-BCM2712-HVS.patch @@ -734,7 +734,7 @@ Signed-off-by: Maxime Ripard vc4->hvs = hvs; -@@ -1379,10 +1715,124 @@ static int vc4_hvs_hw_init(struct vc4_hv +@@ -1390,10 +1726,124 @@ static int vc4_hvs_hw_init(struct vc4_hv return 0; } @@ -860,7 +860,7 @@ Signed-off-by: Maxime Ripard /* * Recompute Composite Output Buffer (COB) allocations for the -@@ -1443,6 +1893,31 @@ static int vc4_hvs_cob_init(struct vc4_h +@@ -1454,6 +1904,31 @@ static int vc4_hvs_cob_init(struct vc4_h HVS_WRITE(SCALER_DISPBASE0, reg); break; @@ -892,7 +892,7 @@ Signed-off-by: Maxime Ripard default: return -EINVAL; } -@@ -1468,10 +1943,16 @@ static int vc4_hvs_bind(struct device *d +@@ -1479,10 +1954,16 @@ static int vc4_hvs_bind(struct device *d return PTR_ERR(hvs); hvs->regset.base = hvs->regs; @@ -912,7 +912,7 @@ Signed-off-by: Maxime Ripard struct rpi_firmware *firmware; struct device_node *node; unsigned int max_rate; -@@ -1485,12 +1966,20 @@ static int vc4_hvs_bind(struct device *d +@@ -1496,12 +1977,20 @@ static int vc4_hvs_bind(struct device *d if (!firmware) return -EPROBE_DEFER; @@ -934,7 +934,7 @@ Signed-off-by: Maxime Ripard max_rate = rpi_firmware_clk_get_max_rate(firmware, RPI_FIRMWARE_CORE_CLK_ID); rpi_firmware_put(firmware); -@@ -1507,14 +1996,51 @@ static int vc4_hvs_bind(struct device *d +@@ -1518,14 +2007,51 @@ static int vc4_hvs_bind(struct device *d dev_err(&pdev->dev, "Couldn't enable the core clock\n"); return ret; } @@ -990,7 +990,7 @@ Signed-off-by: Maxime Ripard if (ret) return ret; -@@ -1531,10 +2057,12 @@ static int vc4_hvs_bind(struct device *d +@@ -1542,10 +2068,12 @@ static int vc4_hvs_bind(struct device *d if (ret) return ret; @@ -1007,7 +1007,7 @@ Signed-off-by: Maxime Ripard return 0; } -@@ -1559,6 +2087,7 @@ static void vc4_hvs_unbind(struct device +@@ -1570,6 +2098,7 @@ static void vc4_hvs_unbind(struct device drm_mm_remove_node(node); drm_mm_takedown(&vc4->hvs->lbm_mm); @@ -1015,7 +1015,7 @@ Signed-off-by: Maxime Ripard clk_disable_unprepare(hvs->core_clk); vc4->hvs = NULL; -@@ -1581,6 +2110,7 @@ static void vc4_hvs_dev_remove(struct pl +@@ -1592,6 +2121,7 @@ static void vc4_hvs_dev_remove(struct pl static const struct of_device_id vc4_hvs_dt_match[] = { { .compatible = "brcm,bcm2711-hvs" }, diff --git a/target/linux/bcm27xx/patches-6.6/950-0757-drm-panel-add-panel-dsi.patch b/target/linux/bcm27xx/patches-6.6/950-0757-drm-panel-add-panel-dsi.patch index 989fe3315f7..4e9ba92a188 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0757-drm-panel-add-panel-dsi.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0757-drm-panel-add-panel-dsi.patch @@ -23,7 +23,7 @@ Signed-off-by: Timon Skerutsch /** * struct panel_desc - Describes a simple panel. -@@ -4875,6 +4876,9 @@ static const struct panel_desc_dsi osd10 +@@ -4903,6 +4904,9 @@ static const struct panel_desc_dsi osd10 .lanes = 4, }; @@ -33,7 +33,7 @@ Signed-off-by: Timon Skerutsch static const struct of_device_id dsi_of_match[] = { { .compatible = "auo,b080uan01", -@@ -4898,20 +4902,137 @@ static const struct of_device_id dsi_of_ +@@ -4926,20 +4930,137 @@ static const struct of_device_id dsi_of_ .compatible = "osddisplays,osd101t2045-53ts", .data = &osd101t2045_53ts }, { diff --git a/target/linux/bcm27xx/patches-6.6/950-0829-vc4-hvs-Add-support-for-D0-register-changes.patch b/target/linux/bcm27xx/patches-6.6/950-0829-vc4-hvs-Add-support-for-D0-register-changes.patch index c8c284a1394..82edd649c0c 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0829-vc4-hvs-Add-support-for-D0-register-changes.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0829-vc4-hvs-Add-support-for-D0-register-changes.patch @@ -273,7 +273,7 @@ Signed-off-by: Dom Cobley else dlist_size = 4096; -@@ -1894,14 +1953,17 @@ static int vc6_hvs_hw_init(struct vc4_hv +@@ -1905,14 +1964,17 @@ static int vc6_hvs_hw_init(struct vc4_hv const struct vc6_csc_coeff_entry *coeffs; unsigned int i; @@ -295,7 +295,7 @@ Signed-off-by: Dom Cobley for (i = 0; i < 6; i++) { coeffs = &csc_coeffs[i / 3][i % 3]; -@@ -2000,21 +2062,21 @@ static int vc4_hvs_cob_init(struct vc4_h +@@ -2011,21 +2073,21 @@ static int vc4_hvs_cob_init(struct vc4_h reg = 0; top = 3840; @@ -320,7 +320,7 @@ Signed-off-by: Dom Cobley VC4_SET_FIELD(top, SCALER6_DISPX_COB_TOP) | VC4_SET_FIELD(base, SCALER6_DISPX_COB_BASE)); break; -@@ -2045,7 +2107,10 @@ static int vc4_hvs_bind(struct device *d +@@ -2056,7 +2118,10 @@ static int vc4_hvs_bind(struct device *d hvs->regset.base = hvs->regs; @@ -332,7 +332,7 @@ Signed-off-by: Dom Cobley hvs->regset.regs = vc6_hvs_regs; hvs->regset.nregs = ARRAY_SIZE(vc6_hvs_regs); } else { -@@ -2212,6 +2277,7 @@ static void vc4_hvs_dev_remove(struct pl +@@ -2223,6 +2288,7 @@ static void vc4_hvs_dev_remove(struct pl static const struct of_device_id vc4_hvs_dt_match[] = { { .compatible = "brcm,bcm2711-hvs" }, { .compatible = "brcm,bcm2712-hvs" }, diff --git a/target/linux/bcm27xx/patches-6.6/950-0830-vc4-hvs-Updates-to-support-D0-alpha-and-csc-changes.patch b/target/linux/bcm27xx/patches-6.6/950-0830-vc4-hvs-Updates-to-support-D0-alpha-and-csc-changes.patch index 0535f63224f..ec7071c5950 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0830-vc4-hvs-Updates-to-support-D0-alpha-and-csc-changes.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0830-vc4-hvs-Updates-to-support-D0-alpha-and-csc-changes.patch @@ -16,7 +16,7 @@ Signed-off-by: Dom Cobley --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -1892,6 +1892,17 @@ static int vc4_hvs_hw_init(struct vc4_hv +@@ -1903,6 +1903,17 @@ static int vc4_hvs_hw_init(struct vc4_hv #define CFC1_N_MA_CSC_COEFF_C23(x) (0xa03c + ((x) * 0x3000)) #define CFC1_N_MA_CSC_COEFF_C24(x) (0xa040 + ((x) * 0x3000)) @@ -34,7 +34,7 @@ Signed-off-by: Dom Cobley /* 4 S2.22 multiplication factors, and 1 S9.15 addititive element for each of 3 * output components */ -@@ -1962,31 +1973,43 @@ static int vc6_hvs_hw_init(struct vc4_hv +@@ -1973,31 +1984,43 @@ static int vc6_hvs_hw_init(struct vc4_hv HVS_WRITE(SCALER6(PRI_MAP0), 0xffffffff); HVS_WRITE(SCALER6(PRI_MAP1), 0xffffffff); diff --git a/target/linux/bcm27xx/patches-6.6/950-0842-ARM-pl011-Add-rs485-to-the-RP1-support.patch b/target/linux/bcm27xx/patches-6.6/950-0842-ARM-pl011-Add-rs485-to-the-RP1-support.patch index ed90f11920f..75cdb63c6a4 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0842-ARM-pl011-Add-rs485-to-the-RP1-support.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0842-ARM-pl011-Add-rs485-to-the-RP1-support.patch @@ -13,7 +13,7 @@ Signed-off-by: Phil Elwell --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c -@@ -3033,6 +3033,8 @@ static int pl011_axi_probe(struct platfo +@@ -3040,6 +3040,8 @@ static int pl011_axi_probe(struct platfo uap->port.iotype = vendor->access_32b ? UPIO_MEM32 : UPIO_MEM; uap->port.irq = irq; uap->port.ops = &amba_pl011_pops; diff --git a/target/linux/bcm27xx/patches-6.6/950-0853-drivers-usb-dwc3-add-FS-LS-bus-instance-parkmode-dis.patch b/target/linux/bcm27xx/patches-6.6/950-0853-drivers-usb-dwc3-add-FS-LS-bus-instance-parkmode-dis.patch index 901553cd6ce..706baccdc72 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0853-drivers-usb-dwc3-add-FS-LS-bus-instance-parkmode-dis.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0853-drivers-usb-dwc3-add-FS-LS-bus-instance-parkmode-dis.patch @@ -45,7 +45,7 @@ Signed-off-by: Jonathan Bell #define DWC3_GUCTL1_RESUME_OPMODE_HS_HOST BIT(10) /* Global Status Register */ -@@ -1116,10 +1117,12 @@ struct dwc3_scratchpad_array { +@@ -1117,10 +1118,12 @@ struct dwc3_scratchpad_array { * generation after resume from suspend. * @ulpi_ext_vbus_drv: Set to confiure the upli chip to drives CPEN pin * VBUS with an external supply. @@ -62,7 +62,7 @@ Signed-off-by: Jonathan Bell * @tx_de_emphasis_quirk: set if we enable Tx de-emphasis quirk * @tx_de_emphasis: Tx de-emphasis value * 0 - -6dB de-emphasis -@@ -1346,6 +1349,7 @@ struct dwc3 { +@@ -1347,6 +1350,7 @@ struct dwc3 { unsigned ulpi_ext_vbus_drv:1; unsigned parkmode_disable_ss_quirk:1; unsigned parkmode_disable_hs_quirk:1; diff --git a/target/linux/bcm27xx/patches-6.6/950-0983-drivers-mmc-preallocate-a-block-for-SD-extension-reg.patch b/target/linux/bcm27xx/patches-6.6/950-0983-drivers-mmc-preallocate-a-block-for-SD-extension-reg.patch index 4d90245f364..2d1d317891c 100644 --- a/target/linux/bcm27xx/patches-6.6/950-0983-drivers-mmc-preallocate-a-block-for-SD-extension-reg.patch +++ b/target/linux/bcm27xx/patches-6.6/950-0983-drivers-mmc-preallocate-a-block-for-SD-extension-reg.patch @@ -19,7 +19,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c -@@ -264,6 +264,8 @@ static void mmc_release_card(struct devi +@@ -266,6 +266,8 @@ static void mmc_release_card(struct devi sdio_free_common_cis(card); @@ -145,7 +145,7 @@ Signed-off-by: Jonathan Bell --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h -@@ -320,6 +320,7 @@ struct mmc_card { +@@ -321,6 +321,7 @@ struct mmc_card { struct sd_switch_caps sw_caps; /* switch (CMD6) caps */ struct sd_ext_reg ext_power; /* SD extension reg for PM */ struct sd_ext_reg ext_perf; /* SD extension reg for PERF */ diff --git a/target/linux/bcm27xx/patches-6.6/950-1167-mmc-restrict-posted-write-counts-for-SD-cards-in-CQ-.patch b/target/linux/bcm27xx/patches-6.6/950-1167-mmc-restrict-posted-write-counts-for-SD-cards-in-CQ-.patch index 2ba494958ea..b1ddf96311c 100644 --- a/target/linux/bcm27xx/patches-6.6/950-1167-mmc-restrict-posted-write-counts-for-SD-cards-in-CQ-.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1167-mmc-restrict-posted-write-counts-for-SD-cards-in-CQ-.patch @@ -146,7 +146,7 @@ Signed-off-by: Jonathan Bell card->ext_perf.fno = fno; --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h -@@ -343,6 +343,8 @@ struct mmc_card { +@@ -344,6 +344,8 @@ struct mmc_card { unsigned int nr_parts; struct workqueue_struct *complete_wq; /* Private workqueue */ diff --git a/target/linux/bcm27xx/patches-6.6/950-1218-Bluetooth-hci_sync-Fix-crash-on-NULL-parent.patch b/target/linux/bcm27xx/patches-6.6/950-1218-Bluetooth-hci_sync-Fix-crash-on-NULL-parent.patch index 3b4c7e65afc..223e2df2b78 100644 --- a/target/linux/bcm27xx/patches-6.6/950-1218-Bluetooth-hci_sync-Fix-crash-on-NULL-parent.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1218-Bluetooth-hci_sync-Fix-crash-on-NULL-parent.patch @@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c -@@ -4865,7 +4865,8 @@ static const struct { +@@ -4872,7 +4872,8 @@ static const struct { */ static int hci_dev_setup_sync(struct hci_dev *hdev) { diff --git a/target/linux/bcm27xx/patches-6.6/950-1257-drm-vc4-Add-support-for-per-plane-scaling-filter-sel.patch b/target/linux/bcm27xx/patches-6.6/950-1257-drm-vc4-Add-support-for-per-plane-scaling-filter-sel.patch index 52a13c6508d..e4d2aace93b 100644 --- a/target/linux/bcm27xx/patches-6.6/950-1257-drm-vc4-Add-support-for-per-plane-scaling-filter-sel.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1257-drm-vc4-Add-support-for-per-plane-scaling-filter-sel.patch @@ -40,7 +40,7 @@ Signed-off-by: Dave Stevenson static int vc4_hvs_upload_linear_kernel(struct vc4_hvs *hvs, struct drm_mm_node *space, -@@ -2259,14 +2262,19 @@ static int vc4_hvs_bind(struct device *d +@@ -2270,14 +2273,19 @@ static int vc4_hvs_bind(struct device *d if (ret) return ret; @@ -62,7 +62,7 @@ Signed-off-by: Dave Stevenson ret = vc4_hvs_cob_init(hvs); if (ret) -@@ -2292,6 +2300,8 @@ static void vc4_hvs_unbind(struct device +@@ -2303,6 +2311,8 @@ static void vc4_hvs_unbind(struct device if (drm_mm_node_allocated(&vc4->hvs->mitchell_netravali_filter)) drm_mm_remove_node(&vc4->hvs->mitchell_netravali_filter); diff --git a/target/linux/bcm27xx/patches-6.6/950-1260-drivers-mmc-disable-write-caching-on-Samsung-2023-mo.patch b/target/linux/bcm27xx/patches-6.6/950-1260-drivers-mmc-disable-write-caching-on-Samsung-2023-mo.patch index 35607aacafb..761e5bea7f6 100644 --- a/target/linux/bcm27xx/patches-6.6/950-1260-drivers-mmc-disable-write-caching-on-Samsung-2023-mo.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1260-drivers-mmc-disable-write-caching-on-Samsung-2023-mo.patch @@ -20,8 +20,8 @@ Signed-off-by: Jonathan Bell --- a/drivers/mmc/core/card.h +++ b/drivers/mmc/core/card.h -@@ -84,6 +84,7 @@ struct mmc_fixup { - #define CID_MANFID_TOSHIBA 0x11 +@@ -85,6 +85,7 @@ struct mmc_fixup { + #define CID_MANFID_GIGASTONE 0x12 #define CID_MANFID_MICRON 0x13 #define CID_MANFID_SAMSUNG 0x15 +#define CID_MANFID_SAMSUNG_SD 0x1b @@ -30,9 +30,9 @@ Signed-off-by: Jonathan Bell #define CID_MANFID_HYNIX 0x90 --- a/drivers/mmc/core/quirks.h +++ b/drivers/mmc/core/quirks.h -@@ -25,6 +25,14 @@ static const struct mmc_fixup __maybe_un - 0, -1ull, SDIO_ANY_ID, SDIO_ANY_ID, add_quirk_sd, - MMC_QUIRK_BROKEN_SD_CACHE, EXT_CSD_REV_ANY), +@@ -34,6 +34,14 @@ static const struct mmc_fixup __maybe_un + MMC_QUIRK_BROKEN_SD_CACHE | MMC_QUIRK_BROKEN_SD_POWEROFF_NOTIFY, + EXT_CSD_REV_ANY), + /* + * Samsung Pro Plus/EVO Plus/Pro Ultimate SD cards (2023) claim to cache diff --git a/target/linux/bcm27xx/patches-6.6/950-1282-tty-serial-pl011-Also-unregister-pl011_axi_platform_.patch b/target/linux/bcm27xx/patches-6.6/950-1282-tty-serial-pl011-Also-unregister-pl011_axi_platform_.patch index 3a5f9f15c38..593d4a1e538 100644 --- a/target/linux/bcm27xx/patches-6.6/950-1282-tty-serial-pl011-Also-unregister-pl011_axi_platform_.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1282-tty-serial-pl011-Also-unregister-pl011_axi_platform_.patch @@ -12,7 +12,7 @@ Signed-off-by: Dom Cobley --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c -@@ -3122,6 +3122,7 @@ static int __init pl011_init(void) +@@ -3129,6 +3129,7 @@ static int __init pl011_init(void) static void __exit pl011_exit(void) { platform_driver_unregister(&arm_sbsa_uart_platform_driver); diff --git a/target/linux/bcm27xx/patches-6.6/950-1323-drm-vc4-Remove-request-for-min-clocks-when-hdmi-outp.patch b/target/linux/bcm27xx/patches-6.6/950-1323-drm-vc4-Remove-request-for-min-clocks-when-hdmi-outp.patch index 1a1e3439e5e..cde586b126c 100644 --- a/target/linux/bcm27xx/patches-6.6/950-1323-drm-vc4-Remove-request-for-min-clocks-when-hdmi-outp.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1323-drm-vc4-Remove-request-for-min-clocks-when-hdmi-outp.patch @@ -50,7 +50,7 @@ Signed-off-by: Dom Cobley return 0; --- a/drivers/gpu/drm/vc4/vc4_hvs.c +++ b/drivers/gpu/drm/vc4/vc4_hvs.c -@@ -2312,7 +2312,10 @@ static void vc4_hvs_unbind(struct device +@@ -2323,7 +2323,10 @@ static void vc4_hvs_unbind(struct device drm_mm_remove_node(node); drm_mm_takedown(&vc4->hvs->lbm_mm); diff --git a/target/linux/bcm27xx/patches-6.6/950-1333-mmc-quirks-disable-cache-on-more-known-bad-Sandisk-c.patch b/target/linux/bcm27xx/patches-6.6/950-1333-mmc-quirks-disable-cache-on-more-known-bad-Sandisk-c.patch index 109c502e13f..c62b301c22f 100644 --- a/target/linux/bcm27xx/patches-6.6/950-1333-mmc-quirks-disable-cache-on-more-known-bad-Sandisk-c.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1333-mmc-quirks-disable-cache-on-more-known-bad-Sandisk-c.patch @@ -14,7 +14,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/mmc/core/quirks.h +++ b/drivers/mmc/core/quirks.h -@@ -33,6 +33,18 @@ static const struct mmc_fixup __maybe_un +@@ -42,6 +42,18 @@ static const struct mmc_fixup __maybe_un 0, -1ull, SDIO_ANY_ID, SDIO_ANY_ID, add_quirk_sd, MMC_QUIRK_BROKEN_SD_CACHE, EXT_CSD_REV_ANY), diff --git a/target/linux/bcm27xx/patches-6.6/950-1336-mmc-quirks-add-MMC_QUIRK_BROKEN_ERASE-for-Phison-Int.patch b/target/linux/bcm27xx/patches-6.6/950-1336-mmc-quirks-add-MMC_QUIRK_BROKEN_ERASE-for-Phison-Int.patch index ba61b15ea15..feb6eaf8ead 100644 --- a/target/linux/bcm27xx/patches-6.6/950-1336-mmc-quirks-add-MMC_QUIRK_BROKEN_ERASE-for-Phison-Int.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1336-mmc-quirks-add-MMC_QUIRK_BROKEN_ERASE-for-Phison-Int.patch @@ -15,7 +15,7 @@ Signed-off-by: Jonathan Bell --- a/drivers/mmc/core/quirks.h +++ b/drivers/mmc/core/quirks.h -@@ -162,6 +162,15 @@ static const struct mmc_fixup __maybe_un +@@ -171,6 +171,15 @@ static const struct mmc_fixup __maybe_un MMC_FIXUP("SD32G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), MMC_FIXUP("SD64G", 0x41, 0x3432, add_quirk, MMC_QUIRK_ERASE_BROKEN), diff --git a/target/linux/bcm27xx/patches-6.6/950-1340-mm-numa-Allow-override-of-kernel-s-default-NUMA-poli.patch b/target/linux/bcm27xx/patches-6.6/950-1340-mm-numa-Allow-override-of-kernel-s-default-NUMA-poli.patch index dceb6df45f8..f2d7a91b77f 100644 --- a/target/linux/bcm27xx/patches-6.6/950-1340-mm-numa-Allow-override-of-kernel-s-default-NUMA-poli.patch +++ b/target/linux/bcm27xx/patches-6.6/950-1340-mm-numa-Allow-override-of-kernel-s-default-NUMA-poli.patch @@ -23,7 +23,7 @@ Signed-off-by: Tvrtko Ursulin --- a/mm/mempolicy.c +++ b/mm/mempolicy.c -@@ -2963,7 +2963,9 @@ void __init numa_policy_init(void) +@@ -2947,7 +2947,9 @@ void __init numa_policy_init(void) /* Reset policy of current process to default */ void numa_default_policy(void) { @@ -34,7 +34,7 @@ Signed-off-by: Tvrtko Ursulin } /* -@@ -2981,7 +2983,6 @@ static const char * const policy_modes[] +@@ -2965,7 +2967,6 @@ static const char * const policy_modes[] }; @@ -42,7 +42,7 @@ Signed-off-by: Tvrtko Ursulin /** * mpol_parse_str - parse string to mempolicy, for tmpfs mpol mount option. * @str: string containing mempolicy to parse -@@ -2994,13 +2995,18 @@ static const char * const policy_modes[] +@@ -2978,13 +2979,18 @@ static const char * const policy_modes[] */ int mpol_parse_str(char *str, struct mempolicy **mpol) { @@ -62,7 +62,7 @@ Signed-off-by: Tvrtko Ursulin if (flags) *flags++ = '\0'; /* terminate mode string */ -@@ -3079,9 +3085,16 @@ int mpol_parse_str(char *str, struct mem +@@ -3063,9 +3069,16 @@ int mpol_parse_str(char *str, struct mem goto out; } @@ -82,7 +82,7 @@ Signed-off-by: Tvrtko Ursulin /* * Save nodes for mpol_to_str() to show the tmpfs mount options -@@ -3114,7 +3127,29 @@ out: +@@ -3098,7 +3111,29 @@ out: *mpol = new; return err; } diff --git a/target/linux/bcm53xx/patches-6.6/180-usb-xhci-add-support-for-performing-fake-doorbell.patch b/target/linux/bcm53xx/patches-6.6/180-usb-xhci-add-support-for-performing-fake-doorbell.patch index 13b6566a8e9..7ac12a290f6 100644 --- a/target/linux/bcm53xx/patches-6.6/180-usb-xhci-add-support-for-performing-fake-doorbell.patch +++ b/target/linux/bcm53xx/patches-6.6/180-usb-xhci-add-support-for-performing-fake-doorbell.patch @@ -103,11 +103,11 @@ it on BCM4708 family. if (xhci->quirks & XHCI_NEC_HOST) --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h -@@ -1660,6 +1660,7 @@ struct xhci_hcd { - #define XHCI_ZHAOXIN_HOST BIT_ULL(46) +@@ -1661,6 +1661,7 @@ struct xhci_hcd { #define XHCI_WRITE_64_HI_LO BIT_ULL(47) #define XHCI_CDNS_SCTX_QUIRK BIT_ULL(48) -+#define XHCI_FAKE_DOORBELL BIT_ULL(49) + #define XHCI_ETRON_HOST BIT_ULL(49) ++#define XHCI_FAKE_DOORBELL BIT_ULL(50) unsigned int num_active_eps; unsigned int limit_active_eps; diff --git a/target/linux/generic/backport-6.6/611-01-v6.11-udp-Allow-GSO-transmit-from-devices-with-no-checksum.patch b/target/linux/generic/backport-6.6/611-01-v6.11-udp-Allow-GSO-transmit-from-devices-with-no-checksum.patch index 2f03074bc9a..b9633a87725 100644 --- a/target/linux/generic/backport-6.6/611-01-v6.11-udp-Allow-GSO-transmit-from-devices-with-no-checksum.patch +++ b/target/linux/generic/backport-6.6/611-01-v6.11-udp-Allow-GSO-transmit-from-devices-with-no-checksum.patch @@ -82,7 +82,7 @@ Signed-off-by: Jakub Kicinski int delta = sum_truesize - gso_skb->truesize; --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c -@@ -1261,8 +1261,7 @@ static int udp_v6_send_skb(struct sk_buf +@@ -1258,8 +1258,7 @@ static int udp_v6_send_skb(struct sk_buf kfree_skb(skb); return -EINVAL; } diff --git a/target/linux/generic/backport-6.6/780-04-v6.8-r8169-improve-handling-task-scheduling.patch b/target/linux/generic/backport-6.6/780-04-v6.8-r8169-improve-handling-task-scheduling.patch index 757c800533d..36ac67375a2 100644 --- a/target/linux/generic/backport-6.6/780-04-v6.8-r8169-improve-handling-task-scheduling.patch +++ b/target/linux/generic/backport-6.6/780-04-v6.8-r8169-improve-handling-task-scheduling.patch @@ -29,7 +29,7 @@ Signed-off-by: Jakub Kicinski set_bit(flag, tp->wk.flags); schedule_work(&tp->wk.work); } -@@ -4520,8 +4523,7 @@ static void rtl_task(struct work_struct +@@ -4526,8 +4529,7 @@ static void rtl_task(struct work_struct rtnl_lock(); diff --git a/target/linux/generic/backport-6.6/780-05-v6.8-r8169-add-support-for-LED-s-on-RTL8168-RTL8101.patch b/target/linux/generic/backport-6.6/780-05-v6.8-r8169-add-support-for-LED-s-on-RTL8168-RTL8101.patch index 0504a00df4f..ccb8e413fef 100644 --- a/target/linux/generic/backport-6.6/780-05-v6.8-r8169-add-support-for-LED-s-on-RTL8168-RTL8101.patch +++ b/target/linux/generic/backport-6.6/780-05-v6.8-r8169-add-support-for-LED-s-on-RTL8168-RTL8101.patch @@ -296,7 +296,7 @@ Signed-off-by: David S. Miller static void r8168fp_adjust_ocp_cmd(struct rtl8169_private *tp, u32 *cmd, int type) { /* based on RTL8168FP_OOBMAC_BASE in vendor driver */ -@@ -5197,6 +5255,7 @@ static int rtl_init_one(struct pci_dev * +@@ -5203,6 +5261,7 @@ static int rtl_init_one(struct pci_dev * raw_spin_lock_init(&tp->cfg9346_usage_lock); raw_spin_lock_init(&tp->config25_lock); raw_spin_lock_init(&tp->mac_ocp_lock); @@ -304,7 +304,7 @@ Signed-off-by: David S. Miller dev->tstats = devm_netdev_alloc_pcpu_stats(&pdev->dev, struct pcpu_sw_netstats); -@@ -5353,6 +5412,12 @@ static int rtl_init_one(struct pci_dev * +@@ -5359,6 +5418,12 @@ static int rtl_init_one(struct pci_dev * if (rc) return rc; diff --git a/target/linux/generic/backport-6.6/780-06-v6.8-r8169-fix-building-with-CONFIG_LEDS_CLASS-m.patch b/target/linux/generic/backport-6.6/780-06-v6.8-r8169-fix-building-with-CONFIG_LEDS_CLASS-m.patch index 1adaf87625e..3860de75700 100644 --- a/target/linux/generic/backport-6.6/780-06-v6.8-r8169-fix-building-with-CONFIG_LEDS_CLASS-m.patch +++ b/target/linux/generic/backport-6.6/780-06-v6.8-r8169-fix-building-with-CONFIG_LEDS_CLASS-m.patch @@ -59,7 +59,7 @@ Signed-off-by: Jakub Kicinski obj-$(CONFIG_R8169) += r8169.o --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -5412,11 +5412,10 @@ static int rtl_init_one(struct pci_dev * +@@ -5418,11 +5418,10 @@ static int rtl_init_one(struct pci_dev * if (rc) return rc; diff --git a/target/linux/generic/backport-6.6/780-07-v6.9-r8169-simplify-EEE-handling.patch b/target/linux/generic/backport-6.6/780-07-v6.9-r8169-simplify-EEE-handling.patch index c3f94b3aff0..0f5f68c68a1 100644 --- a/target/linux/generic/backport-6.6/780-07-v6.9-r8169-simplify-EEE-handling.patch +++ b/target/linux/generic/backport-6.6/780-07-v6.9-r8169-simplify-EEE-handling.patch @@ -75,7 +75,7 @@ Signed-off-by: Jakub Kicinski genphy_soft_reset(tp->phydev); } -@@ -5114,7 +5089,9 @@ static int r8169_mdio_register(struct rt +@@ -5120,7 +5095,9 @@ static int r8169_mdio_register(struct rt } tp->phydev->mac_managed_pm = true; @@ -86,7 +86,7 @@ Signed-off-by: Jakub Kicinski phy_support_asym_pause(tp->phydev); /* PHY will be woken up in rtl_open() */ -@@ -5249,7 +5226,6 @@ static int rtl_init_one(struct pci_dev * +@@ -5255,7 +5232,6 @@ static int rtl_init_one(struct pci_dev * tp->dev = dev; tp->pci_dev = pdev; tp->supports_gmii = ent->driver_data == RTL_CFG_NO_GBIT ? 0 : 1; diff --git a/target/linux/generic/backport-6.6/780-08-v6.9-r8169-add-support-for-RTL8126A.patch b/target/linux/generic/backport-6.6/780-08-v6.9-r8169-add-support-for-RTL8126A.patch index 354aacf1cf7..210730d6b12 100644 --- a/target/linux/generic/backport-6.6/780-08-v6.9-r8169-add-support-for-RTL8126A.patch +++ b/target/linux/generic/backport-6.6/780-08-v6.9-r8169-add-support-for-RTL8126A.patch @@ -311,7 +311,7 @@ Signed-off-by: David S. Miller rtl_enable_rxdvgate(tp); fsleep(2000); break; -@@ -4105,8 +4163,7 @@ static unsigned int rtl_quirk_packet_pad +@@ -4111,8 +4169,7 @@ static unsigned int rtl_quirk_packet_pad switch (tp->mac_version) { case RTL_GIGA_MAC_VER_34: @@ -321,7 +321,7 @@ Signed-off-by: David S. Miller padto = max_t(unsigned int, padto, ETH_ZLEN); break; default: -@@ -5141,7 +5198,7 @@ static void rtl_hw_initialize(struct rtl +@@ -5147,7 +5204,7 @@ static void rtl_hw_initialize(struct rtl case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_48: rtl_hw_init_8168g(tp); break; diff --git a/target/linux/generic/backport-6.6/780-10-v6.9-r8169-simplify-code-by-using-core-provided-pcpu-stat.patch b/target/linux/generic/backport-6.6/780-10-v6.9-r8169-simplify-code-by-using-core-provided-pcpu-stat.patch index c155b11431f..959a1b0276d 100644 --- a/target/linux/generic/backport-6.6/780-10-v6.9-r8169-simplify-code-by-using-core-provided-pcpu-stat.patch +++ b/target/linux/generic/backport-6.6/780-10-v6.9-r8169-simplify-code-by-using-core-provided-pcpu-stat.patch @@ -16,7 +16,7 @@ Signed-off-by: Paolo Abeni --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -5290,11 +5290,6 @@ static int rtl_init_one(struct pci_dev * +@@ -5296,11 +5296,6 @@ static int rtl_init_one(struct pci_dev * raw_spin_lock_init(&tp->mac_ocp_lock); mutex_init(&tp->led_lock); @@ -28,7 +28,7 @@ Signed-off-by: Paolo Abeni /* Get the *optional* external "ether_clk" used on some boards */ tp->clk = devm_clk_get_optional_enabled(&pdev->dev, "ether_clk"); if (IS_ERR(tp->clk)) -@@ -5409,6 +5404,8 @@ static int rtl_init_one(struct pci_dev * +@@ -5415,6 +5410,8 @@ static int rtl_init_one(struct pci_dev * dev->hw_features |= NETIF_F_RXALL; dev->hw_features |= NETIF_F_RXFCS; diff --git a/target/linux/generic/backport-6.6/780-11-v6.9-r8169-add-LED-support-for-RTL8125-RTL8126.patch b/target/linux/generic/backport-6.6/780-11-v6.9-r8169-add-LED-support-for-RTL8125-RTL8126.patch index 1c793f9b1d3..fa9b4f10620 100644 --- a/target/linux/generic/backport-6.6/780-11-v6.9-r8169-add-LED-support-for-RTL8125-RTL8126.patch +++ b/target/linux/generic/backport-6.6/780-11-v6.9-r8169-add-LED-support-for-RTL8125-RTL8126.patch @@ -225,7 +225,7 @@ Signed-off-by: Jakub Kicinski void r8169_get_led_name(struct rtl8169_private *tp, int idx, char *buf, int buf_len) { -@@ -5442,10 +5493,12 @@ static int rtl_init_one(struct pci_dev * +@@ -5448,10 +5499,12 @@ static int rtl_init_one(struct pci_dev * if (rc) return rc; diff --git a/target/linux/generic/backport-6.6/780-16-v6.9-r8169-fix-LED-related-deadlock-on-module-removal.patch b/target/linux/generic/backport-6.6/780-16-v6.9-r8169-fix-LED-related-deadlock-on-module-removal.patch index cb031d8f348..26290cdef56 100644 --- a/target/linux/generic/backport-6.6/780-16-v6.9-r8169-fix-LED-related-deadlock-on-module-removal.patch +++ b/target/linux/generic/backport-6.6/780-16-v6.9-r8169-fix-LED-related-deadlock-on-module-removal.patch @@ -124,7 +124,7 @@ Signed-off-by: David S. Miller u32 ocp_base; }; -@@ -5069,6 +5071,8 @@ static void rtl_remove_one(struct pci_de +@@ -5075,6 +5077,8 @@ static void rtl_remove_one(struct pci_de cancel_work_sync(&tp->wk.work); @@ -133,7 +133,7 @@ Signed-off-by: David S. Miller unregister_netdev(tp->dev); if (tp->dash_type != RTL_DASH_NONE) -@@ -5527,9 +5531,9 @@ static int rtl_init_one(struct pci_dev * +@@ -5533,9 +5537,9 @@ static int rtl_init_one(struct pci_dev * if (IS_ENABLED(CONFIG_R8169_LEDS)) { if (rtl_is_8125(tp)) diff --git a/target/linux/generic/backport-6.6/780-17-v6.9-r8169-add-missing-conditional-compiling-for-call-to-.patch b/target/linux/generic/backport-6.6/780-17-v6.9-r8169-add-missing-conditional-compiling-for-call-to-.patch index 0412c919035..265c715f5e4 100644 --- a/target/linux/generic/backport-6.6/780-17-v6.9-r8169-add-missing-conditional-compiling-for-call-to-.patch +++ b/target/linux/generic/backport-6.6/780-17-v6.9-r8169-add-missing-conditional-compiling-for-call-to-.patch @@ -19,7 +19,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -5071,7 +5071,8 @@ static void rtl_remove_one(struct pci_de +@@ -5077,7 +5077,8 @@ static void rtl_remove_one(struct pci_de cancel_work_sync(&tp->wk.work); diff --git a/target/linux/generic/backport-6.6/780-20-v6.11-r8169-disable-interrupt-source-RxOverflow.patch b/target/linux/generic/backport-6.6/780-20-v6.11-r8169-disable-interrupt-source-RxOverflow.patch index fc10a3ff143..9ded598665a 100644 --- a/target/linux/generic/backport-6.6/780-20-v6.11-r8169-disable-interrupt-source-RxOverflow.patch +++ b/target/linux/generic/backport-6.6/780-20-v6.11-r8169-disable-interrupt-source-RxOverflow.patch @@ -18,7 +18,7 @@ Signed-off-by: Jakub Kicinski --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -5112,12 +5112,10 @@ static void rtl_set_irq_mask(struct rtl8 +@@ -5118,12 +5118,10 @@ static void rtl_set_irq_mask(struct rtl8 tp->irq_mask = RxOK | RxErr | TxOK | TxErr | LinkChg; if (tp->mac_version <= RTL_GIGA_MAC_VER_06) diff --git a/target/linux/generic/backport-6.6/780-22-v6.12-r8169-add-support-for-RTL8126A-rev.b.patch b/target/linux/generic/backport-6.6/780-22-v6.12-r8169-add-support-for-RTL8126A-rev.b.patch index a825627e743..3360b61fad9 100644 --- a/target/linux/generic/backport-6.6/780-22-v6.12-r8169-add-support-for-RTL8126A-rev.b.patch +++ b/target/linux/generic/backport-6.6/780-22-v6.12-r8169-add-support-for-RTL8126A-rev.b.patch @@ -215,7 +215,7 @@ Signed-off-by: Jakub Kicinski rtl_enable_rxdvgate(tp); fsleep(2000); break; -@@ -4252,7 +4264,7 @@ static unsigned int rtl_quirk_packet_pad +@@ -4258,7 +4270,7 @@ static unsigned int rtl_quirk_packet_pad switch (tp->mac_version) { case RTL_GIGA_MAC_VER_34: @@ -224,7 +224,7 @@ Signed-off-by: Jakub Kicinski padto = max_t(unsigned int, padto, ETH_ZLEN); break; default: -@@ -5288,7 +5300,7 @@ static void rtl_hw_initialize(struct rtl +@@ -5294,7 +5306,7 @@ static void rtl_hw_initialize(struct rtl case RTL_GIGA_MAC_VER_40 ... RTL_GIGA_MAC_VER_48: rtl_hw_init_8168g(tp); break; diff --git a/target/linux/generic/config-6.6 b/target/linux/generic/config-6.6 index 105dc0d344f..2ea1b791038 100644 --- a/target/linux/generic/config-6.6 +++ b/target/linux/generic/config-6.6 @@ -7547,6 +7547,7 @@ CONFIG_ZONE_DMA=y # CONFIG_ZRAM_DEF_COMP_ZSTD is not set # CONFIG_ZRAM_MEMORY_TRACKING is not set # CONFIG_ZRAM_MULTI_COMP is not set +# CONFIG_ZRAM_TRACK_ENTRY_ACTIME is not set # CONFIG_ZSMALLOC is not set CONFIG_ZSMALLOC_CHAIN_SIZE=8 # CONFIG_ZSWAP is not set diff --git a/target/linux/generic/hack-6.6/259-regmap_dynamic.patch b/target/linux/generic/hack-6.6/259-regmap_dynamic.patch index cb93c96da60..4f6dca7127b 100644 --- a/target/linux/generic/hack-6.6/259-regmap_dynamic.patch +++ b/target/linux/generic/hack-6.6/259-regmap_dynamic.patch @@ -137,7 +137,7 @@ Signed-off-by: Felix Fietkau #include #include #include -@@ -3470,3 +3471,5 @@ static int __init regmap_initcall(void) +@@ -3483,3 +3484,5 @@ static int __init regmap_initcall(void) return 0; } postcore_initcall(regmap_initcall); diff --git a/target/linux/generic/hack-6.6/650-netfilter-add-xt_FLOWOFFLOAD-target.patch b/target/linux/generic/hack-6.6/650-netfilter-add-xt_FLOWOFFLOAD-target.patch index eca611da7e8..58b37db2fb9 100644 --- a/target/linux/generic/hack-6.6/650-netfilter-add-xt_FLOWOFFLOAD-target.patch +++ b/target/linux/generic/hack-6.6/650-netfilter-add-xt_FLOWOFFLOAD-target.patch @@ -758,7 +758,7 @@ Signed-off-by: Felix Fietkau #include #include #include -@@ -377,8 +376,7 @@ flow_offload_lookup(struct nf_flowtable +@@ -373,8 +372,7 @@ flow_offload_lookup(struct nf_flowtable } EXPORT_SYMBOL_GPL(flow_offload_lookup); @@ -768,7 +768,7 @@ Signed-off-by: Felix Fietkau void (*iter)(struct nf_flowtable *flowtable, struct flow_offload *flow, void *data), void *data) -@@ -439,6 +437,7 @@ static void nf_flow_offload_gc_step(stru +@@ -435,6 +433,7 @@ static void nf_flow_offload_gc_step(stru nf_flow_offload_stats(flow_table, flow); } } diff --git a/target/linux/generic/hack-6.6/790-SFP-GE-T-ignore-TX_FAULT.patch b/target/linux/generic/hack-6.6/790-SFP-GE-T-ignore-TX_FAULT.patch index 7733b455208..1d6bc6ee079 100644 --- a/target/linux/generic/hack-6.6/790-SFP-GE-T-ignore-TX_FAULT.patch +++ b/target/linux/generic/hack-6.6/790-SFP-GE-T-ignore-TX_FAULT.patch @@ -26,7 +26,7 @@ Signed-off-by: Daniel Golle --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c -@@ -471,6 +471,9 @@ static const struct sfp_quirk sfp_quirks +@@ -472,6 +472,9 @@ static const struct sfp_quirk sfp_quirks // FS 2.5G Base-T SFP_QUIRK_M("FS", "SFP-2.5G-T", sfp_quirk_oem_2_5g), @@ -36,7 +36,7 @@ Signed-off-by: Daniel Golle // Lantech 8330-262D-E can operate at 2500base-X, but incorrectly report // 2500MBd NRZ in their EEPROM SFP_QUIRK_M("Lantech", "8330-262D-E", sfp_quirk_2500basex), -@@ -2589,7 +2592,8 @@ static void sfp_sm_main(struct sfp *sfp, +@@ -2590,7 +2593,8 @@ static void sfp_sm_main(struct sfp *sfp, * or t_start_up, so assume there is a fault. */ sfp_sm_fault(sfp, SFP_S_INIT_TX_FAULT, @@ -46,7 +46,7 @@ Signed-off-by: Daniel Golle } else if (event == SFP_E_TIMEOUT || event == SFP_E_TX_CLEAR) { init_done: /* Create mdiobus and start trying for PHY */ -@@ -2843,10 +2847,12 @@ static void sfp_check_state(struct sfp * +@@ -2844,10 +2848,12 @@ static void sfp_check_state(struct sfp * mutex_lock(&sfp->st_mutex); state = sfp_get_state(sfp); changed = state ^ sfp->state; diff --git a/target/linux/generic/hack-6.6/930-Revert-Revert-Revert-driver-core-Set-fw_devlink-on-b.patch b/target/linux/generic/hack-6.6/930-Revert-Revert-Revert-driver-core-Set-fw_devlink-on-b.patch index 1c5fb11ff54..85a19027fda 100644 --- a/target/linux/generic/hack-6.6/930-Revert-Revert-Revert-driver-core-Set-fw_devlink-on-b.patch +++ b/target/linux/generic/hack-6.6/930-Revert-Revert-Revert-driver-core-Set-fw_devlink-on-b.patch @@ -19,7 +19,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/base/core.c +++ b/drivers/base/core.c -@@ -1657,7 +1657,7 @@ static void device_links_purge(struct de +@@ -1658,7 +1658,7 @@ static void device_links_purge(struct de #define FW_DEVLINK_FLAGS_RPM (FW_DEVLINK_FLAGS_ON | \ DL_FLAG_PM_RUNTIME) diff --git a/target/linux/generic/pending-6.6/456-mmc-core-set-card-fwnode_handle.patch b/target/linux/generic/pending-6.6/456-mmc-core-set-card-fwnode_handle.patch index 2ee170d47b8..323c208e732 100644 --- a/target/linux/generic/pending-6.6/456-mmc-core-set-card-fwnode_handle.patch +++ b/target/linux/generic/pending-6.6/456-mmc-core-set-card-fwnode_handle.patch @@ -12,7 +12,7 @@ Signed-off-by: Daniel Golle --- a/drivers/mmc/core/bus.c +++ b/drivers/mmc/core/bus.c -@@ -364,6 +364,8 @@ int mmc_add_card(struct mmc_card *card) +@@ -366,6 +366,8 @@ int mmc_add_card(struct mmc_card *card) mmc_add_card_debugfs(card); card->dev.of_node = mmc_of_find_child_device(card->host, 0); diff --git a/target/linux/generic/pending-6.6/700-netfilter-nft_flow_offload-handle-netdevice-events-f.patch b/target/linux/generic/pending-6.6/700-netfilter-nft_flow_offload-handle-netdevice-events-f.patch index 6b93f47772e..750ca29287a 100644 --- a/target/linux/generic/pending-6.6/700-netfilter-nft_flow_offload-handle-netdevice-events-f.patch +++ b/target/linux/generic/pending-6.6/700-netfilter-nft_flow_offload-handle-netdevice-events-f.patch @@ -10,7 +10,7 @@ Signed-off-by: Pablo Neira Ayuso --- a/net/netfilter/nf_flow_table_core.c +++ b/net/netfilter/nf_flow_table_core.c -@@ -662,6 +662,23 @@ static struct pernet_operations nf_flow_ +@@ -658,6 +658,23 @@ static struct pernet_operations nf_flow_ .exit_batch = nf_flow_table_pernet_exit, }; @@ -34,7 +34,7 @@ Signed-off-by: Pablo Neira Ayuso static int __init nf_flow_table_module_init(void) { int ret; -@@ -674,8 +691,14 @@ static int __init nf_flow_table_module_i +@@ -670,8 +687,14 @@ static int __init nf_flow_table_module_i if (ret) goto out_offload; @@ -49,7 +49,7 @@ Signed-off-by: Pablo Neira Ayuso out_offload: unregister_pernet_subsys(&nf_flow_table_net_ops); return ret; -@@ -683,6 +706,7 @@ out_offload: +@@ -679,6 +702,7 @@ out_offload: static void __exit nf_flow_table_module_exit(void) { diff --git a/target/linux/mediatek/patches-6.6/251-v6.8-watchdog-mediatek-mt7988-add-wdt-support.patch b/target/linux/mediatek/patches-6.6/251-v6.8-watchdog-mediatek-mt7988-add-wdt-support.patch index b89b385eeb4..c399b768b00 100644 --- a/target/linux/mediatek/patches-6.6/251-v6.8-watchdog-mediatek-mt7988-add-wdt-support.patch +++ b/target/linux/mediatek/patches-6.6/251-v6.8-watchdog-mediatek-mt7988-add-wdt-support.patch @@ -106,7 +106,7 @@ Signed-off-by: Wim Van Sebroeck spin_unlock_irqrestore(&data->lock, flags); return 0; -@@ -406,6 +445,8 @@ static int mtk_wdt_probe(struct platform +@@ -412,6 +451,8 @@ static int mtk_wdt_probe(struct platform wdt_data->toprgu_sw_rst_num); if (err) return err; @@ -115,7 +115,7 @@ Signed-off-by: Wim Van Sebroeck } mtk_wdt->disable_wdt_extrst = -@@ -444,6 +485,7 @@ static const struct of_device_id mtk_wdt +@@ -450,6 +491,7 @@ static const struct of_device_id mtk_wdt { .compatible = "mediatek,mt6589-wdt" }, { .compatible = "mediatek,mt6795-wdt", .data = &mt6795_data }, { .compatible = "mediatek,mt7986-wdt", .data = &mt7986_data }, diff --git a/target/linux/ramips/patches-6.6/810-uvc-add-iPassion-iP2970-support.patch b/target/linux/ramips/patches-6.6/810-uvc-add-iPassion-iP2970-support.patch index efc2763880f..c98aaf9442b 100644 --- a/target/linux/ramips/patches-6.6/810-uvc-add-iPassion-iP2970-support.patch +++ b/target/linux/ramips/patches-6.6/810-uvc-add-iPassion-iP2970-support.patch @@ -13,7 +13,7 @@ Signed-off-by: John Crispin --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c -@@ -3229,6 +3229,18 @@ static const struct usb_device_id uvc_id +@@ -3249,6 +3249,18 @@ static const struct usb_device_id uvc_id .bInterfaceSubClass = 1, .bInterfaceProtocol = 0, .driver_info = UVC_INFO_META(V4L2_META_FMT_D4XX) }, diff --git a/target/linux/realtek/patches-6.6/710-net-phy-sfp-re-probe-modules-on-DEV_UP-event.patch b/target/linux/realtek/patches-6.6/710-net-phy-sfp-re-probe-modules-on-DEV_UP-event.patch index d7a232327d8..4e1a21aa715 100644 --- a/target/linux/realtek/patches-6.6/710-net-phy-sfp-re-probe-modules-on-DEV_UP-event.patch +++ b/target/linux/realtek/patches-6.6/710-net-phy-sfp-re-probe-modules-on-DEV_UP-event.patch @@ -10,7 +10,7 @@ Signed-off-by: Antoine Tenart --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c -@@ -2415,6 +2415,13 @@ static void sfp_sm_module(struct sfp *sf +@@ -2416,6 +2416,13 @@ static void sfp_sm_module(struct sfp *sf return; } diff --git a/target/linux/realtek/patches-6.6/714-net-phy-sfp-add-support-for-SMBus.patch b/target/linux/realtek/patches-6.6/714-net-phy-sfp-add-support-for-SMBus.patch index 06d264d805e..76e2d765069 100644 --- a/target/linux/realtek/patches-6.6/714-net-phy-sfp-add-support-for-SMBus.patch +++ b/target/linux/realtek/patches-6.6/714-net-phy-sfp-add-support-for-SMBus.patch @@ -10,7 +10,7 @@ Signed-off-by: Antoine Tenart --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c -@@ -662,10 +662,64 @@ static int sfp_i2c_write(struct sfp *sfp +@@ -663,10 +663,64 @@ static int sfp_i2c_write(struct sfp *sfp return ret == ARRAY_SIZE(msgs) ? len : 0; } @@ -77,7 +77,7 @@ Signed-off-by: Antoine Tenart sfp->i2c = i2c; sfp->read = sfp_i2c_read; -@@ -697,6 +751,29 @@ static int sfp_i2c_mdiobus_create(struct +@@ -698,6 +752,29 @@ static int sfp_i2c_mdiobus_create(struct return 0; } @@ -107,7 +107,7 @@ Signed-off-by: Antoine Tenart static void sfp_i2c_mdiobus_destroy(struct sfp *sfp) { mdiobus_unregister(sfp->i2c_mii); -@@ -1870,8 +1947,15 @@ static void sfp_sm_fault(struct sfp *sfp +@@ -1871,8 +1948,15 @@ static void sfp_sm_fault(struct sfp *sfp static int sfp_sm_add_mdio_bus(struct sfp *sfp) { diff --git a/target/linux/rockchip/patches-6.6/034-v6.7-usb-dwc3-add-optional-PHY-interface-clocks.patch b/target/linux/rockchip/patches-6.6/034-v6.7-usb-dwc3-add-optional-PHY-interface-clocks.patch index 0b9e47da3c9..00ca1d40139 100644 --- a/target/linux/rockchip/patches-6.6/034-v6.7-usb-dwc3-add-optional-PHY-interface-clocks.patch +++ b/target/linux/rockchip/patches-6.6/034-v6.7-usb-dwc3-add-optional-PHY-interface-clocks.patch @@ -71,7 +71,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h -@@ -997,6 +997,8 @@ struct dwc3_scratchpad_array { +@@ -998,6 +998,8 @@ struct dwc3_scratchpad_array { * @bus_clk: clock for accessing the registers * @ref_clk: reference clock * @susp_clk: clock used when the SS phy is in low power (S3) state @@ -80,7 +80,7 @@ Signed-off-by: Greg Kroah-Hartman * @reset: reset control * @regs: base address for our registers * @regs_size: address space size -@@ -1169,6 +1171,8 @@ struct dwc3 { +@@ -1170,6 +1172,8 @@ struct dwc3 { struct clk *bus_clk; struct clk *ref_clk; struct clk *susp_clk; diff --git a/target/linux/starfive/patches-6.6/0109-usb-xhci-To-improve-performance-usb-using-lowmem-for.patch b/target/linux/starfive/patches-6.6/0109-usb-xhci-To-improve-performance-usb-using-lowmem-for.patch index febc6bac4e8..847b8e20ff4 100644 --- a/target/linux/starfive/patches-6.6/0109-usb-xhci-To-improve-performance-usb-using-lowmem-for.patch +++ b/target/linux/starfive/patches-6.6/0109-usb-xhci-To-improve-performance-usb-using-lowmem-for.patch @@ -160,7 +160,7 @@ Signed-off-by: minda.chen } --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c -@@ -3672,7 +3672,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd * +@@ -3667,7 +3667,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd * full_len = urb->transfer_buffer_length; /* If we have scatter/gather list, we use it. */ @@ -277,16 +277,16 @@ Signed-off-by: minda.chen /* There is one xhci_hcd structure per controller */ struct xhci_hcd { struct usb_hcd *main_hcd; -@@ -1661,6 +1668,8 @@ struct xhci_hcd { - #define XHCI_WRITE_64_HI_LO BIT_ULL(47) +@@ -1662,6 +1669,8 @@ struct xhci_hcd { #define XHCI_CDNS_SCTX_QUIRK BIT_ULL(48) + #define XHCI_ETRON_HOST BIT_ULL(49) +#define XHCI_LOCAL_BUFFER BIT_ULL(63) + unsigned int num_active_eps; unsigned int limit_active_eps; struct xhci_port *hw_ports; -@@ -1690,6 +1699,8 @@ struct xhci_hcd { +@@ -1691,6 +1700,8 @@ struct xhci_hcd { struct list_head regset_list; void *dbc; diff --git a/target/linux/starfive/patches-6.6/1000-serial-8250_dw-Add-starfive-jh7100-hsuart-compatible.patch b/target/linux/starfive/patches-6.6/1000-serial-8250_dw-Add-starfive-jh7100-hsuart-compatible.patch index 463c7eb7b66..a094e4b5d69 100644 --- a/target/linux/starfive/patches-6.6/1000-serial-8250_dw-Add-starfive-jh7100-hsuart-compatible.patch +++ b/target/linux/starfive/patches-6.6/1000-serial-8250_dw-Add-starfive-jh7100-hsuart-compatible.patch @@ -15,11 +15,11 @@ Signed-off-by: Emil Renner Berthing --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c -@@ -802,6 +802,7 @@ static const struct of_device_id dw8250_ - { .compatible = "cavium,octeon-3860-uart", .data = &dw8250_octeon_3860_data }, +@@ -803,6 +803,7 @@ static const struct of_device_id dw8250_ { .compatible = "marvell,armada-38x-uart", .data = &dw8250_armada_38x_data }, { .compatible = "renesas,rzn1-uart", .data = &dw8250_renesas_rzn1_data }, -+ { .compatible = "starfive,jh7100-hsuart", .data = &dw8250_starfive_jh7100_data }, - { .compatible = "starfive,jh7100-uart", .data = &dw8250_starfive_jh7100_data }, + { .compatible = "sophgo,sg2044-uart", .data = &dw8250_skip_set_rate_data }, ++ { .compatible = "starfive,jh7100-hsuart", .data = &dw8250_skip_set_rate_data }, + { .compatible = "starfive,jh7100-uart", .data = &dw8250_skip_set_rate_data }, { /* Sentinel */ } }; From 8943430b9f8046d49842de6b40f9c90fb57fff04 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 19 Dec 2024 06:26:59 +0100 Subject: [PATCH 087/149] hostapd: fix passing radio parameter in wpa_supplicant calls Fixes accessing PHY status in AP+STA configurations Signed-off-by: Felix Fietkau --- package/network/services/hostapd/files/hostapd.uc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/services/hostapd/files/hostapd.uc b/package/network/services/hostapd/files/hostapd.uc index e345a678f41..873881200ad 100644 --- a/package/network/services/hostapd/files/hostapd.uc +++ b/package/network/services/hostapd/files/hostapd.uc @@ -189,7 +189,7 @@ function __iface_pending_next(pending, state, ret, data) pending.call("wpa_supplicant", "phy_status", { phy: phydev.phy, - radio: phydev.radio, + radio: phydev.radio ?? -1, }); return "check_phy"; case "check_phy": @@ -202,7 +202,7 @@ function __iface_pending_next(pending, state, ret, data) } pending.call("wpa_supplicant", "phy_set_state", { phy: phydev.phy, - radio: phydev.radio, + radio: phydev.radio ?? -1, stop: true }); return "wpas_stopped"; @@ -211,7 +211,7 @@ function __iface_pending_next(pending, state, ret, data) hostapd.printf(`hostapd.add_iface failed for phy ${phy} ifname=${bss.ifname}`); pending.call("wpa_supplicant", "phy_set_state", { phy: phydev.phy, - radio: phydev.radio, + radio: phydev.radio ?? -1, stop: false }); return null; From 2e03c7d53e84e5e8c964914b78fe4b429563655e Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 19 Dec 2024 06:44:30 +0100 Subject: [PATCH 088/149] wifi-scripts: fix phy index lookup in device_capabilities For renamed phys, the index cannot be derived from the name Signed-off-by: Felix Fietkau --- .../wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc index f95f01e8468..adbfc1b9781 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc @@ -437,7 +437,7 @@ function device_extended_features(data, flag) { } function device_capabilities(phy) { - let idx = +substr(phy, 3, 1);; + let idx = +fs.readfile(`/sys/class/ieee80211/${phy}/index`); phy = nl80211.request(nl80211.const.NL80211_CMD_GET_WIPHY, nl80211.const.NLM_F_DUMP, { wiphy: idx, split_wiphy_dump: true }); if (!phy) return; From 31e45f62cafbc9361c72d320241e589b31e2b5ed Mon Sep 17 00:00:00 2001 From: Florian Maurer Date: Sat, 14 Dec 2024 12:38:28 +0100 Subject: [PATCH 089/149] hostapd: fix call to hostapd reload access to undeclared variable radio In [anonymous function](), file /usr/share/hostap/hostapd.uc, line 830, byte 45: Signed-off-by: Florian Maurer --- package/network/services/hostapd/files/hostapd.uc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/services/hostapd/files/hostapd.uc b/package/network/services/hostapd/files/hostapd.uc index 873881200ad..b7ef22ce6f0 100644 --- a/package/network/services/hostapd/files/hostapd.uc +++ b/package/network/services/hostapd/files/hostapd.uc @@ -899,7 +899,7 @@ let main_obj = { let phy_list = req.args.phy ? [ phy_name(req.args.phy, req.args.radio) ] : keys(hostapd.data.config); for (let phy_name in phy_list) { let phy = hostapd.data.config[phy_name]; - let config = iface_load_config(phy.phy, radio, phy.orig_file); + let config = iface_load_config(phy.phy, phy.radio_idx, phy.orig_file); iface_set_config(phy_name, config); } From edca1d0019d8a2f2a41ac68a1fdbc5aae6e57a17 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Thu, 19 Dec 2024 17:06:06 +0800 Subject: [PATCH 090/149] rockchip: backport rk3588 usb reset fixes Signed-off-by: Tianling Shen --- ...-bpf-Add-bpf-programmable-net-device.patch | 12 ++--- ...dd-reset-names-for-combphy-on-rk3568.patch | 44 +++++++++++++++++++ ...ockchip-naneng-combphy-fix-phy-reset.patch | 37 ++++++++++++++++ ...-GPU-scheduler-to-variable-number-of.patch | 24 +++++----- ...-sched-Add-drm_sched_wqueue_-helpers.patch | 14 +++--- ...-scheduler-to-use-a-work-queue-rathe.patch | 24 +++++----- ...ed-Split-free_job-into-own-work-item.patch | 12 ++--- ...x-from-drm_sched_wakeup_if_can_queue.patch | 2 +- ...rm-sched-Qualify-drm_sched_wakeup-by.patch | 2 +- ...d-implement-dynamic-job-flow-control.patch | 22 +++++----- ...69-add-devname-configuration-from-OF.patch | 4 +- ...m64-dts-rockchip-rk356x-add-rng-node.patch | 2 +- 12 files changed, 140 insertions(+), 59 deletions(-) create mode 100644 target/linux/rockchip/patches-6.6/012-v6.13-arm64-dts-rockchip-add-reset-names-for-combphy-on-rk3568.patch create mode 100644 target/linux/rockchip/patches-6.6/032-09-v6.13-phy-rockchip-naneng-combphy-fix-phy-reset.patch diff --git a/target/linux/generic/backport-6.6/068-01-v6.7-netkit-bpf-Add-bpf-programmable-net-device.patch b/target/linux/generic/backport-6.6/068-01-v6.7-netkit-bpf-Add-bpf-programmable-net-device.patch index f0b0c2ada48..32e24b9d60c 100644 --- a/target/linux/generic/backport-6.6/068-01-v6.7-netkit-bpf-Add-bpf-programmable-net-device.patch +++ b/target/linux/generic/backport-6.6/068-01-v6.7-netkit-bpf-Add-bpf-programmable-net-device.patch @@ -1196,7 +1196,7 @@ Signed-off-by: Martin KaFai Lau #include #define IS_FD_ARRAY(map) ((map)->map_type == BPF_MAP_TYPE_PERF_EVENT_ARRAY || \ -@@ -3811,6 +3812,8 @@ attach_type_to_prog_type(enum bpf_attach +@@ -3827,6 +3828,8 @@ attach_type_to_prog_type(enum bpf_attach return BPF_PROG_TYPE_LSM; case BPF_TCX_INGRESS: case BPF_TCX_EGRESS: @@ -1205,7 +1205,7 @@ Signed-off-by: Martin KaFai Lau return BPF_PROG_TYPE_SCHED_CLS; default: return BPF_PROG_TYPE_UNSPEC; -@@ -3867,7 +3870,9 @@ static int bpf_prog_attach_check_attach_ +@@ -3883,7 +3886,9 @@ static int bpf_prog_attach_check_attach_ return 0; case BPF_PROG_TYPE_SCHED_CLS: if (attach_type != BPF_TCX_INGRESS && @@ -1216,7 +1216,7 @@ Signed-off-by: Martin KaFai Lau return -EINVAL; return 0; default: -@@ -3950,7 +3955,11 @@ static int bpf_prog_attach(const union b +@@ -3966,7 +3971,11 @@ static int bpf_prog_attach(const union b ret = cgroup_bpf_prog_attach(attr, ptype, prog); break; case BPF_PROG_TYPE_SCHED_CLS: @@ -1229,7 +1229,7 @@ Signed-off-by: Martin KaFai Lau break; default: ret = -EINVAL; -@@ -4011,7 +4020,11 @@ static int bpf_prog_detach(const union b +@@ -4027,7 +4036,11 @@ static int bpf_prog_detach(const union b ret = cgroup_bpf_prog_detach(attr, ptype); break; case BPF_PROG_TYPE_SCHED_CLS: @@ -1242,7 +1242,7 @@ Signed-off-by: Martin KaFai Lau break; default: ret = -EINVAL; -@@ -4073,6 +4086,9 @@ static int bpf_prog_query(const union bp +@@ -4089,6 +4102,9 @@ static int bpf_prog_query(const union bp case BPF_TCX_INGRESS: case BPF_TCX_EGRESS: return tcx_prog_query(attr, uattr); @@ -1252,7 +1252,7 @@ Signed-off-by: Martin KaFai Lau default: return -EINVAL; } -@@ -5054,7 +5070,11 @@ static int link_create(union bpf_attr *a +@@ -5070,7 +5086,11 @@ static int link_create(union bpf_attr *a ret = bpf_xdp_link_attach(attr, prog); break; case BPF_PROG_TYPE_SCHED_CLS: diff --git a/target/linux/rockchip/patches-6.6/012-v6.13-arm64-dts-rockchip-add-reset-names-for-combphy-on-rk3568.patch b/target/linux/rockchip/patches-6.6/012-v6.13-arm64-dts-rockchip-add-reset-names-for-combphy-on-rk3568.patch new file mode 100644 index 00000000000..7a8f86a46fd --- /dev/null +++ b/target/linux/rockchip/patches-6.6/012-v6.13-arm64-dts-rockchip-add-reset-names-for-combphy-on-rk3568.patch @@ -0,0 +1,44 @@ +From 8b9c12757f919157752646faf3821abf2b7d2a64 Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Fri, 22 Nov 2024 15:30:05 +0800 +Subject: [PATCH] arm64: dts: rockchip: add reset-names for combphy on rk3568 + +The reset-names of combphy are missing, add it. + +Signed-off-by: Chukun Pan +Fixes: fd3ac6e80497 ("dt-bindings: phy: rockchip: rk3588 has two reset lines") +Link: https://lore.kernel.org/r/20241122073006.99309-1-amadeus@jmu.edu.cn +Signed-off-by: Heiko Stuebner +--- + arch/arm64/boot/dts/rockchip/rk3568.dtsi | 1 + + arch/arm64/boot/dts/rockchip/rk356x-base.dtsi | 2 ++ + 2 files changed, 3 insertions(+) + +--- a/arch/arm64/boot/dts/rockchip/rk3568.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3568.dtsi +@@ -223,6 +223,7 @@ + assigned-clocks = <&pmucru CLK_PCIEPHY0_REF>; + assigned-clock-rates = <100000000>; + resets = <&cru SRST_PIPEPHY0>; ++ reset-names = "phy"; + rockchip,pipe-grf = <&pipegrf>; + rockchip,pipe-phy-grf = <&pipe_phy_grf0>; + #phy-cells = <1>; +--- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi +@@ -1747,6 +1747,7 @@ + assigned-clocks = <&pmucru CLK_PCIEPHY1_REF>; + assigned-clock-rates = <100000000>; + resets = <&cru SRST_PIPEPHY1>; ++ reset-names = "phy"; + rockchip,pipe-grf = <&pipegrf>; + rockchip,pipe-phy-grf = <&pipe_phy_grf1>; + #phy-cells = <1>; +@@ -1763,6 +1764,7 @@ + assigned-clocks = <&pmucru CLK_PCIEPHY2_REF>; + assigned-clock-rates = <100000000>; + resets = <&cru SRST_PIPEPHY2>; ++ reset-names = "phy"; + rockchip,pipe-grf = <&pipegrf>; + rockchip,pipe-phy-grf = <&pipe_phy_grf2>; + #phy-cells = <1>; diff --git a/target/linux/rockchip/patches-6.6/032-09-v6.13-phy-rockchip-naneng-combphy-fix-phy-reset.patch b/target/linux/rockchip/patches-6.6/032-09-v6.13-phy-rockchip-naneng-combphy-fix-phy-reset.patch new file mode 100644 index 00000000000..893023a24ca --- /dev/null +++ b/target/linux/rockchip/patches-6.6/032-09-v6.13-phy-rockchip-naneng-combphy-fix-phy-reset.patch @@ -0,0 +1,37 @@ +From fbcbffbac994aca1264e3c14da96ac9bfd90466e Mon Sep 17 00:00:00 2001 +From: Chukun Pan +Date: Fri, 22 Nov 2024 15:30:06 +0800 +Subject: [PATCH] phy: rockchip: naneng-combphy: fix phy reset + +Currently, the USB port via combophy on the RK3528/RK3588 SoC is broken. + + usb usb8-port1: Cannot enable. Maybe the USB cable is bad? + +This is due to the combphy of RK3528/RK3588 SoC has multiple resets, but +only "phy resets" need assert and deassert, "apb resets" don't need. +So change the driver to only match the phy resets, which is also what +the vendor kernel does. + +Fixes: 7160820d742a ("phy: rockchip: add naneng combo phy for RK3568") +Cc: FUKAUMI Naoki +Cc: Michael Zimmermann +Signed-off-by: Chukun Pan +Reviewed-by: Heiko Stuebner +Tested-by: FUKAUMI Naoki +Link: https://lore.kernel.org/r/20241122073006.99309-2-amadeus@jmu.edu.cn +Signed-off-by: Vinod Koul +--- + drivers/phy/rockchip/phy-rockchip-naneng-combphy.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c ++++ b/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c +@@ -309,7 +309,7 @@ static int rockchip_combphy_parse_dt(str + + priv->ext_refclk = device_property_present(dev, "rockchip,ext-refclk"); + +- priv->phy_rst = devm_reset_control_array_get_exclusive(dev); ++ priv->phy_rst = devm_reset_control_get(dev, "phy"); + if (IS_ERR(priv->phy_rst)) + return dev_err_probe(dev, PTR_ERR(priv->phy_rst), "failed to get phy reset\n"); + diff --git a/target/linux/rockchip/patches-6.6/034-20-v6.7-drm-sched-Convert-the-GPU-scheduler-to-variable-number-of.patch b/target/linux/rockchip/patches-6.6/034-20-v6.7-drm-sched-Convert-the-GPU-scheduler-to-variable-number-of.patch index 7937f79f136..0a64ca42994 100644 --- a/target/linux/rockchip/patches-6.6/034-20-v6.7-drm-sched-Convert-the-GPU-scheduler-to-variable-number-of.patch +++ b/target/linux/rockchip/patches-6.6/034-20-v6.7-drm-sched-Convert-the-GPU-scheduler-to-variable-number-of.patch @@ -181,9 +181,9 @@ Link: https://lore.kernel.org/r/20231023032251.164775-1-luben.tuikov@amd.com return -ENOENT; + } - job->entity = entity; - job->s_fence = drm_sched_fence_alloc(entity, owner); -@@ -671,7 +677,7 @@ void drm_sched_job_arm(struct drm_sched_ + /* + * We don't know for sure how the user has allocated. Thus, zero the +@@ -679,7 +685,7 @@ void drm_sched_job_arm(struct drm_sched_ sched = entity->rq->sched; job->sched = sched; @@ -192,7 +192,7 @@ Link: https://lore.kernel.org/r/20231023032251.164775-1-luben.tuikov@amd.com job->id = atomic64_inc_return(&sched->job_id_count); drm_sched_fence_init(job->s_fence, job->entity); -@@ -888,10 +894,10 @@ drm_sched_select_entity(struct drm_gpu_s +@@ -896,10 +902,10 @@ drm_sched_select_entity(struct drm_gpu_s return NULL; /* Kernel run queue has higher priority than normal run queue*/ @@ -206,7 +206,7 @@ Link: https://lore.kernel.org/r/20231023032251.164775-1-luben.tuikov@amd.com if (entity) break; } -@@ -1071,6 +1077,7 @@ static int drm_sched_main(void *param) +@@ -1079,6 +1085,7 @@ static int drm_sched_main(void *param) * * @sched: scheduler instance * @ops: backend operations for this scheduler @@ -214,7 +214,7 @@ Link: https://lore.kernel.org/r/20231023032251.164775-1-luben.tuikov@amd.com * @hw_submission: number of hw submissions that can be in flight * @hang_limit: number of times to allow a job to hang before dropping it * @timeout: timeout value in jiffies for the scheduler -@@ -1084,11 +1091,12 @@ static int drm_sched_main(void *param) +@@ -1092,11 +1099,12 @@ static int drm_sched_main(void *param) */ int drm_sched_init(struct drm_gpu_scheduler *sched, const struct drm_sched_backend_ops *ops, @@ -228,7 +228,7 @@ Link: https://lore.kernel.org/r/20231023032251.164775-1-luben.tuikov@amd.com sched->ops = ops; sched->hw_submission_limit = hw_submission; sched->name = name; -@@ -1097,8 +1105,36 @@ int drm_sched_init(struct drm_gpu_schedu +@@ -1105,8 +1113,36 @@ int drm_sched_init(struct drm_gpu_schedu sched->hang_limit = hang_limit; sched->score = score ? score : &sched->_score; sched->dev = dev; @@ -267,7 +267,7 @@ Link: https://lore.kernel.org/r/20231023032251.164775-1-luben.tuikov@amd.com init_waitqueue_head(&sched->wake_up_worker); init_waitqueue_head(&sched->job_scheduled); -@@ -1115,11 +1151,18 @@ int drm_sched_init(struct drm_gpu_schedu +@@ -1123,11 +1159,18 @@ int drm_sched_init(struct drm_gpu_schedu ret = PTR_ERR(sched->thread); sched->thread = NULL; DRM_DEV_ERROR(sched->dev, "Failed to create scheduler for %s.\n", name); @@ -287,7 +287,7 @@ Link: https://lore.kernel.org/r/20231023032251.164775-1-luben.tuikov@amd.com } EXPORT_SYMBOL(drm_sched_init); -@@ -1138,8 +1181,8 @@ void drm_sched_fini(struct drm_gpu_sched +@@ -1146,8 +1189,8 @@ void drm_sched_fini(struct drm_gpu_sched if (sched->thread) kthread_stop(sched->thread); @@ -298,7 +298,7 @@ Link: https://lore.kernel.org/r/20231023032251.164775-1-luben.tuikov@amd.com spin_lock(&rq->lock); list_for_each_entry(s_entity, &rq->entities, list) -@@ -1150,7 +1193,7 @@ void drm_sched_fini(struct drm_gpu_sched +@@ -1158,7 +1201,7 @@ void drm_sched_fini(struct drm_gpu_sched */ s_entity->stopped = true; spin_unlock(&rq->lock); @@ -307,7 +307,7 @@ Link: https://lore.kernel.org/r/20231023032251.164775-1-luben.tuikov@amd.com } /* Wakeup everyone stuck in drm_sched_entity_flush for this scheduler */ -@@ -1160,6 +1203,8 @@ void drm_sched_fini(struct drm_gpu_sched +@@ -1168,6 +1211,8 @@ void drm_sched_fini(struct drm_gpu_sched cancel_delayed_work_sync(&sched->work_tdr); sched->ready = false; @@ -316,7 +316,7 @@ Link: https://lore.kernel.org/r/20231023032251.164775-1-luben.tuikov@amd.com } EXPORT_SYMBOL(drm_sched_fini); -@@ -1186,9 +1231,10 @@ void drm_sched_increase_karma(struct drm +@@ -1194,9 +1239,10 @@ void drm_sched_increase_karma(struct drm if (bad->s_priority != DRM_SCHED_PRIORITY_KERNEL) { atomic_inc(&bad->karma); diff --git a/target/linux/rockchip/patches-6.6/034-21-v6.8-drm-sched-Add-drm_sched_wqueue_-helpers.patch b/target/linux/rockchip/patches-6.6/034-21-v6.8-drm-sched-Add-drm_sched_wqueue_-helpers.patch index d0265f5cdc1..29743a42c39 100644 --- a/target/linux/rockchip/patches-6.6/034-21-v6.8-drm-sched-Add-drm_sched_wqueue_-helpers.patch +++ b/target/linux/rockchip/patches-6.6/034-21-v6.8-drm-sched-Add-drm_sched_wqueue_-helpers.patch @@ -92,7 +92,7 @@ Signed-off-by: Luben Tuikov --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c -@@ -4615,7 +4615,7 @@ bool amdgpu_device_has_job_running(struc +@@ -4652,7 +4652,7 @@ bool amdgpu_device_has_job_running(struc for (i = 0; i < AMDGPU_MAX_RINGS; ++i) { struct amdgpu_ring *ring = adev->rings[i]; @@ -101,7 +101,7 @@ Signed-off-by: Luben Tuikov continue; spin_lock(&ring->sched.job_list_lock); -@@ -4757,7 +4757,7 @@ int amdgpu_device_pre_asic_reset(struct +@@ -4794,7 +4794,7 @@ int amdgpu_device_pre_asic_reset(struct for (i = 0; i < AMDGPU_MAX_RINGS; ++i) { struct amdgpu_ring *ring = adev->rings[i]; @@ -110,7 +110,7 @@ Signed-off-by: Luben Tuikov continue; /* Clear job fence from fence drv to avoid force_completion -@@ -5297,7 +5297,7 @@ int amdgpu_device_gpu_recover(struct amd +@@ -5338,7 +5338,7 @@ int amdgpu_device_gpu_recover(struct amd for (i = 0; i < AMDGPU_MAX_RINGS; ++i) { struct amdgpu_ring *ring = tmp_adev->rings[i]; @@ -119,7 +119,7 @@ Signed-off-by: Luben Tuikov continue; drm_sched_stop(&ring->sched, job ? &job->base : NULL); -@@ -5372,7 +5372,7 @@ skip_hw_reset: +@@ -5413,7 +5413,7 @@ skip_hw_reset: for (i = 0; i < AMDGPU_MAX_RINGS; ++i) { struct amdgpu_ring *ring = tmp_adev->rings[i]; @@ -128,7 +128,7 @@ Signed-off-by: Luben Tuikov continue; drm_sched_start(&ring->sched, true); -@@ -5698,7 +5698,7 @@ pci_ers_result_t amdgpu_pci_error_detect +@@ -5739,7 +5739,7 @@ pci_ers_result_t amdgpu_pci_error_detect for (i = 0; i < AMDGPU_MAX_RINGS; ++i) { struct amdgpu_ring *ring = adev->rings[i]; @@ -137,7 +137,7 @@ Signed-off-by: Luben Tuikov continue; drm_sched_stop(&ring->sched, NULL); -@@ -5826,7 +5826,7 @@ void amdgpu_pci_resume(struct pci_dev *p +@@ -5867,7 +5867,7 @@ void amdgpu_pci_resume(struct pci_dev *p for (i = 0; i < AMDGPU_MAX_RINGS; ++i) { struct amdgpu_ring *ring = adev->rings[i]; @@ -188,7 +188,7 @@ Signed-off-by: Luben Tuikov } EXPORT_SYMBOL(drm_sched_start); -@@ -1252,3 +1252,38 @@ void drm_sched_increase_karma(struct drm +@@ -1260,3 +1260,38 @@ void drm_sched_increase_karma(struct drm } } EXPORT_SYMBOL(drm_sched_increase_karma); diff --git a/target/linux/rockchip/patches-6.6/034-22-v6.8-drm-sched-Convert-drm-scheduler-to-use-a-work-queue-rathe.patch b/target/linux/rockchip/patches-6.6/034-22-v6.8-drm-sched-Convert-drm-scheduler-to-use-a-work-queue-rathe.patch index 348b20d0d6b..32299a5835f 100644 --- a/target/linux/rockchip/patches-6.6/034-22-v6.8-drm-sched-Convert-drm-scheduler-to-use-a-work-queue-rathe.patch +++ b/target/linux/rockchip/patches-6.6/034-22-v6.8-drm-sched-Convert-drm-scheduler-to-use-a-work-queue-rathe.patch @@ -164,7 +164,7 @@ Signed-off-by: Luben Tuikov } /** -@@ -874,7 +883,7 @@ static bool drm_sched_can_queue(struct d +@@ -882,7 +891,7 @@ static bool drm_sched_can_queue(struct d void drm_sched_wakeup_if_can_queue(struct drm_gpu_scheduler *sched) { if (drm_sched_can_queue(sched)) @@ -173,7 +173,7 @@ Signed-off-by: Luben Tuikov } /** -@@ -985,60 +994,41 @@ drm_sched_pick_best(struct drm_gpu_sched +@@ -993,60 +1002,41 @@ drm_sched_pick_best(struct drm_gpu_sched EXPORT_SYMBOL(drm_sched_pick_best); /** @@ -256,7 +256,7 @@ Signed-off-by: Luben Tuikov } s_fence = sched_job->s_fence; -@@ -1069,7 +1059,9 @@ static int drm_sched_main(void *param) +@@ -1077,7 +1067,9 @@ static int drm_sched_main(void *param) wake_up(&sched->job_scheduled); } @@ -267,7 +267,7 @@ Signed-off-by: Luben Tuikov } /** -@@ -1077,6 +1069,8 @@ static int drm_sched_main(void *param) +@@ -1085,6 +1077,8 @@ static int drm_sched_main(void *param) * * @sched: scheduler instance * @ops: backend operations for this scheduler @@ -276,7 +276,7 @@ Signed-off-by: Luben Tuikov * @num_rqs: number of runqueues, one for each priority, up to DRM_SCHED_PRIORITY_COUNT * @hw_submission: number of hw submissions that can be in flight * @hang_limit: number of times to allow a job to hang before dropping it -@@ -1091,6 +1085,7 @@ static int drm_sched_main(void *param) +@@ -1099,6 +1093,7 @@ static int drm_sched_main(void *param) */ int drm_sched_init(struct drm_gpu_scheduler *sched, const struct drm_sched_backend_ops *ops, @@ -284,7 +284,7 @@ Signed-off-by: Luben Tuikov u32 num_rqs, uint32_t hw_submission, unsigned int hang_limit, long timeout, struct workqueue_struct *timeout_wq, atomic_t *score, const char *name, struct device *dev) -@@ -1121,14 +1116,22 @@ int drm_sched_init(struct drm_gpu_schedu +@@ -1129,14 +1124,22 @@ int drm_sched_init(struct drm_gpu_schedu return 0; } @@ -312,7 +312,7 @@ Signed-off-by: Luben Tuikov for (i = DRM_SCHED_PRIORITY_MIN; i < sched->num_rqs; i++) { sched->sched_rq[i] = kzalloc(sizeof(*sched->sched_rq[i]), GFP_KERNEL); if (!sched->sched_rq[i]) -@@ -1136,31 +1139,26 @@ int drm_sched_init(struct drm_gpu_schedu +@@ -1144,31 +1147,26 @@ int drm_sched_init(struct drm_gpu_schedu drm_sched_rq_init(sched, sched->sched_rq[i]); } @@ -349,7 +349,7 @@ Signed-off-by: Luben Tuikov drm_err(sched, "%s: Failed to setup GPU scheduler--out of memory\n", __func__); return ret; } -@@ -1178,8 +1176,7 @@ void drm_sched_fini(struct drm_gpu_sched +@@ -1186,8 +1184,7 @@ void drm_sched_fini(struct drm_gpu_sched struct drm_sched_entity *s_entity; int i; @@ -359,7 +359,7 @@ Signed-off-by: Luben Tuikov for (i = sched->num_rqs - 1; i >= DRM_SCHED_PRIORITY_MIN; i--) { struct drm_sched_rq *rq = sched->sched_rq[i]; -@@ -1202,6 +1199,8 @@ void drm_sched_fini(struct drm_gpu_sched +@@ -1210,6 +1207,8 @@ void drm_sched_fini(struct drm_gpu_sched /* Confirm no work left behind accessing device structures */ cancel_delayed_work_sync(&sched->work_tdr); @@ -368,7 +368,7 @@ Signed-off-by: Luben Tuikov sched->ready = false; kfree(sched->sched_rq); sched->sched_rq = NULL; -@@ -1262,7 +1261,7 @@ EXPORT_SYMBOL(drm_sched_increase_karma); +@@ -1270,7 +1269,7 @@ EXPORT_SYMBOL(drm_sched_increase_karma); */ bool drm_sched_wqueue_ready(struct drm_gpu_scheduler *sched) { @@ -377,7 +377,7 @@ Signed-off-by: Luben Tuikov } EXPORT_SYMBOL(drm_sched_wqueue_ready); -@@ -1273,7 +1272,8 @@ EXPORT_SYMBOL(drm_sched_wqueue_ready); +@@ -1281,7 +1280,8 @@ EXPORT_SYMBOL(drm_sched_wqueue_ready); */ void drm_sched_wqueue_stop(struct drm_gpu_scheduler *sched) { @@ -387,7 +387,7 @@ Signed-off-by: Luben Tuikov } EXPORT_SYMBOL(drm_sched_wqueue_stop); -@@ -1284,6 +1284,7 @@ EXPORT_SYMBOL(drm_sched_wqueue_stop); +@@ -1292,6 +1292,7 @@ EXPORT_SYMBOL(drm_sched_wqueue_stop); */ void drm_sched_wqueue_start(struct drm_gpu_scheduler *sched) { diff --git a/target/linux/rockchip/patches-6.6/034-23-v6.8-drm-sched-Split-free_job-into-own-work-item.patch b/target/linux/rockchip/patches-6.6/034-23-v6.8-drm-sched-Split-free_job-into-own-work-item.patch index a2efa0ff275..2f844df735e 100644 --- a/target/linux/rockchip/patches-6.6/034-23-v6.8-drm-sched-Split-free_job-into-own-work-item.patch +++ b/target/linux/rockchip/patches-6.6/034-23-v6.8-drm-sched-Split-free_job-into-own-work-item.patch @@ -77,7 +77,7 @@ Signed-off-by: Luben Tuikov } /** -@@ -943,8 +969,10 @@ drm_sched_get_cleanup_job(struct drm_gpu +@@ -951,8 +977,10 @@ drm_sched_get_cleanup_job(struct drm_gpu typeof(*next), list); if (next) { @@ -90,7 +90,7 @@ Signed-off-by: Luben Tuikov /* start TO timer for next job */ drm_sched_start_timeout(sched); } -@@ -994,7 +1022,40 @@ drm_sched_pick_best(struct drm_gpu_sched +@@ -1002,7 +1030,40 @@ drm_sched_pick_best(struct drm_gpu_sched EXPORT_SYMBOL(drm_sched_pick_best); /** @@ -132,7 +132,7 @@ Signed-off-by: Luben Tuikov * * @w: run job work */ -@@ -1003,65 +1064,51 @@ static void drm_sched_run_job_work(struc +@@ -1011,65 +1072,51 @@ static void drm_sched_run_job_work(struc struct drm_gpu_scheduler *sched = container_of(w, struct drm_gpu_scheduler, work_run_job); struct drm_sched_entity *entity; @@ -228,7 +228,7 @@ Signed-off-by: Luben Tuikov } /** -@@ -1145,6 +1192,7 @@ int drm_sched_init(struct drm_gpu_schedu +@@ -1153,6 +1200,7 @@ int drm_sched_init(struct drm_gpu_schedu atomic_set(&sched->hw_rq_count, 0); INIT_DELAYED_WORK(&sched->work_tdr, drm_sched_job_timedout); INIT_WORK(&sched->work_run_job, drm_sched_run_job_work); @@ -236,7 +236,7 @@ Signed-off-by: Luben Tuikov atomic_set(&sched->_score, 0); atomic64_set(&sched->job_id_count, 0); sched->pause_submit = false; -@@ -1274,6 +1322,7 @@ void drm_sched_wqueue_stop(struct drm_gp +@@ -1282,6 +1330,7 @@ void drm_sched_wqueue_stop(struct drm_gp { WRITE_ONCE(sched->pause_submit, true); cancel_work_sync(&sched->work_run_job); @@ -244,7 +244,7 @@ Signed-off-by: Luben Tuikov } EXPORT_SYMBOL(drm_sched_wqueue_stop); -@@ -1286,5 +1335,6 @@ void drm_sched_wqueue_start(struct drm_g +@@ -1294,5 +1343,6 @@ void drm_sched_wqueue_start(struct drm_g { WRITE_ONCE(sched->pause_submit, false); queue_work(sched->submit_wq, &sched->work_run_job); diff --git a/target/linux/rockchip/patches-6.6/034-25-v6.8-drm-sched-Drop-suffix-from-drm_sched_wakeup_if_can_queue.patch b/target/linux/rockchip/patches-6.6/034-25-v6.8-drm-sched-Drop-suffix-from-drm_sched_wakeup_if_can_queue.patch index 8244617d121..39d03624337 100644 --- a/target/linux/rockchip/patches-6.6/034-25-v6.8-drm-sched-Drop-suffix-from-drm_sched_wakeup_if_can_queue.patch +++ b/target/linux/rockchip/patches-6.6/034-25-v6.8-drm-sched-Drop-suffix-from-drm_sched_wakeup_if_can_queue.patch @@ -42,7 +42,7 @@ Signed-off-by: Luben Tuikov EXPORT_SYMBOL(drm_sched_entity_push_job); --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c -@@ -917,12 +917,12 @@ static bool drm_sched_can_queue(struct d +@@ -925,12 +925,12 @@ static bool drm_sched_can_queue(struct d } /** diff --git a/target/linux/rockchip/patches-6.6/034-26-v6.8-drm-sched-Qualify-drm_sched_wakeup-by.patch b/target/linux/rockchip/patches-6.6/034-26-v6.8-drm-sched-Qualify-drm_sched_wakeup-by.patch index 01cb59a78f4..3a4e6f18974 100644 --- a/target/linux/rockchip/patches-6.6/034-26-v6.8-drm-sched-Qualify-drm_sched_wakeup-by.patch +++ b/target/linux/rockchip/patches-6.6/034-26-v6.8-drm-sched-Qualify-drm_sched_wakeup-by.patch @@ -40,7 +40,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20231110000123.72565-2-ltuik EXPORT_SYMBOL(drm_sched_entity_push_job); --- a/drivers/gpu/drm/scheduler/sched_main.c +++ b/drivers/gpu/drm/scheduler/sched_main.c -@@ -922,10 +922,12 @@ static bool drm_sched_can_queue(struct d +@@ -930,10 +930,12 @@ static bool drm_sched_can_queue(struct d * * Wake up the scheduler if we can queue jobs. */ diff --git a/target/linux/rockchip/patches-6.6/034-27-v6.8-drm-sched-implement-dynamic-job-flow-control.patch b/target/linux/rockchip/patches-6.6/034-27-v6.8-drm-sched-implement-dynamic-job-flow-control.patch index 926cc5f8a82..d19384f5b70 100644 --- a/target/linux/rockchip/patches-6.6/034-27-v6.8-drm-sched-implement-dynamic-job-flow-control.patch +++ b/target/linux/rockchip/patches-6.6/034-27-v6.8-drm-sched-implement-dynamic-job-flow-control.patch @@ -385,9 +385,9 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20231110001638.71750-1-dakr@ { if (!entity->rq) { /* This will most likely be followed by missing frames -@@ -692,7 +798,13 @@ int drm_sched_job_init(struct drm_sched_ - return -ENOENT; - } +@@ -700,7 +806,13 @@ int drm_sched_job_init(struct drm_sched_ + */ + memset(job, 0, sizeof(*job)); + if (unlikely(!credits)) { + pr_err("*ERROR* %s: credits cannot be 0!\n", __func__); @@ -399,7 +399,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20231110001638.71750-1-dakr@ job->s_fence = drm_sched_fence_alloc(entity, owner); if (!job->s_fence) return -ENOMEM; -@@ -905,20 +1017,9 @@ void drm_sched_job_cleanup(struct drm_sc +@@ -913,20 +1025,9 @@ void drm_sched_job_cleanup(struct drm_sc EXPORT_SYMBOL(drm_sched_job_cleanup); /** @@ -421,7 +421,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20231110001638.71750-1-dakr@ * * Wake up the scheduler if we can queue jobs. */ -@@ -926,7 +1027,7 @@ void drm_sched_wakeup(struct drm_gpu_sch +@@ -934,7 +1035,7 @@ void drm_sched_wakeup(struct drm_gpu_sch struct drm_sched_entity *entity) { if (drm_sched_entity_is_ready(entity)) @@ -430,7 +430,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20231110001638.71750-1-dakr@ drm_sched_run_job_queue(sched); } -@@ -935,7 +1036,11 @@ void drm_sched_wakeup(struct drm_gpu_sch +@@ -943,7 +1044,11 @@ void drm_sched_wakeup(struct drm_gpu_sch * * @sched: scheduler instance * @@ -443,7 +443,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20231110001638.71750-1-dakr@ */ static struct drm_sched_entity * drm_sched_select_entity(struct drm_gpu_scheduler *sched) -@@ -943,19 +1048,16 @@ drm_sched_select_entity(struct drm_gpu_s +@@ -951,19 +1056,16 @@ drm_sched_select_entity(struct drm_gpu_s struct drm_sched_entity *entity; int i; @@ -466,7 +466,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20231110001638.71750-1-dakr@ } /** -@@ -1102,7 +1204,7 @@ static void drm_sched_run_job_work(struc +@@ -1110,7 +1212,7 @@ static void drm_sched_run_job_work(struc s_fence = sched_job->s_fence; @@ -475,7 +475,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20231110001638.71750-1-dakr@ drm_sched_job_begin(sched_job); trace_drm_run_job(sched_job, entity); -@@ -1137,7 +1239,7 @@ static void drm_sched_run_job_work(struc +@@ -1145,7 +1247,7 @@ static void drm_sched_run_job_work(struc * @submit_wq: workqueue to use for submission. If NULL, an ordered wq is * allocated and used * @num_rqs: number of runqueues, one for each priority, up to DRM_SCHED_PRIORITY_COUNT @@ -484,7 +484,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20231110001638.71750-1-dakr@ * @hang_limit: number of times to allow a job to hang before dropping it * @timeout: timeout value in jiffies for the scheduler * @timeout_wq: workqueue to use for timeout work. If NULL, the system_wq is -@@ -1151,14 +1253,14 @@ static void drm_sched_run_job_work(struc +@@ -1159,14 +1261,14 @@ static void drm_sched_run_job_work(struc int drm_sched_init(struct drm_gpu_scheduler *sched, const struct drm_sched_backend_ops *ops, struct workqueue_struct *submit_wq, @@ -501,7 +501,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/20231110001638.71750-1-dakr@ sched->name = name; sched->timeout = timeout; sched->timeout_wq = timeout_wq ? : system_wq; -@@ -1207,7 +1309,7 @@ int drm_sched_init(struct drm_gpu_schedu +@@ -1215,7 +1317,7 @@ int drm_sched_init(struct drm_gpu_schedu init_waitqueue_head(&sched->job_scheduled); INIT_LIST_HEAD(&sched->pending_list); spin_lock_init(&sched->job_list_lock); diff --git a/target/linux/rockchip/patches-6.6/602-net-ethernet-r8169-add-devname-configuration-from-OF.patch b/target/linux/rockchip/patches-6.6/602-net-ethernet-r8169-add-devname-configuration-from-OF.patch index faa8d55de98..0f45d532e1c 100644 --- a/target/linux/rockchip/patches-6.6/602-net-ethernet-r8169-add-devname-configuration-from-OF.patch +++ b/target/linux/rockchip/patches-6.6/602-net-ethernet-r8169-add-devname-configuration-from-OF.patch @@ -8,7 +8,7 @@ #include #include #include -@@ -5373,6 +5374,7 @@ static int rtl_init_one(struct pci_dev * +@@ -5379,6 +5380,7 @@ static int rtl_init_one(struct pci_dev * int jumbo_max, region, rc; enum mac_version chipset; struct net_device *dev; @@ -16,7 +16,7 @@ u32 txconfig; u16 xid; -@@ -5380,6 +5382,9 @@ static int rtl_init_one(struct pci_dev * +@@ -5386,6 +5388,9 @@ static int rtl_init_one(struct pci_dev * if (!dev) return -ENOMEM; diff --git a/target/linux/rockchip/patches-6.6/801-04-arm64-dts-rockchip-rk356x-add-rng-node.patch b/target/linux/rockchip/patches-6.6/801-04-arm64-dts-rockchip-rk356x-add-rng-node.patch index 4b7ca8b1ecc..fe81bbf3d70 100644 --- a/target/linux/rockchip/patches-6.6/801-04-arm64-dts-rockchip-rk356x-add-rng-node.patch +++ b/target/linux/rockchip/patches-6.6/801-04-arm64-dts-rockchip-rk356x-add-rng-node.patch @@ -11,7 +11,7 @@ Signed-off-by: Lin Jinhan --- a/arch/arm64/boot/dts/rockchip/rk3568.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3568.dtsi -@@ -266,6 +266,10 @@ +@@ -267,6 +267,10 @@ }; }; From aea6227660cceb9797e39facf9bdf085a6477523 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Thu, 19 Dec 2024 20:42:05 +0800 Subject: [PATCH 091/149] linux-firmware: add panthor firmware Signed-off-by: Tianling Shen --- package/firmware/linux-firmware/mali.mk | 8 ++++++++ package/kernel/linux/modules/video.mk | 7 ++++--- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 package/firmware/linux-firmware/mali.mk diff --git a/package/firmware/linux-firmware/mali.mk b/package/firmware/linux-firmware/mali.mk new file mode 100644 index 00000000000..74848505e57 --- /dev/null +++ b/package/firmware/linux-firmware/mali.mk @@ -0,0 +1,8 @@ +Package/panthor-firmware = $(call Package/firmware-default,Gen10 Arm Mali GPUs firmware) +define Package/panthor-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/arm/mali/arch10.8 + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/arm/mali/arch10.8/mali_csffw.bin \ + $(1)/lib/firmware/arm/mali/arch10.8/ +endef +$(eval $(call BuildPackage,panthor-firmware)) diff --git a/package/kernel/linux/modules/video.mk b/package/kernel/linux/modules/video.mk index 6124b0e24d3..587ed892b69 100644 --- a/package/kernel/linux/modules/video.mk +++ b/package/kernel/linux/modules/video.mk @@ -618,7 +618,7 @@ $(eval $(call KernelPackage,drm-imx-ldb)) define KernelPackage/drm-lima SUBMENU:=$(VIDEO_MENU) TITLE:=Mali-4xx GPU support - DEPENDS:=@(TARGET_rockchip||TARGET_sunxi) +kmod-drm +!LINUX_5_15:kmod-drm-gem-shmem-helper + DEPENDS:=@(TARGET_rockchip||TARGET_sunxi) +kmod-drm +kmod-drm-gem-shmem-helper KCONFIG:= \ CONFIG_DRM_VGEM \ CONFIG_DRM_GEM_CMA_HELPER=y \ @@ -639,7 +639,7 @@ $(eval $(call KernelPackage,drm-lima)) define KernelPackage/drm-panfrost SUBMENU:=$(VIDEO_MENU) TITLE:=DRM support for ARM Mali Midgard/Bifrost GPUs - DEPENDS:=@(TARGET_rockchip||TARGET_sunxi) +kmod-drm +!LINUX_5_15:kmod-drm-gem-shmem-helper + DEPENDS:=@(TARGET_rockchip||TARGET_sunxi) +kmod-drm +kmod-drm-gem-shmem-helper KCONFIG:=CONFIG_DRM_PANFROST FILES:= \ $(LINUX_DIR)/drivers/gpu/drm/panfrost/panfrost.ko \ @@ -657,7 +657,8 @@ $(eval $(call KernelPackage,drm-panfrost)) define KernelPackage/drm-panthor SUBMENU:=$(VIDEO_MENU) TITLE:=DRM support for ARM Mali CSF-based GPUs - DEPENDS:=@TARGET_rockchip +kmod-drm +kmod-drm-exec +kmod-drm-gem-shmem-helper + DEPENDS:=@TARGET_rockchip +kmod-drm +kmod-drm-exec +kmod-drm-gem-shmem-helper \ + panthor-firmware KCONFIG:= \ CONFIG_DRM_GPUVM \ CONFIG_DRM_PANTHOR From d4d6c48b6e055dca5480d49d44503d1175539485 Mon Sep 17 00:00:00 2001 From: Jonas Jelonek Date: Mon, 25 Nov 2024 23:04:15 +0000 Subject: [PATCH 092/149] 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 110e023b962..2c5e420f93b 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 093/149] 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 2a133813263..85422fe1f63 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 9b704b983cb..48c040613c9 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 1fdb3036776..825e4abbad5 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 00000000000..f11cf016868 --- /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 094/149] 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 efcf0ec3585..910f60d11b2 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 d2c223b4efa..0f8b6e3d03f 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 c4455fbc747..8dba5b4275f 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 85422fe1f63..12dca517127 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 48c040613c9..5ffc4e33743 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 825e4abbad5..abc6fc1e091 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 095/149] 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 69008c65de0..b4133150918 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 218743e942c..e74d2d361d5 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 28524a3dcf4..12a89dae74a 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 096/149] 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 1e5dc77de0e..3b76c2be062 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 6ffc9364da8..ecb7bffa025 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 0844fcd6dbd..50fcdbaed81 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 d1364106406..572aad2a3b3 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 097/149] 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 c2fc609610e..cda3be9f2f5 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 b33ec98bf29..7a47292474f 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 00000000000..a123fe3a5f1 --- /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 098/149] 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 cc2dadbe9c7..5cae2a8821a 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 099/149] 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 dfbf3af137c..306f84a516f 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 100/149] 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 1c2a75f1dd4..731b5a82556 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 e987d754f0a..42910d436ee 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 101/149] 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 c7ddd8313a3..f049274889a 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 102/149] 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 5993c1b798d..b985c4bc8e4 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 f049274889a..9844dc2180f 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 27fcea86ece..d9647dbc072 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 From 21b3fff01c3c2c45d0a172fb6d5e8c274e7cb2d6 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 2 Dec 2024 16:50:22 -0800 Subject: [PATCH 103/149] ramips: rt3050: fix wrong compatible In the process of upstreaming the local phy driver back in 2017, it seems rt3050.dtsi was left out when updating the compatible string. Add device reset as the driver needs it. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/17257 Signed-off-by: Robert Marko --- target/linux/ramips/dts/rt3050.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/linux/ramips/dts/rt3050.dtsi b/target/linux/ramips/dts/rt3050.dtsi index 8a2304f7b96..fd52e519360 100644 --- a/target/linux/ramips/dts/rt3050.dtsi +++ b/target/linux/ramips/dts/rt3050.dtsi @@ -296,12 +296,12 @@ }; usbphy: usbphy { - compatible = "ralink,rt3050-usbphy"; + compatible = "ralink,rt3352-usbphy"; #phy-cells = <0>; ralink,sysctl = <&sysc>; - resets = <&sysc 22>; - reset-names = "host"; + resets = <&sysc 22>, <&sysc 25>; + reset-names = "host", "device"; }; ethernet: ethernet@10100000 { From 4b6e7da0f7499acb69feaacca79e0ee826c0b8db Mon Sep 17 00:00:00 2001 From: Shymon Samsel Date: Fri, 13 Dec 2024 05:59:04 -0500 Subject: [PATCH 104/149] ipq807x: add support for TP-Link EAP620 HD v1 Specifications: * SoC: Qualcomm IPQ8072A (64-bit Quad-core Arm Cortex-A53 @ 1.4 GHz) * Memory: 2x ESMT M15T4G16256A-DEBG2G (1 GiB DDR3-1866 13-13-13) * Serial Port: 3v3 TTL 115200n8 * Wi-Fi: QCA5054 (4x4 5 GHz 802.11ax) * Wi-Fi: QCN5024 (2x2 2.4 GHz 802.11b/g/n/ax) * Ethernet: AR8031 (10/100/1000BASE-T) * Flash: Winbond W29N01HZSINF (128 MiB) * LEDs: 1x Blue Status (GPIO 42 Active High) * Buttons: 1x Reset (GPIO 50 Active Low) Installation Instructions (Serial+TFTP): 1. Solder 4 pin header to JP1 and bridge pads of R58 and R62. 2. Connect 3V3 TTL port to TX, RX, and GND, which are positions 1, 2, and 3 respectively. Be sure to crossover TX and RX. 3. Copy RAM firmware openwrt-qualcommax-ipq807x-tplink_eap620hd-v1-initramfs-uImage.itb to a TFTP server's root that is in the same subnet as your AP. 4. Power up the AP hold Ctrl+B in the serial console (115200n8) until autoboot is halted. 5. Run the following commands in the U-boot prompt: # setenv serverip # setenv ipaddr # tftpboot 0x44000000 openwrt-qualcommax-ipq807x-tplink_eap620hd-v1-initramfs-uImage.itb # bootm You may need to type Ctrl+C and Enter before running these commands to clear invisible characters from the buffer. 6. Run the following command in a terminal to copy the sysupgrade image to be installed (check IP address): $ scp -O openwrt-qualcommax-ipq807x-tplink_eap620hd-v1-squashfs-sysupgrade.bin root@192.168.1.1:/tmp/ 7. Activate the OpenWrt serial console and run the following commands: # cd /tmp # sysupgrade -n openwrt-qualcommax-ipq807x-tplink_eap620hd-v1-squashfs-sysupgrade.bin 8. The AP will reboot and OpenWrt will be successfully installed. Known Issues: * 5GHz radio instability (upstream current ath11k build bug maybe?) Device support directly followed from EAP660HDv1 support Links: #15832 Signed-off-by: Shymon Samsel Link: https://github.com/openwrt/openwrt/pull/17254 Signed-off-by: Robert Marko --- .../uboot-envtools/files/qualcommax_ipq807x | 1 + package/firmware/ipq-wifi/Makefile | 2 + .../boot/dts/qcom/ipq8072-eap620hd-v1.dts | 142 ++++++++++++++++++ target/linux/qualcommax/image/ipq807x.mk | 14 ++ .../ipq807x/base-files/etc/board.d/02_network | 2 + .../etc/hotplug.d/firmware/11-ath11k-caldata | 1 + .../lib/preinit/09_mount_factory_data | 1 + .../base-files/lib/upgrade/platform.sh | 1 + 8 files changed, 164 insertions(+) create mode 100644 target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-eap620hd-v1.dts diff --git a/package/boot/uboot-envtools/files/qualcommax_ipq807x b/package/boot/uboot-envtools/files/qualcommax_ipq807x index f5fb07a4db0..b0088125c4c 100644 --- a/package/boot/uboot-envtools/files/qualcommax_ipq807x +++ b/package/boot/uboot-envtools/files/qualcommax_ipq807x @@ -39,6 +39,7 @@ linksys,mx8500) ;; netgear,sxr80|\ netgear,sxs80|\ +tplink,eap620hd-v1|\ tplink,eap660hd-v1) idx="$(find_mtd_index 0:appsblenv)" [ -n "$idx" ] && \ diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index fe17484d851..1cb6cd6863a 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -55,6 +55,7 @@ ALLWIFIBOARDS:= \ redmi_ax6 \ skspruce_wia3300-20 \ spectrum_sax1v1k \ + tplink_eap620hd-v1 \ tplink_eap660hd-v1 \ wallys_dr40x9 \ xiaomi_ax3600 \ @@ -184,6 +185,7 @@ $(eval $(call generate-ipq-wifi-package,prpl_haze,prpl Haze)) $(eval $(call generate-ipq-wifi-package,redmi_ax6,Redmi AX6)) $(eval $(call generate-ipq-wifi-package,skspruce_wia3300-20,SKSpruce WIA3300-20)) $(eval $(call generate-ipq-wifi-package,spectrum_sax1v1k,Spectrum SAX1V1K)) +$(eval $(call generate-ipq-wifi-package,tplink_eap620hd-v1,TP-Link EAP620 HD v1)) $(eval $(call generate-ipq-wifi-package,tplink_eap660hd-v1,TP-Link EAP660 HD v1)) $(eval $(call generate-ipq-wifi-package,wallys_dr40x9,Wallys DR40X9)) $(eval $(call generate-ipq-wifi-package,xiaomi_ax3600,Xiaomi AX3600)) diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-eap620hd-v1.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-eap620hd-v1.dts new file mode 100644 index 00000000000..05621892e6e --- /dev/null +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-eap620hd-v1.dts @@ -0,0 +1,142 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR BSD-2-Clause + +/dts-v1/; + +#include "ipq8074.dtsi" +#include "ipq8074-hk-cpu.dtsi" +#include "ipq8074-ess.dtsi" +#include +#include +#include + +/ { + model = "TP-Link EAP620 HD v1"; + compatible = "tplink,eap620hd-v1", "qcom,ipq8074"; + + aliases { + serial0 = &blsp1_uart5; + led-boot = &led_status_blue; + led-failsafe = &led_status_blue; + led-running = &led_status_blue; + led-upgrade = &led_status_blue; + }; + + chosen { + stdout-path = "serial0,115200n8"; + bootargs-append = " root=/dev/ubiblock0_1"; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 50 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_status_blue: status-blue { + function = LED_FUNCTION_STATUS; + gpios = <&tlmm 42 GPIO_ACTIVE_HIGH>; + color = ; + }; + }; +}; + +&blsp1_uart5 { + status = "okay"; +}; + +&tlmm { + mdio_pins: mdio-pins { + mdc { + pins = "gpio68"; + function = "mdc"; + drive-strength = <8>; + bias-pull-up; + }; + + mdio { + pins = "gpio69"; + function = "mdio"; + drive-strength = <8>; + bias-pull-up; + }; + }; +}; + +&mdio { + status = "okay"; + #size-cells = <1>; + pinctrl-0 = <&mdio_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>; + + ar8031: ethernet-phy@4 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <4>; + }; +}; + +&dp6 { + status = "okay"; + phy-handle = <&ar8031>; + label = "lan"; +}; + +&switch { + status = "okay"; + switch_lan_bmp = ; + switch_mac_mode2 = ; + + qcom,port_phyinfo { + port@6 { + phy_address = <4>; + port_id = <6>; + }; + }; +}; + +&edma { + status = "okay"; +}; + +&prng { + status = "okay"; +}; + +&cryptobam { + status = "okay"; +}; + +&crypto { + status = "okay"; +}; + +&qpic_bam { + status = "okay"; +}; + +&qpic_nand { + status = "okay"; + + nand@0 { + reg = <0>; + nand-ecc-strength = <4>; + nand-ecc-step-size = <512>; + nand-bus-width = <8>; + + partitions { + compatible = "qcom,smem-part"; + }; + }; +}; + +&wifi { + status = "okay"; + qcom,ath11k-calibration-variant = "TP-Link-EAP620-HD-v1"; +}; diff --git a/target/linux/qualcommax/image/ipq807x.mk b/target/linux/qualcommax/image/ipq807x.mk index ff6963405c6..4a194c6cb7b 100644 --- a/target/linux/qualcommax/image/ipq807x.mk +++ b/target/linux/qualcommax/image/ipq807x.mk @@ -346,6 +346,20 @@ define Device/spectrum_sax1v1k endef TARGET_DEVICES += spectrum_sax1v1k +define Device/tplink_eap620hd-v1 + $(call Device/FitImage) + $(call Device/UbiFit) + DEVICE_VENDOR := TP-Link + DEVICE_MODEL := EAP620 HD + DEVICE_VARIANT := v1 + BLOCKSIZE := 128k + PAGESIZE := 2048 + SOC := ipq8072 + DEVICE_PACKAGES := ipq-wifi-tplink_eap620hd-v1 + TPLINK_SUPPORT_STRING := SupportList:\r\nEAP620 HD(TP-Link|UN|AX1800-D):1.0\r\n +endef +TARGET_DEVICES += tplink_eap620hd-v1 + define Device/tplink_eap660hd-v1 $(call Device/FitImage) $(call Device/UbiFit) diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network index 437581d0011..012288fedc5 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network +++ b/target/linux/qualcommax/ipq807x/base-files/etc/board.d/02_network @@ -60,6 +60,7 @@ ipq807x_setup_interfaces() qnap,301w) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 10g-2" "10g-1" ;; + tplink,eap620hd-v1|\ tplink,eap660hd-v1) ucidef_set_interface_lan "lan" "dhcp" ;; @@ -92,6 +93,7 @@ ipq807x_setup_macs() lan_mac=$(macaddr_add $label_mac 1) wan_mac=$label_mac ;; + tplink,eap620hd-v1|\ tplink,eap660hd-v1) label_mac=$(get_mac_binary /tmp/factory_data/default-mac 0) lan_mac=$label_mac diff --git a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata index 2e741f04484..7496138a26f 100644 --- a/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata +++ b/target/linux/qualcommax/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata @@ -80,6 +80,7 @@ case "$FIRMWARE" in spectrum,sax1v1k) caldata_extract_mmc "0:ART" 0x1000 0x20000 ;; + tplink,eap620hd-v1|\ tplink,eap660hd-v1) caldata_from_file "/tmp/factory_data/radio" 0 0x20000 label_mac=$(get_mac_binary /tmp/factory_data/default-mac 0) diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/preinit/09_mount_factory_data b/target/linux/qualcommax/ipq807x/base-files/lib/preinit/09_mount_factory_data index 59fde529d3c..2563202a1a2 100644 --- a/target/linux/qualcommax/ipq807x/base-files/lib/preinit/09_mount_factory_data +++ b/target/linux/qualcommax/ipq807x/base-files/lib/preinit/09_mount_factory_data @@ -7,6 +7,7 @@ preinit_mount_factory_data() { . /lib/functions/system.sh case $(board_name) in + tplink,eap620hd-v1|\ tplink,eap660hd-v1) mtd_path=$(find_mtd_chardev "factory_data") ubiattach --dev-path="$mtd_path" --devn=1 diff --git a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh index 70657629fcc..5e339ae1ecc 100644 --- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh @@ -214,6 +214,7 @@ platform_do_upgrade() { CI_DATAPART="rootfs_data" emmc_do_upgrade "$1" ;; + tplink,eap620hd-v1|\ tplink,eap660hd-v1) tplink_do_upgrade "$1" ;; From b651e3223cbbffd86d1b63764032454c571d7c6a Mon Sep 17 00:00:00 2001 From: Shymon Samsel Date: Thu, 19 Dec 2024 12:28:43 -0500 Subject: [PATCH 105/149] ipq-wifi: update to Git HEAD (2024-12-18) 4b849214b137 ipq8074: add TP-Link EAP620 HD v1 BDF Add board file for TP-Link EAP620 HD v1. Sourced from bdwlan_US.bin in stock firmware 1.1.0 Build 20211028 Signed-off-by: Shymon Samsel Link: https://github.com/openwrt/openwrt/pull/17254 Signed-off-by: Robert Marko --- package/firmware/ipq-wifi/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 1cb6cd6863a..679a1442115 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -6,9 +6,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware/qca-wireless.git -PKG_SOURCE_DATE:=2024-11-28 -PKG_SOURCE_VERSION:=e1f6c9ac9e1508852f292a2b8167823e180db4e8 -PKG_MIRROR_HASH:=cc7ef25d43bbea4d521e0cb69887b975295be98ddf83b29f52c3c0e7d1ceeb25 +PKG_SOURCE_DATE:=2024-12-18 +PKG_SOURCE_VERSION:=4b849214b137b14a903112af3c2016ad9acf48c2 +PKG_MIRROR_HASH:=28162682fe7612460e42398ecc669e245fc0ece873361e3910c2dd8a56111f1c PKG_FLAGS:=nonshared include $(INCLUDE_DIR)/package.mk From 33e23e8922ce7b7e488c85816c4b1084ae3710b0 Mon Sep 17 00:00:00 2001 From: Eric Fahlgren Date: Tue, 3 Dec 2024 15:17:05 -0800 Subject: [PATCH 106/149] build: d1: add SUPPORTED_DEVICES Include specific SUPPORTED_DEVICES values derived from the .dts file. This makes the generated profiles.json consistent with the 'board_name' from 'ubus call system board'. Specifically, this fixes a bug in the generated profiles.json that breaks the ASU clients when selecting the proper image from a build. See the 'supported_devices' fields here for the incorrect (or incomplete) list: https://downloads.openwrt.org/releases/24.10.0-rc1/targets/d1/generic/profiles.json Links: https://forum.openwrt.org/t/owut-openwrt-upgrade-tool/200035/287 Signed-off-by: Eric Fahlgren Link: https://github.com/openwrt/openwrt/pull/17155 Signed-off-by: Robert Marko --- target/linux/d1/image/Makefile | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/target/linux/d1/image/Makefile b/target/linux/d1/image/Makefile index aadf1807e75..8dca2fb1cb0 100644 --- a/target/linux/d1/image/Makefile +++ b/target/linux/d1/image/Makefile @@ -49,43 +49,47 @@ define Device/FitImage KERNEL_NAME := Image endef -define Device/dongshan_nezha_stu +define Device/100ask_dongshan-nezha-stu $(call Device/Default) DEVICE_VENDOR := Dongshan DEVICE_MODEL := Nezha STU devkit DEVICE_DTS := allwinner/sun20i-d1-dongshan-nezha-stu + SUPPORTED_DEVICES += dongshan_nezha_stu UBOOT := dongshan_nezha_stu endef -TARGET_DEVICES += dongshan_nezha_stu +TARGET_DEVICES += 100ask_dongshan-nezha-stu -define Device/lichee_rv_dock +define Device/sipeed_lichee-rv-dock $(call Device/Default) DEVICE_VENDOR := Sipeed DEVICE_MODEL := LicheePi RV (dock) DEVICE_DTS := allwinner/sun20i-d1-lichee-rv-dock + SUPPORTED_DEVICES += lichee_rv_dock DEVICE_PACKAGES += kmod-rtl8723bs UBOOT := lichee_rv_dock endef -TARGET_DEVICES += lichee_rv_dock +TARGET_DEVICES += sipeed_lichee-rv-dock -define Device/mangopi_mq_pro +define Device/widora_mangopi-mq-pro $(call Device/Default) DEVICE_VENDOR := MangoPi DEVICE_MODEL := MQ Pro DEVICE_DTS := allwinner/sun20i-d1-mangopi-mq-pro + SUPPORTED_DEVICES += mangopi_mq_pro DEVICE_PACKAGES += kmod-rtl8723bs UBOOT := mangopi_mq_pro endef -TARGET_DEVICES += mangopi_mq_pro +TARGET_DEVICES += widora_mangopi-mq-pro -define Device/nezha +define Device/allwinner_d1-nezha $(call Device/Default) DEVICE_VENDOR := Nezha DEVICE_MODEL := D1 DEVICE_DTS := allwinner/sun20i-d1-nezha + SUPPORTED_DEVICES += nezha UBOOT := nezha endef -TARGET_DEVICES += nezha +TARGET_DEVICES += allwinner_d1-nezha define Image/Build $(call Image/Build/$(1),$(1)) From a7f4155f54ac72c388a8b515865e496bfd6ec437 Mon Sep 17 00:00:00 2001 From: Jonas Jelonek Date: Wed, 18 Dec 2024 21:57:22 +0100 Subject: [PATCH 107/149] kernel: netdevices: add driver for Broadcom NetXtreme-C/E Package bnxt_en kernel module for Broadcom NetXtreme-C/E based Ethernet network chips like BCM573xx and BCM574xx. Signed-off-by: Jonas Jelonek Link: https://github.com/openwrt/openwrt/pull/17301 Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/netdevices.mk | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index cd24fb3ecbc..c72bc0e8e63 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -1525,6 +1525,28 @@ endef $(eval $(call KernelPackage,bnx2x)) +define KernelPackage/bnxt-en + SUBMENU:=$(NETWORK_DEVICES_MENU) + TITLE:=Broadcom NetXtreme-C/E network driver + DEPENDS:=@PCI_SUPPORT +kmod-hwmon-core +kmod-lib-crc32c +kmod-mdio +kmod-ptp + FILES:=$(LINUX_DIR)/drivers/net/ethernet/broadcom/bnxt/bnxt_en.ko + KCONFIG:= \ + CONFIG_BNXT \ + CONFIG_BNXT_SRIOV=y \ + CONFIG_BNXT_FLOWER_OFFLOAD=y \ + CONFIG_BNXT_DCB=n \ + CONFIG_BNXT_HWMON=y + AUTOLOAD:=$(call AutoProbe,bnxt_en) +endef + +define KernelPackage/bnxt-en/description + Supports Broadcom NetXtreme-C/E based Ethernet NICs including: + * BCM573xx + * BCM574xx +endef + +$(eval $(call KernelPackage,bnxt-en)) + define KernelPackage/be2net SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=Broadcom Emulex OneConnect 10Gbps NIC From 9d434a8abf7cb50782aaae41fe2b011b3a9bf489 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Wed, 16 Oct 2024 16:05:40 +0800 Subject: [PATCH 108/149] kernel: crypto: add atmel i2c hw accelerator support Add support for Microchip / Atmel ECC/SHA/RNG hw accelerator. Signed-off-by: Tianling Shen Link: https://github.com/openwrt/openwrt/pull/17253 Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/crypto.mk | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk index 2257a36c802..78c97121764 100644 --- a/package/kernel/linux/modules/crypto.mk +++ b/package/kernel/linux/modules/crypto.mk @@ -366,6 +366,26 @@ endef $(eval $(call KernelPackage,crypto-hmac)) +define KernelPackage/crypto-hw-atmel + TITLE:=Microchip / Atmel ECC/SHA/RNG hw accelerator + DEPENDS:=+kmod-i2c-core +kmod-crypto-ecdh +kmod-crypto-sha1 \ + +kmod-crypto-sha256 +kmod-lib-crc16 +kmod-random-core + KCONFIG:= \ + CONFIG_CRYPTO_HW=y \ + CONFIG_CRYPTO_DEV_ATMEL_I2C \ + CONFIG_CRYPTO_DEV_ATMEL_ECC \ + CONFIG_CRYPTO_DEV_ATMEL_SHA204A + FILES:= \ + $(LINUX_DIR)/drivers/crypto/atmel-i2c.ko \ + $(LINUX_DIR)/drivers/crypto/atmel-ecc.ko \ + $(LINUX_DIR)/drivers/crypto/atmel-sha204a.ko + AUTOLOAD:=$(call AutoLoad,09,atmel-i2c atmel-ecc atmel-sha204a) + $(call AddDepends/crypto) +endef + +$(eval $(call KernelPackage,crypto-hw-atmel)) + + define KernelPackage/crypto-hw-ccp TITLE:=AMD Cryptographic Coprocessor DEPENDS:= \ From 5a7fb834c7cb53cac7855759ca4165f596f1e4c8 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Wed, 16 Oct 2024 16:05:40 +0800 Subject: [PATCH 109/149] mediatek: update openembed som7981 support The board has been redesigned due to previous hardware bugs (with other reasons maybe). Changes in new board: - Added a gpio beeper - Added a Atmel i2c eeprom - Added a Atmel i2c ECC accelerator - Added a Philips RTC module - Added two RS485 - Removed WPS button - Replaced USB3 port with M.2 B-key for LTE modules - Swapped GbE LEDs gpio Also assigned wifi mac with nvmem binding, added iface setup for failsafe, increased phy assert time for rtl8221b, and updated LED labels. Keeping compatibility for old version is not necessary here as only few samples were sent to those interested in it. Signed-off-by: Tianling Shen Link: https://github.com/openwrt/openwrt/pull/17253 Signed-off-by: Hauke Mehrtens --- .../lib/preinit/05_set_preinit_iface | 3 +- .../dts/mt7981b-openembed-som7981.dts | 111 ++++++++++++++---- .../filogic/base-files/etc/board.d/01_leds | 4 +- .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 3 - target/linux/mediatek/image/filogic.mk | 5 +- 5 files changed, 99 insertions(+), 27 deletions(-) diff --git a/target/linux/mediatek/base-files/lib/preinit/05_set_preinit_iface b/target/linux/mediatek/base-files/lib/preinit/05_set_preinit_iface index 0deab424813..1025d1f1e13 100644 --- a/target/linux/mediatek/base-files/lib/preinit/05_set_preinit_iface +++ b/target/linux/mediatek/base-files/lib/preinit/05_set_preinit_iface @@ -2,7 +2,8 @@ set_preinit_iface() { case $(board_name) in cudy,m3000-v1|\ cudy,tr3000-v1|\ - glinet,gl-mt3000) + glinet,gl-mt3000|\ + openembed,som7981) ip link set eth1 up ifname=eth1 ;; diff --git a/target/linux/mediatek/dts/mt7981b-openembed-som7981.dts b/target/linux/mediatek/dts/mt7981b-openembed-som7981.dts index 0e9dea1ddb0..d5c868567bd 100644 --- a/target/linux/mediatek/dts/mt7981b-openembed-som7981.dts +++ b/target/linux/mediatek/dts/mt7981b-openembed-som7981.dts @@ -12,9 +12,10 @@ compatible = "openembed,som7981", "mediatek,mt7981"; aliases { - led-boot = &wlan2g_led; - led-failsafe = &wlan2g_led; - led-upgrade = &wlan2g_led; + led-boot = &act_led; + led-failsafe = &act_led; + led-running = &act_led; + led-upgrade = &act_led; serial0 = &uart0; }; @@ -26,6 +27,11 @@ reg = <0 0x40000000 0 0x40000000>; }; + beeper { + compatible = "gpio-beeper"; + gpios = <&pio 2 GPIO_ACTIVE_HIGH>; + }; + gpio-keys { compatible = "gpio-keys"; @@ -34,12 +40,6 @@ linux,code = ; gpios = <&pio 1 GPIO_ACTIVE_LOW>; }; - - button-wps { - label = "wps"; - linux,code = ; - gpios = <&pio 0 GPIO_ACTIVE_LOW>; - }; }; gpio-leds { @@ -47,28 +47,27 @@ led-0 { function = LED_FUNCTION_LAN; - color = ; + color = ; gpios = <&pio 8 GPIO_ACTIVE_LOW>; }; led-1 { function = LED_FUNCTION_LAN; - color = ; + color = ; gpios = <&pio 13 GPIO_ACTIVE_LOW>; }; - wlan2g_led: led-2 { - function = LED_FUNCTION_WLAN_2GHZ; - color = ; + led-2 { + function = LED_FUNCTION_PANIC; + color = ; gpios = <&pio 34 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy0tpt"; + panic-indicator; }; - led-3 { - function = LED_FUNCTION_WLAN_5GHZ; + act_led: led-3 { + function = LED_FUNCTION_ACTIVITY; color = ; gpios = <&pio 35 GPIO_ACTIVE_LOW>; - linux,default-trigger = "phy1tpt"; }; }; }; @@ -97,14 +96,38 @@ }; }; +&i2c0 { + clock-frequency = <400000>; + pinctrl-names = "default"; + pinctrl-0 = <&i2c0_pins>; + status = "okay"; + + eeprom@50 { + compatible = "atmel,24c64"; + reg = <0x50>; + page-size = <32>; + }; + + rtc@51 { + compatible = "nxp,pcf8563"; + reg = <0x51>; + #clock-cells = <0>; + }; + + crypto@60 { + compatible = "atmel,atecc508a"; + reg = <0x60>; + }; +}; + &mdio_bus { phy0: ethernet-phy@5 { reg = <5>; compatible = "ethernet-phy-ieee802.3-c45"; phy-mode = "2500base-x"; reset-gpios = <&pio 14 GPIO_ACTIVE_LOW>; - reset-assert-us = <10000>; - reset-deassert-us = <50000>; + reset-assert-us = <15000>; + reset-deassert-us = <68000>; realtek,aldps-enable; }; }; @@ -184,6 +207,13 @@ }; &pio { + i2c0_pins: i2c0-pins { + mux { + function = "i2c"; + groups = "i2c0_1"; + }; + }; + spi0_flash_pins: spi0-pins { mux { function = "spi"; @@ -202,12 +232,45 @@ mediatek,pull-down-adv = <0>; }; }; + + uart1_pins: uart1-pins { + mux { + function = "uart"; + groups = "uart1_3"; + }; + }; + + uart2_pins: uart2-pins { + mux { + function = "uart"; + groups = "uart2_0_tx_rx"; + }; + }; + + wwan_rst_h: wwan-rst-h { + pins = "GPIO_WPS"; + drive-strength = <8>; + mediatek,pull-down-adv = <0>; + output-low; + }; }; &uart0 { status = "okay"; }; +&uart1 { + pinctrl-names = "default"; + pinctrl-0 = <&uart1_pins>; + status = "okay"; +}; + +&uart2 { + pinctrl-names = "default"; + pinctrl-0 = <&uart2_pins>; + status = "okay"; +}; + &usb_phy { status = "okay"; }; @@ -220,8 +283,16 @@ nvmem-cells = <&eeprom_factory_0>; nvmem-cell-names = "eeprom"; status = "okay"; + + band@1 { + reg = <1>; + nvmem-cells = <&macaddr_factory_a 0>; + nvmem-cell-names = "mac-address"; + }; }; &xhci { + pinctrl-names = "default"; + pinctrl-0 = <&wwan_rst_h>; status = "okay"; }; diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds index 2496323d873..ca4961c6553 100644 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds @@ -71,8 +71,8 @@ nradio,c8-668gl) ucidef_set_led_netdev "5g" "5G" "blue:indicator-0" "eth1" "link" ;; openembed,som7981) - ucidef_set_led_netdev "lanact" "LANACT" "green:lan" "eth1" "rx tx" - ucidef_set_led_netdev "lanlink" "LANLINK" "amber:lan" "eth1" "link" + ucidef_set_led_netdev "lanact" "LANACT" "amber:lan" "eth1" "rx tx" + ucidef_set_led_netdev "lanlink" "LANLINK" "green:lan" "eth1" "link" ;; openwrt,one) ucidef_set_led_netdev "wanact" "WANACT" "mdio-bus:0f:green:wan" "eth0" "rx tx" diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index 41c425e5579..3f5554d269f 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -141,9 +141,6 @@ case "$board" in [ "$PHYNBR" = "0" ] && echo "$hw_mac_addr" > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_setbit_la $hw_mac_addr > /sys${DEVPATH}/macaddress ;; - openembed,som7981) - [ "$PHYNBR" = "1" ] && cat /sys/class/net/eth0/address > /sys${DEVPATH}/macaddress - ;; qihoo,360t7) addr=$(mtd_get_mac_ascii factory lanMac) [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index abc6fc1e091..91706f8c73c 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -1215,7 +1215,10 @@ define Device/openembed_som7981 DEVICE_MODEL := SOM7981 DEVICE_DTS := mt7981b-openembed-som7981 DEVICE_DTS_DIR := ../dts - DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware \ + kmod-crypto-hw-atmel kmod-eeprom-at24 kmod-gpio-beeper kmod-rtc-pcf8563 \ + kmod-usb-net-cdc-mbim kmod-usb-net-qmi-wwan kmod-usb-serial-option \ + kmod-usb3 uqmi UBINIZE_OPTS := -E 5 BLOCKSIZE := 128k PAGESIZE := 2048 From dc655dcfca9a8e527cdea9eb395bea4aff276b30 Mon Sep 17 00:00:00 2001 From: Rani Hod Date: Sun, 22 Dec 2024 02:53:51 +0200 Subject: [PATCH 110/149] linux-firmware: package MediaTek MT7925 Bluetooth firmware `btusb` fails to start on MT7925 hardware without the appropriate firmware being loaded first: ``` bluetooth hci0: Direct firmware load for mediatek/mt7925/BT_RAM_CODE_MT7925_1_1_hdr.bin failed with error -2 bluetooth hci0: Falling back to sysfs fallback for: mediatek/mt7925/BT_RAM_CODE_MT7925_1_1_hdr.bin ``` Package firmware for MediaTek MT7925 Bluetooth from `linux-firmware`. Signed-off-by: Rani Hod Link: https://github.com/openwrt/openwrt/pull/17331 Signed-off-by: Hauke Mehrtens --- package/firmware/linux-firmware/mediatek.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/package/firmware/linux-firmware/mediatek.mk b/package/firmware/linux-firmware/mediatek.mk index d520557196d..cbc1c70d81f 100644 --- a/package/firmware/linux-firmware/mediatek.mk +++ b/package/firmware/linux-firmware/mediatek.mk @@ -69,6 +69,15 @@ define Package/mt7922bt-firmware/install endef $(eval $(call BuildPackage,mt7922bt-firmware)) +Package/mt7925bt-firmware = $(call Package/firmware-default,mt7925bt firmware,,LICENCE.mediatek) +define Package/mt7925bt-firmware/install + $(INSTALL_DIR) $(1)/lib/firmware/mediatek/mt7925 + $(INSTALL_DATA) \ + $(PKG_BUILD_DIR)/mediatek/mt7925/BT_RAM_CODE_MT7925_1_1_hdr.bin \ + $(1)/lib/firmware/mediatek/mt7925 +endef +$(eval $(call BuildPackage,mt7925bt-firmware)) + Package/mt7981-wo-firmware = $(call Package/firmware-default,MT7981 offload firmware,,LICENCE.mediatek) define Package/mt7981-wo-firmware/install $(INSTALL_DIR) $(1)/lib/firmware/mediatek From 6992d6e51af34603de099d7bbe9d7e848f109e22 Mon Sep 17 00:00:00 2001 From: Maxim Anisimov Date: Tue, 10 Dec 2024 16:37:02 +0300 Subject: [PATCH 111/149] mediatek/filogic: add support for Cudy AP3000 v1 Hardware: SoC: MT7981b RAM: 512 MB Flash: 256 MB SPI NAND Ethernet: 1x2.5Gbps (rtl8221b) WiFi: 2x2 MT7981 Button: Reset LED: 1x multicolor Installation ------------ At the moment, firmware installation is only possible via a transition firmware. It's can be requested from the manufacturer by email to support@cudy.com Signed-off-by: Maxim Anisimov Link: https://github.com/openwrt/openwrt/pull/17225 Signed-off-by: Hauke Mehrtens --- .../mediatek/dts/mt7981b-cudy-ap3000-v1.dts | 218 ++++++++++++++++++ .../filogic/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/ieee80211/11_fix_wifi_mac | 9 +- target/linux/mediatek/image/filogic.mk | 17 ++ 4 files changed, 239 insertions(+), 6 deletions(-) create mode 100644 target/linux/mediatek/dts/mt7981b-cudy-ap3000-v1.dts diff --git a/target/linux/mediatek/dts/mt7981b-cudy-ap3000-v1.dts b/target/linux/mediatek/dts/mt7981b-cudy-ap3000-v1.dts new file mode 100644 index 00000000000..bd6c15225b4 --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-cudy-ap3000-v1.dts @@ -0,0 +1,218 @@ +// SPDX-License-Identifier: GPL-2.0-only OR MIT + +/dts-v1/; + +#include "mt7981.dtsi" + +/ { + model = "Cudy AP3000 v1"; + compatible = "cudy,ap3000-v1", "mediatek,mt7981"; + + aliases { + label-mac-device = &gmac0; + led-boot = &status_led; + led-failsafe = &status_led; + led-running = &status_led; + led-upgrade = &status_led; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + button-reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + }; + + gpio-leds { + compatible = "gpio-leds"; + + led-0 { + color = ; + function = LED_FUNCTION_WLAN_2GHZ; + gpios = <&pio 4 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led-1 { + color = ; + function = LED_FUNCTION_WLAN_5GHZ; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + status_led: led-2 { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&pio 11 GPIO_ACTIVE_LOW>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&pio 6 GPIO_ACTIVE_HIGH>; + hw_algo = "level"; + hw_margin_ms = <10000>; + always-running; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-handle = <&phy1>; + phy-mode = "2500base-x"; + + nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_bdinfo_de00 0>; + }; +}; + +&mdio_bus { + phy1: phy@1 { + reg = <1>; + interrupt-parent = <&pio>; + interrupts = <38 IRQ_TYPE_LEVEL_LOW>; + reset-gpios = <&pio 39 GPIO_ACTIVE_LOW>; + reset-assert-us = <100000>; + reset-deassert-us = <100000>; + }; +}; + +&pio { + spi0_flash_pins: spi0-pins { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + + conf-pu { + pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP"; + drive-strength = ; + bias-pull-up = ; + }; + + conf-pd { + pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO"; + drive-strength = ; + bias-pull-down = ; + }; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + /* ESMT F50L2G41XA (256M) */ + spi_nand@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-nand"; + reg = <0>; + + spi-max-frequency = <52000000>; + spi-tx-buswidth = <4>; + spi-rx-buswidth = <4>; + + spi-cal-enable; + spi-cal-mode = "read-data"; + spi-cal-datalen = <7>; + spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4e 0x41 0x4e 0x44>; + spi-cal-addrlen = <5>; + spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>; + + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bl2"; + reg = <0x0 0x100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x100000 0x80000>; + }; + + partition@180000 { + label = "factory"; + reg = <0x180000 0x200000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1000>; + }; + }; + }; + + partition@380000 { + label = "bdinfo"; + reg = <0x380000 0x40000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_bdinfo_de00: macaddr@de00 { + compatible = "mac-base"; + reg = <0xde00 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@3C0000 { + label = "fip"; + reg = <0x3C0000 0x200000>; + read-only; + }; + + partition@5C0000 { + label = "ubi"; + reg = <0x5C0000 0x4000000>; + }; + }; + }; +}; + +&wifi { + nvmem-cell-names = "eeprom"; + nvmem-cells = <&eeprom_factory_0>; + status = "okay"; +}; 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 12dca517127..d58a450a9d4 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 @@ -75,6 +75,7 @@ mediatek_setup_interfaces() ucidef_set_interfaces_lan_wan "lan1" eth1 ;; cudy,ap3000outdoor-v1|\ + cudy,ap3000-v1|\ cudy,re3000-v1|\ netgear,wax220|\ ubnt,unifi-6-plus|\ diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac index 3f5554d269f..3188fe71d5a 100644 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac @@ -73,14 +73,11 @@ case "$board" in addr=$(mtd_get_mac_binary "Factory" 0x8000) [ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress ;; - cudy,tr3000-v1|\ - cudy,re3000-v1) - addr=$(mtd_get_mac_binary bdinfo 0xde00) - [ "$PHYNBR" = "0" ] && echo "$addr" > /sys${DEVPATH}/macaddress - [ "$PHYNBR" = "1" ] && macaddr_setbit_la $(macaddr_add $addr 1) > /sys${DEVPATH}/macaddress - ;; cudy,ap3000outdoor-v1|\ + cudy,ap3000-v1|\ cudy,m3000-v1|\ + cudy,re3000-v1|\ + cudy,tr3000-v1|\ cudy,wr3000s-v1|\ cudy,wr3000-v1) addr=$(mtd_get_mac_binary bdinfo 0xde00) diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 91706f8c73c..9815c8ce184 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -594,6 +594,23 @@ define Device/cudy_ap3000outdoor-v1 endef TARGET_DEVICES += cudy_ap3000outdoor-v1 +define Device/cudy_ap3000-v1 + DEVICE_VENDOR := Cudy + DEVICE_MODEL := AP3000 + DEVICE_VARIANT := v1 + DEVICE_DTS := mt7981b-cudy-ap3000-v1 + DEVICE_DTS_DIR := ../dts + SUPPORTED_DEVICES += R49 + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 65536k + KERNEL_IN_UBI := 1 + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware +endef +TARGET_DEVICES += cudy_ap3000-v1 + define Device/cudy_m3000-v1 DEVICE_VENDOR := Cudy DEVICE_MODEL := M3000 From e0813dc071db32e848ba86ef9ae57510a54cd96f Mon Sep 17 00:00:00 2001 From: Jianyu Zhuang Date: Tue, 10 Dec 2024 15:38:20 +0800 Subject: [PATCH 112/149] mediatek: filogic: add support for Tenbay WR3000K MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tenbay WR3000K is an 802.11ax (Wi-Fi 6) router, based on MediaTek MT7981B. - SoC: MetiaTek MT7981B - RAM: Hynex H5TQ2G863GFR 512MiB - Flash: Winbond W25N01GVZEIG 128MiB - Wi-Fi: MediaTek MT7976C (2.4GHz/5GHz, 802.11ax, 2x2 MIMO, AX3000) - MediaTek MT7915E: 2.4GHz and 5GHz - Ethernet: 1x 10/100/1000 Mbps WAN + 3x 10/100/1000 Mbps LAN - Switch: MediaTek MT7531AE - UART: J4 (115200 baud) - LEDs: Power - Buttons: Reset, WPS - PWR: 12V/1A DC, 5.5×2.1 connector | Vendor | OpenWrt Interface | Address | Notes | |---------|-------------------|---------------|------------------------------------------------| | WAN | wan | Label MAC | Stored MAC in factory + offset 4, label MAC is Stored MAC - 2 | | LAN | br-lan | Label MAC+1 | | | 2.4GHz | phy0-ap0 | Label MAC + 2 | | | 5GHz | phy1-ap0 | Label MAC + 3 | | - 0x000000000000-0x000000100000 : "BL2" - 0x000000100000-0x000000180000 : "u-boot-env" - 0x000000180000-0x000000380000 : "Factory" - 0x000000380000-0x000000580000 : "FIP" - 0x000000580000-0x000003580000 : "ubi" - 0x000003580000-0x000006580000 : "ubi1" - 0x000006580000-0x0000065a0000 : "Product" - 0x0000065a0000-0x000007580000 : "Custom" - The original partition-Ubi partition-Ubi1 is an AB dual system, and Openwrt only uses Ubi. So flash requires modifying the uboot variable `boot_from=ubi` to ensure that it only starts from Ubi. - The Product and Custom partitions are original and only exist to align with the original layout; they are not used by OpenWrt. - id: 0, kernel - id: 1, rootfs - id: 2, rootfs_data - **USB-to-TTL Serial Adapter** (e.g., CH340 or CP2102). - **Dupont Wires** (male-to-male, 3 wires). - **PC/Laptop** with a serial communication tool. - Screwdriver (to open the router case). 1. **OpenWrt Firmware**: - Download the appropriate `wr3000k--mediatek-filogic-tenbay_wr3000k-squashfs-sysupgrade.bin` firmware file for your router from the [OpenWrt website](https://openwrt.org/). 2. **Serial Communication Tool**: - Windows: PuTTY, Tera Term. - Linux/Mac: Minicom, screen. 3. (Optional) **TFTP Server**: - Install a TFTP server like Tftpd64 or tftp-hpa. --- 1. Open the router casing and locate the **TX, RX, and GND** pins. 2. Connect the router pins to the USB-to-TTL adapter as follows: - **TX (router)** → **RX (adapter)** - **RX (router)** → **TX (adapter)** - **GND (router)** → **GND (adapter)** 3. Do **not** connect the VCC pin to avoid damage. - **Baud rate**: 115200 - **Data bits**: 8 - **Stop bits**: 1 - **Parity**: None - **Flow control**: None --- 1. Power on the router and observe the serial terminal output. 2. When prompted (e.g., `Hit any key to stop autoboot: 3`), press the '/' key quickly to interrupt the boot process. 3. You will see the U-Boot Boot Menu: ```plaintext *** U-Boot Boot Menu *** 1. Factory mode 2. Startup system (Default) 3. Upgrade firmware 4. Upgrade ATF BL2 5. Upgrade ATF FIP 6. Upgrade single image 7. Load image 0. U-Boot console Press UP/DOWN to move, ENTER to select, ESC/CTRL+C to quit ``` 4. Select Option 0 by typing 0 and pressing Enter. 5. Input into ```plaintext MT7981> setenv boot_from ubi MT7981> saveenv Saving Environment to MTD... Erasing on MTD device 'nmbm0'... OK Writing to MTD device 'nmbm0'... OK OK MT7981> printenv baudrate=115200 boot_from=ubi ... ``` the above indicates system will start from *ubi*. and then type ```plaintext MT7981> reset ``` will boot from *ubi* 1. Power on the router and observe the serial terminal output. 2. When prompted (e.g., `Hit any key to stop autoboot: 3`), press the '/' key quickly to interrupt the boot process. 3. You will see the U-Boot Boot Menu: ```plaintext *** U-Boot Boot Menu *** 1. Factory mode 2. Startup system (Default) 3. Upgrade firmware 4. Upgrade ATF BL2 5. Upgrade ATF FIP 6. Upgrade single image 7. Load image 0. U-Boot console Press UP/DOWN to move, ENTER to select, ESC/CTRL+C to quit ``` 4. Choose Option 3: Upgrade Firmware Enter Upgrade Mode Select Option 3 by typing 3 and pressing Enter. Upgrade Methods You will be prompted to choose between: ```plaintext *** Upgrading Firmware *** Run image after upgrading? (Y/n): y Available load methods: 0 - TFTP client (Default) 1 - Xmodem 2 - Ymodem 3 - Kermit 4 - S-Record 5 - RAM Select (enter for default): 0 Input U-Boot's IP address: 192.168.1.1 Input TFTP server's IP address: 192.168.1.10 Input IP netmask: 255.255.255.0 Input file name: wr3000k--mediatek-filogic-tenbay_wr3000k-squashfs-sysupgrade.bin ``` Type Enter to proceed. The router will erase the old firmware and write the new one. Signed-off-by: Jianyu Zhuang Link: https://github.com/openwrt/openwrt/pull/17172 Signed-off-by: Hauke Mehrtens --- .../uboot-envtools/files/mediatek_filogic | 1 + .../mediatek/dts/mt7981b-tenbay-wr3000k.dts | 249 ++++++++++++++++++ .../filogic/base-files/etc/board.d/02_network | 3 +- target/linux/mediatek/image/filogic.mk | 21 ++ 4 files changed, 273 insertions(+), 1 deletion(-) create mode 100644 target/linux/mediatek/dts/mt7981b-tenbay-wr3000k.dts diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic index d0a15e34736..9d7c5a1527b 100644 --- a/package/boot/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-envtools/files/mediatek_filogic @@ -107,6 +107,7 @@ glinet,gl-mt3000) ;; mercusys,mr90x-v1|\ routerich,ax3000|\ +tenbay,wr3000k|\ tplink,re6000xd) local envdev=/dev/mtd$(find_mtd_index "u-boot-env") ubootenv_add_uci_config "$envdev" "0x0" "0x20000" "0x20000" "1" diff --git a/target/linux/mediatek/dts/mt7981b-tenbay-wr3000k.dts b/target/linux/mediatek/dts/mt7981b-tenbay-wr3000k.dts new file mode 100644 index 00000000000..2ae16673afa --- /dev/null +++ b/target/linux/mediatek/dts/mt7981b-tenbay-wr3000k.dts @@ -0,0 +1,249 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; +#include "mt7981.dtsi" + +/ { + model = "Tenbay WR3000K"; + compatible = "tenbay,wr3000k", "mediatek,mt7981"; + + aliases { + led-boot = &led_run; + led-failsafe = &led_blue; + led-running = &led_green; + led-upgrade = &led_blue; + serial0 = &uart0; + label-mac-device = &wan; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + gpio-keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&pio 1 GPIO_ACTIVE_LOW>; + }; + + wps { + label = "wps"; + linux,code = ; + gpios = <&pio 0 GPIO_ACTIVE_LOW>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_run: led-0 { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + }; + + led_green: led-1 { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&pio 11 GPIO_ACTIVE_LOW>; + }; + + led_blue: led-2 { + color = ; + function = LED_FUNCTION_STATUS; + gpios = <&pio 12 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +ð { + pinctrl-names = "default"; + pinctrl-0 = <&mdio_pins>; + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + nvmem-cells = <&macaddr_factory_4 (-1)>; + nvmem-cell-names = "mac-address"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; +}; + +&mdio_bus { + switch: switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <38 IRQ_TYPE_LEVEL_HIGH>; + }; +}; + +&switch { + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + }; + + port@1 { + reg = <1>; + label = "lan2"; + }; + + port@2 { + reg = <2>; + label = "lan3"; + }; + + wan: port@3 { + reg = <3>; + label = "wan"; + nvmem-cells = <&macaddr_factory_4 (-2)>; + nvmem-cell-names = "mac-address"; + }; + + port@6 { + reg = <6>; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi0_flash_pins>; + status = "okay"; + + flash@0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "spi-nand"; + reg = <0>; + spi-max-frequency = <52000000>; + + spi-cal-enable; + spi-cal-mode = "read-data"; + spi-cal-datalen = <7>; + spi-cal-data = /bits/ 8 <0x53 0x50 0x49 0x4E 0x41 0x4E 0x44>; + spi-cal-addrlen = <5>; + spi-cal-addr = /bits/ 32 <0x0 0x0 0x0 0x0 0x0>; + + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "BL2"; + reg = <0x00000 0x0100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x0100000 0x0080000>; + }; + + factory: partition@180000 { + label = "Factory"; + reg = <0x180000 0x0200000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1000>; + }; + + macaddr_factory_4: macaddr@4 { + compatible = "mac-base"; + reg = <0x4 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + + partition@380000 { + label = "FIP"; + reg = <0x380000 0x0200000>; + read-only; + }; + + partition@580000 { + label = "ubi"; + compatible = "linux,ubi"; + reg = <0x580000 0x3000000>; + }; + + partition@3580000 { + label = "ubi1"; + reg = <0x3580000 0x3000000>; + }; + + partition@6580000 { + label = "Product"; + reg = <0x6580000 0x0020000>; // 128 KB + }; + + partition@65a0000 { + label = "Custom"; + reg = <0x65a0000 0x1000000>; // 16 MB + }; + }; + }; +}; + +&pio { + spi0_flash_pins: spi0-pins { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + }; +}; + +&wifi { + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; + status = "okay"; +}; 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 d58a450a9d4..0d0ee526178 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 @@ -36,7 +36,8 @@ mediatek_setup_interfaces() keenetic,kn-3811|\ qihoo,360t7|\ routerich,ax3000|\ - routerich,ax3000-ubootmod) + routerich,ax3000-ubootmod|\ + tenbay,wr3000k) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" wan ;; asus,tuf-ax4200|\ diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 9815c8ce184..235971d1942 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -1368,6 +1368,27 @@ define Device/ruijie_rg-x60-pro endef TARGET_DEVICES += ruijie_rg-x60-pro +define Device/tenbay_wr3000k + DEVICE_VENDOR := Tenbay + DEVICE_MODEL := WR3000K + DEVICE_DTS := mt7981b-tenbay-wr3000k + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-mt7915e kmod-mt7981-firmware mt7981-wo-firmware + UBINIZE_OPTS := -E 5 + BLOCKSIZE := 128k + PAGESIZE := 2048 + IMAGE_SIZE := 49152k + KERNEL_IN_UBI := 1 + IMAGES += factory.bin + IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE) + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + KERNEL = kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb + KERNEL_INITRAMFS = kernel-bin | lzma | \ + fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd +endef +TARGET_DEVICES += tenbay_wr3000k + define Device/tplink_re6000xd DEVICE_VENDOR := TP-Link DEVICE_MODEL := RE6000XD From 4585d5abd9b77fa9ef794407c5dedcbc4001c869 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 22 Dec 2024 16:41:11 +0100 Subject: [PATCH 113/149] kernel: generic: netfilter: nft_set_hash: unaligned atomic read on struct nft_set_ext Fix kernel panic on some 64 bit architectures. This patch is pending upstream. https://patchwork.ozlabs.org/project/netfilter-devel/patch/20241222100239.336289-1-pablo@netfilter.org/ Fixes: https://github.com/openwrt/openwrt/issues/17336 Link: https://github.com/openwrt/openwrt/pull/17340 Signed-off-by: Hauke Mehrtens --- ...t_hash-unaligned-atomic-read-on-stru.patch | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 target/linux/generic/pending-6.6/605-netfilter-nft_set_hash-unaligned-atomic-read-on-stru.patch diff --git a/target/linux/generic/pending-6.6/605-netfilter-nft_set_hash-unaligned-atomic-read-on-stru.patch b/target/linux/generic/pending-6.6/605-netfilter-nft_set_hash-unaligned-atomic-read-on-stru.patch new file mode 100644 index 00000000000..61e163293e2 --- /dev/null +++ b/target/linux/generic/pending-6.6/605-netfilter-nft_set_hash-unaligned-atomic-read-on-stru.patch @@ -0,0 +1,87 @@ +From 113fb8a8d1f27156f58b27ce0fc02af9b3705bf7 Mon Sep 17 00:00:00 2001 +From: Pablo Neira Ayuso +Date: Sun, 22 Dec 2024 11:02:39 +0100 +Subject: [PATCH] netfilter: nft_set_hash: unaligned atomic read on struct + nft_set_ext + +Access to genmask field in struct nft_set_ext results in unaligned +atomic read: + +[ 72.130109] Unable to handle kernel paging request at virtual address ffff0000c2bb708c +[ 72.131036] Mem abort info: +[ 72.131213] ESR = 0x0000000096000021 +[ 72.131446] EC = 0x25: DABT (current EL), IL = 32 bits +[ 72.132209] SET = 0, FnV = 0 +[ 72.133216] EA = 0, S1PTW = 0 +[ 72.134080] FSC = 0x21: alignment fault +[ 72.135593] Data abort info: +[ 72.137194] ISV = 0, ISS = 0x00000021, ISS2 = 0x00000000 +[ 72.142351] CM = 0, WnR = 0, TnD = 0, TagAccess = 0 +[ 72.145989] GCS = 0, Overlay = 0, DirtyBit = 0, Xs = 0 +[ 72.150115] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000237d27000 +[ 72.154893] [ffff0000c2bb708c] pgd=0000000000000000, p4d=180000023ffff403, pud=180000023f84b403, pmd=180000023f835403, ++pte=0068000102bb7707 +[ 72.163021] Internal error: Oops: 0000000096000021 [#1] SMP +[...] +[ 72.170041] CPU: 7 UID: 0 PID: 54 Comm: kworker/7:0 Tainted: G E 6.13.0-rc3+ #2 +[ 72.170509] Tainted: [E]=UNSIGNED_MODULE +[ 72.170720] Hardware name: QEMU QEMU Virtual Machine, BIOS edk2-stable202302-for-qemu 03/01/2023 +[ 72.171192] Workqueue: events_power_efficient nft_rhash_gc [nf_tables] +[ 72.171552] pstate: 21400005 (nzCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--) +[ 72.171915] pc : nft_rhash_gc+0x200/0x2d8 [nf_tables] +[ 72.172166] lr : nft_rhash_gc+0x128/0x2d8 [nf_tables] +[ 72.172546] sp : ffff800081f2bce0 +[ 72.172724] x29: ffff800081f2bd40 x28: ffff0000c2bb708c x27: 0000000000000038 +[ 72.173078] x26: ffff0000c6780ef0 x25: ffff0000c643df00 x24: ffff0000c6778f78 +[ 72.173431] x23: 000000000000001a x22: ffff0000c4b1f000 x21: ffff0000c6780f78 +[ 72.173782] x20: ffff0000c2bb70dc x19: ffff0000c2bb7080 x18: 0000000000000000 +[ 72.174135] x17: ffff0000c0a4e1c0 x16: 0000000000003000 x15: 0000ac26d173b978 +[ 72.174485] x14: ffffffffffffffff x13: 0000000000000030 x12: ffff0000c6780ef0 +[ 72.174841] x11: 0000000000000000 x10: ffff800081f2bcf8 x9 : ffff0000c3000000 +[ 72.175193] x8 : 00000000000004be x7 : 0000000000000000 x6 : 0000000000000000 +[ 72.175544] x5 : 0000000000000040 x4 : ffff0000c3000010 x3 : 0000000000000000 +[ 72.175871] x2 : 0000000000003a98 x1 : ffff0000c2bb708c x0 : 0000000000000004 +[ 72.176207] Call trace: +[ 72.176316] nft_rhash_gc+0x200/0x2d8 [nf_tables] (P) +[ 72.176653] process_one_work+0x178/0x3d0 +[ 72.176831] worker_thread+0x200/0x3f0 +[ 72.176995] kthread+0xe8/0xf8 +[ 72.177130] ret_from_fork+0x10/0x20 +[ 72.177289] Code: 54fff984 d503201f d2800080 91003261 (f820303f) +[ 72.177557] ---[ end trace 0000000000000000 ]--- + +Align struct nft_set_ext to word size to address this and +documentation it. + +pahole reports that this increases the size of elements for rhash and +pipapo in 8 bytes on x86_64. + +Fixes: 7ffc7481153b ("netfilter: nft_set_hash: skip duplicated elements pending gc run") +Signed-off-by: Pablo Neira Ayuso +--- + include/net/netfilter/nf_tables.h | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +--- a/include/net/netfilter/nf_tables.h ++++ b/include/net/netfilter/nf_tables.h +@@ -721,15 +721,18 @@ struct nft_set_ext_tmpl { + /** + * struct nft_set_ext - set extensions + * +- * @genmask: generation mask ++ * @genmask: generation mask, but also flags (see NFT_SET_ELEM_DEAD_BIT) + * @offset: offsets of individual extension types + * @data: beginning of extension data ++ * ++ * This structure must be aligned to word size, otherwise atomic bitops ++ * on genmask field can cause aligment failure on some archs. + */ + struct nft_set_ext { + u8 genmask; + u8 offset[NFT_SET_EXT_NUM]; + char data[]; +-}; ++} __aligned(BITS_PER_LONG / 8); + + static inline void nft_set_ext_prepare(struct nft_set_ext_tmpl *tmpl) + { From 91966bee336749780317927a633be7e010f69d97 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 15 Jun 2024 14:23:02 -0700 Subject: [PATCH 114/149] ath79: nbg6x16: use nvmem Userspace handling is deprecated. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16291 Signed-off-by: Hauke Mehrtens --- .../linux/ath79/dts/qca9557_zyxel_nbg6616.dts | 10 +++++++-- .../linux/ath79/dts/qca9558_zyxel_nbg6716.dts | 10 +++++++-- .../ath79/dts/qca955x_zyxel_nbg6x16.dtsi | 10 +++++++-- .../generic/base-files/etc/board.d/02_network | 3 --- .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 8 +------ .../base-files/lib/preinit/10_fix_eth_mac.sh | 5 ----- .../etc/hotplug.d/ieee80211/10-fix-wifi-mac | 21 ------------------- .../base-files/lib/preinit/10_fix_eth_mac.sh | 15 ------------- target/linux/ath79/nand/config-default | 1 + 9 files changed, 26 insertions(+), 57 deletions(-) delete mode 100644 target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac delete mode 100644 target/linux/ath79/nand/base-files/lib/preinit/10_fix_eth_mac.sh diff --git a/target/linux/ath79/dts/qca9557_zyxel_nbg6616.dts b/target/linux/ath79/dts/qca9557_zyxel_nbg6616.dts index 828096f8f6c..1c4e9efca02 100644 --- a/target/linux/ath79/dts/qca9557_zyxel_nbg6616.dts +++ b/target/linux/ath79/dts/qca9557_zyxel_nbg6616.dts @@ -9,6 +9,7 @@ model = "Zyxel NBG6616"; aliases { + label-mac-device = &wmac; led-boot = &led_power; led-failsafe = &led_power; led-running = &led_power; @@ -82,8 +83,13 @@ }; partition@30000 { + compatible = "u-boot,env"; label = "u-boot-env"; reg = <0x030000 0x010000>; + + macaddr_uboot_ethaddr: ethaddr { + #nvmem-cell-cells = <1>; + }; }; partition@40000 { @@ -136,7 +142,7 @@ wifi@0,0 { compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - nvmem-cells = <&cal_art_5000>; - nvmem-cell-names = "calibration"; + nvmem-cells = <&cal_art_5000>, <&macaddr_uboot_ethaddr 1>; + nvmem-cell-names = "calibration", "mac-address"; }; }; diff --git a/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts b/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts index 463553fe27c..67d2f77d381 100644 --- a/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts +++ b/target/linux/ath79/dts/qca9558_zyxel_nbg6716.dts @@ -9,6 +9,7 @@ model = "Zyxel NBG6716"; aliases { + label-mac-device = &wmac; led-boot = &led_power; led-failsafe = &led_power; led-running = &led_power; @@ -103,8 +104,13 @@ }; partition@40000 { + compatible = "u-boot,env"; label = "u-boot-env"; reg = <0x040000 0x010000>; + + macaddr_uboot_ethaddr: ethaddr { + #nvmem-cell-cells = <1>; + }; }; partition@50000 { @@ -185,8 +191,8 @@ wifi@0,0 { compatible = "qcom,ath10k"; reg = <0 0 0 0 0>; - nvmem-cells = <&cal_art_5000>; - nvmem-cell-names = "calibration"; + nvmem-cells = <&cal_art_5000>, <&macaddr_uboot_ethaddr 1>; + nvmem-cell-names = "calibration", "mac-address"; qcom,ath10k-calibration-variant = "ZyXEL-NBG6716"; }; }; diff --git a/target/linux/ath79/dts/qca955x_zyxel_nbg6x16.dtsi b/target/linux/ath79/dts/qca955x_zyxel_nbg6x16.dtsi index 3cbb305aadb..99f61afbc04 100644 --- a/target/linux/ath79/dts/qca955x_zyxel_nbg6x16.dtsi +++ b/target/linux/ath79/dts/qca955x_zyxel_nbg6x16.dtsi @@ -82,6 +82,9 @@ pll-data = <0xa6000000 0x00000101 0x00001616>; phy-handle = <&phy17>; + nvmem-cells = <&macaddr_uboot_ethaddr 2>; + nvmem-cell-names = "mac-address"; + fixed-link { speed = <1000>; full-duplex; @@ -94,6 +97,9 @@ pll-data = <0x03000101 0x00000101 0x00001616>; phy-handle = <&phy1>; + nvmem-cells = <&macaddr_uboot_ethaddr 3>; + nvmem-cell-names = "mac-address"; + fixed-link { speed = <1000>; full-duplex; @@ -103,8 +109,8 @@ &wmac { status = "okay"; - nvmem-cells = <&cal_art_1000>; - nvmem-cell-names = "calibration"; + nvmem-cells = <&cal_art_1000>, <&macaddr_uboot_ethaddr 0>; + nvmem-cell-names = "calibration", "mac-address"; }; &usb_phy0 { 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 42910d436ee..ad0365a4651 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 @@ -861,9 +861,6 @@ ath79_setup_macs() xiaomi,aiot-ac2350) lan_mac=$(mtd_get_mac_binary art 0x1002) ;; - zyxel,nbg6616) - label_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) - ;; esac [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index b10599cc154..4dfc67e280c 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -75,8 +75,7 @@ case "$board" in iodata,wn-ac1600dgr|\ iodata,wn-ac1600dgr2|\ sitecom,wlr-7100|\ - sitecom,wlr-8100|\ - zyxel,nbg6616) + sitecom,wlr-8100) # There is no eeprom data for 5 GHz wlan in "art" partition # which would allow to patch the macaddress [ "$PHYNBR" -eq 0 ] && \ @@ -121,11 +120,6 @@ case "$board" in [ "$PHYNBR" -eq 0 ] && \ macaddr_add "$(mtd_get_mac_text mac 0x18)" 1 > /sys${DEVPATH}/macaddress ;; - zyxel,nbg6616) - # Set mac address for 2.4g device - [ "$PHYNBR" -eq 1 ] && \ - mtd_get_mac_ascii u-boot-env ethaddr > /sys${DEVPATH}/macaddress - ;; zyxel,nwa1123-ac) [ "$PHYNBR" -eq 0 ] && \ mtd_get_mac_text mib0 0x66 > /sys${DEVPATH}/macaddress diff --git a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh index 76f4b93a356..41aa43e9869 100644 --- a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh +++ b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh @@ -32,11 +32,6 @@ preinit_set_mac_address() { base_mac=$(mtd_get_mac_encrypted_deco $(find_mtd_part config)) ip link set dev eth0 address $base_mac ;; - zyxel,nbg6616) - ethaddr=$(mtd_get_mac_ascii u-boot-env ethaddr) - ip link set dev eth0 address $(macaddr_add $ethaddr 2) - ip link set dev eth1 address $(macaddr_add $ethaddr 3) - ;; esac } diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac b/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac deleted file mode 100644 index 989791b64fc..00000000000 --- a/target/linux/ath79/nand/base-files/etc/hotplug.d/ieee80211/10-fix-wifi-mac +++ /dev/null @@ -1,21 +0,0 @@ -[ "$ACTION" = "add" ] || exit 0 - -PHYNBR=${DEVPATH##*/phy} - -[ -n $PHYNBR ] || exit 0 - -. /lib/functions.sh -. /lib/functions/system.sh - -board=$(board_name) - -case $board in - zyxel,emg2926-q10a|\ - zyxel,nbg6716) - ethaddr=$(mtd_get_mac_ascii u-boot-env ethaddr) - [ "$PHYNBR" -eq 0 ] && \ - macaddr_add $ethaddr 1 > /sys${DEVPATH}/macaddress - [ "$PHYNBR" -eq 1 ] && \ - echo -n $ethaddr > /sys${DEVPATH}/macaddress - ;; -esac diff --git a/target/linux/ath79/nand/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/ath79/nand/base-files/lib/preinit/10_fix_eth_mac.sh deleted file mode 100644 index 4e501496be7..00000000000 --- a/target/linux/ath79/nand/base-files/lib/preinit/10_fix_eth_mac.sh +++ /dev/null @@ -1,15 +0,0 @@ -. /lib/functions.sh -. /lib/functions/system.sh - -preinit_set_mac_address() { - case $(board_name) in - zyxel,emg2926-q10a|\ - zyxel,nbg6716) - ethaddr=$(mtd_get_mac_ascii u-boot-env ethaddr) - ip link set dev eth0 address $(macaddr_add $ethaddr 2) - ip link set dev eth1 address $(macaddr_add $ethaddr 3) - ;; - esac -} - -boot_hook_add preinit_main preinit_set_mac_address diff --git a/target/linux/ath79/nand/config-default b/target/linux/ath79/nand/config-default index 71ce1caad7d..bbe9673d707 100644 --- a/target/linux/ath79/nand/config-default +++ b/target/linux/ath79/nand/config-default @@ -17,6 +17,7 @@ CONFIG_MTD_UBI=y CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_NVMEM_U_BOOT_ENV=y # CONFIG_PCI_AR71XX is not set CONFIG_POWER_RESET=y CONFIG_POWER_RESET_GPIO_RESTART=y From 2398cad2b5d55dc88bc40e9ec0d5b876dfe0bf80 Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Thu, 28 Nov 2024 17:28:47 +0100 Subject: [PATCH 115/149] optee-os-stm32: bump to 4.4.0 Tested on STM32MP135F-DK. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/17243 Signed-off-by: Hauke Mehrtens --- package/boot/optee-os-stm32/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/boot/optee-os-stm32/Makefile b/package/boot/optee-os-stm32/Makefile index 9e681127e6a..e0be8e433e5 100644 --- a/package/boot/optee-os-stm32/Makefile +++ b/package/boot/optee-os-stm32/Makefile @@ -7,10 +7,10 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=4.3.0 +PKG_VERSION:=4.4.0 PKG_RELEASE:=1 -PKG_HASH:=390b271905c828d6def9fa6a77bbaa425f3b434d733c8eb18f582ccbc6896096 +PKG_HASH:=b13c65ff2abcd21a9200cb0131f34d61bde7c31eb0427fa761d27c3b87c7fec8 PKG_MAINTAINER:=Thomas Richard OPTEE_USE_INTREE_DTC:=1 From 5292a2de26ac4cf7a00de0f7a0149174ed6be31c Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Thu, 28 Nov 2024 18:05:29 +0100 Subject: [PATCH 116/149] uboot-stm32: bump to 2024.10 Now the tool mkeficapsule is built by default if EFI_LOADER config is set (which is the case by default for armv7). This tool needs gnutls, which only exists in the packages feed. As we don't need mkeficapsule, just disable it. Tested on STM32MP135F-DK. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/17243 Signed-off-by: Hauke Mehrtens --- package/boot/uboot-stm32/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/package/boot/uboot-stm32/Makefile b/package/boot/uboot-stm32/Makefile index 58754aedd5a..6234827a28f 100644 --- a/package/boot/uboot-stm32/Makefile +++ b/package/boot/uboot-stm32/Makefile @@ -7,10 +7,10 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=2024.07 +PKG_VERSION:=2024.10 PKG_RELEASE:=1 -PKG_HASH:=f591da9ab90ef3d6b3d173766d0ddff90c4ed7330680897486117df390d83c8f +PKG_HASH:=b28daf4ac17e43156363078bf510297584137f6df50fced9b12df34f61a92fb0 PKG_MAINTAINER:=Thomas Richard UBOOT_USE_INTREE_DTC:=1 @@ -38,6 +38,9 @@ UBOOT_TARGETS := stm32mp135f-dk UBOOT_MAKE_FLAGS += DEVICE_TREE=$(DEVICE_TREE) +UBOOT_CUSTOMIZE_CONFIG := \ + --disable TOOLS_MKEFICAPSULE + define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) $(foreach img,$(UBOOT_IMAGE), \ From c117d7a37a74f8b4c06828a4549d500288a124a7 Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Fri, 29 Nov 2024 11:36:46 +0100 Subject: [PATCH 117/149] include/trusted-firmware-a.mk: remove the no-warn-rwx-segments hack Since v2.12, TF-A automatically selects the no-warn-rwx-segments option if needed. So move this hack to the package Makefiles. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/17243 Signed-off-by: Hauke Mehrtens --- include/trusted-firmware-a.mk | 1 - package/boot/arm-trusted-firmware-bcm63xx/Makefile | 1 + package/boot/arm-trusted-firmware-mediatek/Makefile | 1 + package/boot/arm-trusted-firmware-mvebu/Makefile | 1 + package/boot/arm-trusted-firmware-rockchip/Makefile | 3 +++ package/boot/arm-trusted-firmware-stm32/Makefile | 1 + package/boot/arm-trusted-firmware-sunxi/Makefile | 3 +++ package/boot/rkbin/Makefile | 3 +++ package/boot/tfa-layerscape/Makefile | 1 + 9 files changed, 14 insertions(+), 1 deletion(-) diff --git a/include/trusted-firmware-a.mk b/include/trusted-firmware-a.mk index e469dae9840..b44cec8d074 100644 --- a/include/trusted-firmware-a.mk +++ b/include/trusted-firmware-a.mk @@ -83,7 +83,6 @@ define Build/Compile/Trusted-Firmware-A $(if $(DTC),DTC="$(DTC)") \ PLAT=$(PLAT) \ BUILD_STRING="OpenWrt v$(PKG_VERSION)-$(PKG_RELEASE) ($(VARIANT))" \ - $(if $(CONFIG_BINUTILS_VERSION_2_37)$(CONFIG_BINUTILS_VERSION_2_38),,LDFLAGS="-no-warn-rwx-segments") \ $(TFA_MAKE_FLAGS) endef diff --git a/package/boot/arm-trusted-firmware-bcm63xx/Makefile b/package/boot/arm-trusted-firmware-bcm63xx/Makefile index bcb5ce98920..385776ff59f 100644 --- a/package/boot/arm-trusted-firmware-bcm63xx/Makefile +++ b/package/boot/arm-trusted-firmware-bcm63xx/Makefile @@ -33,6 +33,7 @@ TFA_TARGETS:= \ bcm4908 TFA_MAKE_FLAGS += \ + $(if $(CONFIG_BINUTILS_VERSION_2_37)$(CONFIG_BINUTILS_VERSION_2_38),,LDFLAGS="-no-warn-rwx-segments") \ BRCM_CHIP=$(BRCM_CHIP) define Package/trusted-firmware-a/install diff --git a/package/boot/arm-trusted-firmware-mediatek/Makefile b/package/boot/arm-trusted-firmware-mediatek/Makefile index c8988fa4003..3046a01a586 100644 --- a/package/boot/arm-trusted-firmware-mediatek/Makefile +++ b/package/boot/arm-trusted-firmware-mediatek/Makefile @@ -569,6 +569,7 @@ TFA_TARGETS:= \ mt7988-spim-nand-ubi-comb TFA_MAKE_FLAGS += \ + $(if $(CONFIG_BINUTILS_VERSION_2_37)$(CONFIG_BINUTILS_VERSION_2_38),,LDFLAGS="-no-warn-rwx-segments") \ BOOT_DEVICE=$(BOOT_DEVICE) \ USE_MKIMAGE=1 MKIMAGE=$(STAGING_DIR_HOST)/bin/mkimage \ $(if $(findstring ddr4,$(DDR_TYPE)),DRAM_USE_DDR4=1) \ diff --git a/package/boot/arm-trusted-firmware-mvebu/Makefile b/package/boot/arm-trusted-firmware-mvebu/Makefile index 047c8db55e6..7dd0f11d52a 100644 --- a/package/boot/arm-trusted-firmware-mvebu/Makefile +++ b/package/boot/arm-trusted-firmware-mvebu/Makefile @@ -119,6 +119,7 @@ TFA_TARGETS:= \ edpu TFA_MAKE_FLAGS += \ + $(if $(CONFIG_BINUTILS_VERSION_2_37)$(CONFIG_BINUTILS_VERSION_2_38),,LDFLAGS="-no-warn-rwx-segments") \ CROSS_CM3=$(BUILD_DIR)/$(CM3_GCC_NAME)-$(CM3_GCC_RELEASE)-$(CM3_GCC_VERSION)/bin/arm-none-eabi- \ BL33=$(STAGING_DIR_IMAGE)/$(UBOOT)-u-boot.bin \ MV_DDR_PATH=$(BUILD_DIR)/$(MV_DDR_NAME) \ diff --git a/package/boot/arm-trusted-firmware-rockchip/Makefile b/package/boot/arm-trusted-firmware-rockchip/Makefile index 38a644efa38..9073afe3652 100644 --- a/package/boot/arm-trusted-firmware-rockchip/Makefile +++ b/package/boot/arm-trusted-firmware-rockchip/Makefile @@ -37,6 +37,9 @@ TFA_TARGETS:= \ rk3328 \ rk3399 +TFA_MAKE_FLAGS+= \ + $(if $(CONFIG_BINUTILS_VERSION_2_37)$(CONFIG_BINUTILS_VERSION_2_38),,LDFLAGS="-no-warn-rwx-segments") + ifeq ($(BUILD_VARIANT),rk3399) M0_GCC_NAME:=gcc-arm M0_GCC_RELEASE:=11.2-2022.02 diff --git a/package/boot/arm-trusted-firmware-stm32/Makefile b/package/boot/arm-trusted-firmware-stm32/Makefile index 75a92f15af6..9d36d39b0c9 100644 --- a/package/boot/arm-trusted-firmware-stm32/Makefile +++ b/package/boot/arm-trusted-firmware-stm32/Makefile @@ -41,6 +41,7 @@ endef TFA_TARGETS := stm32mp135f-dk TFA_MAKE_FLAGS += \ + $(if $(CONFIG_BINUTILS_VERSION_2_37)$(CONFIG_BINUTILS_VERSION_2_38),,LDFLAGS="-no-warn-rwx-segments") \ ARCH=aarch32 AARCH32_SP=optee \ BL32=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-tee-header_v2.bin \ BL32_EXTRA1=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-tee-pager_v2.bin \ diff --git a/package/boot/arm-trusted-firmware-sunxi/Makefile b/package/boot/arm-trusted-firmware-sunxi/Makefile index 4b007f8b039..4903c98cde1 100644 --- a/package/boot/arm-trusted-firmware-sunxi/Makefile +++ b/package/boot/arm-trusted-firmware-sunxi/Makefile @@ -46,6 +46,9 @@ TFA_TARGETS:= \ sunxi-h6 \ sunxi-h616 +TFA_MAKE_FLAGS+= \ + $(if $(CONFIG_BINUTILS_VERSION_2_37)$(CONFIG_BINUTILS_VERSION_2_38),,LDFLAGS="-no-warn-rwx-segments") + define Package/trusted-firmware-a/install $(INSTALL_DIR) $(STAGING_DIR_IMAGE) $(INSTALL_DATA) $(PKG_BUILD_DIR)/build/$(PLAT)/release/bl31.bin $(STAGING_DIR_IMAGE)/bl31_$(BUILD_VARIANT).bin diff --git a/package/boot/rkbin/Makefile b/package/boot/rkbin/Makefile index d895c06547b..fef19de7dc8 100644 --- a/package/boot/rkbin/Makefile +++ b/package/boot/rkbin/Makefile @@ -71,6 +71,9 @@ TFA_TARGETS:= \ rk3568-e25 \ rk3588 +TFA_MAKE_FLAGS+= \ + $(if $(CONFIG_BINUTILS_VERSION_2_37)$(CONFIG_BINUTILS_VERSION_2_38),,LDFLAGS="-no-warn-rwx-segments") + ifeq ($(BUILD_VARIANT),rk3308-rock-pi-s) TPL_FILE:=rk3308_ddr_589MHz_uart0_m0_v2.07.bin define Download/rk3308-tpl-rock-pi-s diff --git a/package/boot/tfa-layerscape/Makefile b/package/boot/tfa-layerscape/Makefile index 7304df55c71..1302e35c40c 100644 --- a/package/boot/tfa-layerscape/Makefile +++ b/package/boot/tfa-layerscape/Makefile @@ -161,6 +161,7 @@ TFA_TARGETS := \ lx2160a-rdb-sdboot TFA_MAKE_FLAGS += \ + $(if $(CONFIG_BINUTILS_VERSION_2_37)$(CONFIG_BINUTILS_VERSION_2_38),,LDFLAGS="-no-warn-rwx-segments") \ fip pbl \ BOOT_MODE=$(BOOT_MODE) \ RCW=$(STAGING_DIR_IMAGE)/fsl_$(BUILD_VARIANT)-rcw.bin \ From 73da0f633472505176f736f03e071b4441901f23 Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Fri, 29 Nov 2024 11:53:14 +0100 Subject: [PATCH 118/149] arm-trusted-firmware-stm32: bump to v2.12 No need to pass the option no-warn-rwx-segments. Since v2.12, TF-A automatically selects it if needed. A patch is added to revert commit 03a581e2 ("feat(stm32mp1-fdts): remove RTC clock configuration"). This commit removed RTC clock configuration, as it assumed that it was done correctly by OPTEE. But it is not the case. Without this patch the RTC is in a bad state, consequently the wifi module cannot be initialized. stm32_rtc 5c004000.rtc: rtc_ck is slow stm32_rtc 5c004000.rtc: Can't enter in init mode. Prescaler config failed. stm32_rtc: probe of 5c004000.rtc failed with error -110 sdio mmc1:0001:1: Direct firmware load for brcm/brcmfmac43430-sdio.st,stm32mp135f-dk.bin failed with error -2 brcmfmac: brcmf_sdio_htclk: HT Avail timeout (1000000): clkctl 0x50 Tested on STM32MP135F-DK. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/17243 Signed-off-by: Hauke Mehrtens --- .../boot/arm-trusted-firmware-stm32/Makefile | 8 ++- ...2mp1-fdts-remove-RTC-clock-configura.patch | 66 +++++++++++++++++++ 2 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 package/boot/arm-trusted-firmware-stm32/patches/0001-Revert-feat-stm32mp1-fdts-remove-RTC-clock-configura.patch diff --git a/package/boot/arm-trusted-firmware-stm32/Makefile b/package/boot/arm-trusted-firmware-stm32/Makefile index 9d36d39b0c9..7f486885d3a 100644 --- a/package/boot/arm-trusted-firmware-stm32/Makefile +++ b/package/boot/arm-trusted-firmware-stm32/Makefile @@ -7,10 +7,13 @@ include $(TOPDIR)/rules.mk -PKG_VERSION:=2.10 +PKG_VERSION:=2.12 PKG_RELEASE:=1 -PKG_HASH:=88215a62291b9ba87da8e50b077741103cdc08fb6c9e1ebd34dfaace746d3201 +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/ARM-software/arm-trusted-firmware.git +PKG_SOURCE_VERSION:=v$(PKG_VERSION) +PKG_MIRROR_HASH:=51b2022baa25df7fd8f2e6d2709c9351c14b17447cda64759a8a1d432f9d1c11 PKG_MAINTAINER:=Thomas Richard include $(INCLUDE_DIR)/kernel.mk @@ -41,7 +44,6 @@ endef TFA_TARGETS := stm32mp135f-dk TFA_MAKE_FLAGS += \ - $(if $(CONFIG_BINUTILS_VERSION_2_37)$(CONFIG_BINUTILS_VERSION_2_38),,LDFLAGS="-no-warn-rwx-segments") \ ARCH=aarch32 AARCH32_SP=optee \ BL32=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-tee-header_v2.bin \ BL32_EXTRA1=$(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-tee-pager_v2.bin \ diff --git a/package/boot/arm-trusted-firmware-stm32/patches/0001-Revert-feat-stm32mp1-fdts-remove-RTC-clock-configura.patch b/package/boot/arm-trusted-firmware-stm32/patches/0001-Revert-feat-stm32mp1-fdts-remove-RTC-clock-configura.patch new file mode 100644 index 00000000000..58b896c65de --- /dev/null +++ b/package/boot/arm-trusted-firmware-stm32/patches/0001-Revert-feat-stm32mp1-fdts-remove-RTC-clock-configura.patch @@ -0,0 +1,66 @@ +From 0e1a71d84585ec33b479c2cb8c8d65a4f6734dbe Mon Sep 17 00:00:00 2001 +From: Thomas Richard +Date: Wed, 4 Dec 2024 14:26:52 +0100 +Subject: [PATCH] Revert "feat(stm32mp1-fdts): remove RTC clock configuration" + +This reverts commit 703a581e2522bffe21b421c98994dc02aed2934c. +--- + fdts/stm32mp135f-dk.dts | 2 ++ + fdts/stm32mp157c-ed1.dts | 2 ++ + fdts/stm32mp15xx-dkx.dtsi | 2 ++ + 3 files changed, 6 insertions(+) + +--- a/fdts/stm32mp135f-dk.dts ++++ b/fdts/stm32mp135f-dk.dts +@@ -190,6 +190,7 @@ + CLK_AXI_PLL2P + CLK_MLAHBS_PLL3 + CLK_CKPER_HSE ++ CLK_RTC_LSE + CLK_SDMMC1_PLL4P + CLK_SDMMC2_PLL4P + CLK_STGEN_HSE +@@ -211,6 +212,7 @@ + DIV(DIV_APB4, 1) + DIV(DIV_APB5, 2) + DIV(DIV_APB6, 1) ++ DIV(DIV_RTC, 0) + >; + + st,pll_vco { +--- a/fdts/stm32mp157c-ed1.dts ++++ b/fdts/stm32mp157c-ed1.dts +@@ -194,6 +194,7 @@ + CLK_MPU_PLL1P + CLK_AXI_PLL2P + CLK_MCU_PLL3P ++ CLK_RTC_LSE + CLK_MCO1_DISABLED + CLK_MCO2_DISABLED + CLK_CKPER_HSE +@@ -242,6 +243,7 @@ + DIV(DIV_APB3, 1) + DIV(DIV_APB4, 1) + DIV(DIV_APB5, 2) ++ DIV(DIV_RTC, 23) + DIV(DIV_MCO1, 0) + DIV(DIV_MCO2, 0) + >; +--- a/fdts/stm32mp15xx-dkx.dtsi ++++ b/fdts/stm32mp15xx-dkx.dtsi +@@ -198,6 +198,7 @@ + CLK_MPU_PLL1P + CLK_AXI_PLL2P + CLK_MCU_PLL3P ++ CLK_RTC_LSE + CLK_MCO1_DISABLED + CLK_MCO2_DISABLED + CLK_CKPER_HSE +@@ -246,6 +247,7 @@ + DIV(DIV_APB3, 1) + DIV(DIV_APB4, 1) + DIV(DIV_APB5, 2) ++ DIV(DIV_RTC, 23) + DIV(DIV_MCO1, 0) + DIV(DIV_MCO2, 0) + >; From af6c1f9497210edf06f2973465fff8563343ad22 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 23 Dec 2024 01:49:04 +0100 Subject: [PATCH 119/149] uboot-d1: Adapt BUILD_DEVICES to renamed boards The boards where renamed, but BUILD_DEVICES was not adapted. This variable points to the board name. Without this change the u-boot binaries are not selected in the configuration. Copy the u-boot binaries under the BUILD_DEVICES name as it is expected by the image scripts. Fixes: 33e23e8922ce ("build: d1: add SUPPORTED_DEVICES") Signed-off-by: Hauke Mehrtens --- package/boot/uboot-d1/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/package/boot/uboot-d1/Makefile b/package/boot/uboot-d1/Makefile index 083a219baf6..611922443b0 100644 --- a/package/boot/uboot-d1/Makefile +++ b/package/boot/uboot-d1/Makefile @@ -30,7 +30,7 @@ define U-Boot/dongshan_nezha_stu OPENSBI:=generic DEPENDS:=+opensbi_generic UBOOT_DTS:=sun20i-d1-dongshan-nezha-stu.dtb - BUILD_DEVICES:=dongshan_nezha_stu + BUILD_DEVICES:=100ask_dongshan-nezha-stu endef define U-Boot/lichee_rv_dock @@ -38,7 +38,7 @@ define U-Boot/lichee_rv_dock OPENSBI:=generic DEPENDS:=+opensbi_generic UBOOT_DTS:=sun20i-d1-lichee-rv-dock.dtb - BUILD_DEVICES:=lichee_rv_dock + BUILD_DEVICES:=sipeed_lichee-rv-dock endef define U-Boot/mangopi_mq_pro @@ -46,7 +46,7 @@ define U-Boot/mangopi_mq_pro OPENSBI:=generic DEPENDS:=+opensbi_generic UBOOT_DTS:=sun20i-d1-mangopi-mq-pro.dtb - BUILD_DEVICES:=mangopi_mq_pro + BUILD_DEVICES:=widora_mangopi-mq-pro endef define U-Boot/nezha @@ -54,7 +54,7 @@ define U-Boot/nezha OPENSBI:=generic DEPENDS:=+opensbi_generic UBOOT_DTS:=sun20i-d1-nezha.dtb - BUILD_DEVICES:=nezha + BUILD_DEVICES:=allwinner_d1-nezha endef UBOOT_TARGETS := \ @@ -74,7 +74,7 @@ endef define Build/InstallDev $(INSTALL_DIR) $(STAGING_DIR_IMAGE) $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(DTS_DIR)/$(UBOOT_DTS) $(STAGING_DIR_IMAGE)/$(UBOOT_DTS) - $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(UBOOT_IMAGE) + $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(UBOOT_IMAGE) $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-$(UBOOT_IMAGE) mkimage -C none -A riscv -T script -d uEnv-$(UENV).txt \ $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-boot.scr endef From 5736376f46be52881f4c355f70afc0b36c426821 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Thu, 24 Oct 2024 16:28:29 +0800 Subject: [PATCH 120/149] rockchip: enable support for disk led trigger Signed-off-by: Tianling Shen --- target/linux/rockchip/armv8/config-6.6 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/rockchip/armv8/config-6.6 b/target/linux/rockchip/armv8/config-6.6 index 7f50d4c49b8..1761a33b5c0 100644 --- a/target/linux/rockchip/armv8/config-6.6 +++ b/target/linux/rockchip/armv8/config-6.6 @@ -379,6 +379,7 @@ CONFIG_LEDS_GPIO=y CONFIG_LEDS_PWM=y CONFIG_LEDS_SYSCON=y CONFIG_LEDS_TRIGGER_CPU=y +CONFIG_LEDS_TRIGGER_DISK=y CONFIG_LEDS_TRIGGER_PANIC=y CONFIG_LIBCRC32C=y CONFIG_LIBFDT=y From 934bf398beed4c9c974cd24fa6a535b9721380b5 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Thu, 24 Oct 2024 16:28:35 +0800 Subject: [PATCH 121/149] rockchip: add MMBOX ANAS3035 support Hardware -------- RockChip RK3568 ARM64 (4 cores) 4GB LPDDR4X RAM 2x 2500 Base-T (PCIe, rtl8125b) 4x LEDs (POWER / SATA1 / SATA2 / SATA3) 32GB eMMC on-board Micro-SD Slot HDMI OUT 2x USB 2.0 Port 3x SATA Slot DC Jack 12V Installation ------------ Uncompress the ImmortalWrt sysupgrade and write it to a micro SD card or internal eMMC using dd. Signed-off-by: Tianling Shen --- package/boot/uboot-rockchip/Makefile | 8 + .../patches/900-arm-add-dts-files.patch | 3 +- .../arm/dts/rk3568-mmbox-anas3035-u-boot.dtsi | 12 + .../arch/arm/dts/rk3568-mmbox-anas3035.dts | 769 +++++++++++++++++ .../configs/mmbox-anas3035-rk3568_defconfig | 77 ++ .../armv8/base-files/etc/board.d/02_network | 4 +- .../etc/hotplug.d/net/40-net-smp-affinity | 1 + .../dts/rockchip/rk3568-mmbox-anas3035.dts | 798 ++++++++++++++++++ target/linux/rockchip/image/armv8.mk | 11 + .../900-arm64-boot-add-dts-files.patch | 5 +- 10 files changed, 1684 insertions(+), 4 deletions(-) create mode 100644 package/boot/uboot-rockchip/src/arch/arm/dts/rk3568-mmbox-anas3035-u-boot.dtsi create mode 100644 package/boot/uboot-rockchip/src/arch/arm/dts/rk3568-mmbox-anas3035.dts create mode 100644 package/boot/uboot-rockchip/src/configs/mmbox-anas3035-rk3568_defconfig create mode 100644 target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3568-mmbox-anas3035.dts diff --git a/package/boot/uboot-rockchip/Makefile b/package/boot/uboot-rockchip/Makefile index 38930ead805..e947910d30b 100644 --- a/package/boot/uboot-rockchip/Makefile +++ b/package/boot/uboot-rockchip/Makefile @@ -236,6 +236,13 @@ define U-Boot/lyt-t68m-rk3568 lyt_t68m endef +define U-Boot/mmbox-anas3035-rk3568 + $(U-Boot/rk3568/Default) + NAME:=MMBOX ANAS3035 + BUILD_DEVICES:= \ + mmbox_anas3035 +endef + define U-Boot/mrkaio-m68s-rk3568 $(U-Boot/rk3568/Default) NAME:=Mrkaio M68S @@ -401,6 +408,7 @@ UBOOT_TARGETS := \ fastrhino-r66s-rk3568 \ fastrhino-r68s-rk3568 \ lyt-t68m-rk3568 \ + mmbox-anas3035-rk3568 \ mrkaio-m68s-rk3568 \ nanopi-r5c-rk3568 \ nanopi-r5s-rk3568 \ diff --git a/package/boot/uboot-rockchip/patches/900-arm-add-dts-files.patch b/package/boot/uboot-rockchip/patches/900-arm-add-dts-files.patch index 5959af336a8..f75a62eb3f5 100644 --- a/package/boot/uboot-rockchip/patches/900-arm-add-dts-files.patch +++ b/package/boot/uboot-rockchip/patches/900-arm-add-dts-files.patch @@ -1,6 +1,6 @@ --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile -@@ -87,6 +87,22 @@ dtb-$(CONFIG_ROCKCHIP_RK3368) += \ +@@ -87,6 +87,23 @@ dtb-$(CONFIG_ROCKCHIP_RK3368) += \ rk3368-geekbox.dtb \ rk3368-px5-evb.dtb \ @@ -13,6 +13,7 @@ + +dtb-$(CONFIG_ROCKCHIP_RK3568) += \ + rk3568-armsom-sige3.dtb \ ++ rk3568-mmbox-anas3035.dtb \ + rk3568-lyt-t68m.dtb \ + rk3568-mrkaio-m68s.dtb \ + rk3568-photonicat.dtb diff --git a/package/boot/uboot-rockchip/src/arch/arm/dts/rk3568-mmbox-anas3035-u-boot.dtsi b/package/boot/uboot-rockchip/src/arch/arm/dts/rk3568-mmbox-anas3035-u-boot.dtsi new file mode 100644 index 00000000000..37fa59ea6b8 --- /dev/null +++ b/package/boot/uboot-rockchip/src/arch/arm/dts/rk3568-mmbox-anas3035-u-boot.dtsi @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rk356x-u-boot.dtsi" + +&sdhci { + mmc-ddr-1_8v; +}; + +&vcc5v0_usb_host { + /delete-property/ regulator-always-on; + /delete-property/ regulator-boot-on; +}; diff --git a/package/boot/uboot-rockchip/src/arch/arm/dts/rk3568-mmbox-anas3035.dts b/package/boot/uboot-rockchip/src/arch/arm/dts/rk3568-mmbox-anas3035.dts new file mode 100644 index 00000000000..d8c0cc8ff2e --- /dev/null +++ b/package/boot/uboot-rockchip/src/arch/arm/dts/rk3568-mmbox-anas3035.dts @@ -0,0 +1,769 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; +#include +#include +#include +#include +#include +#include "rk3568.dtsi" + +/ { + model = "MMBOX ANAS3035"; + compatible = "mmbox,anas3035", "rockchip,rk3568"; + + aliases { + mmc0 = &sdhci; + mmc1 = &sdmmc0; + }; + + chosen: chosen { + stdout-path = "serial2:1500000n8"; + }; + + gpio-leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&power_led_pin>, <&sata0_pins>, <&sata1_pins>, <&sata2_pins>; + + power_led: led-0 { + color = ; + function = LED_FUNCTION_POWER; + gpios = <&gpio3 RK_PA2 GPIO_ACTIVE_HIGH>; + }; + + sata0_led: led-1 { + color = ; + function = LED_FUNCTION_DISK; + /* for to sata2 slot */ + function-enumerator = <3>; + gpios = <&gpio4 RK_PC6 GPIO_ACTIVE_LOW>; + linux,default-trigger = "disk-activity"; + }; + + sata1_led: led-2 { + color = ; + function = LED_FUNCTION_DISK; + /* for to sata0 slot */ + function-enumerator = <1>; + gpios = <&gpio4 RK_PC5 GPIO_ACTIVE_LOW>; + linux,default-trigger = "disk-activity"; + }; + + sata2_led: led-3 { + color = ; + function = LED_FUNCTION_DISK; + /* for to sata1 slot */ + function-enumerator = <2>; + gpios = <&gpio4 RK_PC4 GPIO_ACTIVE_LOW>; + linux,default-trigger = "disk-activity"; + }; + }; + + hdmi-con { + compatible = "hdmi-connector"; + type = "a"; + + port { + hdmi_con_in: endpoint { + remote-endpoint = <&hdmi_out_con>; + }; + }; + }; + + fan: pwm-fan { + compatible = "pwm-fan"; + #cooling-cells = <2>; + cooling-levels = <0 80 128 175 230 255>; + fan-supply = <&vcc5v0_fan>; + pwms = <&pwm5 0 50000 0>; + }; + + vcc12v_dcin: regulator-vcc12v-dcin { + compatible = "regulator-fixed"; + regulator-name = "vcc12v_dcin"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + }; + + vcc3v3_pcie: regulator-vcc3v3-pcie { + compatible = "regulator-fixed"; + enable-active-high; + gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&pcie_pwr_en>; + regulator-name = "vcc3v3_pcie"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vcc5v0_sys>; + }; + + vcc3v3_sys: regulator-vcc3v3-sys { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3_sys"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vcc12v_dcin>; + }; + + vcc5v0_fan: regulator-vcc5v0-fan { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&fan_pwr_en>; + regulator-name = "vcc5v0_fan"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vcc5v0_sys>; + }; + + vcc5v0_sata: regulator-vcc5v0-sata { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio0 RK_PC2 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&sata_pwr_en>; + regulator-name = "vcc5v0_sata"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vcc12v_dcin>; + }; + + vcc5v0_sys: regulator-vcc5v0-sys { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_sys"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vcc12v_dcin>; + }; + + vcc5v0_usb: regulator-vcc5v0-usb { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_usb"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vcc12v_dcin>; + }; + + vcc5v0_usb_host: regulator-vcc5v0-usb-host { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&vcc5v0_usb_host_en>; + regulator-name = "vcc5v0_usb_host"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vcc5v0_usb>; + }; + + vcc5v0_usb_otg: regulator-vcc5v0-usb-otg { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&vcc5v0_usb_otg_en>; + regulator-name = "vcc5v0_usb_otg"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vcc5v0_usb>; + }; +}; + +&combphy0 { + status = "okay"; +}; + +&combphy1 { + status = "okay"; +}; + +&combphy2 { + status = "okay"; +}; + +&cpu0 { + cpu-supply = <&vdd_cpu>; +}; + +&cpu1 { + cpu-supply = <&vdd_cpu>; +}; + +&cpu2 { + cpu-supply = <&vdd_cpu>; +}; + +&cpu3 { + cpu-supply = <&vdd_cpu>; +}; + +&cpu_thermal { + trips { + cpu_trip_active_cool: cpu-trip-active-cool { + temperature = <20000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_trip_active_low: cpu-trip-active-low { + temperature = <30000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_trip_active_med: cpu-trip-active-med { + temperature = <40000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_trip_active_high: cpu-trip-active-high { + temperature = <50000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_trip_active_hot: cpu-trip-active-hot { + temperature = <60000>; + hysteresis = <2000>; + type = "hot"; + }; + }; + + cooling-maps { + cpu-active-cool { + trip = <&cpu_trip_active_cool>; + cooling-device = <&fan THERMAL_NO_LIMIT 1>; + }; + + cpu-active-low { + trip = <&cpu_trip_active_low>; + cooling-device = <&fan 1 2>; + }; + + cpu-active-med { + trip = <&cpu_trip_active_med>; + cooling-device = <&fan 2 3>; + }; + + cpu-active-high { + trip = <&cpu_trip_active_high>; + cooling-device = <&fan 3 4>; + }; + + cpu-active-hot { + trip = <&cpu_trip_active_hot>; + cooling-device = <&fan 4 THERMAL_NO_LIMIT>; + }; + }; +}; + +&gpu { + mali-supply = <&vdd_gpu>; + status = "okay"; +}; + +&hdmi { + avdd-0v9-supply = <&vdda0v9_image>; + avdd-1v8-supply = <&vcca1v8_image>; + status = "okay"; +}; + +&hdmi_in { + hdmi_in_vp0: endpoint { + remote-endpoint = <&vp0_out_hdmi>; + }; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; +}; + +&hdmi_sound { + status = "okay"; +}; + +&i2c0 { + status = "okay"; + + vdd_cpu: regulator@1c { + compatible = "tcs,tcs4525"; + reg = <0x1c>; + fcs,suspend-voltage-selector = <1>; + regulator-name = "vdd_cpu"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <1150000>; + regulator-ramp-delay = <2300>; + vin-supply = <&vcc5v0_sys>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + rk809: pmic@20 { + compatible = "rockchip,rk809"; + reg = <0x20>; + interrupt-parent = <&gpio0>; + interrupts = ; + #clock-cells = <1>; + pinctrl-names = "default"; + pinctrl-0 = <&pmic_int>; + system-power-controller; + vcc1-supply = <&vcc3v3_sys>; + vcc2-supply = <&vcc3v3_sys>; + vcc3-supply = <&vcc3v3_sys>; + vcc4-supply = <&vcc3v3_sys>; + vcc5-supply = <&vcc3v3_sys>; + vcc6-supply = <&vcc3v3_sys>; + vcc7-supply = <&vcc3v3_sys>; + vcc8-supply = <&vcc3v3_sys>; + vcc9-supply = <&vcc3v3_sys>; + wakeup-source; + + regulators { + vdd_logic: DCDC_REG1 { + regulator-name = "vdd_logic"; + regulator-always-on; + regulator-boot-on; + regulator-initial-mode = <0x2>; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1350000>; + regulator-ramp-delay = <6001>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdd_gpu: DCDC_REG2 { + regulator-name = "vdd_gpu"; + regulator-always-on; + regulator-initial-mode = <0x2>; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1350000>; + regulator-ramp-delay = <6001>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_ddr: DCDC_REG3 { + regulator-name = "vcc_ddr"; + regulator-always-on; + regulator-boot-on; + regulator-initial-mode = <0x2>; + + regulator-state-mem { + regulator-on-in-suspend; + }; + }; + + vdd_npu: DCDC_REG4 { + regulator-name = "vdd_npu"; + regulator-initial-mode = <0x2>; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1350000>; + regulator-ramp-delay = <6001>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_1v8: DCDC_REG5 { + regulator-name = "vcc_1v8"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdda0v9_image: LDO_REG1 { + regulator-name = "vdda0v9_image"; + regulator-min-microvolt = <950000>; + regulator-max-microvolt = <950000>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdda_0v9: LDO_REG2 { + regulator-name = "vdda_0v9"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <900000>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdda0v9_pmu: LDO_REG3 { + regulator-name = "vdda0v9_pmu"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <900000>; + + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <900000>; + }; + }; + + vccio_acodec: LDO_REG4 { + regulator-name = "vccio_acodec"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vccio_sd: LDO_REG5 { + regulator-name = "vccio_sd"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc3v3_pmu: LDO_REG6 { + regulator-name = "vcc3v3_pmu"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <3300000>; + }; + }; + + vcca_1v8: LDO_REG7 { + regulator-name = "vcca_1v8"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcca1v8_pmu: LDO_REG8 { + regulator-name = "vcca1v8_pmu"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vcca1v8_image: LDO_REG9 { + regulator-name = "vcca1v8_image"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_3v3: SWITCH_REG1 { + regulator-name = "vcc_3v3"; + regulator-always-on; + regulator-boot-on; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc3v3_sd: SWITCH_REG2 { + regulator-name = "vcc3v3_sd"; + regulator-always-on; + regulator-boot-on; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + }; + + }; +}; + +&i2c5 { + status = "okay"; + + hym8563: rtc@51 { + compatible = "haoyu,hym8563"; + reg = <0x51>; + #clock-cells = <0>; + clock-output-names = "rtcic_32kout"; + interrupt-parent = <&gpio0>; + interrupts = ; + pinctrl-names = "default"; + pinctrl-0 = <&hym8563_int>; + wakeup-source; + }; +}; + +&i2s0_8ch { + status = "okay"; +}; + +&pcie30phy { + data-lanes = <1 2>; + status = "okay"; +}; + +&pcie3x1 { + num-lanes = <1>; + reset-gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>; + vpcie3v3-supply = <&vcc3v3_pcie>; + status = "okay"; +}; + +&pcie3x2 { + num-lanes = <1>; + reset-gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>; + vpcie3v3-supply = <&vcc3v3_pcie>; + status = "okay"; +}; + +&pinctrl { + fan { + fan_pwr_en: fan-pwr-en { + rockchip,pins = <0 RK_PB7 RK_FUNC_GPIO &pcfg_pull_down>; + }; + }; + + gpio-leds { + power_led_pin: power-led-pin { + rockchip,pins = <3 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + hym8563 { + hym8563_int: hym8563-int { + rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + + pcie { + pcie_pwr_en: pcie-pwr-en { + rockchip,pins = <0 RK_PD4 RK_FUNC_GPIO &pcfg_pull_down>; + }; + }; + + pmic { + pmic_int: pmic-int { + rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + + rockchip-key { + reset_button_pin: reset-button-pin { + rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + sata { + sata_pwr_en: sata-pwr-en { + rockchip,pins = <0 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>; + }; + }; + + usb { + vcc5v0_usb_host_en: vcc5v0-usb-host-en { + rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + vcc5v0_usb_otg_en: vcc5v0-usb-otg-en { + rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; +}; + +&pmu_io_domains { + pmuio1-supply = <&vcc3v3_pmu>; + pmuio2-supply = <&vcc3v3_pmu>; + vccio1-supply = <&vccio_acodec>; + vccio3-supply = <&vccio_sd>; + vccio4-supply = <&vcc_1v8>; + vccio5-supply = <&vcc_3v3>; + vccio6-supply = <&vcc_1v8>; + vccio7-supply = <&vcc_3v3>; + status = "okay"; +}; + +&pwm5 { + status = "okay"; +}; + +&sata0 { + phy-supply = <&vcc5v0_sata>; + status = "okay"; +}; + +&sata1 { + phy-supply = <&vcc5v0_sata>; + status = "okay"; +}; + +&sata2 { + phy-supply = <&vcc5v0_sata>; + status = "okay"; +}; + +&saradc { + vref-supply = <&vcca_1v8>; + status = "okay"; +}; + +&sdhci { + bus-width = <8>; + max-frequency = <200000000>; + mmc-hs200_1_8v; + non-removable; + pinctrl-names = "default"; + pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>; + status = "okay"; +}; + +&sdmmc0 { + bus-width = <4>; + cap-mmc-highspeed; + cap-sd-highspeed; + disable-wp; + no-sdio; + no-mmc; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>; + sd-uhs-sdr50; + vmmc-supply = <&vcc3v3_sd>; + vqmmc-supply = <&vccio_sd>; + status = "okay"; +}; + +&tsadc { + rockchip,hw-tshut-mode = <1>; + rockchip,hw-tshut-polarity = <0>; + status = "okay"; +}; + +&uart2 { + status = "okay"; +}; + +&usb_host0_ehci { + status = "okay"; +}; + +&usb_host0_ohci { + status = "okay"; +}; + +&usb_host0_xhci { + dr_mode = "host"; + extcon = <&usb2phy0>; + maximum-speed = "high-speed"; + phys = <&usb2phy0_otg>; + phy-names = "usb2-phy"; + status = "okay"; +}; + +&usb_host1_ehci { + status = "okay"; +}; + +&usb_host1_ohci { + status = "okay"; +}; + +&usb_host1_xhci { + maximum-speed = "high-speed"; + phys = <&usb2phy0_host>; + phy-names = "usb2-phy"; + status = "okay"; +}; + +&usb2phy0 { + status = "okay"; +}; + +&usb2phy0_host { + phy-supply = <&vcc5v0_usb_host>; + status = "okay"; +}; + +&usb2phy0_otg { + phy-supply = <&vcc5v0_usb_otg>; + status = "okay"; +}; + +&usb2phy1 { + status = "okay"; +}; + +&usb2phy1_host { + status = "okay"; +}; + +&usb2phy1_otg { + status = "okay"; +}; + +&vop { + assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>; + assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>; + status = "okay"; +}; + +&vop_mmu { + status = "okay"; +}; + +&vp0 { + vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 { + reg = ; + remote-endpoint = <&hdmi_in_vp0>; + }; +}; diff --git a/package/boot/uboot-rockchip/src/configs/mmbox-anas3035-rk3568_defconfig b/package/boot/uboot-rockchip/src/configs/mmbox-anas3035-rk3568_defconfig new file mode 100644 index 00000000000..ea41550e8e6 --- /dev/null +++ b/package/boot/uboot-rockchip/src/configs/mmbox-anas3035-rk3568_defconfig @@ -0,0 +1,77 @@ +CONFIG_ARM=y +CONFIG_SKIP_LOWLEVEL_INIT=y +CONFIG_SYS_HAS_NONCACHED_MEMORY=y +CONFIG_COUNTER_FREQUENCY=24000000 +CONFIG_ARCH_ROCKCHIP=y +CONFIG_DEFAULT_DEVICE_TREE="rk3568-mmbox-anas3035" +CONFIG_ROCKCHIP_RK3568=y +CONFIG_SPL_SERIAL=y +CONFIG_DEBUG_UART_BASE=0xFE660000 +CONFIG_DEBUG_UART_CLOCK=24000000 +CONFIG_SYS_LOAD_ADDR=0xc00800 +CONFIG_PCI=y +CONFIG_DEBUG_UART=y +CONFIG_AHCI=y +CONFIG_FIT=y +CONFIG_FIT_VERBOSE=y +CONFIG_SPL_FIT_SIGNATURE=y +CONFIG_SPL_LOAD_FIT=y +CONFIG_LEGACY_IMAGE_FORMAT=y +CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-mmbox-anas3035.dtb" +# CONFIG_DISPLAY_CPUINFO is not set +CONFIG_DISPLAY_BOARDINFO_LATE=y +CONFIG_SPL_MAX_SIZE=0x40000 +CONFIG_SPL_PAD_TO=0x7f8000 +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set +CONFIG_SPL_ATF=y +CONFIG_CMD_GPIO=y +CONFIG_CMD_GPT=y +CONFIG_CMD_I2C=y +CONFIG_CMD_MMC=y +CONFIG_CMD_PCI=y +CONFIG_CMD_USB=y +CONFIG_CMD_PMIC=y +CONFIG_CMD_REGULATOR=y +# CONFIG_SPL_DOS_PARTITION is not set +CONFIG_SPL_OF_CONTROL=y +CONFIG_OF_LIVE=y +# CONFIG_OF_UPSTREAM is not set +CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" +CONFIG_SPL_DM_SEQ_ALIAS=y +CONFIG_SPL_REGMAP=y +CONFIG_SPL_SYSCON=y +CONFIG_DWC_AHCI=y +CONFIG_SPL_CLK=y +CONFIG_ROCKCHIP_GPIO=y +CONFIG_SYS_I2C_ROCKCHIP=y +CONFIG_MISC=y +CONFIG_SUPPORT_EMMC_RPMB=y +CONFIG_MMC_DW=y +CONFIG_MMC_DW_ROCKCHIP=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_SDMA=y +CONFIG_MMC_SDHCI_ROCKCHIP=y +CONFIG_RTL8169=y +CONFIG_PCIE_DW_ROCKCHIP=y +CONFIG_PHY_ROCKCHIP_INNO_USB2=y +CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y +CONFIG_SPL_PINCTRL=y +CONFIG_DM_PMIC=y +CONFIG_PMIC_RK8XX=y +CONFIG_REGULATOR_RK8XX=y +CONFIG_PWM_ROCKCHIP=y +CONFIG_SPL_RAM=y +CONFIG_SCSI=y +CONFIG_BAUDRATE=1500000 +CONFIG_DEBUG_UART_SHIFT=2 +CONFIG_SYS_NS16550_MEM32=y +CONFIG_SYSRESET=y +CONFIG_USB=y +CONFIG_USB_XHCI_HCD=y +CONFIG_USB_EHCI_HCD=y +CONFIG_USB_EHCI_GENERIC=y +CONFIG_USB_OHCI_HCD=y +CONFIG_USB_OHCI_GENERIC=y +CONFIG_USB_DWC3=y +CONFIG_USB_DWC3_GENERIC=y +CONFIG_ERRNO_STR=y diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network index 5995e49dc9f..394aeefe96c 100644 --- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network @@ -27,6 +27,7 @@ rockchip_setup_interfaces() armsom,sige3|\ friendlyarm,nanopi-r5c|\ lunzn,fastrhino-r66s|\ + mmbox,anas3035|\ radxa,e25|\ radxa,rock-3b|\ xunlong,orangepi-5-plus) @@ -75,7 +76,8 @@ rockchip_setup_macs() friendlyarm,nanopi-r2c|\ friendlyarm,nanopi-r2s|\ lunzn,fastrhino-r66s|\ - lunzn,fastrhino-r68s) + lunzn,fastrhino-r68s|\ + mmbox,anas3035) wan_mac=$(macaddr_generate_from_mmc_cid mmcblk0) lan_mac=$(macaddr_add "$wan_mac" 1) ;; diff --git a/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity b/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity index 0e278c9a31d..2389792132f 100644 --- a/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity +++ b/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity @@ -38,6 +38,7 @@ friendlyarm,nanopi-r3s|\ friendlyarm,nanopi-r5c|\ friendlyarm,nanopi-r6c|\ lunzn,fastrhino-r66s|\ +mmbox,anas3035|\ radxa,e25|\ sinovoip,rk3568-bpi-r2pro|\ xunlong,orangepi-5-plus) diff --git a/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3568-mmbox-anas3035.dts b/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3568-mmbox-anas3035.dts new file mode 100644 index 00000000000..34af648a11b --- /dev/null +++ b/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3568-mmbox-anas3035.dts @@ -0,0 +1,798 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +/dts-v1/; +#include +#include +#include +#include +#include +#include "rk3568.dtsi" + +/ { + model = "MMBOX ANAS3035"; + compatible = "mmbox,anas3035", "rockchip,rk3568"; + + aliases { + mmc0 = &sdhci; + mmc1 = &sdmmc0; + + led-boot = &power_led; + led-failsafe = &power_led; + led-running = &power_led; + led-upgrade = &power_led; + }; + + chosen: chosen { + stdout-path = "serial2:1500000n8"; + }; + + gpio-leds { + compatible = "gpio-leds"; + pinctrl-names = "default"; + pinctrl-0 = <&power_led_pin>, <&sata0_pins>, <&sata1_pins>, <&sata2_pins>; + + power_led: led-0 { + color = ; + function = LED_FUNCTION_POWER; + gpios = <&gpio3 RK_PA2 GPIO_ACTIVE_HIGH>; + }; + + sata0_led: led-1 { + color = ; + function = LED_FUNCTION_DISK; + /* for to sata2 slot */ + function-enumerator = <3>; + gpios = <&gpio4 RK_PC6 GPIO_ACTIVE_LOW>; + linux,default-trigger = "disk-activity"; + }; + + sata1_led: led-2 { + color = ; + function = LED_FUNCTION_DISK; + /* for to sata0 slot */ + function-enumerator = <1>; + gpios = <&gpio4 RK_PC5 GPIO_ACTIVE_LOW>; + linux,default-trigger = "disk-activity"; + }; + + sata2_led: led-3 { + color = ; + function = LED_FUNCTION_DISK; + /* for to sata1 slot */ + function-enumerator = <2>; + gpios = <&gpio4 RK_PC4 GPIO_ACTIVE_LOW>; + linux,default-trigger = "disk-activity"; + }; + }; + + hdmi-con { + compatible = "hdmi-connector"; + type = "a"; + + port { + hdmi_con_in: endpoint { + remote-endpoint = <&hdmi_out_con>; + }; + }; + }; + + fan: pwm-fan { + compatible = "pwm-fan"; + #cooling-cells = <2>; + cooling-levels = <0 80 128 175 230 255>; + fan-supply = <&vcc5v0_fan>; + pwms = <&pwm5 0 50000 0>; + }; + + vcc12v_dcin: regulator-vcc12v-dcin { + compatible = "regulator-fixed"; + regulator-name = "vcc12v_dcin"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + }; + + vcc3v3_pcie: regulator-vcc3v3-pcie { + compatible = "regulator-fixed"; + enable-active-high; + gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&pcie_pwr_en>; + regulator-name = "vcc3v3_pcie"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vcc5v0_sys>; + }; + + vcc3v3_sys: regulator-vcc3v3-sys { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3_sys"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + vin-supply = <&vcc12v_dcin>; + }; + + vcc5v0_fan: regulator-vcc5v0-fan { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&fan_pwr_en>; + regulator-name = "vcc5v0_fan"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vcc5v0_sys>; + }; + + vcc5v0_sata: regulator-vcc5v0-sata { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio0 RK_PC2 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&sata_pwr_en>; + regulator-name = "vcc5v0_sata"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vcc12v_dcin>; + }; + + vcc5v0_sys: regulator-vcc5v0-sys { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_sys"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vcc12v_dcin>; + }; + + vcc5v0_usb: regulator-vcc5v0-usb { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_usb"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vcc12v_dcin>; + }; + + vcc5v0_usb_host: regulator-vcc5v0-usb-host { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&vcc5v0_usb_host_en>; + regulator-name = "vcc5v0_usb_host"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vcc5v0_usb>; + }; + + vcc5v0_usb_otg: regulator-vcc5v0-usb-otg { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&vcc5v0_usb_otg_en>; + regulator-name = "vcc5v0_usb_otg"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vcc5v0_usb>; + }; +}; + +&combphy0 { + status = "okay"; +}; + +&combphy1 { + status = "okay"; +}; + +&combphy2 { + status = "okay"; +}; + +&cpu0 { + cpu-supply = <&vdd_cpu>; +}; + +&cpu1 { + cpu-supply = <&vdd_cpu>; +}; + +&cpu2 { + cpu-supply = <&vdd_cpu>; +}; + +&cpu3 { + cpu-supply = <&vdd_cpu>; +}; + +&cpu_thermal { + trips { + cpu_trip_active_cool: cpu-trip-active-cool { + temperature = <20000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_trip_active_low: cpu-trip-active-low { + temperature = <30000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_trip_active_med: cpu-trip-active-med { + temperature = <40000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_trip_active_high: cpu-trip-active-high { + temperature = <50000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_trip_active_hot: cpu-trip-active-hot { + temperature = <60000>; + hysteresis = <2000>; + type = "hot"; + }; + }; + + cooling-maps { + cpu-active-cool { + trip = <&cpu_trip_active_cool>; + cooling-device = <&fan THERMAL_NO_LIMIT 1>; + }; + + cpu-active-low { + trip = <&cpu_trip_active_low>; + cooling-device = <&fan 1 2>; + }; + + cpu-active-med { + trip = <&cpu_trip_active_med>; + cooling-device = <&fan 2 3>; + }; + + cpu-active-high { + trip = <&cpu_trip_active_high>; + cooling-device = <&fan 3 4>; + }; + + cpu-active-hot { + trip = <&cpu_trip_active_hot>; + cooling-device = <&fan 4 THERMAL_NO_LIMIT>; + }; + }; +}; + +&gpu { + mali-supply = <&vdd_gpu>; + status = "okay"; +}; + +&hdmi { + avdd-0v9-supply = <&vdda0v9_image>; + avdd-1v8-supply = <&vcca1v8_image>; + status = "okay"; +}; + +&hdmi_in { + hdmi_in_vp0: endpoint { + remote-endpoint = <&vp0_out_hdmi>; + }; +}; + +&hdmi_out { + hdmi_out_con: endpoint { + remote-endpoint = <&hdmi_con_in>; + }; +}; + +&hdmi_sound { + status = "okay"; +}; + +&i2c0 { + status = "okay"; + + vdd_cpu: regulator@1c { + compatible = "tcs,tcs4525"; + reg = <0x1c>; + fcs,suspend-voltage-selector = <1>; + regulator-name = "vdd_cpu"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <1150000>; + regulator-ramp-delay = <2300>; + vin-supply = <&vcc5v0_sys>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + rk809: pmic@20 { + compatible = "rockchip,rk809"; + reg = <0x20>; + interrupt-parent = <&gpio0>; + interrupts = ; + #clock-cells = <1>; + pinctrl-names = "default"; + pinctrl-0 = <&pmic_int>; + system-power-controller; + vcc1-supply = <&vcc3v3_sys>; + vcc2-supply = <&vcc3v3_sys>; + vcc3-supply = <&vcc3v3_sys>; + vcc4-supply = <&vcc3v3_sys>; + vcc5-supply = <&vcc3v3_sys>; + vcc6-supply = <&vcc3v3_sys>; + vcc7-supply = <&vcc3v3_sys>; + vcc8-supply = <&vcc3v3_sys>; + vcc9-supply = <&vcc3v3_sys>; + wakeup-source; + + regulators { + vdd_logic: DCDC_REG1 { + regulator-name = "vdd_logic"; + regulator-always-on; + regulator-boot-on; + regulator-initial-mode = <0x2>; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1350000>; + regulator-ramp-delay = <6001>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdd_gpu: DCDC_REG2 { + regulator-name = "vdd_gpu"; + regulator-always-on; + regulator-initial-mode = <0x2>; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1350000>; + regulator-ramp-delay = <6001>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_ddr: DCDC_REG3 { + regulator-name = "vcc_ddr"; + regulator-always-on; + regulator-boot-on; + regulator-initial-mode = <0x2>; + + regulator-state-mem { + regulator-on-in-suspend; + }; + }; + + vdd_npu: DCDC_REG4 { + regulator-name = "vdd_npu"; + regulator-initial-mode = <0x2>; + regulator-min-microvolt = <500000>; + regulator-max-microvolt = <1350000>; + regulator-ramp-delay = <6001>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_1v8: DCDC_REG5 { + regulator-name = "vcc_1v8"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdda0v9_image: LDO_REG1 { + regulator-name = "vdda0v9_image"; + regulator-min-microvolt = <950000>; + regulator-max-microvolt = <950000>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdda_0v9: LDO_REG2 { + regulator-name = "vdda_0v9"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <900000>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vdda0v9_pmu: LDO_REG3 { + regulator-name = "vdda0v9_pmu"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <900000>; + regulator-max-microvolt = <900000>; + + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <900000>; + }; + }; + + vccio_acodec: LDO_REG4 { + regulator-name = "vccio_acodec"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vccio_sd: LDO_REG5 { + regulator-name = "vccio_sd"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc3v3_pmu: LDO_REG6 { + regulator-name = "vcc3v3_pmu"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <3300000>; + }; + }; + + vcca_1v8: LDO_REG7 { + regulator-name = "vcca_1v8"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcca1v8_pmu: LDO_REG8 { + regulator-name = "vcca1v8_pmu"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + + regulator-state-mem { + regulator-on-in-suspend; + regulator-suspend-microvolt = <1800000>; + }; + }; + + vcca1v8_image: LDO_REG9 { + regulator-name = "vcca1v8_image"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc_3v3: SWITCH_REG1 { + regulator-name = "vcc_3v3"; + regulator-always-on; + regulator-boot-on; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + + vcc3v3_sd: SWITCH_REG2 { + regulator-name = "vcc3v3_sd"; + regulator-always-on; + regulator-boot-on; + + regulator-state-mem { + regulator-off-in-suspend; + }; + }; + }; + + }; +}; + +&i2c5 { + status = "okay"; + + hym8563: rtc@51 { + compatible = "haoyu,hym8563"; + reg = <0x51>; + #clock-cells = <0>; + clock-output-names = "rtcic_32kout"; + interrupt-parent = <&gpio0>; + interrupts = ; + pinctrl-names = "default"; + pinctrl-0 = <&hym8563_int>; + wakeup-source; + }; +}; + +&i2s0_8ch { + status = "okay"; +}; + +&pcie30phy { + data-lanes = <1 2>; + status = "okay"; +}; + +&pcie3x1 { + num-lanes = <1>; + reset-gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>; + vpcie3v3-supply = <&vcc3v3_pcie>; + status = "okay"; + + pcie@0,0 { + reg = <0x00100000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + + pcie-eth@10,0 { + compatible = "pci10ec,8125"; + reg = <0x000000 0 0 0 0>; + realtek,led-data = <0x0 0x0 0x200 0x2b>; + }; + }; +}; + +&pcie3x2 { + num-lanes = <1>; + reset-gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>; + vpcie3v3-supply = <&vcc3v3_pcie>; + status = "okay"; + + pcie@0,0 { + reg = <0x00200000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + + pcie-eth@20,0 { + compatible = "pci10ec,8125"; + reg = <0x000000 0 0 0 0>; + realtek,led-data = <0x0 0x0 0x200 0x2b>; + }; + }; +}; + +&pinctrl { + fan { + fan_pwr_en: fan-pwr-en { + rockchip,pins = <0 RK_PB7 RK_FUNC_GPIO &pcfg_pull_down>; + }; + }; + + gpio-leds { + power_led_pin: power-led-pin { + rockchip,pins = <3 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + hym8563 { + hym8563_int: hym8563-int { + rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + + pcie { + pcie_pwr_en: pcie-pwr-en { + rockchip,pins = <0 RK_PD4 RK_FUNC_GPIO &pcfg_pull_down>; + }; + }; + + pmic { + pmic_int: pmic-int { + rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + + rockchip-key { + reset_button_pin: reset-button-pin { + rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + sata { + sata_pwr_en: sata-pwr-en { + rockchip,pins = <0 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>; + }; + }; + + usb { + vcc5v0_usb_host_en: vcc5v0-usb-host-en { + rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + vcc5v0_usb_otg_en: vcc5v0-usb-otg-en { + rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; +}; + +&pmu_io_domains { + pmuio1-supply = <&vcc3v3_pmu>; + pmuio2-supply = <&vcc3v3_pmu>; + vccio1-supply = <&vccio_acodec>; + vccio3-supply = <&vccio_sd>; + vccio4-supply = <&vcc_1v8>; + vccio5-supply = <&vcc_3v3>; + vccio6-supply = <&vcc_1v8>; + vccio7-supply = <&vcc_3v3>; + status = "okay"; +}; + +&pwm5 { + status = "okay"; +}; + +&sata0 { + phy-supply = <&vcc5v0_sata>; + status = "okay"; +}; + +&sata1 { + phy-supply = <&vcc5v0_sata>; + status = "okay"; +}; + +&sata2 { + phy-supply = <&vcc5v0_sata>; + status = "okay"; +}; + +&saradc { + vref-supply = <&vcca_1v8>; + status = "okay"; +}; + +&sdhci { + bus-width = <8>; + max-frequency = <200000000>; + mmc-hs200_1_8v; + non-removable; + pinctrl-names = "default"; + pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>; + status = "okay"; +}; + +&sdmmc0 { + bus-width = <4>; + cap-mmc-highspeed; + cap-sd-highspeed; + disable-wp; + no-sdio; + no-mmc; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>; + sd-uhs-sdr50; + vmmc-supply = <&vcc3v3_sd>; + vqmmc-supply = <&vccio_sd>; + status = "okay"; +}; + +&tsadc { + rockchip,hw-tshut-mode = <1>; + rockchip,hw-tshut-polarity = <0>; + status = "okay"; +}; + +&uart2 { + status = "okay"; +}; + +&usb_host0_ehci { + status = "okay"; +}; + +&usb_host0_ohci { + status = "okay"; +}; + +&usb_host0_xhci { + dr_mode = "host"; + extcon = <&usb2phy0>; + maximum-speed = "high-speed"; + phys = <&usb2phy0_otg>; + phy-names = "usb2-phy"; + status = "okay"; +}; + +&usb_host1_ehci { + status = "okay"; +}; + +&usb_host1_ohci { + status = "okay"; +}; + +&usb_host1_xhci { + maximum-speed = "high-speed"; + phys = <&usb2phy0_host>; + phy-names = "usb2-phy"; + status = "okay"; +}; + +&usb2phy0 { + status = "okay"; +}; + +&usb2phy0_host { + phy-supply = <&vcc5v0_usb_host>; + status = "okay"; +}; + +&usb2phy0_otg { + phy-supply = <&vcc5v0_usb_otg>; + status = "okay"; +}; + +&usb2phy1 { + status = "okay"; +}; + +&usb2phy1_host { + status = "okay"; +}; + +&usb2phy1_otg { + status = "okay"; +}; + +&vop { + assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>; + assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>; + status = "okay"; +}; + +&vop_mmu { + status = "okay"; +}; + +&vp0 { + vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 { + reg = ; + remote-endpoint = <&hdmi_in_vp0>; + }; +}; diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk index ec0716d553a..fe4b32cdf25 100644 --- a/target/linux/rockchip/image/armv8.mk +++ b/target/linux/rockchip/image/armv8.mk @@ -246,6 +246,17 @@ define Device/lyt_t68m endef TARGET_DEVICES += lyt_t68m +define Device/mmbox_anas3035 + DEVICE_VENDOR := MMBOX + DEVICE_MODEL := ANAS3035 + SOC := rk3568 + DEVICE_DTS := rockchip/rk3568-mmbox-anas3035 + UBOOT_DEVICE_NAME := mmbox-anas3035-rk3568 + BOOT_FLOW := pine64-img + DEVICE_PACKAGES := kmod-r8125 kmod-ata-ahci-dwc kmod-hwmon-pwmfan kmod-hwmon-drivetemp +endef +TARGET_DEVICES += mmbox_anas3035 + define Device/pine64_rock64 DEVICE_VENDOR := Pine64 DEVICE_MODEL := Rock64 diff --git a/target/linux/rockchip/patches-6.6/900-arm64-boot-add-dts-files.patch b/target/linux/rockchip/patches-6.6/900-arm64-boot-add-dts-files.patch index 1669573ca82..db2343938ad 100644 --- a/target/linux/rockchip/patches-6.6/900-arm64-boot-add-dts-files.patch +++ b/target/linux/rockchip/patches-6.6/900-arm64-boot-add-dts-files.patch @@ -16,7 +16,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-r4s-enterprise.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-orangepi.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-pinebook-pro.dtb -@@ -91,19 +93,24 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-so +@@ -91,19 +93,25 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-so dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-box-demo.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-lubancat-1.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-nanopi-r3s.dtb @@ -25,6 +25,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb1-v10.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-fastrhino-r66s.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-fastrhino-r68s.dtb ++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-mmbox-anas3035.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-lubancat-2.dtb +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-lyt-t68m.dtb +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-mrkaio-m68s.dtb @@ -41,7 +42,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-edgeble-neu6a-io.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-edgeble-neu6b-io.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-evb1-v10.dtb -@@ -112,5 +119,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-or +@@ -112,5 +120,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-or dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-rock-5b.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-indiedroid-nova.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588s-khadas-edge2.dtb From 24fc5ff2136a10bf0ee9e764ae0404b2928a67ce Mon Sep 17 00:00:00 2001 From: Florian Maurer Date: Thu, 19 Dec 2024 10:46:40 +0100 Subject: [PATCH 122/149] ipq40xx-generic: EN WS-AP3915i remove BLOCKSIZE from image definition The blocksize was too high, resulting in forgetting the config on sysupgrade It is not needed for SPI-NOR. Signed-off-by: Florian Maurer Link: https://github.com/openwrt/openwrt/pull/17305 Signed-off-by: Robert Marko --- target/linux/ipq40xx/image/generic.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk index d92d0824f9a..21841f4bf17 100644 --- a/target/linux/ipq40xx/image/generic.mk +++ b/target/linux/ipq40xx/image/generic.mk @@ -542,7 +542,6 @@ define Device/extreme-networks_ws-ap3915i DEVICE_MODEL := WS-AP3915i IMAGE_SIZE := 30080k SOC := qcom-ipq4029 - BLOCKSIZE := 128k IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size | append-metadata endef TARGET_DEVICES += extreme-networks_ws-ap3915i From 363f52d067e1852d46ccdc3ab4d12bc2f9d018dd Mon Sep 17 00:00:00 2001 From: Florian Maurer Date: Thu, 19 Dec 2024 11:49:13 +0100 Subject: [PATCH 123/149] ipq40xx-generic: ws-ap3915i fix macadress set macaddress correctly for board Signed-off-by: Florian Maurer Link: https://github.com/openwrt/openwrt/pull/17305 Signed-off-by: Robert Marko --- target/linux/ipq40xx/base-files/etc/board.d/02_network | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network index e3a6e242284..549e1ac0c96 100644 --- a/target/linux/ipq40xx/base-files/etc/board.d/02_network +++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network @@ -202,6 +202,9 @@ ipq40xx_setup_macs() wan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr) lan_mac=$(macaddr_add "$wan_mac" 1) ;; + extreme-networks,ws-ap3915i) + label_mac="$(mtd_get_mac_ascii CFG1 ethaddr)" + ;; ezviz,cs-w3-wd1200g-eup) label_mac=$(mtd_get_mac_binary "ART" 0x6) ;; From 0de59fb952b7784c8085e340367523276c97687c Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Sun, 22 Dec 2024 20:13:05 +0800 Subject: [PATCH 124/149] Revert "ipq40xx: use PHY to control USB GPIO" This reverts commit 3bd2cee9bf85f01732e05e0c8fb070fb18c74095. Based on my testing, we are unable to control USB power supply through some third-party tools (e.g. uhubctl) or sysfs in userspace. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/17339 Signed-off-by: Robert Marko --- .../arch/arm/boot/dts/qcom/qcom-ipq4019-wia3300-20.dts | 7 +++++-- target/linux/ipq40xx/generic/config-default | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4019-wia3300-20.dts b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4019-wia3300-20.dts index 85ad382223d..644329419d9 100644 --- a/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4019-wia3300-20.dts +++ b/target/linux/ipq40xx/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq4019-wia3300-20.dts @@ -68,6 +68,11 @@ }; }; + output-usb-power { + compatible = "regulator-output"; + vout-supply = <®_usb>; + }; + reg_usb: regulator-usb { compatible = "regulator-fixed"; @@ -414,8 +419,6 @@ &usb2_hs_phy { status = "okay"; - - phy-supply = <®_usb>; }; &watchdog { diff --git a/target/linux/ipq40xx/generic/config-default b/target/linux/ipq40xx/generic/config-default index bd9876a0b64..4999ad36223 100644 --- a/target/linux/ipq40xx/generic/config-default +++ b/target/linux/ipq40xx/generic/config-default @@ -3,4 +3,5 @@ CONFIG_MTD_UBI_BEB_LIMIT=20 CONFIG_MTD_UBI_BLOCK=y CONFIG_MTD_UBI_NVMEM=y CONFIG_MTD_UBI_WL_THRESHOLD=4096 +CONFIG_REGULATOR_USERSPACE_CONSUMER=y CONFIG_UBIFS_FS=y From 967a6a2cf501d4dd60e790ab69c871a000d85391 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Mon, 23 Dec 2024 21:56:31 +0800 Subject: [PATCH 125/149] uboot-rockchip: increase rng-seed size Increase rng-seed size to make Linux happy and initialize rng pool instantly. Linux 5.19+ requires 32 bytes of entropy to initialize random pool, but u-boot currently provides only 8 bytes. Boot with 8 byte rng-seed (Linux 6.11): # dmesg | grep crng [ 12.089286] random: crng init done Boot with 32 byte rng-seed (Linux 6.11): # dmesg | grep crng [ 0.000000] random: crng init done Signed-off-by: Tianling Shen Link: https://github.com/openwrt/openwrt/pull/17352 Signed-off-by: Hauke Mehrtens --- ...se-rng-seed-size-to-make-it-sufficie.patch | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 package/boot/uboot-rockchip/patches/001-rockchip-board-Increase-rng-seed-size-to-make-it-sufficie.patch diff --git a/package/boot/uboot-rockchip/patches/001-rockchip-board-Increase-rng-seed-size-to-make-it-sufficie.patch b/package/boot/uboot-rockchip/patches/001-rockchip-board-Increase-rng-seed-size-to-make-it-sufficie.patch new file mode 100644 index 00000000000..0b7bf1be7d0 --- /dev/null +++ b/package/boot/uboot-rockchip/patches/001-rockchip-board-Increase-rng-seed-size-to-make-it-sufficie.patch @@ -0,0 +1,96 @@ +From ed4ae7386257aa66455e330234e513d098a36f84 Mon Sep 17 00:00:00 2001 +From: Alex Shumsky +Date: Wed, 16 Oct 2024 13:02:03 +0300 +Subject: [PATCH] rockchip: board: Increase rng-seed size to make it sufficient + for modern Linux + +Increase rng-seed size to make Linux happy and initialize rng pool instantly. +Linux 5.19+ requires 32 bytes of entropy to initialize random pool, but u-boot +currently provides only 8 bytes. +Linux 5.18 and probably some versions before it used to require 64 bytes. +Bump min value to 64 bytes to be on a safe side. + +Boot with 8 byte rng-seed (Linux 6.11): + # dmesg | grep crng + [ 12.089286] random: crng init done +Boot with 32 byte rng-seed (Linux 6.11): + # dmesg | grep crng + [ 0.000000] random: crng init done + +Linux source references: +https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/char/random.c?h=v5.19#n551 +https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/char/random.c?h=v5.18#n236 + +Signed-off-by: Alex Shumsky +Fixes: d2048bafae40 ("rockchip: board: Add board_rng_seed() for all Rockchip devices") +Reviewed-by: Dragan Simic +Reviewed-by: Marek Vasut +Reviewed-by: Quentin Schulz +Reviewed-by: Kever Yang +--- + arch/arm/mach-rockchip/board.c | 11 ++++++++++- + common/Kconfig | 3 +++ + doc/usage/environment.rst | 5 +++++ + include/fdt_support.h | 3 ++- + 4 files changed, 20 insertions(+), 2 deletions(-) + +--- a/arch/arm/mach-rockchip/board.c ++++ b/arch/arm/mach-rockchip/board.c +@@ -480,9 +480,18 @@ __weak int misc_init_r(void) + __weak int board_rng_seed(struct abuf *buf) + { + struct udevice *dev; +- size_t len = 0x8; ++ ulong len = env_get_ulong("rng_seed_size", 10, 64); + u64 *data; + ++ if (len < 64) { ++ /* ++ * rng_seed_size should be at least 32 bytes for Linux 5.19+, ++ * or 64 for older Linux kernel versions ++ */ ++ log_warning("Value for rng_seed_size (%lu) too low, Linux kernel RNG may fail to initialize early\n", ++ len); ++ } ++ + data = malloc(len); + if (!data) { + printf("Out of memory\n"); +--- a/common/Kconfig ++++ b/common/Kconfig +@@ -927,6 +927,9 @@ config BOARD_RNG_SEED + new seed for use on subsequent boots, and whether or not the + kernel should account any entropy from the given seed. + ++ Default seed size (64 bytes) can be overridden by a decimal ++ environment variable rng_seed_size. ++ + endmenu + + menu "Update support" +--- a/doc/usage/environment.rst ++++ b/doc/usage/environment.rst +@@ -323,6 +323,11 @@ netretry + Useful on scripts which control the retry operation + themselves. + ++rng_seed_size ++ Size of random value added to device-tree node /chosen/rng-seed. ++ This variable is given as a decimal number. ++ If unset, 64 bytes is used as the default. ++ + silent_linux + If set then Linux will be told to boot silently, by + adding 'console=' to its command line. If "yes" it will be +--- a/include/fdt_support.h ++++ b/include/fdt_support.h +@@ -202,7 +202,8 @@ int ft_board_setup(void *blob, struct bd + * + * This function is called if CONFIG_BOARD_RNG_SEED is set, and must + * be provided by the board. It should return, via @buf, some suitable +- * seed value to pass to the kernel. ++ * seed value to pass to the kernel. Seed size could be set in a decimal ++ * environment variable rng_seed_size and it defaults to 64 bytes. + * + * @param buf A struct abuf for returning the seed and its size. + * @return 0 if ok, negative on error. From 4e68103c4eb93d3f9b9359742c3c377ee2844943 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Mon, 23 Dec 2024 21:57:15 +0800 Subject: [PATCH 126/149] uboot-rockchip: fix build with swig 4.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following error by backporting upstream update: ``` scripts/dtc/pylibfdt/libfdt_wrap.c: In function ‘_wrap_fdt_next_node’: scripts/dtc/pylibfdt/libfdt_wrap.c:5581:17: error: too few arguments to function ‘SWIG_Python_AppendOutput’ 5581 | resultobj = SWIG_Python_AppendOutput(resultobj, val); | ^~~~~~~~~~~~~~~~~~~~~~~~ ``` Fixes: https://github.com/openwrt/openwrt/issues/17345 Signed-off-by: Tianling Shen Link: https://github.com/openwrt/openwrt/pull/17352 Signed-off-by: Hauke Mehrtens --- ...libfdt-i_shipped-Use-SWIG_AppendOutp.patch | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 package/boot/uboot-rockchip/patches/002-scripts-dtc-pylibfdt-libfdt-i_shipped-Use-SWIG_AppendOutp.patch diff --git a/package/boot/uboot-rockchip/patches/002-scripts-dtc-pylibfdt-libfdt-i_shipped-Use-SWIG_AppendOutp.patch b/package/boot/uboot-rockchip/patches/002-scripts-dtc-pylibfdt-libfdt-i_shipped-Use-SWIG_AppendOutp.patch new file mode 100644 index 00000000000..f5beca8d77a --- /dev/null +++ b/package/boot/uboot-rockchip/patches/002-scripts-dtc-pylibfdt-libfdt-i_shipped-Use-SWIG_AppendOutp.patch @@ -0,0 +1,55 @@ +From a63456b9191fae2fe49f4b121e025792022e3950 Mon Sep 17 00:00:00 2001 +From: Markus Volk +Date: Wed, 30 Oct 2024 06:07:16 +0100 +Subject: [PATCH] scripts/dtc/pylibfdt/libfdt.i_shipped: Use SWIG_AppendOutput +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Swig has changed language specific AppendOutput functions. The helper +macro SWIG_AppendOutput remains unchanged. Use that instead +of SWIG_Python_AppendOutput, which would require an extra parameter +since swig 4.3.0. + +/home/flk/poky/build-test/tmp/work/qemux86_64-poky-linux/u-boot/2024.10/git/arch/x86/cpu/u-boot-64.lds +| scripts/dtc/pylibfdt/libfdt_wrap.c: In function ‘_wrap_fdt_next_node’: +| scripts/dtc/pylibfdt/libfdt_wrap.c:5581:17: error: too few arguments to function ‘SWIG_Python_AppendOutput’ +| 5581 | resultobj = SWIG_Python_AppendOutput(resultobj, val); +| | ^~~~~~~~~~~~~~~~~~~~~~~~ + +Signed-off-by: Markus Volk +Reported-by: Rudi Heitbaum +Link: https://github.com/dgibson/dtc/pull/154 +--- + scripts/dtc/pylibfdt/libfdt.i_shipped | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/scripts/dtc/pylibfdt/libfdt.i_shipped ++++ b/scripts/dtc/pylibfdt/libfdt.i_shipped +@@ -1037,7 +1037,7 @@ typedef uint32_t fdt32_t; + fdt_string(fdt1, fdt32_to_cpu($1->nameoff))); + buff = PyByteArray_FromStringAndSize( + (const char *)($1 + 1), fdt32_to_cpu($1->len)); +- resultobj = SWIG_Python_AppendOutput(resultobj, buff); ++ resultobj = SWIG_AppendOutput(resultobj, buff); + } + } + +@@ -1076,7 +1076,7 @@ typedef uint32_t fdt32_t; + + %typemap(argout) int *depth { + PyObject *val = Py_BuildValue("i", *arg$argnum); +- resultobj = SWIG_Python_AppendOutput(resultobj, val); ++ resultobj = SWIG_AppendOutput(resultobj, val); + } + + %apply int *depth { int *depth }; +@@ -1092,7 +1092,7 @@ typedef uint32_t fdt32_t; + if (PyTuple_GET_SIZE(resultobj) == 0) + resultobj = val; + else +- resultobj = SWIG_Python_AppendOutput(resultobj, val); ++ resultobj = SWIG_AppendOutput(resultobj, val); + } + } + From 3c0ef48bc82cb11edd0b4fdbc4beaa3f95708967 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 22 Dec 2024 17:33:21 +0100 Subject: [PATCH 127/149] mbedtls: Deactivate ARIA block cipher by default The ARIA block cipher is pretty uncommon in TLS, deactivate it for now. This saves some space and reduces the possible variations and attack vectors of mbedtls. ARIA support was deactivated in OpenWrt 23.05 by default. Link: https://github.com/openwrt/openwrt/pull/17342 Signed-off-by: Hauke Mehrtens --- package/libs/mbedtls/Config.in | 4 ++++ package/libs/mbedtls/Makefile | 1 + 2 files changed, 5 insertions(+) diff --git a/package/libs/mbedtls/Config.in b/package/libs/mbedtls/Config.in index 51f8bcbbdd3..0a760ed2cb8 100644 --- a/package/libs/mbedtls/Config.in +++ b/package/libs/mbedtls/Config.in @@ -8,6 +8,10 @@ config MBEDTLS_AES_C bool "MBEDTLS_AES_C" default y +config MBEDTLS_ARIA_C + bool "MBEDTLS_ARIA_C" + default n + config MBEDTLS_CAMELLIA_C bool "MBEDTLS_CAMELLIA_C" default n diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile index 2efdf86cd20..f5bff133248 100644 --- a/package/libs/mbedtls/Makefile +++ b/package/libs/mbedtls/Makefile @@ -37,6 +37,7 @@ MBEDTLS_BUILD_OPTS_CURVES= \ MBEDTLS_BUILD_OPTS_CIPHERS= \ CONFIG_MBEDTLS_AES_C \ + CONFIG_MBEDTLS_ARIA_C \ CONFIG_MBEDTLS_CAMELLIA_C \ CONFIG_MBEDTLS_CCM_C \ CONFIG_MBEDTLS_CMAC_C \ From 42254d3f5fa010466195c167c13f704ba85b3f54 Mon Sep 17 00:00:00 2001 From: Edward Chow Date: Tue, 10 Dec 2024 18:36:40 +0800 Subject: [PATCH 128/149] ath79: port buffalo WZR-450HP2 from ar71xx Referencing commit a1837135e04b Hardware -------- SoC: Qualcomm Atheros QCA9558 RAM: 128M DDR2 (Nanya NT5TU64M16HG-AC) FLASH: 128M SPI-NAND (Spansion S34ML01G100TFI00) WLAN: QCA9558 3T3R 802.11 bgn ETH: Qualcomm Atheros QCA8337 UART: 115200 8n1 BUTTON: Reset - WPS - "Router" switch LED: 2x system-LED, 2x wlan-LED, 1x internet-LED, 2x routing-LED LEDs besides the ethernet ports are controlled by the ethernet switch MAC Address: use address(sample 1) source label cc:e1:d5:xx:xx:ed art@macaddr_wan lan cc:e1:d5:xx:xx:ec art@macaddr_lan wan cc:e1:d5:xx:xx:ed $label WiFi4_2G cc:e1:d5:xx:xx:ec art@cal_ath9k Installation from Serial Console ------------ 1. Connect to the serial console. Power up the device and interrupt autoboot when prompted 2. Connect a TFTP server reachable at 192.168.11.10/24 to the ethernet port. Serve the OpenWrt initramfs image as "openwrt.bin" 3. Boot the initramfs image using U-Boot ath> tftpboot 0x84000000 openwrt.bin ath> bootm 0x84000000 4. Copy the OpenWrt sysupgrade image to the device using scp and install it like a normal upgrade (with no need to keeping config since no config from "previous OpenWRT installation" could be kept at all) # sysupgrade -n /path/to/openwrt/sysupgrade.bin Installation from Web Interface ------------ To flash just do a firmware upgrade from the stock firmware (Buffalo branded dd-wrt) with squashfs-factory.bin Signed-off-by: Edward Chow Link: https://github.com/openwrt/openwrt/pull/17227 Signed-off-by: Hauke Mehrtens --- package/boot/uboot-envtools/files/ath79 | 1 + .../ath79/dts/qca9558_buffalo_wzr-450hp2.dts | 179 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 4 + target/linux/ath79/image/generic.mk | 12 ++ 4 files changed, 196 insertions(+) create mode 100644 target/linux/ath79/dts/qca9558_buffalo_wzr-450hp2.dts diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index c6d23ce73dc..c989e61bd55 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -28,6 +28,7 @@ asus,rt-ac59u-v2|\ asus,zenwifi-cd6n|\ asus,zenwifi-cd6r|\ buffalo,bhr-4grv2|\ +buffalo,wzr-450hp2|\ devolo,magic-2-wifi|\ engenius,eap300-v2|\ engenius,eap350-v1|\ diff --git a/target/linux/ath79/dts/qca9558_buffalo_wzr-450hp2.dts b/target/linux/ath79/dts/qca9558_buffalo_wzr-450hp2.dts new file mode 100644 index 00000000000..8f19907dfee --- /dev/null +++ b/target/linux/ath79/dts/qca9558_buffalo_wzr-450hp2.dts @@ -0,0 +1,179 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" + +#include +#include +#include + +/ { + compatible = "buffalo,wzr-450hp2", "qca,qca9558"; + model = "Buffalo WZR-450HP2/WZR-450HP2D"; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_green; + led-running = &led_status_green; + led-upgrade = &led_status_green; + label-mac-device = ð0; + }; + + leds { + compatible = "gpio-leds"; + + led_status_green: status_green { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + led_wlan_green: wlan_green { + function = LED_FUNCTION_WLAN; + color = ; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led_wps_green: wps_green { + function = LED_FUNCTION_WPS; + color = ; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + rfkill { + label = "RFKILL button"; + linux,code = ; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x40000>; + read-only; + }; + + partition@40000 { + reg = <0x40000 0x10000>; + label = "u-boot-env"; + }; + + partition@50000 { + compatible = "denx,uimage"; + reg = <0x50000 0xf90000>; + label = "firmware"; + }; + + partition@fe0000 { + reg = <0xfe0000 0x10000>; + label = "user_property"; + read-only; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x10000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_wan: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_lan: macaddr@6 { + reg = <0x6 0x6>; + }; + + cal_ath9k: cal_ath9k@1000 { + reg = <0x1000 0x440>; + }; + }; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + + qca,ar8327-initvals = < + 0x04 0x07600000 /* PORT0 PAD MODE CTRL: RGMII, to eth0 */ + 0x0c 0x00080080 /* PORT6 PAD MODE CTRL: SGMII, to eth1 */ + 0x10 0x81000080 /* POWER ON STRAP */ + 0x50 0xcc35cc35 /* LED_CTRL0 */ + 0x54 0xca35ca35 /* LED_CTRL1 */ + 0x58 0xc935c935 /* LED_CTRL2 */ + 0x5c 0x03ffff00 /* LED_CTRL3 */ + 0x7c 0x0000007e /* PORT0_STATUS */ + 0x94 0x0000007e /* PORT6_STATUS */ + >; + }; +}; + +ð0 { + status = "okay"; + + nvmem-cells = <&macaddr_wan>; + nvmem-cell-names = "mac-address"; + phy-handle = <&phy0>; + pll-data = <0x56000000 0x00000101 0x00001616>; + + gmac-config { + device = <&gmac>; + rgmii-enabled = <1>; + }; +}; + +ð1 { + status = "okay"; + + nvmem-cells = <&macaddr_lan>; + nvmem-cell-names = "mac-address"; + pll-data = <0x03000101 0x00000101 0x00001616>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&wmac { + status = "okay"; + + nvmem-cells = <&cal_ath9k>; + nvmem-cell-names = "calibration"; +}; 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 ad0365a4651..0321a9ac859 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 @@ -213,6 +213,10 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "6@eth0" ;; + buffalo,wzr-450hp2) + ucidef_add_switch "switch0" \ + "6@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0@eth0" + ;; buffalo,wzr-600dhp|\ buffalo,wzr-hp-ag300h|\ tplink,archer-c25-v1|\ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 92f9bc6cdde..846a9acd200 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -759,6 +759,18 @@ define Device/buffalo_wzr-hp-g450h endef TARGET_DEVICES += buffalo_wzr-hp-g450h +define Device/buffalo_wzr-450hp2 + $(Device/buffalo_common) + SOC := qca9558 + DEVICE_MODEL := WZR-450HP2 + DEVICE_ALT0_VENDOR := Buffalo + DEVICE_ALT0_MODEL := WZR-450HP2D + BUFFALO_PRODUCT := WZR-450HP2 + IMAGE_SIZE := 15936k + SUPPORTED_DEVICES += wzr-450hp2 +endef +TARGET_DEVICES += buffalo_wzr-450hp2 + define Device/comfast_cf-e110n-v2 SOC := qca9533 DEVICE_VENDOR := COMFAST From f69fc4c413357ab2e981f11eacd6101b6a59ab34 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 22 Dec 2024 17:47:34 +0100 Subject: [PATCH 129/149] procd: update to Git HEAD (2024-12-22) 42d3937 jail/seccomp: add support for loongarch64 Link: https://github.com/openwrt/openwrt/pull/17335 Signed-off-by: Hauke Mehrtens --- package/system/procd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile index 7a2276a46d1..65cc0ad9f65 100644 --- a/package/system/procd/Makefile +++ b/package/system/procd/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/procd.git -PKG_MIRROR_HASH:=99139ce325d73f5b250d115703540acfac3bcdc8ee202f2d3aacf3083042bc70 -PKG_SOURCE_DATE:=2024-12-17 -PKG_SOURCE_VERSION:=fd01fb852302a2683d09ee1c2193d7c51e2b0ba8 +PKG_MIRROR_HASH:=41dbb5352eff931ecc78c4ce9a081645c26a7fb8dc57cdd6521a2f8d3a142567 +PKG_SOURCE_DATE:=2024-12-22 +PKG_SOURCE_VERSION:=42d3937654508b04da64969f9d764ac2ec411904 CMAKE_INSTALL:=1 PKG_LICENSE:=GPL-2.0 From b6b6148d7d19f7081551491192e161f46cb0bdb8 Mon Sep 17 00:00:00 2001 From: Weijie Gao Date: Sun, 22 Dec 2024 18:32:54 +0800 Subject: [PATCH 130/149] config: enable SECCOMP support for loongarch64 Make USE_SECCOMP selectable for loongarch64 Signed-off-by: Weijie Gao Link: https://github.com/openwrt/openwrt/pull/17335 Signed-off-by: Hauke Mehrtens --- config/Config-build.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/Config-build.in b/config/Config-build.in index ec3a8d1f803..9b6b5f30669 100644 --- a/config/Config-build.in +++ b/config/Config-build.in @@ -426,7 +426,7 @@ menu "Global build settings" config USE_SECCOMP bool "Enable SECCOMP" select KERNEL_SECCOMP - depends on (aarch64 || arm || armeb || mips || mipsel || mips64 || mips64el || i386 || powerpc || x86_64) + depends on (aarch64 || arm || armeb || mips || mipsel || mips64 || mips64el || i386 || loongarch64 || powerpc || x86_64) depends on !TARGET_uml default y help From b3ce08e0b6fa6780bf7ee295a1f176c053b1100b Mon Sep 17 00:00:00 2001 From: Roland Reinl Date: Fri, 13 Dec 2024 18:58:26 +0100 Subject: [PATCH 131/149] mediatek: filogic: Add support for D-Link AQUILA PRO AI M60 Specification: - MT7986 CPU using 2.4GHz and 5GHz WiFi (both AX) - MT7531 switch - 512MB RAM - 128MB NAND flash (MX35LF1GE4AB-Z4I) with two UBI partitions with identical size - 1 multi color LED (red, green, blue, white) connected via GCA230718 (Same as D-Link M30 A1) - 3 buttons (WPS, reset, LED on/off) - 1x 2.5 Gbit WAN port with Maxlinear GPY211C - 4x 1 Gbit LAN ports Disassembly: - There are five screws at the bottom: 2 under the rubber feet, 3 under the label. - After removing the screws, the white plastic part can be shifted out of the blue part. - Be careful because the antennas are mounted on the side and the top of the white part. Serial Interface - The serial interface can be connected to the 4 pin holes next to/under the antenna cables. - Note that there is another set of 4 pin holes on the side of the board, it's not used. - Pins (from front to rear): - 3.3V (do not connect) - TX - RX - GND - Settings: 115200, 8N1 MAC addresses: - MAC address is stored in partition "Odm" at offset 0x81 (for example XX:XX:XX:XX:XX:52) - MAC address on the device label is ODM + 1 (for example XX:XX:XX:XX:XX:53) - WAN MAC is the one from the ODM partition (for example XX:XX:XX:XX:XX:52) - LAN MAC is the one from the ODM partition + 1 (for example XX:XX:XX:XX:XX:53) - WLAN MAC (2.4 GHz) is the one from the ODM partition + 2 (for example (XX:XX:XX:XX:XX:54) - WLAN MAC (5 GHz) is the one from the ODM partition + 5 (for example (XX:XX:XX:XX:XX:57) Flashing via OEM web interface: - Currently not supported because image crypto is not known Flashing via recovery web interface: - This is only working if the first partition is active because recovery images are always flashed to the active partition and OpenWrt can only be executed from the first partition - Use a Chromium based browser, otherwise firmware upgrade might not work - Recovery web interface is accessible via 192.168.200.1 after keeping the reset button pressed during start of the device until the LED blinks red - Upload the recovery image, this will take some time. LED will continue flashing red during the update process - The after flashing, the recovery web interface redirects to http://192.168.0.1. This can be ignored. OpenWrt is accessible via 192.168.1.1 after flashing - If the first partition isn't the active partition, OpenWrt will hang during the boot process. In this case: - Download the recovery image from https://github.com/RolandoMagico/openwrt/releases/tag/M60-Recovery-UBI-Switch (UBI switch image) - Enable recovery web interface again and load the UBI switch image. This image works on the second partition of the M60 - OpenWrt should boot now as expected. After booting, flash the normal OpenWrt sysupgrade image (for example in the OpenWrt web interface) - Flashing a sysupgrade image from the UBI switch image will make the first partition the active partition and from now on, default OpenWrt images can be used Flashing via Initramfs: - Before switching to OpenWrt, ensure that both partitions contain OEM firmware. - This can be achieved by re-flashing the same OEM firmware version again via the OEM web interface. - Flashing via OEM web interface will automatically flash the currently not active partition. - Open router, connect serial interface - Start a TFTP server at 192.168.200.2 and provide the initramfs image there - When starting the router, select "7. Load Image" in U-Boot - Settings for load address, load method can be kept as they are - Specify host and router IP address if you use different ones than the default (Router 192.168.200.1, TFTP server 192.168.200.2) - Enter the file name of the initramfs image - Confirm "Run loaded data now?" question after loading the image with "Y" - OpenWrt initramfs will start now - Before flashing OpenWrt, create a backup of the "ubi" partition. It is required when reverting back to OEM - Flash sysupgrade image to flash, during flashing the U-Boot variable sw_tryactive will be set to 0 - During next boot, U-Boot tries to boot from the ubi partition. If it fails, it will switch to the ubi1 partition Reverting back to OEM: - Boot the initramfs image as described in "Flashing via Initramfs" above - Copy the backed up ubi partition to /tmp (e.g. by using SCP) - Write the backup to the UBI partition: mtd write /tmp/OpenWrt.mtd4.ubi.bin /dev/mtd4 - Reboot the device, OEM firmware will start now Signed-off-by: Roland Reinl Link: https://github.com/openwrt/openwrt/pull/17296 Signed-off-by: Hauke Mehrtens --- .../uboot-envtools/files/mediatek_filogic | 3 +- .../mt7986a-dlink-aquila-pro-ai-m60-a1.dts | 377 ++++++++++++++++++ .../filogic/base-files/etc/board.d/02_network | 3 +- .../base-files/lib/upgrade/platform.sh | 4 + target/linux/mediatek/image/filogic.mk | 14 + 5 files changed, 399 insertions(+), 2 deletions(-) create mode 100644 target/linux/mediatek/dts/mt7986a-dlink-aquila-pro-ai-m60-a1.dts diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic index 9d7c5a1527b..bf107cc1352 100644 --- a/package/boot/uboot-envtools/files/mediatek_filogic +++ b/package/boot/uboot-envtools/files/mediatek_filogic @@ -96,7 +96,8 @@ zbtlink,zbt-z8102ax|\ zbtlink,zbt-z8103ax) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" ;; -dlink,aquila-pro-ai-m30-a1) +dlink,aquila-pro-ai-m30-a1|\ +dlink,aquila-pro-ai-m60-a1) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x40000" "0x40000" ;; gatonetworks,gdsp) diff --git a/target/linux/mediatek/dts/mt7986a-dlink-aquila-pro-ai-m60-a1.dts b/target/linux/mediatek/dts/mt7986a-dlink-aquila-pro-ai-m60-a1.dts new file mode 100644 index 00000000000..a95c069156e --- /dev/null +++ b/target/linux/mediatek/dts/mt7986a-dlink-aquila-pro-ai-m60-a1.dts @@ -0,0 +1,377 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) + +/dts-v1/; +#include +#include +#include + +#include "mt7986a.dtsi" + +/ { + model = "D-Link AQUILA PRO AI M60 A1"; + compatible = "dlink,aquila-pro-ai-m60-a1", "mediatek,mt7986a"; + + aliases { + serial0 = &uart0; + led-boot = &led_status_white; + led-failsafe = &led_status_red; + led-running = &led_status_white; + led-upgrade = &led_status_blue; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory@40000000 { + reg = <0 0x40000000 0 0x20000000>; + }; + + gpio-keys { + compatible = "gpio-keys"; + + button-reset { + label = "reset"; + gpios = <&pio 10 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + button-wps { + label = "wps"; + gpios = <&pio 9 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + button-leds-on-off { + label = "leds-on-off"; + linux,code = ; + gpios = <&pio 47 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð { + status = "okay"; + + gmac0: mac@0 { + compatible = "mediatek,eth-mac"; + reg = <0>; + phy-mode = "2500base-x"; + + nvmem-cells = <&macaddr_odm 1>; + nvmem-cell-names = "mac-address"; + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + + gmac1: mac@1 { + compatible = "mediatek,eth-mac"; + reg = <1>; + phy-mode = "2500base-x"; + phy-handle = <&phy6>; + nvmem-cells = <&macaddr_odm 0>; + nvmem-cell-names = "mac-address"; + label = "internet"; + }; + + mdio: mdio-bus { + #address-cells = <1>; + #size-cells = <0>; + + reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>; + reset-delay-us = <1500000>; + reset-post-delay-us = <1000000>; + + phy6: phy@6 { + compatible = "maxlinear,gpy211", "ethernet-phy-ieee802.3-c45"; + reg = <6>; + phy-mode = "2500base-x"; + }; + + switch@1f { + compatible = "mediatek,mt7531"; + reg = <31>; + reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>; + interrupt-controller; + #interrupt-cells = <1>; + interrupt-parent = <&pio>; + interrupts = <66 IRQ_TYPE_LEVEL_HIGH>; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + label = "lan1"; + }; + + port@1 { + reg = <1>; + label = "lan2"; + }; + + port@2 { + reg = <2>; + label = "lan3"; + }; + + port@3 { + reg = <3>; + label = "lan4"; + }; + + port@6 { + reg = <6>; + label = "cpu"; + ethernet = <&gmac0>; + phy-mode = "2500base-x"; + + fixed-link { + speed = <2500>; + full-duplex; + pause; + }; + }; + }; + }; + }; +}; + +&pio { + spi_flash_pins: spi-flash-pins-33-to-38 { + mux { + function = "spi"; + groups = "spi0", "spi0_wp_hold"; + }; + conf-pu { + pins = "SPI2_CS", "SPI2_HOLD", "SPI2_WP"; + drive-strength = <8>; + mediatek,pull-up-adv = <0>; /* bias-disable */ + }; + conf-pd { + pins = "SPI2_CLK", "SPI2_MOSI", "SPI2_MISO"; + drive-strength = <8>; + mediatek,pull-down-adv = <0>; /* bias-disable */ + }; + }; + + wf_2g_5g_pins: wf_2g_5g-pins { + mux { + function = "wifi"; + groups = "wf_2g", "wf_5g"; + }; + conf { + pins = + "WF0_HB2", + "WF0_HB3", + "WF0_HB4", + "WF0_HB0", + "WF0_HB0_B", + "WF0_HB5", + "WF0_HB6", + "WF0_HB7", + "WF0_HB8", + "WF0_HB9", + "WF0_HB10", + "WF0_TOP_CLK", + "WF0_TOP_DATA", + "WF1_HB1", + "WF1_HB2", + "WF1_HB3", + "WF1_HB4", + "WF1_HB0", + "WF1_HB5", + "WF1_HB6", + "WF1_HB7", + "WF1_HB8", + "WF1_TOP_CLK", + "WF1_TOP_DATA"; + drive-strength = <4>; + }; + }; + + i2c_pins_3_4: i2c-pins-3-4 { + mux { + function = "i2c"; + groups = "i2c"; + }; + }; +}; + +&spi0 { + pinctrl-names = "default"; + pinctrl-0 = <&spi_flash_pins>; + status = "okay"; + + flash@0 { + compatible = "spi-nand"; + #address-cells = <1>; + #size-cells = <1>; + reg = <0>; + + spi-max-frequency = <20000000>; + spi-tx-bus-width = <4>; + spi-rx-bus-width = <4>; + + mediatek,nmbm; + mediatek,bmt-max-ratio = <1>; + mediatek,bmt-max-reserved-blocks = <64>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "BL2"; + reg = <0x000000 0x100000>; + read-only; + }; + + partition@100000 { + label = "u-boot-env"; + reg = <0x100000 0x80000>; + }; + + partition@180000 { + label = "Factory"; + reg = <0x180000 0x200000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + eeprom_factory_0: eeprom@0 { + reg = <0x0 0x1000>; + }; + }; + }; + + partition@380000 { + label = "FIP"; + reg = <0x380000 0x200000>; + read-only; + }; + + partition@580000 { + label = "ubi"; + reg = <0x580000 0x3200000>; + }; + + partition@3780000 { + label = "ubi1"; + reg = <0x3780000 0x3200000>; + read-only; + }; + + partition@6980000 { + label = "Odm"; + reg = <0x6980000 0x40000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_odm: macaddr@81 { + compatible = "mac-base"; + reg = <0x81 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + + }; + + partition@69c0000 { + label = "Config1"; + reg = <0x69c0000 0x80000>; + read-only; + }; + + partition@6a40000 { + label = "Config2"; + reg = <0x6a40000 0x80000>; + read-only; + }; + + partition@6ac0000 { + label = "Storage"; + reg = <0x6ac0000 0xA00000>; + read-only; + }; + + }; + }; +}; + +&wifi { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&wf_2g_5g_pins>; + + + nvmem-cells = <&eeprom_factory_0>; + nvmem-cell-names = "eeprom"; + + band@0 { + /* 2.4 GHz */ + reg = <0>; + nvmem-cells = <&macaddr_odm 2>; + nvmem-cell-names = "mac-address"; + }; + band@1 { + /* 5 GHz */ + reg = <1>; + nvmem-cells = <&macaddr_odm 5>; + nvmem-cell-names = "mac-address"; + }; +}; + +&uart0 { + status = "okay"; +}; + +&watchdog { + status = "okay"; +}; + +&i2c0 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&i2c_pins_3_4>; + + gca230718@40 { + compatible = "unknown,gca230718"; + reg = <0x40>; + + led_status_red: led@0 { + color = ; + function = LED_FUNCTION_STATUS; + reg = <0>; + }; + + led@1 { + color = ; + function = LED_FUNCTION_STATUS; + reg = <1>; + }; + + led_status_blue: led@2 { + color = ; + function = LED_FUNCTION_STATUS; + reg = <2>; + }; + + led_status_white: led@3 { + color = ; + function = LED_FUNCTION_STATUS; + reg = <3>; + }; + }; +}; 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 0d0ee526178..e9f63938b2d 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 @@ -93,7 +93,8 @@ mediatek_setup_interfaces() openwrt,one) ucidef_set_interfaces_lan_wan eth1 eth0 ;; - dlink,aquila-pro-ai-m30-a1) + dlink,aquila-pro-ai-m30-a1|\ + dlink,aquila-pro-ai-m60-a1) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" internet ;; keenetic,kn-3911|\ diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh index f3d5cb472e3..baab9ac2918 100755 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh @@ -123,6 +123,10 @@ platform_do_upgrade() { yuncore,ax835) default_do_upgrade "$1" ;; + dlink,aquila-pro-ai-m60-a1) + fw_setenv sw_tryactive 0 + nand_do_upgrade "$1" + ;; mercusys,mr90x-v1|\ tplink,re6000xd) CI_UBIPART="ubi0" diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk index 235971d1942..22c9151ff37 100644 --- a/target/linux/mediatek/image/filogic.mk +++ b/target/linux/mediatek/image/filogic.mk @@ -720,6 +720,20 @@ define Device/dlink_aquila-pro-ai-m30-a1 endef TARGET_DEVICES += dlink_aquila-pro-ai-m30-a1 +define Device/dlink_aquila-pro-ai-m60-a1 + DEVICE_VENDOR := D-Link + DEVICE_MODEL := AQUILA PRO AI M60 + DEVICE_VARIANT := A1 + DEVICE_DTS := mt7986a-dlink-aquila-pro-ai-m60-a1 + DEVICE_DTS_DIR := ../dts + DEVICE_PACKAGES := kmod-leds-gca230718 kmod-mt7915e kmod-mt7986-firmware mt7986-wo-firmware + IMAGES += recovery.bin + IMAGE_SIZE := 51200k + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata + IMAGE/recovery.bin := sysupgrade-tar | pad-to $$(IMAGE_SIZE) | dlink-ai-recovery-header DLK6E8202001 \x30\x6C\x19\x0C \x00\x00\x2C\x00 \x00\x00\x20\x03 \x82\x6E +endef +TARGET_DEVICES += dlink_aquila-pro-ai-m60-a1 + define Device/edgecore_eap111 DEVICE_VENDOR := Edgecore DEVICE_MODEL := EAP111 From 0e2dcfc4f488ecd7acf31e01bd10624d8a273cde Mon Sep 17 00:00:00 2001 From: Joel Low Date: Sat, 14 Dec 2024 21:39:36 +0800 Subject: [PATCH 132/149] netfilter: add kmod-nfnetlink-ct{helper,timeout} Add kmod-nfnetlink-ct{helper,timeout} to allow handling firewall rules in userspace (together with conntrackd). The timeout module allows specifying custom expiration rules. Signed-off-by: Joel Low Link: https://github.com/openwrt/openwrt/pull/17267 Signed-off-by: Hauke Mehrtens --- config/Config-kernel.in | 7 +++++ package/kernel/linux/modules/netfilter.mk | 34 +++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/config/Config-kernel.in b/config/Config-kernel.in index 91678cf2a66..64c8c63466a 100644 --- a/config/Config-kernel.in +++ b/config/Config-kernel.in @@ -1239,6 +1239,13 @@ config KERNEL_MPTCP_IPV6 default KERNEL_MPTCP endif +config KERNEL_NF_CONNTRACK_TIMEOUT + bool "Per-connection connection tracking timeout" + default y if !SMALL_FLASH + help + Select this option to enable support for per-connection conntrack timeouts. + Increases the (uncompressed) size of nf_conntrack.ko by ~8kB. + # # NFS related symbols # diff --git a/package/kernel/linux/modules/netfilter.mk b/package/kernel/linux/modules/netfilter.mk index cf66bd8cd8c..30ff35ca6bf 100644 --- a/package/kernel/linux/modules/netfilter.mk +++ b/package/kernel/linux/modules/netfilter.mk @@ -1048,6 +1048,40 @@ endef $(eval $(call KernelPackage,nfnetlink-queue)) +define KernelPackage/nfnetlink-cthelper + TITLE:=Netfilter User space conntrack helpers + FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink_cthelper.ko + KCONFIG:=CONFIG_NF_CT_NETLINK_HELPER + AUTOLOAD:=$(call AutoProbe,nfnetlink_cthelper) + $(call AddDepends/nfnetlink,+kmod-nfnetlink-queue +kmod-nf-conntrack-netlink) +endef + +define KernelPackage/nfnetlink-cthelper/description + Kernel modules support for a netlink-based connection tracking + userspace helpers interface +endef + +$(eval $(call KernelPackage,nfnetlink-cthelper)) + + +define KernelPackage/nfnetlink-cttimeout + TITLE:=Netfilter conntrack expectation timeout + FILES:=$(LINUX_DIR)/net/netfilter/nfnetlink_cttimeout.ko + KCONFIG:=CONFIG_NF_CT_NETLINK_TIMEOUT + AUTOLOAD:=$(call AutoProbe,nfnetlink_cttimeout) + $(call AddDepends/nfnetlink,+kmod-nf-conntrack +kmod-nf-conntrack-timeout @KERNEL_NF_CONNTRACK_TIMEOUT) +endef + +define KernelPackage/nfnetlink-cttimeout/description + Kernel modules support for a netlink-based connection tracking + userspace timeout interface + + Requires CONFIG_NF_CONNTRACK_TIMEOUT (only enabled for non-small flash devices) +endef + +$(eval $(call KernelPackage,nfnetlink-cttimeout)) + + define KernelPackage/nf-conntrack-netlink TITLE:=Connection tracking netlink interface FILES:=$(LINUX_DIR)/net/netfilter/nf_conntrack_netlink.ko From 5c76e63f198610d975c40a1af33d4f41e09481f7 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 14 Dec 2024 17:07:36 -0800 Subject: [PATCH 133/149] ath79: use nvmem for wrong 3e0 cal size These three devices use AR9287 chips, which have a calibration size of 3d8. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/17278 Signed-off-by: Hauke Mehrtens --- .../ath79/dts/ar7241_netgear_wnr2200-16m.dts | 8 ++++++-- .../linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts | 8 ++++++-- .../linux/ath79/dts/ar7241_netgear_wnr2200.dtsi | 1 - .../ath79/dts/ar7241_tplink_tl-wr842n-v1.dts | 15 ++++++++++++--- .../etc/hotplug.d/firmware/10-ath9k-eeprom | 5 ----- 5 files changed, 24 insertions(+), 13 deletions(-) diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts index aa734966d50..95766664862 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200-16m.dts @@ -50,6 +50,10 @@ macaddr_art_6: macaddr@6 { reg = <0x6 0x6>; }; + + cal_art_1000: calibration@1000 { + reg = <0x1000 0x3d8>; + }; }; }; }; @@ -65,6 +69,6 @@ }; &ath9k { - nvmem-cells = <&macaddr_art_0 1>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_art_0 1>, <&cal_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; }; diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts b/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts index 27c31c3c123..62ee49e9d0b 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200-8m.dts @@ -50,6 +50,10 @@ macaddr_art_6: macaddr@6 { reg = <0x6 0x6>; }; + + cal_art_1000: calibration@1000 { + reg = <0x1000 0x3d8>; + }; }; }; }; @@ -65,6 +69,6 @@ }; &ath9k { - nvmem-cells = <&macaddr_art_0 1>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_art_0 1>, <&cal_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; }; diff --git a/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi b/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi index 2c1dd064fec..8dcb8f852c4 100644 --- a/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi +++ b/target/linux/ath79/dts/ar7241_netgear_wnr2200.dtsi @@ -173,7 +173,6 @@ ath9k: wifi@0,0 { compatible = "pci168c,002e"; reg = <0x0000 0 0 0 0>; - qca,no-eeprom; #gpio-cells = <2>; gpio-controller; diff --git a/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts b/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts index b0edbf4d06f..83690106887 100644 --- a/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts +++ b/target/linux/ath79/dts/ar7241_tplink_tl-wr842n-v1.dts @@ -128,6 +128,16 @@ reg = <0x7f0000 0x10000>; label = "art"; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: calibration@1000 { + reg = <0x1000 0x3d8>; + }; + }; }; }; }; @@ -141,9 +151,8 @@ reg = <0x0000 0 0 0 0>; #gpio-cells = <2>; gpio-controller; - qca,no-eeprom; - nvmem-cells = <&macaddr_uboot_1fc00 0>; - nvmem-cell-names = "mac-address"; + nvmem-cells = <&macaddr_uboot_1fc00 0>, <&cal_art_1000>; + nvmem-cell-names = "mac-address", "calibration"; }; }; diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 675522823f6..89cb3df6f21 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -83,11 +83,6 @@ case "$FIRMWARE" in meraki,mr12) caldata_extract "art" 0x11000 0xeb8 ;; - netgear,wnr2200-8m|\ - netgear,wnr2200-16m|\ - tplink,tl-wr842n-v1) - caldata_extract "art" 0x1000 0x3e0 - ;; ubnt,powerbridge-m|\ ubnt,rocket-m) caldata_extract "art" 0x1000 0x1000 From a2b0ded29f1f92663b1fd7e2a3382d61f1856b09 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 16 Dec 2024 14:15:08 -0800 Subject: [PATCH 134/149] ath79: fix calibration size for AR9287 These devices use AR9287, which uses 3d8 as the calibration size, not 440 like newer chips do. Add a compatible line to make it clear that this is the case. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/17278 Signed-off-by: Hauke Mehrtens --- target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi index d9c7336f911..e9abd423f57 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi @@ -83,7 +83,7 @@ }; calibration_art_1000: calibration@1000 { - reg = <0x1000 0x440>; + reg = <0x1000 0x3d8>; }; }; }; @@ -92,6 +92,7 @@ }; &wifi { + compatible = "pci168c,002e"; nvmem-cells = <&calibration_art_1000>; nvmem-cell-names = "calibration"; }; From ed5f6fdd7d2e2ca1ddb6bd5369723bc3a5c53622 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 14 Dec 2024 14:32:14 -0800 Subject: [PATCH 135/149] ath79: wr2543: add compatible string for wifi Makes it clear that the calibration size is correct as most ar72xx devices use older wifi chips. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/17278 Signed-off-by: Hauke Mehrtens --- target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts b/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts index 0124ddff87a..744971c6f8f 100644 --- a/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts +++ b/target/linux/ath79/dts/ar7242_tplink_tl-wr2543-v1.dts @@ -159,6 +159,7 @@ status = "okay"; ath9k: wifi@0,0 { + compatible = "pci168c,0030"; reg = <0x0000 0 0 0 0>; #gpio-cells = <2>; gpio-controller; From eabfe691cef15da08ad515a7724d01da1b11ae73 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 15 Dec 2024 23:54:02 -0800 Subject: [PATCH 136/149] bmips: dsl-2750b-b1: fix calibration size AR9287 uses 3d8, not 440 like newer chips. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/17278 Signed-off-by: Hauke Mehrtens --- target/linux/bmips/dts/bcm6328-dlink-dsl-2750b-b1.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/bmips/dts/bcm6328-dlink-dsl-2750b-b1.dts b/target/linux/bmips/dts/bcm6328-dlink-dsl-2750b-b1.dts index e4806c0a9ad..970182629d6 100644 --- a/target/linux/bmips/dts/bcm6328-dlink-dsl-2750b-b1.dts +++ b/target/linux/bmips/dts/bcm6328-dlink-dsl-2750b-b1.dts @@ -180,7 +180,7 @@ #size-cells = <1>; cal_data_1000: calibration@1000 { - reg = <0x1000 0x440>; + reg = <0x1000 0x3d8>; }; }; }; From d3f8b1cf17ad0a241316f217ea2710fcf5228005 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 16 Dec 2024 15:07:50 -0800 Subject: [PATCH 137/149] lantiq: use nvmem for fritz73x0 These units use AR9287, which has a calibration size of 3d8. Also fixed compatible string to the proper one to indicate AR9287. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/17278 Signed-off-by: Hauke Mehrtens --- .../arch/mips/boot/dts/lantiq/ar9_avm_fritz7312.dts | 9 +++++++-- .../arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts | 9 +++++++-- .../base-files/etc/hotplug.d/firmware/12-ath9k-eeprom | 3 --- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7312.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7312.dts index 9ea6c3929cb..ba6c4870489 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7312.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7312.dts @@ -136,6 +136,10 @@ #address-cells = <1>; #size-cells = <1>; + cal_ath9k_cal_985: calibration@985 { + reg = <0x985 0x3d8>; + }; + macaddr_ath9k_cal_a91: macaddr@a91 { compatible = "mac-base"; reg = <0xa91 0x6>; @@ -180,8 +184,9 @@ reset-gpios = <&gpio 21 GPIO_ACTIVE_LOW>; wifi@0,0 { - compatible = "pci0,0"; + compatible = "pci168c,002d"; reg = <0x7000 0 0 0 0>; - qca,no-eeprom; /* load from ath9k-eeprom-pci-0000:00:0e.0.bin */ + nvmem-cells = <&cal_ath9k_cal_985>; + nvmem-cell-names = "calibration"; }; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts index 953a8ccbf74..c09d3879b42 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/ar9_avm_fritz7320.dts @@ -163,6 +163,10 @@ #address-cells = <1>; #size-cells = <1>; + cal_ath9k_cal_985: calibration@985 { + reg = <0x985 0x3d8>; + }; + macaddr_ath9k_cal_a91: macaddr@a91 { compatible = "mac-base"; reg = <0xa91 0x6>; @@ -206,9 +210,10 @@ reset-gpios = <&gpio 21 GPIO_ACTIVE_LOW>; wifi@0,0 { - compatible = "pci0,0"; + compatible = "pci168c,002d"; reg = <0x7000 0 0 0 0>; - qca,no-eeprom; /* load from ath9k-eeprom-pci-0000:00:0e.0.bin */ + nvmem-cells = <&cal_ath9k_cal_985>; + nvmem-cell-names = "calibration"; }; }; diff --git a/target/linux/lantiq/xway/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom b/target/linux/lantiq/xway/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom index 98bb9af6947..91eb3f16806 100644 --- a/target/linux/lantiq/xway/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom +++ b/target/linux/lantiq/xway/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom @@ -45,9 +45,6 @@ case "$FIRMWARE" in caldata_extract "calibration" 0xf000 0x1000 ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 2) 0x20c ;; - avm,fritz7312|avm,fritz7320) - caldata_extract "urlader" 0x985 0x1000 - ;; *) caldata_die "board $board is not supported yet" ;; From e85b1afe6e49b03fad13145a3fdd4cc7e45c27f7 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 16 Dec 2024 15:42:19 -0800 Subject: [PATCH 138/149] lantiq: use nvmem for fritz 736x Two use AR9287 and one AR9381. Both have different calibration sizes. Move differences out of wifi node to make it clearer what's what. qca,no-eeprom needs to stay for 7362sl as there's no nvmem equivalent for caldata_extract_reverse Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/17278 Signed-off-by: Hauke Mehrtens --- .../arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts | 4 ++-- .../arch/mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts | 10 ++++++++++ .../arch/mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts | 5 +++++ .../arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi | 4 +--- .../base-files/etc/hotplug.d/firmware/12-ath9k-eeprom | 3 --- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts index cc15324b56e..1b414050629 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360-v2.dts @@ -49,7 +49,7 @@ #size-cells = <1>; cal_urlader_985: cal@985 { - reg = <0x985 0x440>; + reg = <0x985 0x3d8>; }; macaddr_urlader_a91: macaddr@a91 { @@ -94,7 +94,7 @@ }; &wifi { - /delete-property/ qca,no-eeprom; + compatible = "pci168c,002e"; nvmem-cells = <&cal_urlader_985>; nvmem-cell-names = "calibration"; }; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts index cbe6c14c991..9301b049cae 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7360sl.dts @@ -49,6 +49,10 @@ #address-cells = <1>; #size-cells = <1>; + cal_urlader_985: cal@985 { + reg = <0x985 0x3d8>; + }; + macaddr_urlader_a91: macaddr@a91 { compatible = "mac-base"; reg = <0xa91 0x6>; @@ -89,3 +93,9 @@ &phy1 { reset-gpios = <&gpio 44 GPIO_ACTIVE_LOW>; }; + +&wifi { + compatible = "pci168c,002e"; + nvmem-cells = <&cal_urlader_985>; + nvmem-cell-names = "calibration"; +}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts index 7929bde6cfe..e1334fa3064 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz7362sl.dts @@ -127,3 +127,8 @@ &phy1 { reset-gpios = <&gpio 44 GPIO_ACTIVE_LOW>; }; + +&wifi { + compatible = "pci168c,0030"; + qca,no-eeprom; /* load from ath9k-eeprom-pci-0000:01:00.0.bin */ +}; diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi index e7fc9a4f55b..cc0c97da89c 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz736x.dtsi @@ -155,10 +155,8 @@ #address-cells = <2>; device_type = "pci"; - wifi: wifi@168c,002e { - compatible = "pci168c,002e"; + wifi: wifi@0,0 { reg = <0 0 0 0 0>; - qca,no-eeprom; /* load from ath9k-eeprom-pci-0000:01:00.0.bin */ }; }; }; diff --git a/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom b/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom index 164e2d39caa..936181c6935 100644 --- a/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom +++ b/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom @@ -19,9 +19,6 @@ case "$FIRMWARE" in avm,fritz3390) caldata_extract_reverse "urlader" 0x2546 0x440 ;; - avm,fritz7360sl) - caldata_extract "urlader" 0x985 0x1000 - ;; avm,fritz7412|\ avm,fritz7430) /usr/bin/fritz_cal_extract -i 1 -s 0x1e000 -e 0x207 -l 5120 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader") || \ From f6433c58108f7e9edf0a8de017132ac5a9d0c1de Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 6 Oct 2024 16:51:49 -0700 Subject: [PATCH 139/149] kernel: leds-gca230718: run through clang-format This file does not use a coding style consistent with the kernel. Run clang-format with the kernel's .clang-format file. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16869 Signed-off-by: Hauke Mehrtens --- .../leds-gca230718/src/leds-gca230718.c | 159 +++++++++--------- 1 file changed, 84 insertions(+), 75 deletions(-) diff --git a/package/kernel/leds-gca230718/src/leds-gca230718.c b/package/kernel/leds-gca230718/src/leds-gca230718.c index 194d149970e..71c8b983b58 100644 --- a/package/kernel/leds-gca230718/src/leds-gca230718.c +++ b/package/kernel/leds-gca230718/src/leds-gca230718.c @@ -17,40 +17,39 @@ #include #include -#define GCA230718_MAX_LEDS (4u) +#define GCA230718_MAX_LEDS (4u) -#define GCA230718_OPMODE_DISABLED (0x00u) -#define GCA230718_OPMODE_NO_TOGGLE (0x01u) -#define GCA230718_OPMODE_TOGGLE_RAMP_CONTROL_DISABLED (0x02u) -#define GCA230718_OPMODE_TOGGLE_RAMP_CONTROL_ENSABLED (0x03u) +#define GCA230718_OPMODE_DISABLED (0x00u) +#define GCA230718_OPMODE_NO_TOGGLE (0x01u) +#define GCA230718_OPMODE_TOGGLE_RAMP_CONTROL_DISABLED (0x02u) +#define GCA230718_OPMODE_TOGGLE_RAMP_CONTROL_ENSABLED (0x03u) -#define GCA230718_1ST_SEQUENCE_BYTE_1 (0x02u) -#define GCA230718_2ND_SEQUENCE_BYTE_1 (0x01u) -#define GCA230718_3RD_SEQUENCE_BYTE_1 (0x03u) +#define GCA230718_1ST_SEQUENCE_BYTE_1 (0x02u) +#define GCA230718_2ND_SEQUENCE_BYTE_1 (0x01u) +#define GCA230718_3RD_SEQUENCE_BYTE_1 (0x03u) -struct gca230718_led -{ +struct gca230718_led { enum led_brightness brightness; struct i2c_client *client; struct led_classdev ledClassDev; }; -struct gca230718_private -{ +struct gca230718_private { struct mutex lock; struct gca230718_led leds[GCA230718_MAX_LEDS]; }; -static void gca230718_init_private_led_data(struct gca230718_private* data) +static void gca230718_init_private_led_data(struct gca230718_private *data) { u8 ledIndex; - for (ledIndex = 0; ledIndex < GCA230718_MAX_LEDS; ledIndex++) - { + for (ledIndex = 0; ledIndex < GCA230718_MAX_LEDS; ledIndex++) { data->leds[ledIndex].client = NULL; } } -static void gca230718_send_sequence(struct i2c_client *client, u8 byte0, struct gca230718_private* gca230718_privateData) +static void +gca230718_send_sequence(struct i2c_client *client, u8 byte0, + struct gca230718_private *gca230718_privateData) { int status = 0; u8 ledIndex; @@ -64,140 +63,150 @@ static void gca230718_send_sequence(struct i2c_client *client, u8 byte0, struct controlCommand[1] = byte0; controlCommand[2] = GCA230718_OPMODE_NO_TOGGLE; /* Byte 3-6 are set below to the brighness value of the individual LEDs */ - controlCommand[7] = 0x01; /* Frequency, doesn't care as long as GCA230718_OPMODE_NO_TOGGLE is used above */ + controlCommand[7] = + 0x01; /* Frequency, doesn't care as long as GCA230718_OPMODE_NO_TOGGLE is used above */ /* Byte 8-11 are set below to the brighness value of the individual LEDs */ controlCommand[12] = 0x87; - for (ledIndex = 0; ledIndex < GCA230718_MAX_LEDS; ledIndex++) - { - controlCommand[3 + ledIndex] = gca230718_privateData->leds[ledIndex].brightness; - controlCommand[8 + ledIndex] = gca230718_privateData->leds[ledIndex].brightness; + for (ledIndex = 0; ledIndex < GCA230718_MAX_LEDS; ledIndex++) { + controlCommand[3 + ledIndex] = + gca230718_privateData->leds[ledIndex].brightness; + controlCommand[8 + ledIndex] = + gca230718_privateData->leds[ledIndex].brightness; } mutex_lock(&(gca230718_privateData->lock)); - if ((status = i2c_smbus_write_i2c_block_data(client, resetCommandRegister, sizeof(resetCommand), resetCommand)) != 0) - { - pr_info("Error %i during call of i2c_smbus_write_i2c_block_data for reset command\n", status); - } - else if ((status = i2c_smbus_write_i2c_block_data(client, controlCommandRegister, sizeof(controlCommand), controlCommand)) != 0) - { - pr_info("Error %i during call of i2c_smbus_write_i2c_block_data for control command\n", status); + if ((status = i2c_smbus_write_i2c_block_data( + client, resetCommandRegister, sizeof(resetCommand), + resetCommand)) != 0) { + pr_info("Error %i during call of i2c_smbus_write_i2c_block_data for reset command\n", + status); + } else if ((status = i2c_smbus_write_i2c_block_data( + client, controlCommandRegister, + sizeof(controlCommand), controlCommand)) != 0) { + pr_info("Error %i during call of i2c_smbus_write_i2c_block_data for control command\n", + status); } mutex_unlock(&(gca230718_privateData->lock)); } -static int gca230718_set_brightness(struct led_classdev *led_cdev, enum led_brightness value) +static int gca230718_set_brightness(struct led_classdev *led_cdev, + enum led_brightness value) { - struct gca230718_led* led; - struct i2c_client* client; + struct gca230718_led *led; + struct i2c_client *client; led = container_of(led_cdev, struct gca230718_led, ledClassDev); client = led->client; - if (client != NULL) - { - struct gca230718_private* gca230718_privateData; + if (client != NULL) { + struct gca230718_private *gca230718_privateData; led->brightness = value; gca230718_privateData = i2c_get_clientdata(client); - gca230718_send_sequence(client, GCA230718_2ND_SEQUENCE_BYTE_1, gca230718_privateData); + gca230718_send_sequence(client, GCA230718_2ND_SEQUENCE_BYTE_1, + gca230718_privateData); } return 0; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6,3,0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) static int gca230718_probe(struct i2c_client *client) #else -static int gca230718_probe(struct i2c_client *client, const struct i2c_device_id *id) +static int gca230718_probe(struct i2c_client *client, + const struct i2c_device_id *id) #endif { int status = 0; - struct gca230718_private* gca230718_privateData; + struct gca230718_private *gca230718_privateData; pr_info("Enter gca230718_probe for device address %u\n", client->addr); - gca230718_privateData = devm_kzalloc(&(client->dev), sizeof(struct gca230718_private), GFP_KERNEL); + gca230718_privateData = devm_kzalloc( + &(client->dev), sizeof(struct gca230718_private), GFP_KERNEL); - if (gca230718_privateData == NULL) - { + if (gca230718_privateData == NULL) { pr_info("Error during allocating memory for private data\n"); status = -ENOMEM; - } - else - { - struct device_node* ledNode; + } else { + struct device_node *ledNode; mutex_init(&gca230718_privateData->lock); gca230718_init_private_led_data(gca230718_privateData); i2c_set_clientdata(client, gca230718_privateData); - for_each_child_of_node(client->dev.of_node, ledNode) - { + for_each_child_of_node(client->dev.of_node, ledNode) { u32 regValue = 0; - if (of_property_read_u32(ledNode, "reg", ®Value) != 0) - { - pr_info("Missing entry \"reg\" in node %s\n", ledNode->name); - } - else if (regValue >= GCA230718_MAX_LEDS) - { - pr_info("Invalid entry \"reg\" in node %s (%u)\n", ledNode->name, regValue); - } - else - { - struct led_classdev* ledClassDev = &(gca230718_privateData->leds[regValue].ledClassDev); + if (of_property_read_u32(ledNode, "reg", ®Value) != + 0) { + pr_info("Missing entry \"reg\" in node %s\n", + ledNode->name); + } else if (regValue >= GCA230718_MAX_LEDS) { + pr_info("Invalid entry \"reg\" in node %s (%u)\n", + ledNode->name, regValue); + } else { + struct led_classdev *ledClassDev = + &(gca230718_privateData->leds[regValue] + .ledClassDev); struct led_init_data init_data = {}; - gca230718_privateData->leds[regValue].client = client; + gca230718_privateData->leds[regValue].client = + client; init_data.fwnode = of_fwnode_handle(ledNode); - pr_info("Creating LED for node %s: reg=%u\n", ledNode->name, regValue); + pr_info("Creating LED for node %s: reg=%u\n", + ledNode->name, regValue); - ledClassDev->name = of_get_property(ledNode, "label", NULL); - if (ledClassDev->name == NULL) - { + ledClassDev->name = + of_get_property(ledNode, "label", NULL); + if (ledClassDev->name == NULL) { ledClassDev->name = ledNode->name; } ledClassDev->brightness = LED_OFF; ledClassDev->max_brightness = LED_FULL; - ledClassDev->brightness_set_blocking = gca230718_set_brightness; - - if (devm_led_classdev_register_ext(&(client->dev), ledClassDev, &init_data) != 0) - { + ledClassDev->brightness_set_blocking = + gca230718_set_brightness; + + if (devm_led_classdev_register_ext( + &(client->dev), ledClassDev, + &init_data) != 0) { pr_info("Error during call of devm_led_classdev_register_ext"); } } } } - if (status == 0) - { + if (status == 0) { /* Send full initialization sequence. Afterwards only GCA230718_2ND_SEQUENCE_BYTE_1 must be send to upddate the brightness values. */ - gca230718_send_sequence(client, GCA230718_1ST_SEQUENCE_BYTE_1, gca230718_privateData); - gca230718_send_sequence(client, GCA230718_2ND_SEQUENCE_BYTE_1, gca230718_privateData); - gca230718_send_sequence(client, GCA230718_3RD_SEQUENCE_BYTE_1, gca230718_privateData); + gca230718_send_sequence(client, GCA230718_1ST_SEQUENCE_BYTE_1, + gca230718_privateData); + gca230718_send_sequence(client, GCA230718_2ND_SEQUENCE_BYTE_1, + gca230718_privateData); + gca230718_send_sequence(client, GCA230718_3RD_SEQUENCE_BYTE_1, + gca230718_privateData); } return status; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,18,0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) static void gca230718_remove(struct i2c_client *client) #else static int gca230718_remove(struct i2c_client *client) #endif { - struct gca230718_private* gca230718_privateData; + struct gca230718_private *gca230718_privateData; gca230718_privateData = i2c_get_clientdata(client); mutex_destroy(&gca230718_privateData->lock); gca230718_init_private_led_data(gca230718_privateData); -#if LINUX_VERSION_CODE < KERNEL_VERSION(5,18,0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0) return 0; #endif } From e2b80013ed78fef11ff5f2e1347fb9fe250f5231 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 6 Oct 2024 16:53:39 -0700 Subject: [PATCH 140/149] kernel: leds-gca230718: remove old kernel compat Not needed as all the older kernels are gone. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16869 Signed-off-by: Hauke Mehrtens --- package/kernel/leds-gca230718/src/leds-gca230718.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/package/kernel/leds-gca230718/src/leds-gca230718.c b/package/kernel/leds-gca230718/src/leds-gca230718.c index 71c8b983b58..9069fc90f7b 100644 --- a/package/kernel/leds-gca230718/src/leds-gca230718.c +++ b/package/kernel/leds-gca230718/src/leds-gca230718.c @@ -114,12 +114,7 @@ static int gca230718_set_brightness(struct led_classdev *led_cdev, return 0; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) static int gca230718_probe(struct i2c_client *client) -#else -static int gca230718_probe(struct i2c_client *client, - const struct i2c_device_id *id) -#endif { int status = 0; struct gca230718_private *gca230718_privateData; @@ -195,20 +190,12 @@ static int gca230718_probe(struct i2c_client *client, return status; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) static void gca230718_remove(struct i2c_client *client) -#else -static int gca230718_remove(struct i2c_client *client) -#endif { struct gca230718_private *gca230718_privateData; gca230718_privateData = i2c_get_clientdata(client); mutex_destroy(&gca230718_privateData->lock); gca230718_init_private_led_data(gca230718_privateData); - -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0) - return 0; -#endif } static const struct i2c_device_id gca230718_i2c_ids[] = { From 980fe907116e4a15737ca3895979b59c10aff791 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 6 Oct 2024 16:56:25 -0700 Subject: [PATCH 141/149] kernel: leds-gca230718: remove status variable I have no idea why this is even here. Simplifies the code with direct returns. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16869 Signed-off-by: Hauke Mehrtens --- .../leds-gca230718/src/leds-gca230718.c | 115 ++++++++---------- 1 file changed, 53 insertions(+), 62 deletions(-) diff --git a/package/kernel/leds-gca230718/src/leds-gca230718.c b/package/kernel/leds-gca230718/src/leds-gca230718.c index 9069fc90f7b..98cc732c345 100644 --- a/package/kernel/leds-gca230718/src/leds-gca230718.c +++ b/package/kernel/leds-gca230718/src/leds-gca230718.c @@ -116,78 +116,69 @@ static int gca230718_set_brightness(struct led_classdev *led_cdev, static int gca230718_probe(struct i2c_client *client) { - int status = 0; struct gca230718_private *gca230718_privateData; pr_info("Enter gca230718_probe for device address %u\n", client->addr); gca230718_privateData = devm_kzalloc( - &(client->dev), sizeof(struct gca230718_private), GFP_KERNEL); + &client->dev, sizeof(struct gca230718_private), GFP_KERNEL); - if (gca230718_privateData == NULL) { + if (!gca230718_privateData) { pr_info("Error during allocating memory for private data\n"); - status = -ENOMEM; - } else { - struct device_node *ledNode; - mutex_init(&gca230718_privateData->lock); - gca230718_init_private_led_data(gca230718_privateData); - i2c_set_clientdata(client, gca230718_privateData); - - for_each_child_of_node(client->dev.of_node, ledNode) { - u32 regValue = 0; - if (of_property_read_u32(ledNode, "reg", ®Value) != - 0) { - pr_info("Missing entry \"reg\" in node %s\n", - ledNode->name); - } else if (regValue >= GCA230718_MAX_LEDS) { - pr_info("Invalid entry \"reg\" in node %s (%u)\n", - ledNode->name, regValue); - } else { - struct led_classdev *ledClassDev = - &(gca230718_privateData->leds[regValue] - .ledClassDev); - struct led_init_data init_data = {}; - - gca230718_privateData->leds[regValue].client = - client; - init_data.fwnode = of_fwnode_handle(ledNode); - - pr_info("Creating LED for node %s: reg=%u\n", - ledNode->name, regValue); - - ledClassDev->name = - of_get_property(ledNode, "label", NULL); - if (ledClassDev->name == NULL) { - ledClassDev->name = ledNode->name; - } - - ledClassDev->brightness = LED_OFF; - ledClassDev->max_brightness = LED_FULL; - ledClassDev->brightness_set_blocking = - gca230718_set_brightness; - - if (devm_led_classdev_register_ext( - &(client->dev), ledClassDev, - &init_data) != 0) { - pr_info("Error during call of devm_led_classdev_register_ext"); - } - } + return -ENOMEM; + } + struct device_node *ledNode; + mutex_init(&gca230718_privateData->lock); + gca230718_init_private_led_data(gca230718_privateData); + i2c_set_clientdata(client, gca230718_privateData); + + for_each_child_of_node(client->dev.of_node, ledNode) { + u32 regValue = 0; + if (of_property_read_u32(ledNode, "reg", ®Value)) + pr_info("Missing entry \"reg\" in node %s\n", + ledNode->name); + else if (regValue >= GCA230718_MAX_LEDS) + pr_info("Invalid entry \"reg\" in node %s (%u)\n", + ledNode->name, regValue); + else { + struct led_classdev *ledClassDev = + &(gca230718_privateData->leds[regValue] + .ledClassDev); + struct led_init_data init_data = {}; + + gca230718_privateData->leds[regValue].client = client; + init_data.fwnode = of_fwnode_handle(ledNode); + + pr_info("Creating LED for node %s: reg=%u\n", + ledNode->name, regValue); + + ledClassDev->name = + of_get_property(ledNode, "label", NULL); + if (!ledClassDev->name) + ledClassDev->name = ledNode->name; + + ledClassDev->brightness = LED_OFF; + ledClassDev->max_brightness = LED_FULL; + ledClassDev->brightness_set_blocking = + gca230718_set_brightness; + + if (devm_led_classdev_register_ext( + &client->dev, ledClassDev, &init_data)) + pr_info("Error during call of devm_led_classdev_register_ext"); } } - if (status == 0) { - /* - Send full initialization sequence. - Afterwards only GCA230718_2ND_SEQUENCE_BYTE_1 must be send to upddate the brightness values. - */ - gca230718_send_sequence(client, GCA230718_1ST_SEQUENCE_BYTE_1, - gca230718_privateData); - gca230718_send_sequence(client, GCA230718_2ND_SEQUENCE_BYTE_1, - gca230718_privateData); - gca230718_send_sequence(client, GCA230718_3RD_SEQUENCE_BYTE_1, - gca230718_privateData); - } + /* + Send full initialization sequence. + Afterwards only GCA230718_2ND_SEQUENCE_BYTE_1 must be send to upddate the brightness values. + */ + gca230718_send_sequence(client, GCA230718_1ST_SEQUENCE_BYTE_1, + gca230718_privateData); + gca230718_send_sequence(client, GCA230718_2ND_SEQUENCE_BYTE_1, + gca230718_privateData); + gca230718_send_sequence(client, GCA230718_3RD_SEQUENCE_BYTE_1, + gca230718_privateData); - return status; + return 0; } static void gca230718_remove(struct i2c_client *client) From 8a1c48301f4b37b5d00d1d825be841063aa39b5b Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 6 Oct 2024 17:02:27 -0700 Subject: [PATCH 142/149] kernel: leds-gca230718: use shorter priv variable Shorter and more consistent with other drivers. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16869 Signed-off-by: Hauke Mehrtens --- .../leds-gca230718/src/leds-gca230718.c | 60 ++++++++----------- 1 file changed, 26 insertions(+), 34 deletions(-) diff --git a/package/kernel/leds-gca230718/src/leds-gca230718.c b/package/kernel/leds-gca230718/src/leds-gca230718.c index 98cc732c345..7467e35ac6f 100644 --- a/package/kernel/leds-gca230718/src/leds-gca230718.c +++ b/package/kernel/leds-gca230718/src/leds-gca230718.c @@ -47,9 +47,8 @@ static void gca230718_init_private_led_data(struct gca230718_private *data) } } -static void -gca230718_send_sequence(struct i2c_client *client, u8 byte0, - struct gca230718_private *gca230718_privateData) +static void gca230718_send_sequence(struct i2c_client *client, u8 byte0, + struct gca230718_private *priv) { int status = 0; u8 ledIndex; @@ -69,13 +68,11 @@ gca230718_send_sequence(struct i2c_client *client, u8 byte0, controlCommand[12] = 0x87; for (ledIndex = 0; ledIndex < GCA230718_MAX_LEDS; ledIndex++) { - controlCommand[3 + ledIndex] = - gca230718_privateData->leds[ledIndex].brightness; - controlCommand[8 + ledIndex] = - gca230718_privateData->leds[ledIndex].brightness; + controlCommand[3 + ledIndex] = priv->leds[ledIndex].brightness; + controlCommand[8 + ledIndex] = priv->leds[ledIndex].brightness; } - mutex_lock(&(gca230718_privateData->lock)); + mutex_lock(&(priv->lock)); if ((status = i2c_smbus_write_i2c_block_data( client, resetCommandRegister, sizeof(resetCommand), @@ -89,7 +86,7 @@ gca230718_send_sequence(struct i2c_client *client, u8 byte0, status); } - mutex_unlock(&(gca230718_privateData->lock)); + mutex_unlock(&(priv->lock)); } static int gca230718_set_brightness(struct led_classdev *led_cdev, @@ -101,14 +98,14 @@ static int gca230718_set_brightness(struct led_classdev *led_cdev, led = container_of(led_cdev, struct gca230718_led, ledClassDev); client = led->client; - if (client != NULL) { - struct gca230718_private *gca230718_privateData; + if (client) { + struct gca230718_private *priv; led->brightness = value; - gca230718_privateData = i2c_get_clientdata(client); + priv = i2c_get_clientdata(client); gca230718_send_sequence(client, GCA230718_2ND_SEQUENCE_BYTE_1, - gca230718_privateData); + priv); } return 0; @@ -116,20 +113,19 @@ static int gca230718_set_brightness(struct led_classdev *led_cdev, static int gca230718_probe(struct i2c_client *client) { - struct gca230718_private *gca230718_privateData; + struct gca230718_private *priv; pr_info("Enter gca230718_probe for device address %u\n", client->addr); - gca230718_privateData = devm_kzalloc( - &client->dev, sizeof(struct gca230718_private), GFP_KERNEL); - - if (!gca230718_privateData) { + priv = devm_kzalloc(&client->dev, sizeof(struct gca230718_private), + GFP_KERNEL); + if (!priv) { pr_info("Error during allocating memory for private data\n"); return -ENOMEM; } struct device_node *ledNode; - mutex_init(&gca230718_privateData->lock); - gca230718_init_private_led_data(gca230718_privateData); - i2c_set_clientdata(client, gca230718_privateData); + mutex_init(&priv->lock); + gca230718_init_private_led_data(priv); + i2c_set_clientdata(client, priv); for_each_child_of_node(client->dev.of_node, ledNode) { u32 regValue = 0; @@ -141,11 +137,10 @@ static int gca230718_probe(struct i2c_client *client) ledNode->name, regValue); else { struct led_classdev *ledClassDev = - &(gca230718_privateData->leds[regValue] - .ledClassDev); + &(priv->leds[regValue].ledClassDev); struct led_init_data init_data = {}; - gca230718_privateData->leds[regValue].client = client; + priv->leds[regValue].client = client; init_data.fwnode = of_fwnode_handle(ledNode); pr_info("Creating LED for node %s: reg=%u\n", @@ -171,22 +166,19 @@ static int gca230718_probe(struct i2c_client *client) Send full initialization sequence. Afterwards only GCA230718_2ND_SEQUENCE_BYTE_1 must be send to upddate the brightness values. */ - gca230718_send_sequence(client, GCA230718_1ST_SEQUENCE_BYTE_1, - gca230718_privateData); - gca230718_send_sequence(client, GCA230718_2ND_SEQUENCE_BYTE_1, - gca230718_privateData); - gca230718_send_sequence(client, GCA230718_3RD_SEQUENCE_BYTE_1, - gca230718_privateData); + gca230718_send_sequence(client, GCA230718_1ST_SEQUENCE_BYTE_1, priv); + gca230718_send_sequence(client, GCA230718_2ND_SEQUENCE_BYTE_1, priv); + gca230718_send_sequence(client, GCA230718_3RD_SEQUENCE_BYTE_1, priv); return 0; } static void gca230718_remove(struct i2c_client *client) { - struct gca230718_private *gca230718_privateData; - gca230718_privateData = i2c_get_clientdata(client); - mutex_destroy(&gca230718_privateData->lock); - gca230718_init_private_led_data(gca230718_privateData); + struct gca230718_private *priv; + priv = i2c_get_clientdata(client); + mutex_destroy(&priv->lock); + gca230718_init_private_led_data(priv); } static const struct i2c_device_id gca230718_i2c_ids[] = { From 4c8bb0a20f8a42b598941fec8b02db6599e3c325 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 6 Oct 2024 17:08:24 -0700 Subject: [PATCH 143/149] kernel: leds-gca230718: remove _remove Not needed. Everything can be replaced with devm. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/16869 Signed-off-by: Hauke Mehrtens --- .../leds-gca230718/src/leds-gca230718.c | 27 +++++-------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/package/kernel/leds-gca230718/src/leds-gca230718.c b/package/kernel/leds-gca230718/src/leds-gca230718.c index 7467e35ac6f..4cfa2052033 100644 --- a/package/kernel/leds-gca230718/src/leds-gca230718.c +++ b/package/kernel/leds-gca230718/src/leds-gca230718.c @@ -39,14 +39,6 @@ struct gca230718_private { struct gca230718_led leds[GCA230718_MAX_LEDS]; }; -static void gca230718_init_private_led_data(struct gca230718_private *data) -{ - u8 ledIndex; - for (ledIndex = 0; ledIndex < GCA230718_MAX_LEDS; ledIndex++) { - data->leds[ledIndex].client = NULL; - } -} - static void gca230718_send_sequence(struct i2c_client *client, u8 byte0, struct gca230718_private *priv) { @@ -114,6 +106,7 @@ static int gca230718_set_brightness(struct led_classdev *led_cdev, static int gca230718_probe(struct i2c_client *client) { struct gca230718_private *priv; + int err; pr_info("Enter gca230718_probe for device address %u\n", client->addr); priv = devm_kzalloc(&client->dev, sizeof(struct gca230718_private), @@ -122,11 +115,14 @@ static int gca230718_probe(struct i2c_client *client) pr_info("Error during allocating memory for private data\n"); return -ENOMEM; } - struct device_node *ledNode; - mutex_init(&priv->lock); - gca230718_init_private_led_data(priv); + + err = devm_mutex_init(&client->dev, &priv->lock); + if (err) + return err; + i2c_set_clientdata(client, priv); + struct device_node *ledNode; for_each_child_of_node(client->dev.of_node, ledNode) { u32 regValue = 0; if (of_property_read_u32(ledNode, "reg", ®Value)) @@ -173,14 +169,6 @@ static int gca230718_probe(struct i2c_client *client) return 0; } -static void gca230718_remove(struct i2c_client *client) -{ - struct gca230718_private *priv; - priv = i2c_get_clientdata(client); - mutex_destroy(&priv->lock); - gca230718_init_private_led_data(priv); -} - static const struct i2c_device_id gca230718_i2c_ids[] = { { "gca230718", 0 }, {}, @@ -195,7 +183,6 @@ MODULE_DEVICE_TABLE(of, gca230718_dt_ids); static struct i2c_driver gca230718_driver = { .probe = gca230718_probe, - .remove = gca230718_remove, .id_table = gca230718_i2c_ids, .driver = { .name = KBUILD_MODNAME, From a25809a474defedbd8f05d628d2c8525d79d549d Mon Sep 17 00:00:00 2001 From: Sander Vanheule Date: Tue, 24 Dec 2024 09:56:11 +0100 Subject: [PATCH 144/149] realtek: generate compat_version 2.0 for GS1900 The GS1900 images have been updated to have a larger firmware partition, bumping the compatibility version to 2.0. However, since this version is generated on first boot and the default was used, these images still advertised 1.0 after a fresh install. Add a new uci-defaults script that will generate the correct version for all affected Zyxel GS1900 devices. Fixes: 35acdbe9095d ("realtek: merge Zyxel GS1900 firmware partitions") Signed-off-by: Sander Vanheule --- .../base-files/etc/board.d/05_compat-version | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 target/linux/realtek/base-files/etc/board.d/05_compat-version diff --git a/target/linux/realtek/base-files/etc/board.d/05_compat-version b/target/linux/realtek/base-files/etc/board.d/05_compat-version new file mode 100644 index 00000000000..5c4ecb9aae3 --- /dev/null +++ b/target/linux/realtek/base-files/etc/board.d/05_compat-version @@ -0,0 +1,28 @@ +# +# Copyright (C) 2020 OpenWrt.org +# + +. /lib/functions.sh +. /lib/functions/uci-defaults.sh + +board_config_update + +case "$(board_name)" in + zyxel,gs1900-8 | \ + zyxel,gs1900-8hp-v1 | \ + zyxel,gs1900-8hp-v2 | \ + zyxel,gs1900-10hp | \ + zyxel,gs1900-16 | \ + zyxel,gs1900-24e | \ + zyxel,gs1900-24ep | \ + zyxel,gs1900-24hp-v1 | \ + zyxel,gs1900-24hp-v2 | \ + zyxel,gs1900-24-v1 | \ + zyxel,gs1900-48) + ucidef_set_compat_version "2.0" + ;; +esac + +board_config_flush + +exit 0 From d1e9c50d06a8cb618cb85ab489cbcccaec220636 Mon Sep 17 00:00:00 2001 From: Kyle Hendry Date: Sat, 16 Nov 2024 18:16:31 -0800 Subject: [PATCH 145/149] bmips: dts: fix pinctrl error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The kernel logs the error "bcm6368_nand 10000200.nand: there is not valid maps for state default" on boot and all nand pins show as UNCLAIMED in sysfs pinmux-pins. bcm6362.dtsi, bcm6368.dtsi and bcm63268.dtsi use the undocumented property group which the driver doesn't understand. This has been documented upstream in commit caf963efd4b0b9ff42ca12e52b8efe277264d35b. Replacing group with pins allows the nand pins to be properly configured. Signed-off-by: Kyle Hendry [add bcm636/bcm6368 and fix commit title] Signed-off-by: Álvaro Fernández Rojas --- target/linux/bmips/dts/bcm63268.dtsi | 16 ++++++++-------- target/linux/bmips/dts/bcm6362.dtsi | 2 +- target/linux/bmips/dts/bcm6368.dtsi | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/target/linux/bmips/dts/bcm63268.dtsi b/target/linux/bmips/dts/bcm63268.dtsi index d1aed29018e..5a8cb7193f9 100644 --- a/target/linux/bmips/dts/bcm63268.dtsi +++ b/target/linux/bmips/dts/bcm63268.dtsi @@ -245,7 +245,7 @@ pinctrl_nand: nand-pins { function = "nand"; - group = "nand_grp"; + pins = "nand_grp"; }; pinctrl_gpio35_alt: gpio35_alt-pins { @@ -255,37 +255,37 @@ pinctrl_dectpd: dectpd-pins { function = "dectpd"; - group = "dectpd_grp"; + pins = "dectpd_grp"; }; pinctrl_vdsl_phy_override_0: vdsl_phy_override_0-pins { function = "vdsl_phy_override_0"; - group = "vdsl_phy_override_0_grp"; + pins = "vdsl_phy_override_0_grp"; }; pinctrl_vdsl_phy_override_1: vdsl_phy_override_1-pins { function = "vdsl_phy_override_1"; - group = "vdsl_phy_override_1_grp"; + pins = "vdsl_phy_override_1_grp"; }; pinctrl_vdsl_phy_override_2: vdsl_phy_override_2-pins { function = "vdsl_phy_override_2"; - group = "vdsl_phy_override_2_grp"; + pins = "vdsl_phy_override_2_grp"; }; pinctrl_vdsl_phy_override_3: vdsl_phy_override_3-pins { function = "vdsl_phy_override_3"; - group = "vdsl_phy_override_3_grp"; + pins = "vdsl_phy_override_3_grp"; }; pinctrl_dsl_gpio8: dsl_gpio8-pins { function = "dsl_gpio8"; - group = "dsl_gpio8"; + pins = "dsl_gpio8"; }; pinctrl_dsl_gpio9: dsl_gpio9-pins { function = "dsl_gpio9"; - group = "dsl_gpio9"; + pins = "dsl_gpio9"; }; }; }; diff --git a/target/linux/bmips/dts/bcm6362.dtsi b/target/linux/bmips/dts/bcm6362.dtsi index 1089d89350b..5722f6e30c2 100644 --- a/target/linux/bmips/dts/bcm6362.dtsi +++ b/target/linux/bmips/dts/bcm6362.dtsi @@ -320,7 +320,7 @@ pinctrl_nand: nand-pins { function = "nand"; - group = "nand_grp"; + pins = "nand_grp"; }; }; }; diff --git a/target/linux/bmips/dts/bcm6368.dtsi b/target/linux/bmips/dts/bcm6368.dtsi index e50f7a1b0c6..a855ab340ac 100644 --- a/target/linux/bmips/dts/bcm6368.dtsi +++ b/target/linux/bmips/dts/bcm6368.dtsi @@ -334,7 +334,7 @@ pinctrl_uart1: uart1-pins { function = "uart1"; - group = "uart1_grp"; + pins = "uart1_grp"; }; }; }; From d275bcc4bb837240f174a0fe568d00c6a0a282f7 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 25 Dec 2024 23:59:46 +0100 Subject: [PATCH 146/149] yafut: Mark as nonshared This package is depending on @NAND_SUPPORT which is only set for some targets. Mark it nonshared to build it in the target build process. Fixes: https://github.com/openwrt/openwrt/issues/14714 Link: https://github.com/openwrt/openwrt/pull/17379 Signed-off-by: Hauke Mehrtens --- package/utils/yafut/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/package/utils/yafut/Makefile b/package/utils/yafut/Makefile index 1e2ec7bc024..e3f240f7545 100644 --- a/package/utils/yafut/Makefile +++ b/package/utils/yafut/Makefile @@ -11,6 +11,7 @@ PKG_SOURCE_VERSION:=38439f8a53d33b14744bc8f938662670b9d3e361 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=LICENSE +PKG_FLAGS:=nonshared include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk From df222e57be467eb85e77f4f569e169d471c8ba54 Mon Sep 17 00:00:00 2001 From: Joan Moreau Date: Sat, 28 Sep 2024 13:53:02 +0000 Subject: [PATCH 147/149] ath79: add support for KuWfi CPE830(D) / YunCore CPE830(D) Short specification: * 650/600/216 MHz (CPU/DDR/AHB) * 2x 10/100 Mbps Ethernet, passive PoE support * 64 MB of RAM (DDR2) * 16 MB of FLASH * 2T2R 2.4 GHz with external PA, up to 30 dBm (1000mW) * 2x internal 14 dBi antennas * 8x LED, 1x button * No UART on PCB on some versions * Display panel with 2x buttons (F/N) not supported (and not relevant in OpenWrt)- Flash instructions * Connect PC with 192.168.0.141 to WAN port * Install a TFTP server on your PC ('atftp' is doing the job for instance) * Copy your firmware in the TFTP folder as upgrade.bin * Power up device pushing the 'reset' button * The device shall upload upgrade.bin, install it and reboot * Device shall be booting on 192.168.1.1 as default Signed-off-by: Joan Moreau Link: https://github.com/openwrt/openwrt/pull/17279 Signed-off-by: Hauke Mehrtens --- .../ath79/dts/qca9533_yuncore_cpe830.dts | 153 ++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 7 + target/linux/ath79/image/generic.mk | 13 ++ 3 files changed, 173 insertions(+) create mode 100644 target/linux/ath79/dts/qca9533_yuncore_cpe830.dts diff --git a/target/linux/ath79/dts/qca9533_yuncore_cpe830.dts b/target/linux/ath79/dts/qca9533_yuncore_cpe830.dts new file mode 100644 index 00000000000..31b0f2c6105 --- /dev/null +++ b/target/linux/ath79/dts/qca9533_yuncore_cpe830.dts @@ -0,0 +1,153 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca953x.dtsi" + +#include +#include +#include + +/ { + compatible = "yuncore,cpe830", "qca,qca9533"; + model = "YunCore/KuWfi CPE830(D)"; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + }; + + aliases { + label-mac-device = &wmac; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + function = LED_FUNCTION_POWER; + color = ; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + wlan { + function = LED_FUNCTION_WLAN; + color = ; + gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + link1 { + label = "green:signal0"; + color = ; + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + }; + + link2 { + label = "green:signal1"; + color = ; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; + + link3 { + label = "green:signal2"; + color = ; + gpios = <&gpio 3 GPIO_ACTIVE_LOW>; + }; + + link4 { + label = "green:signal3"; + color = ; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x050000 0xfa0000>; + }; + + partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 0x6>; + }; + + macaddr_art_6: macaddr@6 { + reg = <0x6 0x6>; + }; + + cal_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_wmac: macaddr@1002 { + reg = <0x1002 0x6>; + }; + }; + }; + }; + }; +}; + +ð0 { + status = "okay"; + phy-handle = <&swphy4>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + status = "okay"; + nvmem-cells = <&macaddr_art_6>; + nvmem-cell-names = "mac-address"; +}; + +&wmac { + status = "okay"; + nvmem-cells = <&cal_art_1000>; + nvmem-cell-names = "calibration"; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index 6409adb78ad..b9142c8a079 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -545,6 +545,13 @@ yuncore,a770) ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1" ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x10" ;; +yuncore,cpe830) + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "wifi_low" "WIFILOW" "green:signal0" "wlan0" "1" "100" + ucidef_set_led_rssi "wifi_mediumlow" "WIFIMEDIUMLOW" "green:signal1" "wlan0" "26" "100" + ucidef_set_led_rssi "wifi_mediumhigh" "WIFIMEDIUMHIGH" "green:signal2" "wlan0" "51" "100" + ucidef_set_led_rssi "wifi_high" "WIFIHIGH" "green:signal3" "wlan0" "76" "100" + ;; zbtlink,zbt-wd323) ucidef_set_led_switch "lan1" "LAN1" "orange:lan1" "switch0" "0x10" ucidef_set_led_switch "lan2" "LAN2" "orange:lan2" "switch0" "0x08" diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 846a9acd200..74ef0d2da08 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -3319,6 +3319,19 @@ define Device/yuncore_xd3200 endef TARGET_DEVICES += yuncore_xd3200 +define Device/yuncore_cpe830 + SOC := qca9533 + DEVICE_VENDOR := YunCore + DEVICE_MODEL := CPE830(D) + DEVICE_ALT0_VENDOR = KuWfi + DEVICE_ALT0_MODEL = CPE830(D) + IMAGE_SIZE := 16000k + IMAGES += tftp.bin + IMAGE/tftp.bin := $$(IMAGE/sysupgrade.bin) | yuncore-tftp-header-16m + DEVICE_PACKAGES := rssileds -swconfig +endef +TARGET_DEVICES += yuncore_cpe830 + define Device/yuncore_xd4200 SOC := qca9563 DEVICE_VENDOR := YunCore From de0c143742517d401c4730137f092be8fb7e882a Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Wed, 25 Dec 2024 20:33:23 +0800 Subject: [PATCH 148/149] ramips: mt762{0,8}: reduce default MMC clock to 24 MHz The upstream mtk-sd driver did not perform specific timing optimization for MT762x series SoC, hence the SDHC peripheral of some boards cannot run at too high frequency. Reduce the maximum clock frequency to fix the mmc read/write error. Closes: https://github.com/openwrt/openwrt/issues/17364 Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/17375 Signed-off-by: Hauke Mehrtens --- target/linux/ramips/dts/mt7620a.dtsi | 2 +- target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts | 4 ---- target/linux/ramips/dts/mt7628an.dtsi | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/target/linux/ramips/dts/mt7620a.dtsi b/target/linux/ramips/dts/mt7620a.dtsi index 93b4286193a..0555674802c 100644 --- a/target/linux/ramips/dts/mt7620a.dtsi +++ b/target/linux/ramips/dts/mt7620a.dtsi @@ -540,7 +540,7 @@ interrupt-parent = <&intc>; interrupts = <14>; - max-frequency = <48000000>; + max-frequency = <24000000>; pinctrl-names = "default", "state_uhs"; pinctrl-0 = <&sdhci_pins>; diff --git a/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts b/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts index 29aff9958a8..2cb7017972e 100644 --- a/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts +++ b/target/linux/ramips/dts/mt7620a_hiwifi_hc5861.dts @@ -108,10 +108,6 @@ }; }; -&sdhci { - max-frequency = <24000000>; -}; - &wmac { pinctrl-names = "default", "pa_gpio"; pinctrl-0 = <&pa_pins>; diff --git a/target/linux/ramips/dts/mt7628an.dtsi b/target/linux/ramips/dts/mt7628an.dtsi index 239211b1e18..79763332b8b 100644 --- a/target/linux/ramips/dts/mt7628an.dtsi +++ b/target/linux/ramips/dts/mt7628an.dtsi @@ -394,7 +394,7 @@ interrupt-parent = <&intc>; interrupts = <14>; - max-frequency = <48000000>; + max-frequency = <24000000>; pinctrl-names = "default", "state_uhs"; pinctrl-0 = <&sdxc_pins>; From a85059438f2caed0d01a87fce9b8bd5bed134bb2 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 26 Dec 2024 09:41:22 +0100 Subject: [PATCH 149/149] mac80211: update to version 6.12.6 - drop patches accepted upstream - include build fixes in the tarball - based on https://github.com/nbd168/backports commit 410656ef04d2 Signed-off-by: Felix Fietkau --- package/kernel/mac80211/Makefile | 4 +- ...add_platform_eeprom_support_to_ath5k.patch | 6 +- ...-and-handle-country-code-for-WCN7850.patch | 56 +-- .../patches/ath5k/432-ath5k_add_pciids.patch | 11 - ...erpret-requested-txpower-in-EIRP-dom.patch | 4 +- ...power-reduction-for-US-regulatory-do.patch | 2 +- ...-in-driver-tables-with-country-codes.patch | 4 +- .../build/070-remove-broken-wext-select.patch | 10 - .../build/120-headers_version_fix.patch | 14 - .../patches/build/140-trace_backport.patch | 18 +- .../210-wireless_netns_local_backport.patch | 44 ++ ...=> 220-brcmfmac_usb_driver_backport.patch} | 0 ...-init_vqs-build-error-on-kernel-6.6.patch} | 0 ...t_allns-build-error-on-kernel-6.6.59.patch | 169 ------- ...700-mwl8k-missing-pci-id-for-WNR854T.patch | 2 +- ...crease-the-global-limit-up-to-4-SSID.patch | 2 +- ...940-mwl8k_init_devices_synchronously.patch | 4 +- ...ringified-name-of-command-in-error-l.patch | 10 +- ...-rtw88-Set-efuse-ext_lna_5g-fix-typo.patch | 30 -- ...upport-USB-3-with-RTL8822CU-RTL8822B.patch | 284 ----------- ...fs-support-multiple-adapters-debuggi.patch | 454 ------------------ ...-wifi-rtw88-select-WANT_DEV_COREDUMP.patch | 25 - ...-Parse-channel-from-IE-to-correct-in.patch | 151 ------ ...nit-RX-burst-length-according-to-USB.patch | 73 --- ...pdate-the-RX-stats-after-every-frame.patch | 31 -- ...ifi-rtw88-usb-Support-RX-aggregation.patch | 118 ----- ...e-USB-RX-aggregation-for-8822c-8822b.patch | 168 ------- ...n-mac_id-for-vif-sta-and-update-to-T.patch | 231 --------- ...-the-RX-descriptor-with-a-single-fun.patch | 2 +- ...Fix-the-RX-aggregation-in-USB-3-mode.patch | 70 --- ...e-data-rate-fallback-for-older-chips.patch | 4 +- ...et-pkt_info.ls-for-the-reserved-page.patch | 2 +- ...w88-usb-Support-USB-3-with-RTL8812AU.patch | 6 +- ...nable-RX-aggregation-for-8821au-8812.patch | 4 +- .../patches/subsys/130-disable_auto_vif.patch | 2 +- .../patches/subsys/220-allow-ibss-mixed.patch | 2 +- ...race-period-for-DFS-available-after-.patch | 6 +- ...dd-AQL-support-for-broadcast-packets.patch | 2 +- ...-not-pass-a-stopped-vif-to-the-drive.patch | 24 - ...1-add-option-for-vif-allowed-radios.patch} | 12 +- ...troduce-EHT-rate-support-in-AQL-airt.patch | 233 --------- ...eck-radio-iface-combination-for-mult.patch | 122 ----- ...-vif-radio-mask-to-limit-ibss-scan-.patch} | 8 +- ...et-correct-chandef-when-starting-CAC.patch | 64 --- ...-vif-radio-mask-to-limit-chanctx-an.patch} | 8 +- ...0211-move-radar-detect-work-to-sdata.patch | 136 ------ ...1-remove-status-ampdu_delimiter_crc.patch} | 0 ...-net_device-to-.set_monitor_channel.patch} | 2 +- ...move-label-usage-in-ieee80211_start_.patch | 50 -- ...-flag-to-opt-out-of-virtual-monitor.patch} | 24 +- ...k-rdev_end_cac-trace-event-from-wiph.patch | 42 -- ...i-cfg80211-add-monitor-SKIP_TX-flag.patch} | 0 ...ve-DFS-related-members-to-links-in-w.patch | 309 ------------ ...37-wifi-cfg80211-handle-DFS-per-link.patch | 435 ----------------- ...-support-for-the-monitor-SKIP_TX-fl.patch} | 2 +- ...38-wifi-mac80211-handle-DFS-per-link.patch | 134 ------ ...80211-refactor-ieee80211_rx_monitor.patch} | 0 ...-mac80211-use-proper-link-ID-for-DFS.patch | 168 ------- ...ter-on-monitor-interfaces-based-on-.patch} | 0 ...report-per-wiphy-radio-antenna-mask.patch} | 0 ...ndle-ieee80211_radar_detected-for-ML.patch | 360 -------------- ...-vif-addr-when-switching-from-monit.patch} | 0 ...ip-non-uploaded-keys-in-ieee80211_it.patch | 79 --- ...x-incorrect-timing-to-initialize-sta.patch | 32 -- ...ee80211_i-Fix-memory-corruption-bug-.patch | 53 -- ...ix-user-power-when-emulating-chanctx.patch | 24 - ...80211-Add-wiphy_delayed_work_pending.patch | 83 ---- ...nvert-color-collision-detection-to-w.patch | 148 ------ 68 files changed, 143 insertions(+), 4434 deletions(-) delete mode 100644 package/kernel/mac80211/patches/ath5k/432-ath5k_add_pciids.patch delete mode 100644 package/kernel/mac80211/patches/build/070-remove-broken-wext-select.patch delete mode 100644 package/kernel/mac80211/patches/build/120-headers_version_fix.patch create mode 100644 package/kernel/mac80211/patches/build/210-wireless_netns_local_backport.patch rename package/kernel/mac80211/patches/build/{230-brcmfmac_usb_driver_backport.patch => 220-brcmfmac_usb_driver_backport.patch} (100%) rename package/kernel/mac80211/patches/build/{235-fix-init_vqs-build-error-on-kernel-6.6.patch => 230-fix-init_vqs-build-error-on-kernel-6.6.patch} (100%) delete mode 100644 package/kernel/mac80211/patches/build/236-fix-genlmsg_multicast_allns-build-error-on-kernel-6.6.59.patch delete mode 100644 package/kernel/mac80211/patches/rtl/001-v6.12-wifi-rtw88-Set-efuse-ext_lna_5g-fix-typo.patch delete mode 100644 package/kernel/mac80211/patches/rtl/002-v6.12-wifi-rtw88-usb-Support-USB-3-with-RTL8822CU-RTL8822B.patch delete mode 100644 package/kernel/mac80211/patches/rtl/004-v6.12-wifi-rtw88-debugfs-support-multiple-adapters-debuggi.patch delete mode 100644 package/kernel/mac80211/patches/rtl/005-v6.12-wifi-rtw88-select-WANT_DEV_COREDUMP.patch delete mode 100644 package/kernel/mac80211/patches/rtl/008-v6.12-wifi-rtw88-8822c-Parse-channel-from-IE-to-correct-in.patch delete mode 100644 package/kernel/mac80211/patches/rtl/010-v6.12-wifi-rtw88-usb-Init-RX-burst-length-according-to-USB.patch delete mode 100644 package/kernel/mac80211/patches/rtl/011-v6.12-wifi-rtw88-usb-Update-the-RX-stats-after-every-frame.patch delete mode 100644 package/kernel/mac80211/patches/rtl/012-v6.12-wifi-rtw88-usb-Support-RX-aggregation.patch delete mode 100644 package/kernel/mac80211/patches/rtl/013-v6.12-wifi-rtw88-Enable-USB-RX-aggregation-for-8822c-8822b.patch delete mode 100644 package/kernel/mac80211/patches/rtl/016-v6.12-wifi-rtw88-assign-mac_id-for-vif-sta-and-update-to-T.patch delete mode 100644 package/kernel/mac80211/patches/rtl/020-v6.12-wifi-rtw88-Fix-the-RX-aggregation-in-USB-3-mode.patch delete mode 100644 package/kernel/mac80211/patches/subsys/321-wifi-mac80211-do-not-pass-a-stopped-vif-to-the-drive.patch rename package/kernel/mac80211/patches/subsys/{350-wifi-cfg80211-add-option-for-vif-allowed-radios.patch => 330-wifi-cfg80211-add-option-for-vif-allowed-radios.patch} (96%) delete mode 100644 package/kernel/mac80211/patches/subsys/330-wifi-mac80211-introduce-EHT-rate-support-in-AQL-airt.patch delete mode 100644 package/kernel/mac80211/patches/subsys/331-wifi-cfg80211-check-radio-iface-combination-for-mult.patch rename package/kernel/mac80211/patches/subsys/{351-wifi-mac80211-use-vif-radio-mask-to-limit-ibss-scan-.patch => 331-wifi-mac80211-use-vif-radio-mask-to-limit-ibss-scan-.patch} (88%) delete mode 100644 package/kernel/mac80211/patches/subsys/332-wifi-cfg80211-Set-correct-chandef-when-starting-CAC.patch rename package/kernel/mac80211/patches/subsys/{352-wifi-mac80211-use-vif-radio-mask-to-limit-chanctx-an.patch => 332-wifi-mac80211-use-vif-radio-mask-to-limit-chanctx-an.patch} (86%) delete mode 100644 package/kernel/mac80211/patches/subsys/333-Revert-wifi-mac80211-move-radar-detect-work-to-sdata.patch rename package/kernel/mac80211/patches/subsys/{353-wifi-mac80211-remove-status-ampdu_delimiter_crc.patch => 333-wifi-mac80211-remove-status-ampdu_delimiter_crc.patch} (100%) rename package/kernel/mac80211/patches/subsys/{354-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch => 334-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch} (98%) delete mode 100644 package/kernel/mac80211/patches/subsys/334-wifi-mac80211-remove-label-usage-in-ieee80211_start_.patch rename package/kernel/mac80211/patches/subsys/{355-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch => 335-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch} (93%) delete mode 100644 package/kernel/mac80211/patches/subsys/335-wifi-trace-unlink-rdev_end_cac-trace-event-from-wiph.patch rename package/kernel/mac80211/patches/subsys/{356-wifi-cfg80211-add-monitor-SKIP_TX-flag.patch => 336-wifi-cfg80211-add-monitor-SKIP_TX-flag.patch} (100%) delete mode 100644 package/kernel/mac80211/patches/subsys/336-wifi-cfg80211-move-DFS-related-members-to-links-in-w.patch delete mode 100644 package/kernel/mac80211/patches/subsys/337-wifi-cfg80211-handle-DFS-per-link.patch rename package/kernel/mac80211/patches/subsys/{357-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch => 337-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch} (97%) delete mode 100644 package/kernel/mac80211/patches/subsys/338-wifi-mac80211-handle-DFS-per-link.patch rename package/kernel/mac80211/patches/subsys/{358-wifi-mac80211-refactor-ieee80211_rx_monitor.patch => 338-wifi-mac80211-refactor-ieee80211_rx_monitor.patch} (100%) delete mode 100644 package/kernel/mac80211/patches/subsys/339-wifi-cfg80211-mac80211-use-proper-link-ID-for-DFS.patch rename package/kernel/mac80211/patches/subsys/{359-wifi-mac80211-filter-on-monitor-interfaces-based-on-.patch => 339-wifi-mac80211-filter-on-monitor-interfaces-based-on-.patch} (100%) rename package/kernel/mac80211/patches/subsys/{360-wifi-cfg80211-report-per-wiphy-radio-antenna-mask.patch => 340-wifi-cfg80211-report-per-wiphy-radio-antenna-mask.patch} (100%) delete mode 100644 package/kernel/mac80211/patches/subsys/340-wifi-mac80211-handle-ieee80211_radar_detected-for-ML.patch rename package/kernel/mac80211/patches/subsys/{361-wifi-mac80211-fix-vif-addr-when-switching-from-monit.patch => 341-wifi-mac80211-fix-vif-addr-when-switching-from-monit.patch} (100%) delete mode 100644 package/kernel/mac80211/patches/subsys/341-wifi-mac80211-skip-non-uploaded-keys-in-ieee80211_it.patch delete mode 100644 package/kernel/mac80211/patches/subsys/362-wifi-mac80211-fix-incorrect-timing-to-initialize-sta.patch delete mode 100644 package/kernel/mac80211/patches/subsys/363-wifi-mac80211-ieee80211_i-Fix-memory-corruption-bug-.patch delete mode 100644 package/kernel/mac80211/patches/subsys/364-mac80211-fix-user-power-when-emulating-chanctx.patch delete mode 100644 package/kernel/mac80211/patches/subsys/365-wifi-cfg80211-Add-wiphy_delayed_work_pending.patch delete mode 100644 package/kernel/mac80211/patches/subsys/366-wifi-mac80211-Convert-color-collision-detection-to-w.patch diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 1c848d1f57e..b0de3950b9e 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -10,13 +10,13 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=6.11.2 +PKG_VERSION:=6.12.6 PKG_RELEASE:=1 PKG_LICENSE:=GPL-2.0-only PKG_LICENSE_FILES:=COPYING PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/ -PKG_HASH:=700ea5abef8dde9e3c6df2acd32ff443da735d773d56db9a80269e2237549b34 +PKG_HASH:=28ec39425a1b3270e1422d92a8131a6a3d8919cc13e8ee250c315e55d922ba68 PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)backports-$(PKG_VERSION) diff --git a/package/kernel/mac80211/patches/ath/431-add_platform_eeprom_support_to_ath5k.patch b/package/kernel/mac80211/patches/ath/431-add_platform_eeprom_support_to_ath5k.patch index c762aa6d643..abadadf856c 100644 --- a/package/kernel/mac80211/patches/ath/431-add_platform_eeprom_support_to_ath5k.patch +++ b/package/kernel/mac80211/patches/ath/431-add_platform_eeprom_support_to_ath5k.patch @@ -8,7 +8,7 @@ #include "../ath.h" #include "ath5k.h" #include "debug.h" -@@ -71,7 +72,7 @@ static void ath5k_pci_read_cachesize(str +@@ -73,7 +74,7 @@ static void ath5k_pci_read_cachesize(str } /* @@ -17,7 +17,7 @@ */ static bool ath5k_pci_eeprom_read(struct ath_common *common, u32 offset, u16 *data) -@@ -79,6 +80,19 @@ ath5k_pci_eeprom_read(struct ath_common +@@ -81,6 +82,19 @@ ath5k_pci_eeprom_read(struct ath_common struct ath5k_hw *ah = common->ah; u32 status, timeout; @@ -37,7 +37,7 @@ /* * Initialize EEPROM access */ -@@ -122,6 +136,16 @@ static int ath5k_pci_eeprom_read_mac(str +@@ -124,6 +138,16 @@ static int ath5k_pci_eeprom_read_mac(str u16 data; int octet; diff --git a/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch b/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch index f368ccd2727..caa4e20f971 100644 --- a/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch +++ b/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch @@ -451,7 +451,7 @@ Acked-by: Jeff Johnson enum ath12k_dev_flags { ATH12K_CAC_RUNNING, ATH12K_FLAG_CRASH_FLUSH, -@@ -313,6 +319,8 @@ struct ath12k_vif_iter { +@@ -319,6 +325,8 @@ struct ath12k_vif_iter { #define ATH12K_RX_RATE_TABLE_11AX_NUM 576 #define ATH12K_RX_RATE_TABLE_NUM 320 @@ -460,7 +460,7 @@ Acked-by: Jeff Johnson struct ath12k_rx_peer_rate_stats { u64 ht_mcs_count[HAL_RX_MAX_MCS_HT + 1]; u64 vht_mcs_count[HAL_RX_MAX_MCS_VHT + 1]; -@@ -648,6 +656,13 @@ struct ath12k { +@@ -654,6 +662,13 @@ struct ath12k { u32 freq_low; u32 freq_high; @@ -474,7 +474,7 @@ Acked-by: Jeff Johnson bool nlo_enabled; }; -@@ -880,6 +895,8 @@ struct ath12k_base { +@@ -886,6 +901,8 @@ struct ath12k_base { /* continuous recovery fail count */ atomic_t fail_cont_count; unsigned long reset_fail_timeout; @@ -485,7 +485,7 @@ Acked-by: Jeff Johnson u32 fw_crash_counter; --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c -@@ -2946,6 +2946,11 @@ static void ath12k_bss_assoc(struct ath1 +@@ -2949,6 +2949,11 @@ static void ath12k_bss_assoc(struct ath1 if (ret) ath12k_warn(ar->ab, "failed to set vdev %i OBSS PD parameters: %d\n", arvif->vdev_id, ret); @@ -497,7 +497,7 @@ Acked-by: Jeff Johnson } static void ath12k_bss_disassoc(struct ath12k *ar, -@@ -3521,7 +3526,7 @@ void __ath12k_mac_scan_finish(struct ath +@@ -3524,7 +3529,7 @@ void __ath12k_mac_scan_finish(struct ath ar->scan_channel = NULL; ar->scan.roc_freq = 0; cancel_delayed_work(&ar->scan.timeout); @@ -506,9 +506,9 @@ Acked-by: Jeff Johnson break; } } -@@ -3782,7 +3787,12 @@ scan: +@@ -3790,7 +3795,12 @@ scan: - ret = ath12k_start_scan(ar, &arg); + ret = ath12k_start_scan(ar, arg); if (ret) { - ath12k_warn(ar->ab, "failed to start hw scan: %d\n", ret); + if (ret == -EBUSY) @@ -520,7 +520,7 @@ Acked-by: Jeff Johnson spin_lock_bh(&ar->data_lock); ar->scan.state = ATH12K_SCAN_IDLE; spin_unlock_bh(&ar->data_lock); -@@ -3801,6 +3811,11 @@ exit: +@@ -3810,6 +3820,11 @@ exit: mutex_unlock(&ar->conf_mutex); @@ -532,7 +532,7 @@ Acked-by: Jeff Johnson return ret; } -@@ -5985,7 +6000,7 @@ static int ath12k_mac_start(struct ath12 +@@ -5994,7 +6009,7 @@ static int ath12k_mac_start(struct ath12 /* TODO: Do we need to enable ANI? */ @@ -541,7 +541,7 @@ Acked-by: Jeff Johnson ar->num_started_vdevs = 0; ar->num_created_vdevs = 0; -@@ -6165,6 +6180,9 @@ static void ath12k_mac_stop(struct ath12 +@@ -6174,6 +6189,9 @@ static void ath12k_mac_stop(struct ath12 cancel_delayed_work_sync(&ar->scan.timeout); cancel_work_sync(&ar->regd_update_work); cancel_work_sync(&ar->ab->rfkill_work); @@ -551,7 +551,7 @@ Acked-by: Jeff Johnson spin_lock_bh(&ar->data_lock); list_for_each_entry_safe(ppdu_stats, tmp, &ar->ppdu_stats_info, list) { -@@ -6411,6 +6429,117 @@ static void ath12k_mac_op_update_vif_off +@@ -6420,6 +6438,117 @@ static void ath12k_mac_op_update_vif_off ath12k_mac_update_vif_offload(arvif); } @@ -669,7 +669,7 @@ Acked-by: Jeff Johnson static int ath12k_mac_vdev_create(struct ath12k *ar, struct ieee80211_vif *vif) { struct ath12k_hw *ah = ar->ah; -@@ -6525,6 +6654,7 @@ static int ath12k_mac_vdev_create(struct +@@ -6534,6 +6663,7 @@ static int ath12k_mac_vdev_create(struct arvif->vdev_id, ret); goto err_peer_del; } @@ -677,7 +677,7 @@ Acked-by: Jeff Johnson break; case WMI_VDEV_TYPE_STA: param_id = WMI_STA_PS_PARAM_RX_WAKE_POLICY; -@@ -6563,6 +6693,13 @@ static int ath12k_mac_vdev_create(struct +@@ -6572,6 +6702,13 @@ static int ath12k_mac_vdev_create(struct arvif->vdev_id, ret); goto err_peer_del; } @@ -691,7 +691,7 @@ Acked-by: Jeff Johnson break; default: break; -@@ -6903,6 +7040,11 @@ static void ath12k_mac_op_remove_interfa +@@ -6912,6 +7049,11 @@ static void ath12k_mac_op_remove_interfa ath12k_dbg(ab, ATH12K_DBG_MAC, "mac remove interface (vdev %d)\n", arvif->vdev_id); @@ -703,7 +703,7 @@ Acked-by: Jeff Johnson if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { ret = ath12k_peer_delete(ar, arvif->vdev_id, vif->addr); if (ret) -@@ -7743,6 +7885,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc +@@ -7752,6 +7894,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc ar->num_started_vdevs == 1 && ar->monitor_vdev_created) ath12k_mac_monitor_stop(ar); @@ -718,7 +718,7 @@ Acked-by: Jeff Johnson mutex_unlock(&ar->conf_mutex); } -@@ -8281,6 +8431,14 @@ ath12k_mac_op_reconfig_complete(struct i +@@ -8290,6 +8440,14 @@ ath12k_mac_op_reconfig_complete(struct i ath12k_warn(ar->ab, "pdev %d successfully recovered\n", ar->pdev->pdev_id); @@ -733,7 +733,7 @@ Acked-by: Jeff Johnson if (ab->is_reset) { recovery_count = atomic_inc_return(&ab->recovery_count); -@@ -9330,6 +9488,9 @@ static void ath12k_mac_setup(struct ath1 +@@ -9339,6 +9497,9 @@ static void ath12k_mac_setup(struct ath1 INIT_WORK(&ar->wmi_mgmt_tx_work, ath12k_mgmt_over_wmi_tx_work); skb_queue_head_init(&ar->wmi_mgmt_tx_queue); @@ -888,36 +888,36 @@ Acked-by: Jeff Johnson #endif --- a/drivers/net/wireless/ath/ath12k/hw.c +++ b/drivers/net/wireless/ath/ath12k/hw.c -@@ -926,6 +926,7 @@ static const struct ath12k_hw_params ath - .supports_dynamic_smps_6ghz = true, - +@@ -928,6 +928,7 @@ static const struct ath12k_hw_params ath .iova_mask = 0, + + .supports_aspm = false, + .current_cc_support = false, }, { .name = "wcn7850 hw2.0", -@@ -1004,6 +1005,7 @@ static const struct ath12k_hw_params ath - .supports_dynamic_smps_6ghz = false, - +@@ -1008,6 +1009,7 @@ static const struct ath12k_hw_params ath .iova_mask = ATH12K_PCIE_MAX_PAYLOAD_SIZE - 1, + + .supports_aspm = true, + .current_cc_support = true, }, { .name = "qcn9274 hw2.0", -@@ -1078,6 +1080,7 @@ static const struct ath12k_hw_params ath - .supports_dynamic_smps_6ghz = true, - +@@ -1084,6 +1086,7 @@ static const struct ath12k_hw_params ath .iova_mask = 0, + + .supports_aspm = false, + .current_cc_support = false, }, }; --- a/drivers/net/wireless/ath/ath12k/hw.h +++ b/drivers/net/wireless/ath/ath12k/hw.h -@@ -189,6 +189,7 @@ struct ath12k_hw_params { - bool tcl_ring_retry:1; +@@ -190,6 +190,7 @@ struct ath12k_hw_params { bool reoq_lut_support:1; bool supports_shadow_regs:1; + bool supports_aspm:1; + bool current_cc_support:1; u32 num_tcl_banks; diff --git a/package/kernel/mac80211/patches/ath5k/432-ath5k_add_pciids.patch b/package/kernel/mac80211/patches/ath5k/432-ath5k_add_pciids.patch deleted file mode 100644 index bd0e6707a55..00000000000 --- a/package/kernel/mac80211/patches/ath5k/432-ath5k_add_pciids.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/drivers/net/wireless/ath/ath5k/pci.c -+++ b/drivers/net/wireless/ath/ath5k/pci.c -@@ -47,6 +47,8 @@ static const struct pci_device_id ath5k_ - { PCI_VDEVICE(ATHEROS, 0x001b) }, /* 5413 Eagle */ - { PCI_VDEVICE(ATHEROS, 0x001c) }, /* PCI-E cards */ - { PCI_VDEVICE(ATHEROS, 0x001d) }, /* 2417 Nala */ -+ { PCI_VDEVICE(ATHEROS, 0xff16) }, /* 2413,2414 sx76x on lantiq_danube */ -+ { PCI_VDEVICE(ATHEROS, 0xff1a) }, /* 2417 arv45xx on lantiq_danube */ - { PCI_VDEVICE(ATHEROS, 0xff1b) }, /* AR5BXB63 */ - { 0 } - }; diff --git a/package/kernel/mac80211/patches/ath9k/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch b/package/kernel/mac80211/patches/ath9k/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch index 385eea0116d..9016da963b3 100644 --- a/package/kernel/mac80211/patches/ath9k/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch +++ b/package/kernel/mac80211/patches/ath9k/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch @@ -8,7 +8,7 @@ This reverts commit 71f5137bf010c6faffab50c0ec15374c59c4a411. --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -2977,7 +2977,8 @@ void ath9k_hw_apply_txpower(struct ath_h +@@ -2975,7 +2975,8 @@ void ath9k_hw_apply_txpower(struct ath_h { struct ath_regulatory *reg = ath9k_hw_regulatory(ah); struct ieee80211_channel *channel; @@ -18,7 +18,7 @@ This reverts commit 71f5137bf010c6faffab50c0ec15374c59c4a411. u16 ctl = NO_CTL; if (!chan) -@@ -2989,9 +2990,14 @@ void ath9k_hw_apply_txpower(struct ath_h +@@ -2987,9 +2988,14 @@ void ath9k_hw_apply_txpower(struct ath_h channel = chan->chan; chan_pwr = min_t(int, channel->max_power * 2, MAX_COMBINED_POWER); new_pwr = min_t(int, chan_pwr, reg->power_limit); diff --git a/package/kernel/mac80211/patches/ath9k/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch b/package/kernel/mac80211/patches/ath9k/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch index 0c3edc1260f..5e5f3e4f102 100644 --- a/package/kernel/mac80211/patches/ath9k/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch +++ b/package/kernel/mac80211/patches/ath9k/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -2996,6 +2996,10 @@ void ath9k_hw_apply_txpower(struct ath_h +@@ -2994,6 +2994,10 @@ void ath9k_hw_apply_txpower(struct ath_h if (ant_gain > max_gain) ant_reduction = ant_gain - max_gain; diff --git a/package/kernel/mac80211/patches/brcm/863-brcmfmac-add-in-driver-tables-with-country-codes.patch b/package/kernel/mac80211/patches/brcm/863-brcmfmac-add-in-driver-tables-with-country-codes.patch index 25f0d254c0d..1f0609e3488 100644 --- a/package/kernel/mac80211/patches/brcm/863-brcmfmac-add-in-driver-tables-with-country-codes.patch +++ b/package/kernel/mac80211/patches/brcm/863-brcmfmac-add-in-driver-tables-with-country-codes.patch @@ -49,9 +49,9 @@ Signed-off-by: Rafał Miłecki void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, struct brcmf_mp_device *settings) { -@@ -114,6 +144,8 @@ void brcmf_of_probe(struct device *dev, - of_node_put(root); +@@ -113,6 +143,8 @@ void brcmf_of_probe(struct device *dev, } + of_node_put(root); + brcmf_of_probe_cc(dev, settings); + diff --git a/package/kernel/mac80211/patches/build/070-remove-broken-wext-select.patch b/package/kernel/mac80211/patches/build/070-remove-broken-wext-select.patch deleted file mode 100644 index 121b7faad93..00000000000 --- a/package/kernel/mac80211/patches/build/070-remove-broken-wext-select.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- a/drivers/staging/rtl8723bs/Kconfig -+++ b/drivers/staging/rtl8723bs/Kconfig -@@ -5,7 +5,6 @@ config RTL8723BS - depends on m - depends on WLAN && MMC && CFG80211 - depends on m -- select CFG80211_WEXT - depends on CRYPTO - select BPAUTO_CRYPTO_LIB_ARC4 - help diff --git a/package/kernel/mac80211/patches/build/120-headers_version_fix.patch b/package/kernel/mac80211/patches/build/120-headers_version_fix.patch deleted file mode 100644 index 29f500a4d06..00000000000 --- a/package/kernel/mac80211/patches/build/120-headers_version_fix.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/backport-include/net/dropreason.h -+++ b/backport-include/net/dropreason.h -@@ -3,10 +3,9 @@ - - #include - -+#include - #if LINUX_VERSION_IS_GEQ(6,0,0) - #include_next --#else --#include - #endif - - #if LINUX_VERSION_IS_LESS(6,4,0) diff --git a/package/kernel/mac80211/patches/build/140-trace_backport.patch b/package/kernel/mac80211/patches/build/140-trace_backport.patch index 00ee47e1a46..8b77b7e83d9 100644 --- a/package/kernel/mac80211/patches/build/140-trace_backport.patch +++ b/package/kernel/mac80211/patches/build/140-trace_backport.patch @@ -1,6 +1,6 @@ --- a/drivers/bus/mhi/host/trace.h +++ b/drivers/bus/mhi/host/trace.h -@@ -103,7 +103,7 @@ TRACE_EVENT(mhi_gen_tre, +@@ -104,7 +104,7 @@ TRACE_EVENT(mhi_gen_tre, ), TP_fast_assign( @@ -8,8 +8,8 @@ + __assign_str(name, mhi_cntrl->mhi_dev->name); __entry->ch_num = mhi_chan->chan; __entry->wp = mhi_tre; - __entry->tre_ptr = mhi_tre->ptr; -@@ -131,7 +131,7 @@ TRACE_EVENT(mhi_intvec_states, + __entry->tre_ptr = le64_to_cpu(mhi_tre->ptr); +@@ -132,7 +132,7 @@ TRACE_EVENT(mhi_intvec_states, ), TP_fast_assign( @@ -18,7 +18,7 @@ __entry->local_ee = mhi_cntrl->ee; __entry->state = mhi_cntrl->dev_state; __entry->dev_ee = dev_ee; -@@ -158,7 +158,7 @@ TRACE_EVENT(mhi_tryset_pm_state, +@@ -159,7 +159,7 @@ TRACE_EVENT(mhi_tryset_pm_state, ), TP_fast_assign( @@ -27,16 +27,16 @@ if (pm_state) pm_state = __fls(pm_state); __entry->pm_state = pm_state; -@@ -184,7 +184,7 @@ DECLARE_EVENT_CLASS(mhi_process_event_ri +@@ -185,7 +185,7 @@ DECLARE_EVENT_CLASS(mhi_process_event_ri ), TP_fast_assign( - __assign_str(name); + __assign_str(name, mhi_cntrl->mhi_dev->name); __entry->rp = rp; - __entry->ptr = rp->ptr; - __entry->dword0 = rp->dword[0]; -@@ -226,7 +226,7 @@ DECLARE_EVENT_CLASS(mhi_update_channel_s + __entry->ptr = le64_to_cpu(rp->ptr); + __entry->dword0 = le32_to_cpu(rp->dword[0]); +@@ -227,7 +227,7 @@ DECLARE_EVENT_CLASS(mhi_update_channel_s ), TP_fast_assign( @@ -45,7 +45,7 @@ __entry->ch_num = mhi_chan->chan; __entry->state = state; __entry->reason = reason; -@@ -265,7 +265,7 @@ TRACE_EVENT(mhi_pm_st_transition, +@@ -266,7 +266,7 @@ TRACE_EVENT(mhi_pm_st_transition, ), TP_fast_assign( diff --git a/package/kernel/mac80211/patches/build/210-wireless_netns_local_backport.patch b/package/kernel/mac80211/patches/build/210-wireless_netns_local_backport.patch new file mode 100644 index 00000000000..9b0e95e8453 --- /dev/null +++ b/package/kernel/mac80211/patches/build/210-wireless_netns_local_backport.patch @@ -0,0 +1,44 @@ +--- a/net/wireless/core.c ++++ b/net/wireless/core.c +@@ -165,11 +165,15 @@ int cfg80211_switch_netns(struct cfg8021 + list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { + if (!wdev->netdev) + continue; ++#if LINUX_VERSION_IS_GEQ(6,12,0) + wdev->netdev->netns_local = false; ++#endif + err = dev_change_net_namespace(wdev->netdev, net, "wlan%d"); + if (err) + break; ++#if LINUX_VERSION_IS_GEQ(6,12,0) + wdev->netdev->netns_local = true; ++#endif + } + + if (err) { +@@ -181,11 +185,15 @@ int cfg80211_switch_netns(struct cfg8021 + list) { + if (!wdev->netdev) + continue; ++#if LINUX_VERSION_IS_GEQ(6,12,0) + wdev->netdev->netns_local = false; ++#endif + err = dev_change_net_namespace(wdev->netdev, net, + "wlan%d"); + WARN_ON(err); ++#if LINUX_VERSION_IS_GEQ(6,12,0) + wdev->netdev->netns_local = true; ++#endif + } + + return err; +@@ -1518,7 +1526,9 @@ static int cfg80211_netdev_notifier_call + SET_NETDEV_DEVTYPE(dev, &wiphy_type); + wdev->netdev = dev; + /* can only change netns with wiphy */ ++#if LINUX_VERSION_IS_GEQ(6,12,0) + dev->netns_local = true; ++#endif + + cfg80211_init_wdev(wdev); + break; diff --git a/package/kernel/mac80211/patches/build/230-brcmfmac_usb_driver_backport.patch b/package/kernel/mac80211/patches/build/220-brcmfmac_usb_driver_backport.patch similarity index 100% rename from package/kernel/mac80211/patches/build/230-brcmfmac_usb_driver_backport.patch rename to package/kernel/mac80211/patches/build/220-brcmfmac_usb_driver_backport.patch diff --git a/package/kernel/mac80211/patches/build/235-fix-init_vqs-build-error-on-kernel-6.6.patch b/package/kernel/mac80211/patches/build/230-fix-init_vqs-build-error-on-kernel-6.6.patch similarity index 100% rename from package/kernel/mac80211/patches/build/235-fix-init_vqs-build-error-on-kernel-6.6.patch rename to package/kernel/mac80211/patches/build/230-fix-init_vqs-build-error-on-kernel-6.6.patch diff --git a/package/kernel/mac80211/patches/build/236-fix-genlmsg_multicast_allns-build-error-on-kernel-6.6.59.patch b/package/kernel/mac80211/patches/build/236-fix-genlmsg_multicast_allns-build-error-on-kernel-6.6.59.patch deleted file mode 100644 index 905bf8dfc17..00000000000 --- a/package/kernel/mac80211/patches/build/236-fix-genlmsg_multicast_allns-build-error-on-kernel-6.6.59.patch +++ /dev/null @@ -1,169 +0,0 @@ -From e0f83d268974dab0361d11904dfc9acec53f96a6 Mon Sep 17 00:00:00 2001 -From: Eric Dumazet -Date: Fri, 11 Oct 2024 17:12:17 +0000 -Subject: [PATCH] genetlink: hold RCU in genlmsg_mcast() - -[ Upstream commit 56440d7ec28d60f8da3bfa09062b3368ff9b16db ] - -While running net selftests with CONFIG_PROVE_RCU_LIST=y I saw -one lockdep splat [1]. - -genlmsg_mcast() uses for_each_net_rcu(), and must therefore hold RCU. - -Instead of letting all callers guard genlmsg_multicast_allns() -with a rcu_read_lock()/rcu_read_unlock() pair, do it in genlmsg_mcast(). - -This also means the @flags parameter is useless, we need to always use -GFP_ATOMIC. - -[1] -[10882.424136] ============================= -[10882.424166] WARNING: suspicious RCU usage -[10882.424309] 6.12.0-rc2-virtme #1156 Not tainted -[10882.424400] ----------------------------- -[10882.424423] net/netlink/genetlink.c:1940 RCU-list traversed in non-reader section!! -[10882.424469] -other info that might help us debug this: - -[10882.424500] -rcu_scheduler_active = 2, debug_locks = 1 -[10882.424744] 2 locks held by ip/15677: -[10882.424791] #0: ffffffffb6b491b0 (cb_lock){++++}-{3:3}, at: genl_rcv (net/netlink/genetlink.c:1219) -[10882.426334] #1: ffffffffb6b49248 (genl_mutex){+.+.}-{3:3}, at: genl_rcv_msg (net/netlink/genetlink.c:61 net/netlink/genetlink.c:57 net/netlink/genetlink.c:1209) -[10882.426465] -stack backtrace: -[10882.426805] CPU: 14 UID: 0 PID: 15677 Comm: ip Not tainted 6.12.0-rc2-virtme #1156 -[10882.426919] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 -[10882.427046] Call Trace: -[10882.427131] -[10882.427244] dump_stack_lvl (lib/dump_stack.c:123) -[10882.427335] lockdep_rcu_suspicious (kernel/locking/lockdep.c:6822) -[10882.427387] genlmsg_multicast_allns (net/netlink/genetlink.c:1940 (discriminator 7) net/netlink/genetlink.c:1977 (discriminator 7)) -[10882.427436] l2tp_tunnel_notify.constprop.0 (net/l2tp/l2tp_netlink.c:119) l2tp_netlink -[10882.427683] l2tp_nl_cmd_tunnel_create (net/l2tp/l2tp_netlink.c:253) l2tp_netlink -[10882.427748] genl_family_rcv_msg_doit (net/netlink/genetlink.c:1115) -[10882.427834] genl_rcv_msg (net/netlink/genetlink.c:1195 net/netlink/genetlink.c:1210) -[10882.427877] ? __pfx_l2tp_nl_cmd_tunnel_create (net/l2tp/l2tp_netlink.c:186) l2tp_netlink -[10882.427927] ? __pfx_genl_rcv_msg (net/netlink/genetlink.c:1201) -[10882.427959] netlink_rcv_skb (net/netlink/af_netlink.c:2551) -[10882.428069] genl_rcv (net/netlink/genetlink.c:1220) -[10882.428095] netlink_unicast (net/netlink/af_netlink.c:1332 net/netlink/af_netlink.c:1357) -[10882.428140] netlink_sendmsg (net/netlink/af_netlink.c:1901) -[10882.428210] ____sys_sendmsg (net/socket.c:729 (discriminator 1) net/socket.c:744 (discriminator 1) net/socket.c:2607 (discriminator 1)) - -Fixes: 33f72e6f0c67 ("l2tp : multicast notification to the registered listeners") -Signed-off-by: Eric Dumazet -Cc: James Chapman -Cc: Tom Parkin -Cc: Johannes Berg -Link: https://patch.msgid.link/20241011171217.3166614-1-edumazet@google.com -Signed-off-by: Jakub Kicinski -Signed-off-by: Sasha Levin ---- - drivers/target/target_core_user.c | 2 +- - include/net/genetlink.h | 3 +-- - net/l2tp/l2tp_netlink.c | 4 ++-- - net/netlink/genetlink.c | 28 ++++++++++++++-------------- - net/wireless/nl80211.c | 8 ++------ - 5 files changed, 20 insertions(+), 25 deletions(-) - ---- a/backport-include/net/genetlink.h -+++ b/backport-include/net/genetlink.h -@@ -150,7 +150,7 @@ int genlmsg_multicast(const struct genl_ - #define genlmsg_multicast_allns LINUX_BACKPORT(genlmsg_multicast_allns) - int backport_genlmsg_multicast_allns(const struct genl_family *family, - struct sk_buff *skb, u32 portid, -- unsigned int group, gfp_t flags); -+ unsigned int group); - - #define genl_family_attrbuf LINUX_BACKPORT(genl_family_attrbuf) - static inline struct nlattr **genl_family_attrbuf(struct genl_family *family) ---- a/compat/backport-genetlink.c -+++ b/compat/backport-genetlink.c -@@ -198,23 +198,23 @@ int genlmsg_multicast(const struct genl_ - } - EXPORT_SYMBOL_GPL(genlmsg_multicast); - --static int genlmsg_mcast(struct sk_buff *skb, u32 portid, unsigned long group, -- gfp_t flags) -+static int genlmsg_mcast(struct sk_buff *skb, u32 portid, unsigned long group) - { - struct sk_buff *tmp; - struct net *net, *prev = NULL; - bool delivered = false; - int err; - -+ rcu_read_lock(); - for_each_net_rcu(net) { - if (prev) { -- tmp = skb_clone(skb, flags); -+ tmp = skb_clone(skb, GFP_ATOMIC); - if (!tmp) { - err = -ENOMEM; - goto error; - } - err = nlmsg_multicast(prev->genl_sock, tmp, -- portid, group, flags); -+ portid, group, GFP_ATOMIC); - if (!err) - delivered = true; - else if (err != -ESRCH) -@@ -223,25 +223,29 @@ static int genlmsg_mcast(struct sk_buff - - prev = net; - } -+ err = nlmsg_multicast(prev->genl_sock, skb, portid, group, GFP_ATOMIC); -+ -+ rcu_read_unlock(); - -- err = nlmsg_multicast(prev->genl_sock, skb, portid, group, flags); - if (!err) - delivered = true; - else if (err != -ESRCH) - return err; - return delivered ? 0 : -ESRCH; - error: -+ rcu_read_unlock(); -+ - kfree_skb(skb); - return err; - } - - int backport_genlmsg_multicast_allns(const struct genl_family *family, - struct sk_buff *skb, u32 portid, -- unsigned int group, gfp_t flags) -+ unsigned int group) - { - group = __backport_genl_group(family, group); - if (group == INVALID_GROUP) - return -EINVAL; -- return genlmsg_mcast(skb, portid, group, flags); -+ return genlmsg_mcast(skb, portid, group); - } - EXPORT_SYMBOL_GPL(backport_genlmsg_multicast_allns); ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -17956,10 +17956,8 @@ void nl80211_common_reg_change_event(enu - - genlmsg_end(msg, hdr); - -- rcu_read_lock(); - genlmsg_multicast_allns(&nl80211_fam, msg, 0, -- NL80211_MCGRP_REGULATORY, GFP_ATOMIC); -- rcu_read_unlock(); -+ NL80211_MCGRP_REGULATORY); - - return; - -@@ -18692,10 +18690,8 @@ void nl80211_send_beacon_hint_event(stru - - genlmsg_end(msg, hdr); - -- rcu_read_lock(); - genlmsg_multicast_allns(&nl80211_fam, msg, 0, -- NL80211_MCGRP_REGULATORY, GFP_ATOMIC); -- rcu_read_unlock(); -+ NL80211_MCGRP_REGULATORY); - - return; - diff --git a/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch b/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch index c3324f4289f..cfb7dcf7386 100644 --- a/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch +++ b/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/marvell/mwl8k.c +++ b/drivers/net/wireless/marvell/mwl8k.c -@@ -5709,6 +5709,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw") +@@ -5712,6 +5712,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw") MODULE_FIRMWARE(MWL8K_8366_AP_FW(MWL8K_8366_AP_FW_API)); static const struct pci_device_id mwl8k_pci_id_table[] = { diff --git a/package/kernel/mac80211/patches/mwl/900-mwifiex-increase-the-global-limit-up-to-4-SSID.patch b/package/kernel/mac80211/patches/mwl/900-mwifiex-increase-the-global-limit-up-to-4-SSID.patch index caa139a2c6e..484b37bfcc5 100644 --- a/package/kernel/mac80211/patches/mwl/900-mwifiex-increase-the-global-limit-up-to-4-SSID.patch +++ b/package/kernel/mac80211/patches/mwl/900-mwifiex-increase-the-global-limit-up-to-4-SSID.patch @@ -30,7 +30,7 @@ the card-specific structure. #define MWIFIEX_DMA_ALIGN_SZ 64 #define MWIFIEX_RX_HEADROOM 64 -@@ -100,7 +100,7 @@ +@@ -123,7 +123,7 @@ #define MWIFIEX_RATE_INDEX_OFDM0 4 #define MWIFIEX_MAX_STA_NUM 3 diff --git a/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch index 062b0600d0c..d09cfac448c 100644 --- a/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch +++ b/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/marvell/mwl8k.c +++ b/drivers/net/wireless/marvell/mwl8k.c -@@ -6295,6 +6295,8 @@ static int mwl8k_probe(struct pci_dev *p +@@ -6298,6 +6298,8 @@ static int mwl8k_probe(struct pci_dev *p priv->running_bsses = 0; @@ -9,7 +9,7 @@ return rc; err_stop_firmware: -@@ -6328,8 +6330,6 @@ static void mwl8k_remove(struct pci_dev +@@ -6331,8 +6333,6 @@ static void mwl8k_remove(struct pci_dev return; priv = hw->priv; diff --git a/package/kernel/mac80211/patches/mwl/950-mwifiex-Print-stringified-name-of-command-in-error-l.patch b/package/kernel/mac80211/patches/mwl/950-mwifiex-Print-stringified-name-of-command-in-error-l.patch index a7ecabde829..93a213265c6 100644 --- a/package/kernel/mac80211/patches/mwl/950-mwifiex-Print-stringified-name-of-command-in-error-l.patch +++ b/package/kernel/mac80211/patches/mwl/950-mwifiex-Print-stringified-name-of-command-in-error-l.patch @@ -116,7 +116,7 @@ Signed-off-by: Pali Rohár mwifiex_recycle_cmd_node(adapter, cmd_node); queue_work(adapter->workqueue, &adapter->main_work); return -1; -@@ -653,8 +732,8 @@ int mwifiex_send_cmd(struct mwifiex_priv +@@ -655,8 +734,8 @@ int mwifiex_send_cmd(struct mwifiex_priv /* Return error, since the command preparation failed */ if (ret) { mwifiex_dbg(adapter, ERROR, @@ -127,7 +127,7 @@ Signed-off-by: Pali Rohár mwifiex_insert_cmd_to_free_q(adapter, cmd_node); return -1; } -@@ -902,8 +981,9 @@ int mwifiex_process_cmdresp(struct mwifi +@@ -904,8 +983,9 @@ int mwifiex_process_cmdresp(struct mwifi if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING) { if (ret) { mwifiex_dbg(adapter, ERROR, @@ -139,7 +139,7 @@ Signed-off-by: Pali Rohár mwifiex_init_fw_complete(adapter); return -1; } else if (adapter->last_init_cmd == cmdresp_no) -@@ -1265,8 +1345,8 @@ mwifiex_process_sleep_confirm_resp(struc +@@ -1287,8 +1367,8 @@ mwifiex_process_sleep_confirm_resp(struc if (command != HostCmd_CMD_802_11_PS_MODE_ENH) { mwifiex_dbg(adapter, ERROR, @@ -152,7 +152,7 @@ Signed-off-by: Pali Rohár --- a/drivers/net/wireless/marvell/mwifiex/main.h +++ b/drivers/net/wireless/marvell/mwifiex/main.h -@@ -1084,6 +1084,8 @@ void mwifiex_cancel_all_pending_cmd(stru +@@ -1100,6 +1100,8 @@ void mwifiex_cancel_all_pending_cmd(stru void mwifiex_cancel_pending_scan_cmd(struct mwifiex_adapter *adapter); void mwifiex_cancel_scan(struct mwifiex_adapter *adapter); @@ -177,7 +177,7 @@ Signed-off-by: Pali Rohár adapter->cmd_wait_q.status = -1; --- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c +++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c -@@ -802,7 +802,8 @@ int mwifiex_uap_prepare_cmd(struct mwifi +@@ -964,7 +964,8 @@ int mwifiex_uap_prepare_cmd(struct mwifi break; default: mwifiex_dbg(priv->adapter, ERROR, diff --git a/package/kernel/mac80211/patches/rtl/001-v6.12-wifi-rtw88-Set-efuse-ext_lna_5g-fix-typo.patch b/package/kernel/mac80211/patches/rtl/001-v6.12-wifi-rtw88-Set-efuse-ext_lna_5g-fix-typo.patch deleted file mode 100644 index 96a6743c5bc..00000000000 --- a/package/kernel/mac80211/patches/rtl/001-v6.12-wifi-rtw88-Set-efuse-ext_lna_5g-fix-typo.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 8fbcaa308591b91e9037ab6a8d733873b749a70d Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Sat, 6 Jul 2024 01:40:58 +0300 -Subject: [PATCH] wifi: rtw88: Set efuse->ext_lna_5g - fix typo - -efuse->ext_lna_2g is set twice and efuse->ext_lna_5g is not set at all. -Set each one once. - -Nothing uses these members right now. They will be used by the RTL8821AU -and RTL8812AU drivers. - -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/8ccc9e13-0d45-417d-8f88-93a0ad294f77@gmail.com ---- - drivers/net/wireless/realtek/rtw88/main.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- a/drivers/net/wireless/realtek/rtw88/main.c -+++ b/drivers/net/wireless/realtek/rtw88/main.c -@@ -2006,7 +2006,7 @@ static int rtw_chip_efuse_info_setup(str - efuse->ext_pa_2g = efuse->pa_type_2g & BIT(4) ? 1 : 0; - efuse->ext_lna_2g = efuse->lna_type_2g & BIT(3) ? 1 : 0; - efuse->ext_pa_5g = efuse->pa_type_5g & BIT(0) ? 1 : 0; -- efuse->ext_lna_2g = efuse->lna_type_5g & BIT(3) ? 1 : 0; -+ efuse->ext_lna_5g = efuse->lna_type_5g & BIT(3) ? 1 : 0; - - if (!is_valid_ether_addr(efuse->addr)) { - eth_random_addr(efuse->addr); diff --git a/package/kernel/mac80211/patches/rtl/002-v6.12-wifi-rtw88-usb-Support-USB-3-with-RTL8822CU-RTL8822B.patch b/package/kernel/mac80211/patches/rtl/002-v6.12-wifi-rtw88-usb-Support-USB-3-with-RTL8822CU-RTL8822B.patch deleted file mode 100644 index 2faa59d760e..00000000000 --- a/package/kernel/mac80211/patches/rtl/002-v6.12-wifi-rtw88-usb-Support-USB-3-with-RTL8822CU-RTL8822B.patch +++ /dev/null @@ -1,284 +0,0 @@ -From 315c23a64e99552502dd4d18d6ddc073fad9a7c3 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Thu, 11 Jul 2024 01:11:33 +0300 -Subject: [PATCH] wifi: rtw88: usb: Support USB 3 with RTL8822CU/RTL8822BU - -The Realtek wifi 5 devices which support USB 3 are weird: when first -plugged in, they pretend to be USB 2. The driver needs to send some -commands to the device, which make it disappear and come back as a -USB 3 device. - -Implement the required commands in rtw88. - -When a USB 3 device is plugged into a USB 2 port, rtw88 will try to -switch it to USB 3 mode only once. The device will disappear and come -back still in USB 2 mode, of course. - -Some people experience heavy interference in the 2.4 GHz band in -USB 3 mode, so add a module parameter switch_usb_mode with the -default value 1 to let people disable the switching. - -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/77906c62-5674-426f-bde1-1b2a12a0339d@gmail.com ---- - drivers/net/wireless/realtek/rtw88/debug.h | 1 + - drivers/net/wireless/realtek/rtw88/main.h | 2 + - drivers/net/wireless/realtek/rtw88/reg.h | 11 +++ - drivers/net/wireless/realtek/rtw88/rtw8822b.c | 1 + - drivers/net/wireless/realtek/rtw88/rtw8822b.h | 4 +- - drivers/net/wireless/realtek/rtw88/rtw8822c.c | 1 + - drivers/net/wireless/realtek/rtw88/rtw8822c.h | 24 +++--- - drivers/net/wireless/realtek/rtw88/usb.c | 84 +++++++++++++++++++ - 8 files changed, 116 insertions(+), 12 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/debug.h -+++ b/drivers/net/wireless/realtek/rtw88/debug.h -@@ -25,6 +25,7 @@ enum rtw_debug_mask { - RTW_DBG_HW_SCAN = 0x00010000, - RTW_DBG_STATE = 0x00020000, - RTW_DBG_SDIO = 0x00040000, -+ RTW_DBG_USB = 0x00080000, - - RTW_DBG_UNEXP = 0x80000000, - RTW_DBG_ALL = 0xffffffff ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -1785,6 +1785,8 @@ struct rtw_efuse { - bool share_ant; - u8 bt_setting; - -+ u8 usb_mode_switch; -+ - struct { - u8 hci; - u8 bw; ---- a/drivers/net/wireless/realtek/rtw88/reg.h -+++ b/drivers/net/wireless/realtek/rtw88/reg.h -@@ -15,6 +15,7 @@ - #define BIT_WLOCK_1C_B6 BIT(5) - #define REG_SYS_PW_CTRL 0x0004 - #define BIT_PFM_WOWL BIT(3) -+#define BIT_APFM_OFFMAC BIT(9) - #define REG_SYS_CLK_CTRL 0x0008 - #define BIT_CPU_CLK_EN BIT(14) - -@@ -133,6 +134,14 @@ - #define REG_PMC_DBG_CTRL1 0xa8 - #define BITS_PMC_BT_IQK_STS GENMASK(22, 21) - -+#define REG_PAD_CTRL2 0x00C4 -+#define BIT_RSM_EN_V1 BIT(16) -+#define BIT_NO_PDN_CHIPOFF_V1 BIT(17) -+#define BIT_MASK_USB23_SW_MODE_V1 GENMASK(19, 18) -+#define BIT_USB3_USB2_TRANSITION BIT(20) -+#define BIT_USB_MODE_U2 1 -+#define BIT_USB_MODE_U3 2 -+ - #define REG_EFUSE_ACCESS 0x00CF - #define EFUSE_ACCESS_ON 0x69 - #define EFUSE_ACCESS_OFF 0x00 -@@ -568,6 +577,8 @@ - #define BIT_WL_SECURITY_CLK BIT(15) - #define BIT_DDMA_EN BIT(8) - -+#define REG_SW_MDIO 0x10C0 -+ - #define REG_H2C_PKT_READADDR 0x10D0 - #define REG_H2C_PKT_WRITEADDR 0x10D4 - #define REG_FW_DBG6 0x10F8 ---- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c -@@ -46,6 +46,7 @@ static int rtw8822b_read_efuse(struct rt - - map = (struct rtw8822b_efuse *)log_map; - -+ efuse->usb_mode_switch = u8_get_bits(map->usb_mode, BIT(7)); - efuse->rfe_option = map->rfe_option; - efuse->rf_board_option = map->rf_board_option; - efuse->crystal_cap = map->xtal_k; ---- a/drivers/net/wireless/realtek/rtw88/rtw8822b.h -+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.h -@@ -72,7 +72,9 @@ struct rtw8822bs_efuse { - - struct rtw8822b_efuse { - __le16 rtl_id; -- u8 res0[0x0e]; -+ u8 res0[4]; -+ u8 usb_mode; -+ u8 res1[0x09]; - - /* power index for four RF paths */ - struct rtw_txpwr_idx txpwr_idx_table[4]; ---- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c -@@ -49,6 +49,7 @@ static int rtw8822c_read_efuse(struct rt - - map = (struct rtw8822c_efuse *)log_map; - -+ efuse->usb_mode_switch = u8_get_bits(map->usb_mode, BIT(7)); - efuse->rfe_option = map->rfe_option; - efuse->rf_board_option = map->rf_board_option; - efuse->crystal_cap = map->xtal_k & XCAP_MASK; ---- a/drivers/net/wireless/realtek/rtw88/rtw8822c.h -+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.h -@@ -59,16 +59,18 @@ struct rtw8822ce_efuse { - - struct rtw8822c_efuse { - __le16 rtl_id; -- u8 res0[0x0e]; -+ u8 res0[4]; -+ u8 usb_mode; -+ u8 res1[0x09]; - - /* power index for four RF paths */ - struct rtw_txpwr_idx txpwr_idx_table[4]; - - u8 channel_plan; /* 0xb8 */ - u8 xtal_k; -- u8 res1; -+ u8 res2; - u8 iqk_lck; -- u8 res2[5]; /* 0xbc */ -+ u8 res3[5]; /* 0xbc */ - u8 rf_board_option; - u8 rf_feature_option; - u8 rf_bt_setting; -@@ -80,21 +82,21 @@ struct rtw8822c_efuse { - u8 rf_antenna_option; /* 0xc9 */ - u8 rfe_option; - u8 country_code[2]; -- u8 res3[3]; -+ u8 res4[3]; - u8 path_a_thermal; /* 0xd0 */ - u8 path_b_thermal; -- u8 res4[2]; -+ u8 res5[2]; - u8 rx_gain_gap_2g_ofdm; -- u8 res5; -- u8 rx_gain_gap_2g_cck; - u8 res6; -- u8 rx_gain_gap_5gl; -+ u8 rx_gain_gap_2g_cck; - u8 res7; -- u8 rx_gain_gap_5gm; -+ u8 rx_gain_gap_5gl; - u8 res8; -- u8 rx_gain_gap_5gh; -+ u8 rx_gain_gap_5gm; - u8 res9; -- u8 res10[0x42]; -+ u8 rx_gain_gap_5gh; -+ u8 res10; -+ u8 res11[0x42]; - union { - struct rtw8822ce_efuse e; - struct rtw8822cu_efuse u; ---- a/drivers/net/wireless/realtek/rtw88/usb.c -+++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -14,6 +14,11 @@ - #include "ps.h" - #include "usb.h" - -+static bool rtw_switch_usb_mode = true; -+module_param_named(switch_usb_mode, rtw_switch_usb_mode, bool, 0644); -+MODULE_PARM_DESC(switch_usb_mode, -+ "Set to N to disable switching to USB 3 mode to avoid potential interference in the 2.4 GHz band (default: Y)"); -+ - #define RTW_USB_MAX_RXQ_LEN 512 - - struct rtw_usb_txcb { -@@ -841,6 +846,77 @@ static void rtw_usb_intf_deinit(struct r - usb_set_intfdata(intf, NULL); - } - -+static int rtw_usb_switch_mode_new(struct rtw_dev *rtwdev) -+{ -+ enum usb_device_speed cur_speed; -+ u8 id = rtwdev->chip->id; -+ bool can_switch; -+ u32 pad_ctrl2; -+ -+ if (rtw_read8(rtwdev, REG_SYS_CFG2 + 3) == 0x20) -+ cur_speed = USB_SPEED_SUPER; -+ else -+ cur_speed = USB_SPEED_HIGH; -+ -+ if (cur_speed == USB_SPEED_SUPER) -+ return 0; -+ -+ pad_ctrl2 = rtw_read32(rtwdev, REG_PAD_CTRL2); -+ -+ can_switch = !!(pad_ctrl2 & (BIT_MASK_USB23_SW_MODE_V1 | -+ BIT_USB3_USB2_TRANSITION)); -+ -+ if (!can_switch) { -+ rtw_dbg(rtwdev, RTW_DBG_USB, -+ "Switching to USB 3 mode unsupported by the chip\n"); -+ return 0; -+ } -+ -+ /* At this point cur_speed is USB_SPEED_HIGH. If we already tried -+ * to switch don't try again - it's a USB 2 port. -+ */ -+ if (u32_get_bits(pad_ctrl2, BIT_MASK_USB23_SW_MODE_V1) == BIT_USB_MODE_U3) -+ return 0; -+ -+ /* Enable IO wrapper timeout */ -+ if (id == RTW_CHIP_TYPE_8822B || id == RTW_CHIP_TYPE_8821C) -+ rtw_write8_clr(rtwdev, REG_SW_MDIO + 3, BIT(0)); -+ -+ u32p_replace_bits(&pad_ctrl2, BIT_USB_MODE_U3, BIT_MASK_USB23_SW_MODE_V1); -+ pad_ctrl2 |= BIT_RSM_EN_V1; -+ -+ rtw_write32(rtwdev, REG_PAD_CTRL2, pad_ctrl2); -+ rtw_write8(rtwdev, REG_PAD_CTRL2 + 1, 4); -+ -+ rtw_write16_set(rtwdev, REG_SYS_PW_CTRL, BIT_APFM_OFFMAC); -+ usleep_range(1000, 1001); -+ rtw_write32_set(rtwdev, REG_PAD_CTRL2, BIT_NO_PDN_CHIPOFF_V1); -+ -+ return 1; -+} -+ -+static int rtw_usb_switch_mode(struct rtw_dev *rtwdev) -+{ -+ u8 id = rtwdev->chip->id; -+ -+ if (id != RTW_CHIP_TYPE_8822C && id != RTW_CHIP_TYPE_8822B) -+ return 0; -+ -+ if (!rtwdev->efuse.usb_mode_switch) { -+ rtw_dbg(rtwdev, RTW_DBG_USB, -+ "Switching to USB 3 mode disabled by chip's efuse\n"); -+ return 0; -+ } -+ -+ if (!rtw_switch_usb_mode) { -+ rtw_dbg(rtwdev, RTW_DBG_USB, -+ "Switching to USB 3 mode disabled by module parameter\n"); -+ return 0; -+ } -+ -+ return rtw_usb_switch_mode_new(rtwdev); -+} -+ - int rtw_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) - { - struct rtw_dev *rtwdev; -@@ -896,6 +972,14 @@ int rtw_usb_probe(struct usb_interface * - goto err_destroy_rxwq; - } - -+ ret = rtw_usb_switch_mode(rtwdev); -+ if (ret) { -+ /* Not a fail, but we do need to skip rtw_register_hw. */ -+ rtw_dbg(rtwdev, RTW_DBG_USB, "switching to USB 3 mode\n"); -+ ret = 0; -+ goto err_destroy_rxwq; -+ } -+ - ret = rtw_register_hw(rtwdev, rtwdev->hw); - if (ret) { - rtw_err(rtwdev, "failed to register hw\n"); diff --git a/package/kernel/mac80211/patches/rtl/004-v6.12-wifi-rtw88-debugfs-support-multiple-adapters-debuggi.patch b/package/kernel/mac80211/patches/rtl/004-v6.12-wifi-rtw88-debugfs-support-multiple-adapters-debuggi.patch deleted file mode 100644 index d965fbce927..00000000000 --- a/package/kernel/mac80211/patches/rtl/004-v6.12-wifi-rtw88-debugfs-support-multiple-adapters-debuggi.patch +++ /dev/null @@ -1,454 +0,0 @@ -From 8db6c1ca64664ef9b071e6eeb646023ac5b240a8 Mon Sep 17 00:00:00 2001 -From: Ping-Ke Shih -Date: Thu, 18 Jul 2024 14:41:55 +0800 -Subject: [PATCH] wifi: rtw88: debugfs: support multiple adapters debugging - -Originally in order to read partial registers from large area, we write -a range value stored into a static variable and read registers according -to the static variable. - -However, if we install more than one adapters supported by this driver, -the static variables will be overwritten by latter adapters. To resolve -the problem, move the static variables to struct rtw_dev for each adapter. - -With changes, smatch spends too much time to parse rtw_debugfs_init(): - debug.c:1289 rtw_debugfs_init() parse error: turning off implications - after 60 seconds -Move stuffs of adding debugfs entries to three rtw_debugfs_add_xxx() -functions. - -Reported-by: Bitterblue Smith -Closes: https://lore.kernel.org/linux-wireless/cd6a2acf3c2c36d938b40140b52a779516f446a9.camel@realtek.com/T/#m27662022c70d9f893ba96f6c6a8dd8fce2434dfe -Tested-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/20240718064155.38955-1-pkshih@realtek.com ---- - drivers/net/wireless/realtek/rtw88/debug.c | 303 ++++++++++++--------- - drivers/net/wireless/realtek/rtw88/debug.h | 2 + - drivers/net/wireless/realtek/rtw88/main.c | 1 + - drivers/net/wireless/realtek/rtw88/main.h | 3 +- - 4 files changed, 180 insertions(+), 129 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/debug.c -+++ b/drivers/net/wireless/realtek/rtw88/debug.c -@@ -43,6 +43,62 @@ struct rtw_debugfs_priv { - }; - }; - -+struct rtw_debugfs { -+ struct rtw_debugfs_priv mac_0; -+ struct rtw_debugfs_priv mac_1; -+ struct rtw_debugfs_priv mac_2; -+ struct rtw_debugfs_priv mac_3; -+ struct rtw_debugfs_priv mac_4; -+ struct rtw_debugfs_priv mac_5; -+ struct rtw_debugfs_priv mac_6; -+ struct rtw_debugfs_priv mac_7; -+ struct rtw_debugfs_priv mac_10; -+ struct rtw_debugfs_priv mac_11; -+ struct rtw_debugfs_priv mac_12; -+ struct rtw_debugfs_priv mac_13; -+ struct rtw_debugfs_priv mac_14; -+ struct rtw_debugfs_priv mac_15; -+ struct rtw_debugfs_priv mac_16; -+ struct rtw_debugfs_priv mac_17; -+ struct rtw_debugfs_priv bb_8; -+ struct rtw_debugfs_priv bb_9; -+ struct rtw_debugfs_priv bb_a; -+ struct rtw_debugfs_priv bb_b; -+ struct rtw_debugfs_priv bb_c; -+ struct rtw_debugfs_priv bb_d; -+ struct rtw_debugfs_priv bb_e; -+ struct rtw_debugfs_priv bb_f; -+ struct rtw_debugfs_priv bb_18; -+ struct rtw_debugfs_priv bb_19; -+ struct rtw_debugfs_priv bb_1a; -+ struct rtw_debugfs_priv bb_1b; -+ struct rtw_debugfs_priv bb_1c; -+ struct rtw_debugfs_priv bb_1d; -+ struct rtw_debugfs_priv bb_1e; -+ struct rtw_debugfs_priv bb_1f; -+ struct rtw_debugfs_priv bb_2c; -+ struct rtw_debugfs_priv bb_2d; -+ struct rtw_debugfs_priv bb_40; -+ struct rtw_debugfs_priv bb_41; -+ struct rtw_debugfs_priv rf_dump; -+ struct rtw_debugfs_priv tx_pwr_tbl; -+ struct rtw_debugfs_priv write_reg; -+ struct rtw_debugfs_priv h2c; -+ struct rtw_debugfs_priv rf_write; -+ struct rtw_debugfs_priv rf_read; -+ struct rtw_debugfs_priv read_reg; -+ struct rtw_debugfs_priv fix_rate; -+ struct rtw_debugfs_priv dump_cam; -+ struct rtw_debugfs_priv rsvd_page; -+ struct rtw_debugfs_priv phy_info; -+ struct rtw_debugfs_priv coex_enable; -+ struct rtw_debugfs_priv coex_info; -+ struct rtw_debugfs_priv edcca_enable; -+ struct rtw_debugfs_priv fw_crash; -+ struct rtw_debugfs_priv force_lowest_basic_rate; -+ struct rtw_debugfs_priv dm_cap; -+}; -+ - static const char * const rtw_dm_cap_strs[] = { - [RTW_DM_CAP_NA] = "NA", - [RTW_DM_CAP_TXGAPK] = "TXGAPK", -@@ -524,7 +580,7 @@ static int rtw_debug_get_bb_page(struct - return 0; - } - --static int rtw_debug_get_rf_dump(struct seq_file *m, void *v) -+static int rtw_debugfs_get_rf_dump(struct seq_file *m, void *v) - { - struct rtw_debugfs_priv *debugfs_priv = m->private; - struct rtw_dev *rtwdev = debugfs_priv->rtwdev; -@@ -1074,139 +1130,102 @@ static int rtw_debugfs_get_dm_cap(struct - return 0; - } - --#define rtw_debug_impl_mac(page, addr) \ --static struct rtw_debugfs_priv rtw_debug_priv_mac_ ##page = { \ -+#define rtw_debug_priv_mac(addr) \ -+{ \ - .cb_read = rtw_debug_get_mac_page, \ - .cb_data = addr, \ - } - --rtw_debug_impl_mac(0, 0x0000); --rtw_debug_impl_mac(1, 0x0100); --rtw_debug_impl_mac(2, 0x0200); --rtw_debug_impl_mac(3, 0x0300); --rtw_debug_impl_mac(4, 0x0400); --rtw_debug_impl_mac(5, 0x0500); --rtw_debug_impl_mac(6, 0x0600); --rtw_debug_impl_mac(7, 0x0700); --rtw_debug_impl_mac(10, 0x1000); --rtw_debug_impl_mac(11, 0x1100); --rtw_debug_impl_mac(12, 0x1200); --rtw_debug_impl_mac(13, 0x1300); --rtw_debug_impl_mac(14, 0x1400); --rtw_debug_impl_mac(15, 0x1500); --rtw_debug_impl_mac(16, 0x1600); --rtw_debug_impl_mac(17, 0x1700); -- --#define rtw_debug_impl_bb(page, addr) \ --static struct rtw_debugfs_priv rtw_debug_priv_bb_ ##page = { \ -+#define rtw_debug_priv_bb(addr) \ -+{ \ - .cb_read = rtw_debug_get_bb_page, \ - .cb_data = addr, \ - } - --rtw_debug_impl_bb(8, 0x0800); --rtw_debug_impl_bb(9, 0x0900); --rtw_debug_impl_bb(a, 0x0a00); --rtw_debug_impl_bb(b, 0x0b00); --rtw_debug_impl_bb(c, 0x0c00); --rtw_debug_impl_bb(d, 0x0d00); --rtw_debug_impl_bb(e, 0x0e00); --rtw_debug_impl_bb(f, 0x0f00); --rtw_debug_impl_bb(18, 0x1800); --rtw_debug_impl_bb(19, 0x1900); --rtw_debug_impl_bb(1a, 0x1a00); --rtw_debug_impl_bb(1b, 0x1b00); --rtw_debug_impl_bb(1c, 0x1c00); --rtw_debug_impl_bb(1d, 0x1d00); --rtw_debug_impl_bb(1e, 0x1e00); --rtw_debug_impl_bb(1f, 0x1f00); --rtw_debug_impl_bb(2c, 0x2c00); --rtw_debug_impl_bb(2d, 0x2d00); --rtw_debug_impl_bb(40, 0x4000); --rtw_debug_impl_bb(41, 0x4100); -- --static struct rtw_debugfs_priv rtw_debug_priv_rf_dump = { -- .cb_read = rtw_debug_get_rf_dump, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_tx_pwr_tbl = { -- .cb_read = rtw_debugfs_get_tx_pwr_tbl, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_write_reg = { -- .cb_write = rtw_debugfs_set_write_reg, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_h2c = { -- .cb_write = rtw_debugfs_set_h2c, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_rf_write = { -- .cb_write = rtw_debugfs_set_rf_write, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_rf_read = { -- .cb_write = rtw_debugfs_set_rf_read, -- .cb_read = rtw_debugfs_get_rf_read, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_read_reg = { -- .cb_write = rtw_debugfs_set_read_reg, -- .cb_read = rtw_debugfs_get_read_reg, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_fix_rate = { -- .cb_write = rtw_debugfs_set_fix_rate, -- .cb_read = rtw_debugfs_get_fix_rate, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_dump_cam = { -- .cb_write = rtw_debugfs_set_single_input, -- .cb_read = rtw_debugfs_get_dump_cam, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_rsvd_page = { -- .cb_write = rtw_debugfs_set_rsvd_page, -- .cb_read = rtw_debugfs_get_rsvd_page, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_phy_info = { -- .cb_read = rtw_debugfs_get_phy_info, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_coex_enable = { -- .cb_write = rtw_debugfs_set_coex_enable, -- .cb_read = rtw_debugfs_get_coex_enable, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_coex_info = { -- .cb_read = rtw_debugfs_get_coex_info, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_edcca_enable = { -- .cb_write = rtw_debugfs_set_edcca_enable, -- .cb_read = rtw_debugfs_get_edcca_enable, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_fw_crash = { -- .cb_write = rtw_debugfs_set_fw_crash, -- .cb_read = rtw_debugfs_get_fw_crash, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_force_lowest_basic_rate = { -- .cb_write = rtw_debugfs_set_force_lowest_basic_rate, -- .cb_read = rtw_debugfs_get_force_lowest_basic_rate, --}; -- --static struct rtw_debugfs_priv rtw_debug_priv_dm_cap = { -- .cb_write = rtw_debugfs_set_dm_cap, -- .cb_read = rtw_debugfs_get_dm_cap, -+#define rtw_debug_priv_get(name) \ -+{ \ -+ .cb_read = rtw_debugfs_get_ ##name, \ -+} -+ -+#define rtw_debug_priv_set(name) \ -+{ \ -+ .cb_write = rtw_debugfs_set_ ##name, \ -+} -+ -+#define rtw_debug_priv_set_and_get(name) \ -+{ \ -+ .cb_write = rtw_debugfs_set_ ##name, \ -+ .cb_read = rtw_debugfs_get_ ##name, \ -+} -+ -+#define rtw_debug_priv_set_single_and_get(name) \ -+{ \ -+ .cb_write = rtw_debugfs_set_single_input, \ -+ .cb_read = rtw_debugfs_get_ ##name, \ -+} -+ -+static const struct rtw_debugfs rtw_debugfs_templ = { -+ .mac_0 = rtw_debug_priv_mac(0x0000), -+ .mac_1 = rtw_debug_priv_mac(0x0100), -+ .mac_2 = rtw_debug_priv_mac(0x0200), -+ .mac_3 = rtw_debug_priv_mac(0x0300), -+ .mac_4 = rtw_debug_priv_mac(0x0400), -+ .mac_5 = rtw_debug_priv_mac(0x0500), -+ .mac_6 = rtw_debug_priv_mac(0x0600), -+ .mac_7 = rtw_debug_priv_mac(0x0700), -+ .mac_10 = rtw_debug_priv_mac(0x1000), -+ .mac_11 = rtw_debug_priv_mac(0x1100), -+ .mac_12 = rtw_debug_priv_mac(0x1200), -+ .mac_13 = rtw_debug_priv_mac(0x1300), -+ .mac_14 = rtw_debug_priv_mac(0x1400), -+ .mac_15 = rtw_debug_priv_mac(0x1500), -+ .mac_16 = rtw_debug_priv_mac(0x1600), -+ .mac_17 = rtw_debug_priv_mac(0x1700), -+ .bb_8 = rtw_debug_priv_bb(0x0800), -+ .bb_9 = rtw_debug_priv_bb(0x0900), -+ .bb_a = rtw_debug_priv_bb(0x0a00), -+ .bb_b = rtw_debug_priv_bb(0x0b00), -+ .bb_c = rtw_debug_priv_bb(0x0c00), -+ .bb_d = rtw_debug_priv_bb(0x0d00), -+ .bb_e = rtw_debug_priv_bb(0x0e00), -+ .bb_f = rtw_debug_priv_bb(0x0f00), -+ .bb_18 = rtw_debug_priv_bb(0x1800), -+ .bb_19 = rtw_debug_priv_bb(0x1900), -+ .bb_1a = rtw_debug_priv_bb(0x1a00), -+ .bb_1b = rtw_debug_priv_bb(0x1b00), -+ .bb_1c = rtw_debug_priv_bb(0x1c00), -+ .bb_1d = rtw_debug_priv_bb(0x1d00), -+ .bb_1e = rtw_debug_priv_bb(0x1e00), -+ .bb_1f = rtw_debug_priv_bb(0x1f00), -+ .bb_2c = rtw_debug_priv_bb(0x2c00), -+ .bb_2d = rtw_debug_priv_bb(0x2d00), -+ .bb_40 = rtw_debug_priv_bb(0x4000), -+ .bb_41 = rtw_debug_priv_bb(0x4100), -+ .rf_dump = rtw_debug_priv_get(rf_dump), -+ .tx_pwr_tbl = rtw_debug_priv_get(tx_pwr_tbl), -+ .write_reg = rtw_debug_priv_set(write_reg), -+ .h2c = rtw_debug_priv_set(h2c), -+ .rf_write = rtw_debug_priv_set(rf_write), -+ .rf_read = rtw_debug_priv_set_and_get(rf_read), -+ .read_reg = rtw_debug_priv_set_and_get(read_reg), -+ .fix_rate = rtw_debug_priv_set_and_get(fix_rate), -+ .dump_cam = rtw_debug_priv_set_single_and_get(dump_cam), -+ .rsvd_page = rtw_debug_priv_set_and_get(rsvd_page), -+ .phy_info = rtw_debug_priv_get(phy_info), -+ .coex_enable = rtw_debug_priv_set_and_get(coex_enable), -+ .coex_info = rtw_debug_priv_get(coex_info), -+ .edcca_enable = rtw_debug_priv_set_and_get(edcca_enable), -+ .fw_crash = rtw_debug_priv_set_and_get(fw_crash), -+ .force_lowest_basic_rate = rtw_debug_priv_set_and_get(force_lowest_basic_rate), -+ .dm_cap = rtw_debug_priv_set_and_get(dm_cap), - }; - - #define rtw_debugfs_add_core(name, mode, fopname, parent) \ - do { \ -- rtw_debug_priv_ ##name.rtwdev = rtwdev; \ -+ struct rtw_debugfs_priv *priv = &rtwdev->debugfs->name; \ -+ priv->rtwdev = rtwdev; \ - if (IS_ERR(debugfs_create_file(#name, mode, \ -- parent, &rtw_debug_priv_ ##name,\ -+ parent, priv, \ - &file_ops_ ##fopname))) \ - pr_debug("Unable to initialize debugfs:%s\n", \ - #name); \ -@@ -1219,12 +1238,9 @@ static struct rtw_debugfs_priv rtw_debug - #define rtw_debugfs_add_r(name) \ - rtw_debugfs_add_core(name, S_IFREG | 0444, single_r, debugfs_topdir) - --void rtw_debugfs_init(struct rtw_dev *rtwdev) -+static -+void rtw_debugfs_add_basic(struct rtw_dev *rtwdev, struct dentry *debugfs_topdir) - { -- struct dentry *debugfs_topdir; -- -- debugfs_topdir = debugfs_create_dir("rtw88", -- rtwdev->hw->wiphy->debugfsdir); - rtw_debugfs_add_w(write_reg); - rtw_debugfs_add_rw(read_reg); - rtw_debugfs_add_w(rf_write); -@@ -1236,6 +1252,17 @@ void rtw_debugfs_init(struct rtw_dev *rt - rtw_debugfs_add_r(coex_info); - rtw_debugfs_add_rw(coex_enable); - rtw_debugfs_add_w(h2c); -+ rtw_debugfs_add_r(rf_dump); -+ rtw_debugfs_add_r(tx_pwr_tbl); -+ rtw_debugfs_add_rw(edcca_enable); -+ rtw_debugfs_add_rw(fw_crash); -+ rtw_debugfs_add_rw(force_lowest_basic_rate); -+ rtw_debugfs_add_rw(dm_cap); -+} -+ -+static -+void rtw_debugfs_add_sec0(struct rtw_dev *rtwdev, struct dentry *debugfs_topdir) -+{ - rtw_debugfs_add_r(mac_0); - rtw_debugfs_add_r(mac_1); - rtw_debugfs_add_r(mac_2); -@@ -1252,6 +1279,11 @@ void rtw_debugfs_init(struct rtw_dev *rt - rtw_debugfs_add_r(bb_d); - rtw_debugfs_add_r(bb_e); - rtw_debugfs_add_r(bb_f); -+} -+ -+static -+void rtw_debugfs_add_sec1(struct rtw_dev *rtwdev, struct dentry *debugfs_topdir) -+{ - rtw_debugfs_add_r(mac_10); - rtw_debugfs_add_r(mac_11); - rtw_debugfs_add_r(mac_12); -@@ -1274,14 +1306,29 @@ void rtw_debugfs_init(struct rtw_dev *rt - rtw_debugfs_add_r(bb_40); - rtw_debugfs_add_r(bb_41); - } -- rtw_debugfs_add_r(rf_dump); -- rtw_debugfs_add_r(tx_pwr_tbl); -- rtw_debugfs_add_rw(edcca_enable); -- rtw_debugfs_add_rw(fw_crash); -- rtw_debugfs_add_rw(force_lowest_basic_rate); -- rtw_debugfs_add_rw(dm_cap); - } - -+void rtw_debugfs_init(struct rtw_dev *rtwdev) -+{ -+ struct dentry *debugfs_topdir; -+ -+ rtwdev->debugfs = kmemdup(&rtw_debugfs_templ, sizeof(rtw_debugfs_templ), -+ GFP_KERNEL); -+ if (!rtwdev->debugfs) -+ return; -+ -+ debugfs_topdir = debugfs_create_dir("rtw88", -+ rtwdev->hw->wiphy->debugfsdir); -+ -+ rtw_debugfs_add_basic(rtwdev, debugfs_topdir); -+ rtw_debugfs_add_sec0(rtwdev, debugfs_topdir); -+ rtw_debugfs_add_sec1(rtwdev, debugfs_topdir); -+} -+ -+void rtw_debugfs_deinit(struct rtw_dev *rtwdev) -+{ -+ kfree(rtwdev->debugfs); -+} - #endif /* CPTCFG_RTW88_DEBUGFS */ - - #ifdef CPTCFG_RTW88_DEBUG ---- a/drivers/net/wireless/realtek/rtw88/debug.h -+++ b/drivers/net/wireless/realtek/rtw88/debug.h -@@ -34,11 +34,13 @@ enum rtw_debug_mask { - #ifdef CPTCFG_RTW88_DEBUGFS - - void rtw_debugfs_init(struct rtw_dev *rtwdev); -+void rtw_debugfs_deinit(struct rtw_dev *rtwdev); - void rtw_debugfs_get_simple_phy_info(struct seq_file *m); - - #else - - static inline void rtw_debugfs_init(struct rtw_dev *rtwdev) {} -+static inline void rtw_debugfs_deinit(struct rtw_dev *rtwdev) {} - - #endif /* CPTCFG_RTW88_DEBUGFS */ - ---- a/drivers/net/wireless/realtek/rtw88/main.c -+++ b/drivers/net/wireless/realtek/rtw88/main.c -@@ -2300,6 +2300,7 @@ void rtw_unregister_hw(struct rtw_dev *r - - ieee80211_unregister_hw(hw); - rtw_unset_supported_band(hw, chip); -+ rtw_debugfs_deinit(rtwdev); - } - EXPORT_SYMBOL(rtw_unregister_hw); - ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -50,6 +50,7 @@ extern const struct ieee80211_ops rtw_op - #define RTW_MAX_CHANNEL_NUM_5G 49 - - struct rtw_dev; -+struct rtw_debugfs; - - enum rtw_hci_type { - RTW_HCI_TYPE_PCIE, -@@ -2053,7 +2054,7 @@ struct rtw_dev { - bool beacon_loss; - struct completion lps_leave_check; - -- struct dentry *debugfs; -+ struct rtw_debugfs *debugfs; - - u8 sta_cnt; - u32 rts_threshold; diff --git a/package/kernel/mac80211/patches/rtl/005-v6.12-wifi-rtw88-select-WANT_DEV_COREDUMP.patch b/package/kernel/mac80211/patches/rtl/005-v6.12-wifi-rtw88-select-WANT_DEV_COREDUMP.patch deleted file mode 100644 index 6c31b5e848f..00000000000 --- a/package/kernel/mac80211/patches/rtl/005-v6.12-wifi-rtw88-select-WANT_DEV_COREDUMP.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 7e989b0c1e33210c07340bf5228aa83ea52515b5 Mon Sep 17 00:00:00 2001 -From: Zong-Zhe Yang -Date: Thu, 18 Jul 2024 15:06:15 +0800 -Subject: [PATCH] wifi: rtw88: select WANT_DEV_COREDUMP - -We have invoked device coredump when fw crash. -Should select WANT_DEV_COREDUMP by ourselves. - -Signed-off-by: Zong-Zhe Yang -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/20240718070616.42217-1-pkshih@realtek.com ---- - drivers/net/wireless/realtek/rtw88/Kconfig | 1 + - 1 file changed, 1 insertion(+) - ---- a/drivers/net/wireless/realtek/rtw88/Kconfig -+++ b/drivers/net/wireless/realtek/rtw88/Kconfig -@@ -14,6 +14,7 @@ if RTW88 - config RTW88_CORE - tristate - depends on m -+ select BPAUTO_WANT_DEV_COREDUMP - - config RTW88_PCI - tristate diff --git a/package/kernel/mac80211/patches/rtl/008-v6.12-wifi-rtw88-8822c-Parse-channel-from-IE-to-correct-in.patch b/package/kernel/mac80211/patches/rtl/008-v6.12-wifi-rtw88-8822c-Parse-channel-from-IE-to-correct-in.patch deleted file mode 100644 index a304cd7d050..00000000000 --- a/package/kernel/mac80211/patches/rtl/008-v6.12-wifi-rtw88-8822c-Parse-channel-from-IE-to-correct-in.patch +++ /dev/null @@ -1,151 +0,0 @@ -From 53ed4b25a79aeec5991c2dc579e635b136ef7676 Mon Sep 17 00:00:00 2001 -From: Po-Hao Huang -Date: Wed, 24 Jul 2024 13:05:01 +0800 -Subject: [PATCH] wifi: rtw88: 8822c: Parse channel from IE to correct invalid - hardware reports - -For CCK packets we could get incorrect reports from hardware. -And this causes wrong frequencies being reported. Parse the channel -information from IE if provided by AP to fix this. - -Signed-off-by: Po-Hao Huang -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/20240724050501.7550-1-pkshih@realtek.com ---- - drivers/net/wireless/realtek/rtw88/main.h | 1 + - drivers/net/wireless/realtek/rtw88/pci.c | 1 + - drivers/net/wireless/realtek/rtw88/rtw8822c.c | 7 ++-- - drivers/net/wireless/realtek/rtw88/rx.c | 41 +++++++++++++++++++ - drivers/net/wireless/realtek/rtw88/rx.h | 13 ++++++ - drivers/net/wireless/realtek/rtw88/sdio.c | 1 + - drivers/net/wireless/realtek/rtw88/usb.c | 2 + - 7 files changed, 63 insertions(+), 3 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -623,6 +623,7 @@ struct rtw_rx_pkt_stat { - bool crc_err; - bool decrypted; - bool is_c2h; -+ bool channel_invalid; - - s32 signal_power; - u16 pkt_len; ---- a/drivers/net/wireless/realtek/rtw88/pci.c -+++ b/drivers/net/wireless/realtek/rtw88/pci.c -@@ -1088,6 +1088,7 @@ static u32 rtw_pci_rx_napi(struct rtw_de - /* remove rx_desc */ - skb_pull(new, pkt_offset); - -+ rtw_update_rx_freq_for_invalid(rtwdev, new, &rx_status, &pkt_stat); - rtw_rx_stats(rtwdev, pkt_stat.vif, new); - memcpy(new->cb, &rx_status, sizeof(rx_status)); - ieee80211_rx_napi(rtwdev->hw, NULL, new, napi); ---- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c -@@ -2576,9 +2576,10 @@ static void query_phy_status_page0(struc - rx_power[RF_PATH_B] -= 110; - - channel = GET_PHY_STAT_P0_CHANNEL(phy_status); -- if (channel == 0) -- channel = rtwdev->hal.current_channel; -- rtw_set_rx_freq_band(pkt_stat, channel); -+ if (channel != 0) -+ rtw_set_rx_freq_band(pkt_stat, channel); -+ else -+ pkt_stat->channel_invalid = true; - - pkt_stat->rx_power[RF_PATH_A] = rx_power[RF_PATH_A]; - pkt_stat->rx_power[RF_PATH_B] = rx_power[RF_PATH_B]; ---- a/drivers/net/wireless/realtek/rtw88/rx.c -+++ b/drivers/net/wireless/realtek/rtw88/rx.c -@@ -146,6 +146,47 @@ static void rtw_set_rx_freq_by_pktstat(s - rx_status->band = pkt_stat->band; - } - -+void rtw_update_rx_freq_from_ie(struct rtw_dev *rtwdev, struct sk_buff *skb, -+ struct ieee80211_rx_status *rx_status, -+ struct rtw_rx_pkt_stat *pkt_stat) -+{ -+ struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)skb->data; -+ int channel = rtwdev->hal.current_channel; -+ size_t hdr_len, ielen; -+ int channel_number; -+ u8 *variable; -+ -+ if (!test_bit(RTW_FLAG_SCANNING, rtwdev->flags)) -+ goto fill_rx_status; -+ -+ if (ieee80211_is_beacon(mgmt->frame_control)) { -+ variable = mgmt->u.beacon.variable; -+ hdr_len = offsetof(struct ieee80211_mgmt, -+ u.beacon.variable); -+ } else if (ieee80211_is_probe_resp(mgmt->frame_control)) { -+ variable = mgmt->u.probe_resp.variable; -+ hdr_len = offsetof(struct ieee80211_mgmt, -+ u.probe_resp.variable); -+ } else { -+ goto fill_rx_status; -+ } -+ -+ if (skb->len > hdr_len) -+ ielen = skb->len - hdr_len; -+ else -+ goto fill_rx_status; -+ -+ channel_number = cfg80211_get_ies_channel_number(variable, ielen, -+ NL80211_BAND_2GHZ); -+ if (channel_number != -1) -+ channel = channel_number; -+ -+fill_rx_status: -+ rtw_set_rx_freq_band(pkt_stat, channel); -+ rtw_set_rx_freq_by_pktstat(pkt_stat, rx_status); -+} -+EXPORT_SYMBOL(rtw_update_rx_freq_from_ie); -+ - void rtw_rx_fill_rx_status(struct rtw_dev *rtwdev, - struct rtw_rx_pkt_stat *pkt_stat, - struct ieee80211_hdr *hdr, ---- a/drivers/net/wireless/realtek/rtw88/rx.h -+++ b/drivers/net/wireless/realtek/rtw88/rx.h -@@ -50,5 +50,18 @@ void rtw_rx_fill_rx_status(struct rtw_de - struct ieee80211_hdr *hdr, - struct ieee80211_rx_status *rx_status, - u8 *phy_status); -+void rtw_update_rx_freq_from_ie(struct rtw_dev *rtwdev, struct sk_buff *skb, -+ struct ieee80211_rx_status *rx_status, -+ struct rtw_rx_pkt_stat *pkt_stat); -+ -+static inline -+void rtw_update_rx_freq_for_invalid(struct rtw_dev *rtwdev, struct sk_buff *skb, -+ struct ieee80211_rx_status *rx_status, -+ struct rtw_rx_pkt_stat *pkt_stat) -+{ -+ if (pkt_stat->channel_invalid) -+ rtw_update_rx_freq_from_ie(rtwdev, skb, rx_status, pkt_stat); -+} -+ - - #endif ---- a/drivers/net/wireless/realtek/rtw88/sdio.c -+++ b/drivers/net/wireless/realtek/rtw88/sdio.c -@@ -948,6 +948,7 @@ static void rtw_sdio_rx_skb(struct rtw_d - skb_put(skb, pkt_stat->pkt_len); - skb_reserve(skb, pkt_offset); - -+ rtw_update_rx_freq_for_invalid(rtwdev, skb, rx_status, pkt_stat); - rtw_rx_stats(rtwdev, pkt_stat->vif, skb); - - ieee80211_rx_irqsafe(rtwdev->hw, skb); ---- a/drivers/net/wireless/realtek/rtw88/usb.c -+++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -579,6 +579,8 @@ static void rtw_usb_rx_handler(struct wo - - skb_put(skb, pkt_stat.pkt_len); - skb_reserve(skb, pkt_offset); -+ -+ rtw_update_rx_freq_for_invalid(rtwdev, skb, &rx_status, &pkt_stat); - memcpy(skb->cb, &rx_status, sizeof(rx_status)); - ieee80211_rx_irqsafe(rtwdev->hw, skb); - } diff --git a/package/kernel/mac80211/patches/rtl/010-v6.12-wifi-rtw88-usb-Init-RX-burst-length-according-to-USB.patch b/package/kernel/mac80211/patches/rtl/010-v6.12-wifi-rtw88-usb-Init-RX-burst-length-according-to-USB.patch deleted file mode 100644 index 191c87ff37a..00000000000 --- a/package/kernel/mac80211/patches/rtl/010-v6.12-wifi-rtw88-usb-Init-RX-burst-length-according-to-USB.patch +++ /dev/null @@ -1,73 +0,0 @@ -From fbbd8cb347e25b68d25c4f3871821afc495ee7a9 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Thu, 8 Aug 2024 01:19:36 +0300 -Subject: [PATCH] wifi: rtw88: usb: Init RX burst length according to USB speed - -This is needed in order to make USB RX aggregation work with RTL8811CU -(and presumably RTL8822BU and RTL8822CU also). - -I don't know what BIT_DMA_BURST_CNT, BIT_DMA_MODE, and BIT_DROP_DATA_EN -are doing. - -Tested with RTL8822CU, RTL8811CU, and RTL8723DU. - -The RX speed is unchanged in my tests. - -Tested-by: Sascha Hauer -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/ac569c6f-7129-4341-b523-901fe10cabff@gmail.com ---- - drivers/net/wireless/realtek/rtw88/reg.h | 6 ++++++ - drivers/net/wireless/realtek/rtw88/usb.c | 23 ++++++++++++++++++++++- - 2 files changed, 28 insertions(+), 1 deletion(-) - ---- a/drivers/net/wireless/realtek/rtw88/reg.h -+++ b/drivers/net/wireless/realtek/rtw88/reg.h -@@ -322,6 +322,12 @@ - #define REG_RXDMA_DPR 0x028C - #define REG_RXDMA_MODE 0x0290 - #define BIT_DMA_MODE BIT(1) -+#define BIT_DMA_BURST_CNT GENMASK(3, 2) -+#define BIT_DMA_BURST_SIZE GENMASK(5, 4) -+#define BIT_DMA_BURST_SIZE_64 2 -+#define BIT_DMA_BURST_SIZE_512 1 -+#define BIT_DMA_BURST_SIZE_1024 0 -+ - #define REG_RXPKTNUM 0x02B0 - - #define REG_INT_MIG 0x0304 ---- a/drivers/net/wireless/realtek/rtw88/usb.c -+++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -720,9 +720,30 @@ static void rtw_usb_link_ps(struct rtw_d - /* empty function for rtw_hci_ops */ - } - -+static void rtw_usb_init_burst_pkt_len(struct rtw_dev *rtwdev) -+{ -+ struct rtw_usb *rtwusb = rtw_get_usb_priv(rtwdev); -+ enum usb_device_speed speed = rtwusb->udev->speed; -+ u8 rxdma, burst_size; -+ -+ rxdma = BIT_DMA_BURST_CNT | BIT_DMA_MODE; -+ -+ if (speed == USB_SPEED_SUPER) -+ burst_size = BIT_DMA_BURST_SIZE_1024; -+ else if (speed == USB_SPEED_HIGH) -+ burst_size = BIT_DMA_BURST_SIZE_512; -+ else -+ burst_size = BIT_DMA_BURST_SIZE_64; -+ -+ u8p_replace_bits(&rxdma, burst_size, BIT_DMA_BURST_SIZE); -+ -+ rtw_write8(rtwdev, REG_RXDMA_MODE, rxdma); -+ rtw_write16_set(rtwdev, REG_TXDMA_OFFSET_CHK, BIT_DROP_DATA_EN); -+} -+ - static void rtw_usb_interface_cfg(struct rtw_dev *rtwdev) - { -- /* empty function for rtw_hci_ops */ -+ rtw_usb_init_burst_pkt_len(rtwdev); - } - - static struct rtw_hci_ops rtw_usb_ops = { diff --git a/package/kernel/mac80211/patches/rtl/011-v6.12-wifi-rtw88-usb-Update-the-RX-stats-after-every-frame.patch b/package/kernel/mac80211/patches/rtl/011-v6.12-wifi-rtw88-usb-Update-the-RX-stats-after-every-frame.patch deleted file mode 100644 index f78f43b4647..00000000000 --- a/package/kernel/mac80211/patches/rtl/011-v6.12-wifi-rtw88-usb-Update-the-RX-stats-after-every-frame.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 38ea04a79ad0f8cc30bb5e9ad98d665e4ae5060c Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Thu, 8 Aug 2024 01:20:36 +0300 -Subject: [PATCH] wifi: rtw88: usb: Update the RX stats after every frame - -Update the number of received unicast data frames and bytes every time -a frame is received. This is what the PCI and SDIO drivers do. - -This has an influence on the power saving, bluetooth coexistence, and -(in a future patch) the use of RX aggregation. - -Tested with RTL8822CU, RTL8811CU, and RTL8723DU. - -Tested-by: Sascha Hauer -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/75a2ca52-8f01-45c5-926f-d3a68ae3b284@gmail.com ---- - drivers/net/wireless/realtek/rtw88/usb.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/drivers/net/wireless/realtek/rtw88/usb.c -+++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -581,6 +581,7 @@ static void rtw_usb_rx_handler(struct wo - skb_reserve(skb, pkt_offset); - - rtw_update_rx_freq_for_invalid(rtwdev, skb, &rx_status, &pkt_stat); -+ rtw_rx_stats(rtwdev, pkt_stat.vif, skb); - memcpy(skb->cb, &rx_status, sizeof(rx_status)); - ieee80211_rx_irqsafe(rtwdev->hw, skb); - } diff --git a/package/kernel/mac80211/patches/rtl/012-v6.12-wifi-rtw88-usb-Support-RX-aggregation.patch b/package/kernel/mac80211/patches/rtl/012-v6.12-wifi-rtw88-usb-Support-RX-aggregation.patch deleted file mode 100644 index bc8eac898b2..00000000000 --- a/package/kernel/mac80211/patches/rtl/012-v6.12-wifi-rtw88-usb-Support-RX-aggregation.patch +++ /dev/null @@ -1,118 +0,0 @@ -From df3d8f463b1dfc7cb8f4fb52b1b81d290b850d03 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Thu, 8 Aug 2024 01:21:36 +0300 -Subject: [PATCH] wifi: rtw88: usb: Support RX aggregation - -The chips can be configured to aggregate several frames into a single -USB transfer. Modify rtw_usb_rx_handler() to support this case. - -RX aggregation improves the RX speed of RTL8811CU on certain ARM -systems, like the NanoPi NEO Core2. It also improves the RX speed of -RTL8822CU on some x86_64 systems. - -Currently none of the chips are configured to aggregate frames. - -Tested with RTL8822CU, RTL8811CU, and RTL8723DU. - -Reviewed-by: Sascha Hauer -Tested-by: Sascha Hauer -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/f845826d-de71-492d-9a22-e48c07989a1f@gmail.com ---- - drivers/net/wireless/realtek/rtw88/usb.c | 61 ++++++++++++++++-------- - 1 file changed, 40 insertions(+), 21 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/usb.c -+++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -546,11 +546,12 @@ static void rtw_usb_rx_handler(struct wo - struct rtw_usb *rtwusb = container_of(work, struct rtw_usb, rx_work); - struct rtw_dev *rtwdev = rtwusb->rtwdev; - const struct rtw_chip_info *chip = rtwdev->chip; -- struct rtw_rx_pkt_stat pkt_stat; -+ u32 pkt_desc_sz = chip->rx_pkt_desc_sz; - struct ieee80211_rx_status rx_status; -+ u32 pkt_offset, next_pkt, urb_len; -+ struct rtw_rx_pkt_stat pkt_stat; -+ struct sk_buff *next_skb; - struct sk_buff *skb; -- u32 pkt_desc_sz = chip->rx_pkt_desc_sz; -- u32 pkt_offset; - u8 *rx_desc; - int limit; - -@@ -559,31 +560,48 @@ static void rtw_usb_rx_handler(struct wo - if (!skb) - break; - -- rx_desc = skb->data; -- chip->ops->query_rx_desc(rtwdev, rx_desc, &pkt_stat, -- &rx_status); -- pkt_offset = pkt_desc_sz + pkt_stat.drv_info_sz + -- pkt_stat.shift; -- -- if (pkt_stat.is_c2h) { -- skb_put(skb, pkt_stat.pkt_len + pkt_offset); -- rtw_fw_c2h_cmd_rx_irqsafe(rtwdev, pkt_offset, skb); -- continue; -- } -- - if (skb_queue_len(&rtwusb->rx_queue) >= RTW_USB_MAX_RXQ_LEN) { - dev_dbg_ratelimited(rtwdev->dev, "failed to get rx_queue, overflow\n"); - dev_kfree_skb_any(skb); - continue; - } - -- skb_put(skb, pkt_stat.pkt_len); -- skb_reserve(skb, pkt_offset); -+ urb_len = skb->len; -+ -+ do { -+ rx_desc = skb->data; -+ chip->ops->query_rx_desc(rtwdev, rx_desc, &pkt_stat, -+ &rx_status); -+ pkt_offset = pkt_desc_sz + pkt_stat.drv_info_sz + -+ pkt_stat.shift; -+ -+ next_pkt = round_up(pkt_stat.pkt_len + pkt_offset, 8); -+ -+ if (urb_len >= next_pkt + pkt_desc_sz) -+ next_skb = skb_clone(skb, GFP_KERNEL); -+ else -+ next_skb = NULL; -+ -+ if (pkt_stat.is_c2h) { -+ skb_trim(skb, pkt_stat.pkt_len + pkt_offset); -+ rtw_fw_c2h_cmd_rx_irqsafe(rtwdev, pkt_offset, skb); -+ } else { -+ skb_pull(skb, pkt_offset); -+ skb_trim(skb, pkt_stat.pkt_len); -+ rtw_update_rx_freq_for_invalid(rtwdev, skb, -+ &rx_status, -+ &pkt_stat); -+ rtw_rx_stats(rtwdev, pkt_stat.vif, skb); -+ memcpy(skb->cb, &rx_status, sizeof(rx_status)); -+ ieee80211_rx_irqsafe(rtwdev->hw, skb); -+ } -+ -+ skb = next_skb; -+ if (skb) -+ skb_pull(skb, next_pkt); - -- rtw_update_rx_freq_for_invalid(rtwdev, skb, &rx_status, &pkt_stat); -- rtw_rx_stats(rtwdev, pkt_stat.vif, skb); -- memcpy(skb->cb, &rx_status, sizeof(rx_status)); -- ieee80211_rx_irqsafe(rtwdev->hw, skb); -+ urb_len -= next_pkt; -+ } while (skb); - } - } - -@@ -627,6 +645,7 @@ static void rtw_usb_read_port_complete(s - if (skb) - dev_kfree_skb_any(skb); - } else { -+ skb_put(skb, urb->actual_length); - skb_queue_tail(&rtwusb->rx_queue, skb); - queue_work(rtwusb->rxwq, &rtwusb->rx_work); - } diff --git a/package/kernel/mac80211/patches/rtl/013-v6.12-wifi-rtw88-Enable-USB-RX-aggregation-for-8822c-8822b.patch b/package/kernel/mac80211/patches/rtl/013-v6.12-wifi-rtw88-Enable-USB-RX-aggregation-for-8822c-8822b.patch deleted file mode 100644 index 71175324e6d..00000000000 --- a/package/kernel/mac80211/patches/rtl/013-v6.12-wifi-rtw88-Enable-USB-RX-aggregation-for-8822c-8822b.patch +++ /dev/null @@ -1,168 +0,0 @@ -From 002a5db9a52a0e7af0fa9a450d31049748435748 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Thu, 8 Aug 2024 01:23:06 +0300 -Subject: [PATCH] wifi: rtw88: Enable USB RX aggregation for 8822c/8822b/8821c - -Enable USB RX aggregation when there is at least 1 Mbps RX or TX -traffic, otherwise disable it. - -USB RX aggregation improves the RX speed of RTL8811CU on certain ARM -systems, like the NanoPi NEO Core2. Before: 28 Mbps, after: 231 Mbps. - -It also improves the RX speed of RTL8822CU on some x86_64 systems. -Before: ~200 Mbps, after: ~300 Mbps. - -The official drivers for these chips use the same logic for SDIO, but -for some reason the SDIO driver in rtw88 always enables RX aggregation, -so this patch only toggles aggregation for USB devices. - -RTL8703B is likely not found in USB devices, and RTL8723DU doesn't like -aggregation. - -Tested-by: Sascha Hauer -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/b4c0d54c-6755-4b0f-9dd7-f9196fd74b68@gmail.com ---- - drivers/net/wireless/realtek/rtw88/hci.h | 7 ++++ - drivers/net/wireless/realtek/rtw88/main.c | 13 +++++--- - drivers/net/wireless/realtek/rtw88/pci.c | 1 + - drivers/net/wireless/realtek/rtw88/sdio.c | 1 + - drivers/net/wireless/realtek/rtw88/usb.c | 40 +++++++++++++++++++++++ - 5 files changed, 58 insertions(+), 4 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/hci.h -+++ b/drivers/net/wireless/realtek/rtw88/hci.h -@@ -18,6 +18,7 @@ struct rtw_hci_ops { - void (*deep_ps)(struct rtw_dev *rtwdev, bool enter); - void (*link_ps)(struct rtw_dev *rtwdev, bool enter); - void (*interface_cfg)(struct rtw_dev *rtwdev); -+ void (*dynamic_rx_agg)(struct rtw_dev *rtwdev, bool enable); - - int (*write_data_rsvd_page)(struct rtw_dev *rtwdev, u8 *buf, u32 size); - int (*write_data_h2c)(struct rtw_dev *rtwdev, u8 *buf, u32 size); -@@ -72,6 +73,12 @@ static inline void rtw_hci_interface_cfg - rtwdev->hci.ops->interface_cfg(rtwdev); - } - -+static inline void rtw_hci_dynamic_rx_agg(struct rtw_dev *rtwdev, bool enable) -+{ -+ if (rtwdev->hci.ops->dynamic_rx_agg) -+ rtwdev->hci.ops->dynamic_rx_agg(rtwdev, enable); -+} -+ - static inline int - rtw_hci_write_data_rsvd_page(struct rtw_dev *rtwdev, u8 *buf, u32 size) - { ---- a/drivers/net/wireless/realtek/rtw88/main.c -+++ b/drivers/net/wireless/realtek/rtw88/main.c -@@ -212,6 +212,7 @@ static void rtw_watch_dog_work(struct wo - struct rtw_traffic_stats *stats = &rtwdev->stats; - struct rtw_watch_dog_iter_data data = {}; - bool busy_traffic = test_bit(RTW_FLAG_BUSY_TRAFFIC, rtwdev->flags); -+ u32 tx_unicast_mbps, rx_unicast_mbps; - bool ps_active; - - mutex_lock(&rtwdev->mutex); -@@ -236,10 +237,11 @@ static void rtw_watch_dog_work(struct wo - else - ps_active = false; - -- ewma_tp_add(&stats->tx_ewma_tp, -- (u32)(stats->tx_unicast >> RTW_TP_SHIFT)); -- ewma_tp_add(&stats->rx_ewma_tp, -- (u32)(stats->rx_unicast >> RTW_TP_SHIFT)); -+ tx_unicast_mbps = stats->tx_unicast >> RTW_TP_SHIFT; -+ rx_unicast_mbps = stats->rx_unicast >> RTW_TP_SHIFT; -+ -+ ewma_tp_add(&stats->tx_ewma_tp, tx_unicast_mbps); -+ ewma_tp_add(&stats->rx_ewma_tp, rx_unicast_mbps); - stats->tx_throughput = ewma_tp_read(&stats->tx_ewma_tp); - stats->rx_throughput = ewma_tp_read(&stats->rx_ewma_tp); - -@@ -259,6 +261,9 @@ static void rtw_watch_dog_work(struct wo - - rtw_phy_dynamic_mechanism(rtwdev); - -+ rtw_hci_dynamic_rx_agg(rtwdev, -+ tx_unicast_mbps >= 1 || rx_unicast_mbps >= 1); -+ - data.rtwdev = rtwdev; - /* rtw_iterate_vifs internally uses an atomic iterator which is needed - * to avoid taking local->iflist_mtx mutex ---- a/drivers/net/wireless/realtek/rtw88/pci.c -+++ b/drivers/net/wireless/realtek/rtw88/pci.c -@@ -1601,6 +1601,7 @@ static struct rtw_hci_ops rtw_pci_ops = - .deep_ps = rtw_pci_deep_ps, - .link_ps = rtw_pci_link_ps, - .interface_cfg = rtw_pci_interface_cfg, -+ .dynamic_rx_agg = NULL, - - .read8 = rtw_pci_read8, - .read16 = rtw_pci_read16, ---- a/drivers/net/wireless/realtek/rtw88/sdio.c -+++ b/drivers/net/wireless/realtek/rtw88/sdio.c -@@ -1157,6 +1157,7 @@ static struct rtw_hci_ops rtw_sdio_ops = - .deep_ps = rtw_sdio_deep_ps, - .link_ps = rtw_sdio_link_ps, - .interface_cfg = rtw_sdio_interface_cfg, -+ .dynamic_rx_agg = NULL, - - .read8 = rtw_sdio_read8, - .read16 = rtw_sdio_read16, ---- a/drivers/net/wireless/realtek/rtw88/usb.c -+++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -766,6 +766,45 @@ static void rtw_usb_interface_cfg(struct - rtw_usb_init_burst_pkt_len(rtwdev); - } - -+static void rtw_usb_dynamic_rx_agg_v1(struct rtw_dev *rtwdev, bool enable) -+{ -+ u8 size, timeout; -+ u16 val16; -+ -+ rtw_write32_set(rtwdev, REG_RXDMA_AGG_PG_TH, BIT_EN_PRE_CALC); -+ rtw_write8_set(rtwdev, REG_TXDMA_PQ_MAP, BIT_RXDMA_AGG_EN); -+ rtw_write8_clr(rtwdev, REG_RXDMA_AGG_PG_TH + 3, BIT(7)); -+ -+ if (enable) { -+ size = 0x5; -+ timeout = 0x20; -+ } else { -+ size = 0x0; -+ timeout = 0x1; -+ } -+ val16 = u16_encode_bits(size, BIT_RXDMA_AGG_PG_TH) | -+ u16_encode_bits(timeout, BIT_DMA_AGG_TO_V1); -+ -+ rtw_write16(rtwdev, REG_RXDMA_AGG_PG_TH, val16); -+} -+ -+static void rtw_usb_dynamic_rx_agg(struct rtw_dev *rtwdev, bool enable) -+{ -+ switch (rtwdev->chip->id) { -+ case RTW_CHIP_TYPE_8822C: -+ case RTW_CHIP_TYPE_8822B: -+ case RTW_CHIP_TYPE_8821C: -+ rtw_usb_dynamic_rx_agg_v1(rtwdev, enable); -+ break; -+ case RTW_CHIP_TYPE_8723D: -+ /* Doesn't like aggregation. */ -+ break; -+ case RTW_CHIP_TYPE_8703B: -+ /* Likely not found in USB devices. */ -+ break; -+ } -+} -+ - static struct rtw_hci_ops rtw_usb_ops = { - .tx_write = rtw_usb_tx_write, - .tx_kick_off = rtw_usb_tx_kick_off, -@@ -775,6 +814,7 @@ static struct rtw_hci_ops rtw_usb_ops = - .deep_ps = rtw_usb_deep_ps, - .link_ps = rtw_usb_link_ps, - .interface_cfg = rtw_usb_interface_cfg, -+ .dynamic_rx_agg = rtw_usb_dynamic_rx_agg, - - .write8 = rtw_usb_write8, - .write16 = rtw_usb_write16, diff --git a/package/kernel/mac80211/patches/rtl/016-v6.12-wifi-rtw88-assign-mac_id-for-vif-sta-and-update-to-T.patch b/package/kernel/mac80211/patches/rtl/016-v6.12-wifi-rtw88-assign-mac_id-for-vif-sta-and-update-to-T.patch deleted file mode 100644 index ce110c5c90c..00000000000 --- a/package/kernel/mac80211/patches/rtl/016-v6.12-wifi-rtw88-assign-mac_id-for-vif-sta-and-update-to-T.patch +++ /dev/null @@ -1,231 +0,0 @@ -From 902cb7b11f9a7ff07233cc4c626b54c3e4703149 Mon Sep 17 00:00:00 2001 -From: Ping-Ke Shih -Date: Mon, 19 Aug 2024 10:52:48 +0800 -Subject: [PATCH] wifi: rtw88: assign mac_id for vif/sta and update to TX desc - -A mac_id as an instance in firmware has to be assigned for each station -including AP and connected stations. Firmware will use the mac_id to -control TX rate and do statistics. - -Assignment rule is to assign mac_id to each vif when adding vif. -For station mode, sta->mac_id will reuse vif->mac_id. For AP mode, -dynamically allocate an sta->mac_id to a station, and vif->mac_id is -used to send broadcast/multicast packets which are not belong to -a station. For example, - - vif->mac_id sta->mac_id -vif0 (STA mode) 0 0 -vif1 (AP mode) 1 2... - -By the way, remove unused RTW_BC_MC_MACID, which was planed to send -broadcast/multicast packets on fixed mac_id. - -Tested-on RTL8822CE with STA + AP SCC mode. - -Link: https://lore.kernel.org/linux-wireless/e4be0a75-43b2-4ae5-9aab-5c4a88e78097@gmail.com/ -Cc: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/20240819025248.17939-1-pkshih@realtek.com ---- - drivers/net/wireless/realtek/rtw88/mac80211.c | 13 ++++++-- - drivers/net/wireless/realtek/rtw88/main.c | 30 ++++++++----------- - drivers/net/wireless/realtek/rtw88/main.h | 14 +++++++-- - drivers/net/wireless/realtek/rtw88/tx.c | 11 +++++-- - drivers/net/wireless/realtek/rtw88/tx.h | 1 + - 5 files changed, 44 insertions(+), 25 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/mac80211.c -+++ b/drivers/net/wireless/realtek/rtw88/mac80211.c -@@ -167,6 +167,12 @@ static int rtw_ops_add_interface(struct - - mutex_lock(&rtwdev->mutex); - -+ rtwvif->mac_id = rtw_acquire_macid(rtwdev); -+ if (rtwvif->mac_id >= RTW_MAX_MAC_ID_NUM) { -+ mutex_unlock(&rtwdev->mutex); -+ return -ENOSPC; -+ } -+ - port = find_first_zero_bit(rtwdev->hw_port, RTW_PORT_NUM); - if (port >= RTW_PORT_NUM) { - mutex_unlock(&rtwdev->mutex); -@@ -214,7 +220,8 @@ static int rtw_ops_add_interface(struct - - mutex_unlock(&rtwdev->mutex); - -- rtw_dbg(rtwdev, RTW_DBG_STATE, "start vif %pM on port %d\n", vif->addr, rtwvif->port); -+ rtw_dbg(rtwdev, RTW_DBG_STATE, "start vif %pM mac_id %d on port %d\n", -+ vif->addr, rtwvif->mac_id, rtwvif->port); - return 0; - } - -@@ -225,7 +232,8 @@ static void rtw_ops_remove_interface(str - struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv; - u32 config = 0; - -- rtw_dbg(rtwdev, RTW_DBG_STATE, "stop vif %pM on port %d\n", vif->addr, rtwvif->port); -+ rtw_dbg(rtwdev, RTW_DBG_STATE, "stop vif %pM mac_id %d on port %d\n", -+ vif->addr, rtwvif->mac_id, rtwvif->port); - - mutex_lock(&rtwdev->mutex); - -@@ -242,6 +250,7 @@ static void rtw_ops_remove_interface(str - config |= PORT_SET_BCN_CTRL; - rtw_vif_port_config(rtwdev, rtwvif, config); - clear_bit(rtwvif->port, rtwdev->hw_port); -+ rtw_release_macid(rtwdev, rtwvif->mac_id); - rtw_recalc_lps(rtwdev, NULL); - - mutex_unlock(&rtwdev->mutex); ---- a/drivers/net/wireless/realtek/rtw88/main.c -+++ b/drivers/net/wireless/realtek/rtw88/main.c -@@ -311,17 +311,6 @@ static void rtw_ips_work(struct work_str - mutex_unlock(&rtwdev->mutex); - } - --static u8 rtw_acquire_macid(struct rtw_dev *rtwdev) --{ -- unsigned long mac_id; -- -- mac_id = find_first_zero_bit(rtwdev->mac_id_map, RTW_MAX_MAC_ID_NUM); -- if (mac_id < RTW_MAX_MAC_ID_NUM) -- set_bit(mac_id, rtwdev->mac_id_map); -- -- return mac_id; --} -- - static void rtw_sta_rc_work(struct work_struct *work) - { - struct rtw_sta_info *si = container_of(work, struct rtw_sta_info, -@@ -340,12 +329,14 @@ int rtw_sta_add(struct rtw_dev *rtwdev, - struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv; - int i; - -- si->mac_id = rtw_acquire_macid(rtwdev); -- if (si->mac_id >= RTW_MAX_MAC_ID_NUM) -- return -ENOSPC; -+ if (vif->type == NL80211_IFTYPE_STATION) { -+ si->mac_id = rtwvif->mac_id; -+ } else { -+ si->mac_id = rtw_acquire_macid(rtwdev); -+ if (si->mac_id >= RTW_MAX_MAC_ID_NUM) -+ return -ENOSPC; -+ } - -- if (vif->type == NL80211_IFTYPE_STATION && vif->cfg.assoc == 0) -- rtwvif->mac_id = si->mac_id; - si->rtwdev = rtwdev; - si->sta = sta; - si->vif = vif; -@@ -370,11 +361,13 @@ void rtw_sta_remove(struct rtw_dev *rtwd - bool fw_exist) - { - struct rtw_sta_info *si = (struct rtw_sta_info *)sta->drv_priv; -+ struct ieee80211_vif *vif = si->vif; - int i; - - cancel_work_sync(&si->rc_work); - -- rtw_release_macid(rtwdev, si->mac_id); -+ if (vif->type != NL80211_IFTYPE_STATION) -+ rtw_release_macid(rtwdev, si->mac_id); - if (fw_exist) - rtw_fw_media_status_report(rtwdev, si->mac_id, false); - -@@ -614,6 +607,8 @@ static void rtw_reset_vif_iter(void *dat - rtw_bf_disassoc(rtwdev, vif, NULL); - rtw_vif_assoc_changed(rtwvif, NULL); - rtw_txq_cleanup(rtwdev, vif->txq); -+ -+ rtw_release_macid(rtwdev, rtwvif->mac_id); - } - - void rtw_fw_recovery(struct rtw_dev *rtwdev) -@@ -2139,7 +2134,6 @@ int rtw_core_init(struct rtw_dev *rtwdev - rtwdev->sec.total_cam_num = 32; - rtwdev->hal.current_channel = 1; - rtwdev->dm_info.fix_rate = U8_MAX; -- set_bit(RTW_BC_MC_MACID, rtwdev->mac_id_map); - - rtw_stats_init(rtwdev); - ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -742,7 +742,6 @@ struct rtw_txq { - unsigned long flags; - }; - --#define RTW_BC_MC_MACID 1 - DECLARE_EWMA(rssi, 10, 16); - - struct rtw_sta_info { -@@ -805,7 +804,7 @@ struct rtw_bf_info { - struct rtw_vif { - enum rtw_net_type net_type; - u16 aid; -- u8 mac_id; /* for STA mode only */ -+ u8 mac_id; - u8 mac_addr[ETH_ALEN]; - u8 bssid[ETH_ALEN]; - u8 port; -@@ -2131,6 +2130,17 @@ static inline bool rtw_chip_has_tx_stbc( - return rtwdev->chip->tx_stbc; - } - -+static inline u8 rtw_acquire_macid(struct rtw_dev *rtwdev) -+{ -+ unsigned long mac_id; -+ -+ mac_id = find_first_zero_bit(rtwdev->mac_id_map, RTW_MAX_MAC_ID_NUM); -+ if (mac_id < RTW_MAX_MAC_ID_NUM) -+ set_bit(mac_id, rtwdev->mac_id_map); -+ -+ return mac_id; -+} -+ - static inline void rtw_release_macid(struct rtw_dev *rtwdev, u8 mac_id) - { - clear_bit(mac_id, rtwdev->mac_id_map); ---- a/drivers/net/wireless/realtek/rtw88/tx.c -+++ b/drivers/net/wireless/realtek/rtw88/tx.c -@@ -46,7 +46,8 @@ void rtw_tx_fill_tx_desc(struct rtw_tx_p - le32_encode_bits(pkt_info->ls, RTW_TX_DESC_W0_LS) | - le32_encode_bits(pkt_info->dis_qselseq, RTW_TX_DESC_W0_DISQSELSEQ); - -- tx_desc->w1 = le32_encode_bits(pkt_info->qsel, RTW_TX_DESC_W1_QSEL) | -+ tx_desc->w1 = le32_encode_bits(pkt_info->mac_id, RTW_TX_DESC_W1_MACID) | -+ le32_encode_bits(pkt_info->qsel, RTW_TX_DESC_W1_QSEL) | - le32_encode_bits(pkt_info->rate_id, RTW_TX_DESC_W1_RATE_ID) | - le32_encode_bits(pkt_info->sec_type, RTW_TX_DESC_W1_SEC_TYPE) | - le32_encode_bits(pkt_info->pkt_offset, RTW_TX_DESC_W1_PKT_OFFSET) | -@@ -401,14 +402,18 @@ void rtw_tx_pkt_info_update(struct rtw_d - const struct rtw_chip_info *chip = rtwdev->chip; - struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; -+ struct ieee80211_vif *vif = info->control.vif; - struct rtw_sta_info *si; -- struct ieee80211_vif *vif = NULL; -+ struct rtw_vif *rtwvif; - __le16 fc = hdr->frame_control; - bool bmc; - - if (sta) { - si = (struct rtw_sta_info *)sta->drv_priv; -- vif = si->vif; -+ pkt_info->mac_id = si->mac_id; -+ } else if (vif) { -+ rtwvif = (struct rtw_vif *)vif->drv_priv; -+ pkt_info->mac_id = rtwvif->mac_id; - } - - if (ieee80211_is_mgmt(fc) || ieee80211_is_nullfunc(fc)) ---- a/drivers/net/wireless/realtek/rtw88/tx.h -+++ b/drivers/net/wireless/realtek/rtw88/tx.h -@@ -27,6 +27,7 @@ struct rtw_tx_desc { - #define RTW_TX_DESC_W0_BMC BIT(24) - #define RTW_TX_DESC_W0_LS BIT(26) - #define RTW_TX_DESC_W0_DISQSELSEQ BIT(31) -+#define RTW_TX_DESC_W1_MACID GENMASK(7, 0) - #define RTW_TX_DESC_W1_QSEL GENMASK(12, 8) - #define RTW_TX_DESC_W1_RATE_ID GENMASK(20, 16) - #define RTW_TX_DESC_W1_SEC_TYPE GENMASK(23, 22) diff --git a/package/kernel/mac80211/patches/rtl/019-v6.13-wifi-rtw88-Parse-the-RX-descriptor-with-a-single-fun.patch b/package/kernel/mac80211/patches/rtl/019-v6.13-wifi-rtw88-Parse-the-RX-descriptor-with-a-single-fun.patch index 9828f507b64..4a32831ea3e 100644 --- a/package/kernel/mac80211/patches/rtl/019-v6.13-wifi-rtw88-Parse-the-RX-descriptor-with-a-single-fun.patch +++ b/package/kernel/mac80211/patches/rtl/019-v6.13-wifi-rtw88-Parse-the-RX-descriptor-with-a-single-fun.patch @@ -547,7 +547,7 @@ Link: https://patch.msgid.link/913f1747-38fc-4409-85a4-57bb9cee506b@gmail.com --- a/drivers/net/wireless/realtek/rtw88/usb.c +++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -570,8 +570,8 @@ static void rtw_usb_rx_handler(struct wo +@@ -571,8 +571,8 @@ static void rtw_usb_rx_handler(struct wo do { rx_desc = skb->data; diff --git a/package/kernel/mac80211/patches/rtl/020-v6.12-wifi-rtw88-Fix-the-RX-aggregation-in-USB-3-mode.patch b/package/kernel/mac80211/patches/rtl/020-v6.12-wifi-rtw88-Fix-the-RX-aggregation-in-USB-3-mode.patch deleted file mode 100644 index 174ee10816e..00000000000 --- a/package/kernel/mac80211/patches/rtl/020-v6.12-wifi-rtw88-Fix-the-RX-aggregation-in-USB-3-mode.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 4aefde403da7af30757915e0462d88398c9388c5 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Tue, 8 Oct 2024 21:44:02 +0300 -Subject: [PATCH] wifi: rtw88: Fix the RX aggregation in USB 3 mode - -RTL8822CU, RTL8822BU, and RTL8821CU don't need BIT_EN_PRE_CALC. -In fact, RTL8822BU in USB 3 mode doesn't pass all the frames to the -driver, resulting in much lower download speed than normal: - -$ iperf3 -c 192.168.0.1 -R -Connecting to host 192.168.0.1, port 5201 -Reverse mode, remote host 192.168.0.1 is sending -[ 5] local 192.168.0.50 port 43062 connected to 192.168.0.1 port 5201 -[ ID] Interval Transfer Bitrate -[ 5] 0.00-1.00 sec 26.9 MBytes 225 Mbits/sec -[ 5] 1.00-2.00 sec 7.50 MBytes 62.9 Mbits/sec -[ 5] 2.00-3.00 sec 8.50 MBytes 71.3 Mbits/sec -[ 5] 3.00-4.00 sec 8.38 MBytes 70.3 Mbits/sec -[ 5] 4.00-5.00 sec 7.75 MBytes 65.0 Mbits/sec -[ 5] 5.00-6.00 sec 8.00 MBytes 67.1 Mbits/sec -[ 5] 6.00-7.00 sec 8.00 MBytes 67.1 Mbits/sec -[ 5] 7.00-8.00 sec 7.75 MBytes 65.0 Mbits/sec -[ 5] 8.00-9.00 sec 7.88 MBytes 66.1 Mbits/sec -[ 5] 9.00-10.00 sec 7.88 MBytes 66.1 Mbits/sec -- - - - - - - - - - - - - - - - - - - - - - - - - -[ ID] Interval Transfer Bitrate Retr -[ 5] 0.00-10.02 sec 102 MBytes 85.1 Mbits/sec 224 sender -[ 5] 0.00-10.00 sec 98.6 MBytes 82.7 Mbits/sec receiver - -Don't set BIT_EN_PRE_CALC. Then the speed is much better: - -% iperf3 -c 192.168.0.1 -R -Connecting to host 192.168.0.1, port 5201 -Reverse mode, remote host 192.168.0.1 is sending -[ 5] local 192.168.0.50 port 39000 connected to 192.168.0.1 port 5201 -[ ID] Interval Transfer Bitrate -[ 5] 0.00-1.00 sec 52.8 MBytes 442 Mbits/sec -[ 5] 1.00-2.00 sec 71.9 MBytes 603 Mbits/sec -[ 5] 2.00-3.00 sec 74.8 MBytes 627 Mbits/sec -[ 5] 3.00-4.00 sec 75.9 MBytes 636 Mbits/sec -[ 5] 4.00-5.00 sec 76.0 MBytes 638 Mbits/sec -[ 5] 5.00-6.00 sec 74.1 MBytes 622 Mbits/sec -[ 5] 6.00-7.00 sec 74.0 MBytes 621 Mbits/sec -[ 5] 7.00-8.00 sec 76.0 MBytes 638 Mbits/sec -[ 5] 8.00-9.00 sec 74.4 MBytes 624 Mbits/sec -[ 5] 9.00-10.00 sec 63.9 MBytes 536 Mbits/sec -- - - - - - - - - - - - - - - - - - - - - - - - - -[ ID] Interval Transfer Bitrate Retr -[ 5] 0.00-10.00 sec 717 MBytes 601 Mbits/sec 24 sender -[ 5] 0.00-10.00 sec 714 MBytes 599 Mbits/sec receiver - -Fixes: 002a5db9a52a ("wifi: rtw88: Enable USB RX aggregation for 8822c/8822b/8821c") -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Kalle Valo -Link: https://patch.msgid.link/afb94a82-3d18-459e-97fc-1a217608cdf0@gmail.com ---- - drivers/net/wireless/realtek/rtw88/usb.c | 1 - - 1 file changed, 1 deletion(-) - ---- a/drivers/net/wireless/realtek/rtw88/usb.c -+++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -771,7 +771,6 @@ static void rtw_usb_dynamic_rx_agg_v1(st - u8 size, timeout; - u16 val16; - -- rtw_write32_set(rtwdev, REG_RXDMA_AGG_PG_TH, BIT_EN_PRE_CALC); - rtw_write8_set(rtwdev, REG_TXDMA_PQ_MAP, BIT_RXDMA_AGG_EN); - rtw_write8_clr(rtwdev, REG_RXDMA_AGG_PG_TH + 3, BIT(7)); - diff --git a/package/kernel/mac80211/patches/rtl/030-v6.13-wifi-rtw88-Enable-data-rate-fallback-for-older-chips.patch b/package/kernel/mac80211/patches/rtl/030-v6.13-wifi-rtw88-Enable-data-rate-fallback-for-older-chips.patch index 153c04ee20f..944985edc97 100644 --- a/package/kernel/mac80211/patches/rtl/030-v6.13-wifi-rtw88-Enable-data-rate-fallback-for-older-chips.patch +++ b/package/kernel/mac80211/patches/rtl/030-v6.13-wifi-rtw88-Enable-data-rate-fallback-for-older-chips.patch @@ -174,7 +174,7 @@ Link: https://patch.msgid.link/2b3e3e6f-541b-4a3b-8ca3-65b267e6a95a@gmail.com void rtw_tx_rsvd_page_pkt_info_update(struct rtw_dev *rtwdev, --- a/drivers/net/wireless/realtek/rtw88/usb.c +++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -457,7 +457,7 @@ static int rtw_usb_write_data(struct rtw +@@ -458,7 +458,7 @@ static int rtw_usb_write_data(struct rtw skb_put_data(skb, buf, size); skb_push(skb, chip->tx_pkt_desc_sz); memset(skb->data, 0, chip->tx_pkt_desc_sz); @@ -183,7 +183,7 @@ Link: https://patch.msgid.link/2b3e3e6f-541b-4a3b-8ca3-65b267e6a95a@gmail.com rtw_tx_fill_txdesc_checksum(rtwdev, pkt_info, skb->data); ret = rtw_usb_write_port(rtwdev, qsel, skb, -@@ -524,7 +524,7 @@ static int rtw_usb_tx_write(struct rtw_d +@@ -525,7 +525,7 @@ static int rtw_usb_tx_write(struct rtw_d pkt_desc = skb_push(skb, chip->tx_pkt_desc_sz); memset(pkt_desc, 0, chip->tx_pkt_desc_sz); ep = qsel_to_ep(rtwusb, pkt_info->qsel); diff --git a/package/kernel/mac80211/patches/rtl/034-v6.13-wifi-rtw88-usb-Set-pkt_info.ls-for-the-reserved-page.patch b/package/kernel/mac80211/patches/rtl/034-v6.13-wifi-rtw88-usb-Set-pkt_info.ls-for-the-reserved-page.patch index 7c6e1358608..67d7d230f4e 100644 --- a/package/kernel/mac80211/patches/rtl/034-v6.13-wifi-rtw88-usb-Set-pkt_info.ls-for-the-reserved-page.patch +++ b/package/kernel/mac80211/patches/rtl/034-v6.13-wifi-rtw88-usb-Set-pkt_info.ls-for-the-reserved-page.patch @@ -17,7 +17,7 @@ Link: https://patch.msgid.link/e443f5d9-4b53-4f64-985c-64313ec80bef@gmail.com --- a/drivers/net/wireless/realtek/rtw88/usb.c +++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -477,6 +477,7 @@ static int rtw_usb_write_data_rsvd_page( +@@ -478,6 +478,7 @@ static int rtw_usb_write_data_rsvd_page( pkt_info.tx_pkt_size = size; pkt_info.qsel = TX_DESC_QSEL_BEACON; pkt_info.offset = chip->tx_pkt_desc_sz; diff --git a/package/kernel/mac80211/patches/rtl/048-wifi-rtw88-usb-Support-USB-3-with-RTL8812AU.patch b/package/kernel/mac80211/patches/rtl/048-wifi-rtw88-usb-Support-USB-3-with-RTL8812AU.patch index 2ccefb98939..33ca91d77d8 100644 --- a/package/kernel/mac80211/patches/rtl/048-wifi-rtw88-usb-Support-USB-3-with-RTL8812AU.patch +++ b/package/kernel/mac80211/patches/rtl/048-wifi-rtw88-usb-Support-USB-3-with-RTL8812AU.patch @@ -12,7 +12,7 @@ Signed-off-by: Bitterblue Smith --- a/drivers/net/wireless/realtek/rtw88/usb.c +++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -929,6 +929,32 @@ static void rtw_usb_intf_deinit(struct r +@@ -930,6 +930,32 @@ static void rtw_usb_intf_deinit(struct r usb_set_intfdata(intf, NULL); } @@ -45,7 +45,7 @@ Signed-off-by: Bitterblue Smith static int rtw_usb_switch_mode_new(struct rtw_dev *rtwdev) { enum usb_device_speed cur_speed; -@@ -982,7 +1008,8 @@ static int rtw_usb_switch_mode(struct rt +@@ -983,7 +1009,8 @@ static int rtw_usb_switch_mode(struct rt { u8 id = rtwdev->chip->id; @@ -55,7 +55,7 @@ Signed-off-by: Bitterblue Smith return 0; if (!rtwdev->efuse.usb_mode_switch) { -@@ -997,7 +1024,10 @@ static int rtw_usb_switch_mode(struct rt +@@ -998,7 +1025,10 @@ static int rtw_usb_switch_mode(struct rt return 0; } diff --git a/package/kernel/mac80211/patches/rtl/049-wifi-rtw88-usb-Enable-RX-aggregation-for-8821au-8812.patch b/package/kernel/mac80211/patches/rtl/049-wifi-rtw88-usb-Enable-RX-aggregation-for-8821au-8812.patch index 00775c0281e..d4c3ef34957 100644 --- a/package/kernel/mac80211/patches/rtl/049-wifi-rtw88-usb-Enable-RX-aggregation-for-8821au-8812.patch +++ b/package/kernel/mac80211/patches/rtl/049-wifi-rtw88-usb-Enable-RX-aggregation-for-8821au-8812.patch @@ -19,7 +19,7 @@ Signed-off-by: Bitterblue Smith --- a/drivers/net/wireless/realtek/rtw88/usb.c +++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -788,6 +788,32 @@ static void rtw_usb_dynamic_rx_agg_v1(st +@@ -789,6 +789,32 @@ static void rtw_usb_dynamic_rx_agg_v1(st rtw_write16(rtwdev, REG_RXDMA_AGG_PG_TH, val16); } @@ -52,7 +52,7 @@ Signed-off-by: Bitterblue Smith static void rtw_usb_dynamic_rx_agg(struct rtw_dev *rtwdev, bool enable) { switch (rtwdev->chip->id) { -@@ -796,6 +822,10 @@ static void rtw_usb_dynamic_rx_agg(struc +@@ -797,6 +823,10 @@ static void rtw_usb_dynamic_rx_agg(struc case RTW_CHIP_TYPE_8821C: rtw_usb_dynamic_rx_agg_v1(rtwdev, enable); break; diff --git a/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch b/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch index eea165ccca9..c9496b5e709 100644 --- a/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch +++ b/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/main.c +++ b/net/mac80211/main.c -@@ -1581,24 +1581,6 @@ int ieee80211_register_hw(struct ieee802 +@@ -1583,24 +1583,6 @@ int ieee80211_register_hw(struct ieee802 ieee80211_check_wbrf_support(local); diff --git a/package/kernel/mac80211/patches/subsys/220-allow-ibss-mixed.patch b/package/kernel/mac80211/patches/subsys/220-allow-ibss-mixed.patch index 55376362a5b..378ca275f5b 100644 --- a/package/kernel/mac80211/patches/subsys/220-allow-ibss-mixed.patch +++ b/package/kernel/mac80211/patches/subsys/220-allow-ibss-mixed.patch @@ -16,7 +16,7 @@ and we should ignore this. --- a/net/wireless/core.c +++ b/net/wireless/core.c -@@ -654,21 +654,6 @@ static int wiphy_verify_combinations(str +@@ -678,21 +678,6 @@ int wiphy_verify_iface_combinations(stru c->limits[j].max > 1)) return -EINVAL; diff --git a/package/kernel/mac80211/patches/subsys/310-cfg80211-allow-grace-period-for-DFS-available-after-.patch b/package/kernel/mac80211/patches/subsys/310-cfg80211-allow-grace-period-for-DFS-available-after-.patch index 7e9be59e044..c86b836f2f5 100644 --- a/package/kernel/mac80211/patches/subsys/310-cfg80211-allow-grace-period-for-DFS-available-after-.patch +++ b/package/kernel/mac80211/patches/subsys/310-cfg80211-allow-grace-period-for-DFS-available-after-.patch @@ -113,7 +113,7 @@ Signed-off-by: Felix Fietkau { --- a/net/wireless/core.h +++ b/net/wireless/core.h -@@ -467,6 +467,8 @@ void cfg80211_set_dfs_state(struct wiphy +@@ -475,6 +475,8 @@ void cfg80211_set_dfs_state(struct wiphy enum nl80211_dfs_state dfs_state); void cfg80211_dfs_channels_update_work(struct work_struct *work); @@ -124,7 +124,7 @@ Signed-off-by: Felix Fietkau --- a/net/wireless/mlme.c +++ b/net/wireless/mlme.c -@@ -1037,6 +1037,8 @@ void cfg80211_dfs_channels_update_work(s +@@ -1031,6 +1031,8 @@ void cfg80211_dfs_channels_update_work(s if (c->dfs_state == NL80211_DFS_UNAVAILABLE) { time_dfs_update = IEEE80211_DFS_MIN_NOP_TIME_MS; radar_event = NL80211_RADAR_NOP_FINISHED; @@ -133,7 +133,7 @@ Signed-off-by: Felix Fietkau } else { if (regulatory_pre_cac_allowed(wiphy) || cfg80211_any_wiphy_oper_chan(wiphy, c)) -@@ -1044,11 +1046,10 @@ void cfg80211_dfs_channels_update_work(s +@@ -1038,11 +1040,10 @@ void cfg80211_dfs_channels_update_work(s time_dfs_update = REG_PRE_CAC_EXPIRY_GRACE_MS; radar_event = NL80211_RADAR_PRE_CAC_EXPIRED; diff --git a/package/kernel/mac80211/patches/subsys/320-mac80211-add-AQL-support-for-broadcast-packets.patch b/package/kernel/mac80211/patches/subsys/320-mac80211-add-AQL-support-for-broadcast-packets.patch index c03f40d9b4f..9513dc14bc3 100644 --- a/package/kernel/mac80211/patches/subsys/320-mac80211-add-AQL-support-for-broadcast-packets.patch +++ b/package/kernel/mac80211/patches/subsys/320-mac80211-add-AQL-support-for-broadcast-packets.patch @@ -85,7 +85,7 @@ Signed-off-by: Felix Fietkau const struct ieee80211_ops *ops; --- a/net/mac80211/main.c +++ b/net/mac80211/main.c -@@ -952,6 +952,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_ +@@ -954,6 +954,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_ spin_lock_init(&local->rx_path_lock); spin_lock_init(&local->queue_stop_reason_lock); diff --git a/package/kernel/mac80211/patches/subsys/321-wifi-mac80211-do-not-pass-a-stopped-vif-to-the-drive.patch b/package/kernel/mac80211/patches/subsys/321-wifi-mac80211-do-not-pass-a-stopped-vif-to-the-drive.patch deleted file mode 100644 index f48fa38e5e9..00000000000 --- a/package/kernel/mac80211/patches/subsys/321-wifi-mac80211-do-not-pass-a-stopped-vif-to-the-drive.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: Felix Fietkau -Date: Wed, 2 Oct 2024 11:45:35 +0200 -Subject: [PATCH] wifi: mac80211: do not pass a stopped vif to the driver in - .get_txpower - -Avoid potentially crashing in the driver because of uninitialized private data - -Fixes: 5b3dc42b1b0d ("mac80211: add support for driver tx power reporting") -Cc: stable@vger.kernel.org -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -3134,7 +3134,8 @@ static int ieee80211_get_tx_power(struct - struct ieee80211_local *local = wiphy_priv(wiphy); - struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); - -- if (local->ops->get_txpower) -+ if (local->ops->get_txpower && -+ (sdata->flags & IEEE80211_SDATA_IN_DRIVER)) - return drv_get_txpower(local, sdata, dbm); - - if (local->emulate_chanctx) diff --git a/package/kernel/mac80211/patches/subsys/350-wifi-cfg80211-add-option-for-vif-allowed-radios.patch b/package/kernel/mac80211/patches/subsys/330-wifi-cfg80211-add-option-for-vif-allowed-radios.patch similarity index 96% rename from package/kernel/mac80211/patches/subsys/350-wifi-cfg80211-add-option-for-vif-allowed-radios.patch rename to package/kernel/mac80211/patches/subsys/330-wifi-cfg80211-add-option-for-vif-allowed-radios.patch index d5b42f3a3a5..3b09c46f28a 100644 --- a/package/kernel/mac80211/patches/subsys/350-wifi-cfg80211-add-option-for-vif-allowed-radios.patch +++ b/package/kernel/mac80211/patches/subsys/330-wifi-cfg80211-add-option-for-vif-allowed-radios.patch @@ -23,15 +23,15 @@ Signed-off-by: Felix Fietkau --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h -@@ -6227,6 +6227,7 @@ enum ieee80211_ap_reg_power { +@@ -6271,6 +6271,7 @@ enum ieee80211_ap_reg_power { * entered. - * @links[].cac_time_ms: CAC time in ms + * @links.cac_time_ms: CAC time in ms * @valid_links: bitmap describing what elements of @links are valid + * @radio_mask: Bitmask of radios that this interface is allowed to operate on. */ struct wireless_dev { struct wiphy *wiphy; -@@ -6339,6 +6340,8 @@ struct wireless_dev { +@@ -6383,6 +6384,8 @@ struct wireless_dev { unsigned int cac_time_ms; } links[IEEE80211_MLD_MAX_NUM_LINKS]; u16 valid_links; @@ -40,7 +40,7 @@ Signed-off-by: Felix Fietkau }; static inline const u8 *wdev_address(struct wireless_dev *wdev) -@@ -6525,6 +6528,17 @@ bool cfg80211_radio_chandef_valid(const +@@ -6569,6 +6572,17 @@ bool cfg80211_radio_chandef_valid(const const struct cfg80211_chan_def *chandef); /** @@ -246,7 +246,7 @@ Signed-off-by: Felix Fietkau continue; for (i = 0; i < rdev_req->n_channels; i++) { -@@ -3490,9 +3491,12 @@ int cfg80211_wext_siwscan(struct net_dev +@@ -3519,9 +3520,12 @@ int cfg80211_wext_siwscan(struct net_dev continue; for (j = 0; j < wiphy->bands[band]->n_channels; j++) { @@ -298,7 +298,7 @@ Signed-off-by: Felix Fietkau +EXPORT_SYMBOL(cfg80211_wdev_channel_allowed); --- a/net/wireless/core.c +++ b/net/wireless/core.c -@@ -1415,6 +1415,8 @@ void cfg80211_init_wdev(struct wireless_ +@@ -1424,6 +1424,8 @@ void cfg80211_init_wdev(struct wireless_ /* allow mac80211 to determine the timeout */ wdev->ps_timeout = -1; diff --git a/package/kernel/mac80211/patches/subsys/330-wifi-mac80211-introduce-EHT-rate-support-in-AQL-airt.patch b/package/kernel/mac80211/patches/subsys/330-wifi-mac80211-introduce-EHT-rate-support-in-AQL-airt.patch deleted file mode 100644 index 0a3c8ec53b2..00000000000 --- a/package/kernel/mac80211/patches/subsys/330-wifi-mac80211-introduce-EHT-rate-support-in-AQL-airt.patch +++ /dev/null @@ -1,233 +0,0 @@ -From: Ming Yen Hsieh -Date: Wed, 4 Sep 2024 19:12:56 +0800 -Subject: [PATCH] wifi: mac80211: introduce EHT rate support in AQL airtime - -Add definitions related to EHT mode and airtime calculation -according to the 802.11BE_D4.0. - -Co-developed-by: Bo Jiao -Signed-off-by: Bo Jiao -Signed-off-by: Deren Wu -Signed-off-by: Quan Zhou -Signed-off-by: Ming Yen Hsieh -Link: https://patch.msgid.link/20240904111256.11734-1-mingyen.hsieh@mediatek.com -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/airtime.c -+++ b/net/mac80211/airtime.c -@@ -55,10 +55,21 @@ - #define HE_DURATION_S(shift, streams, gi, bps) \ - (HE_DURATION(streams, gi, bps) >> shift) - -+/* gi in HE/EHT is identical. It matches enum nl80211_eht_gi as well */ -+#define EHT_GI_08 HE_GI_08 -+#define EHT_GI_16 HE_GI_16 -+#define EHT_GI_32 HE_GI_32 -+ -+#define EHT_DURATION(streams, gi, bps) \ -+ HE_DURATION(streams, gi, bps) -+#define EHT_DURATION_S(shift, streams, gi, bps) \ -+ HE_DURATION_S(shift, streams, gi, bps) -+ - #define BW_20 0 - #define BW_40 1 - #define BW_80 2 - #define BW_160 3 -+#define BW_320 4 - - /* - * Define group sort order: HT40 -> SGI -> #streams -@@ -68,17 +79,26 @@ - #define IEEE80211_VHT_STREAM_GROUPS 8 /* BW(=4) * SGI(=2) */ - - #define IEEE80211_HE_MAX_STREAMS 8 -+#define IEEE80211_HE_STREAM_GROUPS 12 /* BW(=4) * GI(=3) */ -+ -+#define IEEE80211_EHT_MAX_STREAMS 8 -+#define IEEE80211_EHT_STREAM_GROUPS 15 /* BW(=5) * GI(=3) */ - - #define IEEE80211_HT_GROUPS_NB (IEEE80211_MAX_STREAMS * \ - IEEE80211_HT_STREAM_GROUPS) - #define IEEE80211_VHT_GROUPS_NB (IEEE80211_MAX_STREAMS * \ - IEEE80211_VHT_STREAM_GROUPS) -+#define IEEE80211_HE_GROUPS_NB (IEEE80211_HE_MAX_STREAMS * \ -+ IEEE80211_HE_STREAM_GROUPS) -+#define IEEE80211_EHT_GROUPS_NB (IEEE80211_EHT_MAX_STREAMS * \ -+ IEEE80211_EHT_STREAM_GROUPS) - - #define IEEE80211_HT_GROUP_0 0 - #define IEEE80211_VHT_GROUP_0 (IEEE80211_HT_GROUP_0 + IEEE80211_HT_GROUPS_NB) - #define IEEE80211_HE_GROUP_0 (IEEE80211_VHT_GROUP_0 + IEEE80211_VHT_GROUPS_NB) -+#define IEEE80211_EHT_GROUP_0 (IEEE80211_HE_GROUP_0 + IEEE80211_HE_GROUPS_NB) - --#define MCS_GROUP_RATES 12 -+#define MCS_GROUP_RATES 14 - - #define HT_GROUP_IDX(_streams, _sgi, _ht40) \ - IEEE80211_HT_GROUP_0 + \ -@@ -203,6 +223,69 @@ - #define HE_GROUP(_streams, _gi, _bw) \ - __HE_GROUP(_streams, _gi, _bw, \ - HE_GROUP_SHIFT(_streams, _gi, _bw)) -+ -+#define EHT_BW2VBPS(_bw, r5, r4, r3, r2, r1) \ -+ ((_bw) == BW_320 ? r5 : BW2VBPS(_bw, r4, r3, r2, r1)) -+ -+#define EHT_GROUP_IDX(_streams, _gi, _bw) \ -+ (IEEE80211_EHT_GROUP_0 + \ -+ IEEE80211_EHT_MAX_STREAMS * 3 * (_bw) + \ -+ IEEE80211_EHT_MAX_STREAMS * (_gi) + \ -+ (_streams) - 1) -+ -+#define __EHT_GROUP(_streams, _gi, _bw, _s) \ -+ [EHT_GROUP_IDX(_streams, _gi, _bw)] = { \ -+ .shift = _s, \ -+ .duration = { \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 1960, 980, 490, 234, 117)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 3920, 1960, 980, 468, 234)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 5880, 2937, 1470, 702, 351)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 7840, 3920, 1960, 936, 468)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 11760, 5880, 2940, 1404, 702)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 15680, 7840, 3920, 1872, 936)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 17640, 8820, 4410, 2106, 1053)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 19600, 9800, 4900, 2340, 1170)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 23520, 11760, 5880, 2808, 1404)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 26133, 13066, 6533, 3120, 1560)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 29400, 14700, 7350, 3510, 1755)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 32666, 16333, 8166, 3900, 1950)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 35280, 17640, 8820, 4212, 2106)), \ -+ EHT_DURATION_S(_s, _streams, _gi, \ -+ EHT_BW2VBPS(_bw, 39200, 19600, 9800, 4680, 2340)) \ -+ } \ -+} -+ -+#define EHT_GROUP_SHIFT(_streams, _gi, _bw) \ -+ GROUP_SHIFT(EHT_DURATION(_streams, _gi, \ -+ EHT_BW2VBPS(_bw, 1960, 980, 490, 234, 117))) -+ -+#define EHT_GROUP(_streams, _gi, _bw) \ -+ __EHT_GROUP(_streams, _gi, _bw, \ -+ EHT_GROUP_SHIFT(_streams, _gi, _bw)) -+ -+#define EHT_GROUP_RANGE(_gi, _bw) \ -+ EHT_GROUP(1, _gi, _bw), \ -+ EHT_GROUP(2, _gi, _bw), \ -+ EHT_GROUP(3, _gi, _bw), \ -+ EHT_GROUP(4, _gi, _bw), \ -+ EHT_GROUP(5, _gi, _bw), \ -+ EHT_GROUP(6, _gi, _bw), \ -+ EHT_GROUP(7, _gi, _bw), \ -+ EHT_GROUP(8, _gi, _bw) -+ - struct mcs_group { - u8 shift; - u16 duration[MCS_GROUP_RATES]; -@@ -376,6 +459,26 @@ static const struct mcs_group airtime_mc - HE_GROUP(6, HE_GI_32, BW_160), - HE_GROUP(7, HE_GI_32, BW_160), - HE_GROUP(8, HE_GI_32, BW_160), -+ -+ EHT_GROUP_RANGE(EHT_GI_08, BW_20), -+ EHT_GROUP_RANGE(EHT_GI_16, BW_20), -+ EHT_GROUP_RANGE(EHT_GI_32, BW_20), -+ -+ EHT_GROUP_RANGE(EHT_GI_08, BW_40), -+ EHT_GROUP_RANGE(EHT_GI_16, BW_40), -+ EHT_GROUP_RANGE(EHT_GI_32, BW_40), -+ -+ EHT_GROUP_RANGE(EHT_GI_08, BW_80), -+ EHT_GROUP_RANGE(EHT_GI_16, BW_80), -+ EHT_GROUP_RANGE(EHT_GI_32, BW_80), -+ -+ EHT_GROUP_RANGE(EHT_GI_08, BW_160), -+ EHT_GROUP_RANGE(EHT_GI_16, BW_160), -+ EHT_GROUP_RANGE(EHT_GI_32, BW_160), -+ -+ EHT_GROUP_RANGE(EHT_GI_08, BW_320), -+ EHT_GROUP_RANGE(EHT_GI_16, BW_320), -+ EHT_GROUP_RANGE(EHT_GI_32, BW_320), - }; - - static u32 -@@ -422,6 +525,9 @@ static u32 ieee80211_get_rate_duration(s - case RATE_INFO_BW_160: - bw = BW_160; - break; -+ case RATE_INFO_BW_320: -+ bw = BW_320; -+ break; - default: - WARN_ON_ONCE(1); - return 0; -@@ -443,14 +549,27 @@ static u32 ieee80211_get_rate_duration(s - idx = status->rate_idx; - group = HE_GROUP_IDX(streams, status->he_gi, bw); - break; -+ case RX_ENC_EHT: -+ streams = status->nss; -+ idx = status->rate_idx; -+ group = EHT_GROUP_IDX(streams, status->eht.gi, bw); -+ break; - default: - WARN_ON_ONCE(1); - return 0; - } - -- if (WARN_ON_ONCE((status->encoding != RX_ENC_HE && streams > 4) || -- (status->encoding == RX_ENC_HE && streams > 8))) -- return 0; -+ switch (status->encoding) { -+ case RX_ENC_EHT: -+ case RX_ENC_HE: -+ if (WARN_ON_ONCE(streams > 8)) -+ return 0; -+ break; -+ default: -+ if (WARN_ON_ONCE(streams > 4)) -+ return 0; -+ break; -+ } - - if (idx >= MCS_GROUP_RATES) - return 0; -@@ -517,7 +636,9 @@ static bool ieee80211_fill_rate_info(str - stat->nss = ri->nss; - stat->rate_idx = ri->mcs; - -- if (ri->flags & RATE_INFO_FLAGS_HE_MCS) -+ if (ri->flags & RATE_INFO_FLAGS_EHT_MCS) -+ stat->encoding = RX_ENC_EHT; -+ else if (ri->flags & RATE_INFO_FLAGS_HE_MCS) - stat->encoding = RX_ENC_HE; - else if (ri->flags & RATE_INFO_FLAGS_VHT_MCS) - stat->encoding = RX_ENC_VHT; -@@ -529,7 +650,14 @@ static bool ieee80211_fill_rate_info(str - if (ri->flags & RATE_INFO_FLAGS_SHORT_GI) - stat->enc_flags |= RX_ENC_FLAG_SHORT_GI; - -- stat->he_gi = ri->he_gi; -+ switch (stat->encoding) { -+ case RX_ENC_EHT: -+ stat->eht.gi = ri->eht_gi; -+ break; -+ default: -+ stat->he_gi = ri->he_gi; -+ break; -+ } - - if (stat->encoding != RX_ENC_LEGACY) - return true; diff --git a/package/kernel/mac80211/patches/subsys/331-wifi-cfg80211-check-radio-iface-combination-for-mult.patch b/package/kernel/mac80211/patches/subsys/331-wifi-cfg80211-check-radio-iface-combination-for-mult.patch deleted file mode 100644 index 76c351aa831..00000000000 --- a/package/kernel/mac80211/patches/subsys/331-wifi-cfg80211-check-radio-iface-combination-for-mult.patch +++ /dev/null @@ -1,122 +0,0 @@ -From: Karthikeyan Periyasamy -Date: Tue, 17 Sep 2024 19:32:39 +0530 -Subject: [PATCH] wifi: cfg80211: check radio iface combination for multi radio - per wiphy - -Currently, wiphy_verify_combinations() fails for the multi-radio per wiphy -due to the condition check on new global interface combination that DFS -only works on one channel. In a multi-radio scenario, new global interface -combination encompasses the capabilities of all radio combinations, so it -supports more than one channel with DFS. For multi-radio per wiphy, -interface combination verification needs to be performed for radio specific -interface combinations. This is necessary as the new global interface -combination combines the capabilities of all radio combinations. - -Fixes: a01b1e9f9955 ("wifi: mac80211: add support for DFS with multiple radios") -Signed-off-by: Karthikeyan Periyasamy ---- - ---- a/net/wireless/core.c -+++ b/net/wireless/core.c -@@ -599,16 +599,20 @@ use_default_name: - } - EXPORT_SYMBOL(wiphy_new_nm); - --static int wiphy_verify_combinations(struct wiphy *wiphy) -+static -+int wiphy_verify_iface_combinations(struct wiphy *wiphy, -+ const struct ieee80211_iface_combination *iface_comb, -+ int n_iface_comb, -+ bool combined_radio) - { - const struct ieee80211_iface_combination *c; - int i, j; - -- for (i = 0; i < wiphy->n_iface_combinations; i++) { -+ for (i = 0; i < n_iface_comb; i++) { - u32 cnt = 0; - u16 all_iftypes = 0; - -- c = &wiphy->iface_combinations[i]; -+ c = &iface_comb[i]; - - /* - * Combinations with just one interface aren't real, -@@ -621,9 +625,13 @@ static int wiphy_verify_combinations(str - if (WARN_ON(!c->num_different_channels)) - return -EINVAL; - -- /* DFS only works on one channel. */ -- if (WARN_ON(c->radar_detect_widths && -- (c->num_different_channels > 1))) -+ /* DFS only works on one channel. Avoid this check -+ * for multi-radio global combination, since it hold -+ * the capabilities of all radio combinations. -+ */ -+ if (!combined_radio && -+ WARN_ON(c->radar_detect_widths && -+ c->num_different_channels > 1)) - return -EINVAL; - - if (WARN_ON(!c->n_limits)) -@@ -644,13 +652,21 @@ static int wiphy_verify_combinations(str - if (WARN_ON(wiphy->software_iftypes & types)) - return -EINVAL; - -- /* Only a single P2P_DEVICE can be allowed */ -- if (WARN_ON(types & BIT(NL80211_IFTYPE_P2P_DEVICE) && -+ /* Only a single P2P_DEVICE can be allowed, avoid this -+ * check for multi-radio global combination, since it -+ * hold the capabilities of all radio combinations. -+ */ -+ if (!combined_radio && -+ WARN_ON(types & BIT(NL80211_IFTYPE_P2P_DEVICE) && - c->limits[j].max > 1)) - return -EINVAL; - -- /* Only a single NAN can be allowed */ -- if (WARN_ON(types & BIT(NL80211_IFTYPE_NAN) && -+ /* Only a single NAN can be allowed, avoid this -+ * check for multi-radio global combination, since it -+ * hold the capabilities of all radio combinations. -+ */ -+ if (!combined_radio && -+ WARN_ON(types & BIT(NL80211_IFTYPE_NAN) && - c->limits[j].max > 1)) - return -EINVAL; - -@@ -674,6 +690,34 @@ static int wiphy_verify_combinations(str - return 0; - } - -+static int wiphy_verify_combinations(struct wiphy *wiphy) -+{ -+ int i, ret; -+ bool combined_radio = false; -+ -+ if (wiphy->n_radio) { -+ for (i = 0; i < wiphy->n_radio; i++) { -+ const struct wiphy_radio *radio = &wiphy->radio[i]; -+ -+ ret = wiphy_verify_iface_combinations(wiphy, -+ radio->iface_combinations, -+ radio->n_iface_combinations, -+ false); -+ if (ret) -+ return ret; -+ } -+ -+ combined_radio = true; -+ } -+ -+ ret = wiphy_verify_iface_combinations(wiphy, -+ wiphy->iface_combinations, -+ wiphy->n_iface_combinations, -+ combined_radio); -+ -+ return ret; -+} -+ - int wiphy_register(struct wiphy *wiphy) - { - struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); diff --git a/package/kernel/mac80211/patches/subsys/351-wifi-mac80211-use-vif-radio-mask-to-limit-ibss-scan-.patch b/package/kernel/mac80211/patches/subsys/331-wifi-mac80211-use-vif-radio-mask-to-limit-ibss-scan-.patch similarity index 88% rename from package/kernel/mac80211/patches/subsys/351-wifi-mac80211-use-vif-radio-mask-to-limit-ibss-scan-.patch rename to package/kernel/mac80211/patches/subsys/331-wifi-mac80211-use-vif-radio-mask-to-limit-ibss-scan-.patch index 7363c3873f6..779857fe88a 100644 --- a/package/kernel/mac80211/patches/subsys/351-wifi-mac80211-use-vif-radio-mask-to-limit-ibss-scan-.patch +++ b/package/kernel/mac80211/patches/subsys/331-wifi-mac80211-use-vif-radio-mask-to-limit-ibss-scan-.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c -@@ -1178,14 +1178,14 @@ int ieee80211_request_ibss_scan(struct i +@@ -1176,14 +1176,14 @@ int ieee80211_request_ibss_scan(struct i unsigned int n_channels) { struct ieee80211_local *local = sdata->local; @@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau /* fill internal scan request */ if (!channels) { -@@ -1202,7 +1202,9 @@ int ieee80211_request_ibss_scan(struct i +@@ -1200,7 +1200,9 @@ int ieee80211_request_ibss_scan(struct i &local->hw.wiphy->bands[band]->channels[i]; if (tmp_ch->flags & (IEEE80211_CHAN_NO_IR | @@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau continue; local->int_scan_req->channels[n_ch] = tmp_ch; -@@ -1211,21 +1213,23 @@ int ieee80211_request_ibss_scan(struct i +@@ -1209,21 +1211,23 @@ int ieee80211_request_ibss_scan(struct i } if (WARN_ON_ONCE(n_ch == 0)) @@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau local->int_scan_req->n_channels = n_ch; } -@@ -1235,9 +1239,7 @@ int ieee80211_request_ibss_scan(struct i +@@ -1233,9 +1237,7 @@ int ieee80211_request_ibss_scan(struct i memcpy(local->int_scan_req->ssids[0].ssid, ssid, IEEE80211_MAX_SSID_LEN); local->int_scan_req->ssids[0].ssid_len = ssid_len; diff --git a/package/kernel/mac80211/patches/subsys/332-wifi-cfg80211-Set-correct-chandef-when-starting-CAC.patch b/package/kernel/mac80211/patches/subsys/332-wifi-cfg80211-Set-correct-chandef-when-starting-CAC.patch deleted file mode 100644 index 72a3510aacf..00000000000 --- a/package/kernel/mac80211/patches/subsys/332-wifi-cfg80211-Set-correct-chandef-when-starting-CAC.patch +++ /dev/null @@ -1,64 +0,0 @@ -From: Issam Hamdi -Date: Fri, 16 Aug 2024 16:24:18 +0200 -Subject: [PATCH] wifi: cfg80211: Set correct chandef when starting CAC - -When starting CAC in a mode other than AP mode, it return a -"WARNING: CPU: 0 PID: 63 at cfg80211_chandef_dfs_usable+0x20/0xaf [cfg80211]" -caused by the chandef.chan being null at the end of CAC. - -Solution: Ensure the channel definition is set for the different modes -when starting CAC to avoid getting a NULL 'chan' at the end of CAC. - - Call Trace: - ? show_regs.part.0+0x14/0x16 - ? __warn+0x67/0xc0 - ? cfg80211_chandef_dfs_usable+0x20/0xaf [cfg80211] - ? report_bug+0xa7/0x130 - ? exc_overflow+0x30/0x30 - ? handle_bug+0x27/0x50 - ? exc_invalid_op+0x18/0x60 - ? handle_exception+0xf6/0xf6 - ? exc_overflow+0x30/0x30 - ? cfg80211_chandef_dfs_usable+0x20/0xaf [cfg80211] - ? exc_overflow+0x30/0x30 - ? cfg80211_chandef_dfs_usable+0x20/0xaf [cfg80211] - ? regulatory_propagate_dfs_state.cold+0x1b/0x4c [cfg80211] - ? cfg80211_propagate_cac_done_wk+0x1a/0x30 [cfg80211] - ? process_one_work+0x165/0x280 - ? worker_thread+0x120/0x3f0 - ? kthread+0xc2/0xf0 - ? process_one_work+0x280/0x280 - ? kthread_complete_and_exit+0x20/0x20 - ? ret_from_fork+0x19/0x24 - -Reported-by: Kretschmer Mathias -Signed-off-by: Issam Hamdi -Link: https://patch.msgid.link/20240816142418.3381951-1-ih@simonwunderlich.de -[shorten subject, remove OCB, reorder cases to match previous list] -Signed-off-by: Johannes Berg ---- - ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -10144,7 +10144,20 @@ static int nl80211_start_radar_detection - - err = rdev_start_radar_detection(rdev, dev, &chandef, cac_time_ms); - if (!err) { -- wdev->links[0].ap.chandef = chandef; -+ switch (wdev->iftype) { -+ case NL80211_IFTYPE_AP: -+ case NL80211_IFTYPE_P2P_GO: -+ wdev->links[0].ap.chandef = chandef; -+ break; -+ case NL80211_IFTYPE_ADHOC: -+ wdev->u.ibss.chandef = chandef; -+ break; -+ case NL80211_IFTYPE_MESH_POINT: -+ wdev->u.mesh.chandef = chandef; -+ break; -+ default: -+ break; -+ } - wdev->cac_started = true; - wdev->cac_start_time = jiffies; - wdev->cac_time_ms = cac_time_ms; diff --git a/package/kernel/mac80211/patches/subsys/352-wifi-mac80211-use-vif-radio-mask-to-limit-chanctx-an.patch b/package/kernel/mac80211/patches/subsys/332-wifi-mac80211-use-vif-radio-mask-to-limit-chanctx-an.patch similarity index 86% rename from package/kernel/mac80211/patches/subsys/352-wifi-mac80211-use-vif-radio-mask-to-limit-chanctx-an.patch rename to package/kernel/mac80211/patches/subsys/332-wifi-mac80211-use-vif-radio-mask-to-limit-chanctx-an.patch index ac3d1011489..0c8c894eaaa 100644 --- a/package/kernel/mac80211/patches/subsys/352-wifi-mac80211-use-vif-radio-mask-to-limit-chanctx-an.patch +++ b/package/kernel/mac80211/patches/subsys/332-wifi-mac80211-use-vif-radio-mask-to-limit-chanctx-an.patch @@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c -@@ -1167,7 +1167,7 @@ ieee80211_replace_chanctx(struct ieee802 +@@ -1169,7 +1169,7 @@ ieee80211_replace_chanctx(struct ieee802 static bool ieee80211_find_available_radio(struct ieee80211_local *local, const struct ieee80211_chan_req *chanreq, @@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau { struct wiphy *wiphy = local->hw.wiphy; const struct wiphy_radio *radio; -@@ -1178,6 +1178,9 @@ ieee80211_find_available_radio(struct ie +@@ -1180,6 +1180,9 @@ ieee80211_find_available_radio(struct ie return true; for (i = 0; i < wiphy->n_radio; i++) { @@ -28,7 +28,7 @@ Signed-off-by: Felix Fietkau radio = &wiphy->radio[i]; if (!cfg80211_radio_chandef_valid(radio, &chanreq->oper)) continue; -@@ -1211,7 +1214,9 @@ int ieee80211_link_reserve_chanctx(struc +@@ -1213,7 +1216,9 @@ int ieee80211_link_reserve_chanctx(struc new_ctx = ieee80211_find_reservation_chanctx(local, chanreq, mode); if (!new_ctx) { if (ieee80211_can_create_new_chanctx(local, -1) && @@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau new_ctx = ieee80211_new_chanctx(local, chanreq, mode, false, radio_idx); else -@@ -1881,7 +1886,9 @@ int _ieee80211_link_use_channel(struct i +@@ -1883,7 +1888,9 @@ int _ieee80211_link_use_channel(struct i /* Note: context is now reserved */ if (ctx) reserved = true; diff --git a/package/kernel/mac80211/patches/subsys/333-Revert-wifi-mac80211-move-radar-detect-work-to-sdata.patch b/package/kernel/mac80211/patches/subsys/333-Revert-wifi-mac80211-move-radar-detect-work-to-sdata.patch deleted file mode 100644 index d12df8f53ea..00000000000 --- a/package/kernel/mac80211/patches/subsys/333-Revert-wifi-mac80211-move-radar-detect-work-to-sdata.patch +++ /dev/null @@ -1,136 +0,0 @@ -From: Aditya Kumar Singh -Date: Fri, 6 Sep 2024 12:14:19 +0530 -Subject: [PATCH] Revert "wifi: mac80211: move radar detect work to sdata" -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -This reverts commit ce9e660ef32e ("wifi: mac80211: move radar detect work to sdata"). - -To enable radar detection with MLO, it’s essential to handle it on a -per-link basis. This is because when using MLO, multiple links may already -be active and beaconing. In this scenario, another link should be able to -initiate a radar detection. Also, if underlying links are associated with -different hardware devices but grouped together for MLO, they could -potentially start radar detection simultaneously. Therefore, it makes -sense to manage radar detection settings separately for each link by moving -them back to a per-link data structure. - -Signed-off-by: Aditya Kumar Singh -Link: https://patch.msgid.link/20240906064426.2101315-2-quic_adisi@quicinc.com -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -1658,7 +1658,7 @@ static int ieee80211_stop_ap(struct wiph - - if (sdata->wdev.cac_started) { - chandef = link_conf->chanreq.oper; -- wiphy_delayed_work_cancel(wiphy, &sdata->dfs_cac_timer_work); -+ wiphy_delayed_work_cancel(wiphy, &link->dfs_cac_timer_work); - cfg80211_cac_event(sdata->dev, &chandef, - NL80211_RADAR_CAC_ABORTED, - GFP_KERNEL); -@@ -3482,7 +3482,7 @@ static int ieee80211_start_radar_detecti - if (err) - goto out_unlock; - -- wiphy_delayed_work_queue(wiphy, &sdata->dfs_cac_timer_work, -+ wiphy_delayed_work_queue(wiphy, &sdata->deflink.dfs_cac_timer_work, - msecs_to_jiffies(cac_time_ms)); - - out_unlock: -@@ -3499,7 +3499,7 @@ static void ieee80211_end_cac(struct wip - - list_for_each_entry(sdata, &local->interfaces, list) { - wiphy_delayed_work_cancel(wiphy, -- &sdata->dfs_cac_timer_work); -+ &sdata->deflink.dfs_cac_timer_work); - - if (sdata->wdev.cac_started) { - ieee80211_link_release_channel(&sdata->deflink); ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -1069,6 +1069,7 @@ struct ieee80211_link_data { - int ap_power_level; /* in dBm */ - - bool radar_required; -+ struct wiphy_delayed_work dfs_cac_timer_work; - - union { - struct ieee80211_link_data_managed mgd; -@@ -1167,8 +1168,6 @@ struct ieee80211_sub_if_data { - struct ieee80211_link_data deflink; - struct ieee80211_link_data __rcu *link[IEEE80211_MLD_MAX_NUM_LINKS]; - -- struct wiphy_delayed_work dfs_cac_timer_work; -- - /* for ieee80211_set_active_links_async() */ - struct wiphy_work activate_links_work; - u16 desired_active_links; ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -551,7 +551,7 @@ static void ieee80211_do_stop(struct iee - wiphy_work_cancel(local->hw.wiphy, - &sdata->deflink.color_change_finalize_work); - wiphy_delayed_work_cancel(local->hw.wiphy, -- &sdata->dfs_cac_timer_work); -+ &sdata->deflink.dfs_cac_timer_work); - - if (sdata->wdev.cac_started) { - chandef = sdata->vif.bss_conf.chanreq.oper; -@@ -1744,8 +1744,6 @@ static void ieee80211_setup_sdata(struct - wiphy_work_init(&sdata->work, ieee80211_iface_work); - wiphy_work_init(&sdata->activate_links_work, - ieee80211_activate_links_work); -- wiphy_delayed_work_init(&sdata->dfs_cac_timer_work, -- ieee80211_dfs_cac_timer_work); - - switch (type) { - case NL80211_IFTYPE_P2P_GO: ---- a/net/mac80211/link.c -+++ b/net/mac80211/link.c -@@ -45,6 +45,8 @@ void ieee80211_link_init(struct ieee8021 - ieee80211_color_collision_detection_work); - INIT_LIST_HEAD(&link->assigned_chanctx_list); - INIT_LIST_HEAD(&link->reserved_chanctx_list); -+ wiphy_delayed_work_init(&link->dfs_cac_timer_work, -+ ieee80211_dfs_cac_timer_work); - - if (!deflink) { - switch (sdata->vif.type) { ---- a/net/mac80211/mlme.c -+++ b/net/mac80211/mlme.c -@@ -3031,15 +3031,16 @@ void ieee80211_dynamic_ps_timer(struct t - - void ieee80211_dfs_cac_timer_work(struct wiphy *wiphy, struct wiphy_work *work) - { -- struct ieee80211_sub_if_data *sdata = -- container_of(work, struct ieee80211_sub_if_data, -+ struct ieee80211_link_data *link = -+ container_of(work, struct ieee80211_link_data, - dfs_cac_timer_work.work); -- struct cfg80211_chan_def chandef = sdata->vif.bss_conf.chanreq.oper; -+ struct cfg80211_chan_def chandef = link->conf->chanreq.oper; -+ struct ieee80211_sub_if_data *sdata = link->sdata; - - lockdep_assert_wiphy(sdata->local->hw.wiphy); - - if (sdata->wdev.cac_started) { -- ieee80211_link_release_channel(&sdata->deflink); -+ ieee80211_link_release_channel(link); - cfg80211_cac_event(sdata->dev, &chandef, - NL80211_RADAR_CAC_FINISHED, - GFP_KERNEL); ---- a/net/mac80211/util.c -+++ b/net/mac80211/util.c -@@ -3460,7 +3460,7 @@ void ieee80211_dfs_cac_cancel(struct iee - - list_for_each_entry(sdata, &local->interfaces, list) { - wiphy_delayed_work_cancel(local->hw.wiphy, -- &sdata->dfs_cac_timer_work); -+ &sdata->deflink.dfs_cac_timer_work); - - if (sdata->wdev.cac_started) { - chandef = sdata->vif.bss_conf.chanreq.oper; diff --git a/package/kernel/mac80211/patches/subsys/353-wifi-mac80211-remove-status-ampdu_delimiter_crc.patch b/package/kernel/mac80211/patches/subsys/333-wifi-mac80211-remove-status-ampdu_delimiter_crc.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/353-wifi-mac80211-remove-status-ampdu_delimiter_crc.patch rename to package/kernel/mac80211/patches/subsys/333-wifi-mac80211-remove-status-ampdu_delimiter_crc.patch diff --git a/package/kernel/mac80211/patches/subsys/354-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch b/package/kernel/mac80211/patches/subsys/334-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch similarity index 98% rename from package/kernel/mac80211/patches/subsys/354-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch rename to package/kernel/mac80211/patches/subsys/334-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch index c2a915963c2..ef8a36a9af7 100644 --- a/package/kernel/mac80211/patches/subsys/354-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch +++ b/package/kernel/mac80211/patches/subsys/334-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch @@ -88,7 +88,7 @@ Signed-off-by: Felix Fietkau bool cfg80211_any_usable_channels(struct wiphy *wiphy, --- a/net/wireless/core.h +++ b/net/wireless/core.h -@@ -510,6 +510,7 @@ static inline unsigned int elapsed_jiffi +@@ -518,6 +518,7 @@ static inline unsigned int elapsed_jiffi } int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev, diff --git a/package/kernel/mac80211/patches/subsys/334-wifi-mac80211-remove-label-usage-in-ieee80211_start_.patch b/package/kernel/mac80211/patches/subsys/334-wifi-mac80211-remove-label-usage-in-ieee80211_start_.patch deleted file mode 100644 index 329b6454628..00000000000 --- a/package/kernel/mac80211/patches/subsys/334-wifi-mac80211-remove-label-usage-in-ieee80211_start_.patch +++ /dev/null @@ -1,50 +0,0 @@ -From: Aditya Kumar Singh -Date: Fri, 6 Sep 2024 12:14:20 +0530 -Subject: [PATCH] wifi: mac80211: remove label usage in - ieee80211_start_radar_detection() - -After locks rework [1], ieee80211_start_radar_detection() function is no -longer acquiring any lock as such explicitly. Hence, it is not unlocking -anything as well. However, label "out_unlock" is still used which creates -confusion. Also, now there is no need of goto label as such. - -Get rid of the goto logic and use direct return statements. - -[1]: https://lore.kernel.org/all/20230828135928.b1c6efffe9ad.I4aec875e25abc9ef0b5ad1e70b5747fd483fbd3c@changeid/ - -Signed-off-by: Aditya Kumar Singh -Link: https://patch.msgid.link/20240906064426.2101315-3-quic_adisi@quicinc.com -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -3468,10 +3468,8 @@ static int ieee80211_start_radar_detecti - - lockdep_assert_wiphy(local->hw.wiphy); - -- if (!list_empty(&local->roc_list) || local->scanning) { -- err = -EBUSY; -- goto out_unlock; -- } -+ if (!list_empty(&local->roc_list) || local->scanning) -+ return -EBUSY; - - /* whatever, but channel contexts should not complain about that one */ - sdata->deflink.smps_mode = IEEE80211_SMPS_OFF; -@@ -3480,13 +3478,12 @@ static int ieee80211_start_radar_detecti - err = ieee80211_link_use_channel(&sdata->deflink, &chanreq, - IEEE80211_CHANCTX_SHARED); - if (err) -- goto out_unlock; -+ return err; - - wiphy_delayed_work_queue(wiphy, &sdata->deflink.dfs_cac_timer_work, - msecs_to_jiffies(cac_time_ms)); - -- out_unlock: -- return err; -+ return 0; - } - - static void ieee80211_end_cac(struct wiphy *wiphy, diff --git a/package/kernel/mac80211/patches/subsys/355-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch b/package/kernel/mac80211/patches/subsys/335-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch similarity index 93% rename from package/kernel/mac80211/patches/subsys/355-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch rename to package/kernel/mac80211/patches/subsys/335-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch index 2510cb0dbe9..604abfd43fc 100644 --- a/package/kernel/mac80211/patches/subsys/355-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch +++ b/package/kernel/mac80211/patches/subsys/335-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau if (ret) return ret; done: -@@ -3049,7 +3057,8 @@ static int ieee80211_set_tx_power(struct +@@ -3050,7 +3058,8 @@ static int ieee80211_set_tx_power(struct if (wdev) { sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); @@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau if (!ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF)) return -EOPNOTSUPP; -@@ -3097,7 +3106,8 @@ static int ieee80211_set_tx_power(struct +@@ -3098,7 +3107,8 @@ static int ieee80211_set_tx_power(struct } list_for_each_entry(sdata, &local->interfaces, list) { @@ -115,7 +115,7 @@ Signed-off-by: Felix Fietkau has_monitor = true; continue; } -@@ -3107,7 +3117,8 @@ static int ieee80211_set_tx_power(struct +@@ -3108,7 +3118,8 @@ static int ieee80211_set_tx_power(struct sdata->vif.bss_conf.txpower_type = txp_type; } list_for_each_entry(sdata, &local->interfaces, list) { @@ -125,7 +125,7 @@ Signed-off-by: Felix Fietkau continue; ieee80211_recalc_txpower(sdata, update_txp_type); } -@@ -4299,7 +4310,8 @@ static int ieee80211_cfg_get_channel(str +@@ -4303,7 +4314,8 @@ static int ieee80211_cfg_get_channel(str if (chanctx_conf) { *chandef = link->conf->chanreq.oper; ret = 0; @@ -137,7 +137,7 @@ Signed-off-by: Felix Fietkau *chandef = local->monitor_chanreq.oper; --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c -@@ -337,6 +337,10 @@ ieee80211_get_chanctx_max_required_bw(st +@@ -339,6 +339,10 @@ ieee80211_get_chanctx_max_required_bw(st case NL80211_IFTYPE_P2P_DEVICE: case NL80211_IFTYPE_NAN: continue; @@ -148,7 +148,7 @@ Signed-off-by: Felix Fietkau case NL80211_IFTYPE_ADHOC: case NL80211_IFTYPE_MESH_POINT: case NL80211_IFTYPE_OCB: -@@ -345,7 +349,6 @@ ieee80211_get_chanctx_max_required_bw(st +@@ -347,7 +351,6 @@ ieee80211_get_chanctx_max_required_bw(st case NL80211_IFTYPE_WDS: case NL80211_IFTYPE_UNSPECIFIED: case NUM_NL80211_IFTYPES: @@ -156,7 +156,7 @@ Signed-off-by: Felix Fietkau case NL80211_IFTYPE_P2P_CLIENT: case NL80211_IFTYPE_P2P_GO: WARN_ON_ONCE(1); -@@ -954,6 +957,10 @@ void ieee80211_recalc_smps_chanctx(struc +@@ -956,6 +959,10 @@ void ieee80211_recalc_smps_chanctx(struc if (!link->sdata->u.mgd.associated) continue; break; @@ -167,7 +167,7 @@ Signed-off-by: Felix Fietkau case NL80211_IFTYPE_AP: case NL80211_IFTYPE_ADHOC: case NL80211_IFTYPE_MESH_POINT: -@@ -966,6 +973,11 @@ void ieee80211_recalc_smps_chanctx(struc +@@ -968,6 +975,11 @@ void ieee80211_recalc_smps_chanctx(struc if (rcu_access_pointer(link->conf->chanctx_conf) != &chanctx->conf) continue; @@ -296,8 +296,8 @@ Signed-off-by: Felix Fietkau } --- a/net/mac80211/util.c +++ b/net/mac80211/util.c -@@ -754,7 +754,8 @@ static void __iterate_interfaces(struct - list_for_each_entry_rcu(sdata, &local->interfaces, list) { +@@ -739,7 +739,8 @@ static void __iterate_interfaces(struct + lockdep_is_held(&local->hw.wiphy->mtx)) { switch (sdata->vif.type) { case NL80211_IFTYPE_MONITOR: - if (!(sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE)) @@ -306,7 +306,7 @@ Signed-off-by: Felix Fietkau continue; break; case NL80211_IFTYPE_AP_VLAN: -@@ -1857,8 +1858,10 @@ int ieee80211_reconfig(struct ieee80211_ +@@ -1856,8 +1857,10 @@ int ieee80211_reconfig(struct ieee80211_ } list_for_each_entry(sdata, &local->interfaces, list) { @@ -318,7 +318,7 @@ Signed-off-by: Felix Fietkau ieee80211_sdata_running(sdata)) { res = drv_add_interface(local, sdata); if (WARN_ON(res)) -@@ -1871,11 +1874,14 @@ int ieee80211_reconfig(struct ieee80211_ +@@ -1870,11 +1873,14 @@ int ieee80211_reconfig(struct ieee80211_ */ if (res) { list_for_each_entry_continue_reverse(sdata, &local->interfaces, diff --git a/package/kernel/mac80211/patches/subsys/335-wifi-trace-unlink-rdev_end_cac-trace-event-from-wiph.patch b/package/kernel/mac80211/patches/subsys/335-wifi-trace-unlink-rdev_end_cac-trace-event-from-wiph.patch deleted file mode 100644 index 98bc0c26fdb..00000000000 --- a/package/kernel/mac80211/patches/subsys/335-wifi-trace-unlink-rdev_end_cac-trace-event-from-wiph.patch +++ /dev/null @@ -1,42 +0,0 @@ -From: Aditya Kumar Singh -Date: Fri, 6 Sep 2024 12:14:21 +0530 -Subject: [PATCH] wifi: trace: unlink rdev_end_cac trace event from - wiphy_netdev_evt class - -rdev_end_cac trace event is linked with wiphy_netdev_evt event class. -There is no option to pass link ID currently to wiphy_netdev_evt class. -A subsequent change would pass link ID to rdev_end_cac event and hence -it can no longer derive the event class from wiphy_netdev_evt. - -Therefore, unlink rdev_end_cac event from wiphy_netdev_evt and define it's -own independent trace event. Link ID would be passed in subsequent change. - -Signed-off-by: Aditya Kumar Singh -Link: https://patch.msgid.link/20240906064426.2101315-4-quic_adisi@quicinc.com -Signed-off-by: Johannes Berg ---- - ---- a/net/wireless/trace.h -+++ b/net/wireless/trace.h -@@ -805,9 +805,18 @@ DEFINE_EVENT(wiphy_netdev_evt, rdev_flus - TP_ARGS(wiphy, netdev) - ); - --DEFINE_EVENT(wiphy_netdev_evt, rdev_end_cac, -- TP_PROTO(struct wiphy *wiphy, struct net_device *netdev), -- TP_ARGS(wiphy, netdev) -+TRACE_EVENT(rdev_end_cac, -+ TP_PROTO(struct wiphy *wiphy, struct net_device *netdev), -+ TP_ARGS(wiphy, netdev), -+ TP_STRUCT__entry( -+ WIPHY_ENTRY -+ NETDEV_ENTRY -+ ), -+ TP_fast_assign( -+ WIPHY_ASSIGN; -+ NETDEV_ASSIGN; -+ ), -+ TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT, WIPHY_PR_ARG, NETDEV_PR_ARG) - ); - - DECLARE_EVENT_CLASS(station_add_change, diff --git a/package/kernel/mac80211/patches/subsys/356-wifi-cfg80211-add-monitor-SKIP_TX-flag.patch b/package/kernel/mac80211/patches/subsys/336-wifi-cfg80211-add-monitor-SKIP_TX-flag.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/356-wifi-cfg80211-add-monitor-SKIP_TX-flag.patch rename to package/kernel/mac80211/patches/subsys/336-wifi-cfg80211-add-monitor-SKIP_TX-flag.patch diff --git a/package/kernel/mac80211/patches/subsys/336-wifi-cfg80211-move-DFS-related-members-to-links-in-w.patch b/package/kernel/mac80211/patches/subsys/336-wifi-cfg80211-move-DFS-related-members-to-links-in-w.patch deleted file mode 100644 index 95dac04de5e..00000000000 --- a/package/kernel/mac80211/patches/subsys/336-wifi-cfg80211-move-DFS-related-members-to-links-in-w.patch +++ /dev/null @@ -1,309 +0,0 @@ -From: Aditya Kumar Singh -Date: Fri, 6 Sep 2024 12:14:22 +0530 -Subject: [PATCH] wifi: cfg80211: move DFS related members to links[] in - wireless_dev - -A few members related to DFS handling are currently under per wireless -device data structure. However, in order to support DFS with MLO, there is -a need to have them on a per-link manner. - -Hence, as a preliminary step, move members cac_started, cac_start_time -and cac_time_ms to be on a per-link basis. - -Since currently, link ID is not known at all places, use default value of -0 for now. - -Signed-off-by: Aditya Kumar Singh -Link: https://patch.msgid.link/20240906064426.2101315-5-quic_adisi@quicinc.com -Signed-off-by: Johannes Berg ---- - ---- a/drivers/net/wireless/marvell/mwifiex/11h.c -+++ b/drivers/net/wireless/marvell/mwifiex/11h.c -@@ -117,7 +117,7 @@ void mwifiex_dfs_cac_work_queue(struct w - dfs_cac_work); - - chandef = priv->dfs_chandef; -- if (priv->wdev.cac_started) { -+ if (priv->wdev.links[0].cac_started) { - mwifiex_dbg(priv->adapter, MSG, - "CAC timer finished; No radar detected\n"); - cfg80211_cac_event(priv->netdev, &chandef, -@@ -174,7 +174,7 @@ int mwifiex_stop_radar_detection(struct - */ - void mwifiex_abort_cac(struct mwifiex_private *priv) - { -- if (priv->wdev.cac_started) { -+ if (priv->wdev.links[0].cac_started) { - if (mwifiex_stop_radar_detection(priv, &priv->dfs_chandef)) - mwifiex_dbg(priv->adapter, ERROR, - "failed to stop CAC in FW\n"); ---- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c -+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c -@@ -1880,7 +1880,7 @@ mwifiex_cfg80211_del_station(struct wiph - struct mwifiex_sta_node *sta_node; - u8 deauth_mac[ETH_ALEN]; - -- if (!priv->bss_started && priv->wdev.cac_started) { -+ if (!priv->bss_started && priv->wdev.links[0].cac_started) { - mwifiex_dbg(priv->adapter, INFO, "%s: abort CAC!\n", __func__); - mwifiex_abort_cac(priv); - } -@@ -3978,7 +3978,7 @@ mwifiex_cfg80211_channel_switch(struct w - return -EBUSY; - } - -- if (priv->wdev.cac_started) -+ if (priv->wdev.links[0].cac_started) - return -EBUSY; - - if (cfg80211_chandef_identical(¶ms->chandef, ---- a/drivers/net/wireless/quantenna/qtnfmac/event.c -+++ b/drivers/net/wireless/quantenna/qtnfmac/event.c -@@ -520,21 +520,21 @@ static int qtnf_event_handle_radar(struc - cfg80211_radar_event(wiphy, &chandef, GFP_KERNEL); - break; - case QLINK_RADAR_CAC_FINISHED: -- if (!vif->wdev.cac_started) -+ if (!vif->wdev.links[0].cac_started) - break; - - cfg80211_cac_event(vif->netdev, &chandef, - NL80211_RADAR_CAC_FINISHED, GFP_KERNEL); - break; - case QLINK_RADAR_CAC_ABORTED: -- if (!vif->wdev.cac_started) -+ if (!vif->wdev.links[0].cac_started) - break; - - cfg80211_cac_event(vif->netdev, &chandef, - NL80211_RADAR_CAC_ABORTED, GFP_KERNEL); - break; - case QLINK_RADAR_CAC_STARTED: -- if (vif->wdev.cac_started) -+ if (vif->wdev.links[0].cac_started) - break; - - if (!wiphy_ext_feature_isset(wiphy, ---- a/include/net/cfg80211.h -+++ b/include/net/cfg80211.h -@@ -6198,9 +6198,6 @@ enum ieee80211_ap_reg_power { - * @address: The address for this device, valid only if @netdev is %NULL - * @is_running: true if this is a non-netdev device that has been started, e.g. - * the P2P Device. -- * @cac_started: true if DFS channel availability check has been started -- * @cac_start_time: timestamp (jiffies) when the dfs state was entered. -- * @cac_time_ms: CAC time in ms - * @ps: powersave mode is enabled - * @ps_timeout: dynamic powersave timeout - * @ap_unexpected_nlportid: (private) netlink port ID of application -@@ -6224,6 +6221,11 @@ enum ieee80211_ap_reg_power { - * unprotected beacon report - * @links: array of %IEEE80211_MLD_MAX_NUM_LINKS elements containing @addr - * @ap and @client for each link -+ * @links[].cac_started: true if DFS channel availability check has been -+ * started -+ * @links[].cac_start_time: timestamp (jiffies) when the dfs state was -+ * entered. -+ * @links[].cac_time_ms: CAC time in ms - * @valid_links: bitmap describing what elements of @links are valid - */ - struct wireless_dev { -@@ -6265,11 +6267,6 @@ struct wireless_dev { - u32 owner_nlportid; - bool nl_owner_dead; - -- /* FIXME: need to rework radar detection for MLO */ -- bool cac_started; -- unsigned long cac_start_time; -- unsigned int cac_time_ms; -- - #ifdef CPTCFG_CFG80211_WEXT - /* wext data */ - struct { -@@ -6336,6 +6333,10 @@ struct wireless_dev { - struct cfg80211_internal_bss *current_bss; - } client; - }; -+ -+ bool cac_started; -+ unsigned long cac_start_time; -+ unsigned int cac_time_ms; - } links[IEEE80211_MLD_MAX_NUM_LINKS]; - u16 valid_links; - }; ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -1656,7 +1656,7 @@ static int ieee80211_stop_ap(struct wiph - ieee80211_link_info_change_notify(sdata, link, - BSS_CHANGED_BEACON_ENABLED); - -- if (sdata->wdev.cac_started) { -+ if (sdata->wdev.links[0].cac_started) { - chandef = link_conf->chanreq.oper; - wiphy_delayed_work_cancel(wiphy, &link->dfs_cac_timer_work); - cfg80211_cac_event(sdata->dev, &chandef, -@@ -3498,9 +3498,9 @@ static void ieee80211_end_cac(struct wip - wiphy_delayed_work_cancel(wiphy, - &sdata->deflink.dfs_cac_timer_work); - -- if (sdata->wdev.cac_started) { -+ if (sdata->wdev.links[0].cac_started) { - ieee80211_link_release_channel(&sdata->deflink); -- sdata->wdev.cac_started = false; -+ sdata->wdev.links[0].cac_started = false; - } - } - } -@@ -3955,7 +3955,7 @@ __ieee80211_channel_switch(struct wiphy - if (!list_empty(&local->roc_list) || local->scanning) - return -EBUSY; - -- if (sdata->wdev.cac_started) -+ if (sdata->wdev.links[0].cac_started) - return -EBUSY; - - if (WARN_ON(link_id >= IEEE80211_MLD_MAX_NUM_LINKS)) ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -553,7 +553,7 @@ static void ieee80211_do_stop(struct iee - wiphy_delayed_work_cancel(local->hw.wiphy, - &sdata->deflink.dfs_cac_timer_work); - -- if (sdata->wdev.cac_started) { -+ if (sdata->wdev.links[0].cac_started) { - chandef = sdata->vif.bss_conf.chanreq.oper; - WARN_ON(local->suspended); - ieee80211_link_release_channel(&sdata->deflink); ---- a/net/mac80211/mlme.c -+++ b/net/mac80211/mlme.c -@@ -3039,7 +3039,7 @@ void ieee80211_dfs_cac_timer_work(struct - - lockdep_assert_wiphy(sdata->local->hw.wiphy); - -- if (sdata->wdev.cac_started) { -+ if (sdata->wdev.links[0].cac_started) { - ieee80211_link_release_channel(link); - cfg80211_cac_event(sdata->dev, &chandef, - NL80211_RADAR_CAC_FINISHED, ---- a/net/mac80211/scan.c -+++ b/net/mac80211/scan.c -@@ -585,7 +585,7 @@ static bool __ieee80211_can_leave_ch(str - return false; - - list_for_each_entry(sdata_iter, &local->interfaces, list) { -- if (sdata_iter->wdev.cac_started) -+ if (sdata_iter->wdev.links[0].cac_started) - return false; - } - ---- a/net/mac80211/util.c -+++ b/net/mac80211/util.c -@@ -3462,7 +3462,7 @@ void ieee80211_dfs_cac_cancel(struct iee - wiphy_delayed_work_cancel(local->hw.wiphy, - &sdata->deflink.dfs_cac_timer_work); - -- if (sdata->wdev.cac_started) { -+ if (sdata->wdev.links[0].cac_started) { - chandef = sdata->vif.bss_conf.chanreq.oper; - ieee80211_link_release_channel(&sdata->deflink); - cfg80211_cac_event(sdata->dev, ---- a/net/wireless/ibss.c -+++ b/net/wireless/ibss.c -@@ -94,7 +94,7 @@ int __cfg80211_join_ibss(struct cfg80211 - - lockdep_assert_held(&rdev->wiphy.mtx); - -- if (wdev->cac_started) -+ if (wdev->links[0].cac_started) - return -EBUSY; - - if (wdev->u.ibss.ssid_len) ---- a/net/wireless/mesh.c -+++ b/net/wireless/mesh.c -@@ -127,7 +127,7 @@ int __cfg80211_join_mesh(struct cfg80211 - if (!rdev->ops->join_mesh) - return -EOPNOTSUPP; - -- if (wdev->cac_started) -+ if (wdev->links[0].cac_started) - return -EBUSY; - - if (!setup->chandef.chan) { ---- a/net/wireless/mlme.c -+++ b/net/wireless/mlme.c -@@ -1124,13 +1124,14 @@ void cfg80211_cac_event(struct net_devic - - trace_cfg80211_cac_event(netdev, event); - -- if (WARN_ON(!wdev->cac_started && event != NL80211_RADAR_CAC_STARTED)) -+ if (WARN_ON(!wdev->links[0].cac_started && -+ event != NL80211_RADAR_CAC_STARTED)) - return; - - switch (event) { - case NL80211_RADAR_CAC_FINISHED: -- timeout = wdev->cac_start_time + -- msecs_to_jiffies(wdev->cac_time_ms); -+ timeout = wdev->links[0].cac_start_time + -+ msecs_to_jiffies(wdev->links[0].cac_time_ms); - WARN_ON(!time_after_eq(jiffies, timeout)); - cfg80211_set_dfs_state(wiphy, chandef, NL80211_DFS_AVAILABLE); - memcpy(&rdev->cac_done_chandef, chandef, -@@ -1139,10 +1140,10 @@ void cfg80211_cac_event(struct net_devic - cfg80211_sched_dfs_chan_update(rdev); - fallthrough; - case NL80211_RADAR_CAC_ABORTED: -- wdev->cac_started = false; -+ wdev->links[0].cac_started = false; - break; - case NL80211_RADAR_CAC_STARTED: -- wdev->cac_started = true; -+ wdev->links[0].cac_started = true; - break; - default: - WARN_ON(1); ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -6066,7 +6066,7 @@ static int nl80211_start_ap(struct sk_bu - if (!rdev->ops->start_ap) - return -EOPNOTSUPP; - -- if (wdev->cac_started) -+ if (wdev->links[0].cac_started) - return -EBUSY; - - if (wdev->links[link_id].ap.beacon_interval) -@@ -10122,7 +10122,7 @@ static int nl80211_start_radar_detection - goto unlock; - } - -- if (cfg80211_beaconing_iface_active(wdev) || wdev->cac_started) { -+ if (cfg80211_beaconing_iface_active(wdev) || wdev->links[0].cac_started) { - err = -EBUSY; - goto unlock; - } -@@ -10158,9 +10158,9 @@ static int nl80211_start_radar_detection - default: - break; - } -- wdev->cac_started = true; -- wdev->cac_start_time = jiffies; -- wdev->cac_time_ms = cac_time_ms; -+ wdev->links[0].cac_started = true; -+ wdev->links[0].cac_start_time = jiffies; -+ wdev->links[0].cac_time_ms = cac_time_ms; - } - unlock: - wiphy_unlock(wiphy); ---- a/net/wireless/reg.c -+++ b/net/wireless/reg.c -@@ -4241,7 +4241,7 @@ static void cfg80211_check_and_end_cac(s - list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { - struct cfg80211_chan_def *chandef; - -- if (!wdev->cac_started) -+ if (!wdev->links[0].cac_started) - continue; - - /* FIXME: radar detection is tied to link 0 for now */ diff --git a/package/kernel/mac80211/patches/subsys/337-wifi-cfg80211-handle-DFS-per-link.patch b/package/kernel/mac80211/patches/subsys/337-wifi-cfg80211-handle-DFS-per-link.patch deleted file mode 100644 index a4e0333642a..00000000000 --- a/package/kernel/mac80211/patches/subsys/337-wifi-cfg80211-handle-DFS-per-link.patch +++ /dev/null @@ -1,435 +0,0 @@ -From: Aditya Kumar Singh -Date: Fri, 6 Sep 2024 12:14:23 +0530 -Subject: [PATCH] wifi: cfg80211: handle DFS per link - -Currently, during starting a radar detection, no link id information is -parsed and passed down. In order to support starting radar detection -during Multi Link Operation, it is required to pass link id as well. - -Add changes to first parse and then pass link id in the start radar -detection path. - -Additionally, update notification APIs to allow drivers/mac80211 to -pass the link ID. - -However, everything is handled at link 0 only until all API's are ready to -handle it per link. - -Signed-off-by: Aditya Kumar Singh -Link: https://patch.msgid.link/20240906064426.2101315-6-quic_adisi@quicinc.com -Signed-off-by: Johannes Berg ---- - ---- a/drivers/net/wireless/marvell/mwifiex/11h.c -+++ b/drivers/net/wireless/marvell/mwifiex/11h.c -@@ -122,7 +122,7 @@ void mwifiex_dfs_cac_work_queue(struct w - "CAC timer finished; No radar detected\n"); - cfg80211_cac_event(priv->netdev, &chandef, - NL80211_RADAR_CAC_FINISHED, -- GFP_KERNEL); -+ GFP_KERNEL, 0); - } - } - -@@ -182,7 +182,8 @@ void mwifiex_abort_cac(struct mwifiex_pr - "Aborting delayed work for CAC.\n"); - cancel_delayed_work_sync(&priv->dfs_cac_work); - cfg80211_cac_event(priv->netdev, &priv->dfs_chandef, -- NL80211_RADAR_CAC_ABORTED, GFP_KERNEL); -+ NL80211_RADAR_CAC_ABORTED, GFP_KERNEL, -+ 0); - } - } - -@@ -221,7 +222,7 @@ int mwifiex_11h_handle_chanrpt_ready(str - cfg80211_cac_event(priv->netdev, - &priv->dfs_chandef, - NL80211_RADAR_DETECTED, -- GFP_KERNEL); -+ GFP_KERNEL, 0); - } - break; - default: ---- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c -+++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c -@@ -4145,7 +4145,7 @@ static int - mwifiex_cfg80211_start_radar_detection(struct wiphy *wiphy, - struct net_device *dev, - struct cfg80211_chan_def *chandef, -- u32 cac_time_ms) -+ u32 cac_time_ms, int link_id) - { - struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev); - struct mwifiex_radar_params radar_params; ---- a/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c -+++ b/drivers/net/wireless/quantenna/qtnfmac/cfg80211.c -@@ -837,7 +837,7 @@ static int qtnf_channel_switch(struct wi - static int qtnf_start_radar_detection(struct wiphy *wiphy, - struct net_device *ndev, - struct cfg80211_chan_def *chandef, -- u32 cac_time_ms) -+ u32 cac_time_ms, int link_id) - { - struct qtnf_vif *vif = qtnf_netdev_get_priv(ndev); - int ret; ---- a/drivers/net/wireless/quantenna/qtnfmac/event.c -+++ b/drivers/net/wireless/quantenna/qtnfmac/event.c -@@ -524,14 +524,14 @@ static int qtnf_event_handle_radar(struc - break; - - cfg80211_cac_event(vif->netdev, &chandef, -- NL80211_RADAR_CAC_FINISHED, GFP_KERNEL); -+ NL80211_RADAR_CAC_FINISHED, GFP_KERNEL, 0); - break; - case QLINK_RADAR_CAC_ABORTED: - if (!vif->wdev.links[0].cac_started) - break; - - cfg80211_cac_event(vif->netdev, &chandef, -- NL80211_RADAR_CAC_ABORTED, GFP_KERNEL); -+ NL80211_RADAR_CAC_ABORTED, GFP_KERNEL, 0); - break; - case QLINK_RADAR_CAC_STARTED: - if (vif->wdev.links[0].cac_started) -@@ -542,7 +542,7 @@ static int qtnf_event_handle_radar(struc - break; - - cfg80211_cac_event(vif->netdev, &chandef, -- NL80211_RADAR_CAC_STARTED, GFP_KERNEL); -+ NL80211_RADAR_CAC_STARTED, GFP_KERNEL, 0); - break; - default: - pr_warn("%s: unhandled radar event %u\n", ---- a/include/net/cfg80211.h -+++ b/include/net/cfg80211.h -@@ -4841,9 +4841,9 @@ struct cfg80211_ops { - int (*start_radar_detection)(struct wiphy *wiphy, - struct net_device *dev, - struct cfg80211_chan_def *chandef, -- u32 cac_time_ms); -+ u32 cac_time_ms, int link_id); - void (*end_cac)(struct wiphy *wiphy, -- struct net_device *dev); -+ struct net_device *dev, unsigned int link_id); - int (*update_ft_ies)(struct wiphy *wiphy, struct net_device *dev, - struct cfg80211_update_ft_ies_params *ftie); - int (*crit_proto_start)(struct wiphy *wiphy, -@@ -8745,6 +8745,7 @@ void cfg80211_sta_opmode_change_notify(s - * @chandef: chandef for the current channel - * @event: type of event - * @gfp: context flags -+ * @link_id: valid link_id for MLO operation or 0 otherwise. - * - * This function is called when a Channel availability check (CAC) is finished - * or aborted. This must be called to notify the completion of a CAC process, -@@ -8752,7 +8753,8 @@ void cfg80211_sta_opmode_change_notify(s - */ - void cfg80211_cac_event(struct net_device *netdev, - const struct cfg80211_chan_def *chandef, -- enum nl80211_radar_event event, gfp_t gfp); -+ enum nl80211_radar_event event, gfp_t gfp, -+ unsigned int link_id); - - /** - * cfg80211_background_cac_abort - Channel Availability Check offchan abort event ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -1661,7 +1661,7 @@ static int ieee80211_stop_ap(struct wiph - wiphy_delayed_work_cancel(wiphy, &link->dfs_cac_timer_work); - cfg80211_cac_event(sdata->dev, &chandef, - NL80211_RADAR_CAC_ABORTED, -- GFP_KERNEL); -+ GFP_KERNEL, 0); - } - - drv_stop_ap(sdata->local, sdata, link_conf); -@@ -3459,7 +3459,7 @@ static int ieee80211_set_bitrate_mask(st - static int ieee80211_start_radar_detection(struct wiphy *wiphy, - struct net_device *dev, - struct cfg80211_chan_def *chandef, -- u32 cac_time_ms) -+ u32 cac_time_ms, int link_id) - { - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); - struct ieee80211_chan_req chanreq = { .oper = *chandef }; -@@ -3487,7 +3487,7 @@ static int ieee80211_start_radar_detecti - } - - static void ieee80211_end_cac(struct wiphy *wiphy, -- struct net_device *dev) -+ struct net_device *dev, unsigned int link_id) - { - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); - struct ieee80211_local *local = sdata->local; ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -559,7 +559,7 @@ static void ieee80211_do_stop(struct iee - ieee80211_link_release_channel(&sdata->deflink); - cfg80211_cac_event(sdata->dev, &chandef, - NL80211_RADAR_CAC_ABORTED, -- GFP_KERNEL); -+ GFP_KERNEL, 0); - } - - if (sdata->vif.type == NL80211_IFTYPE_AP) { ---- a/net/mac80211/mlme.c -+++ b/net/mac80211/mlme.c -@@ -3043,7 +3043,7 @@ void ieee80211_dfs_cac_timer_work(struct - ieee80211_link_release_channel(link); - cfg80211_cac_event(sdata->dev, &chandef, - NL80211_RADAR_CAC_FINISHED, -- GFP_KERNEL); -+ GFP_KERNEL, 0); - } - } - ---- a/net/mac80211/util.c -+++ b/net/mac80211/util.c -@@ -3468,7 +3468,7 @@ void ieee80211_dfs_cac_cancel(struct iee - cfg80211_cac_event(sdata->dev, - &chandef, - NL80211_RADAR_CAC_ABORTED, -- GFP_KERNEL); -+ GFP_KERNEL, 0); - } - } - } ---- a/net/wireless/mlme.c -+++ b/net/wireless/mlme.c -@@ -1111,18 +1111,19 @@ EXPORT_SYMBOL(__cfg80211_radar_event); - - void cfg80211_cac_event(struct net_device *netdev, - const struct cfg80211_chan_def *chandef, -- enum nl80211_radar_event event, gfp_t gfp) -+ enum nl80211_radar_event event, gfp_t gfp, -+ unsigned int link_id) - { - struct wireless_dev *wdev = netdev->ieee80211_ptr; - struct wiphy *wiphy = wdev->wiphy; - struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); - unsigned long timeout; - -- /* not yet supported */ -- if (wdev->valid_links) -+ if (WARN_ON(wdev->valid_links && -+ !(wdev->valid_links & BIT(link_id)))) - return; - -- trace_cfg80211_cac_event(netdev, event); -+ trace_cfg80211_cac_event(netdev, event, link_id); - - if (WARN_ON(!wdev->links[0].cac_started && - event != NL80211_RADAR_CAC_STARTED)) ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -10122,7 +10122,20 @@ static int nl80211_start_radar_detection - goto unlock; - } - -- if (cfg80211_beaconing_iface_active(wdev) || wdev->links[0].cac_started) { -+ if (cfg80211_beaconing_iface_active(wdev)) { -+ /* During MLO other link(s) can beacon, only the current link -+ * can not already beacon -+ */ -+ if (wdev->valid_links && -+ !wdev->links[0].ap.beacon_interval) { -+ /* nothing */ -+ } else { -+ err = -EBUSY; -+ goto unlock; -+ } -+ } -+ -+ if (wdev->links[0].cac_started) { - err = -EBUSY; - goto unlock; - } -@@ -10142,7 +10155,8 @@ static int nl80211_start_radar_detection - if (WARN_ON(!cac_time_ms)) - cac_time_ms = IEEE80211_DFS_MIN_CAC_TIME_MS; - -- err = rdev_start_radar_detection(rdev, dev, &chandef, cac_time_ms); -+ err = rdev_start_radar_detection(rdev, dev, &chandef, cac_time_ms, -+ 0); - if (!err) { - switch (wdev->iftype) { - case NL80211_IFTYPE_AP: -@@ -16512,10 +16526,10 @@ nl80211_set_ttlm(struct sk_buff *skb, st - SELECTOR(__sel, NETDEV_UP_NOTMX, \ - NL80211_FLAG_NEED_NETDEV_UP | \ - NL80211_FLAG_NO_WIPHY_MTX) \ -- SELECTOR(__sel, NETDEV_UP_NOTMX_NOMLO, \ -+ SELECTOR(__sel, NETDEV_UP_NOTMX_MLO, \ - NL80211_FLAG_NEED_NETDEV_UP | \ - NL80211_FLAG_NO_WIPHY_MTX | \ -- NL80211_FLAG_MLO_UNSUPPORTED) \ -+ NL80211_FLAG_MLO_VALID_LINK_ID) \ - SELECTOR(__sel, NETDEV_UP_CLEAR, \ - NL80211_FLAG_NEED_NETDEV_UP | \ - NL80211_FLAG_CLEAR_SKB) \ -@@ -17410,7 +17424,7 @@ static const struct genl_small_ops nl802 - .flags = GENL_UNS_ADMIN_PERM, - .internal_flags = IFLAGS(NL80211_FLAG_NEED_NETDEV_UP | - NL80211_FLAG_NO_WIPHY_MTX | -- NL80211_FLAG_MLO_UNSUPPORTED), -+ NL80211_FLAG_MLO_VALID_LINK_ID), - }, - { - .cmd = NL80211_CMD_GET_PROTOCOL_FEATURES, ---- a/net/wireless/rdev-ops.h -+++ b/net/wireless/rdev-ops.h -@@ -1200,26 +1200,27 @@ static inline int - rdev_start_radar_detection(struct cfg80211_registered_device *rdev, - struct net_device *dev, - struct cfg80211_chan_def *chandef, -- u32 cac_time_ms) -+ u32 cac_time_ms, int link_id) - { - int ret = -EOPNOTSUPP; - - trace_rdev_start_radar_detection(&rdev->wiphy, dev, chandef, -- cac_time_ms); -+ cac_time_ms, link_id); - if (rdev->ops->start_radar_detection) - ret = rdev->ops->start_radar_detection(&rdev->wiphy, dev, -- chandef, cac_time_ms); -+ chandef, cac_time_ms, -+ link_id); - trace_rdev_return_int(&rdev->wiphy, ret); - return ret; - } - - static inline void - rdev_end_cac(struct cfg80211_registered_device *rdev, -- struct net_device *dev) -+ struct net_device *dev, unsigned int link_id) - { -- trace_rdev_end_cac(&rdev->wiphy, dev); -+ trace_rdev_end_cac(&rdev->wiphy, dev, link_id); - if (rdev->ops->end_cac) -- rdev->ops->end_cac(&rdev->wiphy, dev); -+ rdev->ops->end_cac(&rdev->wiphy, dev, link_id); - trace_rdev_return_void(&rdev->wiphy); - } - ---- a/net/wireless/reg.c -+++ b/net/wireless/reg.c -@@ -4229,6 +4229,8 @@ EXPORT_SYMBOL(regulatory_pre_cac_allowed - static void cfg80211_check_and_end_cac(struct cfg80211_registered_device *rdev) - { - struct wireless_dev *wdev; -+ unsigned int link_id; -+ - /* If we finished CAC or received radar, we should end any - * CAC running on the same channels. - * the check !cfg80211_chandef_dfs_usable contain 2 options: -@@ -4241,16 +4243,17 @@ static void cfg80211_check_and_end_cac(s - list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { - struct cfg80211_chan_def *chandef; - -- if (!wdev->links[0].cac_started) -- continue; -+ for_each_valid_link(wdev, link_id) { -+ if (!wdev->links[link_id].cac_started) -+ continue; - -- /* FIXME: radar detection is tied to link 0 for now */ -- chandef = wdev_chandef(wdev, 0); -- if (!chandef) -- continue; -+ chandef = wdev_chandef(wdev, link_id); -+ if (!chandef) -+ continue; - -- if (!cfg80211_chandef_dfs_usable(&rdev->wiphy, chandef)) -- rdev_end_cac(rdev, wdev->netdev); -+ if (!cfg80211_chandef_dfs_usable(&rdev->wiphy, chandef)) -+ rdev_end_cac(rdev, wdev->netdev, link_id); -+ } - } - } - ---- a/net/wireless/trace.h -+++ b/net/wireless/trace.h -@@ -806,17 +806,21 @@ DEFINE_EVENT(wiphy_netdev_evt, rdev_flus - ); - - TRACE_EVENT(rdev_end_cac, -- TP_PROTO(struct wiphy *wiphy, struct net_device *netdev), -- TP_ARGS(wiphy, netdev), -+ TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, -+ unsigned int link_id), -+ TP_ARGS(wiphy, netdev, link_id), - TP_STRUCT__entry( - WIPHY_ENTRY - NETDEV_ENTRY -+ __field(unsigned int, link_id) - ), - TP_fast_assign( - WIPHY_ASSIGN; - NETDEV_ASSIGN; -+ __entry->link_id = link_id; - ), -- TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT, WIPHY_PR_ARG, NETDEV_PR_ARG) -+ TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", link_id: %d", -+ WIPHY_PR_ARG, NETDEV_PR_ARG, __entry->link_id) - ); - - DECLARE_EVENT_CLASS(station_add_change, -@@ -2661,24 +2665,26 @@ TRACE_EVENT(rdev_external_auth, - TRACE_EVENT(rdev_start_radar_detection, - TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, - struct cfg80211_chan_def *chandef, -- u32 cac_time_ms), -- TP_ARGS(wiphy, netdev, chandef, cac_time_ms), -+ u32 cac_time_ms, int link_id), -+ TP_ARGS(wiphy, netdev, chandef, cac_time_ms, link_id), - TP_STRUCT__entry( - WIPHY_ENTRY - NETDEV_ENTRY - CHAN_DEF_ENTRY - __field(u32, cac_time_ms) -+ __field(int, link_id) - ), - TP_fast_assign( - WIPHY_ASSIGN; - NETDEV_ASSIGN; - CHAN_DEF_ASSIGN(chandef); - __entry->cac_time_ms = cac_time_ms; -+ __entry->link_id = link_id; - ), - TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT -- ", cac_time_ms=%u", -+ ", cac_time_ms=%u, link_id=%d", - WIPHY_PR_ARG, NETDEV_PR_ARG, CHAN_DEF_PR_ARG, -- __entry->cac_time_ms) -+ __entry->cac_time_ms, __entry->link_id) - ); - - TRACE_EVENT(rdev_set_mcast_rate, -@@ -3492,18 +3498,21 @@ TRACE_EVENT(cfg80211_radar_event, - ); - - TRACE_EVENT(cfg80211_cac_event, -- TP_PROTO(struct net_device *netdev, enum nl80211_radar_event evt), -- TP_ARGS(netdev, evt), -+ TP_PROTO(struct net_device *netdev, enum nl80211_radar_event evt, -+ unsigned int link_id), -+ TP_ARGS(netdev, evt, link_id), - TP_STRUCT__entry( - NETDEV_ENTRY - __field(enum nl80211_radar_event, evt) -+ __field(unsigned int, link_id) - ), - TP_fast_assign( - NETDEV_ASSIGN; - __entry->evt = evt; -+ __entry->link_id = link_id; - ), -- TP_printk(NETDEV_PR_FMT ", event: %d", -- NETDEV_PR_ARG, __entry->evt) -+ TP_printk(NETDEV_PR_FMT ", event: %d, link_id=%u", -+ NETDEV_PR_ARG, __entry->evt, __entry->link_id) - ); - - DECLARE_EVENT_CLASS(cfg80211_rx_evt, diff --git a/package/kernel/mac80211/patches/subsys/357-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch b/package/kernel/mac80211/patches/subsys/337-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch similarity index 97% rename from package/kernel/mac80211/patches/subsys/357-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch rename to package/kernel/mac80211/patches/subsys/337-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch index e62c15c19d1..d9e484eebaa 100644 --- a/package/kernel/mac80211/patches/subsys/357-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch +++ b/package/kernel/mac80211/patches/subsys/337-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -1374,7 +1374,7 @@ struct ieee80211_local { +@@ -1373,7 +1373,7 @@ struct ieee80211_local { spinlock_t queue_stop_reason_lock; int open_count; diff --git a/package/kernel/mac80211/patches/subsys/338-wifi-mac80211-handle-DFS-per-link.patch b/package/kernel/mac80211/patches/subsys/338-wifi-mac80211-handle-DFS-per-link.patch deleted file mode 100644 index 388c0575c88..00000000000 --- a/package/kernel/mac80211/patches/subsys/338-wifi-mac80211-handle-DFS-per-link.patch +++ /dev/null @@ -1,134 +0,0 @@ -From: Aditya Kumar Singh -Date: Fri, 6 Sep 2024 12:14:24 +0530 -Subject: [PATCH] wifi: mac80211: handle DFS per link - -In order to support DFS with MLO, handle the link ID now passed from -cfg80211, adjust the code to do everything per link and call the -notifications to cfg80211 correctly. - -Signed-off-by: Aditya Kumar Singh -Link: https://patch.msgid.link/20240906064426.2101315-7-quic_adisi@quicinc.com -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -3464,6 +3464,7 @@ static int ieee80211_start_radar_detecti - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); - struct ieee80211_chan_req chanreq = { .oper = *chandef }; - struct ieee80211_local *local = sdata->local; -+ struct ieee80211_link_data *link_data; - int err; - - lockdep_assert_wiphy(local->hw.wiphy); -@@ -3471,16 +3472,20 @@ static int ieee80211_start_radar_detecti - if (!list_empty(&local->roc_list) || local->scanning) - return -EBUSY; - -+ link_data = sdata_dereference(sdata->link[link_id], sdata); -+ if (!link_data) -+ return -ENOLINK; -+ - /* whatever, but channel contexts should not complain about that one */ -- sdata->deflink.smps_mode = IEEE80211_SMPS_OFF; -- sdata->deflink.needed_rx_chains = local->rx_chains; -+ link_data->smps_mode = IEEE80211_SMPS_OFF; -+ link_data->needed_rx_chains = local->rx_chains; - -- err = ieee80211_link_use_channel(&sdata->deflink, &chanreq, -+ err = ieee80211_link_use_channel(link_data, &chanreq, - IEEE80211_CHANCTX_SHARED); - if (err) - return err; - -- wiphy_delayed_work_queue(wiphy, &sdata->deflink.dfs_cac_timer_work, -+ wiphy_delayed_work_queue(wiphy, &link_data->dfs_cac_timer_work, - msecs_to_jiffies(cac_time_ms)); - - return 0; -@@ -3491,16 +3496,21 @@ static void ieee80211_end_cac(struct wip - { - struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); - struct ieee80211_local *local = sdata->local; -+ struct ieee80211_link_data *link_data; - - lockdep_assert_wiphy(local->hw.wiphy); - - list_for_each_entry(sdata, &local->interfaces, list) { -+ link_data = sdata_dereference(sdata->link[link_id], sdata); -+ if (!link_data) -+ continue; -+ - wiphy_delayed_work_cancel(wiphy, -- &sdata->deflink.dfs_cac_timer_work); -+ &link_data->dfs_cac_timer_work); - -- if (sdata->wdev.links[0].cac_started) { -- ieee80211_link_release_channel(&sdata->deflink); -- sdata->wdev.links[0].cac_started = false; -+ if (sdata->wdev.links[link_id].cac_started) { -+ ieee80211_link_release_channel(link_data); -+ sdata->wdev.links[link_id].cac_started = false; - } - } - } ---- a/net/mac80211/link.c -+++ b/net/mac80211/link.c -@@ -77,6 +77,16 @@ void ieee80211_link_stop(struct ieee8021 - &link->color_change_finalize_work); - wiphy_work_cancel(link->sdata->local->hw.wiphy, - &link->csa.finalize_work); -+ -+ if (link->sdata->wdev.links[link->link_id].cac_started) { -+ wiphy_delayed_work_cancel(link->sdata->local->hw.wiphy, -+ &link->dfs_cac_timer_work); -+ cfg80211_cac_event(link->sdata->dev, -+ &link->conf->chanreq.oper, -+ NL80211_RADAR_CAC_ABORTED, -+ GFP_KERNEL, link->link_id); -+ } -+ - ieee80211_link_release_channel(link); - } - ---- a/net/mac80211/util.c -+++ b/net/mac80211/util.c -@@ -3455,20 +3455,30 @@ void ieee80211_dfs_cac_cancel(struct iee - { - struct ieee80211_sub_if_data *sdata; - struct cfg80211_chan_def chandef; -+ struct ieee80211_link_data *link; -+ unsigned int link_id; - - lockdep_assert_wiphy(local->hw.wiphy); - - list_for_each_entry(sdata, &local->interfaces, list) { -- wiphy_delayed_work_cancel(local->hw.wiphy, -- &sdata->deflink.dfs_cac_timer_work); -+ for (link_id = 0; link_id < IEEE80211_MLD_MAX_NUM_LINKS; -+ link_id++) { -+ link = sdata_dereference(sdata->link[link_id], -+ sdata); -+ if (!link) -+ continue; - -- if (sdata->wdev.links[0].cac_started) { -- chandef = sdata->vif.bss_conf.chanreq.oper; -- ieee80211_link_release_channel(&sdata->deflink); -- cfg80211_cac_event(sdata->dev, -- &chandef, -+ wiphy_delayed_work_cancel(local->hw.wiphy, -+ &link->dfs_cac_timer_work); -+ -+ if (!sdata->wdev.links[link_id].cac_started) -+ continue; -+ -+ chandef = link->conf->chanreq.oper; -+ ieee80211_link_release_channel(link); -+ cfg80211_cac_event(sdata->dev, &chandef, - NL80211_RADAR_CAC_ABORTED, -- GFP_KERNEL, 0); -+ GFP_KERNEL, link_id); - } - } - } diff --git a/package/kernel/mac80211/patches/subsys/358-wifi-mac80211-refactor-ieee80211_rx_monitor.patch b/package/kernel/mac80211/patches/subsys/338-wifi-mac80211-refactor-ieee80211_rx_monitor.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/358-wifi-mac80211-refactor-ieee80211_rx_monitor.patch rename to package/kernel/mac80211/patches/subsys/338-wifi-mac80211-refactor-ieee80211_rx_monitor.patch diff --git a/package/kernel/mac80211/patches/subsys/339-wifi-cfg80211-mac80211-use-proper-link-ID-for-DFS.patch b/package/kernel/mac80211/patches/subsys/339-wifi-cfg80211-mac80211-use-proper-link-ID-for-DFS.patch deleted file mode 100644 index 53079b6cf62..00000000000 --- a/package/kernel/mac80211/patches/subsys/339-wifi-cfg80211-mac80211-use-proper-link-ID-for-DFS.patch +++ /dev/null @@ -1,168 +0,0 @@ -From: Aditya Kumar Singh -Date: Fri, 6 Sep 2024 12:14:25 +0530 -Subject: [PATCH] wifi: cfg80211/mac80211: use proper link ID for DFS - -Now that all APIs have support to handle DFS per link, use proper link ID -instead of 0. - -Signed-off-by: Aditya Kumar Singh -Link: https://patch.msgid.link/20240906064426.2101315-8-quic_adisi@quicinc.com -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -1656,12 +1656,12 @@ static int ieee80211_stop_ap(struct wiph - ieee80211_link_info_change_notify(sdata, link, - BSS_CHANGED_BEACON_ENABLED); - -- if (sdata->wdev.links[0].cac_started) { -+ if (sdata->wdev.links[link_id].cac_started) { - chandef = link_conf->chanreq.oper; - wiphy_delayed_work_cancel(wiphy, &link->dfs_cac_timer_work); - cfg80211_cac_event(sdata->dev, &chandef, - NL80211_RADAR_CAC_ABORTED, -- GFP_KERNEL, 0); -+ GFP_KERNEL, link_id); - } - - drv_stop_ap(sdata->local, sdata, link_conf); -@@ -3965,7 +3965,7 @@ __ieee80211_channel_switch(struct wiphy - if (!list_empty(&local->roc_list) || local->scanning) - return -EBUSY; - -- if (sdata->wdev.links[0].cac_started) -+ if (sdata->wdev.links[link_id].cac_started) - return -EBUSY; - - if (WARN_ON(link_id >= IEEE80211_MLD_MAX_NUM_LINKS)) ---- a/net/mac80211/mlme.c -+++ b/net/mac80211/mlme.c -@@ -3039,11 +3039,11 @@ void ieee80211_dfs_cac_timer_work(struct - - lockdep_assert_wiphy(sdata->local->hw.wiphy); - -- if (sdata->wdev.links[0].cac_started) { -+ if (sdata->wdev.links[link->link_id].cac_started) { - ieee80211_link_release_channel(link); - cfg80211_cac_event(sdata->dev, &chandef, - NL80211_RADAR_CAC_FINISHED, -- GFP_KERNEL, 0); -+ GFP_KERNEL, link->link_id); - } - } - ---- a/net/mac80211/scan.c -+++ b/net/mac80211/scan.c -@@ -575,6 +575,7 @@ static bool __ieee80211_can_leave_ch(str - { - struct ieee80211_local *local = sdata->local; - struct ieee80211_sub_if_data *sdata_iter; -+ unsigned int link_id; - - lockdep_assert_wiphy(local->hw.wiphy); - -@@ -585,8 +586,9 @@ static bool __ieee80211_can_leave_ch(str - return false; - - list_for_each_entry(sdata_iter, &local->interfaces, list) { -- if (sdata_iter->wdev.links[0].cac_started) -- return false; -+ for_each_valid_link(&sdata_iter->wdev, link_id) -+ if (sdata_iter->wdev.links[link_id].cac_started) -+ return false; - } - - return true; ---- a/net/wireless/mlme.c -+++ b/net/wireless/mlme.c -@@ -1125,14 +1125,14 @@ void cfg80211_cac_event(struct net_devic - - trace_cfg80211_cac_event(netdev, event, link_id); - -- if (WARN_ON(!wdev->links[0].cac_started && -+ if (WARN_ON(!wdev->links[link_id].cac_started && - event != NL80211_RADAR_CAC_STARTED)) - return; - - switch (event) { - case NL80211_RADAR_CAC_FINISHED: -- timeout = wdev->links[0].cac_start_time + -- msecs_to_jiffies(wdev->links[0].cac_time_ms); -+ timeout = wdev->links[link_id].cac_start_time + -+ msecs_to_jiffies(wdev->links[link_id].cac_time_ms); - WARN_ON(!time_after_eq(jiffies, timeout)); - cfg80211_set_dfs_state(wiphy, chandef, NL80211_DFS_AVAILABLE); - memcpy(&rdev->cac_done_chandef, chandef, -@@ -1141,10 +1141,10 @@ void cfg80211_cac_event(struct net_devic - cfg80211_sched_dfs_chan_update(rdev); - fallthrough; - case NL80211_RADAR_CAC_ABORTED: -- wdev->links[0].cac_started = false; -+ wdev->links[link_id].cac_started = false; - break; - case NL80211_RADAR_CAC_STARTED: -- wdev->links[0].cac_started = true; -+ wdev->links[link_id].cac_started = true; - break; - default: - WARN_ON(1); ---- a/net/wireless/nl80211.c -+++ b/net/wireless/nl80211.c -@@ -6066,7 +6066,7 @@ static int nl80211_start_ap(struct sk_bu - if (!rdev->ops->start_ap) - return -EOPNOTSUPP; - -- if (wdev->links[0].cac_started) -+ if (wdev->links[link_id].cac_started) - return -EBUSY; - - if (wdev->links[link_id].ap.beacon_interval) -@@ -10073,6 +10073,7 @@ static int nl80211_start_radar_detection - struct cfg80211_registered_device *rdev = info->user_ptr[0]; - struct net_device *dev = info->user_ptr[1]; - struct wireless_dev *wdev = dev->ieee80211_ptr; -+ int link_id = nl80211_link_id(info->attrs); - struct wiphy *wiphy = wdev->wiphy; - struct cfg80211_chan_def chandef; - enum nl80211_dfs_regions dfs_region; -@@ -10127,7 +10128,7 @@ static int nl80211_start_radar_detection - * can not already beacon - */ - if (wdev->valid_links && -- !wdev->links[0].ap.beacon_interval) { -+ !wdev->links[link_id].ap.beacon_interval) { - /* nothing */ - } else { - err = -EBUSY; -@@ -10135,7 +10136,7 @@ static int nl80211_start_radar_detection - } - } - -- if (wdev->links[0].cac_started) { -+ if (wdev->links[link_id].cac_started) { - err = -EBUSY; - goto unlock; - } -@@ -10156,7 +10157,7 @@ static int nl80211_start_radar_detection - cac_time_ms = IEEE80211_DFS_MIN_CAC_TIME_MS; - - err = rdev_start_radar_detection(rdev, dev, &chandef, cac_time_ms, -- 0); -+ link_id); - if (!err) { - switch (wdev->iftype) { - case NL80211_IFTYPE_AP: -@@ -10172,9 +10173,9 @@ static int nl80211_start_radar_detection - default: - break; - } -- wdev->links[0].cac_started = true; -- wdev->links[0].cac_start_time = jiffies; -- wdev->links[0].cac_time_ms = cac_time_ms; -+ wdev->links[link_id].cac_started = true; -+ wdev->links[link_id].cac_start_time = jiffies; -+ wdev->links[link_id].cac_time_ms = cac_time_ms; - } - unlock: - wiphy_unlock(wiphy); diff --git a/package/kernel/mac80211/patches/subsys/359-wifi-mac80211-filter-on-monitor-interfaces-based-on-.patch b/package/kernel/mac80211/patches/subsys/339-wifi-mac80211-filter-on-monitor-interfaces-based-on-.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/359-wifi-mac80211-filter-on-monitor-interfaces-based-on-.patch rename to package/kernel/mac80211/patches/subsys/339-wifi-mac80211-filter-on-monitor-interfaces-based-on-.patch diff --git a/package/kernel/mac80211/patches/subsys/360-wifi-cfg80211-report-per-wiphy-radio-antenna-mask.patch b/package/kernel/mac80211/patches/subsys/340-wifi-cfg80211-report-per-wiphy-radio-antenna-mask.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/360-wifi-cfg80211-report-per-wiphy-radio-antenna-mask.patch rename to package/kernel/mac80211/patches/subsys/340-wifi-cfg80211-report-per-wiphy-radio-antenna-mask.patch diff --git a/package/kernel/mac80211/patches/subsys/340-wifi-mac80211-handle-ieee80211_radar_detected-for-ML.patch b/package/kernel/mac80211/patches/subsys/340-wifi-mac80211-handle-ieee80211_radar_detected-for-ML.patch deleted file mode 100644 index 3f64864bd41..00000000000 --- a/package/kernel/mac80211/patches/subsys/340-wifi-mac80211-handle-ieee80211_radar_detected-for-ML.patch +++ /dev/null @@ -1,360 +0,0 @@ -From: Aditya Kumar Singh -Date: Fri, 6 Sep 2024 12:14:26 +0530 -Subject: [PATCH] wifi: mac80211: handle ieee80211_radar_detected() for MLO - -Currently DFS works under assumption there could be only one channel -context in the hardware. Hence, drivers just calls the function -ieee80211_radar_detected() passing the hardware structure. However, with -MLO, this obviously will not work since number of channel contexts will be -more than one and hence drivers would need to pass the channel information -as well on which the radar is detected. - -Also, when radar is detected in one of the links, other link's CAC should -not be cancelled. - -Hence, in order to support DFS with MLO, do the following changes - - * Add channel context conf pointer as an argument to the function - ieee80211_radar_detected(). During MLO, drivers would have to pass on - which channel context conf radar is detected. Otherwise, drivers could - just pass NULL. - * ieee80211_radar_detected() will iterate over all channel contexts - present and - * if channel context conf is passed, only mark that as radar - detected - * if NULL is passed, then mark all channel contexts as radar - detected - * Then as usual, schedule the radar detected work. - * In the worker, go over all the contexts again and for all such context - which is marked with radar detected, cancel the ongoing CAC by calling - ieee80211_dfs_cac_cancel() and then notify cfg80211 via - cfg80211_radar_event(). - * To cancel the CAC, pass the channel context as well where radar is - detected to ieee80211_dfs_cac_cancel(). This ensures that CAC is - canceled only on the links using the provided context, leaving other - links unaffected. - -This would also help in scenarios where there is split phy 5 GHz radio, -which is capable of DFS channels in both lower and upper band. In this -case, simultaneous radars can be detected. - -Signed-off-by: Aditya Kumar Singh -Link: https://patch.msgid.link/20240906064426.2101315-9-quic_adisi@quicinc.com -Signed-off-by: Johannes Berg ---- - ---- a/drivers/net/wireless/ath/ath10k/debug.c -+++ b/drivers/net/wireless/ath/ath10k/debug.c -@@ -3,7 +3,7 @@ - * Copyright (c) 2005-2011 Atheros Communications Inc. - * Copyright (c) 2011-2017 Qualcomm Atheros, Inc. - * Copyright (c) 2018, The Linux Foundation. All rights reserved. -- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. -+ * Copyright (c) 2022, 2024 Qualcomm Innovation Center, Inc. All rights reserved. - */ - - #include -@@ -1774,7 +1774,7 @@ static ssize_t ath10k_write_simulate_rad - if (!arvif->is_started) - return -EINVAL; - -- ieee80211_radar_detected(ar->hw); -+ ieee80211_radar_detected(ar->hw, NULL); - - return count; - } ---- a/drivers/net/wireless/ath/ath10k/mac.c -+++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -1437,7 +1437,7 @@ static void ath10k_recalc_radar_detectio - * by indicating that radar was detected. - */ - ath10k_warn(ar, "failed to start CAC: %d\n", ret); -- ieee80211_radar_detected(ar->hw); -+ ieee80211_radar_detected(ar->hw, NULL); - } - } - ---- a/drivers/net/wireless/ath/ath10k/wmi.c -+++ b/drivers/net/wireless/ath/ath10k/wmi.c -@@ -3990,7 +3990,7 @@ static void ath10k_radar_detected(struct - if (ar->dfs_block_radar_events) - ath10k_info(ar, "DFS Radar detected, but ignored as requested\n"); - else -- ieee80211_radar_detected(ar->hw); -+ ieee80211_radar_detected(ar->hw, NULL); - } - - static void ath10k_radar_confirmation_work(struct work_struct *work) ---- a/drivers/net/wireless/ath/ath11k/wmi.c -+++ b/drivers/net/wireless/ath/ath11k/wmi.c -@@ -8358,7 +8358,7 @@ ath11k_wmi_pdev_dfs_radar_detected_event - if (ar->dfs_block_radar_events) - ath11k_info(ab, "DFS Radar detected, but ignored as requested\n"); - else -- ieee80211_radar_detected(ar->hw); -+ ieee80211_radar_detected(ar->hw, NULL); - - exit: - rcu_read_unlock(); ---- a/drivers/net/wireless/ath/ath12k/wmi.c -+++ b/drivers/net/wireless/ath/ath12k/wmi.c -@@ -6789,7 +6789,7 @@ ath12k_wmi_pdev_dfs_radar_detected_event - if (ar->dfs_block_radar_events) - ath12k_info(ab, "DFS Radar detected, but ignored as requested\n"); - else -- ieee80211_radar_detected(ath12k_ar_to_hw(ar)); -+ ieee80211_radar_detected(ath12k_ar_to_hw(ar), NULL); - - exit: - rcu_read_unlock(); ---- a/drivers/net/wireless/ath/ath9k/dfs.c -+++ b/drivers/net/wireless/ath/ath9k/dfs.c -@@ -280,7 +280,7 @@ ath9k_dfs_process_radar_pulse(struct ath - if (!pd->add_pulse(pd, pe, NULL)) - return; - DFS_STAT_INC(sc, radar_detected); -- ieee80211_radar_detected(sc->hw); -+ ieee80211_radar_detected(sc->hw, NULL); - } - - /* ---- a/drivers/net/wireless/ath/ath9k/dfs_debug.c -+++ b/drivers/net/wireless/ath/ath9k/dfs_debug.c -@@ -116,7 +116,7 @@ static ssize_t write_file_simulate_radar - { - struct ath_softc *sc = file->private_data; - -- ieee80211_radar_detected(sc->hw); -+ ieee80211_radar_detected(sc->hw, NULL); - - return count; - } ---- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c -+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c -@@ -394,7 +394,7 @@ mt7615_mcu_rx_radar_detected(struct mt76 - if (mt76_phy_dfs_state(mphy) < MT_DFS_STATE_CAC) - return; - -- ieee80211_radar_detected(mphy->hw); -+ ieee80211_radar_detected(mphy->hw, NULL); - dev->hw_pattern++; - } - ---- a/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c -+++ b/drivers/net/wireless/mediatek/mt76/mt76x02_dfs.c -@@ -630,7 +630,7 @@ static void mt76x02_dfs_tasklet(struct t - radar_detected = mt76x02_dfs_check_detection(dev); - if (radar_detected) { - /* sw detector rx radar pattern */ -- ieee80211_radar_detected(dev->mt76.hw); -+ ieee80211_radar_detected(dev->mt76.hw, NULL); - mt76x02_dfs_detector_reset(dev); - - return; -@@ -658,7 +658,7 @@ static void mt76x02_dfs_tasklet(struct t - - /* hw detector rx radar pattern */ - dfs_pd->stats[i].hw_pattern++; -- ieee80211_radar_detected(dev->mt76.hw); -+ ieee80211_radar_detected(dev->mt76.hw, NULL); - mt76x02_dfs_detector_reset(dev); - - return; ---- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c -+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c -@@ -293,7 +293,7 @@ mt7915_mcu_rx_radar_detected(struct mt79 - &dev->rdd2_chandef, - GFP_ATOMIC); - else -- ieee80211_radar_detected(mphy->hw); -+ ieee80211_radar_detected(mphy->hw, NULL); - dev->hw_pattern++; - } - ---- a/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c -+++ b/drivers/net/wireless/mediatek/mt76/mt7996/mcu.c -@@ -371,7 +371,7 @@ mt7996_mcu_rx_radar_detected(struct mt79 - &dev->rdd2_chandef, - GFP_ATOMIC); - else -- ieee80211_radar_detected(mphy->hw); -+ ieee80211_radar_detected(mphy->hw, NULL); - dev->hw_pattern++; - } - ---- a/drivers/net/wireless/ti/wl18xx/event.c -+++ b/drivers/net/wireless/ti/wl18xx/event.c -@@ -142,7 +142,7 @@ int wl18xx_process_mailbox_events(struct - wl18xx_radar_type_decode(mbox->radar_type)); - - if (!wl->radar_debug_mode) -- ieee80211_radar_detected(wl->hw); -+ ieee80211_radar_detected(wl->hw, NULL); - } - - if (vector & PERIODIC_SCAN_REPORT_EVENT_ID) { ---- a/drivers/net/wireless/virtual/mac80211_hwsim.c -+++ b/drivers/net/wireless/virtual/mac80211_hwsim.c -@@ -1146,7 +1146,7 @@ static int hwsim_write_simulate_radar(vo - { - struct mac80211_hwsim_data *data = dat; - -- ieee80211_radar_detected(data->hw); -+ ieee80211_radar_detected(data->hw, NULL); - - return 0; - } ---- a/include/net/mac80211.h -+++ b/include/net/mac80211.h -@@ -6717,8 +6717,11 @@ void ieee80211_cqm_beacon_loss_notify(st - * ieee80211_radar_detected - inform that a radar was detected - * - * @hw: pointer as obtained from ieee80211_alloc_hw() -+ * @chanctx_conf: Channel context on which radar is detected. Mandatory to -+ * pass a valid pointer during MLO. For non-MLO %NULL can be passed - */ --void ieee80211_radar_detected(struct ieee80211_hw *hw); -+void ieee80211_radar_detected(struct ieee80211_hw *hw, -+ struct ieee80211_chanctx_conf *chanctx_conf); - - /** - * ieee80211_chswitch_done - Complete channel switch process ---- a/net/mac80211/chan.c -+++ b/net/mac80211/chan.c -@@ -681,6 +681,7 @@ ieee80211_alloc_chanctx(struct ieee80211 - ctx->mode = mode; - ctx->conf.radar_enabled = false; - ctx->conf.radio_idx = radio_idx; -+ ctx->radar_detected = false; - _ieee80211_recalc_chanctx_min_def(local, ctx, NULL, false); - - return ctx; ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -895,6 +895,8 @@ struct ieee80211_chanctx { - struct ieee80211_chan_req req; - - struct ieee80211_chanctx_conf conf; -+ -+ bool radar_detected; - }; - - struct mac80211_qos_map { -@@ -2632,7 +2634,8 @@ void ieee80211_recalc_chanctx_min_def(st - bool ieee80211_is_radar_required(struct ieee80211_local *local); - - void ieee80211_dfs_cac_timer_work(struct wiphy *wiphy, struct wiphy_work *work); --void ieee80211_dfs_cac_cancel(struct ieee80211_local *local); -+void ieee80211_dfs_cac_cancel(struct ieee80211_local *local, -+ struct ieee80211_chanctx *chanctx); - void ieee80211_dfs_radar_detected_work(struct wiphy *wiphy, - struct wiphy_work *work); - int ieee80211_send_action_csa(struct ieee80211_sub_if_data *sdata, ---- a/net/mac80211/pm.c -+++ b/net/mac80211/pm.c -@@ -32,7 +32,7 @@ int __ieee80211_suspend(struct ieee80211 - - ieee80211_scan_cancel(local); - -- ieee80211_dfs_cac_cancel(local); -+ ieee80211_dfs_cac_cancel(local, NULL); - - ieee80211_roc_purge(local, NULL); - ---- a/net/mac80211/util.c -+++ b/net/mac80211/util.c -@@ -3451,11 +3451,16 @@ u64 ieee80211_calculate_rx_timestamp(str - return ts; - } - --void ieee80211_dfs_cac_cancel(struct ieee80211_local *local) -+/* Cancel CAC for the interfaces under the specified @local. If @ctx is -+ * also provided, only the interfaces using that ctx will be canceled. -+ */ -+void ieee80211_dfs_cac_cancel(struct ieee80211_local *local, -+ struct ieee80211_chanctx *ctx) - { - struct ieee80211_sub_if_data *sdata; - struct cfg80211_chan_def chandef; - struct ieee80211_link_data *link; -+ struct ieee80211_chanctx_conf *chanctx_conf; - unsigned int link_id; - - lockdep_assert_wiphy(local->hw.wiphy); -@@ -3468,6 +3473,11 @@ void ieee80211_dfs_cac_cancel(struct iee - if (!link) - continue; - -+ chanctx_conf = sdata_dereference(link->conf->chanctx_conf, -+ sdata); -+ if (ctx && &ctx->conf != chanctx_conf) -+ continue; -+ - wiphy_delayed_work_cancel(local->hw.wiphy, - &link->dfs_cac_timer_work); - -@@ -3488,9 +3498,8 @@ void ieee80211_dfs_radar_detected_work(s - { - struct ieee80211_local *local = - container_of(work, struct ieee80211_local, radar_detected_work); -- struct cfg80211_chan_def chandef = local->hw.conf.chandef; -+ struct cfg80211_chan_def chandef; - struct ieee80211_chanctx *ctx; -- int num_chanctx = 0; - - lockdep_assert_wiphy(local->hw.wiphy); - -@@ -3498,25 +3507,46 @@ void ieee80211_dfs_radar_detected_work(s - if (ctx->replace_state == IEEE80211_CHANCTX_REPLACES_OTHER) - continue; - -- num_chanctx++; -+ if (!ctx->radar_detected) -+ continue; -+ -+ ctx->radar_detected = false; -+ - chandef = ctx->conf.def; -+ -+ ieee80211_dfs_cac_cancel(local, ctx); -+ cfg80211_radar_event(local->hw.wiphy, &chandef, GFP_KERNEL); - } -+} - -- ieee80211_dfs_cac_cancel(local); -+static void -+ieee80211_radar_mark_chan_ctx_iterator(struct ieee80211_hw *hw, -+ struct ieee80211_chanctx_conf *chanctx_conf, -+ void *data) -+{ -+ struct ieee80211_chanctx *ctx = -+ container_of(chanctx_conf, struct ieee80211_chanctx, -+ conf); - -- if (num_chanctx > 1) -- /* XXX: multi-channel is not supported yet */ -- WARN_ON(1); -- else -- cfg80211_radar_event(local->hw.wiphy, &chandef, GFP_KERNEL); -+ if (ctx->replace_state == IEEE80211_CHANCTX_REPLACES_OTHER) -+ return; -+ -+ if (data && data != chanctx_conf) -+ return; -+ -+ ctx->radar_detected = true; - } - --void ieee80211_radar_detected(struct ieee80211_hw *hw) -+void ieee80211_radar_detected(struct ieee80211_hw *hw, -+ struct ieee80211_chanctx_conf *chanctx_conf) - { - struct ieee80211_local *local = hw_to_local(hw); - - trace_api_radar_detected(local); - -+ ieee80211_iter_chan_contexts_atomic(hw, ieee80211_radar_mark_chan_ctx_iterator, -+ chanctx_conf); -+ - wiphy_work_queue(hw->wiphy, &local->radar_detected_work); - } - EXPORT_SYMBOL(ieee80211_radar_detected); diff --git a/package/kernel/mac80211/patches/subsys/361-wifi-mac80211-fix-vif-addr-when-switching-from-monit.patch b/package/kernel/mac80211/patches/subsys/341-wifi-mac80211-fix-vif-addr-when-switching-from-monit.patch similarity index 100% rename from package/kernel/mac80211/patches/subsys/361-wifi-mac80211-fix-vif-addr-when-switching-from-monit.patch rename to package/kernel/mac80211/patches/subsys/341-wifi-mac80211-fix-vif-addr-when-switching-from-monit.patch diff --git a/package/kernel/mac80211/patches/subsys/341-wifi-mac80211-skip-non-uploaded-keys-in-ieee80211_it.patch b/package/kernel/mac80211/patches/subsys/341-wifi-mac80211-skip-non-uploaded-keys-in-ieee80211_it.patch deleted file mode 100644 index b426d68c326..00000000000 --- a/package/kernel/mac80211/patches/subsys/341-wifi-mac80211-skip-non-uploaded-keys-in-ieee80211_it.patch +++ /dev/null @@ -1,79 +0,0 @@ -From: Felix Fietkau -Date: Sun, 6 Oct 2024 17:34:08 +0200 -Subject: [PATCH] wifi: mac80211: skip non-uploaded keys in ieee80211_iter_keys - -Sync iterator conditions with ieee80211_iter_keys_rcu. - -Fixes: 830af02f24fb ("mac80211: allow driver to iterate keys") -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/key.c -+++ b/net/mac80211/key.c -@@ -987,6 +987,26 @@ void ieee80211_reenable_keys(struct ieee - } - } - -+static void -+ieee80211_key_iter(struct ieee80211_hw *hw, -+ struct ieee80211_vif *vif, -+ struct ieee80211_key *key, -+ void (*iter)(struct ieee80211_hw *hw, -+ struct ieee80211_vif *vif, -+ struct ieee80211_sta *sta, -+ struct ieee80211_key_conf *key, -+ void *data), -+ void *iter_data) -+{ -+ /* skip keys of station in removal process */ -+ if (key->sta && key->sta->removed) -+ return; -+ if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) -+ return; -+ iter(hw, vif, key->sta ? &key->sta->sta : NULL, -+ &key->conf, iter_data); -+} -+ - void ieee80211_iter_keys(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, - void (*iter)(struct ieee80211_hw *hw, -@@ -1005,16 +1025,13 @@ void ieee80211_iter_keys(struct ieee8021 - if (vif) { - sdata = vif_to_sdata(vif); - list_for_each_entry_safe(key, tmp, &sdata->key_list, list) -- iter(hw, &sdata->vif, -- key->sta ? &key->sta->sta : NULL, -- &key->conf, iter_data); -+ ieee80211_key_iter(hw, vif, key, iter, iter_data); - } else { - list_for_each_entry(sdata, &local->interfaces, list) - list_for_each_entry_safe(key, tmp, - &sdata->key_list, list) -- iter(hw, &sdata->vif, -- key->sta ? &key->sta->sta : NULL, -- &key->conf, iter_data); -+ ieee80211_key_iter(hw, &sdata->vif, key, -+ iter, iter_data); - } - } - EXPORT_SYMBOL(ieee80211_iter_keys); -@@ -1031,17 +1048,8 @@ _ieee80211_iter_keys_rcu(struct ieee8021 - { - struct ieee80211_key *key; - -- list_for_each_entry_rcu(key, &sdata->key_list, list) { -- /* skip keys of station in removal process */ -- if (key->sta && key->sta->removed) -- continue; -- if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE)) -- continue; -- -- iter(hw, &sdata->vif, -- key->sta ? &key->sta->sta : NULL, -- &key->conf, iter_data); -- } -+ list_for_each_entry_rcu(key, &sdata->key_list, list) -+ ieee80211_key_iter(hw, &sdata->vif, key, iter, iter_data); - } - - void ieee80211_iter_keys_rcu(struct ieee80211_hw *hw, diff --git a/package/kernel/mac80211/patches/subsys/362-wifi-mac80211-fix-incorrect-timing-to-initialize-sta.patch b/package/kernel/mac80211/patches/subsys/362-wifi-mac80211-fix-incorrect-timing-to-initialize-sta.patch deleted file mode 100644 index 94e51afd859..00000000000 --- a/package/kernel/mac80211/patches/subsys/362-wifi-mac80211-fix-incorrect-timing-to-initialize-sta.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: Benjamin Lin -Date: Mon, 18 Nov 2024 16:07:22 +0800 -Subject: [PATCH] wifi: mac80211: fix incorrect timing to initialize - station NSS capability - -Station's spatial streaming capability should be initialized before -handling VHT OMN, because the handling requires the capability information. - -Fixes: a8bca3e9371d ("wifi: mac80211: track capability/opmode NSS separately") -Signed-off-by: Benjamin Lin ---- - ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -1914,6 +1914,8 @@ static int sta_link_apply_parameters(str - params->eht_capa_len, - link_sta); - -+ ieee80211_sta_init_nss(link_sta); -+ - if (params->opmode_notif_used) { - /* returned value is only needed for rc update, but the - * rc isn't initialized here yet, so ignore it -@@ -1923,8 +1925,6 @@ static int sta_link_apply_parameters(str - sband->band); - } - -- ieee80211_sta_init_nss(link_sta); -- - return 0; - } - diff --git a/package/kernel/mac80211/patches/subsys/363-wifi-mac80211-ieee80211_i-Fix-memory-corruption-bug-.patch b/package/kernel/mac80211/patches/subsys/363-wifi-mac80211-ieee80211_i-Fix-memory-corruption-bug-.patch deleted file mode 100644 index dcdb89cd4a6..00000000000 --- a/package/kernel/mac80211/patches/subsys/363-wifi-mac80211-ieee80211_i-Fix-memory-corruption-bug-.patch +++ /dev/null @@ -1,53 +0,0 @@ -From: "Gustavo A. R. Silva" -Date: Fri, 25 Oct 2024 16:05:50 -0600 -Subject: [PATCH] wifi: mac80211: ieee80211_i: Fix memory corruption bug in - struct ieee80211_chanctx - -Move the `struct ieee80211_chanctx_conf conf` to the end of -`struct ieee80211_chanctx` and fix a memory corruption bug -triggered e.g. in `hwsim_set_chanctx_magic()`: `radar_detected` -is being overwritten when `cp->magic = HWSIM_CHANCTX_MAGIC;` -See the function call sequence below: - -drv_add_chanctx(... struct ieee80211_chanctx *ctx) -> - local->ops->add_chanctx(&local->hw, &ctx->conf) -> - mac80211_hwsim_add_chanctx(... struct ieee80211_chanctx_conf *ctx) -> - hwsim_set_chanctx_magic(ctx) - -This also happens in a number of other drivers. - -Also, add a code comment to try to prevent people from introducing -new members after `struct ieee80211_chanctx_conf conf`. Notice that -`struct ieee80211_chanctx_conf` is a flexible structure --a structure -that contains a flexible-array member, so it should always be at -the end of any other containing structures. - -This change also fixes 50 of the following warnings: - -net/mac80211/ieee80211_i.h:895:39: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] - --Wflex-array-member-not-at-end was introduced in GCC-14, and we are -getting ready to enable it, globally. - -Fixes: bca8bc0399ac ("wifi: mac80211: handle ieee80211_radar_detected() for MLO") -Signed-off-by: Gustavo A. R. Silva -Link: https://patch.msgid.link/ZxwWPrncTeSi1UTq@kspp -[also refer to other drivers in commit message] -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -894,9 +894,10 @@ struct ieee80211_chanctx { - /* temporary data for search algorithm etc. */ - struct ieee80211_chan_req req; - -- struct ieee80211_chanctx_conf conf; -- - bool radar_detected; -+ -+ /* MUST be last - ends in a flexible-array member. */ -+ struct ieee80211_chanctx_conf conf; - }; - - struct mac80211_qos_map { diff --git a/package/kernel/mac80211/patches/subsys/364-mac80211-fix-user-power-when-emulating-chanctx.patch b/package/kernel/mac80211/patches/subsys/364-mac80211-fix-user-power-when-emulating-chanctx.patch deleted file mode 100644 index 15db2c54e4d..00000000000 --- a/package/kernel/mac80211/patches/subsys/364-mac80211-fix-user-power-when-emulating-chanctx.patch +++ /dev/null @@ -1,24 +0,0 @@ -From: Ben Greear -Date: Thu, 10 Oct 2024 13:39:54 -0700 -Subject: [PATCH] mac80211: fix user-power when emulating chanctx - -ieee80211_calc_hw_conf_chan was ignoring the configured -user_txpower. If it is set, use it to potentially decrease -txpower as requested. - -Signed-off-by: Ben Greear -Link: https://patch.msgid.link/20241010203954.1219686-1-greearb@candelatech.com -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/main.c -+++ b/net/mac80211/main.c -@@ -167,6 +167,8 @@ static u32 ieee80211_calc_hw_conf_chan(s - } - - power = ieee80211_chandef_max_power(&chandef); -+ if (local->user_power_level != IEEE80211_UNSET_POWER_LEVEL) -+ power = min(local->user_power_level, power); - - rcu_read_lock(); - list_for_each_entry_rcu(sdata, &local->interfaces, list) { diff --git a/package/kernel/mac80211/patches/subsys/365-wifi-cfg80211-Add-wiphy_delayed_work_pending.patch b/package/kernel/mac80211/patches/subsys/365-wifi-cfg80211-Add-wiphy_delayed_work_pending.patch deleted file mode 100644 index 981cc2433b3..00000000000 --- a/package/kernel/mac80211/patches/subsys/365-wifi-cfg80211-Add-wiphy_delayed_work_pending.patch +++ /dev/null @@ -1,83 +0,0 @@ -From: Remi Pommarel -Date: Tue, 24 Sep 2024 21:28:04 +0200 -Subject: [PATCH] wifi: cfg80211: Add wiphy_delayed_work_pending() - -Add wiphy_delayed_work_pending() to check if any delayed work timer is -pending, that can be used to be sure that wiphy_delayed_work_queue() -won't postpone an already pending delayed work. - -Signed-off-by: Remi Pommarel -Link: https://patch.msgid.link/20240924192805.13859-2-repk@triplefau.lt -[fix return value kernel-doc] -Signed-off-by: Johannes Berg ---- - ---- a/include/net/cfg80211.h -+++ b/include/net/cfg80211.h -@@ -6141,6 +6141,50 @@ void wiphy_delayed_work_flush(struct wip - struct wiphy_delayed_work *dwork); - - /** -+ * wiphy_delayed_work_pending - Find out whether a wiphy delayable -+ * work item is currently pending. -+ * -+ * @wiphy: the wiphy, for debug purposes -+ * @dwork: the delayed work in question -+ * -+ * Return: true if timer is pending, false otherwise -+ * -+ * How wiphy_delayed_work_queue() works is by setting a timer which -+ * when it expires calls wiphy_work_queue() to queue the wiphy work. -+ * Because wiphy_delayed_work_queue() uses mod_timer(), if it is -+ * called twice and the second call happens before the first call -+ * deadline, the work will rescheduled for the second deadline and -+ * won't run before that. -+ * -+ * wiphy_delayed_work_pending() can be used to detect if calling -+ * wiphy_work_delayed_work_queue() would start a new work schedule -+ * or delayed a previous one. As seen below it cannot be used to -+ * detect precisely if the work has finished to execute nor if it -+ * is currently executing. -+ * -+ * CPU0 CPU1 -+ * wiphy_delayed_work_queue(wk) -+ * mod_timer(wk->timer) -+ * wiphy_delayed_work_pending(wk) -> true -+ * -+ * [...] -+ * expire_timers(wk->timer) -+ * detach_timer(wk->timer) -+ * wiphy_delayed_work_pending(wk) -> false -+ * wk->timer->function() | -+ * wiphy_work_queue(wk) | delayed work pending -+ * list_add_tail() | returns false but -+ * queue_work(cfg80211_wiphy_work) | wk->func() has not -+ * | been run yet -+ * [...] | -+ * cfg80211_wiphy_work() | -+ * wk->func() V -+ * -+ */ -+bool wiphy_delayed_work_pending(struct wiphy *wiphy, -+ struct wiphy_delayed_work *dwork); -+ -+/** - * enum ieee80211_ap_reg_power - regulatory power for an Access Point - * - * @IEEE80211_REG_UNSET_AP: Access Point has no regulatory power mode ---- a/net/wireless/core.c -+++ b/net/wireless/core.c -@@ -1735,6 +1735,13 @@ void wiphy_delayed_work_flush(struct wip - } - EXPORT_SYMBOL_GPL(wiphy_delayed_work_flush); - -+bool wiphy_delayed_work_pending(struct wiphy *wiphy, -+ struct wiphy_delayed_work *dwork) -+{ -+ return timer_pending(&dwork->timer); -+} -+EXPORT_SYMBOL_GPL(wiphy_delayed_work_pending); -+ - static int __init cfg80211_init(void) - { - int err; diff --git a/package/kernel/mac80211/patches/subsys/366-wifi-mac80211-Convert-color-collision-detection-to-w.patch b/package/kernel/mac80211/patches/subsys/366-wifi-mac80211-Convert-color-collision-detection-to-w.patch deleted file mode 100644 index ae72441c468..00000000000 --- a/package/kernel/mac80211/patches/subsys/366-wifi-mac80211-Convert-color-collision-detection-to-w.patch +++ /dev/null @@ -1,148 +0,0 @@ -From: Remi Pommarel -Date: Tue, 24 Sep 2024 21:28:05 +0200 -Subject: [PATCH] wifi: mac80211: Convert color collision detection to wiphy - work - -Call to ieee80211_color_collision_detection_work() needs wiphy lock to -be held (see lockdep assert in cfg80211_bss_color_notify()). Not locking -wiphy causes the following lockdep error: - - WARNING: CPU: 2 PID: 42 at net/wireless/nl80211.c:19505 cfg80211_bss_color_notify+0x1a4/0x25c - Modules linked in: - CPU: 2 PID: 42 Comm: kworker/u8:3 Tainted: G W 6.4.0-02327-g36c6cb260481 #1048 - Hardware name: - Workqueue: phy1 ieee80211_color_collision_detection_work - pstate: 60000005 (nZCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) - pc : cfg80211_bss_color_notify+0x1a4/0x25c - lr : cfg80211_bss_color_notify+0x1a0/0x25c - sp : ffff000002947d00 - x29: ffff000002947d00 x28: ffff800008e1a000 x27: ffff000002bd4705 - x26: ffff00000d034000 x25: ffff80000903cf40 x24: 0000000000000000 - x23: ffff00000cb70720 x22: 0000000000800000 x21: ffff800008dfb008 - x20: 000000000000008d x19: ffff00000d035fa8 x18: 0000000000000010 - x17: 0000000000000001 x16: 000003564b1ce96a x15: 000d69696d057970 - x14: 000000000000003b x13: 0000000000000001 x12: 0000000000040000 - x11: 0000000000000001 x10: ffff80000978f9c0 x9 : ffff0000028d3174 - x8 : ffff800008e30000 x7 : 0000000000000000 x6 : 0000000000000028 - x5 : 000000000002f498 x4 : ffff00000d034a80 x3 : 0000000000800000 - x2 : ffff800016143000 x1 : 0000000000000000 x0 : 0000000000000000 - Call trace: - cfg80211_bss_color_notify+0x1a4/0x25c - ieee80211_color_collision_detection_work+0x20/0x118 - process_one_work+0x294/0x554 - worker_thread+0x70/0x440 - kthread+0xf4/0xf8 - ret_from_fork+0x10/0x20 - irq event stamp: 77372 - hardirqs last enabled at (77371): [] _raw_spin_unlock_irq+0x2c/0x4c - hardirqs last disabled at (77372): [] el1_dbg+0x20/0x48 - softirqs last enabled at (77350): [] batadv_send_outstanding_bcast_packet+0xb8/0x120 - softirqs last disabled at (77348): [] batadv_send_outstanding_bcast_packet+0x80/0x120 - -The wiphy lock cannot be taken directly from color collision detection -delayed work (ieee80211_color_collision_detection_work()) because this -work is cancel_delayed_work_sync() under this wiphy lock causing a -potential deadlock( see [0] for details). - -To fix that ieee80211_color_collision_detection_work() could be -converted to a wiphy work and cancel_delayed_work_sync() can be simply -replaced by wiphy_delayed_work_cancel() serving the same purpose under -wiphy lock. - -This could potentially fix [1]. - -[0]: https://lore.kernel.org/linux-wireless/D4A40Q44OAY2.W3SIF6UEPBUN@freebox.fr/ -[1]: https://lore.kernel.org/lkml/000000000000612f290618eee3e5@google.com/ - -Reported-by: Nicolas Escande -Signed-off-by: Remi Pommarel -Link: https://patch.msgid.link/20240924192805.13859-3-repk@triplefau.lt -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -4836,12 +4836,12 @@ void ieee80211_color_change_finalize_wor - ieee80211_color_change_finalize(link); - } - --void ieee80211_color_collision_detection_work(struct work_struct *work) -+void ieee80211_color_collision_detection_work(struct wiphy *wiphy, -+ struct wiphy_work *work) - { -- struct delayed_work *delayed_work = to_delayed_work(work); - struct ieee80211_link_data *link = -- container_of(delayed_work, struct ieee80211_link_data, -- color_collision_detect_work); -+ container_of(work, struct ieee80211_link_data, -+ color_collision_detect_work.work); - struct ieee80211_sub_if_data *sdata = link->sdata; - - cfg80211_obss_color_collision_notify(sdata->dev, link->color_bitmap, -@@ -4894,7 +4894,8 @@ ieee80211_obss_color_collision_notify(st - return; - } - -- if (delayed_work_pending(&link->color_collision_detect_work)) { -+ if (wiphy_delayed_work_pending(sdata->local->hw.wiphy, -+ &link->color_collision_detect_work)) { - rcu_read_unlock(); - return; - } -@@ -4903,9 +4904,9 @@ ieee80211_obss_color_collision_notify(st - /* queue the color collision detection event every 500 ms in order to - * avoid sending too much netlink messages to userspace. - */ -- ieee80211_queue_delayed_work(&sdata->local->hw, -- &link->color_collision_detect_work, -- msecs_to_jiffies(500)); -+ wiphy_delayed_work_queue(sdata->local->hw.wiphy, -+ &link->color_collision_detect_work, -+ msecs_to_jiffies(500)); - - rcu_read_unlock(); - } ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -1056,7 +1056,7 @@ struct ieee80211_link_data { - } csa; - - struct wiphy_work color_change_finalize_work; -- struct delayed_work color_collision_detect_work; -+ struct wiphy_delayed_work color_collision_detect_work; - u64 color_bitmap; - - /* context reservation -- protected with wiphy mutex */ -@@ -2010,7 +2010,8 @@ int ieee80211_channel_switch(struct wiph - /* color change handling */ - void ieee80211_color_change_finalize_work(struct wiphy *wiphy, - struct wiphy_work *work); --void ieee80211_color_collision_detection_work(struct work_struct *work); -+void ieee80211_color_collision_detection_work(struct wiphy *wiphy, -+ struct wiphy_work *work); - - /* interface handling */ - #define MAC80211_SUPPORTED_FEATURES_TX (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | \ ---- a/net/mac80211/link.c -+++ b/net/mac80211/link.c -@@ -41,8 +41,8 @@ void ieee80211_link_init(struct ieee8021 - ieee80211_csa_finalize_work); - wiphy_work_init(&link->color_change_finalize_work, - ieee80211_color_change_finalize_work); -- INIT_DELAYED_WORK(&link->color_collision_detect_work, -- ieee80211_color_collision_detection_work); -+ wiphy_delayed_work_init(&link->color_collision_detect_work, -+ ieee80211_color_collision_detection_work); - INIT_LIST_HEAD(&link->assigned_chanctx_list); - INIT_LIST_HEAD(&link->reserved_chanctx_list); - wiphy_delayed_work_init(&link->dfs_cac_timer_work, -@@ -72,7 +72,8 @@ void ieee80211_link_stop(struct ieee8021 - if (link->sdata->vif.type == NL80211_IFTYPE_STATION) - ieee80211_mgd_stop_link(link); - -- cancel_delayed_work_sync(&link->color_collision_detect_work); -+ wiphy_delayed_work_cancel(link->sdata->local->hw.wiphy, -+ &link->color_collision_detect_work); - wiphy_work_cancel(link->sdata->local->hw.wiphy, - &link->color_change_finalize_work); - wiphy_work_cancel(link->sdata->local->hw.wiphy,