From 456b9029d764e69f390ee26bca24883b12eb83c2 Mon Sep 17 00:00:00 2001 From: Roland Barenbrug Date: Wed, 29 Jun 2022 13:09:25 +0200 Subject: [PATCH 01/54] ltq-vdsl-app: Fix counter overflow resulting in negative values The re-transmit counters can overflow the 32 bit representation resulting in negative values being displayed. Background being that the numbers are treated at some point as signed INT rather than unsigned INT. Change the counters from 32 bit to 64 bit, should provide sufficient room to avoid any overflow. Not the nicest solution but it works Fixes: #10077 Signed-off-by: Roland Barenbrug Acked-by: Martin Blumenstingl --- package/network/config/ltq-vdsl-app/src/src/dsl_cpe_ubus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/network/config/ltq-vdsl-app/src/src/dsl_cpe_ubus.c b/package/network/config/ltq-vdsl-app/src/src/dsl_cpe_ubus.c index 93eecaf71d..61ac7708ba 100644 --- a/package/network/config/ltq-vdsl-app/src/src/dsl_cpe_ubus.c +++ b/package/network/config/ltq-vdsl-app/src/src/dsl_cpe_ubus.c @@ -146,7 +146,7 @@ static inline void m_bool(const char *id, bool value) { } static inline void m_u32(const char *id, uint32_t value) { - blobmsg_add_u32(&b, id, value); + blobmsg_add_u64(&b, id, value); } static inline void m_str(const char *id, const char *value) { From 8019410f566377d958e2bd23673d168742ab2f44 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Tue, 19 Jul 2022 15:24:59 +0200 Subject: [PATCH 02/54] x86: add missing Lex 3I380NX network detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Lex 3I380NX industrial PC has 4 ethernet controllers on board which need pmc_plt_clk0 - 3 to function, add it to the critclk_systems DMI table, so that drivers/clk/x86/clk-pmc-atom.c will mark the clocks as CLK_CRITICAL and they will not get turned off. This commit is nearly redundant to 3d0818f5eba8 ("platform/x86: pmc_atom: Add Lex 3I380D industrial PC to critclk_systems DMI table") but for all Lex Baytrail devices. The original vendor firmware is only available using the WaybackMachine: http://www.lex.com.tw/products/3I380NX.html Signed-off-by: Michael Schöne Signed-off-by: Paul Spooren (Hans broader version for more Lex Baytrail systems, v5.15) Signed-off-by: Christian Lamparter --- ..._atom-Add-Lex-3I380NX-industrial-PC-.patch | 52 +++++++++++++++++++ ..._atom-Add-Lex-3I380NX-industrial-PC-.patch | 52 +++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 target/linux/x86/patches-5.10/113-v5.21-platform-x86-pmc_atom-Add-Lex-3I380NX-industrial-PC-.patch create mode 100644 target/linux/x86/patches-5.15/113-v5.21-platform-x86-pmc_atom-Add-Lex-3I380NX-industrial-PC-.patch diff --git a/target/linux/x86/patches-5.10/113-v5.21-platform-x86-pmc_atom-Add-Lex-3I380NX-industrial-PC-.patch b/target/linux/x86/patches-5.10/113-v5.21-platform-x86-pmc_atom-Add-Lex-3I380NX-industrial-PC-.patch new file mode 100644 index 0000000000..3cff37c918 --- /dev/null +++ b/target/linux/x86/patches-5.10/113-v5.21-platform-x86-pmc_atom-Add-Lex-3I380NX-industrial-PC-.patch @@ -0,0 +1,52 @@ +From: Hans de Goede +Date: Thu, 28 Jul 2022 20:06:35 +0200 +Subject: platform/x86: pmc_atom: Match all Lex BayTrail boards with + critclk_systems DMI table + +The critclk_systems[] DMI match table already contains 2 Lex BayTrail +boards and patches were just submitted to add 3 more entries for the +following models: 3I380NX, 3I380A, 3I380CW. + +Looking at: https://www.lex.com.tw/products/embedded-ipc-board/ +we can see that Lex BayTrail makes many embedded boards with +multiple ethernet boards and none of their products are battery +powered so we don't need to worry (too much) about power consumption +when suspended. + +Add a new DMI match which simply matches all Lex BayTrail boards and drop +the 2 existing board specific quirks. + +Reported-by: Michael Schöne +Reported-by: Paul Spooren +Reported-by: Matwey V. Kornilov +Signed-off-by: Hans de Goede +--- +--- a/drivers/platform/x86/pmc_atom.c ++++ b/drivers/platform/x86/pmc_atom.c +@@ -376,19 +376,15 @@ + }, + }, + { +- /* pmc_plt_clk0 - 3 are used for the 4 ethernet controllers */ +- .ident = "Lex 3I380D", ++ /* ++ * Lex System / Lex Computech Co. makes a lot of Bay Trail ++ * based embedded boards which often come with multiple ++ * ethernet controllers using multiple pmc_plt_clks. See: ++ * https://www.lex.com.tw/products/embedded-ipc-board/ ++ */ ++ .ident = "Lex BayTrail", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Lex BayTrail"), +- DMI_MATCH(DMI_PRODUCT_NAME, "3I380D"), +- }, +- }, +- { +- /* pmc_plt_clk* - are used for ethernet controllers */ +- .ident = "Lex 2I385SW", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Lex BayTrail"), +- DMI_MATCH(DMI_PRODUCT_NAME, "2I385SW"), + }, + }, + { diff --git a/target/linux/x86/patches-5.15/113-v5.21-platform-x86-pmc_atom-Add-Lex-3I380NX-industrial-PC-.patch b/target/linux/x86/patches-5.15/113-v5.21-platform-x86-pmc_atom-Add-Lex-3I380NX-industrial-PC-.patch new file mode 100644 index 0000000000..3cff37c918 --- /dev/null +++ b/target/linux/x86/patches-5.15/113-v5.21-platform-x86-pmc_atom-Add-Lex-3I380NX-industrial-PC-.patch @@ -0,0 +1,52 @@ +From: Hans de Goede +Date: Thu, 28 Jul 2022 20:06:35 +0200 +Subject: platform/x86: pmc_atom: Match all Lex BayTrail boards with + critclk_systems DMI table + +The critclk_systems[] DMI match table already contains 2 Lex BayTrail +boards and patches were just submitted to add 3 more entries for the +following models: 3I380NX, 3I380A, 3I380CW. + +Looking at: https://www.lex.com.tw/products/embedded-ipc-board/ +we can see that Lex BayTrail makes many embedded boards with +multiple ethernet boards and none of their products are battery +powered so we don't need to worry (too much) about power consumption +when suspended. + +Add a new DMI match which simply matches all Lex BayTrail boards and drop +the 2 existing board specific quirks. + +Reported-by: Michael Schöne +Reported-by: Paul Spooren +Reported-by: Matwey V. Kornilov +Signed-off-by: Hans de Goede +--- +--- a/drivers/platform/x86/pmc_atom.c ++++ b/drivers/platform/x86/pmc_atom.c +@@ -376,19 +376,15 @@ + }, + }, + { +- /* pmc_plt_clk0 - 3 are used for the 4 ethernet controllers */ +- .ident = "Lex 3I380D", ++ /* ++ * Lex System / Lex Computech Co. makes a lot of Bay Trail ++ * based embedded boards which often come with multiple ++ * ethernet controllers using multiple pmc_plt_clks. See: ++ * https://www.lex.com.tw/products/embedded-ipc-board/ ++ */ ++ .ident = "Lex BayTrail", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Lex BayTrail"), +- DMI_MATCH(DMI_PRODUCT_NAME, "3I380D"), +- }, +- }, +- { +- /* pmc_plt_clk* - are used for ethernet controllers */ +- .ident = "Lex 2I385SW", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Lex BayTrail"), +- DMI_MATCH(DMI_PRODUCT_NAME, "2I385SW"), + }, + }, + { From 3678881773c6257f0db8d343aaa903f54fd695f5 Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Fri, 5 Aug 2022 11:35:08 +0200 Subject: [PATCH 03/54] kernel: usb-serial-cp210x: @GPIO_SUPPORT all other drivers depend on @GPIO_SUPPORT rather than forcing CONFIG_GPIOLIB=y. (I wonder what would happen if someone decides to try UML with USBIP?) Signed-off-by: Christian Lamparter --- package/kernel/linux/modules/usb.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk index 19c44f805b..8f0eac7522 100644 --- a/package/kernel/linux/modules/usb.mk +++ b/package/kernel/linux/modules/usb.mk @@ -1541,8 +1541,8 @@ $(eval $(call KernelPackage,usb-hid)) define KernelPackage/usb-hid-cp2112 SUBMENU:=$(USB_MENU) TITLE:=Silicon Labs CP2112 HID USB to SMBus Master Bridge - KCONFIG:=CONFIG_GPIOLIB=y CONFIG_HID_CP2112 - DEPENDS:=+kmod-usb-hid +kmod-i2c-core + KCONFIG:=CONFIG_HID_CP2112 + DEPENDS:=@GPIO_SUPPORT +kmod-usb-hid +kmod-i2c-core FILES:=$(LINUX_DIR)/drivers/hid/hid-cp2112.ko AUTOLOAD:=$(call AutoProbe,hid-cp2112) endef From 2b03f207e038ec2ba8f57f55cc93e211af2e1a75 Mon Sep 17 00:00:00 2001 From: Leo Soares Date: Sun, 31 Jul 2022 15:21:42 +0100 Subject: [PATCH 04/54] kernel: add kmod-usb-hid-mcp2221 "The MCP2221 is a USB-to-UART/I2C serial converter which enables USB connectivity in applications that have a UART and I2C interfaces." Signed-off-by: Leo Soares (replaced GPIOLIB KConfig with @GPIO_SUPPORT) Signed-off-by: Christian Lamparter --- package/kernel/linux/modules/usb.mk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk index 8f0eac7522..84097ac34a 100644 --- a/package/kernel/linux/modules/usb.mk +++ b/package/kernel/linux/modules/usb.mk @@ -1555,6 +1555,23 @@ endef $(eval $(call KernelPackage,usb-hid-cp2112)) +define KernelPackage/usb-hid-mcp2221 + SUBMENU:=$(USB_MENU) + TITLE:=Microchip USB 2.0 to I2C/UART Protocol Converter with GPIO + KCONFIG:=CONFIG_HID_MCP2221 + DEPENDS:=@GPIO_SUPPORT +kmod-usb-hid +kmod-i2c-core + FILES:=$(LINUX_DIR)/drivers/hid/hid-mcp2221.ko + AUTOLOAD:=$(call AutoProbe,hid-mcp2221) +endef + +define KernelPackage/usb-hid-mcp2221/description + HID device driver which registers as an i2c adapter and gpiochip to expose + these functions of the MCP2221. +endef + +$(eval $(call KernelPackage,usb-hid-mcp2221)) + + define KernelPackage/usb-yealink TITLE:=USB Yealink VOIP phone DEPENDS:=+kmod-input-evdev From 0bfe1cfbb13c58d909951cab9fac8910ccbe74f3 Mon Sep 17 00:00:00 2001 From: Wenli Looi Date: Mon, 1 Aug 2022 03:22:32 +0000 Subject: [PATCH 05/54] ramips: support fw_printenv for Netgear WAX202 Config partition contains uboot env for the first 0x20000 bytes. The rest of the partition contains other data including the device MAC address and the password printed on the label. Signed-off-by: Wenli Looi --- package/boot/uboot-envtools/files/ramips | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 738d983af2..13d9c6223a 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -47,7 +47,8 @@ zte,mf283plus) h3c,tx1800-plus|\ h3c,tx1801-plus|\ h3c,tx1806|\ -jcg,q20) +jcg,q20|\ +netgear,wax202) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000" ;; hootoo,ht-tm05|\ From 4cccea02a60aee0dd77c4db35672c92e2fe384a1 Mon Sep 17 00:00:00 2001 From: Wenli Looi Date: Mon, 1 Aug 2022 03:23:22 +0000 Subject: [PATCH 06/54] ramips: fix fw_setsys This change was included in the original pull request but later omitted for some reason: https://github.com/openwrt/openwrt/pull/4936 Signed-off-by: Wenli Looi --- package/boot/uboot-envtools/files/ramips | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 13d9c6223a..9d19398b36 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -95,6 +95,6 @@ xiaomi,mi-router-cr6609) esac config_load ubootenv -config_foreach ubootenv_add_app_config ubootenv +config_foreach ubootenv_add_app_config exit 0 From 35a0f2b00c44a43ad087327f0cbdb1c9c5e60c49 Mon Sep 17 00:00:00 2001 From: Leo Soares Date: Sun, 31 Jul 2022 15:28:47 +0100 Subject: [PATCH 07/54] ath79: add LTE led for GL.iNet GL-XE300 This commit adds the LTE led for GL.iNet GL-XE300 to the default leds config. Signed-off-by: Leo Soares --- target/linux/ath79/nand/base-files/etc/board.d/01_leds | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/ath79/nand/base-files/etc/board.d/01_leds b/target/linux/ath79/nand/base-files/etc/board.d/01_leds index 41c4fa2527..ce22d0e3ce 100644 --- a/target/linux/ath79/nand/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds @@ -17,6 +17,7 @@ glinet,gl-ar300m-nor) glinet,gl-xe300) ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1" ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x10" + ucidef_set_led_netdev "3gnet" "LTE" "green:lte" "wwan0" ;; netgear,pgzng1) ucidef_set_led_wlan "wlan" "WLAN" "green:wlan" "phy0tpt" From 31cca8f8d3f6218965812c46de35ba30c4ba83ab Mon Sep 17 00:00:00 2001 From: Chen Minqiang Date: Sun, 31 Jul 2022 05:04:58 +0800 Subject: [PATCH 08/54] umdns: add missing syscall to seccomp filter There is some syscall missing: 'getdents64' 'getrandom' 'statx' 'newfstatat' Found with: 'mkdir /etc/umdns; ln -s /tmp/1.json /etc/umdns/; utrace /usr/sbin/umdns' Signed-off-by: Chen Minqiang --- package/network/services/umdns/files/umdns.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/network/services/umdns/files/umdns.json b/package/network/services/umdns/files/umdns.json index 92f1a17b52..554b616633 100644 --- a/package/network/services/umdns/files/umdns.json +++ b/package/network/services/umdns/files/umdns.json @@ -19,12 +19,15 @@ "fcntl", "fcntl64", "fstat", + "getdents64", "getsockname", + "getrandom", "ioctl", "madvise", "mmap", "mmap2", "munmap", + "newfstatat", "open", "openat", "pipe", @@ -42,6 +45,7 @@ "setsockopt", "sigreturn", "socket", + "statx", "time", "uname", "write", From 943905b0b6ee59fb7eaf3611960c0ec87ed61bbc Mon Sep 17 00:00:00 2001 From: Olliver Schinagl Date: Thu, 4 Aug 2022 16:09:00 +0200 Subject: [PATCH 09/54] realtek: Fix typo in Kconfig prompt As the symbol RTL930x shows, the bool enables the RTL930x platform, not the RTL839x one. Signed-off-by: Olliver Schinagl (slightly changed commit subject) Signed-off-by: Christian Lamparter --- .../realtek/patches-5.10/300-mips-add-rtl838x-platform.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/realtek/patches-5.10/300-mips-add-rtl838x-platform.patch b/target/linux/realtek/patches-5.10/300-mips-add-rtl838x-platform.patch index 8292c82ef1..373bcff421 100644 --- a/target/linux/realtek/patches-5.10/300-mips-add-rtl838x-platform.patch +++ b/target/linux/realtek/patches-5.10/300-mips-add-rtl838x-platform.patch @@ -49,7 +49,7 @@ + select SYS_SUPPORTS_MULTITHREADING + +config RTL930X -+ bool "Realtek RTL839X based platforms" ++ bool "Realtek RTL930X based platforms" + depends on RTL83XX + select MIPS_CPU_SCACHE + select CSRC_R4K From 8756a047874bf688138a81898b6973f196cd1d36 Mon Sep 17 00:00:00 2001 From: Daniel Kestrel Date: Fri, 5 Aug 2022 10:35:07 +0200 Subject: [PATCH 10/54] lantiq: fix lan port 3+4 phy-mode settings for Fritzbox 3390 There are forum reports that 2 LAN ports are still not working, the phy-mode settings are adjusted to fix the problem. Fixes: #10371 Signed-off-by: Daniel Kestrel --- .../files/arch/mips/boot/dts/lantiq/vr9_avm_fritz3390.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz3390.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz3390.dts index 5a3f2e5836..ba88a81270 100644 --- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz3390.dts +++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz3390.dts @@ -170,14 +170,14 @@ port@0 { reg = <0>; label = "lan3"; - phy-mode = "rgmii"; + phy-mode = "rgmii-rxid"; phy-handle = <&phy0>; }; port@1 { reg = <1>; label = "lan4"; - phy-mode = "rgmii"; + phy-mode = "rgmii-rxid"; phy-handle = <&phy1>; }; From d6801e0d3f8b0e764fef3d698edf74b3758667ec Mon Sep 17 00:00:00 2001 From: Christian Lamparter Date: Fri, 5 Aug 2022 12:42:09 +0200 Subject: [PATCH 11/54] kernel: silence refresh warning |Warning: trailing whitespace in line 66 of drivers/mtd/parsers/Kconfig Signed-off-by: Christian Lamparter --- .../pending-5.10/430-mtd-add-myloader-partition-parser.patch | 2 +- .../pending-5.15/430-mtd-add-myloader-partition-parser.patch | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/target/linux/generic/pending-5.10/430-mtd-add-myloader-partition-parser.patch b/target/linux/generic/pending-5.10/430-mtd-add-myloader-partition-parser.patch index 0889c9a343..8a6e630530 100644 --- a/target/linux/generic/pending-5.10/430-mtd-add-myloader-partition-parser.patch +++ b/target/linux/generic/pending-5.10/430-mtd-add-myloader-partition-parser.patch @@ -20,7 +20,7 @@ Signed-off-by: Adrian Schmutzler + help + MyLoader is a bootloader which allows the user to define partitions + in flash devices, by putting a table in the second erase block -+ on the device, similar to a partition table. This table gives the ++ on the device, similar to a partition table. This table gives the + offsets and lengths of the user defined partitions. + + If you need code which can detect and parse these tables, and diff --git a/target/linux/generic/pending-5.15/430-mtd-add-myloader-partition-parser.patch b/target/linux/generic/pending-5.15/430-mtd-add-myloader-partition-parser.patch index 0889c9a343..8a6e630530 100644 --- a/target/linux/generic/pending-5.15/430-mtd-add-myloader-partition-parser.patch +++ b/target/linux/generic/pending-5.15/430-mtd-add-myloader-partition-parser.patch @@ -20,7 +20,7 @@ Signed-off-by: Adrian Schmutzler + help + MyLoader is a bootloader which allows the user to define partitions + in flash devices, by putting a table in the second erase block -+ on the device, similar to a partition table. This table gives the ++ on the device, similar to a partition table. This table gives the + offsets and lengths of the user defined partitions. + + If you need code which can detect and parse these tables, and From a23d132cff541210b281ac60de619e7ce7ec3ba0 Mon Sep 17 00:00:00 2001 From: Hans Dedecker Date: Fri, 5 Aug 2022 18:29:05 +0200 Subject: [PATCH 12/54] odhcp6c: update to git HEAD 7d21e8d dhcpv6: add option to ignore stateless advertise Signed-off-by: Hans Dedecker --- package/network/ipv6/odhcp6c/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/ipv6/odhcp6c/Makefile b/package/network/ipv6/odhcp6c/Makefile index c646b85856..82bc719139 100644 --- a/package/network/ipv6/odhcp6c/Makefile +++ b/package/network/ipv6/odhcp6c/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=18 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcp6c.git -PKG_SOURCE_DATE:=2022-07-13 -PKG_SOURCE_VERSION:=9212bfcbab7681cd30186ac7f1ef4c47bf38c89a -PKG_MIRROR_HASH:=85118a9ae084701a00b4dc6a9b2e3279e4fd70eb5b31b539a121ce0a894f9e45 +PKG_SOURCE_DATE:=2022-08-05 +PKG_SOURCE_VERSION:=7d21e8d8ecd6d776f64b6928f62893c0f5c9747a +PKG_MIRROR_HASH:=6d918517de4ec47d83edddb6167bb52f08b2b696f336d5055a45290bb37ac4db PKG_MAINTAINER:=Hans Dedecker PKG_LICENSE:=GPL-2.0 From 3d669ec9cd14cd9a80d861c5b620d4c997d7bb6a Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Sun, 25 Apr 2021 17:06:03 +0900 Subject: [PATCH 13/54] realtek: add support for Panasonic Switch-M16eG PN28160K Panasonic Switch-M16eG PN28160K is a 16 + 2 port gigabit switch, based on RTL8382M. Specification: - SoC : Realtek RTL8382M - RAM : DDR3 128 MiB (Winbond W631GG8KB-15) - Flash : SPI-NOR 32 MiB (Macronix MX25L25635FMI-10G) - Ethernet : 10/100/1000 Mbps x16 + 2 - port 1-8 : TP, RTL8218B (SoC) - port 9-16 : RTL8218FB - port 9-14: TP - port 15-16: TP/SFP (Combo) - LEDs/Keys : 7x / 1x - UART : RS-232 port on the front panel (connector: RJ-45) - 3:TX, 4:GND, 5:GND, 6:RX (pin number: RJ-45) - 9600n8 - Power : 100-240 VAC, 50/60 Hz, 0.5 A - Plug : IEC 60320-C13 - Stock OS : VxWorks based Flash instruction using initramfs image: 1. Prepare the TFTP server with the IP address 192.168.1.111 2. Rename the OpenWrt initramfs image to "0101A8C0.img" and place it to the TFTP directory 3. Download the official upgrading firmware (ex: pn28160k_v30003.rom) and place it to the TFTP directory 4. Boot M16eG and interrupt the U-Boot with Ctrl + C keys 5. Execute the following commands and boot with the OpenWrt initramfs image rtk network on tftpboot 0x81000000 bootm 6. Backup mtdblock files to the computer by scp or anything and reboot 7. Interrupt the U-Boot and execute the following commands to re-create filesystem in the flash ffsmount c:/ ffsfmt c:/ this step takes a long time, about ~ 4 mins 8. Execute the following commands to put the official images to the filesystem updatert example: updatert pn28160k_v30003.rom this step takes about ~ 40 secs 9. Set the environment variables of the U-Boot by the following commands setenv loadaddr 0xb4e00000 setenv bootcmd bootm saveenv 10: Download the OpenWrt initramfs image and boot with it tftpboot 0x81000000 0101A8C0.img bootm 11: On the initramfs image, download the sysupgrade image and perform sysupgrade with it sysupgrade 12: Wait ~ 120 seconds to complete flashing Known Issues: - 2x SFP ports are provided as combo ports by the RTL8218FB chip, but the phy driver has no support for it. Currently, only TP ports work by the RTL8218D support. Note: - "Switch-M16eG" is a model name, and "PN28160K" is a model number. Switch-M16eG has an another (old) model number ("PN28160"), it's not a Realtek based hardware. - Switch-M16eG has a "POWER" LED (Green), but it's not connected to any GPIO pin. - U-Boot checks the runtime images in the flash when booting and fails to execute "bootcmd" variable if the images are not existing. - A filesystem is formed in the flash (0x100000-0x1DFFFFF) on the stock firmware and it includes the stock images, configuration files and checksum files. It's unknown format, can't be managed on the OpenWrt. To get the enough space for OpenWrt, move the filesystem to the head of "fs_reserved" partition by execution of "ffsfmt" and "updatert". - A GPIO pin on PCA9539 is used for resetting external RTL8218FB phy. This should be specified as "reset-gpios" property in MDIO node, but RTL8218FB won't be configured on RTL8218D support in the phy driver. So, ethernet ports on the phy will be broken after hard-resetting. At the moment, configure this pin as gpio-hog to avoid breaking by resetting. Back to the stock firmware: 1. Delete "loadaddr" variable and set "bootcmd" to the original value on U-Boot: setenv loadaddr setenv bootcmd 'bootm 0x81000000' on OpenWrt: fw_setenv loadaddr fw_setenv bootcmd 'bootm 0x81000000' 2. Perform reset or reboot on U-Boot: reset on OpenWrt: reboot Signed-off-by: INAGAKI Hiroshi --- .../rtl8382_panasonic_m16eg-pn28160k.dts | 171 ++++++++++++++++++ .../rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi | 1 + target/linux/realtek/image/rtl838x.mk | 10 + 3 files changed, 182 insertions(+) create mode 100644 target/linux/realtek/dts-5.10/rtl8382_panasonic_m16eg-pn28160k.dts diff --git a/target/linux/realtek/dts-5.10/rtl8382_panasonic_m16eg-pn28160k.dts b/target/linux/realtek/dts-5.10/rtl8382_panasonic_m16eg-pn28160k.dts new file mode 100644 index 0000000000..c3b29a87ff --- /dev/null +++ b/target/linux/realtek/dts-5.10/rtl8382_panasonic_m16eg-pn28160k.dts @@ -0,0 +1,171 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rtl838x.dtsi" +#include "rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi" + +#include + +/ { + compatible = "panasonic,m16eg-pn28160k", "realtek,rtl8382-soc"; + model = "Panasonic Switch-M16eG PN28160K"; + + aliases { + led-boot = &led_status_eco_green; + led-failsafe = &led_status_eco_amber; + led-running = &led_status_eco_green; + led-upgrade = &led_status_eco_green; + }; + + /* + * sfp0/1 are "combo" port with each TP port (23/24), and they are + * connected to the RTL8218FB. Currently, there is no support for + * the chip and only TP ports work by the RTL8218D support. + */ + sfp0: sfp-p23 { + compatible = "sff,sfp"; + i2c-bus = <&i2c0>; + tx-fault-gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>; + tx-disable-gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>; + mod-def0-gpio = <&gpio1 2 GPIO_ACTIVE_LOW>; + los-gpio = <&gpio1 3 GPIO_ACTIVE_HIGH>; + }; + + sfp1: sfp-p24 { + compatible = "sff,sfp"; + i2c-bus = <&i2c1>; + tx-fault-gpio = <&gpio1 4 GPIO_ACTIVE_HIGH>; + tx-disable-gpio = <&gpio1 5 GPIO_ACTIVE_HIGH>; + mod-def0-gpio = <&gpio1 6 GPIO_ACTIVE_LOW>; + los-gpio = <&gpio1 7 GPIO_ACTIVE_HIGH>; + }; +}; + +&leds { + led_status_eco_amber: led-5 { + label = "amber:status_eco"; + gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <1>; + }; + + led_status_eco_green: led-6 { + label = "green:status_eco"; + gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <2>; + }; +}; + +&i2c_gpio_0 { + scl-gpios = <&gpio0 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + sda-gpios = <&gpio0 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; +}; + +&i2c_gpio_1 { + scl-gpios = <&gpio0 12 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + sda-gpios = <&gpio0 13 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; +}; + +&gpio2 { + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio0>; + interrupts = <2 IRQ_TYPE_EDGE_FALLING>; + + /* + * GPIO12 (IO1_4): RTL8218FB + * + * This GPIO pin should be specified as "reset-gpio" in mdio node, but + * RTL8218FB phy won't be configured on RTL8218D support in the current + * phy driver. So, ethernet ports on the phy will be broken after hard- + * resetting. + * (RTL8218FB phy will be detected as RTL8218D by the phy driver) + * At the moment, configure this GPIO pin as gpio-hog to avoid breaking + * by resetting. + */ + ext_switch_reset { + gpio-hog; + gpios = <12 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "ext-switch-reset"; + }; +}; + +&i2c_switch { + i2c0: i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + i2c1: i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; +}; + +ðernet0 { + mdio-bus { + compatible = "realtek,rtl838x-mdio"; + #address-cells = <1>; + #size-cells = <0>; + + INTERNAL_PHY(8) + INTERNAL_PHY(9) + INTERNAL_PHY(10) + INTERNAL_PHY(11) + INTERNAL_PHY(12) + INTERNAL_PHY(13) + INTERNAL_PHY(14) + INTERNAL_PHY(15) + + /* RTL8218FB */ + EXTERNAL_PHY(16) + EXTERNAL_PHY(17) + EXTERNAL_PHY(18) + EXTERNAL_PHY(19) + EXTERNAL_PHY(20) + EXTERNAL_PHY(21) + EXTERNAL_PHY(22) + EXTERNAL_PHY(23) + }; +}; + +&switch0 { + ports { + #address-cells = <1>; + #size-cells = <0>; + + SWITCH_PORT(8, 1, internal) + SWITCH_PORT(9, 2, internal) + SWITCH_PORT(10, 3, internal) + SWITCH_PORT(11, 4, internal) + SWITCH_PORT(12, 5, internal) + SWITCH_PORT(13, 6, internal) + SWITCH_PORT(14, 7, internal) + SWITCH_PORT(15, 8, internal) + + SWITCH_PORT(16, 9, qsgmii) + SWITCH_PORT(17, 10, qsgmii) + SWITCH_PORT(18, 11, qsgmii) + SWITCH_PORT(19, 12, qsgmii) + SWITCH_PORT(20, 13, qsgmii) + SWITCH_PORT(21, 14, qsgmii) + SWITCH_PORT(22, 15, qsgmii) + SWITCH_PORT(23, 16, qsgmii) + + port@28 { + ethernet = <ðernet0>; + reg = <28>; + phy-mode = "internal"; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; +}; diff --git a/target/linux/realtek/dts-5.10/rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi b/target/linux/realtek/dts-5.10/rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi index 48aa1849d6..fb2aa18d21 100644 --- a/target/linux/realtek/dts-5.10/rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi +++ b/target/linux/realtek/dts-5.10/rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi @@ -94,6 +94,7 @@ /* * GPIO14 (IO1_6): Shift Register RESET (port LED) * - Switch-M8eG PN28080K: 3x 74HC164 + * - Switch-M16eG PN28160K: 4x 74HC164 * - Switch-M24eG PN28240K: 6x 74HC164 * - Switch-M48eG PN28480K: 12x 74HC164 */ diff --git a/target/linux/realtek/image/rtl838x.mk b/target/linux/realtek/image/rtl838x.mk index 60eda5359d..cbd41ce841 100644 --- a/target/linux/realtek/image/rtl838x.mk +++ b/target/linux/realtek/image/rtl838x.mk @@ -138,6 +138,16 @@ define Device/netgear_gs310tp-v1 endef TARGET_DEVICES += netgear_gs310tp-v1 +define Device/panasonic_m16eg-pn28160k + SOC := rtl8382 + IMAGE_SIZE := 16384k + DEVICE_VENDOR := Panasonic + DEVICE_MODEL := Switch-M16eG + DEVICE_VARIANT := PN28160K + DEVICE_PACKAGES := kmod-i2c-mux-pca954x +endef +TARGET_DEVICES += panasonic_m16eg-pn28160k + define Device/panasonic_m8eg-pn28080k SOC := rtl8380 IMAGE_SIZE := 16384k From fa52e5e2542883382e5bb7233ddfb8b025f932ab Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Sun, 25 Apr 2021 17:06:03 +0900 Subject: [PATCH 14/54] realtek: add support for Panasonic Switch-M24eG PN28240K Panasonic Switch-M24eG PN28240K is a 24 + 2 port gigabit switch, based on RTL8382M. Specification: - SoC : Realtek RTL8382M - RAM : DDR3 128 MiB (Winbond W631GG8KB-15) - Flash : SPI-NOR 32 MiB (Macronix MX25L25635FMI-10G) - Ethernet : 10/100/1000 Mbps x24 + 2 - port 1-8 : TP, RTL8218B - port 9-16 : TP, RTL8218B (SoC) - port 17-24 : RTL8218FB - port 17-22: TP - port 23-24: TP/SFP (Combo) - LEDs/Keys : 7x / 1x - UART : RS-232 port on the front panel (connector: RJ-45) - 3:TX, 4:GND, 5:GND, 6:RX (pin number: RJ-45) - 9600n8 - Power : 100-240 VAC, 50/60 Hz, 0.5 A - Plug : IEC 60320-C13 - Stock OS : VxWorks based Flash instruction using initramfs image: 1. Prepare the TFTP server with the IP address 192.168.1.111 2. Rename the OpenWrt initramfs image to "0101A8C0.img" and place it to the TFTP directory 3. Download the official upgrading firmware (ex: pn28240k_v30000.rom) and place it to the TFTP directory 4. Boot M24eG and interrupt the U-Boot with Ctrl + C keys 5. Execute the following commands and boot with the OpenWrt initramfs image rtk network on tftpboot 0x81000000 bootm 6. Backup mtdblock files to the computer by scp or anything and reboot 7. Interrupt the U-Boot and execute the following commands to re-create filesystem in the flash ffsmount c:/ ffsfmt c:/ this step takes a long time, about ~ 4 mins 8. Execute the following commands to put the official images to the filesystem updatert example: updatert pn28240k_v30000.rom this step takes about ~ 40 secs 9. Set the environment variables of the U-Boot by the following commands setenv loadaddr 0xb4e00000 setenv bootcmd bootm saveenv 10: Download the OpenWrt initramfs image and boot with it tftpboot 0x81000000 0101A8C0.img bootm 11: On the initramfs image, download the sysupgrade image and perform sysupgrade with it sysupgrade 12: Wait ~ 120 seconds to complete flashing Known Issues: - 2x SFP ports are provided as combo ports by the RTL8218FB chip, but the phy driver has no support for it. Currently, only TP ports work by the RTL8218D support. Note: - "Switch-M24eG" is a model name, and "PN28240K" is a model number. Switch-M24eG has an another (old) model number ("PN28240"), it's not a Realtek based hardware. - Switch-M24eG has a "POWER" LED (Green), but it's not connected to any GPIO pin. - U-Boot checks the runtime images in the flash when booting and fails to execute "bootcmd" variable if the images are not existing. - A filesystem is formed in the flash (0x100000-0x1DFFFFF) on the stock firmware and it includes the stock images, configuration files and checksum files. It's unknown format, can't be managed on the OpenWrt. To get the enough space for OpenWrt, move the filesystem to the head of "fs_reserved" partition by execution of "ffsfmt" and "updatert". - A GPIO pin on PCA9539 is used for resetting external RTL8218B phy and RTL8218FB phy. This should be specified as "reset-gpios" property in MDIO node, but the current configuration of RTL8218B phy in the phy driver seems to be incomplete and RTL8218FB won't be configured on RTL8218D support. So, ethernet ports on these phys will be broken after hard-resetting. At the moment, configure this pin as gpio-hog to avoid breaking by resetting. Back to the stock firmware: 1. Delete "loadaddr" variable and set "bootcmd" to the original value on U-Boot: setenv loadaddr setenv bootcmd 'bootm 0x81000000' on OpenWrt: fw_setenv loadaddr fw_setenv bootcmd 'bootm 0x81000000' 2. Perform reset or reboot on U-Boot: reset on OpenWrt: reboot Signed-off-by: INAGAKI Hiroshi --- .../rtl8382_panasonic_m24eg-pn28240k.dts | 190 ++++++++++++++++++ target/linux/realtek/image/rtl838x.mk | 10 + 2 files changed, 200 insertions(+) create mode 100644 target/linux/realtek/dts-5.10/rtl8382_panasonic_m24eg-pn28240k.dts diff --git a/target/linux/realtek/dts-5.10/rtl8382_panasonic_m24eg-pn28240k.dts b/target/linux/realtek/dts-5.10/rtl8382_panasonic_m24eg-pn28240k.dts new file mode 100644 index 0000000000..1fa9d2cdc7 --- /dev/null +++ b/target/linux/realtek/dts-5.10/rtl8382_panasonic_m24eg-pn28240k.dts @@ -0,0 +1,190 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rtl838x.dtsi" +#include "rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi" + +#include + +/ { + compatible = "panasonic,m24eg-pn28240k", "realtek,rtl8382-soc"; + model = "Panasonic Switch-M24eG PN28240K"; + + aliases { + led-boot = &led_status_eco_green; + led-failsafe = &led_status_eco_amber; + led-running = &led_status_eco_green; + led-upgrade = &led_status_eco_green; + }; + + /* + * sfp0/1 are "combo" port with each TP port (23/24), and they are + * connected to the RTL8218FB. Currently, there is no support for + * the chip and only TP ports work by the RTL8218D support. + */ + sfp0: sfp-p23 { + compatible = "sff,sfp"; + i2c-bus = <&i2c0>; + tx-fault-gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>; + tx-disable-gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>; + mod-def0-gpio = <&gpio1 2 GPIO_ACTIVE_LOW>; + los-gpio = <&gpio1 3 GPIO_ACTIVE_HIGH>; + }; + + sfp1: sfp-p24 { + compatible = "sff,sfp"; + i2c-bus = <&i2c1>; + tx-fault-gpio = <&gpio1 4 GPIO_ACTIVE_HIGH>; + tx-disable-gpio = <&gpio1 5 GPIO_ACTIVE_HIGH>; + mod-def0-gpio = <&gpio1 6 GPIO_ACTIVE_LOW>; + los-gpio = <&gpio1 7 GPIO_ACTIVE_HIGH>; + }; +}; + +&leds { + led_status_eco_amber: led-5 { + label = "amber:status_eco"; + gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <1>; + }; + + led_status_eco_green: led-6 { + label = "green:status_eco"; + gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <2>; + }; +}; + +&i2c_gpio_0 { + scl-gpios = <&gpio0 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + sda-gpios = <&gpio0 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; +}; + +&i2c_gpio_1 { + scl-gpios = <&gpio0 12 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + sda-gpios = <&gpio0 13 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; +}; + +&gpio2 { + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio0>; + interrupts = <2 IRQ_TYPE_EDGE_FALLING>; + + /* + * GPIO12 (IO1_4): RTL8218B + RTL8218FB + * + * This GPIO pin should be specified as "reset-gpio" in mdio node, + * but the current configuration of RTL8218B phy in the phy driver + * seems to be incomplete and RTL8218FB phy won't be configured on + * RTL8218D support. So, ethernet ports on these phys will be broken + * after hard-resetting. + * (RTL8218FB phy will be detected as RTL8218D by the phy driver) + * At the moment, configure this GPIO pin as gpio-hog to avoid breaking + * by resetting. + */ + ext_switch_reset { + gpio-hog; + gpios = <12 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "ext-switch-reset"; + }; +}; + +&i2c_switch { + i2c0: i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + i2c1: i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; +}; + +ðernet0 { + mdio-bus { + compatible = "realtek,rtl838x-mdio"; + #address-cells = <1>; + #size-cells = <0>; + + EXTERNAL_PHY(0) + EXTERNAL_PHY(1) + EXTERNAL_PHY(2) + EXTERNAL_PHY(3) + EXTERNAL_PHY(4) + EXTERNAL_PHY(5) + EXTERNAL_PHY(6) + EXTERNAL_PHY(7) + + INTERNAL_PHY(8) + INTERNAL_PHY(9) + INTERNAL_PHY(10) + INTERNAL_PHY(11) + INTERNAL_PHY(12) + INTERNAL_PHY(13) + INTERNAL_PHY(14) + INTERNAL_PHY(15) + + /* RTL8218FB */ + EXTERNAL_PHY(16) + EXTERNAL_PHY(17) + EXTERNAL_PHY(18) + EXTERNAL_PHY(19) + EXTERNAL_PHY(20) + EXTERNAL_PHY(21) + EXTERNAL_PHY(22) + EXTERNAL_PHY(23) + }; +}; + +&switch0 { + ports { + #address-cells = <1>; + #size-cells = <0>; + + SWITCH_PORT(0, 1, qsgmii) + SWITCH_PORT(1, 2, qsgmii) + SWITCH_PORT(2, 3, qsgmii) + SWITCH_PORT(3, 4, qsgmii) + SWITCH_PORT(4, 5, qsgmii) + SWITCH_PORT(5, 6, qsgmii) + SWITCH_PORT(6, 7, qsgmii) + SWITCH_PORT(7, 8, qsgmii) + + SWITCH_PORT(8, 9, internal) + SWITCH_PORT(9, 10, internal) + SWITCH_PORT(10, 11, internal) + SWITCH_PORT(11, 12, internal) + SWITCH_PORT(12, 13, internal) + SWITCH_PORT(13, 14, internal) + SWITCH_PORT(14, 15, internal) + SWITCH_PORT(15, 16, internal) + + SWITCH_PORT(16, 17, qsgmii) + SWITCH_PORT(17, 18, qsgmii) + SWITCH_PORT(18, 19, qsgmii) + SWITCH_PORT(19, 20, qsgmii) + SWITCH_PORT(20, 21, qsgmii) + SWITCH_PORT(21, 22, qsgmii) + SWITCH_PORT(22, 23, qsgmii) + SWITCH_PORT(23, 24, qsgmii) + + port@28 { + ethernet = <ðernet0>; + reg = <28>; + phy-mode = "internal"; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; +}; diff --git a/target/linux/realtek/image/rtl838x.mk b/target/linux/realtek/image/rtl838x.mk index cbd41ce841..9e1dd0308d 100644 --- a/target/linux/realtek/image/rtl838x.mk +++ b/target/linux/realtek/image/rtl838x.mk @@ -148,6 +148,16 @@ define Device/panasonic_m16eg-pn28160k endef TARGET_DEVICES += panasonic_m16eg-pn28160k +define Device/panasonic_m24eg-pn28240k + SOC := rtl8382 + IMAGE_SIZE := 16384k + DEVICE_VENDOR := Panasonic + DEVICE_MODEL := Switch-M24eG + DEVICE_VARIANT := PN28240K + DEVICE_PACKAGES := kmod-i2c-mux-pca954x +endef +TARGET_DEVICES += panasonic_m24eg-pn28240k + define Device/panasonic_m8eg-pn28080k SOC := rtl8380 IMAGE_SIZE := 16384k From 4974ee7341ebf83579331fbe496a832cf7ed6c56 Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Sun, 24 Jul 2022 18:03:37 +0900 Subject: [PATCH 15/54] realtek: enable pca953x GPIO driver for rtl839x subtarget The system status LED on Panasonic Switch-M48eG PN28480K is connected to a PCA9539PW. To use the LED as a status LED of OpenWrt while booting, enable the pca953x driver and built-in to the kernel. Also enable CONFIG_GPIO_PCA953X_IRQ to use interrupt via RTL83xx GPIO. Signed-off-by: INAGAKI Hiroshi --- target/linux/realtek/rtl839x/config-5.10 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/linux/realtek/rtl839x/config-5.10 b/target/linux/realtek/rtl839x/config-5.10 index 76a0517ede..1b4e1de43f 100644 --- a/target/linux/realtek/rtl839x/config-5.10 +++ b/target/linux/realtek/rtl839x/config-5.10 @@ -70,6 +70,8 @@ CONFIG_GENERIC_TIME_VSYSCALL=y CONFIG_GPIOLIB=y CONFIG_GPIOLIB_IRQCHIP=y CONFIG_GPIO_GENERIC=y +CONFIG_GPIO_PCA953X=y +CONFIG_GPIO_PCA953X_IRQ=y CONFIG_GPIO_REALTEK_OTTO=y CONFIG_GPIO_RTL8231=y CONFIG_GRO_CELLS=y @@ -169,6 +171,7 @@ CONFIG_REALTEK_OTTO_WDT=y CONFIG_REALTEK_PHY=y CONFIG_REALTEK_SOC_PHY=y CONFIG_REGMAP=y +CONFIG_REGMAP_I2C=y CONFIG_REGMAP_MMIO=y CONFIG_RESET_CONTROLLER=y CONFIG_RTL83XX=y From cef3f05a55a3a3e6d2e18aef5459dda78fc3e336 Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Fri, 3 Sep 2021 18:58:09 +0900 Subject: [PATCH 16/54] realtek: add support for Panasonic Switch-M48eG PN28480K Panasonic Switch-M48eG PN28480K is a 48 + 4 port gigabit switch, based on RTL8393M. Specification: - SoC : Realtek RTL8393M - RAM : DDR3 128 MiB (Winbond W631GG8KB-15) - Flash : SPI-NOR 32 MiB (Macronix MX25L25635FMI-10G) - Ethernet : 10/100/1000 Mbps x48 + 2 - port 1-40 : TP, RTL8218B x5 - port 41-48 : RTL8218FB - port 41-44: TP - port 45-48: TP/SFP (Combo) - LEDs/Keys : 7x / 1x - UART : RS-232 port on the front panel (connector: RJ-45) - 3:TX, 4:GND, 5:GND, 6:RX (pin number: RJ-45) - 9600n8 - Power : 100-240 VAC, 50/60 Hz, 0.5 A - Plug : IEC 60320-C13 - Stock OS : VxWorks based Flash instruction using initramfs image: 1. Prepare the TFTP server with the IP address 192.168.1.111 2. Rename the OpenWrt initramfs image to "0101A8C0.img" and place it to the TFTP directory 3. Download the official upgrading firmware (ex: pn28480k_v30000.rom) and place it to the TFTP directory 4. Boot M48eG and interrupt the U-Boot with Ctrl + C keys 5. Execute the following commands and boot with the OpenWrt initramfs image rtk network on tftpboot 0x81000000 bootm 6. Backup mtdblock files to the computer by scp or anything and reboot 7. Interrupt the U-Boot and execute the following commands to re-create filesystem in the flash ffsmount c:/ ffsfmt c:/ this step takes a long time, about ~ 4 mins 8. Execute the following commands to put the official images to the filesystem updatert example: updatert pn28480k_v30000.rom this step takes about ~ 40 secs 9. Set the environment variables of the U-Boot by the following commands setenv loadaddr 0xb4e00000 setenv bootcmd 'sleep 10; bootm;' saveenv 'sleep 10;' is required as dummy to execute 'bootm' command correctly 10: Download the OpenWrt initramfs image and boot with it tftpboot 0x81000000 0101A8C0.img bootm 11: On the initramfs image, download the sysupgrade image and perform sysupgrade with it sysupgrade 12: Wait ~ 120 seconds to complete flashing Known Issues: - 4x SFP ports are provided as combo ports by the RTL8218FB chip, but the phy driver has no support for it. Currently, only TP ports work by the RTL8218B support. Note: - "Switch-M48eG" is a model name, and "PN28480K" is a model number. Switch-M48eG has an another (old) model number ("PN28480"), it's not a Realtek based hardware. - Switch-M48eG has a "POWER" LED (Green), but it's not connected to any GPIO pin. - U-Boot checks the runtime images in the flash when booting and fails to execute "bootcmd" variable if the images are not existing. - A filesystem is formed in the flash (0x100000-0x1DFFFFF) on the stock firmware and it includes the stock images, configuration files and checksum files. It's unknown format, can't be managed on the OpenWrt. To get the enough space for OpenWrt, move the filesystem to the head of "fs_reserved" partition by execution of "ffsfmt" and "updatert". - A GPIO pin on PCA9539 is used for resetting external RTL8218B phys and RTL8218FB phy. This should be specified as "reset-gpios" property in MDIO node, but the current configuration of RTL8218B phy in the driver seems to be incomplete and RTL8218FB won't be configured on RTL8218D support. So, ethernet ports on these phys will be broken after hard-resetting. At the moment, configure this pin as gpio-hog to avoid breaking by resetting. - This model has 2x Microchip TCN75A thermal sensors. Linux Kernel supports TCN75 chip on lm75 driver, but no support for TCN75'A' variant. At the moment, use TCN75 support for the chips instead. Back to the stock firmware: 1. Delete "loadaddr" variable and set "bootcmd" to the original value on U-Boot: setenv loadaddr setenv bootcmd 'ffsrdm c:/runtime.had 0x81000000;alphadec c:/runtime.had 0x81000240 0x80010000;' on OpenWrt: fw_setenv loadaddr fw_setenv bootcmd 'ffsrdm c:/runtime.had 0x81000000;alphadec c:/runtime.had 0x81000240 0x80010000;' 2. Perform reset or reboot on U-Boot: reset on OpenWrt: reboot Signed-off-by: INAGAKI Hiroshi --- .../rtl8393_panasonic_m48eg-pn28480k.dts | 380 ++++++++++++++++++ target/linux/realtek/image/rtl839x.mk | 11 + 2 files changed, 391 insertions(+) create mode 100644 target/linux/realtek/dts-5.10/rtl8393_panasonic_m48eg-pn28480k.dts diff --git a/target/linux/realtek/dts-5.10/rtl8393_panasonic_m48eg-pn28480k.dts b/target/linux/realtek/dts-5.10/rtl8393_panasonic_m48eg-pn28480k.dts new file mode 100644 index 0000000000..6a7eb6eb81 --- /dev/null +++ b/target/linux/realtek/dts-5.10/rtl8393_panasonic_m48eg-pn28480k.dts @@ -0,0 +1,380 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rtl839x.dtsi" +#include "rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi" + +#include + +/ { + compatible = "panasonic,m48eg-pn28480k", "realtek,rtl8393-soc"; + model = "Panasonic Switch-M48eG PN28480K"; + + aliases { + led-boot = &led_status_eco_green; + led-failsafe = &led_status_eco_amber; + led-running = &led_status_eco_green; + led-upgrade = &led_status_eco_green; + }; + + fan: gpio-fan { + compatible = "gpio-fan"; + gpios = <&gpio0 19 GPIO_ACTIVE_HIGH>; + /* the actual speeds (rpm) are unknown, just use dummy values */ + gpio-fan,speed-map = <1 0>, <2 1>; + #cooling-cells = <2>; + }; + + /* + * sfp0/1/2/3 are "combo" port with each TP port (45/46/47/48), + * and they are connected to the RTL8218FB. Currently, there is + * no support for the chip and only TP ports work by the RTL8218B + * support. + */ + sfp0: sfp-p45 { + compatible = "sff,sfp"; + i2c-bus = <&i2c0>; + tx-fault-gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>; + tx-disable-gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>; + mod-def0-gpio = <&gpio1 2 GPIO_ACTIVE_LOW>; + los-gpio = <&gpio1 3 GPIO_ACTIVE_HIGH>; + }; + + sfp1: sfp-p46 { + compatible = "sff,sfp"; + i2c-bus = <&i2c1>; + tx-fault-gpio = <&gpio1 4 GPIO_ACTIVE_HIGH>; + tx-disable-gpio = <&gpio1 5 GPIO_ACTIVE_HIGH>; + mod-def0-gpio = <&gpio1 6 GPIO_ACTIVE_LOW>; + los-gpio = <&gpio1 7 GPIO_ACTIVE_HIGH>; + }; + + sfp2: sfp-p47 { + compatible = "sff,sfp"; + i2c-bus = <&i2c2>; + tx-fault-gpio = <&gpio1 8 GPIO_ACTIVE_HIGH>; + tx-disable-gpio = <&gpio1 9 GPIO_ACTIVE_HIGH>; + mod-def0-gpio = <&gpio1 10 GPIO_ACTIVE_LOW>; + los-gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>; + }; + + sfp3: sfp-p48 { + compatible = "sff,sfp"; + i2c-bus = <&i2c3>; + tx-fault-gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>; + tx-disable-gpio = <&gpio1 13 GPIO_ACTIVE_HIGH>; + mod-def0-gpio = <&gpio1 14 GPIO_ACTIVE_LOW>; + los-gpio = <&gpio1 15 GPIO_ACTIVE_HIGH>; + }; + + thermal-zones { + /* + * Zone for SoC temperature + * + * Fan speed: + * + * - 0-44 celsius: Low + * - 45-54 celsius: High + */ + cpu-thermal { + polling-delay-passive = <1000>; + polling-delay = <2000>; + + thermal-sensors = <&tsens_soc>; + + trips { + cpu_alert: trip-point { + temperature = <45000>; + hysteresis = <4000>; + type = "active"; + }; + + cpu_crit { + temperature = <55000>; + hysteresis = <1000>; + type = "critical"; + }; + }; + + cooling-maps { + map { + trip = <&cpu_alert>; + cooling-device = <&fan 0 1>; + }; + }; + }; + + /* + * Zone for system temperature + * + * Fan speed: + * + * - 0-39 celsius: Low + * - 40-49 celsius: High + * + * Note: official recommended ranges of temperature on each + * fan speed setting: + * + * - Low speed : 0-40 celsius + * - High speed: 0-50 celsius + * + * (stock firmware doesn't support auto-selection of + * speed and need to be selected manually by user) + */ + sys-thermal { + polling-delay-passive = <1000>; + polling-delay = <2000>; + + thermal-sensors = <&tsens_sys>; + + trips { + sys_alert: trip-point { + temperature = <40000>; + hysteresis = <4000>; + type = "active"; + }; + + sys_crit { + temperature = <50000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + + cooling-maps { + map { + trip = <&sys_alert>; + cooling-device = <&fan 0 1>; + }; + }; + }; + }; +}; + +&leds { + led_status_eco_amber: led-5 { + label = "amber:status_eco"; + gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <1>; + }; + + led_status_eco_green: led-6 { + label = "green:status_eco"; + gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>; + color = ; + function = LED_FUNCTION_STATUS; + function-enumerator = <2>; + }; +}; + +&i2c_gpio_0 { + scl-gpios = <&gpio0 16 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + sda-gpios = <&gpio0 17 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + + /* Microchip TCN75A (for SoC) */ + tsens_soc: sensor@48 { + compatible = "microchip,tcn75"; + reg = <0x48>; + #thermal-sensor-cells = <0>; + }; + + /* Microchip TCN75A (for System) */ + tsens_sys: sensor@49 { + compatible = "microchip,tcn75"; + reg = <0x49>; + #thermal-sensor-cells = <0>; + }; +}; + +&i2c_gpio_1 { + scl-gpios = <&gpio0 14 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + sda-gpios = <&gpio0 15 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; +}; + +&gpio2 { + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio0>; + interrupts = <18 IRQ_TYPE_EDGE_FALLING>; + + /* + * GPIO12 (IO1_4): 5x RTL8218B + RTL8218FB + * + * This GPIO pin should be specified as "reset-gpio" in mdio node, + * but the current configuration of RTL8218B phy in the phy driver + * seems to be incomplete and RTL8218FB phy won't be configured on + * RTL8218D support. So, ethernet ports on these phys will be broken + * after hard-resetting. + * (RTL8218FB phy will be detected as RTL8218D by the phy driver) + * At the moment, configure this GPIO pin as gpio-hog to avoid breaking + * by resetting. + */ + ext_switch_reset { + gpio-hog; + gpios = <12 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "ext-switch-reset"; + }; +}; + +&i2c_switch { + i2c0: i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + i2c1: i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + i2c2: i2c@2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + i2c3: i2c@3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; +}; + +ðernet0 { + mdio-bus { + compatible = "realtek,rtl838x-mdio"; + #address-cells = <1>; + #size-cells = <0>; + + EXTERNAL_PHY(0) + EXTERNAL_PHY(1) + EXTERNAL_PHY(2) + EXTERNAL_PHY(3) + EXTERNAL_PHY(4) + EXTERNAL_PHY(5) + EXTERNAL_PHY(6) + EXTERNAL_PHY(7) + + EXTERNAL_PHY(8) + EXTERNAL_PHY(9) + EXTERNAL_PHY(10) + EXTERNAL_PHY(11) + EXTERNAL_PHY(12) + EXTERNAL_PHY(13) + EXTERNAL_PHY(14) + EXTERNAL_PHY(15) + + EXTERNAL_PHY(16) + EXTERNAL_PHY(17) + EXTERNAL_PHY(18) + EXTERNAL_PHY(19) + EXTERNAL_PHY(20) + EXTERNAL_PHY(21) + EXTERNAL_PHY(22) + EXTERNAL_PHY(23) + + EXTERNAL_PHY(24) + EXTERNAL_PHY(25) + EXTERNAL_PHY(26) + EXTERNAL_PHY(27) + EXTERNAL_PHY(28) + EXTERNAL_PHY(29) + EXTERNAL_PHY(30) + EXTERNAL_PHY(31) + + EXTERNAL_PHY(32) + EXTERNAL_PHY(33) + EXTERNAL_PHY(34) + EXTERNAL_PHY(35) + EXTERNAL_PHY(36) + EXTERNAL_PHY(37) + EXTERNAL_PHY(38) + EXTERNAL_PHY(39) + + /* RTL8218FB */ + EXTERNAL_PHY(40) + EXTERNAL_PHY(41) + EXTERNAL_PHY(42) + EXTERNAL_PHY(43) + EXTERNAL_PHY(44) + EXTERNAL_PHY(45) + EXTERNAL_PHY(46) + EXTERNAL_PHY(47) + }; +}; + +&switch0 { + ports { + #address-cells = <1>; + #size-cells = <0>; + + SWITCH_PORT(0, 1, qsgmii) + SWITCH_PORT(1, 2, qsgmii) + SWITCH_PORT(2, 3, qsgmii) + SWITCH_PORT(3, 4, qsgmii) + SWITCH_PORT(4, 5, qsgmii) + SWITCH_PORT(5, 6, qsgmii) + SWITCH_PORT(6, 7, qsgmii) + SWITCH_PORT(7, 8, qsgmii) + + SWITCH_PORT(8, 9, qsgmii) + SWITCH_PORT(9, 10, qsgmii) + SWITCH_PORT(10, 11, qsgmii) + SWITCH_PORT(11, 12, qsgmii) + SWITCH_PORT(12, 13, qsgmii) + SWITCH_PORT(13, 14, qsgmii) + SWITCH_PORT(14, 15, qsgmii) + SWITCH_PORT(15, 16, qsgmii) + + SWITCH_PORT(16, 17, qsgmii) + SWITCH_PORT(17, 18, qsgmii) + SWITCH_PORT(18, 19, qsgmii) + SWITCH_PORT(19, 20, qsgmii) + SWITCH_PORT(20, 21, qsgmii) + SWITCH_PORT(21, 22, qsgmii) + SWITCH_PORT(22, 23, qsgmii) + SWITCH_PORT(23, 24, qsgmii) + + SWITCH_PORT(24, 25, qsgmii) + SWITCH_PORT(25, 26, qsgmii) + SWITCH_PORT(26, 27, qsgmii) + SWITCH_PORT(27, 28, qsgmii) + SWITCH_PORT(28, 29, qsgmii) + SWITCH_PORT(29, 30, qsgmii) + SWITCH_PORT(30, 31, qsgmii) + SWITCH_PORT(31, 32, qsgmii) + + SWITCH_PORT(32, 33, qsgmii) + SWITCH_PORT(33, 34, qsgmii) + SWITCH_PORT(34, 35, qsgmii) + SWITCH_PORT(35, 36, qsgmii) + SWITCH_PORT(36, 37, qsgmii) + SWITCH_PORT(37, 38, qsgmii) + SWITCH_PORT(38, 39, qsgmii) + SWITCH_PORT(39, 40, qsgmii) + + SWITCH_PORT(40, 41, qsgmii) + SWITCH_PORT(41, 42, qsgmii) + SWITCH_PORT(42, 43, qsgmii) + SWITCH_PORT(43, 44, qsgmii) + SWITCH_PORT(44, 45, qsgmii) + SWITCH_PORT(45, 46, qsgmii) + SWITCH_PORT(46, 47, qsgmii) + SWITCH_PORT(47, 48, qsgmii) + + port@52 { + ethernet = <ðernet0>; + reg = <52>; + phy-mode = "internal"; + + fixed-link { + speed = <1000>; + full-duplex; + }; + }; + }; +}; diff --git a/target/linux/realtek/image/rtl839x.mk b/target/linux/realtek/image/rtl839x.mk index 2363b91849..8917e8550f 100644 --- a/target/linux/realtek/image/rtl839x.mk +++ b/target/linux/realtek/image/rtl839x.mk @@ -1,5 +1,16 @@ # SPDX-License-Identifier: GPL-2.0-only +define Device/panasonic_m48eg-pn28480k + SOC := rtl8393 + IMAGE_SIZE := 16384k + DEVICE_VENDOR := Panasonic + DEVICE_MODEL := Switch-M48eG + DEVICE_VARIANT := PN28480K + DEVICE_PACKAGES := kmod-hwmon-gpiofan kmod-hwmon-lm75 kmod-i2c-mux-pca954x \ + kmod-thermal +endef +TARGET_DEVICES += panasonic_m48eg-pn28480k + define Device/zyxel_gs1900-48 SOC := rtl8393 IMAGE_SIZE := 13952k From 98df6bd99c0f70d4f2ad709af09084f985689ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Fri, 5 Aug 2022 10:58:43 +0200 Subject: [PATCH 17/54] generic: 5.15: disable CONFIG_DEBUG_INFO_REDUCED symbol MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This came up during build testing of mvebu/cortexa9 target with 5.15 kernel. Signed-off-by: Petr Štetiar --- target/linux/generic/config-5.15 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15 index c21f7631ec..991d3ddf77 100644 --- a/target/linux/generic/config-5.15 +++ b/target/linux/generic/config-5.15 @@ -1317,6 +1317,7 @@ CONFIG_DEBUG_FS_ALLOW_ALL=y # CONFIG_DEBUG_INFO_DWARF4 is not set # CONFIG_DEBUG_INFO_DWARF5 is not set CONFIG_DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT=y +# CONFIG_DEBUG_INFO_REDUCED is not set # CONFIG_DEBUG_INFO_SPLIT is not set # CONFIG_DEBUG_IRQFLAGS is not set CONFIG_DEBUG_KERNEL=y From 7df6795d4c25447683fd4b4a4813bebcddaea547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Sat, 6 Aug 2022 14:55:07 +0200 Subject: [PATCH 18/54] zlib: backport fix for heap-based buffer over-read (CVE-2022-37434) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit zlib through 1.2.12 has a heap-based buffer over-read or buffer overflow in inflate in inflate.c via a large gzip header extra field. NOTE: only applications that call inflateGetHeader are affected. Some common applications bundle the affected zlib source code but may be unable to call inflateGetHeader. Fixes: CVE-2022-37434 References: https://github.com/ivd38/zlib_overflow Signed-off-by: Petr Štetiar --- .../zlib/patches/006-fix-CVE-2022-37434.patch | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 package/libs/zlib/patches/006-fix-CVE-2022-37434.patch diff --git a/package/libs/zlib/patches/006-fix-CVE-2022-37434.patch b/package/libs/zlib/patches/006-fix-CVE-2022-37434.patch new file mode 100644 index 0000000000..dc84d3a1d3 --- /dev/null +++ b/package/libs/zlib/patches/006-fix-CVE-2022-37434.patch @@ -0,0 +1,32 @@ +From eff308af425b67093bab25f80f1ae950166bece1 Mon Sep 17 00:00:00 2001 +From: Mark Adler +Date: Sat, 30 Jul 2022 15:51:11 -0700 +Subject: [PATCH] Fix a bug when getting a gzip header extra field with + inflate(). + +If the extra field was larger than the space the user provided with +inflateGetHeader(), and if multiple calls of inflate() delivered +the extra header data, then there could be a buffer overflow of the +provided space. This commit assures that provided space is not +exceeded. +--- + inflate.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/inflate.c b/inflate.c +index 7be8c6366..7a7289749 100644 +--- a/inflate.c ++++ b/inflate.c +@@ -763,9 +763,10 @@ int flush; + copy = state->length; + if (copy > have) copy = have; + if (copy) { ++ len = state->head->extra_len - state->length; + if (state->head != Z_NULL && +- state->head->extra != Z_NULL) { +- len = state->head->extra_len - state->length; ++ state->head->extra != Z_NULL && ++ len < state->head->extra_max) { + zmemcpy(state->head->extra + len, next, + len + copy > state->head->extra_max ? + state->head->extra_max - len : copy); From 122b625e7411a3711b6ed84b89676e73bb1e7de8 Mon Sep 17 00:00:00 2001 From: John Audia Date: Wed, 3 Aug 2022 14:15:01 -0400 Subject: [PATCH 19/54] kernel: bump 5.15 to 5.15.59 Patches automatically rebased. Build system: x86_64 Build-tested: bcm2711/RPi4B, mt7622/RT3200 Run-tested: bcm2711/RPi4B, mt7622/RT3200 Signed-off-by: John Audia --- include/kernel-5.15 | 4 ++-- .../ath79/patches-5.15/910-unaligned_access_hacks.patch | 8 ++++---- target/linux/generic/hack-5.15/902-debloat_proc.patch | 4 ++-- ...ix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch | 2 +- ...llow-rejecting-with-source-address-failed-policy.patch | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/kernel-5.15 b/include/kernel-5.15 index 5bbf12d6f4..716bcddf80 100644 --- a/include/kernel-5.15 +++ b/include/kernel-5.15 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.15 = .58 -LINUX_KERNEL_HASH-5.15.58 = d75bd9579c4b318e6162e21c591878fd37efda0f79c5cdd0dc4eb9ea9dfc4fa8 +LINUX_VERSION-5.15 = .59 +LINUX_KERNEL_HASH-5.15.59 = e6ddc642057340db06b3b921c2b31bfed2c611359e8f144c3e5cf9c3ac33bccb diff --git a/target/linux/ath79/patches-5.15/910-unaligned_access_hacks.patch b/target/linux/ath79/patches-5.15/910-unaligned_access_hacks.patch index ef9dab5508..1eaeefef00 100644 --- a/target/linux/ath79/patches-5.15/910-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-5.15/910-unaligned_access_hacks.patch @@ -305,7 +305,7 @@ list_for_each_entry(p, head, list) { --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c -@@ -613,48 +613,53 @@ static void tcp_options_write(__be32 *pt +@@ -610,48 +610,53 @@ static void tcp_options_write(__be32 *pt u16 options = opts->options; /* mungable copy */ if (unlikely(OPTION_MD5 & options)) { @@ -382,7 +382,7 @@ } if (unlikely(opts->num_sack_blocks)) { -@@ -662,16 +667,17 @@ static void tcp_options_write(__be32 *pt +@@ -659,16 +664,17 @@ static void tcp_options_write(__be32 *pt tp->duplicate_sack : tp->selective_acks; int this_sack; @@ -406,7 +406,7 @@ } tp->rx_opt.dsack = 0; -@@ -684,13 +690,14 @@ static void tcp_options_write(__be32 *pt +@@ -681,13 +687,14 @@ static void tcp_options_write(__be32 *pt if (foc->exp) { len = TCPOLEN_EXP_FASTOPEN_BASE + foc->len; @@ -706,7 +706,7 @@ EXPORT_SYMBOL(xfrm_parse_spi); --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -4138,14 +4138,16 @@ static bool tcp_parse_aligned_timestamp( +@@ -4140,14 +4140,16 @@ static bool tcp_parse_aligned_timestamp( { const __be32 *ptr = (const __be32 *)(th + 1); diff --git a/target/linux/generic/hack-5.15/902-debloat_proc.patch b/target/linux/generic/hack-5.15/902-debloat_proc.patch index fef28464bc..33d637f13e 100644 --- a/target/linux/generic/hack-5.15/902-debloat_proc.patch +++ b/target/linux/generic/hack-5.15/902-debloat_proc.patch @@ -341,7 +341,7 @@ Signed-off-by: Felix Fietkau --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c -@@ -3019,11 +3019,13 @@ static const struct seq_operations fib_r +@@ -3022,11 +3022,13 @@ static const struct seq_operations fib_r int __net_init fib_proc_init(struct net *net) { @@ -357,7 +357,7 @@ Signed-off-by: Felix Fietkau fib_triestat_seq_show, NULL)) goto out2; -@@ -3034,17 +3036,21 @@ int __net_init fib_proc_init(struct net +@@ -3037,17 +3039,21 @@ int __net_init fib_proc_init(struct net return 0; out3: diff --git a/target/linux/generic/pending-5.15/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-5.15/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch index 30c70a6be9..4e347a4671 100644 --- a/target/linux/generic/pending-5.15/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch +++ b/target/linux/generic/pending-5.15/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -7552,7 +7552,7 @@ static void __init alloc_node_mem_map(st +@@ -7556,7 +7556,7 @@ static void __init alloc_node_mem_map(st if (pgdat == NODE_DATA(0)) { mem_map = NODE_DATA(0)->node_mem_map; if (page_to_pfn(mem_map) != pgdat->node_start_pfn) diff --git a/target/linux/generic/pending-5.15/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-5.15/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch index 68960765bb..ac4396209e 100644 --- a/target/linux/generic/pending-5.15/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch +++ b/target/linux/generic/pending-5.15/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch @@ -66,7 +66,7 @@ Signed-off-by: Jonas Gorski static void rt_fibinfo_free(struct rtable __rcu **rtp) --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c -@@ -2767,6 +2767,7 @@ static const char *const rtn_type_names[ +@@ -2770,6 +2770,7 @@ static const char *const rtn_type_names[ [RTN_THROW] = "THROW", [RTN_NAT] = "NAT", [RTN_XRESOLVE] = "XRESOLVE", From ccff2fbaea50ae983a25483a40ae2dbaeeca5581 Mon Sep 17 00:00:00 2001 From: John Audia Date: Wed, 3 Aug 2022 14:32:51 -0400 Subject: [PATCH 20/54] kernel: bump 5.10 to 5.10.135 All patches automatically rebased. Signed-off-by: John Audia --- include/kernel-5.10 | 4 ++-- .../ath79/patches-5.10/910-unaligned_access_hacks.patch | 8 ++++---- ...ix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/kernel-5.10 b/include/kernel-5.10 index c2df3cb11a..8a4895d91b 100644 --- a/include/kernel-5.10 +++ b/include/kernel-5.10 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.10 = .134 -LINUX_KERNEL_HASH-5.10.134 = ec3513acdf033dd8f8ac2545cd1bb826b0669e151185e5f70408a5c9fe273269 +LINUX_VERSION-5.10 = .135 +LINUX_KERNEL_HASH-5.10.135 = e499a61be9ce670716dd27b5124bb9ef6c6bc0e8fab443abf717a77136543344 diff --git a/target/linux/ath79/patches-5.10/910-unaligned_access_hacks.patch b/target/linux/ath79/patches-5.10/910-unaligned_access_hacks.patch index ad19f8eaf9..713f01f20f 100644 --- a/target/linux/ath79/patches-5.10/910-unaligned_access_hacks.patch +++ b/target/linux/ath79/patches-5.10/910-unaligned_access_hacks.patch @@ -305,7 +305,7 @@ list_for_each_entry(p, head, list) { --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c -@@ -612,48 +612,53 @@ static void tcp_options_write(__be32 *pt +@@ -609,48 +609,53 @@ static void tcp_options_write(__be32 *pt u16 options = opts->options; /* mungable copy */ if (unlikely(OPTION_MD5 & options)) { @@ -382,7 +382,7 @@ } if (unlikely(opts->num_sack_blocks)) { -@@ -661,16 +666,17 @@ static void tcp_options_write(__be32 *pt +@@ -658,16 +663,17 @@ static void tcp_options_write(__be32 *pt tp->duplicate_sack : tp->selective_acks; int this_sack; @@ -406,7 +406,7 @@ } tp->rx_opt.dsack = 0; -@@ -683,13 +689,14 @@ static void tcp_options_write(__be32 *pt +@@ -680,13 +686,14 @@ static void tcp_options_write(__be32 *pt if (foc->exp) { len = TCPOLEN_EXP_FASTOPEN_BASE + foc->len; @@ -706,7 +706,7 @@ EXPORT_SYMBOL(xfrm_parse_spi); --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c -@@ -4092,14 +4092,16 @@ static bool tcp_parse_aligned_timestamp( +@@ -4093,14 +4093,16 @@ static bool tcp_parse_aligned_timestamp( { const __be32 *ptr = (const __be32 *)(th + 1); diff --git a/target/linux/generic/pending-5.10/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-5.10/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch index 0d1d3e1137..f788deabac 100644 --- a/target/linux/generic/pending-5.10/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch +++ b/target/linux/generic/pending-5.10/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch @@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf --- a/mm/page_alloc.c +++ b/mm/page_alloc.c -@@ -7055,7 +7055,7 @@ static void __ref alloc_node_mem_map(str +@@ -7059,7 +7059,7 @@ static void __ref alloc_node_mem_map(str if (pgdat == NODE_DATA(0)) { mem_map = NODE_DATA(0)->node_mem_map; if (page_to_pfn(mem_map) != pgdat->node_start_pfn) From b8f27251c9f755f7219391daa0e15318a12972a3 Mon Sep 17 00:00:00 2001 From: Olliver Schinagl Date: Sun, 31 Jul 2022 10:19:09 +0200 Subject: [PATCH 21/54] base-files: LED/gpio: Ensure inverted is read as a boolean The sysfs interface for the GPIO takes a boolean value. Ensure we get one from uci. Signed-off-by: Olliver Schinagl --- package/base-files/files/etc/init.d/led | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led index 51cb8b5178..732ac59a84 100755 --- a/package/base-files/files/etc/init.d/led +++ b/package/base-files/files/etc/init.d/led @@ -29,7 +29,7 @@ load_led() { config_get delay $1 delay "150" config_get message $1 message "" config_get gpio $1 gpio "0" - config_get inverted $1 inverted "0" + config_get_bool inverted $1 inverted "0" # execute application led trigger [ -f "/usr/libexec/led-trigger/${trigger}" ] && { From 404cad64709fbe3794f9116fb7c35708027d2ac8 Mon Sep 17 00:00:00 2001 From: Olliver Schinagl Date: Sun, 31 Jul 2022 10:11:58 +0200 Subject: [PATCH 22/54] base-files: LED/trigger/heartbeat: Add support for inversion The heartbeat trigger has the option to be inverted, however openwrt/uci/luci have no way to set this. This patch adds this support. Signed-off-by: Olliver Schinagl --- package/base-files/files/etc/init.d/led | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/base-files/files/etc/init.d/led b/package/base-files/files/etc/init.d/led index 732ac59a84..08a1e6df3b 100755 --- a/package/base-files/files/etc/init.d/led +++ b/package/base-files/files/etc/init.d/led @@ -69,6 +69,10 @@ load_led() { return 1 } case "$trigger" in + "heartbeat") + echo "${inverted}" > "/sys/class/leds/${sysfs}/invert" + ;; + "netdev") [ -n "$dev" ] && { echo $dev > /sys/class/leds/${sysfs}/device_name From 0cb1ce97485a051c9c526d92377769f8a083f7ef Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Wed, 3 Aug 2022 07:13:08 +0200 Subject: [PATCH 23/54] elfutils: update to 0.187 Changes: debuginfod: Support -C option for connection thread pooling. debuginfod-client: Negative cache file are now zero sized instead of no-permission files. addr2line: The -A, --absolute option, which shows file names including the full compilation directory is now the default. To get the old behavior use the new option --relative. readelf, elflint: Recognize FDO Packaging Metadata ELF notes libdw, debuginfo-client: Load libcurl lazily only when files need to be fetched remotely. libcurl is now never loaded when DEBUGINFOD_URLS is unset. And when DEBUGINFOD_URLS is set, libcurl is only loaded when the debuginfod_begin function is called. Signed-off-by: Nick Hainke --- package/libs/elfutils/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile index 2a7b5c50e2..4ca37d3b06 100644 --- a/package/libs/elfutils/Makefile +++ b/package/libs/elfutils/Makefile @@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=elfutils -PKG_VERSION:=0.186 +PKG_VERSION:=0.187 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION) -PKG_HASH:=7f6fb9149b1673d38d9178a0d3e0fb8a1ec4f53a9f4c2ff89469609879641177 +PKG_HASH:=e70b0dfbe610f90c4d1fe0d71af142a4e25c3c4ef9ebab8d2d72b65159d454c8 PKG_MAINTAINER:=Luiz Angelo Daros de Luca PKG_LICENSE:=GPL-3.0-or-later From b108810601ff1976a0c33f9c20186e50f5a74e7d Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sat, 2 Jul 2022 21:48:18 +0200 Subject: [PATCH 24/54] libtraceevent: add Linux kernel trace event library Needed by trace-cmd. Signed-off-by: Nick Hainke --- package/libs/libtraceevent/Makefile | 74 +++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 package/libs/libtraceevent/Makefile diff --git a/package/libs/libtraceevent/Makefile b/package/libs/libtraceevent/Makefile new file mode 100644 index 0000000000..9fb9304e76 --- /dev/null +++ b/package/libs/libtraceevent/Makefile @@ -0,0 +1,74 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=libtraceevent +PKG_VERSION:=1.6.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/snapshot/ +PKG_HASH:=1aaeb12f5842a843a06b733e3f4230b0937ba9c2ecd39345edf6f66cc8cbe795 + +PKG_MAINTAINER:=Nick Hainke + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libtraceevent + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Linux kernel trace event library + URL:=https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git + ABI_VERSION:=0 +endef + +define Package/libtraceevent/description +The libtraceevent library provides APIs to access kernel tracepoint events, located in +the tracefs file system under the events directory. +endef + +define Package/libtraceevent-extra + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Extra plugins for libtraceevent + DEPENDS:= +endef + +CONFIGURE_ARGS+= \ + --enable-shared \ + --enable-static + +PLUGINS_DIR := $(PKG_BUILD_DIR)/plugins +PLUGINS_MAIN := function hrtimer mac80211 sched_switch + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_BUILD_DIR)/include/traceevent $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/lib/libtraceevent.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_BUILD_DIR)/libtraceevent.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libtraceevent/install + $(INSTALL_DIR) $(1)/usr/lib/traceevent/plugins + $(CP) $(PKG_BUILD_DIR)/lib/libtraceevent.so.* $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) \ + $(patsubst %,$(PLUGINS_DIR)/plugin_%.so,$(PLUGINS_MAIN)) \ + $(1)/usr/lib/traceevent/plugins +endef + +define Package/libtraceevent-extra/install + $(INSTALL_DIR) $(1)/usr/lib/traceevent/plugins + $(CP) \ + $$(patsubst %,$(PLUGINS_DIR)/plugin_%.so, \ + $$(filter-out $(PLUGINS_MAIN), \ + $$(patsubst $(PLUGINS_DIR)/plugin_%.so,%, \ + $$(wildcard $(PLUGINS_DIR)/plugin_*.so)))) \ + $(1)/usr/lib/traceevent/plugins +endef + +$(eval $(call BuildPackage,libtraceevent)) +$(eval $(call BuildPackage,libtraceevent-extra)) From 6d84e78cd9633578d33a46b914a9cc5bae082f6b Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sat, 2 Jul 2022 21:49:37 +0200 Subject: [PATCH 25/54] libtracefs: add Linux kernel trace file system library Needed by trace-cmd. Signed-off-by: Nick Hainke --- package/libs/libtracefs/Makefile | 49 ++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 package/libs/libtracefs/Makefile diff --git a/package/libs/libtracefs/Makefile b/package/libs/libtracefs/Makefile new file mode 100644 index 0000000000..412c5fd122 --- /dev/null +++ b/package/libs/libtracefs/Makefile @@ -0,0 +1,49 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=libtracefs +PKG_VERSION:=1.4.2 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/snapshot/ +PKG_HASH:=8ad03e6d2a6227f6eb11692d9f04614d3da60ac6c5e4fe436e59b2bed90f031b + +PKG_MAINTAINER:=Nick Hainke + +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libtracefs + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Linux kernel trace file system library + URL:=https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git + DEPENDS+=+libpthread +libtraceevent + ABI_VERSION:=0 +endef + +define Package/libtracefs/description +The libtracefs library provides APIs to access kernel trace file system. +endef + +CONFIGURE_ARGS+= \ + --enable-shared \ + --enable-static \ + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_BUILD_DIR)/include/* $(1)/usr/include/ + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/lib/libtracefs.{a,so*} $(1)/usr/lib/ + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_BUILD_DIR)/libtracefs.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libtracefs/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/lib/libtracefs.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libtracefs)) From 9edda3169f6ad8f2f20b6e540ecdced40d530585 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sat, 2 Jul 2022 21:50:36 +0200 Subject: [PATCH 26/54] trace-cmd: update to v3.1.2 Remove outdated patches: - 100-musl.patch - 110-mac80211_tracepoint.patch Trace-cmd now uses libtracefs and livtraceevent as libraries. The plugins moved to libtraceevent. Signed-off-by: Nick Hainke --- package/devel/trace-cmd/Makefile | 26 +---- .../devel/trace-cmd/patches/100-musl.patch | 104 ------------------ .../patches/110-mac80211_tracepoint.patch | 24 ---- 3 files changed, 5 insertions(+), 149 deletions(-) delete mode 100644 package/devel/trace-cmd/patches/100-musl.patch delete mode 100644 package/devel/trace-cmd/patches/110-mac80211_tracepoint.patch diff --git a/package/devel/trace-cmd/Makefile b/package/devel/trace-cmd/Makefile index e15b04ad23..c9b0dc980b 100644 --- a/package/devel/trace-cmd/Makefile +++ b/package/devel/trace-cmd/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=trace-cmd -PKG_VERSION:=v2.9.1 +PKG_VERSION:=v3.1.2 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/rostedt/trace-cmd.git/snapshot/ -PKG_HASH:=9404fc3cf540ea795304608068c9db6cdb38b90584c7f3c43249785913d54b38 +PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/snapshot/ +PKG_HASH:=206672af60aa0bc35cfc44a4be746efa575bac729060e54b6453f7d5dfbcd979 PKG_LICENSE:=GPL-2.0-only PKG_LICENSE_FILES:=COPYING @@ -21,14 +21,14 @@ define Package/trace-cmd SECTION:=devel CATEGORY:=Development TITLE:=Linux trace command line utility - DEPENDS:= + DEPENDS:=+libtracefs +zlib endef define Package/trace-cmd-extra SECTION:=devel CATEGORY:=Development TITLE:=Extra plugins for trace-cmd - DEPENDS:= + DEPENDS:=+libtraceevent-extra endef MAKE_FLAGS += \ @@ -36,27 +36,11 @@ MAKE_FLAGS += \ NO_AUDIT=1 \ prefix=/usr -PLUGINS_DIR := $(PKG_INSTALL_DIR)/usr/lib/traceevent/plugins -PLUGINS_MAIN := function hrtimer mac80211 sched_switch - TARGET_CFLAGS += --std=gnu99 -D_GNU_SOURCE define Package/trace-cmd/install $(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/traceevent/plugins $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/trace-cmd $(1)/usr/bin/ - $(CP) \ - $(patsubst %,$(PLUGINS_DIR)/plugin_%.so,$(PLUGINS_MAIN)) \ - $(1)/usr/lib/traceevent/plugins -endef - -define Package/trace-cmd-extra/install - $(INSTALL_DIR) $(1)/usr/lib/traceevent/plugins - $(CP) \ - $$(patsubst %,$(PLUGINS_DIR)/plugin_%.so, \ - $$(filter-out $(PLUGINS_MAIN), \ - $$(patsubst $(PLUGINS_DIR)/plugin_%.so,%, \ - $$(wildcard $(PLUGINS_DIR)/plugin_*.so)))) \ - $(1)/usr/lib/traceevent/plugins endef $(eval $(call BuildPackage,trace-cmd)) diff --git a/package/devel/trace-cmd/patches/100-musl.patch b/package/devel/trace-cmd/patches/100-musl.patch deleted file mode 100644 index 80b419eb82..0000000000 --- a/package/devel/trace-cmd/patches/100-musl.patch +++ /dev/null @@ -1,104 +0,0 @@ -From 1a000636c1828eecdcec5360a51623ef4ffbff04 Mon Sep 17 00:00:00 2001 -From: Beniamin Sandu -Date: Mon, 30 Nov 2020 14:27:55 +0200 -Subject: trace-cmd: make it build against musl C library - -* add some missing headers and macros -* set pthread affinity using pthread_setaffinity_np after creating the thread -instead of pthread_attr_setaffinity_np (which seems to not be implemented -in musl) - -Tested using https://musl.cc/x86_64-linux-musl-native.tgz - -Link: https://lore.kernel.org/linux-trace-devel/20201130122755.31000-1-beniaminsandu@gmail.com - -Reviewed-by: Tzvetomir Stoyanov (VMware) -Signed-off-by: Beniamin Sandu -[ Fixed a whitespace issue ] -Signed-off-by: Steven Rostedt (VMware) ---- - include/trace-cmd/trace-cmd.h | 1 + - lib/trace-cmd/include/trace-cmd-local.h | 1 + - lib/tracefs/tracefs-events.c | 1 + - tracecmd/include/trace-local.h | 1 + - tracecmd/trace-tsync.c | 16 +++++++++++----- - 5 files changed, 20 insertions(+), 5 deletions(-) - ---- a/include/trace-cmd/trace-cmd.h -+++ b/include/trace-cmd/trace-cmd.h -@@ -6,6 +6,7 @@ - #ifndef _TRACE_CMD_H - #define _TRACE_CMD_H - -+#include - #include "traceevent/event-parse.h" - - #define TRACECMD_MAGIC { 23, 8, 68 } ---- a/lib/trace-cmd/include/trace-cmd-local.h -+++ b/lib/trace-cmd/include/trace-cmd-local.h -@@ -26,5 +26,6 @@ void warning(const char *fmt, ...); - #endif - #endif - -+#include - - #endif /* _TRACE_CMD_LOCAL_H */ ---- a/lib/tracefs/tracefs-events.c -+++ b/lib/tracefs/tracefs-events.c -@@ -13,6 +13,7 @@ - #include - #include - #include -+#include - - #include "kbuffer.h" - #include "tracefs.h" ---- a/tracecmd/include/trace-local.h -+++ b/tracecmd/include/trace-local.h -@@ -8,6 +8,7 @@ - - #include - #include /* for DIR */ -+#include - - #include "trace-cmd.h" - #include "event-utils.h" ---- a/tracecmd/trace-tsync.c -+++ b/tracecmd/trace-tsync.c -@@ -104,13 +104,16 @@ int tracecmd_host_tsync(struct buffer_in - - pthread_attr_init(&attrib); - pthread_attr_setdetachstate(&attrib, PTHREAD_CREATE_JOINABLE); -- if (!get_first_cpu(&pin_mask, &mask_size)) -- pthread_attr_setaffinity_np(&attrib, mask_size, pin_mask); - - ret = pthread_create(&instance->tsync_thread, &attrib, - tsync_host_thread, &instance->tsync); -- if (!ret) -+ -+ if (!ret) { -+ if (!get_first_cpu(&pin_mask, &mask_size)) -+ pthread_setaffinity_np(instance->tsync_thread, mask_size, pin_mask); - instance->tsync_thread_running = true; -+ } -+ - if (pin_mask) - CPU_FREE(pin_mask); - pthread_attr_destroy(&attrib); -@@ -243,11 +246,14 @@ unsigned int tracecmd_guest_tsync(char * - pthread_attr_init(&attrib); - tsync->sync_proto = proto; - pthread_attr_setdetachstate(&attrib, PTHREAD_CREATE_JOINABLE); -- if (!get_first_cpu(&pin_mask, &mask_size)) -- pthread_attr_setaffinity_np(&attrib, mask_size, pin_mask); - - ret = pthread_create(thr_id, &attrib, tsync_agent_thread, tsync); - -+ if (!ret) { -+ if (!get_first_cpu(&pin_mask, &mask_size)) -+ pthread_setaffinity_np(*thr_id, mask_size, pin_mask); -+ } -+ - if (pin_mask) - CPU_FREE(pin_mask); - pthread_attr_destroy(&attrib); diff --git a/package/devel/trace-cmd/patches/110-mac80211_tracepoint.patch b/package/devel/trace-cmd/patches/110-mac80211_tracepoint.patch deleted file mode 100644 index cffcaa06b5..0000000000 --- a/package/devel/trace-cmd/patches/110-mac80211_tracepoint.patch +++ /dev/null @@ -1,24 +0,0 @@ ---- a/lib/traceevent/plugins/plugin_mac80211.c -+++ b/lib/traceevent/plugins/plugin_mac80211.c -@@ -165,12 +165,15 @@ static int drv_config(struct trace_seq * - { 2, "IDLE" }, - { 3, "QOS"}, - ); -- tep_print_num_field(s, " chan:%d/", event, "center_freq", record, 1); -- print_enum(s, event, "channel_type", data, -- { 0, "noht" }, -- { 1, "ht20" }, -- { 2, "ht40-" }, -- { 3, "ht40+" }); -+ tep_print_num_field(s, " chan:%d@", event, "control_freq", record, 1); -+ print_enum(s, event, "chan_width", data, -+ { 0, "20_noht" }, -+ { 1, "20" }, -+ { 2, "40" }, -+ { 3, "80" }, -+ { 4, "80p80" }, -+ { 5, "160" }); -+ - trace_seq_putc(s, ' '); - SF("power_level"); - From 45255aa0e870f09eac3954ad0df5a88f13d25ea9 Mon Sep 17 00:00:00 2001 From: Lea Teuberth Date: Wed, 27 Jul 2022 17:50:40 +0200 Subject: [PATCH 27/54] ramips: adding support for Asus RP-AC56 Specifications: CPU: MT7621A dual-core 880MHz RAM: 64MB DDR2 FLASH: 16MB MX25L12805D NOR SPI WIFI: 2.4GHz 2x2 MT7603 b/g/n PCI WIFI: 5GHz 2x2 MT7662 a/b/ac PCI ETH: 1xLAN 1000base-T integrated SWITCH: MT7530 Port 0: LAN, Port 6: CPU LED: Power, 2.4GHz WiFi, 5GHz WiFi BTN: WPS, Reset UART: Near ETH port, from ETH: 3V3-TxD-GND-RxD 57600 8n1 MISC: Audio support Installation: 1. Update using recovery mode - while holdig "reset" button, power on the device - keep holding "reset" until power led is flashing yellow - set own IP to 192.168.1.75, subnet mask: 255.255.255.0 - push firmware image (can be factory.bin or sysupgrade.bin) using tftp client in binary mode to 192.168.1.1 Notes: This board has only two MAC addresses programmed in the "factory" partition: - MAC for wlan0 (2.4GHz) at offset 0x0004 - MAC for wlan1 (5GHz) at offset 0x8004 - stock firmware re-uses wlan0 MAC for ethernet - no valid addresses found in 0x28, 0x2e, 0xe000 and 0xe006 Signed-off-by: Lea Teuberth --- .../linux/ramips/dts/mt7621_asus_rp-ac56.dts | 243 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 16 ++ .../mt7621/base-files/etc/board.d/02_network | 1 + 3 files changed, 260 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_asus_rp-ac56.dts diff --git a/target/linux/ramips/dts/mt7621_asus_rp-ac56.dts b/target/linux/ramips/dts/mt7621_asus_rp-ac56.dts new file mode 100644 index 0000000000..5ae0ca6e82 --- /dev/null +++ b/target/linux/ramips/dts/mt7621_asus_rp-ac56.dts @@ -0,0 +1,243 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "asus,rp-ac56", "mediatek,mt7621-soc"; + model = "Asus RP-AC56"; + + aliases { + led-boot = &led_power_orange; + led-failsafe = &led_power_orange; + led-running = &led_power_white; + led-upgrade = &led_power_blue; + label-mac-device = &gmac0; + }; + + leds { + compatible = "gpio-leds"; + + wlan2g_red { + label = "red:wlan2g"; + gpios = <&gpio 16 GPIO_ACTIVE_HIGH>; + }; + + wlan2g_blue { + label = "blue:wlan2g"; + gpios = <&gpio 12 GPIO_ACTIVE_HIGH>; + }; + + wlan2g_green { + label = "green:wlan2g"; + gpios = <&gpio 13 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + + wlan5g_red { + label = "red:wlan5g"; + gpios = <&gpio 45 GPIO_ACTIVE_HIGH>; + }; + + wlan5g_blue { + label = "blue:wlan5g"; + gpios = <&gpio 43 GPIO_ACTIVE_HIGH>; + }; + + wlan5g_green { + label = "green:wlan5g"; + gpios = <&gpio 44 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy1tpt"; + }; + + led_power_white: power_white { + label = "white:power"; + gpios = <&gpio 48 GPIO_ACTIVE_HIGH>; + }; + + led_power_orange: power_orange { + label = "orange:power"; + gpios = <&gpio 47 GPIO_ACTIVE_HIGH>; + }; + + led_power_blue: power_blue { + label = "blue:power"; + gpios = <&gpio 46 GPIO_ACTIVE_HIGH>; + }; + }; + + keys { + compatible = "gpio-keys"; + + wps { + label = "wps"; + gpios = <&gpio 10 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + reset { + label = "reset"; + gpios = <&gpio 41 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + sound { + compatible = "simple-audio-card"; + simple-audio-card,name = "Audio-I2S"; + simple-audio-card,format = "i2s"; + simple-audio-card,bitclock-master = <&dailink0_master>; + simple-audio-card,frame-master = <&dailink0_master>; + simple-audio-card,routing = + "Headphone Jack", "HP_L", + "Headphone Jack", "HP_R"; + simple-audio-card,mclk-fs = <256>; + + simple-audio-card,cpu { + sound-dai = <&i2s>; + }; + + dailink0_master: simple-audio-card,codec { + sound-dai = <&codec>; + }; + }; +}; + +&gpio { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "nvram"; + reg = <0x30000 0x10000>; + read-only; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xfa0000>; + }; + + radio: partition@ff0000 { + label = "radio"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "uart2"; + function = "gpio"; + }; +}; + +&pinctrl { + i2s_pins: i2s { + i2s { + groups = "uart3"; + function = "i2s"; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x0000>; + ieee80211-freq-limit = <2400000 2500000>; + }; +}; + +&pcie1 { + wifi@0,0 { + compatible = "mediatek,mt76"; + reg = <0x0000 0 0 0 0>; + mediatek,mtd-eeprom = <&factory 0x8000>; + ieee80211-freq-limit = <5000000 6000000>; + }; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan"; + }; + }; +}; + +&xhci { + status = "disabled"; +}; + +&i2c { + status = "okay"; + + codec: wm8960@18 { + #sound-dai-cells = <0>; + compatible = "wlf,wm8960"; + reg = <0x18>; + wlf,shared-lrclk; + }; +}; + +&gdma { + status = "okay"; +}; + +&i2s { + #sound-dai-cells = <0>; + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&i2s_pins>; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index b560ce3d95..7cda0c8f75 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -189,6 +189,22 @@ define Device/asiarf_ap7621-nv1 endef TARGET_DEVICES += asiarf_ap7621-nv1 +define Device/asus_rp-ac56 + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + DEVICE_VENDOR := ASUS + DEVICE_MODEL := RP-AC56 + IMAGE_SIZE := 16000k + BLOCKSIZE := 64k + DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 \ + kmod-i2c-ralink kmod-sound-mt7620 + IMAGES += factory.bin + IMAGE/factory.bin := append-kernel | append-rootfs | pad-rootfs | check-size + IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \ + check-size | append-metadata +endef +TARGET_DEVICES += asus_rp-ac56 + define Device/asus_rp-ac87 $(Device/dsa-migration) $(Device/uimage-lzma-loader) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 400b03133e..88dc8c265e 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -9,6 +9,7 @@ ramips_setup_interfaces() case $board in ampedwireless,ally-00x19k|\ + asus,rp-ac56|\ asus,rp-ac87|\ edimax,re23s|\ mikrotik,routerboard-m11g|\ From b00a02aaa0fff867acfe02229f39bc47158f0874 Mon Sep 17 00:00:00 2001 From: David Yang Date: Wed, 9 Jun 2021 00:53:27 +0800 Subject: [PATCH 28/54] ramips: add support for Netgear PR2000 This patch adds support for Netgear PR2000, sold as "Travel Router and Range Extender". Specifications: -------------- * SoC: Mediatek MT7620N * RAM: 64MB DDR2 * Flash: 16MB SPI NOR flash (Macronix MX25L12805D) * WiFi 2.4GHz: builtin * Ethernet: builtin * LED: Power, Internet, WiFi, USB * Buttons: Reset (GPIO 1/2) * UART: Serial console (57600 8n1) * USB: 1 x USB2 SPECIAL NOTES: ------------- Problem: WiFi is super weak, but SSID beacons seems to be right. Solve: Change 36h in factory partition (namely 0xf60036) to be 0x0. Explain: Clearly Netgear have different ideas on how EEPROM is used. Bit 2 of 36h indicates the presence of External LNA for 11g (2.4 GHz) band, which seems to be incorrectly set by Netgear (originally 0x04). Lifting it solves the problem of weak RX signal. Installation: ------------ There are two possible ways to install the firmware. Flashing via web interface of original firmware is not tested due to a broken firmware. 1) Open the shell and use a UART2USB convert to gain TTY access (TP7: RXD, TP9: TXD, TP10: GND). Please notice you have to remove resistance R54 next to TP7 otherwise you won't be able to input anything. 2) Use well-known Netgear debug switch. Access http://192.168.168.1/setup.cgi?todo=debug to start telnet service (username: root, password: ). Please back up firmware if you want to go back to the original. After you can control the device, flash the firmware as usual. Here are some hints for that. Option 1 (via nmrpflash): 1) Download nmrpflash from https://github.com/jclehner/nmrpflash 2) Use *-factory.img and flash: nmrpflash -L nmrpflash -i net* -f 3) Turn off then turn on the device, wait it finishing flash. Option 2 (replacing u-boot via breed): 1) Download breed-mt7620-reset1.bin from https://breed.hackpascal.net/ 2) Setup HTTP server on your computer, for example: python3 -m http.server You can skip this step if your breed is already accessible from HTTP, since the original wget does not support HTTPS. 3) Connect to the route and flash breed: cd /tmp wget http:///breed-mt7620-reset1.bin dd if=breed-mt7620-reset1.bin of=/dev/mtdblock0 bs=64k 4) Reboot. Hold reset key or press any key in TTY to enter breed. 5) Access breed web interface (http://192.168.1.1/). Choose memory layout to be 0x40000 and flash new firmware. Remark: ------ As a "Range Extender", it has a switch to switch between Wired mode (GPIO 21 low) and Wireless mode (GPIO 20 low), which is not implemented in this patch. However, the router will be turned off when it switches to the middle, which makes this switch much less useful. MAC addresses: ------------- The OEM firmware uses one single MAC for all interfaces, located at 0xf700b0. Signed-off-by: David Yang --- .../ramips/dts/mt7620n_netgear_pr2000.dts | 191 ++++++++++++++++++ target/linux/ramips/image/mt7620.mk | 15 ++ .../mt7620/base-files/etc/board.d/01_leds | 3 + .../mt7620/base-files/etc/board.d/02_network | 1 + 4 files changed, 210 insertions(+) create mode 100644 target/linux/ramips/dts/mt7620n_netgear_pr2000.dts diff --git a/target/linux/ramips/dts/mt7620n_netgear_pr2000.dts b/target/linux/ramips/dts/mt7620n_netgear_pr2000.dts new file mode 100644 index 0000000000..6b4dde5432 --- /dev/null +++ b/target/linux/ramips/dts/mt7620n_netgear_pr2000.dts @@ -0,0 +1,191 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7620n.dtsi" + +#include +#include + +/ { + compatible = "netgear,pr2000", "ralink,mt7620n-soc"; + model = "Netgear PR2000"; + + aliases { + label-mac-device = ðernet; + }; + + leds { + compatible = "gpio-leds"; + + internet { + label = "green:internet"; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + }; + + wifi { + label = "green:wifi"; + gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + usb { + label = "green:usb"; + gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; + trigger-sources = <&ohci_port1>, <&ehci_port1>; + linux,default-trigger = "usbport"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wireless { + label = "wireless"; + gpios = <&gpio0 20 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + + wired { + label = "wired"; + gpios = <&gpio0 21 GPIO_ACTIVE_LOW>; + linux,code = ; + linux,input-type = ; + }; + }; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + }; + + /* sercomm header for kernel starts at 0x3ffba + * can be safely ignored since not used by OpenWRT + */ + + partition@40000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x40000 0xf20000>; + }; + + factory: partition@f60000 { + label = "factory"; + reg = <0xf60000 0x10000>; + read-only; + }; + + board_data: partition@f70000 { + label = "board_data"; + reg = <0xf70000 0x10000>; + read-only; + }; + + partition@f80000 { + label = "POT"; + reg = <0xf80000 0x10000>; + read-only; + }; + + partition@f90000 { + label = "Traffic Meter"; + reg = <0xf90000 0x10000>; + read-only; + }; + + partition@fa0000 { + label = "Traffic Meter2"; + reg = <0xfa0000 0x10000>; + read-only; + }; + + partition@fb0000 { + label = "nvram"; + reg = <0xfb0000 0x10000>; + }; + + partition@fc0000 { + label = "DPF"; + reg = <0xfc0000 0x10000>; + read-only; + }; + + partition@fd0000 { + label = "ralink_nvram"; + reg = <0xfd0000 0x10000>; + read-only; + }; + + partition@fe0000 { + label = "reserved1"; + reg = <0xfe0000 0x10000>; + read-only; + }; + + partition@ff0000 { + label = "reserved2"; + reg = <0xff0000 0x10000>; + read-only; + }; + }; + }; +}; + +ðernet { + mtd-mac-address = <&board_data 0xb0>; + mediatek,portmap = "wllll"; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0x0>; + mtd-mac-address = <&board_data 0xb0>; +}; + +&state_default { + default { + groups = "ephy", "wled", "pa", "i2c"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index d2a2c90460..b3551fa6cb 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -802,6 +802,21 @@ define Device/netgear_jwnr2010-v5 endef TARGET_DEVICES += netgear_jwnr2010-v5 +define Device/netgear_pr2000 + $(Device/netgear_sercomm_nor) + SOC := mt7620n + BLOCKSIZE := 4k + IMAGE_SIZE := 15488k + DEVICE_MODEL := PR2000 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci + SERCOMM_HWNAME := PR2000 + SERCOMM_HWID := AQ7 + SERCOMM_HWVER := A001 + SERCOMM_SWVER := 0x0000 + SERCOMM_PAD := 640k +endef +TARGET_DEVICES += netgear_pr2000 + define Device/netgear_wn3000rp-v3 SOC := mt7620a IMAGE_SIZE := 7872k diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds index 1293c34cbf..889818c631 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds @@ -177,6 +177,9 @@ netgear,jwnr2010-v5) ucidef_set_led_switch "lan4" "lan4" "green:lan4" "switch0" "0x01" ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10" ;; +netgear,pr2000) + ucidef_set_led_switch "internet" "internet" "green:internet" "switch0" "0x01" + ;; phicomm,psg1208) ucidef_set_led_netdev "wifi_led" "wifi" "white:wlan2g" "wlan0" ;; diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network index f7bc41669f..7b1766766b 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network @@ -202,6 +202,7 @@ ramips_setup_interfaces() ucidef_add_switch "switch1" \ "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0" ;; + netgear,pr2000|\ nexx,wt3020-4m|\ nexx,wt3020-8m) ucidef_add_switch "switch0" \ From 577f3fdbc92c91e252ee3b134637816a240d89f7 Mon Sep 17 00:00:00 2001 From: David Yang Date: Sun, 6 Jun 2021 22:42:49 +0800 Subject: [PATCH 29/54] ramips: add support for Netcore NW5212 This patch adds support for Netcore NW5212, provided by some carrier in China. Specifications: -------------- * SoC: Mediatek MT7620A * RAM: 128MB DDR2 * Flash: 16MB SPI NOR flash (Winbond W25Q128BV) * WiFi 2.4GHz: builtin * Ethernet: builtin * LED: Power, WAN, LAN 1-4, WiFi * Buttons: Reset (GPIO 13) * UART: Serial console (57600 8n1) * USB: 1 x USB2 Installation: ------------ The router comes with OpenWrt 14.07 built with MTK SDK. However, as the modem is provided by carriers, so the web interface is highly minimized and only contains a static page with no interaction options. There are two possible ways to gain the access. 1) Open the shell and use a UART2USB convert to gain TTY access. Please notice you have to remove resistance R54 at the back of the board otherwise you won't be able to input anything. 2) Use built-in backdoor. Access http://192.168.1.1/cgi-bin/_/testxst to start dropbear service at port 9122. Be warned the software is super old and only diffie-hellman-group1-sha1, diffie-hellman-group14-sha1, kexguess2@matt.ucc.asn.au is support, you may not be able to connect it with an up-to-date ssh client. After you can control the device, flash the firmware as usual. Here are some hints for that. Option 1 (via original firmware): 1) Setup HTTP server on your computer, for example: python3 -m http.server 2) Connect to the route and flash: cd /tmp wget http:/// mtd -r write firmware Option 2 (replacing u-boot via breed): 1) Download breed-mt7620-reset13.bin from https://breed.hackpascal.net/ 2) Setup HTTP server on your computer, for example: python3 -m http.server You can skip this step if your breed is already accessible from HTTP, since the original wget does not support HTTPS. 3) Connect to the route and flash breed: cd /tmp wget http:///breed-mt7620-reset13.bin mtd write breed-mt7620-reset13.bin Bootloader 4) Reboot. Hold reset key or press any key in TTY to enter breed. 5) Access breed web interface (http://192.168.1.1/). Choose the flash layout to be 0x50000 and flash new firmware. MAC addresses: ------------- There are three MACs stored in factory, as in MT7620A reference design: source address usage 0x4 label WLAN 0x28 label MAC 1 0x2e label + 1 MAC 2 However, the OEM firmware only uses one single MAC (label) for all interfaces, probably a misconfiguration. Signed-off-by: David Yang --- .../ramips/dts/mt7620a_netcore_nw5212.dts | 132 ++++++++++++++++++ target/linux/ramips/image/mt7620.mk | 10 ++ .../mt7620/base-files/etc/board.d/01_leds | 15 +- .../mt7620/base-files/etc/board.d/02_network | 1 + 4 files changed, 151 insertions(+), 7 deletions(-) create mode 100644 target/linux/ramips/dts/mt7620a_netcore_nw5212.dts diff --git a/target/linux/ramips/dts/mt7620a_netcore_nw5212.dts b/target/linux/ramips/dts/mt7620a_netcore_nw5212.dts new file mode 100644 index 0000000000..25287ebc0b --- /dev/null +++ b/target/linux/ramips/dts/mt7620a_netcore_nw5212.dts @@ -0,0 +1,132 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7620a.dtsi" + +#include +#include + +/ { + compatible = "netcore,nw5212", "ralink,mt7620a-soc"; + model = "Netcore NW5212"; + + aliases { + label-mac-device = ðernet; + }; + + leds { + compatible = "gpio-leds"; + + lan4 { + label = "green:lan4"; + gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; + }; + + lan3 { + label = "green:lan3"; + gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; + }; + + lan2 { + label = "green:lan2"; + gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; + }; + + lan1 { + label = "green:lan1"; + gpios = <&gpio2 3 GPIO_ACTIVE_LOW>; + }; + + wan { + label = "green:wan"; + gpios = <&gpio2 4 GPIO_ACTIVE_LOW>; + }; + + wlan2g { + label = "green:wlan2g"; + gpios = <&gpio3 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; +}; + +&gpio2 { + status = "okay"; +}; + +&gpio3 { + status = "okay"; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <70000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x30000 0x10000>; + }; + + factory: partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; + }; +}; + +&state_default { + gpio { + groups = "uartf", "wled", "ephy"; + function = "gpio"; + }; +}; + +ðernet { + mtd-mac-address = <&factory 0x28>; + mediatek,portmap = "llllw"; +}; + +&ehci { + status = "okay"; +}; + +&ohci { + status = "okay"; +}; + +&wmac { + ralink,mtd-eeprom = <&factory 0x0>; +}; diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk index b3551fa6cb..f6ad162779 100644 --- a/target/linux/ramips/image/mt7620.mk +++ b/target/linux/ramips/image/mt7620.mk @@ -729,6 +729,16 @@ define Device/microduino_microwrt endef TARGET_DEVICES += microduino_microwrt +define Device/netcore_nw5212 + SOC := mt7620a + IMAGE_SIZE := 16064k + BLOCKSIZE := 4k + DEVICE_VENDOR := Netcore + DEVICE_MODEL := NW5212 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci +endef +TARGET_DEVICES += netcore_nw5212 + define Device/netgear_ex2700 SOC := mt7620a NETGEAR_HW_ID := 29764623+4+0+32+2x2+0 diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds index 889818c631..b1dc36672d 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds @@ -160,6 +160,14 @@ lenovo,newifi-y1s) ucidef_set_led_netdev "wifi5g" "WIFI5G" "blue:wifi" "wlan0" ucidef_set_led_netdev "wan" "WAN" "blue:internet" "eth0.2" "tx rx" ;; +netcore,nw5212|\ +netgear,jwnr2010-v5) + ucidef_set_led_switch "lan1" "lan1" "green:lan1" "switch0" "0x08" + ucidef_set_led_switch "lan2" "lan2" "green:lan2" "switch0" "0x04" + ucidef_set_led_switch "lan3" "lan3" "green:lan3" "switch0" "0x02" + ucidef_set_led_switch "lan4" "lan4" "green:lan4" "switch0" "0x01" + ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10" + ;; netgear,ex2700|\ netgear,wn3000rp-v3|\ netgear,wn3100rp-v2) @@ -170,13 +178,6 @@ netgear,ex6130) ucidef_set_led_netdev "wlan5g" "ROUTER (green)" "green:router" "wlan0" ucidef_set_led_netdev "wlan2g" "DEVICE (green)" "green:device" "wlan1" ;; -netgear,jwnr2010-v5) - ucidef_set_led_switch "lan1" "lan1" "green:lan1" "switch0" "0x08" - ucidef_set_led_switch "lan2" "lan2" "green:lan2" "switch0" "0x04" - ucidef_set_led_switch "lan3" "lan3" "green:lan3" "switch0" "0x02" - ucidef_set_led_switch "lan4" "lan4" "green:lan4" "switch0" "0x01" - ucidef_set_led_switch "wan" "wan" "green:wan" "switch0" "0x10" - ;; netgear,pr2000) ucidef_set_led_switch "internet" "internet" "green:internet" "switch0" "0x01" ;; diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network index 7b1766766b..79df102056 100644 --- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network @@ -111,6 +111,7 @@ ramips_setup_interfaces() "0:lan" "6@eth0" ;; dlink,dir-810l|\ + netcore,nw5212|\ netgear,jwnr2010-v5|\ phicomm,k2-v22.4|\ phicomm,k2-v22.5|\ From 2293f1abe4d17c9ed9593f4e24fc73836f99dea5 Mon Sep 17 00:00:00 2001 From: Reto Schneider Date: Fri, 11 Jun 2021 11:19:51 +0200 Subject: [PATCH 30/54] ramips: mt7628: fix memory controller reset bit According to MediaTek MT7688 Datasheet v1.4, as well as the MT7628 counterpart, the memory controller reset bit (MC_RST) is 10, not 20. Reset bit 20 is used for for UART 2 (UART2_RST). Please note: Due to the lack of hardware, I was not able to test this change. Signed-off-by: Reto Schneider --- target/linux/ramips/dts/mt7628an.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/ramips/dts/mt7628an.dtsi b/target/linux/ramips/dts/mt7628an.dtsi index 7bc001207b..8ef73dce80 100644 --- a/target/linux/ramips/dts/mt7628an.dtsi +++ b/target/linux/ramips/dts/mt7628an.dtsi @@ -76,7 +76,7 @@ compatible = "ralink,mt7620a-memc", "ralink,rt3050-memc"; reg = <0x300 0x100>; - resets = <&rstctrl 20>; + resets = <&rstctrl 10>; reset-names = "mc"; interrupt-parent = <&intc>; From 50e1f3d84db6fce48dd094f31cb55197db4c0d55 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Burfeind Date: Mon, 11 Jul 2022 22:42:59 +0200 Subject: [PATCH 31/54] ath79: rename references of UniFi to UniFi AP extract the compatible and model to make room for other variants follow-up of commit dc23df8a8ca7 ("ath79: change Ubiquiti UniFi AP model name to include "AP"") Signed-off-by: Jan-Niklas Burfeind --- target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dts | 8 ++++++++ .../{ar7241_ubnt_unifi.dts => ar7241_ubnt_unifi-ap.dtsi} | 3 --- target/linux/ath79/image/generic-ubnt.mk | 6 +++--- 3 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dts rename target/linux/ath79/dts/{ar7241_ubnt_unifi.dts => ar7241_ubnt_unifi-ap.dtsi} (95%) diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dts b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dts new file mode 100644 index 0000000000..e9f57c0bbe --- /dev/null +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar7241_ubnt_unifi-ap.dtsi" + +/ { + compatible = "ubnt,unifi", "qca,ar7241"; + model = "Ubiquiti UniFi AP"; +}; diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi.dts b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi similarity index 95% rename from target/linux/ath79/dts/ar7241_ubnt_unifi.dts rename to target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi index 3c50e89d01..c70a1c02db 100644 --- a/target/linux/ath79/dts/ar7241_ubnt_unifi.dts +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap.dtsi @@ -3,9 +3,6 @@ #include "ar7241_ubnt_unifi.dtsi" / { - compatible = "ubnt,unifi", "qca,ar7241"; - model = "Ubiquiti UniFi AP"; - aliases { led-boot = &led_dome_green; led-failsafe = &led_dome_green; diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk index 69f7a94863..e6a6de48f0 100644 --- a/target/linux/ath79/image/generic-ubnt.mk +++ b/target/linux/ath79/image/generic-ubnt.mk @@ -210,12 +210,12 @@ define Device/ubnt_routerstation-pro endef TARGET_DEVICES += ubnt_routerstation-pro -define Device/ubnt_unifi +define Device/ubnt_unifi-ap $(Device/ubnt-bz) DEVICE_MODEL := UniFi AP - SUPPORTED_DEVICES += unifi + SUPPORTED_DEVICES += unifi ubnt,unifi endef -TARGET_DEVICES += ubnt_unifi +TARGET_DEVICES += ubnt_unifi-ap define Device/ubnt_unifiac DEVICE_VENDOR := Ubiquiti From 75dffdc8cf78ecbb73b25169ba6ad05fff48acaf Mon Sep 17 00:00:00 2001 From: Jan-Niklas Burfeind Date: Mon, 11 Jul 2022 22:43:00 +0200 Subject: [PATCH 32/54] ath79: add variant UniFi AP LR The hardware difference is the antenna which has a higher gain compared to the original UniFi AP. The variant was supported before in ar71xx. Signed-off-by: Jan-Niklas Burfeind --- target/linux/ath79/dts/ar7241_ubnt_unifi-ap-lr.dts | 8 ++++++++ target/linux/ath79/image/generic-ubnt.mk | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 target/linux/ath79/dts/ar7241_ubnt_unifi-ap-lr.dts diff --git a/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-lr.dts b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-lr.dts new file mode 100644 index 0000000000..ab2b455228 --- /dev/null +++ b/target/linux/ath79/dts/ar7241_ubnt_unifi-ap-lr.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar7241_ubnt_unifi-ap.dtsi" + +/ { + compatible = "ubnt,unifi", "qca,ar7241"; + model = "Ubiquiti UniFi AP LR"; +}; diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk index e6a6de48f0..fe158e584b 100644 --- a/target/linux/ath79/image/generic-ubnt.mk +++ b/target/linux/ath79/image/generic-ubnt.mk @@ -217,6 +217,14 @@ define Device/ubnt_unifi-ap endef TARGET_DEVICES += ubnt_unifi-ap +define Device/ubnt_unifi-ap-lr + $(Device/ubnt-bz) + DEVICE_MODEL := UniFi AP + DEVICE_VARIANT := LR + SUPPORTED_DEVICES += unifi ubnt,unifi ubnt,unifi-ap +endef +TARGET_DEVICES += ubnt_unifi-ap-lr + define Device/ubnt_unifiac DEVICE_VENDOR := Ubiquiti SOC := qca9563 From 0dc58214896aacf67a3759495d70e2b4e9c160d8 Mon Sep 17 00:00:00 2001 From: Manuel Niekamp Date: Wed, 22 Jun 2022 22:56:29 +0200 Subject: [PATCH 33/54] ath79: add support for Sophos AP15 The Sophos AP15 seems to be very close to Sophos AP55/AP100. Based on: commit 6f1efb289837 ("ath79: add support for Sophos AP100/AP55 family") author Andrew Powers-Holmes Fri, 3 Sep 2021 15:53:57 +0200 (23:53 +1000) committer Hauke Mehrtens Sat, 16 Apr 2022 16:59:29 +0200 (16:59 +0200) Unique to AP15: - Green and yellow LED - 2T2R 2.4GHz 802.11b/g/n via SoC WMAC - No buttons - No piezo beeper - No 5.8GHz Flashing instructions: - Derived from UART method described in referenced commit, methods described there should work too. - Set up a TFTP server; IP address has to be 192.168.99.8/24 - Copy the firmware (initramfs-kernel) to your TFTP server directory renaming it to e.g. boot.bin - Open AP's enclosure and locate UART header (there is a video online) - Terminal connection parameters are 115200 8/N/1 - Connect TFTP server and AP via ethernet - Power up AP and cancel autoboot when prompted - Prompt shows 'ath> ' - Commands used to boot: ath> tftpboot 0x81000000 boot.bin ath> bootm 0x81000000 - Device should boot OpenWRT - IP address after boot is 192.168.1.1/24 - Connect to device via browser - Permanently flash using the web ui (flashing sysupgrade image) - (BTW: the AP55 images seem to work too, only LEDs are not working) Testing done: - To be honest: Currently not so much testing done. - Flashed onto two devices - Devices are booting - MAC addresses are correct - LEDs are working - Scanning for WLANs is working Big thanks to all the people working on this great project! (Sorry about my english, it is not my native language) Signed-off-by: Manuel Niekamp --- package/boot/uboot-envtools/files/ath79 | 1 + .../linux/ath79/dts/qca9558_sophos_ap15.dts | 138 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 1 + target/linux/ath79/image/generic.mk | 9 ++ 5 files changed, 150 insertions(+) create mode 100644 target/linux/ath79/dts/qca9558_sophos_ap15.dts diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index e1a4423497..a435e06a0d 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -126,6 +126,7 @@ plasmacloud,pa300e) qihoo,c301) ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x10000" ;; +sophos,ap15|\ sophos,ap55|\ sophos,ap55c|\ sophos,ap100|\ diff --git a/target/linux/ath79/dts/qca9558_sophos_ap15.dts b/target/linux/ath79/dts/qca9558_sophos_ap15.dts new file mode 100644 index 0000000000..bb4b058a9a --- /dev/null +++ b/target/linux/ath79/dts/qca9558_sophos_ap15.dts @@ -0,0 +1,138 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x.dtsi" + +#include +#include + +/ { + compatible = "sophos,ap15", "qca,qca9558"; + model = "Sophos AP15"; + + aliases { + led-boot = &led_status_green; + led-failsafe = &led_status_yellow; + led-running = &led_status_green; + led-upgrade = &led_status_yellow; + label-mac-device = ð0; + }; + + chosen { + bootargs = "console=ttyS0,115200n8"; + }; + + leds { + compatible = "gpio-leds"; + + led_status_green: status_green { + label = "green:status"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + led_status_yellow: status_yellow { + label = "yellow:status"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&pcie0 { + status = "okay"; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <25000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x040000 0x010000>; + }; + + art: partition@50000 { + label = "art"; + reg = <0x050000 0x010000>; + read-only; + }; + + config: partition@60000 { + label = "config"; + reg = <0x060000 0x010000>; + read-only; + }; + + partition@70000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x070000 0xf90000>; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy-mask = <0x10>; + + phy4: ethernet-phy@4 { + reg = <4>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0xa6000000 0xa0000101 0xa0001313>; + + nvmem-cells = <&macaddr_config_201a>; + nvmem-cell-names = "mac-address"; + + phy-mode = "rgmii-id"; + phy-handle = <&phy4>; + + gmac_config: gmac-config { + device = <&gmac>; + + rgmii-enabled = <1>; + + rxdv-delay = <3>; + rxd-delay = <3>; + txen-delay = <3>; + txd-delay = <3>; + }; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; + +&config { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_201a: macaddr@201a { + reg = <0x201a 0x6>; + }; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index 84221da80d..f10737f2fb 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -65,6 +65,7 @@ ath79_setup_interfaces() pisen,wmb001n|\ pisen,wmm003n|\ siemens,ws-ap3610|\ + sophos,ap15|\ sophos,ap55|\ sophos,ap55c|\ sophos,ap100|\ diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index 56e42f1e31..0aa3e006f6 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -30,6 +30,7 @@ case "$FIRMWARE" in qxwlan,e1700ac-v2-16m|\ qxwlan,e600gac-v2-8m|\ qxwlan,e600gac-v2-16m|\ + sophos,ap15|\ sophos,ap55|\ sophos,ap55c|\ sophos,ap100|\ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 7442a0f68c..4aa6ed6480 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -2417,6 +2417,15 @@ define Device/sitecom_wlr-8100 endef TARGET_DEVICES += sitecom_wlr-8100 +define Device/sophos_ap15 + SOC := qca9558 + DEVICE_VENDOR := Sophos + DEVICE_MODEL := AP15 + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct + IMAGE_SIZE := 15936k +endef +TARGET_DEVICES += sophos_ap15 + define Device/sophos_ap55 SOC := qca9558 DEVICE_VENDOR := Sophos From 2cc50592404a634fff32f2e07c2754508b89d9b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Valentin?= Date: Fri, 17 Jun 2022 21:35:03 +0200 Subject: [PATCH 34/54] ramips: add support for ZyXEL LTE3301-Plus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ZyXEL LTE3301-PLUS is an 4G indoor CPE with 2 external LTE antennas. Specifications: - SoC: MediaTek MT7621AT - RAM: 256 MB - Flash: 128 MB MB NAND (MX30LF1G18AC) - WiFi: MediaTek MT7615E - Switch: 4 LAN ports (Gigabit) - LTE: Quectel EG506 connected by USB3 to SoC - SIM: 1 micro-SIM slot - USB: USB3 port - Buttons: Reset, WPS - LEDs: Multicolour power, internet, LTE, signal, Wifi, USB - Power: 12V, 1.5A The device is built as an indoor ethernet to LTE bridge or router with Wifi. UART Serial: 57600N1 Located on populated 5 pin header J5: [o] GND [ ] key - no pin [o] RX [o] TX [o] 3.3V Vcc MAC assignment: lan: 98:0d:67:ee:85:54 (base, on the device back) wlan: 98:0d:67:ee:85:55 Installation from web GUI: - Log in as "admin" on http://192.168.1.1/ - Upload OpenWrt initramfs-recovery.bin image on the Maintenance -> Firmware page - Wait for OpenWrt to boot and ssh to root@192.168.1.1 - format ubi device: ubiformat /dev/mtd6 - attach ubi device: ubiattach -m6 - create rootfs volume: ubimkvol /dev/ubi0 -n0 -N rootfs -s 1MiB - rootfs_data volume: ubimkvol /dev/ubi0 -n1 -N rootfs_data -s 1MiB - run sysupgrade with sysupgrade image For more details about flashing see commit 2449a632084b ("ramips: mt7621: Add support for ZyXEL NR7101"). Please note that this commit is needed: firmware-utils: add marcant changes for ZyXEL NBG6716 and LTE3301-PLUS Signed-off-by: André Valentin --- package/boot/uboot-envtools/files/ramips | 3 + .../ramips/dts/mt7621_zyxel_lte3301-plus.dts | 217 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 19 ++ .../mt7621/base-files/etc/board.d/01_leds | 3 + .../mt7621/base-files/etc/board.d/02_network | 3 +- .../base-files/etc/board.d/03_gpio_switches | 4 + .../mt7621/base-files/etc/init.d/bootcount | 5 + .../mt7621/base-files/lib/upgrade/platform.sh | 1 + 8 files changed, 254 insertions(+), 1 deletion(-) create mode 100644 target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index 9d19398b36..f7f4821cef 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -81,6 +81,9 @@ xiaomi,redmi-router-ac2100) ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x4000" "0x20000" ;; +zyxel,lte3301-plus) + ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x80000" + ;; zyxel,nr7101) idx="$(find_mtd_index Config)" [ -n "$idx" ] && \ diff --git a/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts b/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts new file mode 100644 index 0000000000..ed8260534e --- /dev/null +++ b/target/linux/ramips/dts/mt7621_zyxel_lte3301-plus.dts @@ -0,0 +1,217 @@ +/dts-v1/; + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "zyxel,lte3301-plus", "mediatek,mt7621-soc"; + model = "ZyXEL LTE3301-Plus"; + + aliases { + label-mac-device = &gmac0; + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + }; + + + chosen { + bootargs = "console=ttyS0,57600"; + }; + + gpio_export { + compatible = "gpio-export"; + #size-cells = <0>; + + power_modem { + gpio-export,name = "power_modem"; + gpio-export,output = <1>; + gpios = <&gpio 27 GPIO_ACTIVE_LOW>; + }; + + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + wps { + label = "wps"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "lte3301-plus:white:power"; + gpios = <&gpio 5 GPIO_ACTIVE_HIGH>; + }; + + wifi { + label = "lte3301-plus:white:wifi"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + internet { + label = "lte3301-plus:white:internet"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + }; + + usb { + label = "lte3301-plus:white:usb"; + gpios = <&gpio 24 GPIO_ACTIVE_LOW>; + }; + + lte { + label = "lte3301-plus:white:lte"; + gpios = <&gpio 26 GPIO_ACTIVE_LOW>; + }; + + mobile_green { + label = "lte3301-plus:green:mobile"; + gpios = <&gpio 31 GPIO_ACTIVE_LOW>; + }; + + mobile_orange { + label = "lte3301-plus:orange:mobile"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + }; + + mobile_red { + label = "lte3301-plus:red:mobile"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + }; + +}; + +&gpio { + status = "okay"; + + enable_usb_power { + gpio-hog; + line-name = "enable USB power"; + gpios = <7 GPIO_ACTIVE_HIGH>; + output-high; + }; +}; + +&nand { + status = "okay"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "uboot"; + reg = <0x00000 0x80000>; /* 64 KB */ + }; + partition@80000 { + label = "uboot_env"; + reg = <0x80000 0x80000>; /* 64 KB */ + }; + factory: partition@100000 { + label = "factory"; + reg = <0x100000 0x40000>; + }; + partition@140000 { + label = "Kernel"; + reg = <0x140000 0x1ec0000>; + }; + partition@2140000 { + label = "kernel2"; + reg = <0x2140000 0x1ec0000>; + }; + partition@4000000 { + label = "wwan"; + reg = <0x4000000 0x100000>; + }; + partition@4100000 { + label = "ubi"; + reg = <0x4100000 0x3ee0000>; + }; + }; +}; + +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + +&state_default { + gpio { + groups = "i2c", "rgmii2", "uart3", "jtag", "wdt"; + function = "gpio"; + }; + +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_fe6e>; + nvmem-cell-names = "mac-address"; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan4"; + }; + port@1 { + status = "okay"; + label = "lan3"; + }; + port@2 { + status = "okay"; + label = "lan2"; + }; + port@3 { + status = "okay"; + label = "lan1"; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&pcie0 { + status = "okay"; + mt7615d@0,0 { + /* In reality at hangs at pcie1, this is a driver bug */ + compatible = "pci14c3,7615"; + reg = <0x0000 0 0 0 0>; + mediatek,firmware-eeprom = "mt7615e_eeprom.bin"; + mediatek,mtd-eeprom = <&factory 0x0000>; + nvmem-cells = <&macaddr_factory_fe6e>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <(1)>; + }; + +}; + +&factory { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + mtd-mac-address = <&factory 0xfe6e>; + + macaddr_factory_fe6e: macaddr@fe6e { + reg = <0xfe6e 0x6>; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 7cda0c8f75..cc6dbe9418 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -2259,6 +2259,25 @@ define Device/zio_freezio endef TARGET_DEVICES += zio_freezio +define Device/zyxel_lte3301-plus + $(Device/dsa-migration) + BLOCKSIZE := 128k + PAGESIZE := 2048 + UBINIZE_OPTS := -E 5 + DEVICE_VENDOR := ZyXEL + DEVICE_MODEL := LTE3301-PLUS + DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware kmod-usb3 \ + uboot-envtools kmod-usb-ledtrig-usbport kmod-usb-net-qmi-wwan \ + kmod-usb-serial-option uqmi + KERNEL := $(KERNEL_DTB) | uImage lzma | \ + zytrx-header $$(DEVICE_MODEL) $$(VERSION_DIST)-$$(REVISION) + KERNEL_INITRAMFS := $(KERNEL_DTB) | uImage lzma | \ + zytrx-header $$(DEVICE_MODEL) 9.99(ABQU.1)$$(VERSION_DIST)-recovery + KERNEL_INITRAMFS_SUFFIX := -recovery.bin + IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata +endef +TARGET_DEVICES += zyxel_lte3301-plus + define Device/zyxel_nr7101 $(Device/dsa-migration) BLOCKSIZE := 128k diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds index 4b912283e1..9f62a29aa7 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds @@ -168,6 +168,9 @@ zbtlink,zbt-wg1608-16m) ucidef_set_led_netdev "lan4" "LAN4" "green:lan-4" "lan4" ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan" ;; +zyxel,lte3301-plus) + ucidef_set_led_netdev "internet" "internet" "white:internet" "wwan0" + ;; esac board_config_flush diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network index 88dc8c265e..7211422364 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network @@ -76,7 +76,8 @@ ramips_setup_interfaces() ucidef_set_interface_lan "lan1 lan2" ;; linksys,re6500|\ - netgear,wac104) + netgear,wac104|\ + zyxel,lte3301-plus) ucidef_set_interface_lan "lan1 lan2 lan3 lan4" ;; mikrotik,routerboard-750gr3) diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches b/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches index ed728b07c4..4bf2aa37e0 100644 --- a/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches +++ b/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches @@ -22,6 +22,10 @@ ubnt,edgerouter-x-sfp) ucidef_add_gpio_switch "poe_power_port3" "PoE Power Port3" "403" ucidef_add_gpio_switch "poe_power_port4" "PoE Power Port4" "404" ;; +zyxel,lte3301-plus) + ucidef_add_gpio_switch "usb_power" "Power USB Port" "usb_power" "1" + ucidef_add_gpio_switch "lte_power" "Power LTE modem" "lte_power" "1" + ;; zyxel,nr7101) ucidef_add_gpio_switch "lte_reset" "Reset LTE/5G modem" "483" ;; diff --git a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount index 8382bdf0c5..4ebe50fdfe 100755 --- a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount +++ b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount @@ -20,6 +20,11 @@ boot() { samknows,whitebox-v8) fw_setenv bootcount 0 ;; + zyxel,lte3301-plus) + [ $(printf %d $(fw_printenv -n DebugFlag)) -gt 0 ] || fw_setenv DebugFlag 1 + [ $(printf %d $(fw_printenv -n Image1Stable)) -gt 0 ] || fw_setenv Image1Stable 1 + [ $(printf %d $(fw_printenv -n Image1Try)) -gt 0 ] && fw_setenv Image1Try 0 + ;; zyxel,nr7101) [ $(printf %d $(fw_printenv -n DebugFlag)) -gt 0 ] || fw_setenv DebugFlag 0x1 [ $(printf %d $(fw_printenv -n Image1Stable)) -gt 0 ] || fw_setenv Image1Stable 1 diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index 9af46202ba..80490c377d 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -119,6 +119,7 @@ platform_do_upgrade() { ubnt,edgerouter-x-sfp) platform_upgrade_ubnt_erx "$1" ;; + zyxel,lte3301-plus|\ zyxel,nr7101) fw_setenv CheckBypass 0 fw_setenv Image1Stable 0 From 606e357bf824a314a0c6a147539974e99e8aabe1 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Fri, 29 Jul 2022 18:35:55 +0200 Subject: [PATCH 35/54] kernel: netsupport: kmod-sched: Remove sch_fq_codel and sch_fifo The sch_fq_codel.ko and the sch_fifo.ko are always compiled into the kernel, they are activated in the generic kernel configuration. There is no need to activate the build of these kernel modules in the kmod-sched* packages. Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/netsupport.mk | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index af720128eb..cebc46daac 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -739,7 +739,7 @@ $(eval $(call KernelPackage,mppe)) SCHED_MODULES = $(patsubst $(LINUX_DIR)/net/sched/%.ko,%,$(wildcard $(LINUX_DIR)/net/sched/*.ko)) -SCHED_MODULES_CORE = sch_ingress sch_fq_codel sch_hfsc sch_htb sch_tbf cls_basic cls_fw cls_route cls_flow cls_tcindex cls_u32 em_u32 act_gact act_mirred act_skbedit cls_matchall +SCHED_MODULES_CORE = sch_ingress sch_hfsc sch_htb sch_tbf cls_basic cls_fw cls_route cls_flow cls_tcindex cls_u32 em_u32 act_gact act_mirred act_skbedit cls_matchall SCHED_MODULES_FILTER = $(SCHED_MODULES_CORE) act_connmark act_ctinfo sch_cake sch_netem sch_mqprio em_ipset cls_bpf cls_flower act_bpf act_vlan SCHED_MODULES_EXTRA = $(filter-out $(SCHED_MODULES_FILTER),$(SCHED_MODULES)) SCHED_FILES = $(patsubst %,$(LINUX_DIR)/net/sched/%.ko,$(filter $(SCHED_MODULES_CORE),$(SCHED_MODULES))) @@ -754,7 +754,6 @@ define KernelPackage/sched-core CONFIG_NET_SCH_HTB \ CONFIG_NET_SCH_TBF \ CONFIG_NET_SCH_INGRESS \ - CONFIG_NET_SCH_FQ_CODEL \ CONFIG_NET_CLS=y \ CONFIG_NET_CLS_ACT=y \ CONFIG_NET_CLS_BASIC \ @@ -908,7 +907,6 @@ define KernelPackage/sched KCONFIG:= \ CONFIG_NET_SCH_CODEL \ CONFIG_NET_SCH_DSMARK \ - CONFIG_NET_SCH_FIFO \ CONFIG_NET_SCH_GRED \ CONFIG_NET_SCH_MULTIQ \ CONFIG_NET_SCH_PRIO \ From 3cc878a8d3e4d2d445bf2ee34883e9326bfa0bb2 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Fri, 29 Jul 2022 18:35:56 +0200 Subject: [PATCH 36/54] kernel: netsupport: kmod-sched: Add kmod-lib-textsearch dependency The CONFIG_NET_EMATCH_TEXT configuration option depends on the kmod-lib-textsearch package. Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/netsupport.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index cebc46daac..e51817b6cf 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -903,7 +903,7 @@ $(eval $(call KernelPackage,bpf-test)) define KernelPackage/sched SUBMENU:=$(NETWORK_SUPPORT_MENU) TITLE:=Extra traffic schedulers - DEPENDS:=+kmod-sched-core +kmod-ipt-core +kmod-lib-crc32c + DEPENDS:=+kmod-sched-core +kmod-ipt-core +kmod-lib-crc32c +kmod-lib-textsearch KCONFIG:= \ CONFIG_NET_SCH_CODEL \ CONFIG_NET_SCH_DSMARK \ From 1b956e66ccafc962033260567c2f1e845f71683f Mon Sep 17 00:00:00 2001 From: Thomas Langer Date: Fri, 29 Jul 2022 18:35:57 +0200 Subject: [PATCH 37/54] kernel: netsupport: kmod-sched: explicitly define included modules Change SCHED_MODULES_EXTRA to an explicit list of modules instead of taking everything that is not filtered out. This removes the need of updating the filter each time an extra sch_*, act_* or similar is added with an own kmod definition. Signed-off-by: Thomas Langer Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/netsupport.mk | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index e51817b6cf..e412a909b1 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -738,12 +738,8 @@ endef $(eval $(call KernelPackage,mppe)) -SCHED_MODULES = $(patsubst $(LINUX_DIR)/net/sched/%.ko,%,$(wildcard $(LINUX_DIR)/net/sched/*.ko)) SCHED_MODULES_CORE = sch_ingress sch_hfsc sch_htb sch_tbf cls_basic cls_fw cls_route cls_flow cls_tcindex cls_u32 em_u32 act_gact act_mirred act_skbedit cls_matchall -SCHED_MODULES_FILTER = $(SCHED_MODULES_CORE) act_connmark act_ctinfo sch_cake sch_netem sch_mqprio em_ipset cls_bpf cls_flower act_bpf act_vlan -SCHED_MODULES_EXTRA = $(filter-out $(SCHED_MODULES_FILTER),$(SCHED_MODULES)) -SCHED_FILES = $(patsubst %,$(LINUX_DIR)/net/sched/%.ko,$(filter $(SCHED_MODULES_CORE),$(SCHED_MODULES))) -SCHED_FILES_EXTRA = $(patsubst %,$(LINUX_DIR)/net/sched/%.ko,$(SCHED_MODULES_EXTRA)) +SCHED_FILES_CORE = $(foreach mod,$(SCHED_MODULES_CORE),$(LINUX_DIR)/net/sched/$(mod).ko) define KernelPackage/sched-core SUBMENU:=$(NETWORK_SUPPORT_MENU) @@ -768,7 +764,7 @@ define KernelPackage/sched-core CONFIG_NET_CLS_MATCHALL \ CONFIG_NET_EMATCH=y \ CONFIG_NET_EMATCH_U32 - FILES:=$(SCHED_FILES) + FILES:=$(SCHED_FILES_CORE) AUTOLOAD:=$(call AutoLoad,70, $(SCHED_MODULES_CORE)) endef @@ -900,6 +896,9 @@ endef $(eval $(call KernelPackage,bpf-test)) +SCHED_MODULES_EXTRA = sch_codel sch_dsmark sch_gred sch_multiq sch_prio sch_red sch_sfq sch_teql sch_fq sch_pie act_police act_ipt act_pedit act_simple act_csum em_cmp em_nbyte em_meta em_text +SCHED_FILES_EXTRA = $(foreach mod,$(SCHED_MODULES_EXTRA),$(LINUX_DIR)/net/sched/$(mod).ko) + define KernelPackage/sched SUBMENU:=$(NETWORK_SUPPORT_MENU) TITLE:=Extra traffic schedulers From c94ba95e6cd41ccf8f15e77ebe7b7d65e5fd4396 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Fri, 29 Jul 2022 18:35:58 +0200 Subject: [PATCH 38/54] kernel: netsupport: kmod-sched: Reorder packages This puts the kmod-sched packages into an alphabetical order. I kept the kmod-sched-core at the top as this is the main package. No changes other than reordering were done. Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/netsupport.mk | 122 +++++++++++---------- 1 file changed, 63 insertions(+), 59 deletions(-) diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index e412a909b1..4bd988ad92 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -775,6 +775,37 @@ endef $(eval $(call KernelPackage,sched-core)) +define KernelPackage/sched-act-vlan + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=Traffic VLAN manipulation + DEPENDS:=+kmod-sched-core + KCONFIG:=CONFIG_NET_ACT_VLAN + FILES:=$(LINUX_DIR)/net/sched/act_vlan.ko + AUTOLOAD:=$(call AutoProbe, act_vlan) +endef + +define KernelPackage/sched-act-vlan/description + Allows to configure rules to push or pop vlan headers. +endef + +$(eval $(call KernelPackage,sched-act-vlan)) + + +define KernelPackage/sched-bpf + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=Traffic shaper support for Berkeley Packet Filter + KCONFIG:= \ + CONFIG_NET_CLS_BPF \ + CONFIG_NET_ACT_BPF + FILES:= \ + $(LINUX_DIR)/net/sched/cls_bpf.ko \ + $(LINUX_DIR)/net/sched/act_bpf.ko + AUTOLOAD:=$(call AutoLoad,72,cls_bpf act_bpf) +endef + +$(eval $(call KernelPackage,sched-bpf)) + + define KernelPackage/sched-cake SUBMENU:=$(NETWORK_SUPPORT_MENU) TITLE:=Cake fq_codel/blue derived shaper @@ -790,6 +821,29 @@ endef $(eval $(call KernelPackage,sched-cake)) + +define KernelPackage/sched-connmark + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=Traffic shaper conntrack mark support + DEPENDS:=+kmod-sched-core +kmod-ipt-core +kmod-ipt-conntrack-extra + KCONFIG:=CONFIG_NET_ACT_CONNMARK + FILES:=$(LINUX_DIR)/net/sched/act_connmark.ko + AUTOLOAD:=$(call AutoLoad,71, act_connmark) +endef +$(eval $(call KernelPackage,sched-connmark)) + + +define KernelPackage/sched-ctinfo + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=Traffic shaper ctinfo support + DEPENDS:=+kmod-sched-core +kmod-ipt-core +kmod-ipt-conntrack-extra + KCONFIG:=CONFIG_NET_ACT_CTINFO + FILES:=$(LINUX_DIR)/net/sched/act_ctinfo.ko + AUTOLOAD:=$(call AutoLoad,71, act_ctinfo) +endef +$(eval $(call KernelPackage,sched-ctinfo)) + + define KernelPackage/sched-flower SUBMENU:=$(NETWORK_SUPPORT_MENU) TITLE:=Flower traffic classifier @@ -806,20 +860,18 @@ endef $(eval $(call KernelPackage,sched-flower)) -define KernelPackage/sched-act-vlan +define KernelPackage/sched-ipset SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Traffic VLAN manipulation - DEPENDS:=+kmod-sched-core - KCONFIG:=CONFIG_NET_ACT_VLAN - FILES:=$(LINUX_DIR)/net/sched/act_vlan.ko - AUTOLOAD:=$(call AutoProbe, act_vlan) + TITLE:=Traffic shaper ipset support + DEPENDS:=+kmod-sched-core +kmod-ipt-ipset + KCONFIG:= \ + CONFIG_NET_EMATCH_IPSET + FILES:= \ + $(LINUX_DIR)/net/sched/em_ipset.ko + AUTOLOAD:=$(call AutoLoad,72,em_ipset) endef -define KernelPackage/sched-act-vlan/description - Allows to configure rules to push or pop vlan headers. -endef - -$(eval $(call KernelPackage,sched-act-vlan)) +$(eval $(call KernelPackage,sched-ipset)) define KernelPackage/sched-mqprio @@ -837,54 +889,6 @@ endef $(eval $(call KernelPackage,sched-mqprio)) -define KernelPackage/sched-connmark - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Traffic shaper conntrack mark support - DEPENDS:=+kmod-sched-core +kmod-ipt-core +kmod-ipt-conntrack-extra - KCONFIG:=CONFIG_NET_ACT_CONNMARK - FILES:=$(LINUX_DIR)/net/sched/act_connmark.ko - AUTOLOAD:=$(call AutoLoad,71, act_connmark) -endef -$(eval $(call KernelPackage,sched-connmark)) - -define KernelPackage/sched-ctinfo - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Traffic shaper ctinfo support - DEPENDS:=+kmod-sched-core +kmod-ipt-core +kmod-ipt-conntrack-extra - KCONFIG:=CONFIG_NET_ACT_CTINFO - FILES:=$(LINUX_DIR)/net/sched/act_ctinfo.ko - AUTOLOAD:=$(call AutoLoad,71, act_ctinfo) -endef -$(eval $(call KernelPackage,sched-ctinfo)) - -define KernelPackage/sched-ipset - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Traffic shaper ipset support - DEPENDS:=+kmod-sched-core +kmod-ipt-ipset - KCONFIG:= \ - CONFIG_NET_EMATCH_IPSET - FILES:= \ - $(LINUX_DIR)/net/sched/em_ipset.ko - AUTOLOAD:=$(call AutoLoad,72,em_ipset) -endef - -$(eval $(call KernelPackage,sched-ipset)) - - -define KernelPackage/sched-bpf - SUBMENU:=$(NETWORK_SUPPORT_MENU) - TITLE:=Traffic shaper support for Berkeley Packet Filter - KCONFIG:= \ - CONFIG_NET_CLS_BPF \ - CONFIG_NET_ACT_BPF - FILES:= \ - $(LINUX_DIR)/net/sched/cls_bpf.ko \ - $(LINUX_DIR)/net/sched/act_bpf.ko - AUTOLOAD:=$(call AutoLoad,72,cls_bpf act_bpf) -endef - -$(eval $(call KernelPackage,sched-bpf)) - define KernelPackage/bpf-test SUBMENU:=$(NETWORK_SUPPORT_MENU) From fa85e44d3c4437327a0ad592831f1746b8b2dc3a Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Fri, 29 Jul 2022 18:35:59 +0200 Subject: [PATCH 39/54] kernel: netsupport: Add kmod-sched-drr This adds a package with the DRR scheduler. Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/netsupport.mk | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index 4bd988ad92..ab358aeaaf 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -844,6 +844,22 @@ endef $(eval $(call KernelPackage,sched-ctinfo)) +define KernelPackage/sched-drr + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=Deficit Round Robin scheduler (DRR) + DEPENDS:=+kmod-sched-core + KCONFIG:=CONFIG_NET_SCH_DRR + FILES:=$(LINUX_DIR)/net/sched/sch_drr.ko + AUTOLOAD:=$(call AutoProbe,sch_drr) +endef + +define KernelPackage/sched-drr/description + DRR algorithm Configuration +endef + +$(eval $(call KernelPackage,sched-drr)) + + define KernelPackage/sched-flower SUBMENU:=$(NETWORK_SUPPORT_MENU) TITLE:=Flower traffic classifier From 0e3911b6084ac596a3da6b1a255776e44331beef Mon Sep 17 00:00:00 2001 From: Thomas Langer Date: Fri, 29 Jul 2022 18:36:00 +0200 Subject: [PATCH 40/54] kernel: netsupport: Extract sched-prio and sched-red Extract the kmod-sched-prio and kmod-sched-red kernel modules from the big kmod-sched package. This allows adding the two kernel modules to OpenWrt without adding the kmod-sched and all its depdnecy. Signed-off-by: Thomas Langer Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/netsupport.mk | 36 ++++++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index ab358aeaaf..8b984ec17f 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -906,6 +906,38 @@ endef $(eval $(call KernelPackage,sched-mqprio)) +define KernelPackage/sched-prio + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=Multi Band Priority Queueing (PRIO) + DEPENDS:=+kmod-sched-core + KCONFIG:=CONFIG_NET_SCH_PRIO + FILES:=$(LINUX_DIR)/net/sched/sch_prio.ko + AUTOLOAD:=$(call AutoProbe,sch_prio) +endef + +define KernelPackage/sched-prio/description + PRIO algorithm Configuration +endef + +$(eval $(call KernelPackage,sched-prio)) + + +define KernelPackage/sched-red + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=Random Early Detection (RED) + DEPENDS:=+kmod-sched-core + KCONFIG:=CONFIG_NET_SCH_RED + FILES:=$(LINUX_DIR)/net/sched/sch_red.ko + AUTOLOAD:=$(call AutoProbe,sch_red) +endef + +define KernelPackage/sched-red/description + Random Early Detection (RED) algorithm Configuration +endef + +$(eval $(call KernelPackage,sched-red)) + + define KernelPackage/bpf-test SUBMENU:=$(NETWORK_SUPPORT_MENU) TITLE:=Test Berkeley Packet Filter functionality @@ -916,7 +948,7 @@ endef $(eval $(call KernelPackage,bpf-test)) -SCHED_MODULES_EXTRA = sch_codel sch_dsmark sch_gred sch_multiq sch_prio sch_red sch_sfq sch_teql sch_fq sch_pie act_police act_ipt act_pedit act_simple act_csum em_cmp em_nbyte em_meta em_text +SCHED_MODULES_EXTRA = sch_codel sch_dsmark sch_gred sch_multiq sch_sfq sch_teql sch_fq sch_pie act_police act_ipt act_pedit act_simple act_csum em_cmp em_nbyte em_meta em_text SCHED_FILES_EXTRA = $(foreach mod,$(SCHED_MODULES_EXTRA),$(LINUX_DIR)/net/sched/$(mod).ko) define KernelPackage/sched @@ -928,8 +960,6 @@ define KernelPackage/sched CONFIG_NET_SCH_DSMARK \ CONFIG_NET_SCH_GRED \ CONFIG_NET_SCH_MULTIQ \ - CONFIG_NET_SCH_PRIO \ - CONFIG_NET_SCH_RED \ CONFIG_NET_SCH_SFQ \ CONFIG_NET_SCH_TEQL \ CONFIG_NET_SCH_FQ \ From aba1bdaed8cb612d4a4d9e8bba2dc963d6ceca76 Mon Sep 17 00:00:00 2001 From: Thomas Langer Date: Fri, 29 Jul 2022 18:36:01 +0200 Subject: [PATCH 41/54] kernel: netsupport: Add kmod-sched-act-sample This adds the act_sample.ko and psample.ko kernel module which allows traffic sampling. Signed-off-by: Thomas Langer Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/netsupport.mk | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index 8b984ec17f..74af7a9e41 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -775,6 +775,26 @@ endef $(eval $(call KernelPackage,sched-core)) +define KernelPackage/sched-act-sample + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=Traffic Sampling + DEPENDS:=+kmod-sched-core + KCONFIG:= \ + CONFIG_NET_ACT_SAMPLE \ + CONFIG_PSAMPLE + FILES:= \ + $(LINUX_DIR)/net/psample/psample.ko \ + $(LINUX_DIR)/net/sched/act_sample.ko + AUTOLOAD:=$(call AutoProbe,act_sample psample) +endef + +define KernelPackage/sched-act-sample/description + Packet sampling tc action. +endef + +$(eval $(call KernelPackage,sched-act-sample)) + + define KernelPackage/sched-act-vlan SUBMENU:=$(NETWORK_SUPPORT_MENU) TITLE:=Traffic VLAN manipulation From 6a2e9f3da6d0f0f3ae382db1e77a65c2f0e67d24 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Fri, 29 Jul 2022 18:36:02 +0200 Subject: [PATCH 42/54] kernel: ipt-ipset: Add ipset/ip_set_hash_ipmac.ko Add the ipset/ip_set_hash_ipmac.ko file. The CONFIG_IP_SET_HASH_IPMAC KConfig option is already set by the package. Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/netfilter.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/package/kernel/linux/modules/netfilter.mk b/package/kernel/linux/modules/netfilter.mk index 9808649e70..22b7dbd285 100644 --- a/package/kernel/linux/modules/netfilter.mk +++ b/package/kernel/linux/modules/netfilter.mk @@ -348,6 +348,7 @@ IPSET_MODULES:= \ ipset/ip_set_bitmap_ipmac \ ipset/ip_set_bitmap_port \ ipset/ip_set_hash_ip \ + ipset/ip_set_hash_ipmac \ ipset/ip_set_hash_ipmark \ ipset/ip_set_hash_ipport \ ipset/ip_set_hash_ipportip \ From 0582acf42967e47c16eb3193f91ca65b01b57e8e Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Thu, 4 Aug 2022 18:44:51 +0200 Subject: [PATCH 43/54] kernel: netsupport: Extract act_police This extracts kmod-sched-act-police to allow using it without adding all the packages from the big kmod-sched package. Signed-off-by: Hauke Mehrtens --- package/kernel/linux/modules/netsupport.mk | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index 74af7a9e41..9b99aa1d21 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -775,6 +775,18 @@ endef $(eval $(call KernelPackage,sched-core)) +define KernelPackage/sched-act-police + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=Traffic Policing + DEPENDS:=+kmod-sched-core + KCONFIG:=CONFIG_NET_ACT_POLICE + FILES:=$(LINUX_DIR)/net/sched/act_police.ko + AUTOLOAD:=$(call AutoProbe,act_police) +endef + +$(eval $(call KernelPackage,sched-act-police)) + + define KernelPackage/sched-act-sample SUBMENU:=$(NETWORK_SUPPORT_MENU) TITLE:=Traffic Sampling @@ -968,7 +980,7 @@ endef $(eval $(call KernelPackage,bpf-test)) -SCHED_MODULES_EXTRA = sch_codel sch_dsmark sch_gred sch_multiq sch_sfq sch_teql sch_fq sch_pie act_police act_ipt act_pedit act_simple act_csum em_cmp em_nbyte em_meta em_text +SCHED_MODULES_EXTRA = sch_codel sch_dsmark sch_gred sch_multiq sch_sfq sch_teql sch_fq sch_pie act_ipt act_pedit act_simple act_csum em_cmp em_nbyte em_meta em_text SCHED_FILES_EXTRA = $(foreach mod,$(SCHED_MODULES_EXTRA),$(LINUX_DIR)/net/sched/$(mod).ko) define KernelPackage/sched @@ -984,7 +996,6 @@ define KernelPackage/sched CONFIG_NET_SCH_TEQL \ CONFIG_NET_SCH_FQ \ CONFIG_NET_SCH_PIE \ - CONFIG_NET_ACT_POLICE \ CONFIG_NET_ACT_IPT \ CONFIG_NET_ACT_PEDIT \ CONFIG_NET_ACT_SIMP \ From 23c77384f3d191a825fff5e58807ab6d539d5e0e Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Sun, 7 Aug 2022 10:30:10 +0200 Subject: [PATCH 44/54] trace-cmd: import patch to fix autodetection of libzstd libzstd from the packages feed gets picked up. Add patch adding NO_LIBZSTD option like in perf and enable it. Signed-off-by: Nick Hainke --- package/devel/trace-cmd/Makefile | 3 +- ...NO_LIBZSTD-option-to-disable-libzstd.patch | 38 +++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 package/devel/trace-cmd/patches/100-tracecmd-add-NO_LIBZSTD-option-to-disable-libzstd.patch diff --git a/package/devel/trace-cmd/Makefile b/package/devel/trace-cmd/Makefile index c9b0dc980b..3f96d43b77 100644 --- a/package/devel/trace-cmd/Makefile +++ b/package/devel/trace-cmd/Makefile @@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=trace-cmd PKG_VERSION:=v3.1.2 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/snapshot/ @@ -34,6 +34,7 @@ endef MAKE_FLAGS += \ NO_PYTHON=1 \ NO_AUDIT=1 \ + NO_LIBZSTD=1 \ prefix=/usr TARGET_CFLAGS += --std=gnu99 -D_GNU_SOURCE diff --git a/package/devel/trace-cmd/patches/100-tracecmd-add-NO_LIBZSTD-option-to-disable-libzstd.patch b/package/devel/trace-cmd/patches/100-tracecmd-add-NO_LIBZSTD-option-to-disable-libzstd.patch new file mode 100644 index 0000000000..447e3b0790 --- /dev/null +++ b/package/devel/trace-cmd/patches/100-tracecmd-add-NO_LIBZSTD-option-to-disable-libzstd.patch @@ -0,0 +1,38 @@ +From 4fcc23ee4291f445cada012b6bef6879274a25f1 Mon Sep 17 00:00:00 2001 +From: Nick Hainke +Date: Sun, 7 Aug 2022 10:11:06 +0200 +Subject: [PATCH] tracecmd: add NO_LIBZSTD option to disable libzstd + +Other Linux kernel tools like perf already include options to disable +libzstd manually. Add this option also to trace-cmd. + +The OpenWrt SDK fails to build trace-cmd due to the autodetection of +libzstd. The package is present in some feed repositories but should +not be used by trace-cmd. The compilation will fail with: + + Package trace-cmd is missing dependencies for the following libraries: + libzstd.so.1 + +Signed-off-by: Nick Hainke +--- + Makefile | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/Makefile ++++ b/Makefile +@@ -320,6 +320,7 @@ CFLAGS += -DHAVE_ZLIB + $(info Have zlib compression support) + endif + ++ifndef NO_LIBZSTD + TEST_LIBZSTD = $(shell sh -c "$(PKG_CONFIG) --atleast-version 1.4.0 libzstd > /dev/null 2>&1 && echo y") + + ifeq ("$(TEST_LIBZSTD)", "y") +@@ -335,6 +336,7 @@ $(info ******************************* + endif + + export LIBZSTD_CFLAGS LIBZSTD_LDLAGS ZSTD_INSTALLED ++endif + + CUNIT_INSTALLED := $(shell if (printf "$(pound)include \n void main(){CU_initialize_registry();}" | $(CC) -o /dev/null -x c - -lcunit >/dev/null 2>&1) ; then echo 1; else echo 0 ; fi) + export CUNIT_INSTALLED From 8b804cae5e039142bc63896a75f15146eca3bebc Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Mon, 1 Aug 2022 15:07:44 +0200 Subject: [PATCH 45/54] mac80211: backport upstream fix for unitialized lock usage Backports upstream fix from 5.19 lockdep complains use of uninitialized spinlock at ieee80211_do_stop() [1], for commit f856373e2f31ffd3 ("wifi: mac80211: do not wake queues on a vif that is being stopped") guards clear_bit() using fq.lock even before fq_init() from ieee80211_txq_setup_flows() initializes this spinlock. According to discussion [2], Toke was not happy with expanding usage of fq.lock. Since __ieee80211_wake_txqs() is called under RCU read lock, we can instead use synchronize_rcu() for flushing ieee80211_wake_txqs(). Signed-off-by: Koen Vandeputte --- ...-not-abuse-fq.lock-in-ieee80211_do_s.patch | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 package/kernel/mac80211/patches/subsys/340-wifi-mac80211-do-not-abuse-fq.lock-in-ieee80211_do_s.patch diff --git a/package/kernel/mac80211/patches/subsys/340-wifi-mac80211-do-not-abuse-fq.lock-in-ieee80211_do_s.patch b/package/kernel/mac80211/patches/subsys/340-wifi-mac80211-do-not-abuse-fq.lock-in-ieee80211_do_s.patch new file mode 100644 index 0000000000..82243f1d98 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/340-wifi-mac80211-do-not-abuse-fq.lock-in-ieee80211_do_s.patch @@ -0,0 +1,46 @@ +From aa40d5a43526cca9439a2b45fcfdcd016594dece Mon Sep 17 00:00:00 2001 +From: Tetsuo Handa +Date: Sun, 17 Jul 2022 21:21:52 +0900 +Subject: [PATCH] wifi: mac80211: do not abuse fq.lock in ieee80211_do_stop() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +lockdep complains use of uninitialized spinlock at ieee80211_do_stop() [1], +for commit f856373e2f31ffd3 ("wifi: mac80211: do not wake queues on a vif +that is being stopped") guards clear_bit() using fq.lock even before +fq_init() from ieee80211_txq_setup_flows() initializes this spinlock. + +According to discussion [2], Toke was not happy with expanding usage of +fq.lock. Since __ieee80211_wake_txqs() is called under RCU read lock, we +can instead use synchronize_rcu() for flushing ieee80211_wake_txqs(). + +Link: https://syzkaller.appspot.com/bug?extid=eceab52db7c4b961e9d6 [1] +Link: https://lkml.kernel.org/r/874k0zowh2.fsf@toke.dk [2] +Reported-by: syzbot +Signed-off-by: Tetsuo Handa +Fixes: f856373e2f31ffd3 ("wifi: mac80211: do not wake queues on a vif that is being stopped") +Tested-by: syzbot +Acked-by: Toke Høiland-Jørgensen +Signed-off-by: Kalle Valo +Link: https://lore.kernel.org/r/9cc9b81d-75a3-3925-b612-9d0ad3cab82b@I-love.SAKURA.ne.jp +[ pick up commit 3598cb6e1862 ("wifi: mac80211: do not abuse fq.lock in ieee80211_do_stop()") from -next] +Link: https://lore.kernel.org/all/87o7xcq6qt.fsf@kernel.org/ +Signed-off-by: Jakub Kicinski +--- + net/mac80211/iface.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/net/mac80211/iface.c ++++ b/net/mac80211/iface.c +@@ -377,9 +377,8 @@ static void ieee80211_do_stop(struct iee + bool cancel_scan; + struct cfg80211_nan_func *func; + +- spin_lock_bh(&local->fq.lock); + clear_bit(SDATA_STATE_RUNNING, &sdata->state); +- spin_unlock_bh(&local->fq.lock); ++ synchronize_rcu(); /* flush _ieee80211_wake_txqs() */ + + cancel_scan = rcu_access_pointer(local->scan_sdata) == sdata; + if (cancel_scan) From a5da8e6ecdfe43efe6cb6e28f28f1aab543ca2d6 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Fri, 5 Aug 2022 16:34:44 +0200 Subject: [PATCH 46/54] kernel: fix missing mhi control devices Both of these packages depend on CONFIG_WWAN in the kernel. Also fix the missing "wwan" subfolder in the path. This fixes the missing devices in /dev after booting an MHI capable modem. Fixes: 2519190fec ("kernel: package mhi wwan ctrl driver") Fixes: 6af46796fa ("kernel: package mhi mbim driver") Signed-off-by: Koen Vandeputte --- package/kernel/linux/modules/netdevices.mk | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk index 2e81835fe1..bb4e1ab5cd 100644 --- a/package/kernel/linux/modules/netdevices.mk +++ b/package/kernel/linux/modules/netdevices.mk @@ -1380,8 +1380,9 @@ define KernelPackage/mhi-wwan-ctrl SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=MHI WWAN Control DEPENDS:=@LINUX_5_15 @PCI_SUPPORT +kmod-mhi-bus - KCONFIG:=CONFIG_MHI_WWAN_CTRL - FILES:=$(LINUX_DIR)/drivers/net/mhi_wwan_ctrl.ko + KCONFIG:=CONFIG_MHI_WWAN_CTRL \ + CONFIG_WWAN=y + FILES:=$(LINUX_DIR)/drivers/net/wwan/mhi_wwan_ctrl.ko AUTOLOAD:=$(call AutoProbe,mhi_wwan_ctrl) endef @@ -1396,8 +1397,9 @@ define KernelPackage/mhi-wwan-mbim SUBMENU:=$(NETWORK_DEVICES_MENU) TITLE:=MHI MBIM DEPENDS:=@LINUX_5_15 @PCI_SUPPORT +kmod-mhi-bus - KCONFIG:=CONFIG_MHI_WWAN_MBIM - FILES:=$(LINUX_DIR)/drivers/net/mhi_wwan_mbim.ko + KCONFIG:=CONFIG_MHI_WWAN_MBIM \ + CONFIG_WWAN=y + FILES:=$(LINUX_DIR)/drivers/net/wwan/mhi_wwan_mbim.ko AUTOLOAD:=$(call AutoProbe,mhi_wwan_mbim) endef From 4e4a457d3755a51af427d46200f2487f01f53c11 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Fri, 5 Aug 2022 16:56:11 +0200 Subject: [PATCH 47/54] kernel: backport support for Sierra Wireless EM919x modems Adds support for Sierra Wireless EM919x modem (X55 5G) Backported from kernel 5.16 Signed-off-by: Koen Vandeputte --- ...eric-Introduce-Sierra-EM919X-support.patch | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 target/linux/generic/backport-5.15/780-v5.16-bus-mhi-pci_generic-Introduce-Sierra-EM919X-support.patch diff --git a/target/linux/generic/backport-5.15/780-v5.16-bus-mhi-pci_generic-Introduce-Sierra-EM919X-support.patch b/target/linux/generic/backport-5.15/780-v5.16-bus-mhi-pci_generic-Introduce-Sierra-EM919X-support.patch new file mode 100644 index 0000000000..47a123494e --- /dev/null +++ b/target/linux/generic/backport-5.15/780-v5.16-bus-mhi-pci_generic-Introduce-Sierra-EM919X-support.patch @@ -0,0 +1,61 @@ +Index: linux-5.15.58/drivers/bus/mhi/pci_generic.c +=================================================================== +--- linux-5.15.58.orig/drivers/bus/mhi/pci_generic.c ++++ linux-5.15.58/drivers/bus/mhi/pci_generic.c +@@ -406,6 +406,46 @@ static const struct mhi_pci_dev_info mhi + .mru_default = 32768, + }; + ++static const struct mhi_channel_config mhi_sierra_em919x_channels[] = { ++ MHI_CHANNEL_CONFIG_UL_SBL(2, "SAHARA", 32, 0), ++ MHI_CHANNEL_CONFIG_DL_SBL(3, "SAHARA", 256, 0), ++ MHI_CHANNEL_CONFIG_UL(4, "DIAG", 32, 0), ++ MHI_CHANNEL_CONFIG_DL(5, "DIAG", 32, 0), ++ MHI_CHANNEL_CONFIG_UL(12, "MBIM", 128, 0), ++ MHI_CHANNEL_CONFIG_DL(13, "MBIM", 128, 0), ++ MHI_CHANNEL_CONFIG_UL(14, "QMI", 32, 0), ++ MHI_CHANNEL_CONFIG_DL(15, "QMI", 32, 0), ++ MHI_CHANNEL_CONFIG_UL(32, "DUN", 32, 0), ++ MHI_CHANNEL_CONFIG_DL(33, "DUN", 32, 0), ++ MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0", 512, 1), ++ MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0", 512, 2), ++}; ++ ++static struct mhi_event_config modem_sierra_em919x_mhi_events[] = { ++ /* first ring is control+data and DIAG ring */ ++ MHI_EVENT_CONFIG_CTRL(0, 2048), ++ /* Hardware channels request dedicated hardware event rings */ ++ MHI_EVENT_CONFIG_HW_DATA(1, 2048, 100), ++ MHI_EVENT_CONFIG_HW_DATA(2, 2048, 101) ++}; ++ ++static const struct mhi_controller_config modem_sierra_em919x_config = { ++ .max_channels = 128, ++ .timeout_ms = 24000, ++ .num_channels = ARRAY_SIZE(mhi_sierra_em919x_channels), ++ .ch_cfg = mhi_sierra_em919x_channels, ++ .num_events = ARRAY_SIZE(modem_sierra_em919x_mhi_events), ++ .event_cfg = modem_sierra_em919x_mhi_events, ++}; ++ ++static const struct mhi_pci_dev_info mhi_sierra_em919x_info = { ++ .name = "sierra-em919x", ++ .config = &modem_sierra_em919x_config, ++ .bar_num = MHI_PCI_DEFAULT_BAR_NUM, ++ .dma_data_width = 32, ++ .sideband_wake = false, ++}; ++ + static const struct mhi_channel_config mhi_telit_fn980_hw_v1_channels[] = { + MHI_CHANNEL_CONFIG_UL(14, "QMI", 32, 0), + MHI_CHANNEL_CONFIG_DL(15, "QMI", 32, 0), +@@ -480,6 +520,9 @@ static const struct mhi_pci_dev_info mhi + }; + + static const struct pci_device_id mhi_pci_id_table[] = { ++ /* EM919x (sdx55), use the same vid:pid as qcom-sdx55m */ ++ { PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0306, 0x18d7, 0x0200), ++ .driver_data = (kernel_ulong_t) &mhi_sierra_em919x_info }, + /* Telit FN980 hardware revision v1 */ + { PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0306, 0x1C5D, 0x2000), + .driver_data = (kernel_ulong_t) &mhi_telit_fn980_hw_v1_info }, From 1bfe42beb463094334e5c753efc9f495591d0b88 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Mon, 8 Aug 2022 11:12:11 +0200 Subject: [PATCH 48/54] kernel: add missing 5.15 symbols Found while testing various platforms Signed-off-by: Koen Vandeputte --- target/linux/generic/config-5.15 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15 index 991d3ddf77..5f2d274fc3 100644 --- a/target/linux/generic/config-5.15 +++ b/target/linux/generic/config-5.15 @@ -18,6 +18,7 @@ CONFIG_64BIT_TIME=y # CONFIG_ACORN_PARTITION is not set # CONFIG_ACPI_ALS is not set # CONFIG_ACPI_APEI is not set +# CONFIG_ACPI_APEI_PCIEAER is not set # CONFIG_ACPI_BUTTON is not set # CONFIG_ACPI_CONFIGFS is not set # CONFIG_ACPI_CUSTOM_METHOD is not set @@ -5112,6 +5113,7 @@ CONFIG_RTC_DRV_CMOS=y # CONFIG_RTC_DRV_MAX6900 is not set # CONFIG_RTC_DRV_MAX6902 is not set # CONFIG_RTC_DRV_MAX6916 is not set +# CONFIG_RTC_DRV_MAX77686 is not set # CONFIG_RTC_DRV_MCP795 is not set # CONFIG_RTC_DRV_MOXART is not set # CONFIG_RTC_DRV_MPC5121 is not set @@ -5149,6 +5151,7 @@ CONFIG_RTC_DRV_CMOS=y # CONFIG_RTC_DRV_SNVS is not set # CONFIG_RTC_DRV_STK17TA8 is not set # CONFIG_RTC_DRV_SUN6I is not set +# CONFIG_RTC_DRV_TEGRA is not set # CONFIG_RTC_DRV_TEST is not set # CONFIG_RTC_DRV_V3020 is not set # CONFIG_RTC_DRV_X1205 is not set @@ -5947,7 +5950,9 @@ CONFIG_SND_PROC_FS=y # CONFIG_SND_SOC_FSL_AUD2HTX is not set # CONFIG_SND_SOC_FSL_AUDMIX is not set # CONFIG_SND_SOC_FSL_ESAI is not set +# CONFIG_SND_SOC_IMX_RPMSG is not set # CONFIG_SND_SOC_FSL_MICFIL is not set +# CONFIG_SND_SOC_FSL_RPMSG is not set # CONFIG_SND_SOC_FSL_SAI is not set # CONFIG_SND_SOC_FSL_SPDIF is not set # CONFIG_SND_SOC_FSL_SSI is not set @@ -7445,6 +7450,7 @@ CONFIG_WLAN=y CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y # CONFIG_WQ_WATCHDOG is not set # CONFIG_WWAN is not set +# CONFIG_WWAN_HWSIM is not set # CONFIG_WW_MUTEX_SELFTEST is not set # CONFIG_X25 is not set # CONFIG_X509_CERTIFICATE_PARSER is not set From 737671bcceb438195ad8fe78b6f93e5ccfef8483 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 9 Aug 2022 00:08:13 +0200 Subject: [PATCH 49/54] jansson: revert ABI version bump The soversion of the shipped libjansson.so library didn't change, so the ABI version change is unwarranted and leads to opkg file clashes. Also stop shipping an unversioned library symlink while we're at it as it only needed at compile/link time and leading to file level clashes between packages on future ABI bumps. Signed-off-by: Jo-Philipp Wich --- package/libs/jansson/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/jansson/Makefile b/package/libs/jansson/Makefile index 4b0b7601c9..6de48c1d86 100644 --- a/package/libs/jansson/Makefile +++ b/package/libs/jansson/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=jansson PKG_VERSION:=2.14 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/akheron/$(PKG_NAME)/tar.gz/v$(PKG_VERSION)? @@ -33,7 +33,7 @@ define Package/jansson CATEGORY:=Libraries TITLE:=Jansson library URL:=http://www.digip.org/jansson/ - ABI_VERSION:=5 + ABI_VERSION:=4 endef define Package/jansson/description @@ -45,7 +45,7 @@ TARGET_LDFLAGS += -flto define Package/jansson/install $(INSTALL_DIR) $(1)/usr/lib - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjansson*so* $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjansson*so.* $(1)/usr/lib/ endef $(eval $(call BuildPackage,jansson)) From eada8925776aafa3ec47d66fb89bf7eae730edf7 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 9 Aug 2022 00:05:02 +0200 Subject: [PATCH 50/54] nftables: fix parsing date expressions Musl libc does not support the non-POSIX "%F" format for strptime() so replace all occurrences of it with an equivalent "%Y-%m-%d" format. Fixes: #10419 Signed-off-by: Jo-Philipp Wich --- package/network/utils/nftables/Makefile | 2 +- ...-t-use-non-POSIX-formats-in-strptime.patch | 49 +++++++++++++++++++ target/linux/ramips/mt7621/config-5.10 | 3 -- 3 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 package/network/utils/nftables/patches/0001-meta-don-t-use-non-POSIX-formats-in-strptime.patch diff --git a/package/network/utils/nftables/Makefile b/package/network/utils/nftables/Makefile index 88d7aebefc..850355df8d 100644 --- a/package/network/utils/nftables/Makefile +++ b/package/network/utils/nftables/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nftables PKG_VERSION:=1.0.4 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files diff --git a/package/network/utils/nftables/patches/0001-meta-don-t-use-non-POSIX-formats-in-strptime.patch b/package/network/utils/nftables/patches/0001-meta-don-t-use-non-POSIX-formats-in-strptime.patch new file mode 100644 index 0000000000..a9d0ee5451 --- /dev/null +++ b/package/network/utils/nftables/patches/0001-meta-don-t-use-non-POSIX-formats-in-strptime.patch @@ -0,0 +1,49 @@ +From 1af8aabccd65e11caa397c4706353075f623cd01 Mon Sep 17 00:00:00 2001 +From: Jo-Philipp Wich +Date: Mon, 8 Aug 2022 23:57:03 +0200 +Subject: [PATCH] meta: don't use non-POSIX formats in strptime() + +The current strptime() invocations in meta.c use the `%F` format which +is not specified by POSIX and thus unimplemented by some libc flavors +such as musl libc. + +Replace all occurrences of `%F` with an equivalent `%Y-%m-%d` format +in order to be able to properly parse user supplied dates in such +environments. + +Signed-off-by: Jo-Philipp Wich +--- + src/meta.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/meta.c b/src/meta.c +index 80ace25b..257bbc9f 100644 +--- a/src/meta.c ++++ b/src/meta.c +@@ -399,7 +399,7 @@ static void date_type_print(const struct expr *expr, struct output_ctx *octx) + tstamp += cur_tm->tm_gmtoff; + + if ((tm = gmtime((time_t *) &tstamp)) != NULL && +- strftime(timestr, sizeof(timestr) - 1, "%F %T", tm)) ++ strftime(timestr, sizeof(timestr) - 1, "%Y-%m-%d %T", tm)) + nft_print(octx, "\"%s\"", timestr); + else + nft_print(octx, "Error converting timestamp to printed time"); +@@ -412,11 +412,11 @@ static bool parse_iso_date(uint64_t *tstamp, const char *sym) + + memset(&tm, 0, sizeof(struct tm)); + +- if (strptime(sym, "%F %T", &tm)) ++ if (strptime(sym, "%Y-%m-%d %T", &tm)) + goto success; +- if (strptime(sym, "%F %R", &tm)) ++ if (strptime(sym, "%Y-%m-%d %R", &tm)) + goto success; +- if (strptime(sym, "%F", &tm)) ++ if (strptime(sym, "%Y-%m-%d", &tm)) + goto success; + + return false; +-- +2.35.1 + diff --git a/target/linux/ramips/mt7621/config-5.10 b/target/linux/ramips/mt7621/config-5.10 index 182da755cf..3c668f9ac5 100644 --- a/target/linux/ramips/mt7621/config-5.10 +++ b/target/linux/ramips/mt7621/config-5.10 @@ -25,7 +25,6 @@ CONFIG_CPU_HAS_PREFETCH=y CONFIG_CPU_HAS_RIXI=y CONFIG_CPU_HAS_SYNC=y CONFIG_CPU_IDLE=y -# CONFIG_CPU_IDLE_GOV_LADDER is not set CONFIG_CPU_IDLE_GOV_TEO=y CONFIG_CPU_MIPS32=y # CONFIG_CPU_MIPS32_R1 is not set @@ -41,7 +40,6 @@ CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y CONFIG_CPU_SUPPORTS_HIGHMEM=y CONFIG_CPU_SUPPORTS_MSA=y CONFIG_CRC16=y -CONFIG_CRYPTO_ACOMP2=y CONFIG_CRYPTO_BLAKE2S=y CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_HASH_INFO=y @@ -108,7 +106,6 @@ CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_MIPS_CPU=y CONFIG_IRQ_WORK=y -# CONFIG_KERNEL_ZSTD is not set CONFIG_LED_TRIGGER_PHY=y CONFIG_LIBFDT=y CONFIG_LOCK_DEBUGGING_SUPPORT=y From f443e9de7003c00a935b9ea12f168e09e83b48cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Tue, 9 Aug 2022 07:50:19 +0200 Subject: [PATCH 51/54] zlib: backport null dereference fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The curl developers found test case that crashed in their testing when using zlib patched against CVE-2022-37434, same patch we've backported in commit 7df6795d4c25 ("zlib: backport fix for heap-based buffer over-read (CVE-2022-37434)"). So we need to backport following patch in order to fix issue introduced in that previous CVE-2022-37434 fix. References: https://github.com/curl/curl/issues/9271 Fixes: 7df6795d4c25 ("zlib: backport fix for heap-based buffer over-read (CVE-2022-37434)") Signed-off-by: Petr Štetiar --- ...ll-dereference-in-fix-CVE-2022-37434.patch | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 package/libs/zlib/patches/007-fix-null-dereference-in-fix-CVE-2022-37434.patch diff --git a/package/libs/zlib/patches/007-fix-null-dereference-in-fix-CVE-2022-37434.patch b/package/libs/zlib/patches/007-fix-null-dereference-in-fix-CVE-2022-37434.patch new file mode 100644 index 0000000000..c5c95a92b2 --- /dev/null +++ b/package/libs/zlib/patches/007-fix-null-dereference-in-fix-CVE-2022-37434.patch @@ -0,0 +1,29 @@ +From 1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d Mon Sep 17 00:00:00 2001 +From: Mark Adler +Date: Mon, 8 Aug 2022 10:50:09 -0700 +Subject: [PATCH] Fix extra field processing bug that dereferences NULL + state->head. + +The recent commit to fix a gzip header extra field processing bug +introduced the new bug fixed here. +--- + inflate.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/inflate.c b/inflate.c +index 7a7289749..2a3c4fe98 100644 +--- a/inflate.c ++++ b/inflate.c +@@ -763,10 +763,10 @@ int flush; + copy = state->length; + if (copy > have) copy = have; + if (copy) { +- len = state->head->extra_len - state->length; + if (state->head != Z_NULL && + state->head->extra != Z_NULL && +- len < state->head->extra_max) { ++ (len = state->head->extra_len - state->length) < ++ state->head->extra_max) { + zmemcpy(state->head->extra + len, next, + len + copy > state->head->extra_max ? + state->head->extra_max - len : copy); From b5ec04f81a5ff1baddb8591af8ac9a4fa9da2a11 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 9 Aug 2022 11:50:46 +0200 Subject: [PATCH 52/54] Revert "nftables: fix parsing date expressions" This reverts commit eada8925776aafa3ec47d66fb89bf7eae730edf7. The commit contained unrelated target changes. Signed-off-by: Jo-Philipp Wich --- package/network/utils/nftables/Makefile | 2 +- ...-t-use-non-POSIX-formats-in-strptime.patch | 49 ------------------- target/linux/ramips/mt7621/config-5.10 | 3 ++ 3 files changed, 4 insertions(+), 50 deletions(-) delete mode 100644 package/network/utils/nftables/patches/0001-meta-don-t-use-non-POSIX-formats-in-strptime.patch diff --git a/package/network/utils/nftables/Makefile b/package/network/utils/nftables/Makefile index 850355df8d..88d7aebefc 100644 --- a/package/network/utils/nftables/Makefile +++ b/package/network/utils/nftables/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nftables PKG_VERSION:=1.0.4 -PKG_RELEASE:=2 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files diff --git a/package/network/utils/nftables/patches/0001-meta-don-t-use-non-POSIX-formats-in-strptime.patch b/package/network/utils/nftables/patches/0001-meta-don-t-use-non-POSIX-formats-in-strptime.patch deleted file mode 100644 index a9d0ee5451..0000000000 --- a/package/network/utils/nftables/patches/0001-meta-don-t-use-non-POSIX-formats-in-strptime.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 1af8aabccd65e11caa397c4706353075f623cd01 Mon Sep 17 00:00:00 2001 -From: Jo-Philipp Wich -Date: Mon, 8 Aug 2022 23:57:03 +0200 -Subject: [PATCH] meta: don't use non-POSIX formats in strptime() - -The current strptime() invocations in meta.c use the `%F` format which -is not specified by POSIX and thus unimplemented by some libc flavors -such as musl libc. - -Replace all occurrences of `%F` with an equivalent `%Y-%m-%d` format -in order to be able to properly parse user supplied dates in such -environments. - -Signed-off-by: Jo-Philipp Wich ---- - src/meta.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/src/meta.c b/src/meta.c -index 80ace25b..257bbc9f 100644 ---- a/src/meta.c -+++ b/src/meta.c -@@ -399,7 +399,7 @@ static void date_type_print(const struct expr *expr, struct output_ctx *octx) - tstamp += cur_tm->tm_gmtoff; - - if ((tm = gmtime((time_t *) &tstamp)) != NULL && -- strftime(timestr, sizeof(timestr) - 1, "%F %T", tm)) -+ strftime(timestr, sizeof(timestr) - 1, "%Y-%m-%d %T", tm)) - nft_print(octx, "\"%s\"", timestr); - else - nft_print(octx, "Error converting timestamp to printed time"); -@@ -412,11 +412,11 @@ static bool parse_iso_date(uint64_t *tstamp, const char *sym) - - memset(&tm, 0, sizeof(struct tm)); - -- if (strptime(sym, "%F %T", &tm)) -+ if (strptime(sym, "%Y-%m-%d %T", &tm)) - goto success; -- if (strptime(sym, "%F %R", &tm)) -+ if (strptime(sym, "%Y-%m-%d %R", &tm)) - goto success; -- if (strptime(sym, "%F", &tm)) -+ if (strptime(sym, "%Y-%m-%d", &tm)) - goto success; - - return false; --- -2.35.1 - diff --git a/target/linux/ramips/mt7621/config-5.10 b/target/linux/ramips/mt7621/config-5.10 index 3c668f9ac5..182da755cf 100644 --- a/target/linux/ramips/mt7621/config-5.10 +++ b/target/linux/ramips/mt7621/config-5.10 @@ -25,6 +25,7 @@ CONFIG_CPU_HAS_PREFETCH=y CONFIG_CPU_HAS_RIXI=y CONFIG_CPU_HAS_SYNC=y CONFIG_CPU_IDLE=y +# CONFIG_CPU_IDLE_GOV_LADDER is not set CONFIG_CPU_IDLE_GOV_TEO=y CONFIG_CPU_MIPS32=y # CONFIG_CPU_MIPS32_R1 is not set @@ -40,6 +41,7 @@ CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y CONFIG_CPU_SUPPORTS_HIGHMEM=y CONFIG_CPU_SUPPORTS_MSA=y CONFIG_CRC16=y +CONFIG_CRYPTO_ACOMP2=y CONFIG_CRYPTO_BLAKE2S=y CONFIG_CRYPTO_DEFLATE=y CONFIG_CRYPTO_HASH_INFO=y @@ -106,6 +108,7 @@ CONFIG_IRQ_DOMAIN_HIERARCHY=y CONFIG_IRQ_FORCED_THREADING=y CONFIG_IRQ_MIPS_CPU=y CONFIG_IRQ_WORK=y +# CONFIG_KERNEL_ZSTD is not set CONFIG_LED_TRIGGER_PHY=y CONFIG_LIBFDT=y CONFIG_LOCK_DEBUGGING_SUPPORT=y From e6e4f979999393825370e9db9fe04d75cb01acf2 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 9 Aug 2022 00:05:02 +0200 Subject: [PATCH 53/54] nftables: fix parsing date expressions Musl libc does not support the non-POSIX "%F" format for strptime() so replace all occurrences of it with an equivalent "%Y-%m-%d" format. Fixes: #10419 Signed-off-by: Jo-Philipp Wich --- package/network/utils/nftables/Makefile | 2 +- ...-t-use-non-POSIX-formats-in-strptime.patch | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 package/network/utils/nftables/patches/0001-meta-don-t-use-non-POSIX-formats-in-strptime.patch diff --git a/package/network/utils/nftables/Makefile b/package/network/utils/nftables/Makefile index 88d7aebefc..850355df8d 100644 --- a/package/network/utils/nftables/Makefile +++ b/package/network/utils/nftables/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=nftables PKG_VERSION:=1.0.4 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://netfilter.org/projects/$(PKG_NAME)/files diff --git a/package/network/utils/nftables/patches/0001-meta-don-t-use-non-POSIX-formats-in-strptime.patch b/package/network/utils/nftables/patches/0001-meta-don-t-use-non-POSIX-formats-in-strptime.patch new file mode 100644 index 0000000000..a9d0ee5451 --- /dev/null +++ b/package/network/utils/nftables/patches/0001-meta-don-t-use-non-POSIX-formats-in-strptime.patch @@ -0,0 +1,49 @@ +From 1af8aabccd65e11caa397c4706353075f623cd01 Mon Sep 17 00:00:00 2001 +From: Jo-Philipp Wich +Date: Mon, 8 Aug 2022 23:57:03 +0200 +Subject: [PATCH] meta: don't use non-POSIX formats in strptime() + +The current strptime() invocations in meta.c use the `%F` format which +is not specified by POSIX and thus unimplemented by some libc flavors +such as musl libc. + +Replace all occurrences of `%F` with an equivalent `%Y-%m-%d` format +in order to be able to properly parse user supplied dates in such +environments. + +Signed-off-by: Jo-Philipp Wich +--- + src/meta.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/meta.c b/src/meta.c +index 80ace25b..257bbc9f 100644 +--- a/src/meta.c ++++ b/src/meta.c +@@ -399,7 +399,7 @@ static void date_type_print(const struct expr *expr, struct output_ctx *octx) + tstamp += cur_tm->tm_gmtoff; + + if ((tm = gmtime((time_t *) &tstamp)) != NULL && +- strftime(timestr, sizeof(timestr) - 1, "%F %T", tm)) ++ strftime(timestr, sizeof(timestr) - 1, "%Y-%m-%d %T", tm)) + nft_print(octx, "\"%s\"", timestr); + else + nft_print(octx, "Error converting timestamp to printed time"); +@@ -412,11 +412,11 @@ static bool parse_iso_date(uint64_t *tstamp, const char *sym) + + memset(&tm, 0, sizeof(struct tm)); + +- if (strptime(sym, "%F %T", &tm)) ++ if (strptime(sym, "%Y-%m-%d %T", &tm)) + goto success; +- if (strptime(sym, "%F %R", &tm)) ++ if (strptime(sym, "%Y-%m-%d %R", &tm)) + goto success; +- if (strptime(sym, "%F", &tm)) ++ if (strptime(sym, "%Y-%m-%d", &tm)) + goto success; + + return false; +-- +2.35.1 + From cf110404e3307bd2dba64889435b4b403f6940f4 Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Tue, 9 Aug 2022 09:36:10 +0200 Subject: [PATCH 54/54] kernel: properly condition EM919x patch Properly format and refresh patch Fixes: d03977faf4 ("kernel: backport support for Sierra Wireless EM919x modems") Signed-off-by: Koen Vandeputte --- ...eric-Introduce-Sierra-EM919X-support.patch | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/target/linux/generic/backport-5.15/780-v5.16-bus-mhi-pci_generic-Introduce-Sierra-EM919X-support.patch b/target/linux/generic/backport-5.15/780-v5.16-bus-mhi-pci_generic-Introduce-Sierra-EM919X-support.patch index 47a123494e..5fe10e0caa 100644 --- a/target/linux/generic/backport-5.15/780-v5.16-bus-mhi-pci_generic-Introduce-Sierra-EM919X-support.patch +++ b/target/linux/generic/backport-5.15/780-v5.16-bus-mhi-pci_generic-Introduce-Sierra-EM919X-support.patch @@ -1,7 +1,26 @@ -Index: linux-5.15.58/drivers/bus/mhi/pci_generic.c -=================================================================== ---- linux-5.15.58.orig/drivers/bus/mhi/pci_generic.c -+++ linux-5.15.58/drivers/bus/mhi/pci_generic.c +From 789d3eeb2367f92193a0882f7cdab03f0f9d6930 Mon Sep 17 00:00:00 2001 +From: Thomas Perrot +Date: Thu, 16 Dec 2021 13:42:27 +0530 +Subject: [PATCH] bus: mhi: pci_generic: Introduce Sierra EM919X support + +Add support for EM919X modems, this modem series is based on SDX55 +qcom chip. + +It is mandatory to use the same ring for control+data and diag events. + +Link: https://lore.kernel.org/r/20211123081541.648426-1-thomas.perrot@bootlin.com +Tested-by: Aleksander Morgado +Reviewed-by: Manivannan Sadhasivam +Signed-off-by: Thomas Perrot +Signed-off-by: Manivannan Sadhasivam +Link: https://lore.kernel.org/r/20211216081227.237749-11-manivannan.sadhasivam@linaro.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/bus/mhi/pci_generic.c | 43 +++++++++++++++++++++++++++++++++++ + 1 file changed, 43 insertions(+) + +--- a/drivers/bus/mhi/pci_generic.c ++++ b/drivers/bus/mhi/pci_generic.c @@ -406,6 +406,46 @@ static const struct mhi_pci_dev_info mhi .mru_default = 32768, };