From bb84c256e701a21a97443ffe9dd1d510bd6c1c40 Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Sun, 16 Feb 2025 21:23:32 +0100 Subject: [PATCH 01/26] ramips: improve MT7621S core detection The proposed detection method was based on reading the LAUNCH_FREADY core flag. However, this method only works before the cores are launched. For this reason, the core number detection method has been changed to a simpler one. For mt6721s the 17th revision bit is zero, hence we know that it is this chip, so the number of cores is 1. Fixes: https://github.com/openwrt/openwrt/issues/17764 Tested-by: Enrico Mioso Tested-by: Simon Etzlstorfer Tested-by: Mauri Sandberg Co-authored-by: Shiji Yang Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/17834 Signed-off-by: Hauke Mehrtens --- ...ort-for-buggy-MT7621S-core-detection.patch | 50 +++++++------------ 1 file changed, 19 insertions(+), 31 deletions(-) diff --git a/target/linux/ramips/patches-6.6/320-MIPS-add-support-for-buggy-MT7621S-core-detection.patch b/target/linux/ramips/patches-6.6/320-MIPS-add-support-for-buggy-MT7621S-core-detection.patch index ef54835f89..50329953cf 100644 --- a/target/linux/ramips/patches-6.6/320-MIPS-add-support-for-buggy-MT7621S-core-detection.patch +++ b/target/linux/ramips/patches-6.6/320-MIPS-add-support-for-buggy-MT7621S-core-detection.patch @@ -26,8 +26,18 @@ Suggested-by: Felix Fietkau Signed-off-by: Ilya Lipnitskiy Signed-off-by: Thomas Bogendoerfer --- - arch/mips/include/asm/mips-cps.h | 23 ++++++++++++++++++++++- - 1 file changed, 22 insertions(+), 1 deletion(-) + +The proposed detection method was based on reading the LAUNCH_FREADY core flag. +However, this method only works before the cores are launched. +For this reason, the core number detection method has been changed to a simpler one. +For mt6721s the 17th revision bit is zero, hence we know that it is this chip, +so the number of cores is 1. + +Co-authored-by: Shiji Yang +Signed-off-by: Mieczyslaw Nalewaj +--- + arch/mips/include/asm/mips-cps.h | 5 +++++ + 1 file changed, 5 insertions(+) --- a/arch/mips/include/asm/mips-cps.h +++ b/arch/mips/include/asm/mips-cps.h @@ -35,41 +45,19 @@ Signed-off-by: Thomas Bogendoerfer #include #include -+#include ++#include + extern unsigned long __cps_access_bad_size(void) __compiletime_error("Bad size for CPS accessor"); -@@ -162,12 +164,31 @@ static inline uint64_t mips_cps_cluster_ - */ - static inline unsigned int mips_cps_numcores(unsigned int cluster) - { -+ unsigned int ncores; -+ +@@ -165,6 +167,10 @@ static inline unsigned int mips_cps_numc if (!mips_cm_present()) return 0; ++ if (IS_ENABLED(CONFIG_SOC_MT7621) && ++ !FIELD_GET(0x20000, __raw_readl(MT7621_SYSC_BASE + SYSC_REG_CHIP_REV))) ++ return 1; ++ /* Add one before masking to handle 0xff indicating no cores */ -- return FIELD_GET(CM_GCR_CONFIG_PCORES, -+ ncores = FIELD_GET(CM_GCR_CONFIG_PCORES, + return FIELD_GET(CM_GCR_CONFIG_PCORES, mips_cps_cluster_config(cluster) + 1); -+ -+ if (IS_ENABLED(CONFIG_SOC_MT7621)) { -+ struct cpulaunch *launch; -+ -+ /* -+ * Ralink MT7621S SoC is single core, but the GCR_CONFIG method -+ * always reports 2 cores. Check the second core's LAUNCH_FREADY -+ * flag to detect if the second core is missing. This method -+ * only works before the core has been started. -+ */ -+ launch = (struct cpulaunch *)CKSEG0ADDR(CPULAUNCH); -+ launch += 2; /* MT7621 has 2 VPEs per core */ -+ if (!(launch->flags & LAUNCH_FREADY)) -+ ncores = 1; -+ } -+ -+ return ncores; - } - - /** From 1437ff840b9b81f62a7cfca02b0ba17f506ea028 Mon Sep 17 00:00:00 2001 From: Robert Senderek Date: Mon, 17 Feb 2025 08:15:20 +0100 Subject: [PATCH 02/26] tools: firmware-utils: update to Git HEAD (2024-02-16) 2051fe5 mktplinkfw2: Add 16MLmtk layout 5d1446b tplink-safeloader: Add more special_id's for MR70X Signed-off-by: Robert Senderek Link: https://github.com/openwrt/openwrt/pull/17999 Signed-off-by: Hauke Mehrtens --- tools/firmware-utils/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile index 117dceb754..3caaa8e437 100644 --- a/tools/firmware-utils/Makefile +++ b/tools/firmware-utils/Makefile @@ -11,9 +11,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware-utils.git -PKG_SOURCE_DATE:=2025-01-14 -PKG_SOURCE_VERSION:=12c0b42231bee58b3cd7cbe95c33de2685484a4f -PKG_MIRROR_HASH:=50d872a5069f9f672de5ea9efcf00872bcce27ec52bbb69fff3785abcee1c77c +PKG_SOURCE_DATE:=2025-02-16 +PKG_SOURCE_VERSION:=5d1446bf57d6490573dc71f10c05e83b36d44374 +PKG_MIRROR_HASH:=e054ea416f5a596f681bba593f71dfbe8149361432d7c17f2374c60dfe227749 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk From f93367227e1458fb366304d0f431f12e95d244cd Mon Sep 17 00:00:00 2001 From: Robert Senderek Date: Fri, 14 Feb 2025 09:01:39 +0100 Subject: [PATCH 03/26] ramips: Add support for Mercusys MR1800X as alt name of MR70X Both share the same OEM firmware but differ in product_name for safeloader product_name:MR1800X,product_ver:1.0.0,special_id:45550000 Signed-off-by: Robert Senderek Link: https://github.com/openwrt/openwrt/pull/17965 Signed-off-by: Hauke Mehrtens --- target/linux/ramips/image/mt7621.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index d887374e26..cfcfd0c88a 100755 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -1992,6 +1992,8 @@ define Device/mercusys_mr70x-v1 $(Device/tplink-safeloader) DEVICE_VENDOR := MERCUSYS DEVICE_MODEL := MR70X + DEVICE_ALT0_VENDOR := MERCUSYS + DEVICE_ALT0_MODEL := MR1800X DEVICE_VARIANT := v1 DEVICE_PACKAGES := kmod-mt7915-firmware -uboot-envtools TPLINK_BOARD_ID := MR70X From 31dc43daf5e5fa11055806f6f23168b89487f812 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 18 Feb 2025 04:31:05 +0000 Subject: [PATCH 04/26] generic: mtk_eth_soc: dump registers on forced reset Import patch from MediaTek's SDK to hack-6.6 which dumps all relevant registers of the Ethernet controller in case of a forced reset. This can help to debug and find the cause for sporadic resets seen on Filogic SoCs when used with OpenWrt's Linux 6.6. Link: https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/73d44392b8556c5fdd13728c1b56ce2abfe280df Signed-off-by: Daniel Golle --- ..._eth_soc-add-hw-dump-for-forced-rese.patch | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 target/linux/generic/hack-6.6/730-net-ethernet-mtk_eth_soc-add-hw-dump-for-forced-rese.patch diff --git a/target/linux/generic/hack-6.6/730-net-ethernet-mtk_eth_soc-add-hw-dump-for-forced-rese.patch b/target/linux/generic/hack-6.6/730-net-ethernet-mtk_eth_soc-add-hw-dump-for-forced-rese.patch new file mode 100644 index 0000000000..8a8a5c061a --- /dev/null +++ b/target/linux/generic/hack-6.6/730-net-ethernet-mtk_eth_soc-add-hw-dump-for-forced-rese.patch @@ -0,0 +1,115 @@ +From bc51c337a3147c4a02c743489885a6657bc5371c Mon Sep 17 00:00:00 2001 +From: Bo-Cun Chen +Date: Wed, 27 Nov 2024 13:36:49 +0800 +Subject: [PATCH] net: ethernet: mtk_eth_soc: add hw dump for forced reset + +Without this patch, the ETH driver is unable to dump the registers +before triggering a forced reset. + +Signed-off-by: Bo-Cun Chen +--- + drivers/net/ethernet/mediatek/mtk_eth_soc.c | 55 +++++++++++++++++++++ + 1 files changed, 55 insertions(+) + +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c +@@ -66,6 +66,7 @@ static const struct mtk_reg_map mtk_reg_ + .rx_ptr = 0x1900, + .rx_cnt_cfg = 0x1904, + .qcrx_ptr = 0x1908, ++ .page = 0x19f0, + .glo_cfg = 0x1a04, + .rst_idx = 0x1a08, + .delay_irq = 0x1a0c, +@@ -132,6 +133,7 @@ static const struct mtk_reg_map mt7986_r + .rx_ptr = 0x4500, + .rx_cnt_cfg = 0x4504, + .qcrx_ptr = 0x4508, ++ .page = 0x45f0, + .glo_cfg = 0x4604, + .rst_idx = 0x4608, + .delay_irq = 0x460c, +@@ -183,6 +185,7 @@ static const struct mtk_reg_map mt7988_r + .rx_ptr = 0x4500, + .rx_cnt_cfg = 0x4504, + .qcrx_ptr = 0x4508, ++ .page = 0x45f0, + .glo_cfg = 0x4604, + .rst_idx = 0x4608, + .delay_irq = 0x460c, +@@ -3885,6 +3888,56 @@ static void mtk_set_mcr_max_rx(struct mt + mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id)); + } + ++static void mtk_hw_dump_reg(struct mtk_eth *eth, char *name, u32 offset, u32 range) ++{ ++ u32 cur = offset; ++ ++ pr_info("\n==================== %s ====================\n", name); ++ while (cur < offset + range) { ++ pr_info("0x%08x: %08x %08x %08x %08x\n", ++ cur, mtk_r32(eth, cur), mtk_r32(eth, cur + 0x4), ++ mtk_r32(eth, cur + 0x8), mtk_r32(eth, cur + 0xc)); ++ cur += 0x10; ++ } ++} ++ ++static void mtk_hw_dump(struct mtk_eth *eth) ++{ ++ const struct mtk_reg_map *reg_map = eth->soc->reg_map; ++ u32 id; ++ ++ mtk_hw_dump_reg(eth, "FE", 0x0, 0x600); ++ mtk_hw_dump_reg(eth, "FE", 0x1400, 0x300); ++ mtk_hw_dump_reg(eth, "ADMA", reg_map->pdma.rx_ptr, 0x300); ++ if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) { ++ for (id = 0; id < MTK_QDMA_NUM_QUEUES / 16; id++) { ++ mtk_w32(eth, id, reg_map->qdma.page); ++ pr_info("\nQDMA PAGE:%x ", mtk_r32(eth, reg_map->qdma.page)); ++ mtk_hw_dump_reg(eth, "QDMA", reg_map->qdma.qtx_cfg, 0x100); ++ mtk_w32(eth, 0, reg_map->qdma.page); ++ } ++ mtk_hw_dump_reg(eth, "QDMA", reg_map->qdma.rx_ptr, 0x300); ++ } ++ if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) { ++ mtk_hw_dump_reg(eth, "WDMA0", reg_map->wdma_base[0], 0x400); ++ mtk_hw_dump_reg(eth, "WDMA1", reg_map->wdma_base[1], 0x400); ++ if (mtk_is_netsys_v3_or_greater(eth)) ++ mtk_hw_dump_reg(eth, "WDMA2", reg_map->wdma_base[2], 0x400); ++ } ++ mtk_hw_dump_reg(eth, "PPE0", reg_map->ppe_base + 0x200, 0x200); ++ if (!mtk_is_netsys_v1(eth)) ++ mtk_hw_dump_reg(eth, "PPE1", reg_map->ppe_base + 0x600, 0x200); ++ if (mtk_is_netsys_v3_or_greater(eth)) ++ mtk_hw_dump_reg(eth, "PPE2", reg_map->ppe_base + 0xE00, 0x200); ++ mtk_hw_dump_reg(eth, "GMAC", 0x10000, 0x300); ++ if (mtk_is_netsys_v3_or_greater(eth)) ++ mtk_hw_dump_reg(eth, "GMAC", 0x10300, 0x100); ++ if (mtk_is_netsys_v3_or_greater(eth)) { ++ mtk_hw_dump_reg(eth, "XGMAC0", 0x12000, 0x300); ++ mtk_hw_dump_reg(eth, "XGMAC1", 0x13000, 0x300); ++ } ++} ++ + static void mtk_hw_reset(struct mtk_eth *eth) + { + u32 val; +@@ -4344,6 +4397,8 @@ static void mtk_pending_work(struct work + rtnl_lock(); + set_bit(MTK_RESETTING, ð->state); + ++ mtk_hw_dump(eth); ++ + mtk_prepare_for_reset(eth); + mtk_wed_fe_reset(); + /* Run again reset preliminary configuration in order to avoid any +--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h ++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h +@@ -1172,6 +1172,7 @@ struct mtk_reg_map { + u32 rx_ptr; /* rx base pointer */ + u32 rx_cnt_cfg; /* rx max count configuration */ + u32 qcrx_ptr; /* rx cpu pointer */ ++ u32 page; /* page configuration */ + u32 glo_cfg; /* global configuration */ + u32 rst_idx; /* reset index */ + u32 delay_irq; /* delay interrupt */ From fe379eb1c1b004f7eef12981f761f6fc1369d7aa Mon Sep 17 00:00:00 2001 From: George Moussalem Date: Wed, 8 Jan 2025 10:21:30 +0400 Subject: [PATCH 05/26] qualcommax: ipq50xx: add support for Linksys SPNMX56 The SPNMX56 is an ISP-branded and distributed device similar to the MX5500 with the same Wifi chips (IPQ5018 for 2.4G and QCN9074 for 5G) but has an additional QCA8081 PHY providing a 2.5gbps ethernet WAN port. Speficiations: * SoC: Qualcomm IPQ5018 (64-bit dual-core ARM Cortex-A53 @ 1.0Ghz) * Memory: Winbond W634GU6NB-11 (512 MiB DDR3-933) * Serial Port: 3v3 TTL 115200n8 * Wi-Fi: IPQ5018 (2x2 2.4 Ghz 802.11b/g/n/ax) QCN9024 (4x4:4 5 Ghz 802.11an/ac/ax) * Ethernet: IPQ5018 integrated virtual switch connected to an external QCA8337 switch (3 Ports 10/100/1000 GBASE-T) and a QCA8081 phy (up to 2.5 Gbps) * Flash: Gigadevice GD5F2GM7RExxG (256 MiB) * LEDs: 1x multi-color PWM LED * Buttons: 1x WPS (GPIO 27 Active Low) 1x Reset (GPIO 28 Acive Low) Flash instructions: 1. On OEM firmware, login to the device (typically at http://192.168.1.1) and click 'CA' in the bottom right corner -> Connectivity -> Manual Upgrade. Alternatively, browse to http:///fwupdate.html Upload openwrt-qualcommax-ipq50xx-linksys_spnmx56-squashfs-factory.bin Optionally flash 2nd partition, after first boot check actual partition: fw_printenv -n boot_part and install firmware on second partition using command in case of 2: mtd -r -e kernel -n write openwrt-qualcommax-ipq50xx-linksys_spnmx56-squashfs-factory.bin kernel and in case of 1: mtd -r -e alt_kernel -n write openwrt-qualcommax-ipq50xx-linksys_spnmx56-squashfs-factory.bin alt_kernel 2. Installation using serial connection from OEM firmware hit Enter once booted and enter credentials (login: root, password: admin) fw_printenv -n boot_part In case of 2: flash_erase /dev/mtd12 0 0 nandwrite -p /dev/mtd12 openwrt-qualcommax-ipq50xx-linksys_spnmx56-squashfs-factory.bin or in case of 1: flash_erase /dev/mtd14 0 0 nandwrite -p /dev/mtd14 openwrt-qualcommax-ipq50xx-linksys_spnmx56-squashfs-factory.bin After first boot install firmware on second partition: mtd -r -e kernel -n write openwrt-qualcommax-ipq50xx-linksys_spnmx56-squashfs-factory.bin kernel or: mtd -r -e alt_kernel -n write openwrt-qualcommax-ipq50xx-linksys_spnmx56-squashfs-factory.bin alt_kernel 3. Back to the OEM firmware. Download firmware from OEM website: Firmware for this device cannot be searched for on the Linksys website. Instead, we'd have to use serial to intercept the URL of the firmware while it's trying to update. Firmware is ISP specific: Toob (UK): http://download.linksys.com/updates/20241125t080737/FW_MX56TB_1.0.1.216218_prod.img The intention is to collect URLs for different ISPs on a wiki page. From serial or SSH: fw_printenv boot_part in case of 1: mtd -r -e alt_kernel -n write FW_MX56TB_1.0.1.216218_prod.img alt_kernel else in case of 2: mtd -r -e kernel -n write FW_MX56TB_1.0.1.216218_prod.img kernel Signed-off-by: George Moussalem Link: https://github.com/openwrt/openwrt/pull/17968 Signed-off-by: Robert Marko --- .../uboot-envtools/files/qualcommax_ipq50xx | 3 +- package/firmware/ipq-wifi/Makefile | 2 + .../arm64/boot/dts/qcom/ipq5018-spnmx56.dts | 240 ++++++++++++++++++ target/linux/qualcommax/image/ipq50xx.mk | 10 + .../ipq50xx/base-files/etc/board.d/02_network | 6 +- .../etc/hotplug.d/firmware/11-ath11k-caldata | 6 +- .../ipq50xx/base-files/etc/init.d/bootcount | 3 +- .../base-files/lib/upgrade/platform.sh | 3 +- 8 files changed, 266 insertions(+), 7 deletions(-) create mode 100644 target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-spnmx56.dts diff --git a/package/boot/uboot-envtools/files/qualcommax_ipq50xx b/package/boot/uboot-envtools/files/qualcommax_ipq50xx index 0e78bb8060..b63451d627 100644 --- a/package/boot/uboot-envtools/files/qualcommax_ipq50xx +++ b/package/boot/uboot-envtools/files/qualcommax_ipq50xx @@ -9,7 +9,8 @@ board=$(board_name) case "$board" in linksys,mx2000|\ -linksys,mx5500) +linksys,mx5500|\ +linksys,spnmx56) idx="$(find_mtd_index u_env)" [ -n "$idx" ] && \ ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000" diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index f784d9a2e4..deeda4955e 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -45,6 +45,7 @@ ALLWIFIBOARDS:= \ linksys_mx5300 \ linksys_mx5500 \ linksys_mx8500 \ + linksys_spnmx56 \ linksys_whw03 \ netgear_lbr20 \ netgear_rax120v2 \ @@ -184,6 +185,7 @@ $(eval $(call generate-ipq-wifi-package,linksys_mx4200,Linksys MX4200)) $(eval $(call generate-ipq-wifi-package,linksys_mx5300,Linksys MX5300)) $(eval $(call generate-ipq-wifi-package,linksys_mx5500,Linksys MX5500)) $(eval $(call generate-ipq-wifi-package,linksys_mx8500,Linksys MX8500)) +$(eval $(call generate-ipq-wifi-package,linksys_spnmx56,Linksys SPNMX56)) $(eval $(call generate-ipq-wifi-package,linksys_whw03,Linksys WHW03)) $(eval $(call generate-ipq-wifi-package,netgear_lbr20,Netgear LBR20)) $(eval $(call generate-ipq-wifi-package,netgear_rax120v2,Netgear RAX120v2)) diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-spnmx56.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-spnmx56.dts new file mode 100644 index 0000000000..75b9444514 --- /dev/null +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq5018-spnmx56.dts @@ -0,0 +1,240 @@ +/dts-v1/; + +#include "ipq5018.dtsi" +#include "ipq5018-mx-base.dtsi" + +/ { + model = "Linksys SPNMX56"; + compatible = "linksys,spnmx56", "qcom,ipq5018"; +}; + +/* +* ================================================================= +* _______________________ _______________________ +* | IPQ5018 | | QCA8337 | +* | +------+ +--------+ | | +--------+ +------+ | +* | | MAC0 |---| GE Phy |-+--- MDI ---+ | Phy4 |---| MAC5 | | +* | +------+ +--------+ | | +--------+ +------+ | +* | | |_______________________| +* | | _______________________ +* | | | QCA8081 | +* | +------+ +--------+ | | +--------+ +------+ | +* | | MAC1 |---| Uniphy |-+-- SGMII+--+ | Phy |---| MAC | | +* | +------+ +--------+ | | +--------+ +------+ | +* |_______________________| |_______________________| +* +* ================================================================= +*/ + +&switch { + status = "okay"; + + switch_mac_mode = ; + + qcom,port_phyinfo { + // MAC0 -> GE Phy --- MDI --- QCA8337 Switch + port@0 { + port_id = <1>; + mdiobus = <&mdio0>; + phy_address = <7>; + phy_dac = <0x10 0x10>; + }; + + // MAC1 -> Uniphy --- SGMII --- QCA8081 + port@1 { + port_id = <2>; + mdiobus = <&mdio1>; + phy_address = <28>; + port_mac_sel = "QGMAC_PORT"; + }; + }; +}; + +// MAC0 -> GE Phy +&dp1 { + status = "okay"; +}; + +// MAC1 ---SGMII---> QCA8081 +&dp2 { + status = "okay"; + + label = "wan"; + phy-handle = <&qca8081>; +}; + +&mdio0 { + status = "okay"; +}; + +// IPQ5018 GE Phy -> QCA8337 PHY4 +&ge_phy { + qcom,dac = <0x10 0x10>; +}; + +&mdio1 { + status = "okay"; + + pinctrl-0 = <&mdio1_pins>; + pinctrl-names = "default"; + reset-gpios = <&tlmm 39 GPIO_ACTIVE_LOW>; + + // Not connected + qca8337_0: ethernet-phy@0 { + reg = <0>; + }; + + // QCA8337 Phy1 -> LAN1 + qca8337_1: ethernet-phy@1 { + reg = <1>; + }; + + // QCA8337 Phy2 -> LAN2 + qca8337_2: ethernet-phy@2 { + reg = <2>; + }; + + // QCA8337 Phy3 -> LAN3 + qca8337_3: ethernet-phy@3 { + reg = <3>; + }; + + // QCA8337 Phy4 -> MDI -> IPQ5018 GE PHY + qca8337_4: ethernet-phy@4 { + reg = <4>; + }; + + // QCA8081 Phy -> WAN + qca8081: ethernet-phy@28 { + compatible = "ethernet-phy-id004d.d101"; + reg = <28>; + reset-deassert-us = <10000>; + reset-gpios = <&tlmm 24 GPIO_ACTIVE_LOW>; + }; + + // QCA8337 switch + switch1: ethernet-switch@17 { + compatible = "qca,qca8337"; + reg = <17>; + #address-cells = <1>; + #size-cells = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@2 { + reg = <2>; + label = "lan3"; + phy-handle = <&qca8337_1>; + }; + + port@3 { + reg = <3>; + label = "lan2"; + phy-handle = <&qca8337_2>; + }; + + port@4 { + reg = <4>; + label = "lan1"; + phy-handle = <&qca8337_3>; + }; + + port@5 { + reg = <5>; + phy-handle = <&qca8337_4>; + phy-mode = "gmii"; + ethernet = <&dp1>; + }; + }; + }; +}; + +&pcie0_phy { + status = "okay"; +}; + +&pcie0 { + status = "okay"; + + perst-gpios = <&tlmm 15 GPIO_ACTIVE_LOW>; + + bridge@0,0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + ranges; + + wifi@1,0 { + status = "okay"; + + /* QCN9074: ath11k lacks DT compatible for PCI cards */ + compatible = "pci17cb,1104"; + reg = <0x00010000 0 0 0 0>; + + qcom,ath11k-calibration-variant = "Linksys-SPNMX56"; + }; + }; +}; + +&q6v5_wcss { + status = "okay"; + + memory-region = <&q6_mem_regions>; + firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt", + "ath11k/IPQ5018/hw1.0/m3_fw.mdt"; + + // IPQ5018 + q6_wcss_pd1: pd-1 { + firmware-name = "ath11k/IPQ5018/hw1.0/q6_fw.mdt"; + + resets = + <&gcc GCC_WCSSAON_RESET>, + <&gcc GCC_WCSS_BCR>, + <&gcc GCC_CE_BCR>; + reset-names = + "wcss_aon_reset", + "wcss_reset", + "ce_reset"; + + clocks = + <&gcc GCC_WCSS_AHB_S_CLK>, + <&gcc GCC_WCSS_ACMT_CLK>, + <&gcc GCC_WCSS_AXI_M_CLK>; + clock-names = + "gcc_wcss_ahb_s_clk", + "gcc_wcss_acmt_clk", + "gcc_wcss_axi_m_clk"; + + interrupts-extended = + <&wcss_smp2p_in 8 0>, + <&wcss_smp2p_in 9 0>, + <&wcss_smp2p_in 12 0>, + <&wcss_smp2p_in 11 0>; + interrupt-names = + "fatal", + "ready", + "spawn-ack", + "stop-ack"; + + qcom,smem-states = + <&wcss_smp2p_out 8>, + <&wcss_smp2p_out 9>, + <&wcss_smp2p_out 10>; + qcom,smem-state-names = + "shutdown", + "stop", + "spawn"; + }; +}; + +&wifi0 { + // IPQ5018 + qcom,rproc = <&q6_wcss_pd1>; + qcom,ath11k-calibration-variant = "Linksys-SPNMX56"; + qcom,ath11k-fw-memory-mode = <2>; + qcom,bdf-addr = <0x4c400000>; + + status = "okay"; +}; diff --git a/target/linux/qualcommax/image/ipq50xx.mk b/target/linux/qualcommax/image/ipq50xx.mk index affd5e6345..cf404d49cd 100644 --- a/target/linux/qualcommax/image/ipq50xx.mk +++ b/target/linux/qualcommax/image/ipq50xx.mk @@ -29,3 +29,13 @@ define Device/linksys_mx5500 ipq-wifi-linksys_mx5500 endef TARGET_DEVICES += linksys_mx5500 + +define Device/linksys_spnmx56 + $(call Device/linksys_ipq50xx_mx_base) + DEVICE_MODEL := SPNMX56 + DEVICE_DTS_CONFIG := config@mp03.1 + DEVICE_PACKAGES := kmod-ath11k-pci \ + ath11k-firmware-qcn9074 \ + ipq-wifi-linksys_spnmx56 +endef +TARGET_DEVICES += linksys_spnmx56 diff --git a/target/linux/qualcommax/ipq50xx/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq50xx/base-files/etc/board.d/02_network index 35bff6df80..c80b259d27 100644 --- a/target/linux/qualcommax/ipq50xx/base-files/etc/board.d/02_network +++ b/target/linux/qualcommax/ipq50xx/base-files/etc/board.d/02_network @@ -8,7 +8,8 @@ ipq50xx_setup_interfaces() local board="$1" case $board in linksys,mx2000|\ - linksys,mx5500) + linksys,mx5500|\ + linksys,spnmx56) ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan" ;; esac @@ -23,7 +24,8 @@ ipq50xx_setup_macs() case "$board" in linksys,mx2000|\ - linksys,mx5500) + linksys,mx5500|\ + linksys,spnmx56) label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr) lan_mac=$label_mac wan_mac=$label_mac diff --git a/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata index 7c8cc99ee3..4da2f2809e 100644 --- a/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata +++ b/target/linux/qualcommax/ipq50xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata @@ -10,7 +10,8 @@ case "$FIRMWARE" in "ath11k/IPQ5018/hw1.0/cal-ahb-c000000.wifi.bin") case "$board" in linksys,mx2000|\ - linksys,mx5500) + linksys,mx5500|\ + linksys,spnmx56) caldata_extract "0:ART" 0x1000 0x20000 label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr) ath11k_patch_mac $(macaddr_add $label_mac 1) 0 @@ -32,7 +33,8 @@ case "$FIRMWARE" in ;; "ath11k/QCN9074/hw1.0/cal-pci-0001:01:00.0.bin") case "$board" in - linksys,mx5500) + linksys,mx5500|\ + linksys,spnmx56) caldata_extract "0:ART" 0x26800 0x20000 label_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr) ath11k_patch_mac $(macaddr_add $label_mac 2) 0 diff --git a/target/linux/qualcommax/ipq50xx/base-files/etc/init.d/bootcount b/target/linux/qualcommax/ipq50xx/base-files/etc/init.d/bootcount index b570428aef..c49ad8472d 100755 --- a/target/linux/qualcommax/ipq50xx/base-files/etc/init.d/bootcount +++ b/target/linux/qualcommax/ipq50xx/base-files/etc/init.d/bootcount @@ -5,7 +5,8 @@ START=99 boot() { case $(board_name) in linksys,mx2000|\ - linksys,mx5500) + linksys,mx5500|\ + linksys,spnmx56) mtd resetbc s_env || true ;; esac diff --git a/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh index a75b6798d2..5144617f8b 100644 --- a/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh @@ -73,7 +73,8 @@ platform_check_image() { platform_do_upgrade() { case "$(board_name)" in linksys,mx2000|\ - linksys,mx5500) + linksys,mx5500|\ + linksys,spnmx56) remove_oem_ubi_volume rootfs linksys_mx_do_upgrade "$1" ;; From 92132bb9cc59a0673250036c685f906936f303f8 Mon Sep 17 00:00:00 2001 From: George Moussalem Date: Fri, 14 Feb 2025 18:58:16 +0400 Subject: [PATCH 06/26] qualcommax: ipq50xx: sysupgrade: fix OEM UBI volume name for Linksys MX devices The UBI volume name in OEM firmware for Linksys MX2000, MX5500, and SPNMX56 is 'squashfs' instead of 'rootfs'. So let's update the volume accordingly. Signed-off-by: George Moussalem Link: https://github.com/openwrt/openwrt/pull/17968 Signed-off-by: Robert Marko --- .../linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh index 5144617f8b..bafbc7bbdb 100644 --- a/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/qualcommax/ipq50xx/base-files/lib/upgrade/platform.sh @@ -75,7 +75,7 @@ platform_do_upgrade() { linksys,mx2000|\ linksys,mx5500|\ linksys,spnmx56) - remove_oem_ubi_volume rootfs + remove_oem_ubi_volume squashfs linksys_mx_do_upgrade "$1" ;; *) From 83d2d21904e06b41cf882e24339b10d6bdf62777 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 9 Feb 2025 16:04:56 +0100 Subject: [PATCH 07/26] apk: update to Git HEAD (2025-02-08) 5f127fcc415c convdb: preserve newlines at the end of scripts e94a2212a0d2 convdb: import package names starting with leading dot 9c0d353c7905 adbdump: use literal block if yaml quoting is needed 93c6a09a8ea8 improve compatibility of shellscripts 6c454d13de9b doc: fix pre/post commit hook documentation 3eb0b70b6d0f solver: rework solver name ordering to fix install_if handling 78c3bdc03cbd solver: make dependencies only packages selectable 373b364ef2a8 build: use the VERSION directly as the soname 6f627d93f5a0 update .gitignore 908f1ee7e87b index, add, pkg: check arch in 'add' only to allow 'index' to work 7c164c471251 index: Fix total always 0 0042b035df53 pkg, db: check arch on apk_db_pkg_add ffc706689603 applet: always show help for global options f6a66ebc5876 help: use uppercase usage prefix 7ebb23720483 doc: fix manpage sections 5e5e1f088986 genhelp: reorganize and add --debug output mode 9b371e452fb2 genhelp: do man page link wrangling for COMMANDS text only 2a87e46a354b context: introduce and use apknew_suffix a6180e4cfa1a meson: add tests option eb100676c5f0 test: move subdir unit to be the first a12eae1780e8 test/user/hardlink: be portable to bsd-style stat(1) f0c096bc034b db: attempt new mount user namespace for chroot in usermode 994e5e4e0006 db: fix "fetch --recurisve" to work 24d8f9677d77 Revert "database: move lock file from /lib/apk to /run/apk" 470432aafe77 applets: simplify option group handling e1275e2f5010 apk: load global options from /etc/apk/config 8c39b525cd0c add support for repository package name specification 5856cf100241 doc, db: fix repository url_base to be allocated and fetch man page a0411e87187e cache: fix not to remove indexes cddca5769e98 apk, commit: support --cache-predownload to first download packages 915e9841ed1c ci: always test all features available 4f94807104e3 commit: print version numbers with --verbose --interactive summary 5bd6d49ac447 fetch: call progress early to avoid flicker fc66fdfc49cd test: portability fixes 3f73ba343cbd test: shellcheck test suite for bash, dash and busybox d94671bb1235 test: fixup sourcing testlib.sh to work better with shellcheck 6007db9cdde6 print: refactor progress printing API a1d7042a2d3b print: further refactor progress API bed4628c9317 print: reorganize progress to be renderred after apk_out 8cd7362a986c add process main loop to pipe stdout/stderr and logs it ccfd7ac5e518 db: log script output using apk_process api 3c4594962fb4 db: log uvol output using apk_process api and add tests fc7768c09497 io_url_wget: log wget output using apk_process api 90a62541751f build: only use VERSION up until first space for soname 378d6360ab17 db: rename apk_db_add_repository to add_repository 5d978c2a5924 db: split open_repository out of add_repository af812cd28c6d print: simplify code a little bit 4c776eb74997 db: make index refresh notices a progress note 64e053071a89 db: fix non-repository reverese dependency indexing 3cf039322ce1 apk-tools-3.0.0_rc1 90220e710c61 commit: fixup progress during package removal d11521ec6309 apk-tools-3.0.0_rc2 dc191820b1c4 solver: fix name resolving order of pure virtual names 7da628bc455f libfetch: remove remaining ftp references 10b467c0992a libfetch: remove error generation script b5b130e1d628 print: flush after progress notice if needed d71722b9a637 libfetch: rework error codes API 7b0b69a3023f commit: advise on using upgrade --prune and/or --available 1fd82ea2d7dc test: fix spelling s/shuld/should 8eb22149138f process: move apk_exit_status_str as static function 752ee96a25b1 db: refactor repository parsing and url printing bfa763904fe4 doc: update apk-keys(5) and apk-repositories(5) 165333af1a35 db: introduce and use apk_db_foreach_repository 8e98d6889c92 libfetch: remove unused file scheme and manual pages 30b1c0348d6b remove usage of TRUE/FALSE fa19887d741c crypto: use explicit algorithm fetching for openssl >=3.0 a706cbdfd5b1 crypto: remove support for obsolete md5 35a57547a7d7 db: remove APK_REPOSITORY_CACHED and use cache_repository 7f616711636c db: const correctness for apk_db_pkg_available 2cda62cd3a4c io: adjust scheme detection in apk_url_local_file() 50a2c12a32b8 db: make repo.url_index a pure blob a186267a8822 db: make repo.url_base_printable prefix of url_index_printable 9fb473c6a269 add .editorconfig 088c584bf515 mkndx: introduce --filter-spec to filter existing index 0c3188793243 atom: remove apk_atomize_dup0 866374c7cda0 python: add initial python binding bdf492471328 python: add unittests 9afe8dae79a0 ci: install python3-dev df3424e5c8cd python: move version to a submodule 3e65a63aa4f1 apk-tools-3.0.0_rc3 946027f6abde test: extend blob_split tests e73b5e313998 db: do not add empty arch a6c84f8f62f7 atom: use null atom also for zero length blobs fb8eef15dc52 db: handle not found names in __apk_db_foreach_sorted_package 0ef8a2223cca commit: don't trigger question with --prune/--available warning fe484a5c06b9 atom: remove apk_atomize 70fc828cf06b update: make --update-cache and and 'update' behave the same 04e83acfb9b9 upgrade: fix previous commit cdeebc01283d test: add mkpkg/add symlink test c2f21ce06a67 mkpkg: do not include filename on error message de0a4886a91c fs_fsys: do not leave temporary files after failed commit e5e362c1a65c doc: update --cache-max-age documentation 8d41ff40b59a fetch: fix fetch_err_make() for 32-bit arches 2526fd73bc66 walk_gentext: make state per-module, use apk_ostream for output bb65553e6423 walk_genadb: make state per-module a920e5976127 adb_walk: rename scheme to start_scheme and always call end for it 92c573fac280 adb_walk: separate string and numeric values fe4876bd3a4e adbdump: add support for json output 66cc8da577f0 walk_adb: always call the string scalar function 40bfa97ce3e3 adb: reset dynamic on freeing adb_obj 7519b70d42d1 convert adb_walk_gen* to apk_serializer_* 64c484730c9f add missing serialize.c 83e85aaee220 add missing apk_serialize.h f70638e12ccc serializer: simplify schema and array handling 9bfc259d9fdb serializer: merge start_schema and start_object to one op a23368b38ff6 serialize_yaml: improve quoting detection 3a33e75b92aa serialize_adb: move from libapk to apk executable f5c3fd843824 info: fix -W with symlinks d54fdb753135 update, version: do not print unavailable repositories 8223c10d4c33 doc: extract arguments are files a3b4ebcefa3b serialize_yaml/adb: support single quoting, and fixes 77aff1daa967 db: fix --no-cache f0e3aa4c139d mkpkg: do not call openat() with null pathname 28770f552f4e adb: fix adb_block_init check when extended block is needed 1ca73b6ae892 blob: apk_blob_push_int use uint64_t as value 0b159e23432e print: use uint64_t for progress api progress type 5da830ba51d0 db, commit, print: use uint64_t for file size types a7b5d8d8eeb9 mkndx, extract: use uint64_t for file size types 639f8ab8d9cd io: use uint64_t for file size as needed 49905d47ee90 io: introduce and use apk_istream_skip 8d83f18647d4 defines: drop muldiv and mulmod helpers d373a9a6971e db: drop now unused apk_repo_format_cache_index 5700b195d67d pkg: update script execution logging style 00c51e267162 pkg: cap sizes that are allowed for scripts and some v2 fields 5157c540d732 io: fix segment_close to read the inner stream ad741fe98b72 db: implement system repository list configuration path 6ca1831ed563 use #pragma once instead of ifdef guards 64254d190b32 db, ctx: add and use allocator in apk_ctx 581825bb0811 fix handling of etc/apk/config options with an argument 508b312df637 apk: add APK_CONFIG to overwite path to config file 0e8e7e5a8264 test: fix busybox realpath compat 0186a6aa9d5c apk: support loading configuration options from /lib/apk/config 0c52242990f4 db: fix package name orphan check a7766c933853 add: don't print misleading error after failed non-repository check 4254863de6ac introduce and use apk_array_foreach and apk_array_foreach_item b276b3c50618 serialize: separate apk_ser_string and its multiline variant 91dc10b1cddf blob: introduce and use apk_blob_foreach_token d345a9aa6d25 adbgen: split adbgen specific code to separate file 00522cd60e18 apk: introduce and use APK_OPTVAL_* macros 7f8a1ca12465 list, search: fix origin existence checks b0bb4a99378b adb: allow copying larger arrays 3fe4258d4c1b mkndx: fix matching packages from old index b263d961ba12 libfetch/http: reuse fetch_netrc_auth for http(s) 1d4ed5525f54 ctype: fix apk_blob_{spn,cspn} for non-ascii characters 1fa9f3c221c7 genhelp.lua: don't match underscores in the middle of words 48980518436f ctx, trust: load public keys also from lib/apk/keys ba38d6584599 mkndx: remove --rewrite-arch a9ea20e37029 context: fix --keys-dir 8abae4785c78 various: fix compilation error for missing inttypes.h fdb10df21486 various: fix compilation error for missing limits.h 89ef2b546087 database: fix compilation error for missing sched.h 8afd4ab47200 process: correctly handle error from pipe2 and open 1cbbf7457721 crypto_openssl: make sha global variables constant for OpenSSL < 3 025710552ac8 io: fix compilation error for missing stdarg.h 908efa92701c libfetch: allow obsolete date format in http timestamps 70494b5bcdf9 apk: add support for boolean flag arguments 16ab8c549a06 apk: add --cache-packages to enable package caching always 460d62ee743c db: extend repositories file format with commands 34771ccb7964 apk-tools-3.0.0_rc4 Link: https://github.com/openwrt/openwrt/pull/17925 Signed-off-by: Christian Marangi --- package/system/apk/Makefile | 8 +-- ...openwrt-move-layer-db-to-temp-folder.patch | 2 +- .../patches/0002-meson-add-tests-option.patch | 52 ------------------- .../0010-app_list-add-full-print.patch | 15 +++--- 4 files changed, 13 insertions(+), 64 deletions(-) delete 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 6ed07384c2..c57edb9a87 100644 --- a/package/system/apk/Makefile +++ b/package/system/apk/Makefile @@ -1,13 +1,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=apk -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE_URL=https://gitlab.alpinelinux.org/alpine/apk-tools.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2024-11-30 -PKG_SOURCE_VERSION:=8d93a79fb8958607f097be2c4ac97f4596faf91d -PKG_MIRROR_HASH:=565c87fac26e696c362c2fe85159cc3ed2fd27153f244c2e9dc0fd7fa67a4173 +PKG_SOURCE_DATE:=2025-02-08 +PKG_SOURCE_VERSION:=34771ccb7964b0e7cb5d1fc64bd1b83fe73296ba +PKG_MIRROR_HASH:=fddd0334fa2ce7cc7fedb2cc95ee800caf9cbe43d617c2e612e2f58fc30b14c2 PKG_VERSION=3.0.0_pre$(subst -,,$(PKG_SOURCE_DATE)) 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 aaf36310a0..eaeb36d10a 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 -@@ -1624,7 +1624,7 @@ const char *apk_db_layer_name(int layer) +@@ -1832,7 +1832,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 deleted file mode 100644 index 075d3a9897..0000000000 --- a/package/system/apk/patches/0002-meson-add-tests-option.patch +++ /dev/null @@ -1,52 +0,0 @@ -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() - diff --git a/package/system/apk/patches/0010-app_list-add-full-print.patch b/package/system/apk/patches/0010-app_list-add-full-print.patch index d0b2b7243d..dd33430310 100644 --- a/package/system/apk/patches/0010-app_list-add-full-print.patch +++ b/package/system/apk/patches/0010-app_list-add-full-print.patch @@ -20,7 +20,7 @@ Signed-off-by: Christian Marangi struct apk_string_array *filters; }; -@@ -118,6 +119,40 @@ static void print_manifest(const struct +@@ -105,6 +106,40 @@ static void print_manifest(const struct printf("%s " BLOB_FMT "\n", pkg->name->name, BLOB_PRINTF(*pkg->version)); } @@ -60,11 +60,11 @@ Signed-off-by: Christian Marangi + static void filter_package(const struct apk_database *db, const struct apk_package *pkg, const struct list_ctx *ctx, const struct apk_name *name) { - if (ctx->match_origin && !origin_matches(ctx, pkg)) -@@ -138,7 +173,9 @@ static void filter_package(const struct - if (ctx->match_providers) - printf("<%s> ", name->name); + if (ctx->match_origin && !origin_matches(ctx, pkg)) return; +@@ -114,7 +149,9 @@ static void filter_package(const struct + if (ctx->upgradable && !is_upgradable(db, pkg)) return; + if (ctx->match_providers) printf("<%s> ", name->name); - if (ctx->manifest) + if (ctx->full) + print_full(pkg, ctx); @@ -72,7 +72,7 @@ Signed-off-by: Christian Marangi print_manifest(pkg, ctx); else print_package(db, pkg, ctx); -@@ -178,6 +215,7 @@ static int print_result(struct apk_datab +@@ -154,6 +191,7 @@ static int print_result(struct apk_datab OPT(OPT_LIST_depends, APK_OPT_SH("d") "depends") \ OPT(OPT_LIST_installed, APK_OPT_SH("I") "installed") \ OPT(OPT_LIST_manifest, "manifest") \ @@ -80,12 +80,13 @@ Signed-off-by: Christian Marangi OPT(OPT_LIST_origin, APK_OPT_SH("o") "origin") \ OPT(OPT_LIST_orphaned, APK_OPT_SH("O") "orphaned") \ OPT(OPT_LIST_providers, APK_OPT_SH("P") "providers") \ -@@ -191,6 +229,8 @@ static int option_parse_applet(void *pct +@@ -167,6 +205,9 @@ static int list_parse_option(void *pctx, struct list_ctx *ctx = pctx; switch (opt) { + case OPT_LIST_full: + ctx->full = 1; ++ break; case OPT_LIST_available: ctx->available = 1; ctx->orphaned = 0; From 3a1c19fd6b20e8ddc589519b192a65cc4270e22c Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 9 Feb 2025 18:40:56 +0100 Subject: [PATCH 08/26] apk: disable python module APK recently introduced python binding support. Disable this sub module as we don't ship python in normal build to reduce space. Link: https://github.com/openwrt/openwrt/pull/17925 Signed-off-by: Christian Marangi --- package/system/apk/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/package/system/apk/Makefile b/package/system/apk/Makefile index c57edb9a87..b1b1fd3a40 100644 --- a/package/system/apk/Makefile +++ b/package/system/apk/Makefile @@ -61,6 +61,7 @@ MESON_COMMON_ARGS = \ -Ddefault_library=static \ -Durl_backend=wget \ -Dzstd=false \ + -Dpython=disabled \ -Dtests=disabled MESON_HOST_ARGS += \ From 2aba2b32ce69556be76e428499abb39293f0a94b Mon Sep 17 00:00:00 2001 From: Zoltan HERPAI Date: Sun, 16 Feb 2025 21:18:13 +0000 Subject: [PATCH 09/26] uboot-sunxi: bump to 2025.01 Runtime-tested on: - Linksprite pcDuino v2 (A10) - Olimex Olinuxino Micro (A20) - Bananapi M2 Berry (V40) - Bananapi P2 Zero (H2+) - OrangePi Zero2 (H616) Patches refreshed where required. Signed-off-by: Zoltan HERPAI --- package/boot/uboot-sunxi/Makefile | 10 +++++++--- .../091-sun6i-sync-PLL1-multdiv-with-Boot1.patch | 2 +- .../patches/093-sun6i-fix-PLL-LDO-voltselect.patch | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile index c6f98a0db4..e32718a5d3 100644 --- a/package/boot/uboot-sunxi/Makefile +++ b/package/boot/uboot-sunxi/Makefile @@ -9,9 +9,8 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk -PKG_VERSION:=2024.01 - -PKG_HASH:=b99611f1ed237bf3541bdc8434b68c96a6e05967061f992443cb30aabebef5b3 +PKG_VERSION:=2025.01 +PKG_HASH:=cdef7d507c93f1bbd9f015ea9bc21fa074268481405501945abc6f854d5b686f PKG_MAINTAINER:=Zoltan HERPAI @@ -428,6 +427,11 @@ UBOOT_TARGETS := \ UBOOT_CONFIGURE_VARS += USE_PRIVATE_LIBGCC=yes +UBOOT_CUSTOMIZE_CONFIG := \ + --disable TOOLS_KWBIMAGE \ + --disable TOOLS_LIBCRYPTO \ + --disable TOOLS_MKEFICAPSULE + UBOOT_MAKE_FLAGS += \ BL31=$(STAGING_DIR_IMAGE)/bl31_sunxi-$(ATF).bin SCP=/dev/null diff --git a/package/boot/uboot-sunxi/patches/091-sun6i-sync-PLL1-multdiv-with-Boot1.patch b/package/boot/uboot-sunxi/patches/091-sun6i-sync-PLL1-multdiv-with-Boot1.patch index 8605436b1a..cef2835e45 100644 --- a/package/boot/uboot-sunxi/patches/091-sun6i-sync-PLL1-multdiv-with-Boot1.patch +++ b/package/boot/uboot-sunxi/patches/091-sun6i-sync-PLL1-multdiv-with-Boot1.patch @@ -14,7 +14,7 @@ More specifically, the following settings are now used: --- a/arch/arm/mach-sunxi/clock_sun6i.c +++ b/arch/arm/mach-sunxi/clock_sun6i.c -@@ -131,11 +131,12 @@ void clock_set_pll1(unsigned int clk) +@@ -128,11 +128,12 @@ void clock_set_pll1(unsigned int clk) struct sunxi_ccm_reg * const ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; const int p = 0; diff --git a/package/boot/uboot-sunxi/patches/093-sun6i-fix-PLL-LDO-voltselect.patch b/package/boot/uboot-sunxi/patches/093-sun6i-fix-PLL-LDO-voltselect.patch index b5fa2a1415..64a3f25798 100644 --- a/package/boot/uboot-sunxi/patches/093-sun6i-fix-PLL-LDO-voltselect.patch +++ b/package/boot/uboot-sunxi/patches/093-sun6i-fix-PLL-LDO-voltselect.patch @@ -18,7 +18,7 @@ required setting for the PLL LDO is 1.37v as per the A31 manual. --- a/arch/arm/mach-sunxi/clock_sun6i.c +++ b/arch/arm/mach-sunxi/clock_sun6i.c -@@ -28,13 +28,26 @@ void clock_init_safe(void) +@@ -27,13 +27,26 @@ void clock_init_safe(void) struct sunxi_prcm_reg * const prcm = (struct sunxi_prcm_reg *)SUNXI_PRCM_BASE; From ef22d4af1f21a83e5981ee410b29c6e8bb55ec86 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Tue, 18 Feb 2025 19:31:48 +0000 Subject: [PATCH 10/26] kernel: add missing patch description Add missing patch description, so all generic patches can be applied to a kernel tree using 'git am'. Fixes: d23e0a0086 ("kernel: backport MHI patch required by an upcoming mac80211 update") Signed-off-by: Daniel Golle --- ...-mhi_power_down_keep_dev-API-to-supp.patch | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/target/linux/generic/backport-6.6/853-v6.10-bus-mhi-host-Add-mhi_power_down_keep_dev-API-to-supp.patch b/target/linux/generic/backport-6.6/853-v6.10-bus-mhi-host-Add-mhi_power_down_keep_dev-API-to-supp.patch index 826b39b518..75c87e378b 100644 --- a/target/linux/generic/backport-6.6/853-v6.10-bus-mhi-host-Add-mhi_power_down_keep_dev-API-to-supp.patch +++ b/target/linux/generic/backport-6.6/853-v6.10-bus-mhi-host-Add-mhi_power_down_keep_dev-API-to-supp.patch @@ -1,3 +1,69 @@ +From 3471bba1b33a8b54cb0be9d30b7aac4fb2766365 Mon Sep 17 00:00:00 2001 +From: Baochen Qiang +Date: Tue, 5 Mar 2024 10:13:18 +0800 +Subject: [PATCH] bus: mhi: host: Add mhi_power_down_keep_dev() API to support + system suspend/hibernation + +Currently, ath11k fails to resume from system suspend/hibernation on some +the x86 host machines with below error message: + +``` +ath11k_pci 0000:06:00.0: timeout while waiting for restart complete +``` + +This happens because, ath11k powers down the MHI stack during suspend and +that leads to destruction of the struct device associated with the MHI +channels. And during resume, ath11k calls calling mhi_sync_power_up() to +power up the MHI subsystem and that eventually calls the driver framework's +device_add() API from mhi_create_devices(). But the PM framework blocks the +struct device creation during device_add() and this leads to probe deferral +as below: + +``` +mhi mhi0_IPCR: Driver qcom_mhi_qrtr force probe deferral +``` + +The reason for deferring device creation during resume is explained in +dpm_prepare(): + + /* + * It is unsafe if probing of devices will happen during suspend or + * hibernation and system behavior will be unpredictable in this + * case. So, let's prohibit device's probing here and defer their + * probes instead. The normal behavior will be restored in + * dpm_complete(). + */ + +Due to the device probe deferral, qcom_mhi_qrtr_probe() API is not getting +called during resume and thus MHI channels are not prepared. So this blocks +the QMI messages from being transferred between ath11k and firmware, +resulting in a firmware initialization failure. + +After consulting with Rafael, it was decided to not destroy the struct +device for the MHI channels during system suspend/hibernation because the +device is bound to appear again during resume. + +So to achieve this, a new API called mhi_power_down_keep_dev() is +introduced for MHI controllers to keep the struct device when required. +This API is similar to the existing mhi_power_down() API, except that it +keeps the struct device associated with MHI channels instead of destroying +them. + +Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.30 + +Signed-off-by: Baochen Qiang +Reviewed-by: Manivannan Sadhasivam +Reviewed-by: Jeff Johnson +Link: https://lore.kernel.org/r/20240305021320.3367-2-quic_bqiang@quicinc.com +[mani: reworded the commit message and subject] +Signed-off-by: Manivannan Sadhasivam +--- + drivers/bus/mhi/host/init.c | 1 + + drivers/bus/mhi/host/internal.h | 1 + + drivers/bus/mhi/host/pm.c | 42 ++++++++++++++++++++++++++++----- + include/linux/mhi.h | 18 +++++++++++++- + 4 files changed, 55 insertions(+), 7 deletions(-) + --- a/drivers/bus/mhi/host/init.c +++ b/drivers/bus/mhi/host/init.c @@ -43,6 +43,7 @@ const char * const dev_state_tran_str[DE From e60729c7205d27ef081062159caa234dbde2a1cf Mon Sep 17 00:00:00 2001 From: Zoltan HERPAI Date: Sat, 15 Feb 2025 16:48:20 +0100 Subject: [PATCH 11/26] uboot-sifiveu: bump to 2023.10 Upgrade the u-boot to a more recent version, and drop and refresh patches while at it. Additionally, use the correct architecture when running mkimage. Runtime-tested: - SiFive Unleashed - SiFive Unmatched Dropped: 0009-riscv-Fix-build-against-binutils.patch Added: 0006-riscv-sifive-fu740-reduce-DDR-speed-from-1866MT-s-to.patch Signed-off-by: Zoltan HERPAI --- package/boot/uboot-sifiveu/Makefile | 6 +- ...Initialized-the-PWM-setting-in-the-.patch} | 35 +++++- ...LED-s-color-to-purple-in-the-U-boot.patch} | 9 +- ...LED-s-color-to-blue-before-jumping-.patch} | 12 +- ...-Set-remote-thermal-of-TMP451-to-85-.patch | 67 +++++++++++ ...-Set-remote-thermal-of-TMP451-to-85-.patch | 111 ------------------ ...> 0005-riscv-dts-Add-few-PMU-events.patch} | 5 +- ...40-reduce-DDR-speed-from-1866MT-s-to.patch | 22 ++++ ...009-riscv-Fix-build-against-binutils.patch | 48 -------- ...-environment-for-dtc-binary-location.patch | 2 +- .../patches/110-no-kwbimage.patch | 4 +- .../patches/130-fix-mkimage-host-build.patch | 4 +- 12 files changed, 142 insertions(+), 183 deletions(-) rename package/boot/uboot-sifiveu/patches/{0002-board-sifive-spl-Initialized-the-PWM-setting-in-the-.patch => 0001-board-sifive-spl-Initialized-the-PWM-setting-in-the-.patch} (76%) rename package/boot/uboot-sifiveu/patches/{0003-board-sifive-Set-LED-s-color-to-purple-in-the-U-boot.patch => 0002-board-sifive-Set-LED-s-color-to-purple-in-the-U-boot.patch} (88%) rename package/boot/uboot-sifiveu/patches/{0004-board-sifive-Set-LED-s-color-to-blue-before-jumping-.patch => 0003-board-sifive-Set-LED-s-color-to-blue-before-jumping-.patch} (78%) create mode 100644 package/boot/uboot-sifiveu/patches/0004-board-sifive-spl-Set-remote-thermal-of-TMP451-to-85-.patch delete mode 100644 package/boot/uboot-sifiveu/patches/0005-board-sifive-spl-Set-remote-thermal-of-TMP451-to-85-.patch rename package/boot/uboot-sifiveu/patches/{0008-riscv-dts-Add-few-PMU-events.patch => 0005-riscv-dts-Add-few-PMU-events.patch} (88%) create mode 100644 package/boot/uboot-sifiveu/patches/0006-riscv-sifive-fu740-reduce-DDR-speed-from-1866MT-s-to.patch delete mode 100644 package/boot/uboot-sifiveu/patches/0009-riscv-Fix-build-against-binutils.patch diff --git a/package/boot/uboot-sifiveu/Makefile b/package/boot/uboot-sifiveu/Makefile index 4cbfe344af..9c91fc726d 100644 --- a/package/boot/uboot-sifiveu/Makefile +++ b/package/boot/uboot-sifiveu/Makefile @@ -7,8 +7,8 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/kernel.mk PKG_RELEASE:=1 -PKG_VERSION:=2022.10 -PKG_HASH:=50b4482a505bc281ba8470c399a3c26e145e29b23500bc35c50debd7fa46bdf8 +PKG_VERSION:=2023.10 +PKG_HASH:=e00e6c6f014e046101739d08d06f328811cebcf5ae101348f409cbbd55ce6900 UBOOT_USE_INTREE_DTC:=1 @@ -58,7 +58,7 @@ define Build/InstallDev $(INSTALL_BIN) $(PKG_BUILD_DIR)/spl/u-boot-spl.bin $(STAGING_DIR_IMAGE)/$(BUILD_VARIANT)-$(UBOOT_IMAGE)-spl $(INSTALL_BIN) $(PKG_BUILD_DIR)/$(DTS_DIR)/$(UBOOT_DTS) $(STAGING_DIR_IMAGE)/$(UBOOT_DTS) - mkimage -C none -A arm -T script -d uEnv-$(UENV).txt \ + mkimage -C none -A riscv -T script -d uEnv-$(UENV).txt \ $(STAGING_DIR_IMAGE)/$(BUILD_DEVICES)-boot.scr endef diff --git a/package/boot/uboot-sifiveu/patches/0002-board-sifive-spl-Initialized-the-PWM-setting-in-the-.patch b/package/boot/uboot-sifiveu/patches/0001-board-sifive-spl-Initialized-the-PWM-setting-in-the-.patch similarity index 76% rename from package/boot/uboot-sifiveu/patches/0002-board-sifive-spl-Initialized-the-PWM-setting-in-the-.patch rename to package/boot/uboot-sifiveu/patches/0001-board-sifive-spl-Initialized-the-PWM-setting-in-the-.patch index 7e11d4c18b..233df7acb6 100644 --- a/package/boot/uboot-sifiveu/patches/0002-board-sifive-spl-Initialized-the-PWM-setting-in-the-.patch +++ b/package/boot/uboot-sifiveu/patches/0001-board-sifive-spl-Initialized-the-PWM-setting-in-the-.patch @@ -1,19 +1,42 @@ -From 725595e667cc4423347c255da8ca4c5b3aa0980a Mon Sep 17 00:00:00 2001 +From 2ba4e6d78e0a63e5d491f9b01b498899e58cb58d Mon Sep 17 00:00:00 2001 From: Vincent Chen Date: Mon, 15 Nov 2021 03:31:04 -0800 -Subject: [PATCH 2/8] board: sifive: spl: Initialized the PWM setting in the +Subject: [PATCH 1/5] board: sifive: spl: Initialized the PWM setting in the SPL stage LEDs and multiple fans can be controlled by SPL. This patch ensures that all fans have been enabled in the SPL stage. In addition, the LED's color will be set to yellow. + +Upstream-Status: Pending +Signed-off-by: Vincent Chen --- - board/sifive/unmatched/Makefile | 1 + - board/sifive/unmatched/pwm.c | 57 +++++++++++++++++++++++++++++++++ - board/sifive/unmatched/spl.c | 2 ++ - 3 files changed, 60 insertions(+) + arch/riscv/include/asm/arch-fu740/eeprom.h | 15 ++++++ + board/sifive/unmatched/Makefile | 1 + + board/sifive/unmatched/pwm.c | 57 ++++++++++++++++++++++ + board/sifive/unmatched/spl.c | 2 + + 4 files changed, 75 insertions(+) + create mode 100644 arch/riscv/include/asm/arch-fu740/eeprom.h create mode 100644 board/sifive/unmatched/pwm.c +--- /dev/null ++++ b/arch/riscv/include/asm/arch-fu740/eeprom.h +@@ -0,0 +1,15 @@ ++/* SPDX-License-Identifier: GPL-2.0 */ ++/* ++ * Copyright (C) 2021 SiFive, Inc. ++ * ++ * Zong Li ++ */ ++ ++#ifndef _ASM_RISCV_EEPROM_H ++#define _ASM_RISCV_EEPROM_H ++ ++#define PCB_REVISION_REV3 0x3 ++ ++u8 get_pcb_revision_from_eeprom(void); ++ ++#endif /* _ASM_RISCV_EEPROM_H */ --- a/board/sifive/unmatched/Makefile +++ b/board/sifive/unmatched/Makefile @@ -9,3 +9,4 @@ obj-y += spl.o diff --git a/package/boot/uboot-sifiveu/patches/0003-board-sifive-Set-LED-s-color-to-purple-in-the-U-boot.patch b/package/boot/uboot-sifiveu/patches/0002-board-sifive-Set-LED-s-color-to-purple-in-the-U-boot.patch similarity index 88% rename from package/boot/uboot-sifiveu/patches/0003-board-sifive-Set-LED-s-color-to-purple-in-the-U-boot.patch rename to package/boot/uboot-sifiveu/patches/0002-board-sifive-Set-LED-s-color-to-purple-in-the-U-boot.patch index a98271acbc..6235f6cb2d 100644 --- a/package/boot/uboot-sifiveu/patches/0003-board-sifive-Set-LED-s-color-to-purple-in-the-U-boot.patch +++ b/package/boot/uboot-sifiveu/patches/0002-board-sifive-Set-LED-s-color-to-purple-in-the-U-boot.patch @@ -1,13 +1,16 @@ -From 7ead6d662a2f9d8498af6650ea38418c64b52048 Mon Sep 17 00:00:00 2001 +From 0dfab8fab80107aa4ad7d41a8ff47e5ff59632f9 Mon Sep 17 00:00:00 2001 From: Vincent Chen Date: Mon, 24 Jan 2022 02:42:02 -0800 -Subject: [PATCH 3/8] board: sifive: Set LED's color to purple in the U-boot +Subject: [PATCH 2/5] board: sifive: Set LED's color to purple in the U-boot stage Set LED's color to purple in the U-boot stage. Because there are still some functions to be executed before board_early_init_f(), it means the LED's is not changed to purple instantly when entering the U-boot stage. + +Upstream-Status: Pending +Signed-off-by: Vincent Chen --- board/sifive/unmatched/pwm.c | 7 +++++++ board/sifive/unmatched/unmatched.c | 6 ++++++ @@ -52,7 +55,7 @@ stage. /* enable all cache ways */ --- a/configs/sifive_unmatched_defconfig +++ b/configs/sifive_unmatched_defconfig -@@ -62,3 +62,4 @@ CONFIG_DM_SCSI=y +@@ -63,3 +63,4 @@ CONFIG_DM_SCSI=y CONFIG_USB=y CONFIG_USB_XHCI_HCD=y CONFIG_USB_XHCI_PCI=y diff --git a/package/boot/uboot-sifiveu/patches/0004-board-sifive-Set-LED-s-color-to-blue-before-jumping-.patch b/package/boot/uboot-sifiveu/patches/0003-board-sifive-Set-LED-s-color-to-blue-before-jumping-.patch similarity index 78% rename from package/boot/uboot-sifiveu/patches/0004-board-sifive-Set-LED-s-color-to-blue-before-jumping-.patch rename to package/boot/uboot-sifiveu/patches/0003-board-sifive-Set-LED-s-color-to-blue-before-jumping-.patch index b5bffd22bd..3a381444a1 100644 --- a/package/boot/uboot-sifiveu/patches/0004-board-sifive-Set-LED-s-color-to-blue-before-jumping-.patch +++ b/package/boot/uboot-sifiveu/patches/0003-board-sifive-Set-LED-s-color-to-blue-before-jumping-.patch @@ -1,20 +1,23 @@ -From 6ef7023c0dcfde320015ab19e0e0d423921be77d Mon Sep 17 00:00:00 2001 +From 1a48019dd4b69dd76551217a61cc4cab9e92fd39 Mon Sep 17 00:00:00 2001 From: Vincent Chen Date: Mon, 15 Nov 2021 03:39:07 -0800 -Subject: [PATCH 1/2] board: sifive: Set LED's color to blue before jumping to +Subject: [PATCH 3/5] board: sifive: Set LED's color to blue before jumping to Linux The LED's color wil be changed from purple to blue before executing the sysboot command. Because the sysboot command includes the image loading from the boot partition, It means the LED's color is blue when executing "Retrieving file: /Image.gz". + +Upstream-Status: Pending +Signed-off-by: Vincent Chen --- include/configs/sifive-unmatched.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/include/configs/sifive-unmatched.h +++ b/include/configs/sifive-unmatched.h -@@ -49,7 +49,12 @@ +@@ -48,6 +48,11 @@ "type_guid_gpt_system=" TYPE_GUID_SYSTEM "\0" \ "partitions=" PARTS_DEFAULT "\0" \ "fdtfile=" CONFIG_DEFAULT_FDT_FILE "\0" \ @@ -26,5 +29,4 @@ from the boot partition, It means the LED's color is blue when executing + "sysboot ${devtype} ${devnum}:${distro_bootpart} any " \ + "${scriptaddr} ${prefix}${boot_syslinux_conf};\0" - #define CONFIG_SYS_EEPROM_BUS_NUM 0 - + #endif /* __SIFIVE_UNMATCHED_H */ diff --git a/package/boot/uboot-sifiveu/patches/0004-board-sifive-spl-Set-remote-thermal-of-TMP451-to-85-.patch b/package/boot/uboot-sifiveu/patches/0004-board-sifive-spl-Set-remote-thermal-of-TMP451-to-85-.patch new file mode 100644 index 0000000000..1db843c153 --- /dev/null +++ b/package/boot/uboot-sifiveu/patches/0004-board-sifive-spl-Set-remote-thermal-of-TMP451-to-85-.patch @@ -0,0 +1,67 @@ +From 877afdf63129caa64d70d4a1252eec44778cfa0e Mon Sep 17 00:00:00 2001 +From: Vincent Chen +Date: Mon, 24 Jan 2022 02:57:40 -0800 +Subject: [PATCH 4/5] board: sifive: spl: Set remote thermal of TMP451 to 85 + deg C + + for the unmatched board + +For TMP451 on the unmatched board, the default value of the remote +thermal threshold is 108 deg C. This commit initilizes it to 85 deg C at SPL. + +Upstream-Status: Pending +Signed-off-by: Vincent Chen +Signed-off-by: Thomas Perrot +--- + board/sifive/unmatched/spl.c | 26 ++++++++++++++++++++++++++ + 1 file changed, 26 insertions(+) + +--- a/board/sifive/unmatched/spl.c ++++ b/board/sifive/unmatched/spl.c +@@ -10,6 +10,8 @@ + #include + #include + #include ++#include ++#include + #include + #include + #include +@@ -26,6 +28,24 @@ + #define MODE_SELECT_SD 0xb + #define MODE_SELECT_MASK GENMASK(3, 0) + ++#define TMP451_REMOTE_THERM_LIMIT_REG_OFFSET 0x19 ++#define TMP451_REMOTE_THERM_LIMIT_INIT_VALUE 0x55 ++ ++static inline int init_tmp451_remote_therm_limit(void) ++{ ++ struct udevice *dev; ++ unsigned char r_therm_limit = TMP451_REMOTE_THERM_LIMIT_INIT_VALUE; ++ int ret; ++ ++ ret = i2c_get_chip_for_busnum(0, 0x4c, 0x1, &dev); ++ ++ if (!ret) ++ ret = dm_i2c_write(dev, TMP451_REMOTE_THERM_LIMIT_REG_OFFSET, ++ &r_therm_limit, ++ sizeof(unsigned char)); ++ return ret; ++} ++ + static inline int spl_reset_device_by_gpio(const char *label, int pin, int low_width) + { + int ret; +@@ -92,6 +112,12 @@ int spl_board_init_f(void) + + pwm_device_init(); + ++ ret = init_tmp451_remote_therm_limit(); ++ if (ret) { ++ debug("TMP451 remote THERM limit init failed: %d\n", ret); ++ goto end; ++ } ++ + ret = spl_gemgxl_init(); + if (ret) { + debug("Gigabit ethernet PHY (VSC8541) init failed: %d\n", ret); diff --git a/package/boot/uboot-sifiveu/patches/0005-board-sifive-spl-Set-remote-thermal-of-TMP451-to-85-.patch b/package/boot/uboot-sifiveu/patches/0005-board-sifive-spl-Set-remote-thermal-of-TMP451-to-85-.patch deleted file mode 100644 index dc0d04151f..0000000000 --- a/package/boot/uboot-sifiveu/patches/0005-board-sifive-spl-Set-remote-thermal-of-TMP451-to-85-.patch +++ /dev/null @@ -1,111 +0,0 @@ -From 07f84ed283b913cbdf87181ae2ed65467d923df5 Mon Sep 17 00:00:00 2001 -From: Vincent Chen -Date: Mon, 24 Jan 2022 02:57:40 -0800 -Subject: [PATCH 2/2] board: sifive: spl: Set remote thermal of TMP451 to 85 - deg C for the unmatched board - -For TMP451 on the unmatched board, the default value of the remote -thermal threshold is 108 deg C. This commit initilizes it to 85 deg C at SPL. ---- - board/sifive/unmatched/spl.c | 29 +++++++++++++++++++++++++++++ - drivers/misc/Kconfig | 10 ++++++++++ - include/configs/sifive-unmatched.h | 4 ++++ - scripts/config_whitelist.txt | 1 + - 4 files changed, 44 insertions(+) - ---- a/board/sifive/unmatched/spl.c -+++ b/board/sifive/unmatched/spl.c -@@ -10,6 +10,8 @@ - #include - #include - #include -+#include -+#include - #include - #include - #include -@@ -26,6 +28,27 @@ - #define MODE_SELECT_SD 0xb - #define MODE_SELECT_MASK GENMASK(3, 0) - -+#define TMP451_REMOTE_THERM_LIMIT_REG_OFFSET 0x19 -+#define TMP451_REMOTE_THERM_LIMIT_INIT_VALUE 0x55 -+ -+static inline int init_tmp451_remote_therm_limit(void) -+{ -+ struct udevice *dev; -+ unsigned char r_therm_limit = TMP451_REMOTE_THERM_LIMIT_INIT_VALUE; -+ int ret; -+ -+ ret = i2c_get_chip_for_busnum(CONFIG_SYS_TMP451_BUS_NUM, -+ CONFIG_SYS_I2C_TMP451_ADDR, -+ CONFIG_SYS_I2C_TMP451_ADDR_LEN, -+ &dev); -+ -+ if (!ret) -+ ret = dm_i2c_write(dev, TMP451_REMOTE_THERM_LIMIT_REG_OFFSET, -+ &r_therm_limit, -+ sizeof(unsigned char)); -+ return ret; -+} -+ - static inline int spl_reset_device_by_gpio(const char *label, int pin, int low_width) - { - int ret; -@@ -92,6 +115,12 @@ int spl_board_init_f(void) - - pwm_device_init(); - -+ ret = init_tmp451_remote_therm_limit(); -+ if (ret) { -+ debug("TMP451 remote THERM limit init failed: %d\n", ret); -+ goto end; -+ } -+ - ret = spl_gemgxl_init(); - if (ret) { - debug("Gigabit ethernet PHY (VSC8541) init failed: %d\n", ret); ---- a/drivers/misc/Kconfig -+++ b/drivers/misc/Kconfig -@@ -536,8 +536,18 @@ config SYS_I2C_EEPROM_ADDR - depends on ID_EEPROM || I2C_EEPROM || SPL_I2C_EEPROM || CMD_EEPROM || ENV_IS_IN_EEPROM - default 0 - -+config SYS_I2C_TMP451_ADDR -+ hex "Chip address of the TMP451 device" -+ default 0 -+ - if I2C_EEPROM - -+config SYS_I2C_TMP451_ADDR_LEN -+ int "Length in bytes of the TMP451 memory array address" -+ default 1 -+ help -+ Note: This is NOT the chip address length! -+ - config SYS_I2C_EEPROM_ADDR_OVERFLOW - hex "EEPROM Address Overflow" - default 0x0 ---- a/include/configs/sifive-unmatched.h -+++ b/include/configs/sifive-unmatched.h -@@ -15,6 +15,10 @@ - - #define CONFIG_STANDALONE_LOAD_ADDR 0x80200000 - -+#define CONFIG_SYS_TMP451_BUS_NUM 0 -+#define CONFIG_SYS_I2C_TMP451_ADDR 0x4c -+#define CONFIG_SYS_I2C_TMP451_ADDR_LEN 0x1 -+ - /* Environment options */ - - #define BOOT_TARGET_DEVICES(func) \ ---- a/scripts/config_whitelist.txt -+++ b/scripts/config_whitelist.txt -@@ -1268,6 +1268,7 @@ CONFIG_SYS_TIMER_BASE - CONFIG_SYS_TIMER_COUNTER - CONFIG_SYS_TIMER_COUNTS_DOWN - CONFIG_SYS_TIMER_RATE -+CONFIG_SYS_TMP451_BUS_NUM - CONFIG_SYS_TMPVIRT - CONFIG_SYS_TSEC1_OFFSET - CONFIG_SYS_TX_ETH_BUFFER diff --git a/package/boot/uboot-sifiveu/patches/0008-riscv-dts-Add-few-PMU-events.patch b/package/boot/uboot-sifiveu/patches/0005-riscv-dts-Add-few-PMU-events.patch similarity index 88% rename from package/boot/uboot-sifiveu/patches/0008-riscv-dts-Add-few-PMU-events.patch rename to package/boot/uboot-sifiveu/patches/0005-riscv-dts-Add-few-PMU-events.patch index 3f3feb9da7..225c845d3c 100644 --- a/package/boot/uboot-sifiveu/patches/0008-riscv-dts-Add-few-PMU-events.patch +++ b/package/boot/uboot-sifiveu/patches/0005-riscv-dts-Add-few-PMU-events.patch @@ -1,7 +1,7 @@ -From c29e4d84cfa17ab96eff2a9044f486ba3c8b5c43 Mon Sep 17 00:00:00 2001 +From 9b2868e9fda750c985313a40e60b67f96dc77ed1 Mon Sep 17 00:00:00 2001 From: Atish Patra Date: Mon, 25 Oct 2021 11:35:41 -0700 -Subject: [PATCH] riscv: dts: Add few PMU events +Subject: [PATCH 5/5] riscv: dts: Add few PMU events fu740 has 2 HPM counters and many HPM events defined in the fu740 manual[1]. This patch adds some of these events and their mapping as per the @@ -9,6 +9,7 @@ OpenSBI PMU DT binding for now. [1]https://sifive.cdn.prismic.io/sifive/de1491e5-077c-461d-9605-e8a0ce57337d_fu740-c000-manual-v1p3.pdf +Upstream-Status: Pending Signed-off-by: Atish Patra --- arch/riscv/dts/fu740-c000.dtsi | 11 +++++++++++ diff --git a/package/boot/uboot-sifiveu/patches/0006-riscv-sifive-fu740-reduce-DDR-speed-from-1866MT-s-to.patch b/package/boot/uboot-sifiveu/patches/0006-riscv-sifive-fu740-reduce-DDR-speed-from-1866MT-s-to.patch new file mode 100644 index 0000000000..380342d4a8 --- /dev/null +++ b/package/boot/uboot-sifiveu/patches/0006-riscv-sifive-fu740-reduce-DDR-speed-from-1866MT-s-to.patch @@ -0,0 +1,22 @@ +From 45f9941ddc6346b38aa9eb7f033e1e169b63bdc7 Mon Sep 17 00:00:00 2001 +From: Thomas Perrot +Date: Fri, 8 Dec 2023 11:24:37 +0100 +Subject: [PATCH] riscv: sifive: fu740: reduce DDR speed from 1866MT/s to + 1600MT/s + +Signed-off-by: Thomas Perrot +--- + arch/riscv/dts/fu740-c000-u-boot.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/riscv/dts/fu740-c000-u-boot.dtsi ++++ b/arch/riscv/dts/fu740-c000-u-boot.dtsi +@@ -77,7 +77,7 @@ + 0x0 0x100b2000 0x0 0x2000 + 0x0 0x100b8000 0x0 0x1000>; + clocks = <&prci FU740_PRCI_CLK_DDRPLL>; +- clock-frequency = <933333324>; ++ clock-frequency = <800000004>; + bootph-pre-ram; + }; + }; diff --git a/package/boot/uboot-sifiveu/patches/0009-riscv-Fix-build-against-binutils.patch b/package/boot/uboot-sifiveu/patches/0009-riscv-Fix-build-against-binutils.patch deleted file mode 100644 index f7c6a62291..0000000000 --- a/package/boot/uboot-sifiveu/patches/0009-riscv-Fix-build-against-binutils.patch +++ /dev/null @@ -1,48 +0,0 @@ -commit 1dde977518f13824b847e23275001191139bc384 -Author: Alexandre Ghiti -Date: Mon Oct 3 18:07:54 2022 +0200 - - riscv: Fix build against binutils 2.38 - - The following description is copied from the equivalent patch for the - Linux Kernel proposed by Aurelien Jarno: - - >From version 2.38, binutils default to ISA spec version 20191213. This - means that the csr read/write (csrr*/csrw*) instructions and fence.i - instruction has separated from the `I` extension, become two standalone - extensions: Zicsr and Zifencei. As the kernel uses those instruction, - this causes the following build failure: - - arch/riscv/cpu/mtrap.S: Assembler messages: - arch/riscv/cpu/mtrap.S:65: Error: unrecognized opcode `csrr a0,scause' - arch/riscv/cpu/mtrap.S:66: Error: unrecognized opcode `csrr a1,sepc' - arch/riscv/cpu/mtrap.S:67: Error: unrecognized opcode `csrr a2,stval' - arch/riscv/cpu/mtrap.S:70: Error: unrecognized opcode `csrw sepc,a0' - - Signed-off-by: Alexandre Ghiti - Reviewed-by: Bin Meng - Tested-by: Heinrich Schuchardt - Tested-by: Heiko Stuebner - Tested-by: Christian Stewart - Reviewed-by: Rick Chen - ---- a/arch/riscv/Makefile -+++ b/arch/riscv/Makefile -@@ -24,7 +24,16 @@ ifeq ($(CONFIG_CMODEL_MEDANY),y) - CMODEL = medany - endif - --ARCH_FLAGS = -march=$(ARCH_BASE)$(ARCH_A)$(ARCH_C) -mabi=$(ABI) \ -+RISCV_MARCH = $(ARCH_BASE)$(ARCH_A)$(ARCH_C) -+ -+# Newer binutils versions default to ISA spec version 20191213 which moves some -+# instructions from the I extension to the Zicsr and Zifencei extensions. -+toolchain-need-zicsr-zifencei := $(call cc-option-yn, -mabi=$(ABI) -march=$(RISCV_MARCH)_zicsr_zifencei) -+ifeq ($(toolchain-need-zicsr-zifencei),y) -+ RISCV_MARCH := $(RISCV_MARCH)_zicsr_zifencei -+endif -+ -+ARCH_FLAGS = -march=$(RISCV_MARCH) -mabi=$(ABI) \ - -mcmodel=$(CMODEL) - - PLATFORM_CPPFLAGS += $(ARCH_FLAGS) diff --git a/package/boot/uboot-sifiveu/patches/100-mkimage-check-environment-for-dtc-binary-location.patch b/package/boot/uboot-sifiveu/patches/100-mkimage-check-environment-for-dtc-binary-location.patch index 789172f21b..fcc30ce35c 100644 --- a/package/boot/uboot-sifiveu/patches/100-mkimage-check-environment-for-dtc-binary-location.patch +++ b/package/boot/uboot-sifiveu/patches/100-mkimage-check-environment-for-dtc-binary-location.patch @@ -17,7 +17,7 @@ Cc: Simon Glass --- a/tools/fit_image.c +++ b/tools/fit_image.c -@@ -729,9 +729,14 @@ static int fit_handle_file(struct image_ +@@ -754,9 +754,14 @@ static int fit_handle_file(struct image_ } *cmd = '\0'; } else if (params->datafile) { diff --git a/package/boot/uboot-sifiveu/patches/110-no-kwbimage.patch b/package/boot/uboot-sifiveu/patches/110-no-kwbimage.patch index 65d14f5bec..f83814b9b2 100644 --- a/package/boot/uboot-sifiveu/patches/110-no-kwbimage.patch +++ b/package/boot/uboot-sifiveu/patches/110-no-kwbimage.patch @@ -1,10 +1,10 @@ --- a/tools/Makefile +++ b/tools/Makefile -@@ -119,7 +119,6 @@ dumpimage-mkimage-objs := aisimage.o \ +@@ -114,7 +114,6 @@ dumpimage-mkimage-objs := aisimage.o \ imximage.o \ imx8image.o \ imx8mimage.o \ - kwbimage.o \ - lib/md5.o \ + generated/lib/md5.o \ lpc32xximage.o \ mxsimage.o \ diff --git a/package/boot/uboot-sifiveu/patches/130-fix-mkimage-host-build.patch b/package/boot/uboot-sifiveu/patches/130-fix-mkimage-host-build.patch index 8b110a880f..cd65c1321f 100644 --- a/package/boot/uboot-sifiveu/patches/130-fix-mkimage-host-build.patch +++ b/package/boot/uboot-sifiveu/patches/130-fix-mkimage-host-build.patch @@ -1,6 +1,6 @@ --- a/tools/image-host.c +++ b/tools/image-host.c -@@ -1122,6 +1122,7 @@ static int fit_config_add_verification_d +@@ -1125,6 +1125,7 @@ static int fit_config_add_verification_d * 2) get public key (X509_get_pubkey) * 3) provide der format (d2i_RSAPublicKey) */ @@ -8,7 +8,7 @@ static int read_pub_key(const char *keydir, const void *name, unsigned char **pubkey, int *pubkey_len) { -@@ -1175,6 +1176,13 @@ err_cert: +@@ -1178,6 +1179,13 @@ err_cert: fclose(f); return ret; } From 1152af3490cacbc05df2d862030e00ff2eeb3b36 Mon Sep 17 00:00:00 2001 From: Zoltan HERPAI Date: Tue, 18 Feb 2025 18:57:53 +0100 Subject: [PATCH 12/26] sunxi: add support for Merrii Hummingbird A31 Specifications: - SoC: Allwinner A31 @ 1GHz - DRAM: 1/2Gb DDR3 - SD-card slot - NAND: 8/16Gb MLC - Ethernet: 1x 10/100/1000Mbps (RTL8211E) - Wireless: Ampak AP6210 (BCM43362) - 2x USB2.0 - 1x mPCIe slot for 4G cards - 1x SIM slot - HDMI/VGA via simplefb - RTC with battery - Power via DC12V / 3A Installation: Use the standard sunxi installation to an SD-card. NAND is not supported. This is to re-add proper support for an older device. Link: https://openwrt.org/toh/merrii/hummingbird Signed-off-by: Zoltan HERPAI --- package/boot/uboot-sunxi/Makefile | 1 + target/linux/sunxi/image/cortexa7.mk | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile index e32718a5d3..5531de2794 100644 --- a/package/boot/uboot-sunxi/Makefile +++ b/package/boot/uboot-sunxi/Makefile @@ -113,6 +113,7 @@ endef define U-Boot/Hummingbird_A31 BUILD_SUBTARGET:=cortexa7 NAME:=Hummingbird A31 board + BUILD_DEVICES:=merrii_hummingbird endef define U-Boot/Marsboard_A10 diff --git a/target/linux/sunxi/image/cortexa7.mk b/target/linux/sunxi/image/cortexa7.mk index e2d83fa94f..1637cd5d20 100644 --- a/target/linux/sunxi/image/cortexa7.mk +++ b/target/linux/sunxi/image/cortexa7.mk @@ -145,6 +145,14 @@ define Device/mele_m9 endef TARGET_DEVICES += mele_m9 +define Device/merrii_hummingbird + DEVICE_VENDOR := Merrii + DEVICE_MODEL := Hummingbird + DEVICE_PACKAGES:=kmod-brcmfmac cypress-firmware-43362-sdio wpad-basic-mbedtls + SOC := sun6i-a31 +endef +TARGET_DEVICES += merrii_hummingbird + define Device/olimex_a20-olinuxino-lime DEVICE_VENDOR := Olimex DEVICE_MODEL := A20-OLinuXino-LIME From 7fd9340ec45dfb85c9d1eff5efe33b22af3d4ec7 Mon Sep 17 00:00:00 2001 From: Sean Khan Date: Mon, 17 Feb 2025 16:35:32 -0500 Subject: [PATCH 13/26] wifi-scripts: fix vht_oper_centr_freq_seg0_idx_map calculation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When selecting channels above 100 in VHT160+ modes the center frequency segment was incorrectly set to 50, causing the interface to not come up. Change logic to instead check if the channel is within ±28 channels of the intended center, which matches the actual 160+ MHz channel width specification for VHT160, HE160, and EHT160. Signed-off-by: Sean Khan Link: https://github.com/openwrt/openwrt/pull/18013 Signed-off-by: John Crispin --- .../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 0e3cfc5b90..01e29db8e2 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 @@ -242,7 +242,7 @@ function device_htmode_append(config) { [ 29, 15 ], [ 61, 47 ], [ 93, 79 ], [ 125, 111 ], [ 157, 143 ], [ 189, 175 ], [ 221, 207 ]]; for (let k, v in vht_oper_centr_freq_seg0_idx_map) - if (v[0] <= config.channel) { + if (config.channel >= (v[0] - 28) && config.channel <= v[0]) { config.vht_oper_centr_freq_seg0_idx = v[1]; break; } From 18511314275bd1056d2e2b6c6a382fa10c0a13f9 Mon Sep 17 00:00:00 2001 From: Sean Khan Date: Mon, 17 Feb 2025 16:55:40 -0500 Subject: [PATCH 14/26] wifi-scripts: fix RX-STBC notation VHT capabilities Notation for RX-STBC VHT capabilities when specifying number of spatial streams should be hyphenated, e.g. RX-STBC-1, RX-STBC-2. HT capabilities use without hyphen, e.g. RX-STBC1, RX-STBC2. This is consistent with what hostapd expects. ```c static int hostapd_config_ht_capab(struct hostapd_config *conf, const char *capab) { if (os_strstr(capab, "[RX-STBC1]")) { conf->ht_capab &= ~HT_CAP_INFO_RX_STBC_MASK; conf->ht_capab |= HT_CAP_INFO_RX_STBC_1; } if (os_strstr(capab, "[RX-STBC12]")) { conf->ht_capab &= ~HT_CAP_INFO_RX_STBC_MASK; conf->ht_capab |= HT_CAP_INFO_RX_STBC_12; } if (os_strstr(capab, "[RX-STBC123]")) { conf->ht_capab &= ~HT_CAP_INFO_RX_STBC_MASK; conf->ht_capab |= HT_CAP_INFO_RX_STBC_123; } } static int hostapd_config_vht_capab(struct hostapd_config *conf, const char *capab) { if (os_strstr(capab, "[RX-STBC-1]")) conf->vht_capab |= VHT_CAP_RXSTBC_1; if (os_strstr(capab, "[RX-STBC-12]")) conf->vht_capab |= VHT_CAP_RXSTBC_2; if (os_strstr(capab, "[RX-STBC-123]")) conf->vht_capab |= VHT_CAP_RXSTBC_3; if (os_strstr(capab, "[RX-STBC-1234]")) } ``` Signed-off-by: Sean Khan Link: https://github.com/openwrt/openwrt/pull/18013 Signed-off-by: John Crispin --- .../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 01e29db8e2..c08d26d04f 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 @@ -329,7 +329,7 @@ function device_htmode_append(config) { config.vht_capab += '[RX-ANTENNA-PATTERN]'; if (vht_capab & 0x20000000 && config.tx_antenna_pattern) config.vht_capab += '[TX-ANTENNA-PATTERN]'; - let rx_stbc = [ '', '[RX-STBC1]', '[RX-STBC12]', '[RX-STBC123]', '[RX-STBC-1234]' ]; + let rx_stbc = [ '', '[RX-STBC-1]', '[RX-STBC-12]', '[RX-STBC-123]', '[RX-STBC-1234]' ]; config.vht_capab += rx_stbc[min(config.rx_stbc, (vht_capab >> 8) & 7)]; if (vht_capab & 0x800 && config.su_beamformer) From eabea737fae4638ace92e1404279f0d2b1839a7a Mon Sep 17 00:00:00 2001 From: Sean Khan Date: Mon, 17 Feb 2025 17:08:09 -0500 Subject: [PATCH 15/26] wifi-scripts: fix missing VHT capabilities detection * Add missing parentheses in the conditionals for VHT160/VHT160-80PLUS80 and VHT_MAX_MPDU capabilities. The missing parentheses caused the bitwise AND to be evaluated after the equality comparison due to ECMA's operator precedence, where `==` has higher precedence than `&`. * Fix Max MPDU length detection by changing the comparison operators to `>=` vs `>` otherwise the condition would never be met. * Add missing default values: - `true` value for `short_gi_80` (As it exists for `short_gi_20`, `short_gi_40`, `short_gi_160`) - `7` for `vht_max_mpdu` (Without it the loop in MAX-MPDU-* calculation always compares with null) * Change the `vht160` condition to `config.vht160 <= 2`. This flag is `2` by default, and only ever set to `0` when `vht_oper_chwidth < 2`. Signed-off-by: Sean Khan Link: https://github.com/openwrt/openwrt/pull/18013 Signed-off-by: John Crispin --- .../usr/share/schema/wireless.wifi-device.json | 6 ++++-- .../files-ucode/usr/share/ucode/wifi/hostapd.uc | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) 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 4354b4f816..79f7ec4e76 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 @@ -635,7 +635,8 @@ }, "short_gi_80": { "description": "Short GI for 80 MHz", - "type": "boolean" + "type": "boolean", + "default": true }, "spectrum_mgmt_required": { "description": "Set Spectrum Management subfield in the Capability Information field", @@ -712,7 +713,8 @@ "description": "Indicates the maximum length of A-MPDU pre-EOF padding that the STA can recv", "type": "number", "minimum": 0, - "maximum": 7 + "maximum": 7, + "default": 7 }, "vht_max_mpdu": { "description": "Maximum MPDU length", 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 c08d26d04f..223f84f7d7 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 @@ -338,15 +338,15 @@ function device_htmode_append(config) { config.vht_capab += '[BF-ANTENNA-' + min(((vht_capab >> 13) & 3) + 1, config.beamformer_antennas) + ']'; /* supported Channel widths */ - if (vht_capab & 0xc == 8 && config.vht160 <= 2) + if ((vht_capab & 0xc) == 8 && config.vht160 <= 2) config.vht_capab += '[VHT160-80PLUS80]'; - else if (vht_capab & 0xc == 4 && config.vht160 <= 1) + else if ((vht_capab & 0xc) == 4 && config.vht160 <= 2) config.vht_capab += '[VHT160]'; /* maximum MPDU length */ - if (vht_capab & 3 > 1 && config.vht_max_mpdu > 11454) + if ((vht_capab & 3) > 1 && config.vht_max_mpdu >= 11454) config.vht_capab += '[MAX-MPDU-11454]'; - else if (vht_capab & 3 && config.vht_max_mpdu > 7991) + else if ((vht_capab & 3) && config.vht_max_mpdu >= 7991) config.vht_capab += '[MAX-MPDU-7991]'; /* maximum A-MPDU length exponent */ From 15013e87cb5415b7462523a2d87e833f3f56995f Mon Sep 17 00:00:00 2001 From: Sean Khan Date: Wed, 19 Feb 2025 00:28:07 -0500 Subject: [PATCH 16/26] wifi-scripts: iwinfo: add null checks for rx/tx bitrate On some devices, the rx/tx bitrate may not always be available right away, or at all when in mesh mode at plink is blocked causing the following: ``` Reference error: left-hand side expression is null In assoclist(), file /usr/share/ucode/iwinfo.uc, line 321, byte 46: called from function info (/usr/share/ucode/iwinfo.uc:427:33) called from anonymous function (/usr/bin/iwinfo:108:25) ` bitrate_raw: station.sta_info.tx_bitrate.bitrate,` Near here -----------------------------------------------^ Reference error: left-hand side expression is null In assoclist(), file /usr/share/ucode/iwinfo.uc, line 314, byte 54: called from function info (/usr/share/ucode/iwinfo.uc:427:33) called from anonymous function (/usr/bin/iwinfo:108:25) ` bitrate: format_rate(station.sta_info.rx_bitrate.bitrate),` Near here -------------------------------------------------------^ Reference error: left-hand side expression is null In assoc_flags(), file /usr/share/ucode/iwinfo.uc, line 216, byte 12: called from function assoclist (/usr/share/ucode/iwinfo.uc:323:51) called from function info (/usr/share/ucode/iwinfo.uc:427:33) called from anonymous function (/usr/bin/iwinfo:108:25) ` if (data[k])` Near here -------^ ``` This was seen on Linksys MX5300 in mesh mode (QCA9984). Signed-off-by: Sean Khan Link: https://github.com/openwrt/openwrt/pull/18027 Signed-off-by: John Crispin --- .../files-ucode/usr/share/ucode/iwinfo.uc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc index 4ce45b21f1..ff878cfebb 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/iwinfo.uc @@ -311,16 +311,16 @@ export function assoclist(dev) { snr: station.sta_info.signal_avg - ifaces[dev].noise, inactive_time: station.sta_info.inactive_time, rx: { - bitrate: format_rate(station.sta_info.rx_bitrate.bitrate), - bitrate_raw: station.sta_info.rx_bitrate.bitrate, - packets: station.sta_info.rx_packets, - flags: assoc_flags(station.sta_info.rx_bitrate), + bitrate: format_rate(station.sta_info.rx_bitrate?.bitrate ?? 0), + bitrate_raw: station.sta_info.rx_bitrate?.bitrate ?? 0, + packets: station.sta_info.rx_packets ?? 0, + flags: assoc_flags(station.sta_info.rx_bitrate ?? {}), }, tx: { - bitrate: format_rate(station.sta_info.tx_bitrate.bitrate), - bitrate_raw: station.sta_info.tx_bitrate.bitrate, - packets: station.sta_info.tx_packets, - flags: assoc_flags(station.sta_info.tx_bitrate), + bitrate: format_rate(station.sta_info.tx_bitrate?.bitrate ?? 0), + bitrate_raw: station.sta_info.tx_bitrate?.bitrate ?? 0, + packets: station.sta_info.tx_packets ?? 0, + flags: assoc_flags(station.sta_info.tx_bitrate ?? {}), }, expected_throughput: station.sta_info.expected_throughput ?? 'unknown', }; From c840629046348d72ff7609433e5e228abb737797 Mon Sep 17 00:00:00 2001 From: Sean Khan Date: Wed, 19 Feb 2025 00:48:57 -0500 Subject: [PATCH 17/26] wifi-scripts: iwinfo: add definition for QCA9984 Fixes iwinfo output for QCA9984 devices. Before: ``` Hardware: nl80211 [Generic MAC80211] ``` After: ``` Hardware: 0x168c:0x0046 0x168c:0xcafe [Qualcomm, Atheros QCA9984] ``` Signed-off-by: Sean Khan Link: https://github.com/openwrt/openwrt/pull/18028 Signed-off-by: John Crispin --- .../config/wifi-scripts/files-ucode/usr/share/wifi_devices.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/wifi_devices.json b/package/network/config/wifi-scripts/files-ucode/usr/share/wifi_devices.json index 5a38ca4b2f..29dbcef246 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/wifi_devices.json +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/wifi_devices.json @@ -164,6 +164,7 @@ [ "0x168c", "0x003c", "0x19b6", "0xd03c", 0, 0, "Mikrotik", "R11e-5HacT" ], [ "0x168c", "0x003c", "0x19b6", "0xd075", 0, 0, "Mikrotik", "R11e-5HacD" ], [ "0x168c", "0x003e", "0x168c", "0x3361", 0, 0, "Qualcomm, Atheros", "QCA6174" ], + [ "0x168c", "0x0046", "0x168c", "0xcafe", 0, 0, "Qualcomm, Atheros", "QCA9984" ], [ "0x168c", "0x0040", "0x168c", "0x0002", 0, 0, "Qualcomm, Atheros", "QCA9990" ], [ "0x168c", "0x0046", "0x0777", "0xe535", 0, 0, "Qualcomm, Atheros", "QCA9994" ], [ "0x168c", "0x0046", "0x0777", "0xe5a2", 0, 0, "Qualcomm, Atheros", "QCA9994" ], From b74318481b424cf72ef178881c567e9f049c04dc Mon Sep 17 00:00:00 2001 From: Lix Zhou Date: Wed, 19 Feb 2025 13:22:12 +0800 Subject: [PATCH 18/26] wifi-scripts: failed to start hostapd if he_spr_psr_enabled is set he_spr_psr_enabled is appended to hostapd.conf if it's enabled, but hostapd doesn't support this config, it should be used as an internal flag to control the he_spr_sr_control configuring. Signed-off-by: Lix Zhou Link: https://github.com/openwrt/openwrt/pull/18025 Signed-off-by: John Crispin --- .../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 b4aa19bf52..61813ab81b 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 @@ -471,7 +471,6 @@ mac80211_hostapd_setup_base() { he_su_beamformer:${he_phy_cap:6:2}:0x80:$he_su_beamformer \ he_su_beamformee:${he_phy_cap:8:2}:0x1:$he_su_beamformee \ he_mu_beamformer:${he_phy_cap:8:2}:0x2:$he_mu_beamformer \ - he_spr_psr_enabled:${he_phy_cap:14:2}:0x1:$he_spr_psr_enabled \ he_twt_required:${he_mac_cap:0:2}:0x6:$he_twt_required if [ "$he_bss_color_enabled" -gt 0 ]; then @@ -480,6 +479,7 @@ mac80211_hostapd_setup_base() { append base_cfg "he_spr_non_srg_obss_pd_max_offset=$he_spr_non_srg_obss_pd_max_offset" "$N" he_spr_sr_control=$((he_spr_sr_control | (1 << 2))) } + [ "$he_spr_psr_enabled" -gt 0 ] && he_spr_psr_enabled=$((0x${he_phy_cap:14:2} & 0x1)) [ "$he_spr_psr_enabled" -gt 0 ] || he_spr_sr_control=$((he_spr_sr_control | (1 << 0))) append base_cfg "he_spr_sr_control=$he_spr_sr_control" "$N" else From 08f5a13db1374f24ee4cb7613ef81c6b65eb00a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20K=C4=99pie=C5=84?= Date: Tue, 18 Feb 2025 08:40:09 +0100 Subject: [PATCH 19/26] yafut: update to a version that builds on macOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The latest upstream version of Yafut builds on macOS and other POSIX-compatible systems. Drop the custom OpenWRT patch applying non-Linux compatibility fixes to the tool's source code. Signed-off-by: Michał Kępień Link: https://github.com/openwrt/openwrt/pull/18014 Signed-off-by: Christian Marangi --- package/utils/yafut/Makefile | 6 +- tools/yafut/Makefile | 6 +- tools/yafut/patches/100-portability.patch | 289 ---------------------- 3 files changed, 6 insertions(+), 295 deletions(-) delete mode 100644 tools/yafut/patches/100-portability.patch diff --git a/package/utils/yafut/Makefile b/package/utils/yafut/Makefile index e3f240f754..42e91ef8a6 100644 --- a/package/utils/yafut/Makefile +++ b/package/utils/yafut/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=https://github.com/kempniu/yafut.git -PKG_MIRROR_HASH:=7540e977104d41b3aca27b58fda8cd84ebec80cfe01d955712fb8dc717aff6a6 -PKG_SOURCE_DATE:=2024-06-10 -PKG_SOURCE_VERSION:=38439f8a53d33b14744bc8f938662670b9d3e361 +PKG_MIRROR_HASH:=f5c76edc81477d2b68a7b032487d10fa361c8eaeecfc36908fde2ae828b7e822 +PKG_SOURCE_DATE:=2025-02-18 +PKG_SOURCE_VERSION:=e342c93981dc255bba58c17925b5c8983d7dacf8 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=LICENSE diff --git a/tools/yafut/Makefile b/tools/yafut/Makefile index a7e36e5175..e463d38c65 100644 --- a/tools/yafut/Makefile +++ b/tools/yafut/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=https://github.com/kempniu/yafut.git -PKG_MIRROR_HASH:=9cc6b4c485ce16d44b67ebf79e8bee1e07aecde112da739cf33e8714ac3842e7 -PKG_SOURCE_DATE:=2024-05-13 -PKG_SOURCE_VERSION:=2b45baaf1cced47af8f22dd3acbf1df2f04c7510 +PKG_MIRROR_HASH:=f5c76edc81477d2b68a7b032487d10fa361c8eaeecfc36908fde2ae828b7e822 +PKG_SOURCE_DATE:=2025-02-18 +PKG_SOURCE_VERSION:=e342c93981dc255bba58c17925b5c8983d7dacf8 PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=LICENSE diff --git a/tools/yafut/patches/100-portability.patch b/tools/yafut/patches/100-portability.patch deleted file mode 100644 index 18fda407af..0000000000 --- a/tools/yafut/patches/100-portability.patch +++ /dev/null @@ -1,289 +0,0 @@ ---- a/lib/yaffs2/direct/yportenv.h -+++ b/lib/yaffs2/direct/yportenv.h -@@ -32,10 +32,13 @@ - #define CONFIG_YAFFS_DEFINES_TYPES 1 - #define CONFIG_YAFFS_USE_32_BIT_TIME_T 1 - #define NO_Y_INLINE 1 --#define loff_t off_t - - #endif /* __rtems__ */ - -+#ifndef linux -+#define loff_t off_t -+#endif -+ - /* Definition of types */ - #ifdef CONFIG_YAFFS_DEFINES_TYPES - typedef unsigned char u8; ---- a/src/ioctl.c -+++ b/src/ioctl.c -@@ -21,5 +21,9 @@ - * integer overflow when building against e.g. musl. - */ - int linux_ioctl(int fd, unsigned long request, void *ptr) { -+#ifdef linux - return syscall(SYS_ioctl, fd, request, ptr); -+#else -+ return -1; -+#endif - } ---- a/src/ioctl.h -+++ b/src/ioctl.h -@@ -12,7 +12,9 @@ int linux_ioctl(int fd, unsigned long re - * time, as the definition of the MEMREAD ioctl trickles down into kernel - * headers distributed out there. - */ -+#ifdef linux - #include -+ - #ifndef MEMREAD - #include - -@@ -35,3 +37,4 @@ struct mtd_read_req { - - #define MEMREAD _IOWR('M', 26, struct mtd_read_req) - #endif /* MEMREAD */ -+#endif ---- a/src/mtd.c -+++ b/src/mtd.c -@@ -4,7 +4,9 @@ - - #include - #include -+#ifdef linux - #include -+#endif - #include - #include - #include -@@ -82,6 +84,7 @@ static void mtd_debug_location(const cha - va_end(args); - } - -+#ifdef linux - /* - * Read the raw contents of the sysfs attribute at the provided 'sysfs_path' - * into 'buf', which is 'buf_len' bytes large. The given sysfs attribute is -@@ -179,6 +182,7 @@ static int discover_mtd_parameters(const - - return 0; - } -+#endif - - /* - * Initialize 'geometry' with 'chunk_size' and 'block_size' set to the default -@@ -203,6 +207,7 @@ static void init_yaffs_geometry_default( - * Initialize 'geometry' with 'chunk_size' and 'block_size' set to the relevant - * MTD parameters provided in 'mtd' and 'mtd_type' set to the provided value. - */ -+#ifdef linux - static void init_yaffs_geometry_autodetected(const struct mtd_ctx *ctx, - const struct mtd_info_user *mtd, - struct mtd_geometry *geometry, -@@ -217,6 +222,7 @@ static void init_yaffs_geometry_autodete - .block_size = mtd->erasesize, - }; - } -+#endif - - /* - * Update 'chunk_size' and 'block_size' in 'geometry' to the values provided in -@@ -280,6 +286,7 @@ static int init_yaffs_geometry_file(cons - * 2. If -C and/or -B were used, override any default values with those - * provided on the command line. - */ -+#ifdef linux - static void init_yaffs_geometry_nand_or_nor(const struct mtd_ctx *ctx, - const struct mtd_info_user *mtd, - const struct opts *opts, -@@ -297,6 +304,7 @@ static void init_yaffs_geometry_nand_or_ - - geometry->block_count = mtd->size / geometry->block_size; - } -+#endif - - /* - * Determine the type of the provided MTD (which can be either NAND/NOR flash -@@ -317,6 +325,7 @@ static int init_yaffs_geometry(const str - geometry->oob_size = 0; - geometry->oobavail = 0; - } else { -+#ifdef linux - struct mtd_info_user mtd; - unsigned int oobavail; - -@@ -329,6 +338,9 @@ static int init_yaffs_geometry(const str - - geometry->oob_size = mtd.oobsize; - geometry->oobavail = oobavail; -+#else -+ return -1; -+#endif - } - - return 0; ---- a/src/ydrv.c -+++ b/src/ydrv.c -@@ -3,7 +3,9 @@ - // SPDX-License-Identifier: GPL-2.0-only - - #include -+#ifdef linux - #include -+#endif - #include - #include - #include -@@ -122,6 +124,7 @@ static long long ydrv_get_data_offset_fo - /* - * Check whether the given MTD block is a bad one on NAND or NOR flash. - */ -+#ifdef linux - static int ydrv_check_bad_nand_or_nor(const struct ydrv_ctx *ctx, - int block_no) { - long long offset = block_no * ctx->block_size; -@@ -139,6 +142,7 @@ static int ydrv_check_bad_nand_or_nor(co - - return (ret == 0 ? YAFFS_OK : YAFFS_FAIL); - } -+#endif - - /* - * Check whether the given MTD block is a bad one. -@@ -154,9 +158,11 @@ static int ydrv_check_bad(struct yaffs_d - } - - switch (ctx->mtd_type) { -+#ifdef linux - case MTD_TYPE_NAND: - case MTD_TYPE_NOR: - return ydrv_check_bad_nand_or_nor(ctx, block_no); -+#endif - case MTD_TYPE_FILE: - ydrv_debug("file is assumed to only contain good blocks"); - return YAFFS_OK; -@@ -169,6 +175,7 @@ static int ydrv_check_bad(struct yaffs_d - /* - * Erase the given MTD block on NAND or NOR flash. - */ -+#ifdef linux - static int ydrv_erase_block_nand_or_nor(const struct ydrv_ctx *ctx, - int block_no) { - long long offset = block_no * ctx->block_size; -@@ -196,6 +203,7 @@ static int ydrv_erase_block_nand_or_nor( - - return YAFFS_OK; - } -+#endif - - /* - * Erase the given MTD block in a file. -@@ -247,9 +255,11 @@ static int ydrv_erase_block(struct yaffs - } - - switch (ctx->mtd_type) { -+#ifdef linux - case MTD_TYPE_NAND: - case MTD_TYPE_NOR: - return ydrv_erase_block_nand_or_nor(ctx, block_no); -+#endif - case MTD_TYPE_FILE: - return ydrv_erase_block_file(ctx, block_no); - default: -@@ -261,6 +271,7 @@ static int ydrv_erase_block(struct yaffs - /* - * Mark the given MTD block as bad on NAND or NOR flash. - */ -+#ifdef linux - static int ydrv_mark_bad_nand_or_nor(const struct ydrv_ctx *ctx, int block_no) { - long long offset = block_no * ctx->block_size; - int err = 0; -@@ -281,6 +292,7 @@ static int ydrv_mark_bad_nand_or_nor(con - - return YAFFS_OK; - } -+#endif - - /* - * Mark the given MTD block as bad. -@@ -296,9 +308,11 @@ static int ydrv_mark_bad(struct yaffs_de - } - - switch (ctx->mtd_type) { -+#ifdef linux - case MTD_TYPE_NAND: - case MTD_TYPE_NOR: - return ydrv_mark_bad_nand_or_nor(ctx, block_no); -+#endif - case MTD_TYPE_FILE: - ydrv_debug("file is assumed to only contain good blocks"); - return YAFFS_FAIL; -@@ -315,9 +329,11 @@ static int ydrv_mark_bad(struct yaffs_de - */ - static int ydrv_ecc_result(int read_result, enum yaffs_ecc_result *ecc_result) { - switch (read_result) { -+#ifdef linux - case -EUCLEAN: - *ecc_result = YAFFS_ECC_RESULT_FIXED; - return YAFFS_OK; -+#endif - case -EBADMSG: - *ecc_result = YAFFS_ECC_RESULT_UNFIXED; - return YAFFS_FAIL; -@@ -333,6 +349,7 @@ static int ydrv_ecc_result(int read_resu - /* - * Read a data+OOB chunk from NAND flash. - */ -+#ifdef linux - static int ydrv_read_chunk_nand(const struct ydrv_ctx *ctx, int chunk, u8 *data, - int data_len, u8 *oob, int oob_len, - enum yaffs_ecc_result *ecc_result_out, -@@ -371,6 +388,7 @@ static int ydrv_read_chunk_nand(const st - - return ret; - } -+#endif - - /* - * Read a data chunk from NOR flash. -@@ -420,10 +438,12 @@ static int ydrv_read_chunk(struct yaffs_ - } - - switch (ctx->mtd_type) { -+#ifdef linux - case MTD_TYPE_NAND: - return ydrv_read_chunk_nand(ctx, chunk, data, data_len, oob, - oob_len, ecc_result_out, - dev->param.is_yaffs2); -+#endif - case MTD_TYPE_NOR: - case MTD_TYPE_FILE: - return ydrv_read_chunk_nor_or_file(ctx, chunk, data, data_len, -@@ -438,6 +458,7 @@ static int ydrv_read_chunk(struct yaffs_ - /* - * Write a data+OOB chunk to NAND flash. - */ -+#ifdef linux - static int ydrv_write_chunk_nand(const struct ydrv_ctx *ctx, int chunk, - const u8 *data, int data_len, const u8 *oob, - int oob_len, bool is_yaffs2) { -@@ -472,6 +493,7 @@ static int ydrv_write_chunk_nand(const s - - return YAFFS_OK; - } -+#endif - - /* - * Write a data chunk to NOR flash. -@@ -516,9 +538,11 @@ static int ydrv_write_chunk(struct yaffs - } - - switch (ctx->mtd_type) { -+#ifdef linux - case MTD_TYPE_NAND: - return ydrv_write_chunk_nand(ctx, chunk, data, data_len, oob, - oob_len, dev->param.is_yaffs2); -+#endif - case MTD_TYPE_NOR: - case MTD_TYPE_FILE: - return ydrv_write_chunk_nor_or_file(ctx, chunk, data, data_len); From 02481fb1d9045853da17c339e510649b2a97079c Mon Sep 17 00:00:00 2001 From: George Moussalem Date: Thu, 6 Feb 2025 22:05:54 +0400 Subject: [PATCH 20/26] nvmem: layouts: ascii-env handle CRLF while parsing Add validation and support for parsing of name/value pairs with CRLF line endings. Signed-off-by: George Moussalem Link: https://github.com/openwrt/openwrt/pull/17935 Signed-off-by: Christian Marangi --- ...-ascii-env-handle-CRLF-while-parsing.patch | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 target/linux/generic/pending-6.6/809-03-nvmem-layouts-ascii-env-handle-CRLF-while-parsing.patch diff --git a/target/linux/generic/pending-6.6/809-03-nvmem-layouts-ascii-env-handle-CRLF-while-parsing.patch b/target/linux/generic/pending-6.6/809-03-nvmem-layouts-ascii-env-handle-CRLF-while-parsing.patch new file mode 100644 index 0000000000..ab5fc58d0e --- /dev/null +++ b/target/linux/generic/pending-6.6/809-03-nvmem-layouts-ascii-env-handle-CRLF-while-parsing.patch @@ -0,0 +1,58 @@ +From: George Moussalem +Date: Thu, 06 Feb 2025 21:55:28 +0400 +Subject: [PATCH] nvmem: layouts: ascii-env handle CRLF while parsing + +The current driver supports LF line endings only. + +For CRLF-based line endings in the ASCII env, the length of the value of +the variable passed to nvmem_layout_parse_mac_base is 18 bytes instead +of an expected length of 17 causing the parsing to fail. +So, let's add the ability to handle CRLF line endings by adding a +condition to check if the value ends with a '\r' character and replace it +with '\0' to properly parse the mac address. + +Tested on Linksys MX2000, MX5500, and SPNMX56. + +Signed-off-by: George Moussalem +--- +--- a/drivers/nvmem/layouts/ascii-env.c ++++ b/drivers/nvmem/layouts/ascii-env.c +@@ -25,18 +25,20 @@ struct ascii_env_match_data { + static int ascii_env_parse_cells(struct device *dev, struct nvmem_device *nvmem, uint8_t *buf, + size_t data_len, const char delim) + { +- char *var, *value, *eq, *lf; ++ char *var, *value, *eq, *lf, *cr; + char *data = buf; ++ uint incr = 0; + + /* + * Warning the inner loop take care of replacing '\n' + * with '\0', hence we can use strlen on value. + */ + for (var = data; var < data + data_len && *var; +- var = value + strlen(value) + 1) { ++ var = value + strlen(value) + incr) { + struct nvmem_cell_info info = {}; + struct device_node *child; + const char *label; ++ incr = 0; + + eq = strchr(var, delim); + if (!eq) +@@ -49,6 +51,15 @@ static int ascii_env_parse_cells(struct + if (!lf) + break; + *lf = '\0'; ++ incr++; ++ ++ /* For CRLF based env, replace '\r' with '\0' too to use strlen ++ * for value, and increment var by one in loop for next variable */ ++ cr = strchr(value, '\r'); ++ if (cr) { ++ *cr = '\0'; ++ incr++; ++ } + + info.name = devm_kstrdup(dev, var, GFP_KERNEL); + if (!info.name) From 208288ff6c8511b0191e5432c509ea5f01f0593e Mon Sep 17 00:00:00 2001 From: Jack Sun Date: Sun, 2 Feb 2025 10:48:30 +0800 Subject: [PATCH 21/26] tools/mtools: update to 4.0.47 Release Notes: https://lists.gnu.org/archive/html/info-gnu/2025-01/msg00010.html Signed-off-by: Jack Sun Link: https://github.com/openwrt/openwrt/pull/17829 Signed-off-by: Christian Marangi --- tools/mtools/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mtools/Makefile b/tools/mtools/Makefile index b810918b98..d270792c06 100644 --- a/tools/mtools/Makefile +++ b/tools/mtools/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mtools -PKG_VERSION:=4.0.43 +PKG_VERSION:=4.0.44 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@GNU/$(PKG_NAME) -PKG_HASH:=541e179665dc4e272b9602f2074243591a157da89cc47064da8c5829dbd2b339 +PKG_HASH:=37dc4df022533c3d4b2ec1c78973c27c7e8b585374c2d46ab64c6a3db31eddb8 HOST_BUILD_PARALLEL:=1 From abd424c3e19df49bf331a5b0d0adbd71ebf14929 Mon Sep 17 00:00:00 2001 From: Jack Sun Date: Sun, 2 Feb 2025 10:46:47 +0800 Subject: [PATCH 22/26] tools/bc: update to 1.08.1 refresh patch: 001-no_doc.patch 002-fix-libmath.patch Changelog included in package. Signed-off-by: Jack Sun Link: https://github.com/openwrt/openwrt/pull/17828 Signed-off-by: Christian Marangi --- tools/bc/Makefile | 6 +++--- tools/bc/patches/001-no_doc.patch | 8 ++++---- tools/bc/patches/002-fix-libmath.patch | 23 +---------------------- 3 files changed, 8 insertions(+), 29 deletions(-) diff --git a/tools/bc/Makefile b/tools/bc/Makefile index 2c29e094e2..f2a19eb266 100644 --- a/tools/bc/Makefile +++ b/tools/bc/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=bc -PKG_VERSION:=1.07.1 +PKG_VERSION:=1.08.1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/bc -PKG_HASH:=62adfca89b0a1c0164c2cdca59ca210c1d44c3ffc46daf9931cf4942664cb02a +PKG_HASH:=515430115b3334c636317503460a0950dff79940aa3259ce2c1aa67c2881d023 PKG_FIXUP := autoreconf PKG_CPE_ID:=cpe:/a:gnu:bc diff --git a/tools/bc/patches/001-no_doc.patch b/tools/bc/patches/001-no_doc.patch index 119f111f49..0768e626e8 100644 --- a/tools/bc/patches/001-no_doc.patch +++ b/tools/bc/patches/001-no_doc.patch @@ -7,15 +7,15 @@ +SUBDIRS = lib bc dc MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in \ - stamp-h $(distdir).tar.gz h/number.h depcomp missing \ + stamp-h $(distdir).tar.gz h/number.h depcomp missing --- a/Makefile.in +++ b/Makefile.in -@@ -288,7 +288,7 @@ target_alias = @target_alias@ +@@ -305,7 +305,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = lib bc dc doc +SUBDIRS = lib bc dc MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in \ - stamp-h $(distdir).tar.gz h/number.h depcomp missing \ - bc/libmath.h + stamp-h $(distdir).tar.gz h/number.h depcomp missing + diff --git a/tools/bc/patches/002-fix-libmath.patch b/tools/bc/patches/002-fix-libmath.patch index f2212f0953..2ec74e55ba 100644 --- a/tools/bc/patches/002-fix-libmath.patch +++ b/tools/bc/patches/002-fix-libmath.patch @@ -1,27 +1,6 @@ ---- a/bc/fix-libmath_h -+++ b/bc/fix-libmath_h -@@ -1,9 +1,9 @@ --ed libmath.h < Date: Sun, 2 Feb 2025 10:44:04 +0800 Subject: [PATCH 23/26] tools/automake: bump to 1.17 refresh patch: 000-relocatable.patch 100-aclocal-skip-not-existing-directories.patch 101-do-not-require-files.patch 200-other-V-values-for-verbosity.patch Announcement:https://lists.gnu.org/archive/html/info-gnu/2021-01/msg00010.html Signed-off-by: Jack Sun Link: https://github.com/openwrt/openwrt/pull/17827 Signed-off-by: Christian Marangi --- tools/automake/Makefile | 8 ++++---- tools/automake/patches/000-relocatable.patch | 12 +++++++----- .../100-aclocal-skip-not-existing-directories.patch | 2 +- .../automake/patches/101-do-not-require-files.patch | 6 +++--- .../patches/200-other-V-values-for-verbosity.patch | 4 ++-- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/tools/automake/Makefile b/tools/automake/Makefile index 7f129c1d83..dddc0a148f 100644 --- a/tools/automake/Makefile +++ b/tools/automake/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=automake PKG_CPE_ID:=cpe:/a:gnu:automake -PKG_VERSION:=1.16.5 +PKG_VERSION:=1.17 PKG_API_VERSION:=$(word 2,$(subst ., ,$(PKG_VERSION))) -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/automake -PKG_HASH:=07bd24ad08a64bc17250ce09ec56e921d6343903943e99ccf63bbf0705e34605 +PKG_HASH:=8920c1fc411e13b90bf704ef9db6f29d540e76d232cb3b2c9f4dc4cc599bd990 include $(INCLUDE_DIR)/host-build.mk @@ -21,7 +21,7 @@ HOST_CONFIGURE_ARGS += \ --disable-silent-rules HOST_CONFIGURE_VARS += \ - PERL="/usr/bin/env perl" \ + PERL="$(shell command -v perl)" \ am_cv_prog_PERL_ithreads=no define Host/Configure diff --git a/tools/automake/patches/000-relocatable.patch b/tools/automake/patches/000-relocatable.patch index 0b61eaeb45..5dcda2829e 100644 --- a/tools/automake/patches/000-relocatable.patch +++ b/tools/automake/patches/000-relocatable.patch @@ -11,7 +11,7 @@ # We need at least this version for CLONE support. --- a/bin/aclocal.in +++ b/bin/aclocal.in -@@ -23,9 +23,11 @@ use 5.006; +@@ -23,10 +23,12 @@ use 5.006; use strict; use warnings FATAL => 'all'; @@ -20,21 +20,23 @@ BEGIN { - unshift (@INC, '@datadir@/@PACKAGE@-@APIVERSION@') +- unless $ENV{AUTOMAKE_UNINSTALLED}; + unshift (@INC, ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/@PACKAGE@-@APIVERSION@' : '@datadir@/@PACKAGE@-@APIVERSION@')) - unless $ENV{AUTOMAKE_UNINSTALLED}; ++ unless $ENV{AUTOMAKE_UNINSTALLED}; } + use File::Basename; @@ -65,8 +67,8 @@ $perl_threads = 0; - # ACLOCAL_PATH environment variable, and reset with the '--system-acdir' - # option. + # --aclocal-path option/ACLOCAL_PATH environment variable, and reset + # with the '--system-acdir' option. my @user_includes = (); -my @automake_includes = ('@datadir@/aclocal-' . $APIVERSION); -my @system_includes = ('@datadir@/aclocal'); +my @automake_includes = ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . "/share/aclocal-$APIVERSION" : "@datadir@/aclocal-$APIVERSION"); +my @system_includes = ($ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/aclocal' : '@datadir@/aclocal'); + my $aclocal_path = ''; # Whether we should copy M4 file in $user_includes[0]. - my $install = 0; --- a/bin/automake.in +++ b/bin/automake.in @@ -26,9 +26,11 @@ use 5.006; diff --git a/tools/automake/patches/100-aclocal-skip-not-existing-directories.patch b/tools/automake/patches/100-aclocal-skip-not-existing-directories.patch index a0d04e21e5..6fa23c49e8 100644 --- a/tools/automake/patches/100-aclocal-skip-not-existing-directories.patch +++ b/tools/automake/patches/100-aclocal-skip-not-existing-directories.patch @@ -1,6 +1,6 @@ --- a/bin/aclocal.in +++ b/bin/aclocal.in -@@ -371,6 +371,12 @@ sub scan_m4_dirs ($$@) +@@ -372,6 +372,12 @@ sub scan_m4_dirs ($$@) foreach my $m4dir (@dirlist) { diff --git a/tools/automake/patches/101-do-not-require-files.patch b/tools/automake/patches/101-do-not-require-files.patch index 3a8c9fcb47..26847bc680 100644 --- a/tools/automake/patches/101-do-not-require-files.patch +++ b/tools/automake/patches/101-do-not-require-files.patch @@ -1,6 +1,6 @@ --- a/bin/automake.in +++ b/bin/automake.in -@@ -4513,7 +4513,7 @@ sub handle_gettext () +@@ -4552,7 +4552,7 @@ sub handle_gettext () && grep ($_ eq 'intl', @subdirs)); } @@ -9,7 +9,7 @@ } # Emit makefile footer. -@@ -5641,7 +5641,7 @@ sub check_gnu_standards () +@@ -5677,7 +5677,7 @@ sub check_gnu_standards () # otherwise require non-.md. my $required = (! -f $file && -f "$file.md") ? "$file.md" : $file; @@ -18,7 +18,7 @@ } # Accept one of these three licenses; default to COPYING. -@@ -5655,7 +5655,7 @@ sub check_gnu_standards () +@@ -5691,7 +5691,7 @@ sub check_gnu_standards () last; } } diff --git a/tools/automake/patches/200-other-V-values-for-verbosity.patch b/tools/automake/patches/200-other-V-values-for-verbosity.patch index 1ea9d38b0e..8a5a2d31bd 100644 --- a/tools/automake/patches/200-other-V-values-for-verbosity.patch +++ b/tools/automake/patches/200-other-V-values-for-verbosity.patch @@ -9,8 +9,8 @@ Subject: [PATCH] Allow other V values for verbosity --- a/m4/silent.m4 +++ b/m4/silent.m4 -@@ -43,7 +43,7 @@ else - fi]) +@@ -53,7 +53,7 @@ case $enable_silent_rules in @%:@ ((( + esac if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. - AM_V='$(V)' From e0f5ce9746323f0c38e49594411dbeb5394e2f15 Mon Sep 17 00:00:00 2001 From: Jack Sun Date: Sun, 2 Feb 2025 10:38:26 +0800 Subject: [PATCH 24/26] tools/autoconf: bump to 2.72 refresh patch:000-relocatable.patch Announcement:https://lists.gnu.org/archive/html/autotools-announce/2023-12/msg00003.html Signed-off-by: Jack Sun Link: https://github.com/openwrt/openwrt/pull/17825 Signed-off-by: Christian Marangi --- tools/autoconf/Makefile | 6 +++--- tools/autoconf/patches/000-relocatable.patch | 22 ++------------------ 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/tools/autoconf/Makefile b/tools/autoconf/Makefile index d933c712b4..1058cf9ac4 100644 --- a/tools/autoconf/Makefile +++ b/tools/autoconf/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=autoconf -PKG_VERSION:=2.71 +PKG_VERSION:=2.72 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/autoconf -PKG_HASH:=431075ad0bf529ef13cb41e9042c542381103e80015686222b8a9d4abef42a1c +PKG_HASH:=ba885c1319578d6c94d46e9b0dceb4014caafe2490e437a0dbca3f270a223f5a include $(INCLUDE_DIR)/host-build.mk diff --git a/tools/autoconf/patches/000-relocatable.patch b/tools/autoconf/patches/000-relocatable.patch index 3961d2264b..bc8a2d1b7c 100644 --- a/tools/autoconf/patches/000-relocatable.patch +++ b/tools/autoconf/patches/000-relocatable.patch @@ -58,7 +58,7 @@ # Some non-GNU m4's don't reject the --help option, so give them /dev/null. fatal "need GNU m4 1.4 or later: $m4" if system "$m4 --help &1 | grep reload-state >/dev/null"; -@@ -272,6 +276,12 @@ sub load_configuration ($) +@@ -322,6 +326,12 @@ sub load_configuration ($) my @words = shellwords ($_); my $type = shift @words; @@ -88,7 +88,7 @@ unshift @INC, $pkgdatadir; $buildauxdir = $ENV{'autom4te_buildauxdir'} || $pkgdatadir . '/build-aux'; -@@ -117,9 +120,9 @@ Written by David J. MacKenzie and Akim D +@@ -116,9 +119,9 @@ Written by David J. MacKenzie and Akim D "; # Lib files. @@ -175,21 +175,3 @@ unshift @INC, $pkgdatadir; # Override SHELL. On DJGPP SHELL may not be set to a shell ---- a/bin/autoconf.as -+++ b/bin/autoconf.as -@@ -89,8 +89,13 @@ exit_missing_arg=' - # restore font-lock: ' - - # Variables. --: ${AUTOM4TE='@bindir@/@autom4te-name@'} --: ${trailer_m4='@pkgdatadir@/autoconf/trailer.m4'} -+if test -n "$STAGING_DIR_HOST"; then -+ : ${AUTOM4TE="$STAGING_DIR_HOST/bin/@autom4te-name@"} -+ : ${trailer_m4="$STAGING_DIR_HOST/share/autoconf/autoconf/trailer.m4"} -+else -+ : ${AUTOM4TE='@bindir@/@autom4te-name@'} -+ : ${trailer_m4='@pkgdatadir@/autoconf/trailer.m4'} -+fi - autom4te_options= - outfile= - verbose=false From bbb3b985b036193d814e9742d07143330d19a71a Mon Sep 17 00:00:00 2001 From: Jack Sun Date: Sun, 2 Feb 2025 10:40:32 +0800 Subject: [PATCH 25/26] tools/autoconf-archive: bump to 2024.10.16 Changelog included in package. Signed-off-by: Jack Sun Link: https://github.com/openwrt/openwrt/pull/17826 Signed-off-by: Christian Marangi --- tools/autoconf-archive/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/autoconf-archive/Makefile b/tools/autoconf-archive/Makefile index a4ab423779..a0c75c1dca 100644 --- a/tools/autoconf-archive/Makefile +++ b/tools/autoconf-archive/Makefile @@ -1,11 +1,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=autoconf-archive -PKG_VERSION:=2023.02.20 +PKG_VERSION:=2024.10.16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/autoconf-archive -PKG_HASH:=71d4048479ae28f1f5794619c3d72df9c01df49b1c628ef85fde37596dc31a33 +PKG_HASH:=7bcd5d001916f3a50ed7436f4f700e3d2b1bade3ed803219c592d62502a57363 include $(INCLUDE_DIR)/host-build.mk From edfe58981193a424dfb2e636d7b97a88fff06743 Mon Sep 17 00:00:00 2001 From: Michael Trinidad Date: Sun, 16 Feb 2025 18:44:03 -0500 Subject: [PATCH 26/26] mwlwifi: update to version 10.4.11-20250206 The fixes are only for the WRT1900X and WRT1200AC. It contains: Deletes the driver's ability to modify the debit table. Remove skb_get(done_skb) in txdone Reworking ISR clean code Napi replaces tasklet Add rx_decrypt feature Signed-off-by: Michael Trinidad Link: https://github.com/openwrt/openwrt/pull/17997 Signed-off-by: Christian Marangi --- package/kernel/mwlwifi/Makefile | 8 +- ...memcpy-in-mwl_fwcmd_get_fw_core_dump.patch | 2 +- ...-PTR_ERR-in-pcie_bf_mimo_ctrl_decode.patch | 2 +- ...Use-zu-and-zd-for-ssize_t-and-size_t.patch | 2 +- ...CIe-DT-node-null-pointer-dereference.patch | 31 ------ .../mwlwifi/patches/020-mac80211_update.patch | 96 +++++++++---------- 6 files changed, 55 insertions(+), 86 deletions(-) delete mode 100644 package/kernel/mwlwifi/patches/010-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch diff --git a/package/kernel/mwlwifi/Makefile b/package/kernel/mwlwifi/Makefile index 3f2d5e0949..07c3acc5f9 100644 --- a/package/kernel/mwlwifi/Makefile +++ b/package/kernel/mwlwifi/Makefile @@ -8,16 +8,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mwlwifi -PKG_RELEASE=2 +PKG_RELEASE=1 PKG_LICENSE:=ISC PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/kaloz/mwlwifi PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2024-04-19 -PKG_SOURCE_VERSION:=a737d348ef4fe00434b2bc44b2b6a68ea833d95b -PKG_MIRROR_HASH:=d55f69c2fa48d02ba535b72b108fc77f5f13a52b29130a631489a053f1670d2c +PKG_SOURCE_DATE:=2025-02-06 +PKG_SOURCE_VERSION:=db97edf20fadea2617805006f5230665fadc6a8c +PKG_MIRROR_HASH:=b5464cf6d57d87f6ce5f13bd2320c7e7e671a3152a74f4ef004382f898b89ecf PKG_MAINTAINER:=Imre Kaloz PKG_BUILD_PARALLEL:=1 diff --git a/package/kernel/mwlwifi/patches/001-Simplify-coredump-memcpy-in-mwl_fwcmd_get_fw_core_dump.patch b/package/kernel/mwlwifi/patches/001-Simplify-coredump-memcpy-in-mwl_fwcmd_get_fw_core_dump.patch index 4b0feeb17e..20e1cce382 100644 --- a/package/kernel/mwlwifi/patches/001-Simplify-coredump-memcpy-in-mwl_fwcmd_get_fw_core_dump.patch +++ b/package/kernel/mwlwifi/patches/001-Simplify-coredump-memcpy-in-mwl_fwcmd_get_fw_core_dump.patch @@ -20,7 +20,7 @@ Signed-off-by: Christian Marangi --- a/hif/fwcmd.c +++ b/hif/fwcmd.c -@@ -3622,11 +3622,7 @@ int mwl_fwcmd_get_fw_core_dump(struct ie +@@ -3624,11 +3624,7 @@ int mwl_fwcmd_get_fw_core_dump(struct ie core_dump->context = pcmd->cmd_data.coredump.context; core_dump->size_kb = pcmd->cmd_data.coredump.size_kb; core_dump->flags = pcmd->cmd_data.coredump.flags; diff --git a/package/kernel/mwlwifi/patches/002-Correctly-use-PTR_ERR-in-pcie_bf_mimo_ctrl_decode.patch b/package/kernel/mwlwifi/patches/002-Correctly-use-PTR_ERR-in-pcie_bf_mimo_ctrl_decode.patch index f204e9fe73..f6c398cf66 100644 --- a/package/kernel/mwlwifi/patches/002-Correctly-use-PTR_ERR-in-pcie_bf_mimo_ctrl_decode.patch +++ b/package/kernel/mwlwifi/patches/002-Correctly-use-PTR_ERR-in-pcie_bf_mimo_ctrl_decode.patch @@ -19,7 +19,7 @@ Signed-off-by: Christian Marangi --- a/hif/pcie/pcie.c +++ b/hif/pcie/pcie.c -@@ -1466,8 +1466,8 @@ static void pcie_bf_mimo_ctrl_decode(str +@@ -1449,8 +1449,8 @@ static void pcie_bf_mimo_ctrl_decode(str &fp_data->f_pos); filp_close(fp_data, current->files); } else { diff --git a/package/kernel/mwlwifi/patches/003-Use-zu-and-zd-for-ssize_t-and-size_t.patch b/package/kernel/mwlwifi/patches/003-Use-zu-and-zd-for-ssize_t-and-size_t.patch index d615e13380..816fb222c0 100644 --- a/package/kernel/mwlwifi/patches/003-Use-zu-and-zd-for-ssize_t-and-size_t.patch +++ b/package/kernel/mwlwifi/patches/003-Use-zu-and-zd-for-ssize_t-and-size_t.patch @@ -14,7 +14,7 @@ Signed-off-by: Christian Marangi --- a/debugfs.c +++ b/debugfs.c -@@ -1342,7 +1342,7 @@ done: +@@ -1394,7 +1394,7 @@ done: priv->reg_value); else len += scnprintf(p + len, size - len, diff --git a/package/kernel/mwlwifi/patches/010-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch b/package/kernel/mwlwifi/patches/010-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch deleted file mode 100644 index f37d2f8171..0000000000 --- a/package/kernel/mwlwifi/patches/010-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 8e809b241695252e397bf0d7fc5f36e115c38831 Mon Sep 17 00:00:00 2001 -From: Robert Marko -Date: Fri, 5 Mar 2021 11:47:59 +0100 -Subject: [PATCH] mwlwifi: fix PCIe DT node null pointer dereference - -pci_bus_to_OF_node() used to get the PCI bus DT node -returns node if found or NULL if none is found. - -Since the return of pci_bus_to_OF_node() is not checked in -the DT node name print it will cause a null pointer -dereference and crash the kernel. - -So first check whether the node is not NULL and then print. - -Signed-off-by: Robert Marko ---- - hif/pcie/pcie.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/hif/pcie/pcie.c -+++ b/hif/pcie/pcie.c -@@ -685,7 +685,8 @@ static struct device_node *pcie_get_devi - struct device_node *dev_node; - - dev_node = pci_bus_to_OF_node(pcie_priv->pdev->bus); -- wiphy_info(priv->hw->wiphy, "device node: %s\n", dev_node->full_name); -+ if (dev_node) -+ wiphy_info(priv->hw->wiphy, "device node: %s\n", dev_node->full_name); - - return dev_node; - } diff --git a/package/kernel/mwlwifi/patches/020-mac80211_update.patch b/package/kernel/mwlwifi/patches/020-mac80211_update.patch index 1c5d581939..1d4afabb51 100644 --- a/package/kernel/mwlwifi/patches/020-mac80211_update.patch +++ b/package/kernel/mwlwifi/patches/020-mac80211_update.patch @@ -13,7 +13,7 @@ --- a/debugfs.c +++ b/debugfs.c -@@ -498,9 +498,9 @@ static ssize_t mwl_debugfs_vif_read(stru +@@ -550,9 +550,9 @@ static ssize_t mwl_debugfs_vif_read(stru switch (vif->type) { case NL80211_IFTYPE_AP: len += scnprintf(p + len, size - len, "type: ap\n"); @@ -26,7 +26,7 @@ len += scnprintf(p + len, size - len, "ssid: %s\n", ssid); len += scnprintf(p + len, size - len, -@@ -522,8 +522,8 @@ static ssize_t mwl_debugfs_vif_read(stru +@@ -574,8 +574,8 @@ static ssize_t mwl_debugfs_vif_read(stru "type: unknown\n"); break; } @@ -37,7 +37,7 @@ len += scnprintf(p + len, size - len, "channel: %d: width: %d\n", chan_def->chan->hw_value, -@@ -596,18 +596,18 @@ static ssize_t mwl_debugfs_sta_read(stru +@@ -648,18 +648,18 @@ static ssize_t mwl_debugfs_sta_read(stru sta_info->wds ? "true" : "false", sta_info->ba_hist.enable ? "enable" : "disable", sta_info->is_amsdu_allowed ? sta_info->amsdu_ctrl.cap : 0 , @@ -68,7 +68,7 @@ sta->tdls, sta->tdls_initiator, sta->wme, -@@ -1158,7 +1158,7 @@ static ssize_t mwl_debugfs_dfs_radar_wri +@@ -1210,7 +1210,7 @@ static ssize_t mwl_debugfs_dfs_radar_wri struct mwl_priv *priv = (struct mwl_priv *)file->private_data; wiphy_info(priv->hw->wiphy, "simulate radar detected\n"); @@ -127,7 +127,7 @@ a_band = true; else return -EINVAL; -@@ -2090,7 +2094,7 @@ int mwl_fwcmd_set_beacon(struct ieee8021 +@@ -2092,7 +2096,7 @@ int mwl_fwcmd_set_beacon(struct ieee8021 if (mwl_fwcmd_set_wsc_ie(hw, b_inf->ie_wsc_len, b_inf->ie_wsc_ptr)) goto err; @@ -136,7 +136,7 @@ goto err; if (b_inf->cap_info & WLAN_CAPABILITY_SPECTRUM_MGMT) -@@ -2152,38 +2156,38 @@ int mwl_fwcmd_set_new_stn_add(struct iee +@@ -2154,38 +2158,38 @@ int mwl_fwcmd_set_new_stn_add(struct iee ether_addr_copy(pcmd->mac_addr, sta->addr); if (hw->conf.chandef.chan->band == NL80211_BAND_2GHZ) @@ -189,7 +189,7 @@ } pcmd->is_qos_sta = sta->wme; -@@ -2239,38 +2243,38 @@ int mwl_fwcmd_set_new_stn_add_sc4(struct +@@ -2241,38 +2245,38 @@ int mwl_fwcmd_set_new_stn_add_sc4(struct ether_addr_copy(pcmd->mac_addr, sta->addr); if (hw->conf.chandef.chan->band == NL80211_BAND_2GHZ) @@ -242,7 +242,7 @@ } pcmd->is_qos_sta = sta->wme; -@@ -2787,9 +2791,9 @@ int mwl_fwcmd_create_ba(struct ieee80211 +@@ -2789,9 +2793,9 @@ int mwl_fwcmd_create_ba(struct ieee80211 pcmd->ba_info.create_params.flags = cpu_to_le32(ba_flags); pcmd->ba_info.create_params.queue_id = stream->idx; pcmd->ba_info.create_params.param_info = @@ -254,7 +254,7 @@ IEEE80211_HT_AMPDU_PARM_DENSITY); if (direction == BA_FLAG_DIRECTION_UP) { pcmd->ba_info.create_params.reset_seq_no = 0; -@@ -2799,9 +2803,9 @@ int mwl_fwcmd_create_ba(struct ieee80211 +@@ -2801,9 +2805,9 @@ int mwl_fwcmd_create_ba(struct ieee80211 pcmd->ba_info.create_params.current_seq = cpu_to_le16(0); } if (priv->chip_type == MWL8964 && @@ -268,16 +268,16 @@ } --- a/hif/pcie/8864/tx.c +++ b/hif/pcie/8864/tx.c -@@ -490,7 +490,7 @@ static void pcie_non_pfu_tx_done(struct - } else - memmove(dma_data->data - hdrlen, &dma_data->wh, hdrlen); - skb_pull(done_skb, sizeof(*dma_data) - hdrlen); -- ieee80211_tx_status(priv->hw, done_skb); -+ ieee80211_tx_status_skb(priv->hw, done_skb); - dev_kfree_skb_any(done_skb); - done_skb = NULL; - } -@@ -743,7 +743,7 @@ void pcie_8864_tx_xmit(struct ieee80211_ +@@ -478,7 +478,7 @@ static void pcie_non_pfu_tx_done(struct + } else + memmove(dma_data->data - hdrlen, &dma_data->wh, hdrlen); + skb_pull(done_skb, sizeof(*dma_data) - hdrlen); +- ieee80211_tx_status(priv->hw, done_skb); ++ ieee80211_tx_status_skb(priv->hw, done_skb); + next: + tx_hndl = tx_hndl->pnext; + tx_desc = tx_hndl->pdesc; +@@ -730,7 +730,7 @@ void pcie_8864_tx_xmit(struct ieee80211_ index = SYSADPT_TX_WMM_QUEUES - index - 1; txpriority = index; @@ -286,7 +286,7 @@ !(xmitcontrol & EAGLE_TXD_XMITCTRL_USE_MC_RATE) && ieee80211_is_data_qos(wh->frame_control)) { tid = qos & 0xf; -@@ -925,4 +925,4 @@ void pcie_8864_tx_del_sta_amsdu_pkts(str +@@ -912,4 +912,4 @@ void pcie_8864_tx_del_sta_amsdu_pkts(str } } spin_unlock_bh(&sta_info->amsdu_lock); @@ -313,7 +313,7 @@ bypass_ack: if (++tx_done_tail >= MAX_TX_RING_DONE_SIZE) -@@ -596,13 +596,13 @@ void pcie_tx_xmit_ndp(struct ieee80211_h +@@ -593,13 +593,13 @@ void pcie_tx_xmit_ndp(struct ieee80211_h ack_skb = skb_copy(skb, GFP_ATOMIC); ack_info = IEEE80211_SKB_CB(ack_skb); pcie_tx_prepare_info(priv, 0, ack_info); @@ -340,16 +340,16 @@ pcie_priv->txbd_ring_size); for (num = 0; num < PCIE_MAX_TXRX_BD; num++) { -@@ -444,7 +444,7 @@ static void pcie_pfu_tx_done(struct mwl_ - } else - memmove(dma_data->data - hdrlen, &dma_data->wh, hdrlen); - skb_pull(done_skb, sizeof(*pfu_dma) - hdrlen); -- ieee80211_tx_status(priv->hw, done_skb); -+ ieee80211_tx_status_skb(priv->hw, done_skb); - } +@@ -431,7 +431,7 @@ static void pcie_pfu_tx_done(struct mwl_ + } else + memmove(dma_data->data - hdrlen, &dma_data->wh, hdrlen); + skb_pull(done_skb, sizeof(*pfu_dma) - hdrlen); +- ieee80211_tx_status(priv->hw, done_skb); ++ ieee80211_tx_status_skb(priv->hw, done_skb); } next: -@@ -694,7 +694,7 @@ void pcie_8997_tx_xmit(struct ieee80211_ + memset(data_buf, 0, sizeof(*data_buf)); +@@ -682,7 +682,7 @@ void pcie_8997_tx_xmit(struct ieee80211_ index = SYSADPT_TX_WMM_QUEUES - index - 1; txpriority = index; @@ -358,7 +358,7 @@ !(xmitcontrol & EAGLE_TXD_XMITCTRL_USE_MC_RATE) && ieee80211_is_data_qos(wh->frame_control)) { tid = qos & 0xf; -@@ -875,4 +875,4 @@ void pcie_8997_tx_del_sta_amsdu_pkts(str +@@ -863,4 +863,4 @@ void pcie_8997_tx_del_sta_amsdu_pkts(str } } spin_unlock_bh(&sta_info->amsdu_lock); @@ -376,7 +376,7 @@ { mwl_fwcmd_radio_disable(hw); -@@ -368,15 +368,15 @@ static void mwl_mac80211_bss_info_change +@@ -390,15 +390,15 @@ static void mwl_mac80211_bss_info_change } } @@ -395,7 +395,7 @@ { struct mwl_priv *priv = hw->priv; struct mwl_vif *mwl_vif; -@@ -426,8 +426,8 @@ static void mwl_mac80211_bss_info_change +@@ -448,8 +448,8 @@ static void mwl_mac80211_bss_info_change if (changed & (BSS_CHANGED_BEACON_INT | BSS_CHANGED_BEACON)) { struct sk_buff *skb; @@ -406,7 +406,7 @@ (!info->hidden_ssid)) { if (mwl_vif->broadcast_ssid != true) { mwl_fwcmd_broadcast_ssid_enable(hw, vif, true); -@@ -441,7 +441,7 @@ static void mwl_mac80211_bss_info_change +@@ -463,7 +463,7 @@ static void mwl_mac80211_bss_info_change } if (!mwl_vif->set_beacon) { @@ -415,7 +415,7 @@ if (skb) { mwl_fwcmd_set_beacon(hw, vif, skb->data, skb->len); -@@ -458,7 +458,7 @@ static void mwl_mac80211_bss_info_change +@@ -480,7 +480,7 @@ static void mwl_mac80211_bss_info_change static void mwl_mac80211_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_bss_conf *info, @@ -424,7 +424,7 @@ { switch (vif->type) { case NL80211_IFTYPE_AP: -@@ -583,10 +583,10 @@ static int mwl_mac80211_sta_add(struct i +@@ -605,10 +605,10 @@ static int mwl_mac80211_sta_add(struct i if (vif->type == NL80211_IFTYPE_MESH_POINT) sta_info->is_mesh_node = true; @@ -437,7 +437,7 @@ sta_info->amsdu_ctrl.cap = MWL_AMSDU_SIZE_8K; sta_info->amsdu_ctrl.amsdu_allow_size = SYSADPT_AMSDU_8K_MAX_SIZE; } -@@ -670,7 +670,7 @@ static int mwl_mac80211_sta_remove(struc +@@ -692,7 +692,7 @@ static int mwl_mac80211_sta_remove(struc static int mwl_mac80211_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif, @@ -446,7 +446,7 @@ const struct ieee80211_tx_queue_params *params) { struct mwl_priv *priv = hw->priv; -@@ -934,4 +934,9 @@ const struct ieee80211_ops mwl_mac80211_ +@@ -956,4 +956,9 @@ const struct ieee80211_ops mwl_mac80211_ .pre_channel_switch = mwl_mac80211_chnl_switch, .sw_scan_start = mwl_mac80211_sw_scan_start, .sw_scan_complete = mwl_mac80211_sw_scan_complete, @@ -502,16 +502,7 @@ case TX_RATE_FORMAT_LEGACY: --- a/hif/pcie/pcie.c +++ b/hif/pcie/pcie.c -@@ -546,7 +546,7 @@ static irqreturn_t pcie_isr_8864(struct - - if (int_status & MACREG_A2HRIC_BIT_RADAR_DETECT) { - wiphy_info(hw->wiphy, "radar detected by firmware\n"); -- ieee80211_radar_detected(hw); -+ ieee80211_radar_detected(hw, NULL); - } - - if (int_status & MACREG_A2HRIC_BIT_CHAN_SWITCH) ieee80211_queue_work(hw, &priv->chnl_switch_handle); -@@ -593,7 +593,7 @@ static irqreturn_t pcie_isr_8997(struct +@@ -533,7 +533,7 @@ static irqreturn_t pcie_isr_8864(struct if (int_status & MACREG_A2HRIC_BIT_RADAR_DETECT) { wiphy_info(hw->wiphy, "radar detected by firmware\n"); @@ -520,7 +511,16 @@ } if (int_status & MACREG_A2HRIC_BIT_CHAN_SWITCH) -@@ -1071,7 +1071,7 @@ static irqreturn_t pcie_isr_ndp(struct i +@@ -575,7 +575,7 @@ static irqreturn_t pcie_isr_8997(struct + + if (int_status & MACREG_A2HRIC_BIT_RADAR_DETECT) { + wiphy_info(hw->wiphy, "radar detected by firmware\n"); +- ieee80211_radar_detected(hw); ++ ieee80211_radar_detected(hw, NULL); + } + + if (int_status & MACREG_A2HRIC_BIT_CHAN_SWITCH) +@@ -1053,7 +1053,7 @@ static irqreturn_t pcie_isr_ndp(struct i if (int_status & MACREG_A2HRIC_NEWDP_DFS) { wiphy_info(hw->wiphy, "radar detected by firmware\n");