From b3da44b6471dbfb3b71201a80f8844a3bc71ee35 Mon Sep 17 00:00:00 2001 From: Dawsen Gao Date: Sat, 12 Feb 2022 10:21:21 +0800 Subject: [PATCH 01/26] ramips: Add support for Dual-Q H721 Dual-Q H721 is a router platform board, it is the smaller model of the U7621-06. The device has the following specifications: MT7621AT (880 MHz) 256 of RAM (DDR3) 16 MB of FLASH (MX25l12805d SPI) 5x 1 Gbps Ethernet (MT7621 built-in switch) 1x M.2 (NGFF) 3.7V 3A max for 5G M.2 Modem work at USB3.0 mode 1x Minipcie 3.7V 3A max for LTE Modem work at USB2.0 Mode 2x Minipcie for WIFI card 4x Lan+1x Wan 10/100M/1000M RJ45 port 14x LEDs (1x GPIO-controlled) 1x reset button 1x UART header (4-pins) 1x mico SD-card reader 1x DC jack for main power (5~27 V) The following has been tested and is working: Ethernet switch miniPCIe slots (tested with Wi-Fi cards and LTE modem cards) miniSIM slot (works with normal size simcard) sysupgrade reset button micro SD-card reader Installation: This board has no locked down bootloader. The seller can be asked to install openwrt, so upgrades are standard sysupgrade method. Recovery: This board contains a Chinese, closed-source bootloader called Breed (Boot and Recovery Environment for Embedded Devices). Breed supports web recovery and to enter it, you keep the reset button pressed for around 5 seconds during boot. Your machine will be assigned an IP through DHCP and the router will use IP address 192.168.1.1. The recovery website is in Chinese, but is easy to use. Click on the second item in the list to access the recovery page, then the second item on the next page is where you select the firmware. In order to start the recovery, you click the button at the bottom. Signed-off-by: Dawsen Gao [change author name (used SoB one), add ethernet pinctrl, apply sorting to device recipe] Signed-off-by: Sungbo Eo --- .../linux/ramips/dts/mt7621_dual-q_h721.dts | 198 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 10 + 2 files changed, 208 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_dual-q_h721.dts diff --git a/target/linux/ramips/dts/mt7621_dual-q_h721.dts b/target/linux/ramips/dts/mt7621_dual-q_h721.dts new file mode 100644 index 0000000000..2a18b3982d --- /dev/null +++ b/target/linux/ramips/dts/mt7621_dual-q_h721.dts @@ -0,0 +1,198 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "mt7621.dtsi" + +#include +#include + +/ { + compatible = "dual-q,h721", "mediatek,mt7621-soc"; + model = "Dual-Q H721"; + + aliases { + led-boot = &led_status; + led-failsafe = &led_status; + led-running = &led_status; + led-upgrade = &led_status; + }; + + chosen { + bootargs = "console=ttyS0,115200"; + }; + + gpio-export { + compatible = "gpio-export"; + #size-cells = <0>; + + usb-30-power { + gpio-export,name = "usb-30-power"; + gpio-export,output = <0>; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + }; + + usb-20-power { + gpio-export,name = "usb-20-power"; + gpio-export,output = <0>; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + usb1 { + label = "green:usb1"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + + sig1 { + label = "green:sig1"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + }; + + usb2 { + label = "green:usb2"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + sig2 { + label = "green:sig2"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + tf { + label = "green:tf"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + wifi1 { + label = "green:wifi1"; + gpios = <&gpio 24 GPIO_ACTIVE_LOW>; + }; + + wifi2 { + label = "green:wifi2"; + gpios = <&gpio 25 GPIO_ACTIVE_LOW>; + }; + + led_status: status { + label = "green:status"; + gpios = <&gpio 27 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x0 0x30000>; + read-only; + }; + + partition@30000 { + label = "config"; + reg = <0x30000 0x10000>; + read-only; + }; + + partition@40000 { + label = "factory"; + reg = <0x40000 0x10000>; + read-only; + + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_factory_e000: macaddr@e000 { + reg = <0xe000 0x6>; + }; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x50000 0xfb0000>; + }; + }; + }; +}; + +&sdhci { + status = "okay"; +}; + +&pcie { + status = "okay"; +}; + +&switch0 { + ports { + port@0 { + status = "okay"; + label = "lan1"; + }; + + port@1 { + status = "okay"; + label = "lan2"; + }; + + port@2 { + status = "okay"; + label = "lan3"; + }; + + port@3 { + status = "okay"; + label = "lan4"; + }; + + port@4 { + status = "okay"; + label = "wan"; + + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; + }; + }; +}; + +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + +&gmac0 { + nvmem-cells = <&macaddr_factory_e000>; + nvmem-cell-names = "mac-address"; +}; + +&state_default { + gpio { + groups = "jtag", "wdt", "rgmii2"; + function = "gpio"; + }; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 44b04dbefb..69d83e57e7 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -395,6 +395,16 @@ define Device/dlink_dir-882-r1 endef TARGET_DEVICES += dlink_dir-882-r1 +define Device/dual-q_h721 + $(Device/dsa-migration) + $(Device/uimage-lzma-loader) + IMAGE_SIZE := 16064k + DEVICE_VENDOR := Dual-Q + DEVICE_MODEL := H721 + DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 -wpad-basic-wolfssl +endef +TARGET_DEVICES += dual-q_h721 + define Device/d-team_newifi-d2 $(Device/dsa-migration) $(Device/uimage-lzma-loader) From 285e636b1665f0f238da072c497f150f9acc4b54 Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Sun, 9 Jan 2022 12:16:06 +0800 Subject: [PATCH 02/26] ramips: update WLAN MAC address of Phicomm K2P The wireless mac address difference of this machine is similar to that of D-Link DIR-853-R1, so use the same practice. Signed-off-by: Chukun Pan --- target/linux/ramips/dts/mt7621_phicomm_k2p.dts | 12 +++++++++++- .../etc/hotplug.d/ieee80211/10_fix_wifi_mac | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_phicomm_k2p.dts b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts index a5060a1aee..a0bdab2226 100644 --- a/target/linux/ramips/dts/mt7621_phicomm_k2p.dts +++ b/target/linux/ramips/dts/mt7621_phicomm_k2p.dts @@ -96,9 +96,15 @@ }; &pcie0 { - mt76@0,0 { + wifi@0,0 { + compatible = "mediatek,mt76"; reg = <0x0000 0 0 0 0>; mediatek,mtd-eeprom = <&factory 0x0>; + + /* 5 GHz (phy1) does not take the address from calibration data, + but setting it manually here works */ + nvmem-cells = <&macaddr_factory_4>; + nvmem-cell-names = "mac-address"; }; }; @@ -150,6 +156,10 @@ #address-cells = <1>; #size-cells = <1>; + macaddr_factory_4: macaddr@4 { + reg = <0x4 0x6>; + }; + macaddr_factory_e000: macaddr@e000 { reg = <0xe000 0x6>; }; diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 7b6827b79a..9a002d24c8 100644 --- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -15,7 +15,8 @@ case "$board" in macaddr_setbit_la "$(mtd_get_mac_binary factory 0xe000)" \ > /sys${DEVPATH}/macaddress ;; - dlink,dir-853-r1) + dlink,dir-853-r1|\ + phicomm,k2p) if [ "$PHYNBR" = "0" ]; then base_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" -1) macaddr_setbit_la "$base_mac" > /sys${DEVPATH}/macaddress From 7fa227ead5246cfa61b38888b2394d433ad66f36 Mon Sep 17 00:00:00 2001 From: Chukun Pan Date: Mon, 10 Jan 2022 12:28:40 +0800 Subject: [PATCH 03/26] ramips: update WLAN MAC address of JCG Y2 MAC addresses on OEM firmware: 04:xx:xx:xx:xx:c8 factory 0x4 wlan2g 06:xx:xx:xx:xx:c8 [not on flash] wlan5g Signed-off-by: Chukun Pan --- .../mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 9a002d24c8..f2daac990b 100644 --- a/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ramips/mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -43,6 +43,10 @@ case "$board" in [ "$PHYNBR" = "1" ] && \ macaddr_setbit_la "$(mtd_get_mac_binary Factory 0x4)" > /sys${DEVPATH}/macaddress ;; + jcg,y2) + [ "$PHYNBR" = "1" ] && \ + macaddr_setbit_la "$(mtd_get_mac_binary factory 0x4)" > /sys${DEVPATH}/macaddress + ;; linksys,e5600|\ linksys,ea6350-v4|\ linksys,ea7300-v1|\ From 591a2b95254116f8286f369078c520ff84106079 Mon Sep 17 00:00:00 2001 From: Sven Schwermer Date: Wed, 9 Mar 2022 09:46:41 +0100 Subject: [PATCH 04/26] ath79: Add LED labels for Airtight C-75 Keep labels since OpenWrt userland tooling (get_dt_led) depends on them to find the LED instances referenced by the led-* aliases. The label for the amber power LED was removed in 4eefdc7adb. Signed-off-by: Sven Schwermer --- target/linux/ath79/dts/qca9550_airtight_c-75.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/ath79/dts/qca9550_airtight_c-75.dts b/target/linux/ath79/dts/qca9550_airtight_c-75.dts index 587610c6df..8dbf1c8bc4 100644 --- a/target/linux/ath79/dts/qca9550_airtight_c-75.dts +++ b/target/linux/ath79/dts/qca9550_airtight_c-75.dts @@ -32,12 +32,14 @@ compatible = "gpio-leds"; led_power_amber: power-amber { + label = "amber:power"; color = ; function = LED_FUNCTION_POWER; gpios = <&gpio 14 GPIO_ACTIVE_LOW>; }; led_power_green: power-green { + label = "green:power"; color = ; function = LED_FUNCTION_POWER; gpios = <&gpio 4 GPIO_ACTIVE_LOW>; From 8d255512437ec47cc7d87d7e11480c0a287417c6 Mon Sep 17 00:00:00 2001 From: Joe Mullally Date: Tue, 8 Mar 2022 19:33:37 +0000 Subject: [PATCH 05/26] ramips: Apply pinctrl DTS changes to TL-WPA8631P MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Applies changes from 7774b86019 to new device committed later. Fix some whitespace in the DTS. Use standard model name format in DTS. Fixes: 6c743c3006f9 ("ramips: Add support for TP-Link TL-WPA8631P v3") Signed-off-by: Joe Mullally Reported-by: Arınç ÜNAL --- .../dts/mt7621_tplink_tl-wpa8631p-v3.dts | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_tplink_tl-wpa8631p-v3.dts b/target/linux/ramips/dts/mt7621_tplink_tl-wpa8631p-v3.dts index 7012c315c1..0d466f1e66 100644 --- a/target/linux/ramips/dts/mt7621_tplink_tl-wpa8631p-v3.dts +++ b/target/linux/ramips/dts/mt7621_tplink_tl-wpa8631p-v3.dts @@ -7,7 +7,7 @@ / { compatible = "tplink,tl-wpa8631p-v3", "mediatek,mt7621-soc"; - model = "TP-Link WPA8631P v3"; + model = "TP-Link TL-WPA8631P v3"; aliases { label-mac-device = &gmac0; @@ -75,15 +75,15 @@ }; }; - gpio-export { - compatible = "gpio-export"; + gpio-export { + compatible = "gpio-export"; - led_control { - gpio-export,name = "tp-link:led:control"; - gpio-export,output = <0>; - gpios = <&gpio 25 GPIO_ACTIVE_LOW>; - }; - }; + led_control { + gpio-export,name = "tp-link:led:control"; + gpio-export,output = <0>; + gpios = <&gpio 25 GPIO_ACTIVE_LOW>; + }; + }; }; &spi0 { @@ -160,6 +160,10 @@ }; }; +ðernet { + pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>; +}; + &gmac0 { nvmem-cells = <&macaddr_config_2008>; nvmem-cell-names = "mac-address"; From 3150e8bf3e58255241ffaeeec5e4063576518d90 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 6 Mar 2022 20:58:29 -0800 Subject: [PATCH 06/26] tools/expat: update to 2.4.7 Mostly a bug fix to the bug fix to CVE-2022-25236 Signed-off-by: Rosen Penev --- tools/expat/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/expat/Makefile b/tools/expat/Makefile index 0bc54a3d48..82d0fb14f9 100644 --- a/tools/expat/Makefile +++ b/tools/expat/Makefile @@ -9,10 +9,10 @@ include $(TOPDIR)/rules.mk PKG_NAME:=expat PKG_CPE_ID:=cpe:/a:libexpat:expat -PKG_VERSION:=2.4.6 +PKG_VERSION:=2.4.7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_HASH:=ce317706b07cae150f90cddd4253f5b4fba929607488af5ac47bf2bc08e31f09 +PKG_HASH:=e149bdd8b90254c62b3d195da53a09bd531a4d63a963b0d8a5268d48dd2f6a65 PKG_SOURCE_URL:=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$(PKG_VERSION)) include $(INCLUDE_DIR)/host-build.mk From cca5367f2726c7fbe319cf97330903ee7a4c00ee Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 12 Mar 2022 14:58:10 -0800 Subject: [PATCH 07/26] tools/expat: enable DTD Fixes gdb usage, which depends on it. Signed-off-by: Rosen Penev --- tools/expat/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/expat/Makefile b/tools/expat/Makefile index 82d0fb14f9..fc339f818a 100644 --- a/tools/expat/Makefile +++ b/tools/expat/Makefile @@ -26,7 +26,7 @@ CMAKE_HOST_OPTIONS += \ -DEXPAT_BUILD_DOCS=OFF \ -DEXPAT_WITH_LIBBSD=OFF \ -DEXPAT_ENABLE_INSTALL=ON \ - -DEXPAT_DTD=OFF \ + -DEXPAT_DTD=ON \ -DEXPAT_NS=OFF \ -DEXPAT_DEV_URANDOM=OFF From e5440ec87163fa24d5df890bc60f0c3e65be8dd9 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Wed, 2 Mar 2022 09:42:52 +0100 Subject: [PATCH 08/26] ipset: add backport patch for IPv6 nftables ipset-translation When porting mwan3 from iptables to nftables I tried the new translation tool for ipset ipset-translate. I noticed that no IPv6 ipset can be created with the tool. I have reported the problem to the upstream project and the following patch fixes the problem. Until this upsream is included in a new release, this patch should be used in Openwrt. https://lore.kernel.org/netfilter-devel/20220228190217.2256371-1-pablo@netfilter.org/T/#m09cc3cb738f2e42024c7aecf5b7240d9f6bbc19c Signed-off-by: Florian Eckert --- package/network/utils/ipset/Makefile | 2 +- ...2-Fix-IPv6-sets-nftables-translation.patch | 82 +++++++++++++++++++ 2 files changed, 83 insertions(+), 1 deletion(-) create mode 100644 package/network/utils/ipset/patches/0002-Fix-IPv6-sets-nftables-translation.patch diff --git a/package/network/utils/ipset/Makefile b/package/network/utils/ipset/Makefile index 7b8d035198..65133d105c 100644 --- a/package/network/utils/ipset/Makefile +++ b/package/network/utils/ipset/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=ipset PKG_VERSION:=7.15 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://ipset.netfilter.org diff --git a/package/network/utils/ipset/patches/0002-Fix-IPv6-sets-nftables-translation.patch b/package/network/utils/ipset/patches/0002-Fix-IPv6-sets-nftables-translation.patch new file mode 100644 index 0000000000..6b29f26d95 --- /dev/null +++ b/package/network/utils/ipset/patches/0002-Fix-IPv6-sets-nftables-translation.patch @@ -0,0 +1,82 @@ +From 50ef784944c60cd291970c47e4b831ff7ef9c923 Mon Sep 17 00:00:00 2001 +From: Pablo Neira Ayuso +Date: Mon, 28 Feb 2022 20:02:17 +0100 +Subject: [PATCH] Fix IPv6 sets nftables translation + +The parser assumes the set is an IPv4 ipset because IPSET_OPT_FAMILY is +not set. + + # ipset-translate restore < ./ipset-mwan3_set_connected_ipv6.dump + add table inet global + add set inet global mwan3_connected_v6 { type ipv6_addr; flags interval; } + flush set inet global mwan3_connected_v6 + ipset v7.15: Error in line 4: Syntax error: '64' is out of range 0-32 + +Remove ipset_xlate_type_get(), call ipset_xlate_set_get() instead to +obtain the set type and family. + +Reported-by: Florian Eckert +Fixes: 325af556cd3a ("add ipset to nftables translation infrastructure") +Signed-off-by: Pablo Neira Ayuso +--- + lib/ipset.c | 24 ++++++++++-------------- + tests/xlate/xlate.t | 2 ++ + tests/xlate/xlate.t.nft | 2 ++ + 3 files changed, 14 insertions(+), 14 deletions(-) + +--- a/lib/ipset.c ++++ b/lib/ipset.c +@@ -949,18 +949,6 @@ ipset_xlate_set_get(struct ipset *ipset, + return NULL; + } + +-static const struct ipset_type *ipset_xlate_type_get(struct ipset *ipset, +- const char *name) +-{ +- const struct ipset_xlate_set *set; +- +- set = ipset_xlate_set_get(ipset, name); +- if (!set) +- return NULL; +- +- return set->type; +-} +- + static int + ipset_parser(struct ipset *ipset, int oargc, char *oargv[]) + { +@@ -1282,8 +1270,16 @@ ipset_parser(struct ipset *ipset, int oa + if (!ipset->xlate) { + type = ipset_type_get(session, cmd); + } else { +- type = ipset_xlate_type_get(ipset, arg0); +- ipset_session_data_set(session, IPSET_OPT_TYPE, type); ++ const struct ipset_xlate_set *xlate_set; ++ ++ xlate_set = ipset_xlate_set_get(ipset, arg0); ++ if (xlate_set) { ++ ipset_session_data_set(session, IPSET_OPT_TYPE, ++ xlate_set->type); ++ ipset_session_data_set(session, IPSET_OPT_FAMILY, ++ &xlate_set->family); ++ type = xlate_set->type; ++ } + } + if (type == NULL) + return ipset->standard_error(ipset, p); +--- a/tests/xlate/xlate.t ++++ b/tests/xlate/xlate.t +@@ -53,3 +53,5 @@ create bp1 bitmap:port range 1-1024 + add bp1 22 + create bim1 bitmap:ip,mac range 1.1.1.0/24 + add bim1 1.1.1.1,aa:bb:cc:dd:ee:ff ++create hn6 hash:net family inet6 ++add hn6 fe80::/64 +--- a/tests/xlate/xlate.t.nft ++++ b/tests/xlate/xlate.t.nft +@@ -54,3 +54,5 @@ add set inet global bp1 { type inet_serv + add element inet global bp1 { 22 } + add set inet global bim1 { type ipv4_addr . ether_addr; } + add element inet global bim1 { 1.1.1.1 . aa:bb:cc:dd:ee:ff } ++add set inet global hn6 { type ipv6_addr; flags interval; } ++add element inet global hn6 { fe80::/64 } From e9c99e0f7f02e94d8e8ca3da4429f5221684c305 Mon Sep 17 00:00:00 2001 From: Etienne Champetier Date: Sun, 13 Mar 2022 00:24:13 -0500 Subject: [PATCH 09/26] iptables: backport missing init_extensions6() calls This fixes ip6tables-nft no being able to use built-in extensions like icmp6. Signed-off-by: Etienne Champetier --- package/network/utils/iptables/Makefile | 2 +- ...l-init_extensions6-for-static-builds.patch | 68 +++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 package/network/utils/iptables/patches/001-xtables-Call-init_extensions6-for-static-builds.patch diff --git a/package/network/utils/iptables/Makefile b/package/network/utils/iptables/Makefile index f978173c9f..f8cf3ec6a5 100644 --- a/package/network/utils/iptables/Makefile +++ b/package/network/utils/iptables/Makefile @@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=iptables PKG_VERSION:=1.8.7 -PKG_RELEASE:=4 +PKG_RELEASE:=5 PKG_SOURCE_URL:=https://netfilter.org/projects/iptables/files PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 diff --git a/package/network/utils/iptables/patches/001-xtables-Call-init_extensions6-for-static-builds.patch b/package/network/utils/iptables/patches/001-xtables-Call-init_extensions6-for-static-builds.patch new file mode 100644 index 0000000000..22ccfa533a --- /dev/null +++ b/package/network/utils/iptables/patches/001-xtables-Call-init_extensions6-for-static-builds.patch @@ -0,0 +1,68 @@ +From e727ccad036e2cdba3339536c65c7ceef43c0740 Mon Sep 17 00:00:00 2001 +From: Erik Wilson +Date: Tue, 13 Jul 2021 16:48:23 -0700 +Subject: [PATCH] xtables: Call init_extensions6() for static builds + +Initialize extensions from libext6 for cases where xtables is built statically. + +Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1550 +Signed-off-by: Erik Wilson +Signed-off-by: Florian Westphal +--- + iptables/xtables-monitor.c | 1 + + iptables/xtables-restore.c | 1 + + iptables/xtables-save.c | 1 + + iptables/xtables-standalone.c | 1 + + iptables/xtables-translate.c | 1 + + 5 files changed, 5 insertions(+) + +--- a/iptables/xtables-monitor.c ++++ b/iptables/xtables-monitor.c +@@ -628,6 +628,7 @@ int xtables_monitor_main(int argc, char + #if defined(ALL_INCLUSIVE) || defined(NO_SHARED_LIBS) + init_extensions(); + init_extensions4(); ++ init_extensions6(); + #endif + + if (nft_init(&h, AF_INET, xtables_ipv4)) { +--- a/iptables/xtables-restore.c ++++ b/iptables/xtables-restore.c +@@ -364,6 +364,7 @@ xtables_restore_main(int family, const c + #if defined(ALL_INCLUSIVE) || defined(NO_SHARED_LIBS) + init_extensions(); + init_extensions4(); ++ init_extensions6(); + #endif + break; + case NFPROTO_ARP: +--- a/iptables/xtables-save.c ++++ b/iptables/xtables-save.c +@@ -202,6 +202,7 @@ xtables_save_main(int family, int argc, + #if defined(ALL_INCLUSIVE) || defined(NO_SHARED_LIBS) + init_extensions(); + init_extensions4(); ++ init_extensions6(); + #endif + tables = xtables_ipv4; + d.commit = true; +--- a/iptables/xtables-standalone.c ++++ b/iptables/xtables-standalone.c +@@ -57,6 +57,7 @@ xtables_main(int family, const char *pro + #if defined(ALL_INCLUSIVE) || defined(NO_SHARED_LIBS) + init_extensions(); + init_extensions4(); ++ init_extensions6(); + #endif + + if (nft_init(&h, family, xtables_ipv4) < 0) { +--- a/iptables/xtables-translate.c ++++ b/iptables/xtables-translate.c +@@ -469,6 +469,7 @@ static int xtables_xlate_main_common(str + #if defined(ALL_INCLUSIVE) || defined(NO_SHARED_LIBS) + init_extensions(); + init_extensions4(); ++ init_extensions6(); + #endif + tables = xtables_ipv4; + break; From 7f92046dff4d0c797c42f0754bf5d5adb5eb6990 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 6 Mar 2022 21:02:33 -0800 Subject: [PATCH 10/26] tools/mtools: update to 4.0.38 No real changelog available. Signed-off-by: Rosen Penev --- tools/mtools/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mtools/Makefile b/tools/mtools/Makefile index c10e887b36..90a4119af4 100644 --- a/tools/mtools/Makefile +++ b/tools/mtools/Makefile @@ -7,11 +7,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mtools -PKG_VERSION:=4.0.37 +PKG_VERSION:=4.0.38 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=@GNU/$(PKG_NAME) -PKG_HASH:=799b197e23e47b61259628810b27790efb7a1fe36037ef1da8a27b0ae4fa8342 +PKG_HASH:=7b94485f486e7df08cca68b00a164a13cd38f4c63cb8684d188759ee7bc5e729 HOST_BUILD_PARALLEL:=1 From f88a6da020796b33a638c21929803c8b695e45b8 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 6 Mar 2022 20:30:53 -0800 Subject: [PATCH 11/26] tools/cmake: update to 3.22.3 Seems to be mostly pthread fixes. Signed-off-by: Rosen Penev --- tools/cmake/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/cmake/Makefile b/tools/cmake/Makefile index d1d5b58a47..f0af6dfeaa 100644 --- a/tools/cmake/Makefile +++ b/tools/cmake/Makefile @@ -7,14 +7,14 @@ include $(TOPDIR)/rules.mk PKG_NAME:=cmake -PKG_VERSION:=3.22.2 +PKG_VERSION:=3.22.3 PKG_RELEASE:=1 PKG_CPE_ID:=cpe:/a:kitware:cmake PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/Kitware/CMake/releases/download/v$(PKG_VERSION)/ \ https://cmake.org/files/v3.19/ -PKG_HASH:=3c1c478b9650b107d452c5bd545c72e2fad4e37c09b89a1984b9a2f46df6aced +PKG_HASH:=9f8469166f94553b6978a16ee29227ec49a2eb5ceb608275dec40d8ae0d1b5a0 HOST_BUILD_PARALLEL:=1 HOST_CONFIGURE_PARALLEL:=1 From 9a44bc78b4413673f15a425e066d5c771b8054c6 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 6 Mar 2022 20:53:47 -0800 Subject: [PATCH 12/26] tools/fakeroot: update to 1.28 Refreshed patches. Upstream says there's only a bugfix for GNU Hurd. Signed-off-by: Rosen Penev --- tools/fakeroot/Makefile | 4 ++-- tools/fakeroot/patches/400-alpine-libc.musl-fix.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/fakeroot/Makefile b/tools/fakeroot/Makefile index adae332099..c29f51e77f 100644 --- a/tools/fakeroot/Makefile +++ b/tools/fakeroot/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=fakeroot -PKG_VERSION:=1.27 +PKG_VERSION:=1.28 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz PKG_SOURCE_URL:=@DEBIAN/pool/main/f/fakeroot -PKG_HASH:=3c45eb2d1802a2762069e2e9d21bdd6fb533592bc0cda74c9aff066ab01caddc +PKG_HASH:=56d405e36ff685f83879be08fdd654255ab9aa38632b4605a98e896ad63990c2 PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE_FILES:=COPYING PKG_FIXUP:=autoreconf diff --git a/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch b/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch index 730732db2e..530c96842e 100644 --- a/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch +++ b/tools/fakeroot/patches/400-alpine-libc.musl-fix.patch @@ -21,7 +21,7 @@ Error relocating openwrt/staging_dir/host/lib/libfakeroot.so: SEND_GET_XATTR: sy #define SEND_GET_XATTR64(a,b,c) send_get_xattr64(a,b) #endif -@@ -136,8 +138,9 @@ +@@ -140,8 +142,9 @@ /* 10.10 uses id_t in getpriority/setpriority calls, so pretend id_t is used everywhere, just happens to be int on some OSes */ From 9c290ad498326c06a8e9dabe19dfb1b1c709e651 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 6 Mar 2022 20:46:22 -0800 Subject: [PATCH 13/26] tools/ccache: update to 4.6 Full changelog: https://ccache.dev/releasenotes.html#_ccache_4_6 Signed-off-by: Rosen Penev --- tools/ccache/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/ccache/Makefile b/tools/ccache/Makefile index 1031fdec99..9b2937dccd 100644 --- a/tools/ccache/Makefile +++ b/tools/ccache/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk include $(INCLUDE_DIR)/target.mk PKG_NAME:=ccache -PKG_VERSION:=4.5.1 +PKG_VERSION:=4.6 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=https://github.com/ccache/ccache/releases/download/v$(PKG_VERSION) -PKG_HASH:=51186ebe0326365f4e6131e1caa8911de7da4aa6718efc00680322d63a759517 +PKG_HASH:=3d2bb860f4359169e640f60cf7cc11da5fab5fb9aed55230d78141e49c3945e9 include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/cmake.mk From 3f5b2d25eef9a252c54adcad18ba65a0d19d69b2 Mon Sep 17 00:00:00 2001 From: John Audia Date: Tue, 8 Mar 2022 17:01:48 -0500 Subject: [PATCH 14/26] kernel: bump 5.10 to 5.10.104 All 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.10 | 4 ++-- .../950-0027-i2c-bcm2835-Add-debug-support.patch | 14 +++++++------- ...bcm2835-Set-clock-stretch-timeout-to-35ms.patch | 4 ++-- ...rs-trx-parse-firmware-MTD-partitions-only.patch | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/kernel-5.10 b/include/kernel-5.10 index 5eededd53f..201f2b0ae0 100644 --- a/include/kernel-5.10 +++ b/include/kernel-5.10 @@ -1,2 +1,2 @@ -LINUX_VERSION-5.10 = .103 -LINUX_KERNEL_HASH-5.10.103 = 4fb8ad55e6430342e4fbc94d54e594e9be8eb6a8bea1d71eccf835948d08580a +LINUX_VERSION-5.10 = .104 +LINUX_KERNEL_HASH-5.10.104 = 394a9267ea8e24d0f0cfaad3439bf43abe7bcf6479dc9548e485b48a0ac562f1 diff --git a/target/linux/bcm27xx/patches-5.10/950-0027-i2c-bcm2835-Add-debug-support.patch b/target/linux/bcm27xx/patches-5.10/950-0027-i2c-bcm2835-Add-debug-support.patch index f481af1f9d..e32618d35e 100644 --- a/target/linux/bcm27xx/patches-5.10/950-0027-i2c-bcm2835-Add-debug-support.patch +++ b/target/linux/bcm27xx/patches-5.10/950-0027-i2c-bcm2835-Add-debug-support.patch @@ -37,7 +37,7 @@ Signed-off-by: Noralf Trønnes --- a/drivers/i2c/busses/i2c-bcm2835.c +++ b/drivers/i2c/busses/i2c-bcm2835.c -@@ -51,6 +51,18 @@ +@@ -56,6 +56,18 @@ #define BCM2835_I2C_CDIV_MIN 0x0002 #define BCM2835_I2C_CDIV_MAX 0xFFFE @@ -56,7 +56,7 @@ Signed-off-by: Noralf Trønnes struct bcm2835_i2c_dev { struct device *dev; void __iomem *regs; -@@ -63,8 +75,78 @@ struct bcm2835_i2c_dev { +@@ -68,8 +80,78 @@ struct bcm2835_i2c_dev { u32 msg_err; u8 *msg_buf; size_t msg_buf_remaining; @@ -135,7 +135,7 @@ Signed-off-by: Noralf Trønnes static inline void bcm2835_i2c_writel(struct bcm2835_i2c_dev *i2c_dev, u32 reg, u32 val) { -@@ -252,6 +334,7 @@ static void bcm2835_i2c_start_transfer(s +@@ -257,6 +339,7 @@ static void bcm2835_i2c_start_transfer(s bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_A, msg->addr); bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_DLEN, msg->len); bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, c); @@ -143,7 +143,7 @@ Signed-off-by: Noralf Trønnes } static void bcm2835_i2c_finish_transfer(struct bcm2835_i2c_dev *i2c_dev) -@@ -278,6 +361,7 @@ static irqreturn_t bcm2835_i2c_isr(int t +@@ -283,6 +366,7 @@ static irqreturn_t bcm2835_i2c_isr(int t u32 val, err; val = bcm2835_i2c_readl(i2c_dev, BCM2835_I2C_S); @@ -151,7 +151,7 @@ Signed-off-by: Noralf Trønnes err = val & (BCM2835_I2C_S_CLKT | BCM2835_I2C_S_ERR); if (err) { -@@ -344,6 +428,13 @@ static int bcm2835_i2c_xfer(struct i2c_a +@@ -349,6 +433,13 @@ static int bcm2835_i2c_xfer(struct i2c_a unsigned long time_left; int i; @@ -165,7 +165,7 @@ Signed-off-by: Noralf Trønnes for (i = 0; i < (num - 1); i++) if (msgs[i].flags & I2C_M_RD) { dev_warn_once(i2c_dev->dev, -@@ -362,6 +453,10 @@ static int bcm2835_i2c_xfer(struct i2c_a +@@ -367,6 +458,10 @@ static int bcm2835_i2c_xfer(struct i2c_a bcm2835_i2c_finish_transfer(i2c_dev); @@ -176,7 +176,7 @@ Signed-off-by: Noralf Trønnes if (!time_left) { bcm2835_i2c_writel(i2c_dev, BCM2835_I2C_C, BCM2835_I2C_C_CLEAR); -@@ -372,7 +467,9 @@ static int bcm2835_i2c_xfer(struct i2c_a +@@ -377,7 +472,9 @@ static int bcm2835_i2c_xfer(struct i2c_a if (!i2c_dev->msg_err) return num; diff --git a/target/linux/bcm27xx/patches-5.10/950-0146-i2c-bcm2835-Set-clock-stretch-timeout-to-35ms.patch b/target/linux/bcm27xx/patches-5.10/950-0146-i2c-bcm2835-Set-clock-stretch-timeout-to-35ms.patch index 9cb93621bb..48a561e38a 100644 --- a/target/linux/bcm27xx/patches-5.10/950-0146-i2c-bcm2835-Set-clock-stretch-timeout-to-35ms.patch +++ b/target/linux/bcm27xx/patches-5.10/950-0146-i2c-bcm2835-Set-clock-stretch-timeout-to-35ms.patch @@ -19,7 +19,7 @@ Signed-off-by: Phil Elwell --- a/drivers/i2c/busses/i2c-bcm2835.c +++ b/drivers/i2c/busses/i2c-bcm2835.c -@@ -188,6 +188,7 @@ static int clk_bcm2835_i2c_set_rate(stru +@@ -193,6 +193,7 @@ static int clk_bcm2835_i2c_set_rate(stru { struct clk_bcm2835_i2c *div = to_clk_bcm2835_i2c(hw); u32 redl, fedl; @@ -27,7 +27,7 @@ Signed-off-by: Phil Elwell u32 divider = clk_bcm2835_i2c_calc_divider(rate, parent_rate); if (divider == -EINVAL) -@@ -211,6 +212,17 @@ static int clk_bcm2835_i2c_set_rate(stru +@@ -216,6 +217,17 @@ static int clk_bcm2835_i2c_set_rate(stru bcm2835_i2c_writel(div->i2c_dev, BCM2835_I2C_DEL, (fedl << BCM2835_I2C_FEDL_SHIFT) | (redl << BCM2835_I2C_REDL_SHIFT)); diff --git a/target/linux/bcm53xx/patches-5.10/140-mtd-parsers-trx-parse-firmware-MTD-partitions-only.patch b/target/linux/bcm53xx/patches-5.10/140-mtd-parsers-trx-parse-firmware-MTD-partitions-only.patch index fa86303637..e1933e75c7 100644 --- a/target/linux/bcm53xx/patches-5.10/140-mtd-parsers-trx-parse-firmware-MTD-partitions-only.patch +++ b/target/linux/bcm53xx/patches-5.10/140-mtd-parsers-trx-parse-firmware-MTD-partitions-only.patch @@ -30,9 +30,9 @@ Signed-off-by: Rafał Miłecki --- a/drivers/mtd/parsers/parser_trx.c +++ b/drivers/mtd/parsers/parser_trx.c -@@ -85,6 +85,10 @@ static int parser_trx_parse(struct mtd_i - uint8_t curr_part = 0, i = 0; - int err; +@@ -92,6 +92,10 @@ static int parser_trx_parse(struct mtd_i + if (err != 0 && err != -EINVAL) + pr_err("failed to parse \"brcm,trx-magic\" DT attribute, using default: %d\n", err); + /* Don't parse any failsafe / backup partitions */ + if (strcmp(mtd->name, "firmware")) From efc8aff62cb244583a14c30f8d099103b75ced1d Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Wed, 9 Mar 2022 10:35:04 +0800 Subject: [PATCH 15/26] kernel/modules: add kmod-inet-diag package Add option to compile kmod-inet-diag, support for INET (TCP, DCCP, etc) socket monitoring interface used by native Linux tools such as ss. Signed-off-by: Tianling Shen --- package/kernel/linux/modules/netsupport.mk | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index 92ff194a62..fd9051586a 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -1295,6 +1295,31 @@ endef $(eval $(call KernelPackage,netlink-diag)) +define KernelPackage/inet-diag + SUBMENU:=$(NETWORK_SUPPORT_MENU) + TITLE:=INET diag support for ss utility + KCONFIG:= \ + CONFIG_INET_DIAG \ + CONFIG_INET_TCP_DIAG \ + CONFIG_INET_UDP_DIAG \ + CONFIG_INET_RAW_DIAG \ + CONFIG_INET_DIAG_DESTROY=n + FILES:= \ + $(LINUX_DIR)/net/ipv4/inet_diag.ko \ + $(LINUX_DIR)/net/ipv4/tcp_diag.ko \ + $(LINUX_DIR)/net/ipv4/udp_diag.ko \ + $(LINUX_DIR)/net/ipv4/raw_diag.ko + AUTOLOAD:=$(call AutoLoad,31,inet_diag tcp_diag udp_diag raw_diag) +endef + +define KernelPackage/inet-diag/description +Support for INET (TCP, DCCP, etc) socket monitoring interface used by +native Linux tools such as ss. +endef + +$(eval $(call KernelPackage,inet-diag)) + + define KernelPackage/wireguard SUBMENU:=$(NETWORK_SUPPORT_MENU) TITLE:=WireGuard secure network tunnel From d1a8690742fc448b764cf5fb448b6459c13e3ccc Mon Sep 17 00:00:00 2001 From: Martin Kennedy Date: Sat, 5 Mar 2022 14:02:36 -0500 Subject: [PATCH 16/26] realtek: add ZyXEL GS1900-24 v1 support The ZyXEL GS1900-24 v1 is a 24 port switch with two SFP ports, similar to the other GS1900 switches. Specifications -------------- * Device: ZyXEL GS1900-24 v1 * SoC: Realtek RTL8382M 500 MHz MIPS 4KEc * Flash: 16 MiB * RAM: Winbond W9751G8KB-25 64 MiB DDR2 SDRAM * Ethernet: 24x 10/100/1000 Mbps, 2x SFP 100/1000 Mbps * LEDs: * 1 PWR LED (green, not configurable) * 1 SYS LED (green, configurable) * 24 ethernet port link/activity LEDs (green, SoC controlled) * 2 SFP status/activity LEDs (green, SoC controlled) * Buttons: * 1 "RESET" button on front panel (soft reset) * 1 button ('SW1') behind right hex grate (hardwired power-off) * Power: 120-240V AC C13 * UART: Internal populated 10-pin header ('J5') providing RS232; connected to SoC UART through a SIPEX 3232EC for voltage level shifting. * 'J5' RS232 Pinout (dot as pin 1): 2) SoC RXD 3) GND 10) SoC TXD Serial connection parameters: 115200 8N1. Installation ------------ OEM upgrade method: * Log in to OEM management web interface * Navigate to Maintenance > Firmware > Management * If "Active Image" has the first option selected, OpenWrt will need to be flashed to the "Active" partition. If the second option is selected, OpenWrt will need to be flashed to the "Backup" partition. * Navigate to Maintenance > Firmware > Upload * Upload the openwrt-realtek-rtl838x-zyxel_gs1900-24-v1-initramfs-kernel.bin file by your preferred method to the previously determined partition. When prompted, select to boot from the newly flashed image, and reboot the switch. * Once OpenWrt has booted, scp the sysupgrade image to /tmp and flash it: > sysupgrade /tmp/openwrt-realtek-rtl838x-zyxel_gs1900-24-v1-squashfs-sysupgrade.bin U-Boot TFTP method: * Configure your client with a static 192.168.1.x IP (e.g. 192.168.1.10). * Set up a TFTP server on your client and make it serve the initramfs image. * Connect serial, power up the switch, interrupt U-boot by hitting the space bar, and enable the network: > rtk network on > Since the GS1900-24 v1 is a dual-partition device, you want to keep the OEM firmware on the backup partition for the time being. OpenWrt can only be installed in the first partition anyway (hardcoded in the DTS). To ensure we are set to boot from the first partition, issue the following commands: > setsys bootpartition 0 > savesys * Download the image onto the device and boot from it: > tftpboot 0x81f00000 192.168.1.10:openwrt-realtek-rtl838x-zyxel_gs1900-24-v1-initramfs-kernel.bin > bootm * Once OpenWrt has booted, scp the sysupgrade image to /tmp and flash it: > sysupgrade /tmp/openwrt-realtek-rtl838x-zyxel_gs1900-24-v1-squashfs-sysupgrade.bin Signed-off-by: Martin Kennedy --- package/boot/uboot-envtools/files/realtek | 1 + .../dts-5.10/rtl8382_zyxel_gs1900-24-v1.dts | 128 ++++++++++++++++++ target/linux/realtek/image/rtl838x.mk | 9 ++ 3 files changed, 138 insertions(+) create mode 100644 target/linux/realtek/dts-5.10/rtl8382_zyxel_gs1900-24-v1.dts diff --git a/package/boot/uboot-envtools/files/realtek b/package/boot/uboot-envtools/files/realtek index a609362a53..9836462a92 100644 --- a/package/boot/uboot-envtools/files/realtek +++ b/package/boot/uboot-envtools/files/realtek @@ -15,6 +15,7 @@ zyxel,gs1900-8|\ zyxel,gs1900-8hp-v1|\ zyxel,gs1900-8hp-v2|\ zyxel,gs1900-10hp|\ +zyxel,gs1900-24-v1|\ zyxel,gs1900-24hp-v2) idx="$(find_mtd_index u-boot-env)" [ -n "$idx" ] && \ diff --git a/target/linux/realtek/dts-5.10/rtl8382_zyxel_gs1900-24-v1.dts b/target/linux/realtek/dts-5.10/rtl8382_zyxel_gs1900-24-v1.dts new file mode 100644 index 0000000000..81482dde10 --- /dev/null +++ b/target/linux/realtek/dts-5.10/rtl8382_zyxel_gs1900-24-v1.dts @@ -0,0 +1,128 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "rtl8380_zyxel_gs1900.dtsi" + +/ { + compatible = "zyxel,gs1900-24-v1", "realtek,rtl838x-soc"; + model = "ZyXEL GS1900-24 v1"; + + memory@0 { + reg = <0x0 0x4000000>; + }; + + /* i2c of the left SFP cage: port 25 */ + i2c0: i2c-gpio-0 { + compatible = "i2c-gpio"; + sda-gpios = <&gpio1 24 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + scl-gpios = <&gpio1 25 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + i2c-gpio,delay-us = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + sfp0: sfp-p25 { + compatible = "sff,sfp"; + i2c-bus = <&i2c0>; + los-gpio = <&gpio1 27 GPIO_ACTIVE_HIGH>; + tx-fault-gpio = <&gpio1 22 GPIO_ACTIVE_HIGH>; + mod-def0-gpio = <&gpio1 26 GPIO_ACTIVE_LOW>; + tx-disable-gpio = <&gpio1 23 GPIO_ACTIVE_HIGH>; + }; + + /* i2c of the right SFP cage: port 26 */ + i2c1: i2c-gpio-1 { + compatible = "i2c-gpio"; + sda-gpios = <&gpio1 30 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + scl-gpios = <&gpio1 31 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + i2c-gpio,delay-us = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + sfp1: sfp-p26 { + compatible = "sff,sfp"; + i2c-bus = <&i2c1>; + los-gpio = <&gpio1 33 GPIO_ACTIVE_HIGH>; + tx-fault-gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>; + mod-def0-gpio = <&gpio1 32 GPIO_ACTIVE_LOW>; + tx-disable-gpio = <&gpio1 29 GPIO_ACTIVE_HIGH>; + }; +}; + +&uart1 { + status = "okay"; +}; + +&mdio { + 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(16) + EXTERNAL_PHY(17) + EXTERNAL_PHY(18) + EXTERNAL_PHY(19) + EXTERNAL_PHY(20) + EXTERNAL_PHY(21) + EXTERNAL_PHY(22) + EXTERNAL_PHY(23) + + INTERNAL_PHY(24) + INTERNAL_PHY(26) +}; + +&switch0 { + ports { + 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@24 { + reg = <24>; + label = "lan25"; + phy-mode = "1000base-x"; + managed = "in-band-status"; + sfp = <&sfp0>; + }; + + port@26 { + reg = <26>; + label = "lan26"; + phy-mode = "1000base-x"; + managed = "in-band-status"; + sfp = <&sfp1>; + }; + }; +}; + +&gpio1 { + /delete-node/ poe_enable; +}; diff --git a/target/linux/realtek/image/rtl838x.mk b/target/linux/realtek/image/rtl838x.mk index 43242d3eea..b9259401b2 100644 --- a/target/linux/realtek/image/rtl838x.mk +++ b/target/linux/realtek/image/rtl838x.mk @@ -126,6 +126,15 @@ define Device/zyxel_gs1900-8hp-v2 endef TARGET_DEVICES += zyxel_gs1900-8hp-v2 +define Device/zyxel_gs1900-24-v1 + $(Device/zyxel_gs1900) + SOC := rtl8382 + DEVICE_MODEL := GS1900-24 + DEVICE_VARIANT := v1 + ZYXEL_VERS := AAHL +endef +TARGET_DEVICES += zyxel_gs1900-24-v1 + define Device/zyxel_gs1900-24hp-v2 $(Device/zyxel_gs1900) SOC := rtl8382 From da1347d6d6462b14a62c76dc7b90205dcb3ceacd Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Wed, 9 Mar 2022 23:30:59 +0900 Subject: [PATCH 17/26] realtek: enable pca953x driver for rtl838x subtarget The system status LED on Panasonic Switch-M8eG PN28080K 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 Acked-by: Sander Vanheule --- target/linux/realtek/rtl838x/config-5.10 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/linux/realtek/rtl838x/config-5.10 b/target/linux/realtek/rtl838x/config-5.10 index 1252aab11e..8e27af95ba 100644 --- a/target/linux/realtek/rtl838x/config-5.10 +++ b/target/linux/realtek/rtl838x/config-5.10 @@ -69,6 +69,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 @@ -166,6 +168,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 e83ab243bef6e32c1fbb8ceda5301aa21f0c51cf Mon Sep 17 00:00:00 2001 From: INAGAKI Hiroshi Date: Wed, 9 Mar 2022 23:31:00 +0900 Subject: [PATCH 18/26] realtek: add support for Panasonic Switch-M8eG PN28080K Panasonic Switch-M8eG PN28080K is a 8 + 1 port gigabit switch, based on RTL8380M. Specification: - SoC : Realtek RTL8380M - RAM : DDR3 128 MiB (Winbond W631GG8KB-15) - Flash : SPI-NOR 32 MiB (Macronix MX25L25635FMI-10G) - Ethernet : 10/100/1000 Mbps x8 + 1 - port 1-8 : TP, RTL8218B (SoC) - port 9 : SFP, RTL8380M (SoC) - 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: pn28080k_v30000.rom) and place it to the TFTP directory 4. Boot M8eG 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 pn28080k_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 Note: - "Switch-M8eG" is a model name, and "PN28080K" is a model number. Switch-M8eG has an another (old) model number ("PN28080"), it's not a Realtek based hardware. - Switch-M8eG has a "POWER" LED (Green), but it's not connected to any GPIO pin. - The U-Boot checks the runtime images in the flash when booting and fails to execute anything in "bootcmd" variable if the images are not exsisting. - 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". - On the other devices in the same series of Switch-M8eG PN28080K, the INT pin on the PCA9555 is not connected to anywhere. 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 Reviewed-by: Sander Vanheule --- .../rtl8380_panasonic_m8eg-pn28080k.dts | 133 ++++++++++++ .../rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi | 195 ++++++++++++++++++ target/linux/realtek/image/rtl838x.mk | 10 + 3 files changed, 338 insertions(+) create mode 100644 target/linux/realtek/dts-5.10/rtl8380_panasonic_m8eg-pn28080k.dts create mode 100644 target/linux/realtek/dts-5.10/rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi diff --git a/target/linux/realtek/dts-5.10/rtl8380_panasonic_m8eg-pn28080k.dts b/target/linux/realtek/dts-5.10/rtl8380_panasonic_m8eg-pn28080k.dts new file mode 100644 index 0000000000..f9d58f5b66 --- /dev/null +++ b/target/linux/realtek/dts-5.10/rtl8380_panasonic_m8eg-pn28080k.dts @@ -0,0 +1,133 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "rtl838x.dtsi" +#include "rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi" + +#include + +/ { + compatible = "panasonic,m8eg-pn28080k", "realtek,rtl8380-soc"; + model = "Panasonic Switch-M8eG PN28080K"; + + 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: sfp-p9 { + 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>; + }; +}; + +&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)>; +}; + +&gpio1 { + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio0>; + interrupts = <2 IRQ_TYPE_EDGE_FALLING>; +}; + +&gpio2 { + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio0>; + interrupts = <2 IRQ_TYPE_EDGE_FALLING>; +}; + +&i2c_switch { + i2c0: i2c@0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; +}; + +ðernet0 { + mdio-bus { + compatible = "realtek,rtl838x-mdio"; + regmap = <ðernet0>; + #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) + + INTERNAL_PHY(24) + }; +}; + +&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) + + port@24 { + reg = <24>; + label = "lan9"; + phy-mode = "1000base-x"; + phy-handle = <&phy24>; + managed = "in-band-status"; + sfp = <&sfp0>; + }; + + 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 new file mode 100644 index 0000000000..48aa1849d6 --- /dev/null +++ b/target/linux/realtek/dts-5.10/rtl83xx_panasonic_mxxeg-pn28xx0k.dtsi @@ -0,0 +1,195 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include +#include + +/ { + chosen { + bootargs = "console=ttyS0,9600"; + }; + + memory@0 { + device_type = "memory"; + reg = <0x0 0x8000000>; + }; + + leds: leds { + compatible = "gpio-leds"; + + led-0 { + label = "amber:any_col"; + gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_FAULT; + }; + + led-1 { + label = "green:giga"; + gpios = <&gpio2 8 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_INDICATOR; + function-enumerator = <1>; + }; + + led-2 { + label = "green:100m"; + gpios = <&gpio2 9 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_INDICATOR; + function-enumerator = <2>; + }; + + led-3 { + label = "green:full"; + gpios = <&gpio2 10 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_INDICATOR; + function-enumerator = <3>; + }; + + led-4 { + label = "green:loop_history"; + gpios = <&gpio2 11 GPIO_ACTIVE_LOW>; + color = ; + function = LED_FUNCTION_INDICATOR; + function-enumerator = <4>; + }; + }; + + keys { + compatible = "gpio-keys"; + + led_mode { + label = "led-mode"; + gpios = <&gpio2 15 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + gpio-restart { + compatible = "gpio-restart"; + gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>; + }; + + i2c_gpio_0: i2c-gpio-0 { + compatible = "i2c-gpio"; + i2c-gpio,delay-us = <2>; + #address-cells = <1>; + #size-cells = <0>; + + gpio1: gpio@20 { + compatible = "nxp,pca9555"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + }; + + gpio2: gpio@75 { + compatible = "nxp,pca9539"; + reg = <0x75>; + gpio-controller; + #gpio-cells = <2>; + + /* + * GPIO14 (IO1_6): Shift Register RESET (port LED) + * - Switch-M8eG PN28080K: 3x 74HC164 + * - Switch-M24eG PN28240K: 6x 74HC164 + * - Switch-M48eG PN28480K: 12x 74HC164 + */ + portled_sregister_reset { + gpio-hog; + gpios = <14 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "portled-sregister-reset"; + }; + }; + }; + + i2c_gpio_1: i2c-gpio-1 { + compatible = "i2c-gpio"; + i2c-gpio,delay-us = <2>; + #address-cells = <1>; + #size-cells = <0>; + + i2c_switch: i2c-switch@70 { + compatible = "nxp,pca9545"; + reset-gpios = <&gpio2 13 GPIO_ACTIVE_LOW>; + reg = <0x70>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; +}; + +&spi0 { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <10000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + label = "u-boot-env"; + reg = <0x80000 0x10000>; + }; + + partition@90000 { + label = "u-boot-env2"; + reg = <0x90000 0x10000>; + }; + + partition@a0000 { + label = "sysinfo"; + reg = <0xa0000 0x60000>; + read-only; + }; + + /* + * Filesystem area in stock firmware + * (0x100000-0x1DFFFFF) + * + * stock firmware images are required to pass + * the checking by the U-Boot, also for OpenWrt + * + * in OpenWrt: + * - 0x100000-0xDFFFFF (13M): stock images + * - 0xE00000-0x1DFFFFF(16M): OpenWrt image + */ + partition@100000 { + label = "fs_reserved"; + reg = <0x100000 0xd00000>; + }; + + partition@e00000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0xe00000 0x1000000>; + }; + + partition@1e00000 { + label = "vlog_data"; + reg = <0x1e00000 0x100000>; + read-only; + }; + + partition@1f00000 { + label = "elog_data"; + reg = <0x1f00000 0x100000>; + read-only; + }; + }; + }; +}; diff --git a/target/linux/realtek/image/rtl838x.mk b/target/linux/realtek/image/rtl838x.mk index b9259401b2..9688dd93de 100644 --- a/target/linux/realtek/image/rtl838x.mk +++ b/target/linux/realtek/image/rtl838x.mk @@ -85,6 +85,16 @@ define Device/netgear_gs310tp-v1 endef TARGET_DEVICES += netgear_gs310tp-v1 +define Device/panasonic_m8eg-pn28080k + SOC := rtl8380 + IMAGE_SIZE := 16384k + DEVICE_VENDOR := Panasonic + DEVICE_MODEL := Switch-M8eG + DEVICE_VARIANT := PN28080K + DEVICE_PACKAGES := kmod-i2c-mux-pca954x +endef +TARGET_DEVICES += panasonic_m8eg-pn28080k + define Device/zyxel_gs1900 SOC := rtl8380 IMAGE_SIZE := 6976k From 07723492e9acf5aea51eb8de3bcc4e36305c9e6b Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 17 Mar 2021 19:07:46 -0400 Subject: [PATCH 19/26] ath79: improve factory.bin for some Senao devices Some boards with firmware made with Senao SDK based on Linux 3.3 have the following lines in the OEM upgrade script at /etc/fwupgrade.sh local append="" local CONF_TAR="/tmp/sysupgrade.tgz" [ -f "$CONF_TAR" ] && append="-j $CONF_TAR" and \# check FWINFO filename [ -z $(ls FWINFO* | grep -i ${modelname}) ] && errcode="1" This addition also prevents needing to factory reset after flashing for some boards that also have these lines in the script \# Support downgrade but do default (Smart v2.x.x.x -> senaowrt v1.x.x.x) [ $(ls FWINFO* | grep -i ${modelname} | cut -d "-" -f4 | cut -c 2) -lt 2 ] && append="" Signed-off-by: Michael Pratt --- target/linux/ath79/image/common-senao.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/linux/ath79/image/common-senao.mk b/target/linux/ath79/image/common-senao.mk index c9c14944c4..dda7da6776 100644 --- a/target/linux/ath79/image/common-senao.mk +++ b/target/linux/ath79/image/common-senao.mk @@ -1,6 +1,6 @@ DEVICE_VARS += SENAO_IMGNAME -# This needs to make /tmp/_sys/sysupgrade.tgz an empty file prior to +# This needs to make OEM config archive 'sysupgrade.tgz' an empty file prior to OEM # sysupgrade, as otherwise it will implant the old configuration from # OEM firmware when writing rootfs from factory.bin # rootfs size and checksum is taken from a squashfs header @@ -9,7 +9,9 @@ define Build/senao-tar-gz -[ -f "$@" ] && \ mkdir -p $@.tmp && \ touch $@.tmp/failsafe.bin && \ + touch $@.tmp/FWINFO-$(word 1,$(1))-$(REVISION) && \ echo '#!/bin/sh' > $@.tmp/before-upgrade.sh && \ + echo ': > /tmp/sysupgrade.tgz' >> $@.tmp/before-upgrade.sh && \ echo ': > /tmp/_sys/sysupgrade.tgz' >> $@.tmp/before-upgrade.sh && \ echo -n $$(( $$(cat $@ | wc -c) / 4096 * 4096 )) > $@.len && \ dd if=$@ bs=$$(cat $@.len) count=1 | md5sum - | cut -d ' ' -f 1 > $@.md5 && \ From 561f46bd02a99c47298b396485f7bac2b4c9fce7 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Fri, 26 Mar 2021 02:12:26 -0400 Subject: [PATCH 20/26] ath79: add support for Araknis AN-300-AP-I-N FCC ID: U2M-AN300APIN Araknis AN-300-AP-I-N is an indoor wireless access point with 1 Gb ethernet port, dual-band wireless, internal antenna plates, and 802.3at PoE+ this board is a Senao device: the hardware is equivalent to EnGenius EWS310AP the software is modified Senao SDK which is based on openwrt and uboot including image checksum verification at boot time, and a failsafe image that boots if checksum fails **Specification:** - AR9344 SOC MIPS 74kc, 2.4 GHz WMAC, 2x2 - AR9382 WLAN PCI on-board 168c:0030, 5 GHz, 2x2 - AR8035-A PHY RGMII GbE with PoE+ IN - 40 MHz clock - 16 MB FLASH MX25L12845EMI-10G - 2x 64 MB RAM 1839ZFG V59C1512164QFJ25 - UART console J10, populated, RX shorted to ground - 4 antennas 5 dBi, internal omni-directional plates - 4 LEDs power, 2G, 5G, wps - 1 button reset NOTE: all 4 gpio controlled LEDS are viewed through the same lightguide therefore, the power LED is off for default state **MAC addresses:** MAC address labeled as ETH Only one Vendor MAC address in flash at art 0x0 eth0 ETH *:7d art 0x0 phy1 2.4G *:7e --- phy0 5GHz *:7f --- **Serial Access:** the RX line on the board for UART is shorted to ground by resistor R176 therefore it must be removed to use the console but it is not necessary to remove to view boot log optionally, R175 can be replaced with a solder bridge short the resistors R175 and R176 are next to the UART RX pin at J10 **Installation:** Method 1: Firmware upgrade page: (if you cannot access the APs webpage) factory reset with the reset button connect ethernet to a computer OEM webpage at 192.168.20.253 username and password 'araknis' make a new password, login again... Navigate to 'File Management' page from left pane Click Browse and select the factory.bin image Upload and verify checksum Click Continue to confirm wait about 3 minutes Method 2: Serial to load Failsafe webpage: After connecting to serial console and rebooting... Interrupt uboot with any key pressed rapidly execute `run failsafe_boot` OR `bootm 0x9fd70000` wait a minute connect to ethernet and navigate to 192.168.20.253 Select the factory.bin image and upload wait about 3 minutes **Return to OEM:** Method 1: Serial to load Failsafe webpage (above) Method 2: delete a checksum from uboot-env this will make uboot load the failsafe image at next boot because it will fail the checksum verification of the image ssh into openwrt and run `fw_setenv rootfs_checksum 0` reboot, wait a minute connect to ethernet and navigate to 192.168.20.253 select OEM firmware image and click upgrade Method 3: backup mtd partitions before upgrade **TFTP recovery:** Requires serial console, reset button does nothing rename initramfs-kernel.bin to '0101A8C0.img' make available on TFTP server at 192.168.1.101 power board, interrupt boot with serial console execute `tftpboot` and `bootm 0x81000000` NOTE: TFTP may not be reliable due to bugged bootloader set MTU to 600 and try many times **Format of OEM firmware image:** The OEM software is built using SDKs from Senao which is based on a heavily modified version of Openwrt Kamikaze or Altitude Adjustment. One of the many modifications is sysupgrade being performed by a custom script. Images are verified through successful unpackaging, correct filenames and size requirements for both kernel and rootfs files, and that they start with the correct magic numbers (first 2 bytes) for the respective headers. Newer Senao software requires more checks but their script includes a way to skip them. The OEM upgrade script is at /etc/fwupgrade.sh OKLI kernel loader is required because the OEM software expects the kernel to be less than 1536k and the OEM upgrade procedure would otherwise overwrite part of the kernel when writing rootfs. Note on PLL-data cells: The default PLL register values will not work because of the external AR8035 switch between the SOC and the ethernet port. For QCA955x series, the PLL registers for eth0 and eth1 can be see in the DTSI as 0x28 and 0x48 respectively. Therefore the PLL registers can be read from uboot for each link speed after attempting tftpboot or another network action using that link speed with `md 0x18050028 1` and `md 0x18050048 1`. The clock delay required for RGMII can be applied at the PHY side, using the at803x driver `phy-mode` setting through the DTS. Therefore, the Ethernet Configuration registers for GMAC0 do not need the bits for RGMII delay on the MAC side. This is possible due to fixes in at803x driver since Linux 5.1 and 5.3 Signed-off-by: Michael Pratt --- package/boot/uboot-envtools/files/ath79 | 1 + .../dts/ar9344_araknis_an-300-ap-i-n.dts | 120 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/10-ath9k-eeprom | 1 + .../base-files/lib/upgrade/platform.sh | 1 + target/linux/ath79/image/generic.mk | 11 ++ 6 files changed, 135 insertions(+) create mode 100644 target/linux/ath79/dts/ar9344_araknis_an-300-ap-i-n.dts diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index bc02f4517c..c5f398ffc7 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -20,6 +20,7 @@ alfa-network,pi-wifi4|\ alfa-network,r36a|\ alfa-network,tube-2hq|\ allnet,all-wap02860ac|\ +araknis,an-300-ap-i-n|\ arduino,yun|\ buffalo,bhr-4grv2|\ devolo,magic-2-wifi|\ diff --git a/target/linux/ath79/dts/ar9344_araknis_an-300-ap-i-n.dts b/target/linux/ath79/dts/ar9344_araknis_an-300-ap-i-n.dts new file mode 100644 index 0000000000..a886b4c001 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_araknis_an-300-ap-i-n.dts @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" +#include "ar934x_senao_loader.dtsi" + +#include +#include + +/ { + compatible = "araknis,an-300-ap-i-n", "qca,ar9344"; + model = "Araknis AN-300-AP-I-N"; + + aliases { + label-mac-device = ð0; + led-boot = &led_power; + led-failsafe = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "amber:power"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + wifi5g { + label = "blue:wifi5g"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wps { + label = "blue:wps"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + }; + }; + + ath9k-leds { + compatible = "gpio-leds"; + + wifi2g { + label = "blue:wifi2g"; + gpios = <&ath9k 0 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + }; +}; + +&mdio0 { + status = "okay"; + + phy0: ethernet-phy@0 { + reg = <0>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + + phy-handle = <&phy0>; + phy-mode = "rgmii-txid"; + + pll-data = <0x02000000 0x00000101 0x00001313>; +}; + +&pcie { + status = "okay"; + + ath9k: wifi@0,0,0 { + compatible = "pci168c,0030"; + reg = <0x0 0 0 0 0>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; + qca,disable-5ghz; + qca,no-eeprom; + #gpio-cells = <2>; + gpio-controller; + }; +}; + +&wmac { + status = "okay"; + + qca,disable-2ghz; + + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <2>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 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 86ce8f5bd7..41e52c6748 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 @@ -14,6 +14,7 @@ ath79_setup_interfaces() alfa-network,ap121f|\ alfa-network,pi-wifi4|\ alfa-network,tube-2hq|\ + araknis,an-300-ap-i-n|\ arduino,yun|\ aruba,ap-105|\ asus,rp-ac66|\ diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 31b872e618..22e162692e 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -72,6 +72,7 @@ case "$FIRMWARE" in ;; "ath9k-eeprom-pci-0000:00:00.0.bin") case $board in + araknis,an-300-ap-i-n|\ atheros,db120|\ engenius,eap600|\ engenius,ecb600|\ diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index 67e53c5fde..cf85196519 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -48,6 +48,7 @@ platform_do_upgrade() { redboot_fis_do_upgrade "$1" vmlinux_2 ;; allnet,all-wap02860ac|\ + araknis,an-300-ap-i-n|\ engenius,eap1200h|\ engenius,eap300-v2|\ engenius,eap600|\ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 27a9860d28..e6d4450bde 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -320,6 +320,17 @@ define Device/allnet_all-wap02860ac endef TARGET_DEVICES += allnet_all-wap02860ac +define Device/araknis_an-300-ap-i-n + $(Device/senao_loader_okli) + SOC := ar9344 + DEVICE_VENDOR := Araknis + DEVICE_MODEL := AN-300-AP-I-N + IMAGE_SIZE := 12096k + LOADER_FLASH_OFFS := 0x220000 + SENAO_IMGNAME := senao-an300 +endef +TARGET_DEVICES += araknis_an-300-ap-i-n + define Device/arduino_yun SOC := ar9331 DEVICE_VENDOR := Arduino From 56716b578e0f0085fadc337d0476d0028ed43994 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 17 Mar 2021 01:07:36 -0400 Subject: [PATCH 21/26] ath79: add support for Araknis AN-500-AP-I-AC FCC ID: 2AG6R-AN500APIAC Araknis AN-500-AP-I-AC is an indoor wireless access point with 1 Gb ethernet port, dual-band wireless, internal antenna plates, and 802.3at PoE+ this board is a Senao device: the hardware is equivalent to EnGenius EAP1200 the software is modified Senao SDK which is based on openwrt and uboot including image checksum verification at boot time, and a failsafe image that boots if checksum fails **Specification:** - QCA9557 SOC MIPS 74kc, 2.4 GHz WMAC, 2x2 - QCA9882 WLAN PCI card 168c:003c, 5 GHz, 2x2, 26dBm - AR8035-A PHY RGMII GbE with PoE+ IN - 40 MHz clock - 16 MB FLASH MX25L12845EMI-10G - 2x 64 MB RAM NT5TU32M16 - UART console J10, populated, RX shorted to ground - 4 antennas 5 dBi, internal omni-directional plates - 4 LEDs power, 2G, 5G, wps - 1 button reset NOTE: all 4 gpio controlled LEDS are viewed through the same lightguide therefore, the power LED is off for default state **MAC addresses:** MAC address labeled as ETH Only one Vendor MAC address in flash at art 0x0 eth0 ETH *:e1 art 0x0 phy1 2.4G *:e2 --- phy0 5GHz *:e3 --- **Serial Access:** the RX line on the board for UART is shorted to ground by resistor R176 therefore it must be removed to use the console but it is not necessary to remove to view boot log optionally, R175 can be replaced with a solder bridge short the resistors R175 and R176 are next to the UART RX pin at J10 **Installation:** Method 1: Firmware upgrade page: (if you cannot access the APs webpage) factory reset with the reset button connect ethernet to a computer OEM webpage at 192.168.20.253 username and password 'araknis' make a new password, login again... Navigate to 'File Management' page from left pane Click Browse and select the factory.bin image Upload and verify checksum Click Continue to confirm wait about 3 minutes Method 2: Serial to load Failsafe webpage: After connecting to serial console and rebooting... Interrupt uboot with any key pressed rapidly execute `run failsafe_boot` OR `bootm 0x9fd70000` wait a minute connect to ethernet and navigate to 192.168.20.253 Select the factory.bin image and upload wait about 3 minutes **Return to OEM:** Method 1: Serial to load Failsafe webpage (above) Method 2: delete a checksum from uboot-env this will make uboot load the failsafe image at next boot because it will fail the checksum verification of the image ssh into openwrt and run `fw_setenv rootfs_checksum 0` reboot, wait a minute connect to ethernet and navigate to 192.168.20.253 select OEM firmware image and click upgrade Method 3: backup mtd partitions before upgrade **TFTP recovery:** Requires serial console, reset button does nothing rename initramfs-kernel.bin to '0101A8C0.img' make available on TFTP server at 192.168.1.101 power board, interrupt boot with serial console execute `tftpboot` and `bootm 0x81000000` NOTE: TFTP may not be reliable due to bugged bootloader set MTU to 600 and try many times **Format of OEM firmware image:** The OEM software is built using SDKs from Senao which is based on a heavily modified version of Openwrt Kamikaze or Altitude Adjustment. One of the many modifications is sysupgrade being performed by a custom script. Images are verified through successful unpackaging, correct filenames and size requirements for both kernel and rootfs files, and that they start with the correct magic numbers (first 2 bytes) for the respective headers. Newer Senao software requires more checks but their script includes a way to skip them. The OEM upgrade script is at /etc/fwupgrade.sh OKLI kernel loader is required because the OEM software expects the kernel to be less than 1536k and the OEM upgrade procedure would otherwise overwrite part of the kernel when writing rootfs. Note on PLL-data cells: The default PLL register values will not work because of the external AR8035 switch between the SOC and the ethernet port. For QCA955x series, the PLL registers for eth0 and eth1 can be see in the DTSI as 0x28 and 0x48 respectively. Therefore the PLL registers can be read from uboot for each link speed after attempting tftpboot or another network action using that link speed with `md 0x18050028 1` and `md 0x18050048 1`. The clock delay required for RGMII can be applied at the PHY side, using the at803x driver `phy-mode` setting through the DTS. Therefore, the Ethernet Configuration registers for GMAC0 do not need the bits for RGMII delay on the MAC side. This is possible due to fixes in at803x driver since Linux 5.1 and 5.3 Signed-off-by: Michael Pratt --- package/boot/uboot-envtools/files/ath79 | 1 + .../dts/qca9557_araknis_an-500-ap-i-ac.dts | 105 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 1 + .../base-files/lib/upgrade/platform.sh | 1 + target/linux/ath79/image/generic.mk | 12 ++ 6 files changed, 121 insertions(+) create mode 100644 target/linux/ath79/dts/qca9557_araknis_an-500-ap-i-ac.dts diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index c5f398ffc7..87a129cd89 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -21,6 +21,7 @@ alfa-network,r36a|\ alfa-network,tube-2hq|\ allnet,all-wap02860ac|\ araknis,an-300-ap-i-n|\ +araknis,an-500-ap-i-ac|\ arduino,yun|\ buffalo,bhr-4grv2|\ devolo,magic-2-wifi|\ diff --git a/target/linux/ath79/dts/qca9557_araknis_an-500-ap-i-ac.dts b/target/linux/ath79/dts/qca9557_araknis_an-500-ap-i-ac.dts new file mode 100644 index 0000000000..419e77c4f8 --- /dev/null +++ b/target/linux/ath79/dts/qca9557_araknis_an-500-ap-i-ac.dts @@ -0,0 +1,105 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x_senao_loader.dtsi" + +#include +#include + +/ { + compatible = "araknis,an-500-ap-i-ac", "qca,qca9557"; + model = "Araknis AN-500-AP-I-AC"; + + aliases { + label-mac-device = ð0; + led-boot = &led_power; + led-failsafe = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "amber:power"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + wifi2g { + label = "blue:wifi2g"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wifi5g { + label = "blue:wifi5g"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wps { + label = "blue:wps"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&partitions { + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; +}; + +&mdio0 { + status = "okay"; + + phy5: ethernet-phy@5 { + reg = <5>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + + phy-handle = <&phy5>; + phy-mode = "rgmii-id"; + + pll-data = <0x82000000 0x80000101 0x80001313>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 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 41e52c6748..9641cac39f 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 @@ -15,6 +15,7 @@ ath79_setup_interfaces() alfa-network,pi-wifi4|\ alfa-network,tube-2hq|\ araknis,an-300-ap-i-n|\ + araknis,an-500-ap-i-ac|\ arduino,yun|\ aruba,ap-105|\ asus,rp-ac66|\ 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 a7ea58b507..cede6daf86 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 @@ -11,6 +11,7 @@ case "$FIRMWARE" in "ath10k/cal-pci-0000:00:00.0.bin") case $board in allnet,all-wap02860ac|\ + araknis,an-500-ap-i-ac|\ engenius,eap1200h|\ engenius,enstationac-v1|\ glinet,gl-x750) diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index cf85196519..38975129f1 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -49,6 +49,7 @@ platform_do_upgrade() { ;; allnet,all-wap02860ac|\ araknis,an-300-ap-i-n|\ + araknis,an-500-ap-i-ac|\ engenius,eap1200h|\ engenius,eap300-v2|\ engenius,eap600|\ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index e6d4450bde..2d595ccf63 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -331,6 +331,18 @@ define Device/araknis_an-300-ap-i-n endef TARGET_DEVICES += araknis_an-300-ap-i-n +define Device/araknis_an-500-ap-i-ac + $(Device/senao_loader_okli) + SOC := qca9557 + DEVICE_VENDOR := Araknis + DEVICE_MODEL := AN-500-AP-I-AC + DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct + IMAGE_SIZE := 11584k + LOADER_FLASH_OFFS := 0x220000 + SENAO_IMGNAME := senao-generic-v1-an500 +endef +TARGET_DEVICES += araknis_an-500-ap-i-ac + define Device/arduino_yun SOC := ar9331 DEVICE_VENDOR := Arduino From 41be1a2de2f84f532a7eb1c11ece99811ca47ba5 Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Wed, 8 Sep 2021 17:00:00 -0400 Subject: [PATCH 22/26] ath79: add support for Araknis AN-700-AP-I-AC FCC ID: 2AG6R-AN700APIAC Araknis AN-700-AP-I-AC is an indoor wireless access point with 1 Gb ethernet port, dual-band wireless, internal antenna plates, and 802.3at PoE+ this board is a Senao device: the hardware is equivalent to EnGenius EAP1750 the software is modified Senao SDK which is based on openwrt and uboot including image checksum verification at boot time, and a failsafe image that boots if checksum fails **Specification:** - QCA9558 SOC MIPS 74kc, 2.4 GHz WMAC, 3x3 - QCA9880 WLAN PCI card, 5 GHz, 3x3, 26dBm - AR8035-A PHY RGMII GbE with PoE+ IN - 40 MHz clock - 16 MB FLASH MX25L12845EMI-10G - 2x 64 MB RAM NT5TU32M16 - UART console J10, populated, RX shorted to ground - 4 antennas 5 dBi, internal omni-directional plates - 4 LEDs power, 2G, 5G, wps - 1 button reset NOTE: all 4 gpio controlled LEDS are viewed through the same lightguide therefore, the power LED is off for default state **MAC addresses:** MAC address labeled as ETH Only one Vendor MAC address in flash at art 0x0 eth0 ETH *:xb art 0x0 phy1 2.4G *:xc --- phy0 5GHz *:xd --- **Serial Access:** the RX line on the board for UART is shorted to ground by resistor R176 therefore it must be removed to use the console but it is not necessary to remove to view boot log optionally, R175 can be replaced with a solder bridge short the resistors R175 and R176 are next to the UART RX pin at J10 **Installation:** Method 1: Firmware upgrade page: (if you cannot access the APs webpage) factory reset with the reset button connect ethernet to a computer OEM webpage at 192.168.20.253 username and password 'araknis' make a new password, login again... Navigate to 'File Management' page from left pane Click Browse and select the factory.bin image Upload and verify checksum Click Continue to confirm wait about 3 minutes Method 2: Serial to load Failsafe webpage: After connecting to serial console and rebooting... Interrupt uboot with any key pressed rapidly execute `run failsafe_boot` OR `bootm 0x9fd70000` wait a minute connect to ethernet and navigate to 192.168.20.253 Select the factory.bin image and upload wait about 3 minutes **Return to OEM:** Method 1: Serial to load Failsafe webpage (above) Method 2: delete a checksum from uboot-env this will make uboot load the failsafe image at next boot because it will fail the checksum verification of the image ssh into openwrt and run `fw_setenv rootfs_checksum 0` reboot, wait a minute connect to ethernet and navigate to 192.168.20.253 select OEM firmware image and click upgrade Method 3: backup mtd partitions before upgrade **TFTP recovery:** Requires serial console, reset button does nothing rename initramfs-kernel.bin to '0101A8C0.img' make available on TFTP server at 192.168.1.101 power board, interrupt boot with serial console execute `tftpboot` and `bootm 0x81000000` NOTE: TFTP may not be reliable due to bugged bootloader set MTU to 600 and try many times **Format of OEM firmware image:** The OEM software is built using SDKs from Senao which is based on a heavily modified version of Openwrt Kamikaze or Altitude Adjustment. One of the many modifications is sysupgrade being performed by a custom script. Images are verified through successful unpackaging, correct filenames and size requirements for both kernel and rootfs files, and that they start with the correct magic numbers (first 2 bytes) for the respective headers. Newer Senao software requires more checks but their script includes a way to skip them. The OEM upgrade script is at /etc/fwupgrade.sh OKLI kernel loader is required because the OEM software expects the kernel to be less than 1536k and the OEM upgrade procedure would otherwise overwrite part of the kernel when writing rootfs. Note on PLL-data cells: The default PLL register values will not work because of the external AR8035 switch between the SOC and the ethernet port. For QCA955x series, the PLL registers for eth0 and eth1 can be see in the DTSI as 0x28 and 0x48 respectively. Therefore the PLL registers can be read from uboot for each link speed after attempting tftpboot or another network action using that link speed with `md 0x18050028 1` and `md 0x18050048 1`. The clock delay required for RGMII can be applied at the PHY side, using the at803x driver `phy-mode` setting through the DTS. Therefore, the Ethernet Configuration registers for GMAC0 do not need the bits for RGMII delay on the MAC side. This is possible due to fixes in at803x driver since Linux 5.1 and 5.3 Signed-off-by: Michael Pratt --- package/boot/uboot-envtools/files/ath79 | 1 + .../dts/qca9558_araknis_an-700-ap-i-ac.dts | 104 ++++++++++++++++++ .../generic/base-files/etc/board.d/02_network | 1 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 1 + .../base-files/lib/upgrade/platform.sh | 1 + target/linux/ath79/image/generic.mk | 12 ++ 6 files changed, 120 insertions(+) create mode 100644 target/linux/ath79/dts/qca9558_araknis_an-700-ap-i-ac.dts diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79 index 87a129cd89..230f2fe417 100644 --- a/package/boot/uboot-envtools/files/ath79 +++ b/package/boot/uboot-envtools/files/ath79 @@ -22,6 +22,7 @@ alfa-network,tube-2hq|\ allnet,all-wap02860ac|\ araknis,an-300-ap-i-n|\ araknis,an-500-ap-i-ac|\ +araknis,an-700-ap-i-ac|\ arduino,yun|\ buffalo,bhr-4grv2|\ devolo,magic-2-wifi|\ diff --git a/target/linux/ath79/dts/qca9558_araknis_an-700-ap-i-ac.dts b/target/linux/ath79/dts/qca9558_araknis_an-700-ap-i-ac.dts new file mode 100644 index 0000000000..304eac5e62 --- /dev/null +++ b/target/linux/ath79/dts/qca9558_araknis_an-700-ap-i-ac.dts @@ -0,0 +1,104 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca955x_senao_loader.dtsi" + +#include +#include + +/ { + compatible = "araknis,an-700-ap-i-ac", "qca,qca9558"; + model = "Araknis AN-700-AP-I-AC"; + + aliases { + label-mac-device = ð0; + led-boot = &led_power; + led-failsafe = &led_power; + led-upgrade = &led_power; + }; + + keys { + compatible = "gpio-keys"; + + reset { + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "amber:power"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + default-state = "off"; + }; + + wifi2g { + label = "blue:wifi2g"; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy1tpt"; + }; + + wifi5g { + label = "blue:wifi5g"; + gpios = <&gpio 23 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + wps { + label = "blue:wps"; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + }; +}; + +&partitions { + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; +}; + +&mdio0 { + status = "okay"; + + phy5: ethernet-phy@5 { + reg = <5>; + eee-broken-100tx; + eee-broken-1000t; + }; +}; + +ð0 { + status = "okay"; + + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + + phy-handle = <&phy5>; + phy-mode = "rgmii-id"; + + pll-data = <0x82000000 0x80000101 0x80001313>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; + nvmem-cells = <&macaddr_art_0>; + nvmem-cell-names = "mac-address"; + mac-address-increment = <1>; +}; + +&art { + compatible = "nvmem-cells"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_art_0: macaddr@0 { + reg = <0x0 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 9641cac39f..bc32081910 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 @@ -16,6 +16,7 @@ ath79_setup_interfaces() alfa-network,tube-2hq|\ araknis,an-300-ap-i-n|\ araknis,an-500-ap-i-ac|\ + araknis,an-700-ap-i-ac|\ arduino,yun|\ aruba,ap-105|\ asus,rp-ac66|\ 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 cede6daf86..b8e99a661f 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 @@ -12,6 +12,7 @@ case "$FIRMWARE" in case $board in allnet,all-wap02860ac|\ araknis,an-500-ap-i-ac|\ + araknis,an-700-ap-i-ac|\ engenius,eap1200h|\ engenius,enstationac-v1|\ glinet,gl-x750) diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh index 38975129f1..953d6a96d3 100644 --- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh @@ -50,6 +50,7 @@ platform_do_upgrade() { allnet,all-wap02860ac|\ araknis,an-300-ap-i-n|\ araknis,an-500-ap-i-ac|\ + araknis,an-700-ap-i-ac|\ engenius,eap1200h|\ engenius,eap300-v2|\ engenius,eap600|\ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 2d595ccf63..769c0ee1da 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -343,6 +343,18 @@ define Device/araknis_an-500-ap-i-ac endef TARGET_DEVICES += araknis_an-500-ap-i-ac +define Device/araknis_an-700-ap-i-ac + $(Device/senao_loader_okli) + SOC := qca9558 + DEVICE_VENDOR := Araknis + DEVICE_MODEL := AN-700-AP-I-AC + DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct + IMAGE_SIZE := 11584k + LOADER_FLASH_OFFS := 0x220000 + SENAO_IMGNAME := senao-generic-v1-an700 +endef +TARGET_DEVICES += araknis_an-700-ap-i-ac + define Device/arduino_yun SOC := ar9331 DEVICE_VENDOR := Arduino From 9cdd15d8a5d2d504e4d1ec8a118e9c3e564de92e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Fri, 11 Mar 2022 20:56:02 +0100 Subject: [PATCH 23/26] mac80211: headers: fix lockdep_assert_not_held() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LOCK_STATE_HELD define was omitted during backport of lockdep_assert_not_held() which leads to build failures of kernels with CONFIG_LOCKDEP=y: backports-5.15.8-1/backport-include/linux/lockdep.h:16:47: error: 'LOCK_STATE_HELD' undeclared (first use in this function) Fix it by adding missing LOCK_STATE_HELD define. References: PR#9373 Reported-by: Oskari Rauta Signed-off-by: Petr Štetiar --- package/kernel/mac80211/Makefile | 2 +- ...-headers-fix-lockdep_assert_not_held.patch | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 package/kernel/mac80211/patches/build/070-headers-fix-lockdep_assert_not_held.patch diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index 2f9fd11f10..715e851a13 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 PKG_VERSION:=5.15.8-1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.15.8/ PKG_HASH:=9f71b659c034f19d156532ec780fcb606cee3c4ccc42e2f8ef18dd3e9f1b6820 diff --git a/package/kernel/mac80211/patches/build/070-headers-fix-lockdep_assert_not_held.patch b/package/kernel/mac80211/patches/build/070-headers-fix-lockdep_assert_not_held.patch new file mode 100644 index 0000000000..d946efa174 --- /dev/null +++ b/package/kernel/mac80211/patches/build/070-headers-fix-lockdep_assert_not_held.patch @@ -0,0 +1,39 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20=C5=A0tetiar?= +Date: Fri, 11 Mar 2022 18:21:04 +0100 +Subject: [PATCH] headers: fix lockdep_assert_not_held() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +LOCK_STATE_HELD define was omitted during backport of +lockdep_assert_not_held() which leads to build failures of kernels with +CONFIG_LOCKDEP=y: + + backports-5.15.8-1/backport-include/linux/lockdep.h:16:47: error: 'LOCK_STATE_HELD' undeclared (first use in this function) + +Fix it by adding missing LOCK_STATE_HELD define. + +References: https://github.com/openwrt/openwrt/pull/9373 +References: https://lore.kernel.org/backports/20220311194800.452-1-ynezz@true.cz/T/#u +Fixes: af58b27b1b1a ("headers: Add lockdep_assert_not_held()") +Reported-by: Oskari Rauta +Signed-off-by: Petr Štetiar +--- + backport-include/linux/lockdep.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/backport-include/linux/lockdep.h b/backport-include/linux/lockdep.h +index ed5ea67894e4..842e24b7ff8f 100644 +--- a/backport-include/linux/lockdep.h ++++ b/backport-include/linux/lockdep.h +@@ -11,6 +11,9 @@ struct lockdep_map { }; + + #ifndef lockdep_assert_not_held + #ifdef CONFIG_LOCKDEP ++#ifndef LOCK_STATE_HELD ++#define LOCK_STATE_HELD 1 ++#endif /* LOCK_STATE_HELD */ + #define lockdep_assert_not_held(l) do { \ + WARN_ON(debug_locks && \ + lockdep_is_held(l) == LOCK_STATE_HELD); \ From fbe2c3feaa4ef5747a691cb4c808925b024ff450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Beh=C3=BAn?= Date: Mon, 14 Mar 2022 18:31:30 +0100 Subject: [PATCH 24/26] kernel: backport DSA patches fixing null-pointer dereference for 5.10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport patches 381a730182f1 ("net: dsa: Move VLAN filtering syncing out of dsa_switch_bridge_leave") 108dc8741c20 ("net: dsa: Avoid cross-chip syncing of VLAN filtering") from upstream (currently in net-next) to fix null-pointer dereference. Signed-off-by: Marek Behún --- ...N-filtering-syncing-out-of-dsa_switc.patch | 88 +++++++++++++++++++ ...cross-chip-syncing-of-VLAN-filtering.patch | 63 +++++++++++++ 2 files changed, 151 insertions(+) create mode 100644 target/linux/generic/backport-5.10/773-v5.18-1-net-dsa-Move-VLAN-filtering-syncing-out-of-dsa_switc.patch create mode 100644 target/linux/generic/backport-5.10/773-v5.18-2-net-dsa-Avoid-cross-chip-syncing-of-VLAN-filtering.patch diff --git a/target/linux/generic/backport-5.10/773-v5.18-1-net-dsa-Move-VLAN-filtering-syncing-out-of-dsa_switc.patch b/target/linux/generic/backport-5.10/773-v5.18-1-net-dsa-Move-VLAN-filtering-syncing-out-of-dsa_switc.patch new file mode 100644 index 0000000000..8c2aa32ec8 --- /dev/null +++ b/target/linux/generic/backport-5.10/773-v5.18-1-net-dsa-Move-VLAN-filtering-syncing-out-of-dsa_switc.patch @@ -0,0 +1,88 @@ +From 7164a8cde4b42f76474088ccaf53f1e463d4e2f6 Mon Sep 17 00:00:00 2001 +From: Tobias Waldekranz +Date: Mon, 24 Jan 2022 22:09:43 +0100 +Subject: [PATCH 5.10 1/2] net: dsa: Move VLAN filtering syncing out of + dsa_switch_bridge_leave +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +commit 381a730182f1d174e1950cd4e63e885b1c302051 upstream. + +Most of dsa_switch_bridge_leave was, in fact, dealing with the syncing +of VLAN filtering for switches on which that is a global +setting. Separate the two phases to prepare for the cross-chip related +bugfix in the following commit. + +Signed-off-by: Tobias Waldekranz +Reviewed-by: Vladimir Oltean +Signed-off-by: David S. Miller +Signed-off-by: Marek Behún +--- + net/dsa/switch.c | 39 ++++++++++++++++++++++++++------------- + 1 file changed, 26 insertions(+), 13 deletions(-) + +diff --git a/net/dsa/switch.c b/net/dsa/switch.c +index a44035872cff..659fd979cc0a 100644 +--- a/net/dsa/switch.c ++++ b/net/dsa/switch.c +@@ -104,23 +104,12 @@ static int dsa_switch_bridge_join(struct dsa_switch *ds, + return 0; + } + +-static int dsa_switch_bridge_leave(struct dsa_switch *ds, +- struct dsa_notifier_bridge_info *info) ++static int dsa_switch_sync_vlan_filtering(struct dsa_switch *ds, ++ struct dsa_notifier_bridge_info *info) + { + bool unset_vlan_filtering = br_vlan_enabled(info->br); +- struct dsa_switch_tree *dst = ds->dst; + int err, i; + +- if (dst->index == info->tree_index && ds->index == info->sw_index && +- ds->ops->port_bridge_leave) +- ds->ops->port_bridge_leave(ds, info->port, info->br); +- +- if ((dst->index != info->tree_index || ds->index != info->sw_index) && +- ds->ops->crosschip_bridge_leave) +- ds->ops->crosschip_bridge_leave(ds, info->tree_index, +- info->sw_index, info->port, +- info->br); +- + /* If the bridge was vlan_filtering, the bridge core doesn't trigger an + * event for changing vlan_filtering setting upon slave ports leaving + * it. That is a good thing, because that lets us handle it and also +@@ -153,6 +142,30 @@ static int dsa_switch_bridge_leave(struct dsa_switch *ds, + if (err && err != EOPNOTSUPP) + return err; + } ++ ++ return 0; ++} ++ ++static int dsa_switch_bridge_leave(struct dsa_switch *ds, ++ struct dsa_notifier_bridge_info *info) ++{ ++ struct dsa_switch_tree *dst = ds->dst; ++ int err; ++ ++ if (dst->index == info->tree_index && ds->index == info->sw_index && ++ ds->ops->port_bridge_leave) ++ ds->ops->port_bridge_leave(ds, info->port, info->br); ++ ++ if ((dst->index != info->tree_index || ds->index != info->sw_index) && ++ ds->ops->crosschip_bridge_leave) ++ ds->ops->crosschip_bridge_leave(ds, info->tree_index, ++ info->sw_index, info->port, ++ info->br); ++ ++ err = dsa_switch_sync_vlan_filtering(ds, info); ++ if (err) ++ return err; ++ + return 0; + } + +-- +2.34.1 + diff --git a/target/linux/generic/backport-5.10/773-v5.18-2-net-dsa-Avoid-cross-chip-syncing-of-VLAN-filtering.patch b/target/linux/generic/backport-5.10/773-v5.18-2-net-dsa-Avoid-cross-chip-syncing-of-VLAN-filtering.patch new file mode 100644 index 0000000000..8dfd2a94b3 --- /dev/null +++ b/target/linux/generic/backport-5.10/773-v5.18-2-net-dsa-Avoid-cross-chip-syncing-of-VLAN-filtering.patch @@ -0,0 +1,63 @@ +From 6948a6654ffc878fc0258b363da77e7fd775b2d9 Mon Sep 17 00:00:00 2001 +From: Tobias Waldekranz +Date: Mon, 24 Jan 2022 22:09:44 +0100 +Subject: [PATCH 5.10 2/2] net: dsa: Avoid cross-chip syncing of VLAN filtering +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +commit 108dc8741c203e9d6ce4e973367f1bac20c7192b upstream. + +Changes to VLAN filtering are not applicable to cross-chip +notifications. + +On a system like this: + +.-----. .-----. .-----. +| sw1 +---+ sw2 +---+ sw3 | +'-1-2-' '-1-2-' '-1-2-' + +Before this change, upon sw1p1 leaving a bridge, a call to +dsa_port_vlan_filtering would also be made to sw2p1 and sw3p1. + +In this scenario: + +.---------. .-----. .-----. +| sw1 +---+ sw2 +---+ sw3 | +'-1-2-3-4-' '-1-2-' '-1-2-' + +When sw1p4 would leave a bridge, dsa_port_vlan_filtering would be +called for sw2 and sw3 with a non-existing port - leading to array +out-of-bounds accesses and crashes on mv88e6xxx. + +Fixes: d371b7c92d19 ("net: dsa: Unset vlan_filtering when ports leave the bridge") +Signed-off-by: Tobias Waldekranz +Reviewed-by: Vladimir Oltean +Signed-off-by: David S. Miller +Signed-off-by: Marek Behún +--- + net/dsa/switch.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/net/dsa/switch.c b/net/dsa/switch.c +index 659fd979cc0a..2fe2f328d2d2 100644 +--- a/net/dsa/switch.c ++++ b/net/dsa/switch.c +@@ -162,9 +162,11 @@ static int dsa_switch_bridge_leave(struct dsa_switch *ds, + info->sw_index, info->port, + info->br); + +- err = dsa_switch_sync_vlan_filtering(ds, info); +- if (err) +- return err; ++ if (dst->index == info->tree_index && ds->index == info->sw_index) { ++ err = dsa_switch_sync_vlan_filtering(ds, info); ++ if (err) ++ return err; ++ } + + return 0; + } +-- +2.34.1 + From 23f94aa330a59eaecbb1b9328a9649e1642345f7 Mon Sep 17 00:00:00 2001 From: Philip Prindeville Date: Tue, 26 Oct 2021 13:47:17 -0600 Subject: [PATCH 25/26] kernel: include CONFIG_KEXEC_SIG in configs Seeing failure to build because of missing symbols related to provisioning CONFIG_KEXEC and signed images. Without this, if you set CONFIG_KERNEL_KEXEC=y and try to build, target/linux will hang at: scripts/kconfig/conf --syncconfig Kconfig ... kexec system call (KEXEC) [Y/n/?] y kexec file based system call (KEXEC_FILE) [Y/n/?] y Verify kernel signature during kexec_file_load() syscall (KEXEC_SIG) [N/y/?] (NEW) Signed-off-by: Philip Prindeville --- target/linux/generic/config-5.10 | 1 + target/linux/generic/config-5.4 | 1 + target/linux/rockchip/armv8/config-5.10 | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10 index ca93b5f269..191566b0b8 100644 --- a/target/linux/generic/config-5.10 +++ b/target/linux/generic/config-5.10 @@ -2873,6 +2873,7 @@ CONFIG_KERNEL_XZ=y CONFIG_KERNFS=y # CONFIG_KEXEC is not set # CONFIG_KEXEC_FILE is not set +# CONFIG_KEXEC_SIG is not set # CONFIG_KEYBOARD_ADC is not set # CONFIG_KEYBOARD_ADP5588 is not set # CONFIG_KEYBOARD_ADP5589 is not set diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4 index 899d04c669..151f0ec1f3 100644 --- a/target/linux/generic/config-5.4 +++ b/target/linux/generic/config-5.4 @@ -2613,6 +2613,7 @@ CONFIG_KERNEL_XZ=y CONFIG_KERNFS=y # CONFIG_KEXEC is not set # CONFIG_KEXEC_FILE is not set +# CONFIG_KEXEC_SIG is not set # CONFIG_KEYBOARD_ADC is not set # CONFIG_KEYBOARD_ADP5588 is not set # CONFIG_KEYBOARD_ADP5589 is not set diff --git a/target/linux/rockchip/armv8/config-5.10 b/target/linux/rockchip/armv8/config-5.10 index 1063489dc6..f68c8cb42f 100644 --- a/target/linux/rockchip/armv8/config-5.10 +++ b/target/linux/rockchip/armv8/config-5.10 @@ -298,7 +298,6 @@ CONFIG_JUMP_LABEL=y CONFIG_KALLSYMS=y CONFIG_KEXEC_CORE=y CONFIG_KEXEC_FILE=y -# CONFIG_KEXEC_SIG is not set CONFIG_KSM=y # CONFIG_LEDS_BRIGHTNESS_HW_CHANGED is not set CONFIG_LEDS_GPIO=y From da2b97210cdcee893a59628455b595d6c69544f6 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 15 Mar 2022 10:45:38 +0100 Subject: [PATCH 26/26] mt76: update to the latest version 378b638c70c0 mt76: mt7915: fix unused variable with testmode disabled 4f4309542862 mt76: mt7915: only use u32_get_bits with constant value de06d828a0bf mt76: mt7921: fix injected MPDU transmission to not use HW A-MSDU c007ba3ec7a9 mt76: mt7915: simplify conditional 64c74dc93f68 mt76: fix dfs state issue with 160 MHz channels d3471b0d92c1 mt76: mt7615: honor ret from mt7615_mcu_restart in mt7663u_mcu_init f4c87b32e0e9 mt76: mt7663u: introduce mt7663u_mcu_power_on routine 82de5987af54 mt76: mt7921: fix up the monitor mode c501df4086e1 mt76: mt7921: use mt76_hw instead of open coding it 594ee03d5a11 mt76: mt7915: fix DFS no radar detection event d8d2b383a241 mt76: split single ldpc cap bit into bits 0f336fba20fe mt76: mt7921: make mt7921_init_tx_queues static 00a066ce9914 mt76: mt7921: fix xmit-queue dump for usb and sdio d6d2479568b2 mt76: mt7921: fix mt7921_queues_acq implementation d17b74420199 mt76: fix monitor mode crash with sdio driver c374559eae6f mt76: mt7915: allow beaconing on all chains b219af63b9ce mt76: connac: add 6 GHz support for wtbl and starec configuration 630384cb3246 mt76: mt7915: add 6 GHz support 28ff1bddc7e8 mt76: mt7915: fix eeprom fields of txpower init values d4b226cc15e7 mt76: mt7915: add txpower init for 6GHz 31e820d4ce4b mt76: mt7921: get rid of mt7921_wait_for_mcu_init declaration 9fee1faf6028 mt76: mt7915: check for devm_pinctrl_get() failure 31a970940b97 mt76: connac: make read-only array ba_range static const e49af7036bbc mt76: use le32/16_get_bits() whenever possible 0664d39039c2 mt76: fix invalid rssi report f16fc9d96105 mt76: mt7915: set band1 TGID field in tx descriptor 67ce2708dcef mt76: mt7915: fix beamforming mib stats 6e899abec818 mt76: mt7915: fix phy cap in mt7915_set_stream_he_txbf_caps() c6780c85cff2 mt76: mt7915: fix typos in comments aa6eadc09a83 mt76: usb: add req_type to ___mt76u_rr signature 74a519ab8353 mt76: usb: add req_type to ___mt76u_wr signature 2651d2c66cbd mt76: usb: introduce __mt76u_init utility routine c03e095eee27 mt76: mt7921: disable runtime pm for usb 41085cdcd7e3 mt76: mt7921: update mt7921_skb_add_usb_sdio_hdr to support usb e700aba6bae3 mt76: mt7921: move mt7921_usb_sdio_tx_prepare_skb in common mac code 056b7f4ebcc6 mt76: mt7921: move mt7921_usb_sdio_tx_complete_skb in common mac code. 0abf682a3def mt76: mt7921: move mt7921_usb_sdio_tx_status_data in mac common code. b0c60d5252de mt76: mt7921: add mt7921u driver 053668acdaf8 mt76: mt7921: move mt7921_init_hw in a dedicated work Signed-off-by: Felix Fietkau --- package/kernel/mt76/Makefile | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile index c88adb6ccc..d68305944a 100644 --- a/package/kernel/mt76/Makefile +++ b/package/kernel/mt76/Makefile @@ -8,9 +8,9 @@ PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/openwrt/mt76 PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2022-02-15 -PKG_SOURCE_VERSION:=c67df0d3130a51d79b558f0329c2ca289c73b16e -PKG_MIRROR_HASH:=57526f62adc1c1cc2c594ff23b883314ad83df8cdfab54c9e3503a8ec4c3a33f +PKG_SOURCE_DATE:=2022-03-15 +PKG_SOURCE_VERSION:=053668acdaf83d0350ce3e21720e20eac9fbbcd7 +PKG_MIRROR_HASH:=0102bc20ec385fcdb336dec97a1a345d4c37c2c6be2f3f428938c2ec1fa5d49a PKG_MAINTAINER:=Felix Fietkau PKG_USE_NINJA:=0 @@ -234,9 +234,17 @@ define KernelPackage/mt7921-common FILES:= $(PKG_BUILD_DIR)/mt7921/mt7921-common.ko endef +define KernelPackage/mt7921u + $(KernelPackage/mt76-default) + TITLE:=MediaTek MT7921U wireless driver + DEPENDS+=+kmod-mt76-usb +kmod-mt7921-common + FILES:= $(PKG_BUILD_DIR)/mt7921/mt7921u.ko + AUTOLOAD:=$(call AutoProbe,mt7921u) +endef + define KernelPackage/mt7921s $(KernelPackage/mt76-default) - TITLE:=MediaTek MT7921s wireless driver + TITLE:=MediaTek MT7921S wireless driver DEPENDS+=+kmod-mt76-sdio +kmod-mt7921-common FILES:= $(PKG_BUILD_DIR)/mt7921/mt7921s.ko AUTOLOAD:=$(call AutoProbe,mt7921s) @@ -339,6 +347,9 @@ endif ifdef CONFIG_PACKAGE_kmod-mt7921-common PKG_MAKE_FLAGS += CONFIG_MT7921_COMMON=m endif +ifdef CONFIG_PACKAGE_kmod-mt7921u + PKG_MAKE_FLAGS += CONFIG_MT7921U=m +endif ifdef CONFIG_PACKAGE_kmod-mt7921s PKG_MAKE_FLAGS += CONFIG_MT7921S=m endif @@ -475,6 +486,7 @@ $(eval $(call KernelPackage,mt7663u)) $(eval $(call KernelPackage,mt7663s)) $(eval $(call KernelPackage,mt7915e)) $(eval $(call KernelPackage,mt7921-common)) +$(eval $(call KernelPackage,mt7921u)) $(eval $(call KernelPackage,mt7921s)) $(eval $(call KernelPackage,mt7921e)) $(eval $(call KernelPackage,mt76))