From lede-commits at lists.infradead.org  Tue Jun  1 14:20:32 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 01 Jun 2021 17:20:32 -0400
Subject: [openwrt/openwrt] kernel: backport fix for hang on napi_disable
 with threaded NAPI
In-Reply-To: <162258243292.26755.16071904141553394716@git-01.infra.openwrt.org>
References: <162258243292.26755.16071904141553394716@git-01.infra.openwrt.org>
Message-ID: <mailman.2163.1622582442.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/9bda91d805b02ba3d3a6481bee31f4569e3c2324

commit 9bda91d805b02ba3d3a6481bee31f4569e3c2324
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Tue Jun 1 23:19:48 2021 +0200

    kernel: backport fix for hang on napi_disable with threaded NAPI
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...-hangup-on-napi_disable-for-threaded-napi.patch | 53 ++++++++++++++++++++++
 ...80-NET-skip-GRO-for-foreign-MAC-addresses.patch |  8 ++--
 2 files changed, 57 insertions(+), 4 deletions(-)

diff --git a/target/linux/generic/backport-5.10/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch b/target/linux/generic/backport-5.10/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch
new file mode 100644
index 0000000000..4b83641291
--- /dev/null
+++ b/target/linux/generic/backport-5.10/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch
@@ -0,0 +1,53 @@
+From: Paolo Abeni <pabeni at redhat.com>
+Date: Fri, 9 Apr 2021 17:24:17 +0200
+Subject: [PATCH] net: fix hangup on napi_disable for threaded napi
+
+napi_disable() is subject to an hangup, when the threaded
+mode is enabled and the napi is under heavy traffic.
+
+If the relevant napi has been scheduled and the napi_disable()
+kicks in before the next napi_threaded_wait() completes - so
+that the latter quits due to the napi_disable_pending() condition,
+the existing code leaves the NAPI_STATE_SCHED bit set and the
+napi_disable() loop waiting for such bit will hang.
+
+This patch addresses the issue by dropping the NAPI_STATE_DISABLE
+bit test in napi_thread_wait(). The later napi_threaded_poll()
+iteration will take care of clearing the NAPI_STATE_SCHED.
+
+This also addresses a related problem reported by Jakub:
+before this patch a napi_disable()/napi_enable() pair killed
+the napi thread, effectively disabling the threaded mode.
+On the patched kernel napi_disable() simply stops scheduling
+the relevant thread.
+
+v1 -> v2:
+  - let the main napi_thread_poll() loop clear the SCHED bit
+
+Reported-by: Jakub Kicinski <kuba at kernel.org>
+Fixes: 29863d41bb6e ("net: implement threaded-able napi poll loop support")
+Signed-off-by: Paolo Abeni <pabeni at redhat.com>
+Reviewed-by: Eric Dumazet <edumazet at google.com>
+Link: https://lore.kernel.org/r/883923fa22745a9589e8610962b7dc59df09fb1f.1617981844.git.pabeni at redhat.com
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
+---
+
+--- a/net/core/dev.c
++++ b/net/core/dev.c
+@@ -6951,7 +6951,7 @@ static int napi_thread_wait(struct napi_
+ 
+ 	set_current_state(TASK_INTERRUPTIBLE);
+ 
+-	while (!kthread_should_stop() && !napi_disable_pending(napi)) {
++	while (!kthread_should_stop()) {
+ 		/* Testing SCHED_THREADED bit here to make sure the current
+ 		 * kthread owns this napi and could poll on this napi.
+ 		 * Testing SCHED bit is not enough because SCHED bit might be
+@@ -6969,6 +6969,7 @@ static int napi_thread_wait(struct napi_
+ 		set_current_state(TASK_INTERRUPTIBLE);
+ 	}
+ 	__set_current_state(TASK_RUNNING);
++
+ 	return -1;
+ }
+ 
diff --git a/target/linux/generic/pending-5.10/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-5.10/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
index 8b5ec9c305..3b485e3cc9 100644
--- a/target/linux/generic/pending-5.10/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
+++ b/target/linux/generic/pending-5.10/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
@@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (netif_elide_gro(skb->dev))
  		goto normal;
  
-@@ -7986,6 +7989,48 @@ static void __netdev_adjacent_dev_unlink
+@@ -7987,6 +7990,48 @@ static void __netdev_adjacent_dev_unlink
  					   &upper_dev->adj_list.lower);
  }
  
@@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static int __netdev_upper_dev_link(struct net_device *dev,
  				   struct net_device *upper_dev, bool master,
  				   void *upper_priv, void *upper_info,
-@@ -8037,6 +8082,7 @@ static int __netdev_upper_dev_link(struc
+@@ -8038,6 +8083,7 @@ static int __netdev_upper_dev_link(struc
  	if (ret)
  		return ret;
  
@@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
  					    &changeupper_info.info);
  	ret = notifier_to_errno(ret);
-@@ -8133,6 +8179,7 @@ static void __netdev_upper_dev_unlink(st
+@@ -8134,6 +8180,7 @@ static void __netdev_upper_dev_unlink(st
  
  	__netdev_adjacent_dev_unlink_neighbour(dev, upper_dev);
  
@@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
  				      &changeupper_info.info);
  
-@@ -8919,6 +8966,7 @@ int dev_set_mac_address(struct net_devic
+@@ -8920,6 +8967,7 @@ int dev_set_mac_address(struct net_devic
  	if (err)
  		return err;
  	dev->addr_assign_type = NET_ADDR_SET;


From lede-commits at lists.infradead.org  Tue Jun  1 22:46:33 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 02 Jun 2021 01:46:33 -0400
Subject: [openwrt/openwrt] mac80211: fix detecting VHT capabilities when
 generating the default config
In-Reply-To: <162261279325.32020.10834618216035211439@git-01.infra.openwrt.org>
References: <162261279325.32020.10834618216035211439@git-01.infra.openwrt.org>
Message-ID: <mailman.2204.1622612799.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/3518b793a2f2293e7e9124b5beae7b09887c5e32

commit 3518b793a2f2293e7e9124b5beae7b09887c5e32
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Jun 2 07:42:40 2021 +0200

    mac80211: fix detecting VHT capabilities when generating the default config
    
    The colon does not directly follow the "VHT Capabilities" string
    
    Reported-by: John Thomson <git at johnthomson.fastmail.com.au>
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/kernel/mac80211/files/lib/wifi/mac80211.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
index 0763da8fd8..f5d4f2e90a 100644
--- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
@@ -92,7 +92,7 @@ $0 ~ "Capabilities:" {
 	ht=1
 }
 
-$0 ~ "VHT Capabilities:" {
+$0 ~ "VHT Capabilities" {
 	vht=1
 }
 


From lede-commits at lists.infradead.org  Tue Jun  1 22:46:34 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 02 Jun 2021 01:46:34 -0400
Subject: [openwrt/openwrt] mac80211: do not enable VHT in the default config
 on 2.4 GHz
In-Reply-To: <162261279325.32020.10834618216035211439@git-01.infra.openwrt.org>
References: <162261279325.32020.10834618216035211439@git-01.infra.openwrt.org>
Message-ID: <mailman.2205.1622612799.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/42a99b18ff23fa768a6ae5f1076f15cbfa494f24

commit 42a99b18ff23fa768a6ae5f1076f15cbfa494f24
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Jun 2 07:45:31 2021 +0200

    mac80211: do not enable VHT in the default config on 2.4 GHz
    
    Some drivers advertise it, but it's not supported at the moment
    
    Reported-by: John Thomson <git at johnthomson.fastmail.com.au>
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/kernel/mac80211/files/lib/wifi/mac80211.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
index f5d4f2e90a..02eabd0506 100644
--- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
@@ -70,7 +70,7 @@ BEGIN {
         if (channel) {
 		mode="NOHT"
 		if (ht) mode="HT20"
-		if (vht) mode="VHT80"
+		if (vht && band != "1:")) mode="VHT80"
 		if (he) mode="HE80"
 		if (he && band == "1:") mode="HE20"
                 sub("\\[", "", channel)


From lede-commits at lists.infradead.org  Wed Jun  2 00:33:39 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 02 Jun 2021 03:33:39 -0400
Subject: [openwrt/openwrt] hostapd: add support for configuring the beacon rate
In-Reply-To: <162261921924.31877.3831187804344709567@git-01.infra.openwrt.org>
References: <162261921924.31877.3831187804344709567@git-01.infra.openwrt.org>
Message-ID: <mailman.2231.1622619230.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/46509a51dd63aa49648ad0f130461817f43532d0

commit 46509a51dd63aa49648ad0f130461817f43532d0
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed May 26 13:04:50 2021 +0200

    hostapd: add support for configuring the beacon rate
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/network/services/hostapd/files/hostapd.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 5e9678eef6..4c4cb3f4b1 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -91,6 +91,7 @@ hostapd_add_log_config() {
 hostapd_common_add_device_config() {
 	config_add_array basic_rate
 	config_add_array supported_rates
+	config_add_string beacon_rate
 
 	config_add_string country
 	config_add_boolean country_ie doth
@@ -117,7 +118,7 @@ hostapd_prepare_device_config() {
 
 	json_get_vars country country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \
 		acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode cell_density \
-		rts_threshold
+		rts_threshold beacon_rate
 
 	hostapd_set_log_options base_cfg
 
@@ -208,6 +209,7 @@ hostapd_prepare_device_config() {
 		hostapd_add_rate brlist "$br"
 	done
 
+	[ -n "$beacon_rate" ] && append base_cfg "beacon_rate=$beacon_rate" "$N"
 	[ -n "$rlist" ] && append base_cfg "supported_rates=$rlist" "$N"
 	[ -n "$brlist" ] && append base_cfg "basic_rates=$brlist" "$N"
 	append base_cfg "beacon_int=$beacon_int" "$N"


From lede-commits at lists.infradead.org  Wed Jun  2 00:33:41 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 02 Jun 2021 03:33:41 -0400
Subject: [openwrt/openwrt]  hostapd: add support for configuring proxy ARP
In-Reply-To: <162261921924.31877.3831187804344709567@git-01.infra.openwrt.org>
References: <162261921924.31877.3831187804344709567@git-01.infra.openwrt.org>
Message-ID: <mailman.2232.1622619231.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/e309b57619b9c073b9b8857858d9456183f27d7d

commit e309b57619b9c073b9b8857858d9456183f27d7d
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed May 26 13:50:43 2021 +0200

    hostapd: add support for configuring proxy ARP
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/network/services/hostapd/files/hostapd.sh | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 13699bf673..8d12683a39 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -341,7 +341,7 @@ hostapd_common_add_bss_config() {
 	config_add_array airtime_sta_weight
 	config_add_int airtime_bss_weight airtime_bss_limit
 
-	config_add_boolean multicast_to_unicast per_sta_vif
+	config_add_boolean multicast_to_unicast proxy_arp per_sta_vif
 
 	config_add_array hostapd_bss_options
 
@@ -518,7 +518,7 @@ hostapd_set_bss_options() {
 		bss_load_update_period chan_util_avg_period sae_require_mfp \
 		multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key skip_inactivity_poll \
 		airtime_bss_weight airtime_bss_limit airtime_sta_weight \
-		multicast_to_unicast per_sta_vif
+		multicast_to_unicast proxy_arp per_sta_vif
 
 	set_default isolate 0
 	set_default maxassoc 0
@@ -997,6 +997,10 @@ hostapd_set_bss_options() {
 	if [ "$multicast_to_unicast" -gt 0 ]; then
 		append bss_conf "multicast_to_unicast=$multicast_to_unicast" "$N"
 	fi
+	set_default proxy_arp 0
+	if [ "$proxy_arp" -gt 0 ]; then
+		append bss_conf "proxy_arp=$proxy_arp" "$N"
+	fi
 
 	set_default per_sta_vif 0
 	if [ "$per_sta_vif" -gt 0 ]; then


From lede-commits at lists.infradead.org  Wed Jun  2 00:33:45 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 02 Jun 2021 03:33:45 -0400
Subject: [openwrt/openwrt]  mt76: update to the latest version
In-Reply-To: <162261921924.31877.3831187804344709567@git-01.infra.openwrt.org>
References: <162261921924.31877.3831187804344709567@git-01.infra.openwrt.org>
Message-ID: <mailman.2233.1622619234.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/b474142fa834e7c3d34a25ab7a46e1e2bc6c0c16

commit b474142fa834e7c3d34a25ab7a46e1e2bc6c0c16
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Jun 2 08:49:19 2021 +0200

    mt76: update to the latest version
    
    bddc1db76d0f mt76: mt7915: drop the use of repeater entries for station interfaces
    3c90f35dddac mt76: mt7915: add thermal sensor device support
    afab0e8202ff mt76: mt7915: add thermal cooling device support
    41cf02184699 mt76: mt7615: add thermal sensor device support
    2ac6b8762565 mt76: connac: update BA win size in Rx direction
    ddb301127291 mt76: mt7921: fix reset under the deep sleep is enabled
    e4cbefd1d69a mt76: mt7921: avoid unnecessary consecutive WiFi resets
    393eea2034d7 mt76: mt7921: fix invalid register access in wake_work
    a15d46407ffa mt76: mt7921: fix OMAC idx usage
    e4d267d8e900 mt76: mt7921: enable runtime pm by default
    50fd8ce2412a mt76: connac: add bss color support for sta mode
    e29058c3c860 mt76: mt7921: return proper error value in mt7921_mac_init
    c89c8c347b1e mt76: mt7921: do not schedule hw reset if the device is not running
    9f7bb428e587 mt76: mt7921: reset wfsys during hw probe
    22ea365913b5 mt76: mt7915: add .offset_tsf callback
    ad91f8e8e494 mt76: mt7615: add .offset_tsf callback
    6f871f35e3c1 mt76: mt7915: use mt7915_mcu_get_txpower_sku() to get per-rate txpower
    597b68b7daa3 mt76: mt7615: remove useless if condition in mt7615_add_interface()
    3945264468eb mt76: testmode: fix memory leak in mt76_testmode_alloc_skb
    bdcc57a11606 mt76: testmode: remove unnecessary function calls in mt76_testmode_free_skb
    a9763452601d mt76: testmode: remove undefined behaviour in mt76_testmode_alloc_skb
    4aef2a2be464 mt76: mt7615: fix potential overflow on large shift
    d9dd7635b055 mt76: mt7915: use mt7915_mcu_get_mib_info() to get survey data
    d740e921758a mt76: mt7921: introduce mac tx done handling
    259ddfc7cb73 mt76: mt7921: update statistic in active mode only
    757b93f4b179 mt76: mt7921: remove leftover 80+80 HE capability
    1fcff599b2e1 mt76: allow hw driver code to overwrite wiphy interface_modes
    c55c22e39b7d mt7915: update firmware to 2020110522
    10548aef1f45 mt76: mt7915: improve error recovery reliability
    ed6b0c79820c mt76: mt7921: set MT76_RESET during mac reset
    321443258bea mt76: move mt76_rates in mt76 module
    d1652e8af9e1 Revert "mt76: connac: do not schedule wake_work if the runtime-pm is disabled"
    4f4cab39ed9f mt76: mt7915: read all eeprom fields from fw in efuse mode
    71450535f164 mt76: mt7921: enable hw offloading for wep keys
    833d577e430c mt76: mt7921: remove mt7921_get_wtbl_info routine
    67b7a22d2b99 mt76: mt7921: enable random mac address during sched_scan
    cf1ff7bf4f1b mt76: mt7915: setup drr group for peers
    ef2f7aa8745f mt76: mt7615: update radar parameters
    b9f09f530223 mt76: mt7915: fix MT_EE_CAL_GROUP_SIZE
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/kernel/mt76/Makefile | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile
index 5104c3ec53..8a98c4bfc0 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:=2021-05-15
-PKG_SOURCE_VERSION:=9d736545bb5ac9707e60b7900b7d6b290492e24d
-PKG_MIRROR_HASH:=8fd98f488579c18cfd8c442cff1796dcd70e2ecbc59c5d5b92ee8c0f06efafcf
+PKG_SOURCE_DATE:=2021-06-02
+PKG_SOURCE_VERSION:=b9f09f530223893c0880c3b08fdb2afe55d152e1
+PKG_MIRROR_HASH:=4a8a8189c70d2f169ec69484c74af9221c1c3b62932624b049f3b23988f11d89
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 PKG_BUILD_PARALLEL:=1
@@ -155,7 +155,7 @@ define KernelPackage/mt7615-common
   $(KernelPackage/mt76-default)
   TITLE:=MediaTek MT7615 wireless driver common code
   HIDDEN:=1
-  DEPENDS+=@PCI_SUPPORT +kmod-mt76-core +kmod-mt76-connac
+  DEPENDS+=@PCI_SUPPORT +kmod-mt76-core +kmod-mt76-connac +kmod-hwmon-core
   FILES:= $(PKG_BUILD_DIR)/mt7615/mt7615-common.ko
 endef
 
@@ -213,7 +213,7 @@ endef
 define KernelPackage/mt7915e
   $(KernelPackage/mt76-default)
   TITLE:=MediaTek MT7915e wireless driver
-  DEPENDS+=@PCI_SUPPORT +kmod-mt7615-common + at DRIVER_11AX_SUPPORT
+  DEPENDS+=@PCI_SUPPORT +kmod-mt7615-common +kmod-hwmon-core + at DRIVER_11AX_SUPPORT
   FILES:= $(PKG_BUILD_DIR)/mt7915/mt7915e.ko
   AUTOLOAD:=$(call AutoProbe,mt7915e)
 endef


From lede-commits at lists.infradead.org  Wed Jun  2 00:33:44 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 02 Jun 2021 03:33:44 -0400
Subject: [openwrt/openwrt]  hostapd: add eap_server support
In-Reply-To: <162261921924.31877.3831187804344709567@git-01.infra.openwrt.org>
References: <162261921924.31877.3831187804344709567@git-01.infra.openwrt.org>
Message-ID: <mailman.2234.1622619234.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/98621c97822eb20a80ab2248a253972051ea6f08

commit 98621c97822eb20a80ab2248a253972051ea6f08
Author: John Crispin <john at phrozen.org>
AuthorDate: Tue Apr 6 14:59:41 2021 +0200

    hostapd: add eap_server support
    
    This makes it possible to avoid using a RADIUS server for WPA enterprise authentication
    
    Signed-off-by: John Crispin <john at phrozen.org>
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/network/services/hostapd/files/hostapd.sh | 25 +++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 687a8d950a..7981f02ed6 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -350,6 +350,9 @@ hostapd_common_add_bss_config() {
 	config_add_boolean request_cui
 	config_add_array radius_auth_req_attr
 	config_add_array radius_acct_req_attr
+
+	config_add_int eap_server
+	config_add_string eap_user_file ca_cert server_cert private_key private_key_passwd server_id
 }
 
 hostapd_set_vlan_file() {
@@ -520,7 +523,8 @@ hostapd_set_bss_options() {
 		bss_load_update_period chan_util_avg_period sae_require_mfp \
 		multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key skip_inactivity_poll \
 		airtime_bss_weight airtime_bss_limit airtime_sta_weight \
-		multicast_to_unicast proxy_arp per_sta_vif
+		multicast_to_unicast proxy_arp per_sta_vif \
+		eap_server eap_user_file ca_cert server_cert private_key private_key_passwd server_id
 
 	set_default isolate 0
 	set_default maxassoc 0
@@ -541,6 +545,7 @@ hostapd_set_bss_options() {
 	set_default multi_ap 0
 	set_default airtime_bss_weight 0
 	set_default airtime_bss_limit 0
+	set_default eap_server 0
 
 	append bss_conf "ctrl_interface=/var/run/hostapd"
 	if [ "$isolate" -gt 0 ]; then
@@ -654,9 +659,11 @@ hostapd_set_bss_options() {
 			set_default dae_port 3799
 			set_default request_cui 0
 
-			append bss_conf "auth_server_addr=$auth_server" "$N"
-			append bss_conf "auth_server_port=$auth_port" "$N"
-			append bss_conf "auth_server_shared_secret=$auth_secret" "$N"
+			[ "$eap_server" -eq 0 ] && {
+				append bss_conf "auth_server_addr=$auth_server" "$N"
+				append bss_conf "auth_server_port=$auth_port" "$N"
+				append bss_conf "auth_server_shared_secret=$auth_secret" "$N"
+			}
 
 			[ "$request_cui" -gt 0 ] && append bss_conf "radius_request_cui=$request_cui" "$N"
 			[ -n "$eap_reauth_period" ] && append bss_conf "eap_reauth_period=$eap_reauth_period" "$N"
@@ -1002,6 +1009,16 @@ hostapd_set_bss_options() {
 		json_for_each_item append_operator_icon operator_icon
 	fi
 
+	if [ "$eap_server" = "1" ]; then
+		append bss_conf "eap_server=1" "$N"
+		[ -n "$eap_user_file" ] && append bss_conf "eap_user_file=$eap_user_file" "$N"
+		[ -n "$ca_cert" ] && append bss_conf "ca_cert=$ca_cert" "$N"
+		[ -n "$server_cert" ] && append bss_conf "server_cert=$server_cert" "$N"
+		[ -n "$private_key" ] && append bss_conf "private_key=$private_key" "$N"
+		[ -n "$private_key_passwd" ] && append bss_conf "private_key_passwd=$private_key_passwd" "$N"
+		[ -n "$server_id" ] && append bss_conf "server_id=$server_id" "$N"
+	fi
+
 	set_default multicast_to_unicast 0
 	if [ "$multicast_to_unicast" -gt 0 ]; then
 		append bss_conf "multicast_to_unicast=$multicast_to_unicast" "$N"


From lede-commits at lists.infradead.org  Wed Jun  2 00:33:42 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 02 Jun 2021 03:33:42 -0400
Subject: [openwrt/openwrt] hostapd: add support for specifying the maxassoc
 parameter as a device option
In-Reply-To: <162261921924.31877.3831187804344709567@git-01.infra.openwrt.org>
References: <162261921924.31877.3831187804344709567@git-01.infra.openwrt.org>
Message-ID: <mailman.2237.1622619237.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/ec223cf7246d3134f92974be2608ffe8ae8e46c2

commit ec223cf7246d3134f92974be2608ffe8ae8e46c2
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed May 26 14:34:46 2021 +0200

    hostapd: add support for specifying the maxassoc parameter as a device option
    
    It allows enforcing a limit on associated stations to be enforced for the
    full device, e.g. in order to deal with hardware/driver limitations
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/network/services/hostapd/files/hostapd.sh  |  4 +-
 .../hostapd/patches/720-iface_max_num_sta.patch    | 82 ++++++++++++++++++++++
 2 files changed, 85 insertions(+), 1 deletion(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 8d12683a39..9993bc9047 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -103,6 +103,7 @@ hostapd_common_add_device_config() {
 	config_add_int rts_threshold
 	config_add_int rssi_reject_assoc_rssi
 	config_add_int rssi_ignore_probe_request
+	config_add_int maxassoc
 
 	config_add_string acs_chan_bias
 	config_add_array hostapd_options
@@ -120,7 +121,7 @@ hostapd_prepare_device_config() {
 
 	json_get_vars country country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \
 		acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode cell_density \
-		rts_threshold beacon_rate rssi_reject_assoc_rssi rssi_ignore_probe_request
+		rts_threshold beacon_rate rssi_reject_assoc_rssi rssi_ignore_probe_request maxassoc
 
 	hostapd_set_log_options base_cfg
 
@@ -220,6 +221,7 @@ hostapd_prepare_device_config() {
 	[ -n "$rts_threshold" ] && append base_cfg "rts_threshold=$rts_threshold" "$N"
 	append base_cfg "dtim_period=$dtim_period" "$N"
 	[ "$airtime_mode" -gt 0 ] && append base_cfg "airtime_mode=$airtime_mode" "$N"
+	[ -n "$maxassoc" ] && append base_cfg "iface_max_num_sta=$maxassoc" "$N"
 
 	json_get_values opts hostapd_options
 	for val in $opts; do
diff --git a/package/network/services/hostapd/patches/720-iface_max_num_sta.patch b/package/network/services/hostapd/patches/720-iface_max_num_sta.patch
new file mode 100644
index 0000000000..b93a0bcbef
--- /dev/null
+++ b/package/network/services/hostapd/patches/720-iface_max_num_sta.patch
@@ -0,0 +1,82 @@
+--- a/hostapd/config_file.c
++++ b/hostapd/config_file.c
+@@ -2873,6 +2873,14 @@ static int hostapd_config_fill(struct ho
+ 				   line, bss->max_num_sta, MAX_STA_COUNT);
+ 			return 1;
+ 		}
++	} else if (os_strcmp(buf, "iface_max_num_sta") == 0) {
++		conf->max_num_sta = atoi(pos);
++		if (conf->max_num_sta < 0 ||
++		    conf->max_num_sta > MAX_STA_COUNT) {
++			wpa_printf(MSG_ERROR, "Line %d: Invalid max_num_sta=%d; allowed range 0..%d",
++				   line, conf->max_num_sta, MAX_STA_COUNT);
++			return 1;
++		}
+ 	} else if (os_strcmp(buf, "wpa") == 0) {
+ 		bss->wpa = atoi(pos);
+ 	} else if (os_strcmp(buf, "extended_key_id") == 0) {
+--- a/src/ap/hostapd.h
++++ b/src/ap/hostapd.h
+@@ -648,6 +648,7 @@ void hostapd_cleanup_cs_params(struct ho
+ void hostapd_periodic_iface(struct hostapd_iface *iface);
+ int hostapd_owe_trans_get_info(struct hostapd_data *hapd);
+ void hostapd_ocv_check_csa_sa_query(void *eloop_ctx, void *timeout_ctx);
++int hostapd_check_max_sta(struct hostapd_data *hapd);
+ 
+ /* utils.c */
+ int hostapd_register_probereq_cb(struct hostapd_data *hapd,
+--- a/src/ap/hostapd.c
++++ b/src/ap/hostapd.c
+@@ -236,6 +236,30 @@ static int hostapd_iface_conf_changed(st
+ }
+ 
+ 
++static inline int hostapd_iface_num_sta(struct hostapd_iface *iface)
++{
++	int num_sta = 0;
++	int i;
++
++	for (i = 0; i < iface->num_bss; i++)
++		num_sta += iface->bss[i]->num_sta;
++
++	return num_sta;
++}
++
++
++int hostapd_check_max_sta(struct hostapd_data *hapd)
++{
++	if (hapd->num_sta >= hapd->conf->max_num_sta)
++		return 1;
++
++	if (hapd->iconf->max_num_sta &&
++	    hostapd_iface_num_sta(hapd->iface) >= hapd->iconf->max_num_sta)
++		return 1;
++
++	return 0;
++}
++
+ int hostapd_reload_config(struct hostapd_iface *iface, int reconf)
+ {
+ 	struct hapd_interfaces *interfaces = iface->interfaces;
+--- a/src/ap/beacon.c
++++ b/src/ap/beacon.c
+@@ -1039,7 +1039,7 @@ void handle_probe_req(struct hostapd_dat
+ 	if (hapd->conf->no_probe_resp_if_max_sta &&
+ 	    is_multicast_ether_addr(mgmt->da) &&
+ 	    is_multicast_ether_addr(mgmt->bssid) &&
+-	    hapd->num_sta >= hapd->conf->max_num_sta &&
++	    hostapd_check_max_sta(hapd) &&
+ 	    !ap_get_sta(hapd, mgmt->sa)) {
+ 		wpa_printf(MSG_MSGDUMP, "%s: Ignore Probe Request from " MACSTR
+ 			   " since no room for additional STA",
+--- a/src/ap/ap_config.h
++++ b/src/ap/ap_config.h
+@@ -976,6 +976,8 @@ struct hostapd_config {
+ 	unsigned int track_sta_max_num;
+ 	unsigned int track_sta_max_age;
+ 
++	int max_num_sta;
++
+ 	char country[3]; /* first two octets: country code as described in
+ 			  * ISO/IEC 3166-1. Third octet:
+ 			  * ' ' (ascii 32): all environments


From lede-commits at lists.infradead.org  Wed Jun  2 00:33:43 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 02 Jun 2021 03:33:43 -0400
Subject: [openwrt/openwrt]  hostapd: add default values for r0kh/r1kh
In-Reply-To: <162261921924.31877.3831187804344709567@git-01.infra.openwrt.org>
References: <162261921924.31877.3831187804344709567@git-01.infra.openwrt.org>
Message-ID: <mailman.2238.1622619237.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/704ab6a002172e76d41612f6d07ff179ef035d10

commit 704ab6a002172e76d41612f6d07ff179ef035d10
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu May 27 13:15:40 2021 +0200

    hostapd: add default values for r0kh/r1kh
    
    This allows WPA enterprise roaming in the same mobility domain without any
    manual key configuration (aside from radius credentials)
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/network/services/hostapd/files/hostapd.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 9993bc9047..687a8d950a 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -812,6 +812,13 @@ hostapd_set_bss_options() {
 				set_default r0_key_lifetime 10000
 				set_default pmk_r1_push 0
 
+				[ -n "$r0kh" -a -n "$r1kh" ] || {
+					key=`echo -n "$mobility_domain/$auth_secret" | md5sum | awk '{print $1}'`
+
+					set_default r0kh "ff:ff:ff:ff:ff:ff,*,$key"
+					set_default r1kh "00:00:00:00:00:00,00:00:00:00:00:00,$key"
+				}
+
 				[ -n "$r1_key_holder" ] && append bss_conf "r1_key_holder=$r1_key_holder" "$N"
 				append bss_conf "r0_key_lifetime=$r0_key_lifetime" "$N"
 				append bss_conf "pmk_r1_push=$pmk_r1_push" "$N"


From lede-commits at lists.infradead.org  Wed Jun  2 00:33:40 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 02 Jun 2021 03:33:40 -0400
Subject: [openwrt/openwrt] hostapd: add configurable rssi thresholds for
 rejecting assoc/probe requests
In-Reply-To: <162261921924.31877.3831187804344709567@git-01.infra.openwrt.org>
References: <162261921924.31877.3831187804344709567@git-01.infra.openwrt.org>
Message-ID: <mailman.2239.1622619237.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/190d4b6184ef3a5212a6d6fb9d3d8847035b7d0a

commit 190d4b6184ef3a5212a6d6fb9d3d8847035b7d0a
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed May 26 13:34:41 2021 +0200

    hostapd: add configurable rssi thresholds for rejecting assoc/probe requests
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/network/services/hostapd/files/hostapd.sh | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 4c4cb3f4b1..13699bf673 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -101,6 +101,8 @@ hostapd_common_add_device_config() {
 	config_add_boolean legacy_rates
 	config_add_int cell_density
 	config_add_int rts_threshold
+	config_add_int rssi_reject_assoc_rssi
+	config_add_int rssi_ignore_probe_request
 
 	config_add_string acs_chan_bias
 	config_add_array hostapd_options
@@ -118,7 +120,7 @@ hostapd_prepare_device_config() {
 
 	json_get_vars country country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \
 		acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode cell_density \
-		rts_threshold beacon_rate
+		rts_threshold beacon_rate rssi_reject_assoc_rssi rssi_ignore_probe_request
 
 	hostapd_set_log_options base_cfg
 
@@ -209,6 +211,8 @@ hostapd_prepare_device_config() {
 		hostapd_add_rate brlist "$br"
 	done
 
+	[ -n "$rssi_reject_assoc_rssi" ] && append base_cfg "rssi_reject_assoc_rssi=$rssi_reject_assoc_rssi" "$N"
+	[ -n "$rssi_ignore_probe_request" ] && append base_cfg "rssi_ignore_probe_request=$rssi_ignore_probe_request" "$N"
 	[ -n "$beacon_rate" ] && append base_cfg "beacon_rate=$beacon_rate" "$N"
 	[ -n "$rlist" ] && append base_cfg "supported_rates=$rlist" "$N"
 	[ -n "$brlist" ] && append base_cfg "basic_rates=$brlist" "$N"


From lede-commits at lists.infradead.org  Wed Jun  2 12:43:44 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 02 Jun 2021 15:43:44 -0400
Subject: [openwrt/openwrt]  rampis: use lzma-loader for ZTE MF283+
In-Reply-To: <162266302302.1151.15117784704605439497@git-01.infra.openwrt.org>
References: <162266302302.1151.15117784704605439497@git-01.infra.openwrt.org>
Message-ID: <mailman.2544.1622663028.434944.lede-commits@lists.infradead.org>

zorun pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/6a5545006e2339b179438bddb61ed98b712f1d1b

commit 6a5545006e2339b179438bddb61ed98b712f1d1b
Author: Lech Perczak <lech.perczak at gmail.com>
AuthorDate: Sun Feb 28 03:24:19 2021 +0100

    rampis: use lzma-loader for ZTE MF283+
    
    Without that, after merging support to master, the device fails to boot
    due to LZMA decompression error:
    
    3: System Boot system code via Flash.
    raspi_read: from:80000 len:40
    .   Image Name:   MIPS OpenWrt Linux-5.4.99
       Created:      2021-02-25  23:35:00 UTC
       Image Type:   MIPS Linux Kernel Image (lzma compressed)
       Data Size:    1786664 Bytes =  1.7 MB
       Load Address: 80000000
       Entry Point:  80000000
    raspi_read: from:80040 len:1b4328
    ............................   Verifying Checksum ... OK
       Uncompressing Kernel Image ... LZMA ERROR 1 - must RESET board to recover
    
    Use lzma-loader to fix it.
    
    Fixes: 59d065c9f81c ("ramips: add support for ZTE MF283+")
    Signed-off-by: Lech Perczak <lech.perczak at gmail.com>
    
    (cherry picked from commit 410fb05b445c89a147029d1471e184a5594602db)
    Signed-off-by: Lech Perczak <lech.perczak at gmail.com>
---
 target/linux/ramips/image/rt305x.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk
index c16de3049f..5483b8a369 100644
--- a/target/linux/ramips/image/rt305x.mk
+++ b/target/linux/ramips/image/rt305x.mk
@@ -1184,6 +1184,7 @@ endef
 TARGET_DEVICES += zorlik_zl5900v2
 
 define Device/zte_mf283plus
+  $(Device/uimage-lzma-loader)
   SOC := rt3352
   IMAGE_SIZE := 15872k
   DEVICE_VENDOR := ZTE


From lede-commits at lists.infradead.org  Wed Jun  2 12:43:43 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 02 Jun 2021 15:43:43 -0400
Subject: [openwrt/openwrt]  ramips: add support for ZTE MF283+
In-Reply-To: <162266302302.1151.15117784704605439497@git-01.infra.openwrt.org>
References: <162266302302.1151.15117784704605439497@git-01.infra.openwrt.org>
Message-ID: <mailman.2545.1622663029.434944.lede-commits@lists.infradead.org>

zorun pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/27bcde303b0a5a1d77a36463afd776f819f43b82

commit 27bcde303b0a5a1d77a36463afd776f819f43b82
Author: Lech Perczak <lech.perczak at gmail.com>
AuthorDate: Sat Feb 6 13:56:46 2021 +0100

    ramips: add support for ZTE MF283+
    
    ZTE MF283+ is a dual-antenna LTE category 4 router, based on Ralink
    RT3352 SoC, and built-in ZTE P685M PCIe MiniCard LTE modem.
    
    Hardware highlighs:
    - CPU: MIPS24KEc at 400MHz,
    - RAM: 64MB DDR2,
    - Flash: 16MB SPI,
    - Ethernet: 4 10/100M port switch with VLAN support,
    - Wireless: Dual-stream 802.11n (RT2860), with two internal antennas,
    - WWAN: Built-in ZTE P685M modem, with two internal antennas and two
      switching SMA connectors for external antennas,
    - FXS: Single ATA, with two connectors marked PHONE1 and PHONE2,
      internally wired in parallel by 0-Ohm resistors, handled entirely by
      internal WWAN modem.
    - USB: internal miniPCIe slot for modem,
      unpopulated USB A connector on PCB.
    - SIM slot for the WWAN modem.
    - UART connector for the console (unpopulated) at 3.3V,
      pinout: 1: VCC, 2: TXD, 3: RXD, 4: GND,
      settings: 57600-8-N-1.
    - LEDs: Power (fixed), WLAN, WWAN (RGB),
      phone (bicolor, controlled by modem), Signal,
      4 link/act LEDs for LAN1-4.
    - Buttons: WPS, reset.
    
    Installation:
    As the modem is, for most of the time, provided by carriers, there is no
    possibility to flash through web interface, only built-in FOTA update
    and TFTP recovery are supported.
    
    There are two installation methods:
    (1) Using serial console and initramfs-kernel - recommended, as it
    allows you to back up original firmware, or
    (2) Using TFTP recovery - does not require disassembly.
    
    (1) Using serial console:
    To install OpenWrt, one needs to disassemble the
    router and flash it via TFTP by using serial console:
    - Locate unpopulated 4-pin header on the top of the board, near buttons.
    - Connect UART adapter to the connector. Use 3.3V voltage level only,
      omit VCC connection. Pin 1 (VCC) is marked by square pad.
    - Put your initramfs-kernel image in TFTP server directory.
    - Power-up the device.
    - Press "1" to load initramfs image to RAM.
    - Enter IP address chosen for the device (defaults to 192.168.0.1).
    - Enter TFTP server IP address (defaults to 192.168.0.22).
    - Enter image filename as put inside TFTP server - something short,
      like firmware.bin is recommended.
    - Hit enter to load the image. U-boot will store above values in
      persistent environment for next installation.
    - If you ever might want to return to vendor firmware,
      BACK UP CONTENTS OF YOUR FLASH NOW.
      For this router, commonly used by mobile networks,
      plain vendor images are not officially available.
      To do so, copy contents of each /dev/mtd[0-3], "firmware" - mtd3 being the
      most important, and copy them over network to your PC. But in case
      anything goes wrong, PLEASE do back up ALL OF THEM.
    - From under OpenWrt just booted, load the sysupgrade image to tmpfs,
      and execute sysupgrade.
    
    (2) Using TFTP recovery
    - Set your host IP to 192.168.0.22 - for example using:
    sudo ip addr add 192.168.0.22/24 dev <interface>
    - Set up a TFTP server on your machine
    - Put the sysupgrade image in TFTP server root named as 'root_uImage'
      (no quotes), for example using tftpd:
      cp openwrt-ramips-rt305x-zte_mf283plus-squashfs-sysupgrade.bin /srv/tftp/root_uImage
    - Power on the router holding BOTH Reset and WPS buttons held for around
      5 seconds, until after WWAN and Signal LEDs blink.
    - Wait for OpenWrt to start booting up, this should take around a
      minute.
    
    Return to original firmware:
    Here, again there are two possibilities are possible, just like for
    installation:
    (1) Using initramfs-kernel image and serial console
    (2) Using TFTP recovery
    
    (1) Using initramfs-kernel image and serial console
    - Boot OpenWrt initramfs-kernel image via TFTP the same as for
      installation.
    - Copy over the backed up "firmware.bin" image of "mtd3" to /tmp/
    - Use "mtd write /tmp/firmware.bin /dev/mtd3", where firmware.bin is
      your backup taken before OpenWrt installation, and /dev/mtd3 is the
      "firmware" partition.
    
    (2) Using TFTP recovery
    - Follow the same steps as for installation, but replacing 'root_uImage'
      with firmware backup you took during installation, or by vendor
      firmware obtained elsewhere.
    
    A few quirks of the device, noted from my instance:
    - Wired and wireless MAC addresses written in flash are the same,
      despite being in separate locations.
    - Power LED is hardwired to 3.3V, so there is no status LED per se, and
      WLAN LED is controlled by WLAN driver, so I had to hijack 3G/4G LED
      for status - original firmware also does this in bootup.
    - FXS subsystem and its LED is controlled by the
      modem, so it work independently of OpenWrt.
      Tested to work even before OpenWrt booted.
      I managed to open up modem's shell via ADB,
      and found from its kernel logs, that FXS and its LED is indeed controlled
      by modem.
    - While finding LEDs, I had no GPL source drop from ZTE, so I had to probe for
      each and every one of them manually, so this might not be complete -
      it looks like bicolor LED is used for FXS, possibly to support
      dual-ported variant in other device sharing the PCB.
    - Flash performance is very low, despite enabling 50MHz clock and fast
      read command, due to using 4k sectors throughout the target. I decided
      to keep it at the moment, to avoid breaking existing devices - I
      identified one potentially affected, should this be limited to under
      4MB of Flash. The difference between sysupgrade durations is whopping
      3min vs 8min, so this is worth pursuing.
    
    In vendor firmware, WWAN LED behaviour is as follows, citing the manual:
    - red - no registration,
    - green - 3G,
    - blue - 4G.
    Blinking indicates activity, so netdev trigger mapped from wwan0 to blue:wwan
    looks reasonable at the moment, for full replacement, a script similar to
    "rssileds" would need to be developed.
    
    Behaviour of "Signal LED" in vendor firmware is as follows:
    - Off - no signal,
    - Blinking - poor coverage
    - Solid - good coverage.
    
    A few more details on the built-in LTE modem:
    Modem is not fully supported upstream in Linux - only two CDC ports
    (DIAG and one for QMI) probe. I sent patches upstream to add required device
    IDs for full support.
    The mapping of USB functions is as follows:
    - CDC (QCDM) - dedicated to comunicating with proprietary Qualcomm tools.
    - CDC (PCUI) - not supported by upstream 'option' driver yet. Patch
      submitted upstream.
    - CDC (Modem) - Exactly the same as above
    - QMI - A patch is sent upstream to add device ID, with that in place,
      uqmi did connect successfully, once I selected correct PDP context
      type for my SIM (IPv4-only, not default IPv4v6).
    - ADB - self-explanatory, one can access the ADB shell with a device ID
      added to 51-android.rules like so:
    
    SUBSYSTEM!="usb", GOTO="android_usb_rules_end"
    LABEL="android_usb_rules_begin"
    SUBSYSTEM=="usb", ATTR{idVendor}=="19d2", ATTR{idProduct}=="1275", ENV{adb_user}="yes"
    ENV{adb_user}=="yes", MODE="0660", GROUP="plugdev", TAG+="uaccess"
    LABEL="android_usb_rules_end"
    
    While not really needed in OpenWrt, it might come useful if one decides to
    move the modem to their PC to hack it further, insides seem to be pretty
    interesting. ADB also works well from within OpenWrt without that. O
    course it isn't needed for normal operation, so I left it out of
    DEVICE_PACKAGES.
    
    Signed-off-by: Lech Perczak <lech.perczak at gmail.com>
    [remove kmod-usb-ledtrig-usbport, take merged upstream patches]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
    
    (cherry picked from commit 59d065c9f81c4d1a89464d071134a50529449f34)
    [Manually remove no longer needed patches for modem]
    Signed-off-by: Lech Perczak <lech.perczak at gmail.com>
---
 package/boot/uboot-envtools/files/ramips           |   3 +-
 target/linux/ramips/dts/rt3352_zte_mf283plus.dts   | 131 +++++++++++++++++++++
 target/linux/ramips/image/rt305x.mk                |  10 ++
 .../ramips/rt305x/base-files/etc/board.d/01_leds   |   4 +
 .../rt305x/base-files/etc/board.d/02_network       |   4 +
 5 files changed, 151 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips
index 597c8f6ca6..a47e2950d3 100644
--- a/package/boot/uboot-envtools/files/ramips
+++ b/package/boot/uboot-envtools/files/ramips
@@ -34,7 +34,8 @@ xiaomi,mi-router-3g-v2|\
 xiaomi,mi-router-4a-gigabit|\
 xiaomi,mi-router-4c|\
 xiaomi,miwifi-nano|\
-zbtlink,zbt-wg2626)
+zbtlink,zbt-wg2626|\
+zte,mf283plus)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
 	;;
 hootoo,ht-tm05|\
diff --git a/target/linux/ramips/dts/rt3352_zte_mf283plus.dts b/target/linux/ramips/dts/rt3352_zte_mf283plus.dts
new file mode 100644
index 0000000000..a91d0e6ea9
--- /dev/null
+++ b/target/linux/ramips/dts/rt3352_zte_mf283plus.dts
@@ -0,0 +1,131 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "rt3352.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "zte,mf283plus", "ralink,rt3352-soc";
+	model = "ZTE MF283+";
+
+	aliases {
+		led-boot = &led_wwan_green;
+		led-failsafe = &led_wwan_red;
+		led-upgrade = &led_wwan_red;
+		label-mac-device = &ethernet;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_wwan_blue: wwan_blue {
+			label = "blue:wwan";
+			gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
+		};
+
+		led_wwan_green: wwan_green {
+			label = "green:wwan";
+			gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
+		};
+
+		led_wwan_red: wwan_red {
+			label = "red:wwan";
+			gpios = <&gpio1 7 GPIO_ACTIVE_LOW>;
+		};
+
+		signal {
+			label = "blue:signal";
+			gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	keys {
+		compatible = "gpio-keys-polled";
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio1 0 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+	};
+};
+
+&spi0 {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <50000000>;
+		m25p,fast-read;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x0 0x60000>;
+				read-only;
+			};
+
+			partition at 60000 {
+				label = "u-boot-env";
+				reg = <0x60000 0x10000>;
+				read-only;
+			};
+
+			factory: partition at 70000 {
+				label = "factory";
+				reg = <0x70000 0x10000>;
+				read-only;
+			};
+
+			partition at 80000 {
+				compatible = "denx,uimage";
+				label = "firmware";
+				reg = <0x80000 0xf80000>;
+			};
+		};
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "i2c", "jtag", "rgmii", "mdio", "uartf";
+		function = "gpio";
+	};
+};
+
+&gpio1 {
+	status = "okay";
+};
+
+&ethernet {
+	mtd-mac-address = <&factory 0x28>;
+};
+
+&esw {
+	mediatek,portmap = <0x2f>;
+};
+
+&wmac {
+	ralink,mtd-eeprom = <&factory 0x0>;
+};
+
+&ehci {
+	status = "okay";
+};
+
+&ohci {
+	status = "okay";
+};
diff --git a/target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk
index 210ae2f8b7..c16de3049f 100644
--- a/target/linux/ramips/image/rt305x.mk
+++ b/target/linux/ramips/image/rt305x.mk
@@ -1183,6 +1183,16 @@ define Device/zorlik_zl5900v2
 endef
 TARGET_DEVICES += zorlik_zl5900v2
 
+define Device/zte_mf283plus
+  SOC := rt3352
+  IMAGE_SIZE := 15872k
+  DEVICE_VENDOR := ZTE
+  DEVICE_MODEL := MF283+
+  DEVICE_PACKAGES := kmod-usb-ohci kmod-usb2 kmod-usb-net-qmi-wwan uqmi \
+	kmod-usb-serial kmod-usb-serial-option
+endef
+TARGET_DEVICES += zte_mf283plus
+
 define Device/zyxel_keenetic
   SOC := rt3052
   BLOCKSIZE := 64k
diff --git a/target/linux/ramips/rt305x/base-files/etc/board.d/01_leds b/target/linux/ramips/rt305x/base-files/etc/board.d/01_leds
index 1796ae50d8..d29328e4b0 100755
--- a/target/linux/ramips/rt305x/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/rt305x/base-files/etc/board.d/01_leds
@@ -94,6 +94,10 @@ vocore,vocore-16m)
 zorlik,zl5900v2)
 	ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0"
 	;;
+zte,mf283plus)
+	ucidef_set_led_wlan "wifi" "wifi" "rt2800soc-phy0::radio" "phy0tpt"
+	ucidef_set_led_netdev "wwan" "wwan" "blue:wwan" "wwan0"
+	;;
 esac
 
 board_config_flush
diff --git a/target/linux/ramips/rt305x/base-files/etc/board.d/02_network b/target/linux/ramips/rt305x/base-files/etc/board.d/02_network
index 56c786bc95..c3e39e76d0 100755
--- a/target/linux/ramips/rt305x/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/rt305x/base-files/etc/board.d/02_network
@@ -164,6 +164,10 @@ ramips_setup_interfaces()
 		ucidef_add_switch "switch0" \
 			"0:lan" "1:lan" "2:wan" "6 at eth0"
 		;;
+	zte,mf283plus)
+		ucidef_add_switch "switch0" \
+			"0:lan" "1:lan" "2:lan" "3:lan" "6 at eth0"
+		;;
 	zyxel,keenetic-lite-b|\
 	zyxel,keenetic-start)
 		ucidef_add_switch "switch0" \


From lede-commits at lists.infradead.org  Wed Jun  2 13:57:23 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 02 Jun 2021 16:57:23 -0400
Subject: [openwrt/openwrt] build/json: fix IMAGE_PREFIX and DEVICE_PACKAGES
In-Reply-To: <162266744363.11314.13729658055789685303@git-01.infra.openwrt.org>
References: <162266744363.11314.13729658055789685303@git-01.infra.openwrt.org>
Message-ID: <mailman.2553.1622667448.434944.lede-commits@lists.infradead.org>

zorun pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/c9a38e21a924f5b69038d6e9d7a5c063e4d2e8d8

commit c9a38e21a924f5b69038d6e9d7a5c063e4d2e8d8
Author: Paul Spooren <mail at aparcar.org>
AuthorDate: Wed Jun 2 10:13:28 2021 -1000

    build/json: fix IMAGE_PREFIX and DEVICE_PACKAGES
    
    These two variables were missing in the definition of
    DEFAULT_DEVICE_VARS which caused them to contain wrong values, messing
    up the resulting JSON files.
    
    This patch adds the two variables IMAGE_PREFIX and DEVICE_PACKAGES to
    DEFAULT_DEVICE_VARS.
    
    Suggested-by: Baptiste Jonglez <git at bitsofnetworks.org>
    Signed-off-by: Paul Spooren <mail at aparcar.org>
---
 include/image.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/image.mk b/include/image.mk
index 8cfd2155f3..b6e8ab3c84 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -419,7 +419,7 @@ DEFAULT_DEVICE_VARS := \
   DEVICE_DTS_CONFIG DEVICE_DTS_DIR DEVICE_FDT_NUM SOC BOARD_NAME \
   UIMAGE_MAGIC UIMAGE_NAME \
   SUPPORTED_DEVICES IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR \
-  UBOOT_PATH IMAGE_SIZE \
+  IMAGE_PREFIX DEVICE_PACKAGES UBOOT_PATH IMAGE_SIZE \
   DEVICE_COMPAT_VERSION DEVICE_COMPAT_MESSAGE \
   DEVICE_VENDOR DEVICE_MODEL DEVICE_VARIANT \
   DEVICE_ALT0_VENDOR DEVICE_ALT0_MODEL DEVICE_ALT0_VARIANT \


From lede-commits at lists.infradead.org  Wed Jun  2 14:00:24 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 02 Jun 2021 17:00:24 -0400
Subject: [openwrt/openwrt]  build/json: fix DEVICE_PACKAGES
In-Reply-To: <162266762475.14446.18080032059164385650@git-01.infra.openwrt.org>
References: <162266762475.14446.18080032059164385650@git-01.infra.openwrt.org>
Message-ID: <mailman.2554.1622667628.434944.lede-commits@lists.infradead.org>

zorun pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/29c94fe28ec6ec2f2cbd08e5af9a1b665587b3fe

commit 29c94fe28ec6ec2f2cbd08e5af9a1b665587b3fe
Author: Paul Spooren <mail at aparcar.org>
AuthorDate: Wed Jun 2 10:09:58 2021 -1000

    build/json: fix DEVICE_PACKAGES
    
    The variable was missing in the definition of DEFAULT_DEVICE_VARS which
    caused it to contain wrong values, messing up the resulting JSON files.
    
    This patch adds the variable DEVICE_PACKAGES to DEFAULT_DEVICE_VARS.
    
    Suggested-by: Baptiste Jonglez <git at bitsofnetworks.org>
    Signed-off-by: Paul Spooren <mail at aparcar.org>
---
 include/image.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/image.mk b/include/image.mk
index d93ce7f233..0d0e3eaba1 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -422,7 +422,7 @@ DEFAULT_DEVICE_VARS := \
   DEVICE_IMG_PREFIX SOC BOARD_NAME UIMAGE_MAGIC UIMAGE_NAME \
   SUPPORTED_DEVICES IMAGE_METADATA KERNEL_ENTRY KERNEL_LOADADDR \
   UBOOT_PATH IMAGE_SIZE \
-  DEVICE_COMPAT_VERSION DEVICE_COMPAT_MESSAGE \
+  DEVICE_PACKAGES DEVICE_COMPAT_VERSION DEVICE_COMPAT_MESSAGE \
   DEVICE_VENDOR DEVICE_MODEL DEVICE_VARIANT \
   DEVICE_ALT0_VENDOR DEVICE_ALT0_MODEL DEVICE_ALT0_VARIANT \
   DEVICE_ALT1_VENDOR DEVICE_ALT1_MODEL DEVICE_ALT1_VARIANT \


From lede-commits at lists.infradead.org  Wed Jun  2 15:03:04 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 02 Jun 2021 18:03:04 -0400
Subject: [openwrt/openwrt]  kernel: ar8216: remove soft_reset
In-Reply-To: <162267138386.31514.697709857134626181@git-01.infra.openwrt.org>
References: <162267138386.31514.697709857134626181@git-01.infra.openwrt.org>
Message-ID: <mailman.2557.1622671393.434944.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/c5a8b85b72c79e302da0297093be329b3216c57b

commit c5a8b85b72c79e302da0297093be329b3216c57b
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Wed Jun 2 23:46:06 2021 +0200

    kernel: ar8216: remove soft_reset
    
    ar8xxx_soft_reset is effectively a NOP function. In the PHY state
    machine, the availability and result of a soft_reset function
    makes no difference for the code flow.
    
    Thus, we can safely remove this method.
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 target/linux/generic/files/drivers/net/phy/ar8216.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c
index dbcb1c41c4..11cb18e4f3 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -2731,13 +2731,6 @@ ar8xxx_phy_remove(struct phy_device *phydev)
 	ar8xxx_free(priv);
 }
 
-static int
-ar8xxx_phy_soft_reset(struct phy_device *phydev)
-{
-	/* we don't need an extra reset */
-	return 0;
-}
-
 static struct phy_driver ar8xxx_phy_driver[] = {
 	{
 		.phy_id		= 0x004d0000,
@@ -2749,7 +2742,6 @@ static struct phy_driver ar8xxx_phy_driver[] = {
 		.config_init	= ar8xxx_phy_config_init,
 		.config_aneg	= ar8xxx_phy_config_aneg,
 		.read_status	= ar8xxx_phy_read_status,
-		.soft_reset	= ar8xxx_phy_soft_reset,
 		.get_features	= ar8xxx_get_features,
 	}
 };


From lede-commits at lists.infradead.org  Wed Jun  2 15:03:03 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 02 Jun 2021 18:03:03 -0400
Subject: [openwrt/openwrt]  kernel: ar8216: add get_features method
In-Reply-To: <162267138386.31514.697709857134626181@git-01.infra.openwrt.org>
References: <162267138386.31514.697709857134626181@git-01.infra.openwrt.org>
Message-ID: <mailman.2560.1622671393.434944.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/766e0f584a325b0b80a97bbc86ca515d97c63001

commit 766e0f584a325b0b80a97bbc86ca515d97c63001
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Wed Jun 2 19:34:01 2021 +0200

    kernel: ar8216: add get_features method
    
    Modifying PHY capabilities in the probe function broke with upstream
    commit 92ed2eb7f4b7 ("net: phy: probe the PHY before determining the
    supported features").
    
    AR8316 switches only support 10/100 Mbit/s link modes because of this
    change.
    
    Provide a get_features method for the PHY driver, so Gigabit link mode
    will be advertised to link partners again.
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 .../linux/generic/files/drivers/net/phy/ar8216.c   | 43 ++++++++++------------
 1 file changed, 20 insertions(+), 23 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c
index ef0fc54949..dbcb1c41c4 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -2552,6 +2552,18 @@ ar8xxx_phy_config_aneg(struct phy_device *phydev)
 	return genphy_config_aneg(phydev);
 }
 
+static int
+ar8xxx_get_features(struct phy_device *phydev)
+{
+	struct ar8xxx_priv *priv = phydev->priv;
+
+	linkmode_copy(phydev->supported, PHY_BASIC_FEATURES);
+	if (ar8xxx_has_gige(priv))
+		linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, phydev->supported);
+
+	return 0;
+}
+
 static const u32 ar8xxx_phy_ids[] = {
 	0x004dd033,
 	0x004dd034, /* AR8327 */
@@ -2649,29 +2661,14 @@ ar8xxx_phy_probe(struct phy_device *phydev)
 found:
 	priv->use_count++;
 
-	if (phydev->mdio.addr == 0) {
-		linkmode_zero(phydev->supported);
-		if (ar8xxx_has_gige(priv))
-			linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, phydev->supported);
-		else
-			linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Full_BIT, phydev->supported);
-		linkmode_copy(phydev->advertising, phydev->supported);
+	if (phydev->mdio.addr == 0 && priv->chip->config_at_probe) {
+		priv->phy = phydev;
 
-		if (priv->chip->config_at_probe) {
-			priv->phy = phydev;
-
-			ret = ar8xxx_start(priv);
-			if (ret)
-				goto err_unregister_switch;
-		}
-	} else {
-		if (ar8xxx_has_gige(priv)) {
-			linkmode_zero(phydev->supported);
-			linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Full_BIT, phydev->supported);
-			linkmode_copy(phydev->advertising, phydev->supported);
-		}
-		if (priv->chip->phy_rgmii_set)
-			priv->chip->phy_rgmii_set(priv, phydev);
+		ret = ar8xxx_start(priv);
+		if (ret)
+			goto err_unregister_switch;
+	} else if (priv->chip->phy_rgmii_set) {
+		priv->chip->phy_rgmii_set(priv, phydev);
 	}
 
 	phydev->priv = priv;
@@ -2746,7 +2743,6 @@ static struct phy_driver ar8xxx_phy_driver[] = {
 		.phy_id		= 0x004d0000,
 		.name		= "Atheros AR8216/AR8236/AR8316",
 		.phy_id_mask	= 0xffff0000,
-		.features	= PHY_BASIC_FEATURES,
 		.probe		= ar8xxx_phy_probe,
 		.remove		= ar8xxx_phy_remove,
 		.detach		= ar8xxx_phy_detach,
@@ -2754,6 +2750,7 @@ static struct phy_driver ar8xxx_phy_driver[] = {
 		.config_aneg	= ar8xxx_phy_config_aneg,
 		.read_status	= ar8xxx_phy_read_status,
 		.soft_reset	= ar8xxx_phy_soft_reset,
+		.get_features	= ar8xxx_get_features,
 	}
 };
 


From lede-commits at lists.infradead.org  Wed Jun  2 20:40:03 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 02 Jun 2021 23:40:03 -0400
Subject: [openwrt/openwrt]  mac80211: fix typo
In-Reply-To: <162269160366.1711.7414801973356362348@git-01.infra.openwrt.org>
References: <162269160366.1711.7414801973356362348@git-01.infra.openwrt.org>
Message-ID: <mailman.2579.1622691611.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/2cd1a108290f48fd35373f91056c05277c289687

commit 2cd1a108290f48fd35373f91056c05277c289687
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Jun 3 05:38:53 2021 +0200

    mac80211: fix typo
    
    Remove stray parenthesis
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/kernel/mac80211/files/lib/wifi/mac80211.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
index 02eabd0506..5eb7cc4c61 100644
--- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
@@ -70,7 +70,7 @@ BEGIN {
         if (channel) {
 		mode="NOHT"
 		if (ht) mode="HT20"
-		if (vht && band != "1:")) mode="VHT80"
+		if (vht && band != "1:") mode="VHT80"
 		if (he) mode="HE80"
 		if (he && band == "1:") mode="HE20"
                 sub("\\[", "", channel)


From lede-commits at lists.infradead.org  Thu Jun  3 01:17:06 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 03 Jun 2021 04:17:06 -0400
Subject: [openwrt/openwrt]  ubus: update to version 2021-06-03
In-Reply-To: <162270822664.32673.17194079513249744594@git-01.infra.openwrt.org>
References: <162270822664.32673.17194079513249744594@git-01.infra.openwrt.org>
Message-ID: <mailman.2622.1622708232.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/4f2243d40a400aa1ce6ae5d06325f93b4d9463a5

commit 4f2243d40a400aa1ce6ae5d06325f93b4d9463a5
Author: Petr ?tetiar <ynezz at true.cz>
AuthorDate: Thu Jun 3 09:49:58 2021 +0200

    ubus: update to version 2021-06-03
    
    This update contains following changes:
    
     * ubusd: protect against too-short messages
     * ubusd: add per-client tx queue limit
     * ubusd: convert tx_queue to linked list
    
    Fixes: FS#1525
    Signed-off-by: Petr ?tetiar <ynezz at true.cz>
---
 package/system/ubus/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile
index 54839e5514..885307107b 100644
--- a/package/system/ubus/Makefile
+++ b/package/system/ubus/Makefile
@@ -5,9 +5,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git
-PKG_SOURCE_DATE:=2021-02-15
-PKG_SOURCE_VERSION:=2537be01858710e714c329153760c64fe3f8a73e
-PKG_MIRROR_HASH:=da1f4959fbe3d51cbc6b7c08b24307f43a80911b395cac834b9f4161c195152f
+PKG_SOURCE_DATE:=2021-06-03
+PKG_SOURCE_VERSION:=a8cf678230ed163ff7a07eb1e2c872f9d655460a
+PKG_MIRROR_HASH:=aee34cd1c1aa0f1a459dda0b2c6cbdb6b66e67147ebd1bcbb2a16a2ef923d008
 PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
 CMAKE_INSTALL:=1
 


From lede-commits at lists.infradead.org  Thu Jun  3 01:37:09 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 03 Jun 2021 04:37:09 -0400
Subject: [openwrt/openwrt]  ubus: update to version 2021-06-03
In-Reply-To: <162270942967.17041.17979392925850047876@git-01.infra.openwrt.org>
References: <162270942967.17041.17979392925850047876@git-01.infra.openwrt.org>
Message-ID: <mailman.2644.1622709433.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/1b27d89d4075a2be7cb8035fde04dd5bbe2c91a3

commit 1b27d89d4075a2be7cb8035fde04dd5bbe2c91a3
Author: Petr ?tetiar <ynezz at true.cz>
AuthorDate: Thu Jun 3 09:49:58 2021 +0200

    ubus: update to version 2021-06-03
    
    This update contains following changes:
    
     * ubusd: protect against too-short messages
     * ubusd: add per-client tx queue limit
     * ubusd: convert tx_queue to linked list
    
    Fixes: FS#1525
    Signed-off-by: Petr ?tetiar <ynezz at true.cz>
    (cherry picked from commit 4f2243d40a400aa1ce6ae5d06325f93b4d9463a5)
---
 package/system/ubus/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile
index 54839e5514..885307107b 100644
--- a/package/system/ubus/Makefile
+++ b/package/system/ubus/Makefile
@@ -5,9 +5,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git
-PKG_SOURCE_DATE:=2021-02-15
-PKG_SOURCE_VERSION:=2537be01858710e714c329153760c64fe3f8a73e
-PKG_MIRROR_HASH:=da1f4959fbe3d51cbc6b7c08b24307f43a80911b395cac834b9f4161c195152f
+PKG_SOURCE_DATE:=2021-06-03
+PKG_SOURCE_VERSION:=a8cf678230ed163ff7a07eb1e2c872f9d655460a
+PKG_MIRROR_HASH:=aee34cd1c1aa0f1a459dda0b2c6cbdb6b66e67147ebd1bcbb2a16a2ef923d008
 PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
 CMAKE_INSTALL:=1
 


From lede-commits at lists.infradead.org  Thu Jun  3 07:01:37 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 03 Jun 2021 10:01:37 -0400
Subject: [openwrt/openwrt] hostapd: fix radius problem due to invalid
 attributes
In-Reply-To: <162272889698.17399.8202198377043702430@git-01.infra.openwrt.org>
References: <162272889698.17399.8202198377043702430@git-01.infra.openwrt.org>
Message-ID: <mailman.2756.1622728905.434944.lede-commits@lists.infradead.org>

blogic pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/96e9c81aabe9e14d6ec75c3f238c4ca7389b92a8

commit 96e9c81aabe9e14d6ec75c3f238c4ca7389b92a8
Author: John Crispin <john at phrozen.org>
AuthorDate: Thu Jun 3 15:57:07 2021 +0200

    hostapd: fix radius problem due to invalid attributes
    
    The offending commit caused the configuration file to contain:
      radius_auth_req_attr=
      radius_acct_req_attr=
    which cause hostapd to add an ATTR of type 0 into the messages.
    
    hostapd: RADIUS message: code=4 (Accounting-Request) identifier=0 length=93
    hostapd:    Attribute 40 (Acct-Status-Type) length=6
    hostapd:       Value: 7
    hostapd:    Attribute 30 (Called-Station-Id) length=28
    hostapd:       Value: 'C4-41-1E-F5-2D-55:OpenWifi'
    hostapd:    Attribute 61 (NAS-Port-Type) length=6
    hostapd:       Value: 19
    hostapd:    Attribute 0 (?Unknown?) length=3    <----------------
    hostapd:    Attribute 55 (Event-Timestamp) length=6
    hostapd:       Value: 1622726457
    hostapd:    Attribute 41 (Acct-Delay-Time) length=6
    hostapd:       Value: 0
    hostapd:    Attribute 44 (Acct-Session-Id) length=18
    hostapd:       Value: '9B5961E7235AAEC6'
    
    Fixes: 3bd6c8c728e (hostapd: add additional radius options)
    Signed-off-by: John Crispin <john at phrozen.org>
---
 package/network/services/hostapd/files/hostapd.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 7981f02ed6..1fa22cb69e 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -490,11 +490,11 @@ append_hs20_conn_capab() {
 }
 
 append_radius_acct_req_attr() {
-	append bss_conf "radius_acct_req_attr=$1" "$N"
+	[ -n "$1" ] && append bss_conf "radius_acct_req_attr=$1" "$N"
 }
 
 append_radius_auth_req_attr() {
-	append bss_conf "radius_auth_req_attr=$1" "$N"
+	[ -n "$1" ] && append bss_conf "radius_auth_req_attr=$1" "$N"
 }
 
 append_airtime_sta_weight() {


From lede-commits at lists.infradead.org  Thu Jun  3 12:07:47 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 03 Jun 2021 15:07:47 -0400
Subject: [openwrt/openwrt]  odhcpd: update to git HEAD
In-Reply-To: <162274726699.548.10474315706601400880@git-01.infra.openwrt.org>
References: <162274726699.548.10474315706601400880@git-01.infra.openwrt.org>
Message-ID: <mailman.2851.1622747272.434944.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/4fd4e9997a116d7bfc6a21bb5b8eadaa30a3a9e7

commit 4fd4e9997a116d7bfc6a21bb5b8eadaa30a3a9e7
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Thu Jun 3 21:04:16 2021 +0200

    odhcpd: update to git HEAD
    
    a12fcb3 config: log config parse failures to syslog
    ebd4297 cmake: enforce additonal compiler checks
    405da32 odhcpd: fix extra compiler warning
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/network/services/odhcpd/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile
index 799a63c23d..9ecae8a919 100644
--- a/package/network/services/odhcpd/Makefile
+++ b/package/network/services/odhcpd/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git
-PKG_SOURCE_DATE:=2021-01-06
-PKG_SOURCE_VERSION:=8d8a8cd35137ff0fa11b6be455fdd596a8d7d2e9
-PKG_MIRROR_HASH:=7149b4a434a35c1e64b20c708c0abbd381e034a2a1b4fbc1b7da0b039568b5b5
+PKG_SOURCE_DATE:=2021-05-15
+PKG_SOURCE_VERSION:=a12fcb3cee2d489b8648a2398812d7bed2f25faa
+PKG_MIRROR_HASH:=26a0dd58e29509471bd2be181a59fa1d75541426137d6ca87c98806199751efb
 
 PKG_MAINTAINER:=Hans Dedecker <dedeckeh at gmail.com>
 PKG_LICENSE:=GPL-2.0


From lede-commits at lists.infradead.org  Fri Jun  4 11:37:13 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 04 Jun 2021 14:37:13 -0400
Subject: [openwrt/openwrt]  netifd: update to the latest version
In-Reply-To: <162283183306.13347.5051578044555342948@git-01.infra.openwrt.org>
References: <162283183306.13347.5051578044555342948@git-01.infra.openwrt.org>
Message-ID: <mailman.3227.1622831844.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/55ded1c2658de67a235dca096266b77e7d5dc51f

commit 55ded1c2658de67a235dca096266b77e7d5dc51f
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri Jun 4 09:11:37 2021 +0200

    netifd: update to the latest version
    
    61a71e5e49c3 bridge: dynamically create vlans for hotplug members
    cb6ee9608e10 bridge: fix dynamic delete of hotplug vlans
    7f199050f395 wireless: pass the real network ifname to the setup script
    50381d0a2998 bridge: allow adding/removing VLANs to configured member ports via hotplug
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/network/config/netifd/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile
index 2f6b779e6d..aaffb57df7 100644
--- a/package/network/config/netifd/Makefile
+++ b/package/network/config/netifd/Makefile
@@ -5,9 +5,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git
-PKG_SOURCE_DATE:=2021-05-26
-PKG_SOURCE_VERSION:=899c2a4520526d43113f73cf673f20e2486a40fb
-PKG_MIRROR_HASH:=354905192b30af88ea953241ed332555e67cdb7e3b54dd139250bf1e6ad3a709
+PKG_SOURCE_DATE:=2021-06-04
+PKG_SOURCE_VERSION:=50381d0a2998f6c0fc4823f0c2aa4206063d549e
+PKG_MIRROR_HASH:=2718df3d3538c93ac77accf55716fb341741df3d231aac59e04dd1f80f558889
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 
 PKG_LICENSE:=GPL-2.0


From lede-commits at lists.infradead.org  Fri Jun  4 11:37:14 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 04 Jun 2021 14:37:14 -0400
Subject: [openwrt/openwrt] hostapd: fix bringing up vlan interfaces with the
 no-bridge option
In-Reply-To: <162283183306.13347.5051578044555342948@git-01.infra.openwrt.org>
References: <162283183306.13347.5051578044555342948@git-01.infra.openwrt.org>
Message-ID: <mailman.3228.1622831844.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/89bd8607f8cdacea7e8d13c1233a2a8b13fdf64c

commit 89bd8607f8cdacea7e8d13c1233a2a8b13fdf64c
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Jun 3 15:21:00 2021 +0200

    hostapd: fix bringing up vlan interfaces with the no-bridge option
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../hostapd/patches/710-vlan_no_bridge.patch       | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/package/network/services/hostapd/patches/710-vlan_no_bridge.patch b/package/network/services/hostapd/patches/710-vlan_no_bridge.patch
index d5aa33520b..73db32e54a 100644
--- a/package/network/services/hostapd/patches/710-vlan_no_bridge.patch
+++ b/package/network/services/hostapd/patches/710-vlan_no_bridge.patch
@@ -10,16 +10,24 @@
  #define DYNAMIC_VLAN_NAMING_END 2
 --- a/src/ap/vlan_full.c
 +++ b/src/ap/vlan_full.c
-@@ -466,6 +466,9 @@ void vlan_newlink(const char *ifname, st
- 
- 	wpa_printf(MSG_DEBUG, "VLAN: vlan_newlink(%s)", ifname);
+@@ -475,6 +475,9 @@ void vlan_newlink(const char *ifname, st
+ 	if (!vlan)
+ 		return;
  
 +	if (hapd->conf->ssid.vlan_no_bridge)
-+		return;
++		goto out;
 +
- 	for (vlan = hapd->conf->vlan; vlan; vlan = vlan->next) {
- 		if (vlan->configured ||
- 		    os_strcmp(ifname, vlan->ifname) != 0)
+ 	vlan->configured = 1;
+ 
+ 	notempty = vlan->vlan_desc.notempty;
+@@ -506,6 +509,7 @@ void vlan_newlink(const char *ifname, st
+ 				    ifname, br_name, tagged[i], hapd);
+ 	}
+ 
++out:
+ 	ifconfig_up(ifname);
+ }
+ 
 --- a/hostapd/config_file.c
 +++ b/hostapd/config_file.c
 @@ -3366,6 +3366,8 @@ static int hostapd_config_fill(struct ho


From lede-commits at lists.infradead.org  Fri Jun  4 13:54:55 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 04 Jun 2021 16:54:55 -0400
Subject: [openwrt/openwrt]  mac80211: split ath patch in dedicated subdir
In-Reply-To: <162284009596.5172.12381844906823013106@git-01.infra.openwrt.org>
References: <162284009596.5172.12381844906823013106@git-01.infra.openwrt.org>
Message-ID: <mailman.3240.1622840102.434944.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/3394af677cadd1f9b877100312c830d87488fcfb

commit 3394af677cadd1f9b877100312c830d87488fcfb
Author: Ansuel Smith <ansuelsmth at gmail.com>
AuthorDate: Wed Jun 2 01:49:50 2021 +0200

    mac80211: split ath patch in dedicated subdir
    
    The ath patch number is already large and adding other patch for ath11k
    will add more confusion with the patch numbering.
    Since the support of ath11k based device is imminent, prepare the mac80211
    ath patch dir and split it in the dedicated ath5k, ath9k, ath10k and ath11k
    (empty for now).
    
    Signed-off-by: Ansuel Smith <ansuelsmth at gmail.com>
---
 package/kernel/mac80211/Makefile                                  | 8 ++++++++
 .../patches/{ath => ath10k}/080-ath10k_thermal_config.patch       | 0
 ...300-ath10k-add-CCMP-PN-replay-protection-for-fragmented-.patch | 0
 .../301-ath10k-drop-fragments-with-multicast-DA-for-PCIe.patch    | 0
 .../302-ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch    | 0
 ...303-ath10k-drop-MPDU-which-has-discard-flag-set-by-firmw.patch | 0
 .../304-ath10k-Fix-TKIP-Michael-MIC-verification-for-PCIe.patch   | 0
 ...305-ath10k-Validate-first-subframe-of-A-MSDU-before-proc.patch | 0
 .../{ath => ath10k}/921-ath10k_init_devices_synchronously.patch   | 0
 .../922-ath10k-increase-rx-buffer-size-to-2048.patch              | 0
 .../patches/{ath => ath10k}/930-ath10k_add_tpt_led_trigger.patch  | 0
 ...dd-LED-and-GPIO-controlling-support-for-various-chipsets.patch | 0
 .../{ath => ath10k}/975-ath10k-use-tpt-trigger-by-default.patch   | 0
 .../{ath => ath10k}/980-ath10k-fix-max-antenna-gain-unit.patch    | 0
 ...981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch | 0
 .../patches/{ath => ath5k}/201-ath5k-WAR-for-AR71xx-PCI-bug.patch | 0
 .../patches/{ath => ath5k}/411-ath5k_allow_adhoc_and_ap.patch     | 0
 .../patches/{ath => ath5k}/420-ath5k_disable_fast_cc.patch        | 0
 .../mac80211/patches/{ath => ath5k}/430-add_ath5k_platform.patch  | 0
 .../mac80211/patches/{ath => ath5k}/432-ath5k_add_pciids.patch    | 0
 .../patches/{ath => ath5k}/440-ath5k_channel_bw_debugfs.patch     | 0
 .../350-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch         | 0
 .../351-ath9k_hw-issue-external-reset-for-QCA955x.patch           | 0
 .../354-ath9k-force-rx_clear-when-disabling-rx.patch              | 0
 ...356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch | 0
 ...365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch | 0
 .../mac80211/patches/{ath => ath9k}/401-ath9k_blink_default.patch | 0
 .../patches/{ath => ath9k}/410-ath9k_allow_adhoc_and_ap.patch     | 0
 .../450-ath9k-enabled-MFP-capability-unconditionally.patch        | 0
 .../patches/{ath => ath9k}/500-ath9k_eeprom_debugfs.patch         | 0
 .../mac80211/patches/{ath => ath9k}/501-ath9k_ahb_init.patch      | 0
 .../patches/{ath => ath9k}/510-ath9k_intr_mitigation_tweak.patch  | 0
 .../mac80211/patches/{ath => ath9k}/511-ath9k_reduce_rxbuf.patch  | 0
 .../patches/{ath => ath9k}/512-ath9k_channelbw_debugfs.patch      | 0
 .../mac80211/patches/{ath => ath9k}/513-ath9k_add_pci_ids.patch   | 0
 .../mac80211/patches/{ath => ath9k}/530-ath9k_extra_leds.patch    | 0
 .../patches/{ath => ath9k}/531-ath9k_extra_platform_leds.patch    | 0
 .../patches/{ath => ath9k}/540-ath9k_reduce_ani_interval.patch    | 0
 .../mac80211/patches/{ath => ath9k}/542-ath9k_debugfs_diag.patch  | 0
 .../patches/{ath => ath9k}/543-ath9k_entropy_from_adc.patch       | 0
 .../{ath => ath9k}/544-ath9k-ar933x-usb-hang-workaround.patch     | 0
 .../mac80211/patches/{ath => ath9k}/545-ath9k_ani_ws_detect.patch | 0
 .../patches/{ath => ath9k}/547-ath9k_led_defstate_fix.patch       | 0
 .../patches/{ath => ath9k}/548-ath9k_enable_gpio_chip.patch       | 0
 .../patches/{ath => ath9k}/549-ath9k_enable_gpio_buttons.patch    | 0
 .../patches/{ath => ath9k}/550-ath9k-disable-bands-via-dt.patch   | 0
 .../patches/{ath => ath9k}/551-ath9k_ubnt_uap_plus_hsr.patch      | 0
 .../{ath/552-ahb_of.patch => ath9k/552-ath9k-ahb_of.patch}        | 0
 .../mac80211/patches/{ath => ath9k}/553-ath9k_of_gpio_mask.patch  | 0
 49 files changed, 8 insertions(+)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 4d10de09a7..92167ebf3b 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -501,6 +501,10 @@ define Build/Patch
 	$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/build,build/)
 	$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/subsys,subsys/)
 	$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath,ath/)
+	$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath5k,ath5k/)
+	$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath9k,ath9k/)
+	$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath10k,ath10k/)
+	$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath11k,ath11k/)
 	$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/rt2x00,rt2x00/)
 	$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/mwl,mwl/)
 	$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/brcm,brcm/)
@@ -512,6 +516,10 @@ define Quilt/Refresh/Package
 	$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/build,build/)
 	$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/subsys,subsys/)
 	$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath,ath/)
+	$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath5k,ath5k/)
+	$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath9k,ath9k/)
+	$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath10k,ath10k/)
+	$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath11k,ath11k/)
 	$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/rt2x00,rt2x00/)
 	$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/mwl,mwl/)
 	$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/brcm,brcm/)
diff --git a/package/kernel/mac80211/patches/ath/080-ath10k_thermal_config.patch b/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/080-ath10k_thermal_config.patch
rename to package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch
diff --git a/package/kernel/mac80211/patches/ath/300-ath10k-add-CCMP-PN-replay-protection-for-fragmented-.patch b/package/kernel/mac80211/patches/ath10k/300-ath10k-add-CCMP-PN-replay-protection-for-fragmented-.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/300-ath10k-add-CCMP-PN-replay-protection-for-fragmented-.patch
rename to package/kernel/mac80211/patches/ath10k/300-ath10k-add-CCMP-PN-replay-protection-for-fragmented-.patch
diff --git a/package/kernel/mac80211/patches/ath/301-ath10k-drop-fragments-with-multicast-DA-for-PCIe.patch b/package/kernel/mac80211/patches/ath10k/301-ath10k-drop-fragments-with-multicast-DA-for-PCIe.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/301-ath10k-drop-fragments-with-multicast-DA-for-PCIe.patch
rename to package/kernel/mac80211/patches/ath10k/301-ath10k-drop-fragments-with-multicast-DA-for-PCIe.patch
diff --git a/package/kernel/mac80211/patches/ath/302-ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch b/package/kernel/mac80211/patches/ath10k/302-ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/302-ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch
rename to package/kernel/mac80211/patches/ath10k/302-ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch
diff --git a/package/kernel/mac80211/patches/ath/303-ath10k-drop-MPDU-which-has-discard-flag-set-by-firmw.patch b/package/kernel/mac80211/patches/ath10k/303-ath10k-drop-MPDU-which-has-discard-flag-set-by-firmw.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/303-ath10k-drop-MPDU-which-has-discard-flag-set-by-firmw.patch
rename to package/kernel/mac80211/patches/ath10k/303-ath10k-drop-MPDU-which-has-discard-flag-set-by-firmw.patch
diff --git a/package/kernel/mac80211/patches/ath/304-ath10k-Fix-TKIP-Michael-MIC-verification-for-PCIe.patch b/package/kernel/mac80211/patches/ath10k/304-ath10k-Fix-TKIP-Michael-MIC-verification-for-PCIe.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/304-ath10k-Fix-TKIP-Michael-MIC-verification-for-PCIe.patch
rename to package/kernel/mac80211/patches/ath10k/304-ath10k-Fix-TKIP-Michael-MIC-verification-for-PCIe.patch
diff --git a/package/kernel/mac80211/patches/ath/305-ath10k-Validate-first-subframe-of-A-MSDU-before-proc.patch b/package/kernel/mac80211/patches/ath10k/305-ath10k-Validate-first-subframe-of-A-MSDU-before-proc.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/305-ath10k-Validate-first-subframe-of-A-MSDU-before-proc.patch
rename to package/kernel/mac80211/patches/ath10k/305-ath10k-Validate-first-subframe-of-A-MSDU-before-proc.patch
diff --git a/package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/ath10k/921-ath10k_init_devices_synchronously.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/921-ath10k_init_devices_synchronously.patch
rename to package/kernel/mac80211/patches/ath10k/921-ath10k_init_devices_synchronously.patch
diff --git a/package/kernel/mac80211/patches/ath/922-ath10k-increase-rx-buffer-size-to-2048.patch b/package/kernel/mac80211/patches/ath10k/922-ath10k-increase-rx-buffer-size-to-2048.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/922-ath10k-increase-rx-buffer-size-to-2048.patch
rename to package/kernel/mac80211/patches/ath10k/922-ath10k-increase-rx-buffer-size-to-2048.patch
diff --git a/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch b/package/kernel/mac80211/patches/ath10k/930-ath10k_add_tpt_led_trigger.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch
rename to package/kernel/mac80211/patches/ath10k/930-ath10k_add_tpt_led_trigger.patch
diff --git a/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
rename to package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
diff --git a/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch
rename to package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch
diff --git a/package/kernel/mac80211/patches/ath/980-ath10k-fix-max-antenna-gain-unit.patch b/package/kernel/mac80211/patches/ath10k/980-ath10k-fix-max-antenna-gain-unit.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/980-ath10k-fix-max-antenna-gain-unit.patch
rename to package/kernel/mac80211/patches/ath10k/980-ath10k-fix-max-antenna-gain-unit.patch
diff --git a/package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch b/package/kernel/mac80211/patches/ath10k/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch
rename to package/kernel/mac80211/patches/ath10k/981-ath10k-adjust-tx-power-reduction-for-US-regulatory-d.patch
diff --git a/package/kernel/mac80211/patches/ath/201-ath5k-WAR-for-AR71xx-PCI-bug.patch b/package/kernel/mac80211/patches/ath5k/201-ath5k-WAR-for-AR71xx-PCI-bug.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/201-ath5k-WAR-for-AR71xx-PCI-bug.patch
rename to package/kernel/mac80211/patches/ath5k/201-ath5k-WAR-for-AR71xx-PCI-bug.patch
diff --git a/package/kernel/mac80211/patches/ath/411-ath5k_allow_adhoc_and_ap.patch b/package/kernel/mac80211/patches/ath5k/411-ath5k_allow_adhoc_and_ap.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/411-ath5k_allow_adhoc_and_ap.patch
rename to package/kernel/mac80211/patches/ath5k/411-ath5k_allow_adhoc_and_ap.patch
diff --git a/package/kernel/mac80211/patches/ath/420-ath5k_disable_fast_cc.patch b/package/kernel/mac80211/patches/ath5k/420-ath5k_disable_fast_cc.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/420-ath5k_disable_fast_cc.patch
rename to package/kernel/mac80211/patches/ath5k/420-ath5k_disable_fast_cc.patch
diff --git a/package/kernel/mac80211/patches/ath/430-add_ath5k_platform.patch b/package/kernel/mac80211/patches/ath5k/430-add_ath5k_platform.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/430-add_ath5k_platform.patch
rename to package/kernel/mac80211/patches/ath5k/430-add_ath5k_platform.patch
diff --git a/package/kernel/mac80211/patches/ath/432-ath5k_add_pciids.patch b/package/kernel/mac80211/patches/ath5k/432-ath5k_add_pciids.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/432-ath5k_add_pciids.patch
rename to package/kernel/mac80211/patches/ath5k/432-ath5k_add_pciids.patch
diff --git a/package/kernel/mac80211/patches/ath/440-ath5k_channel_bw_debugfs.patch b/package/kernel/mac80211/patches/ath5k/440-ath5k_channel_bw_debugfs.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/440-ath5k_channel_bw_debugfs.patch
rename to package/kernel/mac80211/patches/ath5k/440-ath5k_channel_bw_debugfs.patch
diff --git a/package/kernel/mac80211/patches/ath/350-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch b/package/kernel/mac80211/patches/ath9k/350-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/350-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch
rename to package/kernel/mac80211/patches/ath9k/350-ath9k_hw-reset-AHB-WMAC-interface-on-AR91xx.patch
diff --git a/package/kernel/mac80211/patches/ath/351-ath9k_hw-issue-external-reset-for-QCA955x.patch b/package/kernel/mac80211/patches/ath9k/351-ath9k_hw-issue-external-reset-for-QCA955x.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/351-ath9k_hw-issue-external-reset-for-QCA955x.patch
rename to package/kernel/mac80211/patches/ath9k/351-ath9k_hw-issue-external-reset-for-QCA955x.patch
diff --git a/package/kernel/mac80211/patches/ath/354-ath9k-force-rx_clear-when-disabling-rx.patch b/package/kernel/mac80211/patches/ath9k/354-ath9k-force-rx_clear-when-disabling-rx.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/354-ath9k-force-rx_clear-when-disabling-rx.patch
rename to package/kernel/mac80211/patches/ath9k/354-ath9k-force-rx_clear-when-disabling-rx.patch
diff --git a/package/kernel/mac80211/patches/ath/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch b/package/kernel/mac80211/patches/ath9k/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch
rename to package/kernel/mac80211/patches/ath9k/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch
diff --git a/package/kernel/mac80211/patches/ath/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch b/package/kernel/mac80211/patches/ath9k/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch
rename to package/kernel/mac80211/patches/ath9k/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch
diff --git a/package/kernel/mac80211/patches/ath/401-ath9k_blink_default.patch b/package/kernel/mac80211/patches/ath9k/401-ath9k_blink_default.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/401-ath9k_blink_default.patch
rename to package/kernel/mac80211/patches/ath9k/401-ath9k_blink_default.patch
diff --git a/package/kernel/mac80211/patches/ath/410-ath9k_allow_adhoc_and_ap.patch b/package/kernel/mac80211/patches/ath9k/410-ath9k_allow_adhoc_and_ap.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/410-ath9k_allow_adhoc_and_ap.patch
rename to package/kernel/mac80211/patches/ath9k/410-ath9k_allow_adhoc_and_ap.patch
diff --git a/package/kernel/mac80211/patches/ath/450-ath9k-enabled-MFP-capability-unconditionally.patch b/package/kernel/mac80211/patches/ath9k/450-ath9k-enabled-MFP-capability-unconditionally.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/450-ath9k-enabled-MFP-capability-unconditionally.patch
rename to package/kernel/mac80211/patches/ath9k/450-ath9k-enabled-MFP-capability-unconditionally.patch
diff --git a/package/kernel/mac80211/patches/ath/500-ath9k_eeprom_debugfs.patch b/package/kernel/mac80211/patches/ath9k/500-ath9k_eeprom_debugfs.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/500-ath9k_eeprom_debugfs.patch
rename to package/kernel/mac80211/patches/ath9k/500-ath9k_eeprom_debugfs.patch
diff --git a/package/kernel/mac80211/patches/ath/501-ath9k_ahb_init.patch b/package/kernel/mac80211/patches/ath9k/501-ath9k_ahb_init.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/501-ath9k_ahb_init.patch
rename to package/kernel/mac80211/patches/ath9k/501-ath9k_ahb_init.patch
diff --git a/package/kernel/mac80211/patches/ath/510-ath9k_intr_mitigation_tweak.patch b/package/kernel/mac80211/patches/ath9k/510-ath9k_intr_mitigation_tweak.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/510-ath9k_intr_mitigation_tweak.patch
rename to package/kernel/mac80211/patches/ath9k/510-ath9k_intr_mitigation_tweak.patch
diff --git a/package/kernel/mac80211/patches/ath/511-ath9k_reduce_rxbuf.patch b/package/kernel/mac80211/patches/ath9k/511-ath9k_reduce_rxbuf.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/511-ath9k_reduce_rxbuf.patch
rename to package/kernel/mac80211/patches/ath9k/511-ath9k_reduce_rxbuf.patch
diff --git a/package/kernel/mac80211/patches/ath/512-ath9k_channelbw_debugfs.patch b/package/kernel/mac80211/patches/ath9k/512-ath9k_channelbw_debugfs.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/512-ath9k_channelbw_debugfs.patch
rename to package/kernel/mac80211/patches/ath9k/512-ath9k_channelbw_debugfs.patch
diff --git a/package/kernel/mac80211/patches/ath/513-ath9k_add_pci_ids.patch b/package/kernel/mac80211/patches/ath9k/513-ath9k_add_pci_ids.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/513-ath9k_add_pci_ids.patch
rename to package/kernel/mac80211/patches/ath9k/513-ath9k_add_pci_ids.patch
diff --git a/package/kernel/mac80211/patches/ath/530-ath9k_extra_leds.patch b/package/kernel/mac80211/patches/ath9k/530-ath9k_extra_leds.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/530-ath9k_extra_leds.patch
rename to package/kernel/mac80211/patches/ath9k/530-ath9k_extra_leds.patch
diff --git a/package/kernel/mac80211/patches/ath/531-ath9k_extra_platform_leds.patch b/package/kernel/mac80211/patches/ath9k/531-ath9k_extra_platform_leds.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/531-ath9k_extra_platform_leds.patch
rename to package/kernel/mac80211/patches/ath9k/531-ath9k_extra_platform_leds.patch
diff --git a/package/kernel/mac80211/patches/ath/540-ath9k_reduce_ani_interval.patch b/package/kernel/mac80211/patches/ath9k/540-ath9k_reduce_ani_interval.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/540-ath9k_reduce_ani_interval.patch
rename to package/kernel/mac80211/patches/ath9k/540-ath9k_reduce_ani_interval.patch
diff --git a/package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch b/package/kernel/mac80211/patches/ath9k/542-ath9k_debugfs_diag.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch
rename to package/kernel/mac80211/patches/ath9k/542-ath9k_debugfs_diag.patch
diff --git a/package/kernel/mac80211/patches/ath/543-ath9k_entropy_from_adc.patch b/package/kernel/mac80211/patches/ath9k/543-ath9k_entropy_from_adc.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/543-ath9k_entropy_from_adc.patch
rename to package/kernel/mac80211/patches/ath9k/543-ath9k_entropy_from_adc.patch
diff --git a/package/kernel/mac80211/patches/ath/544-ath9k-ar933x-usb-hang-workaround.patch b/package/kernel/mac80211/patches/ath9k/544-ath9k-ar933x-usb-hang-workaround.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/544-ath9k-ar933x-usb-hang-workaround.patch
rename to package/kernel/mac80211/patches/ath9k/544-ath9k-ar933x-usb-hang-workaround.patch
diff --git a/package/kernel/mac80211/patches/ath/545-ath9k_ani_ws_detect.patch b/package/kernel/mac80211/patches/ath9k/545-ath9k_ani_ws_detect.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/545-ath9k_ani_ws_detect.patch
rename to package/kernel/mac80211/patches/ath9k/545-ath9k_ani_ws_detect.patch
diff --git a/package/kernel/mac80211/patches/ath/547-ath9k_led_defstate_fix.patch b/package/kernel/mac80211/patches/ath9k/547-ath9k_led_defstate_fix.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/547-ath9k_led_defstate_fix.patch
rename to package/kernel/mac80211/patches/ath9k/547-ath9k_led_defstate_fix.patch
diff --git a/package/kernel/mac80211/patches/ath/548-ath9k_enable_gpio_chip.patch b/package/kernel/mac80211/patches/ath9k/548-ath9k_enable_gpio_chip.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/548-ath9k_enable_gpio_chip.patch
rename to package/kernel/mac80211/patches/ath9k/548-ath9k_enable_gpio_chip.patch
diff --git a/package/kernel/mac80211/patches/ath/549-ath9k_enable_gpio_buttons.patch b/package/kernel/mac80211/patches/ath9k/549-ath9k_enable_gpio_buttons.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/549-ath9k_enable_gpio_buttons.patch
rename to package/kernel/mac80211/patches/ath9k/549-ath9k_enable_gpio_buttons.patch
diff --git a/package/kernel/mac80211/patches/ath/550-ath9k-disable-bands-via-dt.patch b/package/kernel/mac80211/patches/ath9k/550-ath9k-disable-bands-via-dt.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/550-ath9k-disable-bands-via-dt.patch
rename to package/kernel/mac80211/patches/ath9k/550-ath9k-disable-bands-via-dt.patch
diff --git a/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch b/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch
rename to package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch
diff --git a/package/kernel/mac80211/patches/ath/552-ahb_of.patch b/package/kernel/mac80211/patches/ath9k/552-ath9k-ahb_of.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/552-ahb_of.patch
rename to package/kernel/mac80211/patches/ath9k/552-ath9k-ahb_of.patch
diff --git a/package/kernel/mac80211/patches/ath/553-ath9k_of_gpio_mask.patch b/package/kernel/mac80211/patches/ath9k/553-ath9k_of_gpio_mask.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath/553-ath9k_of_gpio_mask.patch
rename to package/kernel/mac80211/patches/ath9k/553-ath9k_of_gpio_mask.patch


From lede-commits at lists.infradead.org  Fri Jun  4 16:51:05 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 04 Jun 2021 19:51:05 -0400
Subject: [openwrt/openwrt] ramips: enable additional UART on MikroTik
 RouterBOARD M33G
In-Reply-To: <162285066294.13938.18268214475752374621@git-01.infra.openwrt.org>
References: <162285066294.13938.18268214475752374621@git-01.infra.openwrt.org>
Message-ID: <mailman.3259.1622850670.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/fbc2feadd4e56483db485217f69a1e2149e7693f

commit fbc2feadd4e56483db485217f69a1e2149e7693f
Author: Philipp Borgers <borgers at mi.fu-berlin.de>
AuthorDate: Wed Jun 2 11:01:32 2021 +0200

    ramips: enable additional UART on MikroTik RouterBOARD M33G
    
    The RouterBOARD M33G has an additional UART that should be enabled
    by default.
    
    Signed-off-by: Philipp Borgers <borgers at mi.fu-berlin.de>
---
 target/linux/ramips/dts/mt7621_mikrotik_routerboard-m33g.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m33g.dts b/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m33g.dts
index affbaf35b7..d457c43426 100644
--- a/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m33g.dts
+++ b/target/linux/ramips/dts/mt7621_mikrotik_routerboard-m33g.dts
@@ -127,3 +127,7 @@
 &pcie {
 	status = "okay";
 };
+
+&uartlite3 {
+	status = "okay";
+};


From lede-commits at lists.infradead.org  Fri Jun  4 16:51:03 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 04 Jun 2021 19:51:03 -0400
Subject: [openwrt/openwrt]  ath79: Add support for OpenMesh A40
In-Reply-To: <162285066294.13938.18268214475752374621@git-01.infra.openwrt.org>
References: <162285066294.13938.18268214475752374621@git-01.infra.openwrt.org>
Message-ID: <mailman.3260.1622850670.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/9a172797e593c061f6759a37eaeba2956ad8d72f

commit 9a172797e593c061f6759a37eaeba2956ad8d72f
Author: Sven Eckelmann <sven at narfation.org>
AuthorDate: Mon Nov 23 13:41:34 2020 +0100

    ath79: Add support for OpenMesh A40
    
    Device specifications:
    ======================
    
    * Qualcomm/Atheros QCA9558 ver 1 rev 0
    * 720/600/240 MHz (CPU/DDR/AHB)
    * 128 MB of RAM
    * 16 MB of SPI NOR flash
      - 2x 7 MB available; but one of the 7 MB regions is the recovery image
    * 2T2R 2.4 GHz Wi-Fi (11n)
    * 2T2R 5 GHz Wi-Fi (11ac)
    * multi-color LED (controlled via red/green/blue GPIOs)
    * 1x GPIO-button (reset)
    * external h/w watchdog (enabled by default))
    * TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
    * 2x ethernet
      - eth0
        + Label: Ethernet 1
        + AR8035 ethernet PHY (RGMII)
        + 10/100/1000 Mbps Ethernet
        + 802.3af POE
        + used as WAN interface
      - eth1
        + Label: Ethernet 2
        + AR8035 ethernet PHY (SGMII)
        + 10/100/1000 Mbps Ethernet
        + used as LAN interface
    * 1x USB
    * internal antennas
    
    Flashing instructions:
    ======================
    
    Various methods can be used to install the actual image on the flash.
    Two easy ones are:
    
    ap51-flash
    ----------
    
    The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
    used to transfer the image to the u-boot when the device boots up.
    
    initramfs from TFTP
    -------------------
    
    The serial console must be used to access the u-boot shell during bootup.
    It can then be used to first boot up the initramfs image from a TFTP server
    (here with the IP 192.168.1.21):
    
       setenv serverip 192.168.1.21
       setenv ipaddr 192.168.1.1
       tftpboot 0c00000 <filename-of-initramfs-kernel>.bin && bootm $fileaddr
    
    The actual sysupgrade image can then be transferred (on the LAN port) to the
    device via
    
      scp <filename-of-squashfs-sysupgrade>.bin root at 192.168.1.1:/tmp/
    
    On the device, the sysupgrade must then be started using
    
      sysupgrade -n /tmp/<filename-of-squashfs-sysupgrade>.bin
    
    Signed-off-by: Sven Eckelmann <sven at narfation.org>
---
 package/boot/uboot-envtools/files/ath79                        |  1 +
 target/linux/ath79/dts/qca9558_openmesh_a40.dts                |  8 ++++++++
 target/linux/ath79/generic/base-files/etc/board.d/02_network   |  1 +
 .../base-files/etc/hotplug.d/firmware/11-ath10k-caldata        |  1 +
 target/linux/ath79/generic/base-files/lib/upgrade/platform.sh  |  1 +
 target/linux/ath79/image/generic.mk                            | 10 ++++++++++
 6 files changed, 22 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79
index 1fc484df52..91ba587bf8 100644
--- a/package/boot/uboot-envtools/files/ath79
+++ b/package/boot/uboot-envtools/files/ath79
@@ -48,6 +48,7 @@ netgear,wnr2200-16m|\
 netgear,wnr612-v2|\
 ocedo,koala|\
 ocedo,raccoon|\
+openmesh,a40|\
 openmesh,a60|\
 openmesh,mr600-v1|\
 openmesh,mr600-v2|\
diff --git a/target/linux/ath79/dts/qca9558_openmesh_a40.dts b/target/linux/ath79/dts/qca9558_openmesh_a40.dts
new file mode 100644
index 0000000000..d2b817031a
--- /dev/null
+++ b/target/linux/ath79/dts/qca9558_openmesh_a40.dts
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qca9558_openmesh_a60.dtsi"
+
+/ {
+	compatible = "openmesh,a40", "qca,qca9558";
+	model = "OpenMesh A40";
+};
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 d2b55f0ba6..87aaf0bcad 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
@@ -170,6 +170,7 @@ ath79_setup_interfaces()
 	comfast,cf-e120a-v3|\
 	comfast,cf-e314n-v2|\
 	compex,wpj531-16m|\
+	openmesh,a40|\
 	openmesh,a60|\
 	openmesh,om2p-v4|\
 	openmesh,om2p-hs-v4|\
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 1402c5529a..a7986a98ec 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
@@ -98,6 +98,7 @@ case "$FIRMWARE" in
 		caldata_extract "art" 0x5000 0x844
 		ath10k_patch_mac $(mtd_get_mac_binary art 0xc)
 		;;
+	openmesh,a40|\
 	openmesh,a60|\
 	openmesh,mr1750-v1|\
 	openmesh,mr1750-v2)
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 9b6a0cf9bc..20041e4c95 100644
--- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
@@ -65,6 +65,7 @@ platform_do_upgrade() {
 	jjplus,ja76pf2)
 		redboot_fis_do_upgrade "$1" linux
 		;;
+	openmesh,a40|\
 	openmesh,a60|\
 	openmesh,mr600-v1|\
 	openmesh,mr600-v2|\
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 7c26f5dc1f..86aae57266 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -1628,6 +1628,16 @@ define Device/openmesh_common_256k
 	openmesh-image ce_type=$$$$(OPENMESH_CE_TYPE) | append-metadata
 endef
 
+define Device/openmesh_a40
+  $(Device/openmesh_common_64k)
+  SOC := qca9558
+  DEVICE_MODEL := A40
+  DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct kmod-usb2
+  OPENMESH_CE_TYPE := A60
+  SUPPORTED_DEVICES += a40
+endef
+TARGET_DEVICES += openmesh_a40
+
 define Device/openmesh_a60
   $(Device/openmesh_common_64k)
   SOC := qca9558


From lede-commits at lists.infradead.org  Fri Jun  4 16:51:02 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 04 Jun 2021 19:51:02 -0400
Subject: [openwrt/openwrt]  ath79: Add support for OpenMesh A60
In-Reply-To: <162285066294.13938.18268214475752374621@git-01.infra.openwrt.org>
References: <162285066294.13938.18268214475752374621@git-01.infra.openwrt.org>
Message-ID: <mailman.3263.1622850674.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/eaf2e32c12655d7fb58e158086a784393dc6f69a

commit eaf2e32c12655d7fb58e158086a784393dc6f69a
Author: Sven Eckelmann <sven at narfation.org>
AuthorDate: Mon Nov 23 13:41:34 2020 +0100

    ath79: Add support for OpenMesh A60
    
    Device specifications:
    ======================
    
    * Qualcomm/Atheros QCA9558 ver 1 rev 0
    * 720/600/240 MHz (CPU/DDR/AHB)
    * 128 MB of RAM
    * 16 MB of SPI NOR flash
      - 2x 7 MB available; but one of the 7 MB regions is the recovery image
    * 3T3R 2.4 GHz Wi-Fi (11n)
    * 3T3R 5 GHz Wi-Fi (11ac)
    * multi-color LED (controlled via red/green/blue GPIOs)
    * 1x GPIO-button (reset)
    * external h/w watchdog (enabled by default))
    * TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
    * 2x ethernet
      - eth0
        + Label: Ethernet 1
        + AR8035 ethernet PHY (RGMII)
        + 10/100/1000 Mbps Ethernet
        + 802.3af POE
        + used as WAN interface
      - eth1
        + Label: Ethernet 2
        + AR8031 ethernet PHY (SGMII)
        + 10/100/1000 Mbps Ethernet
        + used as LAN interface
    * 1x USB
    * internal antennas
    
    Flashing instructions:
    ======================
    
    Various methods can be used to install the actual image on the flash.
    Two easy ones are:
    
    ap51-flash
    ----------
    
    The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
    used to transfer the image to the u-boot when the device boots up.
    
    initramfs from TFTP
    -------------------
    
    The serial console must be used to access the u-boot shell during bootup.
    It can then be used to first boot up the initramfs image from a TFTP server
    (here with the IP 192.168.1.21):
    
       setenv serverip 192.168.1.21
       setenv ipaddr 192.168.1.1
       tftpboot 0c00000 <filename-of-initramfs-kernel>.bin && bootm $fileaddr
    
    The actual sysupgrade image can then be transferred (on the LAN port) to the
    device via
    
      scp <filename-of-squashfs-sysupgrade>.bin root at 192.168.1.1:/tmp/
    
    On the device, the sysupgrade must then be started using
    
      sysupgrade -n /tmp/<filename-of-squashfs-sysupgrade>.bin
    
    Signed-off-by: Sven Eckelmann <sven at narfation.org>
---
 package/boot/uboot-envtools/files/ath79            |   1 +
 target/linux/ath79/dts/qca9558_openmesh_a60.dts    |   8 +
 target/linux/ath79/dts/qca9558_openmesh_a60.dtsi   | 180 +++++++++++++++++++++
 .../generic/base-files/etc/board.d/02_network      |   1 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata       |   1 +
 .../generic/base-files/lib/upgrade/platform.sh     |   1 +
 target/linux/ath79/image/generic.mk                |  10 ++
 7 files changed, 202 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ath79 b/package/boot/uboot-envtools/files/ath79
index 7b0692e59f..1fc484df52 100644
--- a/package/boot/uboot-envtools/files/ath79
+++ b/package/boot/uboot-envtools/files/ath79
@@ -48,6 +48,7 @@ netgear,wnr2200-16m|\
 netgear,wnr612-v2|\
 ocedo,koala|\
 ocedo,raccoon|\
+openmesh,a60|\
 openmesh,mr600-v1|\
 openmesh,mr600-v2|\
 openmesh,mr900-v1|\
diff --git a/target/linux/ath79/dts/qca9558_openmesh_a60.dts b/target/linux/ath79/dts/qca9558_openmesh_a60.dts
new file mode 100644
index 0000000000..473f055b49
--- /dev/null
+++ b/target/linux/ath79/dts/qca9558_openmesh_a60.dts
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qca9558_openmesh_a60.dtsi"
+
+/ {
+	compatible = "openmesh,a60", "qca,qca9558";
+	model = "OpenMesh A60";
+};
diff --git a/target/linux/ath79/dts/qca9558_openmesh_a60.dtsi b/target/linux/ath79/dts/qca9558_openmesh_a60.dtsi
new file mode 100644
index 0000000000..9938e5f4c0
--- /dev/null
+++ b/target/linux/ath79/dts/qca9558_openmesh_a60.dtsi
@@ -0,0 +1,180 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qca955x.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	chosen {
+		/delete-property/ bootargs;
+	};
+
+	aliases {
+		serial0 = &uart;
+		led-boot = &led_status_green;
+		led-failsafe = &led_status_green;
+		led-running = &led_status_green;
+		led-upgrade = &led_status_green;
+		label-mac-device = &eth0;
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		status_blue {
+			label = "blue:status";
+			gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
+		};
+
+		status_red {
+			label = "red:status";
+			gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_status_green: status_green {
+			label = "green:status";
+			gpios = <&gpio 23 GPIO_ACTIVE_HIGH>;
+		};
+	};
+
+	watchdog {
+		compatible = "linux,wdt-gpio";
+		gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+		hw_algo = "toggle";
+		/* hw_margin_ms is actually 300s but driver limits it to 60s */
+		hw_margin_ms = <60000>;
+		always-running;
+	};
+};
+
+&usb_phy1 {
+	status = "okay";
+};
+
+&usb1 {
+	status = "okay";
+};
+
+&spi {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <40000000>;
+
+		/* partitions are passed via bootloader */
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x000000 0x040000>;
+				read-only;
+			};
+
+			partition at 40000 {
+				label = "u-boot-env";
+				reg = <0x040000 0x010000>;
+			};
+
+			partition at 50000 {
+				label = "custom";
+				reg = <0x050000 0x060000>;
+				read-only;
+			};
+
+			partition at b0000 {
+				label = "inactive";
+				reg = <0x0b0000 0x7a0000>;
+			};
+
+			partition at 850000 {
+				label = "inactive2";
+				reg = <0x850000 0x7a0000>;
+			};
+
+			art: partition at ff0000 {
+				label = "ART";
+				reg = <0xff0000 0x010000>;
+				read-only;
+			};
+		};
+	};
+};
+
+&mdio0 {
+	status = "okay";
+
+	phy-mask = <0x6>;
+
+	phy1: ethernet-phy at 1 {
+		reg = <1>;
+		eee-broken-100tx;
+		eee-broken-1000t;
+	};
+
+	phy2: ethernet-phy at 2 {
+		reg = <2>;
+		eee-broken-100tx;
+		eee-broken-1000t;
+		at803x-override-sgmii-link-check;
+	};
+};
+
+&eth0 {
+	status = "okay";
+
+	pll-data = <0x82000101 0x80000101 0x80001313>;
+
+	mtd-mac-address = <&art 0x0>;
+
+	phy-mode = "rgmii-id";
+	phy-handle = <&phy1>;
+
+	gmac-config {
+		device = <&gmac>;
+		rgmii-enabled = <1>;
+		rxd-delay = <3>;
+		rxdv-delay = <3>;
+		txd-delay = <0>;
+		txen-delay = <0>;
+	};
+};
+
+&eth1 {
+	status = "okay";
+
+	pll-data = <0x03000101 0x80000101 0x80001313>;
+
+	mtd-mac-address = <&art 0x6>;
+
+	qca955x-sgmii-fixup;
+
+	phy-handle = <&phy2>;
+};
+
+&wmac {
+	status = "okay";
+
+	mtd-cal-data = <&art 0x1000>;
+	mtd-mac-address = <&art 0x0>;
+	mtd-mac-address-increment = <2>;
+};
+
+&pcie0 {
+	status = "okay";
+};
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 4133b9d7d3..d2b55f0ba6 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
@@ -170,6 +170,7 @@ ath79_setup_interfaces()
 	comfast,cf-e120a-v3|\
 	comfast,cf-e314n-v2|\
 	compex,wpj531-16m|\
+	openmesh,a60|\
 	openmesh,om2p-v4|\
 	openmesh,om2p-hs-v4|\
 	plasmacloud,pa300|\
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 9e4b4496e5..1402c5529a 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
@@ -98,6 +98,7 @@ case "$FIRMWARE" in
 		caldata_extract "art" 0x5000 0x844
 		ath10k_patch_mac $(mtd_get_mac_binary art 0xc)
 		;;
+	openmesh,a60|\
 	openmesh,mr1750-v1|\
 	openmesh,mr1750-v2)
 		caldata_extract "ART" 0x5000 0x844
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 f8b1c13677..9b6a0cf9bc 100644
--- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
@@ -65,6 +65,7 @@ platform_do_upgrade() {
 	jjplus,ja76pf2)
 		redboot_fis_do_upgrade "$1" linux
 		;;
+	openmesh,a60|\
 	openmesh,mr600-v1|\
 	openmesh,mr600-v2|\
 	openmesh,mr900-v1|\
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 2e23e4e72c..7c26f5dc1f 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -1628,6 +1628,16 @@ define Device/openmesh_common_256k
 	openmesh-image ce_type=$$$$(OPENMESH_CE_TYPE) | append-metadata
 endef
 
+define Device/openmesh_a60
+  $(Device/openmesh_common_64k)
+  SOC := qca9558
+  DEVICE_MODEL := A60
+  DEVICE_PACKAGES += kmod-ath10k-ct ath10k-firmware-qca988x-ct kmod-usb2
+  OPENMESH_CE_TYPE := A60
+  SUPPORTED_DEVICES += a60
+endef
+TARGET_DEVICES += openmesh_a60
+
 define Device/openmesh_mr600-v1
   $(Device/openmesh_common_64k)
   SOC := ar9344


From lede-commits at lists.infradead.org  Fri Jun  4 16:51:04 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 04 Jun 2021 19:51:04 -0400
Subject: [openwrt/openwrt] ath79: add support for Qualcomm AP143 reference
 boards
In-Reply-To: <162285066294.13938.18268214475752374621@git-01.infra.openwrt.org>
References: <162285066294.13938.18268214475752374621@git-01.infra.openwrt.org>
Message-ID: <mailman.3264.1622850674.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/1eb481206dd4173f9e19f83e4b05892cd1035c74

commit 1eb481206dd4173f9e19f83e4b05892cd1035c74
Author: Zoltan HERPAI <wigyori at uid0.hu>
AuthorDate: Mon Aug 3 23:07:21 2020 +0200

    ath79: add support for Qualcomm AP143 reference boards
    
    Specifications:
    
    SoC:    QCA9533
    DRAM:   32Mb DDR1
    Flash:  8/16Mb SPI-NOR
    LAN:    4x 10/100Mbps via AR8229 switch (integrated into SoC)
            on GMII
    WAN:    1x 10/100Mbps via MII
    WLAN:   QCA9530
    USB:    1x 2.0
    UART:   standard QCA UART header
    JTAG:   yes
    Button: 1x WPS, 1x reset
    LEDs:   8x LEDs
    
    A version with 4Mb flash is also available, but due to lack of
    enough space it's not supported.
    
    As the original flash layout does not provide enough space for
    the kernel (1472k), the firmware uses OKLI and concat flash to
    overcome the limitation without changing the boot address of the
    bootloaders.
    
    Installation:
    
    1. Original bootloader
    
      Connect the board to ethernet
      Set up a server with an IP address of 192.168.1.10
      Make the openwrt-ath79-generic-qca_ap143-8m-squashfs-factory.bin
      available via TFTP
    
      tftpboot 0x80060000 openwrt-ath79-generic-qca_ap143-8m-squashfs-factory.bin
      erase 0x9f050000 +$filesize
      cp.b $fileaddr 0x9f050000 $filesize
    
      Reboot the board.
    
    2. pepe2k's u-boot_mod
    
      Connect the board to ethernet
      Set up a server with an IP address of 192.168.1.10
      Make the openwrt-ath79-generic-qca_ap143-8m-squashfs-factory.bin
      available via TFTP, as "firmware.bin"
    
      run fw_upg
    
      Reboot the board.
    
    For the 16M version of the board, please use
    openwrt-ath79-generic-qca_ap143-16m-squashfs-factory.bin
    
    Signed-off-by: Zoltan HERPAI <wigyori at uid0.hu>
    [use fwconcatX names, drop redundant uart status, fix IMAGE_SIZE,
    set up IMAGE/factory.bin without metadata]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 target/linux/ath79/dts/qca9533_qca_ap143-16m.dts   |  49 ++++++++
 target/linux/ath79/dts/qca9533_qca_ap143-8m.dts    |  49 ++++++++
 target/linux/ath79/dts/qca9533_qca_ap143.dtsi      | 125 +++++++++++++++++++++
 .../ath79/generic/base-files/etc/board.d/01_leds   |   8 ++
 .../generic/base-files/etc/board.d/02_network      |   4 +-
 target/linux/ath79/image/Makefile                  |   4 +
 target/linux/ath79/image/generic.mk                |  37 ++++++
 7 files changed, 275 insertions(+), 1 deletion(-)

diff --git a/target/linux/ath79/dts/qca9533_qca_ap143-16m.dts b/target/linux/ath79/dts/qca9533_qca_ap143-16m.dts
new file mode 100644
index 0000000000..31e61de175
--- /dev/null
+++ b/target/linux/ath79/dts/qca9533_qca_ap143-16m.dts
@@ -0,0 +1,49 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qca9533_qca_ap143.dtsi"
+
+/ {
+	model = "Qualcomm Atheros AP143 (16M) reference board";
+	compatible = "qca,ap143-16m", "qca,qca9533";
+
+	virtual_flash {
+		compatible = "mtd-concat";
+		devices = <&fwconcat0 &fwconcat1>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				reg = <0x0 0x0>;
+				label = "firmware";
+				compatible = "openwrt,uimage", "denx,uimage";
+				openwrt,ih-magic = <IH_MAGIC_OKLI>;
+			};
+		};
+	};
+};
+
+&partitions {
+	fwconcat0: partition at 50000 {
+		label = "fwconcat0";
+		reg = <0x050000 0xe30000>;
+	};
+
+	partition at e80000 {
+		label = "loader";
+		reg = <0xe80000 0x10000>;
+	};
+
+	fwconcat1: partition at e90000 {
+		label = "fwconcat1";
+		reg = <0xe90000 0x160000>;
+	};
+
+	art: partition at ff0000 {
+		label = "art";
+		reg = <0xff0000 0x010000>;
+		read-only;
+	};
+};
diff --git a/target/linux/ath79/dts/qca9533_qca_ap143-8m.dts b/target/linux/ath79/dts/qca9533_qca_ap143-8m.dts
new file mode 100644
index 0000000000..bdb93420b5
--- /dev/null
+++ b/target/linux/ath79/dts/qca9533_qca_ap143-8m.dts
@@ -0,0 +1,49 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qca9533_qca_ap143.dtsi"
+
+/ {
+	model = "Qualcomm Atheros AP143 (8M) reference board";
+	compatible = "qca,ap143-8m", "qca,qca9533";
+
+	virtual_flash {
+		compatible = "mtd-concat";
+		devices = <&fwconcat0 &fwconcat1>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				reg = <0x0 0x0>;
+				label = "firmware";
+				compatible = "openwrt,uimage", "denx,uimage";
+				openwrt,ih-magic = <IH_MAGIC_OKLI>;
+			};
+		};
+	};
+};
+
+&partitions {
+	fwconcat0: partition at 50000 {
+		label = "fwconcat0";
+		reg = <0x050000 0x630000>;
+	};
+
+	partition at 680000 {
+		label = "loader";
+		reg = <0x680000 0x10000>;
+	};
+
+	fwconcat1: partition at 690000 {
+		label = "fwconcat1";
+		reg = <0x690000 0x160000>;
+	};
+
+	art: partition at 7f0000 {
+		label = "art";
+		reg = <0x7f0000 0x010000>;
+		read-only;
+	};
+};
diff --git a/target/linux/ath79/dts/qca9533_qca_ap143.dtsi b/target/linux/ath79/dts/qca9533_qca_ap143.dtsi
new file mode 100644
index 0000000000..95a24175a5
--- /dev/null
+++ b/target/linux/ath79/dts/qca9533_qca_ap143.dtsi
@@ -0,0 +1,125 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qca953x.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/mtd/partitions/uimage.h>
+
+/ {
+	aliases {
+		led-boot = &led_wps;
+		led-failsafe = &led_wps;
+		led-running = &led_wps;
+		led-upgrade = &led_wps;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		wan {
+			label = "green:wan";
+			gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
+		};
+
+		wlan {
+			label = "green:wlan";
+			gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy0tpt";
+		};
+
+		lan1 {
+			label = "green:lan1";
+			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+		};
+
+		lan2 {
+			label = "green:lan2";
+			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+		};
+
+		lan3 {
+			label = "green:lan3";
+			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+		};
+
+		lan4 {
+			label = "green:lan4";
+			gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
+		};
+
+		led_wps: wps {
+			label = "green:wps";
+			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		wps {
+			label = "WPS button";
+			linux,code = <KEY_WPS_BUTTON>;
+			gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+			debounce-interval = <60>;
+		};
+	};
+};
+
+&spi {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <25000000>;
+
+		partitions: partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x000000 0x040000>;
+				read-only;
+			};
+
+			partition at 40000 {
+				label = "u-boot-env";
+				reg = <0x040000 0x010000>;
+				read-only;
+			};
+		};
+	};
+};
+
+&eth0 {
+	status = "okay";
+
+	mtd-mac-address = <&art 0x0>;
+
+	phy-handle = <&swphy4>;
+};
+
+&eth1 {
+	mtd-mac-address = <&art 0x6>;
+
+	gmac-config {
+		device = <&gmac>;
+	};
+};
+
+&wmac {
+	status = "okay";
+
+	mtd-cal-data = <&art 0x1000>;
+};
+
+&usb0 {
+	status = "okay";
+};
+
+&usb_phy {
+	status = "okay";
+};
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
index 1990353394..8ead3ec0a3 100644
--- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
@@ -260,6 +260,14 @@ pcs,cr3000)
 	ucidef_set_led_switch "lan3" "LAN3" "blue:lan3" "switch0" "0x10"
 	ucidef_set_led_switch "lan4" "LAN4" "blue:lan4" "switch0" "0x02"
 	;;
+qca,ap143-8m|\
+qca,ap143-16m)
+	ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
+	ucidef_set_led_switch "lan1" "LAN1" "green:lan1" "switch0" "0x02"
+	ucidef_set_led_switch "lan2" "LAN2" "green:lan2" "switch0" "0x04"
+	ucidef_set_led_switch "lan3" "LAN3" "green:lan3" "switch0" "0x08"
+	ucidef_set_led_switch "lan4" "LAN4" "green:lan4" "switch0" "0x10"
+	;;
 qihoo,c301)
 	ucidef_set_led_wlan "wlan" "WLAN" "green:wlan" "phy0tpt"
 	;;
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 87aaf0bcad..8ea52af67a 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
@@ -192,7 +192,9 @@ ath79_setup_interfaces()
 		ucidef_add_switch "switch0" \
 			"0 at eth0" "1:wan" "2:lan"
 		;;
-	comfast,cf-e560ac)
+	comfast,cf-e560ac|\
+	qca,ap143-8m|\
+	qca,ap143-16m)
 		ucidef_set_interface_wan "eth1"
 		ucidef_add_switch "switch0" \
 			"0 at eth0" "1:lan" "2:lan" "3:lan" "4:lan"
diff --git a/target/linux/ath79/image/Makefile b/target/linux/ath79/image/Makefile
index 3c126f479e..aa8665fbb2 100644
--- a/target/linux/ath79/image/Makefile
+++ b/target/linux/ath79/image/Makefile
@@ -48,6 +48,10 @@ define Build/append-loader-okli
 	cat "$(KDIR)/loader-$(word 1,$(1)).$(LOADER_TYPE)" >> "$@"
 endef
 
+define Build/append-loader-okli-uimage
+	cat "$(KDIR)/loader-$(word 1,$(1)).uImage" >> "$@"
+endef
+
 define Build/relocate-kernel
 	rm -rf $@.relocate
 	$(CP) ../../generic/image/relocate $@.relocate
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 86aae57266..4d3f455e49 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -1900,6 +1900,43 @@ define Device/plasmacloud_pa300e
 endef
 TARGET_DEVICES += plasmacloud_pa300e
 
+define Device/qca_ap143
+  SOC := qca9533
+  DEVICE_VENDOR := Qualcomm Atheros
+  DEVICE_MODEL := AP143
+  DEVICE_PACKAGES := kmod-usb2
+  SUPPORTED_DEVICES += ap143
+  LOADER_TYPE := bin
+  LOADER_FLASH_OFFS := 0x50000
+  KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49
+  COMPILE := loader-$(1).bin loader-$(1).uImage
+  COMPILE/loader-$(1).bin := loader-okli-compile
+  COMPILE/loader-$(1).uImage := append-loader-okli $(1) | pad-to 64k | lzma | \
+	uImage lzma
+endef
+
+define Device/qca_ap143-8m
+  $(Device/qca_ap143)
+  DEVICE_VARIANT := (8M)
+  IMAGE_SIZE := 7744k
+  IMAGES += factory.bin
+  IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
+	append-rootfs | pad-rootfs | check-size | pad-to 6336k | \
+	append-loader-okli-uimage $(1) | pad-to 64k
+endef
+TARGET_DEVICES += qca_ap143-8m
+
+define Device/qca_ap143-16m
+  $(Device/qca_ap143)
+  DEVICE_VARIANT := (16M)
+  IMAGE_SIZE := 15936k
+  IMAGES += factory.bin
+  IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
+	append-rootfs | pad-rootfs | check-size | pad-to 14528k | \
+	append-loader-okli-uimage $(1) | pad-to 64k
+endef
+TARGET_DEVICES += qca_ap143-16m
+
 define Device/qihoo_c301
   $(Device/seama)
   SOC := ar9344


From lede-commits at lists.infradead.org  Fri Jun  4 21:53:37 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 00:53:37 -0400
Subject: [openwrt/openwrt] hostapd: configure inter-AP communication
 interface for 802.11r
In-Reply-To: <162286881722.31794.3328414021958038072@git-01.infra.openwrt.org>
References: <162286881722.31794.3328414021958038072@git-01.infra.openwrt.org>
Message-ID: <mailman.3283.1622868825.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/305c1b8d746b363f655c2f8d5a6497cca10a5d4e

commit 305c1b8d746b363f655c2f8d5a6497cca10a5d4e
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri Jun 4 09:12:07 2021 +0200

    hostapd: configure inter-AP communication interface for 802.11r
    
    In setups using VLAN bridge filtering, hostapd may need to communicate using
    a VLAN interface on top of the bridge, instead of using the bridge directly
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/network/services/hostapd/files/hostapd.sh  |  1 +
 .../services/hostapd/patches/730-ft_iface.patch    | 38 ++++++++++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 1fa22cb69e..cf85019d56 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -805,6 +805,7 @@ hostapd_set_bss_options() {
 				;;
 			esac
 
+			[ -n "$network_ifname" ] && append bss_conf "ft_iface=$network_ifname" "$N"
 			append bss_conf "mobility_domain=$mobility_domain" "$N"
 			append bss_conf "ft_psk_generate_local=$ft_psk_generate_local" "$N"
 			append bss_conf "ft_over_ds=$ft_over_ds" "$N"
diff --git a/package/network/services/hostapd/patches/730-ft_iface.patch b/package/network/services/hostapd/patches/730-ft_iface.patch
new file mode 100644
index 0000000000..793e8e0194
--- /dev/null
+++ b/package/network/services/hostapd/patches/730-ft_iface.patch
@@ -0,0 +1,38 @@
+--- a/hostapd/config_file.c
++++ b/hostapd/config_file.c
+@@ -3031,6 +3031,8 @@ static int hostapd_config_fill(struct ho
+ 		wpa_printf(MSG_INFO,
+ 			   "Line %d: Obsolete peerkey parameter ignored", line);
+ #ifdef CONFIG_IEEE80211R_AP
++	} else if (os_strcmp(buf, "ft_iface") == 0) {
++		os_strlcpy(bss->ft_iface, pos, sizeof(bss->ft_iface));
+ 	} else if (os_strcmp(buf, "mobility_domain") == 0) {
+ 		if (os_strlen(pos) != 2 * MOBILITY_DOMAIN_ID_LEN ||
+ 		    hexstr2bin(pos, bss->mobility_domain,
+--- a/src/ap/ap_config.h
++++ b/src/ap/ap_config.h
+@@ -277,6 +277,7 @@ struct airtime_sta_weight {
+ struct hostapd_bss_config {
+ 	char iface[IFNAMSIZ + 1];
+ 	char bridge[IFNAMSIZ + 1];
++	char ft_iface[IFNAMSIZ + 1];
+ 	char vlan_bridge[IFNAMSIZ + 1];
+ 	char wds_bridge[IFNAMSIZ + 1];
+ 
+--- a/src/ap/wpa_auth_glue.c
++++ b/src/ap/wpa_auth_glue.c
+@@ -1565,8 +1565,12 @@ int hostapd_setup_wpa(struct hostapd_dat
+ 	    wpa_key_mgmt_ft(hapd->conf->wpa_key_mgmt)) {
+ 		const char *ft_iface;
+ 
+-		ft_iface = hapd->conf->bridge[0] ? hapd->conf->bridge :
+-			   hapd->conf->iface;
++		if (hapd->conf->ft_iface[0])
++			ft_iface = hapd->conf->ft_iface;
++		else if (hapd->conf->bridge[0])
++			ft_iface = hapd->conf->bridge;
++		else
++			ft_iface = hapd->conf->iface;
+ 		hapd->l2 = l2_packet_init(ft_iface, NULL, ETH_P_RRB,
+ 					  hostapd_rrb_receive, hapd, 1);
+ 		if (!hapd->l2) {


From lede-commits at lists.infradead.org  Sat Jun  5 14:30:04 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 17:30:04 -0400
Subject: [openwrt/openwrt]  ipq40xx: add netgear wac510 support
In-Reply-To: <162292860476.16889.2241056893558829203@git-01.infra.openwrt.org>
References: <162292860476.16889.2241056893558829203@git-01.infra.openwrt.org>
Message-ID: <mailman.3317.1622928612.434944.lede-commits@lists.infradead.org>

chunkeey pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/b126d9c3a3d3c8fe0937bcdfffabe8df941d2c06

commit b126d9c3a3d3c8fe0937bcdfffabe8df941d2c06
Author: Robert Marko <robimarko at gmail.com>
AuthorDate: Wed Nov 25 14:23:58 2020 +0100

    ipq40xx: add netgear wac510 support
    
    This adds support for the Netgear WAC510 Insight Managed Smart Cloud
    Wireless Access Point, an indoor dual-band, dual-radio 802.11ac
    business-class wireless AP with integrated omnidirectional antennae
    and two 10/100/1000 Mbps Ethernet ports.
    
    For more information see:
    <https://www.netgear.com/business/wifi/access-points/wac510>
    
    Specifications:
    SoC:        Qualcomm IPQ4018 (DAKOTA) ARM Quad-Core
    RAM:        256 MiB
    Flash1:     2 MiB Winbond W25Q16JV SPI-NOR
    Flash2:     128 MiB Winbond W25N01GVZEIG SPI-NAND
    Ethernet:   Built-in IPQ4018 (SoC, QCA8072 PHY), 2x 1000/100/10 port,
                WAN port active IEEE 802.3af/at PoE in
    Wireless1:  Built-in IPQ4018 (SoC) 802.11b/g/n 2x2:2, 3 dBi antennae
    Wireless2:  Built-in IPQ4018 (SoC) 802.11a/n/ac 2x2:2, 4 dBi antennae
    Input:      (Optional) Barrel 12 V 2.5 A Power, Reset button SW1
    LEDs:       Power, Insight, WAN PoE, LAN, 2.4G WLAN, 5G WLAN
    Serial:     Header J2
    1 - 3.3 Volt (Do NOT connect!)
    2 - TX
    3 - RX
    4 - Ground
    WARNING: The serial port needs a TTL/RS-232 3.3 volt level converter!
             The Serial settings are 115200-8-N-1.
    
    Installation via Stock Web Interface:
    BTW: The default factory console/web interface login user/password are
    admin/password.
    
    In the web interface navigating to Management - Maintenance - Upgrade -
    'Firmware Upgrade' will show you what is currently installed e.g.:
    Manage Firmware
    Current Firmware Version: V5.0.10.2
    Backup Firmware Version: V1.2.5.11
    Under 'Upgrade Options' choose Local (alternatively SFTP would be
    available) then click/select 'Browse File' on the right side, choose
    openwrt-ipq40xx-generic-netgear_wac510-squashfs-nand-factory.tar
    and hit the Upgrade button below. After a minute or two your browser
    should indicate completion printing 'Firmware update complete.' and
    'Rebooting AP...'.
    
    Note that OpenWrt will use the WAN PoE port as actual WAN port
    defaulting to DHCP client but NOT allowing LuCI access, use LAN port
    defaulting to 192.168.1.1/24 to access LuCI.
    
    Installation via TFTP Requiring Serial U-Boot Access:
    Connect to the device's serial port and hit any key to stop autoboot.
    Upload and boot the initramfs based OpenWrt image as follows:
    (IPQ40xx) # setenv serverip 192.168.1.1
    (IPQ40xx) # setenv ipaddr 192.168.1.2
    (IPQ40xx) # tftpboot openwrt-ipq40xx-generic-netgear_wac510-initramfs-fit-uImage.itb
    (IPQ40xx) # bootm
    
    Note: This only runs OpenWrt from RAM and has not installed anything
    to flash as of yet. One may permanently install OpenWrt as follows:
    
    Check the MTD device number of the active partition:
    root at OpenWrt:/# dmesg | grep 'set to be root filesystem'
    [    1.010084] mtd: device 9 (rootfs) set to be root filesystem
    Upload the factory image ending with .ubi to /tmp (e.g. using scp or
    tftp). Then flash the image as follows (substituting the 9 in mtd9
    below with whatever number reported above):
    root at OpenWrt:/# ubiformat /dev/mtd9 -f /tmp/openwrt-ipq40xx-generic-netgear_wac510-squashfs-nand-factory.ubi
    And reboot.
    
    Dual Image Configuration:
    The default U-Boot boot command bootipq uses the U-Boot environment
    variables primary/secondary to decide which image to boot. E.g.
    primary=0, secondary=3800000 uses rootfs while primary=3800000,
    secondary=0 uses rootfs_1.
    Switching their values changes the active partition. E.g. from within
    U-Boot:
    (IPQ40xx) # setenv primary 0
    (IPQ40xx) # setenv secondary 3800000
    (IPQ40xx) # saveenv
    Or from a OpenWrt userspace serial/SSH console:
    fw_setenv primary 0
    fw_setenv secondary 3800000
    Note that if you install two copies of OpenWrt then each will have its
    independent configuration not like when switching partitions on the
    stock firmware.
    BTW: The kernel log shows which boot partition is active:
    [    2.439050] ubi0: attached mtd9 (name "rootfs", size 56 MiB)
    vs.
    [    2.978785] ubi0: attached mtd10 (name "rootfs_1", size 56 MiB)
    Note: After 3 failed boot attempts it automatically switches partition.
    
    Signed-off-by: Robert Marko <robimarko at gmail.com>
    Signed-off-by: Marcel Ziswiler <marcel at ziswiler.com>
    [squashed netgear-tar commit into main and rename netgear-tar for
    now, until it is made generic.]
    Signed-off-by: Christian Lamparter <chunkeey at gmail.com>
---
 package/boot/uboot-envtools/files/ipq40xx          |   1 +
 package/firmware/ipq-wifi/Makefile                 |   2 +
 .../ipq40xx/base-files/etc/board.d/02_network      |   1 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata       |   8 +
 .../linux/ipq40xx/base-files/etc/init.d/bootcount  |   3 +
 .../ipq40xx/base-files/lib/upgrade/platform.sh     |   1 +
 .../arch/arm/boot/dts/qcom-ipq4018-wac510.dts      | 371 +++++++++++++++++++++
 target/linux/ipq40xx/image/generic.mk              |  25 ++
 .../patches-5.4/901-arm-boot-add-dts-files.patch   |   3 +-
 9 files changed, 414 insertions(+), 1 deletion(-)

diff --git a/package/boot/uboot-envtools/files/ipq40xx b/package/boot/uboot-envtools/files/ipq40xx
index 88390f534c..1462aa991d 100644
--- a/package/boot/uboot-envtools/files/ipq40xx
+++ b/package/boot/uboot-envtools/files/ipq40xx
@@ -36,6 +36,7 @@ edgecore,ecw5211|\
 glinet,gl-ap1300|\
 glinet,gl-b1300|\
 luma,wrtq-329acn|\
+netgear,wac510|\
 openmesh,a42|\
 openmesh,a62|\
 plasmacloud,pa1200|\
diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
index e3b25bb556..e63e3b3ba1 100644
--- a/package/firmware/ipq-wifi/Makefile
+++ b/package/firmware/ipq-wifi/Makefile
@@ -47,6 +47,7 @@ ALLWIFIBOARDS:= \
 	mikrotik_sxtsq-5-ac \
 	mobipromo_cm520-79f \
 	nec_wg2600hp3 \
+	netgear_wac510 \
 	plasmacloud_pa1200 \
 	plasmacloud_pa2200 \
 	qxwlan_e2600ac
@@ -132,6 +133,7 @@ $(eval $(call generate-ipq-wifi-package,mikrotik_hap-ac2,Mikrotik hAP ac2))
 $(eval $(call generate-ipq-wifi-package,mikrotik_sxtsq-5-ac,MikroTik SXTsq 5 ac))
 $(eval $(call generate-ipq-wifi-package,mobipromo_cm520-79f,MobiPromo CM520-79F))
 $(eval $(call generate-ipq-wifi-package,nec_wg2600hp3,NEC Platforms WG2600HP3))
+$(eval $(call generate-ipq-wifi-package,netgear_wac510,Netgear WAC510))
 $(eval $(call generate-ipq-wifi-package,plasmacloud_pa1200,Plasma Cloud PA1200))
 $(eval $(call generate-ipq-wifi-package,plasmacloud_pa2200,Plasma Cloud PA2200))
 $(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac,Qxwlan E2600AC))
diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network
index 6a94fe3ff4..ecdbac8f86 100644
--- a/target/linux/ipq40xx/base-files/etc/board.d/02_network
+++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network
@@ -17,6 +17,7 @@ ipq40xx_setup_interfaces()
 	engenius,emr3500|\
 	engenius,ens620ext|\
 	luma,wrtq-329acn|\
+	netgear,wac510|\
 	plasmacloud,pa1200|\
 	plasmacloud,pa2200)
 		ucidef_set_interfaces_lan_wan "eth0" "eth1"
diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index b12c9af9a7..42cb295496 100644
--- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -150,6 +150,10 @@ case "$FIRMWARE" in
 		caldata_extract "ART" 0x1000 0x2f20
 		ath10k_patch_mac $(mtd_get_mac_binary dnidata 0x0)
 		;;
+	netgear,wac510)
+		caldata_extract "0:ART" 0x1000 0x2f20
+		ath10k_patch_mac $(mtd_get_mac_binary "0:MANUDATA" 0x6)
+		;;
 	zyxel,nbg6617 |\
 	zyxel,wre6606)
 		caldata_extract "ART" 0x1000 0x2f20
@@ -260,6 +264,10 @@ case "$FIRMWARE" in
 		caldata_extract "ART" 0x5000 0x2f20
 		ath10k_patch_mac $(mtd_get_mac_binary dnidata 0xc)
 		;;
+	netgear,wac510)
+		caldata_extract "0:ART" 0x5000 0x2f20
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary "0:MANUDATA" 0x6) +16)
+		;;
 	zyxel,nbg6617 |\
 	zyxel,wre6606)
 		caldata_extract "ART" 0x5000 0x2f20
diff --git a/target/linux/ipq40xx/base-files/etc/init.d/bootcount b/target/linux/ipq40xx/base-files/etc/init.d/bootcount
index d2a4abcadd..9abfbddc43 100755
--- a/target/linux/ipq40xx/base-files/etc/init.d/bootcount
+++ b/target/linux/ipq40xx/base-files/etc/init.d/bootcount
@@ -13,5 +13,8 @@ boot() {
 	linksys,mr8300)
 		mtd resetbc s_env || true
 		;;
+	netgear,wac510)
+		fw_setenv boot_cnt=0
+		;;
 	esac
 }
diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
index 54683977cd..68027be666 100644
--- a/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq40xx/base-files/lib/upgrade/platform.sh
@@ -72,6 +72,7 @@ platform_do_upgrade() {
 	glinet,gl-ap1300 |\
 	luma,wrtq-329acn |\
 	mobipromo,cm520-79f |\
+	netgear,wac510 |\
 	qxwlan,e2600ac-c2)
 		nand_do_upgrade "$1"
 		;;
diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wac510.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wac510.dts
new file mode 100644
index 0000000000..20e12855f4
--- /dev/null
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-wac510.dts
@@ -0,0 +1,371 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2020, Robert Marko <robimarko at gmail.com> */
+
+#include "qcom-ipq4019.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/soc/qcom,tcsr.h>
+
+/ {
+	model = "Netgear WAC510";
+	compatible = "netgear,wac510";
+
+	aliases {
+		led-boot = &led_power_amber;
+		led-failsafe = &led_power_amber;
+		led-running = &led_power_green;
+		led-upgrade = &led_power_amber;
+		label-mac-device = &gmac0;
+	};
+
+	chosen {
+		bootargs-append = " root=/dev/ubiblock0_1";
+	};
+
+	soc {
+		rng at 22000 {
+			status = "okay";
+		};
+
+		ess-psgmii at 98000 {
+			status = "okay";
+		};
+
+		counter at 4a1000 {
+			compatible = "qcom,qca-gcnt";
+			reg = <0x4a1000 0x4>;
+		};
+
+		tcsr at 1949000 {
+			compatible = "qcom,tcsr";
+			reg = <0x1949000 0x100>;
+			qcom,wifi_glb_cfg = <TCSR_WIFI_GLB_CFG>;
+		};
+
+		tcsr at 194b000 {
+			status = "okay";
+
+			compatible = "qcom,tcsr";
+			reg = <0x194b000 0x100>;
+			qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>;
+		};
+
+		ess_tcsr at 1953000 {
+			compatible = "qcom,tcsr";
+			reg = <0x1953000 0x1000>;
+			qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
+		};
+
+		tcsr at 1957000 {
+			compatible = "qcom,tcsr";
+			reg = <0x1957000 0x100>;
+			qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>;
+		};
+
+		usb2: usb2 at 60f8800 {
+			status = "okay";
+		};
+
+		usb3: usb3 at 8af8800 {
+			status = "okay";
+		};
+
+		crypto at 8e3a000 {
+			status = "okay";
+		};
+
+		watchdog at b017000 {
+			status = "okay";
+		};
+
+		ess-switch at c000000 {
+			status = "okay";
+		};
+
+		edma at c080000 {
+			status = "okay";
+		};
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&tlmm 63 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	led_spi {
+		compatible = "spi-gpio";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		sck-gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>;
+		mosi-gpios = <&tlmm 4 GPIO_ACTIVE_HIGH>;
+		num-chipselects = <0>;
+
+		ssr: ssr at 0 {
+			compatible = "fairchild,74hc595";
+			reg = <0>;
+			gpio-controller;
+			#gpio-cells = <2>;
+			registers-number = <1>;
+			spi-max-frequency = <1000000>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_power_amber: power_amber {
+			label = "amber:power";
+			gpios = <&ssr 6 GPIO_ACTIVE_LOW>;
+			panic-indicator;
+		};
+
+		led_power_green: power_green {
+			label = "green:power";
+			gpios = <&ssr 5 GPIO_ACTIVE_LOW>;
+		};
+
+		wlan2g_blue {
+			label = "blue:wlan2g";
+			gpios = <&ssr 4 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy0tpt";
+		};
+
+		wlan2g_green {
+			label = "green:wlan2g";
+			gpios = <&ssr 3 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy0radio";
+		};
+
+		wlan5g_blue {
+			label = "blue:wlan5g";
+			gpios = <&ssr 2 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy1tpt";
+		};
+
+		wlan5g_green {
+			label = "green:wlan5g";
+			gpios = <&ssr 1 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy1radio";
+		};
+
+		act_green {
+			label = "green:act";
+			gpios = <&ssr 0 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&qpic_bam {
+	status = "okay";
+};
+
+&tlmm {
+	mdio_pins: mdio_pinmux {
+		mux_1 {
+			pins = "gpio53";
+			function = "mdio";
+			bias-pull-up;
+		};
+
+		mux_2 {
+			pins = "gpio52";
+			function = "mdc";
+			bias-pull-up;
+		};
+	};
+
+	serial_pins: serial_pinmux {
+		mux {
+			pins = "gpio60", "gpio61";
+			function = "blsp_uart0";
+			bias-disable;
+		};
+	};
+
+	spi_0_pins: spi_0_pinmux {
+		pinmux {
+			function = "blsp_spi0";
+			pins = "gpio55", "gpio56", "gpio57";
+			drive-strength = <12>;
+			bias-disable;
+		};
+
+		pinmux_cs {
+			function = "gpio";
+			pins = "gpio54", "gpio59";
+			drive-strength = <2>;
+			bias-disable;
+			output-high;
+		};
+	};
+};
+
+&blsp_dma {
+	status = "okay";
+};
+
+&blsp1_spi1 {
+	status = "okay";
+
+	pinctrl-0 = <&spi_0_pins>;
+	pinctrl-names = "default";
+	cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>,
+		   <&tlmm 59 GPIO_ACTIVE_HIGH>;
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		spi-max-frequency = <50000000>;
+		reg = <0>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "0:SBL1";
+				reg = <0x00000000 0x00040000>;
+				read-only;
+			};
+
+			partition at 40000 {
+				label = "0:MIBIB";
+				reg = <0x00040000 0x00020000>;
+				read-only;
+			};
+
+			partition at 60000 {
+				label = "0:QSEE";
+				reg = <0x00060000 0x00060000>;
+				read-only;
+			};
+
+			partition at c0000 {
+				label = "0:CDT";
+				reg = <0x000c0000 0x00010000>;
+				read-only;
+			};
+
+			partition at d0000 {
+				label = "0:DDRPARAMS";
+				reg = <0x000d0000 0x00010000>;
+				read-only;
+			};
+
+			partition at e0000 {
+				label = "0:APPSBLENV";
+				reg = <0x000e0000 0x00010000>;
+			};
+
+			partition at f0000 {
+				label = "0:APPSBL";
+				reg = <0x000f0000 0x000f0000>;
+				read-only;
+			};
+
+			partition at 1e0000 {
+				label = "0:MANUDATA";
+				reg = <0x001e0000 0x00010000>;
+				read-only;
+			};
+
+			partition at 1f0000 {
+				label = "0:ART";
+				reg = <0x001f0000 0x00010000>;
+				read-only;
+			};
+		};
+	};
+
+	nand at 1 {
+		compatible = "spi-nand";
+		reg = <1>;
+		spi-max-frequency = <48000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "rootfs";
+				reg = <0x00000000 0x03800000>;
+			};
+
+			partition at 3800000 {
+				label = "rootfs_1";
+				reg = <0x03800000 0x03800000>;
+			};
+
+			partition at 7000000 {
+				label = "var_config";
+				reg = <0x07000000 0x00f00000>;
+				read-only;
+			};
+
+			partition at 7f00000 {
+				label = "Oops_log";
+				reg = <0x07f00000 0x000c0000>;
+				read-only;
+			};
+		};
+	};
+};
+
+&blsp1_uart1 {
+	status = "okay";
+
+	pinctrl-0 = <&serial_pins>;
+	pinctrl-names = "default";
+};
+
+&cryptobam {
+	status = "okay";
+};
+
+&mdio {
+	status = "okay";
+
+	pinctrl-0 = <&mdio_pins>;
+	pinctrl-names = "default";
+	reset-gpios = <&tlmm 62 GPIO_ACTIVE_LOW>;
+	reset-delay-us = <2000>;
+};
+
+&gmac0 {
+	qcom,forced_duplex = <1>;
+	qcom,forced_speed = <1000>;
+	qcom,phy_mdio_addr = <3>;
+	qcom,poll_required = <1>;
+	vlan_tag = <1 0x10>;
+};
+
+&wifi0 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-WAC510";
+};
+
+&wifi1 {
+	status = "okay";
+
+	qcom,ath10k-calibration-variant = "Netgear-WAC510";
+};
+
+&usb3_ss_phy {
+	status = "okay";
+};
+
+&usb3_hs_phy {
+	status = "okay";
+};
+
+&usb2_hs_phy {
+	status = "okay";
+};
diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk
index 4e40b8be50..2d6186ed99 100644
--- a/target/linux/ipq40xx/image/generic.mk
+++ b/target/linux/ipq40xx/image/generic.mk
@@ -62,6 +62,16 @@ define Build/mkmylofw_32m
 	@mv $@.new $@
 endef
 
+define Build/wac5xx-netgear-tar
+	mkdir $@.tmp
+	mv $@ $@.tmp/wac5xx-ubifs-root.img
+	md5sum $@.tmp/wac5xx-ubifs-root.img > $@.tmp/wac5xx-ubifs-root.md5sum
+	echo "WAC505 WAC510" > $@.tmp/metadata.txt
+	echo "WAC505_V9.9.9.9" > $@.tmp/version
+	tar -C $@.tmp/ -cf $@ .
+	rm -rf $@.tmp
+endef
+
 define Build/qsdk-ipq-factory-nand-askey
 	$(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh $@.its\
 		askey_kernel $(IMAGE_KERNEL) \
@@ -636,6 +646,21 @@ define Device/netgear_ex6150v2
 endef
 TARGET_DEVICES += netgear_ex6150v2
 
+define Device/netgear_wac510
+	$(call Device/FitImage)
+	$(call Device/UbiFit)
+	DEVICE_VENDOR := Netgear
+	DEVICE_MODEL := WAC510
+	SOC := qcom-ipq4018
+	DEVICE_DTS_CONFIG := config at 5
+	BLOCKSIZE := 128k
+	PAGESIZE := 2048
+	IMAGES += nand-factory.tar
+	IMAGE/nand-factory.tar := append-ubi | wac5xx-netgear-tar
+	DEVICE_PACKAGES := uboot-envtools
+endef
+TARGET_DEVICES += netgear_wac510
+
 define Device/openmesh_a42
 	$(call Device/FitImageLzma)
 	DEVICE_VENDOR := OpenMesh
diff --git a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch
index 6b7c68bf63..0447fb6012 100644
--- a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch
+++ b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch
@@ -10,7 +10,7 @@ Signed-off-by: John Crispin <john at phrozen.org>
 
 --- a/arch/arm/boot/dts/Makefile
 +++ b/arch/arm/boot/dts/Makefile
-@@ -837,11 +837,60 @@ dtb-$(CONFIG_ARCH_QCOM) += \
+@@ -837,11 +837,61 @@ dtb-$(CONFIG_ARCH_QCOM) += \
  	qcom-apq8074-dragonboard.dtb \
  	qcom-apq8084-ifc6540.dtb \
  	qcom-apq8084-mtp.dtb \
@@ -37,6 +37,7 @@ Signed-off-by: John Crispin <john at phrozen.org>
 +	qcom-ipq4019-oap100.dtb \
 +	qcom-ipq4018-pa1200.dtb \
 +	qcom-ipq4018-rt-ac58u.dtb \
++	qcom-ipq4018-wac510.dtb \
 +	qcom-ipq4018-wre6606.dtb \
 +	qcom-ipq4018-wrtq-329acn.dtb \
  	qcom-ipq4019-ap.dk01.1-c1.dtb \


From lede-commits at lists.infradead.org  Sat Jun  5 15:00:18 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:00:18 -0400
Subject: [openwrt/openwrt]  ramips: add support for Linksys E5600
In-Reply-To: <162293041808.3290.17303673137518839373@git-01.infra.openwrt.org>
References: <162293041808.3290.17303673137518839373@git-01.infra.openwrt.org>
Message-ID: <mailman.3320.1622930424.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/251c995cbb1ea5ad1de14775312c2bd19ed10439

commit 251c995cbb1ea5ad1de14775312c2bd19ed10439
Author: Aashish Kulkarni <aashishkul at gmail.com>
AuthorDate: Tue Mar 2 10:40:14 2021 +0530

    ramips: add support for Linksys E5600
    
    This submission relied heavily on the work of Linksys EA7300 v1/ v2.
    
    Specifications:
    
    * SoC: MediaTek MT7621A (880 MHz 2c/4t)
    * RAM: 128M DDR3-1600
    * Flash: 128M NAND
    * Eth: MediaTek MT7621A (10/100/1000 Mbps x5)
    * Radio: MT7603E/MT7613BE (2.4 GHz & 5 GHz)
    * Antennae: 2 internal fixed in the casing and 2 on the PCB
    * LEDs: Blue (x4 Ethernet)
      Blue+Orange (x2 Power + WPS and Internet)
    * Buttons: Reset (x1)
      WPS (x1)
    
    Installation:
    
    Flash factory image through GUI.
    
    This device has 2 partitions for the firmware called firmware and
    alt_firmware. To successfully flash and boot the device, the device
    should have been running from alt_firmware partition. To get the device
    booted through alt_firmware partition, download the OEM firmware from
    Linksys website and upgrade the firmware from web GUI. Once this is done,
    flash the OpenWrt Factory firmware from web GUI.
    
    Reverting to factory firmware:
    
    1. Boot to 'alt_firmware'(where stock firmware resides) by doing one of
       the following:
       Press the "wps" button as soon as power LED turns on when booting.
       (OR) Hard-reset the router consecutively three times to force it to
       boot from 'alt_firmware'.
    2. To remove any traces of OpenWRT from your router simply flash the OEM
       image at this point.
    
    Signed-off-by: Aashish Kulkarni <aashishkul at gmail.com>
    
    [fix hanging indents and wrap to 74 characters per line,
     add kmod-mt7663-firmware-sta package for 5GHz STA mode to work,
     remove sysupgrade.bin and concatenate IMAGES instead in mt7621.mk,
     set default-state "on" for power LED]
    Signed-off-by: Sannihith Kinnera <digislayer at protonmail.com>
    
    [move check-size before append-metadata, remove trailing whitespace]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 target/linux/ramips/dts/mt7621_linksys_e5600.dts   | 182 +++++++++++++++++++++
 target/linux/ramips/image/mt7621.mk                |  23 +++
 .../ramips/mt7621/base-files/etc/board.d/01_leds   |   3 +
 .../mt7621/base-files/etc/board.d/02_network       |   1 +
 .../etc/hotplug.d/ieee80211/10_fix_wifi_mac        |   1 +
 .../ramips/mt7621/base-files/etc/init.d/bootcount  |   1 +
 .../mt7621/base-files/lib/upgrade/platform.sh      |   1 +
 7 files changed, 212 insertions(+)

diff --git a/target/linux/ramips/dts/mt7621_linksys_e5600.dts b/target/linux/ramips/dts/mt7621_linksys_e5600.dts
new file mode 100644
index 0000000000..91db315914
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_linksys_e5600.dts
@@ -0,0 +1,182 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "linksys,e5600", "mediatek,mt7621-soc";
+	model = "Linksys E5600";
+
+	aliases {
+		led-boot = &led_power;
+		led-failsafe = &led_power;
+		led-running = &led_power;
+		led-upgrade = &led_power;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		wps {
+			label = "amber:wps";
+			gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_power: power {
+			label = "blue:power";
+			gpios = <&gpio 10 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
+		};
+
+		wan_amber {
+			label = "amber:wan";
+			gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
+		};
+
+		wan_blue {
+			label = "blue:wan";
+			gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
+		};
+	};
+};
+
+&nand {
+	status = "okay";
+
+	partitions {
+		compatible = "fixed-partitions";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition at 0 {
+			label = "boot";
+			reg = <0x0 0x80000>;
+			read-only;
+		};
+
+		partition at 80000 {
+			label = "u_env";
+			reg = <0x80000 0x40000>;
+			read-only;
+		};
+
+		factory: partition at c0000 {
+			label = "factory";
+			reg = <0xc0000 0x40000>;
+			read-only;
+		};
+
+		partition at 100000 {
+			label = "s_env";
+			reg = <0x100000 0x40000>;
+		};
+
+		partition at 140000 {
+			label = "devinfo";
+			reg = <0x140000 0x40000>;
+			read-only;
+		};
+
+		partition at 180000 {
+			label = "kernel";
+			reg = <0x180000 0x400000>;
+		};
+
+		partition at 580000 {
+			label = "ubi";
+			reg = <0x580000 0x1a00000>;
+		};
+
+		partition at 1f80000 {
+			label = "alt_firmware";
+			reg = <0x1f80000 0x1e00000>;
+		};
+
+		partition at 3d80000 {
+			label = "gdata";
+			reg = <0x3d80000 0x4200000>;
+		};
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "uart2", "uart3", "jtag";
+		function = "gpio";
+	};
+};
+
+&pcie {
+	status = "okay";
+};
+
+&pcie0 {
+	mt76 at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x0000>;
+	};
+};
+
+&pcie1 {
+	mt76 at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x8000>;
+	};
+};
+
+&switch0 {
+	ports {
+		port at 0 {
+			status = "okay";
+			label = "lan1";
+		};
+
+		port at 1 {
+			status = "okay";
+			label = "lan2";
+		};
+
+		port at 2 {
+			status = "okay";
+			label = "lan3";
+		};
+
+		port at 3 {
+			status = "okay";
+			label = "lan4";
+		};
+
+		port at 4 {
+			status = "okay";
+			label = "wan";
+		};
+	};
+};
+
+&xhci {
+	status = "disabled";
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 20433f783d..04f84ac1fe 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -22,6 +22,10 @@ define Build/elecom-wrc-gs-factory
 	mv $@.new $@
 endef
 
+define Build/gemtek-trailer
+	printf "%s%08X" ".GEMTEK." "$$(cksum $@ | cut -d ' ' -f1)" >> $@
+endef
+
 define Build/iodata-factory
 	$(eval fw_size=$(word 1,$(1)))
 	$(eval fw_type=$(word 2,$(1)))
@@ -762,6 +766,25 @@ define Device/lenovo_newifi-d1
 endef
 TARGET_DEVICES += lenovo_newifi-d1
 
+define Device/linksys_e5600
+  $(Device/dsa-migration)
+  $(Device/uimage-lzma-loader)
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  KERNEL_SIZE := 4096k
+  IMAGE_SIZE := 26624k
+  DEVICE_VENDOR := Linksys
+  DEVICE_MODEL := E5600
+  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap \
+	kmod-mt7663-firmware-sta uboot-envtools
+  UBINIZE_OPTS := -E 5
+  IMAGES += factory.bin
+  IMAGE/sysupgrade.bin := sysupgrade-tar | check-size | append-metadata
+  IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \
+	append-ubi | check-size | gemtek-trailer
+endef
+TARGET_DEVICES += linksys_e5600
+
 define Device/linksys_ea7xxx
   $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
index 427983e44b..9e67d458de 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
@@ -46,6 +46,9 @@ gnubee,gb-pc2)
 	ucidef_set_led_netdev "lan1" "lan1" "green:lan1" "lan1"
 	ucidef_set_led_netdev "lan2" "lan2" "green:lan2" "lan2"
 	;;
+linksys,e5600)
+	ucidef_set_led_netdev "wan" "wan link" "blue:wan" "wan" "link"
+	;;
 linksys,ea7300-v1|\
 linksys,ea7300-v2|\
 linksys,ea7500-v2)
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
index 9c946fa7f7..df69e1c432 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
@@ -127,6 +127,7 @@ ramips_setup_macs()
 	zbtlink,zbt-wg3526-32m)
 		label_mac=$(mtd_get_mac_binary factory 0x4)
 		;;
+	linksys,e5600|\
 	linksys,ea7300-v1|\
 	linksys,ea7300-v2|\
 	linksys,ea7500-v2)
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 427bde4e38..49b7f23ce9 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
@@ -18,6 +18,7 @@ case "$board" in
 		[ "$PHYNBR" = "1" ] && \
 			macaddr_setbit_la "$(mtd_get_mac_binary Factory 0x4)" > /sys${DEVPATH}/macaddress
 		;;
+	linksys,e5600|\
 	linksys,ea7300-v1|\
 	linksys,ea7300-v2|\
 	linksys,ea7500-v2)
diff --git a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
index a155458d3f..cfaa62485c 100755
--- a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
+++ b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
@@ -8,6 +8,7 @@ boot() {
 		[ -n "$(fw_printenv bootcount bootchanged 2>/dev/null)" ] &&\
 			echo -e "bootcount\nbootchanged\n" | /usr/sbin/fw_setenv -s -
 		;;
+	linksys,e5600|\
 	linksys,ea7300-v1|\
 	linksys,ea7300-v2|\
 	linksys,ea7500-v2)
diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
index 98e429fdbf..7b57ee7776 100755
--- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
@@ -50,6 +50,7 @@ platform_do_upgrade() {
 	dlink,dir-2660-a1|\
 	hiwifi,hc5962|\
 	jcg,q20|\
+	linksys,e5600|\
 	linksys,ea7300-v1|\
 	linksys,ea7300-v2|\
 	linksys,ea7500-v2|\


From lede-commits at lists.infradead.org  Sat Jun  5 15:00:24 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:00:24 -0400
Subject: [openwrt/openwrt] ath79: use dynamic partitioning for TP-Link CPE
 series
In-Reply-To: <162293041808.3290.17303673137518839373@git-01.infra.openwrt.org>
References: <162293041808.3290.17303673137518839373@git-01.infra.openwrt.org>
Message-ID: <mailman.3323.1622930424.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/7b9a0c264cb9dc2c5a946a0aa9a290427a5e559c

commit 7b9a0c264cb9dc2c5a946a0aa9a290427a5e559c
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Tue May 4 23:32:00 2021 -0400

    ath79: use dynamic partitioning for TP-Link CPE series
    
    CPExxx and WBSxxx boards with AR9344 SOC
    use the OKLI lzma kernel loader
    with the offset of 3 blocks of length 4k (0x3000)
    in order to have a fake "kernel" that cannot grow larger
    than how it is defined in the now static OEM partition table.
    
    Before recent changes to the mtdsplit driver,
    the uImage parser for OKLI only supported images
    that started exactly on an eraseblock boundary.
    
    The mtdsplit parser for uImage now supports identifying images
    with any magic number value
    and at any offset from the eraseblock boundary
    using DTS properties to define those values.
    
    So, it is no longer necessary to use fixed sizes
    for kernel and rootfs
    
    Tested-by: Andrew Cameron <apcameron at softhome.net>  [CPE510 v2]
    Tested-by: Bernhard Geier <freifunk at geierb.de>      [WBS210 v2]
    Tested-by: Petrov <d7c48mWsPKx67w2 at gmail.com>       [CPE210 v1]
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 target/linux/ath79/dts/ar9344_tplink_cpe.dtsi | 18 ++++-----------
 tools/firmware-utils/src/tplink-safeloader.c  | 33 +++++++++------------------
 2 files changed, 15 insertions(+), 36 deletions(-)

diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi
index d4b7de440a..fd6aa0f08b 100644
--- a/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi
+++ b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi
@@ -4,6 +4,7 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/mtd/partitions/uimage.h>
 
 / {
 	aliases {
@@ -59,20 +60,9 @@
 			partition at 40000 {
 				label = "firmware";
 				reg = <0x040000 0x780000>;
-
-				compatible = "fixed-partitions";
-				#address-cells = <1>;
-				#size-cells = <1>;
-
-				partition at 0 {
-					label = "kernel";
-					reg = <0x000000 0x300000>;
-				};
-
-				partition at 300000 {
-					label = "rootfs";
-					reg = <0x300000 0x480000>;
-				};
+				compatible = "openwrt,uimage", "denx,uimage";
+				openwrt,ih-magic = <IH_MAGIC_OKLI>;
+				openwrt,offset = <0x3000>;
 			};
 
 			partition at 7c0000 {
diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c
index 878a0afbe5..e5974325ae 100644
--- a/tools/firmware-utils/src/tplink-safeloader.c
+++ b/tools/firmware-utils/src/tplink-safeloader.c
@@ -156,8 +156,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},
@@ -279,8 +278,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},
@@ -358,8 +356,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},
@@ -400,8 +397,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},
@@ -445,8 +441,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},
@@ -485,8 +480,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},
@@ -525,8 +519,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},
@@ -557,8 +550,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},
@@ -589,8 +581,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},
@@ -622,8 +613,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},
@@ -655,8 +645,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},


From lede-commits at lists.infradead.org  Sat Jun  5 15:00:23 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:00:23 -0400
Subject: [openwrt/openwrt]  umbim: fix return value of proto_mbim_setup()
In-Reply-To: <162293041808.3290.17303673137518839373@git-01.infra.openwrt.org>
References: <162293041808.3290.17303673137518839373@git-01.infra.openwrt.org>
Message-ID: <mailman.3324.1622930426.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/6bc4c0ae3eb3dff6e410b5b012ab0bec267adb5a

commit 6bc4c0ae3eb3dff6e410b5b012ab0bec267adb5a
Author: Adrian Schmutzler <freifunk at adrianschmutzler.de>
AuthorDate: Sat Jun 5 17:59:39 2021 +0200

    umbim: fix return value of proto_mbim_setup()
    
    The variable name appears to be mistyped.
    
    Suggested-by: Howard Chu <hyc at symas.com>
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 package/network/utils/umbim/files/lib/netifd/proto/mbim.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh
index 804870d7d4..abbabd6625 100755
--- a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh
+++ b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh
@@ -155,7 +155,7 @@ proto_mbim_setup() {
 		sleep 15
 	}
 
-	return $rt
+	return $ret
 }
 
 proto_mbim_teardown() {


From lede-commits at lists.infradead.org  Sat Jun  5 15:00:25 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:00:25 -0400
Subject: [openwrt/openwrt] bcm63xx: drop USB LEDs for Technicolor TG582N /
 ADB P.DG A4001N
In-Reply-To: <162293041808.3290.17303673137518839373@git-01.infra.openwrt.org>
References: <162293041808.3290.17303673137518839373@git-01.infra.openwrt.org>
Message-ID: <mailman.3325.1622930426.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/9b144cef4348eb49e33ad63bcb369544215313a5

commit 9b144cef4348eb49e33ad63bcb369544215313a5
Author: Daniele Castro <danielecastro at hotmail.it>
AuthorDate: Tue May 11 13:17:50 2021 +0100

    bcm63xx: drop USB LEDs for Technicolor TG582N / ADB P.DG A4001N
    
    Remove the USB status red and green LEDs for
    - ADB P.DG A4001N A-000-1A1-AX
    - Technicolor TG582N
    - Technicolor TG582N Telecom Italia
    
    After having mounted an SMD socket for the flash memory for
    JTAG reverse engineering, and so be able to easly swap between
    OpenWrt and the stock FW, it turned out that the stock FW does
    not light up the red and green USB LEDs exactly as I remembered.
    
    Signed-off-by: Daniele Castro <danielecastro at hotmail.it>
    [improve commit title]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 target/linux/bcm63xx/base-files/etc/board.d/01_leds | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/target/linux/bcm63xx/base-files/etc/board.d/01_leds b/target/linux/bcm63xx/base-files/etc/board.d/01_leds
index 33c70981de..75e8afef9d 100644
--- a/target/linux/bcm63xx/base-files/etc/board.d/01_leds
+++ b/target/linux/bcm63xx/base-files/etc/board.d/01_leds
@@ -27,10 +27,9 @@ adb,a4001n1)
 	ucidef_set_led_usbdev "usb" "USB" "green:3g" "1-1"
 	;;
 adb,pdg-a4001n-a-000-1a1-ax|\
+technicolor,tg582n|\
 technicolor,tg582n-telecom-italia)
 	ucidef_set_led_netdev "wlan0" "WIFI" "green:wifi" "wlan0"
-	ucidef_set_led_usbdev "usb1" "USB1" "green:service" "1-1"
-	ucidef_set_led_usbdev "usb2" "USB2" "red:service" "2-1"
 	;;
 adb,av4202n)
 	ucidef_set_led_netdev "wlan0" "WLAN" "blue:wifi" "wlan0"
@@ -92,10 +91,6 @@ sercomm,h500-s-lowi|\
 sercomm,h500-s-vfes)
 	ucidef_set_led_netdev "wan" "WAN" "green:internet" "eth0.2"
 	;;
-technicolor,tg582n)
-	ucidef_set_led_netdev "wlan0" "WIFI" "green:wifi" "wlan0"
-	ucidef_set_led_usbdev "usb" "USB" "red:power" "1-1"
-	;;
 telsey,cpva502plus)
 	ucidef_set_led_netdev "lan" "LAN" "amber:link" "eth0"
 	;;


From lede-commits at lists.infradead.org  Sat Jun  5 15:00:22 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:00:22 -0400
Subject: [openwrt/openwrt]  umbim: fix whitespace issues
In-Reply-To: <162293041808.3290.17303673137518839373@git-01.infra.openwrt.org>
References: <162293041808.3290.17303673137518839373@git-01.infra.openwrt.org>
Message-ID: <mailman.3326.1622930426.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/01f29a0c72e88e12c2c1a44bc8ac28c986fb8d35

commit 01f29a0c72e88e12c2c1a44bc8ac28c986fb8d35
Author: Adrian Schmutzler <freifunk at adrianschmutzler.de>
AuthorDate: Sat Jun 5 17:47:56 2021 +0200

    umbim: fix whitespace issues
    
    Make leading whitespaces consistent and remove trailing one.
    
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 package/network/utils/umbim/Makefile                       | 2 +-
 package/network/utils/umbim/files/lib/netifd/proto/mbim.sh | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/package/network/utils/umbim/Makefile b/package/network/utils/umbim/Makefile
index cc34002f6e..984f8354de 100644
--- a/package/network/utils/umbim/Makefile
+++ b/package/network/utils/umbim/Makefile
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=umbim
-PKG_RELEASE:=1
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/umbim.git
diff --git a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh
index 9b5729a7ab..804870d7d4 100755
--- a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh
+++ b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh
@@ -91,7 +91,7 @@ _proto_mbim_setup() {
 	tid=$((tid + 1))
 
 	echo "mbim[$$]" "Checking subscriber"
- 	umbim $DBG -n -t $tid -d $device subscriber || {
+	umbim $DBG -n -t $tid -d $device subscriber || {
 		echo "mbim[$$]" "Subscriber init failed"
 		proto_notify_error "$interface" NO_SUBSCRIBER
 		return 1
@@ -99,7 +99,7 @@ _proto_mbim_setup() {
 	tid=$((tid + 1))
 
 	echo "mbim[$$]" "Register with network"
-  	umbim $DBG -n -t $tid -d $device registration || {
+	umbim $DBG -n -t $tid -d $device registration || {
 		echo "mbim[$$]" "Subscriber registration failed"
 		proto_notify_error "$interface" NO_REGISTRATION
 		return 1
@@ -107,13 +107,13 @@ _proto_mbim_setup() {
 	tid=$((tid + 1))
 
 	echo "mbim[$$]" "Attach to network"
-   	umbim $DBG -n -t $tid -d $device attach || {
+	umbim $DBG -n -t $tid -d $device attach || {
 		echo "mbim[$$]" "Failed to attach to network"
 		proto_notify_error "$interface" ATTACH_FAILED
 		return 1
 	}
 	tid=$((tid + 1))
- 
+
 	echo "mbim[$$]" "Connect to network"
 	while ! umbim $DBG -n -t $tid -d $device connect "$apn" "$auth" "$username" "$password"; do
 		tid=$((tid + 1))


From lede-commits at lists.infradead.org  Sat Jun  5 15:00:20 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:00:20 -0400
Subject: [openwrt/openwrt]  ramips: add support for Linksys EA8100 v1
In-Reply-To: <162293041808.3290.17303673137518839373@git-01.infra.openwrt.org>
References: <162293041808.3290.17303673137518839373@git-01.infra.openwrt.org>
Message-ID: <mailman.3327.1622930426.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/b232680f847f4ea8d058849a51dedebb8e398a01

commit b232680f847f4ea8d058849a51dedebb8e398a01
Author: Tee Hao Wei <angelsl at in04.sg>
AuthorDate: Tue May 18 03:46:36 2021 +0800

    ramips: add support for Linksys EA8100 v1
    
    Specifications:
    - SoC: MT7621AT
    - RAM: 256MB
    - Flash: 128MB NAND
    - Ethernet: 5 Gigabit ports
    - WiFi: 2.4G/5G MT7615N
    - USB: 1 USB 3.0, 1 USB 2.0
    
    This device is very similar to the EA7300 v1/v2 and EA7500 v2.
    
    Installation:
    
    Upload the generated factory image through the factory web interface.
    
    (following part taken from EA7300 v2 commit message:)
    
    This might fail due to the A/B nature of this device. When flashing, OEM
    firmware writes over the non-booted partition. If booted from 'A',
    flashing over 'B' won't work. To get around this, you should flash the
    OEM image over itself. This will then boot the router from 'B' and
    allow you to flash OpenWRT without problems.
    
    Reverting to factory firmware:
    
    Hard-reset the router three times to force it to boot from 'B.' This is
    where the stock firmware resides. To remove any traces of OpenWRT from
    your router simply flash the OEM image at this point.
    
    With thanks to Leon Poon (@LeonPoon) for the initial bringup.
    
    Signed-off-by: Tee Hao Wei <angelsl at in04.sg>
    [add missing entry in 10_fix_wifi_mac]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 package/boot/uboot-envtools/files/ramips                          | 1 +
 target/linux/ramips/dts/mt7621_linksys_ea8100-v1.dts              | 8 ++++++++
 target/linux/ramips/image/mt7621.mk                               | 8 ++++++++
 target/linux/ramips/mt7621/base-files/etc/board.d/01_leds         | 3 ++-
 target/linux/ramips/mt7621/base-files/etc/board.d/02_network      | 3 ++-
 .../mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac     | 3 ++-
 target/linux/ramips/mt7621/base-files/etc/init.d/bootcount        | 3 ++-
 target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh     | 1 +
 8 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips
index a59f647685..2bb04997f9 100644
--- a/package/boot/uboot-envtools/files/ramips
+++ b/package/boot/uboot-envtools/files/ramips
@@ -53,6 +53,7 @@ jcg,q20)
 linksys,ea7300-v1|\
 linksys,ea7300-v2|\
 linksys,ea7500-v2|\
+linksys,ea8100-v1|\
 xiaomi,mi-router-3g|\
 xiaomi,mi-router-3-pro|\
 xiaomi,mi-router-4|\
diff --git a/target/linux/ramips/dts/mt7621_linksys_ea8100-v1.dts b/target/linux/ramips/dts/mt7621_linksys_ea8100-v1.dts
new file mode 100644
index 0000000000..6cc2219aec
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_linksys_ea8100-v1.dts
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621_linksys_ea7xxx.dtsi"
+
+/ {
+	compatible = "linksys,ea8100-v1", "mediatek,mt7621-soc";
+	model = "Linksys EA8100";
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 4b8ec4ceb1..96a66b2398 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -854,6 +854,14 @@ define Device/linksys_ea7500-v2
 endef
 TARGET_DEVICES += linksys_ea7500-v2
 
+define Device/linksys_ea8100-v1
+  $(Device/linksys_ea7xxx)
+  DEVICE_MODEL := EA8100
+  DEVICE_VARIANT := v1
+  LINKSYS_HWNAME := EA8100
+endef
+TARGET_DEVICES += linksys_ea8100-v1
+
 define Device/linksys_re6500
   $(Device/dsa-migration)
   IMAGE_SIZE := 7872k
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
index 9e67d458de..5322bc9db0 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
@@ -51,7 +51,8 @@ linksys,e5600)
 	;;
 linksys,ea7300-v1|\
 linksys,ea7300-v2|\
-linksys,ea7500-v2)
+linksys,ea7500-v2|\
+linksys,ea8100-v1)
 	ucidef_set_led_netdev "lan1" "lan1 link" "green:lan1" "lan1" "link"
 	ucidef_set_led_netdev "lan2" "lan2 link" "green:lan2" "lan2" "link"
 	ucidef_set_led_netdev "lan3" "lan3 link" "green:lan3" "lan3" "link"
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
index b31c99e6f1..d84d3e317f 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
@@ -141,7 +141,8 @@ ramips_setup_macs()
 	linksys,e5600|\
 	linksys,ea7300-v1|\
 	linksys,ea7300-v2|\
-	linksys,ea7500-v2)
+	linksys,ea7500-v2|\
+	linksys,ea8100-v1)
 		lan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
 		wan_mac=$lan_mac
 		label_mac=$lan_mac
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 49b7f23ce9..bd0f0254c6 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
@@ -21,7 +21,8 @@ case "$board" in
 	linksys,e5600|\
 	linksys,ea7300-v1|\
 	linksys,ea7300-v2|\
-	linksys,ea7500-v2)
+	linksys,ea7500-v2|\
+	linksys,ea8100-v1)
 		hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
 		[ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress
 		[ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
diff --git a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
index cfaa62485c..d3525ea0c9 100755
--- a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
+++ b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
@@ -11,7 +11,8 @@ boot() {
 	linksys,e5600|\
 	linksys,ea7300-v1|\
 	linksys,ea7300-v2|\
-	linksys,ea7500-v2)
+	linksys,ea7500-v2|\
+	linksys,ea8100-v1)
 		mtd resetbc s_env || true
 		;;
 	samknows,whitebox-v8)
diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
index 689a0e51ae..4943ad1305 100755
--- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
@@ -62,6 +62,7 @@ platform_do_upgrade() {
 	linksys,ea7300-v1|\
 	linksys,ea7300-v2|\
 	linksys,ea7500-v2|\
+	linksys,ea8100-v1|\
 	netgear,r6220|\
 	netgear,r6260|\
 	netgear,r6350|\


From lede-commits at lists.infradead.org  Sat Jun  5 15:00:19 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:00:19 -0400
Subject: [openwrt/openwrt] ramips: add support for Amped Wireless ALLY
 router and extender
In-Reply-To: <162293041808.3290.17303673137518839373@git-01.infra.openwrt.org>
References: <162293041808.3290.17303673137518839373@git-01.infra.openwrt.org>
Message-ID: <mailman.3330.1622930429.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/6d23e474ad9d0eba935696c66db4fb6e2037bb72

commit 6d23e474ad9d0eba935696c66db4fb6e2037bb72
Author: Jonathan Sturges <jsturges at redhat.com>
AuthorDate: Sat Jun 5 08:17:42 2021 -0400

    ramips: add support for Amped Wireless ALLY router and extender
    
    Amped Wireless ALLY is a whole-home WiFi kit, with a router (model
    ALLY-R1900K) and an Extender (model ALLY-00X19K).  Both are devices are
    11ac and based on MediaTek MT7621AT and MT7615N chips.  The units are
    nearly identical, except the Extender lacks a USB port and has a single
    Ethernet port.
    
    Specification:
    - SoC: MediaTek MT7621AT (2C/4T) @ 880MHz
    - RAM: 128MB DDR3 (Nanya NT5CC64M16GP-DI)
    - FLASH: 128MB NAND (Winbond W29N01GVSIAA)
    - WiFi: 2.4/5 GHz 4T4R
      - 2.4GHz MediaTek MT7615N bgn
      - 5GHz MediaTek MT7615N nac
    - Switch: SoC integrated Gigabit Switch
    - USB: 1x USB3 (Router only)
    - BTN: Reset, WPS
    - LED: single RGB
    - UART:  through-hole on PCB.
       J1: pin1 (square pad, towards rear)=3.3V, pin2=RX,
       pin3=GND, pin4=TX.  Settings: 57600/8N1.
    
    Note regarding dual system partitions
    -------------------------------------
    
    The vendor firmware and boot loader use a dual partition scheme.  The boot
    partition is decided by the bootImage U-boot environment variable: 0 for
    the 1st partition, 1 for the 2nd.
    
    OpenWrt does not support this scheme and will always use the first OS
    partition.  It will set bootImage to 0 during installation, making sure
    the first partition is selected by the boot loader.
    
    Also, because we can't be sure which partition is active to begin with, a
    2-step flash process is used.  We first flash an initramfs image, then
    follow with a regular sysupgrade.
    
    Installation:
    
    Router (ALLY-R1900K)
    1) Install the flashable initramfs image via the OEM web-interface.
      (Alternatively, you can use the TFTP recovery method below.)
      You can use WiFi or Ethernet.
      The direct URL is:  http://192.168.3.1/07_06_00_firmware.html
      a. No login is needed, and you'll be in their setup wizard.
      b. You might get a warning about not being connected to the Internet.
      c. Towards the bottom of the page will be a section entitled "Or
      Manually Upgrade Firmware from a File:" where you can manually choose
      and upload a firmware file.
      d: Click "Choose File", select the OpenWRT "initramfs" image and click
      "Upload."
    2) The Router will flash the OpenWrt initramfs image and reboot.  After
      booting, LuCI will be available on 192.168.1.1.
    3) Log into LuCI as root; there is no password.
    4) Optional (but recommended) is to backup the OEM firmware before
      continuing; see process below.
    5) Complete the Installation by flashing a full OpenWRT image.  Note:
      you may use the sysupgrade command line tool in lieu of the UI if
      you prefer.
      a.  Choose System -> Backup/Flash Firmware.
      b.  Click "Flash Image..." under "Flash new firmware image"
      c.  Click "Browse..." and then select the sysupgrade file.
      d.  Click Upload to upload the sysupgrade file.
      e.  Important:  uncheck "Keep settings and retain the current
          configuration" for this initial installation.
      f.  Click "Continue" to flash the firmware.
      g.  The device will reboot and OpenWRT is installed.
    
    Extender (ALLY-00X19K)
    1) This device requires a TFTP recovery procedure to do an initial load
      of OpenWRT.  Start by configuring a computer as a TFTP client:
      a. Install a TFTP client (server not necessary)
      b. Configure an Ethernet interface to 192.168.1.x/24; don't use .1 or .6
      c. Connect the Ethernet to the sole Ethernet port on the X19K.
    2) Put the ALLY Extender in TFTP recovery mode.
      a. Do this by pressing and holding the reset button on the bottom while
      connecting the power.
      b. As soon as the LED lights up green (roughly 2-3 seconds), release
      the button.
    3) Start the TFTP transfer of the Initramfs image from your setup machine.
    For example, from Linux:
    tftp -v -m binary 192.168.1.6 69 -c put initramfs.bin
    4) The Extender will flash the OpenWrt initramfs image and reboot.  After
    booting, LuCI will be available on 192.168.1.1.
    5) Log into LuCI as root; there is no password.
    6) Optional (but recommended) is to backup the OEM firmware before
      continuing; see process below.
    7) Complete the Installation by flashing a full OpenWRT image.  Note: you
    may use the sysupgrade command line tool in lieu of the UI if you prefer.
      a.  Choose System -> Backup/Flash Firmware.
      b.  Click "Flash Image..." under "Flash new firmware image"
      c.  Click "Browse..." and then select the sysupgrade file.
      d.  Click Upload to upload the sysupgrade file.
      e.  Important:  uncheck "Keep settings and retain the current
          configuration" for this initial installation.
      f.  Click "Continue" to flash the firmware.
      g.  The device will reboot and OpenWRT is installed.
    
    Backup the OEM Firmware:
    -----------------------
    
    There isn't any downloadable firmware for the ALLY devices on the Amped
    Wireless web site. Reverting back to the OEM firmware is not possible
    unless we have a backup of the original OEM firmware.
    
    The OEM firmware may be stored on either /dev/mtd3 ("firmware") or
    /dev/mtd6 ("oem").  We can't be sure which was overwritten with the
    initramfs image, so backup both partitions to be safe.
    
      1) Once logged into LuCI, navigate to System -> Backup/Flash Firmware.
      2) Under "Save mtdblock contents," first select "firmware" and click
      "Save mtdblock" to download the image.
      3) Repeat the process, but select "oem" from the pull-down menu.
    
    Revert to the OEM Firmware:
    --------------------------
    * U-boot TFTP:
      Follow the TFTP recovery steps for the Extender, and use the
      backup image.
    
    * OpenWrt "Flash Firmware" interface:
      Upload the backup image and select "Force update"
      before continuing.
    
    Signed-off-by: Jonathan Sturges <jsturges at redhat.com>
---
 package/boot/uboot-envtools/files/ramips           |   4 +
 .../dts/mt7621_ampedwireless_ally-00x19k.dts       |  21 +++
 .../dts/mt7621_ampedwireless_ally-r1900k.dts       |  32 ++++
 .../ramips/dts/mt7621_ampedwireless_ally.dtsi      | 179 +++++++++++++++++++++
 target/linux/ramips/image/mt7621.mk                |  27 ++++
 .../mt7621/base-files/etc/board.d/02_network       |  41 +++--
 .../mt7621/base-files/lib/upgrade/platform.sh      |   8 +
 7 files changed, 297 insertions(+), 15 deletions(-)

diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips
index ee2d95115c..a59f647685 100644
--- a/package/boot/uboot-envtools/files/ramips
+++ b/package/boot/uboot-envtools/files/ramips
@@ -25,6 +25,10 @@ allnet,all0256n-8m|\
 allnet,all5002)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
 	;;
+ampedwireless,ally-00x19k|\
+ampedwireless,ally-r1900k)
+	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4"
+	;;
 buffalo,wsr-1166dhp|\
 buffalo,wsr-600dhp|\
 mediatek,linkit-smart-7688|\
diff --git a/target/linux/ramips/dts/mt7621_ampedwireless_ally-00x19k.dts b/target/linux/ramips/dts/mt7621_ampedwireless_ally-00x19k.dts
new file mode 100644
index 0000000000..51d41c7fb4
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_ampedwireless_ally-00x19k.dts
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621_ampedwireless_ally.dtsi"
+
+/ {
+	compatible = "ampedwireless,ally-00x19k", "mediatek,mt7621-soc";
+	model = "Amped Wireless ALLY-00X19K";
+};
+
+&switch0 {
+	ports {
+		port at 2 {
+			status = "okay";
+			label = "lan";
+		};
+	};
+};
+
+&xhci {
+	status = "disabled";
+};
diff --git a/target/linux/ramips/dts/mt7621_ampedwireless_ally-r1900k.dts b/target/linux/ramips/dts/mt7621_ampedwireless_ally-r1900k.dts
new file mode 100644
index 0000000000..cd2536e179
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_ampedwireless_ally-r1900k.dts
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621_ampedwireless_ally.dtsi"
+
+/ {
+	compatible = "ampedwireless,ally-r1900k", "mediatek,mt7621-soc";
+	model = "Amped Wireless ALLY-R1900K";
+};
+
+&switch0 {
+	ports {
+		port at 1 {
+			status = "okay";
+			label = "wan";
+		};
+
+		port at 2 {
+			status = "okay";
+			label = "lan1";
+		};
+
+		port at 3 {
+			status = "okay";
+			label = "lan2";
+		};
+
+		port at 4 {
+			status = "okay";
+			label = "lan3";
+		};
+	};
+};
diff --git a/target/linux/ramips/dts/mt7621_ampedwireless_ally.dtsi b/target/linux/ramips/dts/mt7621_ampedwireless_ally.dtsi
new file mode 100644
index 0000000000..7736b06e43
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_ampedwireless_ally.dtsi
@@ -0,0 +1,179 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	aliases {
+		led-boot = &led_status_amber;
+		led-failsafe = &led_status_amber;
+		led-running = &led_status_green;
+		led-upgrade = &led_status_red;
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		led_switch {
+			label = "led_switch";
+			gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
+			linux,code = <KEY_LIGHTS_TOGGLE>;
+			linux,input-type = <EV_SW>;
+		};
+
+		reset {
+			label = "reset";
+			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_status_green: status_green {
+			label = "green:status";
+			gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_status_red: status_red {
+			label = "red:status";
+			gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_status_amber: status_amber {
+			label = "amber:status";
+			gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
+		};
+	};
+};
+
+&pcie {
+	status = "okay";
+};
+
+&pcie0 {
+	wifi at 0,0 {
+		compatible = "pci14c3,7615";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x0000>;
+		ieee80211-freq-limit = <2400000 2500000>;
+	};
+};
+
+&pcie1 {
+	wifi at 0,0 {
+		compatible = "pci14c3,7615";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x8000>;
+		ieee80211-freq-limit = <5000000 6000000>;
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "uart2", "uart3", "jtag", "wdt";
+		function = "gpio";
+	};
+};
+
+&nand {
+	status = "okay";
+
+	partitions {
+		compatible = "fixed-partitions";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition at 0 {
+			label = "u-boot";
+			reg = <0x0 0x80000>;
+			read-only;
+		};
+
+		partition at 80000 {
+			label = "u-boot-env";
+			reg = <0x80000 0x80000>;
+		};
+
+		factory: partition at 100000 {
+			label = "factory";
+			reg = <0x100000 0x40000>;
+			read-only;
+		};
+
+		/*
+		 * uboot expects to find kernels at 0x140000 & 0x2140000,
+		 * referred to as Uimage & Uimage1 in factory FW, respectively.
+		 * U-boot variable 'bootImage' controls which is booted;
+		 * 0 for the first, 1 for the 2nd.
+		 * There's a 3rd partition, Uimage2 (0x4140000), which
+		 * I expected to be a recovery image, but is actually blank.
+		 *
+		 * A kernel is considered suitable for handing control over
+		 * if its linux magic number exists & uImage CRC are correct.
+		 * If either of those conditions fail, 'bootImage' value
+		 * is toggled in uboot env & a restart performed in the hope that the
+		 * alternate kernel is okay.
+		 *
+		 * Note uboot's tftp flash install writes the transferred
+		 * image to the active kernel partition.
+		 */
+
+		partition at 140000 {
+			label = "kernel";
+			reg = <0x140000 0x400000>;
+		};
+
+		partition at 540000 {
+			label = "ubi";
+			reg = <0x540000 0x1c00000>;
+		};
+
+		partition at 2140000 {
+			label = "oem";
+			reg = <0x2140000 0x2000000>;
+		};
+
+		partition at 4140000 {
+			label = "backup";
+			reg = <0x4140000 0x2000000>;
+		};
+
+		partition at 6140000 {
+			label = "chime";
+			reg = <0x6140000 0xa00000>;
+		};
+
+		partition at 6b40000 {
+			label = "data";
+			reg = <0x6b40000 0xa00000>;
+		};
+
+		partition at 7540000 {
+			label = "reserved";
+			reg = <0x7540000 0x840000>;
+			read-only;
+		};
+
+		partition at 7d80000 {
+			label = "nvram";
+			reg = <0x7d80000 0x100000>;
+			read-only;
+		};
+
+		partition at 7e80000 {
+			label = "hwconfig";
+			reg = <0x7e80000 0x100000>;
+			read-only;
+		};
+	};
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 04f84ac1fe..4b8ec4ceb1 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -126,6 +126,33 @@ define Device/alfa-network_quad-e4g
 endef
 TARGET_DEVICES += alfa-network_quad-e4g
 
+define Device/ampedwireless_ally_common
+  $(Device/dsa-migration)
+  DEVICE_VENDOR := Amped Wireless
+  DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware uboot-envtools
+  IMAGE_SIZE := 32768k
+  KERNEL_SIZE := 4096k
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  UBINIZE_OPTS := -E 5
+  KERNEL_INITRAMFS := $(KERNEL_DTB) | uImage lzma -n 'flashable-initramfs' |\
+	edimax-header -s CSYS -m RN68 -f 0x001c0000 -S 0x01100000
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+endef
+
+define Device/ampedwireless_ally-r1900k
+  $(Device/ampedwireless_ally_common)
+  DEVICE_MODEL := ALLY-R1900K
+  DEVICE_PACKAGES += kmod-usb3
+endef
+TARGET_DEVICES += ampedwireless_ally-r1900k
+
+define Device/ampedwireless_ally-00x19k
+  $(Device/ampedwireless_ally_common)
+  DEVICE_MODEL := ALLY-00X19K
+endef
+TARGET_DEVICES += ampedwireless_ally-00x19k
+
 define Device/asiarf_ap7621-001
   $(Device/dsa-migration)
   IMAGE_SIZE := 16000k
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
index df69e1c432..b31c99e6f1 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
@@ -8,21 +8,7 @@ ramips_setup_interfaces()
 	local board="$1"
 
 	case $board in
-	asiarf,ap7621-001|\
-	winstars,ws-wn583a6)
-		ucidef_set_interfaces_lan_wan "lan" "wan"
-		;;
-	asiarf,ap7621-nv1|\
-	glinet,gl-mt1300|\
-	jcg,q20|\
-	lenovo,newifi-d1|\
-	mikrotik,routerboard-m33g|\
-	xiaomi,mi-router-3g|\
-	xiaomi,mi-router-3g-v2|\
-	xiaomi,mi-router-4|\
-	xiaomi,mi-router-4a-gigabit)
-		ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
-		;;
+	ampedwireless,ally-00x19k|\
 	edimax,re23s|\
 	mikrotik,routerboard-m11g|\
 	netgear,ex6150|\
@@ -34,6 +20,7 @@ ramips_setup_interfaces()
 	ubnt,unifi-nanohd)
 		ucidef_set_interface_lan "lan"
 		;;
+	ampedwireless,ally-r1900k|\
 	gehua,ghl-r-001|\
 	hiwifi,hc5962|\
 	xiaomi,mi-router-3-pro|\
@@ -41,6 +28,21 @@ ramips_setup_interfaces()
 	xiaomi,redmi-router-ac2100)
 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
 		;;
+	asiarf,ap7621-001|\
+	winstars,ws-wn583a6)
+		ucidef_set_interfaces_lan_wan "lan" "wan"
+		;;
+	asiarf,ap7621-nv1|\
+	glinet,gl-mt1300|\
+	jcg,q20|\
+	lenovo,newifi-d1|\
+	mikrotik,routerboard-m33g|\
+	xiaomi,mi-router-3g|\
+	xiaomi,mi-router-3g-v2|\
+	xiaomi,mi-router-4|\
+	xiaomi,mi-router-4a-gigabit)
+		ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
+		;;
 	gnubee,gb-pc1|\
 	gnubee,gb-pc2)
 		ucidef_set_interface_lan "lan1 lan2"
@@ -85,6 +87,15 @@ ramips_setup_macs()
 	local label_mac=""
 
 	case $board in
+	ampedwireless,ally-00x19k)
+		lan_mac=$(mtd_get_mac_ascii hwconfig HW.LAN.MAC.Address)
+		label_mac=$lan_mac
+		;;
+	ampedwireless,ally-r1900k)
+		lan_mac=$(mtd_get_mac_ascii hwconfig HW.LAN.MAC.Address)
+		wan_mac=$(mtd_get_mac_ascii hwconfig HW.WAN.MAC.Address)
+		label_mac=$lan_mac
+		;;
 	asus,rt-ac65p|\
 	asus,rt-ac85p)
 		wan_mac=$(mtd_get_mac_ascii u-boot-env et1macaddr)
diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
index 7b57ee7776..689a0e51ae 100755
--- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
@@ -27,6 +27,12 @@ platform_do_upgrade() {
 			fi
 		}
 		;;
+	ampedwireless,ally-00x19k|\
+	ampedwireless,ally-r1900k)
+		if [ "$(fw_printenv --lock / -n bootImage 2>/dev/null)" != "0" ]; then
+			fw_setenv --lock / bootImage 0 || exit 1
+		fi
+		;;
 	mikrotik,routerboard-750gr3|\
 	mikrotik,routerboard-760igs|\
 	mikrotik,routerboard-m11g|\
@@ -43,6 +49,8 @@ platform_do_upgrade() {
 	esac
 
 	case "$board" in
+	ampedwireless,ally-00x19k|\
+	ampedwireless,ally-r1900k|\
 	asus,rt-ac65p|\
 	asus,rt-ac85p|\
 	dlink,dir-1960-a1|\


From lede-commits at lists.infradead.org  Sat Jun  5 15:00:26 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:00:26 -0400
Subject: [openwrt/openwrt]  ramips: split Youku YK1 to YK-L1 and YK-L1c
In-Reply-To: <162293041808.3290.17303673137518839373@git-01.infra.openwrt.org>
References: <162293041808.3290.17303673137518839373@git-01.infra.openwrt.org>
Message-ID: <mailman.3331.1622930429.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/4a9f389ed2dcee18a5c5e1f0d4e5c406f9290579

commit 4a9f389ed2dcee18a5c5e1f0d4e5c406f9290579
Author: Shiji Yang <yangshiji66 at qq.com>
AuthorDate: Sun May 16 21:21:09 2021 +0800

    ramips: split Youku YK1 to YK-L1 and YK-L1c
    
    Device specifications:
    * Model: Youku YK-L1/L1c
    * CPU: MT7620A
    * RAM: 128 MiB
    * Flash: 32 MiB (YK-L1)/ 16 MiB (YK-L1c)
    * LAN: 2* 10M/100M Ports
    * WAN: 1* 10M/100M Port
    * USB: 1* USB2.0
    * SD: 1* MicroSD socket
    * UART: 1* TTL, Baudrate 57600
    
    Descriptions:
      Previous supported device YOUKU yk1 is actually Youku YK-L1. Though they look
      really different, the only hardware difference between the two models is flash
      size, YK-L1 has 32 MiB flash but YK-L1c has 16MiB. It seems that YK-L1c can
      compatible with YK-L1's firmware but it's better to split it to different models.
    
      It is easy to identify the models by looking at the label on the bottom of the
      device. The label has the model number "YK-L1" or "YK-L1c". Due to different flash
      sizes, YK-L1c that using previous YK-L1's firmware needs to apply "force update"
      to install compatible firmware, so please backup config file before system upgrade.
    
    Signed-off-by: Shiji Yang <yangshiji66 at qq.com>
    [use more specific name for DTSI]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 target/linux/ramips/dts/mt7620a_youku_yk-l1.dts      | 12 ++++++++++++
 ...t7620a_youku_yk1.dts => mt7620a_youku_yk-l1.dtsi} |  7 ++-----
 target/linux/ramips/dts/mt7620a_youku_yk-l1c.dts     | 12 ++++++++++++
 target/linux/ramips/image/mt7620.mk                  | 20 +++++++++++++++-----
 .../ramips/mt7620/base-files/etc/board.d/02_network  |  6 ++++--
 5 files changed, 45 insertions(+), 12 deletions(-)

diff --git a/target/linux/ramips/dts/mt7620a_youku_yk-l1.dts b/target/linux/ramips/dts/mt7620a_youku_yk-l1.dts
new file mode 100644
index 0000000000..5155318b0c
--- /dev/null
+++ b/target/linux/ramips/dts/mt7620a_youku_yk-l1.dts
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7620a_youku_yk-l1.dtsi"
+
+/ {
+	compatible = "youku,yk-l1", "ralink,mt7620a-soc";
+	model = "Youku YK-L1";
+};
+
+&firmware {
+	reg = <0x50000 0x1fb0000>;
+};
diff --git a/target/linux/ramips/dts/mt7620a_youku_yk1.dts b/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi
similarity index 93%
rename from target/linux/ramips/dts/mt7620a_youku_yk1.dts
rename to target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi
index 2e59e5bf6e..61062a3179 100644
--- a/target/linux/ramips/dts/mt7620a_youku_yk1.dts
+++ b/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi
@@ -4,9 +4,6 @@
 #include <dt-bindings/input/input.h>
 
 / {
-	compatible = "youku,yk1", "ralink,mt7620a-soc";
-	model = "YOUKU YK1";
-
 	aliases {
 		led-boot = &led_power;
 		led-failsafe = &led_power;
@@ -88,10 +85,10 @@
 				read-only;
 			};
 
-			partition at 50000 {
+			firmware: partition at 50000 {
 				compatible = "denx,uimage";
 				label = "firmware";
-				reg = <0x50000 0x1fb0000>;
+				/* reg property is set based on flash size in DTS files */
 			};
 		};
 	};
diff --git a/target/linux/ramips/dts/mt7620a_youku_yk-l1c.dts b/target/linux/ramips/dts/mt7620a_youku_yk-l1c.dts
new file mode 100644
index 0000000000..c59f0101bd
--- /dev/null
+++ b/target/linux/ramips/dts/mt7620a_youku_yk-l1c.dts
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7620a_youku_yk-l1.dtsi"
+
+/ {
+	compatible = "youku,yk-l1c", "ralink,mt7620a-soc";
+	model = "Youku YK-L1c";
+};
+
+&firmware {
+	reg = <0x50000 0xfb0000>;
+};
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index ddb09baa08..fe41512f36 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -1112,16 +1112,26 @@ define Device/xiaomi_miwifi-mini
 endef
 TARGET_DEVICES += xiaomi_miwifi-mini
 
-define Device/youku_yk1
+define Device/youku_yk-l1
   SOC := mt7620a
   IMAGE_SIZE := 32448k
-  DEVICE_VENDOR := YOUKU
-  DEVICE_MODEL := YK1
+  DEVICE_VENDOR := Youku
+  DEVICE_MODEL := YK-L1
   DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 \
 	kmod-usb-ledtrig-usbport
-  SUPPORTED_DEVICES += youku-yk1
+  SUPPORTED_DEVICES += youku-yk1 youku,yk1
 endef
-TARGET_DEVICES += youku_yk1
+TARGET_DEVICES += youku_yk-l1
+
+define Device/youku_yk-l1c
+  SOC := mt7620a
+  IMAGE_SIZE := 16064k
+  DEVICE_VENDOR := Youku
+  DEVICE_MODEL := YK-L1c
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 \
+	kmod-usb-ledtrig-usbport
+endef
+TARGET_DEVICES += youku_yk-l1c
 
 define Device/yukai_bocco
   SOC := mt7620a
diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network
index 17fa48c739..e2e2614483 100644
--- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network
@@ -215,7 +215,8 @@ ramips_setup_interfaces()
 		ucidef_add_switch "switch0" \
 			"0:lan" "4:wan" "6 at eth0"
 		;;
-	youku,yk1)
+	youku,yk-l1|\
+	youku,yk-l1c)
 		ucidef_add_switch "switch0" \
 			"0:lan" "1:lan" "4:wan" "6 at eth0"
 		;;
@@ -338,7 +339,8 @@ ramips_setup_macs()
 	lenovo,newifi-y1s|\
 	ohyeah,oy-0001|\
 	wavlink,wl-wn530hg4|\
-	youku,yk1)
+	youku,yk-l1|\
+	youku,yk-l1c)
 		wan_mac=$(mtd_get_mac_binary factory 0x2e)
 		;;
 	linksys,e1700)


From lede-commits at lists.infradead.org  Sat Jun  5 15:00:27 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:00:27 -0400
Subject: [openwrt/openwrt] treewide: remove "+" sign for increment with
 macaddr_add
In-Reply-To: <162293041808.3290.17303673137518839373@git-01.infra.openwrt.org>
References: <162293041808.3290.17303673137518839373@git-01.infra.openwrt.org>
Message-ID: <mailman.3332.1622930429.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/6f648ed7e639060902df1d652fedd176f4aa9f98

commit 6f648ed7e639060902df1d652fedd176f4aa9f98
Author: Adrian Schmutzler <freifunk at adrianschmutzler.de>
AuthorDate: Sat Jun 5 23:54:37 2021 +0200

    treewide: remove "+" sign for increment with macaddr_add
    
    Many people appear to use an unneeded "+" prefix for the increment
    when calculating a MAC address with macaddr_add. Since this is not
    required and used inconsistently [*], just remove it.
    
    [*] As a funny side-fact, copy-pasting has led to almost all
        hotplug.d files using the "+", while nearly all of the
        02_network files are not using it.
    
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 .../etc/hotplug.d/firmware/10-ath9k-eeprom         |  2 +-
 .../etc/hotplug.d/firmware/11-ath10k-caldata       | 30 +++++++++++-----------
 .../etc/hotplug.d/firmware/10-ath9k-eeprom         |  4 +--
 .../etc/hotplug.d/firmware/11-ath10k-caldata       |  4 +--
 .../etc/hotplug.d/firmware/11-ath10k-caldata       | 18 ++++++-------
 .../lib/preinit/05_set_iface_mac_ipq40xx.sh        | 14 +++++-----
 .../etc/hotplug.d/firmware/11-ath10k-caldata       | 12 ++++-----
 .../etc/hotplug.d/firmware/11-ath10k-caldata       |  2 +-
 .../etc/hotplug.d/firmware/12-ath9k-eeprom         |  2 +-
 .../etc/hotplug.d/firmware/12-ath9k-eeprom         |  4 +--
 .../base-files/etc/uci-defaults/03_wireless        |  4 +--
 .../armv8/base-files/etc/board.d/02_network        |  2 +-
 12 files changed, 49 insertions(+), 49 deletions(-)

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 08d9e017a7..62f2f1e8b4 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
@@ -40,7 +40,7 @@ case "$FIRMWARE" in
 	engenius,ecb1200|\
 	engenius,ecb1750)
 		caldata_extract "art" 0x1000 0x440
-		ath9k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env athaddr) +1)
+		ath9k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env athaddr) 1)
 		;;
 	engenius,epg5000|\
 	iodata,wn-ac1167dgr|\
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 a7986a98ec..b7cb2da8cd 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
@@ -15,7 +15,7 @@ case "$FIRMWARE" in
 	engenius,enstationac-v1|\
 	glinet,gl-x750)
 		caldata_extract "art" 0x5000 0x844
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +2)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) 2)
 		;;
 	avm,fritz1750e|\
 	avm,fritzdvbc)
@@ -79,15 +79,15 @@ case "$FIRMWARE" in
 	sitecom,wlr-7100|\
 	zyxel,nbg6616)
 		caldata_extract "art" 0x5000 0x844
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 1)
 		;;
 	engenius,ews511ap)
 		caldata_extract "art" 0x5000 0x844
-		ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +1)
+		ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) 1)
 		;;
 	glinet,gl-ar750)
 		caldata_extract "art" 0x5000 0x844
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +1)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) 1)
 		;;
 	nec,wg800hp)
 		caldata_extract "art" 0x5000 0x844
@@ -103,11 +103,11 @@ case "$FIRMWARE" in
 	openmesh,mr1750-v1|\
 	openmesh,mr1750-v2)
 		caldata_extract "ART" 0x5000 0x844
-		ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16)
+		ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) 16)
 		;;
 	openmesh,om5p-ac-v2)
 		caldata_extract "art" 0x5000 0x844
-		ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) +16)
+		ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) 16)
 		;;
 	qihoo,c301)
 		caldata_extract "radiocfg" 0x5000 0x844
@@ -130,22 +130,22 @@ case "$FIRMWARE" in
 		;;
 	tplink,archer-d50-v1)
 		caldata_extract "art" 0x5000 0x844
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary romfile 0xf100) +2)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary romfile 0xf100) 2)
 		;;
 	tplink,archer-d7-v1|\
 	tplink,archer-d7b-v1)
 		caldata_extract "art" 0x5000 0x844
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary romfs 0xf100) +2)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary romfs 0xf100) 2)
 		;;
 	tplink,eap245-v1|\
 	tplink,re450-v2|\
 	tplink,re450-v3)
 		caldata_extract "art" 0x5000 0x844
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +1)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) 1)
 		;;
 	tplink,re350k-v1)
 		caldata_extract "art" 0x5000 0x844
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +2)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) 2)
 		;;
 	tplink,re355-v1|\
 	tplink,re450-v1)
@@ -154,7 +154,7 @@ case "$FIRMWARE" in
 		;;
 	tplink,tl-wpa8630-v1)
 		caldata_extract "art" 0x5000 0x844
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x0fc00) +1)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary u-boot 0x0fc00) 1)
 		;;
 	esac
 	;;
@@ -162,7 +162,7 @@ case "$FIRMWARE" in
 	case $board in
 	sitecom,wlr-8100)
 		caldata_extract "art" 0x5000 0x844
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 1)
 		;;
 	esac
 	;;
@@ -180,7 +180,7 @@ case "$FIRMWARE" in
 	comfast,cf-ew72|\
 	comfast,cf-wr752ac-v1)
 		caldata_extract "art" 0x5000 0x2f20
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +2)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) 2)
 		ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
 			/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
 		rm /lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin
@@ -237,13 +237,13 @@ case "$FIRMWARE" in
 	tplink,tl-wpa8630p-v2.0-eu|\
 	tplink,tl-wpa8630p-v2.1-eu)
 		caldata_extract "art" 0x5000 0x2f20
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +1)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) 1)
 		ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
 			/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
 		;;
 	tplink,eap245-v3)
 		caldata_extract "art" 0x5000 0x2f20
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) +1)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary info 0x8) 1)
 		;;
 	yuncore,a782|\
 	yuncore,xd4200)
diff --git a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index 7ef6fdbe0f..d9425d4437 100644
--- a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -26,10 +26,10 @@ case "$FIRMWARE" in
 	mikrotik,routerboard-lhg-2nd|\
 	mikrotik,routerboard-sxt-5nd-r2|\
 	mikrotik,routerboard-wapr-2nd)
-		caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" +1)
+		caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" 1)
 		;;
 	mikrotik,routerboard-wap-g-5hact2hnd)
-		caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" +2)
+		caldata_mikrotik_ath9k 0x1000 0x440 $(macaddr_add "$mac_base" 2)
 		;;
 	*)
 		caldata_die "board $board is not supported yet"
diff --git a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index d5fd3db24d..f8cc8f1a2b 100644
--- a/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ath79/nand/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -16,11 +16,11 @@ case "$FIRMWARE" in
 	glinet,gl-ar750s-nor|\
 	glinet,gl-ar750s-nor-nand)
 		caldata_extract "art" 0x5000 0x844
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) +1)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) 1)
 		;;
 	zyxel,nbg6716)
 		caldata_extract "art" 0x5000 0x844
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +1)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 1)
 		;;
 	esac
 	;;
diff --git a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 42cb295496..87876ad844 100644
--- a/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ipq40xx/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -12,7 +12,7 @@ case "$FIRMWARE" in
 	meraki,mr33)
 		caldata_extract_ubi "ART" 0x9000 0x844
 		caldata_valid "4408" || caldata_extract "ART" 0x9000 0x844
-		ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) +1)
+		ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) 1)
 		;;
 	esac
 	;;
@@ -128,7 +128,7 @@ case "$FIRMWARE" in
 		;;
 	engenius,ens620ext)
 		caldata_extract "ART" 0x1000 0x2f20
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +2)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 2)
 		;;
 	linksys,ea8300 |\
 	linksys,mr8300)
@@ -138,7 +138,7 @@ case "$FIRMWARE" in
 	meraki,mr33)
 		caldata_extract_ubi "ART" 0x1000 0x2f20
 		caldata_valid "202f" || caldata_extract "ART" 0x1000 0x2f20
-		ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) +2)
+		ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) 2)
 		;;
 	mikrotik,hap-ac2)
 		wlan_data="/sys/firmware/mikrotik/hard_config/wlan_data"
@@ -180,7 +180,7 @@ case "$FIRMWARE" in
 	aruba,ap-303h |\
 	aruba,ap-365)
 		caldata_extract "ART" 0x5000 0x2f20
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary mfginfo 0x1D) +1)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary mfginfo 0x1D) 1)
 		;;
 	asus,map-ac2200)
 		caldata_extract_ubi "Factory" 0x5000 0x2f20
@@ -233,15 +233,15 @@ case "$FIRMWARE" in
 		;;
 	engenius,emd1)
 		caldata_extract "0:ART" 0x5000 0x2f20
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV wlanaddr) +1)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV wlanaddr) 1)
 		;;
 	engenius,emr3500)
 		caldata_extract "0:ART" 0x5000 0x2f20
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) +1)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) 1)
 		;;
 	engenius,ens620ext)
 		caldata_extract "ART" 0x5000 0x2f20
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +3)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 3)
 		;;
 	linksys,ea8300 |\
 	linksys,mr8300)
@@ -251,7 +251,7 @@ case "$FIRMWARE" in
 	meraki,mr33)
 		caldata_extract_ubi "ART" 0x5000 0x2f20
 		caldata_valid "202f" || caldata_extract "ART" 0x5000 0x2f20
-		ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) +3)
+		ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) 3)
 		;;
 	mikrotik,hap-ac2|\
 	mikrotik,sxtsq-5-ac)
@@ -266,7 +266,7 @@ case "$FIRMWARE" in
 		;;
 	netgear,wac510)
 		caldata_extract "0:ART" 0x5000 0x2f20
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary "0:MANUDATA" 0x6) +16)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary "0:MANUDATA" 0x6) 16)
 		;;
 	zyxel,nbg6617 |\
 	zyxel,wre6606)
diff --git a/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh b/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh
index 0d606c75b5..51ba7071e7 100644
--- a/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh
+++ b/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh
@@ -4,8 +4,8 @@ preinit_set_mac_address() {
 	case $(board_name) in
 	asus,map-ac2200)
 		base_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
-		ip link set dev eth0 address $(macaddr_add "$base_mac" +1)
-		ip link set dev eth1 address $(macaddr_add "$base_mac" +3)
+		ip link set dev eth0 address $(macaddr_add "$base_mac" 1)
+		ip link set dev eth1 address $(macaddr_add "$base_mac" 3)
 		;;
 	ezviz,cs-w3-wd1200g-eup)
 		ip link set dev eth0 address $(mtd_get_mac_binary "ART" 0x6)
@@ -13,13 +13,13 @@ preinit_set_mac_address() {
 		;;
 	engenius,eap2200)
 		base_mac=$(cat /sys/class/net/eth0/address)
-		ip link set dev eth1 address $(macaddr_add "${base_mac}" +1)
+		ip link set dev eth1 address $(macaddr_add "$base_mac" 1)
 		;;
 	linksys,ea8300|\
 	linksys,mr8300)
 		base_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
-		ip link set dev eth0 address "${base_mac}"
-		ip link set dev eth1 address $(macaddr_add "${base_mac}" 1)
+		ip link set dev eth0 address "$base_mac"
+		ip link set dev eth1 address $(macaddr_add "$base_mac" 1)
 		;;
 	meraki,mr33)
 		mac_lan=$(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66)
@@ -27,8 +27,8 @@ preinit_set_mac_address() {
 		;;
 	zyxel,nbg6617)
 		base_mac=$(cat /sys/class/net/eth0/address)
-		ip link set dev eth0 address $(macaddr_add "$base_mac" +2)
-		ip link set dev eth1 address $(macaddr_add "$base_mac" +3)
+		ip link set dev eth0 address $(macaddr_add "$base_mac" 2)
+		ip link set dev eth1 address $(macaddr_add "$base_mac" 3)
 	esac
 }
 
diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 5592590d52..d2bdf034b7 100644
--- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -33,7 +33,7 @@ case "$FIRMWARE" in
 	linksys,ea7500-v1 |\
 	linksys,ea8500)
 		caldata_extract "art" 0x1000 0x2f20
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) +1)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 1)
 		;;
 	nec,wg2600hp |\
 	nec,wg2600hp3)
@@ -44,7 +44,7 @@ case "$FIRMWARE" in
 	netgear,r7500v2 |\
 	netgear,r7800)
 		caldata_extract "art" 0x1000 0x2f20
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x6) +1)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x6) 1)
 		;;
 	tplink,ad7200 |\
 	tplink,c2600)
@@ -58,11 +58,11 @@ case "$FIRMWARE" in
 	zyxel,nbg6817)
 		if [ -b "$(find_mtd_part 0:art)" ]; then
 			caldata_extract "0:art" 0x1000 0x2f20
-			ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:appsblenv ethaddr) +1)
+			ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:appsblenv ethaddr) 1)
 		else
 			# XXX: drop upper case after kernel v5.4 is gone (qcom-smem)
 			caldata_extract "0:ART" 0x1000 0x2f20
-			ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) +1)
+			ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) 1)
 		fi
 		;;
 	esac
@@ -85,7 +85,7 @@ case "$FIRMWARE" in
 	linksys,ea7500-v1 |\
 	linksys,ea8500)
 		caldata_extract "art" 0x5000 0x2f20
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) +2)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 2)
 		;;
 	nec,wg2600hp |\
 	nec,wg2600hp3)
@@ -96,7 +96,7 @@ case "$FIRMWARE" in
 	netgear,r7500v2 |\
 	netgear,r7800)
 		caldata_extract "art" 0x5000 0x2f20
-		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x6) +2)
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x6) 2)
 		;;
 	tplink,ad7200 |\
 	tplink,c2600)
diff --git a/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index 4202187d4f..c555aa2c12 100644
--- a/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -10,7 +10,7 @@ case "$FIRMWARE" in
 	case $board in
 		bt,homehub-v5a)
 			caldata_extract_ubi "caldata" 0x5000 0x844
-			ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary_ubi caldata 0x110c) +3)
+			ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary_ubi caldata 0x110c) 3)
 			;;
 		*)
 			caldata_die "board $board is not supported yet"
diff --git a/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom b/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom
index 03664b3fd3..09d26f7f85 100644
--- a/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom
+++ b/target/linux/lantiq/xrx200/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom
@@ -29,7 +29,7 @@ case "$FIRMWARE" in
 				;;
 			bt,homehub-v5a)
 				caldata_extract_ubi "caldata" 0x1000 0x1000
-				ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary_ubi caldata 0x110c) +2) 0x10c
+				ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_binary_ubi caldata 0x110c) 2) 0x10c
 				;;
 			tplink,tdw8970|\
 			tplink,tdw8980)
diff --git a/target/linux/lantiq/xway/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom b/target/linux/lantiq/xway/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom
index 9aea4eed64..98bb9af694 100644
--- a/target/linux/lantiq/xway/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom
+++ b/target/linux/lantiq/xway/base-files/etc/hotplug.d/firmware/12-ath9k-eeprom
@@ -39,11 +39,11 @@ case "$FIRMWARE" in
 				;;
 			bt,homehub-v3a)
 				caldata_extract_swap "art-copy" 0x0 0x1000
-				ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +2) 0x10c
+				ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 2) 0x10c
 				;;
 			netgear,dgn3500|netgear,dgn3500b)
 				caldata_extract "calibration" 0xf000 0x1000
-				ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +2) 0x20c
+				ath9k_patch_mac_crc $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 2) 0x20c
 				;;
 			avm,fritz7312|avm,fritz7320)
 				caldata_extract "urlader" 0x985 0x1000
diff --git a/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/03_wireless b/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/03_wireless
index 2039aeaf1b..f9526e3d86 100644
--- a/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/03_wireless
+++ b/target/linux/mvebu/cortexa9/base-files/etc/uci-defaults/03_wireless
@@ -17,8 +17,8 @@ linksys,wrt1900acs|\
 linksys,wrt3200acm|\
 linksys,wrt32x)
 	SKU=$(strings /dev/mtd3|sed -ne 's/^cert_region=//p')
-	WIFIMAC2G=$(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) +1)
-	WIFIMAC5G=$(macaddr_add $WIFIMAC2G +1)
+	WIFIMAC2G=$(macaddr_add $(mtd_get_mac_ascii devinfo hw_mac_addr) 1)
+	WIFIMAC5G=$(macaddr_add $WIFIMAC2G 1)
 	case "$SKU" in
 		AP)
 			REGD=CN
diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
index f5e88cc148..8371913f8a 100644
--- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
+++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
@@ -33,7 +33,7 @@ rockchip_setup_macs()
 	case "$board" in
 	friendlyarm,nanopi-r2s)
 		wan_mac=$(nanopi_r2s_generate_mac)
-		lan_mac=$(macaddr_add "$wan_mac" +1)
+		lan_mac=$(macaddr_add "$wan_mac" 1)
 		;;
 	esac
 


From lede-commits at lists.infradead.org  Sat Jun  5 15:00:21 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:00:21 -0400
Subject: [openwrt/openwrt]  ipq806x: add support for Askey RT4230W REV6
In-Reply-To: <162293041808.3290.17303673137518839373@git-01.infra.openwrt.org>
References: <162293041808.3290.17303673137518839373@git-01.infra.openwrt.org>
Message-ID: <mailman.3335.1622930429.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/da8428d277cd3373b05330cb3b4f93aef717c5ab

commit da8428d277cd3373b05330cb3b4f93aef717c5ab
Author: Lauro Moreno <lmore377 at gmail.com>
AuthorDate: Wed Oct 28 14:59:47 2020 -0600

    ipq806x: add support for Askey RT4230W REV6
    
    This adds support for the Askey RT4230W REV6
    (Branded by Spectrum/Charter as RAC2V1K)
    
    At this time, there's no way to reinstall the stock firmware so don't install
    this on a router that's being rented.
    
    Specifications:
    
        Qualcomm IPQ8065
        1 GB of RAM (DDR3)
        512 MB Flash (NAND)
        2x Wave 2 WiFi cards (QCA9984)
        5x 10/100/1000 Mbps Ethernet (Switch: QCA8337)
        1x LED (Controlled by a microcontroller that switches it between red and
            blue with different patterns)
        1x USB 3.0 Type-A
        12V DC Power Input
        UART header on PCB - pinout from top to bottom is RX, TX, GND, 5V
        Port settings are 115200n8
    
    More information: https://forum.openwrt.org/t/askey-rac2v1k-support/15830
    https://deviwiki.com/wiki/Askey_RAC2V1K
    
    To check what revision your router is, restore one of these config backups
    through the stock firmware to get ssh access then run
    "cat /proc/device-tree/model".
    https://forum.openwrt.org/t/askey-rac2v1k-support/15830/17
    The revision number on the board doesn't seem to be very consistent so that's
    why this is needed. You can also run printenv in the uboot console and if
    machid is set to 177d, that means your router is rev6.
    
    Note: Don't install this if the router is being rented from an ISP. The defined
    partition layout is different from the OEM one and even if you changed the
    layout to match, backing up and restoring the OEM firmware breaks /overlay so
    nothing will save and the router will likely enter a bootloop.
    
    How to install:
    
    Method 1: Install without opening the case using SSH and tftp
    
        You'll need:
        RAC2V1K-SSH.zip:
    https://github.com/lmore377/openwrt-rt4230w/blob/master/RAC2V1K-SSH.zip
        initramfs and sysupgrade images
    
        Connect to one of the router's LAN ports
    
        Download the RAC2V1K-SSH.zip file and restore the config file that
    corresponds to your router's firmware (If you're firmware is newer than what's
    in the zip file, just restore the 1.1.16 file)
    
        After a reboot, you should be able to ssh into the router with username:
    "4230w" and password: "linuxbox" or "admin". Run the following commannds
         fw_setenv ipaddr 10.42.0.10 #IP of router, can be anything as long as
    it's in the same subnet as the server
         fw_setenv serverip 10.42.0.1# #IP of tftp server that's set up in next
    steps
         fw_setenv bootdelay 8
         fw_setenv bootcmd "tftpboot initramfs.bin; bootm; bootipq"
    
        Don't reboot the router yet.
    
        Install and set up a tftp server on your computer
    
        Set a static ip on the ethernet interface of your computer (use this for
    serverip in the above commands)
    
        Rename the initramfs image to initramfs.bin, and host it with the tftp
    server
    
        Reboot the router. If you set up everything right, the router led should
    switch over to a slow blue glow which means openwrt is booted. If for some
    reason the file doesn't get loaded into ram properly, it should still boot to
    the OEM firmware.
        After openwrt boots, ssh into it and run these commands:
        fw_setenv bootcmd "setenv mtdids nand0=nand0 && setenv mtdparts
     mtdparts=nand0:0x1A000000 at 0x2400000(firmware) && ubi part firmware && ubi
    read 0x44000000 kernel 0x6e0000 && bootm"
        fw_setenv bootdelay 2
    
        After openwrt boots up, figure out a way to get the sysupgrade file onto it
    (scp, custom build with usb kernel module included, wget, etc.) then flash it
    with sysupgrade. After it finishes flashing, it should reboot, the light should
    start flashing blue, then when the light starts "breathing" blue that means
    openwrt is booted.
    
    Method 2: Install with serial access (Do this if something fails and you can't
    boot after using method 1)
    
        You'll need:
        initramfs and sysupgrade images
        Serial access:
    https://openwrt.org/inbox/toh/askey/askey_rt4230w_rev6#opening_the_case
    
        Install and set up a tftp server
    
        Set a static ip on the ethernet interface of your computer
    
        Download the initramfs image, rename it to initramfs.bin, and host it with
    the tftp server
    
        Connect the wan port of the router to your computer
    
        Interrupt U-Boot and run these commands:
        setenv serverip 10.42.0.1 (You can use whatever ip you set for the computer)
        setenv ipaddr 10.42.0.10 (Can be any ip as long as it's in the same subnet)
        setenv bootcmd "setenv mtdids nand0=nand0 &&
    set mtdparts mtdparts=nand0:0x1A000000 at 0x2400000(firmware) && ubi part firmware
    && ubi read 0x44000000 kernel 0x6e0000 && bootm"
    
        saveenv
        tftpboot initramfs.bin
        bootm
    
        After openwrt boots up, figure out a way to get the sysupgrade file onto it
    (scp, custom build with usb kernel module included, wget, etc.) then flash it
    with sysupgrade. After it finishes flashing, it should reboot, the light should
    start flashing blue, then when the light starts "breathing" blue that means
    openwrt is booted.
    
    Signed-off-by: Lauro Moreno <lmore377 at gmail.com>
    [add entry in 5.10 patch, fix whitespace issues]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 package/boot/uboot-envtools/files/ipq806x          |   3 +
 .../ipq806x/base-files/etc/board.d/02_network      |   1 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata       |   2 +
 .../ipq806x/base-files/lib/upgrade/platform.sh     |  19 +-
 .../arm/boot/dts/qcom-ipq8065-rt4230w-rev6.dts     | 303 +++++++++++++++++++++
 target/linux/ipq806x/image/Makefile                |  13 +
 .../patches-5.10/0069-arm-boot-add-dts-files.patch |   3 +-
 .../patches-5.4/0069-arm-boot-add-dts-files.patch  |   3 +-
 8 files changed, 336 insertions(+), 11 deletions(-)

diff --git a/package/boot/uboot-envtools/files/ipq806x b/package/boot/uboot-envtools/files/ipq806x
index 222d801f17..7e1d71a7e9 100644
--- a/package/boot/uboot-envtools/files/ipq806x
+++ b/package/boot/uboot-envtools/files/ipq806x
@@ -30,6 +30,9 @@ ubootenv_mtdinfo () {
 }
 
 case "$board" in
+askey,rt4230w-rev6)
+	ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x40000" "0x20000"
+	;;
 edgecore,ecw5410)
 	ubootenv_add_uci_config "/dev/mtd11" "0x0" "0x10000" "0x10000"
 	;;
diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network
index abdab89857..22d607b0ec 100644
--- a/target/linux/ipq806x/base-files/etc/board.d/02_network
+++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
@@ -11,6 +11,7 @@ board_config_update
 board=$(board_name)
 
 case "$board" in
+askey,rt4230w-rev6 |\
 asrock,g10 |\
 nec,wg2600hp)
 	ucidef_add_switch "switch0" \
diff --git a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
index fca35516ec..5592590d52 100644
--- a/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
+++ b/target/linux/ipq806x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
@@ -9,6 +9,7 @@ board=$(board_name)
 case "$FIRMWARE" in
 "ath10k/pre-cal-pci-0000:01:00.0.bin")
 	case $board in
+	askey,rt4230w-rev6 |\
 	asrock,g10)
 		if [ -b "$(find_mtd_part 0:art)" ]; then
 			caldata_extract "0:art" 0x1000 0x2f20
@@ -68,6 +69,7 @@ case "$FIRMWARE" in
 	;;
 "ath10k/pre-cal-pci-0001:01:00.0.bin")
 	case $board in
+	askey,rt4230w-rev6 |\
 	asrock,g10)
 		if [ -b "$(find_mtd_part 0:art)" ]; then
 			caldata_extract "0:art" 0x5000 0x2f20
diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
index 4dc612492c..a5e18201df 100644
--- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
@@ -10,15 +10,7 @@ platform_check_image() {
 
 platform_do_upgrade() {
 	case "$(board_name)" in
-	asrock,g10)
-		asrock_upgrade_prepare
-		nand_do_upgrade "$1"
-		;;
-	buffalo,wxr-2533dhp)
-		buffalo_upgrade_prepare_ubi
-		CI_ROOTPART="ubi_rootfs"
-		nand_do_upgrade "$1"
-		;;
+	askey,rt4230w-rev6 |\
 	compex,wpq864|\
 	netgear,d7800 |\
 	netgear,r7500 |\
@@ -28,6 +20,15 @@ platform_do_upgrade() {
 	qcom,ipq8064-ap161)
 		nand_do_upgrade "$1"
 		;;
+	asrock,g10)
+		asrock_upgrade_prepare
+		nand_do_upgrade "$1"
+		;;
+	buffalo,wxr-2533dhp)
+		buffalo_upgrade_prepare_ubi
+		CI_ROOTPART="ubi_rootfs"
+		nand_do_upgrade "$1"
+		;;
 	edgecore,ecw5410)
 		part="$(awk -F 'ubi.mtd=' '{printf $2}' /proc/cmdline | sed -e 's/ .*$//')"
 		if [ "$part" = "rootfs1" ]; then
diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-rt4230w-rev6.dts b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-rt4230w-rev6.dts
new file mode 100644
index 0000000000..7342de4bec
--- /dev/null
+++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065-rt4230w-rev6.dts
@@ -0,0 +1,303 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "qcom-ipq8065.dtsi"
+#include <dt-bindings/input/input.h>
+
+/ {
+	model = "Askey RT4230W REV6";
+	compatible = "askey,rt4230w-rev6", "qcom,ipq8065", "qcom,ipq8064";
+
+	memory at 0 {
+		reg = <0x42000000 0x3e000000>;
+		device_type = "memory";
+	};
+
+	aliases {
+		led-boot = &ledctrl3;
+		led-failsafe = &ledctrl1;
+		led-running = &ledctrl2;
+		led-upgrade = &ledctrl3;
+	};
+
+	chosen {
+		bootargs = "rootfstype=squashfs noinitrd";
+	};
+
+	keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&button_pins>;
+		pinctrl-names = "default";
+
+		reset {
+			label = "reset";
+			gpios = <&qcom_pinmux 54 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&qcom_pinmux 68 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&led_pins>;
+		pinctrl-names = "default";
+
+		ledctrl1: ledctrl1 {
+			label = "ledctrl1";
+			gpios = <&qcom_pinmux 22 GPIO_ACTIVE_HIGH>;
+		};
+
+		ledctrl2: ledctrl2 {
+			label = "ledctrl2";
+			gpios = <&qcom_pinmux 23 GPIO_ACTIVE_HIGH>;
+		};
+
+		ledctrl3: ledctrl3 {
+			label = "ledctrl3";
+			gpios = <&qcom_pinmux 24 GPIO_ACTIVE_HIGH>;
+		};
+	};
+};
+
+&qcom_pinmux {
+	button_pins: button_pins {
+		mux {
+			pins = "gpio54", "gpio68";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-pull-up;
+		};
+	};
+
+	led_pins: led_pins {
+		mux {
+			pins = "gpio22", "gpio23", "gpio24";
+			function = "gpio";
+			drive-strength = <2>;
+			bias-pull-down;
+		};
+	};
+
+	rgmii2_pins: rgmii2_pins {
+		mux {
+			pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31",
+				"gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62";
+			function = "rgmii2";
+			drive-strength = <8>;
+			bias-disable;
+		};
+
+		tx {
+			pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32";
+			input-disable;
+		};
+	};
+};
+
+&nand_controller {
+	status = "okay";
+
+	pinctrl-0 = <&nand_pins>;
+	pinctrl-names = "default";
+
+	nand at 0 {
+		reg = <0>;
+		compatible = "qcom,nandcs";
+
+		nand-ecc-strength = <4>;
+		nand-bus-width = <8>;
+		nand-ecc-step-size = <512>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "0:SBL1";
+				reg = <0x0000000 0x0040000>;
+				read-only;
+			};
+			partition at 40000 {
+				label = "0:MIBIB";
+				reg = <0x0040000 0x0140000>;
+				read-only;
+			};
+			partition at 180000 {
+				label = "0:SBL2";
+				reg = <0x0180000 0x0140000>;
+				read-only;
+			};
+			partition at 2c0000 {
+				label = "0:SBL3";
+				reg = <0x02c0000 0x0280000>;
+				read-only;
+			};
+			partition at 540000 {
+				label = "0:DDRCONFIG";
+				reg = <0x0540000 0x0120000>;
+				read-only;
+			};
+			partition at 660000 {
+				label = "0:SSD";
+				reg = <0x0660000 0x0120000>;
+				read-only;
+			};
+			partition at 780000 {
+				label = "0:TZ";
+				reg = <0x0780000 0x0280000>;
+				read-only;
+			};
+			partition at a00000 {
+				label = "0:RPM";
+				reg = <0x0a00000 0x0280000>;
+				read-only;
+			};
+			partition at c80000 {
+				label = "0:APPSBL";
+				reg = <0x0c80000 0x0500000>;
+				read-only;
+			};
+			partition at 1180000 {
+				label = "0:APPSBLENV";
+				reg = <0x1180000 0x0080000>;
+			};
+			ART: partition at 1200000 {
+				label = "0:ART";
+				reg = <0x1200000 0x0140000>;
+				read-only;
+			};
+			partition at 1340000 {
+				label = "0:BOOTCONFIG";
+				reg = <0x1340000 0x0060000>;
+				read-only;
+			};
+			partition at 13a0000 {
+				label = "0:SBL2_1";
+				reg = <0x13a0000 0x0140000>;
+				read-only;
+			};
+			partition at 14e0000 {
+				label = "0:SBL3_1";
+				reg = <0x14e0000 0x0280000>;
+				read-only;
+			};
+			partition at 1760000 {
+				label = "0:DDRCONFIG_1";
+				reg = <0x1760000 0x0120000>;
+				read-only;
+			};
+			partition at 1880000 {
+				label = "0:SSD_1";
+				reg = <0x1880000 0x0120000>;
+				read-only;
+			};
+			partition at 19a0000 {
+				label = "0:TZ_1";
+				reg = <0x19a0000 0x0280000>;
+				read-only;
+			};
+			partition at 1c20000 {
+				label = "0:RPM_1";
+				reg = <0x1c20000 0x0280000>;
+				read-only;
+			};
+			partition at 1ea0000 {
+				label = "0:BOOTCONFIG1";
+				reg = <0x1ea0000 0x0060000>;
+				read-only;
+			};
+			partition at 1f00000 {
+				label = "0:APPSBL_1";
+				reg = <0x1f00000 0x0500000>;
+				read-only;
+			};
+			partition at 2400000 {
+				label = "ubi";
+				reg = <0x2400000 0x1a000000>;
+			};
+		};
+	};
+};
+
+&mdio0 {
+	status = "okay";
+
+	pinctrl-0 = <&mdio0_pins>;
+	pinctrl-names = "default";
+
+	phy0: ethernet-phy at 0 {
+		reg = <0x0>;
+		qca,ar8327-initvals = <
+			0x00004 0x7600000   /* PAD0_MODE */
+			0x00008 0x1000000   /* PAD5_MODE */
+			0x0000c 0x80        /* PAD6_MODE */
+			0x000e4 0xaa545     /* MAC_POWER_SEL */
+			0x000e0 0xc74164de  /* SGMII_CTRL */
+			0x0007c 0x4e        /* PORT0_STATUS */
+			0x00094 0x4e        /* PORT6_STATUS */
+			0x00050 0xcf02cf02  /* LED_CTRL_0 */
+			0x00054 0xc832c832  /* LED_CTRL_1 */
+			>;
+	};
+};
+
+&gmac0 {
+	status = "okay";
+	phy-mode = "rgmii";
+	qcom,id = <0>;
+
+	mtd-mac-address = <&ART 0x0>;
+
+	pinctrl-0 = <&rgmii2_pins>;
+	pinctrl-names = "default";
+
+	fixed-link {
+		speed = <1000>;
+		full-duplex;
+	};
+};
+
+&gmac1 {
+	status = "okay";
+	phy-mode = "sgmii";
+	qcom,id = <1>;
+
+	mtd-mac-address = <&ART 0x6>;
+
+	fixed-link {
+		speed = <1000>;
+		full-duplex;
+	};
+};
+
+&adm_dma {
+	status = "okay";
+};
+
+&usb3_0 {
+	status = "okay";
+	clocks = <&gcc USB30_1_MASTER_CLK>;
+};
+
+&usb3_1 {
+	status = "okay";
+	clocks = <&gcc USB30_0_MASTER_CLK>;
+};
+
+&pcie0 {
+	status = "okay";
+	reset-gpio = <&qcom_pinmux 3 GPIO_ACTIVE_HIGH>;
+	/delete-property/ perst-gpios;
+};
+
+&pcie1 {
+	status = "okay";
+	reset-gpio = <&qcom_pinmux 48 GPIO_ACTIVE_HIGH>;
+	/delete-property/ perst-gpios;
+	force_gen1 = <1>;
+};
diff --git a/target/linux/ipq806x/image/Makefile b/target/linux/ipq806x/image/Makefile
index 6c091be335..e53fba1e1d 100644
--- a/target/linux/ipq806x/image/Makefile
+++ b/target/linux/ipq806x/image/Makefile
@@ -90,6 +90,19 @@ define Device/ZyXELImage
 	IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to $$$$(BLOCKSIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata
 endef
 
+define Device/askey_rt4230w-rev6
+	$(call Device/LegacyImage)
+	DEVICE_VENDOR := Askey
+	DEVICE_MODEL := RT4230W
+	DEVICE_VARIANT := REV6
+	SOC := qcom-ipq8065
+	BLOCKSIZE := 128k
+	PAGESIZE := 2048
+	DEVICE_PACKAGES := ath10k-firmware-qca9984-ct
+	KERNEL_IN_UBI := 1
+endef
+TARGET_DEVICES += askey_rt4230w-rev6
+
 define Device/asrock_g10
 	$(call Device/FitImage)
 	$(call Device/UbiFit)
diff --git a/target/linux/ipq806x/patches-5.10/0069-arm-boot-add-dts-files.patch b/target/linux/ipq806x/patches-5.10/0069-arm-boot-add-dts-files.patch
index a8e17afd42..87d6b65694 100644
--- a/target/linux/ipq806x/patches-5.10/0069-arm-boot-add-dts-files.patch
+++ b/target/linux/ipq806x/patches-5.10/0069-arm-boot-add-dts-files.patch
@@ -10,7 +10,7 @@ Signed-off-by: John Crispin <john at phrozen.org>
 
 --- a/arch/arm/boot/dts/Makefile
 +++ b/arch/arm/boot/dts/Makefile
-@@ -907,8 +907,25 @@ dtb-$(CONFIG_ARCH_QCOM) += \
+@@ -907,8 +907,26 @@ dtb-$(CONFIG_ARCH_QCOM) += \
  	qcom-ipq4019-ap.dk04.1-c3.dtb \
  	qcom-ipq4019-ap.dk07.1-c1.dtb \
  	qcom-ipq4019-ap.dk07.1-c2.dtb \
@@ -32,6 +32,7 @@ Signed-off-by: John Crispin <john at phrozen.org>
 +	qcom-ipq8064-wxr-2533dhp.dtb \
 +	qcom-ipq8065-nbg6817.dtb \
 +	qcom-ipq8065-r7800.dtb \
++	qcom-ipq8065-rt4230w-rev6.dtb \
 +	qcom-ipq8068-ecw5410.dtb \
  	qcom-msm8660-surf.dtb \
  	qcom-msm8960-cdp.dtb \
diff --git a/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch b/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch
index 055a4cbc30..b97d36fd7c 100644
--- a/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch
+++ b/target/linux/ipq806x/patches-5.4/0069-arm-boot-add-dts-files.patch
@@ -10,7 +10,7 @@ Signed-off-by: John Crispin <john at phrozen.org>
 
 --- a/arch/arm/boot/dts/Makefile
 +++ b/arch/arm/boot/dts/Makefile
-@@ -842,7 +842,24 @@ dtb-$(CONFIG_ARCH_QCOM) += \
+@@ -842,7 +842,25 @@ dtb-$(CONFIG_ARCH_QCOM) += \
  	qcom-ipq4019-ap.dk04.1-c3.dtb \
  	qcom-ipq4019-ap.dk07.1-c1.dtb \
  	qcom-ipq4019-ap.dk07.1-c2.dtb \
@@ -31,6 +31,7 @@ Signed-off-by: John Crispin <john at phrozen.org>
 +	qcom-ipq8064-wxr-2533dhp.dtb \
 +	qcom-ipq8065-nbg6817.dtb \
 +	qcom-ipq8065-r7800.dtb \
++	qcom-ipq8065-rt4230w-rev6.dtb \
 +	qcom-ipq8068-ecw5410.dtb \
  	qcom-msm8660-surf.dtb \
  	qcom-msm8960-cdp.dtb \


From lede-commits at lists.infradead.org  Sat Jun  5 15:27:45 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:27:45 -0400
Subject: [openwrt/openwrt] layerscape: armv8_64b: enable
 CONFIG_ARM_PSCI_CPUIDLE
In-Reply-To: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
References: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
Message-ID: <mailman.3336.1622932066.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/e34cc5eb377ce94a8e1717546a4e156a9bd4984b

commit e34cc5eb377ce94a8e1717546a4e156a9bd4984b
Author: Martin Schiller <ms at dev.tdt.de>
AuthorDate: Wed May 19 12:33:26 2021 +0200

    layerscape: armv8_64b: enable CONFIG_ARM_PSCI_CPUIDLE
    
    Enable PSCI firmware based CPUidle driver.
    PSCI firmware is the standard power management control for all ARM64
    based platforms.
    
    Signed-off-by: Martin Schiller <ms at dev.tdt.de>
---
 target/linux/layerscape/armv8_64b/config-5.4 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/layerscape/armv8_64b/config-5.4 b/target/linux/layerscape/armv8_64b/config-5.4
index ac2a6f1918..f72154f290 100644
--- a/target/linux/layerscape/armv8_64b/config-5.4
+++ b/target/linux/layerscape/armv8_64b/config-5.4
@@ -56,6 +56,7 @@ CONFIG_ARM_GIC_V3_ITS=y
 CONFIG_ARM_GIC_V3_ITS_FSL_MC=y
 CONFIG_ARM_GIC_V3_ITS_PCI=y
 # CONFIG_ARM_PL172_MPMC is not set
+CONFIG_ARM_PSCI_CPUIDLE=y
 CONFIG_ARM_PSCI_FW=y
 CONFIG_ARM_SMMU=y
 # CONFIG_ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT is not set


From lede-commits at lists.infradead.org  Sat Jun  5 15:27:48 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:27:48 -0400
Subject: [openwrt/openwrt]  tools/isl: bump to 0.24
In-Reply-To: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
References: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
Message-ID: <mailman.3337.1622932066.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/609aa3978393d7436e5c9caba89d3356af021c80

commit 609aa3978393d7436e5c9caba89d3356af021c80
Author: Rui Salvaterra <rsalvaterra at gmail.com>
AuthorDate: Thu May 27 11:56:37 2021 +0100

    tools/isl: bump to 0.24
    
    Tested with Graphite and -floop-nest-optimize, without issues.
    
    Signed-off-by: Rui Salvaterra <rsalvaterra at gmail.com>
---
 tools/isl/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/isl/Makefile b/tools/isl/Makefile
index c1000e1e31..be372fe2a8 100644
--- a/tools/isl/Makefile
+++ b/tools/isl/Makefile
@@ -7,11 +7,11 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=isl
-PKG_VERSION:=0.20
+PKG_VERSION:=0.24
 
 PKG_SOURCE_URL:=http://isl.gforge.inria.fr
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_HASH:=a5596a9fb8a5b365cb612e4b9628735d6e67e9178fae134a816ae195017e77aa
+PKG_HASH:=043105cc544f416b48736fff8caf077fb0663a717d06b1113f16e391ac99ebad
 
 HOST_BUILD_PARALLEL:=1
 


From lede-commits at lists.infradead.org  Sat Jun  5 15:27:43 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:27:43 -0400
Subject: [openwrt/openwrt]  x86: kernel: enable Fusion-MPT SAS driver
In-Reply-To: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
References: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
Message-ID: <mailman.3338.1622932068.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/8716dda0743454e3949b815613542a4d00fc2a09

commit 8716dda0743454e3949b815613542a4d00fc2a09
Author: Mark Carroll <git at markcarroll.net>
AuthorDate: Sat May 8 11:42:50 2021 +0000

    x86: kernel: enable Fusion-MPT SAS driver
    
    Compile in MPT SAS driver required to mount rootfs on some VMWare
    systems (e.g. required for 1&1 IONOS).
    
    Signed-off-by: Mark Carroll <git at markcarroll.net>
---
 target/linux/x86/64/config-5.10 | 1 +
 target/linux/x86/64/config-5.4  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/target/linux/x86/64/config-5.10 b/target/linux/x86/64/config-5.10
index 7c5a698c97..2db2f4998b 100644
--- a/target/linux/x86/64/config-5.10
+++ b/target/linux/x86/64/config-5.10
@@ -184,6 +184,7 @@ CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
 # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
 CONFIG_FREEZER=y
+CONFIG_FUSION_SAS=y
 CONFIG_FW_CACHE=y
 CONFIG_GART_IOMMU=y
 CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
diff --git a/target/linux/x86/64/config-5.4 b/target/linux/x86/64/config-5.4
index ef03eaa234..b97b9f64c1 100644
--- a/target/linux/x86/64/config-5.4
+++ b/target/linux/x86/64/config-5.4
@@ -183,6 +183,7 @@ CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
 # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
 CONFIG_FREEZER=y
+CONFIG_FUSION_SAS=y
 CONFIG_GART_IOMMU=y
 CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
 CONFIG_GENERIC_CPU=y


From lede-commits at lists.infradead.org  Sat Jun  5 15:27:47 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:27:47 -0400
Subject: [openwrt/openwrt]  toolchain: gdb: Add optional python support
In-Reply-To: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
References: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
Message-ID: <mailman.3341.1622932068.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/74417f8b3a803c59995887e20437394e1abeaaa2

commit 74417f8b3a803c59995887e20437394e1abeaaa2
Author: Hauke Mehrtens <hmehrtens at maxlinear.com>
AuthorDate: Fri May 28 18:35:40 2021 +0200

    toolchain: gdb: Add optional python support
    
    Compile gdb with python support optionally.
    
    To use the Python support in gdb some extra python files are needed,
    install them too. While at it also install other shared files which we
    did not install before.
    
    If gdb is built without Python support the python folder does not
    exists.
    
    Signed-off-by: Hauke Mehrtens <hmehrtens at maxlinear.com>
---
 toolchain/Config.in    |  8 ++++++++
 toolchain/gdb/Makefile | 11 ++++++++++-
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/toolchain/Config.in b/toolchain/Config.in
index 6dda9af92d..8ff5438d79 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -259,6 +259,14 @@ config GDB
 	help
 	  Enable if you want to build the gdb.
 
+config GDB_PYTHON
+	bool
+	depends on GDB
+	prompt "Build gdb with python binding"
+	
+	help
+	  Enable the python bindings for GDB to allow using python in the gdb shell.
+
 config USE_GLIBC
 	default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc)
 	bool
diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile
index 05e3c7de3c..2708eff869 100644
--- a/toolchain/gdb/Makefile
+++ b/toolchain/gdb/Makefile
@@ -36,7 +36,6 @@ HOST_CONFIGURE_ARGS = \
 	--without-included-gettext \
 	--enable-threads \
 	--with-expat \
-	--without-python \
 	--disable-unit-tests \
 	--disable-ubsan \
 	--disable-binutils \
@@ -44,11 +43,21 @@ HOST_CONFIGURE_ARGS = \
 	--disable-gas \
 	--disable-sim
 
+ifneq ($(CONFIG_GDB_PYTHON),)
+  HOST_CONFIGURE_ARGS+= --with-python
+else
+  HOST_CONFIGURE_ARGS:= --without-python
+endif
+
 define Host/Install
 	mkdir -p $(TOOLCHAIN_DIR)/bin
 	$(INSTALL_BIN) $(HOST_BUILD_DIR)/gdb/gdb $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb
 	ln -fs $(TARGET_CROSS)gdb $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb
 	strip $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb
+	mkdir -p $(TOOLCHAIN_DIR)/share/gdb
+	-cp -R $(HOST_BUILD_DIR)/gdb/data-directory/python $(TOOLCHAIN_DIR)/share/gdb/
+	cp -R $(HOST_BUILD_DIR)/gdb/data-directory/syscalls $(TOOLCHAIN_DIR)/share/gdb/
+	cp -R $(HOST_BUILD_DIR)/gdb/data-directory/system-gdbinit $(TOOLCHAIN_DIR)/share/gdb/
 endef
 
 define Host/Clean


From lede-commits at lists.infradead.org  Sat Jun  5 15:27:49 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:27:49 -0400
Subject: [openwrt/openwrt]  ipq40xx: add uboot-envtools to default packages
In-Reply-To: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
References: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
Message-ID: <mailman.3342.1622932068.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/1984a6bbcaac95c439dd4a6eba2f78c54e9be215

commit 1984a6bbcaac95c439dd4a6eba2f78c54e9be215
Author: Tomasz Maciej Nowak <tmn505 at gmail.com>
AuthorDate: Tue May 25 15:26:06 2021 +0200

    ipq40xx: add uboot-envtools to default packages
    
    When support for Luma WRTQ-329ACN was added, the instructions for
    flashing this device include using tools from uboot-envtools package.
    Unfortunately the OpenWrt buildroot system omits packages from
    DEVICE_PACKAGES when CONFIG_TARGET_MULTI_PROFILE,
    CONFIG_TARGET_PER_DEVICE_ROOTFS, CONFIG_TARGET_ALL_PROFILES are set. In
    result the official images are without tools mentioned in the
    instruction. The workoround for the fashing would be installing
    uboot-envtools when booted with initramfs image, but not always the
    access to internet is available. The other method would be to issue the
    necesary command in U-Boot environment but some serial terminals default
    configuration don't work well with pasting lines longer than 80 chars.
    Therefore add uboot-envtools to default packages, which adds really
    small flash footprint to rootfs, where increased size usually is not an
    issue.
    
    Signed-off-by: Tomasz Maciej Nowak <tmn505 at gmail.com>
---
 target/linux/ipq40xx/Makefile         |  3 ++-
 target/linux/ipq40xx/image/generic.mk | 28 ++++++++++++----------------
 2 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/target/linux/ipq40xx/Makefile b/target/linux/ipq40xx/Makefile
index 43b1fcb0f9..400612376c 100644
--- a/target/linux/ipq40xx/Makefile
+++ b/target/linux/ipq40xx/Makefile
@@ -18,6 +18,7 @@ DEFAULT_PACKAGES += \
 	kmod-usb-dwc3-qcom \
 	kmod-leds-gpio kmod-gpio-button-hotplug swconfig \
 	kmod-ath10k-ct wpad-basic-wolfssl \
-	kmod-usb3 kmod-usb-dwc3 ath10k-firmware-qca4019-ct
+	kmod-usb3 kmod-usb-dwc3 ath10k-firmware-qca4019-ct \
+	uboot-envtools
 
 $(eval $(call BuildTarget))
diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk
index 2d6186ed99..68e565594d 100644
--- a/target/linux/ipq40xx/image/generic.mk
+++ b/target/linux/ipq40xx/image/generic.mk
@@ -131,8 +131,7 @@ define Device/alfa-network_ap120c-ac
 	DEVICE_VENDOR := ALFA Network
 	DEVICE_MODEL := AP120C-AC
 	SOC := qcom-ipq4018
-	DEVICE_PACKAGES := kmod-usb-acm \
-		kmod-tpm-i2c-atmel uboot-envtools
+	DEVICE_PACKAGES := kmod-usb-acm kmod-tpm-i2c-atmel
 	BLOCKSIZE := 128k
 	PAGESIZE := 2048
 	IMAGE_SIZE := 65536k
@@ -151,7 +150,6 @@ endef
 define Device/aruba_ap-303
 	$(call Device/aruba_glenmorangie)
 	DEVICE_MODEL := AP-303
-	DEVICE_PACKAGES += uboot-envtools
 endef
 TARGET_DEVICES += aruba_ap-303
 
@@ -164,7 +162,7 @@ TARGET_DEVICES += aruba_ap-303h
 define Device/aruba_ap-365
 	$(call Device/aruba_glenmorangie)
 	DEVICE_MODEL := AP-365
-	DEVICE_PACKAGES += kmod-hwmon-ad7418 uboot-envtools
+	DEVICE_PACKAGES += kmod-hwmon-ad7418
 endef
 TARGET_DEVICES += aruba_ap-365
 
@@ -247,7 +245,7 @@ define Device/buffalo_wtr-m2133hp
 	DEVICE_VENDOR := Buffalo
 	DEVICE_MODEL := WTR-M2133HP
 	SOC := qcom-ipq4019
-	DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9984-ct ipq-wifi-buffalo_wtr-m2133hp
+	DEVICE_PACKAGES := ath10k-firmware-qca9984-ct ipq-wifi-buffalo_wtr-m2133hp
 	BLOCKSIZE := 128k
 	PAGESIZE := 2048
 endef
@@ -328,7 +326,7 @@ define Device/devolo_magic-2-wifi-next
 	IMAGE_SIZE := 26624k
 	IMAGES := sysupgrade.bin
 	IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
-	DEVICE_PACKAGES := ipq-wifi-devolo_magic-2-wifi-next uboot-envtools
+	DEVICE_PACKAGES := ipq-wifi-devolo_magic-2-wifi-next
 endef
 TARGET_DEVICES += devolo_magic-2-wifi-next
 
@@ -367,7 +365,7 @@ define Device/edgecore_ecw5211
 	SOC := qcom-ipq4018
 	BLOCKSIZE := 128k
 	PAGESIZE := 2048
-	DEVICE_PACKAGES := kmod-tpm-i2c-atmel kmod-usb-acm uboot-envtools
+	DEVICE_PACKAGES := kmod-tpm-i2c-atmel kmod-usb-acm
 endef
 TARGET_DEVICES += edgecore_ecw5211
 
@@ -551,7 +549,6 @@ define Device/linksys_ea6350v3
 	UBINIZE_OPTS := -E 5
 	IMAGES += factory.bin
 	IMAGE/factory.bin := append-kernel | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA6350v3
-	DEVICE_PACKAGES := uboot-envtools
 endef
 TARGET_DEVICES += linksys_ea6350v3
 
@@ -567,7 +564,7 @@ define Device/linksys_ea8300
 	UBINIZE_OPTS := -E 5    # EOD marks to "hide" factory sig at EOF
 	IMAGES += factory.bin
 	IMAGE/factory.bin  := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA8300
-	DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9888-ct ipq-wifi-linksys_ea8300 kmod-usb-ledtrig-usbport
+	DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-linksys_ea8300 kmod-usb-ledtrig-usbport
 endef
 TARGET_DEVICES += linksys_ea8300
 
@@ -583,7 +580,7 @@ define Device/linksys_mr8300
 	UBINIZE_OPTS := -E 5    # EOD marks to "hide" factory sig at EOF
 	IMAGES += factory.bin
 	IMAGE/factory.bin  := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=MR8300
-	DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9888-ct ipq-wifi-linksys_mr8300-v0 kmod-usb-ledtrig-usbport
+	DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-linksys_mr8300-v0 kmod-usb-ledtrig-usbport
 endef
 TARGET_DEVICES += linksys_mr8300
 
@@ -592,7 +589,7 @@ define Device/luma_wrtq-329acn
 	DEVICE_VENDOR := Luma Home
 	DEVICE_MODEL := WRTQ-329ACN
 	SOC := qcom-ipq4018
-	DEVICE_PACKAGES := ipq-wifi-luma_wrtq-329acn kmod-ath3k kmod-eeprom-at24 kmod-i2c-gpio uboot-envtools
+	DEVICE_PACKAGES := ipq-wifi-luma_wrtq-329acn kmod-ath3k kmod-eeprom-at24 kmod-i2c-gpio
 	IMAGE_SIZE := 76632k
 	BLOCKSIZE := 128k
 	PAGESIZE := 2048
@@ -673,7 +670,6 @@ define Device/openmesh_a42
 	IMAGES += factory.bin
 	IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A42
 	IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
-	DEVICE_PACKAGES := uboot-envtools
 endef
 TARGET_DEVICES += openmesh_a42
 
@@ -689,7 +685,7 @@ define Device/openmesh_a62
 	IMAGES += factory.bin
 	IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A62
 	IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
-	DEVICE_PACKAGES := ath10k-firmware-qca9888-ct uboot-envtools
+	DEVICE_PACKAGES := ath10k-firmware-qca9888-ct
 endef
 TARGET_DEVICES += openmesh_a62
 
@@ -705,7 +701,7 @@ define Device/plasmacloud_pa1200
 	IMAGES += factory.bin
 	IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA1200
 	IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
-	DEVICE_PACKAGES := uboot-envtools ipq-wifi-plasmacloud-pa1200
+	DEVICE_PACKAGES := ipq-wifi-plasmacloud-pa1200
 endef
 TARGET_DEVICES += plasmacloud_pa1200
 
@@ -721,7 +717,7 @@ define Device/plasmacloud_pa2200
 	IMAGES += factory.bin
 	IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA2200
 	IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
-	DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-plasmacloud-pa2200 uboot-envtools
+	DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-plasmacloud-pa2200
 endef
 TARGET_DEVICES += plasmacloud_pa2200
 
@@ -815,7 +811,7 @@ define Device/zyxel_nbg6617
 #	this minimum-size. However, the larger image can be flashed both ways.
 	IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k | check-size $$$$(ROOTFS_SIZE) | zyxel-ras-image separate-kernel
 	IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | check-size $$$$(ROOTFS_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata
-	DEVICE_PACKAGES := uboot-envtools kmod-usb-ledtrig-usbport
+	DEVICE_PACKAGES := kmod-usb-ledtrig-usbport
 endef
 TARGET_DEVICES += zyxel_nbg6617
 


From lede-commits at lists.infradead.org  Sat Jun  5 15:27:42 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:27:42 -0400
Subject: [openwrt/openwrt]  ath10k-ct: update to latest version
In-Reply-To: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
References: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
Message-ID: <mailman.3343.1622932068.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/2e10ed925e1e07c28570731a429efa5e7de3b826

commit 2e10ed925e1e07c28570731a429efa5e7de3b826
Author: Michael Yartys <michael.yartys at protonmail.com>
AuthorDate: Thu Jun 3 23:50:12 2021 +0200

    ath10k-ct: update to latest version
    
    Changelog:
    - ath10k-ct: Add security fixes.
    - ath10k-ct: Add 5.12 kernel version.
    - ath10k-ct: Fix the beacon/mcast/bcast override issue
    - ath10k-ct 5.7: Fix setting mcast/bcast/beacon rate from debugfs.
    - ath10k-ct: Add 5.11 driver.
    
    Delete upstreamed patch and refresh the rest. Also, use the opportunity to
    set PKG_RELEASE to $(AUTORELEASE).
    
    Runtime-tested on ipq806x (Netgear R7800).
    
    Signed-off-by: Michael Yartys <michael.yartys at protonmail.com>
---
 package/kernel/ath10k-ct/Makefile                  |  8 ++---
 .../164-ath10k-commit-rates-from-mac80211.patch    | 37 ----------------------
 ...-controlling-support-for-various-chipsets.patch |  4 +--
 .../202-ath10k-use-tpt-trigger-by-default.patch    |  4 +--
 4 files changed, 8 insertions(+), 45 deletions(-)

diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile
index a225bd8b19..f06d7cf132 100644
--- a/package/kernel/ath10k-ct/Makefile
+++ b/package/kernel/ath10k-ct/Makefile
@@ -1,16 +1,16 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ath10k-ct
-PKG_RELEASE=2
+PKG_RELEASE=$(AUTORELEASE)
 
 PKG_LICENSE:=GPLv2
 PKG_LICENSE_FILES:=
 
 PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2021-01-11
-PKG_SOURCE_VERSION:=9fe1df7d4f783b6b0cd1c99d11979e5a6e6fc40b
-PKG_MIRROR_HASH:=4e30e256716611045e930b95eadaa8bfcadd5bdd8bbe3869cfe0f377920e812b
+PKG_SOURCE_DATE:=2021-06-03
+PKG_SOURCE_VERSION:=b44cd7b2e7b0df5995ece18f358d4dfc40834ba1
+PKG_MIRROR_HASH:=59f961ad425eb1a48fa9c391a325cc0f23845daec9d12673445d3077f9756cf0
 
 # Build the 5.10 ath10k-ct driver version.
 # Probably this should match as closely as
diff --git a/package/kernel/ath10k-ct/patches/164-ath10k-commit-rates-from-mac80211.patch b/package/kernel/ath10k-ct/patches/164-ath10k-commit-rates-from-mac80211.patch
deleted file mode 100644
index 842f3ea2a5..0000000000
--- a/package/kernel/ath10k-ct/patches/164-ath10k-commit-rates-from-mac80211.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-From: Sven Eckelmann <sven at narfation.org>
-Date: Tue, 26 Feb 2019 08:06:35 +0100
-Subject: ath10k-ct: apply mac80211 rates to ath10k-ct rate state
-
-The rates from mac80211 have to be copied to the state of ath10k-ct or
-otherwise the ath10k_check_apply_special_rates function overwrites
-them again with some default values. This breaks for example the
-mcast_rate set for a wifi-iface.
-
-Signed-off-by: Sven Eckelmann <sven at narfation.org>
-
---- a/ath10k-5.10/mac.c
-+++ b/ath10k-5.10/mac.c
-@@ -6774,6 +6774,7 @@ static void ath10k_recalculate_mgmt_rate
- 		return;
- 	}
- 
-+	arvif->mgt_rate[def->chan->band] = hw_rate_code;
- 	vdev_param = ar->wmi.vdev_param->mgmt_rate;
- 	ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
- 					hw_rate_code);
-@@ -7000,6 +7001,7 @@ static void ath10k_bss_info_changed(stru
- 			   "mac vdev %d mcast_rate %x\n",
- 			   arvif->vdev_id, rate);
- 
-+		arvif->mcast_rate[band] = rate;
- 		vdev_param = ar->wmi.vdev_param->mcast_data_rate;
- 		ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id,
- 						vdev_param, rate);
-@@ -7008,6 +7010,7 @@ static void ath10k_bss_info_changed(stru
- 				    "failed to set mcast rate on vdev %i: %d\n",
- 				    arvif->vdev_id,  ret);
- 
-+		arvif->bcast_rate[band] = rate;
- 		vdev_param = ar->wmi.vdev_param->bcast_data_rate;
- 		ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id,
- 						vdev_param, rate);
diff --git a/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
index 749e796148..691b504c0f 100644
--- a/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
+++ b/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
@@ -210,7 +210,7 @@ v13:
  
  #include "htt.h"
  #include "htc.h"
-@@ -1551,6 +1552,13 @@ struct ath10k {
+@@ -1557,6 +1558,13 @@ struct ath10k {
  	} testmode;
  
  	struct {
@@ -445,7 +445,7 @@ v13:
  {
 --- a/ath10k-5.10/wmi-tlv.c
 +++ b/ath10k-5.10/wmi-tlv.c
-@@ -4585,6 +4585,8 @@ static const struct wmi_ops wmi_tlv_ops
+@@ -4594,6 +4594,8 @@ static const struct wmi_ops wmi_tlv_ops
  	.gen_echo = ath10k_wmi_tlv_op_gen_echo,
  	.gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf,
  	.gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable,
diff --git a/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch
index eae779ef58..6205c9b661 100644
--- a/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch
+++ b/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch
@@ -16,7 +16,7 @@ Signed-off-by: Mathias Kresin <dev at kresin.me>
 
 --- a/ath10k-5.10/core.h
 +++ b/ath10k-5.10/core.h
-@@ -1659,6 +1659,10 @@ struct ath10k {
+@@ -1665,6 +1665,10 @@ struct ath10k {
  	u8 csi_data[4096];
  	u16 csi_data_len;
  
@@ -42,7 +42,7 @@ Signed-off-by: Mathias Kresin <dev at kresin.me>
  	if (ret)
 --- a/ath10k-5.10/mac.c
 +++ b/ath10k-5.10/mac.c
-@@ -11400,7 +11400,7 @@ int ath10k_mac_register(struct ath10k *a
+@@ -11403,7 +11403,7 @@ int ath10k_mac_register(struct ath10k *a
  	ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
  
  #ifdef CPTCFG_MAC80211_LEDS


From lede-commits at lists.infradead.org  Sat Jun  5 15:27:46 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:27:46 -0400
Subject: [openwrt/openwrt] ipq806x: fix LAN and WAN port assignments on
 TP-Link AD7200
In-Reply-To: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
References: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
Message-ID: <mailman.3344.1622932069.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/6fb27e8e6d05ed426f200242fdc1710f6f849127

commit 6fb27e8e6d05ed426f200242fdc1710f6f849127
Author: Alex Henrie <alexhenrie24 at gmail.com>
AuthorDate: Thu Jun 3 22:37:49 2021 -0600

    ipq806x: fix LAN and WAN port assignments on TP-Link AD7200
    
    LAN port 4 was swapped with the WAN port and the remaining three LAN
    ports were numbered in reverse order from their labels on the case.
    
    Fixes: 1a775a4fd033 ("ipq806x: add support for TP-Link Talon AD7200")
    Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
 target/linux/ipq806x/base-files/etc/board.d/02_network | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network
index 22d607b0ec..1a1cec51aa 100644
--- a/target/linux/ipq806x/base-files/etc/board.d/02_network
+++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
@@ -57,7 +57,6 @@ nec,wg2600hp3)
 		"2:lan" "3:lan" "4:lan" "5:lan" "0 at eth1" "1:wan" "6 at eth0"
 	;;
 netgear,r7800 |\
-tplink,ad7200 |\
 tplink,c2600)
 	ucidef_add_switch "switch0" \
 		"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "6 at eth1" "5:wan" "0 at eth0"
@@ -72,6 +71,10 @@ qcom,ipq8064-db149)
 	ucidef_add_switch "switch0" \
 		"1:lan" "2:lan" "3:lan" "4:lan" "6u at eth1" "5:wan" "0u at eth0"
 	;;
+tplink,ad7200)
+	ucidef_add_switch "switch0" \
+		"2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "6 at eth1" "1:wan" "0 at eth0"
+	;;
 ubnt,unifi-ac-hd)
 	ucidef_set_interface_lan "eth0 eth1"
 	;;


From lede-commits at lists.infradead.org  Sat Jun  5 15:27:40 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:27:40 -0400
Subject: [openwrt/openwrt]  kernel: bump 5.10 to 5.10.42
In-Reply-To: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
References: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
Message-ID: <mailman.3345.1622932071.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/da77b9c2f185db72a2917aa2e18f0c8bb164d3c4

commit da77b9c2f185db72a2917aa2e18f0c8bb164d3c4
Author: Rui Salvaterra <rsalvaterra at gmail.com>
AuthorDate: Thu Jun 3 11:12:02 2021 +0100

    kernel: bump 5.10 to 5.10.42
    
    Deleted (reverse-appliable):
    generic/pending-5.10/110-perf-jevents-fix-getting-maximum-number-of-fds.patch
    
    Manually refreshed:
    ramips/patches-5.10/835-asoc-add-mt7620-support.patch
    
    Signed-off-by: Rui Salvaterra <rsalvaterra at gmail.com>
---
 include/kernel-version.mk                          |  4 +--
 ...-add-support-for-boot-console-with-arbitr.patch |  2 +-
 ...ft_flow_offload-handle-netdevice-events-f.patch |  2 +-
 ...ct-napi-poll-functionality-to-__napi_poll.patch |  8 +++---
 ...ment-threaded-able-napi-poll-loop-support.patch | 10 ++++----
 ...fs-attribute-to-control-napi-threaded-mod.patch |  4 +--
 ...e-between-napi-kthread-mode-and-busy-poll.patch |  6 ++---
 ...-hangup-on-napi_disable-for-threaded-napi.patch |  4 +--
 ...lowtable-separate-replace-destroy-and-sta.patch |  6 ++---
 ...lowtable-consolidate-skb_try_make_writabl.patch |  8 +++---
 ...lowtable-move-FLOW_OFFLOAD_DIR_MAX-away-f.patch |  4 +--
 ...r-flowtable-fast-NAT-functions-never-fail.patch | 10 ++++----
 ...solve-forwarding-path-for-dsa-slave-ports.patch |  4 +--
 ...7-netfilter-flowtable-add-xmit-path-types.patch |  2 +-
 ...lowtable-use-dev_fill_forward_path-to-obt.patch |  2 +-
 ...lowtable-use-dev_fill_forward_path-to-obt.patch |  2 +-
 ...3-20-netfilter-flowtable-add-vlan-support.patch |  2 +-
 ...ft_flow_offload-use-direct-xmit-if-hardwa.patch |  2 +-
 ...lowtable-bridge-vlan-hardware-offload-and.patch |  2 +-
 ...-30-dsa-slave-add-support-for-TC_SETUP_FT.patch |  2 +-
 ...et-mtk_eth_soc-fix-parsing-packets-in-GDM.patch |  6 ++---
 ...t-mtk_eth_soc-add-support-for-initializin.patch | 16 ++++++------
 ...t-mtk_eth_soc-add-flow-offloading-support.patch |  8 +++---
 ...t-mtk_eth_soc-unmap-RX-data-before-callin.patch |  4 +--
 ...thernet-mtk_eth_soc-fix-build_skb-cleanup.patch |  4 +--
 ...ethernet-mtk_eth_soc-use-napi_consume_skb.patch | 12 ++++-----
 ...t-mtk_eth_soc-remove-unnecessary-TX-queue.patch |  6 ++---
 ...t-mtk_eth_soc-use-larger-burst-size-for-Q.patch |  2 +-
 ...t-mtk_eth_soc-implement-dynamic-interrupt.patch | 30 +++++++++++-----------
 ...t-mtk_eth_soc-cache-HW-pointer-of-last-fr.patch | 12 ++++-----
 ...t-mtk_eth_soc-only-read-the-full-RX-descr.patch |  4 +--
 ...t-mtk_eth_soc-reduce-unnecessary-interrup.patch |  4 +--
 ...thernet-mtk_eth_soc-rework-NAPI-callbacks.patch |  6 ++---
 ...t-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch |  4 +--
 ...t-mtk_eth_soc-use-iopoll.h-macro-for-DMA-.patch |  2 +-
 ...louder-when-a-non-legacy-FDB-operation-fa.patch |  4 +--
 ...-t-use-switchdev_notifier_fdb_info-in-dsa.patch |  8 +++---
 ...e-switchdev-event-implementation-under-th.patch |  4 +--
 ...t-early-in-dsa_slave_switchdev_event-if-w.patch |  2 +-
 ...ten-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch |  6 ++---
 ...t-dsa-mt7530-Add-support-for-EEE-features.patch |  6 ++---
 .../650-netfilter-add-xt_FLOWOFFLOAD-target.patch  |  6 ++---
 .../hack-5.10/661-use_fq_codel_by_default.patch    |  6 ++---
 ...jevents-fix-getting-maximum-number-of-fds.patch | 24 -----------------
 .../pending-5.10/630-packet_socket_type.patch      | 16 ++++++------
 ...80-NET-skip-GRO-for-foreign-MAC-addresses.patch | 10 ++++----
 ...lude-local-addresses-in-assisted-CPU-port.patch |  2 +-
 ...lude-bridge-addresses-in-assisted-CPU-por.patch |  2 +-
 ...c-static-FDB-entries-on-foreign-interface.patch |  4 +--
 .../patches-5.10/410-bt-mtk-serial-fix.patch       |  2 +-
 ...t-mtk_eth_soc-add-support-for-coherent-DM.patch |  6 ++---
 .../patches-5.10/323-mt7621-memory-detect.patch    |  2 +-
 ...-net-ethernet-mediatek-support-net-labels.patch |  4 +--
 .../patches-5.10/835-asoc-add-mt7620-support.patch | 18 -------------
 54 files changed, 148 insertions(+), 190 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 7ea028d9d3..de25e1a9c7 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -7,10 +7,10 @@ ifdef CONFIG_TESTING_KERNEL
 endif
 
 LINUX_VERSION-5.4 = .123
-LINUX_VERSION-5.10 = .41
+LINUX_VERSION-5.10 = .42
 
 LINUX_KERNEL_HASH-5.4.123 = 8efe33fffb661d14422877b775fb38de373e04ad640f5d0c8f57144ddb1022de
-LINUX_KERNEL_HASH-5.10.41 = f604759de80767c4f8bdc500eec730dc161bc914a48bd366b748c176701a6771
+LINUX_KERNEL_HASH-5.10.42 = 8ba027c73bd67b8ded2649a741d2f018db630c1cbc081700d8ffd07ab0d906e5
 
 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
 sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
diff --git a/target/linux/ath79/patches-5.10/921-serial-core-add-support-for-boot-console-with-arbitr.patch b/target/linux/ath79/patches-5.10/921-serial-core-add-support-for-boot-console-with-arbitr.patch
index ef4a349ea7..9785fbfe54 100644
--- a/target/linux/ath79/patches-5.10/921-serial-core-add-support-for-boot-console-with-arbitr.patch
+++ b/target/linux/ath79/patches-5.10/921-serial-core-add-support-for-boot-console-with-arbitr.patch
@@ -30,7 +30,7 @@ Signed-off-by: Sungbo Eo <mans0n at gorani.run>
  			uport->cons->cflag = 0;
  		}
  		/*
-@@ -2121,8 +2123,10 @@ uart_set_options(struct uart_port *port,
+@@ -2123,8 +2125,10 @@ uart_set_options(struct uart_port *port,
  	 * Allow the setting of the UART parameters with a NULL console
  	 * too:
  	 */
diff --git a/target/linux/generic/backport-5.10/343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch b/target/linux/generic/backport-5.10/343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch
index 137264cb9f..d300af3342 100644
--- a/target/linux/generic/backport-5.10/343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch
+++ b/target/linux/generic/backport-5.10/343-netfilter-nft_flow_offload-handle-netdevice-events-f.patch
@@ -10,7 +10,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
 
 --- a/net/netfilter/nf_flow_table_core.c
 +++ b/net/netfilter/nf_flow_table_core.c
-@@ -577,13 +577,41 @@ void nf_flow_table_free(struct nf_flowta
+@@ -576,13 +576,41 @@ void nf_flow_table_free(struct nf_flowta
  }
  EXPORT_SYMBOL_GPL(nf_flow_table_free);
  
diff --git a/target/linux/generic/backport-5.10/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch b/target/linux/generic/backport-5.10/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch
index 6001455615..877ccb2aee 100644
--- a/target/linux/generic/backport-5.10/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch
+++ b/target/linux/generic/backport-5.10/600-v5.12-net-extract-napi-poll-functionality-to-__napi_poll.patch
@@ -18,7 +18,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/net/core/dev.c
 +++ b/net/core/dev.c
-@@ -6753,15 +6753,10 @@ void __netif_napi_del(struct napi_struct
+@@ -6772,15 +6772,10 @@ void __netif_napi_del(struct napi_struct
  }
  EXPORT_SYMBOL(__netif_napi_del);
  
@@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	weight = n->weight;
  
  	/* This NAPI_STATE_SCHED test is for avoiding a race
-@@ -6781,7 +6776,7 @@ static int napi_poll(struct napi_struct
+@@ -6800,7 +6795,7 @@ static int napi_poll(struct napi_struct
  			    n->poll, work, weight);
  
  	if (likely(work < weight))
@@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	/* Drivers must not modify the NAPI state if they
  	 * consume the entire weight.  In such cases this code
-@@ -6790,7 +6785,7 @@ static int napi_poll(struct napi_struct
+@@ -6809,7 +6804,7 @@ static int napi_poll(struct napi_struct
  	 */
  	if (unlikely(napi_disable_pending(n))) {
  		napi_complete(n);
@@ -53,7 +53,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	}
  
  	if (n->gro_bitmask) {
-@@ -6808,12 +6803,29 @@ static int napi_poll(struct napi_struct
+@@ -6827,12 +6822,29 @@ static int napi_poll(struct napi_struct
  	if (unlikely(!list_empty(&n->poll_list))) {
  		pr_warn_once("%s: Budget exhausted after napi rescheduled\n",
  			     n->dev ? n->dev->name : "backlog");
diff --git a/target/linux/generic/backport-5.10/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch b/target/linux/generic/backport-5.10/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch
index 832c2839da..43267b5d74 100644
--- a/target/linux/generic/backport-5.10/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch
+++ b/target/linux/generic/backport-5.10/601-v5.12-net-implement-threaded-able-napi-poll-loop-support.patch
@@ -131,7 +131,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static int __dev_open(struct net_device *dev, struct netlink_ext_ack *extack)
  {
  	const struct net_device_ops *ops = dev->netdev_ops;
-@@ -4254,6 +4276,21 @@ int gro_normal_batch __read_mostly = 8;
+@@ -4255,6 +4277,21 @@ int gro_normal_batch __read_mostly = 8;
  static inline void ____napi_schedule(struct softnet_data *sd,
  				     struct napi_struct *napi)
  {
@@ -153,7 +153,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	list_add_tail(&napi->poll_list, &sd->poll_list);
  	__raise_softirq_irqoff(NET_RX_SOFTIRQ);
  }
-@@ -6706,6 +6743,12 @@ void netif_napi_add(struct net_device *d
+@@ -6725,6 +6762,12 @@ void netif_napi_add(struct net_device *d
  	set_bit(NAPI_STATE_NPSVC, &napi->state);
  	list_add_rcu(&napi->dev_list, &dev->napi_list);
  	napi_hash_add(napi);
@@ -166,7 +166,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  }
  EXPORT_SYMBOL(netif_napi_add);
  
-@@ -6722,9 +6765,28 @@ void napi_disable(struct napi_struct *n)
+@@ -6741,9 +6784,28 @@ void napi_disable(struct napi_struct *n)
  	hrtimer_cancel(&n->timer);
  
  	clear_bit(NAPI_STATE_DISABLE, &n->state);
@@ -195,7 +195,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static void flush_gro_hash(struct napi_struct *napi)
  {
  	int i;
-@@ -6750,6 +6812,11 @@ void __netif_napi_del(struct napi_struct
+@@ -6769,6 +6831,11 @@ void __netif_napi_del(struct napi_struct
  
  	flush_gro_hash(napi);
  	napi->gro_bitmask = 0;
@@ -207,7 +207,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  }
  EXPORT_SYMBOL(__netif_napi_del);
  
-@@ -6831,6 +6898,51 @@ static int napi_poll(struct napi_struct
+@@ -6850,6 +6917,51 @@ static int napi_poll(struct napi_struct
  	return work;
  }
  
diff --git a/target/linux/generic/backport-5.10/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch b/target/linux/generic/backport-5.10/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch
index d205ebb6b4..c54e2b2fe2 100644
--- a/target/linux/generic/backport-5.10/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch
+++ b/target/linux/generic/backport-5.10/602-v5.12-net-add-sysfs-attribute-to-control-napi-threaded-mod.patch
@@ -57,7 +57,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
   *	@n: NAPI context
 --- a/net/core/dev.c
 +++ b/net/core/dev.c
-@@ -4280,8 +4280,9 @@ static inline void ____napi_schedule(str
+@@ -4281,8 +4281,9 @@ static inline void ____napi_schedule(str
  
  	if (test_bit(NAPI_STATE_THREADED, &napi->state)) {
  		/* Paired with smp_mb__before_atomic() in
@@ -69,7 +69,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		 * wake_up_process() when it's not NULL.
  		 */
  		thread = READ_ONCE(napi->thread);
-@@ -6716,6 +6717,49 @@ static void init_gro_hash(struct napi_st
+@@ -6735,6 +6736,49 @@ static void init_gro_hash(struct napi_st
  	napi->gro_bitmask = 0;
  }
  
diff --git a/target/linux/generic/backport-5.10/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch b/target/linux/generic/backport-5.10/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch
index 92e7ec9e85..cff4e8b173 100644
--- a/target/linux/generic/backport-5.10/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch
+++ b/target/linux/generic/backport-5.10/603-v5.12-net-fix-race-between-napi-kthread-mode-and-busy-poll.patch
@@ -45,7 +45,7 @@ Cc: Hannes Frederic Sowa <hannes at stressinduktion.org>
  enum gro_result {
 --- a/net/core/dev.c
 +++ b/net/core/dev.c
-@@ -4287,6 +4287,8 @@ static inline void ____napi_schedule(str
+@@ -4288,6 +4288,8 @@ static inline void ____napi_schedule(str
  		 */
  		thread = READ_ONCE(napi->thread);
  		if (thread) {
@@ -54,7 +54,7 @@ Cc: Hannes Frederic Sowa <hannes at stressinduktion.org>
  			wake_up_process(thread);
  			return;
  		}
-@@ -6508,7 +6510,8 @@ bool napi_complete_done(struct napi_stru
+@@ -6527,7 +6529,8 @@ bool napi_complete_done(struct napi_stru
  
  		WARN_ON_ONCE(!(val & NAPIF_STATE_SCHED));
  
@@ -64,7 +64,7 @@ Cc: Hannes Frederic Sowa <hannes at stressinduktion.org>
  
  		/* If STATE_MISSED was set, leave STATE_SCHED set,
  		 * because we will call napi->poll() one more time.
-@@ -6944,16 +6947,25 @@ static int napi_poll(struct napi_struct
+@@ -6963,16 +6966,25 @@ static int napi_poll(struct napi_struct
  
  static int napi_thread_wait(struct napi_struct *napi)
  {
diff --git a/target/linux/generic/backport-5.10/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch b/target/linux/generic/backport-5.10/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch
index 4b83641291..0b7639af1c 100644
--- a/target/linux/generic/backport-5.10/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch
+++ b/target/linux/generic/backport-5.10/604-v5.12-net-fix-hangup-on-napi_disable-for-threaded-napi.patch
@@ -34,7 +34,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/net/core/dev.c
 +++ b/net/core/dev.c
-@@ -6951,7 +6951,7 @@ static int napi_thread_wait(struct napi_
+@@ -6970,7 +6970,7 @@ static int napi_thread_wait(struct napi_
  
  	set_current_state(TASK_INTERRUPTIBLE);
  
@@ -43,7 +43,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		/* Testing SCHED_THREADED bit here to make sure the current
  		 * kthread owns this napi and could poll on this napi.
  		 * Testing SCHED bit is not enough because SCHED bit might be
-@@ -6969,6 +6969,7 @@ static int napi_thread_wait(struct napi_
+@@ -6988,6 +6988,7 @@ static int napi_thread_wait(struct napi_
  		set_current_state(TASK_INTERRUPTIBLE);
  	}
  	__set_current_state(TASK_RUNNING);
diff --git a/target/linux/generic/backport-5.10/610-v5.13-01-netfilter-flowtable-separate-replace-destroy-and-sta.patch b/target/linux/generic/backport-5.10/610-v5.13-01-netfilter-flowtable-separate-replace-destroy-and-sta.patch
index 86184dd450..957b741eac 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-01-netfilter-flowtable-separate-replace-destroy-and-sta.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-01-netfilter-flowtable-separate-replace-destroy-and-sta.patch
@@ -30,7 +30,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  
  struct flow_offload_work {
  	struct list_head	list;
-@@ -826,7 +828,12 @@ static void flow_offload_work_handler(st
+@@ -827,7 +829,12 @@ static void flow_offload_work_handler(st
  
  static void flow_offload_queue_work(struct flow_offload_work *offload)
  {
@@ -44,7 +44,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  }
  
  static struct flow_offload_work *
-@@ -898,8 +905,11 @@ void nf_flow_offload_stats(struct nf_flo
+@@ -899,8 +906,11 @@ void nf_flow_offload_stats(struct nf_flo
  
  void nf_flow_table_offload_flush(struct nf_flowtable *flowtable)
  {
@@ -58,7 +58,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  }
  
  static int nf_flow_table_block_setup(struct nf_flowtable *flowtable,
-@@ -1011,15 +1021,33 @@ EXPORT_SYMBOL_GPL(nf_flow_table_offload_
+@@ -1012,15 +1022,33 @@ EXPORT_SYMBOL_GPL(nf_flow_table_offload_
  
  int nf_flow_table_offload_init(void)
  {
diff --git a/target/linux/generic/backport-5.10/610-v5.13-04-netfilter-flowtable-consolidate-skb_try_make_writabl.patch b/target/linux/generic/backport-5.10/610-v5.13-04-netfilter-flowtable-consolidate-skb_try_make_writabl.patch
index 2a4ecbaf53..9fd01b465e 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-04-netfilter-flowtable-consolidate-skb_try_make_writabl.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-04-netfilter-flowtable-consolidate-skb_try_make_writabl.patch
@@ -14,7 +14,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
 
 --- a/net/netfilter/nf_flow_table_core.c
 +++ b/net/netfilter/nf_flow_table_core.c
-@@ -395,9 +395,6 @@ static int nf_flow_nat_port_tcp(struct s
+@@ -394,9 +394,6 @@ static int nf_flow_nat_port_tcp(struct s
  {
  	struct tcphdr *tcph;
  
@@ -24,7 +24,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  	tcph = (void *)(skb_network_header(skb) + thoff);
  	inet_proto_csum_replace2(&tcph->check, skb, port, new_port, false);
  
-@@ -409,9 +406,6 @@ static int nf_flow_nat_port_udp(struct s
+@@ -408,9 +405,6 @@ static int nf_flow_nat_port_udp(struct s
  {
  	struct udphdr *udph;
  
@@ -34,7 +34,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  	udph = (void *)(skb_network_header(skb) + thoff);
  	if (udph->check || skb->ip_summed == CHECKSUM_PARTIAL) {
  		inet_proto_csum_replace2(&udph->check, skb, port,
-@@ -447,9 +441,6 @@ int nf_flow_snat_port(const struct flow_
+@@ -446,9 +440,6 @@ int nf_flow_snat_port(const struct flow_
  	struct flow_ports *hdr;
  	__be16 port, new_port;
  
@@ -44,7 +44,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  	hdr = (void *)(skb_network_header(skb) + thoff);
  
  	switch (dir) {
-@@ -478,9 +469,6 @@ int nf_flow_dnat_port(const struct flow_
+@@ -477,9 +468,6 @@ int nf_flow_dnat_port(const struct flow_
  	struct flow_ports *hdr;
  	__be16 port, new_port;
  
diff --git a/target/linux/generic/backport-5.10/610-v5.13-06-netfilter-flowtable-move-FLOW_OFFLOAD_DIR_MAX-away-f.patch b/target/linux/generic/backport-5.10/610-v5.13-06-netfilter-flowtable-move-FLOW_OFFLOAD_DIR_MAX-away-f.patch
index 473647dcbb..64a0e42079 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-06-netfilter-flowtable-move-FLOW_OFFLOAD_DIR_MAX-away-f.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-06-netfilter-flowtable-move-FLOW_OFFLOAD_DIR_MAX-away-f.patch
@@ -24,7 +24,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  	union {
 --- a/net/netfilter/nf_flow_table_core.c
 +++ b/net/netfilter/nf_flow_table_core.c
-@@ -454,8 +454,6 @@ int nf_flow_snat_port(const struct flow_
+@@ -453,8 +453,6 @@ int nf_flow_snat_port(const struct flow_
  		new_port = flow->tuplehash[FLOW_OFFLOAD_DIR_ORIGINAL].tuple.src_port;
  		hdr->dest = new_port;
  		break;
@@ -33,7 +33,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  	}
  
  	return nf_flow_nat_port(skb, thoff, protocol, port, new_port);
-@@ -482,8 +480,6 @@ int nf_flow_dnat_port(const struct flow_
+@@ -481,8 +479,6 @@ int nf_flow_dnat_port(const struct flow_
  		new_port = flow->tuplehash[FLOW_OFFLOAD_DIR_ORIGINAL].tuple.dst_port;
  		hdr->source = new_port;
  		break;
diff --git a/target/linux/generic/backport-5.10/610-v5.13-07-netfilter-flowtable-fast-NAT-functions-never-fail.patch b/target/linux/generic/backport-5.10/610-v5.13-07-netfilter-flowtable-fast-NAT-functions-never-fail.patch
index 71bb394fe2..2224e095c9 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-07-netfilter-flowtable-fast-NAT-functions-never-fail.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-07-netfilter-flowtable-fast-NAT-functions-never-fail.patch
@@ -11,7 +11,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
 
 --- a/include/net/netfilter/nf_flow_table.h
 +++ b/include/net/netfilter/nf_flow_table.h
-@@ -229,12 +229,12 @@ void nf_flow_table_free(struct nf_flowta
+@@ -228,12 +228,12 @@ void nf_flow_table_free(struct nf_flowta
  
  void flow_offload_teardown(struct flow_offload *flow);
  
@@ -32,7 +32,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  	__be16 source, dest;
 --- a/net/netfilter/nf_flow_table_core.c
 +++ b/net/netfilter/nf_flow_table_core.c
-@@ -389,20 +389,17 @@ static void nf_flow_offload_work_gc(stru
+@@ -388,20 +388,17 @@ static void nf_flow_offload_work_gc(stru
  	queue_delayed_work(system_power_efficient_wq, &flow_table->gc_work, HZ);
  }
  
@@ -57,7 +57,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  {
  	struct udphdr *udph;
  
-@@ -413,30 +410,24 @@ static int nf_flow_nat_port_udp(struct s
+@@ -412,30 +409,24 @@ static int nf_flow_nat_port_udp(struct s
  		if (!udph->check)
  			udph->check = CSUM_MANGLED_0;
  	}
@@ -95,7 +95,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  {
  	struct flow_ports *hdr;
  	__be16 port, new_port;
-@@ -456,13 +447,13 @@ int nf_flow_snat_port(const struct flow_
+@@ -455,13 +446,13 @@ int nf_flow_snat_port(const struct flow_
  		break;
  	}
  
@@ -113,7 +113,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  {
  	struct flow_ports *hdr;
  	__be16 port, new_port;
-@@ -482,7 +473,7 @@ int nf_flow_dnat_port(const struct flow_
+@@ -481,7 +472,7 @@ int nf_flow_dnat_port(const struct flow_
  		break;
  	}
  
diff --git a/target/linux/generic/backport-5.10/610-v5.13-16-net-dsa-resolve-forwarding-path-for-dsa-slave-ports.patch b/target/linux/generic/backport-5.10/610-v5.13-16-net-dsa-resolve-forwarding-path-for-dsa-slave-ports.patch
index 62f18a09af..1d3021a575 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-16-net-dsa-resolve-forwarding-path-for-dsa-slave-ports.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-16-net-dsa-resolve-forwarding-path-for-dsa-slave-ports.patch
@@ -31,7 +31,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1617,6 +1617,21 @@ static struct devlink_port *dsa_slave_ge
+@@ -1619,6 +1619,21 @@ static struct devlink_port *dsa_slave_ge
  	return dp->ds->devlink ? &dp->devlink_port : NULL;
  }
  
@@ -53,7 +53,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  static const struct net_device_ops dsa_slave_netdev_ops = {
  	.ndo_open	 	= dsa_slave_open,
  	.ndo_stop		= dsa_slave_close,
-@@ -1642,6 +1657,7 @@ static const struct net_device_ops dsa_s
+@@ -1644,6 +1659,7 @@ static const struct net_device_ops dsa_s
  	.ndo_vlan_rx_kill_vid	= dsa_slave_vlan_rx_kill_vid,
  	.ndo_get_devlink_port	= dsa_slave_get_devlink_port,
  	.ndo_change_mtu		= dsa_slave_change_mtu,
diff --git a/target/linux/generic/backport-5.10/610-v5.13-17-netfilter-flowtable-add-xmit-path-types.patch b/target/linux/generic/backport-5.10/610-v5.13-17-netfilter-flowtable-add-xmit-path-types.patch
index e0fdf49b91..6052f67faa 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-17-netfilter-flowtable-add-xmit-path-types.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-17-netfilter-flowtable-add-xmit-path-types.patch
@@ -33,7 +33,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  
  	u16				mtu;
  
-@@ -158,7 +164,8 @@ static inline __s32 nf_flow_timeout_delt
+@@ -157,7 +163,8 @@ static inline __s32 nf_flow_timeout_delt
  
  struct nf_flow_route {
  	struct {
diff --git a/target/linux/generic/backport-5.10/610-v5.13-18-netfilter-flowtable-use-dev_fill_forward_path-to-obt.patch b/target/linux/generic/backport-5.10/610-v5.13-18-netfilter-flowtable-use-dev_fill_forward_path-to-obt.patch
index 1fe8739ba6..9541ce8867 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-18-netfilter-flowtable-use-dev_fill_forward_path-to-obt.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-18-netfilter-flowtable-use-dev_fill_forward_path-to-obt.patch
@@ -20,7 +20,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
 
 --- a/include/net/netfilter/nf_flow_table.h
 +++ b/include/net/netfilter/nf_flow_table.h
-@@ -165,6 +165,9 @@ static inline __s32 nf_flow_timeout_delt
+@@ -164,6 +164,9 @@ static inline __s32 nf_flow_timeout_delt
  struct nf_flow_route {
  	struct {
  		struct dst_entry		*dst;
diff --git a/target/linux/generic/backport-5.10/610-v5.13-19-netfilter-flowtable-use-dev_fill_forward_path-to-obt.patch b/target/linux/generic/backport-5.10/610-v5.13-19-netfilter-flowtable-use-dev_fill_forward_path-to-obt.patch
index e42d2558f2..457e218d9b 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-19-netfilter-flowtable-use-dev_fill_forward_path-to-obt.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-19-netfilter-flowtable-use-dev_fill_forward_path-to-obt.patch
@@ -49,7 +49,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  };
  
  struct flow_offload_tuple_rhash {
-@@ -168,6 +175,11 @@ struct nf_flow_route {
+@@ -167,6 +174,11 @@ struct nf_flow_route {
  		struct {
  			u32			ifindex;
  		} in;
diff --git a/target/linux/generic/backport-5.10/610-v5.13-20-netfilter-flowtable-add-vlan-support.patch b/target/linux/generic/backport-5.10/610-v5.13-20-netfilter-flowtable-add-vlan-support.patch
index 976054c5ab..86a1129880 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-20-netfilter-flowtable-add-vlan-support.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-20-netfilter-flowtable-add-vlan-support.patch
@@ -46,7 +46,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  	u16				mtu;
  	union {
  		struct dst_entry	*dst_cache;
-@@ -174,6 +180,11 @@ struct nf_flow_route {
+@@ -173,6 +179,11 @@ struct nf_flow_route {
  		struct dst_entry		*dst;
  		struct {
  			u32			ifindex;
diff --git a/target/linux/generic/backport-5.10/610-v5.13-26-netfilter-nft_flow_offload-use-direct-xmit-if-hardwa.patch b/target/linux/generic/backport-5.10/610-v5.13-26-netfilter-nft_flow_offload-use-direct-xmit-if-hardwa.patch
index 98ecf9886a..56bb9fd56b 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-26-netfilter-nft_flow_offload-use-direct-xmit-if-hardwa.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-26-netfilter-nft_flow_offload-use-direct-xmit-if-hardwa.patch
@@ -23,7 +23,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  			u8		h_source[ETH_ALEN];
  			u8		h_dest[ETH_ALEN];
  		} out;
-@@ -188,6 +189,7 @@ struct nf_flow_route {
+@@ -187,6 +188,7 @@ struct nf_flow_route {
  		} in;
  		struct {
  			u32			ifindex;
diff --git a/target/linux/generic/backport-5.10/610-v5.13-27-netfilter-flowtable-bridge-vlan-hardware-offload-and.patch b/target/linux/generic/backport-5.10/610-v5.13-27-netfilter-flowtable-bridge-vlan-hardware-offload-and.patch
index 06d75ddea9..7fa58ba844 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-27-netfilter-flowtable-bridge-vlan-hardware-offload-and.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-27-netfilter-flowtable-bridge-vlan-hardware-offload-and.patch
@@ -35,7 +35,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  	u16				mtu;
  	union {
  		struct dst_entry	*dst_cache;
-@@ -185,7 +186,8 @@ struct nf_flow_route {
+@@ -184,7 +185,8 @@ struct nf_flow_route {
  				u16		id;
  				__be16		proto;
  			} encap[NF_FLOW_TABLE_ENCAP_MAX];
diff --git a/target/linux/generic/backport-5.10/610-v5.13-30-dsa-slave-add-support-for-TC_SETUP_FT.patch b/target/linux/generic/backport-5.10/610-v5.13-30-dsa-slave-add-support-for-TC_SETUP_FT.patch
index e7a33ce787..72675dc294 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-30-dsa-slave-add-support-for-TC_SETUP_FT.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-30-dsa-slave-add-support-for-TC_SETUP_FT.patch
@@ -17,7 +17,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1237,14 +1237,32 @@ static int dsa_slave_setup_tc_block(stru
+@@ -1239,14 +1239,32 @@ static int dsa_slave_setup_tc_block(stru
  	}
  }
  
diff --git a/target/linux/generic/backport-5.10/610-v5.13-31-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch b/target/linux/generic/backport-5.10/610-v5.13-31-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch
index 8361c992ae..b763984732 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-31-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-31-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch
@@ -19,7 +19,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  
  #include "mtk_eth_soc.h"
  
-@@ -1264,13 +1265,12 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1285,13 +1286,12 @@ static int mtk_poll_rx(struct napi_struc
  			break;
  
  		/* find out which mac the packet come from. values start at 1 */
@@ -38,7 +38,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  
  		if (unlikely(mac < 0 || mac >= MTK_MAC_COUNT ||
  			     !eth->netdev[mac]))
-@@ -2233,6 +2233,9 @@ static void mtk_gdm_config(struct mtk_et
+@@ -2254,6 +2254,9 @@ static void mtk_gdm_config(struct mtk_et
  
  		val |= config;
  
@@ -58,7 +58,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  #define MTK_GDMA_ICS_EN		BIT(22)
  #define MTK_GDMA_TCS_EN		BIT(21)
  #define MTK_GDMA_UCS_EN		BIT(20)
-@@ -305,6 +306,7 @@
+@@ -318,6 +319,7 @@
  #define RX_DMA_L4_VALID_PDMA	BIT(30)		/* when PDMA is used */
  #define RX_DMA_FPORT_SHIFT	19
  #define RX_DMA_FPORT_MASK	0x7
diff --git a/target/linux/generic/backport-5.10/610-v5.13-32-net-ethernet-mtk_eth_soc-add-support-for-initializin.patch b/target/linux/generic/backport-5.10/610-v5.13-32-net-ethernet-mtk_eth_soc-add-support-for-initializin.patch
index 73697615c3..4fd6f8a36b 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-32-net-ethernet-mtk_eth_soc-add-support-for-initializin.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-32-net-ethernet-mtk_eth_soc-add-support-for-initializin.patch
@@ -27,7 +27,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  obj-$(CONFIG_NET_MEDIATEK_STAR_EMAC) += mtk_star_emac.o
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2258,12 +2258,17 @@ static int mtk_open(struct net_device *d
+@@ -2279,12 +2279,17 @@ static int mtk_open(struct net_device *d
  
  	/* we run 2 netdevs on the same dma ring so we only bring it up once */
  	if (!refcount_read(&eth->dma_refcnt)) {
@@ -47,7 +47,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  
  		napi_enable(&eth->tx_napi);
  		napi_enable(&eth->rx_napi);
-@@ -2330,6 +2335,9 @@ static int mtk_stop(struct net_device *d
+@@ -2351,6 +2356,9 @@ static int mtk_stop(struct net_device *d
  
  	mtk_dma_free(eth);
  
@@ -57,7 +57,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  	return 0;
  }
  
-@@ -3058,6 +3066,13 @@ static int mtk_probe(struct platform_dev
+@@ -3079,6 +3087,13 @@ static int mtk_probe(struct platform_dev
  			goto err_free_dev;
  	}
  
@@ -71,7 +71,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  	for (i = 0; i < MTK_MAX_DEVS; i++) {
  		if (!eth->netdev[i])
  			continue;
-@@ -3132,6 +3147,7 @@ static const struct mtk_soc_data mt7621_
+@@ -3153,6 +3168,7 @@ static const struct mtk_soc_data mt7621_
  	.hw_features = MTK_HW_FEATURES,
  	.required_clks = MT7621_CLKS_BITMAP,
  	.required_pctl = false,
@@ -79,7 +79,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  };
  
  static const struct mtk_soc_data mt7622_data = {
-@@ -3140,6 +3156,7 @@ static const struct mtk_soc_data mt7622_
+@@ -3161,6 +3177,7 @@ static const struct mtk_soc_data mt7622_
  	.hw_features = MTK_HW_FEATURES,
  	.required_clks = MT7622_CLKS_BITMAP,
  	.required_pctl = false,
@@ -105,7 +105,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  #define MTK_GDMA_DROP_ALL       0x7777
  
  /* Unicast Filter MAC Address Register - Low */
-@@ -302,6 +304,12 @@
+@@ -315,6 +317,12 @@
  #define RX_DMA_VID(_x)		((_x) & 0xfff)
  
  /* QDMA descriptor rxd4 */
@@ -118,7 +118,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  #define RX_DMA_L4_VALID		BIT(24)
  #define RX_DMA_L4_VALID_PDMA	BIT(30)		/* when PDMA is used */
  #define RX_DMA_FPORT_SHIFT	19
-@@ -799,6 +807,7 @@ struct mtk_soc_data {
+@@ -819,6 +827,7 @@ struct mtk_soc_data {
  	u32		caps;
  	u32		required_clks;
  	bool		required_pctl;
@@ -126,7 +126,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  	netdev_features_t hw_features;
  };
  
-@@ -898,6 +907,8 @@ struct mtk_eth {
+@@ -918,6 +927,8 @@ struct mtk_eth {
  	u32				tx_int_status_reg;
  	u32				rx_dma_l4_valid;
  	int				ip_align;
diff --git a/target/linux/generic/backport-5.10/610-v5.13-33-net-ethernet-mtk_eth_soc-add-flow-offloading-support.patch b/target/linux/generic/backport-5.10/610-v5.13-33-net-ethernet-mtk_eth_soc-add-flow-offloading-support.patch
index 030c3fda9c..599757d413 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-33-net-ethernet-mtk_eth_soc-add-flow-offloading-support.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-33-net-ethernet-mtk_eth_soc-add-flow-offloading-support.patch
@@ -21,7 +21,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  obj-$(CONFIG_NET_MEDIATEK_STAR_EMAC) += mtk_star_emac.o
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2813,6 +2813,7 @@ static const struct net_device_ops mtk_n
+@@ -2834,6 +2834,7 @@ static const struct net_device_ops mtk_n
  #ifdef CONFIG_NET_POLL_CONTROLLER
  	.ndo_poll_controller	= mtk_poll_controller,
  #endif
@@ -29,7 +29,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  };
  
  static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
-@@ -3071,6 +3072,10 @@ static int mtk_probe(struct platform_dev
+@@ -3092,6 +3093,10 @@ static int mtk_probe(struct platform_dev
  				   eth->base + MTK_ETH_PPE_BASE, 2);
  		if (err)
  			goto err_free_dev;
@@ -60,7 +60,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  #define MTK_HW_FEATURES_MT7628	(NETIF_F_SG | NETIF_F_RXCSUM)
  #define NEXT_DESP_IDX(X, Y)	(((X) + 1) & ((Y) - 1))
  
-@@ -909,6 +911,7 @@ struct mtk_eth {
+@@ -929,6 +931,7 @@ struct mtk_eth {
  	int				ip_align;
  
  	struct mtk_ppe			ppe;
@@ -68,7 +68,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  };
  
  /* struct mtk_mac -	the structure that holds the info about the MACs of the
-@@ -953,4 +956,9 @@ int mtk_gmac_sgmii_path_setup(struct mtk
+@@ -973,4 +976,9 @@ int mtk_gmac_sgmii_path_setup(struct mtk
  int mtk_gmac_gephy_path_setup(struct mtk_eth *eth, int mac_id);
  int mtk_gmac_rgmii_path_setup(struct mtk_eth *eth, int mac_id);
  
diff --git a/target/linux/generic/backport-5.10/610-v5.13-38-net-ethernet-mtk_eth_soc-unmap-RX-data-before-callin.patch b/target/linux/generic/backport-5.10/610-v5.13-38-net-ethernet-mtk_eth_soc-unmap-RX-data-before-callin.patch
index ff88c9e84b..e99302ecda 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-38-net-ethernet-mtk_eth_soc-unmap-RX-data-before-callin.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-38-net-ethernet-mtk_eth_soc-unmap-RX-data-before-callin.patch
@@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1298,6 +1298,9 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1319,6 +1319,9 @@ static int mtk_poll_rx(struct napi_struc
  			goto release_desc;
  		}
  
@@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		/* receive data */
  		skb = build_skb(data, ring->frag_size);
  		if (unlikely(!skb)) {
-@@ -1307,8 +1310,6 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1328,8 +1331,6 @@ static int mtk_poll_rx(struct napi_struc
  		}
  		skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN);
  
diff --git a/target/linux/generic/backport-5.10/610-v5.13-39-net-ethernet-mtk_eth_soc-fix-build_skb-cleanup.patch b/target/linux/generic/backport-5.10/610-v5.13-39-net-ethernet-mtk_eth_soc-fix-build_skb-cleanup.patch
index dee26ccff1..a82518882a 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-39-net-ethernet-mtk_eth_soc-fix-build_skb-cleanup.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-39-net-ethernet-mtk_eth_soc-fix-build_skb-cleanup.patch
@@ -16,7 +16,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1304,9 +1304,9 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1325,9 +1325,9 @@ static int mtk_poll_rx(struct napi_struc
  		/* receive data */
  		skb = build_skb(data, ring->frag_size);
  		if (unlikely(!skb)) {
@@ -28,7 +28,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		}
  		skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN);
  
-@@ -1326,6 +1326,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1347,6 +1347,7 @@ static int mtk_poll_rx(struct napi_struc
  		skb_record_rx_queue(skb, 0);
  		napi_gro_receive(napi, skb);
  
diff --git a/target/linux/generic/backport-5.10/610-v5.13-40-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch b/target/linux/generic/backport-5.10/610-v5.13-40-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch
index 1d1845fa84..5972b9afa7 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-40-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-40-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -858,7 +858,8 @@ static int txd_to_idx(struct mtk_tx_ring
+@@ -879,7 +879,8 @@ static int txd_to_idx(struct mtk_tx_ring
  	return ((void *)dma - (void *)ring->dma) / sizeof(*dma);
  }
  
@@ -24,7 +24,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  {
  	if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
  		if (tx_buf->flags & MTK_TX_FLAGS_SINGLE0) {
-@@ -890,8 +891,12 @@ static void mtk_tx_unmap(struct mtk_eth
+@@ -911,8 +912,12 @@ static void mtk_tx_unmap(struct mtk_eth
  
  	tx_buf->flags = 0;
  	if (tx_buf->skb &&
@@ -39,7 +39,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	tx_buf->skb = NULL;
  }
  
-@@ -1069,7 +1074,7 @@ err_dma:
+@@ -1090,7 +1095,7 @@ err_dma:
  		tx_buf = mtk_desc_to_tx_buf(ring, itxd);
  
  		/* unmap dma */
@@ -48,7 +48,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  		itxd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU;
  		if (!MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA))
-@@ -1388,7 +1393,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -1409,7 +1414,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
  			done[mac]++;
  			budget--;
  		}
@@ -57,7 +57,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  		ring->last_free = desc;
  		atomic_inc(&ring->free_count);
-@@ -1425,7 +1430,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
+@@ -1446,7 +1451,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
  			budget--;
  		}
  
@@ -66,7 +66,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  		desc = &ring->dma[cpu];
  		ring->last_free = desc;
-@@ -1627,7 +1632,7 @@ static void mtk_tx_clean(struct mtk_eth
+@@ -1648,7 +1653,7 @@ static void mtk_tx_clean(struct mtk_eth
  
  	if (ring->buf) {
  		for (i = 0; i < MTK_DMA_SIZE; i++)
diff --git a/target/linux/generic/backport-5.10/610-v5.13-42-net-ethernet-mtk_eth_soc-remove-unnecessary-TX-queue.patch b/target/linux/generic/backport-5.10/610-v5.13-42-net-ethernet-mtk_eth_soc-remove-unnecessary-TX-queue.patch
index 67a7e3baed..56d4a82824 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-42-net-ethernet-mtk_eth_soc-remove-unnecessary-TX-queue.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-42-net-ethernet-mtk_eth_soc-remove-unnecessary-TX-queue.patch
@@ -16,7 +16,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1131,17 +1131,6 @@ static void mtk_wake_queue(struct mtk_et
+@@ -1152,17 +1152,6 @@ static void mtk_wake_queue(struct mtk_et
  	}
  }
  
@@ -34,7 +34,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static netdev_tx_t mtk_start_xmit(struct sk_buff *skb, struct net_device *dev)
  {
  	struct mtk_mac *mac = netdev_priv(dev);
-@@ -1162,7 +1151,7 @@ static netdev_tx_t mtk_start_xmit(struct
+@@ -1183,7 +1172,7 @@ static netdev_tx_t mtk_start_xmit(struct
  
  	tx_num = mtk_cal_txd_req(skb);
  	if (unlikely(atomic_read(&ring->free_count) <= tx_num)) {
@@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		netif_err(eth, tx_queued, dev,
  			  "Tx Ring full when queue awake!\n");
  		spin_unlock(&eth->page_lock);
-@@ -1188,7 +1177,7 @@ static netdev_tx_t mtk_start_xmit(struct
+@@ -1209,7 +1198,7 @@ static netdev_tx_t mtk_start_xmit(struct
  		goto drop;
  
  	if (unlikely(atomic_read(&ring->free_count) <= ring->thresh))
diff --git a/target/linux/generic/backport-5.10/610-v5.13-43-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-Q.patch b/target/linux/generic/backport-5.10/610-v5.13-43-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-Q.patch
index 7c95b33578..a192250e28 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-43-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-Q.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-43-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-Q.patch
@@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2193,7 +2193,7 @@ static int mtk_start_dma(struct mtk_eth
+@@ -2214,7 +2214,7 @@ static int mtk_start_dma(struct mtk_eth
  	if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
  		mtk_w32(eth,
  			MTK_TX_WB_DDONE | MTK_TX_DMA_EN |
diff --git a/target/linux/generic/backport-5.10/610-v5.13-45-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch b/target/linux/generic/backport-5.10/610-v5.13-45-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch
index ef4d2e875b..207d8397d8 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-45-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-45-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch
@@ -28,7 +28,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	  MediaTek SoC family.
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1233,12 +1233,13 @@ static void mtk_update_rx_cpu_idx(struct
+@@ -1254,12 +1254,13 @@ static void mtk_update_rx_cpu_idx(struct
  static int mtk_poll_rx(struct napi_struct *napi, int budget,
  		       struct mtk_eth *eth)
  {
@@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	while (done < budget) {
  		struct net_device *netdev;
-@@ -1312,6 +1313,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1333,6 +1334,7 @@ static int mtk_poll_rx(struct napi_struc
  		else
  			skb_checksum_none_assert(skb);
  		skb->protocol = eth_type_trans(skb, netdev);
@@ -51,7 +51,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  		if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX &&
  		    (trxd.rxd2 & RX_DMA_VTAG))
-@@ -1344,6 +1346,12 @@ rx_done:
+@@ -1365,6 +1367,12 @@ rx_done:
  		mtk_update_rx_cpu_idx(eth);
  	}
  
@@ -64,7 +64,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	return done;
  }
  
-@@ -1436,6 +1444,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
+@@ -1457,6 +1465,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
  static int mtk_poll_tx(struct mtk_eth *eth, int budget)
  {
  	struct mtk_tx_ring *ring = &eth->tx_ring;
@@ -72,7 +72,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	unsigned int done[MTK_MAX_DEVS];
  	unsigned int bytes[MTK_MAX_DEVS];
  	int total = 0, i;
-@@ -1453,8 +1462,14 @@ static int mtk_poll_tx(struct mtk_eth *e
+@@ -1474,8 +1483,14 @@ static int mtk_poll_tx(struct mtk_eth *e
  			continue;
  		netdev_completed_queue(eth->netdev[i], done[i], bytes[i]);
  		total += done[i];
@@ -87,7 +87,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	if (mtk_queue_stopped(eth) &&
  	    (atomic_read(&ring->free_count) > ring->thresh))
  		mtk_wake_queue(eth);
-@@ -2129,6 +2144,7 @@ static irqreturn_t mtk_handle_irq_rx(int
+@@ -2150,6 +2165,7 @@ static irqreturn_t mtk_handle_irq_rx(int
  {
  	struct mtk_eth *eth = _eth;
  
@@ -95,7 +95,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	if (likely(napi_schedule_prep(&eth->rx_napi))) {
  		__napi_schedule(&eth->rx_napi);
  		mtk_rx_irq_disable(eth, MTK_RX_DONE_INT);
-@@ -2141,6 +2157,7 @@ static irqreturn_t mtk_handle_irq_tx(int
+@@ -2162,6 +2178,7 @@ static irqreturn_t mtk_handle_irq_tx(int
  {
  	struct mtk_eth *eth = _eth;
  
@@ -103,7 +103,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	if (likely(napi_schedule_prep(&eth->tx_napi))) {
  		__napi_schedule(&eth->tx_napi);
  		mtk_tx_irq_disable(eth, MTK_TX_DONE_INT);
-@@ -2325,6 +2342,9 @@ static int mtk_stop(struct net_device *d
+@@ -2346,6 +2363,9 @@ static int mtk_stop(struct net_device *d
  	napi_disable(&eth->tx_napi);
  	napi_disable(&eth->rx_napi);
  
@@ -113,7 +113,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA))
  		mtk_stop_dma(eth, MTK_QDMA_GLO_CFG);
  	mtk_stop_dma(eth, MTK_PDMA_GLO_CFG);
-@@ -2377,6 +2397,64 @@ err_disable_clks:
+@@ -2398,6 +2418,64 @@ err_disable_clks:
  	return ret;
  }
  
@@ -178,7 +178,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static int mtk_hw_init(struct mtk_eth *eth)
  {
  	int i, val, ret;
-@@ -2398,9 +2476,6 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2419,9 +2497,6 @@ static int mtk_hw_init(struct mtk_eth *e
  			goto err_disable_pm;
  		}
  
@@ -188,7 +188,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		/* disable delay and normal interrupt */
  		mtk_tx_irq_disable(eth, ~0);
  		mtk_rx_irq_disable(eth, ~0);
-@@ -2439,11 +2514,11 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2460,11 +2535,11 @@ static int mtk_hw_init(struct mtk_eth *e
  	/* Enable RX VLan Offloading */
  	mtk_w32(eth, 1, MTK_CDMP_EG_CTRL);
  
@@ -203,7 +203,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mtk_tx_irq_disable(eth, ~0);
  	mtk_rx_irq_disable(eth, ~0);
  
-@@ -2948,6 +3023,13 @@ static int mtk_probe(struct platform_dev
+@@ -2969,6 +3044,13 @@ static int mtk_probe(struct platform_dev
  	spin_lock_init(&eth->page_lock);
  	spin_lock_init(&eth->tx_irq_lock);
  	spin_lock_init(&eth->rx_irq_lock);
@@ -269,7 +269,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  /* QDMA Interrupt grouping registers */
  #define MTK_QDMA_INT_GRP1	0x1a20
-@@ -843,6 +849,7 @@ struct mtk_sgmii {
+@@ -863,6 +869,7 @@ struct mtk_sgmii {
   * @page_lock:		Make sure that register operations are atomic
   * @tx_irq__lock:	Make sure that IRQ register operations are atomic
   * @rx_irq__lock:	Make sure that IRQ register operations are atomic
@@ -277,7 +277,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
   * @dummy_dev:		we run 2 netdevs on 1 physical DMA ring and need a
   *			dummy for NAPI to work
   * @netdev:		The netdev instances
-@@ -861,6 +868,14 @@ struct mtk_sgmii {
+@@ -881,6 +888,14 @@ struct mtk_sgmii {
   * @rx_ring_qdma:	Pointer to the memory holding info about the QDMA RX ring
   * @tx_napi:		The TX NAPI struct
   * @rx_napi:		The RX NAPI struct
@@ -292,7 +292,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
   * @scratch_ring:	Newer SoCs need memory for a second HW managed TX ring
   * @phy_scratch_ring:	physical address of scratch_ring
   * @scratch_head:	The scratch memory that scratch_ring points to.
-@@ -905,6 +920,18 @@ struct mtk_eth {
+@@ -925,6 +940,18 @@ struct mtk_eth {
  
  	const struct mtk_soc_data	*soc;
  
diff --git a/target/linux/generic/backport-5.10/610-v5.13-46-net-ethernet-mtk_eth_soc-cache-HW-pointer-of-last-fr.patch b/target/linux/generic/backport-5.10/610-v5.13-46-net-ethernet-mtk_eth_soc-cache-HW-pointer-of-last-fr.patch
index db21878e92..c2252ed728 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-46-net-ethernet-mtk_eth_soc-cache-HW-pointer-of-last-fr.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-46-net-ethernet-mtk_eth_soc-cache-HW-pointer-of-last-fr.patch
@@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1364,7 +1364,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -1385,7 +1385,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
  	struct mtk_tx_buf *tx_buf;
  	u32 cpu, dma;
  
@@ -26,7 +26,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	dma = mtk_r32(eth, MTK_QTX_DRX_PTR);
  
  	desc = mtk_qdma_phys_to_virt(ring, cpu);
-@@ -1398,6 +1398,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -1419,6 +1419,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
  		cpu = next_cpu;
  	}
  
@@ -34,7 +34,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mtk_w32(eth, cpu, MTK_QTX_CRX_PTR);
  
  	return budget;
-@@ -1598,6 +1599,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -1619,6 +1620,7 @@ static int mtk_tx_alloc(struct mtk_eth *
  	atomic_set(&ring->free_count, MTK_DMA_SIZE - 2);
  	ring->next_free = &ring->dma[0];
  	ring->last_free = &ring->dma[MTK_DMA_SIZE - 1];
@@ -42,7 +42,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	ring->thresh = MAX_SKB_FRAGS;
  
  	/* make sure that all changes to the dma ring are flushed before we
-@@ -1611,9 +1613,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -1632,9 +1634,7 @@ static int mtk_tx_alloc(struct mtk_eth *
  		mtk_w32(eth,
  			ring->phys + ((MTK_DMA_SIZE - 1) * sz),
  			MTK_QTX_CRX_PTR);
@@ -55,7 +55,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	} else {
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -636,6 +636,7 @@ struct mtk_tx_buf {
+@@ -656,6 +656,7 @@ struct mtk_tx_buf {
   * @phys:		The physical addr of tx_buf
   * @next_free:		Pointer to the next free descriptor
   * @last_free:		Pointer to the last free descriptor
@@ -63,7 +63,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
   * @thresh:		The threshold of minimum amount of free descriptors
   * @free_count:		QDMA uses a linked list. Track how many free descriptors
   *			are present
-@@ -646,6 +647,7 @@ struct mtk_tx_ring {
+@@ -666,6 +667,7 @@ struct mtk_tx_ring {
  	dma_addr_t phys;
  	struct mtk_tx_dma *next_free;
  	struct mtk_tx_dma *last_free;
diff --git a/target/linux/generic/backport-5.10/610-v5.13-47-net-ethernet-mtk_eth_soc-only-read-the-full-RX-descr.patch b/target/linux/generic/backport-5.10/610-v5.13-47-net-ethernet-mtk_eth_soc-only-read-the-full-RX-descr.patch
index f1a3fbd864..09b8b3afb9 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-47-net-ethernet-mtk_eth_soc-only-read-the-full-RX-descr.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-47-net-ethernet-mtk_eth_soc-only-read-the-full-RX-descr.patch
@@ -16,7 +16,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -777,13 +777,18 @@ static inline int mtk_max_buf_size(int f
+@@ -798,13 +798,18 @@ static inline int mtk_max_buf_size(int f
  	return buf_size;
  }
  
@@ -37,7 +37,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  }
  
  /* the qdma core needs scratch memory to be setup */
-@@ -1255,8 +1260,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1276,8 +1281,7 @@ static int mtk_poll_rx(struct napi_struc
  		rxd = &ring->dma[idx];
  		data = ring->data[idx];
  
diff --git a/target/linux/generic/backport-5.10/610-v5.13-48-net-ethernet-mtk_eth_soc-reduce-unnecessary-interrup.patch b/target/linux/generic/backport-5.10/610-v5.13-48-net-ethernet-mtk_eth_soc-reduce-unnecessary-interrup.patch
index 21e14ed1e5..411374c2e7 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-48-net-ethernet-mtk_eth_soc-reduce-unnecessary-interrup.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-48-net-ethernet-mtk_eth_soc-reduce-unnecessary-interrup.patch
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1519,8 +1519,8 @@ static int mtk_napi_tx(struct napi_struc
+@@ -1540,8 +1540,8 @@ static int mtk_napi_tx(struct napi_struc
  	if (status & MTK_TX_DONE_INT)
  		return budget;
  
@@ -25,7 +25,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	return tx_done;
  }
-@@ -1553,8 +1553,9 @@ poll_again:
+@@ -1574,8 +1574,9 @@ poll_again:
  		remain_budget -= rx_done;
  		goto poll_again;
  	}
diff --git a/target/linux/generic/backport-5.10/610-v5.13-49-net-ethernet-mtk_eth_soc-rework-NAPI-callbacks.patch b/target/linux/generic/backport-5.10/610-v5.13-49-net-ethernet-mtk_eth_soc-rework-NAPI-callbacks.patch
index 9bc948015d..d0926325d9 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-49-net-ethernet-mtk_eth_soc-rework-NAPI-callbacks.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-49-net-ethernet-mtk_eth_soc-rework-NAPI-callbacks.patch
@@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1496,7 +1496,6 @@ static void mtk_handle_status_irq(struct
+@@ -1517,7 +1517,6 @@ static void mtk_handle_status_irq(struct
  static int mtk_napi_tx(struct napi_struct *napi, int budget)
  {
  	struct mtk_eth *eth = container_of(napi, struct mtk_eth, tx_napi);
@@ -25,7 +25,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	int tx_done = 0;
  
  	if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA))
-@@ -1505,21 +1504,19 @@ static int mtk_napi_tx(struct napi_struc
+@@ -1526,21 +1525,19 @@ static int mtk_napi_tx(struct napi_struc
  	tx_done = mtk_poll_tx(eth, budget);
  
  	if (unlikely(netif_msg_intr(eth))) {
@@ -52,7 +52,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		mtk_tx_irq_enable(eth, MTK_TX_DONE_INT);
  
  	return tx_done;
-@@ -1528,36 +1525,33 @@ static int mtk_napi_tx(struct napi_struc
+@@ -1549,36 +1546,33 @@ static int mtk_napi_tx(struct napi_struc
  static int mtk_napi_rx(struct napi_struct *napi, int budget)
  {
  	struct mtk_eth *eth = container_of(napi, struct mtk_eth, rx_napi);
diff --git a/target/linux/generic/backport-5.10/610-v5.13-50-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch b/target/linux/generic/backport-5.10/610-v5.13-50-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch
index 2355a4831d..ab298ec42b 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-50-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-50-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch
@@ -24,7 +24,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  #include <net/dsa.h>
  
  #include "mtk_eth_soc.h"
-@@ -1250,6 +1251,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1271,6 +1272,7 @@ static int mtk_poll_rx(struct napi_struc
  		struct net_device *netdev;
  		unsigned int pktlen;
  		dma_addr_t dma_addr;
@@ -32,7 +32,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		int mac;
  
  		ring = mtk_get_rx_ring(eth);
-@@ -1319,6 +1321,12 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1340,6 +1342,12 @@ static int mtk_poll_rx(struct napi_struc
  		skb->protocol = eth_type_trans(skb, netdev);
  		bytes += pktlen;
  
diff --git a/target/linux/generic/backport-5.10/610-v5.13-51-net-ethernet-mtk_eth_soc-use-iopoll.h-macro-for-DMA-.patch b/target/linux/generic/backport-5.10/610-v5.13-51-net-ethernet-mtk_eth_soc-use-iopoll.h-macro-for-DMA-.patch
index fd2fb0f7c4..26bb33e42c 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-51-net-ethernet-mtk_eth_soc-use-iopoll.h-macro-for-DMA-.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-51-net-ethernet-mtk_eth_soc-use-iopoll.h-macro-for-DMA-.patch
@@ -19,7 +19,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2033,25 +2033,22 @@ static int mtk_set_features(struct net_d
+@@ -2054,25 +2054,22 @@ static int mtk_set_features(struct net_d
  /* wait for DMA to finish whatever it is doing before we start using it again */
  static int mtk_dma_busy_wait(struct mtk_eth *eth)
  {
diff --git a/target/linux/generic/backport-5.10/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch b/target/linux/generic/backport-5.10/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch
index e6126dbd91..77ce3b6b1e 100644
--- a/target/linux/generic/backport-5.10/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch
+++ b/target/linux/generic/backport-5.10/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch
@@ -25,7 +25,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -2109,7 +2109,9 @@ static void dsa_slave_switchdev_event_wo
+@@ -2111,7 +2111,9 @@ static void dsa_slave_switchdev_event_wo
  
  		err = dsa_port_fdb_add(dp, fdb_info->addr, fdb_info->vid);
  		if (err) {
@@ -36,7 +36,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  			break;
  		}
  		fdb_info->offloaded = true;
-@@ -2124,9 +2126,11 @@ static void dsa_slave_switchdev_event_wo
+@@ -2126,9 +2128,11 @@ static void dsa_slave_switchdev_event_wo
  
  		err = dsa_port_fdb_del(dp, fdb_info->addr, fdb_info->vid);
  		if (err) {
diff --git a/target/linux/generic/backport-5.10/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch b/target/linux/generic/backport-5.10/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch
index f542bb4d11..c7e7763bfc 100644
--- a/target/linux/generic/backport-5.10/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch
+++ b/target/linux/generic/backport-5.10/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch
@@ -54,7 +54,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	struct sk_buff *	(*xmit)(struct sk_buff *skb,
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -2084,76 +2084,66 @@ static int dsa_slave_netdevice_event(str
+@@ -2086,76 +2086,66 @@ static int dsa_slave_netdevice_event(str
  	return NOTIFY_DONE;
  }
  
@@ -167,7 +167,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  }
  
  /* Called under rcu_read_lock() */
-@@ -2161,7 +2151,9 @@ static int dsa_slave_switchdev_event(str
+@@ -2163,7 +2153,9 @@ static int dsa_slave_switchdev_event(str
  				     unsigned long event, void *ptr)
  {
  	struct net_device *dev = switchdev_notifier_info_to_dev(ptr);
@@ -177,7 +177,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	int err;
  
  	if (event == SWITCHDEV_PORT_ATTR_SET) {
-@@ -2174,20 +2166,32 @@ static int dsa_slave_switchdev_event(str
+@@ -2176,20 +2168,32 @@ static int dsa_slave_switchdev_event(str
  	if (!dsa_slave_dev_check(dev))
  		return NOTIFY_DONE;
  
@@ -213,7 +213,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		dev_hold(dev);
  		break;
  	default:
-@@ -2197,10 +2201,6 @@ static int dsa_slave_switchdev_event(str
+@@ -2199,10 +2203,6 @@ static int dsa_slave_switchdev_event(str
  
  	dsa_schedule_work(&switchdev_work->work);
  	return NOTIFY_OK;
diff --git a/target/linux/generic/backport-5.10/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch b/target/linux/generic/backport-5.10/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch
index d2acb3c895..984578a326 100644
--- a/target/linux/generic/backport-5.10/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch
+++ b/target/linux/generic/backport-5.10/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch
@@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -2156,31 +2156,29 @@ static int dsa_slave_switchdev_event(str
+@@ -2158,31 +2158,29 @@ static int dsa_slave_switchdev_event(str
  	struct dsa_port *dp;
  	int err;
  
@@ -68,7 +68,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		fdb_info = ptr;
  
  		if (!fdb_info->added_by_user) {
-@@ -2193,13 +2191,12 @@ static int dsa_slave_switchdev_event(str
+@@ -2195,13 +2193,12 @@ static int dsa_slave_switchdev_event(str
  		switchdev_work->vid = fdb_info->vid;
  
  		dev_hold(dev);
diff --git a/target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch b/target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
index 591950a49e..652efa2567 100644
--- a/target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
+++ b/target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
@@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -2169,6 +2169,9 @@ static int dsa_slave_switchdev_event(str
+@@ -2171,6 +2171,9 @@ static int dsa_slave_switchdev_event(str
  
  		dp = dsa_slave_to_port(dev);
  
diff --git a/target/linux/generic/backport-5.10/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch b/target/linux/generic/backport-5.10/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch
index 91e170964f..e875408a3d 100644
--- a/target/linux/generic/backport-5.10/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch
+++ b/target/linux/generic/backport-5.10/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch
@@ -170,7 +170,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	 */
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -2146,6 +2146,28 @@ static void dsa_slave_switchdev_event_wo
+@@ -2148,6 +2148,28 @@ static void dsa_slave_switchdev_event_wo
  		dev_put(dp->slave);
  }
  
@@ -199,7 +199,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  /* Called under rcu_read_lock() */
  static int dsa_slave_switchdev_event(struct notifier_block *unused,
  				     unsigned long event, void *ptr)
-@@ -2164,10 +2186,37 @@ static int dsa_slave_switchdev_event(str
+@@ -2166,10 +2188,37 @@ static int dsa_slave_switchdev_event(str
  		return notifier_from_errno(err);
  	case SWITCHDEV_FDB_ADD_TO_DEVICE:
  	case SWITCHDEV_FDB_DEL_TO_DEVICE:
@@ -240,7 +240,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  		if (!dp->ds->ops->port_fdb_add || !dp->ds->ops->port_fdb_del)
  			return NOTIFY_DONE;
-@@ -2182,18 +2231,13 @@ static int dsa_slave_switchdev_event(str
+@@ -2184,18 +2233,13 @@ static int dsa_slave_switchdev_event(str
  		switchdev_work->port = dp->index;
  		switchdev_work->event = event;
  
diff --git a/target/linux/generic/backport-5.10/781-v5.13-net-dsa-mt7530-Add-support-for-EEE-features.patch b/target/linux/generic/backport-5.10/781-v5.13-net-dsa-mt7530-Add-support-for-EEE-features.patch
index f85d5cdaad..28576bbfd6 100644
--- a/target/linux/generic/backport-5.10/781-v5.13-net-dsa-mt7530-Add-support-for-EEE-features.patch
+++ b/target/linux/generic/backport-5.10/781-v5.13-net-dsa-mt7530-Add-support-for-EEE-features.patch
@@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2277,6 +2277,17 @@ static void mt753x_phylink_mac_link_up(s
+@@ -2269,6 +2269,17 @@ static void mt753x_phylink_mac_link_up(s
  			mcr |= PMCR_RX_FC_EN;
  	}
  
@@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mt7530_set(priv, MT7530_PMCR_P(port), mcr);
  }
  
-@@ -2507,6 +2518,36 @@ mt753x_phy_write(struct dsa_switch *ds,
+@@ -2499,6 +2510,36 @@ mt753x_phy_write(struct dsa_switch *ds,
  	return priv->info->phy_write(ds, port, regnum, val);
  }
  
@@ -72,7 +72,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static const struct dsa_switch_ops mt7530_switch_ops = {
  	.get_tag_protocol	= mtk_get_tag_protocol,
  	.setup			= mt753x_setup,
-@@ -2535,6 +2576,8 @@ static const struct dsa_switch_ops mt753
+@@ -2527,6 +2568,8 @@ static const struct dsa_switch_ops mt753
  	.phylink_mac_an_restart	= mt753x_phylink_mac_an_restart,
  	.phylink_mac_link_down	= mt753x_phylink_mac_link_down,
  	.phylink_mac_link_up	= mt753x_phylink_mac_link_up,
diff --git a/target/linux/generic/hack-5.10/650-netfilter-add-xt_FLOWOFFLOAD-target.patch b/target/linux/generic/hack-5.10/650-netfilter-add-xt_FLOWOFFLOAD-target.patch
index 7d5f847435..44e897f10a 100644
--- a/target/linux/generic/hack-5.10/650-netfilter-add-xt_FLOWOFFLOAD-target.patch
+++ b/target/linux/generic/hack-5.10/650-netfilter-add-xt_FLOWOFFLOAD-target.patch
@@ -767,7 +767,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #include <net/netfilter/nf_flow_table.h>
  #include <net/netfilter/nf_conntrack.h>
  #include <net/netfilter/nf_conntrack_core.h>
-@@ -356,8 +355,7 @@ flow_offload_lookup(struct nf_flowtable
+@@ -355,8 +354,7 @@ flow_offload_lookup(struct nf_flowtable
  }
  EXPORT_SYMBOL_GPL(flow_offload_lookup);
  
@@ -777,7 +777,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		      void (*iter)(struct flow_offload *flow, void *data),
  		      void *data)
  {
-@@ -389,6 +387,7 @@ nf_flow_table_iterate(struct nf_flowtabl
+@@ -388,6 +386,7 @@ nf_flow_table_iterate(struct nf_flowtabl
  
  	return err;
  }
@@ -807,7 +807,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +#endif /* _XT_FLOWOFFLOAD_H */
 --- a/include/net/netfilter/nf_flow_table.h
 +++ b/include/net/netfilter/nf_flow_table.h
-@@ -266,6 +266,10 @@ void nf_flow_table_free(struct nf_flowta
+@@ -265,6 +265,10 @@ void nf_flow_table_free(struct nf_flowta
  
  void flow_offload_teardown(struct flow_offload *flow);
  
diff --git a/target/linux/generic/hack-5.10/661-use_fq_codel_by_default.patch b/target/linux/generic/hack-5.10/661-use_fq_codel_by_default.patch
index ceabf81249..863738e2ef 100644
--- a/target/linux/generic/hack-5.10/661-use_fq_codel_by_default.patch
+++ b/target/linux/generic/hack-5.10/661-use_fq_codel_by_default.patch
@@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/include/net/sch_generic.h
 +++ b/include/net/sch_generic.h
-@@ -578,12 +578,13 @@ extern struct Qdisc_ops noop_qdisc_ops;
+@@ -611,12 +611,13 @@ extern struct Qdisc_ops noop_qdisc_ops;
  extern struct Qdisc_ops pfifo_fast_ops;
  extern struct Qdisc_ops mq_qdisc_ops;
  extern struct Qdisc_ops noqueue_qdisc_ops;
@@ -82,8 +82,8 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +const struct Qdisc_ops *default_qdisc_ops = &fq_codel_qdisc_ops;
  EXPORT_SYMBOL(default_qdisc_ops);
  
- /* Main transmission queue. */
-@@ -1018,12 +1018,12 @@ static void attach_one_default_qdisc(str
+ static void qdisc_maybe_clear_missed(struct Qdisc *q,
+@@ -1062,12 +1062,12 @@ static void attach_one_default_qdisc(str
  				     void *_unused)
  {
  	struct Qdisc *qdisc;
diff --git a/target/linux/generic/pending-5.10/110-perf-jevents-fix-getting-maximum-number-of-fds.patch b/target/linux/generic/pending-5.10/110-perf-jevents-fix-getting-maximum-number-of-fds.patch
deleted file mode 100644
index d221b05625..0000000000
--- a/target/linux/generic/pending-5.10/110-perf-jevents-fix-getting-maximum-number-of-fds.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Tue, 25 May 2021 18:00:34 +0200
-Subject: [PATCH] perf jevents: fix getting maximum number of fds
-
-On some hosts, rlim.rlim_max can be returned as RLIM_INFINITY.
-By casting it to int, it is interpreted as -1, which will cause get_maxfds
-to return 0, causing "Invalid argument" errors in nftw() calls.
-Fix this by casting the second argument of min() to rlim_t instead.
-
-Fixes: 80eeb67fe577 ("perf jevents: Program to convert JSON file")
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/tools/perf/pmu-events/jevents.c
-+++ b/tools/perf/pmu-events/jevents.c
-@@ -894,7 +894,7 @@ static int get_maxfds(void)
- 	struct rlimit rlim;
- 
- 	if (getrlimit(RLIMIT_NOFILE, &rlim) == 0)
--		return min((int)rlim.rlim_max / 2, 512);
-+		return min(rlim.rlim_max / 2, (rlim_t)512);
- 
- 	return 512;
- }
diff --git a/target/linux/generic/pending-5.10/630-packet_socket_type.patch b/target/linux/generic/pending-5.10/630-packet_socket_type.patch
index 7ea1765f11..6a6e2fdc2a 100644
--- a/target/linux/generic/pending-5.10/630-packet_socket_type.patch
+++ b/target/linux/generic/pending-5.10/630-packet_socket_type.patch
@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #define PACKET_FANOUT_LB		1
 --- a/net/packet/af_packet.c
 +++ b/net/packet/af_packet.c
-@@ -1817,6 +1817,7 @@ static int packet_rcv_spkt(struct sk_buf
+@@ -1818,6 +1818,7 @@ static int packet_rcv_spkt(struct sk_buf
  {
  	struct sock *sk;
  	struct sockaddr_pkt *spkt;
@@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	/*
  	 *	When we registered the protocol we saved the socket in the data
-@@ -1824,6 +1825,7 @@ static int packet_rcv_spkt(struct sk_buf
+@@ -1825,6 +1826,7 @@ static int packet_rcv_spkt(struct sk_buf
  	 */
  
  	sk = pt->af_packet_priv;
@@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	/*
  	 *	Yank back the headers [hope the device set this
-@@ -1836,7 +1838,7 @@ static int packet_rcv_spkt(struct sk_buf
+@@ -1837,7 +1839,7 @@ static int packet_rcv_spkt(struct sk_buf
  	 *	so that this procedure is noop.
  	 */
  
@@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		goto out;
  
  	if (!net_eq(dev_net(dev), sock_net(sk)))
-@@ -2074,12 +2076,12 @@ static int packet_rcv(struct sk_buff *sk
+@@ -2075,12 +2077,12 @@ static int packet_rcv(struct sk_buff *sk
  	unsigned int snaplen, res;
  	bool is_drop_n_account = false;
  
@@ -71,7 +71,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (!net_eq(dev_net(dev), sock_net(sk)))
  		goto drop;
  
-@@ -2205,12 +2207,12 @@ static int tpacket_rcv(struct sk_buff *s
+@@ -2206,12 +2208,12 @@ static int tpacket_rcv(struct sk_buff *s
  	BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h2)) != 32);
  	BUILD_BUG_ON(TPACKET_ALIGN(sizeof(*h.h3)) != 48);
  
@@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (!net_eq(dev_net(dev), sock_net(sk)))
  		goto drop;
  
-@@ -3309,6 +3311,7 @@ static int packet_create(struct net *net
+@@ -3315,6 +3317,7 @@ static int packet_create(struct net *net
  	mutex_init(&po->pg_vec_lock);
  	po->rollover = NULL;
  	po->prot_hook.func = packet_rcv;
@@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	if (sock->type == SOCK_PACKET)
  		po->prot_hook.func = packet_rcv_spkt;
-@@ -3943,6 +3946,16 @@ packet_setsockopt(struct socket *sock, i
+@@ -3949,6 +3952,16 @@ packet_setsockopt(struct socket *sock, i
  		po->xmit = val ? packet_direct_xmit : dev_queue_xmit;
  		return 0;
  	}
@@ -112,7 +112,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	default:
  		return -ENOPROTOOPT;
  	}
-@@ -3999,6 +4012,13 @@ static int packet_getsockopt(struct sock
+@@ -4005,6 +4018,13 @@ static int packet_getsockopt(struct sock
  	case PACKET_VNET_HDR:
  		val = po->has_vnet_hdr;
  		break;
diff --git a/target/linux/generic/pending-5.10/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-5.10/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
index 3b485e3cc9..33d64ab3da 100644
--- a/target/linux/generic/pending-5.10/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
+++ b/target/linux/generic/pending-5.10/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
@@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	__u16			tc_index;	/* traffic control index */
 --- a/net/core/dev.c
 +++ b/net/core/dev.c
-@@ -6018,6 +6018,9 @@ static enum gro_result dev_gro_receive(s
+@@ -6037,6 +6037,9 @@ static enum gro_result dev_gro_receive(s
  	int same_flow;
  	int grow;
  
@@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (netif_elide_gro(skb->dev))
  		goto normal;
  
-@@ -7987,6 +7990,48 @@ static void __netdev_adjacent_dev_unlink
+@@ -8006,6 +8009,48 @@ static void __netdev_adjacent_dev_unlink
  					   &upper_dev->adj_list.lower);
  }
  
@@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static int __netdev_upper_dev_link(struct net_device *dev,
  				   struct net_device *upper_dev, bool master,
  				   void *upper_priv, void *upper_info,
-@@ -8038,6 +8083,7 @@ static int __netdev_upper_dev_link(struc
+@@ -8057,6 +8102,7 @@ static int __netdev_upper_dev_link(struc
  	if (ret)
  		return ret;
  
@@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
  					    &changeupper_info.info);
  	ret = notifier_to_errno(ret);
-@@ -8134,6 +8180,7 @@ static void __netdev_upper_dev_unlink(st
+@@ -8153,6 +8199,7 @@ static void __netdev_upper_dev_unlink(st
  
  	__netdev_adjacent_dev_unlink_neighbour(dev, upper_dev);
  
@@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
  				      &changeupper_info.info);
  
-@@ -8920,6 +8967,7 @@ int dev_set_mac_address(struct net_devic
+@@ -8939,6 +8986,7 @@ int dev_set_mac_address(struct net_devic
  	if (err)
  		return err;
  	dev->addr_assign_type = NET_ADDR_SET;
diff --git a/target/linux/generic/pending-5.10/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch b/target/linux/generic/pending-5.10/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch
index c86a854212..145efa57c3 100644
--- a/target/linux/generic/pending-5.10/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch
+++ b/target/linux/generic/pending-5.10/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch
@@ -18,7 +18,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -2189,10 +2189,12 @@ static int dsa_slave_switchdev_event(str
+@@ -2191,10 +2191,12 @@ static int dsa_slave_switchdev_event(str
  		fdb_info = ptr;
  
  		if (dsa_slave_dev_check(dev)) {
diff --git a/target/linux/generic/pending-5.10/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch b/target/linux/generic/pending-5.10/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch
index bf356422de..53f1232955 100644
--- a/target/linux/generic/pending-5.10/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch
+++ b/target/linux/generic/pending-5.10/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch
@@ -15,7 +15,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -2203,7 +2203,11 @@ static int dsa_slave_switchdev_event(str
+@@ -2205,7 +2205,11 @@ static int dsa_slave_switchdev_event(str
  			struct net_device *br_dev;
  			struct dsa_slave_priv *p;
  
diff --git a/target/linux/generic/pending-5.10/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch b/target/linux/generic/pending-5.10/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch
index 84ad38f6eb..49418d3b86 100644
--- a/target/linux/generic/pending-5.10/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch
+++ b/target/linux/generic/pending-5.10/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch
@@ -28,7 +28,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -2196,9 +2196,12 @@ static int dsa_slave_switchdev_event(str
+@@ -2198,9 +2198,12 @@ static int dsa_slave_switchdev_event(str
  			else if (!fdb_info->added_by_user)
  				return NOTIFY_OK;
  		} else {
@@ -44,7 +44,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
  			 */
  			struct net_device *br_dev;
  			struct dsa_slave_priv *p;
-@@ -2220,7 +2223,8 @@ static int dsa_slave_switchdev_event(str
+@@ -2222,7 +2225,8 @@ static int dsa_slave_switchdev_event(str
  
  			dp = p->dp->cpu_dp;
  
diff --git a/target/linux/mediatek/patches-5.10/410-bt-mtk-serial-fix.patch b/target/linux/mediatek/patches-5.10/410-bt-mtk-serial-fix.patch
index 2e474dd5fe..8dc680d180 100644
--- a/target/linux/mediatek/patches-5.10/410-bt-mtk-serial-fix.patch
+++ b/target/linux/mediatek/patches-5.10/410-bt-mtk-serial-fix.patch
@@ -19,7 +19,7 @@
  	},
  	[PORT_NPCM] = {
  		.name		= "Nuvoton 16550",
-@@ -2687,6 +2687,11 @@ serial8250_do_set_termios(struct uart_po
+@@ -2699,6 +2699,11 @@ serial8250_do_set_termios(struct uart_po
  	unsigned long flags;
  	unsigned int baud, quot, frac = 0;
  
diff --git a/target/linux/mediatek/patches-5.10/700-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch b/target/linux/mediatek/patches-5.10/700-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch
index 0b028cdcee..e131bfdf17 100644
--- a/target/linux/mediatek/patches-5.10/700-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch
+++ b/target/linux/mediatek/patches-5.10/700-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch
@@ -37,7 +37,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #include <linux/mfd/syscon.h>
  #include <linux/regmap.h>
  #include <linux/clk.h>
-@@ -2473,6 +2474,13 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2494,6 +2495,13 @@ static int mtk_hw_init(struct mtk_eth *e
  	if (ret)
  		goto err_disable_pm;
  
@@ -51,7 +51,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
  		ret = device_reset(eth->dev);
  		if (ret) {
-@@ -3053,6 +3061,16 @@ static int mtk_probe(struct platform_dev
+@@ -3074,6 +3082,16 @@ static int mtk_probe(struct platform_dev
  		}
  	}
  
@@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  					  GFP_KERNEL);
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -437,6 +437,12 @@
+@@ -450,6 +450,12 @@
  #define RSTCTRL_FE		BIT(6)
  #define RSTCTRL_PPE		BIT(31)
  
diff --git a/target/linux/ramips/patches-5.10/323-mt7621-memory-detect.patch b/target/linux/ramips/patches-5.10/323-mt7621-memory-detect.patch
index e87263d3c9..40fc5b71d9 100644
--- a/target/linux/ramips/patches-5.10/323-mt7621-memory-detect.patch
+++ b/target/linux/ramips/patches-5.10/323-mt7621-memory-detect.patch
@@ -118,7 +118,7 @@ Signed-off-by: Chuanhong Guo <gch981213 at gmail.com>
  
 --- a/arch/mips/ralink/of.c
 +++ b/arch/mips/ralink/of.c
-@@ -83,6 +83,8 @@ void __init plat_mem_setup(void)
+@@ -85,6 +85,8 @@ void __init plat_mem_setup(void)
  	of_scan_flat_dt(early_init_dt_find_memory, NULL);
  	if (memory_dtb)
  		of_scan_flat_dt(early_init_dt_scan_memory, NULL);
diff --git a/target/linux/ramips/patches-5.10/700-net-ethernet-mediatek-support-net-labels.patch b/target/linux/ramips/patches-5.10/700-net-ethernet-mediatek-support-net-labels.patch
index e94999b73e..c32c16a908 100644
--- a/target/linux/ramips/patches-5.10/700-net-ethernet-mediatek-support-net-labels.patch
+++ b/target/linux/ramips/patches-5.10/700-net-ethernet-mediatek-support-net-labels.patch
@@ -14,7 +14,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2893,6 +2893,7 @@ static const struct net_device_ops mtk_n
+@@ -2914,6 +2914,7 @@ static const struct net_device_ops mtk_n
  
  static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
  {
@@ -22,7 +22,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  	const __be32 *_id = of_get_property(np, "reg", NULL);
  	phy_interface_t phy_mode;
  	struct phylink *phylink;
-@@ -2985,6 +2986,9 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -3006,6 +3007,9 @@ static int mtk_add_mac(struct mtk_eth *e
  
  	eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH - MTK_RX_ETH_HLEN;
  
diff --git a/target/linux/ramips/patches-5.10/835-asoc-add-mt7620-support.patch b/target/linux/ramips/patches-5.10/835-asoc-add-mt7620-support.patch
index 0393c23f65..255c8d751a 100644
--- a/target/linux/ramips/patches-5.10/835-asoc-add-mt7620-support.patch
+++ b/target/linux/ramips/patches-5.10/835-asoc-add-mt7620-support.patch
@@ -18,24 +18,6 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  create mode 100644 sound/soc/ralink/mt7620-i2s.c
  create mode 100644 sound/soc/ralink/mt7620-wm8960.c
 
---- a/arch/mips/ralink/of.c
-+++ b/arch/mips/ralink/of.c
-@@ -13,6 +13,7 @@
- #include <linux/of_fdt.h>
- #include <linux/kernel.h>
- #include <linux/memblock.h>
-+#include <linux/module.h>
- #include <linux/of_platform.h>
- #include <linux/of_address.h>
- 
-@@ -24,6 +25,7 @@
- #include "common.h"
- 
- __iomem void *rt_sysc_membase;
-+EXPORT_SYMBOL(rt_sysc_membase);
- __iomem void *rt_memc_membase;
- 
- __iomem void *plat_of_remap_node(const char *node)
 --- a/sound/soc/Kconfig
 +++ b/sound/soc/Kconfig
 @@ -60,6 +60,7 @@ source "sound/soc/mxs/Kconfig"


From lede-commits at lists.infradead.org  Sat Jun  5 15:27:44 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:27:44 -0400
Subject: [openwrt/openwrt]  kernel: usb: add kmod-usb-gadget-ncm
In-Reply-To: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
References: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
Message-ID: <mailman.3348.1622932074.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/2fdb7053f9e77ed7ae4be0cdbf8a59f79988ee20

commit 2fdb7053f9e77ed7ae4be0cdbf8a59f79988ee20
Author: Kuan-Yi Li <kyli at abysm.org>
AuthorDate: Sun May 30 07:35:38 2021 +0800

    kernel: usb: add kmod-usb-gadget-ncm
    
    Add kernel module package for USB Network Control Model (NCM) Gadget
    support.
    
    Signed-off-by: Kuan-Yi Li <kyli at abysm.org>
---
 package/kernel/linux/modules/usb.mk | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk
index 9e8752cc64..3249b854d6 100644
--- a/package/kernel/linux/modules/usb.mk
+++ b/package/kernel/linux/modules/usb.mk
@@ -179,6 +179,23 @@ endef
 
 $(eval $(call KernelPackage,usb-gadget-eth))
 
+define KernelPackage/usb-gadget-ncm
+  TITLE:=USB Network Control Model (NCM) Gadget support
+  KCONFIG:=CONFIG_USB_G_NCM
+  DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite \
+	+kmod-usb-gadget-eth
+  FILES:= \
+	$(LINUX_DIR)/drivers/usb/gadget/function/usb_f_ncm.ko \
+	$(LINUX_DIR)/drivers/usb/gadget/legacy/g_ncm.ko
+  AUTOLOAD:=$(call AutoLoad,52,usb_f_ncm)
+  $(call AddDepends/usb)
+endef
+
+define KernelPackage/usb-gadget-ncm/description
+  Kernel support for USB Network Control Model (NCM) Gadget
+endef
+
+$(eval $(call KernelPackage,usb-gadget-ncm))
 
 define KernelPackage/usb-gadget-serial
   TITLE:=USB Serial Gadget support


From lede-commits at lists.infradead.org  Sat Jun  5 15:27:41 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:27:41 -0400
Subject: [openwrt/openwrt]  kernel: bump 5.4 to 5.4.124
In-Reply-To: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
References: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
Message-ID: <mailman.3349.1622932074.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/752cd29904c9304125005b34354b75b968bfc449

commit 752cd29904c9304125005b34354b75b968bfc449
Author: John Audia <graysky at archlinux.us>
AuthorDate: Thu Jun 3 14:46:59 2021 -0400

    kernel: bump 5.4 to 5.4.124
    
    Manually rebased:
      generic/hack-5.4/662-remove_pfifo_fast.patch
    
    All other patches automatically rebased.
    
    Build system: x86_64
    Build-tested: ipq806x/R7800
    Run-tested: ipq806x/R7800
    
    No dmesg regressions, everything functional
    
    Signed-off-by: John Audia <graysky at archlinux.us>
    [manual changes to ramips/patches-5.10/835-asoc-add-mt7620-support.patch]
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 include/kernel-version.mk                          |  4 +--
 ...-add-support-for-boot-console-with-arbitr.patch |  2 +-
 ...low-fast-GRO-for-skbs-with-Ethernet-heade.patch |  2 +-
 ...dsa-mt7530-add-support-for-port-mirroring.patch |  4 +--
 ...vide-an-option-for-drivers-to-always-rece.patch |  4 +--
 .../753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch   |  6 ++--
 ...t-mediatek-Integrate-GDM-PSE-setup-operat.patch |  6 ++--
 ...t-mediatek-Refine-the-timing-of-GDM-PSE-s.patch |  6 ++--
 ...et-mediatek-Enable-GDM-GDMA_DROP_ALL-mode.patch |  2 +-
 ...louder-when-a-non-legacy-FDB-operation-fa.patch |  4 +--
 ...-t-use-switchdev_notifier_fdb_info-in-dsa.patch |  8 ++---
 ...e-switchdev-event-implementation-under-th.patch |  4 +--
 ...t-early-in-dsa_slave_switchdev_event-if-w.patch |  2 +-
 ...ten-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch |  6 ++--
 .../hack-5.4/661-use_fq_codel_by_default.patch     |  6 ++--
 .../generic/hack-5.4/662-remove_pfifo_fast.patch   | 21 +++++++++++-
 ...t-dsa-support-hardware-flow-table-offload.patch |  4 +--
 ...80-NET-skip-GRO-for-foreign-MAC-addresses.patch | 10 +++---
 ...net-add-support-for-threaded-NAPI-polling.patch | 14 ++++----
 .../761-net-dsa-mt7530-Support-EEE-features.patch  |  6 ++--
 ...lude-local-addresses-in-assisted-CPU-port.patch |  2 +-
 ...lude-bridge-addresses-in-assisted-CPU-por.patch |  2 +-
 ...c-static-FDB-entries-on-foreign-interface.patch |  4 +--
 ...ethernet-mtk_eth_soc-use-napi_consume_skb.patch | 12 +++----
 ...t-mtk_eth_soc-fix-unnecessary-tx-queue-st.patch |  6 ++--
 ...t-mtk_eth_soc-use-larger-burst-size-for-q.patch |  2 +-
 ...t-mtk_eth_soc-implement-dynamic-interrupt.patch | 26 +++++++-------
 ...t-mtk_eth_soc-cache-hardware-pointer-of-l.patch | 12 +++----
 ...t-mtk_eth_soc-only-read-the-full-rx-descr.patch |  4 +--
 ...t-mtk_eth_soc-unmap-rx-data-before-callin.patch |  4 +--
 ...t-mtk_eth_soc-avoid-rearming-interrupt-if.patch |  4 +--
 ...et-mtk_eth_soc-fix-parsing-packets-in-GDM.patch |  6 ++--
 ...t-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch |  4 +--
 ...t-mediatek-mtk_eth_soc-add-support-for-in.patch | 16 ++++-----
 ...t-mediatek-mtk_eth_soc-add-flow-offloadin.patch | 12 +++----
 ...date-the-xmit-timestamp-to-avoid-watchdog.patch |  2 +-
 ...b-0005-usb-dwc3-add-otg-properties-update.patch |  2 +-
 ...pagate-resolved-link-config-via-mac_link_.patch |  4 +--
 ...530-use-resolved-link-config-in-mac_link_.patch |  8 ++---
 ...530-Extend-device-data-ready-for-adding-a.patch | 12 +++----
 ...a-mt7530-Add-the-support-of-MT7531-switch.patch | 40 +++++++++++-----------
 ...t-mtk_eth_soc-add-support-for-coherent-DM.patch |  6 ++--
 ...-copy-the-commandline-from-the-devicetree.patch |  2 +-
 .../patches-5.4/0048-asoc-add-mt7620-support.patch | 18 ----------
 ...-net-ethernet-mediatek-support-net-labels.patch |  4 +--
 45 files changed, 168 insertions(+), 167 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index de25e1a9c7..85178f5195 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -6,10 +6,10 @@ ifdef CONFIG_TESTING_KERNEL
   KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
 endif
 
-LINUX_VERSION-5.4 = .123
+LINUX_VERSION-5.4 = .124
 LINUX_VERSION-5.10 = .42
 
-LINUX_KERNEL_HASH-5.4.123 = 8efe33fffb661d14422877b775fb38de373e04ad640f5d0c8f57144ddb1022de
+LINUX_KERNEL_HASH-5.4.124 = f7f29dda2b042d7b5986d18274413131cf70e17288c05e9a683df1f46c507d82
 LINUX_KERNEL_HASH-5.10.42 = 8ba027c73bd67b8ded2649a741d2f018db630c1cbc081700d8ffd07ab0d906e5
 
 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
diff --git a/target/linux/ath79/patches-5.4/921-serial-core-add-support-for-boot-console-with-arbitr.patch b/target/linux/ath79/patches-5.4/921-serial-core-add-support-for-boot-console-with-arbitr.patch
index dac2064cbb..2a2aafa568 100644
--- a/target/linux/ath79/patches-5.4/921-serial-core-add-support-for-boot-console-with-arbitr.patch
+++ b/target/linux/ath79/patches-5.4/921-serial-core-add-support-for-boot-console-with-arbitr.patch
@@ -30,7 +30,7 @@ Signed-off-by: Sungbo Eo <mans0n at gorani.run>
  			uport->cons->cflag = 0;
  		}
  		/*
-@@ -2108,8 +2110,10 @@ uart_set_options(struct uart_port *port,
+@@ -2110,8 +2112,10 @@ uart_set_options(struct uart_port *port,
  	 * Allow the setting of the UART parameters with a NULL console
  	 * too:
  	 */
diff --git a/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch b/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch
index a942a53809..eeea18bb9c 100644
--- a/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch
+++ b/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch
@@ -66,7 +66,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/net/core/dev.c
 +++ b/net/core/dev.c
-@@ -5404,8 +5404,7 @@ static inline void skb_gro_reset_offset(
+@@ -5423,8 +5423,7 @@ static inline void skb_gro_reset_offset(
  	NAPI_GRO_CB(skb)->frag0 = NULL;
  	NAPI_GRO_CB(skb)->frag0_len = 0;
  
diff --git a/target/linux/generic/backport-5.4/745-v5.7-net-dsa-mt7530-add-support-for-port-mirroring.patch b/target/linux/generic/backport-5.4/745-v5.7-net-dsa-mt7530-add-support-for-port-mirroring.patch
index e788118259..d4e6f8664d 100644
--- a/target/linux/generic/backport-5.4/745-v5.7-net-dsa-mt7530-add-support-for-port-mirroring.patch
+++ b/target/linux/generic/backport-5.4/745-v5.7-net-dsa-mt7530-add-support-for-port-mirroring.patch
@@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -1153,6 +1153,64 @@ mt7530_port_vlan_del(struct dsa_switch *
+@@ -1145,6 +1145,64 @@ mt7530_port_vlan_del(struct dsa_switch *
  	return 0;
  }
  
@@ -82,7 +82,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static enum dsa_tag_protocol
  mtk_get_tag_protocol(struct dsa_switch *ds, int port)
  {
-@@ -1530,6 +1588,8 @@ static const struct dsa_switch_ops mt753
+@@ -1522,6 +1580,8 @@ static const struct dsa_switch_ops mt753
  	.port_vlan_prepare	= mt7530_port_vlan_prepare,
  	.port_vlan_add		= mt7530_port_vlan_add,
  	.port_vlan_del		= mt7530_port_vlan_del,
diff --git a/target/linux/generic/backport-5.4/752-v5.8-net-dsa-provide-an-option-for-drivers-to-always-rece.patch b/target/linux/generic/backport-5.4/752-v5.8-net-dsa-provide-an-option-for-drivers-to-always-rece.patch
index 921821a899..52d9351b70 100644
--- a/target/linux/generic/backport-5.4/752-v5.8-net-dsa-provide-an-option-for-drivers-to-always-rece.patch
+++ b/target/linux/generic/backport-5.4/752-v5.8-net-dsa-provide-an-option-for-drivers-to-always-rece.patch
@@ -101,7 +101,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		return 0;
  
  	/* Do not deprogram the CPU port as it may be shared with other user
-@@ -1118,7 +1118,7 @@ static int dsa_slave_vlan_rx_add_vid(str
+@@ -1120,7 +1120,7 @@ static int dsa_slave_vlan_rx_add_vid(str
  	 * need to emulate the switchdev prepare + commit phase.
  	 */
  	if (dp->bridge_dev) {
@@ -110,7 +110,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  			return 0;
  
  		/* br_vlan_get_info() returns -EINVAL or -ENOENT if the
-@@ -1152,7 +1152,7 @@ static int dsa_slave_vlan_rx_kill_vid(st
+@@ -1154,7 +1154,7 @@ static int dsa_slave_vlan_rx_kill_vid(st
  	 * need to emulate the switchdev prepare + commit phase.
  	 */
  	if (dp->bridge_dev) {
diff --git a/target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch b/target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch
index c9c2a6392e..eea9bf28d1 100644
--- a/target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch
+++ b/target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch
@@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -1093,12 +1093,6 @@ mt7530_port_vlan_add(struct dsa_switch *
+@@ -1085,12 +1085,6 @@ mt7530_port_vlan_add(struct dsa_switch *
  	struct mt7530_priv *priv = ds->priv;
  	u16 vid;
  
@@ -28,7 +28,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mutex_lock(&priv->reg_mutex);
  
  	for (vid = vlan->vid_begin; vid <= vlan->vid_end; ++vid) {
-@@ -1124,12 +1118,6 @@ mt7530_port_vlan_del(struct dsa_switch *
+@@ -1116,12 +1110,6 @@ mt7530_port_vlan_del(struct dsa_switch *
  	struct mt7530_priv *priv = ds->priv;
  	u16 vid, pvid;
  
@@ -41,7 +41,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mutex_lock(&priv->reg_mutex);
  
  	pvid = priv->ports[port].pvid;
-@@ -1242,6 +1230,7 @@ mt7530_setup(struct dsa_switch *ds)
+@@ -1234,6 +1222,7 @@ mt7530_setup(struct dsa_switch *ds)
  	 * as two netdev instances.
  	 */
  	dn = ds->ports[MT7530_CPU_PORT].master->dev.of_node->parent;
diff --git a/target/linux/generic/backport-5.4/760-net-ethernet-mediatek-Integrate-GDM-PSE-setup-operat.patch b/target/linux/generic/backport-5.4/760-net-ethernet-mediatek-Integrate-GDM-PSE-setup-operat.patch
index 4df1fd2677..e352b0380e 100644
--- a/target/linux/generic/backport-5.4/760-net-ethernet-mediatek-Integrate-GDM-PSE-setup-operat.patch
+++ b/target/linux/generic/backport-5.4/760-net-ethernet-mediatek-Integrate-GDM-PSE-setup-operat.patch
@@ -10,7 +10,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2211,6 +2211,28 @@ static int mtk_start_dma(struct mtk_eth
+@@ -2232,6 +2232,28 @@ static int mtk_start_dma(struct mtk_eth
  	return 0;
  }
  
@@ -39,7 +39,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static int mtk_open(struct net_device *dev)
  {
  	struct mtk_mac *mac = netdev_priv(dev);
-@@ -2406,8 +2428,6 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2427,8 +2449,6 @@ static int mtk_hw_init(struct mtk_eth *e
  	mtk_w32(eth, 0, MTK_QDMA_DELAY_INT);
  	mtk_tx_irq_disable(eth, ~0);
  	mtk_rx_irq_disable(eth, ~0);
@@ -48,7 +48,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	/* FE int grouping */
  	mtk_w32(eth, MTK_TX_DONE_INT, MTK_PDMA_INT_GRP1);
-@@ -2416,18 +2436,7 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2437,18 +2457,7 @@ static int mtk_hw_init(struct mtk_eth *e
  	mtk_w32(eth, MTK_RX_DONE_INT, MTK_QDMA_INT_GRP2);
  	mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
  
diff --git a/target/linux/generic/backport-5.4/761-net-ethernet-mediatek-Refine-the-timing-of-GDM-PSE-s.patch b/target/linux/generic/backport-5.4/761-net-ethernet-mediatek-Refine-the-timing-of-GDM-PSE-s.patch
index cdcd6a1a33..d18d9f93eb 100644
--- a/target/linux/generic/backport-5.4/761-net-ethernet-mediatek-Refine-the-timing-of-GDM-PSE-s.patch
+++ b/target/linux/generic/backport-5.4/761-net-ethernet-mediatek-Refine-the-timing-of-GDM-PSE-s.patch
@@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2215,6 +2215,9 @@ static void mtk_gdm_config(struct mtk_et
+@@ -2236,6 +2236,9 @@ static void mtk_gdm_config(struct mtk_et
  {
  	int i;
  
@@ -25,7 +25,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	for (i = 0; i < MTK_MAC_COUNT; i++) {
  		u32 val = mtk_r32(eth, MTK_GDMA_FWD_CFG(i));
  
-@@ -2253,6 +2256,8 @@ static int mtk_open(struct net_device *d
+@@ -2274,6 +2277,8 @@ static int mtk_open(struct net_device *d
  		if (err)
  			return err;
  
@@ -34,7 +34,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		napi_enable(&eth->tx_napi);
  		napi_enable(&eth->rx_napi);
  		mtk_tx_irq_enable(eth, MTK_TX_DONE_INT);
-@@ -2436,8 +2441,6 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2457,8 +2462,6 @@ static int mtk_hw_init(struct mtk_eth *e
  	mtk_w32(eth, MTK_RX_DONE_INT, MTK_QDMA_INT_GRP2);
  	mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
  
diff --git a/target/linux/generic/backport-5.4/762-net-ethernet-mediatek-Enable-GDM-GDMA_DROP_ALL-mode.patch b/target/linux/generic/backport-5.4/762-net-ethernet-mediatek-Enable-GDM-GDMA_DROP_ALL-mode.patch
index b8c40ef665..e25f1211eb 100644
--- a/target/linux/generic/backport-5.4/762-net-ethernet-mediatek-Enable-GDM-GDMA_DROP_ALL-mode.patch
+++ b/target/linux/generic/backport-5.4/762-net-ethernet-mediatek-Enable-GDM-GDMA_DROP_ALL-mode.patch
@@ -12,7 +12,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2310,6 +2310,8 @@ static int mtk_stop(struct net_device *d
+@@ -2331,6 +2331,8 @@ static int mtk_stop(struct net_device *d
  	if (!refcount_dec_and_test(&eth->dma_refcnt))
  		return 0;
  
diff --git a/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch b/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch
index 967502f022..297175855b 100644
--- a/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch
+++ b/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch
@@ -25,7 +25,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1590,7 +1590,9 @@ static void dsa_slave_switchdev_event_wo
+@@ -1592,7 +1592,9 @@ static void dsa_slave_switchdev_event_wo
  
  		err = dsa_port_fdb_add(dp, fdb_info->addr, fdb_info->vid);
  		if (err) {
@@ -36,7 +36,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  			break;
  		}
  		fdb_info->offloaded = true;
-@@ -1605,9 +1607,11 @@ static void dsa_slave_switchdev_event_wo
+@@ -1607,9 +1609,11 @@ static void dsa_slave_switchdev_event_wo
  
  		err = dsa_port_fdb_del(dp, fdb_info->addr, fdb_info->vid);
  		if (err) {
diff --git a/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch b/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch
index ad7c242280..e9b74053e0 100644
--- a/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch
+++ b/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch
@@ -54,7 +54,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	struct sk_buff *	(*xmit)(struct sk_buff *skb,
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1565,76 +1565,66 @@ static int dsa_slave_netdevice_event(str
+@@ -1567,76 +1567,66 @@ static int dsa_slave_netdevice_event(str
  	return NOTIFY_DONE;
  }
  
@@ -167,7 +167,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  }
  
  /* Called under rcu_read_lock() */
-@@ -1642,7 +1632,9 @@ static int dsa_slave_switchdev_event(str
+@@ -1644,7 +1634,9 @@ static int dsa_slave_switchdev_event(str
  				     unsigned long event, void *ptr)
  {
  	struct net_device *dev = switchdev_notifier_info_to_dev(ptr);
@@ -177,7 +177,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	int err;
  
  	if (event == SWITCHDEV_PORT_ATTR_SET) {
-@@ -1655,20 +1647,32 @@ static int dsa_slave_switchdev_event(str
+@@ -1657,20 +1649,32 @@ static int dsa_slave_switchdev_event(str
  	if (!dsa_slave_dev_check(dev))
  		return NOTIFY_DONE;
  
@@ -213,7 +213,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		dev_hold(dev);
  		break;
  	default:
-@@ -1678,10 +1682,6 @@ static int dsa_slave_switchdev_event(str
+@@ -1680,10 +1684,6 @@ static int dsa_slave_switchdev_event(str
  
  	dsa_schedule_work(&switchdev_work->work);
  	return NOTIFY_OK;
diff --git a/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch b/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch
index 619c71c7bb..b46cd7545e 100644
--- a/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch
+++ b/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch
@@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1637,31 +1637,29 @@ static int dsa_slave_switchdev_event(str
+@@ -1639,31 +1639,29 @@ static int dsa_slave_switchdev_event(str
  	struct dsa_port *dp;
  	int err;
  
@@ -68,7 +68,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		fdb_info = ptr;
  
  		if (!fdb_info->added_by_user) {
-@@ -1674,13 +1672,12 @@ static int dsa_slave_switchdev_event(str
+@@ -1676,13 +1674,12 @@ static int dsa_slave_switchdev_event(str
  		switchdev_work->vid = fdb_info->vid;
  
  		dev_hold(dev);
diff --git a/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch b/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
index 25e0d30e1a..d38c3901cf 100644
--- a/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
+++ b/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
@@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1650,6 +1650,9 @@ static int dsa_slave_switchdev_event(str
+@@ -1652,6 +1652,9 @@ static int dsa_slave_switchdev_event(str
  
  		dp = dsa_slave_to_port(dev);
  
diff --git a/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch b/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch
index ecc74ea050..4aa85e5750 100644
--- a/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch
+++ b/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch
@@ -172,7 +172,7 @@ Signed-off-by: DENG Qingfang <dqfext at gmail.com>
  	 */
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1627,6 +1627,25 @@ static void dsa_slave_switchdev_event_wo
+@@ -1629,6 +1629,25 @@ static void dsa_slave_switchdev_event_wo
  		dev_put(dp->slave);
  }
  
@@ -198,7 +198,7 @@ Signed-off-by: DENG Qingfang <dqfext at gmail.com>
  /* Called under rcu_read_lock() */
  static int dsa_slave_switchdev_event(struct notifier_block *unused,
  				     unsigned long event, void *ptr)
-@@ -1645,10 +1664,37 @@ static int dsa_slave_switchdev_event(str
+@@ -1647,10 +1666,37 @@ static int dsa_slave_switchdev_event(str
  		return notifier_from_errno(err);
  	case SWITCHDEV_FDB_ADD_TO_DEVICE:
  	case SWITCHDEV_FDB_DEL_TO_DEVICE:
@@ -239,7 +239,7 @@ Signed-off-by: DENG Qingfang <dqfext at gmail.com>
  
  		if (!dp->ds->ops->port_fdb_add || !dp->ds->ops->port_fdb_del)
  			return NOTIFY_DONE;
-@@ -1663,18 +1709,13 @@ static int dsa_slave_switchdev_event(str
+@@ -1665,18 +1711,13 @@ static int dsa_slave_switchdev_event(str
  		switchdev_work->port = dp->index;
  		switchdev_work->event = event;
  
diff --git a/target/linux/generic/hack-5.4/661-use_fq_codel_by_default.patch b/target/linux/generic/hack-5.4/661-use_fq_codel_by_default.patch
index 10197eeb04..6d0a54c01d 100644
--- a/target/linux/generic/hack-5.4/661-use_fq_codel_by_default.patch
+++ b/target/linux/generic/hack-5.4/661-use_fq_codel_by_default.patch
@@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/include/net/sch_generic.h
 +++ b/include/net/sch_generic.h
-@@ -570,12 +570,13 @@ extern struct Qdisc_ops noop_qdisc_ops;
+@@ -603,12 +603,13 @@ extern struct Qdisc_ops noop_qdisc_ops;
  extern struct Qdisc_ops pfifo_fast_ops;
  extern struct Qdisc_ops mq_qdisc_ops;
  extern struct Qdisc_ops noqueue_qdisc_ops;
@@ -82,8 +82,8 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +const struct Qdisc_ops *default_qdisc_ops = &fq_codel_qdisc_ops;
  EXPORT_SYMBOL(default_qdisc_ops);
  
- /* Main transmission queue. */
-@@ -1035,12 +1035,12 @@ static void attach_one_default_qdisc(str
+ static void qdisc_maybe_clear_missed(struct Qdisc *q,
+@@ -1079,12 +1079,12 @@ static void attach_one_default_qdisc(str
  				     void *_unused)
  {
  	struct Qdisc *qdisc;
diff --git a/target/linux/generic/hack-5.4/662-remove_pfifo_fast.patch b/target/linux/generic/hack-5.4/662-remove_pfifo_fast.patch
index 27946f8cec..9df3a8258d 100644
--- a/target/linux/generic/hack-5.4/662-remove_pfifo_fast.patch
+++ b/target/linux/generic/hack-5.4/662-remove_pfifo_fast.patch
@@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/net/sched/sch_generic.c
 +++ b/net/sched/sch_generic.c
-@@ -595,211 +595,6 @@ struct Qdisc_ops noqueue_qdisc_ops __rea
+@@ -620,230 +620,6 @@ struct Qdisc_ops noqueue_qdisc_ops __rea
  	.owner		=	THIS_MODULE,
  };
  
@@ -64,8 +64,10 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 -{
 -	struct pfifo_fast_priv *priv = qdisc_priv(qdisc);
 -	struct sk_buff *skb = NULL;
+-	bool need_retry = true;
 -	int band;
 -
+-retry:
 -	for (band = 0; band < PFIFO_FAST_BANDS && !skb; band++) {
 -		struct skb_array *q = band2list(priv, band);
 -
@@ -76,6 +78,23 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 -	}
 -	if (likely(skb)) {
 -		qdisc_update_stats_at_dequeue(qdisc, skb);
+-	} else if (need_retry &&
+-		   test_bit(__QDISC_STATE_MISSED, &qdisc->state)) {
+-		/* Delay clearing the STATE_MISSED here to reduce
+-		 * the overhead of the second spin_trylock() in
+-		 * qdisc_run_begin() and __netif_schedule() calling
+-		 * in qdisc_run_end().
+-		 */
+-		clear_bit(__QDISC_STATE_MISSED, &qdisc->state);
+-
+-		/* Make sure dequeuing happens after clearing
+-		 * STATE_MISSED.
+-		 */
+-		smp_mb__after_atomic();
+-
+-		need_retry = false;
+-
+-		goto retry;
 -	} else {
 -		WRITE_ONCE(qdisc->empty, true);
 -	}
diff --git a/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch b/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch
index 392a37b345..85c606c455 100644
--- a/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch
+++ b/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch
@@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  #include "dsa_priv.h"
  
-@@ -1221,6 +1225,27 @@ static struct devlink_port *dsa_slave_ge
+@@ -1223,6 +1227,27 @@ static struct devlink_port *dsa_slave_ge
  	return dp->ds->devlink ? &dp->devlink_port : NULL;
  }
  
@@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static const struct net_device_ops dsa_slave_netdev_ops = {
  	.ndo_open	 	= dsa_slave_open,
  	.ndo_stop		= dsa_slave_close,
-@@ -1245,6 +1270,9 @@ static const struct net_device_ops dsa_s
+@@ -1247,6 +1272,9 @@ static const struct net_device_ops dsa_s
  	.ndo_vlan_rx_add_vid	= dsa_slave_vlan_rx_add_vid,
  	.ndo_vlan_rx_kill_vid	= dsa_slave_vlan_rx_kill_vid,
  	.ndo_get_devlink_port	= dsa_slave_get_devlink_port,
diff --git a/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
index d8d993fbd8..8871f3457a 100644
--- a/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
+++ b/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
@@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	__u16			tc_index;	/* traffic control index */
 --- a/net/core/dev.c
 +++ b/net/core/dev.c
-@@ -5470,6 +5470,9 @@ static enum gro_result dev_gro_receive(s
+@@ -5489,6 +5489,9 @@ static enum gro_result dev_gro_receive(s
  	int same_flow;
  	int grow;
  
@@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (netif_elide_gro(skb->dev))
  		goto normal;
  
-@@ -7265,6 +7268,48 @@ static void __netdev_adjacent_dev_unlink
+@@ -7284,6 +7287,48 @@ static void __netdev_adjacent_dev_unlink
  					   &upper_dev->adj_list.lower);
  }
  
@@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static int __netdev_upper_dev_link(struct net_device *dev,
  				   struct net_device *upper_dev, bool master,
  				   void *upper_priv, void *upper_info,
-@@ -7315,6 +7360,7 @@ static int __netdev_upper_dev_link(struc
+@@ -7334,6 +7379,7 @@ static int __netdev_upper_dev_link(struc
  	if (ret)
  		return ret;
  
@@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
  					    &changeupper_info.info);
  	ret = notifier_to_errno(ret);
-@@ -7408,6 +7454,7 @@ void netdev_upper_dev_unlink(struct net_
+@@ -7427,6 +7473,7 @@ void netdev_upper_dev_unlink(struct net_
  
  	__netdev_adjacent_dev_unlink_neighbour(dev, upper_dev);
  
@@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
  				      &changeupper_info.info);
  
-@@ -8138,6 +8185,7 @@ int dev_set_mac_address(struct net_devic
+@@ -8157,6 +8204,7 @@ int dev_set_mac_address(struct net_devic
  	if (err)
  		return err;
  	dev->addr_assign_type = NET_ADDR_SET;
diff --git a/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch b/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch
index a3b71b1896..b30482468b 100644
--- a/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch
+++ b/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch
@@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  static int netif_rx_internal(struct sk_buff *skb);
  static int call_netdevice_notifiers_info(unsigned long val,
-@@ -5912,6 +5913,11 @@ void __napi_schedule(struct napi_struct
+@@ -5931,6 +5932,11 @@ void __napi_schedule(struct napi_struct
  {
  	unsigned long flags;
  
@@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	local_irq_save(flags);
  	____napi_schedule(this_cpu_ptr(&softnet_data), n);
  	local_irq_restore(flags);
-@@ -5959,6 +5965,11 @@ EXPORT_SYMBOL(napi_schedule_prep);
+@@ -5978,6 +5984,11 @@ EXPORT_SYMBOL(napi_schedule_prep);
   */
  void __napi_schedule_irqoff(struct napi_struct *n)
  {
@@ -119,7 +119,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	____napi_schedule(this_cpu_ptr(&softnet_data), n);
  }
  EXPORT_SYMBOL(__napi_schedule_irqoff);
-@@ -6220,9 +6231,89 @@ static void init_gro_hash(struct napi_st
+@@ -6239,9 +6250,89 @@ static void init_gro_hash(struct napi_st
  	napi->gro_bitmask = 0;
  }
  
@@ -209,7 +209,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	INIT_LIST_HEAD(&napi->poll_list);
  	hrtimer_init(&napi->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_PINNED);
  	napi->timer.function = napi_watchdog;
-@@ -6239,6 +6330,7 @@ void netif_napi_add(struct net_device *d
+@@ -6258,6 +6349,7 @@ void netif_napi_add(struct net_device *d
  #ifdef CONFIG_NETPOLL
  	napi->poll_owner = -1;
  #endif
@@ -217,7 +217,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	set_bit(NAPI_STATE_SCHED, &napi->state);
  	set_bit(NAPI_STATE_NPSVC, &napi->state);
  	list_add_rcu(&napi->dev_list, &dev->napi_list);
-@@ -6279,6 +6371,7 @@ static void flush_gro_hash(struct napi_s
+@@ -6298,6 +6390,7 @@ static void flush_gro_hash(struct napi_s
  void netif_napi_del(struct napi_struct *napi)
  {
  	might_sleep();
@@ -225,7 +225,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (napi_hash_del(napi))
  		synchronize_net();
  	list_del_init(&napi->dev_list);
-@@ -6291,50 +6384,18 @@ EXPORT_SYMBOL(netif_napi_del);
+@@ -6310,50 +6403,18 @@ EXPORT_SYMBOL(netif_napi_del);
  
  static int napi_poll(struct napi_struct *n, struct list_head *repoll)
  {
@@ -280,7 +280,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	/* Some drivers may have called napi_schedule
  	 * prior to exhausting their budget.
-@@ -10314,6 +10375,10 @@ static int __init net_dev_init(void)
+@@ -10333,6 +10394,10 @@ static int __init net_dev_init(void)
  		sd->backlog.weight = weight_p;
  	}
  
diff --git a/target/linux/generic/pending-5.4/761-net-dsa-mt7530-Support-EEE-features.patch b/target/linux/generic/pending-5.4/761-net-dsa-mt7530-Support-EEE-features.patch
index 0fd4151ad0..e8f35b6e1f 100644
--- a/target/linux/generic/pending-5.4/761-net-dsa-mt7530-Support-EEE-features.patch
+++ b/target/linux/generic/pending-5.4/761-net-dsa-mt7530-Support-EEE-features.patch
@@ -9,7 +9,7 @@ Content-Transfer-Encoding: 8bit
 Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -1417,9 +1417,13 @@ static void mt7530_phylink_mac_config(st
+@@ -1409,9 +1409,13 @@ static void mt7530_phylink_mac_config(st
  	switch (state->speed) {
  	case SPEED_1000:
  		mcr_new |= PMCR_FORCE_SPEED_1000;
@@ -23,7 +23,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  		break;
  	}
  	if (state->duplex == DUPLEX_FULL) {
-@@ -1555,6 +1559,54 @@ mt7530_phylink_mac_link_state(struct dsa
+@@ -1547,6 +1551,54 @@ mt7530_phylink_mac_link_state(struct dsa
  	return 1;
  }
  
@@ -78,7 +78,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  static const struct dsa_switch_ops mt7530_switch_ops = {
  	.get_tag_protocol	= mtk_get_tag_protocol,
  	.setup			= mt7530_setup,
-@@ -1582,6 +1634,8 @@ static const struct dsa_switch_ops mt753
+@@ -1574,6 +1626,8 @@ static const struct dsa_switch_ops mt753
  	.phylink_mac_config	= mt7530_phylink_mac_config,
  	.phylink_mac_link_down	= mt7530_phylink_mac_link_down,
  	.phylink_mac_link_up	= mt7530_phylink_mac_link_up,
diff --git a/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch b/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch
index 618ccf0982..e1a7a0e448 100644
--- a/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch
+++ b/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch
@@ -18,7 +18,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1695,10 +1695,12 @@ static int dsa_slave_switchdev_event(str
+@@ -1697,10 +1697,12 @@ static int dsa_slave_switchdev_event(str
  		fdb_info = ptr;
  
  		if (dsa_slave_dev_check(dev)) {
diff --git a/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch b/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch
index ed34c7ad24..f985adf736 100644
--- a/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch
+++ b/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch
@@ -15,7 +15,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1709,7 +1709,11 @@ static int dsa_slave_switchdev_event(str
+@@ -1711,7 +1711,11 @@ static int dsa_slave_switchdev_event(str
  			struct net_device *br_dev;
  			struct dsa_slave_priv *p;
  
diff --git a/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch b/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch
index 94f45c6be4..984d9805f6 100644
--- a/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch
+++ b/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch
@@ -28,7 +28,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1702,9 +1702,12 @@ static int dsa_slave_switchdev_event(str
+@@ -1704,9 +1704,12 @@ static int dsa_slave_switchdev_event(str
  			else if (!fdb_info->added_by_user)
  				return NOTIFY_OK;
  		} else {
@@ -44,7 +44,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
  			 */
  			struct net_device *br_dev;
  			struct dsa_slave_priv *p;
-@@ -1726,7 +1729,8 @@ static int dsa_slave_switchdev_event(str
+@@ -1728,7 +1731,8 @@ static int dsa_slave_switchdev_event(str
  
  			dp = p->dp->cpu_dp;
  
diff --git a/target/linux/generic/pending-5.4/770-00-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch b/target/linux/generic/pending-5.4/770-00-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch
index 9909c4c963..2f0c7934f5 100644
--- a/target/linux/generic/pending-5.4/770-00-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch
+++ b/target/linux/generic/pending-5.4/770-00-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch
@@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -853,7 +853,8 @@ static int txd_to_idx(struct mtk_tx_ring
+@@ -874,7 +874,8 @@ static int txd_to_idx(struct mtk_tx_ring
  	return ((void *)dma - (void *)ring->dma) / sizeof(*dma);
  }
  
@@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  {
  	if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
  		if (tx_buf->flags & MTK_TX_FLAGS_SINGLE0) {
-@@ -885,8 +886,12 @@ static void mtk_tx_unmap(struct mtk_eth
+@@ -906,8 +907,12 @@ static void mtk_tx_unmap(struct mtk_eth
  
  	tx_buf->flags = 0;
  	if (tx_buf->skb &&
@@ -34,7 +34,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	tx_buf->skb = NULL;
  }
  
-@@ -1064,7 +1069,7 @@ err_dma:
+@@ -1085,7 +1090,7 @@ err_dma:
  		tx_buf = mtk_desc_to_tx_buf(ring, itxd);
  
  		/* unmap dma */
@@ -43,7 +43,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  		itxd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU;
  		if (!MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA))
-@@ -1382,7 +1387,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -1403,7 +1408,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
  			done[mac]++;
  			budget--;
  		}
@@ -52,7 +52,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  		ring->last_free = desc;
  		atomic_inc(&ring->free_count);
-@@ -1419,7 +1424,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
+@@ -1440,7 +1445,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
  			budget--;
  		}
  
@@ -61,7 +61,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  		desc = &ring->dma[cpu];
  		ring->last_free = desc;
-@@ -1621,7 +1626,7 @@ static void mtk_tx_clean(struct mtk_eth
+@@ -1642,7 +1647,7 @@ static void mtk_tx_clean(struct mtk_eth
  
  	if (ring->buf) {
  		for (i = 0; i < MTK_DMA_SIZE; i++)
diff --git a/target/linux/generic/pending-5.4/770-03-net-ethernet-mtk_eth_soc-fix-unnecessary-tx-queue-st.patch b/target/linux/generic/pending-5.4/770-03-net-ethernet-mtk_eth_soc-fix-unnecessary-tx-queue-st.patch
index fd28bb8692..6eeae6985f 100644
--- a/target/linux/generic/pending-5.4/770-03-net-ethernet-mtk_eth_soc-fix-unnecessary-tx-queue-st.patch
+++ b/target/linux/generic/pending-5.4/770-03-net-ethernet-mtk_eth_soc-fix-unnecessary-tx-queue-st.patch
@@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1126,17 +1126,6 @@ static void mtk_wake_queue(struct mtk_et
+@@ -1147,17 +1147,6 @@ static void mtk_wake_queue(struct mtk_et
  	}
  }
  
@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static int mtk_start_xmit(struct sk_buff *skb, struct net_device *dev)
  {
  	struct mtk_mac *mac = netdev_priv(dev);
-@@ -1157,7 +1146,7 @@ static int mtk_start_xmit(struct sk_buff
+@@ -1178,7 +1167,7 @@ static int mtk_start_xmit(struct sk_buff
  
  	tx_num = mtk_cal_txd_req(skb);
  	if (unlikely(atomic_read(&ring->free_count) <= tx_num)) {
@@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		netif_err(eth, tx_queued, dev,
  			  "Tx Ring full when queue awake!\n");
  		spin_unlock(&eth->page_lock);
-@@ -1183,7 +1172,7 @@ static int mtk_start_xmit(struct sk_buff
+@@ -1204,7 +1193,7 @@ static int mtk_start_xmit(struct sk_buff
  		goto drop;
  
  	if (unlikely(atomic_read(&ring->free_count) <= ring->thresh))
diff --git a/target/linux/generic/pending-5.4/770-04-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-q.patch b/target/linux/generic/pending-5.4/770-04-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-q.patch
index e135f27f95..cd042ce409 100644
--- a/target/linux/generic/pending-5.4/770-04-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-q.patch
+++ b/target/linux/generic/pending-5.4/770-04-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-q.patch
@@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2187,7 +2187,7 @@ static int mtk_start_dma(struct mtk_eth
+@@ -2208,7 +2208,7 @@ static int mtk_start_dma(struct mtk_eth
  	if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
  		mtk_w32(eth,
  			MTK_TX_WB_DDONE | MTK_TX_DMA_EN |
diff --git a/target/linux/generic/pending-5.4/770-06-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch b/target/linux/generic/pending-5.4/770-06-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch
index 8720ab503c..9302f0b1f7 100644
--- a/target/linux/generic/pending-5.4/770-06-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch
+++ b/target/linux/generic/pending-5.4/770-06-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch
@@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	  MediaTek SoC family.
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1228,12 +1228,13 @@ static void mtk_update_rx_cpu_idx(struct
+@@ -1249,12 +1249,13 @@ static void mtk_update_rx_cpu_idx(struct
  static int mtk_poll_rx(struct napi_struct *napi, int budget,
  		       struct mtk_eth *eth)
  {
@@ -35,7 +35,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	while (done < budget) {
  		struct net_device *netdev;
-@@ -1307,6 +1308,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1328,6 +1329,7 @@ static int mtk_poll_rx(struct napi_struc
  		else
  			skb_checksum_none_assert(skb);
  		skb->protocol = eth_type_trans(skb, netdev);
@@ -43,7 +43,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  		if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX &&
  		    (trxd.rxd2 & RX_DMA_VTAG))
-@@ -1338,6 +1340,12 @@ rx_done:
+@@ -1359,6 +1361,12 @@ rx_done:
  		mtk_update_rx_cpu_idx(eth);
  	}
  
@@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	return done;
  }
  
-@@ -1430,6 +1438,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
+@@ -1451,6 +1459,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
  static int mtk_poll_tx(struct mtk_eth *eth, int budget)
  {
  	struct mtk_tx_ring *ring = &eth->tx_ring;
@@ -64,7 +64,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	unsigned int done[MTK_MAX_DEVS];
  	unsigned int bytes[MTK_MAX_DEVS];
  	int total = 0, i;
-@@ -1447,8 +1456,14 @@ static int mtk_poll_tx(struct mtk_eth *e
+@@ -1468,8 +1477,14 @@ static int mtk_poll_tx(struct mtk_eth *e
  			continue;
  		netdev_completed_queue(eth->netdev[i], done[i], bytes[i]);
  		total += done[i];
@@ -79,7 +79,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (mtk_queue_stopped(eth) &&
  	    (atomic_read(&ring->free_count) > ring->thresh))
  		mtk_wake_queue(eth);
-@@ -2123,6 +2138,7 @@ static irqreturn_t mtk_handle_irq_rx(int
+@@ -2144,6 +2159,7 @@ static irqreturn_t mtk_handle_irq_rx(int
  {
  	struct mtk_eth *eth = _eth;
  
@@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (likely(napi_schedule_prep(&eth->rx_napi))) {
  		__napi_schedule(&eth->rx_napi);
  		mtk_rx_irq_disable(eth, MTK_RX_DONE_INT);
-@@ -2135,6 +2151,7 @@ static irqreturn_t mtk_handle_irq_tx(int
+@@ -2156,6 +2172,7 @@ static irqreturn_t mtk_handle_irq_tx(int
  {
  	struct mtk_eth *eth = _eth;
  
@@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (likely(napi_schedule_prep(&eth->tx_napi))) {
  		__napi_schedule(&eth->tx_napi);
  		mtk_tx_irq_disable(eth, MTK_TX_DONE_INT);
-@@ -2311,6 +2328,9 @@ static int mtk_stop(struct net_device *d
+@@ -2332,6 +2349,9 @@ static int mtk_stop(struct net_device *d
  	napi_disable(&eth->tx_napi);
  	napi_disable(&eth->rx_napi);
  
@@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA))
  		mtk_stop_dma(eth, MTK_QDMA_GLO_CFG);
  	mtk_stop_dma(eth, MTK_PDMA_GLO_CFG);
-@@ -2360,6 +2380,64 @@ err_disable_clks:
+@@ -2381,6 +2401,64 @@ err_disable_clks:
  	return ret;
  }
  
@@ -170,7 +170,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static int mtk_hw_init(struct mtk_eth *eth)
  {
  	int i, val, ret;
-@@ -2381,9 +2459,6 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2402,9 +2480,6 @@ static int mtk_hw_init(struct mtk_eth *e
  			goto err_disable_pm;
  		}
  
@@ -180,7 +180,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		/* disable delay and normal interrupt */
  		mtk_tx_irq_disable(eth, ~0);
  		mtk_rx_irq_disable(eth, ~0);
-@@ -2422,11 +2497,10 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2443,11 +2518,10 @@ static int mtk_hw_init(struct mtk_eth *e
  	/* Enable RX VLan Offloading */
  	mtk_w32(eth, 1, MTK_CDMP_EG_CTRL);
  
@@ -194,7 +194,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	mtk_tx_irq_disable(eth, ~0);
  	mtk_rx_irq_disable(eth, ~0);
  
-@@ -2930,6 +3004,13 @@ static int mtk_probe(struct platform_dev
+@@ -2951,6 +3025,13 @@ static int mtk_probe(struct platform_dev
  	spin_lock_init(&eth->page_lock);
  	spin_lock_init(&eth->tx_irq_lock);
  	spin_lock_init(&eth->rx_irq_lock);
@@ -260,7 +260,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  /* QDMA Interrupt grouping registers */
  #define MTK_QDMA_INT_GRP1	0x1a20
-@@ -892,6 +898,18 @@ struct mtk_eth {
+@@ -912,6 +918,18 @@ struct mtk_eth {
  
  	const struct mtk_soc_data	*soc;
  
diff --git a/target/linux/generic/pending-5.4/770-08-net-ethernet-mtk_eth_soc-cache-hardware-pointer-of-l.patch b/target/linux/generic/pending-5.4/770-08-net-ethernet-mtk_eth_soc-cache-hardware-pointer-of-l.patch
index a7231d826c..b280b6cf4b 100644
--- a/target/linux/generic/pending-5.4/770-08-net-ethernet-mtk_eth_soc-cache-hardware-pointer-of-l.patch
+++ b/target/linux/generic/pending-5.4/770-08-net-ethernet-mtk_eth_soc-cache-hardware-pointer-of-l.patch
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1358,7 +1358,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -1379,7 +1379,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
  	struct mtk_tx_buf *tx_buf;
  	u32 cpu, dma;
  
@@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	dma = mtk_r32(eth, MTK_QTX_DRX_PTR);
  
  	desc = mtk_qdma_phys_to_virt(ring, cpu);
-@@ -1392,6 +1392,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -1413,6 +1413,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
  		cpu = next_cpu;
  	}
  
@@ -28,7 +28,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	mtk_w32(eth, cpu, MTK_QTX_CRX_PTR);
  
  	return budget;
-@@ -1592,6 +1593,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -1613,6 +1614,7 @@ static int mtk_tx_alloc(struct mtk_eth *
  	atomic_set(&ring->free_count, MTK_DMA_SIZE - 2);
  	ring->next_free = &ring->dma[0];
  	ring->last_free = &ring->dma[MTK_DMA_SIZE - 1];
@@ -36,7 +36,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	ring->thresh = MAX_SKB_FRAGS;
  
  	/* make sure that all changes to the dma ring are flushed before we
-@@ -1605,9 +1607,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -1626,9 +1628,7 @@ static int mtk_tx_alloc(struct mtk_eth *
  		mtk_w32(eth,
  			ring->phys + ((MTK_DMA_SIZE - 1) * sz),
  			MTK_QTX_CRX_PTR);
@@ -49,7 +49,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	} else {
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -624,6 +624,7 @@ struct mtk_tx_buf {
+@@ -644,6 +644,7 @@ struct mtk_tx_buf {
   * @phys:		The physical addr of tx_buf
   * @next_free:		Pointer to the next free descriptor
   * @last_free:		Pointer to the last free descriptor
@@ -57,7 +57,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
   * @thresh:		The threshold of minimum amount of free descriptors
   * @free_count:		QDMA uses a linked list. Track how many free descriptors
   *			are present
-@@ -634,6 +635,7 @@ struct mtk_tx_ring {
+@@ -654,6 +655,7 @@ struct mtk_tx_ring {
  	dma_addr_t phys;
  	struct mtk_tx_dma *next_free;
  	struct mtk_tx_dma *last_free;
diff --git a/target/linux/generic/pending-5.4/770-09-net-ethernet-mtk_eth_soc-only-read-the-full-rx-descr.patch b/target/linux/generic/pending-5.4/770-09-net-ethernet-mtk_eth_soc-only-read-the-full-rx-descr.patch
index 1b7a0a9aca..c2f5013e26 100644
--- a/target/linux/generic/pending-5.4/770-09-net-ethernet-mtk_eth_soc-only-read-the-full-rx-descr.patch
+++ b/target/linux/generic/pending-5.4/770-09-net-ethernet-mtk_eth_soc-only-read-the-full-rx-descr.patch
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -772,13 +772,18 @@ static inline int mtk_max_buf_size(int f
+@@ -793,13 +793,18 @@ static inline int mtk_max_buf_size(int f
  	return buf_size;
  }
  
@@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  }
  
  /* the qdma core needs scratch memory to be setup */
-@@ -1250,8 +1255,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1271,8 +1276,7 @@ static int mtk_poll_rx(struct napi_struc
  		rxd = &ring->dma[idx];
  		data = ring->data[idx];
  
diff --git a/target/linux/generic/pending-5.4/770-10-net-ethernet-mtk_eth_soc-unmap-rx-data-before-callin.patch b/target/linux/generic/pending-5.4/770-10-net-ethernet-mtk_eth_soc-unmap-rx-data-before-callin.patch
index 2e1d2bb79d..285fcf8971 100644
--- a/target/linux/generic/pending-5.4/770-10-net-ethernet-mtk_eth_soc-unmap-rx-data-before-callin.patch
+++ b/target/linux/generic/pending-5.4/770-10-net-ethernet-mtk_eth_soc-unmap-rx-data-before-callin.patch
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1293,17 +1293,18 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1314,17 +1314,18 @@ static int mtk_poll_rx(struct napi_struc
  			goto release_desc;
  		}
  
@@ -34,7 +34,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		pktlen = RX_DMA_GET_PLEN0(trxd.rxd2);
  		skb->dev = netdev;
  		skb_put(skb, pktlen);
-@@ -1321,6 +1322,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1342,6 +1343,7 @@ static int mtk_poll_rx(struct napi_struc
  		skb_record_rx_queue(skb, 0);
  		napi_gro_receive(napi, skb);
  
diff --git a/target/linux/generic/pending-5.4/770-11-net-ethernet-mtk_eth_soc-avoid-rearming-interrupt-if.patch b/target/linux/generic/pending-5.4/770-11-net-ethernet-mtk_eth_soc-avoid-rearming-interrupt-if.patch
index e56799eb16..4036e32354 100644
--- a/target/linux/generic/pending-5.4/770-11-net-ethernet-mtk_eth_soc-avoid-rearming-interrupt-if.patch
+++ b/target/linux/generic/pending-5.4/770-11-net-ethernet-mtk_eth_soc-avoid-rearming-interrupt-if.patch
@@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1515,8 +1515,8 @@ static int mtk_napi_tx(struct napi_struc
+@@ -1536,8 +1536,8 @@ static int mtk_napi_tx(struct napi_struc
  	if (status & MTK_TX_DONE_INT)
  		return budget;
  
@@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	return tx_done;
  }
-@@ -1549,8 +1549,9 @@ poll_again:
+@@ -1570,8 +1570,9 @@ poll_again:
  		remain_budget -= rx_done;
  		goto poll_again;
  	}
diff --git a/target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch b/target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch
index 16993b9d80..b1bde7bbff 100644
--- a/target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch
+++ b/target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch
@@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  #include "mtk_eth_soc.h"
  
-@@ -1259,13 +1260,12 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1280,13 +1281,12 @@ static int mtk_poll_rx(struct napi_struc
  			break;
  
  		/* find out which mac the packet come from. values start at 1 */
@@ -37,7 +37,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  		if (unlikely(mac < 0 || mac >= MTK_MAC_COUNT ||
  			     !eth->netdev[mac]))
-@@ -2247,6 +2247,9 @@ static void mtk_gdm_config(struct mtk_et
+@@ -2268,6 +2268,9 @@ static void mtk_gdm_config(struct mtk_et
  
  		val |= config;
  
@@ -57,7 +57,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #define MTK_GDMA_ICS_EN		BIT(22)
  #define MTK_GDMA_TCS_EN		BIT(21)
  #define MTK_GDMA_UCS_EN		BIT(20)
-@@ -311,6 +312,7 @@
+@@ -324,6 +325,7 @@
  #define RX_DMA_L4_VALID_PDMA	BIT(30)		/* when PDMA is used */
  #define RX_DMA_FPORT_SHIFT	19
  #define RX_DMA_FPORT_MASK	0x7
diff --git a/target/linux/generic/pending-5.4/770-14-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch b/target/linux/generic/pending-5.4/770-14-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch
index 68ae19ec6e..4ab3d84163 100644
--- a/target/linux/generic/pending-5.4/770-14-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch
+++ b/target/linux/generic/pending-5.4/770-14-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch
@@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #include <net/dsa.h>
  
  #include "mtk_eth_soc.h"
-@@ -1246,6 +1247,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1267,6 +1268,7 @@ static int mtk_poll_rx(struct napi_struc
  		struct net_device *netdev;
  		unsigned int pktlen;
  		dma_addr_t dma_addr;
@@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		int mac;
  
  		ring = mtk_get_rx_ring(eth);
-@@ -1315,6 +1317,12 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1336,6 +1338,12 @@ static int mtk_poll_rx(struct napi_struc
  		skb->protocol = eth_type_trans(skb, netdev);
  		bytes += pktlen;
  
diff --git a/target/linux/generic/pending-5.4/770-15-net-ethernet-mediatek-mtk_eth_soc-add-support-for-in.patch b/target/linux/generic/pending-5.4/770-15-net-ethernet-mediatek-mtk_eth_soc-add-support-for-in.patch
index 2614502f5a..f609f11d2c 100644
--- a/target/linux/generic/pending-5.4/770-15-net-ethernet-mediatek-mtk_eth_soc-add-support-for-in.patch
+++ b/target/linux/generic/pending-5.4/770-15-net-ethernet-mediatek-mtk_eth_soc-add-support-for-in.patch
@@ -24,7 +24,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +mtk_eth-y := mtk_eth_soc.o mtk_sgmii.o mtk_eth_path.o mtk_ppe.o
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2280,12 +2280,17 @@ static int mtk_open(struct net_device *d
+@@ -2301,12 +2301,17 @@ static int mtk_open(struct net_device *d
  
  	/* we run 2 netdevs on the same dma ring so we only bring it up once */
  	if (!refcount_read(&eth->dma_refcnt)) {
@@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  		napi_enable(&eth->tx_napi);
  		napi_enable(&eth->rx_napi);
-@@ -2355,6 +2360,9 @@ static int mtk_stop(struct net_device *d
+@@ -2376,6 +2381,9 @@ static int mtk_stop(struct net_device *d
  
  	mtk_dma_free(eth);
  
@@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	return 0;
  }
  
-@@ -3144,6 +3152,13 @@ static int mtk_probe(struct platform_dev
+@@ -3165,6 +3173,13 @@ static int mtk_probe(struct platform_dev
  			goto err_free_dev;
  	}
  
@@ -68,7 +68,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	for (i = 0; i < MTK_MAX_DEVS; i++) {
  		if (!eth->netdev[i])
  			continue;
-@@ -3218,6 +3233,7 @@ static const struct mtk_soc_data mt7621_
+@@ -3239,6 +3254,7 @@ static const struct mtk_soc_data mt7621_
  	.hw_features = MTK_HW_FEATURES,
  	.required_clks = MT7621_CLKS_BITMAP,
  	.required_pctl = false,
@@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  };
  
  static const struct mtk_soc_data mt7622_data = {
-@@ -3226,6 +3242,7 @@ static const struct mtk_soc_data mt7622_
+@@ -3247,6 +3263,7 @@ static const struct mtk_soc_data mt7622_
  	.hw_features = MTK_HW_FEATURES,
  	.required_clks = MT7622_CLKS_BITMAP,
  	.required_pctl = false,
@@ -102,7 +102,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #define MTK_GDMA_DROP_ALL       0x7777
  
  /* Unicast Filter MAC Address Register - Low */
-@@ -308,6 +310,12 @@
+@@ -321,6 +323,12 @@
  #define RX_DMA_VID(_x)		((_x) & 0xfff)
  
  /* QDMA descriptor rxd4 */
@@ -115,7 +115,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #define RX_DMA_L4_VALID		BIT(24)
  #define RX_DMA_L4_VALID_PDMA	BIT(30)		/* when PDMA is used */
  #define RX_DMA_FPORT_SHIFT	19
-@@ -807,6 +815,7 @@ struct mtk_soc_data {
+@@ -827,6 +835,7 @@ struct mtk_soc_data {
  	u32		caps;
  	u32		required_clks;
  	bool		required_pctl;
@@ -123,7 +123,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	netdev_features_t hw_features;
  };
  
-@@ -918,6 +927,8 @@ struct mtk_eth {
+@@ -938,6 +947,8 @@ struct mtk_eth {
  	u32				tx_int_status_reg;
  	u32				rx_dma_l4_valid;
  	int				ip_align;
diff --git a/target/linux/generic/pending-5.4/770-16-net-ethernet-mediatek-mtk_eth_soc-add-flow-offloadin.patch b/target/linux/generic/pending-5.4/770-16-net-ethernet-mediatek-mtk_eth_soc-add-flow-offloadin.patch
index f63ed28998..b0f06f603b 100644
--- a/target/linux/generic/pending-5.4/770-16-net-ethernet-mediatek-mtk_eth_soc-add-flow-offloadin.patch
+++ b/target/linux/generic/pending-5.4/770-16-net-ethernet-mediatek-mtk_eth_soc-add-flow-offloadin.patch
@@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #include <net/dsa.h>
  
  #include "mtk_eth_soc.h"
-@@ -1327,8 +1329,12 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1348,8 +1350,12 @@ static int mtk_poll_rx(struct napi_struc
  		    (trxd.rxd2 & RX_DMA_VTAG))
  			__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
  					       RX_DMA_VID(trxd.rxd3));
@@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  skip_rx:
  		ring->data[idx] = new_data;
-@@ -2861,6 +2867,25 @@ static int mtk_set_rxnfc(struct net_devi
+@@ -2882,6 +2888,25 @@ static int mtk_set_rxnfc(struct net_devi
  	return ret;
  }
  
@@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static const struct ethtool_ops mtk_ethtool_ops = {
  	.get_link_ksettings	= mtk_get_link_ksettings,
  	.set_link_ksettings	= mtk_set_link_ksettings,
-@@ -2892,6 +2917,7 @@ static const struct net_device_ops mtk_n
+@@ -2913,6 +2938,7 @@ static const struct net_device_ops mtk_n
  #ifdef CONFIG_NET_POLL_CONTROLLER
  	.ndo_poll_controller	= mtk_poll_controller,
  #endif
@@ -78,7 +78,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  };
  
  static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
-@@ -3157,6 +3183,10 @@ static int mtk_probe(struct platform_dev
+@@ -3178,6 +3204,10 @@ static int mtk_probe(struct platform_dev
  				   eth->base + MTK_ETH_PPE_BASE, 2);
  		if (err)
  			goto err_free_dev;
@@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	for (i = 0; i < MTK_MAX_DEVS; i++) {
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -929,6 +929,7 @@ struct mtk_eth {
+@@ -949,6 +949,7 @@ struct mtk_eth {
  	int				ip_align;
  
  	struct mtk_ppe			ppe;
@@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  };
  
  /* struct mtk_mac -	the structure that holds the info about the MACs of the
-@@ -973,4 +974,12 @@ int mtk_gmac_sgmii_path_setup(struct mtk
+@@ -993,4 +994,12 @@ int mtk_gmac_sgmii_path_setup(struct mtk
  int mtk_gmac_gephy_path_setup(struct mtk_eth *eth, int mac_id);
  int mtk_gmac_rgmii_path_setup(struct mtk_eth *eth, int mac_id);
  
diff --git a/target/linux/layerscape/patches-5.4/701-net-0029-sdk_dpaa-update-the-xmit-timestamp-to-avoid-watchdog.patch b/target/linux/layerscape/patches-5.4/701-net-0029-sdk_dpaa-update-the-xmit-timestamp-to-avoid-watchdog.patch
index 7f925f8946..044e7013a0 100644
--- a/target/linux/layerscape/patches-5.4/701-net-0029-sdk_dpaa-update-the-xmit-timestamp-to-avoid-watchdog.patch
+++ b/target/linux/layerscape/patches-5.4/701-net-0029-sdk_dpaa-update-the-xmit-timestamp-to-avoid-watchdog.patch
@@ -59,7 +59,7 @@ Signed-off-by: Camelia Groza <camelia.groza at nxp.com>
   */
 --- a/net/sched/sch_generic.c
 +++ b/net/sched/sch_generic.c
-@@ -440,6 +440,13 @@ static void dev_watchdog(struct timer_li
+@@ -465,6 +465,13 @@ static void dev_watchdog(struct timer_li
  					txq->trans_timeout++;
  					break;
  				}
diff --git a/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch b/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch
index 9d3f2ecfda..e3d18a9948 100644
--- a/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch
+++ b/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch
@@ -54,7 +54,7 @@ Signed-off-by: Peter Chen <peter.chen at nxp.com>
  	 * All 3.1 IP version constants are greater than the 3.0 IP
 --- a/drivers/usb/dwc3/gadget.c
 +++ b/drivers/usb/dwc3/gadget.c
-@@ -3574,6 +3574,10 @@ int dwc3_gadget_init(struct dwc3 *dwc)
+@@ -3575,6 +3575,10 @@ int dwc3_gadget_init(struct dwc3 *dwc)
  	dwc->gadget.sg_supported	= true;
  	dwc->gadget.name		= "dwc3-gadget";
  	dwc->gadget.lpm_capable		= true;
diff --git a/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch b/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch
index 7938751124..913784372b 100644
--- a/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch
+++ b/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch
@@ -64,7 +64,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -1450,7 +1450,9 @@ static void mt7530_phylink_mac_link_down
+@@ -1442,7 +1442,9 @@ static void mt7530_phylink_mac_link_down
  static void mt7530_phylink_mac_link_up(struct dsa_switch *ds, int port,
  				       unsigned int mode,
  				       phy_interface_t interface,
@@ -90,7 +90,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		mv88e6xxx_mac_link_force(ds, port, LINK_FORCED_UP);
 --- a/drivers/net/dsa/sja1105/sja1105_main.c
 +++ b/drivers/net/dsa/sja1105/sja1105_main.c
-@@ -830,7 +830,9 @@ static void sja1105_mac_link_down(struct
+@@ -831,7 +831,9 @@ static void sja1105_mac_link_down(struct
  static void sja1105_mac_link_up(struct dsa_switch *ds, int port,
  				unsigned int mode,
  				phy_interface_t interface,
diff --git a/target/linux/mediatek/patches-5.4/0602-net-dsa-mt7530-use-resolved-link-config-in-mac_link_.patch b/target/linux/mediatek/patches-5.4/0602-net-dsa-mt7530-use-resolved-link-config-in-mac_link_.patch
index de5b260778..0f437ae153 100644
--- a/target/linux/mediatek/patches-5.4/0602-net-dsa-mt7530-use-resolved-link-config-in-mac_link_.patch
+++ b/target/linux/mediatek/patches-5.4/0602-net-dsa-mt7530-use-resolved-link-config-in-mac_link_.patch
@@ -51,7 +51,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	mutex_unlock(&priv->reg_mutex);
  }
-@@ -1405,8 +1394,7 @@ static void mt7530_phylink_mac_config(st
+@@ -1397,8 +1386,7 @@ static void mt7530_phylink_mac_config(st
  
  	mcr_cur = mt7530_read(priv, MT7530_PMCR_P(port));
  	mcr_new = mcr_cur;
@@ -61,7 +61,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mcr_new |= PMCR_IFG_XMIT(1) | PMCR_MAC_MODE | PMCR_BACKOFF_EN |
  		   PMCR_BACKPR_EN | PMCR_FORCE_MODE;
  
-@@ -1414,26 +1402,6 @@ static void mt7530_phylink_mac_config(st
+@@ -1406,26 +1394,6 @@ static void mt7530_phylink_mac_config(st
  	if (port == 5 && dsa_is_user_port(ds, 5))
  		mcr_new |= PMCR_EXT_PHY;
  
@@ -88,7 +88,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	if (mcr_new != mcr_cur)
  		mt7530_write(priv, MT7530_PMCR_P(port), mcr_new);
  }
-@@ -1444,7 +1412,7 @@ static void mt7530_phylink_mac_link_down
+@@ -1436,7 +1404,7 @@ static void mt7530_phylink_mac_link_down
  {
  	struct mt7530_priv *priv = ds->priv;
  
@@ -97,7 +97,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  }
  
  static void mt7530_phylink_mac_link_up(struct dsa_switch *ds, int port,
-@@ -1455,8 +1423,31 @@ static void mt7530_phylink_mac_link_up(s
+@@ -1447,8 +1415,31 @@ static void mt7530_phylink_mac_link_up(s
  				       bool tx_pause, bool rx_pause)
  {
  	struct mt7530_priv *priv = ds->priv;
diff --git a/target/linux/mediatek/patches-5.4/0603-net-dsa-mt7530-Extend-device-data-ready-for-adding-a.patch b/target/linux/mediatek/patches-5.4/0603-net-dsa-mt7530-Extend-device-data-ready-for-adding-a.patch
index 04189e8e31..9ac5599a25 100644
--- a/target/linux/mediatek/patches-5.4/0603-net-dsa-mt7530-Extend-device-data-ready-for-adding-a.patch
+++ b/target/linux/mediatek/patches-5.4/0603-net-dsa-mt7530-Extend-device-data-ready-for-adding-a.patch
@@ -47,7 +47,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  		return -EINVAL;
  	}
  
-@@ -1342,12 +1344,11 @@ mt7530_setup(struct dsa_switch *ds)
+@@ -1334,12 +1336,11 @@ mt7530_setup(struct dsa_switch *ds)
  	return 0;
  }
  
@@ -63,7 +63,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  
  	switch (port) {
  	case 0: /* Internal phy */
-@@ -1356,33 +1357,114 @@ static void mt7530_phylink_mac_config(st
+@@ -1348,33 +1349,114 @@ static void mt7530_phylink_mac_config(st
  	case 3:
  	case 4:
  		if (state->interface != PHY_INTERFACE_MODE_GMII)
@@ -189,7 +189,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  		return;
  	}
  
-@@ -1450,61 +1532,44 @@ static void mt7530_phylink_mac_link_up(s
+@@ -1442,61 +1524,44 @@ static void mt7530_phylink_mac_link_up(s
  	mt7530_set(priv, MT7530_PMCR_P(port), mcr);
  }
  
@@ -274,7 +274,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  	phylink_set(mask, Pause);
  	phylink_set(mask, Asym_Pause);
  
-@@ -1600,12 +1665,45 @@ static int mt7530_set_mac_eee(struct dsa
+@@ -1592,12 +1657,45 @@ static int mt7530_set_mac_eee(struct dsa
  	return 0;
  }
  
@@ -323,7 +323,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  	.get_ethtool_stats	= mt7530_get_ethtool_stats,
  	.get_sset_count		= mt7530_get_sset_count,
  	.port_enable		= mt7530_port_enable,
-@@ -1622,18 +1720,43 @@ static const struct dsa_switch_ops mt753
+@@ -1614,18 +1712,43 @@ static const struct dsa_switch_ops mt753
  	.port_vlan_del		= mt7530_port_vlan_del,
  	.port_mirror_add	= mt7530_port_mirror_add,
  	.port_mirror_del	= mt7530_port_mirror_del,
@@ -372,7 +372,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  	{ /* sentinel */ },
  };
  MODULE_DEVICE_TABLE(of, mt7530_of_match);
-@@ -1671,8 +1794,21 @@ mt7530_probe(struct mdio_device *mdiodev
+@@ -1663,8 +1786,21 @@ mt7530_probe(struct mdio_device *mdiodev
  	/* Get the hardware identifier from the devicetree node.
  	 * We will need it for some of the clock and regulator setup.
  	 */
diff --git a/target/linux/mediatek/patches-5.4/0604-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch b/target/linux/mediatek/patches-5.4/0604-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch
index 9333f03aaf..8434c61b50 100644
--- a/target/linux/mediatek/patches-5.4/0604-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch
+++ b/target/linux/mediatek/patches-5.4/0604-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch
@@ -394,7 +394,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  	 */
  	mt7530_write(priv, MT7530_PCR_P(port),
  		     PCR_MATRIX(dsa_user_ports(priv->ds)));
-@@ -1130,27 +1454,42 @@ mt7530_port_vlan_del(struct dsa_switch *
+@@ -1122,27 +1446,42 @@ mt7530_port_vlan_del(struct dsa_switch *
  	return 0;
  }
  
@@ -444,7 +444,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  
  	val = mt7530_read(priv, MT7530_PCR_P(port));
  	if (ingress) {
-@@ -1165,7 +1504,7 @@ static int mt7530_port_mirror_add(struct
+@@ -1157,7 +1496,7 @@ static int mt7530_port_mirror_add(struct
  	return 0;
  }
  
@@ -453,7 +453,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  				   struct dsa_mall_mirror_tc_entry *mirror)
  {
  	struct mt7530_priv *priv = ds->priv;
-@@ -1182,9 +1521,9 @@ static void mt7530_port_mirror_del(struc
+@@ -1174,9 +1513,9 @@ static void mt7530_port_mirror_del(struc
  	mt7530_write(priv, MT7530_PCR_P(port), val);
  
  	if (!priv->mirror_rx && !priv->mirror_tx) {
@@ -466,7 +466,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  	}
  }
  
-@@ -1290,7 +1629,7 @@ mt7530_setup(struct dsa_switch *ds)
+@@ -1282,7 +1621,7 @@ mt7530_setup(struct dsa_switch *ds)
  			   PCR_MATRIX_CLR);
  
  		if (dsa_is_cpu_port(ds, i))
@@ -475,7 +475,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  		else
  			mt7530_port_disable(ds, i);
  
-@@ -1344,6 +1683,118 @@ mt7530_setup(struct dsa_switch *ds)
+@@ -1336,6 +1675,118 @@ mt7530_setup(struct dsa_switch *ds)
  	return 0;
  }
  
@@ -594,7 +594,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  static bool
  mt7530_phy_mode_supported(struct dsa_switch *ds, int port,
  			  const struct phylink_link_state *state)
-@@ -1382,6 +1833,47 @@ unsupported:
+@@ -1374,6 +1825,47 @@ unsupported:
  	return false;
  }
  
@@ -642,7 +642,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  static bool
  mt753x_phy_mode_supported(struct dsa_switch *ds, int port,
  			  const struct phylink_link_state *state)
-@@ -1414,6 +1906,227 @@ mt7530_mac_config(struct dsa_switch *ds,
+@@ -1406,6 +1898,227 @@ mt7530_mac_config(struct dsa_switch *ds,
  	return 0;
  }
  
@@ -870,7 +870,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  static int
  mt753x_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
  		  const struct phylink_link_state *state)
-@@ -1449,6 +2162,8 @@ mt753x_phylink_mac_config(struct dsa_swi
+@@ -1441,6 +2154,8 @@ mt753x_phylink_mac_config(struct dsa_swi
  		if (mt753x_mac_config(ds, port, mode, state) < 0)
  			goto unsupported;
  
@@ -879,7 +879,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  		break;
  	case 6: /* 1st cpu port */
  		if (priv->p6_interface == state->interface)
-@@ -1468,7 +2183,8 @@ unsupported:
+@@ -1460,7 +2175,8 @@ unsupported:
  		return;
  	}
  
@@ -889,7 +889,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  		dev_err(ds->dev, "%s: in-band negotiation unsupported\n",
  			__func__);
  		return;
-@@ -1478,7 +2194,7 @@ unsupported:
+@@ -1470,7 +2186,7 @@ unsupported:
  	mcr_new = mcr_cur;
  	mcr_new &= ~PMCR_LINK_SETTINGS_MASK;
  	mcr_new |= PMCR_IFG_XMIT(1) | PMCR_MAC_MODE | PMCR_BACKOFF_EN |
@@ -898,7 +898,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  
  	/* Are we connected to external phy */
  	if (port == 5 && dsa_is_user_port(ds, 5))
-@@ -1488,7 +2204,18 @@ unsupported:
+@@ -1480,7 +2196,18 @@ unsupported:
  		mt7530_write(priv, MT7530_PMCR_P(port), mcr_new);
  }
  
@@ -918,7 +918,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  					 unsigned int mode,
  					 phy_interface_t interface)
  {
-@@ -1497,7 +2224,19 @@ static void mt7530_phylink_mac_link_down
+@@ -1489,7 +2216,19 @@ static void mt7530_phylink_mac_link_down
  	mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK);
  }
  
@@ -939,7 +939,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  				       unsigned int mode,
  				       phy_interface_t interface,
  				       struct phy_device *phydev,
-@@ -1507,18 +2246,29 @@ static void mt7530_phylink_mac_link_up(s
+@@ -1499,18 +2238,29 @@ static void mt7530_phylink_mac_link_up(s
  	struct mt7530_priv *priv = ds->priv;
  	u32 mcr;
  
@@ -971,7 +971,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  		break;
  	}
  	if (duplex == DUPLEX_FULL) {
-@@ -1532,6 +2282,45 @@ static void mt7530_phylink_mac_link_up(s
+@@ -1524,6 +2274,45 @@ static void mt7530_phylink_mac_link_up(s
  	mt7530_set(priv, MT7530_PMCR_P(port), mcr);
  }
  
@@ -1017,7 +1017,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  static void
  mt7530_mac_port_validate(struct dsa_switch *ds, int port,
  			 unsigned long *supported)
-@@ -1540,6 +2329,14 @@ mt7530_mac_port_validate(struct dsa_swit
+@@ -1532,6 +2321,14 @@ mt7530_mac_port_validate(struct dsa_swit
  		phylink_set(supported, 1000baseX_Full);
  }
  
@@ -1032,7 +1032,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  static void
  mt753x_phylink_validate(struct dsa_switch *ds, int port,
  			unsigned long *supported,
-@@ -1556,7 +2353,8 @@ mt753x_phylink_validate(struct dsa_switc
+@@ -1548,7 +2345,8 @@ mt753x_phylink_validate(struct dsa_switc
  
  	phylink_set_port_modes(mask);
  
@@ -1042,7 +1042,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  		phylink_set(mask, 10baseT_Half);
  		phylink_set(mask, 10baseT_Full);
  		phylink_set(mask, 100baseT_Half);
-@@ -1575,6 +2373,11 @@ mt753x_phylink_validate(struct dsa_switc
+@@ -1567,6 +2365,11 @@ mt753x_phylink_validate(struct dsa_switc
  
  	linkmode_and(supported, supported, mask);
  	linkmode_and(state->advertising, state->advertising, mask);
@@ -1054,7 +1054,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  }
  
  static int
-@@ -1665,6 +2468,63 @@ static int mt7530_set_mac_eee(struct dsa
+@@ -1657,6 +2460,63 @@ static int mt7530_set_mac_eee(struct dsa
  	return 0;
  }
  
@@ -1118,7 +1118,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  static int
  mt753x_phylink_mac_link_state(struct dsa_switch *ds, int port,
  			      struct phylink_link_state *state)
-@@ -1718,13 +2578,14 @@ static const struct dsa_switch_ops mt753
+@@ -1710,13 +2570,14 @@ static const struct dsa_switch_ops mt753
  	.port_vlan_prepare	= mt7530_port_vlan_prepare,
  	.port_vlan_add		= mt7530_port_vlan_add,
  	.port_vlan_del		= mt7530_port_vlan_del,
@@ -1137,7 +1137,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  	.get_mac_eee		= mt7530_get_mac_eee,
  	.set_mac_eee		= mt7530_set_mac_eee,
  };
-@@ -1752,11 +2613,26 @@ static const struct mt753x_info mt753x_t
+@@ -1744,11 +2605,26 @@ static const struct mt753x_info mt753x_t
  		.mac_port_get_state = mt7530_phylink_mac_link_state,
  		.mac_port_config = mt7530_mac_config,
  	},
diff --git a/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch b/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch
index 98886767a2..e75d76b9cc 100644
--- a/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch
+++ b/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch
@@ -37,7 +37,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #include <linux/mfd/syscon.h>
  #include <linux/regmap.h>
  #include <linux/clk.h>
-@@ -2485,6 +2486,13 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2506,6 +2507,13 @@ static int mtk_hw_init(struct mtk_eth *e
  	if (ret)
  		goto err_disable_pm;
  
@@ -51,7 +51,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
  		ret = device_reset(eth->dev);
  		if (ret) {
-@@ -3083,6 +3091,16 @@ static int mtk_probe(struct platform_dev
+@@ -3104,6 +3112,16 @@ static int mtk_probe(struct platform_dev
  		}
  	}
  
@@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  					  GFP_KERNEL);
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -435,6 +435,12 @@
+@@ -448,6 +448,12 @@
  #define RSTCTRL_FE		BIT(6)
  #define RSTCTRL_PPE		BIT(31)
  
diff --git a/target/linux/ramips/patches-5.4/0007-MIPS-ralink-copy-the-commandline-from-the-devicetree.patch b/target/linux/ramips/patches-5.4/0007-MIPS-ralink-copy-the-commandline-from-the-devicetree.patch
index 54af571d85..c05ee8018d 100644
--- a/target/linux/ramips/patches-5.4/0007-MIPS-ralink-copy-the-commandline-from-the-devicetree.patch
+++ b/target/linux/ramips/patches-5.4/0007-MIPS-ralink-copy-the-commandline-from-the-devicetree.patch
@@ -10,7 +10,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
 
 --- a/arch/mips/ralink/of.c
 +++ b/arch/mips/ralink/of.c
-@@ -80,6 +80,8 @@ void __init plat_mem_setup(void)
+@@ -82,6 +82,8 @@ void __init plat_mem_setup(void)
  
  	__dt_setup_arch(dtb);
  
diff --git a/target/linux/ramips/patches-5.4/0048-asoc-add-mt7620-support.patch b/target/linux/ramips/patches-5.4/0048-asoc-add-mt7620-support.patch
index d0d4141a8d..cffdc4f4a1 100644
--- a/target/linux/ramips/patches-5.4/0048-asoc-add-mt7620-support.patch
+++ b/target/linux/ramips/patches-5.4/0048-asoc-add-mt7620-support.patch
@@ -18,24 +18,6 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  create mode 100644 sound/soc/ralink/mt7620-i2s.c
  create mode 100644 sound/soc/ralink/mt7620-wm8960.c
 
---- a/arch/mips/ralink/of.c
-+++ b/arch/mips/ralink/of.c
-@@ -13,6 +13,7 @@
- #include <linux/of_fdt.h>
- #include <linux/kernel.h>
- #include <linux/memblock.h>
-+#include <linux/module.h>
- #include <linux/of_platform.h>
- #include <linux/of_address.h>
- 
-@@ -24,6 +25,7 @@
- #include "common.h"
- 
- __iomem void *rt_sysc_membase;
-+EXPORT_SYMBOL(rt_sysc_membase);
- __iomem void *rt_memc_membase;
- 
- __iomem void *plat_of_remap_node(const char *node)
 --- a/sound/soc/Kconfig
 +++ b/sound/soc/Kconfig
 @@ -60,6 +60,7 @@ source "sound/soc/mxs/Kconfig"
diff --git a/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch b/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch
index 6583fca60b..b011b140c7 100644
--- a/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch
+++ b/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch
@@ -14,7 +14,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2922,6 +2922,7 @@ static const struct net_device_ops mtk_n
+@@ -2943,6 +2943,7 @@ static const struct net_device_ops mtk_n
  
  static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
  {
@@ -22,7 +22,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  	const __be32 *_id = of_get_property(np, "reg", NULL);
  	struct phylink *phylink;
  	int phy_mode, id, err;
-@@ -3014,6 +3015,9 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -3035,6 +3036,9 @@ static int mtk_add_mac(struct mtk_eth *e
  
  	eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH - MTK_RX_ETH_HLEN;
  


From lede-commits at lists.infradead.org  Sat Jun  5 15:27:51 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:27:51 -0400
Subject: [openwrt/openwrt] kernel: package Synopsys Designware PCI to I2C
 controller
In-Reply-To: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
References: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
Message-ID: <mailman.3352.1622933522.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/e9c9b5ec72e4ec8add23515a76bd5de5e7cac2a1

commit e9c9b5ec72e4ec8add23515a76bd5de5e7cac2a1
Author: Tomasz Maciej Nowak <tmn505 at gmail.com>
AuthorDate: Mon May 24 14:41:14 2021 +0200

    kernel: package Synopsys Designware PCI to I2C controller
    
    This is present on Roqos Core RC10 and needed to control LED matrix.
    
    Signed-off-by: Tomasz Maciej Nowak <tmn505 at gmail.com>
---
 package/kernel/linux/modules/i2c.mk | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/package/kernel/linux/modules/i2c.mk b/package/kernel/linux/modules/i2c.mk
index ca6463c81b..f429763227 100644
--- a/package/kernel/linux/modules/i2c.mk
+++ b/package/kernel/linux/modules/i2c.mk
@@ -84,6 +84,35 @@ endef
 $(eval $(call KernelPackage,i2c-algo-pcf))
 
 
+I2C_DWCORE_MODULES:= \
+  CONFIG_I2C_DESIGNWARE_CORE:drivers/i2c/busses/i2c-designware-core
+
+define KernelPackage/i2c-designware-core
+  $(call i2c_defaults,$(I2C_DWCORE_MODULES),58)
+  TITLE:=Synopsys DesignWare I2C core
+  DEPENDS:=+kmod-i2c-core +!LINUX_5_4:kmod-regmap-core
+  HIDDEN:=y
+endef
+
+$(eval $(call KernelPackage,i2c-designware-core))
+
+
+I2C_DWPCI_MODULES:= \
+  CONFIG_I2C_DESIGNWARE_PCI:drivers/i2c/busses/i2c-designware-pci
+
+define KernelPackage/i2c-designware-pci
+  $(call i2c_defaults,$(I2C_DWPCI_MODULES),59)
+  TITLE:=Synopsys DesignWare PCI
+  DEPENDS:=+kmod-i2c-designware-core
+endef
+
+define KernelPackage/i2c-designware-pci/description
+ Support for Synopsys DesignWare I2C controller. Only master mode is supported.
+endef
+
+$(eval $(call KernelPackage,i2c-designware-pci))
+
+
 I2C_GPIO_MODULES:= \
   CONFIG_I2C_GPIO:drivers/i2c/busses/i2c-gpio
 


From lede-commits at lists.infradead.org  Sat Jun  5 15:27:50 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:27:50 -0400
Subject: [openwrt/openwrt]  mvebu: armada-37xx: remove ethernet alias patch
In-Reply-To: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
References: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
Message-ID: <mailman.3353.1622933535.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/db014428b153215a2bdffc80ea44a3a03a1e18cd

commit db014428b153215a2bdffc80ea44a3a03a1e18cd
Author: Tomasz Maciej Nowak <tmn505 at gmail.com>
AuthorDate: Tue May 25 14:53:43 2021 +0200

    mvebu: armada-37xx: remove ethernet alias patch
    
    This patch has been added with initial support for ESPRESSObin board and
    mistakenly it affects all boards with this SoC. Drop this patch since
    the aliases are now in upstream dts for ESPRESSObin. If any boards are
    relying on this, please add the respective alias to that board dts.
    
    Signed-off-by: Tomasz Maciej Nowak <tmn505 at gmail.com>
---
 ...arm64-dts-marvell-armada37xx-Add-eth0-alias.patch | 20 --------------------
 ...uDPU-switch-PHY-operation-mode-to-2500base.patch} |  0
 ... 315-armada-xp-linksys-mamba-resize-kernel.patch} |  0
 ...ch => 316-armada-370-dts-fix-crypto-engine.patch} |  0
 4 files changed, 20 deletions(-)

diff --git a/target/linux/mvebu/patches-5.10/314-arm64-dts-marvell-armada37xx-Add-eth0-alias.patch b/target/linux/mvebu/patches-5.10/314-arm64-dts-marvell-armada37xx-Add-eth0-alias.patch
deleted file mode 100644
index e989f59d5c..0000000000
--- a/target/linux/mvebu/patches-5.10/314-arm64-dts-marvell-armada37xx-Add-eth0-alias.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-From be893f672e340b56ca60f2f6c32fdd713a5852f5 Mon Sep 17 00:00:00 2001
-From: Kevin Mihelich <kevin at archlinuxarm.org>
-Date: Tue, 4 Jul 2017 19:25:28 -0600
-Subject: arm64: dts: marvell: armada37xx: Add eth0 alias
-
-Signed-off-by: Kevin Mihelich <kevin at archlinuxarm.org>
----
- arch/arm64/boot/dts/marvell/armada-37xx.dtsi | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/arch/arm64/boot/dts/marvell/armada-37xx.dtsi
-+++ b/arch/arm64/boot/dts/marvell/armada-37xx.dtsi
-@@ -18,6 +18,7 @@
- 	#size-cells = <2>;
- 
- 	aliases {
-+		ethernet0 = &eth0;
- 		serial0 = &uart0;
- 		serial1 = &uart1;
- 	};
diff --git a/target/linux/mvebu/patches-5.10/315-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch b/target/linux/mvebu/patches-5.10/314-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch
similarity index 100%
rename from target/linux/mvebu/patches-5.10/315-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch
rename to target/linux/mvebu/patches-5.10/314-arm64-dts-uDPU-switch-PHY-operation-mode-to-2500base.patch
diff --git a/target/linux/mvebu/patches-5.10/316-armada-xp-linksys-mamba-resize-kernel.patch b/target/linux/mvebu/patches-5.10/315-armada-xp-linksys-mamba-resize-kernel.patch
similarity index 100%
rename from target/linux/mvebu/patches-5.10/316-armada-xp-linksys-mamba-resize-kernel.patch
rename to target/linux/mvebu/patches-5.10/315-armada-xp-linksys-mamba-resize-kernel.patch
diff --git a/target/linux/mvebu/patches-5.10/317-armada-370-dts-fix-crypto-engine.patch b/target/linux/mvebu/patches-5.10/316-armada-370-dts-fix-crypto-engine.patch
similarity index 100%
rename from target/linux/mvebu/patches-5.10/317-armada-370-dts-fix-crypto-engine.patch
rename to target/linux/mvebu/patches-5.10/316-armada-370-dts-fix-crypto-engine.patch


From lede-commits at lists.infradead.org  Sat Jun  5 15:27:52 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:27:52 -0400
Subject: [openwrt/openwrt]  x86: add Roqos Core RC10 ethernet interfaces
In-Reply-To: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
References: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
Message-ID: <mailman.3354.1622933542.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/09448d8ff30d7c1474c8dd0a762efe0417c471bd

commit 09448d8ff30d7c1474c8dd0a762efe0417c471bd
Author: Tomasz Maciej Nowak <tmn505 at gmail.com>
AuthorDate: Mon May 24 14:41:15 2021 +0200

    x86: add Roqos Core RC10 ethernet interfaces
    
    eth0 -> single NIC (i211at)
    eth1 -> single NIC (i211at) -> 4-port unmanaged switch (BCM53125U)
    
    Notes
    UART is exposed on J4 connector, pinout starting from pin marked 1:
    1. GND, 2. NC?, 3. NC?, 4. RX, 5. TX, 6. NC?
    baud: 115200, parity: none, flow control: none
    The board is setup by coreboot with UEFI. To enter setup screen hold
    ESC key on boot.
    The 5-LED multicolor matrix is attached on first I2C device named
    "Synopsys DesignWare I2C adapter" at address 0x60. Controlling values
    are stored in /opt/roqos/etc/rcLED.conf of original firmware.
    Remember to backup the original firmware, there are no downloadable
    copies.
    
    Signed-off-by: Tomasz Maciej Nowak <tmn505 at gmail.com>
---
 target/linux/x86/base-files/etc/board.d/02_network | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/target/linux/x86/base-files/etc/board.d/02_network b/target/linux/x86/base-files/etc/board.d/02_network
index 581daf49b6..30035dcbe9 100644
--- a/target/linux/x86/base-files/etc/board.d/02_network
+++ b/target/linux/x86/base-files/etc/board.d/02_network
@@ -11,6 +11,9 @@ case "$(board_name)" in
 pc-engines-apu1|pc-engines-apu2|pc-engines-apu3)
 	ucidef_set_interfaces_lan_wan "eth1 eth2" "eth0"
 	;;
+roqos-roqos-core-rc10)
+	ucidef_set_interfaces_lan_wan "eth1" "eth0"
+	;;
 sophos-sg-105|sophos-xg-105)
 	ucidef_set_interfaces_lan_wan "eth0 eth2 eth3" "eth1"
 	;;


From lede-commits at lists.infradead.org  Sat Jun  5 15:27:53 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 05 Jun 2021 18:27:53 -0400
Subject: [openwrt/openwrt] linux-firmware: update to version 20210315 and
 trim down broadcom FW
In-Reply-To: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
References: <162293206073.18433.11090279442785579071@git-01.infra.openwrt.org>
Message-ID: <mailman.3355.1622933549.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/ff2bb16730f629d54bde8ba85c75d8614741e3fd

commit ff2bb16730f629d54bde8ba85c75d8614741e3fd
Author: Josef Schlehofer <pepe.schlehofer at gmail.com>
AuthorDate: Sat May 1 08:51:12 2021 +0200

    linux-firmware: update to version 20210315 and trim down broadcom FW
    
    In there linux-firmware repository located in kernel, there were removed old
    broadcom firmware [1] as they seem to be likely vulnerable to Kr??k vulnerability
    (CVE-2019-15126), because Cypress released new versions and superseded
    by it.
    
    In OpenWrt, there is Makefile for cypress-firmware, which already provides
    the same named packages like it was in linux-firmware. For example, cypress-firmware-43455-sdio
    provides brcmfmac-firmware-43455-sdio [2].
    
    Changelog between 2020118 and 20210315:
    3568f96 (tag: 20210315) linux-firmware: Update firmware file for Intel Bluetooth AX210
    9e96e50 linux-firmware: Update firmware file for Intel Bluetooth AX200
    c8d0db5 linux-firmware: Update firmware file for Intel Bluetooth AX201
    5e2a387 Merge tag 'iwlwifi-fw-2021-03-05-v3' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/linux-firmware into main
    b0d3e31 rtw88: 8822c: Update normal firmware to v9.9.6
    5a2fd63 iwlwifi: add new FWs from core59-66 release
    4f54906 iwlwifi: update 9000-family firmwares
    11b7607 iwlwifi: update 7265D firmware
    e425f76 Merge branch 'add-silabs-wf200' of github.com:jerome-pouiller/linux-firmware into main
    5ecd13f Mellanox: Add new mlxsw_spectrum firmware xx.2008.2406
    58fb90a linux-firmware: add frimware for mediatek bluetooth chip (MT7921)
    e576a1b rtw89: 8852a: add firmware v0.9.12.2
    048a7cb WHENCE: add missing symlink for BananaPi M3
    aa6c6e7 Add symlink for BananaPi M2 to brcmfmac43430-sdio config
    58825f7 brcm: Fix Raspberry Pi 4B NVRAM file
    520f71b silabs: add new firmware for WF200
    f7915a0 amdgpu: add initial firmware for green sardine
    80cb579 rtw88: RTL8822C: Update normal firmware to v9.9.5
    b79d239 (tag: 20210208) Merge branch 'DG1-guc-huc-ADLS-dmc' of git://anongit.freedesktop.org/drm/drm-firmware into main
    66970e1 Merge branch 'qcom-rb5' of https://github.com/lumag/linux-firmware into main
    cf6fc2b Mellanox: Add new mlxsw_spectrum firmware xx.2008.2304
    391fd50 linux-firmware: add firmware for MT7921
    c5e3240 rtw88: RTL8821C: Update firmware to v24.8
    d33d2d8 linux-firmware: Update firmware file for Intel Bluetooth AX210
    3027ae4 linux-firmware: Update firmware file for Intel Bluetooth AX200
    13979c3 linux-firmware: Update firmware file for Intel Bluetooth AX201
    348d8a9 i915: Add DMC v2.01 for ADL-S
    f33f1f7 i915: Add HuC v7.7.1 for DG1
    6a422f5 i915: Add GuC v49.0.1 for DG1
    df822a8 qcom: Add venus firmware files for VPU-1.0
    11a1db1 qcom: Add SM8250 Compute DSP firmware
    e55248b qcom: Add SM8250 Audio DSP firmware
    da74cc6 qcom: add firmware files for Adreno a650
    0578970 brcm: Link RPi4's WiFi firmware with DMI machine name.
    d528862 brcm: Add NVRAM for Vamrs 96boards Rock960
    870b805 brcm: Update Raspberry Pi 3B+/4B NVRAM for downstream changes
    a28a590 cypress: Fix link direction
    060ad8b cypress: Link the new cypress firmware to the old brcm files
    0f0aefd brcm: remove old brcm firmwares that have newer cypress variants
    f580dc2 rtl_bt: Update RTL8822C BT(UART I/F) FW to 0x059A_25CB
    7df2220 rtl_bt: Update RTL8822C BT(USB I/F) FW to 0x099a_7253
    e79405d rtl_bt: Add firmware and config files for RTL8852A BT USB chip
    ef3813d rtl_bt: Update RTL8821C BT(USB I/F) FW to 0x829a_7644
    646f159 (tag: 20201218) make AP6212 in bananpi m2 plus/zero work
    28185ec linux-firmware: Update firmware file for Intel Bluetooth AX210
    23da869 linux-firmware: Update firmware file for Intel Bluetooth AX200
    2099248 linux-firmware: Update firmware file for Intel Bluetooth AX201
    94de5e2 linux-firmware: Update firmware file for Intel Bluetooth 9560
    27a3689 linux-firmware: Update firmware file for Intel Bluetooth 9260
    5c3c4af Merge branch 'lt9611uxc' of https://github.com/lumag/linux-firmware into main
    aaed4a8 Merge branch 'v1.1.6' of https://github.com/irui-wang/linux_fw_vpu_v1.1.6 into main
    d8c9865 Merge branch 'master' of https://github.com/sampnimm/linux-firmware-BT into main
    63ab3db linux-firmware: add firmware for Lontium LT9611UXC DSI to HDMI bridge
    0fe0fe0 mediatek: update MT8173 VPU firmware to v1.1.6
    1a08ec9 QCA : Updated firmware files for WCN3991
    7455a36 Merge branch 'guc_v49' of git://anongit.freedesktop.org/drm/drm-firmware into main
    7eb7fda linux-firmware: Update firmware file for Intel Bluetooth AX210
    5cbf459 linux-firmware: Update firmware file for Intel Bluetooth AX210
    c487f7d i915: Add GuC firmware v49.0.1 for all platforms
    d9ffb07 i915: Remove duplicate KBL DMC entry
    b362fd4 Mellanox: Add new mlxsw_spectrum firmware xx.2008.2018
    bc9cd0b linux-firmware: Update AMD SEV firmware
    54c797a amdgpu: add sienna cichlid firmware for 20.45
    1340e9c amdgpu: update vega20 firmware for 20.45
    b260c9c amdgpu: update vega12 firmware for 20.45
    d683bd5 amdgpu: update vega10 firmware for 20.45
    7c81cc2 amdgpu: update renoir firmware for 20.45
    3619e57 amdgpu: update navi14 firmware for 20.45
    68ce0fb amdgpu: update navi12 firmware for 20.45
    e889b80 amdgpu: update navi10 firmware for 20.45
    f4edc15 amdgpu: update raven2 firmware for 20.45
    e71210f amdgpu: update raven firmware for 20.45
    
    [1] https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/?id=0f0aefd733f70beae4c0246edbd2c158d5ce974c
    
    [2] https://github.com/openwrt/openwrt/blob/eeda8652f1655d4f9c11e9c9f51ddcd3377d119a/package/firmware/cypress-firmware/Makefile#L124
    
    Signed-off-by: Josef Schlehofer <pepe.schlehofer at gmail.com>
---
 package/firmware/linux-firmware/Makefile    |  6 +++---
 package/firmware/linux-firmware/broadcom.mk | 27 ---------------------------
 target/linux/sunxi/image/cortexa7.mk        |  8 ++++----
 3 files changed, 7 insertions(+), 34 deletions(-)

diff --git a/package/firmware/linux-firmware/Makefile b/package/firmware/linux-firmware/Makefile
index 7fb99dd2ce..e2fee3b6a2 100644
--- a/package/firmware/linux-firmware/Makefile
+++ b/package/firmware/linux-firmware/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=linux-firmware
-PKG_VERSION:=20201118
-PKG_RELEASE:=3
+PKG_VERSION:=20210315
+PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=@KERNEL/linux/kernel/firmware
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_HASH:=863d5a31da725b856a917280d1e3014929b3bc3d4e6e5faecf530c13afb7e2b9
+PKG_HASH:=a2348f03492713dca9aef202496c6e58f5e63ee5bec6a7bdfcf8b18ce7155e70
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 
diff --git a/package/firmware/linux-firmware/broadcom.mk b/package/firmware/linux-firmware/broadcom.mk
index 00f7076104..26f6534632 100644
--- a/package/firmware/linux-firmware/broadcom.mk
+++ b/package/firmware/linux-firmware/broadcom.mk
@@ -34,24 +34,6 @@ define Package/brcmfmac-firmware-4329-sdio/install
 endef
 $(eval $(call BuildPackage,brcmfmac-firmware-4329-sdio))
 
-Package/brcmfmac-firmware-43362-sdio = $(call Package/firmware-default,Broadcom BCM43362 FullMac SDIO firmware)
-define Package/brcmfmac-firmware-43362-sdio/install
-	$(INSTALL_DIR) $(1)/lib/firmware/brcm
-	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/brcm/brcmfmac43362-sdio.bin \
-		$(1)/lib/firmware/brcm/brcmfmac43362-sdio.bin
-endef
-$(eval $(call BuildPackage,brcmfmac-firmware-43362-sdio))
-
-Package/brcmfmac-firmware-43430-sdio = $(call Package/firmware-default,Broadcom BCM43430 FullMac SDIO firmware)
-define Package/brcmfmac-firmware-43430-sdio/install
-	$(INSTALL_DIR) $(1)/lib/firmware/brcm
-	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/brcm/brcmfmac43430-sdio.bin \
-		$(1)/lib/firmware/brcm/brcmfmac43430-sdio.bin
-endef
-$(eval $(call BuildPackage,brcmfmac-firmware-43430-sdio))
-
 Package/brcmfmac-firmware-43430-sdio-rpi-3b = $(call Package/firmware-default,Broadcom BCM43430 NVRAM for Raspberry Pi 3B)
 define Package/brcmfmac-firmware-43430-sdio-rpi-3b/install
 	$(INSTALL_DIR) $(1)/lib/firmware/brcm
@@ -79,15 +61,6 @@ define Package/brcmfmac-firmware-43430a0-sdio/install
 endef
 $(eval $(call BuildPackage,brcmfmac-firmware-43430a0-sdio))
 
-Package/brcmfmac-firmware-43455-sdio = $(call Package/firmware-default,Broadcom BCM43455 FullMac SDIO firmware)
-define Package/brcmfmac-firmware-43455-sdio/install
-	$(INSTALL_DIR) $(1)/lib/firmware/brcm
-	$(INSTALL_DATA) \
-		$(PKG_BUILD_DIR)/brcm/brcmfmac43455-sdio.bin \
-		$(1)/lib/firmware/brcm/brcmfmac43455-sdio.bin
-endef
-$(eval $(call BuildPackage,brcmfmac-firmware-43455-sdio))
-
 Package/brcmfmac-firmware-43455-sdio-rpi-3b-plus = $(call Package/firmware-default,Broadcom BCM43455 NVRAM for Raspberry Pi 3B+)
 define Package/brcmfmac-firmware-43455-sdio-rpi-3b-plus/install
 	$(INSTALL_DIR) $(1)/lib/firmware/brcm
diff --git a/target/linux/sunxi/image/cortexa7.mk b/target/linux/sunxi/image/cortexa7.mk
index 01474a20cb..59f11bc83c 100644
--- a/target/linux/sunxi/image/cortexa7.mk
+++ b/target/linux/sunxi/image/cortexa7.mk
@@ -23,7 +23,7 @@ define Device/friendlyarm_nanopi-m1-plus
   DEVICE_VENDOR := FriendlyARM
   DEVICE_MODEL := NanoPi M1 Plus
   DEVICE_PACKAGES:=kmod-rtc-sunxi kmod-leds-gpio kmod-brcmfmac \
-	brcmfmac-firmware-43430-sdio wpad-basic-wolfssl
+	cypress-firmware-43430-sdio wpad-basic-wolfssl
   SOC := sun8i-h3
 endef
 TARGET_DEVICES += friendlyarm_nanopi-m1-plus
@@ -39,7 +39,7 @@ define Device/friendlyarm_nanopi-neo-air
   DEVICE_VENDOR := FriendlyARM
   DEVICE_MODEL := NanoPi NEO Air
   DEVICE_PACKAGES := kmod-rtc-sunxi kmod-leds-gpio kmod-brcmfmac \
-	brcmfmac-firmware-43430-sdio wpad-basic-wolfssl
+	cypress-firmware-43430-sdio wpad-basic-wolfssl
   SOC := sun8i-h3
 endef
 TARGET_DEVICES += friendlyarm_nanopi-neo-air
@@ -48,7 +48,7 @@ define Device/friendlyarm_nanopi-r1
   DEVICE_VENDOR := FriendlyARM
   DEVICE_MODEL := NanoPi R1
   DEVICE_PACKAGES := kmod-rtc-sunxi kmod-usb-net-rtl8152 kmod-leds-gpio \
-	kmod-brcmfmac brcmfmac-firmware-43430-sdio wpad-basic-wolfssl
+	kmod-brcmfmac cypress-firmware-43430-sdio wpad-basic-wolfssl
   SOC := sun8i-h3
 endef
 TARGET_DEVICES += friendlyarm_nanopi-r1
@@ -81,7 +81,7 @@ define Device/sinovoip_bananapi-m2-berry
   DEVICE_VENDOR := Sinovoip
   DEVICE_MODEL := Banana Pi M2 Berry
   DEVICE_PACKAGES:=kmod-rtc-sunxi kmod-ata-sunxi kmod-brcmfmac \
-	brcmfmac-firmware-43430-sdio wpad-basic-wolfssl
+	cypress-firmware-43430-sdio wpad-basic-wolfssl
   SUPPORTED_DEVICES:=lemaker,bananapi-m2-berry
   SOC := sun8i-v40
 endef


From lede-commits at lists.infradead.org  Sun Jun  6 01:56:11 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 06 Jun 2021 04:56:11 -0400
Subject: [openwrt/openwrt]  mt76: update to the latest version
In-Reply-To: <162296977117.523.13078168543458985916@git-01.infra.openwrt.org>
References: <162296977117.523.13078168543458985916@git-01.infra.openwrt.org>
Message-ID: <mailman.3366.1622969777.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/3c46ba053d899df65dc07e373c64d1925d30f88e

commit 3c46ba053d899df65dc07e373c64d1925d30f88e
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Jun 6 10:40:05 2021 +0200

    mt76: update to the latest version
    
    Add mt7915e dependency on kmod-thermal
    
    22b690334c0f mt76: mt7915: do not fail if the cooling device could not be registered
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/kernel/mt76/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile
index 8a98c4bfc0..e4051d8347 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:=2021-06-02
-PKG_SOURCE_VERSION:=b9f09f530223893c0880c3b08fdb2afe55d152e1
-PKG_MIRROR_HASH:=4a8a8189c70d2f169ec69484c74af9221c1c3b62932624b049f3b23988f11d89
+PKG_SOURCE_DATE:=2021-06-06
+PKG_SOURCE_VERSION:=22b690334c0f49b11534cc2e331c9d5e17c4a0bc
+PKG_MIRROR_HASH:=ff5e563935919d2e40c1e7254ef3bc06f7ecc5e69f8ddd12903e8f5de942d630
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 PKG_BUILD_PARALLEL:=1
@@ -213,7 +213,7 @@ endef
 define KernelPackage/mt7915e
   $(KernelPackage/mt76-default)
   TITLE:=MediaTek MT7915e wireless driver
-  DEPENDS+=@PCI_SUPPORT +kmod-mt7615-common +kmod-hwmon-core + at DRIVER_11AX_SUPPORT
+  DEPENDS+=@PCI_SUPPORT +kmod-mt7615-common +kmod-hwmon-core +kmod-thermal + at DRIVER_11AX_SUPPORT
   FILES:= $(PKG_BUILD_DIR)/mt7915/mt7915e.ko
   AUTOLOAD:=$(call AutoProbe,mt7915e)
 endef


From lede-commits at lists.infradead.org  Sun Jun  6 08:51:49 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 06 Jun 2021 11:51:49 -0400
Subject: [openwrt/openwrt]  mac80211: Update to backports-5.10.42
In-Reply-To: <162299470973.12784.1354242761024910233@git-01.infra.openwrt.org>
References: <162299470973.12784.1354242761024910233@git-01.infra.openwrt.org>
Message-ID: <mailman.3416.1622994718.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/04a260911ca0f10a0e37c487c220e1aae3623dda

commit 04a260911ca0f10a0e37c487c220e1aae3623dda
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sat Jun 5 18:21:57 2021 +0200

    mac80211: Update to backports-5.10.42
    
    The removed patches were integrated upstream.
    
    The brcmf_driver_work workqueue was removed in brcmfmac with kernel
    5.10.42, the asynchronous call was covered to a synchronous call. There
    is no need to wait any more.
    This part was removed manually from this patch:
    brcm/860-brcmfmac-register-wiphy-s-during-module_init.patch
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/mac80211/Makefile                   |   6 +-
 .../patches/ath/402-ath_regd_optional.patch        |   2 +-
 .../patches/ath10k/080-ath10k_thermal_config.patch |   2 +-
 ...CCMP-PN-replay-protection-for-fragmented-.patch | 180 -----
 ...drop-fragments-with-multicast-DA-for-PCIe.patch |  66 --
 ...drop-fragments-with-multicast-DA-for-SDIO.patch |  40 -
 ...-MPDU-which-has-discard-flag-set-by-firmw.patch |  54 --
 ...ix-TKIP-Michael-MIC-verification-for-PCIe.patch |  48 --
 ...date-first-subframe-of-A-MSDU-before-proc.patch | 109 ---
 ...-controlling-support-for-various-chipsets.patch |   4 +-
 .../ath9k/551-ath9k_ubnt_uap_plus_hsr.patch        |   2 +-
 ...mfmac-register-wiphy-s-during-module_init.patch |  10 -
 .../mac80211/patches/build/001-fix_build.patch     |   8 +-
 .../mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch |   2 +-
 .../mwl/940-mwl8k_init_devices_synchronously.patch |   4 +-
 .../rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch |   2 +-
 ...wifi-8821ae-upgrade-PHY-and-RF-parameters.patch | 817 ---------------------
 .../subsys/100-remove-cryptoapi-dependencies.patch |  20 +-
 .../patches/subsys/150-disable_addr_notifier.patch |   6 +-
 ...-support-immediate-reconnect-request-hint.patch |   4 +-
 ...pport-driver-based-disconnect-with-reconn.patch |  34 +-
 ...-drop-get_default_func-move-default-flow-.patch |   2 +-
 ...0211-add-rx-decapsulation-offload-support.patch |  26 +-
 ...pport-Rx-timestamp-calculation-for-all-pr.patch |   2 +-
 ...c80211-assure-all-fragments-are-encrypted.patch |  69 --
 ...event-mixed-key-and-fragment-cache-attack.patch |  87 ---
 ...operly-handle-A-MSDUs-that-start-with-an-.patch |  66 --
 ...80211-mitigate-A-MSDU-aggregation-attacks.patch |  40 -
 .../384-mac80211-drop-A-MSDUs-on-old-ciphers.patch |  54 --
 ...5-mac80211-add-fragment-cache-to-sta_info.patch | 313 --------
 ...211-check-defrag-PN-against-current-frame.patch | 109 ---
 ...80211-prevent-attacks-on-TKIP-WEP-as-well.patch |  62 --
 ...o-not-accept-forward-invalid-EAPOL-frames.patch |  94 ---
 ...tend-protection-against-mixed-key-and-fra.patch |  68 --
 34 files changed, 63 insertions(+), 2349 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 92167ebf3b..a8a84f843a 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=mac80211
 
-PKG_VERSION:=5.10.34-1
+PKG_VERSION:=5.10.42-1
 PKG_RELEASE:=1
-PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.10.34/
-PKG_HASH:=03c4ca6bf47d4e50b91b61bc2943a98c788439e56ce2b4080bc4c94141c2c15b
+PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.10.42/
+PKG_HASH:=6876520105240844fdb32d1dcdf2bfdea291a37a96f16c892fda3776ba714fcb
 
 PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
diff --git a/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch b/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch
index 3c9180b113..bf87d3551a 100644
--- a/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch
+++ b/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch
@@ -82,7 +82,7 @@
  	help
 --- a/local-symbols
 +++ b/local-symbols
-@@ -86,6 +86,7 @@ ADM8211=
+@@ -85,6 +85,7 @@ ADM8211=
  ATH_COMMON=
  WLAN_VENDOR_ATH=
  ATH_DEBUG=
diff --git a/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch b/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch
index 55d48daa79..d183419a47 100644
--- a/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch
+++ b/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch
@@ -37,7 +37,7 @@
  void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature);
 --- a/local-symbols
 +++ b/local-symbols
-@@ -143,6 +143,7 @@ ATH10K_SNOC=
+@@ -144,6 +144,7 @@ ATH10K_SNOC=
  ATH10K_DEBUG=
  ATH10K_DEBUGFS=
  ATH10K_SPECTRAL=
diff --git a/package/kernel/mac80211/patches/ath10k/300-ath10k-add-CCMP-PN-replay-protection-for-fragmented-.patch b/package/kernel/mac80211/patches/ath10k/300-ath10k-add-CCMP-PN-replay-protection-for-fragmented-.patch
deleted file mode 100644
index 0ce49b22ab..0000000000
--- a/package/kernel/mac80211/patches/ath10k/300-ath10k-add-CCMP-PN-replay-protection-for-fragmented-.patch
+++ /dev/null
@@ -1,180 +0,0 @@
-From: Wen Gong <wgong at codeaurora.org>
-Date: Tue, 11 May 2021 20:02:52 +0200
-Subject: [PATCH] ath10k: add CCMP PN replay protection for fragmented
- frames for PCIe
-
-PN replay check for not fragmented frames is finished in the firmware,
-but this was not done for fragmented frames when ath10k is used with
-QCA6174/QCA6377 PCIe. mac80211 has the function
-ieee80211_rx_h_defragment() for PN replay check for fragmented frames,
-but this does not get checked with QCA6174 due to the
-ieee80211_has_protected() condition not matching the cleared Protected
-bit case.
-
-Validate the PN of received fragmented frames within ath10k when CCMP is
-used and drop the fragment if the PN is not correct (incremented by
-exactly one from the previous fragment). This applies only for
-QCA6174/QCA6377 PCIe.
-
-Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Wen Gong <wgong at codeaurora.org>
-Signed-off-by: Jouni Malinen <jouni at codeaurora.org>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/drivers/net/wireless/ath/ath10k/htt.h
-+++ b/drivers/net/wireless/ath/ath10k/htt.h
-@@ -846,6 +846,7 @@ enum htt_security_types {
- 
- #define ATH10K_HTT_TXRX_PEER_SECURITY_MAX 2
- #define ATH10K_TXRX_NUM_EXT_TIDS 19
-+#define ATH10K_TXRX_NON_QOS_TID 16
- 
- enum htt_security_flags {
- #define HTT_SECURITY_TYPE_MASK 0x7F
---- a/drivers/net/wireless/ath/ath10k/htt_rx.c
-+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
-@@ -1746,16 +1746,87 @@ static void ath10k_htt_rx_h_csum_offload
- 	msdu->ip_summed = ath10k_htt_rx_get_csum_state(msdu);
- }
- 
-+static u64 ath10k_htt_rx_h_get_pn(struct ath10k *ar, struct sk_buff *skb,
-+				  u16 offset,
-+				  enum htt_rx_mpdu_encrypt_type enctype)
-+{
-+	struct ieee80211_hdr *hdr;
-+	u64 pn = 0;
-+	u8 *ehdr;
-+
-+	hdr = (struct ieee80211_hdr *)(skb->data + offset);
-+	ehdr = skb->data + offset + ieee80211_hdrlen(hdr->frame_control);
-+
-+	if (enctype == HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2) {
-+		pn = ehdr[0];
-+		pn |= (u64)ehdr[1] << 8;
-+		pn |= (u64)ehdr[4] << 16;
-+		pn |= (u64)ehdr[5] << 24;
-+		pn |= (u64)ehdr[6] << 32;
-+		pn |= (u64)ehdr[7] << 40;
-+	}
-+	return pn;
-+}
-+
-+static bool ath10k_htt_rx_h_frag_pn_check(struct ath10k *ar,
-+					  struct sk_buff *skb,
-+					  u16 peer_id,
-+					  u16 offset,
-+					  enum htt_rx_mpdu_encrypt_type enctype)
-+{
-+	struct ath10k_peer *peer;
-+	union htt_rx_pn_t *last_pn, new_pn = {0};
-+	struct ieee80211_hdr *hdr;
-+	bool more_frags;
-+	u8 tid, frag_number;
-+	u32 seq;
-+
-+	peer = ath10k_peer_find_by_id(ar, peer_id);
-+	if (!peer) {
-+		ath10k_dbg(ar, ATH10K_DBG_HTT, "invalid peer for frag pn check\n");
-+		return false;
-+	}
-+
-+	hdr = (struct ieee80211_hdr *)(skb->data + offset);
-+	if (ieee80211_is_data_qos(hdr->frame_control))
-+		tid = ieee80211_get_tid(hdr);
-+	else
-+		tid = ATH10K_TXRX_NON_QOS_TID;
-+
-+	last_pn = &peer->frag_tids_last_pn[tid];
-+	new_pn.pn48 = ath10k_htt_rx_h_get_pn(ar, skb, offset, enctype);
-+	more_frags = ieee80211_has_morefrags(hdr->frame_control);
-+	frag_number = le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG;
-+	seq = (__le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4;
-+
-+	if (frag_number == 0) {
-+		last_pn->pn48 = new_pn.pn48;
-+		peer->frag_tids_seq[tid] = seq;
-+	} else {
-+		if (seq != peer->frag_tids_seq[tid])
-+			return false;
-+
-+		if (new_pn.pn48 != last_pn->pn48 + 1)
-+			return false;
-+
-+		last_pn->pn48 = new_pn.pn48;
-+	}
-+
-+	return true;
-+}
-+
- static void ath10k_htt_rx_h_mpdu(struct ath10k *ar,
- 				 struct sk_buff_head *amsdu,
- 				 struct ieee80211_rx_status *status,
- 				 bool fill_crypt_header,
- 				 u8 *rx_hdr,
--				 enum ath10k_pkt_rx_err *err)
-+				 enum ath10k_pkt_rx_err *err,
-+				 u16 peer_id,
-+				 bool frag)
- {
- 	struct sk_buff *first;
- 	struct sk_buff *last;
--	struct sk_buff *msdu;
-+	struct sk_buff *msdu, *temp;
- 	struct htt_rx_desc *rxd;
- 	struct ieee80211_hdr *hdr;
- 	enum htt_rx_mpdu_encrypt_type enctype;
-@@ -1768,6 +1839,7 @@ static void ath10k_htt_rx_h_mpdu(struct
- 	bool is_decrypted;
- 	bool is_mgmt;
- 	u32 attention;
-+	bool frag_pn_check = true;
- 
- 	if (skb_queue_empty(amsdu))
- 		return;
-@@ -1866,6 +1938,24 @@ static void ath10k_htt_rx_h_mpdu(struct
- 	}
- 
- 	skb_queue_walk(amsdu, msdu) {
-+		if (frag && !fill_crypt_header && is_decrypted &&
-+		    enctype == HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2)
-+			frag_pn_check = ath10k_htt_rx_h_frag_pn_check(ar,
-+								      msdu,
-+								      peer_id,
-+								      0,
-+								      enctype);
-+
-+		if (!frag_pn_check) {
-+			/* Discard the fragment with invalid PN */
-+			temp = msdu->prev;
-+			__skb_unlink(msdu, amsdu);
-+			dev_kfree_skb_any(msdu);
-+			msdu = temp;
-+			frag_pn_check = true;
-+			continue;
-+		}
-+
- 		ath10k_htt_rx_h_csum_offload(msdu);
- 		ath10k_htt_rx_h_undecap(ar, msdu, status, first_hdr, enctype,
- 					is_decrypted);
-@@ -2071,7 +2161,8 @@ static int ath10k_htt_rx_handle_amsdu(st
- 		ath10k_htt_rx_h_unchain(ar, &amsdu, &drop_cnt, &unchain_cnt);
- 
- 	ath10k_htt_rx_h_filter(ar, &amsdu, rx_status, &drop_cnt_filter);
--	ath10k_htt_rx_h_mpdu(ar, &amsdu, rx_status, true, first_hdr, &err);
-+	ath10k_htt_rx_h_mpdu(ar, &amsdu, rx_status, true, first_hdr, &err, 0,
-+			     false);
- 	msdus_to_queue = skb_queue_len(&amsdu);
- 	ath10k_htt_rx_h_enqueue(ar, &amsdu, rx_status);
- 
-@@ -3027,7 +3118,7 @@ static int ath10k_htt_rx_in_ord_ind(stru
- 			ath10k_htt_rx_h_ppdu(ar, &amsdu, status, vdev_id);
- 			ath10k_htt_rx_h_filter(ar, &amsdu, status, NULL);
- 			ath10k_htt_rx_h_mpdu(ar, &amsdu, status, false, NULL,
--					     NULL);
-+					     NULL, peer_id, frag);
- 			ath10k_htt_rx_h_enqueue(ar, &amsdu, status);
- 			break;
- 		case -EAGAIN:
diff --git a/package/kernel/mac80211/patches/ath10k/301-ath10k-drop-fragments-with-multicast-DA-for-PCIe.patch b/package/kernel/mac80211/patches/ath10k/301-ath10k-drop-fragments-with-multicast-DA-for-PCIe.patch
deleted file mode 100644
index 7288c66612..0000000000
--- a/package/kernel/mac80211/patches/ath10k/301-ath10k-drop-fragments-with-multicast-DA-for-PCIe.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From: Wen Gong <wgong at codeaurora.org>
-Date: Tue, 11 May 2021 20:02:53 +0200
-Subject: [PATCH] ath10k: drop fragments with multicast DA for PCIe
-
-Fragmentation is not used with multicast frames. Discard unexpected
-fragments with multicast DA. This fixes CVE-2020-26145.
-
-Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Wen Gong <wgong at codeaurora.org>
-Signed-off-by: Jouni Malinen <jouni at codeaurora.org>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/drivers/net/wireless/ath/ath10k/htt_rx.c
-+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
-@@ -1768,6 +1768,16 @@ static u64 ath10k_htt_rx_h_get_pn(struct
- 	return pn;
- }
- 
-+static bool ath10k_htt_rx_h_frag_multicast_check(struct ath10k *ar,
-+						 struct sk_buff *skb,
-+						 u16 offset)
-+{
-+	struct ieee80211_hdr *hdr;
-+
-+	hdr = (struct ieee80211_hdr *)(skb->data + offset);
-+	return !is_multicast_ether_addr(hdr->addr1);
-+}
-+
- static bool ath10k_htt_rx_h_frag_pn_check(struct ath10k *ar,
- 					  struct sk_buff *skb,
- 					  u16 peer_id,
-@@ -1839,7 +1849,7 @@ static void ath10k_htt_rx_h_mpdu(struct
- 	bool is_decrypted;
- 	bool is_mgmt;
- 	u32 attention;
--	bool frag_pn_check = true;
-+	bool frag_pn_check = true, multicast_check = true;
- 
- 	if (skb_queue_empty(amsdu))
- 		return;
-@@ -1946,13 +1956,20 @@ static void ath10k_htt_rx_h_mpdu(struct
- 								      0,
- 								      enctype);
- 
--		if (!frag_pn_check) {
--			/* Discard the fragment with invalid PN */
-+		if (frag)
-+			multicast_check = ath10k_htt_rx_h_frag_multicast_check(ar,
-+									       msdu,
-+									       0);
-+
-+		if (!frag_pn_check || !multicast_check) {
-+			/* Discard the fragment with invalid PN or multicast DA
-+			 */
- 			temp = msdu->prev;
- 			__skb_unlink(msdu, amsdu);
- 			dev_kfree_skb_any(msdu);
- 			msdu = temp;
- 			frag_pn_check = true;
-+			multicast_check = true;
- 			continue;
- 		}
- 
diff --git a/package/kernel/mac80211/patches/ath10k/302-ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch b/package/kernel/mac80211/patches/ath10k/302-ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch
deleted file mode 100644
index 85d9ce65e2..0000000000
--- a/package/kernel/mac80211/patches/ath10k/302-ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From: Wen Gong <wgong at codeaurora.org>
-Date: Tue, 11 May 2021 20:02:54 +0200
-Subject: [PATCH] ath10k: drop fragments with multicast DA for SDIO
-
-Fragmentation is not used with multicast frames. Discard unexpected
-fragments with multicast DA. This fixes CVE-2020-26145.
-
-Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00049
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Wen Gong <wgong at codeaurora.org>
-Signed-off-by: Jouni Malinen <jouni at codeaurora.org>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/drivers/net/wireless/ath/ath10k/htt_rx.c
-+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
-@@ -2617,6 +2617,13 @@ static bool ath10k_htt_rx_proc_rx_frag_i
- 	rx_desc = (struct htt_hl_rx_desc *)(skb->data + tot_hdr_len);
- 	rx_desc_info = __le32_to_cpu(rx_desc->info);
- 
-+	hdr = (struct ieee80211_hdr *)((u8 *)rx_desc + rx_hl->fw_desc.len);
-+
-+	if (is_multicast_ether_addr(hdr->addr1)) {
-+		/* Discard the fragment with multicast DA */
-+		goto err;
-+	}
-+
- 	if (!MS(rx_desc_info, HTT_RX_DESC_HL_INFO_ENCRYPTED)) {
- 		spin_unlock_bh(&ar->data_lock);
- 		return ath10k_htt_rx_proc_rx_ind_hl(htt, &resp->rx_ind_hl, skb,
-@@ -2624,8 +2631,6 @@ static bool ath10k_htt_rx_proc_rx_frag_i
- 						    HTT_RX_NON_TKIP_MIC);
- 	}
- 
--	hdr = (struct ieee80211_hdr *)((u8 *)rx_desc + rx_hl->fw_desc.len);
--
- 	if (ieee80211_has_retry(hdr->frame_control))
- 		goto err;
- 
diff --git a/package/kernel/mac80211/patches/ath10k/303-ath10k-drop-MPDU-which-has-discard-flag-set-by-firmw.patch b/package/kernel/mac80211/patches/ath10k/303-ath10k-drop-MPDU-which-has-discard-flag-set-by-firmw.patch
deleted file mode 100644
index 03bce4231b..0000000000
--- a/package/kernel/mac80211/patches/ath10k/303-ath10k-drop-MPDU-which-has-discard-flag-set-by-firmw.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From: Wen Gong <wgong at codeaurora.org>
-Date: Tue, 11 May 2021 20:02:55 +0200
-Subject: [PATCH] ath10k: drop MPDU which has discard flag set by firmware
- for SDIO
-
-When the discard flag is set by the firmware for an MPDU, it should be
-dropped. This allows a mitigation for CVE-2020-24588 to be implemented
-in the firmware.
-
-Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00049
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Wen Gong <wgong at codeaurora.org>
-Signed-off-by: Jouni Malinen <jouni at codeaurora.org>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/drivers/net/wireless/ath/ath10k/htt_rx.c
-+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
-@@ -2312,6 +2312,11 @@ static bool ath10k_htt_rx_proc_rx_ind_hl
- 	fw_desc = &rx->fw_desc;
- 	rx_desc_len = fw_desc->len;
- 
-+	if (fw_desc->u.bits.discard) {
-+		ath10k_dbg(ar, ATH10K_DBG_HTT, "htt discard mpdu\n");
-+		goto err;
-+	}
-+
- 	/* I have not yet seen any case where num_mpdu_ranges > 1.
- 	 * qcacld does not seem handle that case either, so we introduce the
- 	 * same limitiation here as well.
---- a/drivers/net/wireless/ath/ath10k/rx_desc.h
-+++ b/drivers/net/wireless/ath/ath10k/rx_desc.h
-@@ -1282,7 +1282,19 @@ struct fw_rx_desc_base {
- #define FW_RX_DESC_UDP              (1 << 6)
- 
- struct fw_rx_desc_hl {
--	u8 info0;
-+	union {
-+		struct {
-+		u8 discard:1,
-+		   forward:1,
-+		   any_err:1,
-+		   dup_err:1,
-+		   reserved:1,
-+		   inspect:1,
-+		   extension:2;
-+		} bits;
-+		u8 info0;
-+	} u;
-+
- 	u8 version;
- 	u8 len;
- 	u8 flags;
diff --git a/package/kernel/mac80211/patches/ath10k/304-ath10k-Fix-TKIP-Michael-MIC-verification-for-PCIe.patch b/package/kernel/mac80211/patches/ath10k/304-ath10k-Fix-TKIP-Michael-MIC-verification-for-PCIe.patch
deleted file mode 100644
index da9d6802bd..0000000000
--- a/package/kernel/mac80211/patches/ath10k/304-ath10k-Fix-TKIP-Michael-MIC-verification-for-PCIe.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From: Wen Gong <wgong at codeaurora.org>
-Date: Tue, 11 May 2021 20:02:56 +0200
-Subject: [PATCH] ath10k: Fix TKIP Michael MIC verification for PCIe
-
-TKIP Michael MIC was not verified properly for PCIe cases since the
-validation steps in ieee80211_rx_h_michael_mic_verify() in mac80211 did
-not get fully executed due to unexpected flag values in
-ieee80211_rx_status.
-
-Fix this by setting the flags property to meet mac80211 expectations for
-performing Michael MIC validation there. This fixes CVE-2020-26141. It
-does the same as ath10k_htt_rx_proc_rx_ind_hl() for SDIO which passed
-MIC verification case. This applies only to QCA6174/QCA9377 PCIe.
-
-Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Wen Gong <wgong at codeaurora.org>
-Signed-off-by: Jouni Malinen <jouni at codeaurora.org>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/drivers/net/wireless/ath/ath10k/htt_rx.c
-+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
-@@ -1974,6 +1974,11 @@ static void ath10k_htt_rx_h_mpdu(struct
- 		}
- 
- 		ath10k_htt_rx_h_csum_offload(msdu);
-+
-+		if (frag && !fill_crypt_header &&
-+		    enctype == HTT_RX_MPDU_ENCRYPT_TKIP_WPA)
-+			status->flag &= ~RX_FLAG_MMIC_STRIPPED;
-+
- 		ath10k_htt_rx_h_undecap(ar, msdu, status, first_hdr, enctype,
- 					is_decrypted);
- 
-@@ -1991,6 +1996,11 @@ static void ath10k_htt_rx_h_mpdu(struct
- 
- 		hdr = (void *)msdu->data;
- 		hdr->frame_control &= ~__cpu_to_le16(IEEE80211_FCTL_PROTECTED);
-+
-+		if (frag && !fill_crypt_header &&
-+		    enctype == HTT_RX_MPDU_ENCRYPT_TKIP_WPA)
-+			status->flag &= ~RX_FLAG_IV_STRIPPED &
-+					~RX_FLAG_MMIC_STRIPPED;
- 	}
- }
- 
diff --git a/package/kernel/mac80211/patches/ath10k/305-ath10k-Validate-first-subframe-of-A-MSDU-before-proc.patch b/package/kernel/mac80211/patches/ath10k/305-ath10k-Validate-first-subframe-of-A-MSDU-before-proc.patch
deleted file mode 100644
index 0bdbed78d5..0000000000
--- a/package/kernel/mac80211/patches/ath10k/305-ath10k-Validate-first-subframe-of-A-MSDU-before-proc.patch
+++ /dev/null
@@ -1,109 +0,0 @@
-From: Sriram R <srirrama at codeaurora.org>
-Date: Tue, 11 May 2021 20:02:57 +0200
-Subject: [PATCH] ath10k: Validate first subframe of A-MSDU before
- processing the list
-
-In certain scenarios a normal MSDU can be received as an A-MSDU when
-the A-MSDU present bit of a QoS header gets flipped during reception.
-Since this bit is unauthenticated, the hardware crypto engine can pass
-the frame to the driver without any error indication.
-
-This could result in processing unintended subframes collected in the
-A-MSDU list. Hence, validate A-MSDU list by checking if the first frame
-has a valid subframe header.
-
-Comparing the non-aggregated MSDU and an A-MSDU, the fields of the first
-subframe DA matches the LLC/SNAP header fields of a normal MSDU.
-In order to avoid processing such frames, add a validation to
-filter such A-MSDU frames where the first subframe header DA matches
-with the LLC/SNAP header pattern.
-
-Tested-on: QCA9984 hw1.0 PCI 10.4-3.10-00047
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Sriram R <srirrama at codeaurora.org>
-Signed-off-by: Jouni Malinen <jouni at codeaurora.org>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/drivers/net/wireless/ath/ath10k/htt_rx.c
-+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
-@@ -2108,14 +2108,62 @@ static void ath10k_htt_rx_h_unchain(stru
- 	ath10k_unchain_msdu(amsdu, unchain_cnt);
- }
- 
-+static bool ath10k_htt_rx_validate_amsdu(struct ath10k *ar,
-+					 struct sk_buff_head *amsdu)
-+{
-+	u8 *subframe_hdr;
-+	struct sk_buff *first;
-+	bool is_first, is_last;
-+	struct htt_rx_desc *rxd;
-+	struct ieee80211_hdr *hdr;
-+	size_t hdr_len, crypto_len;
-+	enum htt_rx_mpdu_encrypt_type enctype;
-+	int bytes_aligned = ar->hw_params.decap_align_bytes;
-+
-+	first = skb_peek(amsdu);
-+
-+	rxd = (void *)first->data - sizeof(*rxd);
-+	hdr = (void *)rxd->rx_hdr_status;
-+
-+	is_first = !!(rxd->msdu_end.common.info0 &
-+		      __cpu_to_le32(RX_MSDU_END_INFO0_FIRST_MSDU));
-+	is_last = !!(rxd->msdu_end.common.info0 &
-+		     __cpu_to_le32(RX_MSDU_END_INFO0_LAST_MSDU));
-+
-+	/* Return in case of non-aggregated msdu */
-+	if (is_first && is_last)
-+		return true;
-+
-+	/* First msdu flag is not set for the first msdu of the list */
-+	if (!is_first)
-+		return false;
-+
-+	enctype = MS(__le32_to_cpu(rxd->mpdu_start.info0),
-+		     RX_MPDU_START_INFO0_ENCRYPT_TYPE);
-+
-+	hdr_len = ieee80211_hdrlen(hdr->frame_control);
-+	crypto_len = ath10k_htt_rx_crypto_param_len(ar, enctype);
-+
-+	subframe_hdr = (u8 *)hdr + round_up(hdr_len, bytes_aligned) +
-+		       crypto_len;
-+
-+	/* Validate if the amsdu has a proper first subframe.
-+	 * There are chances a single msdu can be received as amsdu when
-+	 * the unauthenticated amsdu flag of a QoS header
-+	 * gets flipped in non-SPP AMSDU's, in such cases the first
-+	 * subframe has llc/snap header in place of a valid da.
-+	 * return false if the da matches rfc1042 pattern
-+	 */
-+	if (ether_addr_equal(subframe_hdr, rfc1042_header))
-+		return false;
-+
-+	return true;
-+}
-+
- static bool ath10k_htt_rx_amsdu_allowed(struct ath10k *ar,
- 					struct sk_buff_head *amsdu,
- 					struct ieee80211_rx_status *rx_status)
- {
--	/* FIXME: It might be a good idea to do some fuzzy-testing to drop
--	 * invalid/dangerous frames.
--	 */
--
- 	if (!rx_status->freq) {
- 		ath10k_dbg(ar, ATH10K_DBG_HTT, "no channel configured; ignoring frame(s)!\n");
- 		return false;
-@@ -2126,6 +2174,11 @@ static bool ath10k_htt_rx_amsdu_allowed(
- 		return false;
- 	}
- 
-+	if (!ath10k_htt_rx_validate_amsdu(ar, amsdu)) {
-+		ath10k_dbg(ar, ATH10K_DBG_HTT, "invalid amsdu received\n");
-+		return false;
-+	}
-+
- 	return true;
- }
- 
diff --git a/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
index 5e74687826..ce8effe3c3 100644
--- a/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
+++ b/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
@@ -114,7 +114,7 @@ v13:
  ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o
 --- a/local-symbols
 +++ b/local-symbols
-@@ -146,6 +146,7 @@ ATH10K_DEBUG=
+@@ -145,6 +145,7 @@ ATH10K_DEBUG=
  ATH10K_DEBUGFS=
  ATH10K_SPECTRAL=
  ATH10K_THERMAL=
@@ -456,7 +456,7 @@ v13:
  {
 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
 +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
-@@ -4591,6 +4591,8 @@ static const struct wmi_ops wmi_tlv_ops
+@@ -4594,6 +4594,8 @@ static const struct wmi_ops wmi_tlv_ops
  	.gen_echo = ath10k_wmi_tlv_op_gen_echo,
  	.gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf,
  	.gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable,
diff --git a/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch b/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch
index cd2bdbf1a0..acb9ad443c 100644
--- a/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch
+++ b/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch
@@ -371,7 +371,7 @@
  
 --- a/local-symbols
 +++ b/local-symbols
-@@ -113,6 +113,7 @@ ATH9K_WOW=
+@@ -112,6 +112,7 @@ ATH9K_WOW=
  ATH9K_RFKILL=
  ATH9K_CHANNEL_CONTEXT=
  ATH9K_PCOEM=
diff --git a/package/kernel/mac80211/patches/brcm/860-brcmfmac-register-wiphy-s-during-module_init.patch b/package/kernel/mac80211/patches/brcm/860-brcmfmac-register-wiphy-s-during-module_init.patch
index dc2295db1b..c9730e29fd 100644
--- a/package/kernel/mac80211/patches/brcm/860-brcmfmac-register-wiphy-s-during-module_init.patch
+++ b/package/kernel/mac80211/patches/brcm/860-brcmfmac-register-wiphy-s-during-module_init.patch
@@ -11,16 +11,6 @@ module loads successfully.
 Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
 ---
 
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -1557,6 +1557,7 @@ int __init brcmf_core_init(void)
- {
- 	if (!schedule_work(&brcmf_driver_work))
- 		return -EBUSY;
-+	flush_work(&brcmf_driver_work);
- 
- 	return 0;
- }
 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
 @@ -431,6 +431,7 @@ struct brcmf_fw {
diff --git a/package/kernel/mac80211/patches/build/001-fix_build.patch b/package/kernel/mac80211/patches/build/001-fix_build.patch
index e57ca190e4..8f63d36e2e 100644
--- a/package/kernel/mac80211/patches/build/001-fix_build.patch
+++ b/package/kernel/mac80211/patches/build/001-fix_build.patch
@@ -55,8 +55,8 @@
 -				echo ""							;\
 -			done								\
 -		) > Kconfig.kernel							;\
--		kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) kernelversion |	\
--			sed 's/^\(\([3-5]\|2\.6\)\.[0-9]\+\).*/\1/;t;d')		;\
+-		kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) M=$(BACKPORT_DIR)	\
+-			kernelversion |	sed 's/^\(\([3-5]\|2\.6\)\.[0-9]\+\).*/\1/;t;d');\
 -		test "$$kver" != "" || echo "Kernel version parse failed!"		;\
 -		test "$$kver" != ""							;\
 -		kvers="$$(seq 14 39 | sed 's/^/2.6./')"					;\
@@ -112,8 +112,8 @@
 +	@echo " done."
 +
 +Kconfig.versions: Kconfig.kernel
-+	@kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) kernelversion |	\
-+		sed 's/^\(\([3-5]\|2\.6\)\.[0-9]\+\).*/\1/;t;d')		;\
++	@kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) M=$(BACKPORT_DIR) \
++		kernelversion |	sed 's/^\(\([3-5]\|2\.6\)\.[0-9]\+\).*/\1/;t;d');\
 +	test "$$kver" != "" || echo "Kernel version parse failed!"		;\
 +	test "$$kver" != ""							;\
 +	kvers="$$(seq 14 39 | sed 's/^/2.6./')"					;\
diff --git a/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch b/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch
index cfa40e1bd2..d358cfe367 100644
--- a/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch
+++ b/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/marvell/mwl8k.c
 +++ b/drivers/net/wireless/marvell/mwl8k.c
-@@ -5694,6 +5694,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
+@@ -5695,6 +5695,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
  MODULE_FIRMWARE(MWL8K_8366_AP_FW(MWL8K_8366_AP_FW_API));
  
  static const struct pci_device_id mwl8k_pci_id_table[] = {
diff --git a/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch
index f3130f7ae7..a35cf1875a 100644
--- a/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch
+++ b/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/marvell/mwl8k.c
 +++ b/drivers/net/wireless/marvell/mwl8k.c
-@@ -6279,6 +6279,8 @@ static int mwl8k_probe(struct pci_dev *p
+@@ -6280,6 +6280,8 @@ static int mwl8k_probe(struct pci_dev *p
  
  	priv->running_bsses = 0;
  
@@ -9,7 +9,7 @@
  	return rc;
  
  err_stop_firmware:
-@@ -6312,8 +6314,6 @@ static void mwl8k_remove(struct pci_dev
+@@ -6313,8 +6315,6 @@ static void mwl8k_remove(struct pci_dev
  		return;
  	priv = hw->priv;
  
diff --git a/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch b/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch
index 1c52132da6..e74d9a9aa0 100644
--- a/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch
+++ b/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch
@@ -1,6 +1,6 @@
 --- a/local-symbols
 +++ b/local-symbols
-@@ -333,6 +333,7 @@ RT2X00_LIB_FIRMWARE=
+@@ -332,6 +332,7 @@ RT2X00_LIB_FIRMWARE=
  RT2X00_LIB_CRYPTO=
  RT2X00_LIB_LEDS=
  RT2X00_LIB_DEBUGFS=
diff --git a/package/kernel/mac80211/patches/rtl/001-v5.12-rtlwifi-8821ae-upgrade-PHY-and-RF-parameters.patch b/package/kernel/mac80211/patches/rtl/001-v5.12-rtlwifi-8821ae-upgrade-PHY-and-RF-parameters.patch
deleted file mode 100644
index 7b6cd99d82..0000000000
--- a/package/kernel/mac80211/patches/rtl/001-v5.12-rtlwifi-8821ae-upgrade-PHY-and-RF-parameters.patch
+++ /dev/null
@@ -1,817 +0,0 @@
-From 8f392a72419c4b10e84e635e51bee24670975364 Mon Sep 17 00:00:00 2001
-From: Ping-Ke Shih <pkshih at realtek.com>
-Date: Fri, 19 Feb 2021 13:26:07 +0800
-Subject: [PATCH] rtlwifi: 8821ae: upgrade PHY and RF parameters
-
-New parameters with new format and its parser are updated by the
-commit 84d26fda52e2 ("rtlwifi: Update 8821ae new phy parameters and its parser."),
-but some parameters are missing. Use this commit to update to the novel
-parameters that use new format.
-
-Fixes: 84d26fda52e2 ("rtlwifi: Update 8821ae new phy parameters and its parser")
-Signed-off-by: Ping-Ke Shih <pkshih at realtek.com>
-Tested-by: Kai-Heng Feng <kai.heng.feng at canonical.com>
----
- .../realtek/rtlwifi/rtl8821ae/table.c         | 500 +++++++++++++-----
- 1 file changed, 370 insertions(+), 130 deletions(-)
-
---- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/table.c
-+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/table.c
-@@ -249,7 +249,7 @@ u32 RTL8821AE_PHY_REG_ARRAY[] = {
- 	0x824, 0x00030FE0,
- 	0x828, 0x00000000,
- 	0x82C, 0x002081DD,
--	0x830, 0x2AAA8E24,
-+	0x830, 0x2AAAEEC8,
- 	0x834, 0x0037A706,
- 	0x838, 0x06489B44,
- 	0x83C, 0x0000095B,
-@@ -324,10 +324,10 @@ u32 RTL8821AE_PHY_REG_ARRAY[] = {
- 	0x9D8, 0x00000000,
- 	0x9DC, 0x00000000,
- 	0x9E0, 0x00005D00,
--	0x9E4, 0x00000002,
-+	0x9E4, 0x00000003,
- 	0x9E8, 0x00000001,
- 	0xA00, 0x00D047C8,
--	0xA04, 0x01FF000C,
-+	0xA04, 0x01FF800C,
- 	0xA08, 0x8C8A8300,
- 	0xA0C, 0x2E68000F,
- 	0xA10, 0x9500BB78,
-@@ -1320,7 +1320,11 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x083, 0x00021800,
- 		0x084, 0x00028000,
- 		0x085, 0x00048000,
-+	0x80000111,	0x00000000,	0x40000000,	0x00000000,
-+		0x086, 0x0009483A,
-+	0xA0000000,	0x00000000,
- 		0x086, 0x00094838,
-+	0xB0000000,	0x00000000,
- 		0x087, 0x00044980,
- 		0x088, 0x00048000,
- 		0x089, 0x0000D480,
-@@ -1409,36 +1413,32 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x03C, 0x000CA000,
- 		0x0EF, 0x00000000,
- 		0x0EF, 0x00001100,
--	0xFF0F0104, 0xABCD,
-+	0x80000111,	0x00000000,	0x40000000,	0x00000000,
- 		0x034, 0x0004ADF3,
- 		0x034, 0x00049DF0,
--	0xFF0F0204, 0xCDEF,
-+	0x90000110,	0x00000000,	0x40000000,	0x00000000,
- 		0x034, 0x0004ADF3,
- 		0x034, 0x00049DF0,
--	0xFF0F0404, 0xCDEF,
--		0x034, 0x0004ADF3,
--		0x034, 0x00049DF0,
--	0xFF0F0200, 0xCDEF,
-+	0x90000210,	0x00000000,	0x40000000,	0x00000000,
- 		0x034, 0x0004ADF5,
- 		0x034, 0x00049DF2,
--	0xFF0F02C0, 0xCDEF,
-+	0x9000020c,	0x00000000,	0x40000000,	0x00000000,
-+		0x034, 0x0004A0F3,
-+		0x034, 0x000490B1,
-+		0x9000040c,	0x00000000,	0x40000000,	0x00000000,
- 		0x034, 0x0004A0F3,
- 		0x034, 0x000490B1,
--	0xCDCDCDCD, 0xCDCD,
-+	0x90000200,	0x00000000,	0x40000000,	0x00000000,
-+		0x034, 0x0004ADF5,
-+		0x034, 0x00049DF2,
-+	0x90000410,	0x00000000,	0x40000000,	0x00000000,
-+		0x034, 0x0004ADF3,
-+		0x034, 0x00049DF0,
-+	0xA0000000,	0x00000000,
- 		0x034, 0x0004ADF7,
- 		0x034, 0x00049DF3,
--	0xFF0F0104, 0xDEAD,
--	0xFF0F0104, 0xABCD,
--		0x034, 0x00048DED,
--		0x034, 0x00047DEA,
--		0x034, 0x00046DE7,
--		0x034, 0x00045CE9,
--		0x034, 0x00044CE6,
--		0x034, 0x000438C6,
--		0x034, 0x00042886,
--		0x034, 0x00041486,
--		0x034, 0x00040447,
--	0xFF0F0204, 0xCDEF,
-+	0xB0000000,	0x00000000,
-+	0x80000111,	0x00000000,	0x40000000,	0x00000000,
- 		0x034, 0x00048DED,
- 		0x034, 0x00047DEA,
- 		0x034, 0x00046DE7,
-@@ -1448,7 +1448,7 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x034, 0x00042886,
- 		0x034, 0x00041486,
- 		0x034, 0x00040447,
--	0xFF0F0404, 0xCDEF,
-+	0x90000110,	0x00000000,	0x40000000,	0x00000000,
- 		0x034, 0x00048DED,
- 		0x034, 0x00047DEA,
- 		0x034, 0x00046DE7,
-@@ -1458,7 +1458,17 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x034, 0x00042886,
- 		0x034, 0x00041486,
- 		0x034, 0x00040447,
--	0xFF0F02C0, 0xCDEF,
-+	0x9000020c,	0x00000000,	0x40000000,	0x00000000,
-+		0x034, 0x000480AE,
-+		0x034, 0x000470AB,
-+		0x034, 0x0004608B,
-+		0x034, 0x00045069,
-+		0x034, 0x00044048,
-+		0x034, 0x00043045,
-+		0x034, 0x00042026,
-+		0x034, 0x00041023,
-+		0x034, 0x00040002,
-+	0x9000040c,	0x00000000,	0x40000000,	0x00000000,
- 		0x034, 0x000480AE,
- 		0x034, 0x000470AB,
- 		0x034, 0x0004608B,
-@@ -1468,7 +1478,17 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x034, 0x00042026,
- 		0x034, 0x00041023,
- 		0x034, 0x00040002,
--	0xCDCDCDCD, 0xCDCD,
-+	0x90000410,	0x00000000,	0x40000000,	0x00000000,
-+		0x034, 0x00048DED,
-+		0x034, 0x00047DEA,
-+		0x034, 0x00046DE7,
-+		0x034, 0x00045CE9,
-+		0x034, 0x00044CE6,
-+		0x034, 0x000438C6,
-+		0x034, 0x00042886,
-+		0x034, 0x00041486,
-+		0x034, 0x00040447,
-+	0xA0000000,	0x00000000,
- 		0x034, 0x00048DEF,
- 		0x034, 0x00047DEC,
- 		0x034, 0x00046DE9,
-@@ -1478,38 +1498,36 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x034, 0x0004248A,
- 		0x034, 0x0004108D,
- 		0x034, 0x0004008A,
--	0xFF0F0104, 0xDEAD,
--	0xFF0F0200, 0xABCD,
-+	0xB0000000,	0x00000000,
-+	0x80000210,	0x00000000,	0x40000000,	0x00000000,
- 		0x034, 0x0002ADF4,
--	0xFF0F02C0, 0xCDEF,
-+	0x9000020c,	0x00000000,	0x40000000,	0x00000000,
-+		0x034, 0x0002A0F3,
-+	0x9000040c,	0x00000000,	0x40000000,	0x00000000,
- 		0x034, 0x0002A0F3,
--	0xCDCDCDCD, 0xCDCD,
-+	0x90000200,	0x00000000,	0x40000000,	0x00000000,
-+		0x034, 0x0002ADF4,
-+	0xA0000000,	0x00000000,
- 		0x034, 0x0002ADF7,
--	0xFF0F0200, 0xDEAD,
--	0xFF0F0104, 0xABCD,
--		0x034, 0x00029DF4,
--	0xFF0F0204, 0xCDEF,
-+	0xB0000000,	0x00000000,
-+	0x80000111,	0x00000000,	0x40000000,	0x00000000,
- 		0x034, 0x00029DF4,
--	0xFF0F0404, 0xCDEF,
-+	0x90000110,	0x00000000,	0x40000000,	0x00000000,
- 		0x034, 0x00029DF4,
--	0xFF0F0200, 0xCDEF,
-+	0x90000210,	0x00000000,	0x40000000,	0x00000000,
- 		0x034, 0x00029DF1,
--	0xFF0F02C0, 0xCDEF,
-+	0x9000020c,	0x00000000,	0x40000000,	0x00000000,
-+		0x034, 0x000290F0,
-+	0x9000040c,	0x00000000,	0x40000000,	0x00000000,
- 		0x034, 0x000290F0,
--	0xCDCDCDCD, 0xCDCD,
-+	0x90000200,	0x00000000,	0x40000000,	0x00000000,
-+		0x034, 0x00029DF1,
-+	0x90000410,	0x00000000,	0x40000000,	0x00000000,
-+		0x034, 0x00029DF4,
-+	0xA0000000,	0x00000000,
- 		0x034, 0x00029DF2,
--	0xFF0F0104, 0xDEAD,
--	0xFF0F0104, 0xABCD,
--		0x034, 0x00028DF1,
--		0x034, 0x00027DEE,
--		0x034, 0x00026DEB,
--		0x034, 0x00025CEC,
--		0x034, 0x00024CE9,
--		0x034, 0x000238CA,
--		0x034, 0x00022889,
--		0x034, 0x00021489,
--		0x034, 0x0002044A,
--	0xFF0F0204, 0xCDEF,
-+	0xB0000000,	0x00000000,
-+	0x80000111,	0x00000000,	0x40000000,	0x00000000,
- 		0x034, 0x00028DF1,
- 		0x034, 0x00027DEE,
- 		0x034, 0x00026DEB,
-@@ -1519,7 +1537,7 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x034, 0x00022889,
- 		0x034, 0x00021489,
- 		0x034, 0x0002044A,
--	0xFF0F0404, 0xCDEF,
-+	0x90000110,	0x00000000,	0x40000000,	0x00000000,
- 		0x034, 0x00028DF1,
- 		0x034, 0x00027DEE,
- 		0x034, 0x00026DEB,
-@@ -1529,7 +1547,7 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x034, 0x00022889,
- 		0x034, 0x00021489,
- 		0x034, 0x0002044A,
--	0xFF0F02C0, 0xCDEF,
-+	0x9000020c,	0x00000000,	0x40000000,	0x00000000,
- 		0x034, 0x000280AF,
- 		0x034, 0x000270AC,
- 		0x034, 0x0002608B,
-@@ -1539,7 +1557,27 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x034, 0x00022026,
- 		0x034, 0x00021023,
- 		0x034, 0x00020002,
--	0xCDCDCDCD, 0xCDCD,
-+	0x9000040c,	0x00000000,	0x40000000,	0x00000000,
-+		0x034, 0x000280AF,
-+		0x034, 0x000270AC,
-+		0x034, 0x0002608B,
-+		0x034, 0x00025069,
-+		0x034, 0x00024048,
-+		0x034, 0x00023045,
-+		0x034, 0x00022026,
-+		0x034, 0x00021023,
-+		0x034, 0x00020002,
-+	0x90000410,	0x00000000,	0x40000000,	0x00000000,
-+		0x034, 0x00028DF1,
-+		0x034, 0x00027DEE,
-+		0x034, 0x00026DEB,
-+		0x034, 0x00025CEC,
-+		0x034, 0x00024CE9,
-+		0x034, 0x000238CA,
-+		0x034, 0x00022889,
-+		0x034, 0x00021489,
-+		0x034, 0x0002044A,
-+	0xA0000000,	0x00000000,
- 		0x034, 0x00028DEE,
- 		0x034, 0x00027DEB,
- 		0x034, 0x00026CCD,
-@@ -1549,27 +1587,24 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x034, 0x00022849,
- 		0x034, 0x00021449,
- 		0x034, 0x0002004D,
--	0xFF0F0104, 0xDEAD,
--	0xFF0F02C0, 0xABCD,
-+	0xB0000000,	0x00000000,
-+	0x8000020c,	0x00000000,	0x40000000,	0x00000000,
-+		0x034, 0x0000A0D7,
-+		0x034, 0x000090D3,
-+		0x034, 0x000080B1,
-+		0x034, 0x000070AE,
-+	0x9000040c,	0x00000000,	0x40000000,	0x00000000,
- 		0x034, 0x0000A0D7,
- 		0x034, 0x000090D3,
- 		0x034, 0x000080B1,
- 		0x034, 0x000070AE,
--	0xCDCDCDCD, 0xCDCD,
-+	0xA0000000,	0x00000000,
- 		0x034, 0x0000ADF7,
- 		0x034, 0x00009DF4,
- 		0x034, 0x00008DF1,
- 		0x034, 0x00007DEE,
--	0xFF0F02C0, 0xDEAD,
--	0xFF0F0104, 0xABCD,
--		0x034, 0x00006DEB,
--		0x034, 0x00005CEC,
--		0x034, 0x00004CE9,
--		0x034, 0x000038CA,
--		0x034, 0x00002889,
--		0x034, 0x00001489,
--		0x034, 0x0000044A,
--	0xFF0F0204, 0xCDEF,
-+	0xB0000000,	0x00000000,
-+	0x80000111,	0x00000000,	0x40000000,	0x00000000,
- 		0x034, 0x00006DEB,
- 		0x034, 0x00005CEC,
- 		0x034, 0x00004CE9,
-@@ -1577,7 +1612,7 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x034, 0x00002889,
- 		0x034, 0x00001489,
- 		0x034, 0x0000044A,
--	0xFF0F0404, 0xCDEF,
-+	0x90000110,	0x00000000,	0x40000000,	0x00000000,
- 		0x034, 0x00006DEB,
- 		0x034, 0x00005CEC,
- 		0x034, 0x00004CE9,
-@@ -1585,7 +1620,7 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x034, 0x00002889,
- 		0x034, 0x00001489,
- 		0x034, 0x0000044A,
--	0xFF0F02C0, 0xCDEF,
-+	0x9000020c,	0x00000000,	0x40000000,	0x00000000,
- 		0x034, 0x0000608D,
- 		0x034, 0x0000506B,
- 		0x034, 0x0000404A,
-@@ -1593,7 +1628,23 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x034, 0x00002044,
- 		0x034, 0x00001025,
- 		0x034, 0x00000004,
--	0xCDCDCDCD, 0xCDCD,
-+	0x9000040c,	0x00000000,	0x40000000,	0x00000000,
-+		0x034, 0x0000608D,
-+		0x034, 0x0000506B,
-+		0x034, 0x0000404A,
-+		0x034, 0x00003047,
-+		0x034, 0x00002044,
-+		0x034, 0x00001025,
-+		0x034, 0x00000004,
-+	0x90000410,	0x00000000,	0x40000000,	0x00000000,
-+		0x034, 0x00006DEB,
-+		0x034, 0x00005CEC,
-+		0x034, 0x00004CE9,
-+		0x034, 0x000038CA,
-+		0x034, 0x00002889,
-+		0x034, 0x00001489,
-+		0x034, 0x0000044A,
-+	0xA0000000,	0x00000000,
- 		0x034, 0x00006DCD,
- 		0x034, 0x00005CCD,
- 		0x034, 0x00004CCA,
-@@ -1601,11 +1652,11 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x034, 0x00002888,
- 		0x034, 0x00001488,
- 		0x034, 0x00000486,
--	0xFF0F0104, 0xDEAD,
-+	0xB0000000,	0x00000000,
- 		0x0EF, 0x00000000,
- 		0x018, 0x0001712A,
- 		0x0EF, 0x00000040,
--	0xFF0F0104, 0xABCD,
-+	0x80000111,	0x00000000,	0x40000000,	0x00000000,
- 		0x035, 0x00000187,
- 		0x035, 0x00008187,
- 		0x035, 0x00010187,
-@@ -1615,7 +1666,7 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x035, 0x00040188,
- 		0x035, 0x00048188,
- 		0x035, 0x00050188,
--	0xFF0F0204, 0xCDEF,
-+	0x90000110,	0x00000000,	0x40000000,	0x00000000,
- 		0x035, 0x00000187,
- 		0x035, 0x00008187,
- 		0x035, 0x00010187,
-@@ -1625,7 +1676,37 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x035, 0x00040188,
- 		0x035, 0x00048188,
- 		0x035, 0x00050188,
--	0xFF0F0404, 0xCDEF,
-+	0x90000210,	0x00000000,	0x40000000,	0x00000000,
-+		0x035, 0x00000128,
-+		0x035, 0x00008128,
-+		0x035, 0x00010128,
-+		0x035, 0x000201C8,
-+		0x035, 0x000281C8,
-+		0x035, 0x000301C8,
-+		0x035, 0x000401C8,
-+		0x035, 0x000481C8,
-+		0x035, 0x000501C8,
-+	0x9000040c,	0x00000000,	0x40000000,	0x00000000,
-+		0x035, 0x00000145,
-+		0x035, 0x00008145,
-+		0x035, 0x00010145,
-+		0x035, 0x00020196,
-+		0x035, 0x00028196,
-+		0x035, 0x00030196,
-+		0x035, 0x000401C7,
-+		0x035, 0x000481C7,
-+		0x035, 0x000501C7,
-+	0x90000200,	0x00000000,	0x40000000,	0x00000000,
-+		0x035, 0x00000128,
-+		0x035, 0x00008128,
-+		0x035, 0x00010128,
-+		0x035, 0x000201C8,
-+		0x035, 0x000281C8,
-+		0x035, 0x000301C8,
-+		0x035, 0x000401C8,
-+		0x035, 0x000481C8,
-+		0x035, 0x000501C8,
-+	0x90000410,	0x00000000,	0x40000000,	0x00000000,
- 		0x035, 0x00000187,
- 		0x035, 0x00008187,
- 		0x035, 0x00010187,
-@@ -1635,7 +1716,7 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x035, 0x00040188,
- 		0x035, 0x00048188,
- 		0x035, 0x00050188,
--	0xCDCDCDCD, 0xCDCD,
-+	0xA0000000,	0x00000000,
- 		0x035, 0x00000145,
- 		0x035, 0x00008145,
- 		0x035, 0x00010145,
-@@ -1645,11 +1726,11 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x035, 0x000401C7,
- 		0x035, 0x000481C7,
- 		0x035, 0x000501C7,
--	0xFF0F0104, 0xDEAD,
-+	0xB0000000,	0x00000000,
- 		0x0EF, 0x00000000,
- 		0x018, 0x0001712A,
- 		0x0EF, 0x00000010,
--	0xFF0F0104, 0xABCD,
-+	0x80000111,	0x00000000,	0x40000000,	0x00000000,
- 		0x036, 0x00085733,
- 		0x036, 0x0008D733,
- 		0x036, 0x00095733,
-@@ -1662,7 +1743,7 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x036, 0x000CE4B4,
- 		0x036, 0x000D64B4,
- 		0x036, 0x000DE4B4,
--	0xFF0F0204, 0xCDEF,
-+	0x90000110,	0x00000000,	0x40000000,	0x00000000,
- 		0x036, 0x00085733,
- 		0x036, 0x0008D733,
- 		0x036, 0x00095733,
-@@ -1675,7 +1756,46 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x036, 0x000CE4B4,
- 		0x036, 0x000D64B4,
- 		0x036, 0x000DE4B4,
--	0xFF0F0404, 0xCDEF,
-+	0x90000210,	0x00000000,	0x40000000,	0x00000000,
-+		0x036, 0x000063B5,
-+		0x036, 0x0000E3B5,
-+		0x036, 0x000163B5,
-+		0x036, 0x0001E3B5,
-+		0x036, 0x000263B5,
-+		0x036, 0x0002E3B5,
-+		0x036, 0x000363B5,
-+		0x036, 0x0003E3B5,
-+		0x036, 0x000463B5,
-+		0x036, 0x0004E3B5,
-+		0x036, 0x000563B5,
-+		0x036, 0x0005E3B5,
-+	0x9000040c,	0x00000000,	0x40000000,	0x00000000,
-+		0x036, 0x000056B3,
-+		0x036, 0x0000D6B3,
-+		0x036, 0x000156B3,
-+		0x036, 0x0001D6B3,
-+		0x036, 0x00026634,
-+		0x036, 0x0002E634,
-+		0x036, 0x00036634,
-+		0x036, 0x0003E634,
-+		0x036, 0x000467B4,
-+		0x036, 0x0004E7B4,
-+		0x036, 0x000567B4,
-+		0x036, 0x0005E7B4,
-+	0x90000200,	0x00000000,	0x40000000,	0x00000000,
-+		0x036, 0x000063B5,
-+		0x036, 0x0000E3B5,
-+		0x036, 0x000163B5,
-+		0x036, 0x0001E3B5,
-+		0x036, 0x000263B5,
-+		0x036, 0x0002E3B5,
-+		0x036, 0x000363B5,
-+		0x036, 0x0003E3B5,
-+		0x036, 0x000463B5,
-+		0x036, 0x0004E3B5,
-+		0x036, 0x000563B5,
-+		0x036, 0x0005E3B5,
-+	0x90000410,	0x00000000,	0x40000000,	0x00000000,
- 		0x036, 0x00085733,
- 		0x036, 0x0008D733,
- 		0x036, 0x00095733,
-@@ -1688,7 +1808,7 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x036, 0x000CE4B4,
- 		0x036, 0x000D64B4,
- 		0x036, 0x000DE4B4,
--	0xCDCDCDCD, 0xCDCD,
-+	0xA0000000,	0x00000000,
- 		0x036, 0x000056B3,
- 		0x036, 0x0000D6B3,
- 		0x036, 0x000156B3,
-@@ -1701,103 +1821,162 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x036, 0x0004E7B4,
- 		0x036, 0x000567B4,
- 		0x036, 0x0005E7B4,
--	0xFF0F0104, 0xDEAD,
-+	0xB0000000,	0x00000000,
- 		0x0EF, 0x00000000,
- 		0x0EF, 0x00000008,
--	0xFF0F0104, 0xABCD,
-+	0x80000111,	0x00000000,	0x40000000,	0x00000000,
- 		0x03C, 0x000001C8,
- 		0x03C, 0x00000492,
--	0xFF0F0204, 0xCDEF,
-+	0x90000110,	0x00000000,	0x40000000,	0x00000000,
- 		0x03C, 0x000001C8,
- 		0x03C, 0x00000492,
--	0xFF0F0404, 0xCDEF,
-+	0x90000210,	0x00000000,	0x40000000,	0x00000000,
-+		0x03C, 0x000001B6,
-+		0x03C, 0x00000492,
-+	0x9000040c,	0x00000000,	0x40000000,	0x00000000,
-+		0x03C, 0x0000022A,
-+		0x03C, 0x00000594,
-+	0x90000200,	0x00000000,	0x40000000,	0x00000000,
-+		0x03C, 0x000001B6,
-+		0x03C, 0x00000492,
-+	0x90000410,	0x00000000,	0x40000000,	0x00000000,
- 		0x03C, 0x000001C8,
- 		0x03C, 0x00000492,
--	0xCDCDCDCD, 0xCDCD,
-+	0xA0000000,	0x00000000,
- 		0x03C, 0x0000022A,
- 		0x03C, 0x00000594,
--	0xFF0F0104, 0xDEAD,
--	0xFF0F0104, 0xABCD,
-+	0xB0000000,	0x00000000,
-+	0x80000111,	0x00000000,	0x40000000,	0x00000000,
- 		0x03C, 0x00000800,
--	0xFF0F0204, 0xCDEF,
-+	0x90000110,	0x00000000,	0x40000000,	0x00000000,
- 		0x03C, 0x00000800,
--	0xFF0F0404, 0xCDEF,
-+	0x90000210,	0x00000000,	0x40000000,	0x00000000,
- 		0x03C, 0x00000800,
--	0xFF0F02C0, 0xCDEF,
-+	0x9000020c,	0x00000000,	0x40000000,	0x00000000,
- 		0x03C, 0x00000820,
--	0xCDCDCDCD, 0xCDCD,
-+	0x9000040c,	0x00000000,	0x40000000,	0x00000000,
-+		0x03C, 0x00000820,
-+	0x90000200,	0x00000000,	0x40000000,	0x00000000,
-+		0x03C, 0x00000800,
-+	0x90000410,	0x00000000,	0x40000000,	0x00000000,
-+		0x03C, 0x00000800,
-+	0xA0000000,	0x00000000,
- 		0x03C, 0x00000900,
--	0xFF0F0104, 0xDEAD,
-+	0xB0000000,	0x00000000,
- 		0x0EF, 0x00000000,
- 		0x018, 0x0001712A,
- 		0x0EF, 0x00000002,
--	0xFF0F0104, 0xABCD,
-+	0x80000111,	0x00000000,	0x40000000,	0x00000000,
- 		0x008, 0x0004E400,
--	0xFF0F0204, 0xCDEF,
-+	0x90000110,	0x00000000,	0x40000000,	0x00000000,
- 		0x008, 0x0004E400,
--	0xFF0F0404, 0xCDEF,
-+	0x90000210,	0x00000000,	0x40000000,	0x00000000,
-+		0x008, 0x00002000,
-+	0x9000020c,	0x00000000,	0x40000000,	0x00000000,
-+		0x008, 0x00002000,
-+	0x9000040c,	0x00000000,	0x40000000,	0x00000000,
-+		0x008, 0x00002000,
-+	0x90000200,	0x00000000,	0x40000000,	0x00000000,
-+		0x008, 0x00002000,
-+	0x90000410,	0x00000000,	0x40000000,	0x00000000,
- 		0x008, 0x0004E400,
--	0xCDCDCDCD, 0xCDCD,
-+	0xA0000000,	0x00000000,
- 		0x008, 0x00002000,
--	0xFF0F0104, 0xDEAD,
-+	0xB0000000,	0x00000000,
- 		0x0EF, 0x00000000,
- 		0x0DF, 0x000000C0,
--		0x01F, 0x00040064,
--	0xFF0F0104, 0xABCD,
-+		0x01F, 0x00000064,
-+	0x80000111,	0x00000000,	0x40000000,	0x00000000,
- 		0x058, 0x000A7284,
- 		0x059, 0x000600EC,
--	0xFF0F0204, 0xCDEF,
-+	0x90000110,	0x00000000,	0x40000000,	0x00000000,
- 		0x058, 0x000A7284,
- 		0x059, 0x000600EC,
--	0xFF0F0404, 0xCDEF,
-+	0x9000020c,	0x00000000,	0x40000000,	0x00000000,
-+		0x058, 0x00081184,
-+		0x059, 0x0006016C,
-+	0x9000040c,	0x00000000,	0x40000000,	0x00000000,
-+		0x058, 0x00081184,
-+		0x059, 0x0006016C,
-+	0x90000200,	0x00000000,	0x40000000,	0x00000000,
-+		0x058, 0x00081184,
-+		0x059, 0x0006016C,
-+	0x90000410,	0x00000000,	0x40000000,	0x00000000,
- 		0x058, 0x000A7284,
- 		0x059, 0x000600EC,
--	0xCDCDCDCD, 0xCDCD,
-+	0xA0000000,	0x00000000,
- 		0x058, 0x00081184,
- 		0x059, 0x0006016C,
--	0xFF0F0104, 0xDEAD,
--	0xFF0F0104, 0xABCD,
-+	0xB0000000,	0x00000000,
-+	0x80000111,	0x00000000,	0x40000000,	0x00000000,
- 		0x061, 0x000E8D73,
- 		0x062, 0x00093FC5,
--	0xFF0F0204, 0xCDEF,
-+	0x90000110,	0x00000000,	0x40000000,	0x00000000,
- 		0x061, 0x000E8D73,
- 		0x062, 0x00093FC5,
--	0xFF0F0404, 0xCDEF,
-+	0x90000210,	0x00000000,	0x40000000,	0x00000000,
-+		0x061, 0x000EFD83,
-+		0x062, 0x00093FCC,
-+	0x9000040c,	0x00000000,	0x40000000,	0x00000000,
-+		0x061, 0x000EAD53,
-+		0x062, 0x00093BC4,
-+	0x90000200,	0x00000000,	0x40000000,	0x00000000,
-+		0x061, 0x000EFD83,
-+		0x062, 0x00093FCC,
-+	0x90000410,	0x00000000,	0x40000000,	0x00000000,
- 		0x061, 0x000E8D73,
- 		0x062, 0x00093FC5,
--	0xCDCDCDCD, 0xCDCD,
-+	0xA0000000,	0x00000000,
- 		0x061, 0x000EAD53,
- 		0x062, 0x00093BC4,
--	0xFF0F0104, 0xDEAD,
--	0xFF0F0104, 0xABCD,
-+	0xB0000000,	0x00000000,
-+	0x80000111,	0x00000000,	0x40000000,	0x00000000,
- 		0x063, 0x000110E9,
--	0xFF0F0204, 0xCDEF,
-+	0x90000110,	0x00000000,	0x40000000,	0x00000000,
- 		0x063, 0x000110E9,
--	0xFF0F0404, 0xCDEF,
-+	0x90000210,	0x00000000,	0x40000000,	0x00000000,
-+		0x063, 0x000110EB,
-+	0x9000020c,	0x00000000,	0x40000000,	0x00000000,
- 		0x063, 0x000110E9,
--	0xFF0F0200, 0xCDEF,
--		0x063, 0x000710E9,
--	0xFF0F02C0, 0xCDEF,
-+	0x9000040c,	0x00000000,	0x40000000,	0x00000000,
- 		0x063, 0x000110E9,
--	0xCDCDCDCD, 0xCDCD,
-+	0x90000200,	0x00000000,	0x40000000,	0x00000000,
-+		0x063, 0x000110EB,
-+	0x90000410,	0x00000000,	0x40000000,	0x00000000,
-+		0x063, 0x000110E9,
-+	0xA0000000,	0x00000000,
- 		0x063, 0x000714E9,
--	0xFF0F0104, 0xDEAD,
--	0xFF0F0104, 0xABCD,
-+	0xB0000000,	0x00000000,
-+	0x80000111,	0x00000000,	0x40000000,	0x00000000,
-+		0x064, 0x0001C27C,
-+	0x90000110,	0x00000000,	0x40000000,	0x00000000,
-+		0x064, 0x0001C27C,
-+	0x90000210,	0x00000000,	0x40000000,	0x00000000,
- 		0x064, 0x0001C27C,
--	0xFF0F0204, 0xCDEF,
-+	0x9000040c,	0x00000000,	0x40000000,	0x00000000,
-+		0x064, 0x0001C67C,
-+	0x90000200,	0x00000000,	0x40000000,	0x00000000,
- 		0x064, 0x0001C27C,
--	0xFF0F0404, 0xCDEF,
-+	0x90000410,	0x00000000,	0x40000000,	0x00000000,
- 		0x064, 0x0001C27C,
--	0xCDCDCDCD, 0xCDCD,
-+	0xA0000000,	0x00000000,
- 		0x064, 0x0001C67C,
--	0xFF0F0104, 0xDEAD,
--	0xFF0F0200, 0xABCD,
-+	0xB0000000,	0x00000000,
-+	0x80000111,	0x00000000,	0x40000000,	0x00000000,
-+		0x065, 0x00091016,
-+	0x90000110,	0x00000000,	0x40000000,	0x00000000,
-+		0x065, 0x00091016,
-+	0x90000210,	0x00000000,	0x40000000,	0x00000000,
- 		0x065, 0x00093016,
--	0xFF0F02C0, 0xCDEF,
-+		0x9000020c,	0x00000000,	0x40000000,	0x00000000,
- 		0x065, 0x00093015,
--	0xCDCDCDCD, 0xCDCD,
-+		0x9000040c,	0x00000000,	0x40000000,	0x00000000,
-+		0x065, 0x00093015,
-+		0x90000200,	0x00000000,	0x40000000,	0x00000000,
-+		0x065, 0x00093016,
-+		0xA0000000,	0x00000000,
- 		0x065, 0x00091016,
--	0xFF0F0200, 0xDEAD,
-+		0xB0000000,	0x00000000,
- 		0x018, 0x00000006,
- 		0x0EF, 0x00002000,
- 		0x03B, 0x0003824B,
-@@ -1895,9 +2074,10 @@ u32 RTL8821AE_RADIOA_ARRAY[] = {
- 		0x0B4, 0x0001214C,
- 		0x0B7, 0x0003000C,
- 		0x01C, 0x000539D2,
-+		0x0C4, 0x000AFE00,
- 		0x018, 0x0001F12A,
--		0x0FE, 0x00000000,
--		0x0FE, 0x00000000,
-+		0xFFE, 0x00000000,
-+		0xFFE, 0x00000000,
- 		0x018, 0x0001712A,
- 
- };
-@@ -2017,6 +2197,7 @@ u32 RTL8812AE_MAC_REG_ARRAY[] = {
- u32 RTL8812AE_MAC_1T_ARRAYLEN = ARRAY_SIZE(RTL8812AE_MAC_REG_ARRAY);
- 
- u32 RTL8821AE_MAC_REG_ARRAY[] = {
-+		0x421, 0x0000000F,
- 		0x428, 0x0000000A,
- 		0x429, 0x00000010,
- 		0x430, 0x00000000,
-@@ -2485,7 +2666,7 @@ u32 RTL8821AE_AGC_TAB_ARRAY[] = {
- 		0x81C, 0xA6360001,
- 		0x81C, 0xA5380001,
- 		0x81C, 0xA43A0001,
--		0x81C, 0xA33C0001,
-+		0x81C, 0x683C0001,
- 		0x81C, 0x673E0001,
- 		0x81C, 0x66400001,
- 		0x81C, 0x65420001,
-@@ -2519,7 +2700,66 @@ u32 RTL8821AE_AGC_TAB_ARRAY[] = {
- 		0x81C, 0x017A0001,
- 		0x81C, 0x017C0001,
- 		0x81C, 0x017E0001,
--	0xFF0F02C0, 0xABCD,
-+	0x8000020c,	0x00000000,	0x40000000,	0x00000000,
-+		0x81C, 0xFB000101,
-+		0x81C, 0xFA020101,
-+		0x81C, 0xF9040101,
-+		0x81C, 0xF8060101,
-+		0x81C, 0xF7080101,
-+		0x81C, 0xF60A0101,
-+		0x81C, 0xF50C0101,
-+		0x81C, 0xF40E0101,
-+		0x81C, 0xF3100101,
-+		0x81C, 0xF2120101,
-+		0x81C, 0xF1140101,
-+		0x81C, 0xF0160101,
-+		0x81C, 0xEF180101,
-+		0x81C, 0xEE1A0101,
-+		0x81C, 0xED1C0101,
-+		0x81C, 0xEC1E0101,
-+		0x81C, 0xEB200101,
-+		0x81C, 0xEA220101,
-+		0x81C, 0xE9240101,
-+		0x81C, 0xE8260101,
-+		0x81C, 0xE7280101,
-+		0x81C, 0xE62A0101,
-+		0x81C, 0xE52C0101,
-+		0x81C, 0xE42E0101,
-+		0x81C, 0xE3300101,
-+		0x81C, 0xA5320101,
-+		0x81C, 0xA4340101,
-+		0x81C, 0xA3360101,
-+		0x81C, 0x87380101,
-+		0x81C, 0x863A0101,
-+		0x81C, 0x853C0101,
-+		0x81C, 0x843E0101,
-+		0x81C, 0x69400101,
-+		0x81C, 0x68420101,
-+		0x81C, 0x67440101,
-+		0x81C, 0x66460101,
-+		0x81C, 0x49480101,
-+		0x81C, 0x484A0101,
-+		0x81C, 0x474C0101,
-+		0x81C, 0x2A4E0101,
-+		0x81C, 0x29500101,
-+		0x81C, 0x28520101,
-+		0x81C, 0x27540101,
-+		0x81C, 0x26560101,
-+		0x81C, 0x25580101,
-+		0x81C, 0x245A0101,
-+		0x81C, 0x235C0101,
-+		0x81C, 0x055E0101,
-+		0x81C, 0x04600101,
-+		0x81C, 0x03620101,
-+		0x81C, 0x02640101,
-+		0x81C, 0x01660101,
-+		0x81C, 0x01680101,
-+		0x81C, 0x016A0101,
-+		0x81C, 0x016C0101,
-+		0x81C, 0x016E0101,
-+		0x81C, 0x01700101,
-+		0x81C, 0x01720101,
-+	0x9000040c,	0x00000000,	0x40000000,	0x00000000,
- 		0x81C, 0xFB000101,
- 		0x81C, 0xFA020101,
- 		0x81C, 0xF9040101,
-@@ -2578,7 +2818,7 @@ u32 RTL8821AE_AGC_TAB_ARRAY[] = {
- 		0x81C, 0x016E0101,
- 		0x81C, 0x01700101,
- 		0x81C, 0x01720101,
--	0xCDCDCDCD, 0xCDCD,
-+	0xA0000000,	0x00000000,
- 		0x81C, 0xFF000101,
- 		0x81C, 0xFF020101,
- 		0x81C, 0xFE040101,
-@@ -2637,7 +2877,7 @@ u32 RTL8821AE_AGC_TAB_ARRAY[] = {
- 		0x81C, 0x046E0101,
- 		0x81C, 0x03700101,
- 		0x81C, 0x02720101,
--	0xFF0F02C0, 0xDEAD,
-+	0xB0000000,	0x00000000,
- 		0x81C, 0x01740101,
- 		0x81C, 0x01760101,
- 		0x81C, 0x01780101,
diff --git a/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch b/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch
index ec6ecbcfce..ca02dfb06f 100644
--- a/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch
+++ b/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch
@@ -379,7 +379,7 @@
  #endif /* AES_GCM_H */
 --- a/net/mac80211/wpa.c
 +++ b/net/mac80211/wpa.c
-@@ -311,7 +311,8 @@ ieee80211_crypto_tkip_decrypt(struct iee
+@@ -312,7 +312,8 @@ ieee80211_crypto_tkip_decrypt(struct iee
  }
  
  
@@ -389,7 +389,7 @@
  {
  	__le16 mask_fc;
  	int a4_included, mgmt;
-@@ -341,14 +342,8 @@ static void ccmp_special_blocks(struct s
+@@ -342,14 +343,8 @@ static void ccmp_special_blocks(struct s
  	else
  		qos_tid = 0;
  
@@ -406,7 +406,7 @@
  
  	/* Nonce: Nonce Flags | A2 | PN
  	 * Nonce Flags: Priority (b0..b3) | Management (b4) | Reserved (b5..b7)
-@@ -356,6 +351,8 @@ static void ccmp_special_blocks(struct s
+@@ -357,6 +352,8 @@ static void ccmp_special_blocks(struct s
  	b_0[1] = qos_tid | (mgmt << 4);
  	memcpy(&b_0[2], hdr->addr2, ETH_ALEN);
  	memcpy(&b_0[8], pn, IEEE80211_CCMP_PN_LEN);
@@ -415,7 +415,7 @@
  
  	/* AAD (extra authenticate-only data) / masked 802.11 header
  	 * FC | A1 | A2 | A3 | SC | [A4] | [QC] */
-@@ -412,7 +409,7 @@ static int ccmp_encrypt_skb(struct ieee8
+@@ -413,7 +410,7 @@ static int ccmp_encrypt_skb(struct ieee8
  	u8 *pos;
  	u8 pn[6];
  	u64 pn64;
@@ -424,7 +424,7 @@
  	u8 b_0[AES_BLOCK_SIZE];
  
  	if (info->control.hw_key &&
-@@ -467,9 +464,11 @@ static int ccmp_encrypt_skb(struct ieee8
+@@ -468,9 +465,11 @@ static int ccmp_encrypt_skb(struct ieee8
  		return 0;
  
  	pos += IEEE80211_CCMP_HDR_LEN;
@@ -439,7 +439,7 @@
  }
  
  
-@@ -542,13 +541,13 @@ ieee80211_crypto_ccmp_decrypt(struct iee
+@@ -543,13 +542,13 @@ ieee80211_crypto_ccmp_decrypt(struct iee
  			u8 aad[2 * AES_BLOCK_SIZE];
  			u8 b_0[AES_BLOCK_SIZE];
  			/* hardware didn't decrypt/verify MIC */
@@ -455,7 +455,7 @@
  				return RX_DROP_UNUSABLE;
  		}
  
-@@ -643,7 +642,7 @@ static int gcmp_encrypt_skb(struct ieee8
+@@ -646,7 +645,7 @@ static int gcmp_encrypt_skb(struct ieee8
  	u8 *pos;
  	u8 pn[6];
  	u64 pn64;
@@ -464,7 +464,7 @@
  	u8 j_0[AES_BLOCK_SIZE];
  
  	if (info->control.hw_key &&
-@@ -700,8 +699,10 @@ static int gcmp_encrypt_skb(struct ieee8
+@@ -703,8 +702,10 @@ static int gcmp_encrypt_skb(struct ieee8
  
  	pos += IEEE80211_GCMP_HDR_LEN;
  	gcmp_special_blocks(skb, pn, j_0, aad);
@@ -477,7 +477,7 @@
  }
  
  ieee80211_tx_result
-@@ -1128,9 +1129,9 @@ ieee80211_crypto_aes_gmac_encrypt(struct
+@@ -1133,9 +1134,9 @@ ieee80211_crypto_aes_gmac_encrypt(struct
  	struct ieee80211_key *key = tx->key;
  	struct ieee80211_mmie_16 *mmie;
  	struct ieee80211_hdr *hdr;
@@ -489,7 +489,7 @@
  
  	if (WARN_ON(skb_queue_len(&tx->skbs) != 1))
  		return TX_DROP;
-@@ -1176,7 +1177,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct
+@@ -1181,7 +1182,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct
  	struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
  	struct ieee80211_key *key = rx->key;
  	struct ieee80211_mmie_16 *mmie;
diff --git a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch
index 9589235f71..8d086625e4 100644
--- a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch
+++ b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch
@@ -18,7 +18,7 @@
  static int ieee80211_ifa6_changed(struct notifier_block *nb,
  				  unsigned long data, void *arg)
  {
-@@ -1312,14 +1312,14 @@ int ieee80211_register_hw(struct ieee802
+@@ -1315,14 +1315,14 @@ int ieee80211_register_hw(struct ieee802
  
  	rtnl_unlock();
  
@@ -35,7 +35,7 @@
  	local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed;
  	result = register_inet6addr_notifier(&local->ifa6_notifier);
  	if (result)
-@@ -1328,13 +1328,13 @@ int ieee80211_register_hw(struct ieee802
+@@ -1331,13 +1331,13 @@ int ieee80211_register_hw(struct ieee802
  
  	return 0;
  
@@ -52,7 +52,7 @@
   fail_ifa:
  #endif
  	wiphy_unregister(local->hw.wiphy);
-@@ -1362,10 +1362,10 @@ void ieee80211_unregister_hw(struct ieee
+@@ -1365,10 +1365,10 @@ void ieee80211_unregister_hw(struct ieee
  	tasklet_kill(&local->tx_pending_tasklet);
  	tasklet_kill(&local->tasklet);
  
diff --git a/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch b/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch
index 807d496080..8fe8723cfe 100644
--- a/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch
+++ b/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch
@@ -33,7 +33,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
   * cfg80211_rx_unprot_mlme_mgmt - notification of unprotected mlme mgmt frame
 --- a/net/mac80211/mlme.c
 +++ b/net/mac80211/mlme.c
-@@ -2729,7 +2729,7 @@ static void ieee80211_report_disconnect(
+@@ -2734,7 +2734,7 @@ static void ieee80211_report_disconnect(
  	};
  
  	if (tx)
@@ -42,7 +42,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	else
  		cfg80211_rx_mlme_mgmt(sdata->dev, buf, len);
  
-@@ -4719,7 +4719,8 @@ void ieee80211_mgd_quiesce(struct ieee80
+@@ -4724,7 +4724,8 @@ void ieee80211_mgd_quiesce(struct ieee80
  		if (ifmgd->auth_data)
  			ieee80211_destroy_auth_data(sdata, false);
  		cfg80211_tx_mlme_mgmt(sdata->dev, frame_buf,
diff --git a/package/kernel/mac80211/patches/subsys/301-mac80211-support-driver-based-disconnect-with-reconn.patch b/package/kernel/mac80211/patches/subsys/301-mac80211-support-driver-based-disconnect-with-reconn.patch
index 59a154a543..31621ebf11 100644
--- a/package/kernel/mac80211/patches/subsys/301-mac80211-support-driver-based-disconnect-with-reconn.patch
+++ b/package/kernel/mac80211/patches/subsys/301-mac80211-support-driver-based-disconnect-with-reconn.patch
@@ -34,7 +34,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
   * @vif: &struct ieee80211_vif pointer from the add_interface callback.
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -461,7 +461,9 @@ struct ieee80211_if_managed {
+@@ -450,7 +450,9 @@ struct ieee80211_if_managed {
  	unsigned long probe_timeout;
  	int probe_send_count;
  	bool nullfunc_failed;
@@ -47,7 +47,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	struct ieee80211_mgd_auth_data *auth_data;
 --- a/net/mac80211/mlme.c
 +++ b/net/mac80211/mlme.c
-@@ -2720,7 +2720,7 @@ EXPORT_SYMBOL(ieee80211_ap_probereq_get)
+@@ -2725,7 +2725,7 @@ EXPORT_SYMBOL(ieee80211_ap_probereq_get)
  
  static void ieee80211_report_disconnect(struct ieee80211_sub_if_data *sdata,
  					const u8 *buf, size_t len, bool tx,
@@ -56,7 +56,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  {
  	struct ieee80211_event event = {
  		.type = MLME_EVENT,
-@@ -2729,7 +2729,7 @@ static void ieee80211_report_disconnect(
+@@ -2734,7 +2734,7 @@ static void ieee80211_report_disconnect(
  	};
  
  	if (tx)
@@ -65,7 +65,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	else
  		cfg80211_rx_mlme_mgmt(sdata->dev, buf, len);
  
-@@ -2751,13 +2751,18 @@ static void __ieee80211_disconnect(struc
+@@ -2756,13 +2756,18 @@ static void __ieee80211_disconnect(struc
  
  	tx = !sdata->csa_block_tx;
  
@@ -89,7 +89,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  			       tx, frame_buf);
  	mutex_lock(&local->mtx);
  	sdata->vif.csa_active = false;
-@@ -2770,7 +2775,9 @@ static void __ieee80211_disconnect(struc
+@@ -2775,7 +2780,9 @@ static void __ieee80211_disconnect(struc
  	mutex_unlock(&local->mtx);
  
  	ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), tx,
@@ -100,7 +100,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  
  	sdata_unlock(sdata);
  }
-@@ -2789,6 +2796,13 @@ static void ieee80211_beacon_connection_
+@@ -2794,6 +2801,13 @@ static void ieee80211_beacon_connection_
  		sdata_info(sdata, "Connection to AP %pM lost\n",
  			   ifmgd->bssid);
  		__ieee80211_disconnect(sdata);
@@ -114,7 +114,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	} else {
  		ieee80211_mgd_probe_ap(sdata, true);
  	}
-@@ -2827,6 +2841,21 @@ void ieee80211_connection_loss(struct ie
+@@ -2832,6 +2846,21 @@ void ieee80211_connection_loss(struct ie
  }
  EXPORT_SYMBOL(ieee80211_connection_loss);
  
@@ -136,7 +136,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  
  static void ieee80211_destroy_auth_data(struct ieee80211_sub_if_data *sdata,
  					bool assoc)
-@@ -3130,7 +3159,7 @@ static void ieee80211_rx_mgmt_deauth(str
+@@ -3135,7 +3164,7 @@ static void ieee80211_rx_mgmt_deauth(str
  		ieee80211_set_disassoc(sdata, 0, 0, false, NULL);
  
  		ieee80211_report_disconnect(sdata, (u8 *)mgmt, len, false,
@@ -145,7 +145,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  		return;
  	}
  
-@@ -3179,7 +3208,8 @@ static void ieee80211_rx_mgmt_disassoc(s
+@@ -3184,7 +3213,8 @@ static void ieee80211_rx_mgmt_disassoc(s
  
  	ieee80211_set_disassoc(sdata, 0, 0, false, NULL);
  
@@ -155,7 +155,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  }
  
  static void ieee80211_get_rates(struct ieee80211_supported_band *sband,
-@@ -4199,7 +4229,8 @@ static void ieee80211_rx_mgmt_beacon(str
+@@ -4204,7 +4234,8 @@ static void ieee80211_rx_mgmt_beacon(str
  				       true, deauth_buf);
  		ieee80211_report_disconnect(sdata, deauth_buf,
  					    sizeof(deauth_buf), true,
@@ -165,7 +165,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  		return;
  	}
  
-@@ -4344,7 +4375,7 @@ static void ieee80211_sta_connection_los
+@@ -4349,7 +4380,7 @@ static void ieee80211_sta_connection_los
  			       tx, frame_buf);
  
  	ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), true,
@@ -174,7 +174,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  }
  
  static int ieee80211_auth(struct ieee80211_sub_if_data *sdata)
-@@ -5434,7 +5465,8 @@ int ieee80211_mgd_auth(struct ieee80211_
+@@ -5439,7 +5470,8 @@ int ieee80211_mgd_auth(struct ieee80211_
  
  		ieee80211_report_disconnect(sdata, frame_buf,
  					    sizeof(frame_buf), true,
@@ -184,7 +184,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	}
  
  	sdata_info(sdata, "authenticate with %pM\n", req->bss->bssid);
-@@ -5506,7 +5538,8 @@ int ieee80211_mgd_assoc(struct ieee80211
+@@ -5511,7 +5543,8 @@ int ieee80211_mgd_assoc(struct ieee80211
  
  		ieee80211_report_disconnect(sdata, frame_buf,
  					    sizeof(frame_buf), true,
@@ -194,7 +194,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	}
  
  	if (ifmgd->auth_data && !ifmgd->auth_data->done) {
-@@ -5805,7 +5838,7 @@ int ieee80211_mgd_deauth(struct ieee8021
+@@ -5810,7 +5843,7 @@ int ieee80211_mgd_deauth(struct ieee8021
  		ieee80211_destroy_auth_data(sdata, false);
  		ieee80211_report_disconnect(sdata, frame_buf,
  					    sizeof(frame_buf), true,
@@ -203,7 +203,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  
  		return 0;
  	}
-@@ -5825,7 +5858,7 @@ int ieee80211_mgd_deauth(struct ieee8021
+@@ -5830,7 +5863,7 @@ int ieee80211_mgd_deauth(struct ieee8021
  		ieee80211_destroy_assoc_data(sdata, false, true);
  		ieee80211_report_disconnect(sdata, frame_buf,
  					    sizeof(frame_buf), true,
@@ -212,7 +212,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  		return 0;
  	}
  
-@@ -5840,7 +5873,7 @@ int ieee80211_mgd_deauth(struct ieee8021
+@@ -5845,7 +5878,7 @@ int ieee80211_mgd_deauth(struct ieee8021
  				       req->reason_code, tx, frame_buf);
  		ieee80211_report_disconnect(sdata, frame_buf,
  					    sizeof(frame_buf), true,
@@ -221,7 +221,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  		return 0;
  	}
  
-@@ -5873,7 +5906,7 @@ int ieee80211_mgd_disassoc(struct ieee80
+@@ -5878,7 +5911,7 @@ int ieee80211_mgd_disassoc(struct ieee80
  			       frame_buf);
  
  	ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), true,
diff --git a/package/kernel/mac80211/patches/subsys/311-net-fq_impl-drop-get_default_func-move-default-flow-.patch b/package/kernel/mac80211/patches/subsys/311-net-fq_impl-drop-get_default_func-move-default-flow-.patch
index f8748ef123..33dbb5eb90 100644
--- a/package/kernel/mac80211/patches/subsys/311-net-fq_impl-drop-get_default_func-move-default-flow-.patch
+++ b/package/kernel/mac80211/patches/subsys/311-net-fq_impl-drop-get_default_func-move-default-flow-.patch
@@ -68,7 +68,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static int fq_init(struct fq *fq, int flows_cnt)
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -857,7 +857,6 @@ enum txq_info_flags {
+@@ -846,7 +846,6 @@ enum txq_info_flags {
   */
  struct txq_info {
  	struct fq_tin tin;
diff --git a/package/kernel/mac80211/patches/subsys/315-mac80211-add-rx-decapsulation-offload-support.patch b/package/kernel/mac80211/patches/subsys/315-mac80211-add-rx-decapsulation-offload-support.patch
index 09407f3b1d..b8bb2930f5 100644
--- a/package/kernel/mac80211/patches/subsys/315-mac80211-add-rx-decapsulation-offload-support.patch
+++ b/package/kernel/mac80211/patches/subsys/315-mac80211-add-rx-decapsulation-offload-support.patch
@@ -132,7 +132,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #endif /* __MAC80211_DRIVER_OPS */
 --- a/net/mac80211/iface.c
 +++ b/net/mac80211/iface.c
-@@ -839,7 +839,7 @@ static const struct net_device_ops ieee8
+@@ -835,7 +835,7 @@ static const struct net_device_ops ieee8
  
  };
  
@@ -141,7 +141,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  {
  	switch (iftype) {
  	/* P2P GO and client are mapped to AP/STATION types */
-@@ -859,7 +859,7 @@ static bool ieee80211_set_sdata_offload_
+@@ -855,7 +855,7 @@ static bool ieee80211_set_sdata_offload_
  	flags = sdata->vif.offload_flags;
  
  	if (ieee80211_hw_check(&local->hw, SUPPORTS_TX_ENCAP_OFFLOAD) &&
@@ -150,7 +150,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		flags |= IEEE80211_OFFLOAD_ENCAP_ENABLED;
  
  		if (!ieee80211_hw_check(&local->hw, SUPPORTS_TX_FRAG) &&
-@@ -872,10 +872,21 @@ static bool ieee80211_set_sdata_offload_
+@@ -868,10 +868,21 @@ static bool ieee80211_set_sdata_offload_
  		flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED;
  	}
  
@@ -172,7 +172,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	return true;
  }
  
-@@ -893,7 +904,7 @@ static void ieee80211_set_vif_encap_ops(
+@@ -889,7 +900,7 @@ static void ieee80211_set_vif_encap_ops(
  	}
  
  	if (!ieee80211_hw_check(&local->hw, SUPPORTS_TX_ENCAP_OFFLOAD) ||
@@ -183,7 +183,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	enabled = bss->vif.offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED;
 --- a/net/mac80211/rx.c
 +++ b/net/mac80211/rx.c
-@@ -4114,7 +4114,9 @@ void ieee80211_check_fast_rx(struct sta_
+@@ -4198,7 +4198,9 @@ void ieee80211_check_fast_rx(struct sta_
  		.vif_type = sdata->vif.type,
  		.control_port_protocol = sdata->control_port_protocol,
  	}, *old, *new = NULL;
@@ -193,7 +193,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	/* use sparse to check that we don't return without updating */
  	__acquire(check_fast_rx);
-@@ -4227,6 +4229,17 @@ void ieee80211_check_fast_rx(struct sta_
+@@ -4311,6 +4313,17 @@ void ieee80211_check_fast_rx(struct sta_
  	if (assign)
  		new = kmemdup(&fastrx, sizeof(fastrx), GFP_KERNEL);
  
@@ -211,7 +211,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	spin_lock_bh(&sta->lock);
  	old = rcu_dereference_protected(sta->fast_rx, true);
  	rcu_assign_pointer(sta->fast_rx, new);
-@@ -4273,6 +4286,108 @@ void ieee80211_check_fast_rx_iface(struc
+@@ -4357,6 +4370,108 @@ void ieee80211_check_fast_rx_iface(struc
  	mutex_unlock(&local->sta_mtx);
  }
  
@@ -320,7 +320,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx,
  				     struct ieee80211_fast_rx *fast_rx)
  {
-@@ -4293,9 +4408,6 @@ static bool ieee80211_invoke_fast_rx(str
+@@ -4377,9 +4492,6 @@ static bool ieee80211_invoke_fast_rx(str
  	} addrs __aligned(2);
  	struct ieee80211_sta_rx_stats *stats = &sta->rx_stats;
  
@@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	/* for parallel-rx, we need to have DUP_VALIDATED, otherwise we write
  	 * to a common data structure; drivers can implement that per queue
  	 * but we don't have that information in mac80211
-@@ -4369,32 +4481,6 @@ static bool ieee80211_invoke_fast_rx(str
+@@ -4453,32 +4565,6 @@ static bool ieee80211_invoke_fast_rx(str
  	    pskb_trim(skb, skb->len - fast_rx->icv_len))
  		goto drop;
  
@@ -363,7 +363,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (rx->key && !ieee80211_has_protected(hdr->frame_control))
  		goto drop;
  
-@@ -4406,12 +4492,6 @@ static bool ieee80211_invoke_fast_rx(str
+@@ -4490,12 +4576,6 @@ static bool ieee80211_invoke_fast_rx(str
  		return true;
  	}
  
@@ -376,7 +376,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	/* do the header conversion - first grab the addresses */
  	ether_addr_copy(addrs.da, skb->data + fast_rx->da_offs);
  	ether_addr_copy(addrs.sa, skb->data + fast_rx->sa_offs);
-@@ -4420,62 +4500,14 @@ static bool ieee80211_invoke_fast_rx(str
+@@ -4504,62 +4584,14 @@ static bool ieee80211_invoke_fast_rx(str
  	/* push the addresses in front */
  	memcpy(skb_push(skb, sizeof(addrs)), &addrs, sizeof(addrs));
  
@@ -443,7 +443,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	stats->dropped++;
  	return true;
  }
-@@ -4529,6 +4561,47 @@ static bool ieee80211_prepare_and_rx_han
+@@ -4613,6 +4645,47 @@ static bool ieee80211_prepare_and_rx_han
  	return true;
  }
  
@@ -491,7 +491,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  /*
   * This is the actual Rx frames handler. as it belongs to Rx path it must
   * be called with rcu_read_lock protection.
-@@ -4766,15 +4839,20 @@ void ieee80211_rx_list(struct ieee80211_
+@@ -4850,15 +4923,20 @@ void ieee80211_rx_list(struct ieee80211_
  	 * if it was previously present.
  	 * Also, frames with less than 16 bytes are dropped.
  	 */
diff --git a/package/kernel/mac80211/patches/subsys/373-mac80211-support-Rx-timestamp-calculation-for-all-pr.patch b/package/kernel/mac80211/patches/subsys/373-mac80211-support-Rx-timestamp-calculation-for-all-pr.patch
index c432d77b2e..117fb35fcf 100644
--- a/package/kernel/mac80211/patches/subsys/373-mac80211-support-Rx-timestamp-calculation-for-all-pr.patch
+++ b/package/kernel/mac80211/patches/subsys/373-mac80211-support-Rx-timestamp-calculation-for-all-pr.patch
@@ -15,7 +15,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
 
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -1600,13 +1600,8 @@ ieee80211_have_rx_timestamp(struct ieee8
+@@ -1587,13 +1587,8 @@ ieee80211_have_rx_timestamp(struct ieee8
  {
  	WARN_ON_ONCE(status->flag & RX_FLAG_MACTIME_START &&
  		     status->flag & RX_FLAG_MACTIME_END);
diff --git a/package/kernel/mac80211/patches/subsys/380-mac80211-assure-all-fragments-are-encrypted.patch b/package/kernel/mac80211/patches/subsys/380-mac80211-assure-all-fragments-are-encrypted.patch
deleted file mode 100644
index 69398459f1..0000000000
--- a/package/kernel/mac80211/patches/subsys/380-mac80211-assure-all-fragments-are-encrypted.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From: Mathy Vanhoef <Mathy.Vanhoef at kuleuven.be>
-Date: Tue, 11 May 2021 20:02:42 +0200
-Subject: [PATCH] mac80211: assure all fragments are encrypted
-
-Do not mix plaintext and encrypted fragments in protected Wi-Fi
-networks. This fixes CVE-2020-26147.
-
-Previously, an attacker was able to first forward a legitimate encrypted
-fragment towards a victim, followed by a plaintext fragment. The
-encrypted and plaintext fragment would then be reassembled. For further
-details see Section 6.3 and Appendix D in the paper "Fragment and Forge:
-Breaking Wi-Fi Through Frame Aggregation and Fragmentation".
-
-Because of this change there are now two equivalent conditions in the
-code to determine if a received fragment requires sequential PNs, so we
-also move this test to a separate function to make the code easier to
-maintain.
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef at kuleuven.be>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -2204,6 +2204,16 @@ ieee80211_reassemble_find(struct ieee802
- 	return NULL;
- }
- 
-+static bool requires_sequential_pn(struct ieee80211_rx_data *rx, __le16 fc)
-+{
-+	return rx->key &&
-+		(rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP ||
-+		 rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP_256 ||
-+		 rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP ||
-+		 rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP_256) &&
-+		ieee80211_has_protected(fc);
-+}
-+
- static ieee80211_rx_result debug_noinline
- ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
- {
-@@ -2248,12 +2258,7 @@ ieee80211_rx_h_defragment(struct ieee802
- 		/* This is the first fragment of a new frame. */
- 		entry = ieee80211_reassemble_add(rx->sdata, frag, seq,
- 						 rx->seqno_idx, &(rx->skb));
--		if (rx->key &&
--		    (rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP ||
--		     rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP_256 ||
--		     rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP ||
--		     rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP_256) &&
--		    ieee80211_has_protected(fc)) {
-+		if (requires_sequential_pn(rx, fc)) {
- 			int queue = rx->security_idx;
- 
- 			/* Store CCMP/GCMP PN so that we can verify that the
-@@ -2295,11 +2300,7 @@ ieee80211_rx_h_defragment(struct ieee802
- 		u8 pn[IEEE80211_CCMP_PN_LEN], *rpn;
- 		int queue;
- 
--		if (!rx->key ||
--		    (rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP &&
--		     rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP_256 &&
--		     rx->key->conf.cipher != WLAN_CIPHER_SUITE_GCMP &&
--		     rx->key->conf.cipher != WLAN_CIPHER_SUITE_GCMP_256))
-+		if (!requires_sequential_pn(rx, fc))
- 			return RX_DROP_UNUSABLE;
- 		memcpy(pn, entry->last_pn, IEEE80211_CCMP_PN_LEN);
- 		for (i = IEEE80211_CCMP_PN_LEN - 1; i >= 0; i--) {
diff --git a/package/kernel/mac80211/patches/subsys/381-mac80211-prevent-mixed-key-and-fragment-cache-attack.patch b/package/kernel/mac80211/patches/subsys/381-mac80211-prevent-mixed-key-and-fragment-cache-attack.patch
deleted file mode 100644
index de0f89a5b0..0000000000
--- a/package/kernel/mac80211/patches/subsys/381-mac80211-prevent-mixed-key-and-fragment-cache-attack.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-From: Mathy Vanhoef <Mathy.Vanhoef at kuleuven.be>
-Date: Tue, 11 May 2021 20:02:43 +0200
-Subject: [PATCH] mac80211: prevent mixed key and fragment cache attacks
-
-Simultaneously prevent mixed key attacks (CVE-2020-24587) and fragment
-cache attacks (CVE-2020-24586). This is accomplished by assigning a
-unique color to every key (per interface) and using this to track which
-key was used to decrypt a fragment. When reassembling frames, it is
-now checked whether all fragments were decrypted using the same key.
-
-To assure that fragment cache attacks are also prevented, the ID that is
-assigned to keys is unique even over (re)associations and (re)connects.
-This means fragments separated by a (re)association or (re)connect will
-not be reassembled. Because mac80211 now also prevents the reassembly of
-mixed encrypted and plaintext fragments, all cache attacks are prevented.
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef at kuleuven.be>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/net/mac80211/ieee80211_i.h
-+++ b/net/mac80211/ieee80211_i.h
-@@ -97,6 +97,7 @@ struct ieee80211_fragment_entry {
- 	u8 rx_queue;
- 	bool check_sequential_pn; /* needed for CCMP/GCMP */
- 	u8 last_pn[6]; /* PN of the last fragment if CCMP was used */
-+	unsigned int key_color;
- };
- 
- 
---- a/net/mac80211/key.c
-+++ b/net/mac80211/key.c
-@@ -799,6 +799,7 @@ int ieee80211_key_link(struct ieee80211_
- 		       struct ieee80211_sub_if_data *sdata,
- 		       struct sta_info *sta)
- {
-+	static atomic_t key_color = ATOMIC_INIT(0);
- 	struct ieee80211_key *old_key;
- 	int idx = key->conf.keyidx;
- 	bool pairwise = key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE;
-@@ -850,6 +851,12 @@ int ieee80211_key_link(struct ieee80211_
- 	key->sdata = sdata;
- 	key->sta = sta;
- 
-+	/*
-+	 * Assign a unique ID to every key so we can easily prevent mixed
-+	 * key and fragment cache attacks.
-+	 */
-+	key->color = atomic_inc_return(&key_color);
-+
- 	increment_tailroom_need_count(sdata);
- 
- 	ret = ieee80211_key_replace(sdata, sta, pairwise, old_key, key);
---- a/net/mac80211/key.h
-+++ b/net/mac80211/key.h
-@@ -128,6 +128,8 @@ struct ieee80211_key {
- 	} debugfs;
- #endif
- 
-+	unsigned int color;
-+
- 	/*
- 	 * key config, must be last because it contains key
- 	 * material as variable length member
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -2265,6 +2265,7 @@ ieee80211_rx_h_defragment(struct ieee802
- 			 * next fragment has a sequential PN value.
- 			 */
- 			entry->check_sequential_pn = true;
-+			entry->key_color = rx->key->color;
- 			memcpy(entry->last_pn,
- 			       rx->key->u.ccmp.rx_pn[queue],
- 			       IEEE80211_CCMP_PN_LEN);
-@@ -2302,6 +2303,11 @@ ieee80211_rx_h_defragment(struct ieee802
- 
- 		if (!requires_sequential_pn(rx, fc))
- 			return RX_DROP_UNUSABLE;
-+
-+		/* Prevent mixed key and fragment cache attacks */
-+		if (entry->key_color != rx->key->color)
-+			return RX_DROP_UNUSABLE;
-+
- 		memcpy(pn, entry->last_pn, IEEE80211_CCMP_PN_LEN);
- 		for (i = IEEE80211_CCMP_PN_LEN - 1; i >= 0; i--) {
- 			pn[i]++;
diff --git a/package/kernel/mac80211/patches/subsys/382-mac80211-properly-handle-A-MSDUs-that-start-with-an-.patch b/package/kernel/mac80211/patches/subsys/382-mac80211-properly-handle-A-MSDUs-that-start-with-an-.patch
deleted file mode 100644
index d59fa05091..0000000000
--- a/package/kernel/mac80211/patches/subsys/382-mac80211-properly-handle-A-MSDUs-that-start-with-an-.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From: Mathy Vanhoef <Mathy.Vanhoef at kuleuven.be>
-Date: Tue, 11 May 2021 20:02:44 +0200
-Subject: [PATCH] mac80211: properly handle A-MSDUs that start with an
- RFC 1042 header
-
-Properly parse A-MSDUs whose first 6 bytes happen to equal a rfc1042
-header. This can occur in practice when the destination MAC address
-equals AA:AA:03:00:00:00. More importantly, this simplifies the next
-patch to mitigate A-MSDU injection attacks.
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef at kuleuven.be>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/include/net/cfg80211.h
-+++ b/include/net/cfg80211.h
-@@ -5637,7 +5637,7 @@ unsigned int ieee80211_get_mesh_hdrlen(s
-  */
- int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr,
- 				  const u8 *addr, enum nl80211_iftype iftype,
--				  u8 data_offset);
-+				  u8 data_offset, bool is_amsdu);
- 
- /**
-  * ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3
-@@ -5649,7 +5649,7 @@ int ieee80211_data_to_8023_exthdr(struct
- static inline int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr,
- 					 enum nl80211_iftype iftype)
- {
--	return ieee80211_data_to_8023_exthdr(skb, NULL, addr, iftype, 0);
-+	return ieee80211_data_to_8023_exthdr(skb, NULL, addr, iftype, 0, false);
- }
- 
- /**
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -2696,7 +2696,7 @@ __ieee80211_rx_h_amsdu(struct ieee80211_
- 	if (ieee80211_data_to_8023_exthdr(skb, &ethhdr,
- 					  rx->sdata->vif.addr,
- 					  rx->sdata->vif.type,
--					  data_offset))
-+					  data_offset, true))
- 		return RX_DROP_UNUSABLE;
- 
- 	ieee80211_amsdu_to_8023s(skb, &frame_list, dev->dev_addr,
---- a/net/wireless/util.c
-+++ b/net/wireless/util.c
-@@ -541,7 +541,7 @@ EXPORT_SYMBOL(ieee80211_get_mesh_hdrlen)
- 
- int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr,
- 				  const u8 *addr, enum nl80211_iftype iftype,
--				  u8 data_offset)
-+				  u8 data_offset, bool is_amsdu)
- {
- 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
- 	struct {
-@@ -629,7 +629,7 @@ int ieee80211_data_to_8023_exthdr(struct
- 	skb_copy_bits(skb, hdrlen, &payload, sizeof(payload));
- 	tmp.h_proto = payload.proto;
- 
--	if (likely((ether_addr_equal(payload.hdr, rfc1042_header) &&
-+	if (likely((!is_amsdu && ether_addr_equal(payload.hdr, rfc1042_header) &&
- 		    tmp.h_proto != htons(ETH_P_AARP) &&
- 		    tmp.h_proto != htons(ETH_P_IPX)) ||
- 		   ether_addr_equal(payload.hdr, bridge_tunnel_header)))
diff --git a/package/kernel/mac80211/patches/subsys/383-cfg80211-mitigate-A-MSDU-aggregation-attacks.patch b/package/kernel/mac80211/patches/subsys/383-cfg80211-mitigate-A-MSDU-aggregation-attacks.patch
deleted file mode 100644
index 8ea78dca84..0000000000
--- a/package/kernel/mac80211/patches/subsys/383-cfg80211-mitigate-A-MSDU-aggregation-attacks.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From: Mathy Vanhoef <Mathy.Vanhoef at kuleuven.be>
-Date: Tue, 11 May 2021 20:02:45 +0200
-Subject: [PATCH] cfg80211: mitigate A-MSDU aggregation attacks
-
-Mitigate A-MSDU injection attacks (CVE-2020-24588) by detecting if the
-destination address of a subframe equals an RFC1042 (i.e., LLC/SNAP)
-header, and if so dropping the complete A-MSDU frame. This mitigates
-known attacks, although new (unknown) aggregation-based attacks may
-remain possible.
-
-This defense works because in A-MSDU aggregation injection attacks, a
-normal encrypted Wi-Fi frame is turned into an A-MSDU frame. This means
-the first 6 bytes of the first A-MSDU subframe correspond to an RFC1042
-header. In other words, the destination MAC address of the first A-MSDU
-subframe contains the start of an RFC1042 header during an aggregation
-attack. We can detect this and thereby prevent this specific attack.
-For details, see Section 7.2 of "Fragment and Forge: Breaking Wi-Fi
-Through Frame Aggregation and Fragmentation".
-
-Note that for kernel 4.9 and above this patch depends on "mac80211:
-properly handle A-MSDUs that start with a rfc1042 header". Otherwise
-this patch has no impact and attacks will remain possible.
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef at kuleuven.be>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/net/wireless/util.c
-+++ b/net/wireless/util.c
-@@ -775,6 +775,9 @@ void ieee80211_amsdu_to_8023s(struct sk_
- 		remaining = skb->len - offset;
- 		if (subframe_len > remaining)
- 			goto purge;
-+		/* mitigate A-MSDU aggregation injection attacks */
-+		if (ether_addr_equal(eth.h_dest, rfc1042_header))
-+			goto purge;
- 
- 		offset += sizeof(struct ethhdr);
- 		last = remaining <= subframe_len + padding;
diff --git a/package/kernel/mac80211/patches/subsys/384-mac80211-drop-A-MSDUs-on-old-ciphers.patch b/package/kernel/mac80211/patches/subsys/384-mac80211-drop-A-MSDUs-on-old-ciphers.patch
deleted file mode 100644
index 1b5084c37d..0000000000
--- a/package/kernel/mac80211/patches/subsys/384-mac80211-drop-A-MSDUs-on-old-ciphers.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From: Johannes Berg <johannes.berg at intel.com>
-Date: Tue, 11 May 2021 20:02:46 +0200
-Subject: [PATCH] mac80211: drop A-MSDUs on old ciphers
-
-With old ciphers (WEP and TKIP) we shouldn't be using A-MSDUs
-since A-MSDUs are only supported if we know that they are, and
-the only practical way for that is HT support which doesn't
-support old ciphers.
-
-However, we would normally accept them anyway. Since we check
-the MMIC before deaggregating A-MSDUs, and the A-MSDU bit in
-the QoS header is not protected in TKIP (or WEP), this enables
-attacks similar to CVE-2020-24588. To prevent that, drop A-MSDUs
-completely with old ciphers.
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -6,7 +6,7 @@
-  * Copyright 2007-2010	Johannes Berg <johannes at sipsolutions.net>
-  * Copyright 2013-2014  Intel Mobile Communications GmbH
-  * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
-- * Copyright (C) 2018-2020 Intel Corporation
-+ * Copyright (C) 2018-2021 Intel Corporation
-  */
- 
- #include <linux/jiffies.h>
-@@ -2753,6 +2753,23 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx
- 	if (is_multicast_ether_addr(hdr->addr1))
- 		return RX_DROP_UNUSABLE;
- 
-+	if (rx->key) {
-+		/*
-+		 * We should not receive A-MSDUs on pre-HT connections,
-+		 * and HT connections cannot use old ciphers. Thus drop
-+		 * them, as in those cases we couldn't even have SPP
-+		 * A-MSDUs or such.
-+		 */
-+		switch (rx->key->conf.cipher) {
-+		case WLAN_CIPHER_SUITE_WEP40:
-+		case WLAN_CIPHER_SUITE_WEP104:
-+		case WLAN_CIPHER_SUITE_TKIP:
-+			return RX_DROP_UNUSABLE;
-+		default:
-+			break;
-+		}
-+	}
-+
- 	return __ieee80211_rx_h_amsdu(rx, 0);
- }
- 
diff --git a/package/kernel/mac80211/patches/subsys/385-mac80211-add-fragment-cache-to-sta_info.patch b/package/kernel/mac80211/patches/subsys/385-mac80211-add-fragment-cache-to-sta_info.patch
deleted file mode 100644
index b536126d38..0000000000
--- a/package/kernel/mac80211/patches/subsys/385-mac80211-add-fragment-cache-to-sta_info.patch
+++ /dev/null
@@ -1,313 +0,0 @@
-From: Johannes Berg <johannes.berg at intel.com>
-Date: Tue, 11 May 2021 20:02:47 +0200
-Subject: [PATCH] mac80211: add fragment cache to sta_info
-
-Prior patches protected against fragmentation cache attacks
-by coloring keys, but this shows that it can lead to issues
-when multiple stations use the same sequence number. Add a
-fragment cache to struct sta_info (in addition to the one in
-the interface) to separate fragments for different stations
-properly.
-
-This then automatically clear most of the fragment cache when a
-station disconnects (or reassociates) from an AP, or when client
-interfaces disconnect from the network, etc.
-
-On the way, also fix the comment there since this brings us in line
-with the recommendation in 802.11-2016 ("An AP should support ...").
-Additionally, remove a useless condition (since there's no problem
-purging an already empty list).
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/net/mac80211/ieee80211_i.h
-+++ b/net/mac80211/ieee80211_i.h
-@@ -50,12 +50,6 @@ struct ieee80211_local;
- #define IEEE80211_ENCRYPT_HEADROOM 8
- #define IEEE80211_ENCRYPT_TAILROOM 18
- 
--/* IEEE 802.11 (Ch. 9.5 Defragmentation) requires support for concurrent
-- * reception of at least three fragmented frames. This limit can be increased
-- * by changing this define, at the cost of slower frame reassembly and
-- * increased memory use (about 2 kB of RAM per entry). */
--#define IEEE80211_FRAGMENT_MAX 4
--
- /* power level hasn't been configured (or set to automatic) */
- #define IEEE80211_UNSET_POWER_LEVEL	INT_MIN
- 
-@@ -88,19 +82,6 @@ extern const u8 ieee80211_ac_to_qos_mask
- 
- #define IEEE80211_MAX_NAN_INSTANCE_ID 255
- 
--struct ieee80211_fragment_entry {
--	struct sk_buff_head skb_list;
--	unsigned long first_frag_time;
--	u16 seq;
--	u16 extra_len;
--	u16 last_frag;
--	u8 rx_queue;
--	bool check_sequential_pn; /* needed for CCMP/GCMP */
--	u8 last_pn[6]; /* PN of the last fragment if CCMP was used */
--	unsigned int key_color;
--};
--
--
- struct ieee80211_bss {
- 	u32 device_ts_beacon, device_ts_presp;
- 
-@@ -912,9 +893,7 @@ struct ieee80211_sub_if_data {
- 
- 	char name[IFNAMSIZ];
- 
--	/* Fragment table for host-based reassembly */
--	struct ieee80211_fragment_entry	fragments[IEEE80211_FRAGMENT_MAX];
--	unsigned int fragment_next;
-+	struct ieee80211_fragment_cache frags;
- 
- 	/* TID bitmap for NoAck policy */
- 	u16 noack_map;
-@@ -2329,4 +2308,7 @@ u32 ieee80211_calc_expected_tx_airtime(s
- #define debug_noinline
- #endif
- 
-+void ieee80211_init_frag_cache(struct ieee80211_fragment_cache *cache);
-+void ieee80211_destroy_frag_cache(struct ieee80211_fragment_cache *cache);
-+
- #endif /* IEEE80211_I_H */
---- a/net/mac80211/iface.c
-+++ b/net/mac80211/iface.c
-@@ -8,7 +8,7 @@
-  * Copyright 2008, Johannes Berg <johannes at sipsolutions.net>
-  * Copyright 2013-2014  Intel Mobile Communications GmbH
-  * Copyright (c) 2016        Intel Deutschland GmbH
-- * Copyright (C) 2018-2020 Intel Corporation
-+ * Copyright (C) 2018-2021 Intel Corporation
-  */
- #include <linux/slab.h>
- #include <linux/kernel.h>
-@@ -679,16 +679,12 @@ static void ieee80211_set_multicast_list
-  */
- static void ieee80211_teardown_sdata(struct ieee80211_sub_if_data *sdata)
- {
--	int i;
--
- 	/* free extra data */
- 	ieee80211_free_keys(sdata, false);
- 
- 	ieee80211_debugfs_remove_netdev(sdata);
- 
--	for (i = 0; i < IEEE80211_FRAGMENT_MAX; i++)
--		__skb_queue_purge(&sdata->fragments[i].skb_list);
--	sdata->fragment_next = 0;
-+	ieee80211_destroy_frag_cache(&sdata->frags);
- 
- 	if (ieee80211_vif_is_mesh(&sdata->vif))
- 		ieee80211_mesh_teardown_sdata(sdata);
-@@ -2038,8 +2034,7 @@ int ieee80211_if_add(struct ieee80211_lo
- 	sdata->wdev.wiphy = local->hw.wiphy;
- 	sdata->local = local;
- 
--	for (i = 0; i < IEEE80211_FRAGMENT_MAX; i++)
--		skb_queue_head_init(&sdata->fragments[i].skb_list);
-+	ieee80211_init_frag_cache(&sdata->frags);
- 
- 	INIT_LIST_HEAD(&sdata->key_list);
- 
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -2133,19 +2133,34 @@ ieee80211_rx_h_decrypt(struct ieee80211_
- 	return result;
- }
- 
-+void ieee80211_init_frag_cache(struct ieee80211_fragment_cache *cache)
-+{
-+	int i;
-+
-+	for (i = 0; i < ARRAY_SIZE(cache->entries); i++)
-+		skb_queue_head_init(&cache->entries[i].skb_list);
-+}
-+
-+void ieee80211_destroy_frag_cache(struct ieee80211_fragment_cache *cache)
-+{
-+	int i;
-+
-+	for (i = 0; i < ARRAY_SIZE(cache->entries); i++)
-+		__skb_queue_purge(&cache->entries[i].skb_list);
-+}
-+
- static inline struct ieee80211_fragment_entry *
--ieee80211_reassemble_add(struct ieee80211_sub_if_data *sdata,
-+ieee80211_reassemble_add(struct ieee80211_fragment_cache *cache,
- 			 unsigned int frag, unsigned int seq, int rx_queue,
- 			 struct sk_buff **skb)
- {
- 	struct ieee80211_fragment_entry *entry;
- 
--	entry = &sdata->fragments[sdata->fragment_next++];
--	if (sdata->fragment_next >= IEEE80211_FRAGMENT_MAX)
--		sdata->fragment_next = 0;
-+	entry = &cache->entries[cache->next++];
-+	if (cache->next >= IEEE80211_FRAGMENT_MAX)
-+		cache->next = 0;
- 
--	if (!skb_queue_empty(&entry->skb_list))
--		__skb_queue_purge(&entry->skb_list);
-+	__skb_queue_purge(&entry->skb_list);
- 
- 	__skb_queue_tail(&entry->skb_list, *skb); /* no need for locking */
- 	*skb = NULL;
-@@ -2160,14 +2175,14 @@ ieee80211_reassemble_add(struct ieee8021
- }
- 
- static inline struct ieee80211_fragment_entry *
--ieee80211_reassemble_find(struct ieee80211_sub_if_data *sdata,
-+ieee80211_reassemble_find(struct ieee80211_fragment_cache *cache,
- 			  unsigned int frag, unsigned int seq,
- 			  int rx_queue, struct ieee80211_hdr *hdr)
- {
- 	struct ieee80211_fragment_entry *entry;
- 	int i, idx;
- 
--	idx = sdata->fragment_next;
-+	idx = cache->next;
- 	for (i = 0; i < IEEE80211_FRAGMENT_MAX; i++) {
- 		struct ieee80211_hdr *f_hdr;
- 		struct sk_buff *f_skb;
-@@ -2176,7 +2191,7 @@ ieee80211_reassemble_find(struct ieee802
- 		if (idx < 0)
- 			idx = IEEE80211_FRAGMENT_MAX - 1;
- 
--		entry = &sdata->fragments[idx];
-+		entry = &cache->entries[idx];
- 		if (skb_queue_empty(&entry->skb_list) || entry->seq != seq ||
- 		    entry->rx_queue != rx_queue ||
- 		    entry->last_frag + 1 != frag)
-@@ -2217,6 +2232,7 @@ static bool requires_sequential_pn(struc
- static ieee80211_rx_result debug_noinline
- ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
- {
-+	struct ieee80211_fragment_cache *cache = &rx->sdata->frags;
- 	struct ieee80211_hdr *hdr;
- 	u16 sc;
- 	__le16 fc;
-@@ -2238,6 +2254,9 @@ ieee80211_rx_h_defragment(struct ieee802
- 		goto out_no_led;
- 	}
- 
-+	if (rx->sta)
-+		cache = &rx->sta->frags;
-+
- 	if (likely(!ieee80211_has_morefrags(fc) && frag == 0))
- 		goto out;
- 
-@@ -2256,7 +2275,7 @@ ieee80211_rx_h_defragment(struct ieee802
- 
- 	if (frag == 0) {
- 		/* This is the first fragment of a new frame. */
--		entry = ieee80211_reassemble_add(rx->sdata, frag, seq,
-+		entry = ieee80211_reassemble_add(cache, frag, seq,
- 						 rx->seqno_idx, &(rx->skb));
- 		if (requires_sequential_pn(rx, fc)) {
- 			int queue = rx->security_idx;
-@@ -2284,7 +2303,7 @@ ieee80211_rx_h_defragment(struct ieee802
- 	/* This is a fragment for a frame that should already be pending in
- 	 * fragment cache. Add this fragment to the end of the pending entry.
- 	 */
--	entry = ieee80211_reassemble_find(rx->sdata, frag, seq,
-+	entry = ieee80211_reassemble_find(cache, frag, seq,
- 					  rx->seqno_idx, hdr);
- 	if (!entry) {
- 		I802_DEBUG_INC(rx->local->rx_handlers_drop_defrag);
---- a/net/mac80211/sta_info.c
-+++ b/net/mac80211/sta_info.c
-@@ -4,7 +4,7 @@
-  * Copyright 2006-2007	Jiri Benc <jbenc at suse.cz>
-  * Copyright 2013-2014  Intel Mobile Communications GmbH
-  * Copyright (C) 2015 - 2017 Intel Deutschland GmbH
-- * Copyright (C) 2018-2020 Intel Corporation
-+ * Copyright (C) 2018-2021 Intel Corporation
-  */
- 
- #include <linux/module.h>
-@@ -393,6 +393,8 @@ struct sta_info *sta_info_alloc(struct i
- 
- 	u64_stats_init(&sta->rx_stats.syncp);
- 
-+	ieee80211_init_frag_cache(&sta->frags);
-+
- 	sta->sta_state = IEEE80211_STA_NONE;
- 
- 	/* Mark TID as unreserved */
-@@ -1103,6 +1105,8 @@ static void __sta_info_destroy_part2(str
- 
- 	ieee80211_sta_debugfs_remove(sta);
- 
-+	ieee80211_destroy_frag_cache(&sta->frags);
-+
- 	cleanup_single_sta(sta);
- }
- 
---- a/net/mac80211/sta_info.h
-+++ b/net/mac80211/sta_info.h
-@@ -3,7 +3,7 @@
-  * Copyright 2002-2005, Devicescape Software, Inc.
-  * Copyright 2013-2014  Intel Mobile Communications GmbH
-  * Copyright(c) 2015-2017 Intel Deutschland GmbH
-- * Copyright(c) 2020 Intel Corporation
-+ * Copyright(c) 2020-2021 Intel Corporation
-  */
- 
- #ifndef STA_INFO_H
-@@ -439,6 +439,33 @@ struct ieee80211_sta_rx_stats {
- };
- 
- /*
-+ * IEEE 802.11-2016 (10.6 "Defragmentation") recommends support for "concurrent
-+ * reception of at least one MSDU per access category per associated STA"
-+ * on APs, or "at least one MSDU per access category" on other interface types.
-+ *
-+ * This limit can be increased by changing this define, at the cost of slower
-+ * frame reassembly and increased memory use while fragments are pending.
-+ */
-+#define IEEE80211_FRAGMENT_MAX 4
-+
-+struct ieee80211_fragment_entry {
-+	struct sk_buff_head skb_list;
-+	unsigned long first_frag_time;
-+	u16 seq;
-+	u16 extra_len;
-+	u16 last_frag;
-+	u8 rx_queue;
-+	bool check_sequential_pn; /* needed for CCMP/GCMP */
-+	u8 last_pn[6]; /* PN of the last fragment if CCMP was used */
-+	unsigned int key_color;
-+};
-+
-+struct ieee80211_fragment_cache {
-+	struct ieee80211_fragment_entry	entries[IEEE80211_FRAGMENT_MAX];
-+	unsigned int next;
-+};
-+
-+/*
-  * The bandwidth threshold below which the per-station CoDel parameters will be
-  * scaled to be more lenient (to prevent starvation of slow stations). This
-  * value will be scaled by the number of active stations when it is being
-@@ -531,6 +558,7 @@ struct ieee80211_sta_rx_stats {
-  * @status_stats.last_ack_signal: last ACK signal
-  * @status_stats.ack_signal_filled: last ACK signal validity
-  * @status_stats.avg_ack_signal: average ACK signal
-+ * @frags: fragment cache
-  */
- struct sta_info {
- 	/* General information, mostly static */
-@@ -639,6 +667,8 @@ struct sta_info {
- 
- 	struct cfg80211_chan_def tdls_chandef;
- 
-+	struct ieee80211_fragment_cache frags;
-+
- 	/* keep last! */
- 	struct ieee80211_sta sta;
- };
diff --git a/package/kernel/mac80211/patches/subsys/386-mac80211-check-defrag-PN-against-current-frame.patch b/package/kernel/mac80211/patches/subsys/386-mac80211-check-defrag-PN-against-current-frame.patch
deleted file mode 100644
index fb2747a609..0000000000
--- a/package/kernel/mac80211/patches/subsys/386-mac80211-check-defrag-PN-against-current-frame.patch
+++ /dev/null
@@ -1,109 +0,0 @@
-From: Johannes Berg <johannes.berg at intel.com>
-Date: Tue, 11 May 2021 20:02:48 +0200
-Subject: [PATCH] mac80211: check defrag PN against current frame
-
-As pointed out by Mathy Vanhoef, we implement the RX PN check
-on fragmented frames incorrectly - we check against the last
-received PN prior to the new frame, rather than to the one in
-this frame itself.
-
-Prior patches addressed the security issue here, but in order
-to be able to reason better about the code, fix it to really
-compare against the current frame's PN, not the last stored
-one.
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/net/mac80211/ieee80211_i.h
-+++ b/net/mac80211/ieee80211_i.h
-@@ -227,8 +227,15 @@ struct ieee80211_rx_data {
- 	 */
- 	int security_idx;
- 
--	u32 tkip_iv32;
--	u16 tkip_iv16;
-+	union {
-+		struct {
-+			u32 iv32;
-+			u16 iv16;
-+		} tkip;
-+		struct {
-+			u8 pn[IEEE80211_CCMP_PN_LEN];
-+		} ccm_gcm;
-+	};
- };
- 
- struct ieee80211_csa_settings {
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -2318,7 +2318,6 @@ ieee80211_rx_h_defragment(struct ieee802
- 	if (entry->check_sequential_pn) {
- 		int i;
- 		u8 pn[IEEE80211_CCMP_PN_LEN], *rpn;
--		int queue;
- 
- 		if (!requires_sequential_pn(rx, fc))
- 			return RX_DROP_UNUSABLE;
-@@ -2333,8 +2332,8 @@ ieee80211_rx_h_defragment(struct ieee802
- 			if (pn[i])
- 				break;
- 		}
--		queue = rx->security_idx;
--		rpn = rx->key->u.ccmp.rx_pn[queue];
-+
-+		rpn = rx->ccm_gcm.pn;
- 		if (memcmp(pn, rpn, IEEE80211_CCMP_PN_LEN))
- 			return RX_DROP_UNUSABLE;
- 		memcpy(entry->last_pn, pn, IEEE80211_CCMP_PN_LEN);
---- a/net/mac80211/wpa.c
-+++ b/net/mac80211/wpa.c
-@@ -3,6 +3,7 @@
-  * Copyright 2002-2004, Instant802 Networks, Inc.
-  * Copyright 2008, Jouni Malinen <j at w1.fi>
-  * Copyright (C) 2016-2017 Intel Deutschland GmbH
-+ * Copyright (C) 2020-2021 Intel Corporation
-  */
- 
- #include <linux/netdevice.h>
-@@ -167,8 +168,8 @@ ieee80211_rx_h_michael_mic_verify(struct
- 
- update_iv:
- 	/* update IV in key information to be able to detect replays */
--	rx->key->u.tkip.rx[rx->security_idx].iv32 = rx->tkip_iv32;
--	rx->key->u.tkip.rx[rx->security_idx].iv16 = rx->tkip_iv16;
-+	rx->key->u.tkip.rx[rx->security_idx].iv32 = rx->tkip.iv32;
-+	rx->key->u.tkip.rx[rx->security_idx].iv16 = rx->tkip.iv16;
- 
- 	return RX_CONTINUE;
- 
-@@ -294,8 +295,8 @@ ieee80211_crypto_tkip_decrypt(struct iee
- 					  key, skb->data + hdrlen,
- 					  skb->len - hdrlen, rx->sta->sta.addr,
- 					  hdr->addr1, hwaccel, rx->security_idx,
--					  &rx->tkip_iv32,
--					  &rx->tkip_iv16);
-+					  &rx->tkip.iv32,
-+					  &rx->tkip.iv16);
- 	if (res != TKIP_DECRYPT_OK)
- 		return RX_DROP_UNUSABLE;
- 
-@@ -552,6 +553,8 @@ ieee80211_crypto_ccmp_decrypt(struct iee
- 		}
- 
- 		memcpy(key->u.ccmp.rx_pn[queue], pn, IEEE80211_CCMP_PN_LEN);
-+		if (unlikely(ieee80211_is_frag(hdr)))
-+			memcpy(rx->ccm_gcm.pn, pn, IEEE80211_CCMP_PN_LEN);
- 	}
- 
- 	/* Remove CCMP header and MIC */
-@@ -782,6 +785,8 @@ ieee80211_crypto_gcmp_decrypt(struct iee
- 		}
- 
- 		memcpy(key->u.gcmp.rx_pn[queue], pn, IEEE80211_GCMP_PN_LEN);
-+		if (unlikely(ieee80211_is_frag(hdr)))
-+			memcpy(rx->ccm_gcm.pn, pn, IEEE80211_CCMP_PN_LEN);
- 	}
- 
- 	/* Remove GCMP header and MIC */
diff --git a/package/kernel/mac80211/patches/subsys/387-mac80211-prevent-attacks-on-TKIP-WEP-as-well.patch b/package/kernel/mac80211/patches/subsys/387-mac80211-prevent-attacks-on-TKIP-WEP-as-well.patch
deleted file mode 100644
index bc582a6cc2..0000000000
--- a/package/kernel/mac80211/patches/subsys/387-mac80211-prevent-attacks-on-TKIP-WEP-as-well.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From: Johannes Berg <johannes.berg at intel.com>
-Date: Tue, 11 May 2021 20:02:49 +0200
-Subject: [PATCH] mac80211: prevent attacks on TKIP/WEP as well
-
-Similar to the issues fixed in previous patches, TKIP and WEP
-should be protected even if for TKIP we have the Michael MIC
-protecting it, and WEP is broken anyway.
-
-However, this also somewhat protects potential other algorithms
-that drivers might implement.
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -2284,6 +2284,7 @@ ieee80211_rx_h_defragment(struct ieee802
- 			 * next fragment has a sequential PN value.
- 			 */
- 			entry->check_sequential_pn = true;
-+			entry->is_protected = true;
- 			entry->key_color = rx->key->color;
- 			memcpy(entry->last_pn,
- 			       rx->key->u.ccmp.rx_pn[queue],
-@@ -2296,6 +2297,9 @@ ieee80211_rx_h_defragment(struct ieee802
- 				     sizeof(rx->key->u.gcmp.rx_pn[queue]));
- 			BUILD_BUG_ON(IEEE80211_CCMP_PN_LEN !=
- 				     IEEE80211_GCMP_PN_LEN);
-+		} else if (rx->key && ieee80211_has_protected(fc)) {
-+			entry->is_protected = true;
-+			entry->key_color = rx->key->color;
- 		}
- 		return RX_QUEUED;
- 	}
-@@ -2337,6 +2341,14 @@ ieee80211_rx_h_defragment(struct ieee802
- 		if (memcmp(pn, rpn, IEEE80211_CCMP_PN_LEN))
- 			return RX_DROP_UNUSABLE;
- 		memcpy(entry->last_pn, pn, IEEE80211_CCMP_PN_LEN);
-+	} else if (entry->is_protected &&
-+		   (!rx->key || !ieee80211_has_protected(fc) ||
-+		    rx->key->color != entry->key_color)) {
-+		/* Drop this as a mixed key or fragment cache attack, even
-+		 * if for TKIP Michael MIC should protect us, and WEP is a
-+		 * lost cause anyway.
-+		 */
-+		return RX_DROP_UNUSABLE;
- 	}
- 
- 	skb_pull(rx->skb, ieee80211_hdrlen(fc));
---- a/net/mac80211/sta_info.h
-+++ b/net/mac80211/sta_info.h
-@@ -455,7 +455,8 @@ struct ieee80211_fragment_entry {
- 	u16 extra_len;
- 	u16 last_frag;
- 	u8 rx_queue;
--	bool check_sequential_pn; /* needed for CCMP/GCMP */
-+	u8 check_sequential_pn:1, /* needed for CCMP/GCMP */
-+	   is_protected:1;
- 	u8 last_pn[6]; /* PN of the last fragment if CCMP was used */
- 	unsigned int key_color;
- };
diff --git a/package/kernel/mac80211/patches/subsys/388-mac80211-do-not-accept-forward-invalid-EAPOL-frames.patch b/package/kernel/mac80211/patches/subsys/388-mac80211-do-not-accept-forward-invalid-EAPOL-frames.patch
deleted file mode 100644
index 9a0b78def1..0000000000
--- a/package/kernel/mac80211/patches/subsys/388-mac80211-do-not-accept-forward-invalid-EAPOL-frames.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From: Johannes Berg <johannes.berg at intel.com>
-Date: Tue, 11 May 2021 20:02:50 +0200
-Subject: [PATCH] mac80211: do not accept/forward invalid EAPOL frames
-
-EAPOL frames are used for authentication and key management between the
-AP and each individual STA associated in the BSS. Those frames are not
-supposed to be sent by one associated STA to another associated STA
-(either unicast for broadcast/multicast).
-
-Similarly, in 802.11 they're supposed to be sent to the authenticator
-(AP) address.
-
-Since it is possible for unexpected EAPOL frames to result in misbehavior
-in supplicant implementations, it is better for the AP to not allow such
-cases to be forwarded to other clients either directly, or indirectly if
-the AP interface is part of a bridge.
-
-Accept EAPOL (control port) frames only if they're transmitted to the
-own address, or, due to interoperability concerns, to the PAE group
-address.
-
-Disable forwarding of EAPOL (or well, the configured control port
-protocol) frames back to wireless medium in all cases. Previously, these
-frames were accepted from fully authenticated and authorized stations
-and also from unauthenticated stations for one of the cases.
-
-Additionally, to avoid forwarding by the bridge, rewrite the PAE group
-address case to the local MAC address.
-
-Cc: stable at vger.kernel.org
-Co-developed-by: Jouni Malinen <jouni at codeaurora.org>
-Signed-off-by: Jouni Malinen <jouni at codeaurora.org>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -2541,13 +2541,13 @@ static bool ieee80211_frame_allowed(stru
- 	struct ethhdr *ehdr = (struct ethhdr *) rx->skb->data;
- 
- 	/*
--	 * Allow EAPOL frames to us/the PAE group address regardless
--	 * of whether the frame was encrypted or not.
-+	 * Allow EAPOL frames to us/the PAE group address regardless of
-+	 * whether the frame was encrypted or not, and always disallow
-+	 * all other destination addresses for them.
- 	 */
--	if (ehdr->h_proto == rx->sdata->control_port_protocol &&
--	    (ether_addr_equal(ehdr->h_dest, rx->sdata->vif.addr) ||
--	     ether_addr_equal(ehdr->h_dest, pae_group_addr)))
--		return true;
-+	if (unlikely(ehdr->h_proto == rx->sdata->control_port_protocol))
-+		return ether_addr_equal(ehdr->h_dest, rx->sdata->vif.addr) ||
-+		       ether_addr_equal(ehdr->h_dest, pae_group_addr);
- 
- 	if (ieee80211_802_1x_port_control(rx) ||
- 	    ieee80211_drop_unencrypted(rx, fc))
-@@ -2572,8 +2572,28 @@ static void ieee80211_deliver_skb_to_loc
- 		cfg80211_rx_control_port(dev, skb, noencrypt);
- 		dev_kfree_skb(skb);
- 	} else {
-+		struct ethhdr *ehdr = (void *)skb_mac_header(skb);
-+
- 		memset(skb->cb, 0, sizeof(skb->cb));
- 
-+		/*
-+		 * 802.1X over 802.11 requires that the authenticator address
-+		 * be used for EAPOL frames. However, 802.1X allows the use of
-+		 * the PAE group address instead. If the interface is part of
-+		 * a bridge and we pass the frame with the PAE group address,
-+		 * then the bridge will forward it to the network (even if the
-+		 * client was not associated yet), which isn't supposed to
-+		 * happen.
-+		 * To avoid that, rewrite the destination address to our own
-+		 * address, so that the authenticator (e.g. hostapd) will see
-+		 * the frame, but bridge won't forward it anywhere else. Note
-+		 * that due to earlier filtering, the only other address can
-+		 * be the PAE group address.
-+		 */
-+		if (unlikely(skb->protocol == sdata->control_port_protocol &&
-+			     !ether_addr_equal(ehdr->h_dest, sdata->vif.addr)))
-+			ether_addr_copy(ehdr->h_dest, sdata->vif.addr);
-+
- 		/* deliver to local stack */
- 		if (rx->list)
- #if LINUX_VERSION_IS_GEQ(4,19,0)
-@@ -2617,6 +2637,7 @@ ieee80211_deliver_skb(struct ieee80211_r
- 	if ((sdata->vif.type == NL80211_IFTYPE_AP ||
- 	     sdata->vif.type == NL80211_IFTYPE_AP_VLAN) &&
- 	    !(sdata->flags & IEEE80211_SDATA_DONT_BRIDGE_PACKETS) &&
-+	    ehdr->h_proto != rx->sdata->control_port_protocol &&
- 	    (sdata->vif.type != NL80211_IFTYPE_AP_VLAN || !sdata->u.vlan.sta)) {
- 		if (is_multicast_ether_addr(ehdr->h_dest) &&
- 		    ieee80211_vif_get_num_mcast_if(sdata) != 0) {
diff --git a/package/kernel/mac80211/patches/subsys/389-mac80211-extend-protection-against-mixed-key-and-fra.patch b/package/kernel/mac80211/patches/subsys/389-mac80211-extend-protection-against-mixed-key-and-fra.patch
deleted file mode 100644
index 17809263e9..0000000000
--- a/package/kernel/mac80211/patches/subsys/389-mac80211-extend-protection-against-mixed-key-and-fra.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From: Wen Gong <wgong at codeaurora.org>
-Date: Tue, 11 May 2021 20:02:51 +0200
-Subject: [PATCH] mac80211: extend protection against mixed key and
- fragment cache attacks
-
-For some chips/drivers, e.g., QCA6174 with ath10k, the decryption is
-done by the hardware, and the Protected bit in the Frame Control field
-is cleared in the lower level driver before the frame is passed to
-mac80211. In such cases, the condition for ieee80211_has_protected() is
-not met in ieee80211_rx_h_defragment() of mac80211 and the new security
-validation steps are not executed.
-
-Extend mac80211 to cover the case where the Protected bit has been
-cleared, but the frame is indicated as having been decrypted by the
-hardware. This extends protection against mixed key and fragment cache
-attack for additional drivers/chips. This fixes CVE-2020-24586 and
-CVE-2020-24587 for such cases.
-
-Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Wen Gong <wgong at codeaurora.org>
-Signed-off-by: Jouni Malinen <jouni at codeaurora.org>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -2239,6 +2239,7 @@ ieee80211_rx_h_defragment(struct ieee802
- 	unsigned int frag, seq;
- 	struct ieee80211_fragment_entry *entry;
- 	struct sk_buff *skb;
-+	struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb);
- 
- 	hdr = (struct ieee80211_hdr *)rx->skb->data;
- 	fc = hdr->frame_control;
-@@ -2297,7 +2298,9 @@ ieee80211_rx_h_defragment(struct ieee802
- 				     sizeof(rx->key->u.gcmp.rx_pn[queue]));
- 			BUILD_BUG_ON(IEEE80211_CCMP_PN_LEN !=
- 				     IEEE80211_GCMP_PN_LEN);
--		} else if (rx->key && ieee80211_has_protected(fc)) {
-+		} else if (rx->key &&
-+			   (ieee80211_has_protected(fc) ||
-+			    (status->flag & RX_FLAG_DECRYPTED))) {
- 			entry->is_protected = true;
- 			entry->key_color = rx->key->color;
- 		}
-@@ -2342,13 +2345,19 @@ ieee80211_rx_h_defragment(struct ieee802
- 			return RX_DROP_UNUSABLE;
- 		memcpy(entry->last_pn, pn, IEEE80211_CCMP_PN_LEN);
- 	} else if (entry->is_protected &&
--		   (!rx->key || !ieee80211_has_protected(fc) ||
-+		   (!rx->key ||
-+		    (!ieee80211_has_protected(fc) &&
-+		     !(status->flag & RX_FLAG_DECRYPTED)) ||
- 		    rx->key->color != entry->key_color)) {
- 		/* Drop this as a mixed key or fragment cache attack, even
- 		 * if for TKIP Michael MIC should protect us, and WEP is a
- 		 * lost cause anyway.
- 		 */
- 		return RX_DROP_UNUSABLE;
-+	} else if (entry->is_protected && rx->key &&
-+		   entry->key_color != rx->key->color &&
-+		   (status->flag & RX_FLAG_DECRYPTED)) {
-+		return RX_DROP_UNUSABLE;
- 	}
- 
- 	skb_pull(rx->skb, ieee80211_hdrlen(fc));


From lede-commits at lists.infradead.org  Sun Jun  6 08:56:46 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 06 Jun 2021 11:56:46 -0400
Subject: [openwrt/openwrt]  kernel: bump 5.4 to 5.4.124
In-Reply-To: <162299500602.17238.18081492078634828177@git-01.infra.openwrt.org>
References: <162299500602.17238.18081492078634828177@git-01.infra.openwrt.org>
Message-ID: <mailman.3419.1622995014.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/b55d3d69044ae872c96b4b287b43a57c8e96e7cd

commit b55d3d69044ae872c96b4b287b43a57c8e96e7cd
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sat Jun 5 01:08:30 2021 +0200

    kernel: bump 5.4 to 5.4.124
    
    Manually rebased
      generic/hack-5.4/662-remove_pfifo_fast.patch
      ramips/patches-5.4/0048-asoc-add-mt7620-support.patch
    
    All others updated automatically.
    
    Compile-tested on: armvirt/64, x86/generic, ath79/generic, ramips/mt7621
    Runtime-tested on: armvirt/64, x86/generic, ath79/generic
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 include/kernel-version.mk                          |  4 +--
 ...-add-support-for-boot-console-with-arbitr.patch |  2 +-
 ...low-fast-GRO-for-skbs-with-Ethernet-heade.patch |  2 +-
 ...dsa-mt7530-add-support-for-port-mirroring.patch |  4 +--
 ...vide-an-option-for-drivers-to-always-rece.patch |  4 +--
 .../753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch   |  6 ++--
 ...t-mediatek-Integrate-GDM-PSE-setup-operat.patch |  6 ++--
 ...t-mediatek-Refine-the-timing-of-GDM-PSE-s.patch |  6 ++--
 ...et-mediatek-Enable-GDM-GDMA_DROP_ALL-mode.patch |  2 +-
 ...louder-when-a-non-legacy-FDB-operation-fa.patch |  4 +--
 ...-t-use-switchdev_notifier_fdb_info-in-dsa.patch |  8 ++---
 ...e-switchdev-event-implementation-under-th.patch |  4 +--
 ...t-early-in-dsa_slave_switchdev_event-if-w.patch |  2 +-
 ...ten-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch |  6 ++--
 .../hack-5.4/661-use_fq_codel_by_default.patch     |  6 ++--
 .../generic/hack-5.4/662-remove_pfifo_fast.patch   | 21 +++++++++++-
 ...t-dsa-support-hardware-flow-table-offload.patch |  4 +--
 ...80-NET-skip-GRO-for-foreign-MAC-addresses.patch | 10 +++---
 ...net-add-support-for-threaded-NAPI-polling.patch | 14 ++++----
 .../761-net-dsa-mt7530-Support-EEE-features.patch  |  6 ++--
 ...lude-local-addresses-in-assisted-CPU-port.patch |  2 +-
 ...lude-bridge-addresses-in-assisted-CPU-por.patch |  2 +-
 ...c-static-FDB-entries-on-foreign-interface.patch |  4 +--
 ...ethernet-mtk_eth_soc-use-napi_consume_skb.patch | 12 +++----
 ...t-mtk_eth_soc-fix-unnecessary-tx-queue-st.patch |  6 ++--
 ...t-mtk_eth_soc-use-larger-burst-size-for-q.patch |  2 +-
 ...t-mtk_eth_soc-implement-dynamic-interrupt.patch | 26 +++++++-------
 ...t-mtk_eth_soc-cache-hardware-pointer-of-l.patch | 12 +++----
 ...t-mtk_eth_soc-only-read-the-full-rx-descr.patch |  4 +--
 ...t-mtk_eth_soc-unmap-rx-data-before-callin.patch |  4 +--
 ...t-mtk_eth_soc-avoid-rearming-interrupt-if.patch |  4 +--
 ...et-mtk_eth_soc-fix-parsing-packets-in-GDM.patch |  6 ++--
 ...t-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch |  4 +--
 ...t-mediatek-mtk_eth_soc-add-support-for-in.patch | 16 ++++-----
 ...t-mediatek-mtk_eth_soc-add-flow-offloadin.patch | 12 +++----
 ...date-the-xmit-timestamp-to-avoid-watchdog.patch |  2 +-
 ...b-0005-usb-dwc3-add-otg-properties-update.patch |  2 +-
 ...pagate-resolved-link-config-via-mac_link_.patch |  4 +--
 ...530-use-resolved-link-config-in-mac_link_.patch |  8 ++---
 ...530-Extend-device-data-ready-for-adding-a.patch | 12 +++----
 ...a-mt7530-Add-the-support-of-MT7531-switch.patch | 40 +++++++++++-----------
 ...t-mtk_eth_soc-add-support-for-coherent-DM.patch |  6 ++--
 ...-copy-the-commandline-from-the-devicetree.patch |  2 +-
 .../patches-5.4/0048-asoc-add-mt7620-support.patch | 18 ----------
 ...-net-ethernet-mediatek-support-net-labels.patch |  4 +--
 45 files changed, 168 insertions(+), 167 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 8ce95b5241..c496c500d3 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -6,9 +6,9 @@ ifdef CONFIG_TESTING_KERNEL
   KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
 endif
 
-LINUX_VERSION-5.4 = .123
+LINUX_VERSION-5.4 = .124
 
-LINUX_KERNEL_HASH-5.4.123 = 8efe33fffb661d14422877b775fb38de373e04ad640f5d0c8f57144ddb1022de
+LINUX_KERNEL_HASH-5.4.124 = f7f29dda2b042d7b5986d18274413131cf70e17288c05e9a683df1f46c507d82
 
 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
 sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
diff --git a/target/linux/ath79/patches-5.4/921-serial-core-add-support-for-boot-console-with-arbitr.patch b/target/linux/ath79/patches-5.4/921-serial-core-add-support-for-boot-console-with-arbitr.patch
index dac2064cbb..2a2aafa568 100644
--- a/target/linux/ath79/patches-5.4/921-serial-core-add-support-for-boot-console-with-arbitr.patch
+++ b/target/linux/ath79/patches-5.4/921-serial-core-add-support-for-boot-console-with-arbitr.patch
@@ -30,7 +30,7 @@ Signed-off-by: Sungbo Eo <mans0n at gorani.run>
  			uport->cons->cflag = 0;
  		}
  		/*
-@@ -2108,8 +2110,10 @@ uart_set_options(struct uart_port *port,
+@@ -2110,8 +2112,10 @@ uart_set_options(struct uart_port *port,
  	 * Allow the setting of the UART parameters with a NULL console
  	 * too:
  	 */
diff --git a/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch b/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch
index a942a53809..eeea18bb9c 100644
--- a/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch
+++ b/target/linux/generic/backport-5.4/700-v5.5-net-core-allow-fast-GRO-for-skbs-with-Ethernet-heade.patch
@@ -66,7 +66,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/net/core/dev.c
 +++ b/net/core/dev.c
-@@ -5404,8 +5404,7 @@ static inline void skb_gro_reset_offset(
+@@ -5423,8 +5423,7 @@ static inline void skb_gro_reset_offset(
  	NAPI_GRO_CB(skb)->frag0 = NULL;
  	NAPI_GRO_CB(skb)->frag0_len = 0;
  
diff --git a/target/linux/generic/backport-5.4/745-v5.7-net-dsa-mt7530-add-support-for-port-mirroring.patch b/target/linux/generic/backport-5.4/745-v5.7-net-dsa-mt7530-add-support-for-port-mirroring.patch
index e788118259..d4e6f8664d 100644
--- a/target/linux/generic/backport-5.4/745-v5.7-net-dsa-mt7530-add-support-for-port-mirroring.patch
+++ b/target/linux/generic/backport-5.4/745-v5.7-net-dsa-mt7530-add-support-for-port-mirroring.patch
@@ -17,7 +17,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -1153,6 +1153,64 @@ mt7530_port_vlan_del(struct dsa_switch *
+@@ -1145,6 +1145,64 @@ mt7530_port_vlan_del(struct dsa_switch *
  	return 0;
  }
  
@@ -82,7 +82,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static enum dsa_tag_protocol
  mtk_get_tag_protocol(struct dsa_switch *ds, int port)
  {
-@@ -1530,6 +1588,8 @@ static const struct dsa_switch_ops mt753
+@@ -1522,6 +1580,8 @@ static const struct dsa_switch_ops mt753
  	.port_vlan_prepare	= mt7530_port_vlan_prepare,
  	.port_vlan_add		= mt7530_port_vlan_add,
  	.port_vlan_del		= mt7530_port_vlan_del,
diff --git a/target/linux/generic/backport-5.4/752-v5.8-net-dsa-provide-an-option-for-drivers-to-always-rece.patch b/target/linux/generic/backport-5.4/752-v5.8-net-dsa-provide-an-option-for-drivers-to-always-rece.patch
index 921821a899..52d9351b70 100644
--- a/target/linux/generic/backport-5.4/752-v5.8-net-dsa-provide-an-option-for-drivers-to-always-rece.patch
+++ b/target/linux/generic/backport-5.4/752-v5.8-net-dsa-provide-an-option-for-drivers-to-always-rece.patch
@@ -101,7 +101,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		return 0;
  
  	/* Do not deprogram the CPU port as it may be shared with other user
-@@ -1118,7 +1118,7 @@ static int dsa_slave_vlan_rx_add_vid(str
+@@ -1120,7 +1120,7 @@ static int dsa_slave_vlan_rx_add_vid(str
  	 * need to emulate the switchdev prepare + commit phase.
  	 */
  	if (dp->bridge_dev) {
@@ -110,7 +110,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  			return 0;
  
  		/* br_vlan_get_info() returns -EINVAL or -ENOENT if the
-@@ -1152,7 +1152,7 @@ static int dsa_slave_vlan_rx_kill_vid(st
+@@ -1154,7 +1154,7 @@ static int dsa_slave_vlan_rx_kill_vid(st
  	 * need to emulate the switchdev prepare + commit phase.
  	 */
  	if (dp->bridge_dev) {
diff --git a/target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch b/target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch
index c9c2a6392e..eea9bf28d1 100644
--- a/target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch
+++ b/target/linux/generic/backport-5.4/753-v5.8-net-dsa-mt7530-fix-VLAN-setup.patch
@@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -1093,12 +1093,6 @@ mt7530_port_vlan_add(struct dsa_switch *
+@@ -1085,12 +1085,6 @@ mt7530_port_vlan_add(struct dsa_switch *
  	struct mt7530_priv *priv = ds->priv;
  	u16 vid;
  
@@ -28,7 +28,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mutex_lock(&priv->reg_mutex);
  
  	for (vid = vlan->vid_begin; vid <= vlan->vid_end; ++vid) {
-@@ -1124,12 +1118,6 @@ mt7530_port_vlan_del(struct dsa_switch *
+@@ -1116,12 +1110,6 @@ mt7530_port_vlan_del(struct dsa_switch *
  	struct mt7530_priv *priv = ds->priv;
  	u16 vid, pvid;
  
@@ -41,7 +41,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mutex_lock(&priv->reg_mutex);
  
  	pvid = priv->ports[port].pvid;
-@@ -1242,6 +1230,7 @@ mt7530_setup(struct dsa_switch *ds)
+@@ -1234,6 +1222,7 @@ mt7530_setup(struct dsa_switch *ds)
  	 * as two netdev instances.
  	 */
  	dn = ds->ports[MT7530_CPU_PORT].master->dev.of_node->parent;
diff --git a/target/linux/generic/backport-5.4/760-net-ethernet-mediatek-Integrate-GDM-PSE-setup-operat.patch b/target/linux/generic/backport-5.4/760-net-ethernet-mediatek-Integrate-GDM-PSE-setup-operat.patch
index 4df1fd2677..e352b0380e 100644
--- a/target/linux/generic/backport-5.4/760-net-ethernet-mediatek-Integrate-GDM-PSE-setup-operat.patch
+++ b/target/linux/generic/backport-5.4/760-net-ethernet-mediatek-Integrate-GDM-PSE-setup-operat.patch
@@ -10,7 +10,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2211,6 +2211,28 @@ static int mtk_start_dma(struct mtk_eth
+@@ -2232,6 +2232,28 @@ static int mtk_start_dma(struct mtk_eth
  	return 0;
  }
  
@@ -39,7 +39,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static int mtk_open(struct net_device *dev)
  {
  	struct mtk_mac *mac = netdev_priv(dev);
-@@ -2406,8 +2428,6 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2427,8 +2449,6 @@ static int mtk_hw_init(struct mtk_eth *e
  	mtk_w32(eth, 0, MTK_QDMA_DELAY_INT);
  	mtk_tx_irq_disable(eth, ~0);
  	mtk_rx_irq_disable(eth, ~0);
@@ -48,7 +48,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	/* FE int grouping */
  	mtk_w32(eth, MTK_TX_DONE_INT, MTK_PDMA_INT_GRP1);
-@@ -2416,18 +2436,7 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2437,18 +2457,7 @@ static int mtk_hw_init(struct mtk_eth *e
  	mtk_w32(eth, MTK_RX_DONE_INT, MTK_QDMA_INT_GRP2);
  	mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
  
diff --git a/target/linux/generic/backport-5.4/761-net-ethernet-mediatek-Refine-the-timing-of-GDM-PSE-s.patch b/target/linux/generic/backport-5.4/761-net-ethernet-mediatek-Refine-the-timing-of-GDM-PSE-s.patch
index cdcd6a1a33..d18d9f93eb 100644
--- a/target/linux/generic/backport-5.4/761-net-ethernet-mediatek-Refine-the-timing-of-GDM-PSE-s.patch
+++ b/target/linux/generic/backport-5.4/761-net-ethernet-mediatek-Refine-the-timing-of-GDM-PSE-s.patch
@@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2215,6 +2215,9 @@ static void mtk_gdm_config(struct mtk_et
+@@ -2236,6 +2236,9 @@ static void mtk_gdm_config(struct mtk_et
  {
  	int i;
  
@@ -25,7 +25,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	for (i = 0; i < MTK_MAC_COUNT; i++) {
  		u32 val = mtk_r32(eth, MTK_GDMA_FWD_CFG(i));
  
-@@ -2253,6 +2256,8 @@ static int mtk_open(struct net_device *d
+@@ -2274,6 +2277,8 @@ static int mtk_open(struct net_device *d
  		if (err)
  			return err;
  
@@ -34,7 +34,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		napi_enable(&eth->tx_napi);
  		napi_enable(&eth->rx_napi);
  		mtk_tx_irq_enable(eth, MTK_TX_DONE_INT);
-@@ -2436,8 +2441,6 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2457,8 +2462,6 @@ static int mtk_hw_init(struct mtk_eth *e
  	mtk_w32(eth, MTK_RX_DONE_INT, MTK_QDMA_INT_GRP2);
  	mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
  
diff --git a/target/linux/generic/backport-5.4/762-net-ethernet-mediatek-Enable-GDM-GDMA_DROP_ALL-mode.patch b/target/linux/generic/backport-5.4/762-net-ethernet-mediatek-Enable-GDM-GDMA_DROP_ALL-mode.patch
index b8c40ef665..e25f1211eb 100644
--- a/target/linux/generic/backport-5.4/762-net-ethernet-mediatek-Enable-GDM-GDMA_DROP_ALL-mode.patch
+++ b/target/linux/generic/backport-5.4/762-net-ethernet-mediatek-Enable-GDM-GDMA_DROP_ALL-mode.patch
@@ -12,7 +12,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2310,6 +2310,8 @@ static int mtk_stop(struct net_device *d
+@@ -2331,6 +2331,8 @@ static int mtk_stop(struct net_device *d
  	if (!refcount_dec_and_test(&eth->dma_refcnt))
  		return 0;
  
diff --git a/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch b/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch
index 967502f022..297175855b 100644
--- a/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch
+++ b/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch
@@ -25,7 +25,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1590,7 +1590,9 @@ static void dsa_slave_switchdev_event_wo
+@@ -1592,7 +1592,9 @@ static void dsa_slave_switchdev_event_wo
  
  		err = dsa_port_fdb_add(dp, fdb_info->addr, fdb_info->vid);
  		if (err) {
@@ -36,7 +36,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  			break;
  		}
  		fdb_info->offloaded = true;
-@@ -1605,9 +1607,11 @@ static void dsa_slave_switchdev_event_wo
+@@ -1607,9 +1609,11 @@ static void dsa_slave_switchdev_event_wo
  
  		err = dsa_port_fdb_del(dp, fdb_info->addr, fdb_info->vid);
  		if (err) {
diff --git a/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch b/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch
index ad7c242280..e9b74053e0 100644
--- a/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch
+++ b/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch
@@ -54,7 +54,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	struct sk_buff *	(*xmit)(struct sk_buff *skb,
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1565,76 +1565,66 @@ static int dsa_slave_netdevice_event(str
+@@ -1567,76 +1567,66 @@ static int dsa_slave_netdevice_event(str
  	return NOTIFY_DONE;
  }
  
@@ -167,7 +167,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  }
  
  /* Called under rcu_read_lock() */
-@@ -1642,7 +1632,9 @@ static int dsa_slave_switchdev_event(str
+@@ -1644,7 +1634,9 @@ static int dsa_slave_switchdev_event(str
  				     unsigned long event, void *ptr)
  {
  	struct net_device *dev = switchdev_notifier_info_to_dev(ptr);
@@ -177,7 +177,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	int err;
  
  	if (event == SWITCHDEV_PORT_ATTR_SET) {
-@@ -1655,20 +1647,32 @@ static int dsa_slave_switchdev_event(str
+@@ -1657,20 +1649,32 @@ static int dsa_slave_switchdev_event(str
  	if (!dsa_slave_dev_check(dev))
  		return NOTIFY_DONE;
  
@@ -213,7 +213,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		dev_hold(dev);
  		break;
  	default:
-@@ -1678,10 +1682,6 @@ static int dsa_slave_switchdev_event(str
+@@ -1680,10 +1684,6 @@ static int dsa_slave_switchdev_event(str
  
  	dsa_schedule_work(&switchdev_work->work);
  	return NOTIFY_OK;
diff --git a/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch b/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch
index 619c71c7bb..b46cd7545e 100644
--- a/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch
+++ b/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch
@@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1637,31 +1637,29 @@ static int dsa_slave_switchdev_event(str
+@@ -1639,31 +1639,29 @@ static int dsa_slave_switchdev_event(str
  	struct dsa_port *dp;
  	int err;
  
@@ -68,7 +68,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		fdb_info = ptr;
  
  		if (!fdb_info->added_by_user) {
-@@ -1674,13 +1672,12 @@ static int dsa_slave_switchdev_event(str
+@@ -1676,13 +1674,12 @@ static int dsa_slave_switchdev_event(str
  		switchdev_work->vid = fdb_info->vid;
  
  		dev_hold(dev);
diff --git a/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch b/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
index 25e0d30e1a..d38c3901cf 100644
--- a/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
+++ b/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
@@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1650,6 +1650,9 @@ static int dsa_slave_switchdev_event(str
+@@ -1652,6 +1652,9 @@ static int dsa_slave_switchdev_event(str
  
  		dp = dsa_slave_to_port(dev);
  
diff --git a/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch b/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch
index ecc74ea050..4aa85e5750 100644
--- a/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch
+++ b/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch
@@ -172,7 +172,7 @@ Signed-off-by: DENG Qingfang <dqfext at gmail.com>
  	 */
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1627,6 +1627,25 @@ static void dsa_slave_switchdev_event_wo
+@@ -1629,6 +1629,25 @@ static void dsa_slave_switchdev_event_wo
  		dev_put(dp->slave);
  }
  
@@ -198,7 +198,7 @@ Signed-off-by: DENG Qingfang <dqfext at gmail.com>
  /* Called under rcu_read_lock() */
  static int dsa_slave_switchdev_event(struct notifier_block *unused,
  				     unsigned long event, void *ptr)
-@@ -1645,10 +1664,37 @@ static int dsa_slave_switchdev_event(str
+@@ -1647,10 +1666,37 @@ static int dsa_slave_switchdev_event(str
  		return notifier_from_errno(err);
  	case SWITCHDEV_FDB_ADD_TO_DEVICE:
  	case SWITCHDEV_FDB_DEL_TO_DEVICE:
@@ -239,7 +239,7 @@ Signed-off-by: DENG Qingfang <dqfext at gmail.com>
  
  		if (!dp->ds->ops->port_fdb_add || !dp->ds->ops->port_fdb_del)
  			return NOTIFY_DONE;
-@@ -1663,18 +1709,13 @@ static int dsa_slave_switchdev_event(str
+@@ -1665,18 +1711,13 @@ static int dsa_slave_switchdev_event(str
  		switchdev_work->port = dp->index;
  		switchdev_work->event = event;
  
diff --git a/target/linux/generic/hack-5.4/661-use_fq_codel_by_default.patch b/target/linux/generic/hack-5.4/661-use_fq_codel_by_default.patch
index 10197eeb04..6d0a54c01d 100644
--- a/target/linux/generic/hack-5.4/661-use_fq_codel_by_default.patch
+++ b/target/linux/generic/hack-5.4/661-use_fq_codel_by_default.patch
@@ -14,7 +14,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/include/net/sch_generic.h
 +++ b/include/net/sch_generic.h
-@@ -570,12 +570,13 @@ extern struct Qdisc_ops noop_qdisc_ops;
+@@ -603,12 +603,13 @@ extern struct Qdisc_ops noop_qdisc_ops;
  extern struct Qdisc_ops pfifo_fast_ops;
  extern struct Qdisc_ops mq_qdisc_ops;
  extern struct Qdisc_ops noqueue_qdisc_ops;
@@ -82,8 +82,8 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +const struct Qdisc_ops *default_qdisc_ops = &fq_codel_qdisc_ops;
  EXPORT_SYMBOL(default_qdisc_ops);
  
- /* Main transmission queue. */
-@@ -1035,12 +1035,12 @@ static void attach_one_default_qdisc(str
+ static void qdisc_maybe_clear_missed(struct Qdisc *q,
+@@ -1079,12 +1079,12 @@ static void attach_one_default_qdisc(str
  				     void *_unused)
  {
  	struct Qdisc *qdisc;
diff --git a/target/linux/generic/hack-5.4/662-remove_pfifo_fast.patch b/target/linux/generic/hack-5.4/662-remove_pfifo_fast.patch
index 27946f8cec..9df3a8258d 100644
--- a/target/linux/generic/hack-5.4/662-remove_pfifo_fast.patch
+++ b/target/linux/generic/hack-5.4/662-remove_pfifo_fast.patch
@@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/net/sched/sch_generic.c
 +++ b/net/sched/sch_generic.c
-@@ -595,211 +595,6 @@ struct Qdisc_ops noqueue_qdisc_ops __rea
+@@ -620,230 +620,6 @@ struct Qdisc_ops noqueue_qdisc_ops __rea
  	.owner		=	THIS_MODULE,
  };
  
@@ -64,8 +64,10 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 -{
 -	struct pfifo_fast_priv *priv = qdisc_priv(qdisc);
 -	struct sk_buff *skb = NULL;
+-	bool need_retry = true;
 -	int band;
 -
+-retry:
 -	for (band = 0; band < PFIFO_FAST_BANDS && !skb; band++) {
 -		struct skb_array *q = band2list(priv, band);
 -
@@ -76,6 +78,23 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 -	}
 -	if (likely(skb)) {
 -		qdisc_update_stats_at_dequeue(qdisc, skb);
+-	} else if (need_retry &&
+-		   test_bit(__QDISC_STATE_MISSED, &qdisc->state)) {
+-		/* Delay clearing the STATE_MISSED here to reduce
+-		 * the overhead of the second spin_trylock() in
+-		 * qdisc_run_begin() and __netif_schedule() calling
+-		 * in qdisc_run_end().
+-		 */
+-		clear_bit(__QDISC_STATE_MISSED, &qdisc->state);
+-
+-		/* Make sure dequeuing happens after clearing
+-		 * STATE_MISSED.
+-		 */
+-		smp_mb__after_atomic();
+-
+-		need_retry = false;
+-
+-		goto retry;
 -	} else {
 -		WRITE_ONCE(qdisc->empty, true);
 -	}
diff --git a/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch b/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch
index 392a37b345..85c606c455 100644
--- a/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch
+++ b/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch
@@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  #include "dsa_priv.h"
  
-@@ -1221,6 +1225,27 @@ static struct devlink_port *dsa_slave_ge
+@@ -1223,6 +1227,27 @@ static struct devlink_port *dsa_slave_ge
  	return dp->ds->devlink ? &dp->devlink_port : NULL;
  }
  
@@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static const struct net_device_ops dsa_slave_netdev_ops = {
  	.ndo_open	 	= dsa_slave_open,
  	.ndo_stop		= dsa_slave_close,
-@@ -1245,6 +1270,9 @@ static const struct net_device_ops dsa_s
+@@ -1247,6 +1272,9 @@ static const struct net_device_ops dsa_s
  	.ndo_vlan_rx_add_vid	= dsa_slave_vlan_rx_add_vid,
  	.ndo_vlan_rx_kill_vid	= dsa_slave_vlan_rx_kill_vid,
  	.ndo_get_devlink_port	= dsa_slave_get_devlink_port,
diff --git a/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch b/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
index d8d993fbd8..8871f3457a 100644
--- a/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
+++ b/target/linux/generic/pending-5.4/680-NET-skip-GRO-for-foreign-MAC-addresses.patch
@@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	__u16			tc_index;	/* traffic control index */
 --- a/net/core/dev.c
 +++ b/net/core/dev.c
-@@ -5470,6 +5470,9 @@ static enum gro_result dev_gro_receive(s
+@@ -5489,6 +5489,9 @@ static enum gro_result dev_gro_receive(s
  	int same_flow;
  	int grow;
  
@@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (netif_elide_gro(skb->dev))
  		goto normal;
  
-@@ -7265,6 +7268,48 @@ static void __netdev_adjacent_dev_unlink
+@@ -7284,6 +7287,48 @@ static void __netdev_adjacent_dev_unlink
  					   &upper_dev->adj_list.lower);
  }
  
@@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static int __netdev_upper_dev_link(struct net_device *dev,
  				   struct net_device *upper_dev, bool master,
  				   void *upper_priv, void *upper_info,
-@@ -7315,6 +7360,7 @@ static int __netdev_upper_dev_link(struc
+@@ -7334,6 +7379,7 @@ static int __netdev_upper_dev_link(struc
  	if (ret)
  		return ret;
  
@@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	ret = call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
  					    &changeupper_info.info);
  	ret = notifier_to_errno(ret);
-@@ -7408,6 +7454,7 @@ void netdev_upper_dev_unlink(struct net_
+@@ -7427,6 +7473,7 @@ void netdev_upper_dev_unlink(struct net_
  
  	__netdev_adjacent_dev_unlink_neighbour(dev, upper_dev);
  
@@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	call_netdevice_notifiers_info(NETDEV_CHANGEUPPER,
  				      &changeupper_info.info);
  
-@@ -8138,6 +8185,7 @@ int dev_set_mac_address(struct net_devic
+@@ -8157,6 +8204,7 @@ int dev_set_mac_address(struct net_devic
  	if (err)
  		return err;
  	dev->addr_assign_type = NET_ADDR_SET;
diff --git a/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch b/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch
index a3b71b1896..b30482468b 100644
--- a/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch
+++ b/target/linux/generic/pending-5.4/690-net-add-support-for-threaded-NAPI-polling.patch
@@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  static int netif_rx_internal(struct sk_buff *skb);
  static int call_netdevice_notifiers_info(unsigned long val,
-@@ -5912,6 +5913,11 @@ void __napi_schedule(struct napi_struct
+@@ -5931,6 +5932,11 @@ void __napi_schedule(struct napi_struct
  {
  	unsigned long flags;
  
@@ -107,7 +107,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	local_irq_save(flags);
  	____napi_schedule(this_cpu_ptr(&softnet_data), n);
  	local_irq_restore(flags);
-@@ -5959,6 +5965,11 @@ EXPORT_SYMBOL(napi_schedule_prep);
+@@ -5978,6 +5984,11 @@ EXPORT_SYMBOL(napi_schedule_prep);
   */
  void __napi_schedule_irqoff(struct napi_struct *n)
  {
@@ -119,7 +119,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	____napi_schedule(this_cpu_ptr(&softnet_data), n);
  }
  EXPORT_SYMBOL(__napi_schedule_irqoff);
-@@ -6220,9 +6231,89 @@ static void init_gro_hash(struct napi_st
+@@ -6239,9 +6250,89 @@ static void init_gro_hash(struct napi_st
  	napi->gro_bitmask = 0;
  }
  
@@ -209,7 +209,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	INIT_LIST_HEAD(&napi->poll_list);
  	hrtimer_init(&napi->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_PINNED);
  	napi->timer.function = napi_watchdog;
-@@ -6239,6 +6330,7 @@ void netif_napi_add(struct net_device *d
+@@ -6258,6 +6349,7 @@ void netif_napi_add(struct net_device *d
  #ifdef CONFIG_NETPOLL
  	napi->poll_owner = -1;
  #endif
@@ -217,7 +217,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	set_bit(NAPI_STATE_SCHED, &napi->state);
  	set_bit(NAPI_STATE_NPSVC, &napi->state);
  	list_add_rcu(&napi->dev_list, &dev->napi_list);
-@@ -6279,6 +6371,7 @@ static void flush_gro_hash(struct napi_s
+@@ -6298,6 +6390,7 @@ static void flush_gro_hash(struct napi_s
  void netif_napi_del(struct napi_struct *napi)
  {
  	might_sleep();
@@ -225,7 +225,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (napi_hash_del(napi))
  		synchronize_net();
  	list_del_init(&napi->dev_list);
-@@ -6291,50 +6384,18 @@ EXPORT_SYMBOL(netif_napi_del);
+@@ -6310,50 +6403,18 @@ EXPORT_SYMBOL(netif_napi_del);
  
  static int napi_poll(struct napi_struct *n, struct list_head *repoll)
  {
@@ -280,7 +280,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	/* Some drivers may have called napi_schedule
  	 * prior to exhausting their budget.
-@@ -10314,6 +10375,10 @@ static int __init net_dev_init(void)
+@@ -10333,6 +10394,10 @@ static int __init net_dev_init(void)
  		sd->backlog.weight = weight_p;
  	}
  
diff --git a/target/linux/generic/pending-5.4/761-net-dsa-mt7530-Support-EEE-features.patch b/target/linux/generic/pending-5.4/761-net-dsa-mt7530-Support-EEE-features.patch
index 0fd4151ad0..e8f35b6e1f 100644
--- a/target/linux/generic/pending-5.4/761-net-dsa-mt7530-Support-EEE-features.patch
+++ b/target/linux/generic/pending-5.4/761-net-dsa-mt7530-Support-EEE-features.patch
@@ -9,7 +9,7 @@ Content-Transfer-Encoding: 8bit
 Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -1417,9 +1417,13 @@ static void mt7530_phylink_mac_config(st
+@@ -1409,9 +1409,13 @@ static void mt7530_phylink_mac_config(st
  	switch (state->speed) {
  	case SPEED_1000:
  		mcr_new |= PMCR_FORCE_SPEED_1000;
@@ -23,7 +23,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  		break;
  	}
  	if (state->duplex == DUPLEX_FULL) {
-@@ -1555,6 +1559,54 @@ mt7530_phylink_mac_link_state(struct dsa
+@@ -1547,6 +1551,54 @@ mt7530_phylink_mac_link_state(struct dsa
  	return 1;
  }
  
@@ -78,7 +78,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  static const struct dsa_switch_ops mt7530_switch_ops = {
  	.get_tag_protocol	= mtk_get_tag_protocol,
  	.setup			= mt7530_setup,
-@@ -1582,6 +1634,8 @@ static const struct dsa_switch_ops mt753
+@@ -1574,6 +1626,8 @@ static const struct dsa_switch_ops mt753
  	.phylink_mac_config	= mt7530_phylink_mac_config,
  	.phylink_mac_link_down	= mt7530_phylink_mac_link_down,
  	.phylink_mac_link_up	= mt7530_phylink_mac_link_up,
diff --git a/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch b/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch
index 618ccf0982..e1a7a0e448 100644
--- a/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch
+++ b/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch
@@ -18,7 +18,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1695,10 +1695,12 @@ static int dsa_slave_switchdev_event(str
+@@ -1697,10 +1697,12 @@ static int dsa_slave_switchdev_event(str
  		fdb_info = ptr;
  
  		if (dsa_slave_dev_check(dev)) {
diff --git a/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch b/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch
index ed34c7ad24..f985adf736 100644
--- a/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch
+++ b/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch
@@ -15,7 +15,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1709,7 +1709,11 @@ static int dsa_slave_switchdev_event(str
+@@ -1711,7 +1711,11 @@ static int dsa_slave_switchdev_event(str
  			struct net_device *br_dev;
  			struct dsa_slave_priv *p;
  
diff --git a/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch b/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch
index 94f45c6be4..984d9805f6 100644
--- a/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch
+++ b/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch
@@ -28,7 +28,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1702,9 +1702,12 @@ static int dsa_slave_switchdev_event(str
+@@ -1704,9 +1704,12 @@ static int dsa_slave_switchdev_event(str
  			else if (!fdb_info->added_by_user)
  				return NOTIFY_OK;
  		} else {
@@ -44,7 +44,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
  			 */
  			struct net_device *br_dev;
  			struct dsa_slave_priv *p;
-@@ -1726,7 +1729,8 @@ static int dsa_slave_switchdev_event(str
+@@ -1728,7 +1731,8 @@ static int dsa_slave_switchdev_event(str
  
  			dp = p->dp->cpu_dp;
  
diff --git a/target/linux/generic/pending-5.4/770-00-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch b/target/linux/generic/pending-5.4/770-00-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch
index 9909c4c963..2f0c7934f5 100644
--- a/target/linux/generic/pending-5.4/770-00-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch
+++ b/target/linux/generic/pending-5.4/770-00-net-ethernet-mtk_eth_soc-use-napi_consume_skb.patch
@@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -853,7 +853,8 @@ static int txd_to_idx(struct mtk_tx_ring
+@@ -874,7 +874,8 @@ static int txd_to_idx(struct mtk_tx_ring
  	return ((void *)dma - (void *)ring->dma) / sizeof(*dma);
  }
  
@@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  {
  	if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
  		if (tx_buf->flags & MTK_TX_FLAGS_SINGLE0) {
-@@ -885,8 +886,12 @@ static void mtk_tx_unmap(struct mtk_eth
+@@ -906,8 +907,12 @@ static void mtk_tx_unmap(struct mtk_eth
  
  	tx_buf->flags = 0;
  	if (tx_buf->skb &&
@@ -34,7 +34,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	tx_buf->skb = NULL;
  }
  
-@@ -1064,7 +1069,7 @@ err_dma:
+@@ -1085,7 +1090,7 @@ err_dma:
  		tx_buf = mtk_desc_to_tx_buf(ring, itxd);
  
  		/* unmap dma */
@@ -43,7 +43,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  		itxd->txd3 = TX_DMA_LS0 | TX_DMA_OWNER_CPU;
  		if (!MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA))
-@@ -1382,7 +1387,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -1403,7 +1408,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
  			done[mac]++;
  			budget--;
  		}
@@ -52,7 +52,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  		ring->last_free = desc;
  		atomic_inc(&ring->free_count);
-@@ -1419,7 +1424,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
+@@ -1440,7 +1445,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
  			budget--;
  		}
  
@@ -61,7 +61,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  		desc = &ring->dma[cpu];
  		ring->last_free = desc;
-@@ -1621,7 +1626,7 @@ static void mtk_tx_clean(struct mtk_eth
+@@ -1642,7 +1647,7 @@ static void mtk_tx_clean(struct mtk_eth
  
  	if (ring->buf) {
  		for (i = 0; i < MTK_DMA_SIZE; i++)
diff --git a/target/linux/generic/pending-5.4/770-03-net-ethernet-mtk_eth_soc-fix-unnecessary-tx-queue-st.patch b/target/linux/generic/pending-5.4/770-03-net-ethernet-mtk_eth_soc-fix-unnecessary-tx-queue-st.patch
index fd28bb8692..6eeae6985f 100644
--- a/target/linux/generic/pending-5.4/770-03-net-ethernet-mtk_eth_soc-fix-unnecessary-tx-queue-st.patch
+++ b/target/linux/generic/pending-5.4/770-03-net-ethernet-mtk_eth_soc-fix-unnecessary-tx-queue-st.patch
@@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1126,17 +1126,6 @@ static void mtk_wake_queue(struct mtk_et
+@@ -1147,17 +1147,6 @@ static void mtk_wake_queue(struct mtk_et
  	}
  }
  
@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static int mtk_start_xmit(struct sk_buff *skb, struct net_device *dev)
  {
  	struct mtk_mac *mac = netdev_priv(dev);
-@@ -1157,7 +1146,7 @@ static int mtk_start_xmit(struct sk_buff
+@@ -1178,7 +1167,7 @@ static int mtk_start_xmit(struct sk_buff
  
  	tx_num = mtk_cal_txd_req(skb);
  	if (unlikely(atomic_read(&ring->free_count) <= tx_num)) {
@@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		netif_err(eth, tx_queued, dev,
  			  "Tx Ring full when queue awake!\n");
  		spin_unlock(&eth->page_lock);
-@@ -1183,7 +1172,7 @@ static int mtk_start_xmit(struct sk_buff
+@@ -1204,7 +1193,7 @@ static int mtk_start_xmit(struct sk_buff
  		goto drop;
  
  	if (unlikely(atomic_read(&ring->free_count) <= ring->thresh))
diff --git a/target/linux/generic/pending-5.4/770-04-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-q.patch b/target/linux/generic/pending-5.4/770-04-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-q.patch
index e135f27f95..cd042ce409 100644
--- a/target/linux/generic/pending-5.4/770-04-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-q.patch
+++ b/target/linux/generic/pending-5.4/770-04-net-ethernet-mtk_eth_soc-use-larger-burst-size-for-q.patch
@@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2187,7 +2187,7 @@ static int mtk_start_dma(struct mtk_eth
+@@ -2208,7 +2208,7 @@ static int mtk_start_dma(struct mtk_eth
  	if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
  		mtk_w32(eth,
  			MTK_TX_WB_DDONE | MTK_TX_DMA_EN |
diff --git a/target/linux/generic/pending-5.4/770-06-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch b/target/linux/generic/pending-5.4/770-06-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch
index 8720ab503c..9302f0b1f7 100644
--- a/target/linux/generic/pending-5.4/770-06-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch
+++ b/target/linux/generic/pending-5.4/770-06-net-ethernet-mtk_eth_soc-implement-dynamic-interrupt.patch
@@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	  MediaTek SoC family.
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1228,12 +1228,13 @@ static void mtk_update_rx_cpu_idx(struct
+@@ -1249,12 +1249,13 @@ static void mtk_update_rx_cpu_idx(struct
  static int mtk_poll_rx(struct napi_struct *napi, int budget,
  		       struct mtk_eth *eth)
  {
@@ -35,7 +35,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	while (done < budget) {
  		struct net_device *netdev;
-@@ -1307,6 +1308,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1328,6 +1329,7 @@ static int mtk_poll_rx(struct napi_struc
  		else
  			skb_checksum_none_assert(skb);
  		skb->protocol = eth_type_trans(skb, netdev);
@@ -43,7 +43,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  		if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX &&
  		    (trxd.rxd2 & RX_DMA_VTAG))
-@@ -1338,6 +1340,12 @@ rx_done:
+@@ -1359,6 +1361,12 @@ rx_done:
  		mtk_update_rx_cpu_idx(eth);
  	}
  
@@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	return done;
  }
  
-@@ -1430,6 +1438,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
+@@ -1451,6 +1459,7 @@ static int mtk_poll_tx_pdma(struct mtk_e
  static int mtk_poll_tx(struct mtk_eth *eth, int budget)
  {
  	struct mtk_tx_ring *ring = &eth->tx_ring;
@@ -64,7 +64,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	unsigned int done[MTK_MAX_DEVS];
  	unsigned int bytes[MTK_MAX_DEVS];
  	int total = 0, i;
-@@ -1447,8 +1456,14 @@ static int mtk_poll_tx(struct mtk_eth *e
+@@ -1468,8 +1477,14 @@ static int mtk_poll_tx(struct mtk_eth *e
  			continue;
  		netdev_completed_queue(eth->netdev[i], done[i], bytes[i]);
  		total += done[i];
@@ -79,7 +79,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (mtk_queue_stopped(eth) &&
  	    (atomic_read(&ring->free_count) > ring->thresh))
  		mtk_wake_queue(eth);
-@@ -2123,6 +2138,7 @@ static irqreturn_t mtk_handle_irq_rx(int
+@@ -2144,6 +2159,7 @@ static irqreturn_t mtk_handle_irq_rx(int
  {
  	struct mtk_eth *eth = _eth;
  
@@ -87,7 +87,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (likely(napi_schedule_prep(&eth->rx_napi))) {
  		__napi_schedule(&eth->rx_napi);
  		mtk_rx_irq_disable(eth, MTK_RX_DONE_INT);
-@@ -2135,6 +2151,7 @@ static irqreturn_t mtk_handle_irq_tx(int
+@@ -2156,6 +2172,7 @@ static irqreturn_t mtk_handle_irq_tx(int
  {
  	struct mtk_eth *eth = _eth;
  
@@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (likely(napi_schedule_prep(&eth->tx_napi))) {
  		__napi_schedule(&eth->tx_napi);
  		mtk_tx_irq_disable(eth, MTK_TX_DONE_INT);
-@@ -2311,6 +2328,9 @@ static int mtk_stop(struct net_device *d
+@@ -2332,6 +2349,9 @@ static int mtk_stop(struct net_device *d
  	napi_disable(&eth->tx_napi);
  	napi_disable(&eth->rx_napi);
  
@@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA))
  		mtk_stop_dma(eth, MTK_QDMA_GLO_CFG);
  	mtk_stop_dma(eth, MTK_PDMA_GLO_CFG);
-@@ -2360,6 +2380,64 @@ err_disable_clks:
+@@ -2381,6 +2401,64 @@ err_disable_clks:
  	return ret;
  }
  
@@ -170,7 +170,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static int mtk_hw_init(struct mtk_eth *eth)
  {
  	int i, val, ret;
-@@ -2381,9 +2459,6 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2402,9 +2480,6 @@ static int mtk_hw_init(struct mtk_eth *e
  			goto err_disable_pm;
  		}
  
@@ -180,7 +180,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		/* disable delay and normal interrupt */
  		mtk_tx_irq_disable(eth, ~0);
  		mtk_rx_irq_disable(eth, ~0);
-@@ -2422,11 +2497,10 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2443,11 +2518,10 @@ static int mtk_hw_init(struct mtk_eth *e
  	/* Enable RX VLan Offloading */
  	mtk_w32(eth, 1, MTK_CDMP_EG_CTRL);
  
@@ -194,7 +194,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	mtk_tx_irq_disable(eth, ~0);
  	mtk_rx_irq_disable(eth, ~0);
  
-@@ -2930,6 +3004,13 @@ static int mtk_probe(struct platform_dev
+@@ -2951,6 +3025,13 @@ static int mtk_probe(struct platform_dev
  	spin_lock_init(&eth->page_lock);
  	spin_lock_init(&eth->tx_irq_lock);
  	spin_lock_init(&eth->rx_irq_lock);
@@ -260,7 +260,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  /* QDMA Interrupt grouping registers */
  #define MTK_QDMA_INT_GRP1	0x1a20
-@@ -892,6 +898,18 @@ struct mtk_eth {
+@@ -912,6 +918,18 @@ struct mtk_eth {
  
  	const struct mtk_soc_data	*soc;
  
diff --git a/target/linux/generic/pending-5.4/770-08-net-ethernet-mtk_eth_soc-cache-hardware-pointer-of-l.patch b/target/linux/generic/pending-5.4/770-08-net-ethernet-mtk_eth_soc-cache-hardware-pointer-of-l.patch
index a7231d826c..b280b6cf4b 100644
--- a/target/linux/generic/pending-5.4/770-08-net-ethernet-mtk_eth_soc-cache-hardware-pointer-of-l.patch
+++ b/target/linux/generic/pending-5.4/770-08-net-ethernet-mtk_eth_soc-cache-hardware-pointer-of-l.patch
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1358,7 +1358,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -1379,7 +1379,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
  	struct mtk_tx_buf *tx_buf;
  	u32 cpu, dma;
  
@@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	dma = mtk_r32(eth, MTK_QTX_DRX_PTR);
  
  	desc = mtk_qdma_phys_to_virt(ring, cpu);
-@@ -1392,6 +1392,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -1413,6 +1413,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
  		cpu = next_cpu;
  	}
  
@@ -28,7 +28,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	mtk_w32(eth, cpu, MTK_QTX_CRX_PTR);
  
  	return budget;
-@@ -1592,6 +1593,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -1613,6 +1614,7 @@ static int mtk_tx_alloc(struct mtk_eth *
  	atomic_set(&ring->free_count, MTK_DMA_SIZE - 2);
  	ring->next_free = &ring->dma[0];
  	ring->last_free = &ring->dma[MTK_DMA_SIZE - 1];
@@ -36,7 +36,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	ring->thresh = MAX_SKB_FRAGS;
  
  	/* make sure that all changes to the dma ring are flushed before we
-@@ -1605,9 +1607,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -1626,9 +1628,7 @@ static int mtk_tx_alloc(struct mtk_eth *
  		mtk_w32(eth,
  			ring->phys + ((MTK_DMA_SIZE - 1) * sz),
  			MTK_QTX_CRX_PTR);
@@ -49,7 +49,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	} else {
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -624,6 +624,7 @@ struct mtk_tx_buf {
+@@ -644,6 +644,7 @@ struct mtk_tx_buf {
   * @phys:		The physical addr of tx_buf
   * @next_free:		Pointer to the next free descriptor
   * @last_free:		Pointer to the last free descriptor
@@ -57,7 +57,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
   * @thresh:		The threshold of minimum amount of free descriptors
   * @free_count:		QDMA uses a linked list. Track how many free descriptors
   *			are present
-@@ -634,6 +635,7 @@ struct mtk_tx_ring {
+@@ -654,6 +655,7 @@ struct mtk_tx_ring {
  	dma_addr_t phys;
  	struct mtk_tx_dma *next_free;
  	struct mtk_tx_dma *last_free;
diff --git a/target/linux/generic/pending-5.4/770-09-net-ethernet-mtk_eth_soc-only-read-the-full-rx-descr.patch b/target/linux/generic/pending-5.4/770-09-net-ethernet-mtk_eth_soc-only-read-the-full-rx-descr.patch
index 1b7a0a9aca..c2f5013e26 100644
--- a/target/linux/generic/pending-5.4/770-09-net-ethernet-mtk_eth_soc-only-read-the-full-rx-descr.patch
+++ b/target/linux/generic/pending-5.4/770-09-net-ethernet-mtk_eth_soc-only-read-the-full-rx-descr.patch
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -772,13 +772,18 @@ static inline int mtk_max_buf_size(int f
+@@ -793,13 +793,18 @@ static inline int mtk_max_buf_size(int f
  	return buf_size;
  }
  
@@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  }
  
  /* the qdma core needs scratch memory to be setup */
-@@ -1250,8 +1255,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1271,8 +1276,7 @@ static int mtk_poll_rx(struct napi_struc
  		rxd = &ring->dma[idx];
  		data = ring->data[idx];
  
diff --git a/target/linux/generic/pending-5.4/770-10-net-ethernet-mtk_eth_soc-unmap-rx-data-before-callin.patch b/target/linux/generic/pending-5.4/770-10-net-ethernet-mtk_eth_soc-unmap-rx-data-before-callin.patch
index 2e1d2bb79d..285fcf8971 100644
--- a/target/linux/generic/pending-5.4/770-10-net-ethernet-mtk_eth_soc-unmap-rx-data-before-callin.patch
+++ b/target/linux/generic/pending-5.4/770-10-net-ethernet-mtk_eth_soc-unmap-rx-data-before-callin.patch
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1293,17 +1293,18 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1314,17 +1314,18 @@ static int mtk_poll_rx(struct napi_struc
  			goto release_desc;
  		}
  
@@ -34,7 +34,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		pktlen = RX_DMA_GET_PLEN0(trxd.rxd2);
  		skb->dev = netdev;
  		skb_put(skb, pktlen);
-@@ -1321,6 +1322,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1342,6 +1343,7 @@ static int mtk_poll_rx(struct napi_struc
  		skb_record_rx_queue(skb, 0);
  		napi_gro_receive(napi, skb);
  
diff --git a/target/linux/generic/pending-5.4/770-11-net-ethernet-mtk_eth_soc-avoid-rearming-interrupt-if.patch b/target/linux/generic/pending-5.4/770-11-net-ethernet-mtk_eth_soc-avoid-rearming-interrupt-if.patch
index e56799eb16..4036e32354 100644
--- a/target/linux/generic/pending-5.4/770-11-net-ethernet-mtk_eth_soc-avoid-rearming-interrupt-if.patch
+++ b/target/linux/generic/pending-5.4/770-11-net-ethernet-mtk_eth_soc-avoid-rearming-interrupt-if.patch
@@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -1515,8 +1515,8 @@ static int mtk_napi_tx(struct napi_struc
+@@ -1536,8 +1536,8 @@ static int mtk_napi_tx(struct napi_struc
  	if (status & MTK_TX_DONE_INT)
  		return budget;
  
@@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	return tx_done;
  }
-@@ -1549,8 +1549,9 @@ poll_again:
+@@ -1570,8 +1570,9 @@ poll_again:
  		remain_budget -= rx_done;
  		goto poll_again;
  	}
diff --git a/target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch b/target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch
index 16993b9d80..b1bde7bbff 100644
--- a/target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch
+++ b/target/linux/generic/pending-5.4/770-13-net-ethernet-mtk_eth_soc-fix-parsing-packets-in-GDM.patch
@@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  #include "mtk_eth_soc.h"
  
-@@ -1259,13 +1260,12 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1280,13 +1281,12 @@ static int mtk_poll_rx(struct napi_struc
  			break;
  
  		/* find out which mac the packet come from. values start at 1 */
@@ -37,7 +37,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  		if (unlikely(mac < 0 || mac >= MTK_MAC_COUNT ||
  			     !eth->netdev[mac]))
-@@ -2247,6 +2247,9 @@ static void mtk_gdm_config(struct mtk_et
+@@ -2268,6 +2268,9 @@ static void mtk_gdm_config(struct mtk_et
  
  		val |= config;
  
@@ -57,7 +57,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #define MTK_GDMA_ICS_EN		BIT(22)
  #define MTK_GDMA_TCS_EN		BIT(21)
  #define MTK_GDMA_UCS_EN		BIT(20)
-@@ -311,6 +312,7 @@
+@@ -324,6 +325,7 @@
  #define RX_DMA_L4_VALID_PDMA	BIT(30)		/* when PDMA is used */
  #define RX_DMA_FPORT_SHIFT	19
  #define RX_DMA_FPORT_MASK	0x7
diff --git a/target/linux/generic/pending-5.4/770-14-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch b/target/linux/generic/pending-5.4/770-14-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch
index 68ae19ec6e..4ab3d84163 100644
--- a/target/linux/generic/pending-5.4/770-14-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch
+++ b/target/linux/generic/pending-5.4/770-14-net-ethernet-mtk_eth_soc-set-PPE-flow-hash-as-skb-ha.patch
@@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #include <net/dsa.h>
  
  #include "mtk_eth_soc.h"
-@@ -1246,6 +1247,7 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1267,6 +1268,7 @@ static int mtk_poll_rx(struct napi_struc
  		struct net_device *netdev;
  		unsigned int pktlen;
  		dma_addr_t dma_addr;
@@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		int mac;
  
  		ring = mtk_get_rx_ring(eth);
-@@ -1315,6 +1317,12 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1336,6 +1338,12 @@ static int mtk_poll_rx(struct napi_struc
  		skb->protocol = eth_type_trans(skb, netdev);
  		bytes += pktlen;
  
diff --git a/target/linux/generic/pending-5.4/770-15-net-ethernet-mediatek-mtk_eth_soc-add-support-for-in.patch b/target/linux/generic/pending-5.4/770-15-net-ethernet-mediatek-mtk_eth_soc-add-support-for-in.patch
index 2614502f5a..f609f11d2c 100644
--- a/target/linux/generic/pending-5.4/770-15-net-ethernet-mediatek-mtk_eth_soc-add-support-for-in.patch
+++ b/target/linux/generic/pending-5.4/770-15-net-ethernet-mediatek-mtk_eth_soc-add-support-for-in.patch
@@ -24,7 +24,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +mtk_eth-y := mtk_eth_soc.o mtk_sgmii.o mtk_eth_path.o mtk_ppe.o
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2280,12 +2280,17 @@ static int mtk_open(struct net_device *d
+@@ -2301,12 +2301,17 @@ static int mtk_open(struct net_device *d
  
  	/* we run 2 netdevs on the same dma ring so we only bring it up once */
  	if (!refcount_read(&eth->dma_refcnt)) {
@@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  		napi_enable(&eth->tx_napi);
  		napi_enable(&eth->rx_napi);
-@@ -2355,6 +2360,9 @@ static int mtk_stop(struct net_device *d
+@@ -2376,6 +2381,9 @@ static int mtk_stop(struct net_device *d
  
  	mtk_dma_free(eth);
  
@@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	return 0;
  }
  
-@@ -3144,6 +3152,13 @@ static int mtk_probe(struct platform_dev
+@@ -3165,6 +3173,13 @@ static int mtk_probe(struct platform_dev
  			goto err_free_dev;
  	}
  
@@ -68,7 +68,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	for (i = 0; i < MTK_MAX_DEVS; i++) {
  		if (!eth->netdev[i])
  			continue;
-@@ -3218,6 +3233,7 @@ static const struct mtk_soc_data mt7621_
+@@ -3239,6 +3254,7 @@ static const struct mtk_soc_data mt7621_
  	.hw_features = MTK_HW_FEATURES,
  	.required_clks = MT7621_CLKS_BITMAP,
  	.required_pctl = false,
@@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  };
  
  static const struct mtk_soc_data mt7622_data = {
-@@ -3226,6 +3242,7 @@ static const struct mtk_soc_data mt7622_
+@@ -3247,6 +3263,7 @@ static const struct mtk_soc_data mt7622_
  	.hw_features = MTK_HW_FEATURES,
  	.required_clks = MT7622_CLKS_BITMAP,
  	.required_pctl = false,
@@ -102,7 +102,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #define MTK_GDMA_DROP_ALL       0x7777
  
  /* Unicast Filter MAC Address Register - Low */
-@@ -308,6 +310,12 @@
+@@ -321,6 +323,12 @@
  #define RX_DMA_VID(_x)		((_x) & 0xfff)
  
  /* QDMA descriptor rxd4 */
@@ -115,7 +115,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #define RX_DMA_L4_VALID		BIT(24)
  #define RX_DMA_L4_VALID_PDMA	BIT(30)		/* when PDMA is used */
  #define RX_DMA_FPORT_SHIFT	19
-@@ -807,6 +815,7 @@ struct mtk_soc_data {
+@@ -827,6 +835,7 @@ struct mtk_soc_data {
  	u32		caps;
  	u32		required_clks;
  	bool		required_pctl;
@@ -123,7 +123,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	netdev_features_t hw_features;
  };
  
-@@ -918,6 +927,8 @@ struct mtk_eth {
+@@ -938,6 +947,8 @@ struct mtk_eth {
  	u32				tx_int_status_reg;
  	u32				rx_dma_l4_valid;
  	int				ip_align;
diff --git a/target/linux/generic/pending-5.4/770-16-net-ethernet-mediatek-mtk_eth_soc-add-flow-offloadin.patch b/target/linux/generic/pending-5.4/770-16-net-ethernet-mediatek-mtk_eth_soc-add-flow-offloadin.patch
index f63ed28998..b0f06f603b 100644
--- a/target/linux/generic/pending-5.4/770-16-net-ethernet-mediatek-mtk_eth_soc-add-flow-offloadin.patch
+++ b/target/linux/generic/pending-5.4/770-16-net-ethernet-mediatek-mtk_eth_soc-add-flow-offloadin.patch
@@ -29,7 +29,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #include <net/dsa.h>
  
  #include "mtk_eth_soc.h"
-@@ -1327,8 +1329,12 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1348,8 +1350,12 @@ static int mtk_poll_rx(struct napi_struc
  		    (trxd.rxd2 & RX_DMA_VTAG))
  			__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
  					       RX_DMA_VID(trxd.rxd3));
@@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  skip_rx:
  		ring->data[idx] = new_data;
-@@ -2861,6 +2867,25 @@ static int mtk_set_rxnfc(struct net_devi
+@@ -2882,6 +2888,25 @@ static int mtk_set_rxnfc(struct net_devi
  	return ret;
  }
  
@@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static const struct ethtool_ops mtk_ethtool_ops = {
  	.get_link_ksettings	= mtk_get_link_ksettings,
  	.set_link_ksettings	= mtk_set_link_ksettings,
-@@ -2892,6 +2917,7 @@ static const struct net_device_ops mtk_n
+@@ -2913,6 +2938,7 @@ static const struct net_device_ops mtk_n
  #ifdef CONFIG_NET_POLL_CONTROLLER
  	.ndo_poll_controller	= mtk_poll_controller,
  #endif
@@ -78,7 +78,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  };
  
  static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
-@@ -3157,6 +3183,10 @@ static int mtk_probe(struct platform_dev
+@@ -3178,6 +3204,10 @@ static int mtk_probe(struct platform_dev
  				   eth->base + MTK_ETH_PPE_BASE, 2);
  		if (err)
  			goto err_free_dev;
@@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	for (i = 0; i < MTK_MAX_DEVS; i++) {
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -929,6 +929,7 @@ struct mtk_eth {
+@@ -949,6 +949,7 @@ struct mtk_eth {
  	int				ip_align;
  
  	struct mtk_ppe			ppe;
@@ -99,7 +99,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  };
  
  /* struct mtk_mac -	the structure that holds the info about the MACs of the
-@@ -973,4 +974,12 @@ int mtk_gmac_sgmii_path_setup(struct mtk
+@@ -993,4 +994,12 @@ int mtk_gmac_sgmii_path_setup(struct mtk
  int mtk_gmac_gephy_path_setup(struct mtk_eth *eth, int mac_id);
  int mtk_gmac_rgmii_path_setup(struct mtk_eth *eth, int mac_id);
  
diff --git a/target/linux/layerscape/patches-5.4/701-net-0029-sdk_dpaa-update-the-xmit-timestamp-to-avoid-watchdog.patch b/target/linux/layerscape/patches-5.4/701-net-0029-sdk_dpaa-update-the-xmit-timestamp-to-avoid-watchdog.patch
index 7f925f8946..044e7013a0 100644
--- a/target/linux/layerscape/patches-5.4/701-net-0029-sdk_dpaa-update-the-xmit-timestamp-to-avoid-watchdog.patch
+++ b/target/linux/layerscape/patches-5.4/701-net-0029-sdk_dpaa-update-the-xmit-timestamp-to-avoid-watchdog.patch
@@ -59,7 +59,7 @@ Signed-off-by: Camelia Groza <camelia.groza at nxp.com>
   */
 --- a/net/sched/sch_generic.c
 +++ b/net/sched/sch_generic.c
-@@ -440,6 +440,13 @@ static void dev_watchdog(struct timer_li
+@@ -465,6 +465,13 @@ static void dev_watchdog(struct timer_li
  					txq->trans_timeout++;
  					break;
  				}
diff --git a/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch b/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch
index 9d3f2ecfda..e3d18a9948 100644
--- a/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch
+++ b/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch
@@ -54,7 +54,7 @@ Signed-off-by: Peter Chen <peter.chen at nxp.com>
  	 * All 3.1 IP version constants are greater than the 3.0 IP
 --- a/drivers/usb/dwc3/gadget.c
 +++ b/drivers/usb/dwc3/gadget.c
-@@ -3574,6 +3574,10 @@ int dwc3_gadget_init(struct dwc3 *dwc)
+@@ -3575,6 +3575,10 @@ int dwc3_gadget_init(struct dwc3 *dwc)
  	dwc->gadget.sg_supported	= true;
  	dwc->gadget.name		= "dwc3-gadget";
  	dwc->gadget.lpm_capable		= true;
diff --git a/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch b/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch
index 7938751124..913784372b 100644
--- a/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch
+++ b/target/linux/mediatek/patches-5.4/0601-net-dsa-propagate-resolved-link-config-via-mac_link_.patch
@@ -64,7 +64,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -1450,7 +1450,9 @@ static void mt7530_phylink_mac_link_down
+@@ -1442,7 +1442,9 @@ static void mt7530_phylink_mac_link_down
  static void mt7530_phylink_mac_link_up(struct dsa_switch *ds, int port,
  				       unsigned int mode,
  				       phy_interface_t interface,
@@ -90,7 +90,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		mv88e6xxx_mac_link_force(ds, port, LINK_FORCED_UP);
 --- a/drivers/net/dsa/sja1105/sja1105_main.c
 +++ b/drivers/net/dsa/sja1105/sja1105_main.c
-@@ -830,7 +830,9 @@ static void sja1105_mac_link_down(struct
+@@ -831,7 +831,9 @@ static void sja1105_mac_link_down(struct
  static void sja1105_mac_link_up(struct dsa_switch *ds, int port,
  				unsigned int mode,
  				phy_interface_t interface,
diff --git a/target/linux/mediatek/patches-5.4/0602-net-dsa-mt7530-use-resolved-link-config-in-mac_link_.patch b/target/linux/mediatek/patches-5.4/0602-net-dsa-mt7530-use-resolved-link-config-in-mac_link_.patch
index de5b260778..0f437ae153 100644
--- a/target/linux/mediatek/patches-5.4/0602-net-dsa-mt7530-use-resolved-link-config-in-mac_link_.patch
+++ b/target/linux/mediatek/patches-5.4/0602-net-dsa-mt7530-use-resolved-link-config-in-mac_link_.patch
@@ -51,7 +51,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	mutex_unlock(&priv->reg_mutex);
  }
-@@ -1405,8 +1394,7 @@ static void mt7530_phylink_mac_config(st
+@@ -1397,8 +1386,7 @@ static void mt7530_phylink_mac_config(st
  
  	mcr_cur = mt7530_read(priv, MT7530_PMCR_P(port));
  	mcr_new = mcr_cur;
@@ -61,7 +61,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mcr_new |= PMCR_IFG_XMIT(1) | PMCR_MAC_MODE | PMCR_BACKOFF_EN |
  		   PMCR_BACKPR_EN | PMCR_FORCE_MODE;
  
-@@ -1414,26 +1402,6 @@ static void mt7530_phylink_mac_config(st
+@@ -1406,26 +1394,6 @@ static void mt7530_phylink_mac_config(st
  	if (port == 5 && dsa_is_user_port(ds, 5))
  		mcr_new |= PMCR_EXT_PHY;
  
@@ -88,7 +88,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	if (mcr_new != mcr_cur)
  		mt7530_write(priv, MT7530_PMCR_P(port), mcr_new);
  }
-@@ -1444,7 +1412,7 @@ static void mt7530_phylink_mac_link_down
+@@ -1436,7 +1404,7 @@ static void mt7530_phylink_mac_link_down
  {
  	struct mt7530_priv *priv = ds->priv;
  
@@ -97,7 +97,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  }
  
  static void mt7530_phylink_mac_link_up(struct dsa_switch *ds, int port,
-@@ -1455,8 +1423,31 @@ static void mt7530_phylink_mac_link_up(s
+@@ -1447,8 +1415,31 @@ static void mt7530_phylink_mac_link_up(s
  				       bool tx_pause, bool rx_pause)
  {
  	struct mt7530_priv *priv = ds->priv;
diff --git a/target/linux/mediatek/patches-5.4/0603-net-dsa-mt7530-Extend-device-data-ready-for-adding-a.patch b/target/linux/mediatek/patches-5.4/0603-net-dsa-mt7530-Extend-device-data-ready-for-adding-a.patch
index 04189e8e31..9ac5599a25 100644
--- a/target/linux/mediatek/patches-5.4/0603-net-dsa-mt7530-Extend-device-data-ready-for-adding-a.patch
+++ b/target/linux/mediatek/patches-5.4/0603-net-dsa-mt7530-Extend-device-data-ready-for-adding-a.patch
@@ -47,7 +47,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  		return -EINVAL;
  	}
  
-@@ -1342,12 +1344,11 @@ mt7530_setup(struct dsa_switch *ds)
+@@ -1334,12 +1336,11 @@ mt7530_setup(struct dsa_switch *ds)
  	return 0;
  }
  
@@ -63,7 +63,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  
  	switch (port) {
  	case 0: /* Internal phy */
-@@ -1356,33 +1357,114 @@ static void mt7530_phylink_mac_config(st
+@@ -1348,33 +1349,114 @@ static void mt7530_phylink_mac_config(st
  	case 3:
  	case 4:
  		if (state->interface != PHY_INTERFACE_MODE_GMII)
@@ -189,7 +189,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  		return;
  	}
  
-@@ -1450,61 +1532,44 @@ static void mt7530_phylink_mac_link_up(s
+@@ -1442,61 +1524,44 @@ static void mt7530_phylink_mac_link_up(s
  	mt7530_set(priv, MT7530_PMCR_P(port), mcr);
  }
  
@@ -274,7 +274,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  	phylink_set(mask, Pause);
  	phylink_set(mask, Asym_Pause);
  
-@@ -1600,12 +1665,45 @@ static int mt7530_set_mac_eee(struct dsa
+@@ -1592,12 +1657,45 @@ static int mt7530_set_mac_eee(struct dsa
  	return 0;
  }
  
@@ -323,7 +323,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  	.get_ethtool_stats	= mt7530_get_ethtool_stats,
  	.get_sset_count		= mt7530_get_sset_count,
  	.port_enable		= mt7530_port_enable,
-@@ -1622,18 +1720,43 @@ static const struct dsa_switch_ops mt753
+@@ -1614,18 +1712,43 @@ static const struct dsa_switch_ops mt753
  	.port_vlan_del		= mt7530_port_vlan_del,
  	.port_mirror_add	= mt7530_port_mirror_add,
  	.port_mirror_del	= mt7530_port_mirror_del,
@@ -372,7 +372,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  	{ /* sentinel */ },
  };
  MODULE_DEVICE_TABLE(of, mt7530_of_match);
-@@ -1671,8 +1794,21 @@ mt7530_probe(struct mdio_device *mdiodev
+@@ -1663,8 +1786,21 @@ mt7530_probe(struct mdio_device *mdiodev
  	/* Get the hardware identifier from the devicetree node.
  	 * We will need it for some of the clock and regulator setup.
  	 */
diff --git a/target/linux/mediatek/patches-5.4/0604-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch b/target/linux/mediatek/patches-5.4/0604-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch
index 9333f03aaf..8434c61b50 100644
--- a/target/linux/mediatek/patches-5.4/0604-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch
+++ b/target/linux/mediatek/patches-5.4/0604-net-dsa-mt7530-Add-the-support-of-MT7531-switch.patch
@@ -394,7 +394,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  	 */
  	mt7530_write(priv, MT7530_PCR_P(port),
  		     PCR_MATRIX(dsa_user_ports(priv->ds)));
-@@ -1130,27 +1454,42 @@ mt7530_port_vlan_del(struct dsa_switch *
+@@ -1122,27 +1446,42 @@ mt7530_port_vlan_del(struct dsa_switch *
  	return 0;
  }
  
@@ -444,7 +444,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  
  	val = mt7530_read(priv, MT7530_PCR_P(port));
  	if (ingress) {
-@@ -1165,7 +1504,7 @@ static int mt7530_port_mirror_add(struct
+@@ -1157,7 +1496,7 @@ static int mt7530_port_mirror_add(struct
  	return 0;
  }
  
@@ -453,7 +453,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  				   struct dsa_mall_mirror_tc_entry *mirror)
  {
  	struct mt7530_priv *priv = ds->priv;
-@@ -1182,9 +1521,9 @@ static void mt7530_port_mirror_del(struc
+@@ -1174,9 +1513,9 @@ static void mt7530_port_mirror_del(struc
  	mt7530_write(priv, MT7530_PCR_P(port), val);
  
  	if (!priv->mirror_rx && !priv->mirror_tx) {
@@ -466,7 +466,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  	}
  }
  
-@@ -1290,7 +1629,7 @@ mt7530_setup(struct dsa_switch *ds)
+@@ -1282,7 +1621,7 @@ mt7530_setup(struct dsa_switch *ds)
  			   PCR_MATRIX_CLR);
  
  		if (dsa_is_cpu_port(ds, i))
@@ -475,7 +475,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  		else
  			mt7530_port_disable(ds, i);
  
-@@ -1344,6 +1683,118 @@ mt7530_setup(struct dsa_switch *ds)
+@@ -1336,6 +1675,118 @@ mt7530_setup(struct dsa_switch *ds)
  	return 0;
  }
  
@@ -594,7 +594,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  static bool
  mt7530_phy_mode_supported(struct dsa_switch *ds, int port,
  			  const struct phylink_link_state *state)
-@@ -1382,6 +1833,47 @@ unsupported:
+@@ -1374,6 +1825,47 @@ unsupported:
  	return false;
  }
  
@@ -642,7 +642,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  static bool
  mt753x_phy_mode_supported(struct dsa_switch *ds, int port,
  			  const struct phylink_link_state *state)
-@@ -1414,6 +1906,227 @@ mt7530_mac_config(struct dsa_switch *ds,
+@@ -1406,6 +1898,227 @@ mt7530_mac_config(struct dsa_switch *ds,
  	return 0;
  }
  
@@ -870,7 +870,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  static int
  mt753x_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
  		  const struct phylink_link_state *state)
-@@ -1449,6 +2162,8 @@ mt753x_phylink_mac_config(struct dsa_swi
+@@ -1441,6 +2154,8 @@ mt753x_phylink_mac_config(struct dsa_swi
  		if (mt753x_mac_config(ds, port, mode, state) < 0)
  			goto unsupported;
  
@@ -879,7 +879,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  		break;
  	case 6: /* 1st cpu port */
  		if (priv->p6_interface == state->interface)
-@@ -1468,7 +2183,8 @@ unsupported:
+@@ -1460,7 +2175,8 @@ unsupported:
  		return;
  	}
  
@@ -889,7 +889,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  		dev_err(ds->dev, "%s: in-band negotiation unsupported\n",
  			__func__);
  		return;
-@@ -1478,7 +2194,7 @@ unsupported:
+@@ -1470,7 +2186,7 @@ unsupported:
  	mcr_new = mcr_cur;
  	mcr_new &= ~PMCR_LINK_SETTINGS_MASK;
  	mcr_new |= PMCR_IFG_XMIT(1) | PMCR_MAC_MODE | PMCR_BACKOFF_EN |
@@ -898,7 +898,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  
  	/* Are we connected to external phy */
  	if (port == 5 && dsa_is_user_port(ds, 5))
-@@ -1488,7 +2204,18 @@ unsupported:
+@@ -1480,7 +2196,18 @@ unsupported:
  		mt7530_write(priv, MT7530_PMCR_P(port), mcr_new);
  }
  
@@ -918,7 +918,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  					 unsigned int mode,
  					 phy_interface_t interface)
  {
-@@ -1497,7 +2224,19 @@ static void mt7530_phylink_mac_link_down
+@@ -1489,7 +2216,19 @@ static void mt7530_phylink_mac_link_down
  	mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK);
  }
  
@@ -939,7 +939,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  				       unsigned int mode,
  				       phy_interface_t interface,
  				       struct phy_device *phydev,
-@@ -1507,18 +2246,29 @@ static void mt7530_phylink_mac_link_up(s
+@@ -1499,18 +2238,29 @@ static void mt7530_phylink_mac_link_up(s
  	struct mt7530_priv *priv = ds->priv;
  	u32 mcr;
  
@@ -971,7 +971,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  		break;
  	}
  	if (duplex == DUPLEX_FULL) {
-@@ -1532,6 +2282,45 @@ static void mt7530_phylink_mac_link_up(s
+@@ -1524,6 +2274,45 @@ static void mt7530_phylink_mac_link_up(s
  	mt7530_set(priv, MT7530_PMCR_P(port), mcr);
  }
  
@@ -1017,7 +1017,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  static void
  mt7530_mac_port_validate(struct dsa_switch *ds, int port,
  			 unsigned long *supported)
-@@ -1540,6 +2329,14 @@ mt7530_mac_port_validate(struct dsa_swit
+@@ -1532,6 +2321,14 @@ mt7530_mac_port_validate(struct dsa_swit
  		phylink_set(supported, 1000baseX_Full);
  }
  
@@ -1032,7 +1032,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  static void
  mt753x_phylink_validate(struct dsa_switch *ds, int port,
  			unsigned long *supported,
-@@ -1556,7 +2353,8 @@ mt753x_phylink_validate(struct dsa_switc
+@@ -1548,7 +2345,8 @@ mt753x_phylink_validate(struct dsa_switc
  
  	phylink_set_port_modes(mask);
  
@@ -1042,7 +1042,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  		phylink_set(mask, 10baseT_Half);
  		phylink_set(mask, 10baseT_Full);
  		phylink_set(mask, 100baseT_Half);
-@@ -1575,6 +2373,11 @@ mt753x_phylink_validate(struct dsa_switc
+@@ -1567,6 +2365,11 @@ mt753x_phylink_validate(struct dsa_switc
  
  	linkmode_and(supported, supported, mask);
  	linkmode_and(state->advertising, state->advertising, mask);
@@ -1054,7 +1054,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  }
  
  static int
-@@ -1665,6 +2468,63 @@ static int mt7530_set_mac_eee(struct dsa
+@@ -1657,6 +2460,63 @@ static int mt7530_set_mac_eee(struct dsa
  	return 0;
  }
  
@@ -1118,7 +1118,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  static int
  mt753x_phylink_mac_link_state(struct dsa_switch *ds, int port,
  			      struct phylink_link_state *state)
-@@ -1718,13 +2578,14 @@ static const struct dsa_switch_ops mt753
+@@ -1710,13 +2570,14 @@ static const struct dsa_switch_ops mt753
  	.port_vlan_prepare	= mt7530_port_vlan_prepare,
  	.port_vlan_add		= mt7530_port_vlan_add,
  	.port_vlan_del		= mt7530_port_vlan_del,
@@ -1137,7 +1137,7 @@ Signed-off-by: Sean Wang <sean.wang at mediatek.com>
  	.get_mac_eee		= mt7530_get_mac_eee,
  	.set_mac_eee		= mt7530_set_mac_eee,
  };
-@@ -1752,11 +2613,26 @@ static const struct mt753x_info mt753x_t
+@@ -1744,11 +2605,26 @@ static const struct mt753x_info mt753x_t
  		.mac_port_get_state = mt7530_phylink_mac_link_state,
  		.mac_port_config = mt7530_mac_config,
  	},
diff --git a/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch b/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch
index 98886767a2..e75d76b9cc 100644
--- a/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch
+++ b/target/linux/mediatek/patches-5.4/1011-net-ethernet-mtk_eth_soc-add-support-for-coherent-DM.patch
@@ -37,7 +37,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #include <linux/mfd/syscon.h>
  #include <linux/regmap.h>
  #include <linux/clk.h>
-@@ -2485,6 +2486,13 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -2506,6 +2507,13 @@ static int mtk_hw_init(struct mtk_eth *e
  	if (ret)
  		goto err_disable_pm;
  
@@ -51,7 +51,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
  		ret = device_reset(eth->dev);
  		if (ret) {
-@@ -3083,6 +3091,16 @@ static int mtk_probe(struct platform_dev
+@@ -3104,6 +3112,16 @@ static int mtk_probe(struct platform_dev
  		}
  	}
  
@@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  					  GFP_KERNEL);
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -435,6 +435,12 @@
+@@ -448,6 +448,12 @@
  #define RSTCTRL_FE		BIT(6)
  #define RSTCTRL_PPE		BIT(31)
  
diff --git a/target/linux/ramips/patches-5.4/0007-MIPS-ralink-copy-the-commandline-from-the-devicetree.patch b/target/linux/ramips/patches-5.4/0007-MIPS-ralink-copy-the-commandline-from-the-devicetree.patch
index 54af571d85..c05ee8018d 100644
--- a/target/linux/ramips/patches-5.4/0007-MIPS-ralink-copy-the-commandline-from-the-devicetree.patch
+++ b/target/linux/ramips/patches-5.4/0007-MIPS-ralink-copy-the-commandline-from-the-devicetree.patch
@@ -10,7 +10,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
 
 --- a/arch/mips/ralink/of.c
 +++ b/arch/mips/ralink/of.c
-@@ -80,6 +80,8 @@ void __init plat_mem_setup(void)
+@@ -82,6 +82,8 @@ void __init plat_mem_setup(void)
  
  	__dt_setup_arch(dtb);
  
diff --git a/target/linux/ramips/patches-5.4/0048-asoc-add-mt7620-support.patch b/target/linux/ramips/patches-5.4/0048-asoc-add-mt7620-support.patch
index d0d4141a8d..cffdc4f4a1 100644
--- a/target/linux/ramips/patches-5.4/0048-asoc-add-mt7620-support.patch
+++ b/target/linux/ramips/patches-5.4/0048-asoc-add-mt7620-support.patch
@@ -18,24 +18,6 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  create mode 100644 sound/soc/ralink/mt7620-i2s.c
  create mode 100644 sound/soc/ralink/mt7620-wm8960.c
 
---- a/arch/mips/ralink/of.c
-+++ b/arch/mips/ralink/of.c
-@@ -13,6 +13,7 @@
- #include <linux/of_fdt.h>
- #include <linux/kernel.h>
- #include <linux/memblock.h>
-+#include <linux/module.h>
- #include <linux/of_platform.h>
- #include <linux/of_address.h>
- 
-@@ -24,6 +25,7 @@
- #include "common.h"
- 
- __iomem void *rt_sysc_membase;
-+EXPORT_SYMBOL(rt_sysc_membase);
- __iomem void *rt_memc_membase;
- 
- __iomem void *plat_of_remap_node(const char *node)
 --- a/sound/soc/Kconfig
 +++ b/sound/soc/Kconfig
 @@ -60,6 +60,7 @@ source "sound/soc/mxs/Kconfig"
diff --git a/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch b/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch
index 6583fca60b..b011b140c7 100644
--- a/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch
+++ b/target/linux/ramips/patches-5.4/401-net-ethernet-mediatek-support-net-labels.patch
@@ -14,7 +14,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -2922,6 +2922,7 @@ static const struct net_device_ops mtk_n
+@@ -2943,6 +2943,7 @@ static const struct net_device_ops mtk_n
  
  static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
  {
@@ -22,7 +22,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  	const __be32 *_id = of_get_property(np, "reg", NULL);
  	struct phylink *phylink;
  	int phy_mode, id, err;
-@@ -3014,6 +3015,9 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -3035,6 +3036,9 @@ static int mtk_add_mac(struct mtk_eth *e
  
  	eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH - MTK_RX_ETH_HLEN;
  


From lede-commits at lists.infradead.org  Sun Jun  6 08:56:47 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 06 Jun 2021 11:56:47 -0400
Subject: [openwrt/openwrt]  mac80211: Update to backports-5.10.42
In-Reply-To: <162299500602.17238.18081492078634828177@git-01.infra.openwrt.org>
References: <162299500602.17238.18081492078634828177@git-01.infra.openwrt.org>
Message-ID: <mailman.3422.1622995014.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/00d7a459f3ebb2a0d5f806cc3f95e171b42600e9

commit 00d7a459f3ebb2a0d5f806cc3f95e171b42600e9
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sat Jun 5 18:21:57 2021 +0200

    mac80211: Update to backports-5.10.42
    
    The removed patches were integrated upstream.
    
    The brcmf_driver_work workqueue was removed in brcmfmac with kernel
    5.10.42, the asynchronous call was covered to a synchronous call. There
    is no need to wait any more.
    This part was removed manually from this patch:
    brcm/860-brcmfmac-register-wiphy-s-during-module_init.patch
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 04a260911ca0f10a0e37c487c220e1aae3623dda)
---
 package/kernel/mac80211/Makefile                   |   6 +-
 .../patches/ath/080-ath10k_thermal_config.patch    |   2 +-
 ...CCMP-PN-replay-protection-for-fragmented-.patch | 180 ------------
 ...drop-fragments-with-multicast-DA-for-PCIe.patch |  66 -----
 ...drop-fragments-with-multicast-DA-for-SDIO.patch |  40 ---
 ...-MPDU-which-has-discard-flag-set-by-firmw.patch |  54 ----
 ...ix-TKIP-Michael-MIC-verification-for-PCIe.patch |  48 ----
 ...date-first-subframe-of-A-MSDU-before-proc.patch | 109 -------
 .../patches/ath/402-ath_regd_optional.patch        |   2 +-
 .../patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch  |   2 +-
 ...-controlling-support-for-various-chipsets.patch |   4 +-
 ...mfmac-register-wiphy-s-during-module_init.patch |  10 -
 .../mac80211/patches/build/001-fix_build.patch     |   8 +-
 .../mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch |   2 +-
 .../mwl/940-mwl8k_init_devices_synchronously.patch |   4 +-
 .../rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch |   2 +-
 .../subsys/100-remove-cryptoapi-dependencies.patch |  20 +-
 .../patches/subsys/150-disable_addr_notifier.patch |   6 +-
 ...-support-immediate-reconnect-request-hint.patch |   4 +-
 ...pport-driver-based-disconnect-with-reconn.patch |  34 +--
 ...-drop-get_default_func-move-default-flow-.patch |   2 +-
 ...0211-add-rx-decapsulation-offload-support.patch |  26 +-
 ...pport-Rx-timestamp-calculation-for-all-pr.patch |   2 +-
 ...c80211-assure-all-fragments-are-encrypted.patch |  69 -----
 ...event-mixed-key-and-fragment-cache-attack.patch |  87 ------
 ...operly-handle-A-MSDUs-that-start-with-an-.patch |  66 -----
 ...80211-mitigate-A-MSDU-aggregation-attacks.patch |  40 ---
 .../384-mac80211-drop-A-MSDUs-on-old-ciphers.patch |  54 ----
 ...5-mac80211-add-fragment-cache-to-sta_info.patch | 313 ---------------------
 ...211-check-defrag-PN-against-current-frame.patch | 109 -------
 ...80211-prevent-attacks-on-TKIP-WEP-as-well.patch |  62 ----
 ...o-not-accept-forward-invalid-EAPOL-frames.patch |  94 -------
 ...tend-protection-against-mixed-key-and-fra.patch |  68 -----
 33 files changed, 63 insertions(+), 1532 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 19cda3696c..dd9ec172ca 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=mac80211
 
-PKG_VERSION:=5.10.34-1
+PKG_VERSION:=5.10.42-1
 PKG_RELEASE:=1
-PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.10.34/
-PKG_HASH:=03c4ca6bf47d4e50b91b61bc2943a98c788439e56ce2b4080bc4c94141c2c15b
+PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.10.42/
+PKG_HASH:=6876520105240844fdb32d1dcdf2bfdea291a37a96f16c892fda3776ba714fcb
 
 PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
diff --git a/package/kernel/mac80211/patches/ath/080-ath10k_thermal_config.patch b/package/kernel/mac80211/patches/ath/080-ath10k_thermal_config.patch
index 55d48daa79..de6f9d9bb0 100644
--- a/package/kernel/mac80211/patches/ath/080-ath10k_thermal_config.patch
+++ b/package/kernel/mac80211/patches/ath/080-ath10k_thermal_config.patch
@@ -37,7 +37,7 @@
  void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature);
 --- a/local-symbols
 +++ b/local-symbols
-@@ -143,6 +143,7 @@ ATH10K_SNOC=
+@@ -142,6 +142,7 @@ ATH10K_SNOC=
  ATH10K_DEBUG=
  ATH10K_DEBUGFS=
  ATH10K_SPECTRAL=
diff --git a/package/kernel/mac80211/patches/ath/300-ath10k-add-CCMP-PN-replay-protection-for-fragmented-.patch b/package/kernel/mac80211/patches/ath/300-ath10k-add-CCMP-PN-replay-protection-for-fragmented-.patch
deleted file mode 100644
index 0ce49b22ab..0000000000
--- a/package/kernel/mac80211/patches/ath/300-ath10k-add-CCMP-PN-replay-protection-for-fragmented-.patch
+++ /dev/null
@@ -1,180 +0,0 @@
-From: Wen Gong <wgong at codeaurora.org>
-Date: Tue, 11 May 2021 20:02:52 +0200
-Subject: [PATCH] ath10k: add CCMP PN replay protection for fragmented
- frames for PCIe
-
-PN replay check for not fragmented frames is finished in the firmware,
-but this was not done for fragmented frames when ath10k is used with
-QCA6174/QCA6377 PCIe. mac80211 has the function
-ieee80211_rx_h_defragment() for PN replay check for fragmented frames,
-but this does not get checked with QCA6174 due to the
-ieee80211_has_protected() condition not matching the cleared Protected
-bit case.
-
-Validate the PN of received fragmented frames within ath10k when CCMP is
-used and drop the fragment if the PN is not correct (incremented by
-exactly one from the previous fragment). This applies only for
-QCA6174/QCA6377 PCIe.
-
-Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Wen Gong <wgong at codeaurora.org>
-Signed-off-by: Jouni Malinen <jouni at codeaurora.org>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/drivers/net/wireless/ath/ath10k/htt.h
-+++ b/drivers/net/wireless/ath/ath10k/htt.h
-@@ -846,6 +846,7 @@ enum htt_security_types {
- 
- #define ATH10K_HTT_TXRX_PEER_SECURITY_MAX 2
- #define ATH10K_TXRX_NUM_EXT_TIDS 19
-+#define ATH10K_TXRX_NON_QOS_TID 16
- 
- enum htt_security_flags {
- #define HTT_SECURITY_TYPE_MASK 0x7F
---- a/drivers/net/wireless/ath/ath10k/htt_rx.c
-+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
-@@ -1746,16 +1746,87 @@ static void ath10k_htt_rx_h_csum_offload
- 	msdu->ip_summed = ath10k_htt_rx_get_csum_state(msdu);
- }
- 
-+static u64 ath10k_htt_rx_h_get_pn(struct ath10k *ar, struct sk_buff *skb,
-+				  u16 offset,
-+				  enum htt_rx_mpdu_encrypt_type enctype)
-+{
-+	struct ieee80211_hdr *hdr;
-+	u64 pn = 0;
-+	u8 *ehdr;
-+
-+	hdr = (struct ieee80211_hdr *)(skb->data + offset);
-+	ehdr = skb->data + offset + ieee80211_hdrlen(hdr->frame_control);
-+
-+	if (enctype == HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2) {
-+		pn = ehdr[0];
-+		pn |= (u64)ehdr[1] << 8;
-+		pn |= (u64)ehdr[4] << 16;
-+		pn |= (u64)ehdr[5] << 24;
-+		pn |= (u64)ehdr[6] << 32;
-+		pn |= (u64)ehdr[7] << 40;
-+	}
-+	return pn;
-+}
-+
-+static bool ath10k_htt_rx_h_frag_pn_check(struct ath10k *ar,
-+					  struct sk_buff *skb,
-+					  u16 peer_id,
-+					  u16 offset,
-+					  enum htt_rx_mpdu_encrypt_type enctype)
-+{
-+	struct ath10k_peer *peer;
-+	union htt_rx_pn_t *last_pn, new_pn = {0};
-+	struct ieee80211_hdr *hdr;
-+	bool more_frags;
-+	u8 tid, frag_number;
-+	u32 seq;
-+
-+	peer = ath10k_peer_find_by_id(ar, peer_id);
-+	if (!peer) {
-+		ath10k_dbg(ar, ATH10K_DBG_HTT, "invalid peer for frag pn check\n");
-+		return false;
-+	}
-+
-+	hdr = (struct ieee80211_hdr *)(skb->data + offset);
-+	if (ieee80211_is_data_qos(hdr->frame_control))
-+		tid = ieee80211_get_tid(hdr);
-+	else
-+		tid = ATH10K_TXRX_NON_QOS_TID;
-+
-+	last_pn = &peer->frag_tids_last_pn[tid];
-+	new_pn.pn48 = ath10k_htt_rx_h_get_pn(ar, skb, offset, enctype);
-+	more_frags = ieee80211_has_morefrags(hdr->frame_control);
-+	frag_number = le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG;
-+	seq = (__le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_SEQ) >> 4;
-+
-+	if (frag_number == 0) {
-+		last_pn->pn48 = new_pn.pn48;
-+		peer->frag_tids_seq[tid] = seq;
-+	} else {
-+		if (seq != peer->frag_tids_seq[tid])
-+			return false;
-+
-+		if (new_pn.pn48 != last_pn->pn48 + 1)
-+			return false;
-+
-+		last_pn->pn48 = new_pn.pn48;
-+	}
-+
-+	return true;
-+}
-+
- static void ath10k_htt_rx_h_mpdu(struct ath10k *ar,
- 				 struct sk_buff_head *amsdu,
- 				 struct ieee80211_rx_status *status,
- 				 bool fill_crypt_header,
- 				 u8 *rx_hdr,
--				 enum ath10k_pkt_rx_err *err)
-+				 enum ath10k_pkt_rx_err *err,
-+				 u16 peer_id,
-+				 bool frag)
- {
- 	struct sk_buff *first;
- 	struct sk_buff *last;
--	struct sk_buff *msdu;
-+	struct sk_buff *msdu, *temp;
- 	struct htt_rx_desc *rxd;
- 	struct ieee80211_hdr *hdr;
- 	enum htt_rx_mpdu_encrypt_type enctype;
-@@ -1768,6 +1839,7 @@ static void ath10k_htt_rx_h_mpdu(struct
- 	bool is_decrypted;
- 	bool is_mgmt;
- 	u32 attention;
-+	bool frag_pn_check = true;
- 
- 	if (skb_queue_empty(amsdu))
- 		return;
-@@ -1866,6 +1938,24 @@ static void ath10k_htt_rx_h_mpdu(struct
- 	}
- 
- 	skb_queue_walk(amsdu, msdu) {
-+		if (frag && !fill_crypt_header && is_decrypted &&
-+		    enctype == HTT_RX_MPDU_ENCRYPT_AES_CCM_WPA2)
-+			frag_pn_check = ath10k_htt_rx_h_frag_pn_check(ar,
-+								      msdu,
-+								      peer_id,
-+								      0,
-+								      enctype);
-+
-+		if (!frag_pn_check) {
-+			/* Discard the fragment with invalid PN */
-+			temp = msdu->prev;
-+			__skb_unlink(msdu, amsdu);
-+			dev_kfree_skb_any(msdu);
-+			msdu = temp;
-+			frag_pn_check = true;
-+			continue;
-+		}
-+
- 		ath10k_htt_rx_h_csum_offload(msdu);
- 		ath10k_htt_rx_h_undecap(ar, msdu, status, first_hdr, enctype,
- 					is_decrypted);
-@@ -2071,7 +2161,8 @@ static int ath10k_htt_rx_handle_amsdu(st
- 		ath10k_htt_rx_h_unchain(ar, &amsdu, &drop_cnt, &unchain_cnt);
- 
- 	ath10k_htt_rx_h_filter(ar, &amsdu, rx_status, &drop_cnt_filter);
--	ath10k_htt_rx_h_mpdu(ar, &amsdu, rx_status, true, first_hdr, &err);
-+	ath10k_htt_rx_h_mpdu(ar, &amsdu, rx_status, true, first_hdr, &err, 0,
-+			     false);
- 	msdus_to_queue = skb_queue_len(&amsdu);
- 	ath10k_htt_rx_h_enqueue(ar, &amsdu, rx_status);
- 
-@@ -3027,7 +3118,7 @@ static int ath10k_htt_rx_in_ord_ind(stru
- 			ath10k_htt_rx_h_ppdu(ar, &amsdu, status, vdev_id);
- 			ath10k_htt_rx_h_filter(ar, &amsdu, status, NULL);
- 			ath10k_htt_rx_h_mpdu(ar, &amsdu, status, false, NULL,
--					     NULL);
-+					     NULL, peer_id, frag);
- 			ath10k_htt_rx_h_enqueue(ar, &amsdu, status);
- 			break;
- 		case -EAGAIN:
diff --git a/package/kernel/mac80211/patches/ath/301-ath10k-drop-fragments-with-multicast-DA-for-PCIe.patch b/package/kernel/mac80211/patches/ath/301-ath10k-drop-fragments-with-multicast-DA-for-PCIe.patch
deleted file mode 100644
index 7288c66612..0000000000
--- a/package/kernel/mac80211/patches/ath/301-ath10k-drop-fragments-with-multicast-DA-for-PCIe.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From: Wen Gong <wgong at codeaurora.org>
-Date: Tue, 11 May 2021 20:02:53 +0200
-Subject: [PATCH] ath10k: drop fragments with multicast DA for PCIe
-
-Fragmentation is not used with multicast frames. Discard unexpected
-fragments with multicast DA. This fixes CVE-2020-26145.
-
-Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Wen Gong <wgong at codeaurora.org>
-Signed-off-by: Jouni Malinen <jouni at codeaurora.org>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/drivers/net/wireless/ath/ath10k/htt_rx.c
-+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
-@@ -1768,6 +1768,16 @@ static u64 ath10k_htt_rx_h_get_pn(struct
- 	return pn;
- }
- 
-+static bool ath10k_htt_rx_h_frag_multicast_check(struct ath10k *ar,
-+						 struct sk_buff *skb,
-+						 u16 offset)
-+{
-+	struct ieee80211_hdr *hdr;
-+
-+	hdr = (struct ieee80211_hdr *)(skb->data + offset);
-+	return !is_multicast_ether_addr(hdr->addr1);
-+}
-+
- static bool ath10k_htt_rx_h_frag_pn_check(struct ath10k *ar,
- 					  struct sk_buff *skb,
- 					  u16 peer_id,
-@@ -1839,7 +1849,7 @@ static void ath10k_htt_rx_h_mpdu(struct
- 	bool is_decrypted;
- 	bool is_mgmt;
- 	u32 attention;
--	bool frag_pn_check = true;
-+	bool frag_pn_check = true, multicast_check = true;
- 
- 	if (skb_queue_empty(amsdu))
- 		return;
-@@ -1946,13 +1956,20 @@ static void ath10k_htt_rx_h_mpdu(struct
- 								      0,
- 								      enctype);
- 
--		if (!frag_pn_check) {
--			/* Discard the fragment with invalid PN */
-+		if (frag)
-+			multicast_check = ath10k_htt_rx_h_frag_multicast_check(ar,
-+									       msdu,
-+									       0);
-+
-+		if (!frag_pn_check || !multicast_check) {
-+			/* Discard the fragment with invalid PN or multicast DA
-+			 */
- 			temp = msdu->prev;
- 			__skb_unlink(msdu, amsdu);
- 			dev_kfree_skb_any(msdu);
- 			msdu = temp;
- 			frag_pn_check = true;
-+			multicast_check = true;
- 			continue;
- 		}
- 
diff --git a/package/kernel/mac80211/patches/ath/302-ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch b/package/kernel/mac80211/patches/ath/302-ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch
deleted file mode 100644
index 85d9ce65e2..0000000000
--- a/package/kernel/mac80211/patches/ath/302-ath10k-drop-fragments-with-multicast-DA-for-SDIO.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From: Wen Gong <wgong at codeaurora.org>
-Date: Tue, 11 May 2021 20:02:54 +0200
-Subject: [PATCH] ath10k: drop fragments with multicast DA for SDIO
-
-Fragmentation is not used with multicast frames. Discard unexpected
-fragments with multicast DA. This fixes CVE-2020-26145.
-
-Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00049
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Wen Gong <wgong at codeaurora.org>
-Signed-off-by: Jouni Malinen <jouni at codeaurora.org>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/drivers/net/wireless/ath/ath10k/htt_rx.c
-+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
-@@ -2617,6 +2617,13 @@ static bool ath10k_htt_rx_proc_rx_frag_i
- 	rx_desc = (struct htt_hl_rx_desc *)(skb->data + tot_hdr_len);
- 	rx_desc_info = __le32_to_cpu(rx_desc->info);
- 
-+	hdr = (struct ieee80211_hdr *)((u8 *)rx_desc + rx_hl->fw_desc.len);
-+
-+	if (is_multicast_ether_addr(hdr->addr1)) {
-+		/* Discard the fragment with multicast DA */
-+		goto err;
-+	}
-+
- 	if (!MS(rx_desc_info, HTT_RX_DESC_HL_INFO_ENCRYPTED)) {
- 		spin_unlock_bh(&ar->data_lock);
- 		return ath10k_htt_rx_proc_rx_ind_hl(htt, &resp->rx_ind_hl, skb,
-@@ -2624,8 +2631,6 @@ static bool ath10k_htt_rx_proc_rx_frag_i
- 						    HTT_RX_NON_TKIP_MIC);
- 	}
- 
--	hdr = (struct ieee80211_hdr *)((u8 *)rx_desc + rx_hl->fw_desc.len);
--
- 	if (ieee80211_has_retry(hdr->frame_control))
- 		goto err;
- 
diff --git a/package/kernel/mac80211/patches/ath/303-ath10k-drop-MPDU-which-has-discard-flag-set-by-firmw.patch b/package/kernel/mac80211/patches/ath/303-ath10k-drop-MPDU-which-has-discard-flag-set-by-firmw.patch
deleted file mode 100644
index 03bce4231b..0000000000
--- a/package/kernel/mac80211/patches/ath/303-ath10k-drop-MPDU-which-has-discard-flag-set-by-firmw.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From: Wen Gong <wgong at codeaurora.org>
-Date: Tue, 11 May 2021 20:02:55 +0200
-Subject: [PATCH] ath10k: drop MPDU which has discard flag set by firmware
- for SDIO
-
-When the discard flag is set by the firmware for an MPDU, it should be
-dropped. This allows a mitigation for CVE-2020-24588 to be implemented
-in the firmware.
-
-Tested-on: QCA6174 hw3.2 SDIO WLAN.RMH.4.4.1-00049
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Wen Gong <wgong at codeaurora.org>
-Signed-off-by: Jouni Malinen <jouni at codeaurora.org>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/drivers/net/wireless/ath/ath10k/htt_rx.c
-+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
-@@ -2312,6 +2312,11 @@ static bool ath10k_htt_rx_proc_rx_ind_hl
- 	fw_desc = &rx->fw_desc;
- 	rx_desc_len = fw_desc->len;
- 
-+	if (fw_desc->u.bits.discard) {
-+		ath10k_dbg(ar, ATH10K_DBG_HTT, "htt discard mpdu\n");
-+		goto err;
-+	}
-+
- 	/* I have not yet seen any case where num_mpdu_ranges > 1.
- 	 * qcacld does not seem handle that case either, so we introduce the
- 	 * same limitiation here as well.
---- a/drivers/net/wireless/ath/ath10k/rx_desc.h
-+++ b/drivers/net/wireless/ath/ath10k/rx_desc.h
-@@ -1282,7 +1282,19 @@ struct fw_rx_desc_base {
- #define FW_RX_DESC_UDP              (1 << 6)
- 
- struct fw_rx_desc_hl {
--	u8 info0;
-+	union {
-+		struct {
-+		u8 discard:1,
-+		   forward:1,
-+		   any_err:1,
-+		   dup_err:1,
-+		   reserved:1,
-+		   inspect:1,
-+		   extension:2;
-+		} bits;
-+		u8 info0;
-+	} u;
-+
- 	u8 version;
- 	u8 len;
- 	u8 flags;
diff --git a/package/kernel/mac80211/patches/ath/304-ath10k-Fix-TKIP-Michael-MIC-verification-for-PCIe.patch b/package/kernel/mac80211/patches/ath/304-ath10k-Fix-TKIP-Michael-MIC-verification-for-PCIe.patch
deleted file mode 100644
index da9d6802bd..0000000000
--- a/package/kernel/mac80211/patches/ath/304-ath10k-Fix-TKIP-Michael-MIC-verification-for-PCIe.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From: Wen Gong <wgong at codeaurora.org>
-Date: Tue, 11 May 2021 20:02:56 +0200
-Subject: [PATCH] ath10k: Fix TKIP Michael MIC verification for PCIe
-
-TKIP Michael MIC was not verified properly for PCIe cases since the
-validation steps in ieee80211_rx_h_michael_mic_verify() in mac80211 did
-not get fully executed due to unexpected flag values in
-ieee80211_rx_status.
-
-Fix this by setting the flags property to meet mac80211 expectations for
-performing Michael MIC validation there. This fixes CVE-2020-26141. It
-does the same as ath10k_htt_rx_proc_rx_ind_hl() for SDIO which passed
-MIC verification case. This applies only to QCA6174/QCA9377 PCIe.
-
-Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Wen Gong <wgong at codeaurora.org>
-Signed-off-by: Jouni Malinen <jouni at codeaurora.org>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/drivers/net/wireless/ath/ath10k/htt_rx.c
-+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
-@@ -1974,6 +1974,11 @@ static void ath10k_htt_rx_h_mpdu(struct
- 		}
- 
- 		ath10k_htt_rx_h_csum_offload(msdu);
-+
-+		if (frag && !fill_crypt_header &&
-+		    enctype == HTT_RX_MPDU_ENCRYPT_TKIP_WPA)
-+			status->flag &= ~RX_FLAG_MMIC_STRIPPED;
-+
- 		ath10k_htt_rx_h_undecap(ar, msdu, status, first_hdr, enctype,
- 					is_decrypted);
- 
-@@ -1991,6 +1996,11 @@ static void ath10k_htt_rx_h_mpdu(struct
- 
- 		hdr = (void *)msdu->data;
- 		hdr->frame_control &= ~__cpu_to_le16(IEEE80211_FCTL_PROTECTED);
-+
-+		if (frag && !fill_crypt_header &&
-+		    enctype == HTT_RX_MPDU_ENCRYPT_TKIP_WPA)
-+			status->flag &= ~RX_FLAG_IV_STRIPPED &
-+					~RX_FLAG_MMIC_STRIPPED;
- 	}
- }
- 
diff --git a/package/kernel/mac80211/patches/ath/305-ath10k-Validate-first-subframe-of-A-MSDU-before-proc.patch b/package/kernel/mac80211/patches/ath/305-ath10k-Validate-first-subframe-of-A-MSDU-before-proc.patch
deleted file mode 100644
index 0bdbed78d5..0000000000
--- a/package/kernel/mac80211/patches/ath/305-ath10k-Validate-first-subframe-of-A-MSDU-before-proc.patch
+++ /dev/null
@@ -1,109 +0,0 @@
-From: Sriram R <srirrama at codeaurora.org>
-Date: Tue, 11 May 2021 20:02:57 +0200
-Subject: [PATCH] ath10k: Validate first subframe of A-MSDU before
- processing the list
-
-In certain scenarios a normal MSDU can be received as an A-MSDU when
-the A-MSDU present bit of a QoS header gets flipped during reception.
-Since this bit is unauthenticated, the hardware crypto engine can pass
-the frame to the driver without any error indication.
-
-This could result in processing unintended subframes collected in the
-A-MSDU list. Hence, validate A-MSDU list by checking if the first frame
-has a valid subframe header.
-
-Comparing the non-aggregated MSDU and an A-MSDU, the fields of the first
-subframe DA matches the LLC/SNAP header fields of a normal MSDU.
-In order to avoid processing such frames, add a validation to
-filter such A-MSDU frames where the first subframe header DA matches
-with the LLC/SNAP header pattern.
-
-Tested-on: QCA9984 hw1.0 PCI 10.4-3.10-00047
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Sriram R <srirrama at codeaurora.org>
-Signed-off-by: Jouni Malinen <jouni at codeaurora.org>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/drivers/net/wireless/ath/ath10k/htt_rx.c
-+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
-@@ -2108,14 +2108,62 @@ static void ath10k_htt_rx_h_unchain(stru
- 	ath10k_unchain_msdu(amsdu, unchain_cnt);
- }
- 
-+static bool ath10k_htt_rx_validate_amsdu(struct ath10k *ar,
-+					 struct sk_buff_head *amsdu)
-+{
-+	u8 *subframe_hdr;
-+	struct sk_buff *first;
-+	bool is_first, is_last;
-+	struct htt_rx_desc *rxd;
-+	struct ieee80211_hdr *hdr;
-+	size_t hdr_len, crypto_len;
-+	enum htt_rx_mpdu_encrypt_type enctype;
-+	int bytes_aligned = ar->hw_params.decap_align_bytes;
-+
-+	first = skb_peek(amsdu);
-+
-+	rxd = (void *)first->data - sizeof(*rxd);
-+	hdr = (void *)rxd->rx_hdr_status;
-+
-+	is_first = !!(rxd->msdu_end.common.info0 &
-+		      __cpu_to_le32(RX_MSDU_END_INFO0_FIRST_MSDU));
-+	is_last = !!(rxd->msdu_end.common.info0 &
-+		     __cpu_to_le32(RX_MSDU_END_INFO0_LAST_MSDU));
-+
-+	/* Return in case of non-aggregated msdu */
-+	if (is_first && is_last)
-+		return true;
-+
-+	/* First msdu flag is not set for the first msdu of the list */
-+	if (!is_first)
-+		return false;
-+
-+	enctype = MS(__le32_to_cpu(rxd->mpdu_start.info0),
-+		     RX_MPDU_START_INFO0_ENCRYPT_TYPE);
-+
-+	hdr_len = ieee80211_hdrlen(hdr->frame_control);
-+	crypto_len = ath10k_htt_rx_crypto_param_len(ar, enctype);
-+
-+	subframe_hdr = (u8 *)hdr + round_up(hdr_len, bytes_aligned) +
-+		       crypto_len;
-+
-+	/* Validate if the amsdu has a proper first subframe.
-+	 * There are chances a single msdu can be received as amsdu when
-+	 * the unauthenticated amsdu flag of a QoS header
-+	 * gets flipped in non-SPP AMSDU's, in such cases the first
-+	 * subframe has llc/snap header in place of a valid da.
-+	 * return false if the da matches rfc1042 pattern
-+	 */
-+	if (ether_addr_equal(subframe_hdr, rfc1042_header))
-+		return false;
-+
-+	return true;
-+}
-+
- static bool ath10k_htt_rx_amsdu_allowed(struct ath10k *ar,
- 					struct sk_buff_head *amsdu,
- 					struct ieee80211_rx_status *rx_status)
- {
--	/* FIXME: It might be a good idea to do some fuzzy-testing to drop
--	 * invalid/dangerous frames.
--	 */
--
- 	if (!rx_status->freq) {
- 		ath10k_dbg(ar, ATH10K_DBG_HTT, "no channel configured; ignoring frame(s)!\n");
- 		return false;
-@@ -2126,6 +2174,11 @@ static bool ath10k_htt_rx_amsdu_allowed(
- 		return false;
- 	}
- 
-+	if (!ath10k_htt_rx_validate_amsdu(ar, amsdu)) {
-+		ath10k_dbg(ar, ATH10K_DBG_HTT, "invalid amsdu received\n");
-+		return false;
-+	}
-+
- 	return true;
- }
- 
diff --git a/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch b/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch
index 3c9180b113..bf87d3551a 100644
--- a/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch
+++ b/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch
@@ -82,7 +82,7 @@
  	help
 --- a/local-symbols
 +++ b/local-symbols
-@@ -86,6 +86,7 @@ ADM8211=
+@@ -85,6 +85,7 @@ ADM8211=
  ATH_COMMON=
  WLAN_VENDOR_ATH=
  ATH_DEBUG=
diff --git a/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch b/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch
index cd2bdbf1a0..acb9ad443c 100644
--- a/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch
+++ b/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch
@@ -371,7 +371,7 @@
  
 --- a/local-symbols
 +++ b/local-symbols
-@@ -113,6 +113,7 @@ ATH9K_WOW=
+@@ -112,6 +112,7 @@ ATH9K_WOW=
  ATH9K_RFKILL=
  ATH9K_CHANNEL_CONTEXT=
  ATH9K_PCOEM=
diff --git a/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
index 5e74687826..ce8effe3c3 100644
--- a/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
+++ b/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
@@ -114,7 +114,7 @@ v13:
  ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o
 --- a/local-symbols
 +++ b/local-symbols
-@@ -146,6 +146,7 @@ ATH10K_DEBUG=
+@@ -145,6 +145,7 @@ ATH10K_DEBUG=
  ATH10K_DEBUGFS=
  ATH10K_SPECTRAL=
  ATH10K_THERMAL=
@@ -456,7 +456,7 @@ v13:
  {
 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
 +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
-@@ -4591,6 +4591,8 @@ static const struct wmi_ops wmi_tlv_ops
+@@ -4594,6 +4594,8 @@ static const struct wmi_ops wmi_tlv_ops
  	.gen_echo = ath10k_wmi_tlv_op_gen_echo,
  	.gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf,
  	.gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable,
diff --git a/package/kernel/mac80211/patches/brcm/860-brcmfmac-register-wiphy-s-during-module_init.patch b/package/kernel/mac80211/patches/brcm/860-brcmfmac-register-wiphy-s-during-module_init.patch
index dc2295db1b..c9730e29fd 100644
--- a/package/kernel/mac80211/patches/brcm/860-brcmfmac-register-wiphy-s-during-module_init.patch
+++ b/package/kernel/mac80211/patches/brcm/860-brcmfmac-register-wiphy-s-during-module_init.patch
@@ -11,16 +11,6 @@ module loads successfully.
 Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
 ---
 
---- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -1557,6 +1557,7 @@ int __init brcmf_core_init(void)
- {
- 	if (!schedule_work(&brcmf_driver_work))
- 		return -EBUSY;
-+	flush_work(&brcmf_driver_work);
- 
- 	return 0;
- }
 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c
 @@ -431,6 +431,7 @@ struct brcmf_fw {
diff --git a/package/kernel/mac80211/patches/build/001-fix_build.patch b/package/kernel/mac80211/patches/build/001-fix_build.patch
index e57ca190e4..8f63d36e2e 100644
--- a/package/kernel/mac80211/patches/build/001-fix_build.patch
+++ b/package/kernel/mac80211/patches/build/001-fix_build.patch
@@ -55,8 +55,8 @@
 -				echo ""							;\
 -			done								\
 -		) > Kconfig.kernel							;\
--		kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) kernelversion |	\
--			sed 's/^\(\([3-5]\|2\.6\)\.[0-9]\+\).*/\1/;t;d')		;\
+-		kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) M=$(BACKPORT_DIR)	\
+-			kernelversion |	sed 's/^\(\([3-5]\|2\.6\)\.[0-9]\+\).*/\1/;t;d');\
 -		test "$$kver" != "" || echo "Kernel version parse failed!"		;\
 -		test "$$kver" != ""							;\
 -		kvers="$$(seq 14 39 | sed 's/^/2.6./')"					;\
@@ -112,8 +112,8 @@
 +	@echo " done."
 +
 +Kconfig.versions: Kconfig.kernel
-+	@kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) kernelversion |	\
-+		sed 's/^\(\([3-5]\|2\.6\)\.[0-9]\+\).*/\1/;t;d')		;\
++	@kver=$$($(MAKE) --no-print-directory -C $(KLIB_BUILD) M=$(BACKPORT_DIR) \
++		kernelversion |	sed 's/^\(\([3-5]\|2\.6\)\.[0-9]\+\).*/\1/;t;d');\
 +	test "$$kver" != "" || echo "Kernel version parse failed!"		;\
 +	test "$$kver" != ""							;\
 +	kvers="$$(seq 14 39 | sed 's/^/2.6./')"					;\
diff --git a/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch b/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch
index cfa40e1bd2..d358cfe367 100644
--- a/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch
+++ b/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/marvell/mwl8k.c
 +++ b/drivers/net/wireless/marvell/mwl8k.c
-@@ -5694,6 +5694,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
+@@ -5695,6 +5695,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
  MODULE_FIRMWARE(MWL8K_8366_AP_FW(MWL8K_8366_AP_FW_API));
  
  static const struct pci_device_id mwl8k_pci_id_table[] = {
diff --git a/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch
index f3130f7ae7..a35cf1875a 100644
--- a/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch
+++ b/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/marvell/mwl8k.c
 +++ b/drivers/net/wireless/marvell/mwl8k.c
-@@ -6279,6 +6279,8 @@ static int mwl8k_probe(struct pci_dev *p
+@@ -6280,6 +6280,8 @@ static int mwl8k_probe(struct pci_dev *p
  
  	priv->running_bsses = 0;
  
@@ -9,7 +9,7 @@
  	return rc;
  
  err_stop_firmware:
-@@ -6312,8 +6314,6 @@ static void mwl8k_remove(struct pci_dev
+@@ -6313,8 +6315,6 @@ static void mwl8k_remove(struct pci_dev
  		return;
  	priv = hw->priv;
  
diff --git a/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch b/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch
index 1c52132da6..e74d9a9aa0 100644
--- a/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch
+++ b/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch
@@ -1,6 +1,6 @@
 --- a/local-symbols
 +++ b/local-symbols
-@@ -333,6 +333,7 @@ RT2X00_LIB_FIRMWARE=
+@@ -332,6 +332,7 @@ RT2X00_LIB_FIRMWARE=
  RT2X00_LIB_CRYPTO=
  RT2X00_LIB_LEDS=
  RT2X00_LIB_DEBUGFS=
diff --git a/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch b/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch
index ec6ecbcfce..ca02dfb06f 100644
--- a/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch
+++ b/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch
@@ -379,7 +379,7 @@
  #endif /* AES_GCM_H */
 --- a/net/mac80211/wpa.c
 +++ b/net/mac80211/wpa.c
-@@ -311,7 +311,8 @@ ieee80211_crypto_tkip_decrypt(struct iee
+@@ -312,7 +312,8 @@ ieee80211_crypto_tkip_decrypt(struct iee
  }
  
  
@@ -389,7 +389,7 @@
  {
  	__le16 mask_fc;
  	int a4_included, mgmt;
-@@ -341,14 +342,8 @@ static void ccmp_special_blocks(struct s
+@@ -342,14 +343,8 @@ static void ccmp_special_blocks(struct s
  	else
  		qos_tid = 0;
  
@@ -406,7 +406,7 @@
  
  	/* Nonce: Nonce Flags | A2 | PN
  	 * Nonce Flags: Priority (b0..b3) | Management (b4) | Reserved (b5..b7)
-@@ -356,6 +351,8 @@ static void ccmp_special_blocks(struct s
+@@ -357,6 +352,8 @@ static void ccmp_special_blocks(struct s
  	b_0[1] = qos_tid | (mgmt << 4);
  	memcpy(&b_0[2], hdr->addr2, ETH_ALEN);
  	memcpy(&b_0[8], pn, IEEE80211_CCMP_PN_LEN);
@@ -415,7 +415,7 @@
  
  	/* AAD (extra authenticate-only data) / masked 802.11 header
  	 * FC | A1 | A2 | A3 | SC | [A4] | [QC] */
-@@ -412,7 +409,7 @@ static int ccmp_encrypt_skb(struct ieee8
+@@ -413,7 +410,7 @@ static int ccmp_encrypt_skb(struct ieee8
  	u8 *pos;
  	u8 pn[6];
  	u64 pn64;
@@ -424,7 +424,7 @@
  	u8 b_0[AES_BLOCK_SIZE];
  
  	if (info->control.hw_key &&
-@@ -467,9 +464,11 @@ static int ccmp_encrypt_skb(struct ieee8
+@@ -468,9 +465,11 @@ static int ccmp_encrypt_skb(struct ieee8
  		return 0;
  
  	pos += IEEE80211_CCMP_HDR_LEN;
@@ -439,7 +439,7 @@
  }
  
  
-@@ -542,13 +541,13 @@ ieee80211_crypto_ccmp_decrypt(struct iee
+@@ -543,13 +542,13 @@ ieee80211_crypto_ccmp_decrypt(struct iee
  			u8 aad[2 * AES_BLOCK_SIZE];
  			u8 b_0[AES_BLOCK_SIZE];
  			/* hardware didn't decrypt/verify MIC */
@@ -455,7 +455,7 @@
  				return RX_DROP_UNUSABLE;
  		}
  
-@@ -643,7 +642,7 @@ static int gcmp_encrypt_skb(struct ieee8
+@@ -646,7 +645,7 @@ static int gcmp_encrypt_skb(struct ieee8
  	u8 *pos;
  	u8 pn[6];
  	u64 pn64;
@@ -464,7 +464,7 @@
  	u8 j_0[AES_BLOCK_SIZE];
  
  	if (info->control.hw_key &&
-@@ -700,8 +699,10 @@ static int gcmp_encrypt_skb(struct ieee8
+@@ -703,8 +702,10 @@ static int gcmp_encrypt_skb(struct ieee8
  
  	pos += IEEE80211_GCMP_HDR_LEN;
  	gcmp_special_blocks(skb, pn, j_0, aad);
@@ -477,7 +477,7 @@
  }
  
  ieee80211_tx_result
-@@ -1128,9 +1129,9 @@ ieee80211_crypto_aes_gmac_encrypt(struct
+@@ -1133,9 +1134,9 @@ ieee80211_crypto_aes_gmac_encrypt(struct
  	struct ieee80211_key *key = tx->key;
  	struct ieee80211_mmie_16 *mmie;
  	struct ieee80211_hdr *hdr;
@@ -489,7 +489,7 @@
  
  	if (WARN_ON(skb_queue_len(&tx->skbs) != 1))
  		return TX_DROP;
-@@ -1176,7 +1177,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct
+@@ -1181,7 +1182,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct
  	struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
  	struct ieee80211_key *key = rx->key;
  	struct ieee80211_mmie_16 *mmie;
diff --git a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch
index 9589235f71..8d086625e4 100644
--- a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch
+++ b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch
@@ -18,7 +18,7 @@
  static int ieee80211_ifa6_changed(struct notifier_block *nb,
  				  unsigned long data, void *arg)
  {
-@@ -1312,14 +1312,14 @@ int ieee80211_register_hw(struct ieee802
+@@ -1315,14 +1315,14 @@ int ieee80211_register_hw(struct ieee802
  
  	rtnl_unlock();
  
@@ -35,7 +35,7 @@
  	local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed;
  	result = register_inet6addr_notifier(&local->ifa6_notifier);
  	if (result)
-@@ -1328,13 +1328,13 @@ int ieee80211_register_hw(struct ieee802
+@@ -1331,13 +1331,13 @@ int ieee80211_register_hw(struct ieee802
  
  	return 0;
  
@@ -52,7 +52,7 @@
   fail_ifa:
  #endif
  	wiphy_unregister(local->hw.wiphy);
-@@ -1362,10 +1362,10 @@ void ieee80211_unregister_hw(struct ieee
+@@ -1365,10 +1365,10 @@ void ieee80211_unregister_hw(struct ieee
  	tasklet_kill(&local->tx_pending_tasklet);
  	tasklet_kill(&local->tasklet);
  
diff --git a/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch b/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch
index cbc2a2e03d..7c442429cf 100644
--- a/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch
+++ b/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch
@@ -55,7 +55,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	__NL80211_ATTR_AFTER_LAST,
 --- a/net/mac80211/mlme.c
 +++ b/net/mac80211/mlme.c
-@@ -2729,7 +2729,7 @@ static void ieee80211_report_disconnect(
+@@ -2734,7 +2734,7 @@ static void ieee80211_report_disconnect(
  	};
  
  	if (tx)
@@ -64,7 +64,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	else
  		cfg80211_rx_mlme_mgmt(sdata->dev, buf, len);
  
-@@ -4719,7 +4719,8 @@ void ieee80211_mgd_quiesce(struct ieee80
+@@ -4724,7 +4724,8 @@ void ieee80211_mgd_quiesce(struct ieee80
  		if (ifmgd->auth_data)
  			ieee80211_destroy_auth_data(sdata, false);
  		cfg80211_tx_mlme_mgmt(sdata->dev, frame_buf,
diff --git a/package/kernel/mac80211/patches/subsys/301-mac80211-support-driver-based-disconnect-with-reconn.patch b/package/kernel/mac80211/patches/subsys/301-mac80211-support-driver-based-disconnect-with-reconn.patch
index 59a154a543..31621ebf11 100644
--- a/package/kernel/mac80211/patches/subsys/301-mac80211-support-driver-based-disconnect-with-reconn.patch
+++ b/package/kernel/mac80211/patches/subsys/301-mac80211-support-driver-based-disconnect-with-reconn.patch
@@ -34,7 +34,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
   * @vif: &struct ieee80211_vif pointer from the add_interface callback.
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -461,7 +461,9 @@ struct ieee80211_if_managed {
+@@ -450,7 +450,9 @@ struct ieee80211_if_managed {
  	unsigned long probe_timeout;
  	int probe_send_count;
  	bool nullfunc_failed;
@@ -47,7 +47,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	struct ieee80211_mgd_auth_data *auth_data;
 --- a/net/mac80211/mlme.c
 +++ b/net/mac80211/mlme.c
-@@ -2720,7 +2720,7 @@ EXPORT_SYMBOL(ieee80211_ap_probereq_get)
+@@ -2725,7 +2725,7 @@ EXPORT_SYMBOL(ieee80211_ap_probereq_get)
  
  static void ieee80211_report_disconnect(struct ieee80211_sub_if_data *sdata,
  					const u8 *buf, size_t len, bool tx,
@@ -56,7 +56,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  {
  	struct ieee80211_event event = {
  		.type = MLME_EVENT,
-@@ -2729,7 +2729,7 @@ static void ieee80211_report_disconnect(
+@@ -2734,7 +2734,7 @@ static void ieee80211_report_disconnect(
  	};
  
  	if (tx)
@@ -65,7 +65,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	else
  		cfg80211_rx_mlme_mgmt(sdata->dev, buf, len);
  
-@@ -2751,13 +2751,18 @@ static void __ieee80211_disconnect(struc
+@@ -2756,13 +2756,18 @@ static void __ieee80211_disconnect(struc
  
  	tx = !sdata->csa_block_tx;
  
@@ -89,7 +89,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  			       tx, frame_buf);
  	mutex_lock(&local->mtx);
  	sdata->vif.csa_active = false;
-@@ -2770,7 +2775,9 @@ static void __ieee80211_disconnect(struc
+@@ -2775,7 +2780,9 @@ static void __ieee80211_disconnect(struc
  	mutex_unlock(&local->mtx);
  
  	ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), tx,
@@ -100,7 +100,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  
  	sdata_unlock(sdata);
  }
-@@ -2789,6 +2796,13 @@ static void ieee80211_beacon_connection_
+@@ -2794,6 +2801,13 @@ static void ieee80211_beacon_connection_
  		sdata_info(sdata, "Connection to AP %pM lost\n",
  			   ifmgd->bssid);
  		__ieee80211_disconnect(sdata);
@@ -114,7 +114,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	} else {
  		ieee80211_mgd_probe_ap(sdata, true);
  	}
-@@ -2827,6 +2841,21 @@ void ieee80211_connection_loss(struct ie
+@@ -2832,6 +2846,21 @@ void ieee80211_connection_loss(struct ie
  }
  EXPORT_SYMBOL(ieee80211_connection_loss);
  
@@ -136,7 +136,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  
  static void ieee80211_destroy_auth_data(struct ieee80211_sub_if_data *sdata,
  					bool assoc)
-@@ -3130,7 +3159,7 @@ static void ieee80211_rx_mgmt_deauth(str
+@@ -3135,7 +3164,7 @@ static void ieee80211_rx_mgmt_deauth(str
  		ieee80211_set_disassoc(sdata, 0, 0, false, NULL);
  
  		ieee80211_report_disconnect(sdata, (u8 *)mgmt, len, false,
@@ -145,7 +145,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  		return;
  	}
  
-@@ -3179,7 +3208,8 @@ static void ieee80211_rx_mgmt_disassoc(s
+@@ -3184,7 +3213,8 @@ static void ieee80211_rx_mgmt_disassoc(s
  
  	ieee80211_set_disassoc(sdata, 0, 0, false, NULL);
  
@@ -155,7 +155,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  }
  
  static void ieee80211_get_rates(struct ieee80211_supported_band *sband,
-@@ -4199,7 +4229,8 @@ static void ieee80211_rx_mgmt_beacon(str
+@@ -4204,7 +4234,8 @@ static void ieee80211_rx_mgmt_beacon(str
  				       true, deauth_buf);
  		ieee80211_report_disconnect(sdata, deauth_buf,
  					    sizeof(deauth_buf), true,
@@ -165,7 +165,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  		return;
  	}
  
-@@ -4344,7 +4375,7 @@ static void ieee80211_sta_connection_los
+@@ -4349,7 +4380,7 @@ static void ieee80211_sta_connection_los
  			       tx, frame_buf);
  
  	ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), true,
@@ -174,7 +174,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  }
  
  static int ieee80211_auth(struct ieee80211_sub_if_data *sdata)
-@@ -5434,7 +5465,8 @@ int ieee80211_mgd_auth(struct ieee80211_
+@@ -5439,7 +5470,8 @@ int ieee80211_mgd_auth(struct ieee80211_
  
  		ieee80211_report_disconnect(sdata, frame_buf,
  					    sizeof(frame_buf), true,
@@ -184,7 +184,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	}
  
  	sdata_info(sdata, "authenticate with %pM\n", req->bss->bssid);
-@@ -5506,7 +5538,8 @@ int ieee80211_mgd_assoc(struct ieee80211
+@@ -5511,7 +5543,8 @@ int ieee80211_mgd_assoc(struct ieee80211
  
  		ieee80211_report_disconnect(sdata, frame_buf,
  					    sizeof(frame_buf), true,
@@ -194,7 +194,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	}
  
  	if (ifmgd->auth_data && !ifmgd->auth_data->done) {
-@@ -5805,7 +5838,7 @@ int ieee80211_mgd_deauth(struct ieee8021
+@@ -5810,7 +5843,7 @@ int ieee80211_mgd_deauth(struct ieee8021
  		ieee80211_destroy_auth_data(sdata, false);
  		ieee80211_report_disconnect(sdata, frame_buf,
  					    sizeof(frame_buf), true,
@@ -203,7 +203,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  
  		return 0;
  	}
-@@ -5825,7 +5858,7 @@ int ieee80211_mgd_deauth(struct ieee8021
+@@ -5830,7 +5863,7 @@ int ieee80211_mgd_deauth(struct ieee8021
  		ieee80211_destroy_assoc_data(sdata, false, true);
  		ieee80211_report_disconnect(sdata, frame_buf,
  					    sizeof(frame_buf), true,
@@ -212,7 +212,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  		return 0;
  	}
  
-@@ -5840,7 +5873,7 @@ int ieee80211_mgd_deauth(struct ieee8021
+@@ -5845,7 +5878,7 @@ int ieee80211_mgd_deauth(struct ieee8021
  				       req->reason_code, tx, frame_buf);
  		ieee80211_report_disconnect(sdata, frame_buf,
  					    sizeof(frame_buf), true,
@@ -221,7 +221,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  		return 0;
  	}
  
-@@ -5873,7 +5906,7 @@ int ieee80211_mgd_disassoc(struct ieee80
+@@ -5878,7 +5911,7 @@ int ieee80211_mgd_disassoc(struct ieee80
  			       frame_buf);
  
  	ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), true,
diff --git a/package/kernel/mac80211/patches/subsys/311-net-fq_impl-drop-get_default_func-move-default-flow-.patch b/package/kernel/mac80211/patches/subsys/311-net-fq_impl-drop-get_default_func-move-default-flow-.patch
index f8748ef123..33dbb5eb90 100644
--- a/package/kernel/mac80211/patches/subsys/311-net-fq_impl-drop-get_default_func-move-default-flow-.patch
+++ b/package/kernel/mac80211/patches/subsys/311-net-fq_impl-drop-get_default_func-move-default-flow-.patch
@@ -68,7 +68,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static int fq_init(struct fq *fq, int flows_cnt)
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -857,7 +857,6 @@ enum txq_info_flags {
+@@ -846,7 +846,6 @@ enum txq_info_flags {
   */
  struct txq_info {
  	struct fq_tin tin;
diff --git a/package/kernel/mac80211/patches/subsys/315-mac80211-add-rx-decapsulation-offload-support.patch b/package/kernel/mac80211/patches/subsys/315-mac80211-add-rx-decapsulation-offload-support.patch
index 09407f3b1d..b8bb2930f5 100644
--- a/package/kernel/mac80211/patches/subsys/315-mac80211-add-rx-decapsulation-offload-support.patch
+++ b/package/kernel/mac80211/patches/subsys/315-mac80211-add-rx-decapsulation-offload-support.patch
@@ -132,7 +132,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #endif /* __MAC80211_DRIVER_OPS */
 --- a/net/mac80211/iface.c
 +++ b/net/mac80211/iface.c
-@@ -839,7 +839,7 @@ static const struct net_device_ops ieee8
+@@ -835,7 +835,7 @@ static const struct net_device_ops ieee8
  
  };
  
@@ -141,7 +141,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  {
  	switch (iftype) {
  	/* P2P GO and client are mapped to AP/STATION types */
-@@ -859,7 +859,7 @@ static bool ieee80211_set_sdata_offload_
+@@ -855,7 +855,7 @@ static bool ieee80211_set_sdata_offload_
  	flags = sdata->vif.offload_flags;
  
  	if (ieee80211_hw_check(&local->hw, SUPPORTS_TX_ENCAP_OFFLOAD) &&
@@ -150,7 +150,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		flags |= IEEE80211_OFFLOAD_ENCAP_ENABLED;
  
  		if (!ieee80211_hw_check(&local->hw, SUPPORTS_TX_FRAG) &&
-@@ -872,10 +872,21 @@ static bool ieee80211_set_sdata_offload_
+@@ -868,10 +868,21 @@ static bool ieee80211_set_sdata_offload_
  		flags &= ~IEEE80211_OFFLOAD_ENCAP_ENABLED;
  	}
  
@@ -172,7 +172,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	return true;
  }
  
-@@ -893,7 +904,7 @@ static void ieee80211_set_vif_encap_ops(
+@@ -889,7 +900,7 @@ static void ieee80211_set_vif_encap_ops(
  	}
  
  	if (!ieee80211_hw_check(&local->hw, SUPPORTS_TX_ENCAP_OFFLOAD) ||
@@ -183,7 +183,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	enabled = bss->vif.offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED;
 --- a/net/mac80211/rx.c
 +++ b/net/mac80211/rx.c
-@@ -4114,7 +4114,9 @@ void ieee80211_check_fast_rx(struct sta_
+@@ -4198,7 +4198,9 @@ void ieee80211_check_fast_rx(struct sta_
  		.vif_type = sdata->vif.type,
  		.control_port_protocol = sdata->control_port_protocol,
  	}, *old, *new = NULL;
@@ -193,7 +193,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	/* use sparse to check that we don't return without updating */
  	__acquire(check_fast_rx);
-@@ -4227,6 +4229,17 @@ void ieee80211_check_fast_rx(struct sta_
+@@ -4311,6 +4313,17 @@ void ieee80211_check_fast_rx(struct sta_
  	if (assign)
  		new = kmemdup(&fastrx, sizeof(fastrx), GFP_KERNEL);
  
@@ -211,7 +211,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	spin_lock_bh(&sta->lock);
  	old = rcu_dereference_protected(sta->fast_rx, true);
  	rcu_assign_pointer(sta->fast_rx, new);
-@@ -4273,6 +4286,108 @@ void ieee80211_check_fast_rx_iface(struc
+@@ -4357,6 +4370,108 @@ void ieee80211_check_fast_rx_iface(struc
  	mutex_unlock(&local->sta_mtx);
  }
  
@@ -320,7 +320,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx,
  				     struct ieee80211_fast_rx *fast_rx)
  {
-@@ -4293,9 +4408,6 @@ static bool ieee80211_invoke_fast_rx(str
+@@ -4377,9 +4492,6 @@ static bool ieee80211_invoke_fast_rx(str
  	} addrs __aligned(2);
  	struct ieee80211_sta_rx_stats *stats = &sta->rx_stats;
  
@@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	/* for parallel-rx, we need to have DUP_VALIDATED, otherwise we write
  	 * to a common data structure; drivers can implement that per queue
  	 * but we don't have that information in mac80211
-@@ -4369,32 +4481,6 @@ static bool ieee80211_invoke_fast_rx(str
+@@ -4453,32 +4565,6 @@ static bool ieee80211_invoke_fast_rx(str
  	    pskb_trim(skb, skb->len - fast_rx->icv_len))
  		goto drop;
  
@@ -363,7 +363,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (rx->key && !ieee80211_has_protected(hdr->frame_control))
  		goto drop;
  
-@@ -4406,12 +4492,6 @@ static bool ieee80211_invoke_fast_rx(str
+@@ -4490,12 +4576,6 @@ static bool ieee80211_invoke_fast_rx(str
  		return true;
  	}
  
@@ -376,7 +376,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	/* do the header conversion - first grab the addresses */
  	ether_addr_copy(addrs.da, skb->data + fast_rx->da_offs);
  	ether_addr_copy(addrs.sa, skb->data + fast_rx->sa_offs);
-@@ -4420,62 +4500,14 @@ static bool ieee80211_invoke_fast_rx(str
+@@ -4504,62 +4584,14 @@ static bool ieee80211_invoke_fast_rx(str
  	/* push the addresses in front */
  	memcpy(skb_push(skb, sizeof(addrs)), &addrs, sizeof(addrs));
  
@@ -443,7 +443,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	stats->dropped++;
  	return true;
  }
-@@ -4529,6 +4561,47 @@ static bool ieee80211_prepare_and_rx_han
+@@ -4613,6 +4645,47 @@ static bool ieee80211_prepare_and_rx_han
  	return true;
  }
  
@@ -491,7 +491,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  /*
   * This is the actual Rx frames handler. as it belongs to Rx path it must
   * be called with rcu_read_lock protection.
-@@ -4766,15 +4839,20 @@ void ieee80211_rx_list(struct ieee80211_
+@@ -4850,15 +4923,20 @@ void ieee80211_rx_list(struct ieee80211_
  	 * if it was previously present.
  	 * Also, frames with less than 16 bytes are dropped.
  	 */
diff --git a/package/kernel/mac80211/patches/subsys/373-mac80211-support-Rx-timestamp-calculation-for-all-pr.patch b/package/kernel/mac80211/patches/subsys/373-mac80211-support-Rx-timestamp-calculation-for-all-pr.patch
index c432d77b2e..117fb35fcf 100644
--- a/package/kernel/mac80211/patches/subsys/373-mac80211-support-Rx-timestamp-calculation-for-all-pr.patch
+++ b/package/kernel/mac80211/patches/subsys/373-mac80211-support-Rx-timestamp-calculation-for-all-pr.patch
@@ -15,7 +15,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
 
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -1600,13 +1600,8 @@ ieee80211_have_rx_timestamp(struct ieee8
+@@ -1587,13 +1587,8 @@ ieee80211_have_rx_timestamp(struct ieee8
  {
  	WARN_ON_ONCE(status->flag & RX_FLAG_MACTIME_START &&
  		     status->flag & RX_FLAG_MACTIME_END);
diff --git a/package/kernel/mac80211/patches/subsys/380-mac80211-assure-all-fragments-are-encrypted.patch b/package/kernel/mac80211/patches/subsys/380-mac80211-assure-all-fragments-are-encrypted.patch
deleted file mode 100644
index 69398459f1..0000000000
--- a/package/kernel/mac80211/patches/subsys/380-mac80211-assure-all-fragments-are-encrypted.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From: Mathy Vanhoef <Mathy.Vanhoef at kuleuven.be>
-Date: Tue, 11 May 2021 20:02:42 +0200
-Subject: [PATCH] mac80211: assure all fragments are encrypted
-
-Do not mix plaintext and encrypted fragments in protected Wi-Fi
-networks. This fixes CVE-2020-26147.
-
-Previously, an attacker was able to first forward a legitimate encrypted
-fragment towards a victim, followed by a plaintext fragment. The
-encrypted and plaintext fragment would then be reassembled. For further
-details see Section 6.3 and Appendix D in the paper "Fragment and Forge:
-Breaking Wi-Fi Through Frame Aggregation and Fragmentation".
-
-Because of this change there are now two equivalent conditions in the
-code to determine if a received fragment requires sequential PNs, so we
-also move this test to a separate function to make the code easier to
-maintain.
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef at kuleuven.be>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -2204,6 +2204,16 @@ ieee80211_reassemble_find(struct ieee802
- 	return NULL;
- }
- 
-+static bool requires_sequential_pn(struct ieee80211_rx_data *rx, __le16 fc)
-+{
-+	return rx->key &&
-+		(rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP ||
-+		 rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP_256 ||
-+		 rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP ||
-+		 rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP_256) &&
-+		ieee80211_has_protected(fc);
-+}
-+
- static ieee80211_rx_result debug_noinline
- ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
- {
-@@ -2248,12 +2258,7 @@ ieee80211_rx_h_defragment(struct ieee802
- 		/* This is the first fragment of a new frame. */
- 		entry = ieee80211_reassemble_add(rx->sdata, frag, seq,
- 						 rx->seqno_idx, &(rx->skb));
--		if (rx->key &&
--		    (rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP ||
--		     rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP_256 ||
--		     rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP ||
--		     rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP_256) &&
--		    ieee80211_has_protected(fc)) {
-+		if (requires_sequential_pn(rx, fc)) {
- 			int queue = rx->security_idx;
- 
- 			/* Store CCMP/GCMP PN so that we can verify that the
-@@ -2295,11 +2300,7 @@ ieee80211_rx_h_defragment(struct ieee802
- 		u8 pn[IEEE80211_CCMP_PN_LEN], *rpn;
- 		int queue;
- 
--		if (!rx->key ||
--		    (rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP &&
--		     rx->key->conf.cipher != WLAN_CIPHER_SUITE_CCMP_256 &&
--		     rx->key->conf.cipher != WLAN_CIPHER_SUITE_GCMP &&
--		     rx->key->conf.cipher != WLAN_CIPHER_SUITE_GCMP_256))
-+		if (!requires_sequential_pn(rx, fc))
- 			return RX_DROP_UNUSABLE;
- 		memcpy(pn, entry->last_pn, IEEE80211_CCMP_PN_LEN);
- 		for (i = IEEE80211_CCMP_PN_LEN - 1; i >= 0; i--) {
diff --git a/package/kernel/mac80211/patches/subsys/381-mac80211-prevent-mixed-key-and-fragment-cache-attack.patch b/package/kernel/mac80211/patches/subsys/381-mac80211-prevent-mixed-key-and-fragment-cache-attack.patch
deleted file mode 100644
index de0f89a5b0..0000000000
--- a/package/kernel/mac80211/patches/subsys/381-mac80211-prevent-mixed-key-and-fragment-cache-attack.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-From: Mathy Vanhoef <Mathy.Vanhoef at kuleuven.be>
-Date: Tue, 11 May 2021 20:02:43 +0200
-Subject: [PATCH] mac80211: prevent mixed key and fragment cache attacks
-
-Simultaneously prevent mixed key attacks (CVE-2020-24587) and fragment
-cache attacks (CVE-2020-24586). This is accomplished by assigning a
-unique color to every key (per interface) and using this to track which
-key was used to decrypt a fragment. When reassembling frames, it is
-now checked whether all fragments were decrypted using the same key.
-
-To assure that fragment cache attacks are also prevented, the ID that is
-assigned to keys is unique even over (re)associations and (re)connects.
-This means fragments separated by a (re)association or (re)connect will
-not be reassembled. Because mac80211 now also prevents the reassembly of
-mixed encrypted and plaintext fragments, all cache attacks are prevented.
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef at kuleuven.be>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/net/mac80211/ieee80211_i.h
-+++ b/net/mac80211/ieee80211_i.h
-@@ -97,6 +97,7 @@ struct ieee80211_fragment_entry {
- 	u8 rx_queue;
- 	bool check_sequential_pn; /* needed for CCMP/GCMP */
- 	u8 last_pn[6]; /* PN of the last fragment if CCMP was used */
-+	unsigned int key_color;
- };
- 
- 
---- a/net/mac80211/key.c
-+++ b/net/mac80211/key.c
-@@ -799,6 +799,7 @@ int ieee80211_key_link(struct ieee80211_
- 		       struct ieee80211_sub_if_data *sdata,
- 		       struct sta_info *sta)
- {
-+	static atomic_t key_color = ATOMIC_INIT(0);
- 	struct ieee80211_key *old_key;
- 	int idx = key->conf.keyidx;
- 	bool pairwise = key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE;
-@@ -850,6 +851,12 @@ int ieee80211_key_link(struct ieee80211_
- 	key->sdata = sdata;
- 	key->sta = sta;
- 
-+	/*
-+	 * Assign a unique ID to every key so we can easily prevent mixed
-+	 * key and fragment cache attacks.
-+	 */
-+	key->color = atomic_inc_return(&key_color);
-+
- 	increment_tailroom_need_count(sdata);
- 
- 	ret = ieee80211_key_replace(sdata, sta, pairwise, old_key, key);
---- a/net/mac80211/key.h
-+++ b/net/mac80211/key.h
-@@ -128,6 +128,8 @@ struct ieee80211_key {
- 	} debugfs;
- #endif
- 
-+	unsigned int color;
-+
- 	/*
- 	 * key config, must be last because it contains key
- 	 * material as variable length member
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -2265,6 +2265,7 @@ ieee80211_rx_h_defragment(struct ieee802
- 			 * next fragment has a sequential PN value.
- 			 */
- 			entry->check_sequential_pn = true;
-+			entry->key_color = rx->key->color;
- 			memcpy(entry->last_pn,
- 			       rx->key->u.ccmp.rx_pn[queue],
- 			       IEEE80211_CCMP_PN_LEN);
-@@ -2302,6 +2303,11 @@ ieee80211_rx_h_defragment(struct ieee802
- 
- 		if (!requires_sequential_pn(rx, fc))
- 			return RX_DROP_UNUSABLE;
-+
-+		/* Prevent mixed key and fragment cache attacks */
-+		if (entry->key_color != rx->key->color)
-+			return RX_DROP_UNUSABLE;
-+
- 		memcpy(pn, entry->last_pn, IEEE80211_CCMP_PN_LEN);
- 		for (i = IEEE80211_CCMP_PN_LEN - 1; i >= 0; i--) {
- 			pn[i]++;
diff --git a/package/kernel/mac80211/patches/subsys/382-mac80211-properly-handle-A-MSDUs-that-start-with-an-.patch b/package/kernel/mac80211/patches/subsys/382-mac80211-properly-handle-A-MSDUs-that-start-with-an-.patch
deleted file mode 100644
index 3fdabde219..0000000000
--- a/package/kernel/mac80211/patches/subsys/382-mac80211-properly-handle-A-MSDUs-that-start-with-an-.patch
+++ /dev/null
@@ -1,66 +0,0 @@
-From: Mathy Vanhoef <Mathy.Vanhoef at kuleuven.be>
-Date: Tue, 11 May 2021 20:02:44 +0200
-Subject: [PATCH] mac80211: properly handle A-MSDUs that start with an
- RFC 1042 header
-
-Properly parse A-MSDUs whose first 6 bytes happen to equal a rfc1042
-header. This can occur in practice when the destination MAC address
-equals AA:AA:03:00:00:00. More importantly, this simplifies the next
-patch to mitigate A-MSDU injection attacks.
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef at kuleuven.be>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/include/net/cfg80211.h
-+++ b/include/net/cfg80211.h
-@@ -5628,7 +5628,7 @@ unsigned int ieee80211_get_mesh_hdrlen(s
-  */
- int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr,
- 				  const u8 *addr, enum nl80211_iftype iftype,
--				  u8 data_offset);
-+				  u8 data_offset, bool is_amsdu);
- 
- /**
-  * ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3
-@@ -5640,7 +5640,7 @@ int ieee80211_data_to_8023_exthdr(struct
- static inline int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr,
- 					 enum nl80211_iftype iftype)
- {
--	return ieee80211_data_to_8023_exthdr(skb, NULL, addr, iftype, 0);
-+	return ieee80211_data_to_8023_exthdr(skb, NULL, addr, iftype, 0, false);
- }
- 
- /**
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -2696,7 +2696,7 @@ __ieee80211_rx_h_amsdu(struct ieee80211_
- 	if (ieee80211_data_to_8023_exthdr(skb, &ethhdr,
- 					  rx->sdata->vif.addr,
- 					  rx->sdata->vif.type,
--					  data_offset))
-+					  data_offset, true))
- 		return RX_DROP_UNUSABLE;
- 
- 	ieee80211_amsdu_to_8023s(skb, &frame_list, dev->dev_addr,
---- a/net/wireless/util.c
-+++ b/net/wireless/util.c
-@@ -541,7 +541,7 @@ EXPORT_SYMBOL(ieee80211_get_mesh_hdrlen)
- 
- int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr,
- 				  const u8 *addr, enum nl80211_iftype iftype,
--				  u8 data_offset)
-+				  u8 data_offset, bool is_amsdu)
- {
- 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
- 	struct {
-@@ -629,7 +629,7 @@ int ieee80211_data_to_8023_exthdr(struct
- 	skb_copy_bits(skb, hdrlen, &payload, sizeof(payload));
- 	tmp.h_proto = payload.proto;
- 
--	if (likely((ether_addr_equal(payload.hdr, rfc1042_header) &&
-+	if (likely((!is_amsdu && ether_addr_equal(payload.hdr, rfc1042_header) &&
- 		    tmp.h_proto != htons(ETH_P_AARP) &&
- 		    tmp.h_proto != htons(ETH_P_IPX)) ||
- 		   ether_addr_equal(payload.hdr, bridge_tunnel_header)))
diff --git a/package/kernel/mac80211/patches/subsys/383-cfg80211-mitigate-A-MSDU-aggregation-attacks.patch b/package/kernel/mac80211/patches/subsys/383-cfg80211-mitigate-A-MSDU-aggregation-attacks.patch
deleted file mode 100644
index 8ea78dca84..0000000000
--- a/package/kernel/mac80211/patches/subsys/383-cfg80211-mitigate-A-MSDU-aggregation-attacks.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From: Mathy Vanhoef <Mathy.Vanhoef at kuleuven.be>
-Date: Tue, 11 May 2021 20:02:45 +0200
-Subject: [PATCH] cfg80211: mitigate A-MSDU aggregation attacks
-
-Mitigate A-MSDU injection attacks (CVE-2020-24588) by detecting if the
-destination address of a subframe equals an RFC1042 (i.e., LLC/SNAP)
-header, and if so dropping the complete A-MSDU frame. This mitigates
-known attacks, although new (unknown) aggregation-based attacks may
-remain possible.
-
-This defense works because in A-MSDU aggregation injection attacks, a
-normal encrypted Wi-Fi frame is turned into an A-MSDU frame. This means
-the first 6 bytes of the first A-MSDU subframe correspond to an RFC1042
-header. In other words, the destination MAC address of the first A-MSDU
-subframe contains the start of an RFC1042 header during an aggregation
-attack. We can detect this and thereby prevent this specific attack.
-For details, see Section 7.2 of "Fragment and Forge: Breaking Wi-Fi
-Through Frame Aggregation and Fragmentation".
-
-Note that for kernel 4.9 and above this patch depends on "mac80211:
-properly handle A-MSDUs that start with a rfc1042 header". Otherwise
-this patch has no impact and attacks will remain possible.
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef at kuleuven.be>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/net/wireless/util.c
-+++ b/net/wireless/util.c
-@@ -775,6 +775,9 @@ void ieee80211_amsdu_to_8023s(struct sk_
- 		remaining = skb->len - offset;
- 		if (subframe_len > remaining)
- 			goto purge;
-+		/* mitigate A-MSDU aggregation injection attacks */
-+		if (ether_addr_equal(eth.h_dest, rfc1042_header))
-+			goto purge;
- 
- 		offset += sizeof(struct ethhdr);
- 		last = remaining <= subframe_len + padding;
diff --git a/package/kernel/mac80211/patches/subsys/384-mac80211-drop-A-MSDUs-on-old-ciphers.patch b/package/kernel/mac80211/patches/subsys/384-mac80211-drop-A-MSDUs-on-old-ciphers.patch
deleted file mode 100644
index 1b5084c37d..0000000000
--- a/package/kernel/mac80211/patches/subsys/384-mac80211-drop-A-MSDUs-on-old-ciphers.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From: Johannes Berg <johannes.berg at intel.com>
-Date: Tue, 11 May 2021 20:02:46 +0200
-Subject: [PATCH] mac80211: drop A-MSDUs on old ciphers
-
-With old ciphers (WEP and TKIP) we shouldn't be using A-MSDUs
-since A-MSDUs are only supported if we know that they are, and
-the only practical way for that is HT support which doesn't
-support old ciphers.
-
-However, we would normally accept them anyway. Since we check
-the MMIC before deaggregating A-MSDUs, and the A-MSDU bit in
-the QoS header is not protected in TKIP (or WEP), this enables
-attacks similar to CVE-2020-24588. To prevent that, drop A-MSDUs
-completely with old ciphers.
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -6,7 +6,7 @@
-  * Copyright 2007-2010	Johannes Berg <johannes at sipsolutions.net>
-  * Copyright 2013-2014  Intel Mobile Communications GmbH
-  * Copyright(c) 2015 - 2017 Intel Deutschland GmbH
-- * Copyright (C) 2018-2020 Intel Corporation
-+ * Copyright (C) 2018-2021 Intel Corporation
-  */
- 
- #include <linux/jiffies.h>
-@@ -2753,6 +2753,23 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx
- 	if (is_multicast_ether_addr(hdr->addr1))
- 		return RX_DROP_UNUSABLE;
- 
-+	if (rx->key) {
-+		/*
-+		 * We should not receive A-MSDUs on pre-HT connections,
-+		 * and HT connections cannot use old ciphers. Thus drop
-+		 * them, as in those cases we couldn't even have SPP
-+		 * A-MSDUs or such.
-+		 */
-+		switch (rx->key->conf.cipher) {
-+		case WLAN_CIPHER_SUITE_WEP40:
-+		case WLAN_CIPHER_SUITE_WEP104:
-+		case WLAN_CIPHER_SUITE_TKIP:
-+			return RX_DROP_UNUSABLE;
-+		default:
-+			break;
-+		}
-+	}
-+
- 	return __ieee80211_rx_h_amsdu(rx, 0);
- }
- 
diff --git a/package/kernel/mac80211/patches/subsys/385-mac80211-add-fragment-cache-to-sta_info.patch b/package/kernel/mac80211/patches/subsys/385-mac80211-add-fragment-cache-to-sta_info.patch
deleted file mode 100644
index b536126d38..0000000000
--- a/package/kernel/mac80211/patches/subsys/385-mac80211-add-fragment-cache-to-sta_info.patch
+++ /dev/null
@@ -1,313 +0,0 @@
-From: Johannes Berg <johannes.berg at intel.com>
-Date: Tue, 11 May 2021 20:02:47 +0200
-Subject: [PATCH] mac80211: add fragment cache to sta_info
-
-Prior patches protected against fragmentation cache attacks
-by coloring keys, but this shows that it can lead to issues
-when multiple stations use the same sequence number. Add a
-fragment cache to struct sta_info (in addition to the one in
-the interface) to separate fragments for different stations
-properly.
-
-This then automatically clear most of the fragment cache when a
-station disconnects (or reassociates) from an AP, or when client
-interfaces disconnect from the network, etc.
-
-On the way, also fix the comment there since this brings us in line
-with the recommendation in 802.11-2016 ("An AP should support ...").
-Additionally, remove a useless condition (since there's no problem
-purging an already empty list).
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/net/mac80211/ieee80211_i.h
-+++ b/net/mac80211/ieee80211_i.h
-@@ -50,12 +50,6 @@ struct ieee80211_local;
- #define IEEE80211_ENCRYPT_HEADROOM 8
- #define IEEE80211_ENCRYPT_TAILROOM 18
- 
--/* IEEE 802.11 (Ch. 9.5 Defragmentation) requires support for concurrent
-- * reception of at least three fragmented frames. This limit can be increased
-- * by changing this define, at the cost of slower frame reassembly and
-- * increased memory use (about 2 kB of RAM per entry). */
--#define IEEE80211_FRAGMENT_MAX 4
--
- /* power level hasn't been configured (or set to automatic) */
- #define IEEE80211_UNSET_POWER_LEVEL	INT_MIN
- 
-@@ -88,19 +82,6 @@ extern const u8 ieee80211_ac_to_qos_mask
- 
- #define IEEE80211_MAX_NAN_INSTANCE_ID 255
- 
--struct ieee80211_fragment_entry {
--	struct sk_buff_head skb_list;
--	unsigned long first_frag_time;
--	u16 seq;
--	u16 extra_len;
--	u16 last_frag;
--	u8 rx_queue;
--	bool check_sequential_pn; /* needed for CCMP/GCMP */
--	u8 last_pn[6]; /* PN of the last fragment if CCMP was used */
--	unsigned int key_color;
--};
--
--
- struct ieee80211_bss {
- 	u32 device_ts_beacon, device_ts_presp;
- 
-@@ -912,9 +893,7 @@ struct ieee80211_sub_if_data {
- 
- 	char name[IFNAMSIZ];
- 
--	/* Fragment table for host-based reassembly */
--	struct ieee80211_fragment_entry	fragments[IEEE80211_FRAGMENT_MAX];
--	unsigned int fragment_next;
-+	struct ieee80211_fragment_cache frags;
- 
- 	/* TID bitmap for NoAck policy */
- 	u16 noack_map;
-@@ -2329,4 +2308,7 @@ u32 ieee80211_calc_expected_tx_airtime(s
- #define debug_noinline
- #endif
- 
-+void ieee80211_init_frag_cache(struct ieee80211_fragment_cache *cache);
-+void ieee80211_destroy_frag_cache(struct ieee80211_fragment_cache *cache);
-+
- #endif /* IEEE80211_I_H */
---- a/net/mac80211/iface.c
-+++ b/net/mac80211/iface.c
-@@ -8,7 +8,7 @@
-  * Copyright 2008, Johannes Berg <johannes at sipsolutions.net>
-  * Copyright 2013-2014  Intel Mobile Communications GmbH
-  * Copyright (c) 2016        Intel Deutschland GmbH
-- * Copyright (C) 2018-2020 Intel Corporation
-+ * Copyright (C) 2018-2021 Intel Corporation
-  */
- #include <linux/slab.h>
- #include <linux/kernel.h>
-@@ -679,16 +679,12 @@ static void ieee80211_set_multicast_list
-  */
- static void ieee80211_teardown_sdata(struct ieee80211_sub_if_data *sdata)
- {
--	int i;
--
- 	/* free extra data */
- 	ieee80211_free_keys(sdata, false);
- 
- 	ieee80211_debugfs_remove_netdev(sdata);
- 
--	for (i = 0; i < IEEE80211_FRAGMENT_MAX; i++)
--		__skb_queue_purge(&sdata->fragments[i].skb_list);
--	sdata->fragment_next = 0;
-+	ieee80211_destroy_frag_cache(&sdata->frags);
- 
- 	if (ieee80211_vif_is_mesh(&sdata->vif))
- 		ieee80211_mesh_teardown_sdata(sdata);
-@@ -2038,8 +2034,7 @@ int ieee80211_if_add(struct ieee80211_lo
- 	sdata->wdev.wiphy = local->hw.wiphy;
- 	sdata->local = local;
- 
--	for (i = 0; i < IEEE80211_FRAGMENT_MAX; i++)
--		skb_queue_head_init(&sdata->fragments[i].skb_list);
-+	ieee80211_init_frag_cache(&sdata->frags);
- 
- 	INIT_LIST_HEAD(&sdata->key_list);
- 
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -2133,19 +2133,34 @@ ieee80211_rx_h_decrypt(struct ieee80211_
- 	return result;
- }
- 
-+void ieee80211_init_frag_cache(struct ieee80211_fragment_cache *cache)
-+{
-+	int i;
-+
-+	for (i = 0; i < ARRAY_SIZE(cache->entries); i++)
-+		skb_queue_head_init(&cache->entries[i].skb_list);
-+}
-+
-+void ieee80211_destroy_frag_cache(struct ieee80211_fragment_cache *cache)
-+{
-+	int i;
-+
-+	for (i = 0; i < ARRAY_SIZE(cache->entries); i++)
-+		__skb_queue_purge(&cache->entries[i].skb_list);
-+}
-+
- static inline struct ieee80211_fragment_entry *
--ieee80211_reassemble_add(struct ieee80211_sub_if_data *sdata,
-+ieee80211_reassemble_add(struct ieee80211_fragment_cache *cache,
- 			 unsigned int frag, unsigned int seq, int rx_queue,
- 			 struct sk_buff **skb)
- {
- 	struct ieee80211_fragment_entry *entry;
- 
--	entry = &sdata->fragments[sdata->fragment_next++];
--	if (sdata->fragment_next >= IEEE80211_FRAGMENT_MAX)
--		sdata->fragment_next = 0;
-+	entry = &cache->entries[cache->next++];
-+	if (cache->next >= IEEE80211_FRAGMENT_MAX)
-+		cache->next = 0;
- 
--	if (!skb_queue_empty(&entry->skb_list))
--		__skb_queue_purge(&entry->skb_list);
-+	__skb_queue_purge(&entry->skb_list);
- 
- 	__skb_queue_tail(&entry->skb_list, *skb); /* no need for locking */
- 	*skb = NULL;
-@@ -2160,14 +2175,14 @@ ieee80211_reassemble_add(struct ieee8021
- }
- 
- static inline struct ieee80211_fragment_entry *
--ieee80211_reassemble_find(struct ieee80211_sub_if_data *sdata,
-+ieee80211_reassemble_find(struct ieee80211_fragment_cache *cache,
- 			  unsigned int frag, unsigned int seq,
- 			  int rx_queue, struct ieee80211_hdr *hdr)
- {
- 	struct ieee80211_fragment_entry *entry;
- 	int i, idx;
- 
--	idx = sdata->fragment_next;
-+	idx = cache->next;
- 	for (i = 0; i < IEEE80211_FRAGMENT_MAX; i++) {
- 		struct ieee80211_hdr *f_hdr;
- 		struct sk_buff *f_skb;
-@@ -2176,7 +2191,7 @@ ieee80211_reassemble_find(struct ieee802
- 		if (idx < 0)
- 			idx = IEEE80211_FRAGMENT_MAX - 1;
- 
--		entry = &sdata->fragments[idx];
-+		entry = &cache->entries[idx];
- 		if (skb_queue_empty(&entry->skb_list) || entry->seq != seq ||
- 		    entry->rx_queue != rx_queue ||
- 		    entry->last_frag + 1 != frag)
-@@ -2217,6 +2232,7 @@ static bool requires_sequential_pn(struc
- static ieee80211_rx_result debug_noinline
- ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
- {
-+	struct ieee80211_fragment_cache *cache = &rx->sdata->frags;
- 	struct ieee80211_hdr *hdr;
- 	u16 sc;
- 	__le16 fc;
-@@ -2238,6 +2254,9 @@ ieee80211_rx_h_defragment(struct ieee802
- 		goto out_no_led;
- 	}
- 
-+	if (rx->sta)
-+		cache = &rx->sta->frags;
-+
- 	if (likely(!ieee80211_has_morefrags(fc) && frag == 0))
- 		goto out;
- 
-@@ -2256,7 +2275,7 @@ ieee80211_rx_h_defragment(struct ieee802
- 
- 	if (frag == 0) {
- 		/* This is the first fragment of a new frame. */
--		entry = ieee80211_reassemble_add(rx->sdata, frag, seq,
-+		entry = ieee80211_reassemble_add(cache, frag, seq,
- 						 rx->seqno_idx, &(rx->skb));
- 		if (requires_sequential_pn(rx, fc)) {
- 			int queue = rx->security_idx;
-@@ -2284,7 +2303,7 @@ ieee80211_rx_h_defragment(struct ieee802
- 	/* This is a fragment for a frame that should already be pending in
- 	 * fragment cache. Add this fragment to the end of the pending entry.
- 	 */
--	entry = ieee80211_reassemble_find(rx->sdata, frag, seq,
-+	entry = ieee80211_reassemble_find(cache, frag, seq,
- 					  rx->seqno_idx, hdr);
- 	if (!entry) {
- 		I802_DEBUG_INC(rx->local->rx_handlers_drop_defrag);
---- a/net/mac80211/sta_info.c
-+++ b/net/mac80211/sta_info.c
-@@ -4,7 +4,7 @@
-  * Copyright 2006-2007	Jiri Benc <jbenc at suse.cz>
-  * Copyright 2013-2014  Intel Mobile Communications GmbH
-  * Copyright (C) 2015 - 2017 Intel Deutschland GmbH
-- * Copyright (C) 2018-2020 Intel Corporation
-+ * Copyright (C) 2018-2021 Intel Corporation
-  */
- 
- #include <linux/module.h>
-@@ -393,6 +393,8 @@ struct sta_info *sta_info_alloc(struct i
- 
- 	u64_stats_init(&sta->rx_stats.syncp);
- 
-+	ieee80211_init_frag_cache(&sta->frags);
-+
- 	sta->sta_state = IEEE80211_STA_NONE;
- 
- 	/* Mark TID as unreserved */
-@@ -1103,6 +1105,8 @@ static void __sta_info_destroy_part2(str
- 
- 	ieee80211_sta_debugfs_remove(sta);
- 
-+	ieee80211_destroy_frag_cache(&sta->frags);
-+
- 	cleanup_single_sta(sta);
- }
- 
---- a/net/mac80211/sta_info.h
-+++ b/net/mac80211/sta_info.h
-@@ -3,7 +3,7 @@
-  * Copyright 2002-2005, Devicescape Software, Inc.
-  * Copyright 2013-2014  Intel Mobile Communications GmbH
-  * Copyright(c) 2015-2017 Intel Deutschland GmbH
-- * Copyright(c) 2020 Intel Corporation
-+ * Copyright(c) 2020-2021 Intel Corporation
-  */
- 
- #ifndef STA_INFO_H
-@@ -439,6 +439,33 @@ struct ieee80211_sta_rx_stats {
- };
- 
- /*
-+ * IEEE 802.11-2016 (10.6 "Defragmentation") recommends support for "concurrent
-+ * reception of at least one MSDU per access category per associated STA"
-+ * on APs, or "at least one MSDU per access category" on other interface types.
-+ *
-+ * This limit can be increased by changing this define, at the cost of slower
-+ * frame reassembly and increased memory use while fragments are pending.
-+ */
-+#define IEEE80211_FRAGMENT_MAX 4
-+
-+struct ieee80211_fragment_entry {
-+	struct sk_buff_head skb_list;
-+	unsigned long first_frag_time;
-+	u16 seq;
-+	u16 extra_len;
-+	u16 last_frag;
-+	u8 rx_queue;
-+	bool check_sequential_pn; /* needed for CCMP/GCMP */
-+	u8 last_pn[6]; /* PN of the last fragment if CCMP was used */
-+	unsigned int key_color;
-+};
-+
-+struct ieee80211_fragment_cache {
-+	struct ieee80211_fragment_entry	entries[IEEE80211_FRAGMENT_MAX];
-+	unsigned int next;
-+};
-+
-+/*
-  * The bandwidth threshold below which the per-station CoDel parameters will be
-  * scaled to be more lenient (to prevent starvation of slow stations). This
-  * value will be scaled by the number of active stations when it is being
-@@ -531,6 +558,7 @@ struct ieee80211_sta_rx_stats {
-  * @status_stats.last_ack_signal: last ACK signal
-  * @status_stats.ack_signal_filled: last ACK signal validity
-  * @status_stats.avg_ack_signal: average ACK signal
-+ * @frags: fragment cache
-  */
- struct sta_info {
- 	/* General information, mostly static */
-@@ -639,6 +667,8 @@ struct sta_info {
- 
- 	struct cfg80211_chan_def tdls_chandef;
- 
-+	struct ieee80211_fragment_cache frags;
-+
- 	/* keep last! */
- 	struct ieee80211_sta sta;
- };
diff --git a/package/kernel/mac80211/patches/subsys/386-mac80211-check-defrag-PN-against-current-frame.patch b/package/kernel/mac80211/patches/subsys/386-mac80211-check-defrag-PN-against-current-frame.patch
deleted file mode 100644
index fb2747a609..0000000000
--- a/package/kernel/mac80211/patches/subsys/386-mac80211-check-defrag-PN-against-current-frame.patch
+++ /dev/null
@@ -1,109 +0,0 @@
-From: Johannes Berg <johannes.berg at intel.com>
-Date: Tue, 11 May 2021 20:02:48 +0200
-Subject: [PATCH] mac80211: check defrag PN against current frame
-
-As pointed out by Mathy Vanhoef, we implement the RX PN check
-on fragmented frames incorrectly - we check against the last
-received PN prior to the new frame, rather than to the one in
-this frame itself.
-
-Prior patches addressed the security issue here, but in order
-to be able to reason better about the code, fix it to really
-compare against the current frame's PN, not the last stored
-one.
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/net/mac80211/ieee80211_i.h
-+++ b/net/mac80211/ieee80211_i.h
-@@ -227,8 +227,15 @@ struct ieee80211_rx_data {
- 	 */
- 	int security_idx;
- 
--	u32 tkip_iv32;
--	u16 tkip_iv16;
-+	union {
-+		struct {
-+			u32 iv32;
-+			u16 iv16;
-+		} tkip;
-+		struct {
-+			u8 pn[IEEE80211_CCMP_PN_LEN];
-+		} ccm_gcm;
-+	};
- };
- 
- struct ieee80211_csa_settings {
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -2318,7 +2318,6 @@ ieee80211_rx_h_defragment(struct ieee802
- 	if (entry->check_sequential_pn) {
- 		int i;
- 		u8 pn[IEEE80211_CCMP_PN_LEN], *rpn;
--		int queue;
- 
- 		if (!requires_sequential_pn(rx, fc))
- 			return RX_DROP_UNUSABLE;
-@@ -2333,8 +2332,8 @@ ieee80211_rx_h_defragment(struct ieee802
- 			if (pn[i])
- 				break;
- 		}
--		queue = rx->security_idx;
--		rpn = rx->key->u.ccmp.rx_pn[queue];
-+
-+		rpn = rx->ccm_gcm.pn;
- 		if (memcmp(pn, rpn, IEEE80211_CCMP_PN_LEN))
- 			return RX_DROP_UNUSABLE;
- 		memcpy(entry->last_pn, pn, IEEE80211_CCMP_PN_LEN);
---- a/net/mac80211/wpa.c
-+++ b/net/mac80211/wpa.c
-@@ -3,6 +3,7 @@
-  * Copyright 2002-2004, Instant802 Networks, Inc.
-  * Copyright 2008, Jouni Malinen <j at w1.fi>
-  * Copyright (C) 2016-2017 Intel Deutschland GmbH
-+ * Copyright (C) 2020-2021 Intel Corporation
-  */
- 
- #include <linux/netdevice.h>
-@@ -167,8 +168,8 @@ ieee80211_rx_h_michael_mic_verify(struct
- 
- update_iv:
- 	/* update IV in key information to be able to detect replays */
--	rx->key->u.tkip.rx[rx->security_idx].iv32 = rx->tkip_iv32;
--	rx->key->u.tkip.rx[rx->security_idx].iv16 = rx->tkip_iv16;
-+	rx->key->u.tkip.rx[rx->security_idx].iv32 = rx->tkip.iv32;
-+	rx->key->u.tkip.rx[rx->security_idx].iv16 = rx->tkip.iv16;
- 
- 	return RX_CONTINUE;
- 
-@@ -294,8 +295,8 @@ ieee80211_crypto_tkip_decrypt(struct iee
- 					  key, skb->data + hdrlen,
- 					  skb->len - hdrlen, rx->sta->sta.addr,
- 					  hdr->addr1, hwaccel, rx->security_idx,
--					  &rx->tkip_iv32,
--					  &rx->tkip_iv16);
-+					  &rx->tkip.iv32,
-+					  &rx->tkip.iv16);
- 	if (res != TKIP_DECRYPT_OK)
- 		return RX_DROP_UNUSABLE;
- 
-@@ -552,6 +553,8 @@ ieee80211_crypto_ccmp_decrypt(struct iee
- 		}
- 
- 		memcpy(key->u.ccmp.rx_pn[queue], pn, IEEE80211_CCMP_PN_LEN);
-+		if (unlikely(ieee80211_is_frag(hdr)))
-+			memcpy(rx->ccm_gcm.pn, pn, IEEE80211_CCMP_PN_LEN);
- 	}
- 
- 	/* Remove CCMP header and MIC */
-@@ -782,6 +785,8 @@ ieee80211_crypto_gcmp_decrypt(struct iee
- 		}
- 
- 		memcpy(key->u.gcmp.rx_pn[queue], pn, IEEE80211_GCMP_PN_LEN);
-+		if (unlikely(ieee80211_is_frag(hdr)))
-+			memcpy(rx->ccm_gcm.pn, pn, IEEE80211_CCMP_PN_LEN);
- 	}
- 
- 	/* Remove GCMP header and MIC */
diff --git a/package/kernel/mac80211/patches/subsys/387-mac80211-prevent-attacks-on-TKIP-WEP-as-well.patch b/package/kernel/mac80211/patches/subsys/387-mac80211-prevent-attacks-on-TKIP-WEP-as-well.patch
deleted file mode 100644
index bc582a6cc2..0000000000
--- a/package/kernel/mac80211/patches/subsys/387-mac80211-prevent-attacks-on-TKIP-WEP-as-well.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From: Johannes Berg <johannes.berg at intel.com>
-Date: Tue, 11 May 2021 20:02:49 +0200
-Subject: [PATCH] mac80211: prevent attacks on TKIP/WEP as well
-
-Similar to the issues fixed in previous patches, TKIP and WEP
-should be protected even if for TKIP we have the Michael MIC
-protecting it, and WEP is broken anyway.
-
-However, this also somewhat protects potential other algorithms
-that drivers might implement.
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -2284,6 +2284,7 @@ ieee80211_rx_h_defragment(struct ieee802
- 			 * next fragment has a sequential PN value.
- 			 */
- 			entry->check_sequential_pn = true;
-+			entry->is_protected = true;
- 			entry->key_color = rx->key->color;
- 			memcpy(entry->last_pn,
- 			       rx->key->u.ccmp.rx_pn[queue],
-@@ -2296,6 +2297,9 @@ ieee80211_rx_h_defragment(struct ieee802
- 				     sizeof(rx->key->u.gcmp.rx_pn[queue]));
- 			BUILD_BUG_ON(IEEE80211_CCMP_PN_LEN !=
- 				     IEEE80211_GCMP_PN_LEN);
-+		} else if (rx->key && ieee80211_has_protected(fc)) {
-+			entry->is_protected = true;
-+			entry->key_color = rx->key->color;
- 		}
- 		return RX_QUEUED;
- 	}
-@@ -2337,6 +2341,14 @@ ieee80211_rx_h_defragment(struct ieee802
- 		if (memcmp(pn, rpn, IEEE80211_CCMP_PN_LEN))
- 			return RX_DROP_UNUSABLE;
- 		memcpy(entry->last_pn, pn, IEEE80211_CCMP_PN_LEN);
-+	} else if (entry->is_protected &&
-+		   (!rx->key || !ieee80211_has_protected(fc) ||
-+		    rx->key->color != entry->key_color)) {
-+		/* Drop this as a mixed key or fragment cache attack, even
-+		 * if for TKIP Michael MIC should protect us, and WEP is a
-+		 * lost cause anyway.
-+		 */
-+		return RX_DROP_UNUSABLE;
- 	}
- 
- 	skb_pull(rx->skb, ieee80211_hdrlen(fc));
---- a/net/mac80211/sta_info.h
-+++ b/net/mac80211/sta_info.h
-@@ -455,7 +455,8 @@ struct ieee80211_fragment_entry {
- 	u16 extra_len;
- 	u16 last_frag;
- 	u8 rx_queue;
--	bool check_sequential_pn; /* needed for CCMP/GCMP */
-+	u8 check_sequential_pn:1, /* needed for CCMP/GCMP */
-+	   is_protected:1;
- 	u8 last_pn[6]; /* PN of the last fragment if CCMP was used */
- 	unsigned int key_color;
- };
diff --git a/package/kernel/mac80211/patches/subsys/388-mac80211-do-not-accept-forward-invalid-EAPOL-frames.patch b/package/kernel/mac80211/patches/subsys/388-mac80211-do-not-accept-forward-invalid-EAPOL-frames.patch
deleted file mode 100644
index 9a0b78def1..0000000000
--- a/package/kernel/mac80211/patches/subsys/388-mac80211-do-not-accept-forward-invalid-EAPOL-frames.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From: Johannes Berg <johannes.berg at intel.com>
-Date: Tue, 11 May 2021 20:02:50 +0200
-Subject: [PATCH] mac80211: do not accept/forward invalid EAPOL frames
-
-EAPOL frames are used for authentication and key management between the
-AP and each individual STA associated in the BSS. Those frames are not
-supposed to be sent by one associated STA to another associated STA
-(either unicast for broadcast/multicast).
-
-Similarly, in 802.11 they're supposed to be sent to the authenticator
-(AP) address.
-
-Since it is possible for unexpected EAPOL frames to result in misbehavior
-in supplicant implementations, it is better for the AP to not allow such
-cases to be forwarded to other clients either directly, or indirectly if
-the AP interface is part of a bridge.
-
-Accept EAPOL (control port) frames only if they're transmitted to the
-own address, or, due to interoperability concerns, to the PAE group
-address.
-
-Disable forwarding of EAPOL (or well, the configured control port
-protocol) frames back to wireless medium in all cases. Previously, these
-frames were accepted from fully authenticated and authorized stations
-and also from unauthenticated stations for one of the cases.
-
-Additionally, to avoid forwarding by the bridge, rewrite the PAE group
-address case to the local MAC address.
-
-Cc: stable at vger.kernel.org
-Co-developed-by: Jouni Malinen <jouni at codeaurora.org>
-Signed-off-by: Jouni Malinen <jouni at codeaurora.org>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -2541,13 +2541,13 @@ static bool ieee80211_frame_allowed(stru
- 	struct ethhdr *ehdr = (struct ethhdr *) rx->skb->data;
- 
- 	/*
--	 * Allow EAPOL frames to us/the PAE group address regardless
--	 * of whether the frame was encrypted or not.
-+	 * Allow EAPOL frames to us/the PAE group address regardless of
-+	 * whether the frame was encrypted or not, and always disallow
-+	 * all other destination addresses for them.
- 	 */
--	if (ehdr->h_proto == rx->sdata->control_port_protocol &&
--	    (ether_addr_equal(ehdr->h_dest, rx->sdata->vif.addr) ||
--	     ether_addr_equal(ehdr->h_dest, pae_group_addr)))
--		return true;
-+	if (unlikely(ehdr->h_proto == rx->sdata->control_port_protocol))
-+		return ether_addr_equal(ehdr->h_dest, rx->sdata->vif.addr) ||
-+		       ether_addr_equal(ehdr->h_dest, pae_group_addr);
- 
- 	if (ieee80211_802_1x_port_control(rx) ||
- 	    ieee80211_drop_unencrypted(rx, fc))
-@@ -2572,8 +2572,28 @@ static void ieee80211_deliver_skb_to_loc
- 		cfg80211_rx_control_port(dev, skb, noencrypt);
- 		dev_kfree_skb(skb);
- 	} else {
-+		struct ethhdr *ehdr = (void *)skb_mac_header(skb);
-+
- 		memset(skb->cb, 0, sizeof(skb->cb));
- 
-+		/*
-+		 * 802.1X over 802.11 requires that the authenticator address
-+		 * be used for EAPOL frames. However, 802.1X allows the use of
-+		 * the PAE group address instead. If the interface is part of
-+		 * a bridge and we pass the frame with the PAE group address,
-+		 * then the bridge will forward it to the network (even if the
-+		 * client was not associated yet), which isn't supposed to
-+		 * happen.
-+		 * To avoid that, rewrite the destination address to our own
-+		 * address, so that the authenticator (e.g. hostapd) will see
-+		 * the frame, but bridge won't forward it anywhere else. Note
-+		 * that due to earlier filtering, the only other address can
-+		 * be the PAE group address.
-+		 */
-+		if (unlikely(skb->protocol == sdata->control_port_protocol &&
-+			     !ether_addr_equal(ehdr->h_dest, sdata->vif.addr)))
-+			ether_addr_copy(ehdr->h_dest, sdata->vif.addr);
-+
- 		/* deliver to local stack */
- 		if (rx->list)
- #if LINUX_VERSION_IS_GEQ(4,19,0)
-@@ -2617,6 +2637,7 @@ ieee80211_deliver_skb(struct ieee80211_r
- 	if ((sdata->vif.type == NL80211_IFTYPE_AP ||
- 	     sdata->vif.type == NL80211_IFTYPE_AP_VLAN) &&
- 	    !(sdata->flags & IEEE80211_SDATA_DONT_BRIDGE_PACKETS) &&
-+	    ehdr->h_proto != rx->sdata->control_port_protocol &&
- 	    (sdata->vif.type != NL80211_IFTYPE_AP_VLAN || !sdata->u.vlan.sta)) {
- 		if (is_multicast_ether_addr(ehdr->h_dest) &&
- 		    ieee80211_vif_get_num_mcast_if(sdata) != 0) {
diff --git a/package/kernel/mac80211/patches/subsys/389-mac80211-extend-protection-against-mixed-key-and-fra.patch b/package/kernel/mac80211/patches/subsys/389-mac80211-extend-protection-against-mixed-key-and-fra.patch
deleted file mode 100644
index 17809263e9..0000000000
--- a/package/kernel/mac80211/patches/subsys/389-mac80211-extend-protection-against-mixed-key-and-fra.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From: Wen Gong <wgong at codeaurora.org>
-Date: Tue, 11 May 2021 20:02:51 +0200
-Subject: [PATCH] mac80211: extend protection against mixed key and
- fragment cache attacks
-
-For some chips/drivers, e.g., QCA6174 with ath10k, the decryption is
-done by the hardware, and the Protected bit in the Frame Control field
-is cleared in the lower level driver before the frame is passed to
-mac80211. In such cases, the condition for ieee80211_has_protected() is
-not met in ieee80211_rx_h_defragment() of mac80211 and the new security
-validation steps are not executed.
-
-Extend mac80211 to cover the case where the Protected bit has been
-cleared, but the frame is indicated as having been decrypted by the
-hardware. This extends protection against mixed key and fragment cache
-attack for additional drivers/chips. This fixes CVE-2020-24586 and
-CVE-2020-24587 for such cases.
-
-Tested-on: QCA6174 hw3.2 PCI WLAN.RM.4.4.1-00110-QCARMSWP-1
-
-Cc: stable at vger.kernel.org
-Signed-off-by: Wen Gong <wgong at codeaurora.org>
-Signed-off-by: Jouni Malinen <jouni at codeaurora.org>
-Signed-off-by: Johannes Berg <johannes.berg at intel.com>
----
-
---- a/net/mac80211/rx.c
-+++ b/net/mac80211/rx.c
-@@ -2239,6 +2239,7 @@ ieee80211_rx_h_defragment(struct ieee802
- 	unsigned int frag, seq;
- 	struct ieee80211_fragment_entry *entry;
- 	struct sk_buff *skb;
-+	struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb);
- 
- 	hdr = (struct ieee80211_hdr *)rx->skb->data;
- 	fc = hdr->frame_control;
-@@ -2297,7 +2298,9 @@ ieee80211_rx_h_defragment(struct ieee802
- 				     sizeof(rx->key->u.gcmp.rx_pn[queue]));
- 			BUILD_BUG_ON(IEEE80211_CCMP_PN_LEN !=
- 				     IEEE80211_GCMP_PN_LEN);
--		} else if (rx->key && ieee80211_has_protected(fc)) {
-+		} else if (rx->key &&
-+			   (ieee80211_has_protected(fc) ||
-+			    (status->flag & RX_FLAG_DECRYPTED))) {
- 			entry->is_protected = true;
- 			entry->key_color = rx->key->color;
- 		}
-@@ -2342,13 +2345,19 @@ ieee80211_rx_h_defragment(struct ieee802
- 			return RX_DROP_UNUSABLE;
- 		memcpy(entry->last_pn, pn, IEEE80211_CCMP_PN_LEN);
- 	} else if (entry->is_protected &&
--		   (!rx->key || !ieee80211_has_protected(fc) ||
-+		   (!rx->key ||
-+		    (!ieee80211_has_protected(fc) &&
-+		     !(status->flag & RX_FLAG_DECRYPTED)) ||
- 		    rx->key->color != entry->key_color)) {
- 		/* Drop this as a mixed key or fragment cache attack, even
- 		 * if for TKIP Michael MIC should protect us, and WEP is a
- 		 * lost cause anyway.
- 		 */
- 		return RX_DROP_UNUSABLE;
-+	} else if (entry->is_protected && rx->key &&
-+		   entry->key_color != rx->key->color &&
-+		   (status->flag & RX_FLAG_DECRYPTED)) {
-+		return RX_DROP_UNUSABLE;
- 	}
- 
- 	skb_pull(rx->skb, ieee80211_hdrlen(fc));


From lede-commits at lists.infradead.org  Sun Jun  6 08:58:56 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 06 Jun 2021 11:58:56 -0400
Subject: [openwrt/openwrt]  kernel: bump 4.14 to 4.14.235
In-Reply-To: <162299513691.18785.481979176750504337@git-01.infra.openwrt.org>
References: <162299513691.18785.481979176750504337@git-01.infra.openwrt.org>
Message-ID: <mailman.3425.1622995142.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-19.07:
https://git.openwrt.org/ccc505502e93f6f3b0e7a7288f15dd7a03e85f5b

commit ccc505502e93f6f3b0e7a7288f15dd7a03e85f5b
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sat Jun 5 01:06:28 2021 +0200

    kernel: bump 4.14 to 4.14.235
    
    Manually rebased
      ramips/patches-5.4/0048-asoc-add-mt7620-support.patch
    
    All others updated automatically.
    
    Compile-tested on: ath79/generic, ramips/mt7621
    Runtime-tested on: ath79/generic
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 include/kernel-version.mk                          |  4 +--
 .../patches-4.14/910-unaligned_access_hacks.patch  |  2 +-
 .../patches-4.14/910-unaligned_access_hacks.patch  |  2 +-
 ...950-0040-MMC-added-alternative-MMC-driver.patch |  6 ++---
 .../brcm47xx/patches-4.14/160-kmap_coherent.patch  |  2 +-
 .../cns3xxx/patches-4.14/075-spi_support.patch     |  2 +-
 ...ER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch |  2 +-
 ...ial-option-fix-dwm-158-3g-modem-interface.patch |  2 +-
 ...d-support-for-host-mode-external-vbus-sup.patch |  4 +--
 ...15-netfilter-exit_net-cleanup-check-added.patch |  2 +-
 .../linux/generic/hack-4.14/204-module_strip.patch |  4 +--
 .../linux/generic/hack-4.14/902-debloat_proc.patch |  2 +-
 .../911-kobject_add_broadcast_uevent.patch         |  2 +-
 .../666-Add-support-for-MAP-E-FMRs-mesh-mode.patch | 30 +++++++++++-----------
 .../0001-MIPS-lantiq-add-pcie-driver.patch         |  2 +-
 .../patches-4.14/807-usb-support-layerscape.patch  |  4 +--
 ...diatek-honour-special-tag-bit-inside-RX-D.patch |  2 +-
 ...k-remove-superfluous-pin-setup-for-MT7622.patch |  2 +-
 ...IPS-pci-rt2880-set-pci-controller-of_node.patch |  2 +-
 ...-copy-the-commandline-from-the-devicetree.patch |  2 +-
 .../0048-asoc-add-mt7620-support.patch             | 18 -------------
 21 files changed, 40 insertions(+), 58 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 514d197361..f9f675b7e0 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -6,9 +6,9 @@ ifdef CONFIG_TESTING_KERNEL
   KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
 endif
 
-LINUX_VERSION-4.14 = .232
+LINUX_VERSION-4.14 = .235
 
-LINUX_KERNEL_HASH-4.14.232 = 1dc19361f6970bc94cc62be066702483db9cbd3d63f3089a8c90dabfced74369
+LINUX_KERNEL_HASH-4.14.235 = 0ed1bdd11778f7a6646acddbede653ddc056e047306866e5719f2421e148670e
 
 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
 sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
diff --git a/target/linux/ar71xx/patches-4.14/910-unaligned_access_hacks.patch b/target/linux/ar71xx/patches-4.14/910-unaligned_access_hacks.patch
index 52360b5385..6eee38df57 100644
--- a/target/linux/ar71xx/patches-4.14/910-unaligned_access_hacks.patch
+++ b/target/linux/ar71xx/patches-4.14/910-unaligned_access_hacks.patch
@@ -276,7 +276,7 @@
  		case IPV6_2292HOPOPTS:
 --- a/net/ipv6/ip6_gre.c
 +++ b/net/ipv6/ip6_gre.c
-@@ -400,7 +400,7 @@ static void ip6gre_err(struct sk_buff *s
+@@ -399,7 +399,7 @@ static void ip6gre_err(struct sk_buff *s
  		return;
  	ipv6h = (const struct ipv6hdr *)skb->data;
  	greh = (const struct gre_base_hdr *)(skb->data + offset);
diff --git a/target/linux/ath79/patches-4.14/910-unaligned_access_hacks.patch b/target/linux/ath79/patches-4.14/910-unaligned_access_hacks.patch
index b41cce2db0..89cca72eb3 100644
--- a/target/linux/ath79/patches-4.14/910-unaligned_access_hacks.patch
+++ b/target/linux/ath79/patches-4.14/910-unaligned_access_hacks.patch
@@ -267,7 +267,7 @@
  		case IPV6_2292HOPOPTS:
 --- a/net/ipv6/ip6_gre.c
 +++ b/net/ipv6/ip6_gre.c
-@@ -400,7 +400,7 @@ static void ip6gre_err(struct sk_buff *s
+@@ -399,7 +399,7 @@ static void ip6gre_err(struct sk_buff *s
  		return;
  	ipv6h = (const struct ipv6hdr *)skb->data;
  	greh = (const struct gre_base_hdr *)(skb->data + offset);
diff --git a/target/linux/brcm2708/patches-4.14/950-0040-MMC-added-alternative-MMC-driver.patch b/target/linux/brcm2708/patches-4.14/950-0040-MMC-added-alternative-MMC-driver.patch
index 4caa4efd95..450b97ba3b 100644
--- a/target/linux/brcm2708/patches-4.14/950-0040-MMC-added-alternative-MMC-driver.patch
+++ b/target/linux/brcm2708/patches-4.14/950-0040-MMC-added-alternative-MMC-driver.patch
@@ -111,7 +111,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.org>
  static inline int mmc_blk_part_switch(struct mmc_card *card,
  				      unsigned int part_type);
  
-@@ -2729,6 +2736,7 @@ static int mmc_blk_probe(struct mmc_card
+@@ -2741,6 +2748,7 @@ static int mmc_blk_probe(struct mmc_card
  {
  	struct mmc_blk_data *md, *part_md;
  	char cap_str[10];
@@ -119,7 +119,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.org>
  
  	/*
  	 * Check that the card supports the command class(es) we need.
-@@ -2736,7 +2744,16 @@ static int mmc_blk_probe(struct mmc_card
+@@ -2748,7 +2756,16 @@ static int mmc_blk_probe(struct mmc_card
  	if (!(card->csd.cmdclass & CCC_BLOCK_READ))
  		return -ENODEV;
  
@@ -137,7 +137,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.org>
  
  	md = mmc_blk_alloc(card);
  	if (IS_ERR(md))
-@@ -2744,9 +2761,14 @@ static int mmc_blk_probe(struct mmc_card
+@@ -2756,9 +2773,14 @@ static int mmc_blk_probe(struct mmc_card
  
  	string_get_size((u64)get_capacity(md->disk), 512, STRING_UNITS_2,
  			cap_str, sizeof(cap_str));
diff --git a/target/linux/brcm47xx/patches-4.14/160-kmap_coherent.patch b/target/linux/brcm47xx/patches-4.14/160-kmap_coherent.patch
index 5cdb545e55..a5bb021350 100644
--- a/target/linux/brcm47xx/patches-4.14/160-kmap_coherent.patch
+++ b/target/linux/brcm47xx/patches-4.14/160-kmap_coherent.patch
@@ -8,7 +8,7 @@ This fixes OpenWrt ticket #1485: https://dev.openwrt.org/ticket/1485
 ---
 --- a/arch/mips/include/asm/cpu-features.h
 +++ b/arch/mips/include/asm/cpu-features.h
-@@ -187,6 +187,9 @@
+@@ -188,6 +188,9 @@
  #ifndef cpu_has_local_ebase
  #define cpu_has_local_ebase	1
  #endif
diff --git a/target/linux/cns3xxx/patches-4.14/075-spi_support.patch b/target/linux/cns3xxx/patches-4.14/075-spi_support.patch
index 61d9707491..f34a532be0 100644
--- a/target/linux/cns3xxx/patches-4.14/075-spi_support.patch
+++ b/target/linux/cns3xxx/patches-4.14/075-spi_support.patch
@@ -26,7 +26,7 @@
  obj-$(CONFIG_SPI_DLN2)			+= spi-dln2.o
 --- a/include/linux/spi/spi.h
 +++ b/include/linux/spi/spi.h
-@@ -818,6 +818,10 @@ struct spi_transfer {
+@@ -821,6 +821,10 @@ struct spi_transfer {
  	u32		speed_hz;
  
  	struct list_head transfer_list;
diff --git a/target/linux/cns3xxx/patches-4.14/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch b/target/linux/cns3xxx/patches-4.14/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch
index 56f43295b4..43ad7993f9 100644
--- a/target/linux/cns3xxx/patches-4.14/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch
+++ b/target/linux/cns3xxx/patches-4.14/130-Extend-PCIE_BUS_PEER2PEER-to-set-MRSS-128-to-fix-CNS3xxx-BM-DMA..patch
@@ -1,6 +1,6 @@
 --- a/drivers/pci/probe.c
 +++ b/drivers/pci/probe.c
-@@ -2330,7 +2330,8 @@ static void pcie_write_mrrs(struct pci_d
+@@ -2331,7 +2331,8 @@ static void pcie_write_mrrs(struct pci_d
  	/* In the "safe" case, do not configure the MRRS.  There appear to be
  	 * issues with setting MRRS to 0 on a number of devices.
  	 */
diff --git a/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch b/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch
index 0b84643ff2..84874d3d93 100644
--- a/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch
+++ b/target/linux/generic/backport-4.14/030-USB-serial-option-fix-dwm-158-3g-modem-interface.patch
@@ -30,7 +30,7 @@ Signed-off-by: Johan Hovold <johan at kernel.org>
 
 --- a/drivers/usb/serial/option.c
 +++ b/drivers/usb/serial/option.c
-@@ -2024,7 +2024,8 @@ static const struct usb_device_id option
+@@ -2028,7 +2028,8 @@ static const struct usb_device_id option
  	{ USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d01, 0xff) },			/* D-Link DWM-156 (variant) */
  	{ USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d02, 0xff) },
  	{ USB_DEVICE_INTERFACE_CLASS(0x2001, 0x7d03, 0xff) },
diff --git a/target/linux/generic/backport-4.14/030-v4.17-0001-usb-dwc2-add-support-for-host-mode-external-vbus-sup.patch b/target/linux/generic/backport-4.14/030-v4.17-0001-usb-dwc2-add-support-for-host-mode-external-vbus-sup.patch
index 078c9a6d89..ecdaf92408 100644
--- a/target/linux/generic/backport-4.14/030-v4.17-0001-usb-dwc2-add-support-for-host-mode-external-vbus-sup.patch
+++ b/target/linux/generic/backport-4.14/030-v4.17-0001-usb-dwc2-add-support-for-host-mode-external-vbus-sup.patch
@@ -21,7 +21,7 @@ Signed-off-by: Felipe Balbi <felipe.balbi at linux.intel.com>
 
 --- a/drivers/usb/dwc2/core.h
 +++ b/drivers/usb/dwc2/core.h
-@@ -777,6 +777,7 @@ struct dwc2_hregs_backup {
+@@ -779,6 +779,7 @@ struct dwc2_hregs_backup {
   * @plat:               The platform specific configuration data. This can be
   *                      removed once all SoCs support usb transceiver.
   * @supplies:           Definition of USB power supplies
@@ -29,7 +29,7 @@ Signed-off-by: Felipe Balbi <felipe.balbi at linux.intel.com>
   * @phyif:              PHY interface width
   * @lock:		Spinlock that protects all the driver data structures
   * @priv:		Stores a pointer to the struct usb_hcd
-@@ -914,6 +915,7 @@ struct dwc2_hsotg {
+@@ -916,6 +917,7 @@ struct dwc2_hsotg {
  	struct usb_phy *uphy;
  	struct dwc2_hsotg_plat *plat;
  	struct regulator_bulk_data supplies[DWC2_NUM_SUPPLIES];
diff --git a/target/linux/generic/backport-4.14/336-v4.15-netfilter-exit_net-cleanup-check-added.patch b/target/linux/generic/backport-4.14/336-v4.15-netfilter-exit_net-cleanup-check-added.patch
index ee508f473a..79f4342d7e 100644
--- a/target/linux/generic/backport-4.14/336-v4.15-netfilter-exit_net-cleanup-check-added.patch
+++ b/target/linux/generic/backport-4.14/336-v4.15-netfilter-exit_net-cleanup-check-added.patch
@@ -80,7 +80,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  static void nfnl_queue_net_exit_batch(struct list_head *net_exit_list)
 --- a/net/netfilter/x_tables.c
 +++ b/net/netfilter/x_tables.c
-@@ -1781,8 +1781,17 @@ static int __net_init xt_net_init(struct
+@@ -1784,8 +1784,17 @@ static int __net_init xt_net_init(struct
  	return 0;
  }
  
diff --git a/target/linux/generic/hack-4.14/204-module_strip.patch b/target/linux/generic/hack-4.14/204-module_strip.patch
index 9d8f0f9af8..a8619edbfc 100644
--- a/target/linux/generic/hack-4.14/204-module_strip.patch
+++ b/target/linux/generic/hack-4.14/204-module_strip.patch
@@ -114,7 +114,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  config MODULES_TREE_LOOKUP
 --- a/kernel/module.c
 +++ b/kernel/module.c
-@@ -3039,9 +3039,11 @@ static struct module *setup_load_info(st
+@@ -3068,9 +3068,11 @@ static struct module *setup_load_info(st
  
  static int check_modinfo(struct module *mod, struct load_info *info, int flags)
  {
@@ -127,7 +127,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (flags & MODULE_INIT_IGNORE_VERMAGIC)
  		modmagic = NULL;
  
-@@ -3062,6 +3064,7 @@ static int check_modinfo(struct module *
+@@ -3091,6 +3093,7 @@ static int check_modinfo(struct module *
  				mod->name);
  		add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK);
  	}
diff --git a/target/linux/generic/hack-4.14/902-debloat_proc.patch b/target/linux/generic/hack-4.14/902-debloat_proc.patch
index 222533c42b..b426b07573 100644
--- a/target/linux/generic/hack-4.14/902-debloat_proc.patch
+++ b/target/linux/generic/hack-4.14/902-debloat_proc.patch
@@ -243,7 +243,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  }
 --- a/mm/vmstat.c
 +++ b/mm/vmstat.c
-@@ -1951,10 +1951,12 @@ void __init init_mm_internals(void)
+@@ -1954,10 +1954,12 @@ void __init init_mm_internals(void)
  	start_shepherd_timer();
  #endif
  #ifdef CONFIG_PROC_FS
diff --git a/target/linux/generic/hack-4.14/911-kobject_add_broadcast_uevent.patch b/target/linux/generic/hack-4.14/911-kobject_add_broadcast_uevent.patch
index bf46428854..4788828d4e 100644
--- a/target/linux/generic/hack-4.14/911-kobject_add_broadcast_uevent.patch
+++ b/target/linux/generic/hack-4.14/911-kobject_add_broadcast_uevent.patch
@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #endif /* _KOBJECT_H_ */
 --- a/lib/kobject_uevent.c
 +++ b/lib/kobject_uevent.c
-@@ -602,6 +602,43 @@ int add_uevent_var(struct kobj_uevent_en
+@@ -603,6 +603,43 @@ int add_uevent_var(struct kobj_uevent_en
  EXPORT_SYMBOL_GPL(add_uevent_var);
  
  #if defined(CONFIG_NET)
diff --git a/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
index f4173ae4dc..75215e7a49 100644
--- a/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
+++ b/target/linux/generic/pending-4.14/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
@@ -143,7 +143,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	}
  	return &ip6n->tnls[prio][h];
  }
-@@ -383,6 +394,12 @@ ip6_tnl_dev_uninit(struct net_device *de
+@@ -382,6 +393,12 @@ ip6_tnl_dev_uninit(struct net_device *de
  	struct net *net = t->net;
  	struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id);
  
@@ -156,7 +156,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	if (dev == ip6n->fb_tnl_dev)
  		RCU_INIT_POINTER(ip6n->tnls_wc[0], NULL);
  	else
-@@ -779,6 +796,107 @@ int ip6_tnl_rcv_ctl(struct ip6_tnl *t,
+@@ -778,6 +795,107 @@ int ip6_tnl_rcv_ctl(struct ip6_tnl *t,
  }
  EXPORT_SYMBOL_GPL(ip6_tnl_rcv_ctl);
  
@@ -264,7 +264,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  static int __ip6_tnl_rcv(struct ip6_tnl *tunnel, struct sk_buff *skb,
  			 const struct tnl_ptk_info *tpi,
  			 struct metadata_dst *tun_dst,
-@@ -831,6 +949,27 @@ static int __ip6_tnl_rcv(struct ip6_tnl
+@@ -830,6 +948,27 @@ static int __ip6_tnl_rcv(struct ip6_tnl
  	skb_reset_network_header(skb);
  	memset(skb->cb, 0, sizeof(struct inet6_skb_parm));
  
@@ -292,7 +292,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	__skb_tunnel_rx(skb, tunnel->dev, tunnel->net);
  
  	err = dscp_ecn_decapsulate(tunnel, ipv6h, skb);
-@@ -971,6 +1110,7 @@ static void init_tel_txopt(struct ipv6_t
+@@ -970,6 +1109,7 @@ static void init_tel_txopt(struct ipv6_t
  	opt->ops.opt_nflen = 8;
  }
  
@@ -300,7 +300,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  /**
   * ip6_tnl_addr_conflict - compare packet addresses to tunnel's own
   *   @t: the outgoing tunnel device
-@@ -1313,6 +1453,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
+@@ -1312,6 +1452,7 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
  {
  	struct ip6_tnl *t = netdev_priv(dev);
  	struct ipv6hdr *ipv6h;
@@ -308,7 +308,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	int encap_limit = -1;
  	__u16 offset;
  	struct flowi6 fl6;
-@@ -1380,6 +1521,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
+@@ -1379,6 +1520,18 @@ ip6ip6_tnl_xmit(struct sk_buff *skb, str
  	fl6.flowi6_uid = sock_net_uid(dev_net(dev), NULL);
  	dsfield = INET_ECN_encapsulate(dsfield, ipv6_get_dsfield(ipv6h));
  
@@ -327,7 +327,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6))
  		return -1;
  
-@@ -1506,6 +1659,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
+@@ -1505,6 +1658,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
  	t->parms.link = p->link;
  	t->parms.proto = p->proto;
  	t->parms.fwmark = p->fwmark;
@@ -342,7 +342,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	dst_cache_reset(&t->dst_cache);
  	ip6_tnl_link_config(t);
  	return 0;
-@@ -1544,6 +1705,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
+@@ -1543,6 +1704,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
  	p->flowinfo = u->flowinfo;
  	p->link = u->link;
  	p->proto = u->proto;
@@ -350,7 +350,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	memcpy(p->name, u->name, sizeof(u->name));
  }
  
-@@ -1928,6 +2090,15 @@ static int ip6_tnl_validate(struct nlatt
+@@ -1927,6 +2089,15 @@ static int ip6_tnl_validate(struct nlatt
  	return 0;
  }
  
@@ -366,7 +366,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  static void ip6_tnl_netlink_parms(struct nlattr *data[],
  				  struct __ip6_tnl_parm *parms)
  {
-@@ -1965,6 +2136,46 @@ static void ip6_tnl_netlink_parms(struct
+@@ -1964,6 +2135,46 @@ static void ip6_tnl_netlink_parms(struct
  
  	if (data[IFLA_IPTUN_FWMARK])
  		parms->fwmark = nla_get_u32(data[IFLA_IPTUN_FWMARK]);
@@ -413,7 +413,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  }
  
  static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[],
-@@ -2080,6 +2291,12 @@ static void ip6_tnl_dellink(struct net_d
+@@ -2079,6 +2290,12 @@ static void ip6_tnl_dellink(struct net_d
  
  static size_t ip6_tnl_get_size(const struct net_device *dev)
  {
@@ -426,7 +426,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	return
  		/* IFLA_IPTUN_LINK */
  		nla_total_size(4) +
-@@ -2109,6 +2326,24 @@ static size_t ip6_tnl_get_size(const str
+@@ -2108,6 +2325,24 @@ static size_t ip6_tnl_get_size(const str
  		nla_total_size(0) +
  		/* IFLA_IPTUN_FWMARK */
  		nla_total_size(4) +
@@ -451,7 +451,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  		0;
  }
  
-@@ -2116,6 +2351,9 @@ static int ip6_tnl_fill_info(struct sk_b
+@@ -2115,6 +2350,9 @@ static int ip6_tnl_fill_info(struct sk_b
  {
  	struct ip6_tnl *tunnel = netdev_priv(dev);
  	struct __ip6_tnl_parm *parm = &tunnel->parms;
@@ -461,7 +461,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  
  	if (nla_put_u32(skb, IFLA_IPTUN_LINK, parm->link) ||
  	    nla_put_in6_addr(skb, IFLA_IPTUN_LOCAL, &parm->laddr) ||
-@@ -2125,9 +2363,27 @@ static int ip6_tnl_fill_info(struct sk_b
+@@ -2124,9 +2362,27 @@ static int ip6_tnl_fill_info(struct sk_b
  	    nla_put_be32(skb, IFLA_IPTUN_FLOWINFO, parm->flowinfo) ||
  	    nla_put_u32(skb, IFLA_IPTUN_FLAGS, parm->flags) ||
  	    nla_put_u8(skb, IFLA_IPTUN_PROTO, parm->proto) ||
@@ -490,7 +490,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	if (nla_put_u16(skb, IFLA_IPTUN_ENCAP_TYPE, tunnel->encap.type) ||
  	    nla_put_be16(skb, IFLA_IPTUN_ENCAP_SPORT, tunnel->encap.sport) ||
  	    nla_put_be16(skb, IFLA_IPTUN_ENCAP_DPORT, tunnel->encap.dport) ||
-@@ -2167,6 +2423,7 @@ static const struct nla_policy ip6_tnl_p
+@@ -2166,6 +2422,7 @@ static const struct nla_policy ip6_tnl_p
  	[IFLA_IPTUN_ENCAP_DPORT]	= { .type = NLA_U16 },
  	[IFLA_IPTUN_COLLECT_METADATA]	= { .type = NLA_FLAG },
  	[IFLA_IPTUN_FWMARK]		= { .type = NLA_U32 },
diff --git a/target/linux/lantiq/patches-4.14/0001-MIPS-lantiq-add-pcie-driver.patch b/target/linux/lantiq/patches-4.14/0001-MIPS-lantiq-add-pcie-driver.patch
index 671577f584..071f166a1d 100644
--- a/target/linux/lantiq/patches-4.14/0001-MIPS-lantiq-add-pcie-driver.patch
+++ b/target/linux/lantiq/patches-4.14/0001-MIPS-lantiq-add-pcie-driver.patch
@@ -4143,7 +4143,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
 +
 --- a/arch/mips/pci/pci-legacy.c
 +++ b/arch/mips/pci/pci-legacy.c
-@@ -313,3 +313,30 @@ char *__init pcibios_setup(char *str)
+@@ -318,3 +318,30 @@ char *__init pcibios_setup(char *str)
  		return pcibios_plat_setup(str);
  	return str;
  }
diff --git a/target/linux/layerscape/patches-4.14/807-usb-support-layerscape.patch b/target/linux/layerscape/patches-4.14/807-usb-support-layerscape.patch
index 6371e99575..4ea197ed66 100644
--- a/target/linux/layerscape/patches-4.14/807-usb-support-layerscape.patch
+++ b/target/linux/layerscape/patches-4.14/807-usb-support-layerscape.patch
@@ -528,7 +528,7 @@ Signed-off-by: Zhao Chenhui <chenhui.zhao at freescale.com>
  		reg &= ~DWC3_DCTL_INITU2ENA;
 --- a/drivers/usb/dwc3/gadget.c
 +++ b/drivers/usb/dwc3/gadget.c
-@@ -3231,6 +3231,7 @@ int dwc3_gadget_init(struct dwc3 *dwc)
+@@ -3245,6 +3245,7 @@ int dwc3_gadget_init(struct dwc3 *dwc)
  {
  	int ret;
  	int irq;
@@ -536,7 +536,7 @@ Signed-off-by: Zhao Chenhui <chenhui.zhao at freescale.com>
  
  	irq = dwc3_gadget_get_irq(dwc);
  	if (irq < 0) {
-@@ -3309,6 +3310,12 @@ int dwc3_gadget_init(struct dwc3 *dwc)
+@@ -3323,6 +3324,12 @@ int dwc3_gadget_init(struct dwc3 *dwc)
  
  	dwc3_gadget_set_speed(&dwc->gadget, dwc->maximum_speed);
  
diff --git a/target/linux/mediatek/patches-4.14/0042-net-next-mediatek-honour-special-tag-bit-inside-RX-D.patch b/target/linux/mediatek/patches-4.14/0042-net-next-mediatek-honour-special-tag-bit-inside-RX-D.patch
index 8163e4475d..5d806f307e 100644
--- a/target/linux/mediatek/patches-4.14/0042-net-next-mediatek-honour-special-tag-bit-inside-RX-D.patch
+++ b/target/linux/mediatek/patches-4.14/0042-net-next-mediatek-honour-special-tag-bit-inside-RX-D.patch
@@ -40,7 +40,7 @@ Signed-off-by: John Crispin <john at phrozen.org>
  			     !eth->netdev[mac]))
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -287,6 +287,7 @@
+@@ -288,6 +288,7 @@
  
  /* QDMA descriptor rxd4 */
  #define RX_DMA_L4_VALID		BIT(24)
diff --git a/target/linux/mediatek/patches-4.14/0175-net-mediatek-remove-superfluous-pin-setup-for-MT7622.patch b/target/linux/mediatek/patches-4.14/0175-net-mediatek-remove-superfluous-pin-setup-for-MT7622.patch
index 37c03fed88..1c041cd71d 100644
--- a/target/linux/mediatek/patches-4.14/0175-net-mediatek-remove-superfluous-pin-setup-for-MT7622.patch
+++ b/target/linux/mediatek/patches-4.14/0175-net-mediatek-remove-superfluous-pin-setup-for-MT7622.patch
@@ -86,7 +86,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  const struct of_device_id of_mtk_match[] = {
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -574,10 +574,13 @@ struct mtk_rx_ring {
+@@ -575,10 +575,13 @@ struct mtk_rx_ring {
   * @caps			Flags shown the extra capability for the SoC
   * @required_clks		Flags shown the bitmap for required clocks on
   *				the target SoC
diff --git a/target/linux/ramips/patches-4.14/0002-MIPS-pci-rt2880-set-pci-controller-of_node.patch b/target/linux/ramips/patches-4.14/0002-MIPS-pci-rt2880-set-pci-controller-of_node.patch
index 7ac092cfb0..02b9b4d4aa 100644
--- a/target/linux/ramips/patches-4.14/0002-MIPS-pci-rt2880-set-pci-controller-of_node.patch
+++ b/target/linux/ramips/patches-4.14/0002-MIPS-pci-rt2880-set-pci-controller-of_node.patch
@@ -21,7 +21,7 @@ Cc: linux-kernel at vger.kernel.org
 
 --- a/arch/mips/pci/pci-rt2880.c
 +++ b/arch/mips/pci/pci-rt2880.c
-@@ -246,6 +246,8 @@ static int rt288x_pci_probe(struct platf
+@@ -233,6 +233,8 @@ static int rt288x_pci_probe(struct platf
  	rt2880_pci_write_u32(PCI_BASE_ADDRESS_0, 0x08000000);
  	(void) rt2880_pci_read_u32(PCI_BASE_ADDRESS_0);
  
diff --git a/target/linux/ramips/patches-4.14/0007-MIPS-ralink-copy-the-commandline-from-the-devicetree.patch b/target/linux/ramips/patches-4.14/0007-MIPS-ralink-copy-the-commandline-from-the-devicetree.patch
index c05ee8018d..e03496a01a 100644
--- a/target/linux/ramips/patches-4.14/0007-MIPS-ralink-copy-the-commandline-from-the-devicetree.patch
+++ b/target/linux/ramips/patches-4.14/0007-MIPS-ralink-copy-the-commandline-from-the-devicetree.patch
@@ -10,7 +10,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
 
 --- a/arch/mips/ralink/of.c
 +++ b/arch/mips/ralink/of.c
-@@ -82,6 +82,8 @@ void __init plat_mem_setup(void)
+@@ -84,6 +84,8 @@ void __init plat_mem_setup(void)
  
  	__dt_setup_arch(dtb);
  
diff --git a/target/linux/ramips/patches-4.14/0048-asoc-add-mt7620-support.patch b/target/linux/ramips/patches-4.14/0048-asoc-add-mt7620-support.patch
index 1834e88538..dd68735b8a 100644
--- a/target/linux/ramips/patches-4.14/0048-asoc-add-mt7620-support.patch
+++ b/target/linux/ramips/patches-4.14/0048-asoc-add-mt7620-support.patch
@@ -18,24 +18,6 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
  create mode 100644 sound/soc/ralink/mt7620-i2s.c
  create mode 100644 sound/soc/ralink/mt7620-wm8960.c
 
---- a/arch/mips/ralink/of.c
-+++ b/arch/mips/ralink/of.c
-@@ -15,6 +15,7 @@
- #include <linux/of_fdt.h>
- #include <linux/kernel.h>
- #include <linux/bootmem.h>
-+#include <linux/module.h>
- #include <linux/of_platform.h>
- #include <linux/of_address.h>
- 
-@@ -26,6 +27,7 @@
- #include "common.h"
- 
- __iomem void *rt_sysc_membase;
-+EXPORT_SYMBOL(rt_sysc_membase);
- __iomem void *rt_memc_membase;
- 
- __iomem void *plat_of_remap_node(const char *node)
 --- a/sound/soc/Kconfig
 +++ b/sound/soc/Kconfig
 @@ -59,6 +59,7 @@ source "sound/soc/mxs/Kconfig"


From lede-commits at lists.infradead.org  Sun Jun  6 08:58:57 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 06 Jun 2021 11:58:57 -0400
Subject: [openwrt/openwrt] mac80211: Update to backports version 4.19.193-test1
In-Reply-To: <162299513691.18785.481979176750504337@git-01.infra.openwrt.org>
References: <162299513691.18785.481979176750504337@git-01.infra.openwrt.org>
Message-ID: <mailman.3426.1622995142.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-19.07:
https://git.openwrt.org/ffd4452f8b241d1d5b5ea8a56206f51702bbd6c5

commit ffd4452f8b241d1d5b5ea8a56206f51702bbd6c5
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Jun 6 00:36:57 2021 +0200

    mac80211: Update to backports version 4.19.193-test1
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/mac80211/Makefile                     |  6 +++---
 ...IO-controlling-support-for-various-chipsets.patch |  2 +-
 .../mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch   |  2 +-
 .../mwl/940-mwl8k_init_devices_synchronously.patch   |  4 ++--
 .../subsys/100-remove-cryptoapi-dependencies.patch   | 20 ++++++++++----------
 .../patches/subsys/150-disable_addr_notifier.patch   |  6 +++---
 ...0211-add-stop-start-logic-for-software-TXQs.patch |  6 +++---
 ...minstrel-merge-with-minstrel_ht-always-enab.patch |  4 ++--
 .../subsys/320-mac80211-Add-TXQ-scheduling-API.patch |  8 ++++----
 ...Add-airtime-accounting-and-scheduling-to-TX.patch | 14 +++++++-------
 ...50-mac80211-add-hdrlen-to-ieee80211_tx_data.patch | 16 ++++++++--------
 ...mac80211-add-TX_NEEDS_ALIGNED4_SKBS-hw-flag.patch | 10 +++++-----
 ...set-NETIF_F_LLTX-when-using-intermediate-tx.patch |  2 +-
 ...add-IEEE80211_KEY_FLAG_GENERATE_MMIE-to-iee.patch |  4 ++--
 ...IBSS-send-deauth-when-expiring-inactive-STA.patch | 10 +++++-----
 .../subsys/522-mac80211_configure_antenna_gain.patch |  2 +-
 16 files changed, 58 insertions(+), 58 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index e7ab90d908..9551ed002d 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=mac80211
 
-PKG_VERSION:=4.19.189-1
+PKG_VERSION:=4.19.193-1
 PKG_RELEASE:=1
-PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v4.19.189/
-PKG_HASH:=34a53f743b43cbb25c8e665c3932d8cdd79aa3c081b9e573fae63b5a7407422c
+PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v4.19.193/
+PKG_HASH:=560c0ce9e4079fd26d046e188453e008a5e766e5409d950c4749a23da53d6d0a
 
 PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
diff --git a/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
index a5ffed6979..94ee41c9e2 100644
--- a/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
+++ b/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
@@ -464,7 +464,7 @@ v13:
  {
 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
 +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
-@@ -3996,6 +3996,8 @@ static const struct wmi_ops wmi_tlv_ops
+@@ -3999,6 +3999,8 @@ static const struct wmi_ops wmi_tlv_ops
  	.gen_echo = ath10k_wmi_tlv_op_gen_echo,
  	.gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf,
  	.gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable,
diff --git a/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch b/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch
index 9c5870bef8..91ba189978 100644
--- a/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch
+++ b/package/kernel/mac80211/patches/mwl/700-mwl8k-missing-pci-id-for-WNR854T.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/marvell/mwl8k.c
 +++ b/drivers/net/wireless/marvell/mwl8k.c
-@@ -5691,6 +5691,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
+@@ -5692,6 +5692,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
  MODULE_FIRMWARE(MWL8K_8366_AP_FW(MWL8K_8366_AP_FW_API));
  
  static const struct pci_device_id mwl8k_pci_id_table[] = {
diff --git a/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch b/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch
index ca0b37a8a7..e66d115224 100644
--- a/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch
+++ b/package/kernel/mac80211/patches/mwl/940-mwl8k_init_devices_synchronously.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/marvell/mwl8k.c
 +++ b/drivers/net/wireless/marvell/mwl8k.c
-@@ -6276,6 +6276,8 @@ static int mwl8k_probe(struct pci_dev *p
+@@ -6277,6 +6277,8 @@ static int mwl8k_probe(struct pci_dev *p
  
  	priv->running_bsses = 0;
  
@@ -9,7 +9,7 @@
  	return rc;
  
  err_stop_firmware:
-@@ -6309,8 +6311,6 @@ static void mwl8k_remove(struct pci_dev
+@@ -6310,8 +6312,6 @@ static void mwl8k_remove(struct pci_dev
  		return;
  	priv = hw->priv;
  
diff --git a/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch b/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch
index 0cedfb3ac6..540ad5025e 100644
--- a/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch
+++ b/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch
@@ -385,7 +385,7 @@
  #endif /* AES_GCM_H */
 --- a/net/mac80211/wpa.c
 +++ b/net/mac80211/wpa.c
-@@ -314,7 +314,8 @@ ieee80211_crypto_tkip_decrypt(struct iee
+@@ -315,7 +315,8 @@ ieee80211_crypto_tkip_decrypt(struct iee
  }
  
  
@@ -395,7 +395,7 @@
  {
  	__le16 mask_fc;
  	int a4_included, mgmt;
-@@ -344,14 +345,8 @@ static void ccmp_special_blocks(struct s
+@@ -345,14 +346,8 @@ static void ccmp_special_blocks(struct s
  	else
  		qos_tid = 0;
  
@@ -412,7 +412,7 @@
  
  	/* Nonce: Nonce Flags | A2 | PN
  	 * Nonce Flags: Priority (b0..b3) | Management (b4) | Reserved (b5..b7)
-@@ -359,6 +354,8 @@ static void ccmp_special_blocks(struct s
+@@ -360,6 +355,8 @@ static void ccmp_special_blocks(struct s
  	b_0[1] = qos_tid | (mgmt << 4);
  	memcpy(&b_0[2], hdr->addr2, ETH_ALEN);
  	memcpy(&b_0[8], pn, IEEE80211_CCMP_PN_LEN);
@@ -421,7 +421,7 @@
  
  	/* AAD (extra authenticate-only data) / masked 802.11 header
  	 * FC | A1 | A2 | A3 | SC | [A4] | [QC] */
-@@ -415,7 +412,7 @@ static int ccmp_encrypt_skb(struct ieee8
+@@ -416,7 +413,7 @@ static int ccmp_encrypt_skb(struct ieee8
  	u8 *pos;
  	u8 pn[6];
  	u64 pn64;
@@ -430,7 +430,7 @@
  	u8 b_0[AES_BLOCK_SIZE];
  
  	if (info->control.hw_key &&
-@@ -470,9 +467,11 @@ static int ccmp_encrypt_skb(struct ieee8
+@@ -471,9 +468,11 @@ static int ccmp_encrypt_skb(struct ieee8
  		return 0;
  
  	pos += IEEE80211_CCMP_HDR_LEN;
@@ -445,7 +445,7 @@
  }
  
  
-@@ -545,13 +544,13 @@ ieee80211_crypto_ccmp_decrypt(struct iee
+@@ -546,13 +545,13 @@ ieee80211_crypto_ccmp_decrypt(struct iee
  			u8 aad[2 * AES_BLOCK_SIZE];
  			u8 b_0[AES_BLOCK_SIZE];
  			/* hardware didn't decrypt/verify MIC */
@@ -461,7 +461,7 @@
  				return RX_DROP_UNUSABLE;
  		}
  
-@@ -646,7 +645,7 @@ static int gcmp_encrypt_skb(struct ieee8
+@@ -649,7 +648,7 @@ static int gcmp_encrypt_skb(struct ieee8
  	u8 *pos;
  	u8 pn[6];
  	u64 pn64;
@@ -470,7 +470,7 @@
  	u8 j_0[AES_BLOCK_SIZE];
  
  	if (info->control.hw_key &&
-@@ -703,8 +702,10 @@ static int gcmp_encrypt_skb(struct ieee8
+@@ -706,8 +705,10 @@ static int gcmp_encrypt_skb(struct ieee8
  
  	pos += IEEE80211_GCMP_HDR_LEN;
  	gcmp_special_blocks(skb, pn, j_0, aad);
@@ -483,7 +483,7 @@
  }
  
  ieee80211_tx_result
-@@ -1127,9 +1128,9 @@ ieee80211_crypto_aes_gmac_encrypt(struct
+@@ -1132,9 +1133,9 @@ ieee80211_crypto_aes_gmac_encrypt(struct
  	struct ieee80211_key *key = tx->key;
  	struct ieee80211_mmie_16 *mmie;
  	struct ieee80211_hdr *hdr;
@@ -495,7 +495,7 @@
  
  	if (WARN_ON(skb_queue_len(&tx->skbs) != 1))
  		return TX_DROP;
-@@ -1175,7 +1176,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct
+@@ -1180,7 +1181,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct
  	struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
  	struct ieee80211_key *key = rx->key;
  	struct ieee80211_mmie_16 *mmie;
diff --git a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch
index ab80887bde..c954a8ae1d 100644
--- a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch
+++ b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch
@@ -18,7 +18,7 @@
  static int ieee80211_ifa6_changed(struct notifier_block *nb,
  				  unsigned long data, void *arg)
  {
-@@ -1179,14 +1179,14 @@ int ieee80211_register_hw(struct ieee802
+@@ -1182,14 +1182,14 @@ int ieee80211_register_hw(struct ieee802
  
  	rtnl_unlock();
  
@@ -35,7 +35,7 @@
  	local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed;
  	result = register_inet6addr_notifier(&local->ifa6_notifier);
  	if (result)
-@@ -1195,13 +1195,13 @@ int ieee80211_register_hw(struct ieee802
+@@ -1198,13 +1198,13 @@ int ieee80211_register_hw(struct ieee802
  
  	return 0;
  
@@ -52,7 +52,7 @@
   fail_ifa:
  #endif
  	rtnl_lock();
-@@ -1230,10 +1230,10 @@ void ieee80211_unregister_hw(struct ieee
+@@ -1233,10 +1233,10 @@ void ieee80211_unregister_hw(struct ieee
  	tasklet_kill(&local->tx_pending_tasklet);
  	tasklet_kill(&local->tasklet);
  
diff --git a/package/kernel/mac80211/patches/subsys/300-mac80211-add-stop-start-logic-for-software-TXQs.patch b/package/kernel/mac80211/patches/subsys/300-mac80211-add-stop-start-logic-for-software-TXQs.patch
index b4fbf136ee..d925fcd514 100644
--- a/package/kernel/mac80211/patches/subsys/300-mac80211-add-stop-start-logic-for-software-TXQs.patch
+++ b/package/kernel/mac80211/patches/subsys/300-mac80211-add-stop-start-logic-for-software-TXQs.patch
@@ -61,7 +61,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  };
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -818,6 +818,7 @@ enum txq_info_flags {
+@@ -807,6 +807,7 @@ enum txq_info_flags {
  	IEEE80211_TXQ_STOP,
  	IEEE80211_TXQ_AMPDU,
  	IEEE80211_TXQ_NO_AMSDU,
@@ -69,7 +69,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  };
  
  /**
-@@ -1227,6 +1228,7 @@ struct ieee80211_local {
+@@ -1214,6 +1215,7 @@ struct ieee80211_local {
  
  	struct sk_buff_head pending[IEEE80211_MAX_QUEUES];
  	struct tasklet_struct tx_pending_tasklet;
@@ -77,7 +77,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  
  	atomic_t agg_queue_stop[IEEE80211_MAX_QUEUES];
  
-@@ -2048,6 +2050,7 @@ void ieee80211_txq_remove_vlan(struct ie
+@@ -2035,6 +2037,7 @@ void ieee80211_txq_remove_vlan(struct ie
  			       struct ieee80211_sub_if_data *sdata);
  void ieee80211_fill_txq_stats(struct cfg80211_txq_stats *txqstats,
  			      struct txq_info *txqi);
diff --git a/package/kernel/mac80211/patches/subsys/305-mac80211-minstrel-merge-with-minstrel_ht-always-enab.patch b/package/kernel/mac80211/patches/subsys/305-mac80211-minstrel-merge-with-minstrel_ht-always-enab.patch
index 75ba462070..3866b02dfb 100644
--- a/package/kernel/mac80211/patches/subsys/305-mac80211-minstrel-merge-with-minstrel_ht-always-enab.patch
+++ b/package/kernel/mac80211/patches/subsys/305-mac80211-minstrel-merge-with-minstrel_ht-always-enab.patch
@@ -67,7 +67,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  ccflags-y += -DDEBUG
 --- a/net/mac80211/main.c
 +++ b/net/mac80211/main.c
-@@ -1319,18 +1319,12 @@ static int __init ieee80211_init(void)
+@@ -1322,18 +1322,12 @@ static int __init ieee80211_init(void)
  	if (ret)
  		return ret;
  
@@ -86,7 +86,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	rc80211_minstrel_exit();
  
  	return ret;
-@@ -1338,7 +1332,6 @@ static int __init ieee80211_init(void)
+@@ -1341,7 +1335,6 @@ static int __init ieee80211_init(void)
  
  static void __exit ieee80211_exit(void)
  {
diff --git a/package/kernel/mac80211/patches/subsys/320-mac80211-Add-TXQ-scheduling-API.patch b/package/kernel/mac80211/patches/subsys/320-mac80211-Add-TXQ-scheduling-API.patch
index 3c428823c1..7e646f2766 100644
--- a/package/kernel/mac80211/patches/subsys/320-mac80211-Add-TXQ-scheduling-API.patch
+++ b/package/kernel/mac80211/patches/subsys/320-mac80211-Add-TXQ-scheduling-API.patch
@@ -145,7 +145,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  				struct cfg80211_nan_conf *conf)
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -829,6 +829,8 @@ enum txq_info_flags {
+@@ -818,6 +818,8 @@ enum txq_info_flags {
   *	a fq_flow which is already owned by a different tin
   * @def_cvars: codel vars for @def_flow
   * @frags: used to keep fragments created after dequeue
@@ -154,7 +154,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
   */
  struct txq_info {
  	struct fq_tin tin;
-@@ -836,6 +838,8 @@ struct txq_info {
+@@ -825,6 +827,8 @@ struct txq_info {
  	struct codel_vars def_cvars;
  	struct codel_stats cstats;
  	struct sk_buff_head frags;
@@ -163,7 +163,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	unsigned long flags;
  
  	/* keep last! */
-@@ -1128,6 +1132,11 @@ struct ieee80211_local {
+@@ -1115,6 +1119,11 @@ struct ieee80211_local {
  	struct codel_vars *cvars;
  	struct codel_params cparams;
  
@@ -191,7 +191,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  
 --- a/net/mac80211/sta_info.c
 +++ b/net/mac80211/sta_info.c
-@@ -1261,7 +1261,7 @@ void ieee80211_sta_ps_deliver_wakeup(str
+@@ -1265,7 +1265,7 @@ void ieee80211_sta_ps_deliver_wakeup(str
  			if (!txq_has_queue(sta->sta.txq[i]))
  				continue;
  
diff --git a/package/kernel/mac80211/patches/subsys/322-mac80211-Add-airtime-accounting-and-scheduling-to-TX.patch b/package/kernel/mac80211/patches/subsys/322-mac80211-Add-airtime-accounting-and-scheduling-to-TX.patch
index 666dff8aa0..aac28977f1 100644
--- a/package/kernel/mac80211/patches/subsys/322-mac80211-Add-airtime-accounting-and-scheduling-to-TX.patch
+++ b/package/kernel/mac80211/patches/subsys/322-mac80211-Add-airtime-accounting-and-scheduling-to-TX.patch
@@ -240,7 +240,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  				   sta->debugfs_dir,
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -1137,6 +1137,8 @@ struct ieee80211_local {
+@@ -1124,6 +1124,8 @@ struct ieee80211_local {
  	struct list_head active_txqs[IEEE80211_NUM_ACS];
  	u16 schedule_round[IEEE80211_NUM_ACS];
  
@@ -259,7 +259,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  
  	INIT_LIST_HEAD(&local->chanctx_list);
  	mutex_init(&local->chanctx_mtx);
-@@ -1153,6 +1154,9 @@ int ieee80211_register_hw(struct ieee802
+@@ -1156,6 +1157,9 @@ int ieee80211_register_hw(struct ieee802
  	if (!local->hw.max_nan_de_entries)
  		local->hw.max_nan_de_entries = IEEE80211_MAX_NAN_INSTANCE_ID;
  
@@ -289,7 +289,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  		}
  	}
  
-@@ -399,9 +396,12 @@ struct sta_info *sta_info_alloc(struct i
+@@ -401,9 +398,12 @@ struct sta_info *sta_info_alloc(struct i
  	if (sta_prepare_rate_control(local, sta, gfp))
  		goto free_txq;
  
@@ -302,7 +302,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	}
  
  	for (i = 0; i < IEEE80211_NUM_TIDS; i++)
-@@ -1838,6 +1838,27 @@ void ieee80211_sta_set_buffered(struct i
+@@ -1842,6 +1842,27 @@ void ieee80211_sta_set_buffered(struct i
  }
  EXPORT_SYMBOL(ieee80211_sta_set_buffered);
  
@@ -330,7 +330,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  int sta_info_move_state(struct sta_info *sta,
  			enum ieee80211_sta_state new_state)
  {
-@@ -2208,6 +2229,23 @@ void sta_set_sinfo(struct sta_info *sta,
+@@ -2212,6 +2233,23 @@ void sta_set_sinfo(struct sta_info *sta,
  		sinfo->filled |= BIT_ULL(NL80211_STA_INFO_TX_FAILED);
  	}
  
@@ -356,7 +356,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  		for_each_possible_cpu(cpu) {
 --- a/net/mac80211/sta_info.h
 +++ b/net/mac80211/sta_info.h
-@@ -127,6 +127,16 @@ enum ieee80211_agg_stop_reason {
+@@ -128,6 +128,16 @@ enum ieee80211_agg_stop_reason {
  	AGG_STOP_DESTROY_STA,
  };
  
@@ -373,7 +373,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  struct sta_info;
  
  /**
-@@ -563,6 +573,9 @@ struct sta_info {
+@@ -593,6 +603,9 @@ struct sta_info {
  	} tx_stats;
  	u16 tid_seq[IEEE80211_QOS_CTL_TID_MASK + 1];
  
diff --git a/package/kernel/mac80211/patches/subsys/350-mac80211-add-hdrlen-to-ieee80211_tx_data.patch b/package/kernel/mac80211/patches/subsys/350-mac80211-add-hdrlen-to-ieee80211_tx_data.patch
index a46710a94c..48d4db609f 100644
--- a/package/kernel/mac80211/patches/subsys/350-mac80211-add-hdrlen-to-ieee80211_tx_data.patch
+++ b/package/kernel/mac80211/patches/subsys/350-mac80211-add-hdrlen-to-ieee80211_tx_data.patch
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -179,6 +179,7 @@ struct ieee80211_tx_data {
+@@ -161,6 +161,7 @@ struct ieee80211_tx_data {
  	struct ieee80211_tx_rate rate;
  
  	unsigned int flags;
@@ -164,7 +164,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  			       size_t klen, u8 *data, size_t data_len);
 --- a/net/mac80211/wpa.c
 +++ b/net/mac80211/wpa.c
-@@ -44,7 +44,7 @@ ieee80211_tx_h_michael_mic_add(struct ie
+@@ -45,7 +45,7 @@ ieee80211_tx_h_michael_mic_add(struct ie
  	    skb->len < 24 || !ieee80211_is_data_present(hdr->frame_control))
  		return TX_CONTINUE;
  
@@ -173,7 +173,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (skb->len < hdrlen)
  		return TX_DROP;
  
-@@ -195,7 +195,6 @@ mic_fail_no_key:
+@@ -196,7 +196,6 @@ mic_fail_no_key:
  
  static int tkip_encrypt_skb(struct ieee80211_tx_data *tx, struct sk_buff *skb)
  {
@@ -181,7 +181,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	struct ieee80211_key *key = tx->key;
  	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
  	unsigned int hdrlen;
-@@ -210,7 +209,7 @@ static int tkip_encrypt_skb(struct ieee8
+@@ -211,7 +210,7 @@ static int tkip_encrypt_skb(struct ieee8
  		return 0;
  	}
  
@@ -190,7 +190,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	len = skb->len - hdrlen;
  
  	if (info->control.hw_key)
-@@ -428,7 +427,7 @@ static int ccmp_encrypt_skb(struct ieee8
+@@ -429,7 +428,7 @@ static int ccmp_encrypt_skb(struct ieee8
  		return 0;
  	}
  
@@ -199,7 +199,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	len = skb->len - hdrlen;
  
  	if (info->control.hw_key)
-@@ -660,7 +659,7 @@ static int gcmp_encrypt_skb(struct ieee8
+@@ -663,7 +662,7 @@ static int gcmp_encrypt_skb(struct ieee8
  		return 0;
  	}
  
@@ -208,7 +208,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	len = skb->len - hdrlen;
  
  	if (info->control.hw_key)
-@@ -800,7 +799,6 @@ static ieee80211_tx_result
+@@ -805,7 +804,6 @@ static ieee80211_tx_result
  ieee80211_crypto_cs_encrypt(struct ieee80211_tx_data *tx,
  			    struct sk_buff *skb)
  {
@@ -216,7 +216,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	struct ieee80211_key *key = tx->key;
  	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
  	int hdrlen;
-@@ -816,8 +814,7 @@ ieee80211_crypto_cs_encrypt(struct ieee8
+@@ -821,8 +819,7 @@ ieee80211_crypto_cs_encrypt(struct ieee8
  		     pskb_expand_head(skb, iv_len, 0, GFP_ATOMIC)))
  		return TX_DROP;
  
diff --git a/package/kernel/mac80211/patches/subsys/351-mac80211-add-TX_NEEDS_ALIGNED4_SKBS-hw-flag.patch b/package/kernel/mac80211/patches/subsys/351-mac80211-add-TX_NEEDS_ALIGNED4_SKBS-hw-flag.patch
index f6a9591c7f..68d34519f7 100644
--- a/package/kernel/mac80211/patches/subsys/351-mac80211-add-TX_NEEDS_ALIGNED4_SKBS-hw-flag.patch
+++ b/package/kernel/mac80211/patches/subsys/351-mac80211-add-TX_NEEDS_ALIGNED4_SKBS-hw-flag.patch
@@ -81,7 +81,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
   * mac80211 is capable of taking advantage of many hardware
 --- a/net/mac80211/iface.c
 +++ b/net/mac80211/iface.c
-@@ -1877,6 +1877,10 @@ int ieee80211_if_add(struct ieee80211_lo
+@@ -1873,6 +1873,10 @@ int ieee80211_if_add(struct ieee80211_lo
  					+ 8 /* rfc1042/bridge tunnel */
  					- ETH_HLEN /* ethernet hard_header_len */
  					+ IEEE80211_ENCRYPT_HEADROOM;
@@ -113,7 +113,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (!(mshdr->flags & MESH_FLAGS_AE)) {
 --- a/net/mac80211/rx.c
 +++ b/net/mac80211/rx.c
-@@ -2621,7 +2621,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
+@@ -2705,7 +2705,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
  	struct ieee80211_local *local = rx->local;
  	struct ieee80211_sub_if_data *sdata = rx->sdata;
  	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
@@ -122,7 +122,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	int tailroom = 0;
  
  	hdr = (struct ieee80211_hdr *) skb->data;
-@@ -2714,7 +2714,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
+@@ -2798,7 +2798,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
  	if (sdata->crypto_tx_tailroom_needed_cnt)
  		tailroom = IEEE80211_ENCRYPT_TAILROOM;
  
@@ -133,7 +133,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  				       sdata->encrypt_headroom,
  				  tailroom, GFP_ATOMIC);
  	if (!fwd_skb)
-@@ -2746,6 +2748,12 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
+@@ -2830,6 +2832,12 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
  		return RX_DROP_MONITOR;
  	}
  
@@ -148,7 +148,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
   out:
 --- a/net/mac80211/sta_info.h
 +++ b/net/mac80211/sta_info.h
-@@ -311,7 +311,7 @@ struct ieee80211_fast_tx {
+@@ -312,7 +312,7 @@ struct ieee80211_fast_tx {
  	u8 hdr_len;
  	u8 sa_offs, da_offs, pn_offs;
  	u8 band;
diff --git a/package/kernel/mac80211/patches/subsys/356-mac80211-set-NETIF_F_LLTX-when-using-intermediate-tx.patch b/package/kernel/mac80211/patches/subsys/356-mac80211-set-NETIF_F_LLTX-when-using-intermediate-tx.patch
index 95ab3ab9fb..c4694c484b 100644
--- a/package/kernel/mac80211/patches/subsys/356-mac80211-set-NETIF_F_LLTX-when-using-intermediate-tx.patch
+++ b/package/kernel/mac80211/patches/subsys/356-mac80211-set-NETIF_F_LLTX-when-using-intermediate-tx.patch
@@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/net/mac80211/iface.c
 +++ b/net/mac80211/iface.c
-@@ -1301,6 +1301,7 @@ static void ieee80211_if_setup(struct ne
+@@ -1297,6 +1297,7 @@ static void ieee80211_if_setup(struct ne
  static void ieee80211_if_setup_no_queue(struct net_device *dev)
  {
  	ieee80211_if_setup(dev);
diff --git a/package/kernel/mac80211/patches/subsys/361-mac80211-add-IEEE80211_KEY_FLAG_GENERATE_MMIE-to-iee.patch b/package/kernel/mac80211/patches/subsys/361-mac80211-add-IEEE80211_KEY_FLAG_GENERATE_MMIE-to-iee.patch
index f7e022ca0c..04431bf57a 100644
--- a/package/kernel/mac80211/patches/subsys/361-mac80211-add-IEEE80211_KEY_FLAG_GENERATE_MMIE-to-iee.patch
+++ b/package/kernel/mac80211/patches/subsys/361-mac80211-add-IEEE80211_KEY_FLAG_GENERATE_MMIE-to-iee.patch
@@ -36,7 +36,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  /**
 --- a/net/mac80211/wpa.c
 +++ b/net/mac80211/wpa.c
-@@ -947,7 +947,8 @@ ieee80211_crypto_aes_cmac_encrypt(struct
+@@ -952,7 +952,8 @@ ieee80211_crypto_aes_cmac_encrypt(struct
  
  	info = IEEE80211_SKB_CB(skb);
  
@@ -46,7 +46,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  		return TX_CONTINUE;
  
  	if (WARN_ON(skb_tailroom(skb) < sizeof(*mmie)))
-@@ -963,6 +964,9 @@ ieee80211_crypto_aes_cmac_encrypt(struct
+@@ -968,6 +969,9 @@ ieee80211_crypto_aes_cmac_encrypt(struct
  
  	bip_ipn_set64(mmie->sequence_number, pn64);
  
diff --git a/package/kernel/mac80211/patches/subsys/365-mac80211-IBSS-send-deauth-when-expiring-inactive-STA.patch b/package/kernel/mac80211/patches/subsys/365-mac80211-IBSS-send-deauth-when-expiring-inactive-STA.patch
index 90722a32ce..d30642ee6c 100644
--- a/package/kernel/mac80211/patches/subsys/365-mac80211-IBSS-send-deauth-when-expiring-inactive-STA.patch
+++ b/package/kernel/mac80211/patches/subsys/365-mac80211-IBSS-send-deauth-when-expiring-inactive-STA.patch
@@ -54,7 +54,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	}
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -2069,7 +2069,8 @@ void ieee80211_send_auth(struct ieee8021
+@@ -2056,7 +2056,8 @@ void ieee80211_send_auth(struct ieee8021
  			 const u8 *da, const u8 *key, u8 key_len, u8 key_idx,
  			 u32 tx_flags);
  void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata,
@@ -66,7 +66,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  enum {
 --- a/net/mac80211/mlme.c
 +++ b/net/mac80211/mlme.c
-@@ -2203,8 +2203,9 @@ static void ieee80211_set_disassoc(struc
+@@ -2208,8 +2208,9 @@ static void ieee80211_set_disassoc(struc
  		    !ifmgd->have_beacon)
  			drv_mgd_prepare_tx(sdata->local, sdata, 0);
  
@@ -78,7 +78,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	}
  
  	/* flush out frame - make sure the deauth was actually sent */
-@@ -4369,7 +4370,7 @@ void ieee80211_mgd_quiesce(struct ieee80
+@@ -4374,7 +4375,7 @@ void ieee80211_mgd_quiesce(struct ieee80
  		 * cfg80211 won't know and won't actually abort those attempts,
  		 * thus we need to do that ourselves.
  		 */
@@ -87,7 +87,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  					       IEEE80211_STYPE_DEAUTH,
  					       WLAN_REASON_DEAUTH_LEAVING,
  					       false, frame_buf);
-@@ -5349,7 +5350,7 @@ int ieee80211_mgd_deauth(struct ieee8021
+@@ -5354,7 +5355,7 @@ int ieee80211_mgd_deauth(struct ieee8021
  			   ieee80211_get_reason_code_string(req->reason_code));
  
  		drv_mgd_prepare_tx(sdata->local, sdata, 0);
@@ -96,7 +96,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  					       IEEE80211_STYPE_DEAUTH,
  					       req->reason_code, tx,
  					       frame_buf);
-@@ -5369,7 +5370,7 @@ int ieee80211_mgd_deauth(struct ieee8021
+@@ -5374,7 +5375,7 @@ int ieee80211_mgd_deauth(struct ieee8021
  			   ieee80211_get_reason_code_string(req->reason_code));
  
  		drv_mgd_prepare_tx(sdata->local, sdata, 0);
diff --git a/package/kernel/mac80211/patches/subsys/522-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/subsys/522-mac80211_configure_antenna_gain.patch
index 147eb6edcc..3211dae542 100644
--- a/package/kernel/mac80211/patches/subsys/522-mac80211_configure_antenna_gain.patch
+++ b/package/kernel/mac80211/patches/subsys/522-mac80211_configure_antenna_gain.patch
@@ -87,7 +87,7 @@
  	CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd)
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -1366,6 +1366,7 @@ struct ieee80211_local {
+@@ -1353,6 +1353,7 @@ struct ieee80211_local {
  	int dynamic_ps_forced_timeout;
  
  	int user_power_level; /* in dBm, for all interfaces */


From lede-commits at lists.infradead.org  Sun Jun  6 12:38:51 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 06 Jun 2021 15:38:51 -0400
Subject: [openwrt/openwrt] treewide: do not quote compatible in shell scripts
In-Reply-To: <162300832739.31616.4636715914491748668@git-01.infra.openwrt.org>
References: <162300832739.31616.4636715914491748668@git-01.infra.openwrt.org>
Message-ID: <mailman.3441.1623008332.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/2341c621e42e5fadd6b3205365fb448e44bcbbe0

commit 2341c621e42e5fadd6b3205365fb448e44bcbbe0
Author: Adrian Schmutzler <freifunk at adrianschmutzler.de>
AuthorDate: Sun Jun 6 19:17:47 2021 +0200

    treewide: do not quote compatible in shell scripts
    
    The compatible is a literal string without any problematic
    characters, so there is no reason to quote it.
    
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 .../linux/arc770/base-files/etc/board.d/02_network |  2 +-
 .../kirkwood/base-files/etc/board.d/02_network     | 36 +++++++++++-----------
 .../lib/preinit/05_layerscape_reorder_eth          |  4 +--
 3 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/target/linux/arc770/base-files/etc/board.d/02_network b/target/linux/arc770/base-files/etc/board.d/02_network
index f326f48763..c90f3fb6a6 100644
--- a/target/linux/arc770/base-files/etc/board.d/02_network
+++ b/target/linux/arc770/base-files/etc/board.d/02_network
@@ -7,7 +7,7 @@
 board_config_update
 
 case "$(board_name)" in
-"snps,axs101")
+snps,axs101)
 	ucidef_set_interface_lan "eth0" "dhcp"
 	;;
 esac
diff --git a/target/linux/kirkwood/base-files/etc/board.d/02_network b/target/linux/kirkwood/base-files/etc/board.d/02_network
index c379d13046..694bcaecce 100644
--- a/target/linux/kirkwood/base-files/etc/board.d/02_network
+++ b/target/linux/kirkwood/base-files/etc/board.d/02_network
@@ -10,33 +10,33 @@ board_config_update
 board=$(board_name)
 
 case "$board" in
-"checkpoint,l-50")
+checkpoint,l-50)
 	ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5 lan6 lan7 lan8 dmz" "eth0"
 	;;
-"cisco,on100")
+cisco,on100)
 	ucidef_set_interface_lan "eth0 eth1"
 	;;
-"cloudengines,pogoe02"|\
-"cloudengines,pogoplugv4"|\
-"globalscale,sheevaplug"|\
-"iom,iconnect-1.1"|\
-"iom,ix2-200"|\
-"raidsonic,ib-nas62x0"|\
-"seagate,blackarmor-nas220"|\
-"seagate,dockstar"|\
-"seagate,goflexhome"|\
-"seagate,goflexnet"|\
-"zyxel,nsa310s")
+cloudengines,pogoe02|\
+cloudengines,pogoplugv4|\
+globalscale,sheevaplug|\
+iom,iconnect-1.1|\
+iom,ix2-200|\
+raidsonic,ib-nas62x0|\
+seagate,blackarmor-nas220|\
+seagate,dockstar|\
+seagate,goflexhome|\
+seagate,goflexnet|\
+zyxel,nsa310s)
 	ucidef_set_interface_lan "eth0" "dhcp"
 	;;
-"linksys,e4200-v2"|\
-"linksys,ea3500"|\
-"linksys,ea4500")
+linksys,e4200-v2|\
+linksys,ea3500|\
+linksys,ea4500)
 	ucidef_set_interfaces_lan_wan "ethernet1 ethernet2 ethernet3 ethernet4" "internet"
 	ucidef_set_interface_macaddr "wan" $( mtd_get_mac_ascii u_env eth1addr )
 	;;
-"zyxel,nsa310b"|\
-"zyxel,nsa325")
+zyxel,nsa310b|\
+zyxel,nsa325)
 	ucidef_set_interface_lan "eth0" "dhcp"
 	ucidef_set_interface_macaddr "lan" $( mtd_get_mac_ascii uboot_env ethaddr )
 	;;
diff --git a/target/linux/layerscape/base-files/lib/preinit/05_layerscape_reorder_eth b/target/linux/layerscape/base-files/lib/preinit/05_layerscape_reorder_eth
index 141aac8a6d..c6b741a5ce 100644
--- a/target/linux/layerscape/base-files/lib/preinit/05_layerscape_reorder_eth
+++ b/target/linux/layerscape/base-files/lib/preinit/05_layerscape_reorder_eth
@@ -6,8 +6,8 @@ reorder_layerscape_interfaces() {
 
 	board=$(cat /tmp/sysinfo/board_name)
 	case "$board" in
-	"traverse,ls1043v" | \
-	"traverse,ls1043s")
+	traverse,ls1043v|\
+	traverse,ls1043s)
 
 		# Reorder ethernet interfaces to match the physical order
 		ip link set eth2 name fm1-mac3


From lede-commits at lists.infradead.org  Sun Jun  6 12:38:52 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 06 Jun 2021 15:38:52 -0400
Subject: [openwrt/openwrt]  ramips: Add support for SERCOMM NA502
In-Reply-To: <162300832739.31616.4636715914491748668@git-01.infra.openwrt.org>
References: <162300832739.31616.4636715914491748668@git-01.infra.openwrt.org>
Message-ID: <mailman.3442.1623008332.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/a3d8c1295ed9eeceabd78ab86e73b151ae2868a9

commit a3d8c1295ed9eeceabd78ab86e73b151ae2868a9
Author: Andreas B?hler <dev at aboehler.at>
AuthorDate: Mon Mar 15 00:07:17 2021 +0100

    ramips: Add support for SERCOMM NA502
    
    The SERCOMM NA502 is a smart home gateway manufactured by SERCOMM and sold
    under different brands (among others, A1 Telekom Austria SmartHome
    Gateway). It has multi-protocol radio support in addition to LAN and WiFi.
    
    Note: BLE is currently unsupported.
    
    Specifications
    --------------
    
      - MT7621ST 880MHz, Single-Core, Dual-Thread
      - MT7603EN 2.4GHz WiFi
      - MT7662EN 5GHz WiFi + BLE
      - 128MiB NAND
      - 256MiB DDR3 RAM
      - SD3503 ZWave Controller
      - EM357 Zigbee Coordinator
    
    MAC address assignment
    ----------------------
    
    LAN MAC is read from the config partition, WiFi 2.4GHz is LAN+2 and matches
    the OEM firmware. WiFi 5GHz with LAN+1 is an educated guess since the
    OEM firmware does not enable 5GHz WiFi.
    
    Installation
    ------------
    Attach serial console, then boot the initramfs image via TFTP.
    Once inside OpenWrt, run sysupgrade -n with the sysupgrade file.
    
    Attention: The device has a dual-firmware design. We overwrite kernel2,
    since kernel1 contains an automatic recovery image.
    
    If you get NAND ECC errors and are stuck with bad eraseblocks, try to
    erase the mtd partition first with
    
    mtd unlock ubi
    mtd erase ubi
    
    This should only be needed once.
    
    Signed-off-by: Andreas B?hler <dev at aboehler.at>
    [use kiB for IMAGE_SIZE]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 target/linux/ramips/dts/mt7621_sercomm_na502.dts   | 212 +++++++++++++++++++++
 target/linux/ramips/image/mt7621.mk                |  14 ++
 .../mt7621/base-files/etc/board.d/02_network       |   1 +
 .../mt7621/base-files/lib/upgrade/platform.sh      |   1 +
 4 files changed, 228 insertions(+)

diff --git a/target/linux/ramips/dts/mt7621_sercomm_na502.dts b/target/linux/ramips/dts/mt7621_sercomm_na502.dts
new file mode 100644
index 0000000000..af55d1058f
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_sercomm_na502.dts
@@ -0,0 +1,212 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "sercomm,na502", "mediatek,mt7621-soc";
+	model = "SERCOMM NA502";
+
+	aliases {
+		led-boot = &led_power;
+		led-failsafe = &led_power;
+		led-running = &led_power;
+		led-upgrade = &led_power;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_power: power {
+			label = "green:power";
+			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+		};
+
+		internet {
+			label = "green:internet";
+			gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
+		};
+
+		wifi {
+			label = "green:wifi";
+			gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy0tpt";
+		};
+
+		zwave {
+			label = "green:zwave";
+			gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
+		};
+
+		service {
+			label = "green:service";
+			gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
+		};
+
+		zigbee {
+			label = "green:zigbee";
+			gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
+		};
+
+		bluetooth {
+			label = "green:bluetooth";
+			gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+
+		select {
+			label = "select";
+			gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
+			linux,code = <BTN_0>;
+		};
+
+		sync {
+			label = "sync";
+			gpios = <&gpio 32 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RFKILL>;
+		};
+	};
+
+	gpio-export {
+		compatible = "gpio-export";
+
+		zwave_reset {
+			gpio-export,name = "zwave_reset";
+			gpio-export,output = <1>;
+			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+		};
+
+		zigbee_reset {
+			gpio-export,name = "zigbee_reset";
+			gpio-export,output = <1>;
+			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&gmac0 {
+	mtd-mac-address = <&factory 0xe000>;
+};
+
+&nand {
+	status = "okay";
+
+	partitions {
+		compatible = "fixed-partitions";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition at 0 {
+			label = "u-boot";
+			reg = <0x0 0x80000>;
+			read-only;
+		};
+
+		partition at 80000 {
+			label = "config";
+			reg = <0x80000 0x80000>;
+			read-only;
+		};
+
+		factory: partition at 100000 {
+			label = "factory";
+			reg = <0x100000 0x40000>;
+		};
+
+		partition at 140000 {
+			label = "kernel1";
+			reg = <0x140000 0x1400000>;
+		};
+
+		partition at 1540000 {
+			label = "kernel";
+			reg = <0x1540000 0x400000>;
+		};
+
+		partition at 1940000 {
+			label = "ubi";
+			reg = <0x1940000 0x1000000>;
+		};
+
+		partition at 2940000 {
+			label = "user_storage";
+			reg = <0x2940000 0x100000>;
+		};
+
+		partition at 2a40000 {
+			label = "data";
+			reg = <0x2a40000 0x1000000>;
+		};
+
+		partition at 3a40000 {
+			label = "storage";
+			reg = <0x3a40000 0x3200000>;
+		};
+
+		partition at 6c40000 {
+			label = "backup";
+			reg = <0x6c40000 0x1340000>;
+		};
+	};
+};
+
+&pcie {
+	status = "okay";
+};
+
+&pcie0 {
+	wifi at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x8000>;
+		mtd-mac-address = <&factory 0xe000>;
+		mtd-mac-address-increment = <1>;
+		ieee80211-freq-limit = <5000000 6000000>;
+	};
+};
+
+&pcie1 {
+	wifi at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x0000>;
+		mtd-mac-address = <&factory 0xe000>;
+		mtd-mac-address-increment = <2>;
+		ieee80211-freq-limit = <2400000 2500000>;
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "jtag", "rgmii2";
+		function = "gpio";
+	};
+};
+
+&switch0 {
+	ports {
+		port at 4 {
+			status = "okay";
+			label = "lan";
+		};
+	};
+};
+
+&uartlite2 {
+	status = "okay";
+};
+
+&uartlite3 {
+	status = "okay";
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 96a66b2398..efeac698b1 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -1167,6 +1167,20 @@ define Device/samknows_whitebox-v8
 endef
 TARGET_DEVICES += samknows_whitebox-v8
 
+define Device/sercomm_na502
+  $(Device/uimage-lzma-loader)
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  IMAGE_SIZE := 20480k
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+  UBINIZE_OPTS := -E 5
+  KERNEL_SIZE := 4096k
+  DEVICE_VENDOR := SERCOMM
+  DEVICE_MODEL := NA502
+  DEVICE_PACKAGES := kmod-mt76x2 kmod-mt7603 kmod-usb3
+endef
+TARGET_DEVICES += sercomm_na502
+
 define Device/storylink_sap-g3200u3
   $(Device/dsa-migration)
   IMAGE_SIZE := 7872k
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
index d84d3e317f..aa1d644938 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
@@ -12,6 +12,7 @@ ramips_setup_interfaces()
 	edimax,re23s|\
 	mikrotik,routerboard-m11g|\
 	netgear,ex6150|\
+	sercomm,na502|\
 	thunder,timecloud|\
 	tplink,re350-v1|\
 	tplink,re500-v1|\
diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
index 4943ad1305..c2ad4d3ed6 100755
--- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
@@ -72,6 +72,7 @@ platform_do_upgrade() {
 	netgear,wac104|\
 	netgear,wac124|\
 	netis,wf2881|\
+	sercomm,na502|\
 	xiaomi,mi-router-3g|\
 	xiaomi,mi-router-3-pro|\
 	xiaomi,mi-router-4|\


From lede-commits at lists.infradead.org  Sun Jun  6 12:38:49 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 06 Jun 2021 15:38:49 -0400
Subject: [openwrt/openwrt]  kirkwood: Add support for Sheevaplug
In-Reply-To: <162300832739.31616.4636715914491748668@git-01.infra.openwrt.org>
References: <162300832739.31616.4636715914491748668@git-01.infra.openwrt.org>
Message-ID: <mailman.3443.1623008334.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/03d66d6b8fa6660a89648847a69d691a9a82d5b4

commit 03d66d6b8fa6660a89648847a69d691a9a82d5b4
Author: BERENYI Balazs <balazs at wee.hu>
AuthorDate: Sat Jan 2 18:49:42 2021 +0000

    kirkwood: Add support for Sheevaplug
    
    Globalscale SheevaPlug:
    * Marvell Kirkwood 88F6281
    * 512 MB SDRAM
    * 512 MB Flash
    * Gigabit Network
    * USB 2.0
    * SD slot
    * Serial console
    
    The device is supported in mainline uboot/linux the commit adds only
    some openwrt config for building an image.
    
    Installation:
    1 - Update uboot:
    setenv ipaddr '192.168.0.111'
    setenv serverip '192.168.0.1'
    tftpboot u-boot.kwb
    nand erase 0x0 0x100000
    nand write 0x800000 0x0 0x100000
    reset
    2 - Install OpenWRT:
    setenv ethaddr 00:50:43:01:xx:xx
    saveenv
    setenv ipaddr '192.168.0.111'
    setenv serverip '192.168.0.1'
    tftpboot openwrt-kirkwood-globalscale_sheevaplug-squashfs-factory.bin
    nand erase.part ubi
    nand write 0x800000 ubi 0x600000
    reset
    
    Signed-off-by: BERENYI Balazs <balazs at wee.hu>
    Reviewed-by: Pawel Dembicki <paweldembicki at gmail.com>
    [add vendor name for uboot-kirkwood, merge patches, copy to 5.10,
    add AUTORELEASE for uboot-kirkwood, refresh patches]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 package/boot/uboot-envtools/files/kirkwood         |  1 +
 package/boot/uboot-kirkwood/Makefile               | 10 ++++-
 .../uboot-kirkwood/patches/170-sheevaplug.patch    | 39 ++++++++++++++++++
 .../patches/200-openwrt-config.patch               | 10 +++++
 .../kirkwood/base-files/etc/board.d/02_network     |  1 +
 target/linux/kirkwood/image/Makefile               |  7 ++++
 .../kirkwood/patches-5.10/112-sheevaplug.patch     | 47 ++++++++++++++++++++++
 .../kirkwood/patches-5.4/112-sheevaplug.patch      | 47 ++++++++++++++++++++++
 8 files changed, 160 insertions(+), 2 deletions(-)

diff --git a/package/boot/uboot-envtools/files/kirkwood b/package/boot/uboot-envtools/files/kirkwood
index d1986f206d..6a3dfcaba8 100644
--- a/package/boot/uboot-envtools/files/kirkwood
+++ b/package/boot/uboot-envtools/files/kirkwood
@@ -15,6 +15,7 @@ case "$board" in
 checkpoint,l-50|\
 cloudengines,pogoe02|\
 cloudengines,pogoplugv4|\
+globalscale,sheevaplug|\
 iom,ix2-200|\
 linksys,e4200-v2|\
 linksys,ea4500|\
diff --git a/package/boot/uboot-kirkwood/Makefile b/package/boot/uboot-kirkwood/Makefile
index 1ed1743e21..d9cb10ce13 100644
--- a/package/boot/uboot-kirkwood/Makefile
+++ b/package/boot/uboot-kirkwood/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_VERSION:=2020.04
-PKG_RELEASE:=1
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_HASH:=fe732aaf037d9cc3c0909bad8362af366ae964bbdac6913a34081ff4ad565372
 
@@ -94,6 +94,11 @@ define U-Boot/pogoplugv4
   BUILD_DEVICES:=cloudengines_pogoplugv4
 endef
 
+define U-Boot/sheevaplug
+  NAME:=Globalscale SheevaPlug
+  BUILD_DEVICES:=globalscale_sheevaplug
+endef
+
 UBOOT_TARGETS := \
 	dockstar dockstar_second_stage \
 	goflexhome \
@@ -105,7 +110,8 @@ UBOOT_TARGETS := \
 	nsa310s \
 	nsa325 \
 	pogo_e02 pogo_e02_second_stage \
-	pogoplugv4
+	pogoplugv4 \
+	sheevaplug
 
 define Build/Configure
 	$(if $(findstring _second_stage,$(BUILD_VARIANT)),
diff --git a/package/boot/uboot-kirkwood/patches/170-sheevaplug.patch b/package/boot/uboot-kirkwood/patches/170-sheevaplug.patch
new file mode 100644
index 0000000000..12b3e68d00
--- /dev/null
+++ b/package/boot/uboot-kirkwood/patches/170-sheevaplug.patch
@@ -0,0 +1,39 @@
+--- a/include/configs/sheevaplug.h
++++ b/include/configs/sheevaplug.h
+@@ -45,15 +45,17 @@
+ /*
+  * Default environment variables
+  */
+-#define CONFIG_BOOTCOMMAND		"${x_bootcmd_kernel}; "	\
+-	"setenv bootargs ${x_bootargs} ${x_bootargs_root}; "	\
+-	"bootm 0x6400000;"
++#define CONFIG_BOOTCOMMAND					\
++	"setenv bootargs ${console} ${mtdparts} ${bootargs_root}; "	\
++	"ubi part ubi; " 						\
++	"ubi read 0x800000 kernel; " 			\
++	"bootm 0x800000"
+ 
+-#define CONFIG_EXTRA_ENV_SETTINGS	"x_bootargs=console"	\
+-	"=ttyS0,115200 mtdparts="CONFIG_MTDPARTS_DEFAULT	\
+-	"x_bootcmd_kernel=nand read 0x6400000 0x100000 0x400000\0" \
+-	"x_bootcmd_usb=usb start\0" \
+-	"x_bootargs_root=root=/dev/mtdblock3 rw rootfstype=jffs2\0"
++#define CONFIG_EXTRA_ENV_SETTINGS			\
++	"console=console=ttyS0,115200\0"		\
++	"mtdids="CONFIG_MTDIDS_DEFAULT "\0"		\
++	"mtdparts="CONFIG_MTDPARTS_DEFAULT "\0"	\
++	"bootargs_root=\0"
+ 
+ /*
+  * Ethernet Driver configuration
+--- a/configs/sheevaplug_defconfig
++++ b/configs/sheevaplug_defconfig
+@@ -30,7 +30,7 @@ CONFIG_CMD_FAT=y
+ CONFIG_CMD_JFFS2=y
+ CONFIG_CMD_MTDPARTS=y
+ CONFIG_MTDIDS_DEFAULT="nand0=orion_nand"
+-CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:512K(uboot),512K(env),4M(kernel),-(rootfs)"
++CONFIG_MTDPARTS_DEFAULT="mtdparts=orion_nand:1M(uboot),-(ubi)"
+ CONFIG_CMD_UBI=y
+ CONFIG_ISO_PARTITION=y
+ CONFIG_OF_CONTROL=y
diff --git a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch
index 83eb0f9d2c..ae9fdf3390 100644
--- a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch
+++ b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch
@@ -204,3 +204,13 @@
 +#include "openwrt-kirkwood-common.h"
 +
  #endif /* _CONFIG_NSA310S_H */
+--- a/configs/sheevaplug_defconfig
++++ b/configs/sheevaplug_defconfig
+@@ -49,4 +49,7 @@
+ CONFIG_DM_USB=y
+ CONFIG_USB_EHCI_HCD=y
+ CONFIG_USB_STORAGE=y
++CONFIG_FIT=y
++CONFIG_FIT_VERBOSE=y
+ CONFIG_LZMA=y
++CONFIG_LZO=y
diff --git a/target/linux/kirkwood/base-files/etc/board.d/02_network b/target/linux/kirkwood/base-files/etc/board.d/02_network
index 0578691144..c379d13046 100644
--- a/target/linux/kirkwood/base-files/etc/board.d/02_network
+++ b/target/linux/kirkwood/base-files/etc/board.d/02_network
@@ -18,6 +18,7 @@ case "$board" in
 	;;
 "cloudengines,pogoe02"|\
 "cloudengines,pogoplugv4"|\
+"globalscale,sheevaplug"|\
 "iom,iconnect-1.1"|\
 "iom,ix2-200"|\
 "raidsonic,ib-nas62x0"|\
diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile
index e06eb050ef..c2c5bcab8f 100644
--- a/target/linux/kirkwood/image/Makefile
+++ b/target/linux/kirkwood/image/Makefile
@@ -67,6 +67,13 @@ define Device/cloudengines_pogoplugv4
 endef
 TARGET_DEVICES += cloudengines_pogoplugv4
 
+define Device/globalscale_sheevaplug
+  DEVICE_VENDOR := Globalscale
+  DEVICE_MODEL := Sheevaplug
+  DEVICE_PACKAGES := kmod-mvsdio
+endef
+TARGET_DEVICES += globalscale_sheevaplug
+
 define Device/iom_iconnect-1.1
   DEVICE_VENDOR := Iomega
   DEVICE_MODEL := Iconnect
diff --git a/target/linux/kirkwood/patches-5.10/112-sheevaplug.patch b/target/linux/kirkwood/patches-5.10/112-sheevaplug.patch
new file mode 100644
index 0000000000..d1ff9884a0
--- /dev/null
+++ b/target/linux/kirkwood/patches-5.10/112-sheevaplug.patch
@@ -0,0 +1,47 @@
+--- a/arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
++++ b/arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
+@@ -78,13 +78,8 @@
+ 	};
+ 
+ 	partition at 100000 {
+-		label = "uImage";
+-		reg = <0x0100000 0x400000>;
+-	};
+-
+-	partition at 500000 {
+-		label = "root";
+-		reg = <0x0500000 0x1fb00000>;
++		label = "ubi";
++		reg = <0x0100000 0x1ff00000>;
+ 	};
+ };
+ 
+--- a/arch/arm/boot/dts/kirkwood-sheevaplug.dts
++++ b/arch/arm/boot/dts/kirkwood-sheevaplug.dts
+@@ -13,6 +13,13 @@
+ 	model = "Globalscale Technologies SheevaPlug";
+ 	compatible = "globalscale,sheevaplug", "marvell,kirkwood-88f6281", "marvell,kirkwood";
+ 
++	aliases {
++		led-boot = &led_health;
++		led-failsafe = &led_health;
++		led-running = &led_health;
++		led-upgrade = &led_health;
++	};
++
+ 	ocp at f1000000 {
+ 		mvsdio at 90000 {
+ 			pinctrl-0 = <&pmx_sdio>;
+@@ -28,10 +35,10 @@
+ 		pinctrl-0 = <&pmx_led_blue &pmx_led_red>;
+ 		pinctrl-names = "default";
+ 
+-		health {
++		led_health: health {
+ 			label = "sheevaplug:blue:health";
+ 			gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
+-			default-state = "keep";
++			default-state = "on";
+ 		};
+ 
+ 		misc {
diff --git a/target/linux/kirkwood/patches-5.4/112-sheevaplug.patch b/target/linux/kirkwood/patches-5.4/112-sheevaplug.patch
new file mode 100644
index 0000000000..d1ff9884a0
--- /dev/null
+++ b/target/linux/kirkwood/patches-5.4/112-sheevaplug.patch
@@ -0,0 +1,47 @@
+--- a/arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
++++ b/arch/arm/boot/dts/kirkwood-sheevaplug-common.dtsi
+@@ -78,13 +78,8 @@
+ 	};
+ 
+ 	partition at 100000 {
+-		label = "uImage";
+-		reg = <0x0100000 0x400000>;
+-	};
+-
+-	partition at 500000 {
+-		label = "root";
+-		reg = <0x0500000 0x1fb00000>;
++		label = "ubi";
++		reg = <0x0100000 0x1ff00000>;
+ 	};
+ };
+ 
+--- a/arch/arm/boot/dts/kirkwood-sheevaplug.dts
++++ b/arch/arm/boot/dts/kirkwood-sheevaplug.dts
+@@ -13,6 +13,13 @@
+ 	model = "Globalscale Technologies SheevaPlug";
+ 	compatible = "globalscale,sheevaplug", "marvell,kirkwood-88f6281", "marvell,kirkwood";
+ 
++	aliases {
++		led-boot = &led_health;
++		led-failsafe = &led_health;
++		led-running = &led_health;
++		led-upgrade = &led_health;
++	};
++
+ 	ocp at f1000000 {
+ 		mvsdio at 90000 {
+ 			pinctrl-0 = <&pmx_sdio>;
+@@ -28,10 +35,10 @@
+ 		pinctrl-0 = <&pmx_led_blue &pmx_led_red>;
+ 		pinctrl-names = "default";
+ 
+-		health {
++		led_health: health {
+ 			label = "sheevaplug:blue:health";
+ 			gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
+-			default-state = "keep";
++			default-state = "on";
+ 		};
+ 
+ 		misc {


From lede-commits at lists.infradead.org  Sun Jun  6 12:38:48 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 06 Jun 2021 15:38:48 -0400
Subject: [openwrt/openwrt]  ramips: add support for the Wavlink WL-WN579X3
In-Reply-To: <162300832739.31616.4636715914491748668@git-01.infra.openwrt.org>
References: <162300832739.31616.4636715914491748668@git-01.infra.openwrt.org>
Message-ID: <mailman.3444.1623008334.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/a509b80065b6680e3e007203084c147f77b6717f

commit a509b80065b6680e3e007203084c147f77b6717f
Author: Ben Gainey <ba.gainey at googlemail.com>
AuthorDate: Sun Jan 31 11:15:38 2021 +0000

    ramips: add support for the Wavlink WL-WN579X3
    
    About the device
    ----------------
    
    SoC: MediaTek MT7620a @ 580MHz
    RAM: 64M
    FLASH: 8MB
    WiFi: SoC-integrated: MediaTek MT7620a bgn
    WiFi: MediaTek MT7612EN nac
    GbE: 2x (RTL8211F)
    BTN: - WPS
    - Reset
    - Router/Repeater/AP (3-way slide-switch)
    LED: - WPS (blue)
    - 3-segment Wifi signal representation (blue)
    - WiFi (blue)
    - WAN (blue)
    - LAN (blue)
    - Power (blue)
    UART: UART is present as Pads with through-holes on the PCB. They are
    located next to the reset button and are labelled Vcc/TX/RX/GND as
    appropriate. Use 3.3V, 57600-8N1.
    
    Installation
    ------------
    
    Using the webcmd interface
    --------------------------
    
    Warning: Do not update to the latest Wavlink firmware (version
    20201201) as this removes the webcmd console and you will need to
    use the serial port instead.
    
    You will need to have built uboot/sqauashfs image for this device,
    and you will need to provide an HTTP service where the image can
    be downloaded from that is accessible by the device.
    You cannot use the device manufacturers firmware upgrade interface
    as it rejects the OpenWrt image.
    
    1. Log into the device's admin portal. This is necessary to
       authenticate you as a user in order to be able to access the
       webcmd interface.
    2. Navigate to http://<device-ip>/webcmd.shtml - you can access
       the console directly through this page, or you may wish to
       launch the installed `telnetd` and use telnet instead.
       * Using telnet is recommended since it provides a more
         convenient shell interface that the web form.
       * Launch telnetd from the form with the command `telnetd`.
       * Check the port that telnetd is running on using
         `netstat -antp|grep telnetd`, it is likely to be 2323.
       * Connect to the target using `telnet`. The username should
         be `admin2860`, and the password is your admin password.
    3. On the target use `curl` to download the image.
       e.g.  `curl -L -O http://<some-other-lan-ip>/openwrt-ramips-mt7620-\
              wavlink_wl-wn579x3-squashfs-sysupgrade.bin`.
       Check the hash using `md5sum`.
    4. Use the mtd_write command to flash the image.
       * The flash partition should be mtd4, but check
         /sys/class/mtd/mtd4/name first. The partition should be
         called 'Kernel'.
       * To flash use the following command:
         `mtd_write -r -e /dev/mtd<n> write <image-file> /dev/mtd<n>`
         Where mtd<n> is the Kernel partition, and <image-file> is
         the OpenWrt image previously downloaded.
       * The command above will erase, flash and then reboot the
         device. Once it reboots it will be running OpenWrt.
    
    Connect via ssh to the device at 192.168.1.1 on the LAN port.
    The WAN port will be configured via DHCP.
    
    Using the serial port
    ---------------------
    
    The device uses uboot like many other MT7260a based boards. To
    use this interface, you will need to connect to the serial
    interface, and provide a TFTP server. At boot follow the
    bootloader menu and select option 2 to erase/flash the image.
    Provide the address and filename details for the tftp server.
    The bootloader will do the rest.
    
    Once the image is flashed, the board will boot into OpenWrt. The
    console is available over the serial port.
    
    Signed-off-by: Ben Gainey <ba.gainey at googlemail.com>
---
 .../ramips/dts/mt7620a_wavlink_wl-wn579x3.dts      | 210 +++++++++++++++++++++
 target/linux/ramips/image/mt7620.mk                |   9 +
 .../ramips/mt7620/base-files/etc/board.d/01_leds   |   4 +
 .../mt7620/base-files/etc/board.d/02_network       |   4 +
 4 files changed, 227 insertions(+)

diff --git a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts
new file mode 100644
index 0000000000..679d9c2150
--- /dev/null
+++ b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts
@@ -0,0 +1,210 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "mt7620a.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "wavlink,wl-wn579x3", "ralink,mt7620a-soc";
+	model = "Wavlink WL-WN579X3";
+
+	aliases {
+		led-boot = &led_wps;
+		led-failsafe = &led_wps;
+		led-running = &led_wps;
+		led-upgrade = &led_wps;
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+
+		switch_aps {
+			label = "mode_aps";
+			gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
+			linux,code = <BTN_1>;
+			linux,input-type = <EV_SW>;
+		};
+
+		switch_repeater {
+			label = "mode_repeater";
+			gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
+			linux,code = <BTN_0>;
+			linux,input-type = <EV_SW>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_wps: wps {
+			label = "blue:wps";
+			gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
+		};
+
+		lan {
+			label = "blue:lan";
+			gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
+		};
+
+		wan {
+			label = "blue:wan";
+			gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
+		};
+
+		wifi {
+			label = "blue:wifi";
+			gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
+		};
+
+		/* These three form the signal wifi strength segments */
+		wifi_high {
+			label = "blue:wifi_high";
+			gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
+		};
+
+		wifi_medium {
+			label = "blue:wifi_medium";
+			gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
+		};
+
+		wifi_low {
+			label = "blue:wifi_low";
+			gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&gpio2 {
+	status = "okay";
+};
+
+&gpio3 {
+	status = "okay";
+};
+
+&spi0 {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <50000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x0 0x30000>;
+				read-only;
+			};
+
+			partition at 30000 {
+				label = "config";
+				reg = <0x30000 0x10000>;
+				read-only;
+			};
+
+			factory: partition at 40000 {
+				label = "factory";
+				reg = <0x40000 0x10000>;
+				read-only;
+			};
+
+			partition at 50000 {
+				compatible = "denx,uimage";
+				label = "firmware";
+				reg = <0x50000 0x790000>;
+			};
+
+			partition at 7e0000 {
+				label = "board_data";
+				reg = <0x7e0000 0x10000>;
+				read-only;
+			};
+
+			partition at 7f0000 {
+				label = "nvram";
+				reg = <0x7f0000 0x10000>;
+				read-only;
+			};
+		};
+	};
+};
+
+&pcie {
+	status = "okay";
+};
+
+&pcie0 {
+	wifi at 0,0 {
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x8000>;
+		ieee80211-freq-limit = <5000000 6000000>;
+	};
+};
+
+&ethernet {
+	pinctrl-names = "default";
+	pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
+
+	mtd-mac-address = <&factory 0x28>;
+
+	mediatek,portmap = "llllw";
+
+	port at 4 {
+		status = "okay";
+		phy-handle = <&phy4>;
+		phy-mode = "rgmii";
+	};
+
+	port at 5 {
+		status = "okay";
+		phy-handle = <&phy5>;
+		phy-mode = "rgmii";
+	};
+
+	mdio-bus {
+		status = "okay";
+
+		phy4: ethernet-phy at 4 {
+			reg = <4>;
+			phy-mode = "rgmii";
+		};
+
+		phy5: ethernet-phy at 5 {
+			reg = <5>;
+			phy-mode = "rgmii";
+		};
+	};
+};
+
+&gsw {
+	mediatek,port4 = "gmac";
+};
+
+&wmac {
+	ralink,mtd-eeprom = <&factory 0x0>;
+};
+
+&state_default {
+	gpio {
+		groups = "ephy", "i2c", "wled", "uartf";
+		function = "gpio";
+	};
+};
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index fe41512f36..8f5d354e33 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -1092,6 +1092,15 @@ define Device/wavlink_wl-wn530hg4
 endef
 TARGET_DEVICES += wavlink_wl-wn530hg4
 
+define Device/wavlink_wl-wn579x3
+  SOC := mt7620a
+  IMAGE_SIZE := 7744k
+  DEVICE_VENDOR := Wavlink
+  DEVICE_MODEL := WL-WN579X3
+  DEVICE_PACKAGES := kmod-mt76x2 kmod-phy-realtek
+endef
+TARGET_DEVICES += wavlink_wl-wn579x3
+
 define Device/wrtnode_wrtnode
   SOC := mt7620n
   IMAGE_SIZE := 16064k
diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds
index bbedbe9f0d..53487d7526 100644
--- a/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/mt7620/base-files/etc/board.d/01_leds
@@ -194,6 +194,10 @@ tplink,archer-mr200)
 tplink,re200-v1)
 	ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0"
 	;;
+wavlink,wl-wn579x3)
+	ucidef_set_led_switch "lan" "lan" "blue:lan" "switch0" "0x20"
+	ucidef_set_led_switch "wan" "wan" "blue:wan" "switch0" "0x10"
+	;;
 zbtlink,zbt-ape522ii)
 	ucidef_set_led_netdev "wlan2g4" "wlan1-link" "green:wlan2g4" "wlan1"
 	ucidef_set_led_netdev "sys1" "wlan1" "green:sys1" "wlan1" "tx rx"
diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network
index e2e2614483..71850863c0 100644
--- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network
@@ -215,6 +215,10 @@ ramips_setup_interfaces()
 		ucidef_add_switch "switch0" \
 			"0:lan" "4:wan" "6 at eth0"
 		;;
+	wavlink,wl-wn579x3)
+		ucidef_add_switch "switch0" \
+			"5:lan" "4:wan" "6 at eth0"
+		;;
 	youku,yk-l1|\
 	youku,yk-l1c)
 		ucidef_add_switch "switch0" \


From lede-commits at lists.infradead.org  Sun Jun  6 12:38:47 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 06 Jun 2021 15:38:47 -0400
Subject: [openwrt/openwrt] ath79: add support for Devolo dLAN pro 1200+ WiFi ac
In-Reply-To: <162300832739.31616.4636715914491748668@git-01.infra.openwrt.org>
References: <162300832739.31616.4636715914491748668@git-01.infra.openwrt.org>
Message-ID: <mailman.3447.1623008334.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/624b85e646328c5f4ff271e6cf0edc5923d40c67

commit 624b85e646328c5f4ff271e6cf0edc5923d40c67
Author: Felix Matouschek <felix at matouschek.org>
AuthorDate: Thu Feb 18 23:12:01 2021 +0100

    ath79: add support for Devolo dLAN pro 1200+ WiFi ac
    
    This patch adds support for the Devolo dLAN pro 1200+ WiFi ac.
    This device is a plc wifi AC2400 router/extender with 2 Ethernet ports,
    has a QCA7500 PLC and uses the HomePlug AV2 standard.
    
    Other than the PLC the hardware is identical to the Devolo Magic 2 WIFI.
    Therefore it uses the same dts, which was moved to a dtsi to be included
    by both boards.
    
    This is a board that was previously included in the ar71xx tree.
    
    Hardware:
       SoC:         AR9344
       CPU:         560 MHz
       Flash:       16 MiB (W25Q128JVSIQ)
       RAM:         128 MiB DDR2
       Ethernet:    2xLAN 10/100/1000
       PLC:         QCA75000 (Qualcomm HPAV2)
       PLC Uplink:  1Gbps MIMO
       PLC Link:    RGMII 1Gbps (WAN)
       WiFi:        Atheros AR9340 2.4GHz 802.11bgn
                    Atheros AR9882-BR4A 5GHz 802.11ac
       Switch:      QCA8337, Port0:CPU, Port2:PLC, Port3:LAN1, Port4:LAN2
       Button:      3x Buttons (Reset, wifi and plc)
       LED:         3x Leds (wifi, plc white, plc red)
       GPIO Switch: 11-PLC Pairing (Active Low)
                    13-PLC Enable
                    21-WLAN power
    
    MACs Details verified with the stock firmware:
       Radio1: 2.4 GHz &wmac     *:4c Art location: 0x1002
       Radio0: 5.0 GHz &pcie     *:4d Art location: 0x5006
       Ethernet        &ethernet *:4e = 2.4 GHz + 2
       PLC uplink      ---       *:4f = 2.4 GHz + 3
    Label MAC address is from PLC uplink
    
    The Powerline (PLC) interface of the dLAN pro 1200+ WiFi ac requires 3rd
    party firmware which is not available from standard OpenWrt package
    feeds. There is a package feed on github which you must add to
    OpenWrt buildroot so you can build a firmware image which supports the
    plc interface.
    
    See: https://github.com/0xFelix/dlan-openwrt (forked from Devolo and
    added compatibility for OpenWrt 21.02)
    
    Flash instruction (TFTP):
     1. Set PC to fixed ip address 192.168.0.100
     2. Download the sysupgrade image and rename it to uploadfile
     3. Start a tftp server with the image file in its root directory
     4. Turn off the router
     5. Press and hold Reset button
     6. Turn on router with the reset button pressed and wait ~15 seconds
     7. Release the reset button and after a short time
        the firmware should be transferred from the tftp server
     8. Allow 1-2 minutes for the first boot.
    
    Signed-off-by: Felix Matouschek <felix at matouschek.org>
    [add "plus" to compatible and device name]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 .../dts/ar9344_devolo_dlan-pro-1200plus-ac.dts     |   8 +
 ...gic-2-wifi.dts => ar9344_devolo_dlan_wifi.dtsi} |   5 +-
 .../linux/ath79/dts/ar9344_devolo_magic-2-wifi.dts | 167 +--------------------
 .../ath79/generic/base-files/etc/board.d/01_leds   |   1 +
 .../generic/base-files/etc/board.d/02_network      |   2 +
 .../base-files/etc/board.d/03_gpio_switches        |   3 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata       |   1 +
 target/linux/ath79/image/generic.mk                |   9 ++
 8 files changed, 26 insertions(+), 170 deletions(-)

diff --git a/target/linux/ath79/dts/ar9344_devolo_dlan-pro-1200plus-ac.dts b/target/linux/ath79/dts/ar9344_devolo_dlan-pro-1200plus-ac.dts
new file mode 100644
index 0000000000..fb06d71ad4
--- /dev/null
+++ b/target/linux/ath79/dts/ar9344_devolo_dlan-pro-1200plus-ac.dts
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "ar9344_devolo_dlan_wifi.dtsi"
+
+/ {
+	model = "Devolo dLAN pro 1200+ WiFi ac";
+	compatible = "devolo,dlan-pro-1200plus-ac", "qca,ar9344";
+};
diff --git a/target/linux/ath79/dts/ar9344_devolo_magic-2-wifi.dts b/target/linux/ath79/dts/ar9344_devolo_dlan_wifi.dtsi
similarity index 94%
copy from target/linux/ath79/dts/ar9344_devolo_magic-2-wifi.dts
copy to target/linux/ath79/dts/ar9344_devolo_dlan_wifi.dtsi
index 627265bf70..9424e48654 100644
--- a/target/linux/ath79/dts/ar9344_devolo_magic-2-wifi.dts
+++ b/target/linux/ath79/dts/ar9344_devolo_dlan_wifi.dtsi
@@ -6,9 +6,6 @@
 #include <dt-bindings/input/input.h>
 
 / {
-	model = "Devolo Magic 2 Wifi";
-	compatible = "devolo,magic-2-wifi", "qca,ar9344";
-
 	aliases {
 		led-boot = &led_dlan_red;
 		led-failsafe = &led_dlan_red;
@@ -163,7 +160,7 @@
 		phy-mode = "rgmii";
 
 		qca,ar8327-initvals = <
-			/* PORT0: RGMII, MAC0/6 exchage, tx_delay 01, No rx_delay */
+			/* PORT0: RGMII, MAC0/6 exchange, tx_delay 01, No rx_delay */
 			0x04 0x06400000
 			0x08 0x00000000 /* PORT5 PAD MODE CTRL */
 			0x0c 0x00000000 /* PORT6 PAD MODE CTRL */
diff --git a/target/linux/ath79/dts/ar9344_devolo_magic-2-wifi.dts b/target/linux/ath79/dts/ar9344_devolo_magic-2-wifi.dts
index 627265bf70..d2fd8ecadf 100644
--- a/target/linux/ath79/dts/ar9344_devolo_magic-2-wifi.dts
+++ b/target/linux/ath79/dts/ar9344_devolo_magic-2-wifi.dts
@@ -1,173 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "ar9344.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
+#include "ar9344_devolo_dlan_wifi.dtsi"
 
 / {
 	model = "Devolo Magic 2 Wifi";
 	compatible = "devolo,magic-2-wifi", "qca,ar9344";
-
-	aliases {
-		led-boot = &led_dlan_red;
-		led-failsafe = &led_dlan_red;
-		led-running = &led_dlan_white;
-		led-upgrade = &led_dlan_red;
-	};
-
-	leds {
-		compatible = "gpio-leds";
-
-		wlan {
-			label = "white:wlan";
-			gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
-			linux,default-trigger = "phy1tpt";
-		};
-
-		led_dlan_white: dlan_white {
-			label = "white:dlan";
-			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
-		};
-
-		led_dlan_red: dlan_red {
-			label = "red:dlan";
-			gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
-			panic-indicator;
-		};
-	};
-
-	keys {
-		compatible = "gpio-keys";
-
-		reset {
-			label = "Reset button";
-			linux,code = <KEY_RESTART>;
-			gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
-			debounce-interval = <60>;
-		};
-
-		wifi {
-			label = "WIFI button";
-			linux,code = <KEY_RFKILL>;
-			gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
-			debounce-interval = <60>;
-		};
-
-		dlan {
-			label = "DLAN button";
-			linux,code = <BTN_0>;
-			gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
-			debounce-interval = <60>;
-		};
-	};
-};
-
-&gpio {
-	wlan_power {
-		gpio-hog;
-		line-name = "WLAN power";
-		gpios = <&gpio 21 GPIO_ACTIVE_HIGH>;
-		output-high;
-	};
-};
-
-&spi {
-	status = "okay";
-
-	flash at 0 {
-		compatible = "jedec,spi-nor";
-		reg = <0>;
-		spi-max-frequency = <25000000>;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			uboot: partition at 0 {
-				label = "u-boot";
-				reg = <0x0 0x40000>;
-				read-only;
-			};
-
-			partition at 40000 {
-				label = "u-boot-env";
-				reg = <0x40000 0x10000>;
-				read-only;
-			};
-
-			partition at 50000 {
-				label = "Config1";
-				reg = <0x50000 0x10000>;
-				read-only;
-			};
-
-			partition at 60000 {
-				label = "Config2";
-				reg = <0x60000 0x10000>;
-				read-only;
-			};
-
-			partition at 70000 {
-				compatible = "denx,uimage";
-				label = "firmware";
-				reg = <0x70000 0xf80000>;
-			};
-
-			art: partition at ff0000 {
-				label = "art";
-				reg = <0xff0000 0x10000>;
-				read-only;
-			};
-		};
-	};
-};
-
-&ref {
-	clock-frequency = <40000000>;
-};
-
-&eth0 {
-	status = "okay";
-
-	pll-data = <0x02000000 0x00000101 0x00001616>;
-
-	mtd-mac-address = <&art 0x1002>;
-	mtd-mac-address-increment = <2>;
-
-	phy-mode = "rgmii";
-	phy-handle = <&phy0>;
-};
-
-&wmac {
-	status = "okay";
-
-	mtd-cal-data = <&art 0x1000>;
-};
-
-&pcie {
-	status = "okay";
-
-	wifi at 0,0 {
-		compatible = "qcom,ath10k";
-		reg = <0 0 0 0 0>;
-	};
-};
-
-&mdio0 {
-	status = "okay";
-
-	phy0: ethernet-phy at 0 {
-		reg = <0>;
-		phy-mode = "rgmii";
-
-		qca,ar8327-initvals = <
-			/* PORT0: RGMII, MAC0/6 exchage, tx_delay 01, No rx_delay */
-			0x04 0x06400000
-			0x08 0x00000000 /* PORT5 PAD MODE CTRL */
-			0x0c 0x00000000 /* PORT6 PAD MODE CTRL */
-			0x7c 0x0000007e /* PORT0_STATUS */
-		>;
-	};
 };
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
index 8ead3ec0a3..9720e37f99 100644
--- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
@@ -178,6 +178,7 @@ compex,wpj531-16m)
 	ucidef_set_led_rssi "sig3" "SIG3" "green:sig3" "wlan0" "65" "100"
 	ucidef_set_led_rssi "sig4" "SIG4" "green:sig4" "wlan0" "50" "100"
 	;;
+devolo,dlan-pro-1200plus-ac|\
 devolo,magic-2-wifi)
 	ucidef_set_led_netdev "plcw" "dLAN" "white:dlan" "eth0.1" "rx"
 	;;
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 8ea52af67a..ffafe7db20 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
@@ -210,6 +210,7 @@ ath79_setup_interfaces()
 		ucidef_add_switch "switch0" \
 			"0 at eth0" "3:lan" "2:wan"
 		;;
+	devolo,dlan-pro-1200plus-ac|\
 	devolo,magic-2-wifi)
 		ucidef_add_switch "switch0" \
 			"0 at eth0" "2:wan" "3:lan" "4:lan"
@@ -502,6 +503,7 @@ ath79_setup_macs()
 	compex,wpj563)
 		wan_mac=$(mtd_get_mac_binary u-boot 0x2e018)
 		;;
+	devolo,dlan-pro-1200plus-ac|\
 	devolo,magic-2-wifi)
 		label_mac=$(macaddr_add "$(mtd_get_mac_binary art 0x1002)" 3)
 		;;
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches b/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches
index cd21932bfd..83f428c54a 100644
--- a/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches
+++ b/target/linux/ath79/generic/base-files/etc/board.d/03_gpio_switches
@@ -31,6 +31,9 @@ telco,t1)
 	ucidef_add_gpio_switch "lte_poweroff" "LTE Poweroff" "1" "1"
 	ucidef_add_gpio_switch "lte_reset" "LTE Reset" "12" "1"
 	;;
+devolo,dlan-pro-1200plus-ac)
+	ucidef_add_gpio_switch "plc_enable" "PLC enable" "13" "0"
+	;;
 devolo,magic-2-wifi)
 	ucidef_add_gpio_switch "plc_pairing" "PLC pairing" "11" "1"
 	ucidef_add_gpio_switch "plc_enable" "PLC enable" "13" "1"
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 b7cb2da8cd..b2392c2c64 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
@@ -23,6 +23,7 @@ case "$FIRMWARE" in
 		;;
 	comfast,cf-wr650ac-v1|\
 	comfast,cf-wr650ac-v2|\
+	devolo,dlan-pro-1200plus-ac|\
 	devolo,magic-2-wifi|\
 	qxwlan,e1700ac-v2-8m|\
 	qxwlan,e1700ac-v2-16m|\
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 4d3f455e49..b459136ef5 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -664,6 +664,15 @@ define Device/compex_wpj563
 endef
 TARGET_DEVICES += compex_wpj563
 
+define Device/devolo_dlan-pro-1200plus-ac
+  SOC := ar9344
+  DEVICE_VENDOR := Devolo
+  DEVICE_MODEL := dLAN pro 1200+ WiFi ac
+  DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
+  IMAGE_SIZE := 15872k
+endef
+TARGET_DEVICES += devolo_dlan-pro-1200plus-ac
+
 define Device/devolo_dvl1200e
   SOC := qca9558
   DEVICE_VENDOR := devolo


From lede-commits at lists.infradead.org  Sun Jun  6 12:38:53 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 06 Jun 2021 15:38:53 -0400
Subject: [openwrt/openwrt]  ath79: add support for NEC Aterm WF1200CR
In-Reply-To: <162300832739.31616.4636715914491748668@git-01.infra.openwrt.org>
References: <162300832739.31616.4636715914491748668@git-01.infra.openwrt.org>
Message-ID: <mailman.3448.1623008334.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/a4e2766a5bfa1ac1c706d1cd58c6706ffdcde895

commit a4e2766a5bfa1ac1c706d1cd58c6706ffdcde895
Author: INAGAKI Hiroshi <musashino.open at gmail.com>
AuthorDate: Thu Mar 25 00:19:59 2021 +0900

    ath79: add support for NEC Aterm WF1200CR
    
    NEC Aterm WF1200CR is a 2.4/5 GHz band 11ac (Wi-Fi 5) router, based on
    QCA9561.
    
    Specification:
    
    - SoC           : Qualcomm Atheros QCA9561
    - RAM           : DDR2 128 MiB (W971GG6SB-25)
    - Flash         : SPI-NOR 8 MiB (MX25L6433FM2I-08G)
    - WLAN          : 2.4/5 GHz 2T2R
      - 2.4 GHz     : QCA9561 (SoC)
      - 5 GHz       : QCA9888
    - Ethernet      : 2x 10/100 Mbps
      - Switch      : QCA9561 (SoC)
    - LEDs/Keys     : 8x/3x (2x buttons, 1x slide-switch)
    - UART          : through-hole on PCB
      - JP1: Vcc, GND, NC, TX, RX from "JP1" marking
      - 115200n8
    - Power         : 12 VDC, 0.9 A
    
    Flash instruction using factory image (stock: < v1.3.2):
    
    1. Boot WF1200CR normally with "Router" mode
    2. Access to "http://192.168.10.1/" and open firmware update page
       ("?????????")
    3. Select the OpenWrt factory image and click update ("??") button to
       perform firmware update
    4. Wait ~150 seconds to complete flashing
    
    Alternate flash instruction using initramfs image (stock: >= v1.3.2):
    
    1. Prepare the TFTP server with the IP address 192.168.1.10 and place
       the OpenWrt initramfs image to the TFTP directory with the name
       "0101A8C0.img"
    2. Connect serial console to WF1200CR
    3. Boot WF1200CR and interrupt with any key after the message
       "Hit any key to stop autoboot:  2", the U-Boot starts telnetd after
       the message "starting telnetd server from server 192.168.1.1"
    4. login the telnet (address: 192.168.1.1)
    5. Perform the following commands to modify "bootcmd" variable
       temporary and check the value
       (to ignore the limitation of available commands, "tp; " command at
       the first is required as dummy, and the output of "printenv" is
       printed on the serial console)
    
       tp; set bootcmd 'set autostart yes; tftpboot'
       tp; printenv
    
    6. Save the modified variable with the following command and reset
       device
    
       tp; saveenv
       tp; reset
    
    7. The U-Boot downloads initramfs image from TFTP server and boots it
    8. On initramfs image, download the sysupgrade image to the device and
       perform the following commands to erase stock firmware and sysupgrade
    
       mtd erase firmware
       sysupgrade <sysupgrade image>
    
    9. After the rebooting by completion of sysupgrade, start U-Boot telnetd
       and login with the same way above (3, 4)
    10. Perform the following commands to reset "bootcmd" variable to the
        default and reset the device
    
        tp; run seattle
        tp; reset
    
        (the contents of "seattle":
         setenv bootcmd 'bootm 0x9f070040' && saveenv)
    11. Wait booting-up the device
    
    Known issues:
    
    - the following 6x LEDs are connected to the gpio controller on QCA9888
      chip and the implementation of control via the controller is missing in
      ath10k/ath10k-ct
    
      - "ACTIVE" (Red/Green)
      - "2.4GHz" (Red/Green)
      - "5GHz"   (Red/Green)
    
    Note:
    
    - after the version v1.3.2 of stock firmware, "offline update" by
      uploading image by user is deleted and the factory image cannot be
      used
    
    - the U-Boot on WF1200CR doesn't configure the port-side LEDs on WAN/LAN
      and the configuration is required on OpenWrt
    
      - gpio-hog: set the direction of GPIO 14(WAN)/19(LAN) to output
      - pinmux: set GPIO 14/19 as switch-controlled LEDs
    
    Signed-off-by: INAGAKI Hiroshi <musashino.open at gmail.com>
---
 target/linux/ath79/dts/qca9561_nec_wf1200cr.dts    | 166 +++++++++++++++++++++
 .../generic/base-files/etc/board.d/02_network      |   6 +
 .../etc/hotplug.d/firmware/10-ath9k-eeprom         |   1 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata       |   1 +
 target/linux/ath79/image/generic.mk                |  27 +++-
 5 files changed, 196 insertions(+), 5 deletions(-)

diff --git a/target/linux/ath79/dts/qca9561_nec_wf1200cr.dts b/target/linux/ath79/dts/qca9561_nec_wf1200cr.dts
new file mode 100644
index 0000000000..90aac30d7f
--- /dev/null
+++ b/target/linux/ath79/dts/qca9561_nec_wf1200cr.dts
@@ -0,0 +1,166 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qca956x.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	model = "NEC Aterm WF1200CR";
+	compatible = "nec,wf1200cr", "qca,qca9561";
+
+	aliases {
+		led-boot = &led_power_green;
+		led-failsafe = &led_power_red;
+		led-running = &led_power_green;
+		led-upgrade = &led_power_green;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		/* other LEDs are connected to ath10k (QCA9888) gpiochip */
+
+		led_power_green: power_green {
+			label = "green:power";
+			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+		};
+
+		led_power_red: power_red {
+			label = "red:power";
+			gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+			debounce-interval = <60>;
+		};
+
+		router {
+			label = "rt";
+			gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
+			linux,code = <BTN_0>;
+			linux,input-type = <EV_SW>;
+			debounce-interval = <60>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_WPS_BUTTON>;
+			debounce-interval = <60>;
+		};
+	};
+};
+
+&spi {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <25000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x000000 0x040000>;
+				read-only;
+			};
+
+			partition at 40000 {
+				label = "devdata";
+				reg = <0x040000 0x010000>;
+				read-only;
+			};
+
+			partition at 50000 {
+				label = "devconf";
+				reg = <0x050000 0x010000>;
+				read-only;
+			};
+
+			partition at 60000 {
+				label = "misc";
+				reg = <0x060000 0x010000>;
+				read-only;
+			};
+
+			partition at 70000 {
+				compatible = "seama";
+				label = "firmware";
+				reg = <0x070000 0x780000>;
+			};
+
+			partition at 7f0000 {
+				label = "art";
+				reg = <0x7f0000 0x010000>;
+				read-only;
+			};
+		};
+	};
+};
+
+&eth0 {
+	status = "okay";
+
+	pll-data = <0x03000101 0x00000101 0x00001919>;
+
+	phy-handle = <&swphy0>;
+
+	gmac-config {
+		device = <&gmac>;
+
+		switch-phy-swap = <1>;
+		switch-phy-addr-swap = <0>;
+	};
+};
+
+&eth1 {
+	status = "okay";
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&pinmux_swled_enable_pins>;
+};
+
+&gpio {
+	switch_leds {
+		gpio-hog;
+		gpios = <14 GPIO_ACTIVE_HIGH>,	/* WAN */
+			<19 GPIO_ACTIVE_HIGH>;	/* LAN */
+		output-high;
+		line-name = "led:wan-lan";
+	};
+};
+
+&pinmux {
+	pinmux_swled_enable_pins: swled_enable_pins {
+		pinctrl-single,bits =
+			<0xc 0x240000 0xff0000>,	/* WAN */
+			<0x10 0x10000000 0xff000000>;	/* LAN */
+	};
+};
+
+&pcie {
+	status = "okay";
+
+	wifi at 0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0x0000 0 0 0 0>;
+	};
+};
+
+&wmac {
+	status = "okay";
+
+	qca,no-eeprom;
+};
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 ffafe7db20..f07c086977 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
@@ -300,6 +300,11 @@ ath79_setup_interfaces()
 		ucidef_add_switch "switch0" \
 			"0 at eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
 		;;
+	nec,wf1200cr)
+		ucidef_set_interface_wan "eth1"
+		ucidef_add_switch "switch0" \
+			"0 at eth0" "1:lan"
+		;;
 	nec,wg1200cr|\
 	qxwlan,e1700ac-v2-8m|\
 	qxwlan,e1700ac-v2-16m|\
@@ -599,6 +604,7 @@ ath79_setup_macs()
 		base_mac=$(mtd_get_mac_binary u-boot 0x1fc00)
 		wan_mac=$(macaddr_add "$base_mac" 1)
 		;;
+	nec,wf1200cr|\
 	nec,wg1200cr)
 		lan_mac=$(mtd_get_mac_ascii devdata "lanmac")
 		wan_mac=$(mtd_get_mac_ascii devdata "wanmac")
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 62f2f1e8b4..388f477856 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
@@ -32,6 +32,7 @@ case "$FIRMWARE" in
 	dlink,dir-842-c2|\
 	dlink,dir-842-c3|\
 	dlink,dir-859-a1|\
+	nec,wf1200cr|\
 	nec,wg1200cr|\
 	wd,mynet-n750)
 		caldata_extract "art" 0x1000 0x440
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 b2392c2c64..feb9a5186e 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
@@ -201,6 +201,7 @@ case "$FIRMWARE" in
 		ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
 			/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
 		;;
+	nec,wf1200cr|\
 	nec,wg1200cr)
 		caldata_extract "art" 0x5000 0x2f20
 		ath10k_patch_mac $(mtd_get_mac_ascii devdata wlan5mac)
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index b459136ef5..9d0be2b86b 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -1417,20 +1417,37 @@ define Device/mercury_mw4530r-v1
 endef
 TARGET_DEVICES += mercury_mw4530r-v1
 
+define Device/nec_wx1200cr
+  DEVICE_VENDOR := NEC
+  IMAGE/default := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs
+  IMAGE/sysupgrade.bin := $$(IMAGE/default) | seama | pad-rootfs | \
+	append-metadata | check-size
+  DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct
+endef
+
+define Device/nec_wf1200cr
+  $(Device/nec_wx1200cr)
+  SOC := qca9561
+  DEVICE_MODEL := Aterm WF1200CR
+  IMAGE_SIZE := 7680k
+  SEAMA_MTDBLOCK := 5
+  SEAMA_SIGNATURE := wrgac62_necpf.2016gui_wf1200cr
+  IMAGES += factory.bin
+  IMAGE/factory.bin := $$(IMAGE/default) | pad-rootfs -x 64 | seama | \
+	seama-seal | nec-enc ryztfyutcrqqo69d | check-size
+endef
+TARGET_DEVICES += nec_wf1200cr
+
 define Device/nec_wg1200cr
+  $(Device/nec_wx1200cr)
   SOC := qca9563
-  DEVICE_VENDOR := NEC
   DEVICE_MODEL := Aterm WG1200CR
   IMAGE_SIZE := 7616k
   SEAMA_MTDBLOCK := 6
   SEAMA_SIGNATURE := wrgac72_necpf.2016gui_wg1200cr
   IMAGES += factory.bin
-  IMAGE/default := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs
-  IMAGE/sysupgrade.bin := $$(IMAGE/default) | seama | pad-rootfs | \
-	append-metadata | check-size
   IMAGE/factory.bin := $$(IMAGE/default) | pad-rootfs -x 64 | seama | \
 	seama-seal | nec-enc 9gsiy9nzep452pad | check-size
-  DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct
 endef
 TARGET_DEVICES += nec_wg1200cr
 


From lede-commits at lists.infradead.org  Sun Jun  6 12:38:50 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 06 Jun 2021 15:38:50 -0400
Subject: [openwrt/openwrt]  uboot-kirkwood: refresh patches
In-Reply-To: <162300832739.31616.4636715914491748668@git-01.infra.openwrt.org>
References: <162300832739.31616.4636715914491748668@git-01.infra.openwrt.org>
Message-ID: <mailman.3449.1623008336.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/482e65a16d2c49b5547b032caa060f423a3cb4a5

commit 482e65a16d2c49b5547b032caa060f423a3cb4a5
Author: Adrian Schmutzler <freifunk at adrianschmutzler.de>
AuthorDate: Sun Jun 6 19:06:29 2021 +0200

    uboot-kirkwood: refresh patches
    
    This is only cosmetic, but the next one adding a patch here would
    have to do it anyway, and thus will get a smaller diff for review
    now.
    
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 .../patches/007-nsa310-uboot-generic.patch           |  4 ++--
 .../uboot-kirkwood/patches/010-pogoplug_v4.patch     | 16 ++++++++--------
 .../boot/uboot-kirkwood/patches/110-dockstar.patch   |  6 +++---
 .../boot/uboot-kirkwood/patches/120-iconnect.patch   |  4 ++--
 package/boot/uboot-kirkwood/patches/130-ib62x0.patch |  4 ++--
 .../uboot-kirkwood/patches/140-pogoplug_e02.patch    |  4 ++--
 .../boot/uboot-kirkwood/patches/150-goflexhome.patch |  4 ++--
 .../uboot-kirkwood/patches/200-openwrt-config.patch  | 20 ++++++++++----------
 ...mv88e61xx-add-support-for-RGMII-TX-RX-delay.patch |  7 +------
 ...702-phy-mv88e61xx-add-support-for-MV88E6171.patch | 11 +++--------
 10 files changed, 35 insertions(+), 45 deletions(-)

diff --git a/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch b/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch
index 09dc587bf7..16a1f08c84 100644
--- a/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch
+++ b/package/boot/uboot-kirkwood/patches/007-nsa310-uboot-generic.patch
@@ -28,13 +28,13 @@ NOTE: this patch is ready for upstream, LEDE-specific parts are in
 @@ -53,6 +53,9 @@ config TARGET_GOFLEXHOME
  config TARGET_NAS220
  	bool "BlackArmor NAS220"
-
+ 
 +config TARGET_NSA310
 +	bool "Zyxel NSA310 Board"
 +
  config TARGET_NSA310S
  	bool "Zyxel NSA310S"
-
+ 
 @@ -86,6 +89,7 @@ source "board/raidsonic/ib62x0/Kconfig"
  source "board/Seagate/dockstar/Kconfig"
  source "board/Seagate/goflexhome/Kconfig"
diff --git a/package/boot/uboot-kirkwood/patches/010-pogoplug_v4.patch b/package/boot/uboot-kirkwood/patches/010-pogoplug_v4.patch
index 58bf664238..250caafbf8 100644
--- a/package/boot/uboot-kirkwood/patches/010-pogoplug_v4.patch
+++ b/package/boot/uboot-kirkwood/patches/010-pogoplug_v4.patch
@@ -3,13 +3,13 @@
 @@ -25,6 +25,9 @@ config TARGET_LSXL
  config TARGET_POGO_E02
  	bool "pogo_e02 Board"
-
+ 
 +config TARGET_POGOPLUGV4
 +    bool "Pogoplug V4 Board"
 +
  config TARGET_DNS325
  	bool "dns325 Board"
-
+ 
 @@ -83,6 +86,7 @@ source "board/Marvell/guruplug/Kconfig"
  source "board/Marvell/sheevaplug/Kconfig"
  source "board/buffalo/lsxl/Kconfig"
@@ -22,11 +22,11 @@
 +++ b/arch/arm/mach-kirkwood/include/mach/kw88f6192.h
 @@ -15,6 +15,6 @@
  #define KW_REGS_PHY_BASE		KW88F6192_REGS_PHYS_BASE
-
+ 
  /* TCLK Core Clock defination */
 -#define CONFIG_SYS_TCLK	  166000000 /* 166MHz */
 +#define CONFIG_SYS_TCLK	  166666667 /* 166MHz */
-
+ 
  #endif /* _CONFIG_KW88F6192_H */
 --- a/arch/arm/mach-kirkwood/include/mach/mpp.h
 +++ b/arch/arm/mach-kirkwood/include/mach/mpp.h
@@ -35,12 +35,12 @@
  #define MPP33_TDM_DTX		MPP( 33, 0x2, 0, 1, 0,   0,   1,   1    )
  #define MPP33_GE1_13		MPP( 33, 0x3, 0, 0, 0,   1,   1,   1    )
 +#define MPP33_SATA1_ACTn        MPP( 33, 0x5, 0, 1, 0,   1,   1,   1    )
-
+ 
  #define MPP34_GPIO		MPP( 34, 0x0, 1, 1, 0,   1,   1,   1    )
  #define MPP34_TDM_SPI_CS1	MPP( 34, 0x2, 0, 1, 0,   0,   1,   1    )
  #define MPP34_GE1_14		MPP( 34, 0x3, 0, 0, 0,   1,   1,   1    )
 +#define MPP34_SATA1_ACTn       MPP( 34, 0x5, 0, 1, 0,   1,   1,   1    )
-
+ 
  #define MPP35_GPIO		MPP( 35, 0x0, 1, 1, 1,   1,   1,   1    )
  #define MPP35_TDM_CH0_TX_QL	MPP( 35, 0x2, 0, 1, 0,   0,   1,   1    )
 --- /dev/null
@@ -630,7 +630,7 @@
  obj-$(CONFIG_MMC_SDHCI_XENON)		+= xenon_sdhci.o
  obj-$(CONFIG_MMC_SDHCI_ZYNQ)		+= zynq_sdhci.o
 +obj-$(CONFIG_KIRKWOOD_MMC)		+= kirkwood_mmc.o
-
+ 
  obj-$(CONFIG_MMC_SUNXI)			+= sunxi_mmc.o
  obj-$(CONFIG_MMC_UNIPHIER)		+= tmio-common.o uniphier-sd.o
 --- /dev/null
@@ -1123,7 +1123,7 @@
 @@ -75,4 +75,10 @@
  #define CONFIG_SYS_MAX_NAND_DEVICE     1
  #endif
-
+ 
 +/*
 + * Kirkwood MMC
 + */
diff --git a/package/boot/uboot-kirkwood/patches/110-dockstar.patch b/package/boot/uboot-kirkwood/patches/110-dockstar.patch
index b3837956bc..c3889e122e 100644
--- a/package/boot/uboot-kirkwood/patches/110-dockstar.patch
+++ b/package/boot/uboot-kirkwood/patches/110-dockstar.patch
@@ -5,7 +5,7 @@
  #define CONFIG_KW88F6281	1	/* SOC Name */
  #define CONFIG_SKIP_LOWLEVEL_INIT	/* disable board lowlevel_init */
 +#define CONFIG_SYS_MVFS
-
+ 
  /*
   * mv-common.h should be defined after CMD configs since it used them
 @@ -37,19 +38,15 @@
@@ -20,7 +20,7 @@
 +	"ubi part ubi; " \
 +	"ubi read 0x800000 kernel; " \
 +	"bootm 0x800000"
-
+ 
  #define CONFIG_EXTRA_ENV_SETTINGS \
 -	"console=console=ttyS0,115200\0" \
 -	"mtdids=nand0=orion_nand\0" \
@@ -32,7 +32,7 @@
 +	"mtdids=nand0=orion_nand\0"		\
 +	"mtdparts="CONFIG_MTDPARTS_DEFAULT "\0"	\
 +	"bootargs_root=\0"
-
+ 
  /*
   * Ethernet Driver configuration
 --- a/configs/dockstar_defconfig
diff --git a/package/boot/uboot-kirkwood/patches/120-iconnect.patch b/package/boot/uboot-kirkwood/patches/120-iconnect.patch
index 770a52f737..dad3dd4744 100644
--- a/package/boot/uboot-kirkwood/patches/120-iconnect.patch
+++ b/package/boot/uboot-kirkwood/patches/120-iconnect.patch
@@ -10,7 +10,7 @@
 +	"ubi part ubi; " \
 +	"ubi read 0x800000 kernel; " \
  	"bootm 0x800000"
-
+ 
  #define CONFIG_EXTRA_ENV_SETTINGS \
  	"console=console=ttyS0,115200\0"	\
  	"mtdids=nand0=orion_nand\0"		\
@@ -19,7 +19,7 @@
 -	"bootargs_root=noinitrd ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs\0"
 +	"mtdparts="CONFIG_MTDPARTS_DEFAULT "\0"	\
 +	"bootargs_root=\0"
-
+ 
  /*
   * Ethernet driver configuration
 --- a/configs/iconnect_defconfig
diff --git a/package/boot/uboot-kirkwood/patches/130-ib62x0.patch b/package/boot/uboot-kirkwood/patches/130-ib62x0.patch
index 0092d989e1..c4ee8f0330 100644
--- a/package/boot/uboot-kirkwood/patches/130-ib62x0.patch
+++ b/package/boot/uboot-kirkwood/patches/130-ib62x0.patch
@@ -14,7 +14,7 @@
 +	"ubi part ubi; " \
 +	"ubi read 0x800000 kernel; " \
 +	"bootm 0x800000"
-
+ 
  #define CONFIG_EXTRA_ENV_SETTINGS \
  	"console=console=ttyS0,115200\0"				\
  	"mtdids=nand0=orion_nand\0"					\
@@ -24,7 +24,7 @@
 -	"bootargs_root=ubi.mtd=2 root=ubi0:rootfs rootfstype=ubifs rw\0"
 +	"mtdparts="CONFIG_MTDPARTS_DEFAULT "\0"			\
 +	"bootargs_root=\0"
-
+ 
  /*
   * Ethernet driver configuration
 --- a/configs/ib62x0_defconfig
diff --git a/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch b/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch
index d077915c93..53ad98291c 100644
--- a/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch
+++ b/package/boot/uboot-kirkwood/patches/140-pogoplug_e02.patch
@@ -12,7 +12,7 @@
 +	"ubifsmount ubi:rootfs; "					\
 +	"ubi read 0x800000 kernel; "					\
 +	"bootm 0x800000"
-
+ 
  #define CONFIG_EXTRA_ENV_SETTINGS \
 -	"mtdparts=mtdparts=orion_nand:1M(u-boot),4M(uImage)," \
 -	"32M(rootfs),-(data)\0"\
@@ -24,7 +24,7 @@
 +	"mtdids=nand0=orion_nand\0"		\
 +	"mtdparts="CONFIG_MTDPARTS_DEFAULT "\0"	\
 +	"bootargs_root=\0"
-
+ 
  /*
   * Ethernet Driver configuration
 --- a/configs/pogo_e02_defconfig
diff --git a/package/boot/uboot-kirkwood/patches/150-goflexhome.patch b/package/boot/uboot-kirkwood/patches/150-goflexhome.patch
index 55d69b81d5..014ae66338 100644
--- a/package/boot/uboot-kirkwood/patches/150-goflexhome.patch
+++ b/package/boot/uboot-kirkwood/patches/150-goflexhome.patch
@@ -10,7 +10,7 @@
 +	"ubi part ubi; " \
 +	"ubi read 0x800000 kernel; " \
  	"bootm 0x800000"
-
+ 
  #define CONFIG_EXTRA_ENV_SETTINGS \
  	"console=console=ttyS0,115200\0" \
  	"mtdids=nand0=orion_nand\0" \
@@ -19,7 +19,7 @@
 -	"bootargs_root=ubi.mtd=root root=ubi0:root rootfstype=ubifs ro\0"
 +	"mtdparts="CONFIG_MTDPARTS_DEFAULT "\0" \
 +	"bootargs_root=\0"
-
+ 
  /*
   * Ethernet Driver configuration
 --- a/configs/goflexhome_defconfig
diff --git a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch
index ae9fdf3390..bfd3d3278e 100644
--- a/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch
+++ b/package/boot/uboot-kirkwood/patches/200-openwrt-config.patch
@@ -3,7 +3,7 @@
 @@ -107,4 +107,7 @@ source "board/alliedtelesis/SBx81LIFXCAT
  source "board/Marvell/db-88f6281-bp/Kconfig"
  source "board/checkpoint/l-50/Kconfig"
-
+ 
 +config SECOND_STAGE
 +	bool "OpenWrt second stage hack"
 +
@@ -13,7 +13,7 @@
 @@ -60,4 +60,6 @@
   * File system
   */
-
+ 
 +#include "openwrt-kirkwood-common.h"
 +
  #endif /* _CONFIG_DOCKSTAR_H */
@@ -22,7 +22,7 @@
 @@ -77,4 +77,6 @@
  #define CONFIG_RTC_MV
  #endif /* CONFIG_CMD_DATE */
-
+ 
 +#include "openwrt-kirkwood-common.h"
 +
  #endif /* _CONFIG_IB62x0_H */
@@ -31,7 +31,7 @@
 @@ -67,4 +67,6 @@
   * File system
   */
-
+ 
 +#include "openwrt-kirkwood-common.h"
 +
  #endif /* _CONFIG_ICONNECT_H */
@@ -40,7 +40,7 @@
 @@ -12,6 +12,8 @@
  #ifndef _CONFIG_L50_H
  #define _CONFIG_L50_H
-
+ 
 +#include "openwrt-kirkwood-common.h"
 +
  /*
@@ -85,7 +85,7 @@
 @@ -66,4 +66,6 @@
   * File system
   */
-
+ 
 +#include "openwrt-kirkwood-common.h"
 +
  #endif /* _CONFIG_POGO_E02_H */
@@ -94,7 +94,7 @@
 @@ -85,4 +85,6 @@
  #define CONFIG_SYS_ATA_IDE0_OFFSET      MV_SATA_PORT0_OFFSET
  #endif /*CONFIG_MVSATA_IDE*/
-
+ 
 +#include "openwrt-kirkwood-common.h"
 +
  #endif /* _CONFIG_GOFLEXHOME_H */
@@ -103,7 +103,7 @@
 @@ -100,4 +100,6 @@
  #define CONFIG_RTC_MV
  #endif /* CONFIG_CMD_DATE */
-
+ 
 +#include "openwrt-kirkwood-common.h"
 +
  #endif /* _CONFIG_NSA310_H */
@@ -200,13 +200,13 @@
 @@ -63,4 +63,6 @@
  #define CONFIG_RTC_MV
  #endif /* CONFIG_CMD_DATE */
-
+ 
 +#include "openwrt-kirkwood-common.h"
 +
  #endif /* _CONFIG_NSA310S_H */
 --- a/configs/sheevaplug_defconfig
 +++ b/configs/sheevaplug_defconfig
-@@ -49,4 +49,7 @@
+@@ -49,4 +49,7 @@ CONFIG_USB=y
  CONFIG_DM_USB=y
  CONFIG_USB_EHCI_HCD=y
  CONFIG_USB_STORAGE=y
diff --git a/package/boot/uboot-kirkwood/patches/701-phy-mv88e61xx-add-support-for-RGMII-TX-RX-delay.patch b/package/boot/uboot-kirkwood/patches/701-phy-mv88e61xx-add-support-for-RGMII-TX-RX-delay.patch
index 6e358857b7..66550f91fa 100644
--- a/package/boot/uboot-kirkwood/patches/701-phy-mv88e61xx-add-support-for-RGMII-TX-RX-delay.patch
+++ b/package/boot/uboot-kirkwood/patches/701-phy-mv88e61xx-add-support-for-RGMII-TX-RX-delay.patch
@@ -17,8 +17,6 @@ Signed-off-by: Pawel Dembicki <paweldembicki at gmail.com>
  drivers/net/phy/mv88e61xx.c | 11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)
 
-diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c
-index 5aff7ed397..889327639d 100644
 --- a/drivers/net/phy/mv88e61xx.c
 +++ b/drivers/net/phy/mv88e61xx.c
 @@ -94,6 +94,8 @@
@@ -30,7 +28,7 @@ index 5aff7ed397..889327639d 100644
  #define PORT_REG_PHYS_CTRL_PCS_AN_EN	BIT(10)
  #define PORT_REG_PHYS_CTRL_PCS_AN_RST	BIT(9)
  #define PORT_REG_PHYS_CTRL_FC_VALUE	BIT(7)
-@@ -747,9 +749,16 @@ static int mv88e61xx_fixed_port_setup(struct phy_device *phydev, u8 port)
+@@ -747,9 +749,16 @@ static int mv88e61xx_fixed_port_setup(st
  		       PORT_REG_PHYS_CTRL_SPD1000;
  	}
  
@@ -48,6 +46,3 @@ index 5aff7ed397..889327639d 100644
  
  	return mv88e61xx_port_write(phydev, port, PORT_REG_PHYS_CTRL,
  				   val);
--- 
-2.20.1
-
diff --git a/package/boot/uboot-kirkwood/patches/702-phy-mv88e61xx-add-support-for-MV88E6171.patch b/package/boot/uboot-kirkwood/patches/702-phy-mv88e61xx-add-support-for-MV88E6171.patch
index c91a06cbed..e9caa00852 100644
--- a/package/boot/uboot-kirkwood/patches/702-phy-mv88e61xx-add-support-for-MV88E6171.patch
+++ b/package/boot/uboot-kirkwood/patches/702-phy-mv88e61xx-add-support-for-MV88E6171.patch
@@ -16,8 +16,6 @@ Signed-off-by: Pawel Dembicki <paweldembicki at gmail.com>
  drivers/net/phy/mv88e61xx.c | 14 ++++++++++++++
  1 file changed, 14 insertions(+)
 
-diff --git a/drivers/net/phy/mv88e61xx.c b/drivers/net/phy/mv88e61xx.c
-index 889327639d..e0b648a54e 100644
 --- a/drivers/net/phy/mv88e61xx.c
 +++ b/drivers/net/phy/mv88e61xx.c
 @@ -180,6 +180,7 @@
@@ -28,7 +26,7 @@ index 889327639d..e0b648a54e 100644
  #define PORT_SWITCH_ID_6172		0x1720
  #define PORT_SWITCH_ID_6176		0x1760
  #define PORT_SWITCH_ID_6220		0x2200
-@@ -997,6 +998,7 @@ static int mv88e61xx_probe(struct phy_device *phydev)
+@@ -997,6 +998,7 @@ static int mv88e61xx_probe(struct phy_de
  	switch (priv->id) {
  	case PORT_SWITCH_ID_6096:
  	case PORT_SWITCH_ID_6097:
@@ -36,7 +34,7 @@ index 889327639d..e0b648a54e 100644
  	case PORT_SWITCH_ID_6172:
  	case PORT_SWITCH_ID_6176:
  	case PORT_SWITCH_ID_6240:
-@@ -1152,6 +1154,17 @@ static struct phy_driver mv88e61xx_driver = {
+@@ -1152,6 +1154,17 @@ static struct phy_driver mv88e61xx_drive
  	.shutdown = &genphy_shutdown,
  };
  
@@ -54,7 +52,7 @@ index 889327639d..e0b648a54e 100644
  static struct phy_driver mv88e609x_driver = {
  	.name = "Marvell MV88E609x",
  	.uid = 0x1410c89,
-@@ -1177,6 +1190,7 @@ static struct phy_driver mv88e6071_driver = {
+@@ -1177,6 +1190,7 @@ static struct phy_driver mv88e6071_drive
  int phy_mv88e61xx_init(void)
  {
  	phy_register(&mv88e61xx_driver);
@@ -62,6 +60,3 @@ index 889327639d..e0b648a54e 100644
  	phy_register(&mv88e609x_driver);
  	phy_register(&mv88e6071_driver);
  
--- 
-2.20.1
-


From lede-commits at lists.infradead.org  Sun Jun  6 15:37:49 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 06 Jun 2021 18:37:49 -0400
Subject: [openwrt/openwrt] ath79: fix eth0 PLL registers on WD My Net Wi-Fi
 Range Extender
In-Reply-To: <162301906857.26031.5899968316671725657@git-01.infra.openwrt.org>
References: <162301906857.26031.5899968316671725657@git-01.infra.openwrt.org>
Message-ID: <mailman.3467.1623019074.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/f36990eae77c3a22842a2c418378c5dd40dec366

commit f36990eae77c3a22842a2c418378c5dd40dec366
Author: Jonathan A. Kollasch <jakllsch at kollasch.net>
AuthorDate: Fri Sep 11 14:33:39 2020 -0500

    ath79: fix eth0 PLL registers on WD My Net Wi-Fi Range Extender
    
    This replaces the register bits for RGMII delay on the MAC side in favor
    of having the RGMII delay on the PHY side by setting the phy-mode
    property to rgmii-id (RGMII internal delay), which is supported by the
    at803x driver.  Speed 1000 is fixed as a result, so now all ethernet
    speeds function.
    
    Signed-off-by: Jonathan A. Kollasch <jakllsch at kollasch.net>
    Reviewed-by: Michael Pratt <mcpratt at pm.me>
---
 target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts b/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts
index 575c72ee7c..7313e9acc2 100644
--- a/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts
+++ b/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts
@@ -144,10 +144,10 @@
 &eth0 {
 	status = "okay";
 
-	pll-data = <0x0e000000 0x3c000101 0x3c001313>;
+	pll-data = <0x02000000 0x00000101 0x00001313>;
 
 	/* ethernet MAC is stored in nvram */
-	phy-mode = "rgmii";
+	phy-mode = "rgmii-id";
 	phy-handle = <&phy4>;
 
 	gmac-config {


From lede-commits at lists.infradead.org  Sun Jun  6 15:37:48 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 06 Jun 2021 18:37:48 -0400
Subject: [openwrt/openwrt]  ath79: Support for Ubiquiti Rocket 5AC Lite
In-Reply-To: <162301906857.26031.5899968316671725657@git-01.infra.openwrt.org>
References: <162301906857.26031.5899968316671725657@git-01.infra.openwrt.org>
Message-ID: <mailman.3468.1623019074.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/3e0387b3db86b35e101b147692d0af04c5083ca9

commit 3e0387b3db86b35e101b147692d0af04c5083ca9
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Sun Apr 25 22:41:46 2021 +0200

    ath79: Support for Ubiquiti Rocket 5AC Lite
    
    The Ubiquiti Rocket 5AC Lite (R5AC-Lite) is an outdoor router.
    
    Specifications:
     - SoC: Qualcomm Atheros QCA9558
     - RAM: 128 MB
     - Flash: 16 MB SPI
     - Ethernet: 1x 10/100/1000 Mbps
     - WiFi 5 GHz: QCA988x
     - Buttons: 1x (reset)
     - LEDs: 1x power, 1x Ethernet, 4x RSSI
    
    Installation:
    - Instructions for XC-type Ubiquiti:
      https://openwrt.org/toh/ubiquiti/common
    
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 .../ath79/dts/qca9558_ubnt_rocket-5ac-lite.dts     | 38 ++++++++++++++++++++++
 .../generic/base-files/etc/board.d/02_network      |  1 +
 .../etc/hotplug.d/firmware/11-ath10k-caldata       |  1 +
 target/linux/ath79/image/generic-ubnt.mk           |  9 +++++
 4 files changed, 49 insertions(+)

diff --git a/target/linux/ath79/dts/qca9558_ubnt_rocket-5ac-lite.dts b/target/linux/ath79/dts/qca9558_ubnt_rocket-5ac-lite.dts
new file mode 100644
index 0000000000..e8e2322c56
--- /dev/null
+++ b/target/linux/ath79/dts/qca9558_ubnt_rocket-5ac-lite.dts
@@ -0,0 +1,38 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include "qca955x_ubnt_xc.dtsi"
+
+/ {
+	compatible = "ubnt,rocket-5ac-lite", "ubnt,xc", "qca,qca9558";
+	model = "Ubiquiti Rocket 5AC Lite";
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "Reset button";
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
+			debounce-interval = <60>;
+		};
+	};
+};
+
+&mdio0 {
+	status = "okay";
+
+	phy-mask = <4>;
+	phy4: ethernet-phy at 4 {
+		phy-mode = "sgmii";
+		reg = <4>;
+		at803x-override-sgmii-link-check;
+	};
+};
+
+&eth0 {
+	status = "okay";
+
+	mtd-mac-address = <&art 0x0>;
+	phy-mode = "sgmii";
+	phy-handle = <&phy4>;
+};
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 f07c086977..c1ba760182 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
@@ -86,6 +86,7 @@ ath79_setup_interfaces()
 	ubnt,powerbeam-5ac-500|\
 	ubnt,powerbeam-5ac-gen2|\
 	ubnt,powerbridge-m|\
+	ubnt,rocket-5ac-lite|\
 	ubnt,rocket-m|\
 	ubnt,unifiac-lite|\
 	ubnt,unifiac-lr|\
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 feb9a5186e..8d070cba27 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
@@ -43,6 +43,7 @@ case "$FIRMWARE" in
 	ubnt,nanostation-ac-loco|\
 	ubnt,powerbeam-5ac-500|\
 	ubnt,powerbeam-5ac-gen2|\
+	ubnt,rocket-5ac-lite|\
 	ubnt,unifiac-pro|\
 	yuncore,a770)
 		caldata_extract "art" 0x5000 0x844
diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk
index 733d803d7a..f8e1d1e432 100644
--- a/target/linux/ath79/image/generic-ubnt.mk
+++ b/target/linux/ath79/image/generic-ubnt.mk
@@ -337,6 +337,15 @@ define Device/ubnt_powerbridge-m
 endef
 TARGET_DEVICES += ubnt_powerbridge-m
 
+define Device/ubnt_rocket-5ac-lite
+  $(Device/ubnt-xc)
+  SOC := qca9558
+  DEVICE_MODEL := Rocket 5AC
+  DEVICE_VARIANT := Lite
+  DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca988x-ct
+endef
+TARGET_DEVICES += ubnt_rocket-5ac-lite
+
 define Device/ubnt_rocket-m
   $(Device/ubnt-xm)
   SOC := ar7241


From lede-commits at lists.infradead.org  Mon Jun  7 15:15:12 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 07 Jun 2021 18:15:12 -0400
Subject: [openwrt/openwrt]  ugps: update to git HEAD
In-Reply-To: <162310411218.19048.1330819389840098581@git-01.infra.openwrt.org>
References: <162310411218.19048.1330819389840098581@git-01.infra.openwrt.org>
Message-ID: <mailman.3755.1623104119.434944.lede-commits@lists.infradead.org>

dangole pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/3a8b75b56927d679dbf1a86827ceffef35207281

commit 3a8b75b56927d679dbf1a86827ceffef35207281
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Mon Jun 7 23:13:18 2021 +0100

    ugps: update to git HEAD
    
     86ee86e nmea: parse $GPZDA sentences for date/time
     8e12414 nmea: parse $GPGLL sentences for position
     5e88403 ubus: display only available information
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 package/utils/ugps/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/utils/ugps/Makefile b/package/utils/ugps/Makefile
index 4ce64d9631..c70a7b7ea6 100644
--- a/package/utils/ugps/Makefile
+++ b/package/utils/ugps/Makefile
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ugps
-PKG_RELEASE:=1
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/ugps.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2020-08-29
-PKG_SOURCE_VERSION:=511a5b3c84fa715ef0305cf26c98619c12a4867a
-PKG_MIRROR_HASH:=551d57b4c18da4c4695fa2f7a959c25a03be35d14cf872785e7db740f12366e2
+PKG_SOURCE_DATE:=2021-06-08
+PKG_SOURCE_VERSION:=5e88403fc0d39ae8a270d2c6c6e9c8a4d5232cf3
+PKG_MIRROR_HASH:=a3dfc2cc6def3b634d8b7cda9139926be3d876cf2faa5251c4821987954442a5
 
 PKG_MAINTAINER:=John Crispin <john at phrozen.org>
 PKG_LICENSE:=GPL-2.0+


From lede-commits at lists.infradead.org  Mon Jun  7 15:41:15 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 07 Jun 2021 18:41:15 -0400
Subject: [openwrt/openwrt] ramips: make PHY initialization more descriptive
In-Reply-To: <162310567296.4859.4702888019157327563@git-01.infra.openwrt.org>
References: <162310567296.4859.4702888019157327563@git-01.infra.openwrt.org>
Message-ID: <mailman.3756.1623105681.434944.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/6a15abbc753ca728d798cec9153fc532fce3791d

commit 6a15abbc753ca728d798cec9153fc532fce3791d
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Sun Jun 6 19:45:24 2021 +0200

    ramips: make PHY initialization more descriptive
    
    The basic mode control register of the ESW PHYs is modified in this
    codeblock. Use the respective macros to make this code more readable.
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
index bd379e6c7d..451881fc73 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
@@ -13,6 +13,7 @@
  */
 
 #include <linux/module.h>
+#include <linux/mii.h>
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/platform_device.h>
@@ -168,9 +169,9 @@ static void mt7620_hw_init(struct mt7620_gsw *gsw, int mdio_mode)
 
 		/* turn on all PHYs */
 		for (i = 0; i <= 4; i++) {
-			val = _mt7620_mii_read(gsw, gsw->ephy_base + i, 0);
-			val &= ~BIT(11);
-			_mt7620_mii_write(gsw, gsw->ephy_base + i, 0, val);
+			val = _mt7620_mii_read(gsw, gsw->ephy_base + i, MII_BMCR);
+			val &= ~BMCR_PDOWN;
+			_mt7620_mii_write(gsw, gsw->ephy_base + i, MII_BMCR, val);
 		}
 	}
 


From lede-commits at lists.infradead.org  Mon Jun  7 15:41:12 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 07 Jun 2021 18:41:12 -0400
Subject: [openwrt/openwrt]  ethtool: update to version 5.12
In-Reply-To: <162310567296.4859.4702888019157327563@git-01.infra.openwrt.org>
References: <162310567296.4859.4702888019157327563@git-01.infra.openwrt.org>
Message-ID: <mailman.3757.1623105681.434944.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/1412424fc51209480fa4efed9f3f0badc6dcab09

commit 1412424fc51209480fa4efed9f3f0badc6dcab09
Author: Robert Marko <robimarko at gmail.com>
AuthorDate: Sun May 16 18:01:28 2021 +0200

    ethtool: update to version 5.12
    
    Update ethtool to newly released 5.12 version.
    
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/network/utils/ethtool/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/network/utils/ethtool/Makefile b/package/network/utils/ethtool/Makefile
index 3efc90490b..d645cf9bbb 100644
--- a/package/network/utils/ethtool/Makefile
+++ b/package/network/utils/ethtool/Makefile
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ethtool
-PKG_VERSION:=5.10
+PKG_VERSION:=5.12
 PKG_RELEASE:=1
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/software/network/ethtool
-PKG_HASH:=817d5396a9307b4c637b435d4c558b8f5f964a1464a035ca3c0180f4cc93cfcf
+PKG_HASH:=f5ddfa9c75053d8011b8c8c99ec4e2d3c83cd1972f638692d62e37fa3ef36f07
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING


From lede-commits at lists.infradead.org  Mon Jun  7 15:41:17 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 07 Jun 2021 18:41:17 -0400
Subject: [openwrt/openwrt]  ramips: fix patch location
In-Reply-To: <162310567296.4859.4702888019157327563@git-01.infra.openwrt.org>
References: <162310567296.4859.4702888019157327563@git-01.infra.openwrt.org>
Message-ID: <mailman.3758.1623105684.434944.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/902d7e497c3c26c1a7d9c06945746c319866b335

commit 902d7e497c3c26c1a7d9c06945746c319866b335
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Mon Jun 7 01:05:24 2021 +0200

    ramips: fix patch location
    
    The patch for adding the config_aneg function for the Atheros
    AR8031/AR8033 PHY was formatted in a way it moved to different PHY
    models while refreshing patches on kernel updates.
    
    Move the diff directly below the PHY name so this won't happen in the
    future.
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 target/linux/ramips/patches-5.4/991-at803x.patch | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/target/linux/ramips/patches-5.4/991-at803x.patch b/target/linux/ramips/patches-5.4/991-at803x.patch
index 29e79e65d7..6e178b80ce 100644
--- a/target/linux/ramips/patches-5.4/991-at803x.patch
+++ b/target/linux/ramips/patches-5.4/991-at803x.patch
@@ -147,11 +147,11 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  static struct phy_driver at803x_driver[] = {
  {
  	/* ATHEROS 8035 */
-@@ -482,6 +571,7 @@ static struct phy_driver at803x_driver[]
- 	.suspend		= at803x_suspend,
- 	.resume			= at803x_resume,
- 	/* PHY_GBIT_FEATURES */
+@@ -504,6 +593,7 @@ static struct phy_driver at803x_driver[]
+ 	/* ATHEROS 8031 */
+ 	.phy_id			= ATH8031_PHY_ID,
+ 	.name			= "Atheros 8031 ethernet",
 +	.config_aneg		= at803x_config_aneg,
- 	.read_status		= at803x_read_status,
- 	.ack_interrupt		= at803x_ack_interrupt,
- 	.config_intr		= at803x_config_intr,
+ 	.phy_id_mask		= AT803X_PHY_ID_MASK,
+ 	.probe			= at803x_probe,
+ 	.config_init		= at803x_config_init,


From lede-commits at lists.infradead.org  Mon Jun  7 15:41:13 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 07 Jun 2021 18:41:13 -0400
Subject: [openwrt/openwrt]  generic: backport at803x fixes
In-Reply-To: <162310567296.4859.4702888019157327563@git-01.infra.openwrt.org>
References: <162310567296.4859.4702888019157327563@git-01.infra.openwrt.org>
Message-ID: <mailman.3759.1623105685.434944.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/15167671b0d7cf0c95568dd6f9620db082df5d96

commit 15167671b0d7cf0c95568dd6f9620db082df5d96
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Fri Jun 4 15:12:14 2021 +0200

    generic: backport at803x fixes
    
    As patches for the AR8031/AR8033 copper page selection were merged
    upstream, we can backport these patches.
    
    This also fixes a PHY capabilities detection issue on the Ubiquiti
    ER-X-SFP.
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 ...at803x-select-correct-page-on-config-init.patch | 108 +++++++++++++++++++++
 ...03x-fix-probe-error-if-copper-page-is-sel.patch |  73 ++++++++++++++
 ...at803x-select-correct-page-on-config-init.patch | 104 ++++++++++++++++++++
 ...03x-fix-probe-error-if-copper-page-is-sel.patch |  41 ++++++++
 .../735-net-phy-at803x-fix-at8033-sgmii-mode.patch |  51 ----------
 .../736-net-phy-at803x-add-at8031-features.patch   |  36 -------
 .../735-net-phy-at803x-fix-at8033-sgmii-mode.patch |  51 ----------
 .../736-net-phy-at803x-add-at8031-features.patch   |  36 -------
 ...ess-packet-drops-at-low-traffic-rate-due-.patch |   9 +-
 ...03x-add-vddio-1v8-and-eee-disable-support.patch |  26 ++---
 target/linux/ramips/patches-5.10/710-at803x.patch  |  17 ++--
 target/linux/ramips/patches-5.4/991-at803x.patch   |  17 ++--
 12 files changed, 361 insertions(+), 208 deletions(-)

diff --git a/target/linux/generic/backport-5.10/730-net-phy-at803x-select-correct-page-on-config-init.patch b/target/linux/generic/backport-5.10/730-net-phy-at803x-select-correct-page-on-config-init.patch
new file mode 100644
index 0000000000..00be403299
--- /dev/null
+++ b/target/linux/generic/backport-5.10/730-net-phy-at803x-select-correct-page-on-config-init.patch
@@ -0,0 +1,108 @@
+From c329e5afb42ff0a88285eb4d8a391a18793e4777 Mon Sep 17 00:00:00 2001
+From: David Bauer <mail at david-bauer.net>
+Date: Thu, 15 Apr 2021 03:26:50 +0200
+Subject: [PATCH] net: phy: at803x: select correct page on config init
+
+The Atheros AR8031 and AR8033 expose different registers for SGMII/Fiber
+as well as the copper side of the PHY depending on the BT_BX_REG_SEL bit
+in the chip configure register.
+
+The driver assumes the copper side is selected on probe, but this might
+not be the case depending which page was last selected by the
+bootloader. Notably, Ubiquiti UniFi bootloaders show this behavior.
+
+Select the copper page when probing to circumvent this.
+
+Signed-off-by: David Bauer <mail at david-bauer.net>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/phy/at803x.c | 50 +++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 49 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/phy/at803x.c
++++ b/drivers/net/phy/at803x.c
+@@ -139,6 +139,9 @@
+ #define ATH8035_PHY_ID 0x004dd072
+ #define AT8030_PHY_ID_MASK			0xffffffef
+ 
++#define AT803X_PAGE_FIBER		0
++#define AT803X_PAGE_COPPER		1
++
+ MODULE_DESCRIPTION("Qualcomm Atheros AR803x PHY driver");
+ MODULE_AUTHOR("Matus Ujhelyi");
+ MODULE_LICENSE("GPL");
+@@ -190,6 +193,35 @@ static int at803x_debug_reg_mask(struct
+ 	return phy_write(phydev, AT803X_DEBUG_DATA, val);
+ }
+ 
++static int at803x_write_page(struct phy_device *phydev, int page)
++{
++	int mask;
++	int set;
++
++	if (page == AT803X_PAGE_COPPER) {
++		set = AT803X_BT_BX_REG_SEL;
++		mask = 0;
++	} else {
++		set = 0;
++		mask = AT803X_BT_BX_REG_SEL;
++	}
++
++	return __phy_modify(phydev, AT803X_REG_CHIP_CONFIG, mask, set);
++}
++
++static int at803x_read_page(struct phy_device *phydev)
++{
++	int ccr = __phy_read(phydev, AT803X_REG_CHIP_CONFIG);
++
++	if (ccr < 0)
++		return ccr;
++
++	if (ccr & AT803X_BT_BX_REG_SEL)
++		return AT803X_PAGE_COPPER;
++
++	return AT803X_PAGE_FIBER;
++}
++
+ static int at803x_enable_rx_delay(struct phy_device *phydev)
+ {
+ 	return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, 0,
+@@ -508,6 +540,7 @@ static int at803x_probe(struct phy_devic
+ {
+ 	struct device *dev = &phydev->mdio.dev;
+ 	struct at803x_priv *priv;
++	int ret;
+ 
+ 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+ 	if (!priv)
+@@ -515,7 +548,20 @@ static int at803x_probe(struct phy_devic
+ 
+ 	phydev->priv = priv;
+ 
+-	return at803x_parse_dt(phydev);
++	ret = at803x_parse_dt(phydev);
++	if (ret)
++		return ret;
++
++	/* Some bootloaders leave the fiber page selected.
++	 * Switch to the copper page, as otherwise we read
++	 * the PHY capabilities from the fiber side.
++	 */
++	if (at803x_match_phy_id(phydev, ATH8031_PHY_ID)) {
++		ret = phy_select_page(phydev, AT803X_PAGE_COPPER);
++		ret = phy_restore_page(phydev, AT803X_PAGE_COPPER, ret);
++	}
++
++	return ret;
+ }
+ 
+ static void at803x_remove(struct phy_device *phydev)
+@@ -1097,6 +1143,8 @@ static struct phy_driver at803x_driver[]
+ 	.get_wol		= at803x_get_wol,
+ 	.suspend		= at803x_suspend,
+ 	.resume			= at803x_resume,
++	.read_page		= at803x_read_page,
++	.write_page		= at803x_write_page,
+ 	/* PHY_GBIT_FEATURES */
+ 	.read_status		= at803x_read_status,
+ 	.aneg_done		= at803x_aneg_done,
diff --git a/target/linux/generic/backport-5.10/731-net-phy-at803x-fix-probe-error-if-copper-page-is-sel.patch b/target/linux/generic/backport-5.10/731-net-phy-at803x-fix-probe-error-if-copper-page-is-sel.patch
new file mode 100644
index 0000000000..d6ec7450e8
--- /dev/null
+++ b/target/linux/generic/backport-5.10/731-net-phy-at803x-fix-probe-error-if-copper-page-is-sel.patch
@@ -0,0 +1,73 @@
+From 8f7e876273e294b732b42af2e5e6bba91d798954 Mon Sep 17 00:00:00 2001
+From: Michael Walle <michael at walle.cc>
+Date: Tue, 20 Apr 2021 12:29:29 +0200
+Subject: [PATCH] net: phy: at803x: fix probe error if copper page is selected
+
+The commit c329e5afb42f ("net: phy: at803x: select correct page on
+config init") selects the copper page during probe. This fails if the
+copper page was already selected. In this case, the value of the copper
+page (which is 1) is propagated through phy_restore_page() and is
+finally returned for at803x_probe(). Fix it, by just using the
+at803x_page_write() directly.
+
+Also in case of an error, the regulator is not disabled and leads to a
+WARN_ON() when the probe fails. This couldn't happen before, because
+at803x_parse_dt() was the last call in at803x_probe(). It is hard to
+see, that the parse_dt() actually enables the regulator. Thus move the
+regulator_enable() to the probe function and undo it in case of an
+error.
+
+Fixes: c329e5afb42f ("net: phy: at803x: select correct page on config init")
+Signed-off-by: Michael Walle <michael at walle.cc>
+Reviewed-by: David Bauer <mail at david-bauer.net>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/phy/at803x.c | 23 +++++++++++++++++------
+ 1 file changed, 17 insertions(+), 6 deletions(-)
+
+--- a/drivers/net/phy/at803x.c
++++ b/drivers/net/phy/at803x.c
+@@ -527,10 +527,6 @@ static int at803x_parse_dt(struct phy_de
+ 			phydev_err(phydev, "failed to get VDDIO regulator\n");
+ 			return PTR_ERR(priv->vddio);
+ 		}
+-
+-		ret = regulator_enable(priv->vddio);
+-		if (ret < 0)
+-			return ret;
+ 	}
+ 
+ 	return 0;
+@@ -552,15 +548,30 @@ static int at803x_probe(struct phy_devic
+ 	if (ret)
+ 		return ret;
+ 
++	if (priv->vddio) {
++		ret = regulator_enable(priv->vddio);
++		if (ret < 0)
++			return ret;
++	}
++
+ 	/* Some bootloaders leave the fiber page selected.
+ 	 * Switch to the copper page, as otherwise we read
+ 	 * the PHY capabilities from the fiber side.
+ 	 */
+ 	if (at803x_match_phy_id(phydev, ATH8031_PHY_ID)) {
+-		ret = phy_select_page(phydev, AT803X_PAGE_COPPER);
+-		ret = phy_restore_page(phydev, AT803X_PAGE_COPPER, ret);
++		phy_lock_mdio_bus(phydev);
++		ret = at803x_write_page(phydev, AT803X_PAGE_COPPER);
++		phy_unlock_mdio_bus(phydev);
++		if (ret)
++			goto err;
+ 	}
+ 
++	return 0;
++
++err:
++	if (priv->vddio)
++		regulator_disable(priv->vddio);
++
+ 	return ret;
+ }
+ 
diff --git a/target/linux/generic/backport-5.4/790-net-phy-at803x-select-correct-page-on-config-init.patch b/target/linux/generic/backport-5.4/790-net-phy-at803x-select-correct-page-on-config-init.patch
new file mode 100644
index 0000000000..c6811736f8
--- /dev/null
+++ b/target/linux/generic/backport-5.4/790-net-phy-at803x-select-correct-page-on-config-init.patch
@@ -0,0 +1,104 @@
+From c329e5afb42ff0a88285eb4d8a391a18793e4777 Mon Sep 17 00:00:00 2001
+From: David Bauer <mail at david-bauer.net>
+Date: Thu, 15 Apr 2021 03:26:50 +0200
+Subject: [PATCH] net: phy: at803x: select correct page on config init
+
+The Atheros AR8031 and AR8033 expose different registers for SGMII/Fiber
+as well as the copper side of the PHY depending on the BT_BX_REG_SEL bit
+in the chip configure register.
+
+The driver assumes the copper side is selected on probe, but this might
+not be the case depending which page was last selected by the
+bootloader. Notably, Ubiquiti UniFi bootloaders show this behavior.
+
+Select the copper page when probing to circumvent this.
+
+Signed-off-by: David Bauer <mail at david-bauer.net>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/phy/at803x.c | 50 +++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 49 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/phy/at803x.c
++++ b/drivers/net/phy/at803x.c
+@@ -67,6 +67,9 @@
+ #define ATH8035_PHY_ID 0x004dd072
+ #define AT803X_PHY_ID_MASK			0xffffffef
+ 
++#define AT803X_PAGE_FIBER		0
++#define AT803X_PAGE_COPPER		1
++
+ MODULE_DESCRIPTION("Atheros 803x PHY driver");
+ MODULE_AUTHOR("Matus Ujhelyi");
+ MODULE_LICENSE("GPL");
+@@ -112,6 +115,35 @@ static int at803x_debug_reg_mask(struct
+ 	return phy_write(phydev, AT803X_DEBUG_DATA, val);
+ }
+ 
++static int at803x_write_page(struct phy_device *phydev, int page)
++{
++	int mask;
++	int set;
++
++	if (page == AT803X_PAGE_COPPER) {
++		set = AT803X_BT_BX_REG_SEL;
++		mask = 0;
++	} else {
++		set = 0;
++		mask = AT803X_BT_BX_REG_SEL;
++	}
++
++	return __phy_modify(phydev, AT803X_REG_CHIP_CONFIG, mask, set);
++}
++
++static int at803x_read_page(struct phy_device *phydev)
++{
++	int ccr = __phy_read(phydev, AT803X_REG_CHIP_CONFIG);
++
++	if (ccr < 0)
++		return ccr;
++
++	if (ccr & AT803X_BT_BX_REG_SEL)
++		return AT803X_PAGE_COPPER;
++
++	return AT803X_PAGE_FIBER;
++}
++
+ static int at803x_enable_rx_delay(struct phy_device *phydev)
+ {
+ 	return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, 0,
+@@ -244,6 +276,7 @@ static int at803x_probe(struct phy_devic
+ {
+ 	struct device *dev = &phydev->mdio.dev;
+ 	struct at803x_priv *priv;
++	int ret;
+ 
+ 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+ 	if (!priv)
+@@ -251,7 +284,16 @@ static int at803x_probe(struct phy_devic
+ 
+ 	phydev->priv = priv;
+ 
+-	return 0;
++	/* Some bootloaders leave the fiber page selected.
++	 * Switch to the copper page, as otherwise we read
++	 * the PHY capabilities from the fiber side.
++	 */
++	if ((phydev->phy_id & phydev->drv->phy_id_mask) == (ATH8031_PHY_ID & phydev->drv->phy_id_mask)) {
++		ret = phy_select_page(phydev, AT803X_PAGE_COPPER);
++		ret = phy_restore_page(phydev, AT803X_PAGE_COPPER, ret);
++	}
++
++	return ret;
+ }
+ 
+ static int at803x_config_init(struct phy_device *phydev)
+@@ -466,6 +508,8 @@ static struct phy_driver at803x_driver[]
+ 	.get_wol		= at803x_get_wol,
+ 	.suspend		= at803x_suspend,
+ 	.resume			= at803x_resume,
++	.read_page		= at803x_read_page,
++	.write_page		= at803x_write_page,
+ 	/* PHY_GBIT_FEATURES */
+ 	.read_status		= at803x_read_status,
+ 	.aneg_done		= at803x_aneg_done,
diff --git a/target/linux/generic/backport-5.4/791-net-phy-at803x-fix-probe-error-if-copper-page-is-sel.patch b/target/linux/generic/backport-5.4/791-net-phy-at803x-fix-probe-error-if-copper-page-is-sel.patch
new file mode 100644
index 0000000000..ac9583a89e
--- /dev/null
+++ b/target/linux/generic/backport-5.4/791-net-phy-at803x-fix-probe-error-if-copper-page-is-sel.patch
@@ -0,0 +1,41 @@
+From 8f7e876273e294b732b42af2e5e6bba91d798954 Mon Sep 17 00:00:00 2001
+From: Michael Walle <michael at walle.cc>
+Date: Tue, 20 Apr 2021 12:29:29 +0200
+Subject: [PATCH] net: phy: at803x: fix probe error if copper page is selected
+
+The commit c329e5afb42f ("net: phy: at803x: select correct page on
+config init") selects the copper page during probe. This fails if the
+copper page was already selected. In this case, the value of the copper
+page (which is 1) is propagated through phy_restore_page() and is
+finally returned for at803x_probe(). Fix it, by just using the
+at803x_page_write() directly.
+
+Also in case of an error, the regulator is not disabled and leads to a
+WARN_ON() when the probe fails. This couldn't happen before, because
+at803x_parse_dt() was the last call in at803x_probe(). It is hard to
+see, that the parse_dt() actually enables the regulator. Thus move the
+regulator_enable() to the probe function and undo it in case of an
+error.
+
+Fixes: c329e5afb42f ("net: phy: at803x: select correct page on config init")
+Signed-off-by: Michael Walle <michael at walle.cc>
+Reviewed-by: David Bauer <mail at david-bauer.net>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/phy/at803x.c | 23 +++++++++++++++++------
+ 1 file changed, 17 insertions(+), 6 deletions(-)
+
+--- a/drivers/net/phy/at803x.c
++++ b/drivers/net/phy/at803x.c
+@@ -289,8 +289,9 @@ static int at803x_probe(struct phy_devic
+ 	 * the PHY capabilities from the fiber side.
+ 	 */
+ 	if ((phydev->phy_id & phydev->drv->phy_id_mask) == (ATH8031_PHY_ID & phydev->drv->phy_id_mask)) {
+-		ret = phy_select_page(phydev, AT803X_PAGE_COPPER);
+-		ret = phy_restore_page(phydev, AT803X_PAGE_COPPER, ret);
++		mutex_lock(&phydev->mdio.bus->mdio_lock);
++		ret = at803x_write_page(phydev, AT803X_PAGE_COPPER);
++		mutex_unlock(&phydev->mdio.bus->mdio_lock);
+ 	}
+ 
+ 	return ret;
diff --git a/target/linux/generic/pending-5.10/735-net-phy-at803x-fix-at8033-sgmii-mode.patch b/target/linux/generic/pending-5.10/735-net-phy-at803x-fix-at8033-sgmii-mode.patch
deleted file mode 100644
index b063b10251..0000000000
--- a/target/linux/generic/pending-5.10/735-net-phy-at803x-fix-at8033-sgmii-mode.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From: Roman Yeryomin <roman at advem.lv>
-Subject: kernel: add at803x fix for sgmii mode
-
-Some (possibly broken) bootloaders incorreclty initialize at8033
-phy. This patch enables sgmii autonegotiation mode.
-
-[john at phrozen.org: felix added this to his upstream queue]
-
-Signed-off-by: Roman Yeryomin <roman at advem.lv>
----
- drivers/net/phy/at803x.c | 25 +++++++++++++++++++++++++
- 1 file changed, 25 insertions(+)
-
---- a/drivers/net/phy/at803x.c
-+++ b/drivers/net/phy/at803x.c
-@@ -76,6 +76,7 @@
- #define AT803X_LOC_MAC_ADDR_32_47_OFFSET	0x804A
- #define AT803X_REG_CHIP_CONFIG			0x1f
- #define AT803X_BT_BX_REG_SEL			0x8000
-+#define AT803X_SGMII_ANEG_EN			0x1000
- 
- #define AT803X_DEBUG_ADDR			0x1D
- #define AT803X_DEBUG_DATA			0x1E
-@@ -562,6 +563,27 @@ static int at8031_pll_config(struct phy_
- static int at803x_config_init(struct phy_device *phydev)
- {
- 	int ret;
-+	u32 v;
-+
-+	if (phydev->drv->phy_id == ATH8031_PHY_ID &&
-+		phydev->interface == PHY_INTERFACE_MODE_SGMII)
-+	{
-+		v = phy_read(phydev, AT803X_REG_CHIP_CONFIG);
-+		/* select SGMII/fiber page */
-+		ret = phy_write(phydev, AT803X_REG_CHIP_CONFIG,
-+						v & ~AT803X_BT_BX_REG_SEL);
-+		if (ret)
-+			return ret;
-+		/* enable SGMII autonegotiation */
-+		ret = phy_write(phydev, MII_BMCR, AT803X_SGMII_ANEG_EN);
-+		if (ret)
-+			return ret;
-+		/* select copper page */
-+		ret = phy_write(phydev, AT803X_REG_CHIP_CONFIG,
-+						v | AT803X_BT_BX_REG_SEL);
-+		if (ret)
-+			return ret;
-+	}
- 
- 	/* The RX and TX delay default is:
- 	 *   after HW reset: RX delay enabled and TX delay disabled
diff --git a/target/linux/generic/pending-5.10/736-net-phy-at803x-add-at8031-features.patch b/target/linux/generic/pending-5.10/736-net-phy-at803x-add-at8031-features.patch
deleted file mode 100644
index 77d3946aae..0000000000
--- a/target/linux/generic/pending-5.10/736-net-phy-at803x-add-at8031-features.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-Add back explicit PHY feature flags for the AR8031 and
-AR8033 PHY instead of reading them from the PHY.
-
-The Botloader for Ubiquiti UniFi AC boards (and possibly more)
-leave fiber page selected, thus we will end up reading the PHY
-capabilities of the SGMII side (which does not offer 10 Mbit/s).
-
-We already have a hack in place, which switches back to the copper
-page, however this happens after capabilities are read.
-
-The original conversation about 735-net-phy-at803x-fix-at8033-sgmii-mode
-back in 2015 explicitly mention the UniFi AC Lite. The issue however is
-not missing autonegotiation on the Fiber side, but the fact the PHY
-is never switched to the copper side. So half of this patch is superfluous.
-
-A fix is currently being upstreamed. Once this is mainlined and available to us,
-these patches can be dropped:
-
-735-net-phy-at803x-fix-at8033-sgmii-mode.patch
-736-net-phy-at803x-add-at8031-features.patch
-
-This was tested on a UniFi AC Lite.
-
-See https://patchwork.kernel.org/project/netdevbpf/list/?series=467341
-
---- a/drivers/net/phy/at803x.c
-+++ b/drivers/net/phy/at803x.c
-@@ -1119,7 +1119,7 @@ static struct phy_driver at803x_driver[]
- 	.get_wol		= at803x_get_wol,
- 	.suspend		= at803x_suspend,
- 	.resume			= at803x_resume,
--	/* PHY_GBIT_FEATURES */
-+	.features               = PHY_GBIT_FEATURES,
- 	.read_status		= at803x_read_status,
- 	.aneg_done		= at803x_aneg_done,
- 	.ack_interrupt		= &at803x_ack_interrupt,
diff --git a/target/linux/generic/pending-5.4/735-net-phy-at803x-fix-at8033-sgmii-mode.patch b/target/linux/generic/pending-5.4/735-net-phy-at803x-fix-at8033-sgmii-mode.patch
deleted file mode 100644
index 795743057a..0000000000
--- a/target/linux/generic/pending-5.4/735-net-phy-at803x-fix-at8033-sgmii-mode.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-From: Roman Yeryomin <roman at advem.lv>
-Subject: kernel: add at803x fix for sgmii mode
-
-Some (possibly broken) bootloaders incorreclty initialize at8033
-phy. This patch enables sgmii autonegotiation mode.
-
-[john at phrozen.org: felix added this to his upstream queue]
-
-Signed-off-by: Roman Yeryomin <roman at advem.lv>
----
- drivers/net/phy/at803x.c | 25 +++++++++++++++++++++++++
- 1 file changed, 25 insertions(+)
-
---- a/drivers/net/phy/at803x.c
-+++ b/drivers/net/phy/at803x.c
-@@ -46,6 +46,7 @@
- #define AT803X_LOC_MAC_ADDR_32_47_OFFSET	0x804A
- #define AT803X_REG_CHIP_CONFIG			0x1f
- #define AT803X_BT_BX_REG_SEL			0x8000
-+#define AT803X_SGMII_ANEG_EN			0x1000
- 
- #define AT803X_DEBUG_ADDR			0x1D
- #define AT803X_DEBUG_DATA			0x1E
-@@ -259,6 +260,27 @@ static int at803x_probe(struct phy_devic
- static int at803x_config_init(struct phy_device *phydev)
- {
- 	int ret;
-+	u32 v;
-+
-+	if (phydev->drv->phy_id == ATH8031_PHY_ID &&
-+		phydev->interface == PHY_INTERFACE_MODE_SGMII)
-+	{
-+		v = phy_read(phydev, AT803X_REG_CHIP_CONFIG);
-+		/* select SGMII/fiber page */
-+		ret = phy_write(phydev, AT803X_REG_CHIP_CONFIG,
-+						v & ~AT803X_BT_BX_REG_SEL);
-+		if (ret)
-+			return ret;
-+		/* enable SGMII autonegotiation */
-+		ret = phy_write(phydev, MII_BMCR, AT803X_SGMII_ANEG_EN);
-+		if (ret)
-+			return ret;
-+		/* select copper page */
-+		ret = phy_write(phydev, AT803X_REG_CHIP_CONFIG,
-+						v | AT803X_BT_BX_REG_SEL);
-+		if (ret)
-+			return ret;
-+	}
- 
- 	/* The RX and TX delay default is:
- 	 *   after HW reset: RX delay enabled and TX delay disabled
diff --git a/target/linux/generic/pending-5.4/736-net-phy-at803x-add-at8031-features.patch b/target/linux/generic/pending-5.4/736-net-phy-at803x-add-at8031-features.patch
deleted file mode 100644
index aa70f82823..0000000000
--- a/target/linux/generic/pending-5.4/736-net-phy-at803x-add-at8031-features.patch
+++ /dev/null
@@ -1,36 +0,0 @@
-Add back explicit PHY feature flags for the AR8031 and
-AR8033 PHY instead of reading them from the PHY.
-
-The Botloader for Ubiquiti UniFi AC boards (and possibly more)
-leave fiber page selected, thus we will end up reading the PHY
-capabilities of the SGMII side (which does not offer 10 Mbit/s).
-
-We already have a hack in place, which switches back to the copper
-page, however this happens after capabilities are read.
-
-The original conversation about 735-net-phy-at803x-fix-at8033-sgmii-mode
-back in 2015 explicitly mention the UniFi AC Lite. The issue however is
-not missing autonegotiation on the Fiber side, but the fact the PHY
-is never switched to the copper side. So half of this patch is superfluous.
-
-A fix is currently being upstreamed. Once this is mainlined and available to us,
-these patches can be dropped:
-
-735-net-phy-at803x-fix-at8033-sgmii-mode.patch
-736-net-phy-at803x-add-at8031-features.patch
-
-This was tested on a UniFi AC Lite.
-
-See https://patchwork.kernel.org/project/netdevbpf/list/?series=467341
-
---- a/drivers/net/phy/at803x.c
-+++ b/drivers/net/phy/at803x.c
-@@ -490,7 +490,7 @@ static struct phy_driver at803x_driver[]
- 	.get_wol		= at803x_get_wol,
- 	.suspend		= at803x_suspend,
- 	.resume			= at803x_resume,
--	/* PHY_GBIT_FEATURES */
-+	.features               = PHY_GBIT_FEATURES,
- 	.read_status		= at803x_read_status,
- 	.aneg_done		= at803x_aneg_done,
- 	.ack_interrupt		= &at803x_ack_interrupt,
diff --git a/target/linux/layerscape/patches-5.4/701-net-0327-at803x-Address-packet-drops-at-low-traffic-rate-due-.patch b/target/linux/layerscape/patches-5.4/701-net-0327-at803x-Address-packet-drops-at-low-traffic-rate-due-.patch
index 303d122459..f8dda3a22d 100644
--- a/target/linux/layerscape/patches-5.4/701-net-0327-at803x-Address-packet-drops-at-low-traffic-rate-due-.patch
+++ b/target/linux/layerscape/patches-5.4/701-net-0327-at803x-Address-packet-drops-at-low-traffic-rate-due-.patch
@@ -41,7 +41,7 @@ Signed-off-by: Vladimir Oltean <vladimir.oltean at nxp.com>
  	depends on BCM63XX || COMPILE_TEST
 --- a/drivers/net/phy/at803x.c
 +++ b/drivers/net/phy/at803x.c
-@@ -63,6 +63,8 @@
+@@ -62,6 +62,8 @@
  #define AT803X_DEBUG_REG_5			0x05
  #define AT803X_DEBUG_TX_CLK_DLY_EN		BIT(8)
  
@@ -50,8 +50,8 @@ Signed-off-by: Vladimir Oltean <vladimir.oltean at nxp.com>
  #define ATH8030_PHY_ID 0x004dd076
  #define ATH8031_PHY_ID 0x004dd074
  #define ATH8032_PHY_ID 0x004dd023
-@@ -257,6 +259,19 @@ static int at803x_probe(struct phy_devic
- 	return 0;
+@@ -299,10 +301,30 @@ static int at803x_probe(struct phy_devic
+ 	return ret;
  }
  
 +static void at803x_enable_smart_eee(struct phy_device *phydev, int on)
@@ -70,9 +70,6 @@ Signed-off-by: Vladimir Oltean <vladimir.oltean at nxp.com>
  static int at803x_config_init(struct phy_device *phydev)
  {
  	int ret;
-@@ -282,6 +297,13 @@ static int at803x_config_init(struct phy
- 			return ret;
- 	}
  
 +
 +#ifdef CONFIG_AT803X_PHY_SMART_EEE
diff --git a/target/linux/layerscape/patches-5.4/701-net-0330-net-phy-at803x-add-vddio-1v8-and-eee-disable-support.patch b/target/linux/layerscape/patches-5.4/701-net-0330-net-phy-at803x-add-vddio-1v8-and-eee-disable-support.patch
index 32339191e4..7ae1ba3333 100644
--- a/target/linux/layerscape/patches-5.4/701-net-0330-net-phy-at803x-add-vddio-1v8-and-eee-disable-support.patch
+++ b/target/linux/layerscape/patches-5.4/701-net-0330-net-phy-at803x-add-vddio-1v8-and-eee-disable-support.patch
@@ -28,10 +28,10 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  #define AT803X_REG_CHIP_CONFIG			0x1f
  #define AT803X_BT_BX_REG_SEL			0x8000
 +#define AT803X_SMARTEEE_DISABLED_VAL		0x1000
- #define AT803X_SGMII_ANEG_EN			0x1000
  
  #define AT803X_DEBUG_ADDR			0x1D
-@@ -65,6 +70,9 @@
+ #define AT803X_DEBUG_DATA			0x1E
+@@ -64,6 +69,9 @@
  
  #define AT803X_LPI_EN				BIT(8)
  
@@ -41,9 +41,9 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  #define ATH8030_PHY_ID 0x004dd076
  #define ATH8031_PHY_ID 0x004dd074
  #define ATH8032_PHY_ID 0x004dd023
-@@ -72,12 +80,16 @@
- #define AT803X_PHY_ID_MASK			0xffffffef
- #define AT8032_PHY_ID_MASK			0xffffffff
+@@ -74,12 +82,16 @@
+ #define AT803X_PAGE_FIBER		0
+ #define AT803X_PAGE_COPPER		1
  
 +#define AT803X_EEE_FEATURE_DISABLE		(1 << 1)
 +#define AT803X_VDDIO_1P8V			(1 << 2)
@@ -58,7 +58,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  };
  
  struct at803x_context {
-@@ -141,6 +153,39 @@ static int at803x_disable_tx_delay(struc
+@@ -172,6 +184,39 @@ static int at803x_disable_tx_delay(struc
  				     AT803X_DEBUG_TX_CLK_DLY_EN, 0);
  }
  
@@ -98,7 +98,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  /* save relevant PHY registers to private copy */
  static void at803x_context_save(struct phy_device *phydev,
  				struct at803x_context *context)
-@@ -254,6 +299,12 @@ static int at803x_probe(struct phy_devic
+@@ -286,6 +331,12 @@ static int at803x_probe(struct phy_devic
  	if (!priv)
  		return -ENOMEM;
  
@@ -110,16 +110,16 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
 +
  	phydev->priv = priv;
  
- 	return 0;
-@@ -275,6 +326,7 @@ static void at803x_enable_smart_eee(stru
+ 	/* Some bootloaders leave the fiber page selected.
+@@ -316,6 +367,7 @@ static void at803x_enable_smart_eee(stru
+ 
  static int at803x_config_init(struct phy_device *phydev)
  {
- 	int ret;
 +	struct at803x_priv *priv = phydev->priv;
- 	u32 v;
+ 	int ret;
+ 
  
- 	if (phydev->drv->phy_id == ATH8031_PHY_ID &&
-@@ -323,6 +375,18 @@ static int at803x_config_init(struct phy
+@@ -344,6 +396,18 @@ static int at803x_config_init(struct phy
  	else
  		ret = at803x_disable_tx_delay(phydev);
  
diff --git a/target/linux/ramips/patches-5.10/710-at803x.patch b/target/linux/ramips/patches-5.10/710-at803x.patch
index dab62b7607..d15dd92965 100644
--- a/target/linux/ramips/patches-5.10/710-at803x.patch
+++ b/target/linux/ramips/patches-5.10/710-at803x.patch
@@ -23,7 +23,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  
  #define AT803X_SPECIFIC_FUNCTION_CONTROL	0x10
  #define AT803X_SFC_ASSERT_CRS			BIT(11)
-@@ -83,9 +85,18 @@
+@@ -82,9 +84,18 @@
  
  #define AT803X_MODE_CFG_MASK			0x0F
  #define AT803X_MODE_CFG_SGMII			0x01
@@ -42,7 +42,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  
  #define AT803X_DEBUG_REG_0			0x00
  #define AT803X_DEBUG_RX_CLK_DLY_EN		BIT(15)
-@@ -505,10 +516,72 @@ static int at803x_parse_dt(struct phy_de
+@@ -532,12 +543,75 @@ static int at803x_parse_dt(struct phy_de
  	return 0;
  }
  
@@ -100,22 +100,25 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
 +	.detach = phy_sfp_detach,
 +	.module_insert = at803x_sfp_insert,
 +};
++
 +
  static int at803x_probe(struct phy_device *phydev)
  {
  	struct device *dev = &phydev->mdio.dev;
  	struct at803x_priv *priv;
-+	int ret;
+ 	int ret;
+ 
 +
 +	if (at803x_mode(phydev) == AT803X_MODE_FIBER) {
 +		ret = phy_sfp_probe(phydev, &at803x_sfp_ops);
 +		if (ret < 0)
 +			return ret;
 +	}
- 
++
  	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
  	if (!priv)
-@@ -709,6 +782,10 @@ static int at803x_read_status(struct phy
+ 		return -ENOMEM;
+@@ -744,6 +818,10 @@ static int at803x_read_status(struct phy
  {
  	int ss, err, old_link = phydev->link;
  
@@ -126,7 +129,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  	/* Update the link, but return if there was an error */
  	err = genphy_update_link(phydev);
  	if (err)
-@@ -809,6 +886,12 @@ static int at803x_config_aneg(struct phy
+@@ -844,6 +922,12 @@ static int at803x_config_aneg(struct phy
  {
  	int ret;
  
@@ -139,7 +142,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  	ret = at803x_config_mdix(phydev, phydev->mdix_ctrl);
  	if (ret < 0)
  		return ret;
-@@ -1110,6 +1193,7 @@ static struct phy_driver at803x_driver[]
+@@ -1145,6 +1229,7 @@ static struct phy_driver at803x_driver[]
  	/* Qualcomm Atheros AR8031/AR8033 */
  	PHY_ID_MATCH_EXACT(ATH8031_PHY_ID),
  	.name			= "Qualcomm Atheros AR8031/AR8033",
diff --git a/target/linux/ramips/patches-5.4/991-at803x.patch b/target/linux/ramips/patches-5.4/991-at803x.patch
index 95411211b2..29e79e65d7 100644
--- a/target/linux/ramips/patches-5.4/991-at803x.patch
+++ b/target/linux/ramips/patches-5.4/991-at803x.patch
@@ -23,7 +23,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  
  #define AT803X_SPECIFIC_STATUS			0x11
  #define AT803X_SS_SPEED_MASK			(3 << 14)
-@@ -53,9 +55,18 @@
+@@ -52,9 +54,18 @@
  
  #define AT803X_MODE_CFG_MASK			0x0F
  #define AT803X_MODE_CFG_SGMII			0x01
@@ -42,7 +42,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  
  #define AT803X_DEBUG_REG_0			0x00
  #define AT803X_DEBUG_RX_CLK_DLY_EN		BIT(15)
-@@ -243,10 +254,72 @@ static int at803x_resume(struct phy_devi
+@@ -274,12 +285,73 @@ static int at803x_resume(struct phy_devi
  	return phy_modify(phydev, MII_BMCR, BMCR_PDOWN | BMCR_ISOLATE, 0);
  }
  
@@ -105,17 +105,18 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  {
  	struct device *dev = &phydev->mdio.dev;
  	struct at803x_priv *priv;
-+	int ret;
-+
+ 	int ret;
+ 
 +	if (at803x_mode(phydev) == AT803X_MODE_FIBER) {
 +		ret = phy_sfp_probe(phydev, &at803x_sfp_ops);
 +		if (ret < 0)
 +			return ret;
 +	}
- 
++
  	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
  	if (!priv)
-@@ -394,6 +467,10 @@ static int at803x_read_status(struct phy
+ 		return -ENOMEM;
+@@ -415,6 +487,10 @@ static int at803x_read_status(struct phy
  {
  	int ss, err, old_link = phydev->link;
  
@@ -126,7 +127,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  	/* Update the link, but return if there was an error */
  	err = genphy_update_link(phydev);
  	if (err)
-@@ -448,6 +525,19 @@ static int at803x_read_status(struct phy
+@@ -469,6 +545,19 @@ static int at803x_read_status(struct phy
  	return 0;
  }
  
@@ -146,7 +147,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  static struct phy_driver at803x_driver[] = {
  {
  	/* ATHEROS 8035 */
-@@ -461,6 +551,7 @@ static struct phy_driver at803x_driver[]
+@@ -482,6 +571,7 @@ static struct phy_driver at803x_driver[]
  	.suspend		= at803x_suspend,
  	.resume			= at803x_resume,
  	/* PHY_GBIT_FEATURES */


From lede-commits at lists.infradead.org  Mon Jun  7 15:41:14 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 07 Jun 2021 18:41:14 -0400
Subject: [openwrt/openwrt]  linux-firmware: update to 20210511
In-Reply-To: <162310567296.4859.4702888019157327563@git-01.infra.openwrt.org>
References: <162310567296.4859.4702888019157327563@git-01.infra.openwrt.org>
Message-ID: <mailman.3762.1623105685.434944.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/441353743095d11c232bb855848a2aa2d1edafa0

commit 441353743095d11c232bb855848a2aa2d1edafa0
Author: Tomas Lara <tl849670 at gmail.com>
AuthorDate: Tue Jun 1 14:00:15 2021 -0400

    linux-firmware: update to 20210511
    
    git log --pretty=oneline --abbrev-commit 20201118..20210511
    
    7685cf4 (HEAD, tag: 20210511) nvidia: Update Tegra194 XUSB firmware to v60.09
    cf32752 nvidia: Update Tegra186 XUSB firmware to v55.18
    cb8ca82 nvidia: Update Tegra210 XUSB firmware to v50.26
    f99d6a1 linux-firmware: update firmware for mhdp8546
    ecdfcf8 Merge branch 'adlp_dmc_firmware' of git://anongit.freedesktop.org/drm/drm-firmware into main
    547b202 Merge https://github.com/suraj714/linux-firmware-venus into main
    3d32f21 i915: Add ADL-P DMC Support
    3f23f51 amdgpu: add new polaris 12 MC firmware
    a2565bb firmware: nvidia: Add VIC firmware for Tegra194
    17ec2a5 qcom: add gpu firmwares for sc7280
    b653cf4 Merge https://github.com/pkshih/linux-firmware into main
    2a96c08 brcm: Add a link to enable khadas VIM2's WiFi
    ffc64a2 rtw89: 8852a: update fw to v0.13.8.0
    3e3497c rtl_bt: Update RTL8852A BT USB firmware to 0xD9A8_7893
    c7b11ed qcom: Add venus firmware files for VPU-2.0
    2f4f0f8 rtw89: 8852a: update fw to v0.13.8.0
    fa0efef linux-firmware: Update firmware file for Intel Bluetooth AX210
    9be3daa linux-firmware: Update firmware file for Intel Bluetooth 9560
    687d64a linux-firmware: Update firmware file for Intel Bluetooth 9260
    a7f1249 linux-firmware: Update firmware file for Intel Bluetooth AX200
    47650a0 linux-firmware: Update firmware file for Intel Bluetooth AX201
    195ecf1 linux-firmware: Intel BT 7265: Fix Security Issues
    4116d72 linux-firmware: Update firmware file for Intel Bluetooth 8265
    ca83c73 qcom: update venus firmware files for v5.4
    1334578 Merge branch 'mrvl-prestera' of https://github.com/PLVision/linux-firmware into main
    16052e4 mrvl: prestera: Add Marvell Prestera Switchdev firmware 3.0 version
    bdf929d rtw88: 8822c: Update normal firmware to v9.9.9
    0b558e8 brcm: add missing symlink for Pi Zero W NVRAM file
    cfa004c amdgpu: update arcturus firmware from 21.10
    d5567c5 amdgpu: update navy flounder firmware from 21.10
    ef5ea5d amdgpu: update sienna cichlid firmware from 21.10
    f35700f amdgpu: update vega20 firmware from 21.10
    1be98f1 amdgpu: update picasso firmware from 21.10
    fee0497 amdgpu: update navi14 firmware from 21.10
    15003b0 amdgpu: update green sardine firmware from 21.10
    64555fb amdgpu: update vega12 firmware from 21.10
    eb07276 amdgpu: update navi12 firmware from 21.10
    e36c82a amdgpu: update vega10 firmware from 21.10
    4a5eaa2 amdgpu: update renoir firmware from 21.10
    65eb326 amdgpu: update navi10 firmware from 21.10
    8bdca03 amdgpu: update raven2 firmware from 21.10
    c9e44ca amdgpu: update raven firmware from 21.10
    bc3e610 rtl_nic: add new firmware for RTL8153 and RTL8156 series
    8528618 Merge branch 'for-upstream' of git://git.chelsio.net/pub/git/linux-firmware into main
    940b7f4 cxgb4: Update firmware to revision 1.25.4.0
    f66adc3 Merge branch 'main' of gitolite.kernel.org:/pub/scm/linux/kernel/git/maks/linux-firmware into main
    f350e91 Merge https://github.com/rjliao-qca/qca-btfw into main
    9bc1bcc Merge https://github.com/Netronome/linux-firmware into main
    2f30708 Mellanox: Add new mlxsw_spectrum firmware xx.2008.2438
    393f272 brcm: Link CM4's WiFi firmware with DMI machine name.
    73144e0 linux-firmware: Update firmware file for Intel Bluetooth AX201
    8ab7aba amdgpu: update navi14 smc firmware
    4fe6e53 amdgpu: update navi10 SMC firmware
    c296849 QCA: Update Bluetooth firmware for QCA6174
    d6a18e9 WHENCE: link to similar config file for rtl8821a support
    6c419ae nfp: update Agilio SmartNIC flower firmware to rev AOTC-2.14.A.6
    af1ca28 amdgpu: add arcturus firmware
    0dd245d Merge branch 'sm8250-new-fw' of https://github.com/lumag/linux-firmware into main
    55cab07 rtl_bt: Add rtl8723bs_config-OBDA0623.bin symlink
    2548d06 brcm: Add nvram for the Chuwi Hi8 (CWI509) tablet
    e45c137 brcm: Add nvram for the Predia Basic tablet
    d8fa0cf qcom: sm8250: update remoteproc firmware
    84af0e0 qcom: update a650 firmware files
    3f026a2 rtl_bt: Update RTL8822C BT(UART I/F) FW to 0x59A_76A3
    c82cb46 amdgpu: update sienna cichlid firmware for 20.50
    24fe696 amdgpu: update vega20 firmware for 20.50
    e05d197 amdgpu: update picasso firmware for 20.50
    76d07cd amdgpu: update navi14 firmware for 20.50
    b2fc037 amdgpu: update vega12 firmware for 20.50
    25451a4 amdgpu: update navi12 firmware for 20.50
    b938597 amdgpu: update vega10 firmware for 20.50
    2542ba7 amdgpu: update renoir firmware for 20.50
    b55d063 amdgpu: update navi10 firmware for 20.50
    1a62f28 amdgpu: update raven2 firmware for 20.50
    4df488f amdgpu: update raven firmware for 20.50
    a29bdb2 amdgpu: add initial support for navy flounder
    3568f96 (tag: 20210315) linux-firmware: Update firmware file for Intel Bluetooth AX210
    9e96e50 linux-firmware: Update firmware file for Intel Bluetooth AX200
    c8d0db5 linux-firmware: Update firmware file for Intel Bluetooth AX201
    5e2a387 Merge tag 'iwlwifi-fw-2021-03-05-v3' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/linux-firmware into main
    b0d3e31 rtw88: 8822c: Update normal firmware to v9.9.6
    5a2fd63 iwlwifi: add new FWs from core59-66 release
    4f54906 iwlwifi: update 9000-family firmwares
    11b7607 iwlwifi: update 7265D firmware
    e425f76 Merge branch 'add-silabs-wf200' of github.com:jerome-pouiller/linux-firmware into main
    5ecd13f Mellanox: Add new mlxsw_spectrum firmware xx.2008.2406
    58fb90a linux-firmware: add frimware for mediatek bluetooth chip (MT7921)
    e576a1b rtw89: 8852a: add firmware v0.9.12.2
    048a7cb WHENCE: add missing symlink for BananaPi M3
    aa6c6e7 Add symlink for BananaPi M2 to brcmfmac43430-sdio config
    58825f7 brcm: Fix Raspberry Pi 4B NVRAM file
    520f71b silabs: add new firmware for WF200
    f7915a0 amdgpu: add initial firmware for green sardine
    80cb579 rtw88: RTL8822C: Update normal firmware to v9.9.5
    b79d239 (tag: 20210208) Merge branch 'DG1-guc-huc-ADLS-dmc' of git://anongit.freedesktop.org/drm/drm-firmware into main
    66970e1 Merge branch 'qcom-rb5' of https://github.com/lumag/linux-firmware into main
    cf6fc2b Mellanox: Add new mlxsw_spectrum firmware xx.2008.2304
    391fd50 linux-firmware: add firmware for MT7921
    c5e3240 rtw88: RTL8821C: Update firmware to v24.8
    d33d2d8 linux-firmware: Update firmware file for Intel Bluetooth AX210
    3027ae4 linux-firmware: Update firmware file for Intel Bluetooth AX200
    13979c3 linux-firmware: Update firmware file for Intel Bluetooth AX201
    348d8a9 i915: Add DMC v2.01 for ADL-S
    f33f1f7 i915: Add HuC v7.7.1 for DG1
    6a422f5 i915: Add GuC v49.0.1 for DG1
    df822a8 qcom: Add venus firmware files for VPU-1.0
    11a1db1 qcom: Add SM8250 Compute DSP firmware
    e55248b qcom: Add SM8250 Audio DSP firmware
    da74cc6 qcom: add firmware files for Adreno a650
    0578970 brcm: Link RPi4's WiFi firmware with DMI machine name.
    d528862 brcm: Add NVRAM for Vamrs 96boards Rock960
    870b805 brcm: Update Raspberry Pi 3B+/4B NVRAM for downstream changes
    a28a590 cypress: Fix link direction
    060ad8b cypress: Link the new cypress firmware to the old brcm files
    0f0aefd brcm: remove old brcm firmwares that have newer cypress variants
    f580dc2 rtl_bt: Update RTL8822C BT(UART I/F) FW to 0x059A_25CB
    7df2220 rtl_bt: Update RTL8822C BT(USB I/F) FW to 0x099a_7253
    e79405d rtl_bt: Add firmware and config files for RTL8852A BT USB chip
    ef3813d rtl_bt: Update RTL8821C BT(USB I/F) FW to 0x829a_7644
    646f159 (tag: 20201218) make AP6212 in bananpi m2 plus/zero work
    28185ec linux-firmware: Update firmware file for Intel Bluetooth AX210
    23da869 linux-firmware: Update firmware file for Intel Bluetooth AX200
    2099248 linux-firmware: Update firmware file for Intel Bluetooth AX201
    94de5e2 linux-firmware: Update firmware file for Intel Bluetooth 9560
    27a3689 linux-firmware: Update firmware file for Intel Bluetooth 9260
    5c3c4af Merge branch 'lt9611uxc' of https://github.com/lumag/linux-firmware into main
    aaed4a8 Merge branch 'v1.1.6' of https://github.com/irui-wang/linux_fw_vpu_v1.1.6 into main
    d8c9865 Merge branch 'master' of https://github.com/sampnimm/linux-firmware-BT into main
    63ab3db linux-firmware: add firmware for Lontium LT9611UXC DSI to HDMI bridge
    0fe0fe0 mediatek: update MT8173 VPU firmware to v1.1.6
    1a08ec9 QCA : Updated firmware files for WCN3991
    7455a36 Merge branch 'guc_v49' of git://anongit.freedesktop.org/drm/drm-firmware into main
    7eb7fda linux-firmware: Update firmware file for Intel Bluetooth AX210
    5cbf459 linux-firmware: Update firmware file for Intel Bluetooth AX210
    c487f7d i915: Add GuC firmware v49.0.1 for all platforms
    d9ffb07 i915: Remove duplicate KBL DMC entry
    b362fd4 Mellanox: Add new mlxsw_spectrum firmware xx.2008.2018
    bc9cd0b linux-firmware: Update AMD SEV firmware
    54c797a amdgpu: add sienna cichlid firmware for 20.45
    1340e9c amdgpu: update vega20 firmware for 20.45
    b260c9c amdgpu: update vega12 firmware for 20.45
    d683bd5 amdgpu: update vega10 firmware for 20.45
    7c81cc2 amdgpu: update renoir firmware for 20.45
    3619e57 amdgpu: update navi14 firmware for 20.45
    68ce0fb amdgpu: update navi12 firmware for 20.45
    e889b80 amdgpu: update navi10 firmware for 20.45
    f4edc15 amdgpu: update raven2 firmware for 20.45
    e71210f amdgpu: update raven firmware for 20.45
    
    Signed-off-by: Tomas Lara <tl849670 at gmail.com>
    [rebased; removed brcmfmac changes due to removed firmware]
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 package/firmware/linux-firmware/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/firmware/linux-firmware/Makefile b/package/firmware/linux-firmware/Makefile
index e2fee3b6a2..2ad213b82b 100644
--- a/package/firmware/linux-firmware/Makefile
+++ b/package/firmware/linux-firmware/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=linux-firmware
-PKG_VERSION:=20210315
+PKG_VERSION:=20210511
 PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=@KERNEL/linux/kernel/firmware
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_HASH:=a2348f03492713dca9aef202496c6e58f5e63ee5bec6a7bdfcf8b18ce7155e70
+PKG_HASH:=2aa6ae8b9808408f9811ac38f00c188e53e984a2b3990254f6c9c02c1ab13417
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 


From lede-commits at lists.infradead.org  Mon Jun  7 15:41:16 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 07 Jun 2021 18:41:16 -0400
Subject: [openwrt/openwrt] ramips: mt7620: enable autonegotiation for all ports
In-Reply-To: <162310567296.4859.4702888019157327563@git-01.infra.openwrt.org>
References: <162310567296.4859.4702888019157327563@git-01.infra.openwrt.org>
Message-ID: <mailman.3763.1623105687.434944.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/0056ffb468f40f34bea006eb889b70c9a4f562e0

commit 0056ffb468f40f34bea006eb889b70c9a4f562e0
Author: Gaspare Bruno <gaspare at anlix.io>
AuthorDate: Wed Jan 13 18:03:39 2021 -0300

    ramips: mt7620: enable autonegotiation for all ports
    
    This enables autonegotiation for all ephy ports on probe.
    Some devices do not configure the ports, particularly port 4.
    
    Signed-off-by: Gaspare Bruno <gaspare at anlix.io>
    [replace magic values ; reword commit message]
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
index 451881fc73..0b09814cc8 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
@@ -171,6 +171,7 @@ static void mt7620_hw_init(struct mt7620_gsw *gsw, int mdio_mode)
 		for (i = 0; i <= 4; i++) {
 			val = _mt7620_mii_read(gsw, gsw->ephy_base + i, MII_BMCR);
 			val &= ~BMCR_PDOWN;
+			val |= BMCR_ANRESTART | BMCR_ANENABLE | BMCR_SPEED100;
 			_mt7620_mii_write(gsw, gsw->ephy_base + i, MII_BMCR, val);
 		}
 	}


From lede-commits at lists.infradead.org  Mon Jun  7 15:45:21 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 07 Jun 2021 18:45:21 -0400
Subject: [openwrt/openwrt] scripts/feeds: generate index after all feeds are
 updated
In-Reply-To: <162310592176.9069.2593752434884940651@git-01.infra.openwrt.org>
References: <162310592176.9069.2593752434884940651@git-01.infra.openwrt.org>
Message-ID: <mailman.3764.1623105928.434944.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/1aa80ce3931736f1020f69f486a815c2b2575d19

commit 1aa80ce3931736f1020f69f486a815c2b2575d19
Author: Karel Ko?? <karel.koci at nic.cz>
AuthorDate: Thu Feb 11 10:57:06 2021 +0100

    scripts/feeds: generate index after all feeds are updated
    
    This separates index update from feed update. The result is that all
    requested feeds are first updated and only then indexed.
    
    The reason for this change is to prevent errors being reported and
    potentially invalid index being generated thanks to cross feeds
    dependency.
    The feeds script pulls in default all feeds as they come and on install
    prefers packages from first feeds (unless special feed is requested).
    Thus order of feeds in some way specifies preferences. This is handy for
    downstream distributions as they can simply override any package from
    upstream feeds by placing their feed before them. This removes need to
    patch or fork upstream feeds.
    The problem is that such feed most likely depends in some way also on
    subsequent feeds. The most likely feeds are 'packages' or 'luci'. The
    example would be Python package that needs 'python.mk' from 'packages'
    feed. Ordering custom feed after dependent feeds is sometimes just not
    possible because of preference requirement described before.
    The solution is to just first pull all feeds and generate indexes only
    after that. In the end this ensures that index is generated correctly at
    first try without any error.
    
    In terms of code this removes 'perform_update' argument from
    'update_feed' as with index update removal the update is the only action
    performed in that subroutine. Thus this moves condition to 'update'
    subroutine.
    
    Signed-off-by: Karel Ko?? <karel.koci at nic.cz>
---
 scripts/feeds | 75 ++++++++++++++++++++++++-----------------------------------
 1 file changed, 31 insertions(+), 44 deletions(-)

diff --git a/scripts/feeds b/scripts/feeds
index eee0a50717..bbfd832c45 100755
--- a/scripts/feeds
+++ b/scripts/feeds
@@ -756,12 +756,11 @@ sub uninstall {
 	return 0;
 }
 
-sub update_feed($$$$$)
+sub update_feed($$$$)
 {
 	my $type=shift;
 	my $name=shift;
 	my $src=shift;
-	my $perform_update=shift;
 	my $force_update=shift;
 	my $force_relocate=update_location( $name, "@$src" );
 	my $rv=0;
@@ -773,28 +772,22 @@ sub update_feed($$$$$)
 		warn "Unknown type '$type' in feed $name\n";
 		return 1;
 	};
-	$perform_update and do {
-		my $failed = 1;
-		foreach my $feedsrc (@$src) {
-			warn "Updating feed '$name' from '$feedsrc' ...\n";
-			if (update_feed_via($type, $name, $feedsrc, $force_relocate, $force_update) != 0) {
-				if ($force_update) {
-					$rv=1;
-					$failed=0;
-					warn "failed, ignore.\n";
-					next;
-				}
-				last;
+
+	my $failed = 1;
+	foreach my $feedsrc (@$src) {
+		warn "Updating feed '$name' from '$feedsrc' ...\n";
+		if (update_feed_via($type, $name, $feedsrc, $force_relocate, $force_update) != 0) {
+			if ($force_update) {
+				$rv=1;
+				$failed=0;
+				warn "failed, ignore.\n";
+				next;
 			}
-			$failed = 0;
+			last;
 		}
-		$failed and do {
-			warn "failed.\n";
-			return 1;
-		};
-	};
-	warn "Create index file './feeds/$name.index' \n";
-	update_index($name) == 0 or do {
+		$failed = 0;
+	}
+	$failed and do {
 		warn "failed.\n";
 		return 1;
 	};
@@ -803,45 +796,39 @@ sub update_feed($$$$$)
 
 sub update {
 	my %opts;
-	my $feed_name;
-	my $perform_update=1;
+	my %argv_feeds;
 	my $failed=0;
 
 	$ENV{SCAN_COOKIE} = $$;
 	$ENV{OPENWRT_VERBOSE} = 's';
 
 	getopts('ahif', \%opts);
+	%argv_feeds = map { $_ => 1 } @ARGV;
 
 	if ($opts{h}) {
 		usage();
 		return 0;
 	}
 
-	if ($opts{i}) {
-		# don't update from (remote) repository
-		# only re-create index information
-		$perform_update=0;
-	}
-
 	-d "feeds" or do {
 			mkdir "feeds" or die "Unable to create the feeds directory";
 		};
 
-	if ( ($#ARGV == -1) or $opts{a}) {
-		foreach my $feed (@feeds) {
-			my ($type, $name, $src) = @$feed;
-			update_feed($type, $name, $src, $perform_update, $opts{f}) == 0 or $failed=1;
-		}
-	} else {
-		while ($feed_name = shift @ARGV) {
-			foreach my $feed (@feeds) {
-				my ($type, $name, $src) = @$feed;
-				if($feed_name ne $name) {
-					next;
-				}
-				update_feed($type, $name, $src, $perform_update, $opts{f}) == 0 or $failed=1;
-			}
+	my @index_feeds;
+	foreach my $feed (@feeds) {
+		my ($type, $name, $src) = @$feed;
+		next unless $#ARGV == -1 or $opts{a} or $argv_feeds{$name};
+		if (not $opts{i}) {
+			update_feed($type, $name, $src, $opts{f}) == 0 or $failed=1;
 		}
+		push @index_feeds, $name;
+	}
+	foreach my $name (@index_feeds) {
+		warn "Create index file './feeds/$name.index' \n";
+		update_index($name) == 0 or do {
+			warn "failed.\n";
+			$failed=1;
+		};
 	}
 
 	refresh_config();


From lede-commits at lists.infradead.org  Tue Jun  8 12:58:13 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 08 Jun 2021 15:58:13 -0400
Subject: [openwrt/openwrt] ipq806x: fix LAN and WAN port assignments on
 TP-Link AD7200
In-Reply-To: <162318229313.3059.15998583574592918108@git-01.infra.openwrt.org>
References: <162318229313.3059.15998583574592918108@git-01.infra.openwrt.org>
Message-ID: <mailman.4108.1623182302.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/0753cd98537a0067907d46a0319dba42868df6d9

commit 0753cd98537a0067907d46a0319dba42868df6d9
Author: Alex Henrie <alexhenrie24 at gmail.com>
AuthorDate: Thu Jun 3 22:37:49 2021 -0600

    ipq806x: fix LAN and WAN port assignments on TP-Link AD7200
    
    LAN port 4 was swapped with the WAN port and the remaining three LAN
    ports were numbered in reverse order from their labels on the case.
    
    Fixes: 1a775a4fd033 ("ipq806x: add support for TP-Link Talon AD7200")
    Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
    (cherry picked from commit 6fb27e8e6d05ed426f200242fdc1710f6f849127)
---
 target/linux/ipq806x/base-files/etc/board.d/02_network | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network
index ddef4b7ac6..1e00b97092 100755
--- a/target/linux/ipq806x/base-files/etc/board.d/02_network
+++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
@@ -51,7 +51,6 @@ nec,wg2600hp3)
 		"2:lan" "3:lan" "4:lan" "5:lan" "0 at eth1" "1:wan" "6 at eth0"
 	;;
 netgear,r7800 |\
-tplink,ad7200 |\
 tplink,c2600)
 	ucidef_add_switch "switch0" \
 		"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "6 at eth1" "5:wan" "0 at eth0"
@@ -66,6 +65,10 @@ qcom,ipq8064-db149)
 	ucidef_add_switch "switch0" \
 		"1:lan" "2:lan" "3:lan" "4:lan" "6u at eth1" "5:wan" "0u at eth0"
 	;;
+tplink,ad7200)
+	ucidef_add_switch "switch0" \
+		"2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "6 at eth1" "1:wan" "0 at eth0"
+	;;
 ubnt,unifi-ac-hd)
 	ucidef_set_interface_lan "eth0 eth1"
 	;;


From lede-commits at lists.infradead.org  Tue Jun  8 12:58:15 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 08 Jun 2021 15:58:15 -0400
Subject: [openwrt/openwrt]  x86: kernel: enable Fusion-MPT SAS driver
In-Reply-To: <162318229313.3059.15998583574592918108@git-01.infra.openwrt.org>
References: <162318229313.3059.15998583574592918108@git-01.infra.openwrt.org>
Message-ID: <mailman.4109.1623182302.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/ba5b98fcb891e769cf94086d19ac14009193da3c

commit ba5b98fcb891e769cf94086d19ac14009193da3c
Author: Mark Carroll <git at markcarroll.net>
AuthorDate: Sat May 8 11:42:50 2021 +0000

    x86: kernel: enable Fusion-MPT SAS driver
    
    Compile in MPT SAS driver required to mount rootfs on some VMWare
    systems (e.g. required for 1&1 IONOS).
    
    Signed-off-by: Mark Carroll <git at markcarroll.net>
    (cherry picked from commit 8716dda0743454e3949b815613542a4d00fc2a09)
---
 target/linux/x86/64/config-5.4 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/x86/64/config-5.4 b/target/linux/x86/64/config-5.4
index d044d5f4de..4c2e591501 100644
--- a/target/linux/x86/64/config-5.4
+++ b/target/linux/x86/64/config-5.4
@@ -183,6 +183,7 @@ CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
 # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set
 CONFIG_FREEZER=y
+CONFIG_FUSION_SAS=y
 CONFIG_GART_IOMMU=y
 CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
 CONFIG_GENERIC_CPU=y


From lede-commits at lists.infradead.org  Tue Jun  8 12:58:14 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 08 Jun 2021 15:58:14 -0400
Subject: [openwrt/openwrt]  ipq40xx: add uboot-envtools to default packages
In-Reply-To: <162318229313.3059.15998583574592918108@git-01.infra.openwrt.org>
References: <162318229313.3059.15998583574592918108@git-01.infra.openwrt.org>
Message-ID: <mailman.4110.1623182306.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/f788dfdf55a21a639bb3f48f801a029bafb902a3

commit f788dfdf55a21a639bb3f48f801a029bafb902a3
Author: Tomasz Maciej Nowak <tmn505 at gmail.com>
AuthorDate: Tue May 25 15:26:06 2021 +0200

    ipq40xx: add uboot-envtools to default packages
    
    When support for Luma WRTQ-329ACN was added, the instructions for
    flashing this device include using tools from uboot-envtools package.
    Unfortunately the OpenWrt buildroot system omits packages from
    DEVICE_PACKAGES when CONFIG_TARGET_MULTI_PROFILE,
    CONFIG_TARGET_PER_DEVICE_ROOTFS, CONFIG_TARGET_ALL_PROFILES are set. In
    result the official images are without tools mentioned in the
    instruction. The workoround for the fashing would be installing
    uboot-envtools when booted with initramfs image, but not always the
    access to internet is available. The other method would be to issue the
    necesary command in U-Boot environment but some serial terminals default
    configuration don't work well with pasting lines longer than 80 chars.
    Therefore add uboot-envtools to default packages, which adds really
    small flash footprint to rootfs, where increased size usually is not an
    issue.
    
    Signed-off-by: Tomasz Maciej Nowak <tmn505 at gmail.com>
    (cherry picked from commit 1984a6bbcaac95c439dd4a6eba2f78c54e9be215)
---
 target/linux/ipq40xx/Makefile         |  3 ++-
 target/linux/ipq40xx/image/generic.mk | 28 ++++++++++++----------------
 2 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/target/linux/ipq40xx/Makefile b/target/linux/ipq40xx/Makefile
index 43b1fcb0f9..400612376c 100644
--- a/target/linux/ipq40xx/Makefile
+++ b/target/linux/ipq40xx/Makefile
@@ -18,6 +18,7 @@ DEFAULT_PACKAGES += \
 	kmod-usb-dwc3-qcom \
 	kmod-leds-gpio kmod-gpio-button-hotplug swconfig \
 	kmod-ath10k-ct wpad-basic-wolfssl \
-	kmod-usb3 kmod-usb-dwc3 ath10k-firmware-qca4019-ct
+	kmod-usb3 kmod-usb-dwc3 ath10k-firmware-qca4019-ct \
+	uboot-envtools
 
 $(eval $(call BuildTarget))
diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk
index 4e40b8be50..358a583f84 100644
--- a/target/linux/ipq40xx/image/generic.mk
+++ b/target/linux/ipq40xx/image/generic.mk
@@ -121,8 +121,7 @@ define Device/alfa-network_ap120c-ac
 	DEVICE_VENDOR := ALFA Network
 	DEVICE_MODEL := AP120C-AC
 	SOC := qcom-ipq4018
-	DEVICE_PACKAGES := kmod-usb-acm \
-		kmod-tpm-i2c-atmel uboot-envtools
+	DEVICE_PACKAGES := kmod-usb-acm kmod-tpm-i2c-atmel
 	BLOCKSIZE := 128k
 	PAGESIZE := 2048
 	IMAGE_SIZE := 65536k
@@ -141,7 +140,6 @@ endef
 define Device/aruba_ap-303
 	$(call Device/aruba_glenmorangie)
 	DEVICE_MODEL := AP-303
-	DEVICE_PACKAGES += uboot-envtools
 endef
 TARGET_DEVICES += aruba_ap-303
 
@@ -154,7 +152,7 @@ TARGET_DEVICES += aruba_ap-303h
 define Device/aruba_ap-365
 	$(call Device/aruba_glenmorangie)
 	DEVICE_MODEL := AP-365
-	DEVICE_PACKAGES += kmod-hwmon-ad7418 uboot-envtools
+	DEVICE_PACKAGES += kmod-hwmon-ad7418
 endef
 TARGET_DEVICES += aruba_ap-365
 
@@ -237,7 +235,7 @@ define Device/buffalo_wtr-m2133hp
 	DEVICE_VENDOR := Buffalo
 	DEVICE_MODEL := WTR-M2133HP
 	SOC := qcom-ipq4019
-	DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9984-ct ipq-wifi-buffalo_wtr-m2133hp
+	DEVICE_PACKAGES := ath10k-firmware-qca9984-ct ipq-wifi-buffalo_wtr-m2133hp
 	BLOCKSIZE := 128k
 	PAGESIZE := 2048
 endef
@@ -318,7 +316,7 @@ define Device/devolo_magic-2-wifi-next
 	IMAGE_SIZE := 26624k
 	IMAGES := sysupgrade.bin
 	IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | append-metadata
-	DEVICE_PACKAGES := ipq-wifi-devolo_magic-2-wifi-next uboot-envtools
+	DEVICE_PACKAGES := ipq-wifi-devolo_magic-2-wifi-next
 endef
 TARGET_DEVICES += devolo_magic-2-wifi-next
 
@@ -357,7 +355,7 @@ define Device/edgecore_ecw5211
 	SOC := qcom-ipq4018
 	BLOCKSIZE := 128k
 	PAGESIZE := 2048
-	DEVICE_PACKAGES := kmod-tpm-i2c-atmel kmod-usb-acm uboot-envtools
+	DEVICE_PACKAGES := kmod-tpm-i2c-atmel kmod-usb-acm
 endef
 TARGET_DEVICES += edgecore_ecw5211
 
@@ -541,7 +539,6 @@ define Device/linksys_ea6350v3
 	UBINIZE_OPTS := -E 5
 	IMAGES += factory.bin
 	IMAGE/factory.bin := append-kernel | append-uImage-fakehdr filesystem | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA6350v3
-	DEVICE_PACKAGES := uboot-envtools
 endef
 TARGET_DEVICES += linksys_ea6350v3
 
@@ -557,7 +554,7 @@ define Device/linksys_ea8300
 	UBINIZE_OPTS := -E 5    # EOD marks to "hide" factory sig at EOF
 	IMAGES += factory.bin
 	IMAGE/factory.bin  := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=EA8300
-	DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9888-ct ipq-wifi-linksys_ea8300 kmod-usb-ledtrig-usbport
+	DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-linksys_ea8300 kmod-usb-ledtrig-usbport
 endef
 TARGET_DEVICES += linksys_ea8300
 
@@ -573,7 +570,7 @@ define Device/linksys_mr8300
 	UBINIZE_OPTS := -E 5    # EOD marks to "hide" factory sig at EOF
 	IMAGES += factory.bin
 	IMAGE/factory.bin  := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi | linksys-image type=MR8300
-	DEVICE_PACKAGES := uboot-envtools ath10k-firmware-qca9888-ct ipq-wifi-linksys_mr8300-v0 kmod-usb-ledtrig-usbport
+	DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-linksys_mr8300-v0 kmod-usb-ledtrig-usbport
 endef
 TARGET_DEVICES += linksys_mr8300
 
@@ -582,7 +579,7 @@ define Device/luma_wrtq-329acn
 	DEVICE_VENDOR := Luma Home
 	DEVICE_MODEL := WRTQ-329ACN
 	SOC := qcom-ipq4018
-	DEVICE_PACKAGES := ipq-wifi-luma_wrtq-329acn kmod-ath3k kmod-eeprom-at24 kmod-i2c-gpio uboot-envtools
+	DEVICE_PACKAGES := ipq-wifi-luma_wrtq-329acn kmod-ath3k kmod-eeprom-at24 kmod-i2c-gpio
 	IMAGE_SIZE := 76632k
 	BLOCKSIZE := 128k
 	PAGESIZE := 2048
@@ -648,7 +645,6 @@ define Device/openmesh_a42
 	IMAGES += factory.bin
 	IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A42
 	IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
-	DEVICE_PACKAGES := uboot-envtools
 endef
 TARGET_DEVICES += openmesh_a42
 
@@ -664,7 +660,7 @@ define Device/openmesh_a62
 	IMAGES += factory.bin
 	IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=A62
 	IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
-	DEVICE_PACKAGES := ath10k-firmware-qca9888-ct uboot-envtools
+	DEVICE_PACKAGES := ath10k-firmware-qca9888-ct
 endef
 TARGET_DEVICES += openmesh_a62
 
@@ -680,7 +676,7 @@ define Device/plasmacloud_pa1200
 	IMAGES += factory.bin
 	IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA1200
 	IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
-	DEVICE_PACKAGES := uboot-envtools ipq-wifi-plasmacloud-pa1200
+	DEVICE_PACKAGES := ipq-wifi-plasmacloud-pa1200
 endef
 TARGET_DEVICES += plasmacloud_pa1200
 
@@ -696,7 +692,7 @@ define Device/plasmacloud_pa2200
 	IMAGES += factory.bin
 	IMAGE/factory.bin := append-rootfs | pad-rootfs | openmesh-image ce_type=PA2200
 	IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | sysupgrade-tar rootfs=$$$$@ | append-metadata
-	DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-plasmacloud-pa2200 uboot-envtools
+	DEVICE_PACKAGES := ath10k-firmware-qca9888-ct ipq-wifi-plasmacloud-pa2200
 endef
 TARGET_DEVICES += plasmacloud_pa2200
 
@@ -790,7 +786,7 @@ define Device/zyxel_nbg6617
 #	this minimum-size. However, the larger image can be flashed both ways.
 	IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k | check-size $$$$(ROOTFS_SIZE) | zyxel-ras-image separate-kernel
 	IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | check-size $$$$(ROOTFS_SIZE) | sysupgrade-tar rootfs=$$$$@ | append-metadata
-	DEVICE_PACKAGES := uboot-envtools kmod-usb-ledtrig-usbport
+	DEVICE_PACKAGES := kmod-usb-ledtrig-usbport
 endef
 TARGET_DEVICES += zyxel_nbg6617
 


From lede-commits at lists.infradead.org  Tue Jun  8 12:58:17 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 08 Jun 2021 15:58:17 -0400
Subject: [openwrt/openwrt]  glibc: update to latest 2.33 HEAD (BZ #27892)
In-Reply-To: <162318229313.3059.15998583574592918108@git-01.infra.openwrt.org>
References: <162318229313.3059.15998583574592918108@git-01.infra.openwrt.org>
Message-ID: <mailman.4111.1623182306.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/3b4aac76b4a0cf62827f648666cb60840a3e102e

commit 3b4aac76b4a0cf62827f648666cb60840a3e102e
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Sun May 30 19:38:45 2021 +0200

    glibc: update to latest 2.33 HEAD (BZ #27892)
    
    0ef0e6de7f powerpc: Fix handling of scv return error codes [BZ #27892]
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
    (cherry picked from commit 507257778c733749816a8ca611f072d07916a918)
---
 toolchain/glibc/common.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/toolchain/glibc/common.mk b/toolchain/glibc/common.mk
index 16f03c3c29..b88a456ce7 100644
--- a/toolchain/glibc/common.mk
+++ b/toolchain/glibc/common.mk
@@ -12,8 +12,8 @@ PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=3f5080aedd164c1f92a53552dd3e0b82ac6d2bd3
-PKG_MIRROR_HASH:=93b1f5dad3deeca05c4a897aa553f0f4423cde68c5640cc333166dc78d112bf4
+PKG_SOURCE_VERSION:=0ef0e6de7fdfa18328b09ba2afb4f0112d4bdab4
+PKG_MIRROR_HASH:=1f2cfa8bd69f6286f2449317758e3ef29fc55cd420dfe8cd9327f149b0e9ac62
 PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
 


From lede-commits at lists.infradead.org  Tue Jun  8 12:58:18 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 08 Jun 2021 15:58:18 -0400
Subject: [openwrt/openwrt]  wireless-regdb: update to version 2021.04.21
In-Reply-To: <162318229313.3059.15998583574592918108@git-01.infra.openwrt.org>
References: <162318229313.3059.15998583574592918108@git-01.infra.openwrt.org>
Message-ID: <mailman.4112.1623182306.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/4aae7eb3c005b0a7548984fcf4c7e228244af163

commit 4aae7eb3c005b0a7548984fcf4c7e228244af163
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri May 21 14:29:31 2021 +0200

    wireless-regdb: update to version 2021.04.21
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
    (cherry picked from commit d76535c45e6e970b212744781431e152e90c1ce6)
---
 package/firmware/wireless-regdb/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/firmware/wireless-regdb/Makefile b/package/firmware/wireless-regdb/Makefile
index 308ca40e22..c209d802e4 100644
--- a/package/firmware/wireless-regdb/Makefile
+++ b/package/firmware/wireless-regdb/Makefile
@@ -1,12 +1,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wireless-regdb
-PKG_VERSION:=2020.11.20
+PKG_VERSION:=2021.04.21
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/software/network/wireless-regdb/
-PKG_HASH:=b4164490d82ff7b0086e812ac42ab27baf57be24324d4c0ee1c5dd6ba27f2a52
+PKG_HASH:=9e4c02b2a9710df4dbdb327c39612e8cbbae6495987afeddaebab28c1ea3d8fa
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 


From lede-commits at lists.infradead.org  Tue Jun  8 12:58:16 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 08 Jun 2021 15:58:16 -0400
Subject: [openwrt/openwrt]  umbim: fix return value of proto_mbim_setup()
In-Reply-To: <162318229313.3059.15998583574592918108@git-01.infra.openwrt.org>
References: <162318229313.3059.15998583574592918108@git-01.infra.openwrt.org>
Message-ID: <mailman.4113.1623182309.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/0eaff67b2ac7a8cd1a17c6a1870a386ae051a1b7

commit 0eaff67b2ac7a8cd1a17c6a1870a386ae051a1b7
Author: Adrian Schmutzler <freifunk at adrianschmutzler.de>
AuthorDate: Sat Jun 5 17:59:39 2021 +0200

    umbim: fix return value of proto_mbim_setup()
    
    The variable name appears to be mistyped.
    
    Suggested-by: Howard Chu <hyc at symas.com>
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
    (cherry picked from commit 6bc4c0ae3eb3dff6e410b5b012ab0bec267adb5a)
---
 package/network/utils/umbim/files/lib/netifd/proto/mbim.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh
index 9b5729a7ab..bfeb75b0fb 100755
--- a/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh
+++ b/package/network/utils/umbim/files/lib/netifd/proto/mbim.sh
@@ -155,7 +155,7 @@ proto_mbim_setup() {
 		sleep 15
 	}
 
-	return $rt
+	return $ret
 }
 
 proto_mbim_teardown() {


From lede-commits at lists.infradead.org  Tue Jun  8 13:53:14 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 08 Jun 2021 16:53:14 -0400
Subject: [openwrt/openwrt]  build: fix build for devices without initramfs
In-Reply-To: <162318559434.1498.8728910044944538197@git-01.infra.openwrt.org>
References: <162318559434.1498.8728910044944538197@git-01.infra.openwrt.org>
Message-ID: <mailman.4118.1623185601.434944.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/bb749e49a6e149f681a058b3d7e45fd8d4f79305

commit bb749e49a6e149f681a058b3d7e45fd8d4f79305
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Tue Jun 8 19:30:12 2021 +0200

    build: fix build for devices without initramfs
    
    Don't attempt to copy initramfs images for devices which do not output
    an initramfs image.
    
    This was breaking builds for mpc85xx-p1010 since mid-march.
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 include/image.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/image.mk b/include/image.mk
index 0d0e3eaba1..a7473abe68 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -478,7 +478,7 @@ define Device/Build/initramfs
 	  $$(if $$(CONFIG_JSON_OVERVIEW_IMAGE_INFO), $(BUILD_DIR)/json_info_files/$$(KERNEL_INITRAMFS_IMAGE).json,))
 
   $(KDIR)/$$(KERNEL_INITRAMFS_NAME):: image_prepare
-  $(1)-images: $(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE)
+  $(1)-images: $$(if $$(KERNEL_INITRAMFS),$(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE))
   $(BIN_DIR)/$$(KERNEL_INITRAMFS_IMAGE): $(KDIR)/tmp/$$(KERNEL_INITRAMFS_IMAGE)
 	cp $$^ $$@
 


From lede-commits at lists.infradead.org  Tue Jun  8 13:53:47 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 08 Jun 2021 16:53:47 -0400
Subject: [openwrt/openwrt]  treewide: make AddDepends/usb-serial selective
In-Reply-To: <162318562776.2180.16917496324234480053@git-01.infra.openwrt.org>
References: <162318562776.2180.16917496324234480053@git-01.infra.openwrt.org>
Message-ID: <mailman.4121.1623185636.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/ec8fe0a189bc6af9ebf51017512d4e5536421675

commit ec8fe0a189bc6af9ebf51017512d4e5536421675
Author: Adrian Schmutzler <freifunk at adrianschmutzler.de>
AuthorDate: Thu Feb 25 11:54:43 2021 +0100

    treewide: make AddDepends/usb-serial selective
    
    Make packages depending on usb-serial selective, so we do not have
    to add kmod-usb-serial manually for every device.
    
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
    (cherry picked from commit 9397b22df1473f315552578b58322db7f7750361)
---
 package/kernel/linux/modules/usb.mk         | 2 +-
 target/linux/at91/image/sam9x.mk            | 4 ++--
 target/linux/ath79/image/generic-tp-link.mk | 2 +-
 target/linux/ath79/image/generic.mk         | 4 ++--
 target/linux/ramips/image/mt7620.mk         | 6 +++---
 target/linux/ramips/image/mt76x8.mk         | 4 ++--
 target/linux/ramips/image/rt305x.mk         | 2 +-
 7 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk
index d050165df3..93f99f7cbe 100644
--- a/package/kernel/linux/modules/usb.mk
+++ b/package/kernel/linux/modules/usb.mk
@@ -561,7 +561,7 @@ $(eval $(call KernelPackage,usb-serial))
 
 define AddDepends/usb-serial
   SUBMENU:=$(USB_MENU)
-  DEPENDS+=kmod-usb-serial $(1)
+  DEPENDS+=+kmod-usb-serial $(1)
 endef
 
 
diff --git a/target/linux/at91/image/sam9x.mk b/target/linux/at91/image/sam9x.mk
index bbe410fbfb..1a036e493f 100644
--- a/target/linux/at91/image/sam9x.mk
+++ b/target/linux/at91/image/sam9x.mk
@@ -116,8 +116,8 @@ define Device/calamp_lmu5000
   $(Device/production)
   DEVICE_VENDOR := CalAmp
   DEVICE_MODEL := LMU5000
-  DEVICE_PACKAGES := kmod-rtc-pcf2123 kmod-usb-acm kmod-usb-serial \
-    kmod-usb-serial-option kmod-usb-serial-sierrawireless kmod-gpio-mcp23s08
+  DEVICE_PACKAGES := kmod-rtc-pcf2123 kmod-usb-acm \
+	kmod-usb-serial-option kmod-usb-serial-sierrawireless kmod-gpio-mcp23s08
 endef
 TARGET_DEVICES += calamp_lmu5000
 
diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk
index 0058d74f77..be6aa06b55 100644
--- a/target/linux/ath79/image/generic-tp-link.mk
+++ b/target/linux/ath79/image/generic-tp-link.mk
@@ -492,7 +492,7 @@ define Device/tplink_tl-mr6400-v1
   DEVICE_MODEL := TL-MR6400
   DEVICE_VARIANT := v1
   TPLINK_HWID := 0x64000001
-  DEVICE_PACKAGES := kmod-usb2 kmod-usb-net-rndis kmod-usb-serial \
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-net-rndis \
 	kmod-usb-serial-option adb-enablemodem
   SUPPORTED_DEVICES += tl-mr6400
 endef
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index d93ebbaeba..872e797a31 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -1116,7 +1116,7 @@ define Device/etactica_eg200
   DEVICE_VENDOR := eTactica
   DEVICE_MODEL := EG200
   DEVICE_PACKAGES := kmod-usb-chipidea2 kmod-ledtrig-oneshot \
-	kmod-usb-serial kmod-usb-serial-ftdi kmod-usb-storage kmod-fs-ext4
+	kmod-usb-serial-ftdi kmod-usb-storage kmod-fs-ext4
   IMAGE_SIZE := 16000k
   SUPPORTED_DEVICES += rme-eg200
 endef
@@ -2219,7 +2219,7 @@ define Device/zbtlink_zbt-wd323
   DEVICE_MODEL := WD323
   IMAGE_SIZE := 16000k
   DEVICE_PACKAGES := kmod-usb2 kmod-i2c-gpio kmod-rtc-pcf8563 \
-	kmod-usb-serial kmod-usb-serial-cp210x uqmi
+	kmod-usb-serial-cp210x uqmi
 endef
 TARGET_DEVICES += zbtlink_zbt-wd323
 
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index 949c09662f..fd7e42bf22 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -445,7 +445,7 @@ define Device/head-weblink_hdrm200
   DEVICE_VENDOR := Head Weblink
   DEVICE_MODEL := HDRM2000
   DEVICE_PACKAGES := kmod-mt76x2 kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 \
-	uqmi kmod-usb-serial kmod-usb-serial-option
+	uqmi kmod-usb-serial-option
 endef
 TARGET_DEVICES += head-weblink_hdrm200
 
@@ -1034,7 +1034,7 @@ define Device/tplink_archer-mr200
   TPLINK_HWREV := 0x4a
   IMAGES := sysupgrade.bin
   DEVICE_PACKAGES := kmod-mt76x0e kmod-usb2 kmod-usb-net-rndis \
-	kmod-usb-serial kmod-usb-serial-option adb-enablemodem
+	kmod-usb-serial-option adb-enablemodem
   DEVICE_MODEL := Archer MR200
   SUPPORTED_DEVICES += mr200
 endef
@@ -1221,7 +1221,7 @@ define Device/zbtlink_zbt-we826-e
   DEVICE_VENDOR := Zbtlink
   DEVICE_MODEL := ZBT-WE826-E
   DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-sdhci-mt7620 uqmi \
-	kmod-usb-serial kmod-usb-serial-option
+	kmod-usb-serial-option
 endef
 TARGET_DEVICES += zbtlink_zbt-we826-e
 
diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk
index 315d4f8d74..c5a0baa1cb 100644
--- a/target/linux/ramips/image/mt76x8.mk
+++ b/target/linux/ramips/image/mt76x8.mk
@@ -528,7 +528,7 @@ define Device/tplink_tl-mr6400-v4
   TPLINK_HWREV := 0x4
   TPLINK_HWREVADD := 0x4
   DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport \
-	kmod-usb-serial kmod-usb-serial-option kmod-usb-net-qmi-wwan uqmi
+	kmod-usb-serial-option kmod-usb-net-qmi-wwan uqmi
   IMAGES := sysupgrade.bin tftp-recovery.bin
   IMAGE/tftp-recovery.bin := pad-extra 128k | $$(IMAGE/factory.bin)
 endef
@@ -544,7 +544,7 @@ define Device/tplink_tl-mr6400-v5
   TPLINK_HWREV := 0x5
   TPLINK_HWREVADD := 0x5
   DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport \
-	kmod-usb-serial kmod-usb-serial-option kmod-usb-net-qmi-wwan uqmi
+	kmod-usb-serial-option kmod-usb-net-qmi-wwan uqmi
   IMAGES := sysupgrade.bin tftp-recovery.bin
   IMAGE/tftp-recovery.bin := pad-extra 128k | $$(IMAGE/factory.bin)
 endef
diff --git a/target/linux/ramips/image/rt305x.mk b/target/linux/ramips/image/rt305x.mk
index 5483b8a369..4edc2eb3c4 100644
--- a/target/linux/ramips/image/rt305x.mk
+++ b/target/linux/ramips/image/rt305x.mk
@@ -472,7 +472,7 @@ define Device/dlink_dwr-512-b
   DEVICE_VENDOR := D-Link
   DEVICE_MODEL := DWR-512
   DEVICE_VARIANT := B
-  DEVICE_PACKAGES := jboot-tools kmod-usb2 kmod-spi-dev kmod-usb-serial \
+  DEVICE_PACKAGES := jboot-tools kmod-usb2 kmod-spi-dev \
 	kmod-usb-serial-option kmod-usb-net-cdc-ether comgt-ncm
   DLINK_ROM_ID := DLK6E2412001
   DLINK_FAMILY_MEMBER := 0x6E24


From lede-commits at lists.infradead.org  Wed Jun  9 04:16:55 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 09 Jun 2021 07:16:55 -0400
Subject: [openwrt/openwrt]  toolchain/gdb: fix broken non-python build
In-Reply-To: <162323741538.5523.13720863755974512861@git-01.infra.openwrt.org>
References: <162323741538.5523.13720863755974512861@git-01.infra.openwrt.org>
Message-ID: <mailman.4323.1623237421.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/7f946a880a61816e338e99b79ece6fb206fc6f9c

commit 7f946a880a61816e338e99b79ece6fb206fc6f9c
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Jun 9 13:16:11 2021 +0200

    toolchain/gdb: fix broken non-python build
    
    Append configure args instead of overwriting them
    
    Fixes: 74417f8b3a80 ("toolchain: gdb: Add optional python support")
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 toolchain/gdb/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile
index 2708eff869..e769a3be3e 100644
--- a/toolchain/gdb/Makefile
+++ b/toolchain/gdb/Makefile
@@ -46,7 +46,7 @@ HOST_CONFIGURE_ARGS = \
 ifneq ($(CONFIG_GDB_PYTHON),)
   HOST_CONFIGURE_ARGS+= --with-python
 else
-  HOST_CONFIGURE_ARGS:= --without-python
+  HOST_CONFIGURE_ARGS+= --without-python
 endif
 
 define Host/Install


From lede-commits at lists.infradead.org  Wed Jun  9 13:45:39 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 09 Jun 2021 16:45:39 -0400
Subject: [openwrt/openwrt] ramips: mt7620: add kernel size for Jboot devices
In-Reply-To: <162327153858.9114.4025212850861932760@git-01.infra.openwrt.org>
References: <162327153858.9114.4025212850861932760@git-01.infra.openwrt.org>
Message-ID: <mailman.4542.1623271543.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/e1d8a14cd0a9f8844f9ebb8ca220780b0ce5d6db

commit e1d8a14cd0a9f8844f9ebb8ca220780b0ce5d6db
Author: Pawel Dembicki <paweldembicki at gmail.com>
AuthorDate: Wed Jun 9 12:22:39 2021 +0200

    ramips: mt7620: add kernel size for Jboot devices
    
    Since few months multiple users reported problems with various JBoot
    devices. [0][1][2][3] All of them was bricked.
    
    On my Lava LR-25G001 it freezes with current snapshot:
    
    CDW57CAM_003 Jboot B695
    Giga Switch AR8327 init
    AR8327/AR8337 id   ==> 0x1302
    JRecovery Version R1.2 2014/04/01 18:25
    SPI FLASH: MX25l12805d 16M
    .
    .
    (freeze)
    
    The kernel size is >2048k.
    
    I built current master with minimal config and it boots well:
    
    CDW57CAM_003 Jboot B695
    Giga Switch AR8327 init
    AR8327/AR8337 id   ==> 0x1302
    JRecovery Version R1.2 2014/04/01 18:25
    SPI FLASH: MX25l12805d 16M
    .
    ...........................
    Starting kernel @80000000...
    [    0.000000] Linux version 5.4.124
    
    Kernel size is <2048k.
    
    Jboot bootloader isn't open source, so it's impossible to find
    solution in code. It looks, that some buffer for kernel have 2MB size.
    
    To avoid bricked devices, this commit introduces 2048k limit kernel
    size for all jboot routers.
    
    [0] https://bugs.openwrt.org/index.php?do=details&task_id=3539
    [1] https://eko.one.pl/forum/viewtopic.php?pid=254344
    [2] https://eko.one.pl/forum/viewtopic.php?id=20930
    [3] https://eko.one.pl/forum/viewtopic.php?pid=241376#p241376
    
    Signed-off-by: Pawel Dembicki <paweldembicki at gmail.com>
    [remove Fixes:]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 target/linux/ramips/image/mt7620.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index 8f5d354e33..e56e96d347 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -62,6 +62,7 @@ TARGET_DEVICES += alfa-network_tube-e4g
 define Device/amit_jboot
   DLINK_IMAGE_OFFSET := 0x10000
   KERNEL := $(KERNEL_DTB)
+  KERNEL_SIZE := 2048k
   IMAGES += factory.bin
   IMAGE/sysupgrade.bin := mkdlinkfw | pad-rootfs | append-metadata
   IMAGE/factory.bin := mkdlinkfw | pad-rootfs | mkdlinkfw-factory


From lede-commits at lists.infradead.org  Wed Jun  9 13:45:38 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 09 Jun 2021 16:45:38 -0400
Subject: [openwrt/openwrt] ramips: fix Ethernet random MAC address for
 HILINK HLK-7628N
In-Reply-To: <162327153858.9114.4025212850861932760@git-01.infra.openwrt.org>
References: <162327153858.9114.4025212850861932760@git-01.infra.openwrt.org>
Message-ID: <mailman.4543.1623271543.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/ae9c5cd37bf5c08452f314b54afa963a00bdde30

commit ae9c5cd37bf5c08452f314b54afa963a00bdde30
Author: Liu Yu <f78fk at live.com>
AuthorDate: Tue Jun 8 09:50:02 2021 +0800

    ramips: fix Ethernet random MAC address for HILINK HLK-7628N
    
    Set the ethernet address from flash.
    
    MAC addresses as verified by OEM firmware:
    
      use   interface  source
      2g    wlan0      factory 0x04 (label)
      LAN   eth0.1     factory 0x28 (label+1)
      WAN   eth0.2     factory 0x2e (label+2)
    
    Fixes: 671c9d16e382 ("ramips: add support for HILINK HLK-7628N")
    
    Signed-off-by: Liu Yu <f78fk at live.com>
    [drop old MAC address setup from 02_network, cut out state_default
    changes, face-lift commit message, add Fixes:]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts        | 4 ++++
 target/linux/ramips/mt76x8/base-files/etc/board.d/02_network | 5 +----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts b/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts
index 69987b3566..f5106a5080 100644
--- a/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts
+++ b/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts
@@ -80,6 +80,10 @@
 	};
 };
 
+&ethernet {
+	mtd-mac-address = <&factory 0x28>;
+};
+
 &wmac {
 	status = "okay";
 };
diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
index d61a60591c..703936f217 100644
--- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
@@ -168,6 +168,7 @@ ramips_setup_macs()
 		lan_mac=$wan_mac
 		;;
 	cudy,wr1000|\
+	hilink,hlk-7628n|\
 	hilink,hlk-7688a|\
 	wavlink,wl-wn577a2|\
 	wavlink,wl-wn578a2)
@@ -187,10 +188,6 @@ ramips_setup_macs()
 		wan_mac=$(mtd_get_mac_binary factory 0x22)
 		label_mac=$wan_mac
 		;;
-	hilink,hlk-7628n)
-		lan_mac=$(macaddr_setbit_la "$(cat /sys/class/net/eth0/address)")
-		wan_mac=$(macaddr_add "$lan_mac" 1)
-		;;
 	hiwifi,hc5661a|\
 	hiwifi,hc5761a|\
 	hiwifi,hc5861b)


From lede-commits at lists.infradead.org  Wed Jun  9 13:45:41 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 09 Jun 2021 16:45:41 -0400
Subject: [openwrt/openwrt] ramips: fix LAN LED trigger assignment for Xiaomi
 Router 3 Pro
In-Reply-To: <162327153858.9114.4025212850861932760@git-01.infra.openwrt.org>
References: <162327153858.9114.4025212850861932760@git-01.infra.openwrt.org>
Message-ID: <mailman.4544.1623271544.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/edaf432bf411767f3e8a9e5effc3a416bcac46c7

commit edaf432bf411767f3e8a9e5effc3a416bcac46c7
Author: Adam Elyas <adamelyas at outlook.com>
AuthorDate: Tue Jun 8 08:09:18 2021 +0800

    ramips: fix LAN LED trigger assignment for Xiaomi Router 3 Pro
    
    The default trigger for the amber lights on lan1 and lan3 were
    mistakenly swapped after the device's migration to DSA. This
    caused activity on one port to trigger the amber light on the
    other port. Swapping their default trigger in the DTS file
    fixes that.
    
    Signed-off-by: Adam Elyas <adamelyas at outlook.com>
    [minor commit title adjustment, wrap commit message]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts
index b9101b7ccb..e8f3a50dbe 100644
--- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts
+++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts
@@ -48,7 +48,7 @@
 		lan3_amber {
 			label = "amber:lan3";
 			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
-			linux,default-trigger = "dsa-0.0:01:1Gbps";
+			linux,default-trigger = "dsa-0.0:03:1Gbps";
 		};
 
 		lan2_amber {
@@ -60,7 +60,7 @@
 		lan1_amber {
 			label = "amber:lan1";
 			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
-			linux,default-trigger = "dsa-0.0:03:1Gbps";
+			linux,default-trigger = "dsa-0.0:01:1Gbps";
 		};
 	};
 


From lede-commits at lists.infradead.org  Wed Jun  9 13:45:40 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 09 Jun 2021 16:45:40 -0400
Subject: [openwrt/openwrt]  ramips: mt7620: disable Jboot devices build
In-Reply-To: <162327153858.9114.4025212850861932760@git-01.infra.openwrt.org>
References: <162327153858.9114.4025212850861932760@git-01.infra.openwrt.org>
Message-ID: <mailman.4545.1623271544.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/2c97a02fef0c74b787fdf847e9e6b68457c67362

commit 2c97a02fef0c74b787fdf847e9e6b68457c67362
Author: Pawel Dembicki <paweldembicki at gmail.com>
AuthorDate: Wed Jun 9 12:52:51 2021 +0200

    ramips: mt7620: disable Jboot devices build
    
    At this moment kernel size in mt7620 snapshot builds is bigger than 2048k.
    It should be disabled by default.
    
    Signed-off-by: Pawel Dembicki <paweldembicki at gmail.com>
---
 target/linux/ramips/image/mt7620.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index e56e96d347..849bd31ef8 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -67,6 +67,7 @@ define Device/amit_jboot
   IMAGE/sysupgrade.bin := mkdlinkfw | pad-rootfs | append-metadata
   IMAGE/factory.bin := mkdlinkfw | pad-rootfs | mkdlinkfw-factory
   DEVICE_PACKAGES := jboot-tools kmod-usb2 kmod-usb-ohci
+  DEFAULT := n
 endef
 
 define Device/asus_rp-n53


From lede-commits at lists.infradead.org  Thu Jun 10 01:17:03 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 10 Jun 2021 04:17:03 -0400
Subject: [openwrt/openwrt] mac80211: rely on iwinfo for phy->path and
 path->phy lookups
In-Reply-To: <162331302232.7339.8927424576721560132@git-01.infra.openwrt.org>
References: <162331302232.7339.8927424576721560132@git-01.infra.openwrt.org>
Message-ID: <mailman.4630.1623313026.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/e1d57d4d4349efaa0d0cb4246456d1433b71ce7e

commit e1d57d4d4349efaa0d0cb4246456d1433b71ce7e
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Jun 9 14:32:32 2021 +0200

    mac80211: rely on iwinfo for phy->path and path->phy lookups
    
    This avoids inconsistencies from having multiple implementations do the same thing
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/kernel/mac80211/Makefile                   |  1 -
 .../kernel/mac80211/files/lib/netifd/mac80211.sh   | 36 ----------------------
 .../mac80211/files/lib/netifd/wireless/mac80211.sh |  3 +-
 package/kernel/mac80211/files/lib/wifi/mac80211.sh |  5 ++-
 4 files changed, 3 insertions(+), 42 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index a8a84f843a..0ade95e35e 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -549,7 +549,6 @@ endef
 define KernelPackage/cfg80211/install
 	$(INSTALL_DIR) $(1)/lib/wifi $(1)/lib/netifd/wireless
 	$(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
-	$(INSTALL_DATA) ./files/lib/netifd/mac80211.sh $(1)/lib/netifd
 	$(INSTALL_BIN) ./files/lib/netifd/wireless/mac80211.sh $(1)/lib/netifd/wireless
 	$(INSTALL_DIR) $(1)/etc/hotplug.d/ieee80211
 	$(INSTALL_DATA) ./files/mac80211.hotplug $(1)/etc/hotplug.d/ieee80211/10-wifi-detect
diff --git a/package/kernel/mac80211/files/lib/netifd/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/mac80211.sh
deleted file mode 100644
index 92e5c0e395..0000000000
--- a/package/kernel/mac80211/files/lib/netifd/mac80211.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-mac80211_phy_to_path() {
-	local phy="$1"
-
-	[ -x /usr/bin/readlink -a -h /sys/class/ieee80211/${phy} ] || return
-
-	local path="$(readlink -f /sys/class/ieee80211/${phy}/device)"
-	[ -n "$path" ] || return
-
-	path="${path##/sys/devices/}"
-	case "$path" in
-		platform*/pci*) path="${path##platform/}";;
-	esac
-
-	local p
-	local seq=""
-	for p in $(ls /sys/class/ieee80211/$phy/device/ieee80211); do
-		[ "$p" = "$phy" ] && {
-			echo "$path${seq:++$seq}"
-			break
-		}
-
-		seq=$((${seq:-0} + 1))
-	done
-}
-
-mac80211_path_to_phy() {
-	local path="$1"
-
-	local p
-	for p in $(ls /sys/class/ieee80211); do
-		local cur="$(mac80211_phy_to_path "$p")"
-		case "$cur" in
-			*$path) echo "$p"; return;;
-		esac
-	done
-}
diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index f1ed47802a..c9a0fe542a 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -1,7 +1,6 @@
 #!/bin/sh
 . /lib/netifd/netifd-wireless.sh
 . /lib/netifd/hostapd.sh
-. /lib/netifd/mac80211.sh
 
 init_wireless_driver "$@"
 
@@ -546,7 +545,7 @@ mac80211_generate_mac() {
 find_phy() {
 	[ -n "$phy" -a -d /sys/class/ieee80211/$phy ] && return 0
 	[ -n "$path" ] && {
-		phy="$(mac80211_path_to_phy "$path")"
+		phy="$(iwinfo nl80211 phyname "path=$path")"
 		[ -n "$phy" ] && return 0
 	}
 	[ -n "$macaddr" ] && {
diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
index 5eb7cc4c61..6aa46b0c74 100644
--- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
@@ -1,5 +1,4 @@
 #!/bin/sh
-. /lib/netifd/mac80211.sh
 
 append DRIVERS "mac80211"
 
@@ -11,7 +10,7 @@ lookup_phy() {
 	local devpath
 	config_get devpath "$device" path
 	[ -n "$devpath" ] && {
-		phy="$(mac80211_path_to_phy "$devpath")"
+		phy="$(iwinfo nl80211 phyname "path=$devpath")"
 		[ -n "$phy" ] && return
 	}
 
@@ -161,7 +160,7 @@ detect_mac80211() {
 
 		get_band_defaults "$dev"
 
-		path="$(mac80211_phy_to_path "$dev")"
+		path="$(iwinfo nl80211 path "$dev")"
 		if [ -n "$path" ]; then
 			dev_id="set wireless.radio${devidx}.path='$path'"
 		else


From lede-commits at lists.infradead.org  Thu Jun 10 01:17:02 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 10 Jun 2021 04:17:02 -0400
Subject: [openwrt/openwrt]  iwinfo: update to the latest version
In-Reply-To: <162331302232.7339.8927424576721560132@git-01.infra.openwrt.org>
References: <162331302232.7339.8927424576721560132@git-01.infra.openwrt.org>
Message-ID: <mailman.4631.1623313031.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/6e8475bbd0c841043c1187fb5a42d835071ad502

commit 6e8475bbd0c841043c1187fb5a42d835071ad502
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Jun 10 08:52:28 2021 +0200

    iwinfo: update to the latest version
    
    aa0e3c4bbe12 iwinfo: nl80211: add support for printing the device path for a phy
    dd6d6d2dec35 iwinfo: nl80211: use new path lookup function for nl80211_phy_idx_from_uci_path
    268bb26d2e2a iwinfo: nl80211: support looking up phy by path=.. and macaddr=...
    c0414642fead iwinfo: nl80211: fix typo
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/network/utils/iwinfo/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile
index d8c1befc97..b7c8370bba 100644
--- a/package/network/utils/iwinfo/Makefile
+++ b/package/network/utils/iwinfo/Makefile
@@ -11,9 +11,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git
-PKG_SOURCE_DATE:=2021-04-30
-PKG_SOURCE_VERSION:=c45f0b584b4b86f8250f90ea19afca271c114fa2
-PKG_MIRROR_HASH:=24ad04791254a0523cd15a4fec6116d9ff121e006c93e5e41459f91347b33ec2
+PKG_SOURCE_DATE:=2021-06-09
+PKG_SOURCE_VERSION:=c0414642fead263a4a6a686ad3cb7e965ec8a23a
+PKG_MIRROR_HASH:=c5686bbae86753c53db03a686b034bbb80d31107cc359ebd8522ea1c82db35ea
 PKG_MAINTAINER:=Jo-Philipp Wich <jo at mein.io>
 PKG_LICENSE:=GPL-2.0
 


From lede-commits at lists.infradead.org  Thu Jun 10 01:34:48 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 10 Jun 2021 04:34:48 -0400
Subject: [openwrt/openwrt]  x86: add upgrade support to diag.sh
In-Reply-To: <162331408816.20308.565407477627281661@git-01.infra.openwrt.org>
References: <162331408816.20308.565407477627281661@git-01.infra.openwrt.org>
Message-ID: <mailman.4651.1623314093.434944.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/82bec3364de557eb21ef85e1993468ba535e540b

commit 82bec3364de557eb21ef85e1993468ba535e540b
Author: Chris Blake <chrisrblake93 at gmail.com>
AuthorDate: Wed Jun 9 07:23:11 2021 -0500

    x86: add upgrade support to diag.sh
    
    Similar to how this is done in the diag.sh found in the base-files
    package, we should blink our status LED (if we have one) during the
    upgrade process. This follows the same blink pattern as seen at
    ./package/base-files/files/etc/diag.sh#L36
    
    Signed-off-by: Chris Blake <chrisrblake93 at gmail.com>
---
 target/linux/x86/base-files/etc/diag.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/linux/x86/base-files/etc/diag.sh b/target/linux/x86/base-files/etc/diag.sh
index d043e4f035..303dcbcdea 100644
--- a/target/linux/x86/base-files/etc/diag.sh
+++ b/target/linux/x86/base-files/etc/diag.sh
@@ -73,6 +73,10 @@ set_state() {
 		status_led_blink_preinit_regular
 		;;
 
+	upgrade)
+		status_led_blink_preinit_regular
+		;;
+
 	done)
 		status_led_on
 		;;


From lede-commits at lists.infradead.org  Thu Jun 10 01:34:50 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 10 Jun 2021 04:34:50 -0400
Subject: [openwrt/openwrt]  rockchip: add NanoPi R4S support
In-Reply-To: <162331408816.20308.565407477627281661@git-01.infra.openwrt.org>
References: <162331408816.20308.565407477627281661@git-01.infra.openwrt.org>
Message-ID: <mailman.4652.1623314095.434944.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/b72157984268b6542dd667859e4aed9cc2bbb7f5

commit b72157984268b6542dd667859e4aed9cc2bbb7f5
Author: Tianling Shen <cnsztl at immortalwrt.org>
AuthorDate: Fri Dec 25 20:03:14 2020 +0800

    rockchip: add NanoPi R4S support
    
    Hardware
    --------
    RockChip RK3399 ARM64 (6 cores)
    4GB LPDDR4 RAM
    2x 1000 Base-T
    3 LEDs (LAN / WAN / SYS)
    1 Button (Reset)
    Micro-SD slot
    2x USB 3.0 Port
    
    Installation
    ------------
    Uncompress the OpenWrt sysupgrade and write it to a micro SD card using
    dd.
    
    =====================================
    NOTICE FOR USERS WHO USE 1GB VERSION:
         BY NOW IT IS NOT SUPPORTED
    ====================================
    
    [initialed target]
    Co-developed-by: Marty Jones <mj8263788 at gmail.com>
    Signed-off-by: Marty Jones <mj8263788 at gmail.com>
    [fixed bootscript]
    Co-developed-by: Jayantajit Gogoi <jayanta.gogoi525 at gmail.com>
    Signed-off-by: Jayantajit Gogoi <jayanta.gogoi525 at gmail.com>
    Signed-off-by: Tianling Shen <cnsztl at immortalwrt.org>
---
 target/linux/rockchip/Makefile                     |   2 +-
 .../rockchip/armv8/base-files/etc/board.d/01_leds  |   4 +
 .../armv8/base-files/etc/board.d/02_network        |   7 +-
 .../etc/hotplug.d/net/40-net-smp-affinity          |   4 +
 target/linux/rockchip/armv8/config-5.10            |   1 +
 target/linux/rockchip/armv8/config-5.4             |   1 +
 target/linux/rockchip/image/armv8.mk               |  11 ++
 target/linux/rockchip/image/nanopi-r4s.bootscript  |   8 +
 ...3399-Add-support-for-FriendlyARM-NanoPi-R.patch | 177 +++++++++++++++++++++
 ...s-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch |  31 ++++
 ...3399-Add-support-for-FriendlyARM-NanoPi-R.patch | 177 +++++++++++++++++++++
 ...s-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch |  31 ++++
 12 files changed, 452 insertions(+), 2 deletions(-)

diff --git a/target/linux/rockchip/Makefile b/target/linux/rockchip/Makefile
index 7aeb0a3d55..f7b6995911 100644
--- a/target/linux/rockchip/Makefile
+++ b/target/linux/rockchip/Makefile
@@ -4,7 +4,7 @@ include $(TOPDIR)/rules.mk
 
 BOARD:=rockchip
 BOARDNAME:=Rockchip
-FEATURES:=ext4 audio usb usbgadget display gpio fpu rootfs-part boot-part squashfs
+FEATURES:=ext4 audio usb usbgadget display gpio fpu pci pcie rootfs-part boot-part squashfs
 SUBTARGETS:=armv8
 
 KERNEL_PATCHVER=5.4
diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
index e97ea3312d..b10c43ba60 100644
--- a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
+++ b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
@@ -12,6 +12,10 @@ friendlyarm,nanopi-r2s)
 	ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
 	ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth1"
 	;;
+friendlyarm,nanopi-r4s)
+	ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0"
+	ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth1"
+	;;
 esac
 
 board_config_flush
diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
index 8371913f8a..91bdb760d5 100644
--- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
+++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
@@ -7,7 +7,8 @@ rockchip_setup_interfaces()
 	local board="$1"
 
 	case "$board" in
-	friendlyarm,nanopi-r2s)
+	friendlyarm,nanopi-r2s|\
+	friendlyarm,nanopi-r4s)
 		ucidef_set_interfaces_lan_wan 'eth1' 'eth0'
 		;;
 	*)
@@ -35,6 +36,10 @@ rockchip_setup_macs()
 		wan_mac=$(nanopi_r2s_generate_mac)
 		lan_mac=$(macaddr_add "$wan_mac" 1)
 		;;
+	friendlyarm,nanopi-r4s)
+		wan_mac=$(get_mac_binary "/sys/bus/i2c/devices/2-0051/eeprom" 0xfa)
+		lan_mac=$(macaddr_setbit_la "$wan_mac")
+		;;
 	esac
 
 	[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
diff --git a/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity b/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity
index 44716258bf..9e4a4cf4fc 100644
--- a/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity
+++ b/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity
@@ -26,5 +26,9 @@ friendlyarm,nanopi-r2s)
 	set_interface_core 2 "eth0"
 	set_interface_core 4 "eth1" "xhci-hcd:usb3"
 	;;
+friendlyarm,nanopi-r4s)
+	set_interface_core 10 "eth0"
+	set_interface_core 20 "eth1"
+	;;
 esac
 
diff --git a/target/linux/rockchip/armv8/config-5.10 b/target/linux/rockchip/armv8/config-5.10
index c85984a982..734530a9c7 100644
--- a/target/linux/rockchip/armv8/config-5.10
+++ b/target/linux/rockchip/armv8/config-5.10
@@ -197,6 +197,7 @@ CONFIG_DWMAC_DWC_QOS_ETH=y
 CONFIG_DWMAC_GENERIC=y
 CONFIG_DWMAC_ROCKCHIP=y
 CONFIG_EDAC_SUPPORT=y
+CONFIG_EEPROM_AT24=y
 CONFIG_EMAC_ROCKCHIP=y
 CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_ENERGY_MODEL=y
diff --git a/target/linux/rockchip/armv8/config-5.4 b/target/linux/rockchip/armv8/config-5.4
index 7aadb477cb..0844401c2e 100644
--- a/target/linux/rockchip/armv8/config-5.4
+++ b/target/linux/rockchip/armv8/config-5.4
@@ -182,6 +182,7 @@ CONFIG_DWMAC_DWC_QOS_ETH=y
 CONFIG_DWMAC_GENERIC=y
 CONFIG_DWMAC_ROCKCHIP=y
 CONFIG_EDAC_SUPPORT=y
+CONFIG_EEPROM_AT24=y
 CONFIG_EMAC_ROCKCHIP=y
 CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_ENERGY_MODEL=y
diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk
index 24b1c38137..ee411d266b 100644
--- a/target/linux/rockchip/image/armv8.mk
+++ b/target/linux/rockchip/image/armv8.mk
@@ -12,6 +12,17 @@ define Device/friendlyarm_nanopi-r2s
 endef
 TARGET_DEVICES += friendlyarm_nanopi-r2s
 
+define Device/friendlyarm_nanopi-r4s
+  DEVICE_VENDOR := FriendlyARM
+  DEVICE_MODEL := NanoPi R4S
+  DEVICE_VARIANT := 4GB LPDDR4
+  SOC := rk3399
+  UBOOT_DEVICE_NAME := nanopi-r4s-rk3399
+  IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r4s | pine64-img | gzip | append-metadata
+  DEVICE_PACKAGES := kmod-r8169
+endef
+TARGET_DEVICES += friendlyarm_nanopi-r4s
+
 define Device/pine64_rockpro64
   DEVICE_VENDOR := Pine64
   DEVICE_MODEL := RockPro64
diff --git a/target/linux/rockchip/image/nanopi-r4s.bootscript b/target/linux/rockchip/image/nanopi-r4s.bootscript
new file mode 100644
index 0000000000..abe9c24ee3
--- /dev/null
+++ b/target/linux/rockchip/image/nanopi-r4s.bootscript
@@ -0,0 +1,8 @@
+part uuid mmc ${devnum}:2 uuid
+
+setenv bootargs "console=ttyS2,1500000 earlycon=uart8250,mmio32,0xff1a0000 root=PARTUUID=${uuid} rw rootwait"
+
+load mmc ${devnum}:1 ${fdt_addr_r} rockchip.dtb
+load mmc ${devnum}:1 ${kernel_addr_r} kernel.img
+
+booti ${kernel_addr_r} - ${fdt_addr_r}
diff --git a/target/linux/rockchip/patches-5.10/004-v5.13-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch b/target/linux/rockchip/patches-5.10/004-v5.13-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch
new file mode 100644
index 0000000000..461a5ae7dd
--- /dev/null
+++ b/target/linux/rockchip/patches-5.10/004-v5.13-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch
@@ -0,0 +1,177 @@
+From db792e9adbf85ffc9d6b0b060ac3c8e3148c8992 Mon Sep 17 00:00:00 2001
+From: Tianling Shen <cnsztl at gmail.com>
+Date: Fri, 19 Mar 2021 13:16:27 +0800
+Subject: [PATCH] rockchip: rk3399: Add support for FriendlyARM NanoPi R4S
+
+This adds support for the NanoPi R4S from FriendlyArm.
+
+Rockchip RK3399 SoC
+1GB DDR3 or 4GB LPDDR4 RAM
+Gigabit Ethernet (WAN)
+Gigabit Ethernet (PCIe) (LAN)
+USB 3.0 Port x 2
+MicroSD slot
+Reset button
+WAN - LAN - SYS LED
+
+Co-developed-by: Jensen Huang <jensenhuang at friendlyarm.com>
+Signed-off-by: Jensen Huang <jensenhuang at friendlyarm.com>
+[minor adjustments]
+Co-developed-by: Marty Jones <mj8263788 at gmail.com>
+Signed-off-by: Marty Jones <mj8263788 at gmail.com>
+[further adjustments, fixed format issues]
+Signed-off-by: Tianling Shen <cnsztl at gmail.com>
+Link: https://lore.kernel.org/r/20210319051627.814-2-cnsztl at gmail.com
+Signed-off-by: Heiko Stuebner <heiko at sntech.de>
+---
+ arch/arm64/boot/dts/rockchip/Makefile         |   1 +
+ .../boot/dts/rockchip/rk3399-nanopi-r4s.dts   | 133 +++++++++++++++++++++
+ 2 files changed, 134 insertions(+)
+ create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
+
+--- a/arch/arm64/boot/dts/rockchip/Makefile
++++ b/arch/arm64/boot/dts/rockchip/Makefile
+@@ -30,6 +30,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-le
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopc-t4.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-m4.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-neo4.dtb
++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-r4s.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-orangepi.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-pinebook-pro.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-puma-haikou.dtb
+--- /dev/null
++++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
+@@ -0,0 +1,133 @@
++// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
++/*
++ * FriendlyElec NanoPC-T4 board device tree source
++ *
++ * Copyright (c) 2020 FriendlyElec Computer Tech. Co., Ltd.
++ * (http://www.friendlyarm.com)
++ *
++ * Copyright (c) 2018 Collabora Ltd.
++ *
++ * Copyright (c) 2020 Jensen Huang <jensenhuang at friendlyarm.com>
++ * Copyright (c) 2020 Marty Jones <mj8263788 at gmail.com>
++ * Copyright (c) 2021 Tianling Shen <cnsztl at gmail.com>
++ */
++
++/dts-v1/;
++#include "rk3399-nanopi4.dtsi"
++
++/ {
++	model = "FriendlyElec NanoPi R4S";
++	compatible = "friendlyarm,nanopi-r4s", "rockchip,rk3399";
++
++	/delete-node/ display-subsystem;
++
++	gpio-leds {
++		pinctrl-0 = <&lan_led_pin>, <&sys_led_pin>, <&wan_led_pin>;
++
++		/delete-node/ led-0;
++
++		lan_led: led-lan {
++			gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_HIGH>;
++			label = "green:lan";
++		};
++
++		sys_led: led-sys {
++			gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
++			label = "red:sys";
++			default-state = "on";
++		};
++
++		wan_led: led-wan {
++			gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
++			label = "green:wan";
++		};
++	};
++
++	gpio-keys {
++		pinctrl-0 = <&reset_button_pin>;
++
++		/delete-node/ power;
++
++		reset {
++			debounce-interval = <50>;
++			gpios = <&gpio1 RK_PC6 GPIO_ACTIVE_LOW>;
++			label = "reset";
++			linux,code = <KEY_RESTART>;
++		};
++	};
++
++	vdd_5v: vdd-5v {
++		compatible = "regulator-fixed";
++		regulator-name = "vdd_5v";
++		regulator-always-on;
++		regulator-boot-on;
++	};
++};
++
++&emmc_phy {
++	status = "disabled";
++};
++
++&i2c4 {
++	status = "disabled";
++};
++
++&pcie0 {
++	max-link-speed = <1>;
++	num-lanes = <1>;
++	vpcie3v3-supply = <&vcc3v3_sys>;
++};
++
++&pinctrl {
++	gpio-leds {
++		/delete-node/ status-led-pin;
++
++		lan_led_pin: lan-led-pin {
++			rockchip,pins = <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
++		};
++
++		sys_led_pin: sys-led-pin {
++			rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
++		};
++
++		wan_led_pin: wan-led-pin {
++			rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
++		};
++	};
++
++	rockchip-key {
++		/delete-node/ power-key;
++
++		reset_button_pin: reset-button-pin {
++			rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
++		};
++	};
++};
++
++&sdhci {
++	status = "disabled";
++};
++
++&sdio0 {
++	status = "disabled";
++};
++
++&u2phy0_host {
++	phy-supply = <&vdd_5v>;
++};
++
++&u2phy1_host {
++	status = "disabled";
++};
++
++&uart0 {
++	status = "disabled";
++};
++
++&usbdrd_dwc3_0 {
++	dr_mode = "host";
++};
++
++&vcc3v3_sys {
++	vin-supply = <&vcc5v0_sys>;
++};
diff --git a/target/linux/rockchip/patches-5.10/005-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch b/target/linux/rockchip/patches-5.10/005-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch
new file mode 100644
index 0000000000..792028b292
--- /dev/null
+++ b/target/linux/rockchip/patches-5.10/005-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch
@@ -0,0 +1,31 @@
+From af20b3384e8723077cc6484160b0cf4e9be321de Mon Sep 17 00:00:00 2001
+From: Tianling Shen <cnsztl at gmail.com>
+Date: Mon, 7 Jun 2021 15:45:37 +0800
+Subject: [PATCH] arm64: dts: rockchip: add EEPROM node for NanoPi R4S
+
+NanoPi R4S has a EEPROM attached to the 2nd I2C bus (U92), which
+stores the MAC address.
+
+Signed-off-by: Tianling Shen <cnsztl at gmail.com>
+---
+ arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
++++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
+@@ -68,6 +68,15 @@
+ 	status = "disabled";
+ };
+ 
++&i2c2 {
++	eeprom at 51 {
++		compatible = "microchip,24c02", "atmel,24c02";
++		reg = <0x51>;
++		pagesize = <16>;
++		read-only; /* This holds our MAC */
++	};
++};
++
+ &i2c4 {
+ 	status = "disabled";
+ };
diff --git a/target/linux/rockchip/patches-5.4/007-v5.13-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch b/target/linux/rockchip/patches-5.4/007-v5.13-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch
new file mode 100644
index 0000000000..c508d71317
--- /dev/null
+++ b/target/linux/rockchip/patches-5.4/007-v5.13-rockchip-rk3399-Add-support-for-FriendlyARM-NanoPi-R.patch
@@ -0,0 +1,177 @@
+From db792e9adbf85ffc9d6b0b060ac3c8e3148c8992 Mon Sep 17 00:00:00 2001
+From: Tianling Shen <cnsztl at gmail.com>
+Date: Fri, 19 Mar 2021 13:16:27 +0800
+Subject: [PATCH] rockchip: rk3399: Add support for FriendlyARM NanoPi R4S
+
+This adds support for the NanoPi R4S from FriendlyArm.
+
+Rockchip RK3399 SoC
+1GB DDR3 or 4GB LPDDR4 RAM
+Gigabit Ethernet (WAN)
+Gigabit Ethernet (PCIe) (LAN)
+USB 3.0 Port x 2
+MicroSD slot
+Reset button
+WAN - LAN - SYS LED
+
+Co-developed-by: Jensen Huang <jensenhuang at friendlyarm.com>
+Signed-off-by: Jensen Huang <jensenhuang at friendlyarm.com>
+[minor adjustments]
+Co-developed-by: Marty Jones <mj8263788 at gmail.com>
+Signed-off-by: Marty Jones <mj8263788 at gmail.com>
+[further adjustments, fixed format issues]
+Signed-off-by: Tianling Shen <cnsztl at gmail.com>
+Link: https://lore.kernel.org/r/20210319051627.814-2-cnsztl at gmail.com
+Signed-off-by: Heiko Stuebner <heiko at sntech.de>
+---
+ arch/arm64/boot/dts/rockchip/Makefile         |   1 +
+ .../boot/dts/rockchip/rk3399-nanopi-r4s.dts   | 133 +++++++++++++++++++++
+ 2 files changed, 134 insertions(+)
+ create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
+
+--- a/arch/arm64/boot/dts/rockchip/Makefile
++++ b/arch/arm64/boot/dts/rockchip/Makefile
+@@ -25,6 +25,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-le
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopc-t4.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-m4.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-neo4.dtb
++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-r4s.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-orangepi.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-puma-haikou.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-roc-pc.dtb
+--- /dev/null
++++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
+@@ -0,0 +1,133 @@
++// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
++/*
++ * FriendlyElec NanoPC-T4 board device tree source
++ *
++ * Copyright (c) 2020 FriendlyElec Computer Tech. Co., Ltd.
++ * (http://www.friendlyarm.com)
++ *
++ * Copyright (c) 2018 Collabora Ltd.
++ *
++ * Copyright (c) 2020 Jensen Huang <jensenhuang at friendlyarm.com>
++ * Copyright (c) 2020 Marty Jones <mj8263788 at gmail.com>
++ * Copyright (c) 2021 Tianling Shen <cnsztl at gmail.com>
++ */
++
++/dts-v1/;
++#include "rk3399-nanopi4.dtsi"
++
++/ {
++	model = "FriendlyElec NanoPi R4S";
++	compatible = "friendlyarm,nanopi-r4s", "rockchip,rk3399";
++
++	/delete-node/ display-subsystem;
++
++	gpio-leds {
++		pinctrl-0 = <&lan_led_pin>, <&sys_led_pin>, <&wan_led_pin>;
++
++		/delete-node/ status;
++
++		lan_led: led-lan {
++			gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_HIGH>;
++			label = "green:lan";
++		};
++
++		sys_led: led-sys {
++			gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
++			label = "red:sys";
++			default-state = "on";
++		};
++
++		wan_led: led-wan {
++			gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
++			label = "green:wan";
++		};
++	};
++
++	gpio-keys {
++		pinctrl-0 = <&reset_button_pin>;
++
++		/delete-node/ power;
++
++		reset {
++			debounce-interval = <50>;
++			gpios = <&gpio1 RK_PC6 GPIO_ACTIVE_LOW>;
++			label = "reset";
++			linux,code = <KEY_RESTART>;
++		};
++	};
++
++	vdd_5v: vdd-5v {
++		compatible = "regulator-fixed";
++		regulator-name = "vdd_5v";
++		regulator-always-on;
++		regulator-boot-on;
++	};
++};
++
++&emmc_phy {
++	status = "disabled";
++};
++
++&i2c4 {
++	status = "disabled";
++};
++
++&pcie0 {
++	max-link-speed = <1>;
++	num-lanes = <1>;
++	vpcie3v3-supply = <&vcc3v3_sys>;
++};
++
++&pinctrl {
++	gpio-leds {
++		/delete-node/ leds-gpio;
++
++		lan_led_pin: lan-led-pin {
++			rockchip,pins = <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
++		};
++
++		sys_led_pin: sys-led-pin {
++			rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
++		};
++
++		wan_led_pin: wan-led-pin {
++			rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
++		};
++	};
++
++	rockchip-key {
++		/delete-node/ power-key;
++
++		reset_button_pin: reset-button-pin {
++			rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
++		};
++	};
++};
++
++&sdhci {
++	status = "disabled";
++};
++
++&sdio0 {
++	status = "disabled";
++};
++
++&u2phy0_host {
++	phy-supply = <&vdd_5v>;
++};
++
++&u2phy1_host {
++	status = "disabled";
++};
++
++&uart0 {
++	status = "disabled";
++};
++
++&usbdrd_dwc3_0 {
++	dr_mode = "host";
++};
++
++&vcc3v3_sys {
++	vin-supply = <&vcc5v0_sys>;
++};
diff --git a/target/linux/rockchip/patches-5.4/008-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch b/target/linux/rockchip/patches-5.4/008-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch
new file mode 100644
index 0000000000..792028b292
--- /dev/null
+++ b/target/linux/rockchip/patches-5.4/008-arm64-dts-rockchip-add-EEPROM-node-for-NanoPi-R4S.patch
@@ -0,0 +1,31 @@
+From af20b3384e8723077cc6484160b0cf4e9be321de Mon Sep 17 00:00:00 2001
+From: Tianling Shen <cnsztl at gmail.com>
+Date: Mon, 7 Jun 2021 15:45:37 +0800
+Subject: [PATCH] arm64: dts: rockchip: add EEPROM node for NanoPi R4S
+
+NanoPi R4S has a EEPROM attached to the 2nd I2C bus (U92), which
+stores the MAC address.
+
+Signed-off-by: Tianling Shen <cnsztl at gmail.com>
+---
+ arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
++++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts
+@@ -68,6 +68,15 @@
+ 	status = "disabled";
+ };
+ 
++&i2c2 {
++	eeprom at 51 {
++		compatible = "microchip,24c02", "atmel,24c02";
++		reg = <0x51>;
++		pagesize = <16>;
++		read-only; /* This holds our MAC */
++	};
++};
++
+ &i2c4 {
+ 	status = "disabled";
+ };


From lede-commits at lists.infradead.org  Thu Jun 10 01:34:49 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 10 Jun 2021 04:34:49 -0400
Subject: [openwrt/openwrt]  uboot-rockchip: add NanoPi R4S support
In-Reply-To: <162331408816.20308.565407477627281661@git-01.infra.openwrt.org>
References: <162331408816.20308.565407477627281661@git-01.infra.openwrt.org>
Message-ID: <mailman.4655.1623314098.434944.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/52dc7995f73c80598ef37c2f9ccf6016163f9b4b

commit 52dc7995f73c80598ef37c2f9ccf6016163f9b4b
Author: Tianling Shen <cnsztl at immortalwrt.org>
AuthorDate: Thu May 13 21:49:59 2021 +0800

    uboot-rockchip: add NanoPi R4S support
    
    Add support for the FriendlyARM NanoPi R4S.
    
    Signed-off-by: Tianling Shen <cnsztl at immortalwrt.org>
---
 package/boot/uboot-rockchip/Makefile               |  11 +
 .../102-arm64-rk3399-Add-support-NanoPi-R4s.patch  | 290 +++++++++++++++++++++
 2 files changed, 301 insertions(+)

diff --git a/package/boot/uboot-rockchip/Makefile b/package/boot/uboot-rockchip/Makefile
index 645422aca4..75825ce690 100644
--- a/package/boot/uboot-rockchip/Makefile
+++ b/package/boot/uboot-rockchip/Makefile
@@ -38,6 +38,16 @@ endef
 
 # RK3399 boards
 
+define U-Boot/nanopi-r4s-rk3399
+  BUILD_SUBTARGET:=armv8
+  NAME:=NanoPi R4S
+  BUILD_DEVICES:= \
+    friendlyarm_nanopi-r4s
+  DEPENDS:=+PACKAGE_u-boot-nanopi-r4s-rk3399:arm-trusted-firmware-rockchip
+  PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip
+  ATF:=rk3399_bl31.elf
+endef
+
 define U-Boot/rock-pi-4-rk3399
   BUILD_SUBTARGET:=armv8
   NAME:=Rock Pi 4
@@ -59,6 +69,7 @@ define U-Boot/rockpro64-rk3399
 endef
 
 UBOOT_TARGETS := \
+  nanopi-r4s-rk3399 \
   rock-pi-4-rk3399 \
   rockpro64-rk3399 \
   nanopi-r2s-rk3328
diff --git a/package/boot/uboot-rockchip/patches/102-arm64-rk3399-Add-support-NanoPi-R4s.patch b/package/boot/uboot-rockchip/patches/102-arm64-rk3399-Add-support-NanoPi-R4s.patch
new file mode 100644
index 0000000000..f926f52efe
--- /dev/null
+++ b/package/boot/uboot-rockchip/patches/102-arm64-rk3399-Add-support-NanoPi-R4s.patch
@@ -0,0 +1,290 @@
+From b69b9f3f54732c303939eb748aad97cd4cf60168 Mon Sep 17 00:00:00 2001
+From: Xiaobo Tian <peterwillcn at gmail.com>
+Date: Sat, 27 Feb 2021 22:39:11 +0800
+Subject: [PATCH] arm64: rk3399: Add support NanoPi R4s
+
+NanoPi R4s is SBC base on Rockchip RK3399 hexa-core processor with
+dual-Core Cortex-A72 and Mali-T864 GPU with 4GiB(LPDDR4) of RAM, SD card support,
+including 2 gigabit ethernet(RTL8211E 1Gbps - RTL8111H 1Gbps) and 2 USB 3.0 port.
+port.It also has two GPIO headers which allows further peripherals to be used.
+
+The devicetree file is taken of the rk3399 nanopi4 Linux kernel [1].
+
+[1] https://github.com/torvalds/linux/commit/e7a095908227fb3ccc86d001d9e13c9ae2bef8e6
+
+Signed-off-by: xiaobo <peterwillcn at gmail.com>
+Reviewed-by: Kever Yang <kever.yang at rock-chips.com>
+---
+ arch/arm/dts/Makefile                      |   1 +
+ arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi |  16 +++
+ arch/arm/dts/rk3399-nanopi-r4s.dts         | 138 +++++++++++++++++++++
+ board/rockchip/evb_rk3399/MAINTAINERS      |   6 +
+ configs/nanopi-r4s-rk3399_defconfig        |  62 +++++++++
+ 5 files changed, 223 insertions(+)
+ create mode 100644 arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi
+ create mode 100644 arch/arm/dts/rk3399-nanopi-r4s.dts
+ create mode 100644 configs/nanopi-r4s-rk3399_defconfig
+
+diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
+index dd4d4efed31..0a139473811 100644
+--- a/arch/arm/dts/Makefile
++++ b/arch/arm/dts/Makefile
+@@ -132,6 +132,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3399) += \
+ 	rk3399-nanopi-m4.dtb \
+ 	rk3399-nanopi-m4-2gb.dtb \
+ 	rk3399-nanopi-neo4.dtb \
++	rk3399-nanopi-r4s.dtb \
+ 	rk3399-orangepi.dtb \
+ 	rk3399-pinebook-pro.dtb \
+ 	rk3399-puma-haikou.dtb \
+diff --git a/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi b/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi
+new file mode 100644
+index 00000000000..cd1642527ba
+--- /dev/null
++++ b/arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi
+@@ -0,0 +1,16 @@
++// SPDX-License-Identifier: GPL-2.0+
++/*
++ * RK3399-based FriendlyElec boards device tree source
++ *
++ * Copyright (c) 2016 Fuzhou Rockchip Electronics Co., Ltd
++ *
++ * Copyright (c) 2018 FriendlyElec Computer Tech. Co., Ltd.
++ * (http://www.friendlyarm.com)
++ *
++ * Copyright (c) 2018 Collabora Ltd.
++ * Copyright (c) 2019 Arm Ltd.
++ * Copyright (C) 2020 Xiaobo <peterwillcn at gmail.com>
++ */
++
++#include "rk3399-nanopi4-u-boot.dtsi"
++#include "rk3399-sdram-lpddr4-100.dtsi"
+diff --git a/arch/arm/dts/rk3399-nanopi-r4s.dts b/arch/arm/dts/rk3399-nanopi-r4s.dts
+new file mode 100644
+index 00000000000..6f2cf17bf1b
+--- /dev/null
++++ b/arch/arm/dts/rk3399-nanopi-r4s.dts
+@@ -0,0 +1,138 @@
++// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
++/*
++ * Copyright (c) 2016 Fuzhou Rockchip Electronics Co., Ltd
++ *
++ * Copyright (c) 2018 FriendlyElec Computer Tech. Co., Ltd.
++ * (http://www.friendlyarm.com)
++ *
++ * Copyright (c) 2018 Collabora Ltd.
++ * Copyright (c) 2019 Arm Ltd.
++ * Copyright (C) 2020 Xiaobo <peterwillcn at gmail.com>
++ */
++
++/dts-v1/;
++#include "rk3399-nanopi4.dtsi"
++
++/ {
++	model = "FriendlyElec NanoPi R4S";
++	compatible = "friendlyarm,nanopi-r4s", "rockchip,rk3399";
++
++	aliases {
++		ethernet1 = &r8169;
++	};
++
++	vdd_5v: vdd-5v {
++		compatible = "regulator-fixed";
++		regulator-name = "vdd_5v";
++		regulator-always-on;
++		regulator-boot-on;
++	};
++
++	fan: pwm-fan {
++		compatible = "pwm-fan";
++		cooling-levels = <0 12 18 255>;
++		#cooling-cells = <2>;
++		fan-supply = <&vdd_5v>;
++		pwms = <&pwm1 0 50000 0>;
++	};
++};
++
++&cpu_thermal {
++	trips {
++		cpu_warm: cpu_warm {
++			temperature = <55000>;
++			hysteresis = <2000>;
++			type = "active";
++		};
++
++		cpu_hot: cpu_hot {
++			temperature = <65000>;
++			hysteresis = <2000>;
++			type = "active";
++		};
++	};
++
++	cooling-maps {
++		map2 {
++			trip = <&cpu_warm>;
++			cooling-device = <&fan THERMAL_NO_LIMIT 1>;
++		};
++
++		map3 {
++			trip = <&cpu_hot>;
++			cooling-device = <&fan 2 THERMAL_NO_LIMIT>;
++		};
++	};
++};
++
++&emmc_phy {
++	status = "disabled";
++};
++
++&fusb0 {
++	status = "disabled";
++};
++
++&leds {
++	lan_led: led-1 {
++		gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_HIGH>;
++		label = "nanopi-r4s:green:lan";
++	};
++
++	wan_led: led-2 {
++		gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
++		label = "nanopi-r4s:green:wan";
++	};
++};
++
++&leds_gpio {
++	rockchip,pins =
++		<0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>,
++		<1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>,
++		<1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
++};
++
++&pcie0 {
++	max-link-speed = <1>;
++	num-lanes = <1>;
++	vpcie3v3-supply = <&vcc3v3_sys>;
++
++	pcie at 0 {
++		reg = <0x00000000 0 0 0 0>;
++		#address-cells = <3>;
++		#size-cells = <2>;
++
++		r8169: pcie at 0,0 {
++			reg = <0x000000 0 0 0 0>;
++			local-mac-address = [ 00 00 00 00 00 00 ];
++		};
++	};
++};
++
++&sdhci {
++	status = "disabled";
++};
++
++&sdio0 {
++	status = "disabled";
++};
++
++&sdmmc {
++	host-index-min = <1>;
++};
++
++&u2phy0_host {
++	phy-supply = <&vdd_5v>;
++};
++
++&u2phy1_host {
++	status = "disabled";
++};
++
++&usbdrd_dwc3_0 {
++	dr_mode = "host";
++};
++
++&vcc3v3_sys {
++	vin-supply = <&vcc5v0_sys>;
++};
+diff --git a/board/rockchip/evb_rk3399/MAINTAINERS b/board/rockchip/evb_rk3399/MAINTAINERS
+index 4c889e06a63..3b9d60eccd4 100644
+--- a/board/rockchip/evb_rk3399/MAINTAINERS
++++ b/board/rockchip/evb_rk3399/MAINTAINERS
+@@ -55,6 +55,12 @@ S:	Maintained
+ F:	configs/nanopi-neo4-rk3399_defconfig
+ F:	arch/arm/dts/rk3399-nanopi-neo4-u-boot.dtsi
+ 
++NANOPI-R4S
++M:	Xiaobo Tian <peterwillcn at gmail.com>
++S:	Maintained
++F:	configs/nanopi-r4s-rk3399_defconfig
++F:	arch/arm/dts/rk3399-nanopi-r4s-u-boot.dtsi
++
+ ORANGEPI-RK3399
+ M:	Jagan Teki <jagan at amarulasolutions.com>
+ S:	Maintained
+diff --git a/configs/nanopi-r4s-rk3399_defconfig b/configs/nanopi-r4s-rk3399_defconfig
+new file mode 100644
+index 00000000000..0a3c28b0126
+--- /dev/null
++++ b/configs/nanopi-r4s-rk3399_defconfig
+@@ -0,0 +1,62 @@
++CONFIG_ARM=y
++CONFIG_ARCH_ROCKCHIP=y
++CONFIG_SYS_TEXT_BASE=0x00200000
++CONFIG_ENV_OFFSET=0x3F8000
++CONFIG_ROCKCHIP_RK3399=y
++CONFIG_TARGET_EVB_RK3399=y
++CONFIG_NR_DRAM_BANKS=1
++CONFIG_DEBUG_UART_BASE=0xFF1A0000
++CONFIG_DEBUG_UART_CLOCK=24000000
++CONFIG_DEBUG_UART=y
++CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-nanopi-r4s.dtb"
++CONFIG_DISPLAY_BOARDINFO_LATE=y
++# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
++CONFIG_SPL_STACK_R=y
++CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000
++CONFIG_TPL=y
++CONFIG_CMD_BOOTZ=y
++CONFIG_CMD_GPT=y
++CONFIG_CMD_MMC=y
++CONFIG_CMD_USB=y
++# CONFIG_CMD_SETEXPR is not set
++CONFIG_CMD_TIME=y
++CONFIG_SPL_OF_CONTROL=y
++CONFIG_DEFAULT_DEVICE_TREE="rk3399-nanopi-r4s"
++CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
++CONFIG_ENV_IS_IN_MMC=y
++CONFIG_SYS_RELOC_GD_ENV_ADDR=y
++CONFIG_ROCKCHIP_GPIO=y
++CONFIG_SYS_I2C_ROCKCHIP=y
++CONFIG_MMC_DW=y
++CONFIG_MMC_DW_ROCKCHIP=y
++CONFIG_MMC_SDHCI=y
++CONFIG_MMC_SDHCI_ROCKCHIP=y
++CONFIG_DM_ETH=y
++CONFIG_ETH_DESIGNWARE=y
++CONFIG_GMAC_ROCKCHIP=y
++CONFIG_PMIC_RK8XX=y
++CONFIG_REGULATOR_PWM=y
++CONFIG_REGULATOR_RK8XX=y
++CONFIG_PWM_ROCKCHIP=y
++CONFIG_RAM_RK3399_LPDDR4=y
++CONFIG_BAUDRATE=1500000
++CONFIG_DEBUG_UART_SHIFT=2
++CONFIG_SYSRESET=y
++CONFIG_USB=y
++CONFIG_USB_XHCI_HCD=y
++CONFIG_USB_XHCI_DWC3=y
++CONFIG_USB_EHCI_HCD=y
++CONFIG_USB_EHCI_GENERIC=y
++CONFIG_USB_KEYBOARD=y
++CONFIG_USB_HOST_ETHER=y
++CONFIG_USB_ETHER_ASIX=y
++CONFIG_USB_ETHER_ASIX88179=y
++CONFIG_USB_ETHER_MCS7830=y
++CONFIG_USB_ETHER_RTL8152=y
++CONFIG_USB_ETHER_SMSC95XX=y
++CONFIG_DM_VIDEO=y
++CONFIG_DISPLAY=y
++CONFIG_VIDEO_ROCKCHIP=y
++CONFIG_DISPLAY_ROCKCHIP_HDMI=y
++CONFIG_SPL_TINY_MEMSET=y
++CONFIG_ERRNO_STR=y


From lede-commits at lists.infradead.org  Thu Jun 10 08:14:30 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 10 Jun 2021 11:14:30 -0400
Subject: [openwrt/openwrt]  ramips: add support for Linksys EA8100 v1
In-Reply-To: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
References: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
Message-ID: <mailman.4756.1623338067.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/97df795b78dc572ea2ec105ccbf8af27cc4b4d8e

commit 97df795b78dc572ea2ec105ccbf8af27cc4b4d8e
Author: Tee Hao Wei <angelsl at in04.sg>
AuthorDate: Tue May 18 03:46:36 2021 +0800

    ramips: add support for Linksys EA8100 v1
    
    Specifications:
    - SoC: MT7621AT
    - RAM: 256MB
    - Flash: 128MB NAND
    - Ethernet: 5 Gigabit ports
    - WiFi: 2.4G/5G MT7615N
    - USB: 1 USB 3.0, 1 USB 2.0
    
    This device is very similar to the EA7300 v1/v2 and EA7500 v2.
    
    Installation:
    
    Upload the generated factory image through the factory web interface.
    
    (following part taken from EA7300 v2 commit message:)
    
    This might fail due to the A/B nature of this device. When flashing, OEM
    firmware writes over the non-booted partition. If booted from 'A',
    flashing over 'B' won't work. To get around this, you should flash the
    OEM image over itself. This will then boot the router from 'B' and
    allow you to flash OpenWRT without problems.
    
    Reverting to factory firmware:
    
    Hard-reset the router three times to force it to boot from 'B.' This is
    where the stock firmware resides. To remove any traces of OpenWRT from
    your router simply flash the OEM image at this point.
    
    With thanks to Leon Poon (@LeonPoon) for the initial bringup.
    
    Signed-off-by: Tee Hao Wei <angelsl at in04.sg>
    [add missing entry in 10_fix_wifi_mac]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
    (cherry picked from commit b232680f847f4ea8d058849a51dedebb8e398a01)
---
 package/boot/uboot-envtools/files/ramips                          | 1 +
 target/linux/ramips/dts/mt7621_linksys_ea8100-v1.dts              | 8 ++++++++
 target/linux/ramips/image/mt7621.mk                               | 8 ++++++++
 target/linux/ramips/mt7621/base-files/etc/board.d/01_leds         | 3 ++-
 target/linux/ramips/mt7621/base-files/etc/board.d/02_network      | 3 ++-
 .../mt7621/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac     | 3 ++-
 target/linux/ramips/mt7621/base-files/etc/init.d/bootcount        | 3 ++-
 target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh     | 1 +
 8 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips
index e1920303a9..0de062bd83 100644
--- a/package/boot/uboot-envtools/files/ramips
+++ b/package/boot/uboot-envtools/files/ramips
@@ -54,6 +54,7 @@ jcg,q20)
 linksys,ea7300-v1|\
 linksys,ea7300-v2|\
 linksys,ea7500-v2|\
+linksys,ea8100-v1|\
 xiaomi,mi-router-3g|\
 xiaomi,mi-router-3-pro|\
 xiaomi,mi-router-4|\
diff --git a/target/linux/ramips/dts/mt7621_linksys_ea8100-v1.dts b/target/linux/ramips/dts/mt7621_linksys_ea8100-v1.dts
new file mode 100644
index 0000000000..6cc2219aec
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_linksys_ea8100-v1.dts
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621_linksys_ea7xxx.dtsi"
+
+/ {
+	compatible = "linksys,ea8100-v1", "mediatek,mt7621-soc";
+	model = "Linksys EA8100";
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 873011d2d8..6645c7b06e 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -854,6 +854,14 @@ define Device/linksys_ea7500-v2
 endef
 TARGET_DEVICES += linksys_ea7500-v2
 
+define Device/linksys_ea8100-v1
+  $(Device/linksys_ea7xxx)
+  DEVICE_MODEL := EA8100
+  DEVICE_VARIANT := v1
+  LINKSYS_HWNAME := EA8100
+endef
+TARGET_DEVICES += linksys_ea8100-v1
+
 define Device/linksys_re6500
   $(Device/dsa-migration)
   IMAGE_SIZE := 7872k
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
index 89a56dff2a..95cf120f2d 100755
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
@@ -52,7 +52,8 @@ linksys,e5600)
 	;;
 linksys,ea7300-v1|\
 linksys,ea7300-v2|\
-linksys,ea7500-v2)
+linksys,ea7500-v2|\
+linksys,ea8100-v1)
 	ucidef_set_led_netdev "lan1" "lan1 link" "green:lan1" "lan1" "link"
 	ucidef_set_led_netdev "lan2" "lan2 link" "green:lan2" "lan2" "link"
 	ucidef_set_led_netdev "lan3" "lan3 link" "green:lan3" "lan3" "link"
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
index 5d5923cc70..c0c767306a 100755
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
@@ -142,7 +142,8 @@ ramips_setup_macs()
 	linksys,e5600|\
 	linksys,ea7300-v1|\
 	linksys,ea7300-v2|\
-	linksys,ea7500-v2)
+	linksys,ea7500-v2|\
+	linksys,ea8100-v1)
 		lan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
 		wan_mac=$lan_mac
 		label_mac=$lan_mac
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 49b7f23ce9..bd0f0254c6 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
@@ -21,7 +21,8 @@ case "$board" in
 	linksys,e5600|\
 	linksys,ea7300-v1|\
 	linksys,ea7300-v2|\
-	linksys,ea7500-v2)
+	linksys,ea7500-v2|\
+	linksys,ea8100-v1)
 		hw_mac_addr=$(mtd_get_mac_ascii devinfo hw_mac_addr)
 		[ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 1 > /sys${DEVPATH}/macaddress
 		[ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
diff --git a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
index cfaa62485c..d3525ea0c9 100755
--- a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
+++ b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
@@ -11,7 +11,8 @@ boot() {
 	linksys,e5600|\
 	linksys,ea7300-v1|\
 	linksys,ea7300-v2|\
-	linksys,ea7500-v2)
+	linksys,ea7500-v2|\
+	linksys,ea8100-v1)
 		mtd resetbc s_env || true
 		;;
 	samknows,whitebox-v8)
diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
index 689a0e51ae..4943ad1305 100755
--- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
@@ -62,6 +62,7 @@ platform_do_upgrade() {
 	linksys,ea7300-v1|\
 	linksys,ea7300-v2|\
 	linksys,ea7500-v2|\
+	linksys,ea8100-v1|\
 	netgear,r6220|\
 	netgear,r6260|\
 	netgear,r6350|\


From lede-commits at lists.infradead.org  Thu Jun 10 08:14:21 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 10 Jun 2021 11:14:21 -0400
Subject: [openwrt/openwrt] firmware-utils: zytrx: Add util for ZyXEL
 specific header
In-Reply-To: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
References: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
Message-ID: <mailman.4757.1623338067.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/dd6f02a3f4b70c82b45e1156cbe1edc833f683b4

commit dd6f02a3f4b70c82b45e1156cbe1edc833f683b4
Author: Bj?rn Mork <bjorn at mork.no>
AuthorDate: Mon Apr 19 13:00:55 2021 +0200

    firmware-utils: zytrx: Add util for ZyXEL specific header
    
    The ZyXEL NR7101 prepend an additional header to U-Boot images. This
    header use the TRX magic 0x30524448 (HDR0), but is incompatible with
    TRX images.
    
    This code is reverse-engineered based on matching 32 bit numbers
    found in the header with lengths and different checksum
    calculations of the vendor images found on the device.  The result
    was matched against the validation output produced by the
    bootloader to name the associated header fields.
    
    Example bootloader validation output:
    
     Zyxel TRX Image 1 --> Found!  Header Checksum OK
     ============ZyXEL header information==================
             chipId             : MT7621A
             boardId            : NR7101
             modelId            : 07 01 00 01
             kernel_len         : (14177560)
             kernelChksum       : (0x8DD31F69)
             swVersionInt       : 1.00(ABUV.0)D1
             swVersionExt       : 1.00(ABUV.0)D1
    
     Zyxel TRX Image 2 --> Found!  Header Checksum OK
     ============ZyXEL header information==================
             chipId             : MT7621A
             boardId            : NR7101
             modelId            : 07 01 00 01
             kernel_len         : (14176660)
             kernelChksum       : (0x951A7637)
             swVersionInt       : 1.00(ABUV.0)D0
             swVersionExt       : 1.00(ABUV.0)D0
    
     =================================================
     Check image validation:
     Image1 Header Magic Number --> OK
     Image2 Header Magic Number --> OK
     Image1 Header Checksum --> OK
     Image2 Header Checksum --> OK
     Image1 Data Checksum --> OK
     Image2 Data Checksum --> OK
     Image1 Stable Flag --> Stable
     Image1 Try Counter --> 0
     Image1: OK
     Image2: OK
    
    The coverage and algorithm for the kernelChksum field is unknown.
    This field is not validated by the bootloader or the OEM firmware
    upgrade tool. It is therefore set to a static value for now.
    
    The swVersion fields contain free form string values.  The OEM firmware
    use ZyXEL structured version numbers as shown above.  The strings are
    not interpreted or validated on boot, so they can be repurposed for
    anything we want the bootloader to display to the user.  But the OEM
    web GUI fails to flash images with freeform strings.
    
    The purpose of the other strings in the header is not known.  The
    values appear to be static.  We assume they are fixed for now, until
    we have other examples.  One of these strings is the platform name,
    which is taken as an input parameter for support other members of
    the device family.
    
    Signed-off-by: Bj?rn Mork <bjorn at mork.no>
    Tested-by: Bj?rn Mork <bjorn at mork.no>
    (cherry picked from commit 48cad07a55246317d66fee4ced25cb62a2bae3d3)
---
 tools/firmware-utils/Makefile    |   1 +
 tools/firmware-utils/src/zytrx.c | 226 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 227 insertions(+)

diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile
index 28f8f0555a..cec8398a27 100644
--- a/tools/firmware-utils/Makefile
+++ b/tools/firmware-utils/Makefile
@@ -97,6 +97,7 @@ define Host/Compile
 	$(call cc,wrt400n cyg_crc32)
 	$(call cc,xorimage)
 	$(call cc,zyimage,-Wall)
+	$(call cc,zytrx,-Wall)
 	$(call cc,zyxbcm)
 endef
 
diff --git a/tools/firmware-utils/src/zytrx.c b/tools/firmware-utils/src/zytrx.c
new file mode 100644
index 0000000000..302efc6010
--- /dev/null
+++ b/tools/firmware-utils/src/zytrx.c
@@ -0,0 +1,226 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * zytrx - add header to images for ZyXEL NR7101
+ *
+ * Based on add_header.c - partially based on OpenWrt's
+ * motorola-bin.c
+ *
+ * Copyright (C) 2008 Imre Kaloz  <kaloz at openwrt.org>
+ *                    Gabor Juhos <juhosg at openwrt.org>
+ * Copyright (C) 2021 Bj?rn Mork <bjorn at mork.no>
+
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License,
+ * version 2 as published by the Free Software Foundation.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <string.h>
+#include <netinet/in.h>
+#include <inttypes.h>
+
+#define BPB 8 /* bits/byte */
+
+static uint32_t crc32[1<<BPB];
+
+static void init_crc32(void)
+{
+	const uint32_t poly = ntohl(0x2083b8ed);
+	int n;
+
+	for (n = 0; n < 1<<BPB; n++) {
+		uint32_t crc = n;
+		int bit;
+
+		for (bit = 0; bit < BPB; bit++)
+			crc = (crc & 1) ? (poly ^ (crc >> 1)) : (crc >> 1);
+		crc32[n] = crc;
+	}
+}
+
+static uint32_t crc32buf(const unsigned char *buf, size_t len)
+{
+	uint32_t crc = 0xFFFFFFFF;
+
+	for (; len; len--, buf++)
+		crc = crc32[(uint8_t)crc ^ *buf] ^ (crc >> BPB);
+	return ~crc;
+}
+
+/* HDR0 reversed, to be stored as BE */
+#define MAGIC		0x30524448  /* HDR0 reversed, to be stored as BE */
+
+/* All numbers are stored as BE */
+struct zytrx_t {
+	uint32_t magic;
+	uint32_t len_h;		/* Length of this header */
+	uint32_t len_t;		/* Total length of file  */
+	uint32_t crc32_p;	/* Bit inverted 32-bit CRC of image payload */
+	uint8_t  verInt[32];	/* String "5.0.0.0\n" zero padded */
+	uint8_t  verExt[32];	/* String "\n" zero padded */
+	uint32_t len_p;		/* Length of image payload */
+	uint8_t  pad1[12];	/* zero padding(?) */
+	uint8_t  code[164];	/* string "3 6035 122 0\n" zero padded */
+	uint8_t  chipid[8];	/* string "MT7621A" zero padded */
+	uint8_t  boardid[16];	/* string "NR7101" zero padded */
+	uint32_t modelid;	/* modelid as 4 BCD digits: 0x07010001 */
+	uint8_t  pad2[8];	/* zero padding(?) */
+	uint8_t  swVersionInt[32];	/* ZyXEL version string: "1.00(ABUV.0)D0" zero padded */
+	uint8_t  swVersionExt[32];	/* identical to swVersionInt  */
+	uint8_t  pad4[4];	/* zero padding(?) */
+	uint32_t kernelChksum;	/* no idea how this is computed - reported but not validated */
+	uint8_t  pad5[4];	/* zero padding(?) */
+	uint32_t crc32_h;	/* Bit inverted 32-bit CRC of this header payload */
+	uint8_t  pad6[4];	/* zero padding(?) */
+};
+
+/* static?() field values of unknown meaning - maybe ove to board
+ * table when we know the significance
+ */
+#define VER_INT		"5.0.0.0\n"
+#define VER_EXT		"\n"
+#define CODE		"3 6035 122 0\n"
+#define KERNELCHKSUM	0x12345678
+
+/* table of supported devices using this header format */
+static struct board_t {
+	uint8_t  chipid[8];
+	uint8_t  boardid[16];
+	uint32_t modelid;
+} boards[] = {
+	{ "MT7621A", "NR7101", 0x07010001 },
+	{}
+};
+
+static int find_board(struct zytrx_t *h, char *board)
+{
+	struct board_t *p;
+
+	for (p = boards; p->modelid; p++) {
+		if (strncmp((const char *)p->boardid, board, sizeof(p->boardid)))
+			continue;
+		memcpy(h->chipid, p->chipid, sizeof(h->chipid));
+		memcpy(h->boardid, p->boardid, sizeof(h->boardid));
+		h->modelid = htonl(p->modelid);
+		return 0;
+	}
+	return -1;
+}
+
+static void usage(const char *name)
+{
+	struct board_t *p;
+
+	fprintf(stderr, "Usage:\n");
+	fprintf(stderr, " %s -B <board> -v <versionstr> -i <file> [-o <outputfile>]\n\n", name);
+	fprintf(stderr, "Supported <board> values:\n");
+	for (p = boards; p->modelid; p++)
+		fprintf(stderr, "\t%-12s\n", p->boardid);
+	fprintf(stderr, "\nExample:\n");
+	fprintf(stderr, " %s -B %s -v foobar-1.0 -i my.img -o out.img\n\n", name,
+		boards[0].boardid);
+	exit(EXIT_FAILURE);
+}
+
+static void errexit(const char *msg)
+{
+	fprintf(stderr, "ERR: %s: %s\n", msg, errno ? strerror(errno) : "unknown");
+	exit(EXIT_FAILURE);
+}
+
+static void *map_input(const char *name, size_t *len)
+{
+	struct stat stat;
+	void *mapped;
+	int fd;
+
+	fd = open(name, O_RDONLY);
+	if (fd < 0)
+		return NULL;
+	if (fstat(fd, &stat) < 0) {
+		close(fd);
+		return NULL;
+	}
+	*len = stat.st_size;
+	mapped = mmap(NULL, stat.st_size, PROT_READ, MAP_SHARED, fd, 0);
+	if (close(fd) < 0)
+		return NULL;
+	return mapped;
+}
+
+int main(int argc, char **argv)
+{
+	int c, fdout = STDOUT_FILENO;
+	void *input_file = NULL;
+	size_t file_len, len;
+	uint32_t crc;
+	struct zytrx_t h = {
+		.magic		= htonl(MAGIC),
+		.len_h		= htonl(sizeof(h)),
+		.verInt		= VER_INT,
+		.verExt		= VER_EXT,
+		.code		= CODE,
+		.kernelChksum	= htonl(KERNELCHKSUM),
+	};
+
+	while ((c = getopt(argc, argv, "B:v:i:o:")) != -1) {
+		switch (c) {
+		case 'B':
+			if (find_board(&h, optarg) < 0)
+				errexit("unsupported board");
+			break;
+		case 'v':
+			len = strlen(optarg);
+			if (len > sizeof(h.swVersionInt))
+				errexit("version string too long");
+			memcpy(h.swVersionInt, optarg, len);
+			memcpy(h.swVersionExt, optarg, len);
+			break;
+		case 'i':
+			input_file = map_input(optarg, &file_len);
+			if (!input_file)
+				errexit(optarg);
+			break;
+		case 'o':
+			fdout = open(optarg, O_WRONLY | O_CREAT, 0644);
+			if (fdout < 0)
+				errexit(optarg);
+			break;
+		default:
+			usage(argv[0]);
+		}
+	}
+
+	/* required paremeters */
+	if (!input_file || !h.modelid || !h.swVersionInt[0])
+		usage(argv[0]);
+
+	/* length fields */
+	h.len_t = htonl(sizeof(h) + file_len);
+	h.len_p = htonl(file_len);
+
+	/* crc fields */
+	init_crc32();
+	crc = crc32buf(input_file, file_len);
+	h.crc32_p = htonl(~crc);
+	crc = crc32buf((unsigned char *)&h, sizeof(h));
+	h.crc32_h = htonl(~crc);
+
+	/* dump new image */
+	write(fdout, &h, sizeof(h));
+	write(fdout, input_file, file_len);
+
+	/* close files */
+	munmap(input_file, file_len);
+	if (fdout != STDOUT_FILENO)
+		close(fdout);
+
+	return EXIT_SUCCESS;
+}


From lede-commits at lists.infradead.org  Thu Jun 10 08:14:22 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 10 Jun 2021 11:14:22 -0400
Subject: [openwrt/openwrt] firmware-utils: fix coverity zytrx.c resource leak
In-Reply-To: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
References: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
Message-ID: <mailman.4760.1623338069.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/27f4559281fb9f6a4d8ec5e054cea7f4c6b77820

commit 27f4559281fb9f6a4d8ec5e054cea7f4c6b77820
Author: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
AuthorDate: Sun May 16 11:46:32 2021 +0100

    firmware-utils: fix coverity zytrx.c resource leak
    
    fix coverity resource leak warning:
    
            *len = stat.st_size;
            mapped = mmap(NULL, stat.st_size, PROT_READ, MAP_SHARED, fd, 0);
            if (close(fd) < 0)
    CID 1484880:  Resource leaks  (RESOURCE_LEAK)
    Variable "mapped" going out of scope leaks the storage it points to.
                    return NULL;
            return mapped;
        }
    
    Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
    (cherry picked from commit baf2a50ef3cf34574e12d2ab1b23578310f0d527)
---
 tools/firmware-utils/src/zytrx.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/firmware-utils/src/zytrx.c b/tools/firmware-utils/src/zytrx.c
index 302efc6010..7167679206 100644
--- a/tools/firmware-utils/src/zytrx.c
+++ b/tools/firmware-utils/src/zytrx.c
@@ -150,8 +150,10 @@ static void *map_input(const char *name, size_t *len)
 	}
 	*len = stat.st_size;
 	mapped = mmap(NULL, stat.st_size, PROT_READ, MAP_SHARED, fd, 0);
-	if (close(fd) < 0)
+	if (close(fd) < 0) {
+		(void) munmap(mapped, stat.st_size);
 		return NULL;
+	}
 	return mapped;
 }
 


From lede-commits at lists.infradead.org  Thu Jun 10 08:14:27 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 10 Jun 2021 11:14:27 -0400
Subject: [openwrt/openwrt]  ramips: add support for JCG Q20
In-Reply-To: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
References: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
Message-ID: <mailman.4761.1623338069.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/9fa5b3afc90b1dc2a69f90897f39a4e593b42b11

commit 9fa5b3afc90b1dc2a69f90897f39a4e593b42b11
Author: Chukun Pan <amadeus at jmu.edu.cn>
AuthorDate: Sun May 16 20:10:05 2021 +0800

    ramips: add support for JCG Q20
    
    JCG Q20 is an AX 1800M router.
    
    Hardware specs:
      SoC: MediaTek MT7621AT
      Flash: Winbond W29N01HV 128 MiB
      RAM: Winbond W632GU6NB-11 256 MiB
      WiFi: MT7915 2.4/5 GHz 2T2R
      Ethernet: 10/100/1000 Mbps x3
      LED: Status (red / blue)
      Button: Reset, WPS
      Power: DC 12V,1A
    
    Flash instructions:
      Upload factory.bin in stock firmware's upgrade page,
      do not preserve settings.
    
    MAC addresses map:
      0x00004 *:3e wlan2g/wlan5g
      0x3fff4 *:3c lan/label
      0x3fffa *:3c wan
    
    Signed-off-by: Chukun Pan <amadeus at jmu.edu.cn>
    (cherry picked from commit 57cb387cfeee2a07902a2f1383ca471ef47265f3)
---
 package/boot/uboot-envtools/files/ramips           |   3 +
 target/linux/ramips/dts/mt7621_jcg_q20.dts         | 175 +++++++++++++++++++++
 target/linux/ramips/image/mt7621.mk                |  17 ++
 .../mt7621/base-files/etc/board.d/02_network       |   1 +
 .../etc/hotplug.d/ieee80211/10_fix_wifi_mac        |   4 +
 .../mt7621/base-files/lib/upgrade/platform.sh      |   1 +
 6 files changed, 201 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips
index c153b6a422..5800a548e3 100644
--- a/package/boot/uboot-envtools/files/ramips
+++ b/package/boot/uboot-envtools/files/ramips
@@ -44,6 +44,9 @@ ravpower,rp-wd03)
 	[ -n "$idx" ] && \
 		ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000"
 	;;
+jcg,q20)
+	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
+	;;
 linksys,ea7300-v1|\
 linksys,ea7300-v2|\
 linksys,ea7500-v2|\
diff --git a/target/linux/ramips/dts/mt7621_jcg_q20.dts b/target/linux/ramips/dts/mt7621_jcg_q20.dts
new file mode 100644
index 0000000000..f0e829393c
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_jcg_q20.dts
@@ -0,0 +1,175 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "jcg,q20", "mediatek,mt7621-soc";
+	model = "JCG Q20";
+
+	aliases {
+		led-boot = &led_status_red;
+		led-failsafe = &led_status_red;
+		led-running = &led_status_blue;
+		led-upgrade = &led_status_blue;
+		label-mac-device = &gmac0;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_status_red: status_red {
+			label = "red:status";
+			gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_status_blue: status_blue {
+			label = "blue:status";
+			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+	};
+
+	ubi-concat {
+		compatible = "mtd-concat";
+		devices = <&ubiconcat0 &ubiconcat1>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "ubi";
+				reg = <0x0 0x5900000>;
+			};
+		};
+	};
+};
+
+&nand {
+	status = "okay";
+
+	partitions {
+		compatible = "fixed-partitions";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition at 0 {
+			label = "Bootloader";
+			reg = <0x0 0x80000>;
+			read-only;
+		};
+
+		partition at 80000 {
+			label = "Config";
+			reg = <0x80000 0x80000>;
+		};
+
+		factory: partition at 100000 {
+			label = "Factory";
+			reg = <0x100000 0x80000>;
+			read-only;
+		};
+
+		partition at 180000 {
+			label = "kernel";
+			reg = <0x180000 0x400000>;
+		};
+
+		ubiconcat0: partition at 580000 {
+			label = "ubiconcat0";
+			reg = <0x580000 0x1c00000>;
+		};
+
+		partition at 2180000 {
+			label = "firmware_backup";
+			reg = <0x2180000 0x2000000>;
+		};
+
+		partition at 4180000 {
+			label = "rootfs_data_back";
+			reg = <0x4180000 0x80000>;
+			read-only;
+		};
+
+		partition at 4200000 {
+			label = "nvram_config";
+			reg = <0x4200000 0x80000>;
+			read-only;
+		};
+
+		ubiconcat1: partition at 4280000 {
+			label = "ubiconcat1";
+			reg = <0x4280000 0x3d00000>;
+		};
+
+		/*
+		 * last 512 KiB are for the bad block table
+		 */
+	};
+};
+
+&pcie {
+	status = "okay";
+};
+
+&pcie1 {
+	wifi at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x0>;
+	};
+};
+
+&gmac0 {
+	mtd-mac-address = <&factory 0x3fff4>;
+};
+
+&switch0 {
+	ports {
+		port at 0 {
+			status = "okay";
+			label = "wan";
+			mtd-mac-address = <&factory 0x3fffa>;
+		};
+
+		port at 1 {
+			status = "okay";
+			label = "lan1";
+		};
+
+		port at 4 {
+			status = "okay";
+			label = "lan2";
+		};
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "jtag", "wdt";
+		function = "gpio";
+	};
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 0ec283d74f..6edf6c0cd6 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -720,6 +720,23 @@ define Device/jcg_jhr-ac876m
 endef
 TARGET_DEVICES += jcg_jhr-ac876m
 
+define Device/jcg_q20
+  $(Device/dsa-migration)
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  UBINIZE_OPTS := -E 5
+  KERNEL_SIZE := 4096k
+  IMAGE_SIZE := 91136k
+  IMAGES += factory.bin
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+  IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
+	check-size
+  DEVICE_VENDOR := JCG
+  DEVICE_MODEL := Q20
+  DEVICE_PACKAGES := kmod-mt7915e uboot-envtools
+endef
+TARGET_DEVICES += jcg_q20
+
 define Device/jcg_y2
   $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
index f017e4782e..f5b075f1f4 100755
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
@@ -15,6 +15,7 @@ ramips_setup_interfaces()
 		;;
 	asiarf,ap7621-nv1|\
 	glinet,gl-mt1300|\
+	jcg,q20|\
 	lenovo,newifi-d1|\
 	mikrotik,routerboard-m33g|\
 	xiaomi,mi-router-3g|\
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 e7f778aaf8..427bde4e38 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
@@ -14,6 +14,10 @@ case "$board" in
 		[ "$PHYNBR" = "1" ] && \
 			macaddr_add "$(mtd_get_mac_binary factory 0x4)" 1 > /sys${DEVPATH}/macaddress
 		;;
+	jcg,q20)
+		[ "$PHYNBR" = "1" ] && \
+			macaddr_setbit_la "$(mtd_get_mac_binary Factory 0x4)" > /sys${DEVPATH}/macaddress
+		;;
 	linksys,ea7300-v1|\
 	linksys,ea7300-v2|\
 	linksys,ea7500-v2)
diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
index d30bc3db2e..98e429fdbf 100755
--- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
@@ -49,6 +49,7 @@ platform_do_upgrade() {
 	dlink,dir-2640-a1|\
 	dlink,dir-2660-a1|\
 	hiwifi,hc5962|\
+	jcg,q20|\
 	linksys,ea7300-v1|\
 	linksys,ea7300-v2|\
 	linksys,ea7500-v2|\


From lede-commits at lists.infradead.org  Thu Jun 10 08:14:25 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 10 Jun 2021 11:14:25 -0400
Subject: [openwrt/openwrt] ramips: add support for TP-Link Archer C6U v1 (EU)
In-Reply-To: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
References: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
Message-ID: <mailman.4762.1623338072.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/31be36126929751ac90ad6ff74a1df32feeb8e21

commit 31be36126929751ac90ad6ff74a1df32feeb8e21
Author: Georgi Vlaev <georgi.vlaev at konsulko.com>
AuthorDate: Fri Jul 31 14:02:21 2020 +0300

    ramips: add support for TP-Link Archer C6U v1 (EU)
    
    This patch adds support for TP-Link Archer C6U v1 (EU).
    The device is also known in some market as Archer C6 v3.
    This patch supports only Archer C6U v1 (EU).
    
    Specifications:
    --------------
    
    * SoC: Mediatek MT7621AT 2C2T, 880MHz
    * RAM: 128MB DDR3
    * Flash: 16MB SPI NOR flash (Winbond 25Q128)
    * WiFi 5GHz: Mediatek MT7613BEN (2x2:2)
    * WiFi 2.4GHz: Mediatek MT7603EN (2x2:2)
    * Ethernet: MT7630, 5x 1000Base-T.
    * LED: Power, WAN, LAN, WiFi 2GHz and 5GHz, USB
    * Buttons: Reset, WPS.
    * UART: Serial console (115200 8n1), J1(GND:3)
    * USB: One USB2 port.
    
    Installation:
    ------------
    
    Install the OpenWrt factory image for C6U is from the
    TP-Link web interface.
    
    1) Go to "Advanced/System Tools/Firmware Update".
    2) Click "Browse" and upload the OpenWrt factory image:
    openwrt-ramips-mt7621-tplink_archer-c6u-v1-squashfs-factory.bin.
    3) Click the "Upgrade" button, and select "Yes" when prompted.
    
    Recovery to stock firmware:
    --------------------------
    
    The C6U bootloader has a failsafe mode that provides a web
    interface (running at 192.168.0.1) for reverting back to the
    stock TP-Link firmware. The failsafe interface is triggered
    from the serial console or on failed kernel boot. Unfortunately,
    there's no key combination that enables the failsafe mode. This
    gives us two options for recovery:
    
    1) Recover using the serial console (J1 header).
    The recovery interface can be selected by hitting 'x' when
    prompted on boot.
    
    2) Trigger the bootloader failsafe mode.
    A more dangerous option is force the bootloader into
    recovery mode by erasing the OpenWrt partition from the
    OpenWrt's shell - e.g "mtd erase firmware". Please be
    careful, since erasing the wrong partition can brick
    your device.
    
    MAC addresses:
    -------------
    
    OEM firmware configuration:
    D8:07:B6:xx:xx:83 : 5G
    D8:07:B6:xx:xx:84 : LAN (label)
    D8:07:B6:xx:xx:84 : 2.4G
    D8:07:B6:xx:xx:85 : WAN
    
    Signed-off-by: Georgi Vlaev <georgi.vlaev at konsulko.com>
    (cherry picked from commit a46ad596a3e076599f38a4132b5d6dfee8a3102a)
---
 .../ramips/dts/mt7621_tplink_archer-c6u-v1.dts     | 213 +++++++++++++++++++++
 target/linux/ramips/image/mt7621.mk                |  14 ++
 .../ramips/mt7621/base-files/etc/board.d/01_leds   |   3 +-
 tools/firmware-utils/src/tplink-safeloader.c       |  35 ++++
 4 files changed, 264 insertions(+), 1 deletion(-)

diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts b/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts
new file mode 100644
index 0000000000..7d38b7b096
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_tplink_archer-c6u-v1.dts
@@ -0,0 +1,213 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "tplink,archer-c6u-v1", "mediatek,mt7621-soc";
+	model = "TP-Link Archer C6U v1";
+
+	aliases {
+		led-boot = &led_power;
+		led-failsafe = &led_power;
+		led-running = &led_power;
+		led-upgrade = &led_power;
+		label-mac-device = &gmac0;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_power: power {
+			label = "green:power";
+			gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
+		};
+
+		usb {
+			label = "green:usb";
+			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+			trigger-sources = <&ehci_port2>;
+			linux,default-trigger = "usbport";
+		};
+
+		wan-orange {
+			label = "orange:wan";
+			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+		};
+
+		lan {
+			label = "green:lan";
+			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+		};
+
+		wifi5g {
+			label = "green:wifi5g";
+			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy1tpt";
+		};
+
+		wifi2g {
+			label = "green:wifi2g";
+			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy0tpt";
+		};
+
+		wan-green {
+			label = "green:wan";
+			gpios = <&gpio 45 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	reg_usb_vbus: regulator {
+		compatible = "regulator-fixed";
+		regulator-name = "usb_vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpio = <&gpio 3 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
+};
+
+&spi0 {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <80000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x000000 0x040000>;
+				read-only;
+			};
+
+			partition at 40000 {
+				compatible = "denx,uimage";
+				label = "firmware";
+				reg = <0x040000 0xf60000>;
+			};
+
+			config: partition at fa0000 {
+				label = "config";
+				reg = <0xfa0000 0x010000>;
+				read-only;
+			};
+
+			partition at fb0000 {
+				label = "tplink";
+				reg = <0xfb0000 0x040000>;
+				read-only;
+			};
+
+			radio: partition at ff0000 {
+				label = "radio";
+				reg = <0xff0000 0x010000>;
+				read-only;
+			};
+		};
+	};
+};
+
+&pcie {
+	status = "okay";
+};
+
+&pcie0 {
+	mt76 at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&radio 0x0>;
+		mtd-mac-address = <&config 0x8>;
+		ieee80211-freq-limit = <2400000 2500000>;
+	};
+};
+
+&pcie1 {
+	mt76 at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&radio 0x8000>;
+		mtd-mac-address = <&config 0x8>;
+		mtd-mac-address-increment = <(-1)>;
+		ieee80211-freq-limit = <5000000 6000000>;
+	};
+};
+
+&ethernet {
+	pinctrl-names = "default";
+	pinctrl-0 = <&rgmii1_pins &mdio_pins>;
+};
+
+&gmac0 {
+	mtd-mac-address = <&config 0x8>;
+};
+
+&switch0 {
+	ports {
+		port at 0 {
+			status = "okay";
+			label = "wan";
+			mtd-mac-address = <&config 0x8>;
+			mtd-mac-address-increment = <1>;
+		};
+
+		port at 1 {
+			status = "okay";
+			label = "lan1";
+		};
+
+		port at 2 {
+			status = "okay";
+			label = "lan2";
+		};
+
+		port at 3 {
+			status = "okay";
+			label = "lan3";
+		};
+
+		port at 4 {
+			status = "okay";
+			label = "lan4";
+		};
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "i2c", "uart2", "uart3", "jtag", "wdt", "sdhci";
+		function = "gpio";
+	};
+};
+
+&xhci {
+	vbus-supply = <&reg_usb_vbus>;
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index ce5adb9a8b..d56067948e 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -1145,6 +1145,20 @@ define Device/tplink_archer-a6-v3
 endef
 TARGET_DEVICES += tplink_archer-a6-v3
 
+define Device/tplink_archer-c6u-v1
+  $(Device/dsa-migration)
+  $(Device/tplink-safeloader)
+  DEVICE_MODEL := Archer C6U
+  DEVICE_VARIANT := v1
+  DEVICE_PACKAGES := kmod-mt7603 \
+	kmod-mt7615e kmod-mt7663-firmware-ap \
+	kmod-usb3 kmod-usb-ledtrig-usbport
+  KERNEL := $(KERNEL_DTB) | uImage lzma
+  TPLINK_BOARD_ID := ARCHER-C6U-V1
+  IMAGE_SIZE := 15744k
+endef
+TARGET_DEVICES += tplink_archer-c6u-v1
+
 define Device/tplink_eap235-wall-v1
   $(Device/dsa-migration)
   $(Device/tplink-safeloader)
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
index 086658bbb6..e3064ad5ff 100755
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
@@ -79,7 +79,8 @@ netgear,r6800)
 	ucidef_set_led_netdev "lan3" "LAN3" "white:lan3" "lan3"
 	ucidef_set_led_netdev "lan4" "LAN4" "white:lan4" "lan4"
 	;;
-tplink,archer-a6-v3)
+tplink,archer-a6-v3|\
+tplink,archer-c6u-v1)
 	ucidef_set_led_netdev "lan" "LAN" "green:lan" "br-lan"
 	ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan"
 	;;
diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c
index 32d3c1d35e..d586b9cbd8 100644
--- a/tools/firmware-utils/src/tplink-safeloader.c
+++ b/tools/firmware-utils/src/tplink-safeloader.c
@@ -1097,6 +1097,40 @@ static struct device_info boards[] = {
 		.first_sysupgrade_partition = "os-image",
 		.last_sysupgrade_partition = "file-system",
 	},
+	/** Firmware layout for the Archer C6U v1 */
+	{
+		.id     = "ARCHER-C6U-V1",
+		.vendor = "",
+		.support_list =
+			"SupportList:\n"
+			"{product_name:Archer C6U,product_ver:1.0.0,special_id:45550000}\n",
+		.part_trail = 0x00,
+		.soft_ver = "soft_ver:1.0.2\n",
+
+		.partitions = {
+			{"fs-uboot", 0x00000, 0x40000},
+			{"firmware", 0x40000, 0xf60000},
+			{"default-mac", 0xfa0000, 0x00200},
+			{"pin", 0xfa0200, 0x00100},
+			{"device-id", 0xfa0300, 0x00100},
+			{"product-info", 0xfa0400, 0x0fc00},
+			{"default-config", 0xfb0000, 0x08000},
+			{"ap-def-config", 0xfb8000, 0x08000},
+			{"user-config", 0xfc0000, 0x0c000},
+			{"certificate", 0xfcc000, 0x04000},
+			{"ap-config", 0xfd0000, 0x08000},
+			{"router-config", 0xfd8000, 0x08000},
+			{"partition-table", 0xfe0000, 0x00800},
+			{"soft-version", 0xfe0800, 0x00100},
+			{"support-list", 0xfe0900, 0x00200},
+			{"profile", 0xfe0b00, 0x03000},
+			{"extra-para", 0xfe3b00, 0x00100},
+			{"radio", 0xff0000, 0x10000},
+			{NULL, 0, 0}
+		},
+		.first_sysupgrade_partition = "os-image",
+		.last_sysupgrade_partition = "file-system",
+	},
 	/** Firmware layout for the C60v1 */
 	{
 		.id     = "ARCHER-C60-V1",
@@ -2870,6 +2904,7 @@ static void build_image(const char *output,
 	    strcasecmp(info->id, "ARCHER-C59-V2") == 0 ||
 	    strcasecmp(info->id, "ARCHER-C60-V2") == 0 ||
 	    strcasecmp(info->id, "ARCHER-C60-V3") == 0 ||
+	    strcasecmp(info->id, "ARCHER-C6U-V1") == 0 ||
 	    strcasecmp(info->id, "TLWR1043NV5") == 0) {
 		const uint8_t extra_para[2] = {0x01, 0x00};
 		parts[5] = make_extra_para(info, extra_para,


From lede-commits at lists.infradead.org  Thu Jun 10 08:14:24 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 10 Jun 2021 11:14:24 -0400
Subject: [openwrt/openwrt]  ramips: add support for TP-Link Archer A6 v3
In-Reply-To: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
References: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
Message-ID: <mailman.4763.1623338072.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/30915e5a70ccb3b1f5f562a0f45ef49edf81194d

commit 30915e5a70ccb3b1f5f562a0f45ef49edf81194d
Author: Vinay Patil <post2vinay at gmail.com>
AuthorDate: Mon Apr 19 06:52:51 2021 +0530

    ramips: add support for TP-Link Archer A6 v3
    
    The patch adds support for the TP-Link Archer A6 v3
    The router is sold in US and India with FCC ID TE7A6V3
    
    Specification
    -------------
    MediaTek MT7621 SOC
    RAM:         128MB DDR3
    SPI Flash:   W25Q128 (16MB)
    Ethernet:    MT7530 5x 1000Base-T
    WiFi 5GHz:   Mediatek MT7613BE
    WiFi 2.4GHz: Mediatek MT7603E
    UART/Serial: 115200 8n1
    
    Device Configuration & Serial Port Pins
    ---------------------------------------
    ETH Ports:    LAN4 LAN3 LAN2 LAN1 WAN
                 _______________________
                 |                     |
    Serial Pins: |   VCC GND TXD RXD   |
                 |_____________________|
    
    LEDs:         Power Wifi2G Wifi5G LAN WAN
    
    Build Output
    ------------
    The build will generate following set of files
    [1] openwrt-ramips-mt7621-tplink_archer-a6-v3-initramfs-kernel.bin
    [2] openwrt-ramips-mt7621-tplink_archer-a6-v3-squashfs-factory.bin
    [3] openwrt-ramips-mt7621-tplink_archer-a6-v3-squashfs-sysupgrade.bin
    
    How to Use - Flashing from TP-Link Web Interface
    ------------------------------------------------
    * Go to "Advanced/System Tools/Firmware Update".
    * Click "Browse" and upload the OpenWrt factory image: factory.bin[2]
    * Click the "Upgrade" button, and select "Yes" when prompted.
    
    TFTP Booting
    ------------
    Setup a TFTP boot server with address 192.168.0.5.
    While starting U-boot press '4' key to stop autoboot.
    Copy the initramfs-kernel.bin[1] to TFTP server folder, rename as test.bin
    From u-boot command prompt run tftpboot followed by bootm.
    
    Recovery
    --------
    Archer A6 V3 has recovery page activated if SPI booting from flash fails.
    Recovery page can be activated from serial console only.
    Press 'x' while u-boot is starting
    Note: TFTP boot can be activated only from u-boot serial console.
    Device recovery address: 192.168.0.1
    
    Thanks to: Frankis for Randmon MAC address fix.
    
    Signed-off-by: Vinay Patil <post2vinay at gmail.com>
    [remove superfluous factory image definition, whitespacing]
    Signed-off-by: David Bauer <mail at david-bauer.net>
    
    (cherry picked from commit f8f8935adb2be1ebce46a8d7058c76a8d3a9bd89)
---
 .../ramips/dts/mt7621_tplink_archer-a6-v3.dts      | 188 +++++++++++++++++++++
 target/linux/ramips/image/mt7621.mk                |  13 ++
 .../ramips/mt7621/base-files/etc/board.d/01_leds   |   4 +
 tools/firmware-utils/src/tplink-safeloader.c       |  40 ++++-
 4 files changed, 244 insertions(+), 1 deletion(-)

diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-a6-v3.dts b/target/linux/ramips/dts/mt7621_tplink_archer-a6-v3.dts
new file mode 100644
index 0000000000..46cb365da7
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_tplink_archer-a6-v3.dts
@@ -0,0 +1,188 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "tplink,archer-a6-v3", "mediatek,mt7621-soc";
+	model = "TP-Link Archer A6 v3";
+
+	aliases {
+		label-mac-device = &gmac0;
+		led-boot = &led_power;
+		led-failsafe = &led_power;
+		led-running = &led_power;
+		led-upgrade = &led_power;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200n8";
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		wps {
+			label = "wps";
+			gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
+			debounce-interval = <60>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+
+		reset {
+			label = "reset";
+			gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
+			debounce-interval = <60>;
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_power: power {
+			label = "green:power";
+			gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
+		};
+
+		wan_orange {
+			label = "orange:wan";
+			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+		};
+
+		lan {
+			label = "green:lan";
+			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+		};
+
+		wifi5g {
+			label = "green:wifi5g";
+			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy1tpt";
+		};
+
+		wifi2g {
+			label = "green:wifi2g";
+			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy0tpt";
+		};
+
+		wan_green {
+			label = "green:wan";
+			gpios = <&gpio 45 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&spi0 {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <40000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x0 0x40000>;
+				read-only;
+			};
+
+			partition at 40000 {
+				label = "firmware";
+				compatible = "denx,uimage";
+				reg = <0x40000 0xf60000>;
+			};
+
+			config: partition at fa0000 {
+				label = "config";
+				reg = <0xfa0000 0x50000>;
+				read-only;
+			};
+
+			radio: partition at ff0000 {
+				label = "radio";
+				reg = <0xff0000 0x10000>;
+				read-only;
+			};
+		};
+	};
+};
+
+&state_default {
+	gpio {
+		groups =  "i2c", "uart2", "uart3", "jtag", "wdt";
+		function = "gpio";
+	};
+};
+
+&ethernet {
+	pinctrl-names = "default";
+	pinctrl-0 = <&rgmii1_pins &mdio_pins>;
+};
+
+&pcie {
+	status = "okay";
+};
+
+&pcie0 {
+	wifi at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&radio 0x0>;
+		mtd-mac-address = <&config 0x8>;
+		mtd-mac-address-increment = <1>;
+		ieee80211-freq-limit = <2400000 2500000>;
+	};
+};
+
+&pcie1 {
+	wifi at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&radio 0x8000>;
+		mtd-mac-address = <&config 0x8>;
+		mtd-mac-address-increment = <2>;
+		ieee80211-freq-limit = <5000000 6000000>;
+	};
+};
+
+&gmac0 {
+	mtd-mac-address = <&config 0x8>;
+};
+
+&switch0 {
+	ports {
+		port at 0 {
+			status = "okay";
+			label = "wan";
+		};
+
+		port at 1 {
+			status = "okay";
+			label = "lan1";
+		};
+
+		port at 2 {
+			status = "okay";
+			label = "lan2";
+		};
+
+		port at 3 {
+			status = "okay";
+			label = "lan3";
+		};
+
+		port at 4 {
+			status = "okay";
+			label = "lan4";
+		};
+	};
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index a7f6c80f40..ce5adb9a8b 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -1132,6 +1132,19 @@ define Device/totolink_x5000r
 endef
 TARGET_DEVICES += totolink_x5000r
 
+define Device/tplink_archer-a6-v3
+  $(Device/dsa-migration)
+  $(Device/tplink-safeloader)
+  DEVICE_MODEL := Archer A6
+  DEVICE_VARIANT := V3
+  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e \
+	kmod-mt7663-firmware-ap kmod-mt7663-firmware-sta
+  TPLINK_BOARD_ID := ARCHER-A6-V3
+  KERNEL := $(KERNEL_DTB) | uImage lzma
+  IMAGE_SIZE := 15744k
+endef
+TARGET_DEVICES += tplink_archer-a6-v3
+
 define Device/tplink_eap235-wall-v1
   $(Device/dsa-migration)
   $(Device/tplink-safeloader)
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
index 5fa9ad3fe8..086658bbb6 100755
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
@@ -79,6 +79,10 @@ netgear,r6800)
 	ucidef_set_led_netdev "lan3" "LAN3" "white:lan3" "lan3"
 	ucidef_set_led_netdev "lan4" "LAN4" "white:lan4" "lan4"
 	;;
+tplink,archer-a6-v3)
+	ucidef_set_led_netdev "lan" "LAN" "green:lan" "br-lan"
+	ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan"
+	;;
 tplink,re350-v1)
 	ucidef_set_led_netdev "wifi2g" "Wifi 2.4G" "blue:wifi2G" "wlan0"
 	ucidef_set_led_netdev "wifi5g" "Wifi 5G" "blue:wifi5G" "wlan1"
diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c
index 90027221b6..32d3c1d35e 100644
--- a/tools/firmware-utils/src/tplink-safeloader.c
+++ b/tools/firmware-utils/src/tplink-safeloader.c
@@ -1059,7 +1059,44 @@ static struct device_info boards[] = {
 		.first_sysupgrade_partition = "os-image",
 		.last_sysupgrade_partition = "file-system",
 	},
+	/** Firmware layout for the Archer A6 v3  */
+	{
+		.id     = "ARCHER-A6-V3",
+		.vendor = "",
+		.support_list =
+			"SupportList:\n"
+			"{product_name:Archer A6,product_ver:3.0.0,special_id:55530000}\n"
+			"{product_name:Archer A6,product_ver:3.0.0,special_id:54570000}\n",
+		.part_trail = 0x00,
+		.soft_ver = "soft_ver:1.0.5\n",
 
+		.partitions = {
+			{"fs-uboot", 0x00000, 0x40000},
+			{"firmware", 0x40000, 0xf60000},
+			{"default-mac", 0xfa0000, 0x00200},
+			{"pin", 0xfa0200, 0x00100},
+			{"device-id", 0xfa0300, 0x00100},
+			{"product-info", 0xfa0400, 0x0fc00},
+			{"default-config", 0xfb0000, 0x08000},
+			{"ap-def-config", 0xfb8000, 0x08000},
+			{"user-config", 0xfc0000, 0x0a000},
+			{"ag-config", 0xfca000, 0x04000},
+			{"certificate", 0xfce000, 0x02000},
+			{"ap-config", 0xfd0000, 0x06000},
+			{"router-config", 0xfd6000, 0x06000},
+			{"favicon", 0xfdc000, 0x02000},
+			{"logo", 0xfde000, 0x02000},
+			{"partition-table", 0xfe0000, 0x00800},
+			{"soft-version", 0xfe0800, 0x00100},
+			{"support-list", 0xfe0900, 0x00200},
+			{"profile", 0xfe0b00, 0x03000},
+			{"extra-para", 0xfe3b00, 0x00100},
+			{"radio", 0xff0000, 0x10000},
+			{NULL, 0, 0}
+		},
+		.first_sysupgrade_partition = "os-image",
+		.last_sysupgrade_partition = "file-system",
+	},
 	/** Firmware layout for the C60v1 */
 	{
 		.id     = "ARCHER-C60-V1",
@@ -2824,7 +2861,8 @@ static void build_image(const char *output,
 	parts[4] = read_file("file-system", rootfs_image, add_jffs2_eof, file_system_partition);
 
 	/* Some devices need the extra-para partition to accept the firmware */
-	if (strcasecmp(info->id, "ARCHER-A7-V5") == 0 ||
+	if (strcasecmp(info->id, "ARCHER-A6-V3") == 0 ||
+	    strcasecmp(info->id, "ARCHER-A7-V5") == 0 ||
 	    strcasecmp(info->id, "ARCHER-C2-V3") == 0 ||
 	    strcasecmp(info->id, "ARCHER-C7-V4") == 0 ||
 	    strcasecmp(info->id, "ARCHER-C7-V5") == 0 ||


From lede-commits at lists.infradead.org  Thu Jun 10 08:14:23 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 10 Jun 2021 11:14:23 -0400
Subject: [openwrt/openwrt]  ramips: mt7621: Add support for ZyXEL NR7101
In-Reply-To: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
References: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
Message-ID: <mailman.4766.1623338072.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/8c986d2ab96a29f11dbf6ff259a6e4712037ed3b

commit 8c986d2ab96a29f11dbf6ff259a6e4712037ed3b
Author: Bj?rn Mork <bjorn at mork.no>
AuthorDate: Mon Apr 19 13:00:56 2021 +0200

    ramips: mt7621: Add support for ZyXEL NR7101
    
    The ZyXEL NR7101 is an 802.3at PoE powered 5G outdoor (IP68) CPE
    with integrated directional 5G/LTE antennas.
    
    Specifications:
    
     - SoC: MediaTek MT7621AT
     - RAM: 256 MB
     - Flash: 128 MB MB NAND (MX30LF1G18AC)
     - WiFi: MediaTek MT7603E
     - Switch: 1 LAN port (Gigabiti)
     - 5G/LTE: Quectel RG502Q-EA connected by USB3 to SoC
     - SIM: 2 micro-SIM slots under transparent cover
     - Buttons: Reset, WLAN under same cover
     - LEDs: Multicolour green/red/yellow under same cover (visible)
     - Power: 802.3at PoE via LAN port
    
    The device is built as an outdoor ethernet to 5G/LTE bridge or
    router. The Wifi interface is intended for installation and/or
    temporary management purposes only.
    
    UART Serial:
    
    57600N1
    Located on populated 5 pin header J5:
    
     [o] GND
     [ ] key - no pin
     [o] RX
     [o] TX
     [o] 3.3V Vcc
    
    Remove the SIM/button/LED cover, the WLAN button and 12 screws
    holding the back plate and antenna cover together. The GPS antenna
    is fixed to the cover, so be careful with the cable.  Remove 4
    screws fixing the antenna board to the main board, again being
    careful with the cables.
    
    A bluetooth TTL adapter is recommended for permanent console
    access, to keep the router water and dustproof. The 3.3V pin is
    able to power such an adapter.
    
    MAC addresses:
    
    OpenWrt OEM   Address          Found as
    lan     eth2  08:26:97:*:*:BC  Factory 0xe000 (hex), label
    wlan0   ra0   08:26:97:*:*:BD  Factory 0x4 (hex)
    wwan0   usb0  random
    
    WARNING!!
    
    ISP managed firmware might at any time update itself to a version
    where all known workarounds have been disabled.  Never boot an ISP
    managed firmware with a SIM in any of the slots if you intend to use
    the router with OpenWrt. The bootloader lock can only be disabled with
    root access to running firmware. The flash chip is physically
    inaccessible without soldering.
    
    Installation from OEM web GUI:
    
    - Log in as "supervisor" on https://172.17.1.1/
    - Upload OpenWrt initramfs-recovery.bin image on the
      Maintenance -> Firmware page
    - Wait for OpenWrt to boot and ssh to root at 192.168.1.1
    - (optional) Copy OpenWrt to the recovery partition. See below
    - Sysupgrade to the OpenWrt sysupgrade image and reboot
    
    Installation from OEM ssh:
    
    - Log in as "root" on 172.17.1.1 port 22022
    - scp OpenWrt initramfs-recovery.bin image to 172.17.1.1:/tmp
    - Prepare bootloader config by running:
        nvram setro uboot DebugFlag 0x1
        nvram setro uboot CheckBypass 0
        nvram commit
    - Run "mtd_write -w write initramfs-recovery.bin Kernel" and reboot
    - Wait for OpenWrt to boot and ssh to root at 192.168.1.1
    - (optional) Copy OpenWrt to the recovery partition. See below
    - Sysupgrade to the OpenWrt sysupgrade image and reboot
    
    Copying OpenWrt to the recovery partition:
    
    - Verify that you are running a working OpenWrt recovery image
      from flash
    - ssh to root at 192.168.1.1 and run:
        fw_setenv CheckBypass 0
        mtd -r erase Kernel2
    - Wait while the bootloader mirrors Image1 to Image2
    
    NOTE: This should only be done after successfully booting the OpenWrt
      recovery image from the primary partition during installation.  Do
      not do this after having sysupgraded OpenWrt!  Reinstalling the
      recovery image on normal upgrades is not required or recommended.
    
    Installation from Z-Loader:
    
    - Halt boot by pressing Escape on console
    - Set up a tftp server to serve the OpenWrt initramfs-recovery.bin
      image at 10.10.10.3
    - Type "ATNR 1,initramfs-recovery.bin" at the "ZLB>" prompt
    - Wait for OpenWrt to boot and ssh to root at 192.168.1.1
    - Sysupgrade to the OpenWrt sysupgrade image
    
    NOTE: ATNR will write the recovery image to both primary and recovery
      partitions in one go.
    
    Booting from RAM:
    
    - Halt boot by pressing Escape on console
    - Type "ATGU" at the "ZLB>" prompt to enter the U-Boot menu
    - Press "4" to select "4: Entr boot command line interface."
    - Set up a tftp server to serve the OpenWrt initramfs-recovery.bin
      image at 10.10.10.3
    - Load it using "tftpboot 0x88000000 initramfs-recovery.bin"
    - Boot with "bootm  0x8800017C" to skip the 380 (0x17C) bytes ZyXEL
      header
    
    This method can also be used to RAM boot OEM firmware. The warning
    regarding OEM applies!  Never boot an unknown OEM firmware, or any OEM
    firmware with a SIM in any slot.
    
    NOTE: U-Boot configuration is incomplete (on some devices?). You may
      have to configure a working mac address before running tftp using
       "setenv eth0addr <mac>"
    
    Unlocking the bootloader:
    
    If you are unebale to halt boot, then the bootloader is locked.
    
    The OEM firmware locks the bootloader on every boot by setting
    DebugFlag to 0.  Setting it to 1 is therefore only temporary
    when OEM firmware is installed.
    
    - Run "nvram setro uboot DebugFlag 0x1; nvram commit" in OEM firmware
    - Run "fw_setenv DebugFlag 0x1" in OpenWrt
    
      NOTE:
        OpenWrt does this automatically on first boot if necessary
    
      NOTE2:
        Setting the flag to 0x1 avoids the reset to 0 in known OEM
        versions, but this might change.
    
      WARNING:
        Writing anything to flash while the bootloader is locked is
        considered extremely risky. Errors might cause a permanent
        brick!
    
    Enabling management access from LAN:
    
    Temporary workaround to allow installing OpenWrt if OEM firmware
    has disabled LAN management:
    
    - Connect to console
    - Log in as "root"
    - Run "iptables -I INPUT -i br0 -j ACCEPT"
    
    Notes on the OEM/bootloader dual partition scheme
    
    The dual partition scheme on this device uses Image2 as a recovery
    image only. The device will always boot from Image1, but the
    bootloader might copy Image2 to Image1 under specific conditions. This
    scheme prevents repurposing of the space occupied by Image2 in any
    useful way.
    
    Validation of primary and recovery images is controlled by the
    variables CheckBypass, Image1Stable, and Image1Try.
    
    The bootloader sets CheckBypass to 0 and reboots if Image1 fails
    validation.
    
    If CheckBypass is 0 and Image1 is invalid then Image2 is copied to
    Image1.
    
    If CheckBypass is 0 and Image2 is invalid, then Image1 is copied to
    Image2.
    
    If CheckBypass is 1 then all tests are skipped and Image1 is booted
    unconditionally.  CheckBypass is set to 1 after each successful
    validation of Image1.
    
    Image1Try is incremented if Image1Stable is 0, and Image2 is copied to
    Image1 if Image1Try is 3 or larger.  But the bootloader only tests
    Image1Try if CheckBypass is 0, which is impossible unless the booted
    image sets it to 0 before failing.
    
    The system is therefore not resilient against runtime errors like
    failure to mount the rootfs, unless the kernel image sets CheckBypass
    to 0 before failing. This is not yet implemented in OpenWrt.
    
    Setting Image1Stable to 1 prevents the bootloader from updating
    Image1Try on every boot, saving unnecessary writes to the environment
    partition.
    
    Keeping an OpenWrt initramfs recovery as Image2 is recommended
    primarily to avoid unwanted OEM firmware boots on failure. Ref the
    warning above. It enables console-less recovery in case of some
    failures to boot from Image1.
    
    Signed-off-by: Bj?rn Mork <bjorn at mork.no>
    Tested-by: Bj?rn Mork <bjorn at mork.no>
    (cherry picked from commit 2449a632084b29632605e5a79ce5d73028eb15dd)
---
 package/boot/uboot-envtools/files/ramips           |   5 +
 target/linux/ramips/dts/mt7621_zyxel_nr7101.dts    | 164 +++++++++++++++++++++
 target/linux/ramips/image/mt7621.mk                |  22 +++
 .../mt7621/base-files/etc/board.d/02_network       |   3 +
 .../mt7621/base-files/etc/board.d/03_gpio_switches |   3 +
 .../ramips/mt7621/base-files/etc/init.d/bootcount  |   5 +
 .../mt7621/base-files/lib/upgrade/platform.sh      |   6 +
 7 files changed, 208 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips
index a47e2950d3..c153b6a422 100644
--- a/package/boot/uboot-envtools/files/ramips
+++ b/package/boot/uboot-envtools/files/ramips
@@ -54,6 +54,11 @@ xiaomi,mi-router-ac2100|\
 xiaomi,redmi-router-ac2100)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
 	;;
+zyxel,nr7101)
+	idx="$(find_mtd_index Config)"
+	[ -n "$idx" ] && \
+		ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
+	;;
 esac
 
 config_load ubootenv
diff --git a/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts b/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts
new file mode 100644
index 0000000000..f6a42286f1
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_zyxel_nr7101.dts
@@ -0,0 +1,164 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "zyxel,nr7101", "mediatek,mt7621-soc";
+	model = "ZyXEL NR7101";
+
+	aliases {
+		led-boot = &power;
+		led-failsafe = &power;
+		led-running = &power;
+		led-upgrade = &power;
+		label-mac-device = &gmac0;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led at 13 {
+			label = "yellow:system";
+			gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
+		};
+
+		power: led at 14 {
+			label = "green:system";
+			gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
+		};
+
+		led at 15 {
+			label = "red:system";
+			gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
+		};
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		wps {
+			label = "wlan";
+			gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_WLAN>;
+		};
+
+		reset {
+			label = "reset";
+			gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+	};
+};
+
+&gpio {
+	lte_pwrkey {
+		gpio-hog;
+		gpios = <4 GPIO_ACTIVE_HIGH>;
+		output-high;
+		line-name = "lte-pwrkey";
+	};
+
+	lte_power {
+		gpio-hog;
+		gpios = <18 GPIO_ACTIVE_HIGH>;
+		output-high;
+		line-name = "lte-power";
+	};
+};
+
+&nand {
+	status = "okay";
+
+	partitions {
+		compatible = "fixed-partitions";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition at 0 {
+			label = "Bootloader";
+			reg = <0x0 0x80000>;
+			read-only;
+		};
+
+		partition at 80000 {
+			label = "Config";
+			reg = <0x80000 0x80000>;
+		};
+
+		factory: partition at 100000 {
+			label = "Factory";
+			reg = <0x100000 0x40000>;
+			read-only;
+		};
+
+		partition at 140000 {
+			label = "Kernel";
+			reg = <0x140000 0x1ec0000>;
+		};
+
+		partition at 540000 {
+			label = "ubi";
+			reg = <0x540000 0x1ac0000>;
+		};
+
+		partition at 2140000 {
+			label = "Kernel2";
+			reg = <0x2140000 0x1ec0000>;
+		};
+
+		partition at 4000000 {
+			label = "wwan";
+			reg = <0x4000000 0x100000>;
+		};
+
+		partition at 4100000 {
+			label = "data";
+			reg = <0x4100000 0x1000000>;
+		};
+
+		partition at 5100000 {
+			label = "rom-d";
+			reg = <0x5100000 0x100000>;
+			read-only;
+		};
+
+		partition at 5200000 {
+			label = "reserve";
+			reg = <0x5200000 0x80000>;
+		};
+	};
+};
+
+&pcie {
+	status = "okay";
+};
+
+&pcie0 {
+	mt76 at 0,0 {
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x0>;
+	};
+};
+
+&gmac0 {
+	mtd-mac-address = <&factory 0xe000>;
+};
+
+&switch0 {
+	ports {
+		port at 2 {
+			status = "okay";
+			label = "lan";
+		};
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "i2c", "rgmii2", "uart3", "jtag", "wdt";
+		function = "gpio";
+	};
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index a8f558326d..a7f6c80f40 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -79,6 +79,13 @@ define Build/ubnt-erx-factory-image
 	fi
 endef
 
+define Build/zytrx-header
+	$(eval board=$(word 1,$(1)))
+	$(eval version=$(word 2,$(1)))
+	$(STAGING_DIR_HOST)/bin/zytrx -B '$(board)' -v '$(version)' -i $@ -o $@.new
+	mv $@.new $@
+endef
+
 define Device/dsa-migration
   DEVICE_COMPAT_VERSION := 1.1
   DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA
@@ -1504,6 +1511,21 @@ define Device/zio_freezio
 endef
 TARGET_DEVICES += zio_freezio
 
+define Device/zyxel_nr7101
+  $(Device/dsa-migration)
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  UBINIZE_OPTS := -E 5
+  DEVICE_VENDOR := ZyXEL
+  DEVICE_MODEL := NR7101
+  DEVICE_PACKAGES := kmod-mt7603 kmod-usb3 uboot-envtools kmod-usb-net-qmi-wwan kmod-usb-serial-option uqmi
+  KERNEL := $(KERNEL_DTB) | uImage lzma | zytrx-header $$(DEVICE_MODEL) $$(VERSION_DIST)-$$(REVISION)
+  KERNEL_INITRAMFS := $(KERNEL_DTB) | uImage lzma | zytrx-header $$(DEVICE_MODEL) 9.99(ABUV.9)$$(VERSION_DIST)-recovery
+  KERNEL_INITRAMFS_SUFFIX := -recovery.bin
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+endef
+TARGET_DEVICES += zyxel_nr7101
+
 define Device/zyxel_wap6805
   $(Device/dsa-migration)
   BLOCKSIZE := 128k
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
index 89e679be7c..f017e4782e 100755
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
@@ -64,6 +64,9 @@ ramips_setup_interfaces()
 	ubnt,edgerouter-x-sfp)
 		ucidef_set_interfaces_lan_wan "eth1 eth2 eth3 eth4 eth5" "eth0"
 		;;
+	zyxel,nr7101)
+		ucidef_set_interfaces_lan_wan "lan" "wan"
+		;;
 	zyxel,wap6805)
 		ucidef_set_interface_lan "lan1 lan2 lan3 lan4"
 		ucidef_set_interface "qtn" ifname "eth1" protocol "static" ipaddr "1.1.1.1" netmask "255.255.255.0"
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches b/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches
index 82bbdd24f6..8ef815634f 100755
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/03_gpio_switches
@@ -23,6 +23,9 @@ ubnt,edgerouter-x-sfp)
 	ucidef_add_gpio_switch "poe_power_port3" "PoE Power Port3" "403"
 	ucidef_add_gpio_switch "poe_power_port4" "PoE Power Port4" "404"
 	;;
+zyxel,nr7101)
+	ucidef_add_gpio_switch "lte_reset" "Reset LTE/5G modem" "483"
+	;;
 zyxel,wap6805)
 	ucidef_add_gpio_switch "qtn_power" "Quantenna Module Power" "496" "1"
 	;;
diff --git a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
index 7ef0053e67..a155458d3f 100755
--- a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
+++ b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
@@ -16,5 +16,10 @@ boot() {
 	samknows,whitebox-v8)
 		fw_setenv bootcount 0
 		;;
+	zyxel,nr7101)
+		[ $(printf %d $(fw_printenv -n DebugFlag)) -gt 0 ] || fw_setenv DebugFlag 0x1
+		[ $(printf %d $(fw_printenv -n Image1Stable)) -gt 0 ] || fw_setenv Image1Stable 1
+		[ $(printf %d $(fw_printenv -n Image1Try)) -gt 0 ] && fw_setenv Image1Try 0
+		;;
 	esac
 }
diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
index c9152c5cf4..d30bc3db2e 100755
--- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
@@ -82,6 +82,12 @@ platform_do_upgrade() {
 	ubnt,edgerouter-x-sfp)
 		platform_upgrade_ubnt_erx "$1"
 		;;
+	zyxel,nr7101)
+		fw_setenv CheckBypass 0
+		fw_setenv Image1Stable 0
+		CI_KERNPART="Kernel"
+		nand_do_upgrade "$1"
+		;;
 	zyxel,wap6805)
 		local kernel2_mtd="$(find_mtd_part Kernel2)"
 		[ "$(hexdump -n 4 -e '"%x"' $kernel2_mtd)" = "56190527" ] &&\


From lede-commits at lists.infradead.org  Thu Jun 10 08:14:26 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 10 Jun 2021 11:14:26 -0400
Subject: [openwrt/openwrt]  ramips: add support for cudy WR2100
In-Reply-To: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
References: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
Message-ID: <mailman.4767.1623338072.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/d11f40a0f75bddb1339c6a0423553080acaeb75e

commit d11f40a0f75bddb1339c6a0423553080acaeb75e
Author: Leon M. George <leon at georgemail.eu>
AuthorDate: Thu Dec 24 11:32:47 2020 +0100

    ramips: add support for cudy WR2100
    
    Specifications
    
      SoC:       MT7621
      CPU:       880 MHz
      Flash:     16 MiB
      RAM:       128 MiB
      WLAN:      2.4 GHz b/g/n, 5 GHz a/n/ac
                 MT7603E / MT7615E
      Ethernet:  5x Gbit ports
    
    Installation
    
    There are two known options:
    1) The Luci-based UI.
    2) Press and hold the reset button during power up.
       The router will request 'recovery.bin' from a TFTP server at
       192.168.1.88.
    
    Both options require a signed firmware binary.
    The openwrt image supplied by cudy is signed and can be used to
    install unsigned images.
    
    R4 & R5 need to be shorted (0-100?) for the UART to work.
    
    Signed-off-by: Leon M. George <leon at georgemail.eu>
    [remove non-required switch-port node - remove trgmii phy-mode]
    Signed-off-by: David Bauer <mail at david-bauer.net>
    (cherry picked from commit 3501db9b9b4a71ae52c539b46af817783c327866)
---
 target/linux/ramips/dts/mt7621_cudy_wr2100.dts     | 201 +++++++++++++++++++++
 target/linux/ramips/image/mt7621.mk                |  10 +
 .../ramips/mt7621/base-files/etc/board.d/01_leds   |   7 +
 3 files changed, 218 insertions(+)

diff --git a/target/linux/ramips/dts/mt7621_cudy_wr2100.dts b/target/linux/ramips/dts/mt7621_cudy_wr2100.dts
new file mode 100644
index 0000000000..692c94da55
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_cudy_wr2100.dts
@@ -0,0 +1,201 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "cudy,wr2100", "mediatek,mt7621-soc";
+	model = "Cudy WR2100";
+
+	aliases {
+		led-boot = &led_internet_blue;
+		led-failsafe = &led_internet_blue;
+		led-running = &led_internet_blue;
+		led-upgrade = &led_internet_blue;
+		label-mac-device = &gmac0;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_internet_blue: internet_blue {
+			label = "blue:internet";
+			gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
+		};
+
+		internet_red {
+			label = "red:internet";
+			gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
+		};
+
+		wan {
+			label = "green:wan";
+			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+		};
+
+		lan1 {
+			label = "green:lan1";
+			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+		};
+
+		lan2 {
+			label = "green:lan2";
+			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
+		};
+
+		lan3 {
+			label = "green:lan3";
+			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+		};
+
+		lan4 {
+			label = "green:lan4";
+			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&gmac0 {
+	mtd-mac-address = <&bdinfo 0xde00>;
+};
+
+&pcie {
+	status = "okay";
+};
+
+&pcie0 {
+	wifi at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x0000>;
+		ieee80211-freq-limit = <2400000 2500000>;
+	};
+};
+
+&pcie1 {
+	wifi at 1,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x8000>;
+		ieee80211-freq-limit = <5000000 6000000>;
+	};
+};
+
+&spi0 {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <50000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x0 0x30000>;
+				read-only;
+			};
+
+			partition at 30000 {
+				label = "u-boot-env";
+				reg = <0x30000 0x10000>;
+				read-only;
+			};
+
+			factory: partition at 40000 {
+				label = "factory";
+				reg = <0x40000 0x10000>;
+				read-only;
+			};
+
+			partition at 50000 {
+				compatible = "denx,uimage";
+				label = "firmware";
+				reg = <0x50000 0xf80000>;
+			};
+
+			partition at fd0000 {
+				label = "debug";
+				reg = <0xfd0000 0x10000>;
+				read-only;
+			};
+
+			partition at fe0000 {
+				label = "backup";
+				reg = <0xfe0000 0x10000>;
+				read-only;
+			};
+
+			bdinfo: partition at ff0000 {
+				label = "bdinfo";
+				reg = <0xff0000 0x10000>;
+				read-only;
+			};
+		};
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "i2c", "jtag", "uart2", "uart3", "wdt";
+		function = "gpio";
+	};
+};
+
+&switch0 {
+	ports {
+		port at 0 {
+			status = "okay";
+			label = "lan1";
+		};
+
+		port at 1 {
+			status = "okay";
+			label = "lan2";
+		};
+
+		port at 2 {
+			status = "okay";
+			label = "lan3";
+		};
+
+		port at 3 {
+			status = "okay";
+			label = "lan4";
+		};
+
+		port at 4 {
+			status = "okay";
+			label = "wan";
+
+			mtd-mac-address = <&bdinfo 0xde00>;
+			mtd-mac-address-increment = <1>;
+		};
+	};
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index d56067948e..0ec283d74f 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -240,6 +240,16 @@ define Device/cudy_wr1300
 endef
 TARGET_DEVICES += cudy_wr1300
 
+define Device/cudy_wr2100
+  $(Device/dsa-migration)
+  DEVICE_VENDOR := Cudy
+  DEVICE_MODEL := WR2100
+  IMAGE_SIZE := 15872k
+  UIMAGE_NAME := R11
+  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7615-firmware
+endef
+TARGET_DEVICES += cudy_wr2100
+
 define Device/dlink_dir-8xx-a1
   $(Device/dsa-migration)
   IMAGE_SIZE := 16000k
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
index e3064ad5ff..2e280442bf 100755
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
@@ -12,6 +12,13 @@ asus,rt-n56u-b1)
 	ucidef_set_led_netdev "lan" "LAN link" "blue:lan" "br-lan"
 	ucidef_set_led_netdev "wan" "WAN link" "blue:wan" "wan"
 	;;
+cudy,wr2100)
+	ucidef_set_led_netdev "lan1" "lan1" "green:lan1" "lan1"
+	ucidef_set_led_netdev "lan2" "lan2" "green:lan2" "lan2"
+	ucidef_set_led_netdev "lan3" "lan3" "green:lan3" "lan3"
+	ucidef_set_led_netdev "lan4" "lan4" "green:lan4" "lan4"
+	ucidef_set_led_netdev "wan" "wan" "green:wan" "wan"
+	;;
 d-team,newifi-d2)
 	ucidef_set_led_netdev "internet" "internet" "amber:internet" "wan"
 	ucidef_set_led_netdev "wlan2g" "WiFi 2.4GHz" "blue:wlan2g" "wlan0"


From lede-commits at lists.infradead.org  Thu Jun 10 08:14:28 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 10 Jun 2021 11:14:28 -0400
Subject: [openwrt/openwrt]  ramips: add support for Linksys E5600
In-Reply-To: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
References: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
Message-ID: <mailman.4768.1623338072.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/7cdddfb266b19ef37bf20173184fa75cf9944b59

commit 7cdddfb266b19ef37bf20173184fa75cf9944b59
Author: Aashish Kulkarni <aashishkul at gmail.com>
AuthorDate: Tue Mar 2 10:40:14 2021 +0530

    ramips: add support for Linksys E5600
    
    This submission relied heavily on the work of Linksys EA7300 v1/ v2.
    
    Specifications:
    
    * SoC: MediaTek MT7621A (880 MHz 2c/4t)
    * RAM: 128M DDR3-1600
    * Flash: 128M NAND
    * Eth: MediaTek MT7621A (10/100/1000 Mbps x5)
    * Radio: MT7603E/MT7613BE (2.4 GHz & 5 GHz)
    * Antennae: 2 internal fixed in the casing and 2 on the PCB
    * LEDs: Blue (x4 Ethernet)
      Blue+Orange (x2 Power + WPS and Internet)
    * Buttons: Reset (x1)
      WPS (x1)
    
    Installation:
    
    Flash factory image through GUI.
    
    This device has 2 partitions for the firmware called firmware and
    alt_firmware. To successfully flash and boot the device, the device
    should have been running from alt_firmware partition. To get the device
    booted through alt_firmware partition, download the OEM firmware from
    Linksys website and upgrade the firmware from web GUI. Once this is done,
    flash the OpenWrt Factory firmware from web GUI.
    
    Reverting to factory firmware:
    
    1. Boot to 'alt_firmware'(where stock firmware resides) by doing one of
       the following:
       Press the "wps" button as soon as power LED turns on when booting.
       (OR) Hard-reset the router consecutively three times to force it to
       boot from 'alt_firmware'.
    2. To remove any traces of OpenWRT from your router simply flash the OEM
       image at this point.
    
    Signed-off-by: Aashish Kulkarni <aashishkul at gmail.com>
    
    [fix hanging indents and wrap to 74 characters per line,
     add kmod-mt7663-firmware-sta package for 5GHz STA mode to work,
     remove sysupgrade.bin and concatenate IMAGES instead in mt7621.mk,
     set default-state "on" for power LED]
    Signed-off-by: Sannihith Kinnera <digislayer at protonmail.com>
    
    [move check-size before append-metadata, remove trailing whitespace]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
    Tested-by: Sannihith Kinnera <digislayer at protonmail.com>
    (cherry picked from commit 251c995cbb1ea5ad1de14775312c2bd19ed10439)
---
 target/linux/ramips/dts/mt7621_linksys_e5600.dts   | 182 +++++++++++++++++++++
 target/linux/ramips/image/mt7621.mk                |  23 +++
 .../ramips/mt7621/base-files/etc/board.d/01_leds   |   3 +
 .../mt7621/base-files/etc/board.d/02_network       |   1 +
 .../etc/hotplug.d/ieee80211/10_fix_wifi_mac        |   1 +
 .../ramips/mt7621/base-files/etc/init.d/bootcount  |   1 +
 .../mt7621/base-files/lib/upgrade/platform.sh      |   1 +
 7 files changed, 212 insertions(+)

diff --git a/target/linux/ramips/dts/mt7621_linksys_e5600.dts b/target/linux/ramips/dts/mt7621_linksys_e5600.dts
new file mode 100644
index 0000000000..91db315914
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_linksys_e5600.dts
@@ -0,0 +1,182 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "linksys,e5600", "mediatek,mt7621-soc";
+	model = "Linksys E5600";
+
+	aliases {
+		led-boot = &led_power;
+		led-failsafe = &led_power;
+		led-running = &led_power;
+		led-upgrade = &led_power;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		wps {
+			label = "amber:wps";
+			gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_power: power {
+			label = "blue:power";
+			gpios = <&gpio 10 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
+		};
+
+		wan_amber {
+			label = "amber:wan";
+			gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
+		};
+
+		wan_blue {
+			label = "blue:wan";
+			gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
+		};
+	};
+};
+
+&nand {
+	status = "okay";
+
+	partitions {
+		compatible = "fixed-partitions";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition at 0 {
+			label = "boot";
+			reg = <0x0 0x80000>;
+			read-only;
+		};
+
+		partition at 80000 {
+			label = "u_env";
+			reg = <0x80000 0x40000>;
+			read-only;
+		};
+
+		factory: partition at c0000 {
+			label = "factory";
+			reg = <0xc0000 0x40000>;
+			read-only;
+		};
+
+		partition at 100000 {
+			label = "s_env";
+			reg = <0x100000 0x40000>;
+		};
+
+		partition at 140000 {
+			label = "devinfo";
+			reg = <0x140000 0x40000>;
+			read-only;
+		};
+
+		partition at 180000 {
+			label = "kernel";
+			reg = <0x180000 0x400000>;
+		};
+
+		partition at 580000 {
+			label = "ubi";
+			reg = <0x580000 0x1a00000>;
+		};
+
+		partition at 1f80000 {
+			label = "alt_firmware";
+			reg = <0x1f80000 0x1e00000>;
+		};
+
+		partition at 3d80000 {
+			label = "gdata";
+			reg = <0x3d80000 0x4200000>;
+		};
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "uart2", "uart3", "jtag";
+		function = "gpio";
+	};
+};
+
+&pcie {
+	status = "okay";
+};
+
+&pcie0 {
+	mt76 at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x0000>;
+	};
+};
+
+&pcie1 {
+	mt76 at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x8000>;
+	};
+};
+
+&switch0 {
+	ports {
+		port at 0 {
+			status = "okay";
+			label = "lan1";
+		};
+
+		port at 1 {
+			status = "okay";
+			label = "lan2";
+		};
+
+		port at 2 {
+			status = "okay";
+			label = "lan3";
+		};
+
+		port at 3 {
+			status = "okay";
+			label = "lan4";
+		};
+
+		port at 4 {
+			status = "okay";
+			label = "wan";
+		};
+	};
+};
+
+&xhci {
+	status = "disabled";
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 6edf6c0cd6..44170b4c1a 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -22,6 +22,10 @@ define Build/elecom-wrc-gs-factory
 	mv $@.new $@
 endef
 
+define Build/gemtek-trailer
+	printf "%s%08X" ".GEMTEK." "$$(cksum $@ | cut -d ' ' -f1)" >> $@
+endef
+
 define Build/iodata-factory
 	$(eval fw_size=$(word 1,$(1)))
 	$(eval fw_type=$(word 2,$(1)))
@@ -762,6 +766,25 @@ define Device/lenovo_newifi-d1
 endef
 TARGET_DEVICES += lenovo_newifi-d1
 
+define Device/linksys_e5600
+  $(Device/dsa-migration)
+  $(Device/uimage-lzma-loader)
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  KERNEL_SIZE := 4096k
+  IMAGE_SIZE := 26624k
+  DEVICE_VENDOR := Linksys
+  DEVICE_MODEL := E5600
+  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap \
+	kmod-mt7663-firmware-sta uboot-envtools
+  UBINIZE_OPTS := -E 5
+  IMAGES += factory.bin
+  IMAGE/sysupgrade.bin := sysupgrade-tar | check-size | append-metadata
+  IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \
+	append-ubi | check-size | gemtek-trailer
+endef
+TARGET_DEVICES += linksys_e5600
+
 define Device/linksys_ea7xxx
   $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
index 2e280442bf..89a56dff2a 100755
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
@@ -47,6 +47,9 @@ gnubee,gb-pc2)
 	ucidef_set_led_netdev "lan1" "lan1" "green:lan1" "lan1"
 	ucidef_set_led_netdev "lan2" "lan2" "green:lan2" "lan2"
 	;;
+linksys,e5600)
+	ucidef_set_led_netdev "wan" "wan link" "blue:wan" "wan" "link"
+	;;
 linksys,ea7300-v1|\
 linksys,ea7300-v2|\
 linksys,ea7500-v2)
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
index f5b075f1f4..40f1bfaecd 100755
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
@@ -128,6 +128,7 @@ ramips_setup_macs()
 	zbtlink,zbt-wg3526-32m)
 		label_mac=$(mtd_get_mac_binary factory 0x4)
 		;;
+	linksys,e5600|\
 	linksys,ea7300-v1|\
 	linksys,ea7300-v2|\
 	linksys,ea7500-v2)
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 427bde4e38..49b7f23ce9 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
@@ -18,6 +18,7 @@ case "$board" in
 		[ "$PHYNBR" = "1" ] && \
 			macaddr_setbit_la "$(mtd_get_mac_binary Factory 0x4)" > /sys${DEVPATH}/macaddress
 		;;
+	linksys,e5600|\
 	linksys,ea7300-v1|\
 	linksys,ea7300-v2|\
 	linksys,ea7500-v2)
diff --git a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
index a155458d3f..cfaa62485c 100755
--- a/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
+++ b/target/linux/ramips/mt7621/base-files/etc/init.d/bootcount
@@ -8,6 +8,7 @@ boot() {
 		[ -n "$(fw_printenv bootcount bootchanged 2>/dev/null)" ] &&\
 			echo -e "bootcount\nbootchanged\n" | /usr/sbin/fw_setenv -s -
 		;;
+	linksys,e5600|\
 	linksys,ea7300-v1|\
 	linksys,ea7300-v2|\
 	linksys,ea7500-v2)
diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
index 98e429fdbf..7b57ee7776 100755
--- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
@@ -50,6 +50,7 @@ platform_do_upgrade() {
 	dlink,dir-2660-a1|\
 	hiwifi,hc5962|\
 	jcg,q20|\
+	linksys,e5600|\
 	linksys,ea7300-v1|\
 	linksys,ea7300-v2|\
 	linksys,ea7500-v2|\


From lede-commits at lists.infradead.org  Thu Jun 10 08:14:29 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 10 Jun 2021 11:14:29 -0400
Subject: [openwrt/openwrt] ramips: add support for Amped Wireless ALLY
 router and extender
In-Reply-To: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
References: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
Message-ID: <mailman.4771.1623338074.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/5e6837cf8fa4366fa44f902303b981c15570557e

commit 5e6837cf8fa4366fa44f902303b981c15570557e
Author: Jonathan Sturges <jsturges at redhat.com>
AuthorDate: Sat Jun 5 08:17:42 2021 -0400

    ramips: add support for Amped Wireless ALLY router and extender
    
    Amped Wireless ALLY is a whole-home WiFi kit, with a router (model
    ALLY-R1900K) and an Extender (model ALLY-00X19K).  Both are devices are
    11ac and based on MediaTek MT7621AT and MT7615N chips.  The units are
    nearly identical, except the Extender lacks a USB port and has a single
    Ethernet port.
    
    Specification:
    - SoC: MediaTek MT7621AT (2C/4T) @ 880MHz
    - RAM: 128MB DDR3 (Nanya NT5CC64M16GP-DI)
    - FLASH: 128MB NAND (Winbond W29N01GVSIAA)
    - WiFi: 2.4/5 GHz 4T4R
      - 2.4GHz MediaTek MT7615N bgn
      - 5GHz MediaTek MT7615N nac
    - Switch: SoC integrated Gigabit Switch
    - USB: 1x USB3 (Router only)
    - BTN: Reset, WPS
    - LED: single RGB
    - UART:  through-hole on PCB.
       J1: pin1 (square pad, towards rear)=3.3V, pin2=RX,
       pin3=GND, pin4=TX.  Settings: 57600/8N1.
    
    Note regarding dual system partitions
    -------------------------------------
    
    The vendor firmware and boot loader use a dual partition scheme.  The boot
    partition is decided by the bootImage U-boot environment variable: 0 for
    the 1st partition, 1 for the 2nd.
    
    OpenWrt does not support this scheme and will always use the first OS
    partition.  It will set bootImage to 0 during installation, making sure
    the first partition is selected by the boot loader.
    
    Also, because we can't be sure which partition is active to begin with, a
    2-step flash process is used.  We first flash an initramfs image, then
    follow with a regular sysupgrade.
    
    Installation:
    
    Router (ALLY-R1900K)
    1) Install the flashable initramfs image via the OEM web-interface.
      (Alternatively, you can use the TFTP recovery method below.)
      You can use WiFi or Ethernet.
      The direct URL is:  http://192.168.3.1/07_06_00_firmware.html
      a. No login is needed, and you'll be in their setup wizard.
      b. You might get a warning about not being connected to the Internet.
      c. Towards the bottom of the page will be a section entitled "Or
      Manually Upgrade Firmware from a File:" where you can manually choose
      and upload a firmware file.
      d: Click "Choose File", select the OpenWRT "initramfs" image and click
      "Upload."
    2) The Router will flash the OpenWrt initramfs image and reboot.  After
      booting, LuCI will be available on 192.168.1.1.
    3) Log into LuCI as root; there is no password.
    4) Optional (but recommended) is to backup the OEM firmware before
      continuing; see process below.
    5) Complete the Installation by flashing a full OpenWRT image.  Note:
      you may use the sysupgrade command line tool in lieu of the UI if
      you prefer.
      a.  Choose System -> Backup/Flash Firmware.
      b.  Click "Flash Image..." under "Flash new firmware image"
      c.  Click "Browse..." and then select the sysupgrade file.
      d.  Click Upload to upload the sysupgrade file.
      e.  Important:  uncheck "Keep settings and retain the current
          configuration" for this initial installation.
      f.  Click "Continue" to flash the firmware.
      g.  The device will reboot and OpenWRT is installed.
    
    Extender (ALLY-00X19K)
    1) This device requires a TFTP recovery procedure to do an initial load
      of OpenWRT.  Start by configuring a computer as a TFTP client:
      a. Install a TFTP client (server not necessary)
      b. Configure an Ethernet interface to 192.168.1.x/24; don't use .1 or .6
      c. Connect the Ethernet to the sole Ethernet port on the X19K.
    2) Put the ALLY Extender in TFTP recovery mode.
      a. Do this by pressing and holding the reset button on the bottom while
      connecting the power.
      b. As soon as the LED lights up green (roughly 2-3 seconds), release
      the button.
    3) Start the TFTP transfer of the Initramfs image from your setup machine.
    For example, from Linux:
    tftp -v -m binary 192.168.1.6 69 -c put initramfs.bin
    4) The Extender will flash the OpenWrt initramfs image and reboot.  After
    booting, LuCI will be available on 192.168.1.1.
    5) Log into LuCI as root; there is no password.
    6) Optional (but recommended) is to backup the OEM firmware before
      continuing; see process below.
    7) Complete the Installation by flashing a full OpenWRT image.  Note: you
    may use the sysupgrade command line tool in lieu of the UI if you prefer.
      a.  Choose System -> Backup/Flash Firmware.
      b.  Click "Flash Image..." under "Flash new firmware image"
      c.  Click "Browse..." and then select the sysupgrade file.
      d.  Click Upload to upload the sysupgrade file.
      e.  Important:  uncheck "Keep settings and retain the current
          configuration" for this initial installation.
      f.  Click "Continue" to flash the firmware.
      g.  The device will reboot and OpenWRT is installed.
    
    Backup the OEM Firmware:
    -----------------------
    
    There isn't any downloadable firmware for the ALLY devices on the Amped
    Wireless web site. Reverting back to the OEM firmware is not possible
    unless we have a backup of the original OEM firmware.
    
    The OEM firmware may be stored on either /dev/mtd3 ("firmware") or
    /dev/mtd6 ("oem").  We can't be sure which was overwritten with the
    initramfs image, so backup both partitions to be safe.
    
      1) Once logged into LuCI, navigate to System -> Backup/Flash Firmware.
      2) Under "Save mtdblock contents," first select "firmware" and click
      "Save mtdblock" to download the image.
      3) Repeat the process, but select "oem" from the pull-down menu.
    
    Revert to the OEM Firmware:
    --------------------------
    * U-boot TFTP:
      Follow the TFTP recovery steps for the Extender, and use the
      backup image.
    
    * OpenWrt "Flash Firmware" interface:
      Upload the backup image and select "Force update"
      before continuing.
    
    Signed-off-by: Jonathan Sturges <jsturges at redhat.com>
    
    (cherry picked from commit 6d23e474ad9d0eba935696c66db4fb6e2037bb72)
---
 package/boot/uboot-envtools/files/ramips           |   4 +
 .../dts/mt7621_ampedwireless_ally-00x19k.dts       |  21 +++
 .../dts/mt7621_ampedwireless_ally-r1900k.dts       |  32 ++++
 .../ramips/dts/mt7621_ampedwireless_ally.dtsi      | 179 +++++++++++++++++++++
 target/linux/ramips/image/mt7621.mk                |  27 ++++
 .../mt7621/base-files/etc/board.d/02_network       |  41 +++--
 .../mt7621/base-files/lib/upgrade/platform.sh      |   8 +
 7 files changed, 297 insertions(+), 15 deletions(-)

diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips
index 5800a548e3..e1920303a9 100644
--- a/package/boot/uboot-envtools/files/ramips
+++ b/package/boot/uboot-envtools/files/ramips
@@ -26,6 +26,10 @@ allnet,all0256n-8m|\
 allnet,all5002)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
 	;;
+ampedwireless,ally-00x19k|\
+ampedwireless,ally-r1900k)
+	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4"
+	;;
 buffalo,wsr-1166dhp|\
 buffalo,wsr-600dhp|\
 mediatek,linkit-smart-7688|\
diff --git a/target/linux/ramips/dts/mt7621_ampedwireless_ally-00x19k.dts b/target/linux/ramips/dts/mt7621_ampedwireless_ally-00x19k.dts
new file mode 100644
index 0000000000..51d41c7fb4
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_ampedwireless_ally-00x19k.dts
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621_ampedwireless_ally.dtsi"
+
+/ {
+	compatible = "ampedwireless,ally-00x19k", "mediatek,mt7621-soc";
+	model = "Amped Wireless ALLY-00X19K";
+};
+
+&switch0 {
+	ports {
+		port at 2 {
+			status = "okay";
+			label = "lan";
+		};
+	};
+};
+
+&xhci {
+	status = "disabled";
+};
diff --git a/target/linux/ramips/dts/mt7621_ampedwireless_ally-r1900k.dts b/target/linux/ramips/dts/mt7621_ampedwireless_ally-r1900k.dts
new file mode 100644
index 0000000000..cd2536e179
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_ampedwireless_ally-r1900k.dts
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621_ampedwireless_ally.dtsi"
+
+/ {
+	compatible = "ampedwireless,ally-r1900k", "mediatek,mt7621-soc";
+	model = "Amped Wireless ALLY-R1900K";
+};
+
+&switch0 {
+	ports {
+		port at 1 {
+			status = "okay";
+			label = "wan";
+		};
+
+		port at 2 {
+			status = "okay";
+			label = "lan1";
+		};
+
+		port at 3 {
+			status = "okay";
+			label = "lan2";
+		};
+
+		port at 4 {
+			status = "okay";
+			label = "lan3";
+		};
+	};
+};
diff --git a/target/linux/ramips/dts/mt7621_ampedwireless_ally.dtsi b/target/linux/ramips/dts/mt7621_ampedwireless_ally.dtsi
new file mode 100644
index 0000000000..7736b06e43
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_ampedwireless_ally.dtsi
@@ -0,0 +1,179 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	aliases {
+		led-boot = &led_status_amber;
+		led-failsafe = &led_status_amber;
+		led-running = &led_status_green;
+		led-upgrade = &led_status_red;
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		led_switch {
+			label = "led_switch";
+			gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
+			linux,code = <KEY_LIGHTS_TOGGLE>;
+			linux,input-type = <EV_SW>;
+		};
+
+		reset {
+			label = "reset";
+			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&gpio 18 GPIO_ACTIVE_HIGH>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_status_green: status_green {
+			label = "green:status";
+			gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_status_red: status_red {
+			label = "red:status";
+			gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_status_amber: status_amber {
+			label = "amber:status";
+			gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
+		};
+	};
+};
+
+&pcie {
+	status = "okay";
+};
+
+&pcie0 {
+	wifi at 0,0 {
+		compatible = "pci14c3,7615";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x0000>;
+		ieee80211-freq-limit = <2400000 2500000>;
+	};
+};
+
+&pcie1 {
+	wifi at 0,0 {
+		compatible = "pci14c3,7615";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x8000>;
+		ieee80211-freq-limit = <5000000 6000000>;
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "uart2", "uart3", "jtag", "wdt";
+		function = "gpio";
+	};
+};
+
+&nand {
+	status = "okay";
+
+	partitions {
+		compatible = "fixed-partitions";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition at 0 {
+			label = "u-boot";
+			reg = <0x0 0x80000>;
+			read-only;
+		};
+
+		partition at 80000 {
+			label = "u-boot-env";
+			reg = <0x80000 0x80000>;
+		};
+
+		factory: partition at 100000 {
+			label = "factory";
+			reg = <0x100000 0x40000>;
+			read-only;
+		};
+
+		/*
+		 * uboot expects to find kernels at 0x140000 & 0x2140000,
+		 * referred to as Uimage & Uimage1 in factory FW, respectively.
+		 * U-boot variable 'bootImage' controls which is booted;
+		 * 0 for the first, 1 for the 2nd.
+		 * There's a 3rd partition, Uimage2 (0x4140000), which
+		 * I expected to be a recovery image, but is actually blank.
+		 *
+		 * A kernel is considered suitable for handing control over
+		 * if its linux magic number exists & uImage CRC are correct.
+		 * If either of those conditions fail, 'bootImage' value
+		 * is toggled in uboot env & a restart performed in the hope that the
+		 * alternate kernel is okay.
+		 *
+		 * Note uboot's tftp flash install writes the transferred
+		 * image to the active kernel partition.
+		 */
+
+		partition at 140000 {
+			label = "kernel";
+			reg = <0x140000 0x400000>;
+		};
+
+		partition at 540000 {
+			label = "ubi";
+			reg = <0x540000 0x1c00000>;
+		};
+
+		partition at 2140000 {
+			label = "oem";
+			reg = <0x2140000 0x2000000>;
+		};
+
+		partition at 4140000 {
+			label = "backup";
+			reg = <0x4140000 0x2000000>;
+		};
+
+		partition at 6140000 {
+			label = "chime";
+			reg = <0x6140000 0xa00000>;
+		};
+
+		partition at 6b40000 {
+			label = "data";
+			reg = <0x6b40000 0xa00000>;
+		};
+
+		partition at 7540000 {
+			label = "reserved";
+			reg = <0x7540000 0x840000>;
+			read-only;
+		};
+
+		partition at 7d80000 {
+			label = "nvram";
+			reg = <0x7d80000 0x100000>;
+			read-only;
+		};
+
+		partition at 7e80000 {
+			label = "hwconfig";
+			reg = <0x7e80000 0x100000>;
+			read-only;
+		};
+	};
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 44170b4c1a..873011d2d8 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -126,6 +126,33 @@ define Device/alfa-network_quad-e4g
 endef
 TARGET_DEVICES += alfa-network_quad-e4g
 
+define Device/ampedwireless_ally_common
+  $(Device/dsa-migration)
+  DEVICE_VENDOR := Amped Wireless
+  DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware uboot-envtools
+  IMAGE_SIZE := 32768k
+  KERNEL_SIZE := 4096k
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  UBINIZE_OPTS := -E 5
+  KERNEL_INITRAMFS := $(KERNEL_DTB) | uImage lzma -n 'flashable-initramfs' |\
+	edimax-header -s CSYS -m RN68 -f 0x001c0000 -S 0x01100000
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+endef
+
+define Device/ampedwireless_ally-r1900k
+  $(Device/ampedwireless_ally_common)
+  DEVICE_MODEL := ALLY-R1900K
+  DEVICE_PACKAGES += kmod-usb3
+endef
+TARGET_DEVICES += ampedwireless_ally-r1900k
+
+define Device/ampedwireless_ally-00x19k
+  $(Device/ampedwireless_ally_common)
+  DEVICE_MODEL := ALLY-00X19K
+endef
+TARGET_DEVICES += ampedwireless_ally-00x19k
+
 define Device/asiarf_ap7621-001
   $(Device/dsa-migration)
   IMAGE_SIZE := 16000k
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
index 40f1bfaecd..5d5923cc70 100755
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
@@ -9,21 +9,7 @@ ramips_setup_interfaces()
 	local board="$1"
 
 	case $board in
-	asiarf,ap7621-001|\
-	winstars,ws-wn583a6)
-		ucidef_set_interfaces_lan_wan "lan" "wan"
-		;;
-	asiarf,ap7621-nv1|\
-	glinet,gl-mt1300|\
-	jcg,q20|\
-	lenovo,newifi-d1|\
-	mikrotik,routerboard-m33g|\
-	xiaomi,mi-router-3g|\
-	xiaomi,mi-router-3g-v2|\
-	xiaomi,mi-router-4|\
-	xiaomi,mi-router-4a-gigabit)
-		ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
-		;;
+	ampedwireless,ally-00x19k|\
 	edimax,re23s|\
 	mikrotik,routerboard-m11g|\
 	netgear,ex6150|\
@@ -35,6 +21,7 @@ ramips_setup_interfaces()
 	ubnt,unifi-nanohd)
 		ucidef_set_interface_lan "lan"
 		;;
+	ampedwireless,ally-r1900k|\
 	gehua,ghl-r-001|\
 	hiwifi,hc5962|\
 	xiaomi,mi-router-3-pro|\
@@ -42,6 +29,21 @@ ramips_setup_interfaces()
 	xiaomi,redmi-router-ac2100)
 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
 		;;
+	asiarf,ap7621-001|\
+	winstars,ws-wn583a6)
+		ucidef_set_interfaces_lan_wan "lan" "wan"
+		;;
+	asiarf,ap7621-nv1|\
+	glinet,gl-mt1300|\
+	jcg,q20|\
+	lenovo,newifi-d1|\
+	mikrotik,routerboard-m33g|\
+	xiaomi,mi-router-3g|\
+	xiaomi,mi-router-3g-v2|\
+	xiaomi,mi-router-4|\
+	xiaomi,mi-router-4a-gigabit)
+		ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
+		;;
 	gnubee,gb-pc1|\
 	gnubee,gb-pc2)
 		ucidef_set_interface_lan "lan1 lan2"
@@ -86,6 +88,15 @@ ramips_setup_macs()
 	local label_mac=""
 
 	case $board in
+	ampedwireless,ally-00x19k)
+		lan_mac=$(mtd_get_mac_ascii hwconfig HW.LAN.MAC.Address)
+		label_mac=$lan_mac
+		;;
+	ampedwireless,ally-r1900k)
+		lan_mac=$(mtd_get_mac_ascii hwconfig HW.LAN.MAC.Address)
+		wan_mac=$(mtd_get_mac_ascii hwconfig HW.WAN.MAC.Address)
+		label_mac=$lan_mac
+		;;
 	asus,rt-ac65p|\
 	asus,rt-ac85p)
 		wan_mac=$(mtd_get_mac_ascii u-boot-env et1macaddr)
diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
index 7b57ee7776..689a0e51ae 100755
--- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
@@ -27,6 +27,12 @@ platform_do_upgrade() {
 			fi
 		}
 		;;
+	ampedwireless,ally-00x19k|\
+	ampedwireless,ally-r1900k)
+		if [ "$(fw_printenv --lock / -n bootImage 2>/dev/null)" != "0" ]; then
+			fw_setenv --lock / bootImage 0 || exit 1
+		fi
+		;;
 	mikrotik,routerboard-750gr3|\
 	mikrotik,routerboard-760igs|\
 	mikrotik,routerboard-m11g|\
@@ -43,6 +49,8 @@ platform_do_upgrade() {
 	esac
 
 	case "$board" in
+	ampedwireless,ally-00x19k|\
+	ampedwireless,ally-r1900k|\
 	asus,rt-ac65p|\
 	asus,rt-ac85p|\
 	dlink,dir-1960-a1|\


From lede-commits at lists.infradead.org  Thu Jun 10 08:14:31 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 10 Jun 2021 11:14:31 -0400
Subject: [openwrt/openwrt]  ramips: Add support for SERCOMM NA502
In-Reply-To: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
References: <162333806127.26064.14292618275122989725@git-01.infra.openwrt.org>
Message-ID: <mailman.4772.1623338510.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/46b53ce83b3d47ef48a0ef9cb3263a038e1ebc8a

commit 46b53ce83b3d47ef48a0ef9cb3263a038e1ebc8a
Author: Andreas B?hler <dev at aboehler.at>
AuthorDate: Mon Mar 15 00:07:17 2021 +0100

    ramips: Add support for SERCOMM NA502
    
    The SERCOMM NA502 is a smart home gateway manufactured by SERCOMM and sold
    under different brands (among others, A1 Telekom Austria SmartHome
    Gateway). It has multi-protocol radio support in addition to LAN and WiFi.
    
    Note: BLE is currently unsupported.
    
    Specifications
    --------------
    
      - MT7621ST 880MHz, Single-Core, Dual-Thread
      - MT7603EN 2.4GHz WiFi
      - MT7662EN 5GHz WiFi + BLE
      - 128MiB NAND
      - 256MiB DDR3 RAM
      - SD3503 ZWave Controller
      - EM357 Zigbee Coordinator
    
    MAC address assignment
    ----------------------
    
    LAN MAC is read from the config partition, WiFi 2.4GHz is LAN+2 and matches
    the OEM firmware. WiFi 5GHz with LAN+1 is an educated guess since the
    OEM firmware does not enable 5GHz WiFi.
    
    Installation
    ------------
    Attach serial console, then boot the initramfs image via TFTP.
    Once inside OpenWrt, run sysupgrade -n with the sysupgrade file.
    
    Attention: The device has a dual-firmware design. We overwrite kernel2,
    since kernel1 contains an automatic recovery image.
    
    If you get NAND ECC errors and are stuck with bad eraseblocks, try to
    erase the mtd partition first with
    
    mtd unlock ubi
    mtd erase ubi
    
    This should only be needed once.
    
    Signed-off-by: Andreas B?hler <dev at aboehler.at>
    [use kiB for IMAGE_SIZE]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
    
    (cherry picked from commit a3d8c1295ed9eeceabd78ab86e73b151ae2868a9)
---
 target/linux/ramips/dts/mt7621_sercomm_na502.dts   | 212 +++++++++++++++++++++
 target/linux/ramips/image/mt7621.mk                |  14 ++
 .../mt7621/base-files/etc/board.d/02_network       |   1 +
 .../mt7621/base-files/lib/upgrade/platform.sh      |   1 +
 4 files changed, 228 insertions(+)

diff --git a/target/linux/ramips/dts/mt7621_sercomm_na502.dts b/target/linux/ramips/dts/mt7621_sercomm_na502.dts
new file mode 100644
index 0000000000..af55d1058f
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_sercomm_na502.dts
@@ -0,0 +1,212 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "sercomm,na502", "mediatek,mt7621-soc";
+	model = "SERCOMM NA502";
+
+	aliases {
+		led-boot = &led_power;
+		led-failsafe = &led_power;
+		led-running = &led_power;
+		led-upgrade = &led_power;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_power: power {
+			label = "green:power";
+			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+		};
+
+		internet {
+			label = "green:internet";
+			gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
+		};
+
+		wifi {
+			label = "green:wifi";
+			gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy0tpt";
+		};
+
+		zwave {
+			label = "green:zwave";
+			gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
+		};
+
+		service {
+			label = "green:service";
+			gpios = <&gpio 26 GPIO_ACTIVE_LOW>;
+		};
+
+		zigbee {
+			label = "green:zigbee";
+			gpios = <&gpio 27 GPIO_ACTIVE_LOW>;
+		};
+
+		bluetooth {
+			label = "green:bluetooth";
+			gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+
+		select {
+			label = "select";
+			gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
+			linux,code = <BTN_0>;
+		};
+
+		sync {
+			label = "sync";
+			gpios = <&gpio 32 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RFKILL>;
+		};
+	};
+
+	gpio-export {
+		compatible = "gpio-export";
+
+		zwave_reset {
+			gpio-export,name = "zwave_reset";
+			gpio-export,output = <1>;
+			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+		};
+
+		zigbee_reset {
+			gpio-export,name = "zigbee_reset";
+			gpio-export,output = <1>;
+			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&gmac0 {
+	mtd-mac-address = <&factory 0xe000>;
+};
+
+&nand {
+	status = "okay";
+
+	partitions {
+		compatible = "fixed-partitions";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition at 0 {
+			label = "u-boot";
+			reg = <0x0 0x80000>;
+			read-only;
+		};
+
+		partition at 80000 {
+			label = "config";
+			reg = <0x80000 0x80000>;
+			read-only;
+		};
+
+		factory: partition at 100000 {
+			label = "factory";
+			reg = <0x100000 0x40000>;
+		};
+
+		partition at 140000 {
+			label = "kernel1";
+			reg = <0x140000 0x1400000>;
+		};
+
+		partition at 1540000 {
+			label = "kernel";
+			reg = <0x1540000 0x400000>;
+		};
+
+		partition at 1940000 {
+			label = "ubi";
+			reg = <0x1940000 0x1000000>;
+		};
+
+		partition at 2940000 {
+			label = "user_storage";
+			reg = <0x2940000 0x100000>;
+		};
+
+		partition at 2a40000 {
+			label = "data";
+			reg = <0x2a40000 0x1000000>;
+		};
+
+		partition at 3a40000 {
+			label = "storage";
+			reg = <0x3a40000 0x3200000>;
+		};
+
+		partition at 6c40000 {
+			label = "backup";
+			reg = <0x6c40000 0x1340000>;
+		};
+	};
+};
+
+&pcie {
+	status = "okay";
+};
+
+&pcie0 {
+	wifi at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x8000>;
+		mtd-mac-address = <&factory 0xe000>;
+		mtd-mac-address-increment = <1>;
+		ieee80211-freq-limit = <5000000 6000000>;
+	};
+};
+
+&pcie1 {
+	wifi at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x0000>;
+		mtd-mac-address = <&factory 0xe000>;
+		mtd-mac-address-increment = <2>;
+		ieee80211-freq-limit = <2400000 2500000>;
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "jtag", "rgmii2";
+		function = "gpio";
+	};
+};
+
+&switch0 {
+	ports {
+		port at 4 {
+			status = "okay";
+			label = "lan";
+		};
+	};
+};
+
+&uartlite2 {
+	status = "okay";
+};
+
+&uartlite3 {
+	status = "okay";
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 6645c7b06e..a3bc14d59d 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -1167,6 +1167,20 @@ define Device/samknows_whitebox-v8
 endef
 TARGET_DEVICES += samknows_whitebox-v8
 
+define Device/sercomm_na502
+  $(Device/uimage-lzma-loader)
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  IMAGE_SIZE := 20480k
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+  UBINIZE_OPTS := -E 5
+  KERNEL_SIZE := 4096k
+  DEVICE_VENDOR := SERCOMM
+  DEVICE_MODEL := NA502
+  DEVICE_PACKAGES := kmod-mt76x2 kmod-mt7603 kmod-usb3
+endef
+TARGET_DEVICES += sercomm_na502
+
 define Device/storylink_sap-g3200u3
   $(Device/dsa-migration)
   IMAGE_SIZE := 7872k
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
index c0c767306a..4b44669b84 100755
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
@@ -13,6 +13,7 @@ ramips_setup_interfaces()
 	edimax,re23s|\
 	mikrotik,routerboard-m11g|\
 	netgear,ex6150|\
+	sercomm,na502|\
 	thunder,timecloud|\
 	tplink,re350-v1|\
 	tplink,re500-v1|\
diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
index 4943ad1305..c2ad4d3ed6 100755
--- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
@@ -72,6 +72,7 @@ platform_do_upgrade() {
 	netgear,wac104|\
 	netgear,wac124|\
 	netis,wf2881|\
+	sercomm,na502|\
 	xiaomi,mi-router-3g|\
 	xiaomi,mi-router-3-pro|\
 	xiaomi,mi-router-4|\


From lede-commits at lists.infradead.org  Fri Jun 11 00:01:37 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 11 Jun 2021 03:01:37 -0400
Subject: [openwrt/openwrt] ath79: adjust ath79/tiny Senao APs to 4k blocksize
In-Reply-To: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
References: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
Message-ID: <mailman.4980.1623394899.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/642c88714cbf68a582d191141b96e8b9fb850b74

commit 642c88714cbf68a582d191141b96e8b9fb850b74
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Sun Feb 21 17:41:30 2021 -0500

    ath79: adjust ath79/tiny Senao APs to 4k blocksize
    
    ath79/tiny kernel config has
    CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
    from commit
    05d35403b211ccb9bf20e2b3c0b7a30c82c6d6a2
    
    Because of this, these changes are required for 2 reasons:
    
    1.
    
    Senao devices in ath79/tiny
    with a 'failsafe' partition and the tar.gz sysupgrade platform
    and a flash chip that supports 4k sectors
    will fail to reboot to openwrt after a sysupgrade.
    
    the stored checksum is made with the 64k blocksize length
    of the image to be flashed,
    and the actual checksum changes after flashing due to JFFS2 space
    being formatted within the length of the rootfs from the image
    
    example:
    0x440000 length of kernel + rootfs (from sysupgrade.bin)
    0x439000 offset of rootfs_data (from kernel log)
    
    2.
    
    for boards with flash chips that support 4k sectors:
    saving configuration over sysupgrade is not possible
    because sysupgrade.tgz is appended at a 64k boundary
    and the mtd parser starts JFFS2 at a 4k boundary.
    
    for boards with flash chips that do not support 4k sectors:
    partitioning with 4k boundaries causes a boot loop
    from the mtd parser not finding kernel and rootfs.
    
    Also:
    
    Some of the Senao boards that belong in ath79/tiny,
    for example ENH202,
    have a flash chip that does not support 4k sectors
    (no SECT_4K symbol in upstream source).
    
    Because of this, partitioning must be different for these devices
    depending on the flash chip model detected by the kernel.
    
    Therefore:
    
    this creates 2 DTSI files
    to replace the single one with 64k partitioning
    for 4k and 64k partitioning respectively.
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
    (cherry picked from commit a58cb22bbe4bac17e7421a0ad6bf7929fcd56599)
---
 target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts                | 2 +-
 target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts                | 2 +-
 target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts                | 2 +-
 .../dts/{ar724x_senao_loader.dtsi => ar724x_senao_loader-4k.dtsi}   | 6 +++---
 .../dts/{ar724x_senao_loader.dtsi => ar724x_senao_loader-64k.dtsi}  | 0
 target/linux/ath79/image/tiny.mk                                    | 2 ++
 6 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts b/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts
index 89b6746c61..c5a667b513 100644
--- a/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts
+++ b/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
 #include "ar7240.dtsi"
-#include "ar724x_senao_loader.dtsi"
+#include "ar724x_senao_loader-64k.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
diff --git a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts
index be0f7cbc43..436d8c1289 100644
--- a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts
+++ b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
 #include "ar7242.dtsi"
-#include "ar724x_senao_loader.dtsi"
+#include "ar724x_senao_loader-4k.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
diff --git a/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts
index 55343e786a..be9a193170 100644
--- a/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts
+++ b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
 #include "ar7242.dtsi"
-#include "ar724x_senao_loader.dtsi"
+#include "ar724x_senao_loader-4k.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
diff --git a/target/linux/ath79/dts/ar724x_senao_loader.dtsi b/target/linux/ath79/dts/ar724x_senao_loader-4k.dtsi
similarity index 93%
copy from target/linux/ath79/dts/ar724x_senao_loader.dtsi
copy to target/linux/ath79/dts/ar724x_senao_loader-4k.dtsi
index 54dbec18b3..501ff26859 100644
--- a/target/linux/ath79/dts/ar724x_senao_loader.dtsi
+++ b/target/linux/ath79/dts/ar724x_senao_loader-4k.dtsi
@@ -55,13 +55,13 @@
 
 			partition at a0000 {
 				label = "loader";
-				reg = <0xa0000 0x10000>;
+				reg = <0xa0000 0x1000>;
 				read-only;
 			};
 
-			fwconcat1: partition at b0000 {
+			fwconcat1: partition at a1000 {
 				label = "fwconcat1";
-				reg = <0xb0000 0xf0000>;
+				reg = <0xa1000 0xff000>;
 			};
 
 			fwconcat0: partition at 1a0000 {
diff --git a/target/linux/ath79/dts/ar724x_senao_loader.dtsi b/target/linux/ath79/dts/ar724x_senao_loader-64k.dtsi
similarity index 100%
rename from target/linux/ath79/dts/ar724x_senao_loader.dtsi
rename to target/linux/ath79/dts/ar724x_senao_loader-64k.dtsi
diff --git a/target/linux/ath79/image/tiny.mk b/target/linux/ath79/image/tiny.mk
index e9aab2ce06..29e411c058 100644
--- a/target/linux/ath79/image/tiny.mk
+++ b/target/linux/ath79/image/tiny.mk
@@ -33,6 +33,7 @@ TARGET_DEVICES += dlink_dir-615-e4
 
 define Device/engenius_eap350-v1
   $(Device/senao_loader_okli)
+  BLOCKSIZE := 4k
   SOC := ar7242
   DEVICE_VENDOR := EnGenius
   DEVICE_MODEL := EAP350
@@ -45,6 +46,7 @@ TARGET_DEVICES += engenius_eap350-v1
 
 define Device/engenius_ecb350-v1
   $(Device/senao_loader_okli)
+  BLOCKSIZE := 4k
   SOC := ar7242
   DEVICE_VENDOR := EnGenius
   DEVICE_MODEL := ECB350


From lede-commits at lists.infradead.org  Fri Jun 11 00:01:33 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 11 Jun 2021 03:01:33 -0400
Subject: [openwrt/openwrt]  ath79: create common DTSI for Senao ar934x APs
In-Reply-To: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
References: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
Message-ID: <mailman.4981.1623394899.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/7850f5071a02a1fa49146bcb3c5e4515e2126dff

commit 7850f5071a02a1fa49146bcb3c5e4515e2126dff
Author: Adrian Schmutzler <freifunk at adrianschmutzler.de>
AuthorDate: Mon Feb 15 17:30:59 2021 +0100

    ath79: create common DTSI for Senao ar934x APs
    
    This creates a shared DTSI for ar934x Senao/Engenius APs:
    
     - EAP300 v2
     - ENS202EXT v1
     - EAP600
     - ECB600
    
    Since ar9341/ar9344 have different configuration, this new file
    mostly contains the partitioning.
    
    Suggested-by: Michael Pratt <mcpratt at pm.me>
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
    (cherry picked from commit ce8b535ed3aea743f58d8445dfaa1c2ced375f94)
---
 .../linux/ath79/dts/ar9341_engenius_eap300-v2.dts  | 92 +---------------------
 .../ath79/dts/ar9341_engenius_ens202ext-v1.dts     | 92 +---------------------
 target/linux/ath79/dts/ar9344_engenius_exx600.dtsi | 92 +---------------------
 ...nius_eap300-v2.dts => ar934x_senao_loader.dtsi} | 53 +------------
 4 files changed, 4 insertions(+), 325 deletions(-)

diff --git a/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts b/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts
index b830821977..8c87a73508 100644
--- a/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts
+++ b/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts
@@ -1,10 +1,10 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
 #include "ar9341.dtsi"
+#include "ar934x_senao_loader.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
-#include <dt-bindings/mtd/partitions/uimage.h>
 
 / {
 	model = "Engenius EAP300 v2";
@@ -43,96 +43,6 @@
 			linux,default-trigger = "phy0tpt";
 		};
 	};
-
-	virtual_flash {
-		compatible = "mtd-concat";
-
-		devices = <&fwconcat0 &fwconcat1>;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				compatible = "openwrt,uimage", "denx,uimage";
-				openwrt,ih-magic = <IH_MAGIC_OKLI>;
-				label = "firmware";
-				reg = <0x0 0x0>;
-			};
-		};
-	};
-};
-
-&ref {
-	clock-frequency = <40000000>;
-};
-
-&spi {
-	status = "okay";
-
-	flash at 0 {
-		compatible = "jedec,spi-nor";
-		reg = <0>;
-		spi-max-frequency = <20000000>;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				label = "u-boot";
-				reg = <0x000000 0x040000>;
-				read-only;
-			};
-
-			partition at 40000 {
-				label = "u-boot-env";
-				reg = <0x040000 0x010000>;
-			};
-
-			partition at 50000 {
-				label = "custom";
-				reg = <0x050000 0x050000>;
-				read-only;
-			};
-
-			partition at a0000 {
-				label = "loader";
-				reg = <0x0a0000 0x010000>;
-				read-only;
-			};
-
-			fwconcat1: partition at b0000 {
-				label = "fwconcat1";
-				reg = <0x0b0000 0x170000>;
-			};
-
-			partition at 220000 {
-				label = "fakeroot";
-				reg = <0x220000 0x010000>;
-				read-only;
-			};
-
-			fwconcat0: partition at 230000 {
-				label = "fwconcat0";
-				reg = <0x230000 0xbc0000>;
-			};
-
-			partition at df0000 {
-				label = "failsafe";
-				reg = <0xdf0000 0x200000>;
-				read-only;
-			};
-
-			art: partition at ff0000 {
-				label = "art";
-				reg = <0xff0000 0x010000>;
-				read-only;
-			};
-		};
-	};
 };
 
 &eth1 {
diff --git a/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts b/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts
index 8204578c17..5c81020ccd 100644
--- a/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts
+++ b/target/linux/ath79/dts/ar9341_engenius_ens202ext-v1.dts
@@ -1,10 +1,10 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
 #include "ar9341.dtsi"
+#include "ar934x_senao_loader.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
-#include <dt-bindings/mtd/partitions/uimage.h>
 
 / {
 	model = "Engenius ENS202EXT v1";
@@ -58,96 +58,6 @@
 			gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
 		};
 	};
-
-	virtual_flash {
-		compatible = "mtd-concat";
-
-		devices = <&fwconcat0 &fwconcat1>;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				compatible = "openwrt,uimage", "denx,uimage";
-				openwrt,ih-magic = <IH_MAGIC_OKLI>;
-				label = "firmware";
-				reg = <0x0 0x0>;
-			};
-		};
-	};
-};
-
-&ref {
-	clock-frequency = <40000000>;
-};
-
-&spi {
-	status = "okay";
-
-	flash at 0 {
-		compatible = "jedec,spi-nor";
-		reg = <0>;
-		spi-max-frequency = <40000000>;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				label = "u-boot";
-				reg = <0x000000 0x040000>;
-				read-only;
-			};
-
-			partition at 40000 {
-				label = "u-boot-env";
-				reg = <0x040000 0x010000>;
-			};
-
-			partition at 50000 {
-				label = "custom";
-				reg = <0x050000 0x050000>;
-				read-only;
-			};
-
-			partition at a0000 {
-				label = "loader";
-				reg = <0x0a0000 0x010000>;
-				read-only;
-			};
-
-			fwconcat1: partition at b0000 {
-				label = "fwconcat1";
-				reg = <0x0b0000 0x170000>;
-			};
-
-			partition at 220000 {
-				label = "fakeroot";
-				reg = <0x220000 0x010000>;
-				read-only;
-			};
-
-			fwconcat0: partition at 230000 {
-				label = "fwconcat0";
-				reg = <0x230000 0xbc0000>;
-			};
-
-			partition at df0000 {
-				label = "failsafe";
-				reg = <0xdf0000 0x200000>;
-				read-only;
-			};
-
-			art: partition at ff0000 {
-				label = "art";
-				reg = <0xff0000 0x010000>;
-				read-only;
-			};
-		};
-	};
 };
 
 &eth0 {
diff --git a/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi b/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi
index d7036ff675..1c318f2083 100644
--- a/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi
+++ b/target/linux/ath79/dts/ar9344_engenius_exx600.dtsi
@@ -1,10 +1,10 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
 #include "ar9344.dtsi"
+#include "ar934x_senao_loader.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
-#include <dt-bindings/mtd/partitions/uimage.h>
 
 / {
 	aliases {
@@ -35,96 +35,6 @@
 			linux,default-trigger = "phy1tpt";
 		};
 	};
-
-	virtual_flash {
-		compatible = "mtd-concat";
-
-		devices = <&fwconcat0 &fwconcat1>;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				compatible = "openwrt,uimage", "denx,uimage";
-				openwrt,ih-magic = <IH_MAGIC_OKLI>;
-				label = "firmware";
-				reg = <0x0 0x0>;
-			};
-		};
-	};
-};
-
-&ref {
-	clock-frequency = <40000000>;
-};
-
-&spi {
-	status = "okay";
-
-	flash at 0 {
-		compatible = "jedec,spi-nor";
-		reg = <0>;
-		spi-max-frequency = <40000000>;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				label = "u-boot";
-				reg = <0x000000 0x040000>;
-				read-only;
-			};
-
-			partition at 40000 {
-				label = "u-boot-env";
-				reg = <0x040000 0x010000>;
-			};
-
-			partition at 50000 {
-				label = "custom";
-				reg = <0x050000 0x050000>;
-				read-only;
-			};
-
-			partition at a0000 {
-				label = "loader";
-				reg = <0x0a0000 0x010000>;
-				read-only;
-			};
-
-			fwconcat1: partition at b0000 {
-				label = "fwconcat1";
-				reg = <0x0b0000 0x170000>;
-			};
-
-			partition at 220000 {
-				label = "fakeroot";
-				reg = <0x220000 0x010000>;
-				read-only;
-			};
-
-			fwconcat0: partition at 230000 {
-				label = "fwconcat0";
-				reg = <0x230000 0xbc0000>;
-			};
-
-			partition at df0000 {
-				label = "failsafe";
-				reg = <0xdf0000 0x200000>;
-				read-only;
-			};
-
-			art: partition at ff0000 {
-				label = "art";
-				reg = <0xff0000 0x010000>;
-				read-only;
-			};
-		};
-	};
 };
 
 &mdio0 {
diff --git a/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts b/target/linux/ath79/dts/ar934x_senao_loader.dtsi
similarity index 63%
copy from target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts
copy to target/linux/ath79/dts/ar934x_senao_loader.dtsi
index b830821977..aa8a36d242 100644
--- a/target/linux/ath79/dts/ar9341_engenius_eap300-v2.dts
+++ b/target/linux/ath79/dts/ar934x_senao_loader.dtsi
@@ -1,49 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "ar9341.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
 #include <dt-bindings/mtd/partitions/uimage.h>
 
 / {
-	model = "Engenius EAP300 v2";
-	compatible = "engenius,eap300-v2", "qca,ar9341";
-
-	aliases {
-		led-boot = &led_power;
-		led-failsafe = &led_power;
-		led-running = &led_power;
-		led-upgrade = &led_power;
-	};
-
-	keys {
-		compatible = "gpio-keys";
-
-		reset {
-			label = "reset";
-			gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
-			debounce-interval = <60>;
-			linux,code = <KEY_RESTART>;
-		};
-	};
-
-	leds {
-		compatible = "gpio-leds";
-
-		led_power: power {
-			label = "blue:power";
-			gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
-			default-state = "on";
-		};
-
-		wlan {
-			label = "blue:wlan";
-			gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
-			linux,default-trigger = "phy0tpt";
-		};
-	};
-
 	virtual_flash {
 		compatible = "mtd-concat";
 
@@ -74,7 +33,7 @@
 	flash at 0 {
 		compatible = "jedec,spi-nor";
 		reg = <0>;
-		spi-max-frequency = <20000000>;
+		spi-max-frequency = <40000000>;
 
 		partitions {
 			compatible = "fixed-partitions";
@@ -134,13 +93,3 @@
 		};
 	};
 };
-
-&eth1 {
-	mtd-mac-address = <&art 0x0>;
-};
-
-&wmac {
-	status = "okay";
-
-	mtd-cal-data = <&art 0x1000>;
-};


From lede-commits at lists.infradead.org  Fri Jun 11 00:01:35 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 11 Jun 2021 03:01:35 -0400
Subject: [openwrt/openwrt] ath79: lzma-loader: allow setting custom kernel
 magic
In-Reply-To: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
References: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
Message-ID: <mailman.4982.1623394901.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/1f6ec4b29ebfda19d9df01f1cc289ed6454683cf

commit 1f6ec4b29ebfda19d9df01f1cc289ed6454683cf
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Wed Feb 24 22:35:37 2021 -0500

    ath79: lzma-loader: allow setting custom kernel magic
    
    ...and max flash offset
    
    The mtdsplit parser was recently refactored
    to allow the kernel to have custom image header magic.
    
    Let's also do this for the lzma-loader
    
    For example:
    When implemented together,
    this allows the kernel to "appear" to be a rootfs
    by OEM software in order to write an image
    that is actually kernel + rootfs.
    
    At the same time,
    it would boot to openwrt normally
    by setting the same magic in DTS.
    
    Both of the variables
    have a default value that is unchanged
    when not defined in the makefiles
    
    This has no effect on the size of the loader
    when lzma compressed.
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
    (cherry picked from commit 1b8bd17c2d07c7397015a86941db9e114e1d349a)
---
 target/linux/ath79/image/Makefile                 | 6 +++++-
 target/linux/ath79/image/lzma-loader/Makefile     | 2 ++
 target/linux/ath79/image/lzma-loader/src/Makefile | 5 +++++
 target/linux/ath79/image/lzma-loader/src/loader.c | 4 ++++
 4 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/target/linux/ath79/image/Makefile b/target/linux/ath79/image/Makefile
index c2d2474336..d8b8800d91 100644
--- a/target/linux/ath79/image/Makefile
+++ b/target/linux/ath79/image/Makefile
@@ -4,6 +4,7 @@ include $(INCLUDE_DIR)/image.mk
 KERNEL_LOADADDR = 0x80060000
 
 DEVICE_VARS += LOADER_FLASH_OFFS LOADER_TYPE
+DEVICE_VARS += LOADER_FLASH_MAX LOADER_KERNEL_MAGIC
 DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_HW_ID
 DEVICE_VARS += RAS_BOARD RAS_ROOTFS_SIZE RAS_VERSION
 
@@ -30,7 +31,10 @@ define Build/loader-kernel
 endef
 
 define Build/loader-okli-compile
-	$(call Build/loader-common,FLASH_OFFS=$(LOADER_FLASH_OFFS) FLASH_MAX=0)
+	$(call Build/loader-common, \
+		FLASH_OFFS=$(LOADER_FLASH_OFFS) \
+		FLASH_MAX=$(LOADER_FLASH_MAX) \
+		KERNEL_MAGIC=$(LOADER_KERNEL_MAGIC) )
 endef
 
 # Arguments: <output name> <kernel offset>
diff --git a/target/linux/ath79/image/lzma-loader/Makefile b/target/linux/ath79/image/lzma-loader/Makefile
index 0ff59bc56a..2b1ed82a98 100644
--- a/target/linux/ath79/image/lzma-loader/Makefile
+++ b/target/linux/ath79/image/lzma-loader/Makefile
@@ -13,6 +13,7 @@ LOADADDR	:= 0x80060000
 LOADER		:= loader.bin
 LOADER_NAME	:= $(basename $(notdir $(LOADER)))
 LOADER_DATA	:=
+KERNEL_MAGIC	:=
 TARGET_DIR	:=
 FLASH_OFFS	:=
 FLASH_MAX	:=
@@ -41,6 +42,7 @@ loader-compile: $(PKG_BUILD_DIR)/.prepared
 		LZMA_TEXT_START=$(LZMA_TEXT_START) \
 		LOADADDR=$(LOADADDR) \
 		LOADER_DATA=$(LOADER_DATA) \
+		KERNEL_MAGIC=$(KERNEL_MAGIC) \
 		FLASH_OFFS=$(FLASH_OFFS) \
 		FLASH_MAX=$(FLASH_MAX) \
 		BOARD="$(BOARD)" \
diff --git a/target/linux/ath79/image/lzma-loader/src/Makefile b/target/linux/ath79/image/lzma-loader/src/Makefile
index 7773f027a2..c7bb935a03 100644
--- a/target/linux/ath79/image/lzma-loader/src/Makefile
+++ b/target/linux/ath79/image/lzma-loader/src/Makefile
@@ -18,6 +18,7 @@
 LOADADDR	:=
 LZMA_TEXT_START	:= 0x80a00000
 LOADER_DATA	:=
+KERNEL_MAGIC	:=
 BOARD		:=
 FLASH_OFFS	:=
 FLASH_MAX	:=
@@ -54,6 +55,10 @@ OBJECTS		+= data.o
 CFLAGS		+= -DLZMA_WRAPPER=1 -DLOADADDR=$(LOADADDR)
 endif
 
+ifneq ($(strip $(KERNEL_MAGIC)),)
+CFLAGS		+= -DCONFIG_KERNEL_MAGIC=$(KERNEL_MAGIC)
+endif
+
 ifneq ($(strip $(KERNEL_CMDLINE)),)
 CFLAGS		+= -DCONFIG_KERNEL_CMDLINE='"$(KERNEL_CMDLINE)"'
 endif
diff --git a/target/linux/ath79/image/lzma-loader/src/loader.c b/target/linux/ath79/image/lzma-loader/src/loader.c
index 794c4b6285..0213e94574 100644
--- a/target/linux/ath79/image/lzma-loader/src/loader.c
+++ b/target/linux/ath79/image/lzma-loader/src/loader.c
@@ -189,7 +189,11 @@ static void lzma_init_data(void)
 
 		p = flash_base + flash_ofs;
 		magic = get_be32(p);
+#ifdef CONFIG_KERNEL_MAGIC
+		if (magic == CONFIG_KERNEL_MAGIC) {
+#else
 		if (magic == IH_MAGIC_OKLI) {
+#endif
 			hdr = (struct image_header *) p;
 			break;
 		}


From lede-commits at lists.infradead.org  Fri Jun 11 00:01:31 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 11 Jun 2021 03:01:31 -0400
Subject: [openwrt/openwrt] ath79: rename 'engenius' Makefile definitions to
 'senao'
In-Reply-To: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
References: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
Message-ID: <mailman.4983.1623394901.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/a1b2815b5229fe009fab021a70635b034174a13f

commit a1b2815b5229fe009fab021a70635b034174a13f
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Fri Feb 12 13:24:32 2021 -0500

    ath79: rename 'engenius' Makefile definitions to 'senao'
    
    These recipes and definitions can apply
    to devices from other vendors
    with PCB boards or SDK produced by Senao
    not only the brand Engenius
    
    possible examples:
    Extreme Networks, WatchGuard, OpenMesh,
    Fortinet, ALLNET, OCEDO, Plasma Cloud, devolo, etc.
    
    so rename all of these items
    and move DEVICE_VENDOR from common to generic/tiny.mk
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
    (cherry picked from commit 70bf4a979c24a5db6f29f6dd691e20eb2345b4d0)
---
 .../image/{common-engenius.mk => common-senao.mk}  |  9 +++---
 target/linux/ath79/image/generic.mk                | 32 +++++++++++++---------
 target/linux/ath79/image/tiny.mk                   | 17 +++++++-----
 3 files changed, 33 insertions(+), 25 deletions(-)

diff --git a/target/linux/ath79/image/common-engenius.mk b/target/linux/ath79/image/common-senao.mk
similarity index 87%
rename from target/linux/ath79/image/common-engenius.mk
rename to target/linux/ath79/image/common-senao.mk
index 56e8f8cf67..dd1a53c969 100644
--- a/target/linux/ath79/image/common-engenius.mk
+++ b/target/linux/ath79/image/common-senao.mk
@@ -1,9 +1,9 @@
-DEVICE_VARS += ENGENIUS_IMGNAME
+DEVICE_VARS += SENAO_IMGNAME
 
 # This needs to make /tmp/_sys/sysupgrade.tgz an empty file prior to
 # sysupgrade, as otherwise it will implant the old configuration from
 # OEM firmware when writing rootfs from factory.bin
-define Build/engenius-tar-gz
+define Build/senao-tar-gz
 	-[ -f "$@" ] && \
 	mkdir -p $@.tmp && \
 	touch $@.tmp/failsafe.bin && \
@@ -18,8 +18,7 @@ define Build/engenius-tar-gz
 	rm -rf $@.tmp
 endef
 
-define Device/engenius_loader_okli
-  DEVICE_VENDOR := EnGenius
+define Device/senao_loader_okli
   KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49
   LOADER_TYPE := bin
   COMPILE := loader-$(1).bin loader-$(1).uImage
@@ -29,5 +28,5 @@ define Device/engenius_loader_okli
   IMAGES += factory.bin
   IMAGE/factory.bin := append-squashfs-fakeroot-be | pad-to $$$$(BLOCKSIZE) | \
 	append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \
-	check-size | engenius-tar-gz $$$$(ENGENIUS_IMGNAME)
+	check-size | senao-tar-gz $$$$(SENAO_IMGNAME)
 endef
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 872e797a31..f358d44064 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -1,6 +1,6 @@
 include ./common-buffalo.mk
-include ./common-engenius.mk
 include ./common-netgear.mk
+include ./common-senao.mk
 include ./common-tp-link.mk
 include ./common-yuncore.mk
 
@@ -989,34 +989,37 @@ endef
 TARGET_DEVICES += embeddedwireless_dorin
 
 define Device/engenius_eap1200h
-  $(Device/engenius_loader_okli)
+  $(Device/senao_loader_okli)
   SOC := qca9557
+  DEVICE_VENDOR := EnGenius
   DEVICE_MODEL := EAP1200H
   DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct
   IMAGE_SIZE := 11520k
   LOADER_FLASH_OFFS := 0x230000
-  ENGENIUS_IMGNAME := ar71xx-generic-eap1200h
+  SENAO_IMGNAME := ar71xx-generic-eap1200h
 endef
 TARGET_DEVICES += engenius_eap1200h
 
 define Device/engenius_eap300-v2
-  $(Device/engenius_loader_okli)
+  $(Device/senao_loader_okli)
   SOC := ar9341
+  DEVICE_VENDOR := EnGenius
   DEVICE_MODEL := EAP300
   DEVICE_VARIANT := v2
   IMAGE_SIZE := 12032k
   LOADER_FLASH_OFFS := 0x230000
-  ENGENIUS_IMGNAME := senao-eap300v2
+  SENAO_IMGNAME := senao-eap300v2
 endef
 TARGET_DEVICES += engenius_eap300-v2
 
 define Device/engenius_eap600
-  $(Device/engenius_loader_okli)
+  $(Device/senao_loader_okli)
   SOC := ar9344
+  DEVICE_VENDOR := EnGenius
   DEVICE_MODEL := EAP600
   IMAGE_SIZE := 12032k
   LOADER_FLASH_OFFS := 0x230000
-  ENGENIUS_IMGNAME := senao-eap600
+  SENAO_IMGNAME := senao-eap600
 endef
 TARGET_DEVICES += engenius_eap600
 
@@ -1047,36 +1050,39 @@ endef
 TARGET_DEVICES += engenius_ecb1750
 
 define Device/engenius_ecb600
-  $(Device/engenius_loader_okli)
+  $(Device/senao_loader_okli)
   SOC := ar9344
+  DEVICE_VENDOR := EnGenius
   DEVICE_MODEL := ECB600
   IMAGE_SIZE := 12032k
   LOADER_FLASH_OFFS := 0x230000
-  ENGENIUS_IMGNAME := senao-ecb600
+  SENAO_IMGNAME := senao-ecb600
 endef
 TARGET_DEVICES += engenius_ecb600
 
 define Device/engenius_ens202ext-v1
-  $(Device/engenius_loader_okli)
+  $(Device/senao_loader_okli)
   SOC := ar9341
+  DEVICE_VENDOR := EnGenius
   DEVICE_MODEL := ENS202EXT
   DEVICE_VARIANT := v1
   DEVICE_PACKAGES := rssileds
   IMAGE_SIZE := 12032k
   LOADER_FLASH_OFFS := 0x230000
-  ENGENIUS_IMGNAME := senao-ens202ext
+  SENAO_IMGNAME := senao-ens202ext
 endef
 TARGET_DEVICES += engenius_ens202ext-v1
 
 define Device/engenius_enstationac-v1
-  $(Device/engenius_loader_okli)
+  $(Device/senao_loader_okli)
   SOC := qca9557
+  DEVICE_VENDOR := EnGenius
   DEVICE_MODEL := EnStationAC
   DEVICE_VARIANT := v1
   DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct rssileds
   IMAGE_SIZE := 11520k
   LOADER_FLASH_OFFS := 0x230000
-  ENGENIUS_IMGNAME := ar71xx-generic-enstationac
+  SENAO_IMGNAME := ar71xx-generic-enstationac
 endef
 TARGET_DEVICES += engenius_enstationac-v1
 
diff --git a/target/linux/ath79/image/tiny.mk b/target/linux/ath79/image/tiny.mk
index 36d2818ad5..dec3cd368d 100644
--- a/target/linux/ath79/image/tiny.mk
+++ b/target/linux/ath79/image/tiny.mk
@@ -1,5 +1,5 @@
 include ./common-buffalo.mk
-include ./common-engenius.mk
+include ./common-senao.mk
 
 define Device/buffalo_whr-g301n
   $(Device/buffalo_common)
@@ -32,36 +32,39 @@ endef
 TARGET_DEVICES += dlink_dir-615-e4
 
 define Device/engenius_eap350-v1
-  $(Device/engenius_loader_okli)
+  $(Device/senao_loader_okli)
   SOC := ar7242
+  DEVICE_VENDOR := EnGenius
   DEVICE_MODEL := EAP350
   DEVICE_VARIANT := v1
   IMAGE_SIZE := 4864k
   LOADER_FLASH_OFFS := 0x1b0000
-  ENGENIUS_IMGNAME := senao-eap350
+  SENAO_IMGNAME := senao-eap350
 endef
 TARGET_DEVICES += engenius_eap350-v1
 
 define Device/engenius_ecb350-v1
-  $(Device/engenius_loader_okli)
+  $(Device/senao_loader_okli)
   SOC := ar7242
+  DEVICE_VENDOR := EnGenius
   DEVICE_MODEL := ECB350
   DEVICE_VARIANT := v1
   IMAGE_SIZE := 4864k
   LOADER_FLASH_OFFS := 0x1b0000
-  ENGENIUS_IMGNAME := senao-ecb350
+  SENAO_IMGNAME := senao-ecb350
 endef
 TARGET_DEVICES += engenius_ecb350-v1
 
 define Device/engenius_enh202-v1
-  $(Device/engenius_loader_okli)
+  $(Device/senao_loader_okli)
   SOC := ar7240
+  DEVICE_VENDOR := EnGenius
   DEVICE_MODEL := ENH202
   DEVICE_VARIANT := v1
   DEVICE_PACKAGES := rssileds
   IMAGE_SIZE := 4864k
   LOADER_FLASH_OFFS := 0x1b0000
-  ENGENIUS_IMGNAME := senao-enh202
+  SENAO_IMGNAME := senao-enh202
 endef
 TARGET_DEVICES += engenius_enh202-v1
 


From lede-commits at lists.infradead.org  Fri Jun 11 00:01:36 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 11 Jun 2021 03:01:36 -0400
Subject: [openwrt/openwrt]  ath79: remove 'fakeroot' for Senao devices
In-Reply-To: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
References: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
Message-ID: <mailman.4986.1623394902.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/64d845ef027b31f3dc8f1a6a692c960a3a8844f3

commit 64d845ef027b31f3dc8f1a6a692c960a3a8844f3
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Wed Feb 24 22:55:09 2021 -0500

    ath79: remove 'fakeroot' for Senao devices
    
    By using the same custom kernel header magic
    in both OKLI lzma-loader, DTS, and makefile
    this hack is not necessary anymore
    
    However, "rootfs" size and checksum
    must now be supplied by the factory.bin image
    through a script that is accepted by the OEM upgrade script.
    
    This is because Senao OEM scripts assume a squashfs header exists
    at the offset for the original "rootfs" partition
    which is actually the kernel + rootfs in this implementation,
    and takes size value from the header that would be there with hexdump,
    but this offset is now the uImage header instead.
    
    This frees up 1 eraseblock
    previously used by the "fakeroot" partition
    for bypassing the OEM image verification.
    
    Also, these Senao devices with a 'failsafe' partition
    and the tar-gz factory.bin platform would otherwise require
    flashing the new tar-gz sysupgrade.bin afterward.
    So this also prevents having to flash both images
    when starting from OEM or 'failsafe'
    
    the OEM upgrade script verifies the header magic numbers,
    but only the first two bytes.
    Example:
    
        [ "${magic_word_kernel}" = "2705" ] &&
        [ "${magic_word_rootfs}" = "7371" -o "${magic_word_rootfs}" = "6873" ] &&
        errcode="0"
    
    therefore picked the magic number
    0x73714f4b
    which is
    'sqOK'
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
    (cherry picked from commit 4a0cc5d4ef29a11914850c72158aca1e2a170fb0)
---
 target/linux/ath79/dts/ar724x_senao_loader.dtsi  | 12 +++---------
 target/linux/ath79/dts/ar934x_senao_loader.dtsi  | 12 +++---------
 target/linux/ath79/dts/qca955x_senao_loader.dtsi | 12 +++---------
 target/linux/ath79/image/common-senao.mk         | 15 +++++++++++----
 target/linux/ath79/image/generic.mk              | 24 ++++++++++++------------
 target/linux/ath79/image/tiny.mk                 | 12 ++++++------
 6 files changed, 38 insertions(+), 49 deletions(-)

diff --git a/target/linux/ath79/dts/ar724x_senao_loader.dtsi b/target/linux/ath79/dts/ar724x_senao_loader.dtsi
index fdc2726e6f..54dbec18b3 100644
--- a/target/linux/ath79/dts/ar724x_senao_loader.dtsi
+++ b/target/linux/ath79/dts/ar724x_senao_loader.dtsi
@@ -15,7 +15,7 @@
 
 			partition at 0 {
 				compatible = "openwrt,uimage", "denx,uimage";
-				openwrt,ih-magic = <IH_MAGIC_OKLI>;
+				openwrt,ih-magic = <0x73714f4b>;
 				label = "firmware";
 				reg = <0x0 0x0>;
 			};
@@ -64,15 +64,9 @@
 				reg = <0xb0000 0xf0000>;
 			};
 
-			partition at 1a0000 {
-				label = "fakeroot";
-				reg = <0x1a0000 0x10000>;
-				read-only;
-			};
-
-			fwconcat0: partition at 1b0000 {
+			fwconcat0: partition at 1a0000 {
 				label = "fwconcat0";
-				reg = <0x1b0000 0x4c0000>;
+				reg = <0x1a0000 0x4d0000>;
 			};
 
 			partition at 670000 {
diff --git a/target/linux/ath79/dts/ar934x_senao_loader.dtsi b/target/linux/ath79/dts/ar934x_senao_loader.dtsi
index aa8a36d242..35e5f13535 100644
--- a/target/linux/ath79/dts/ar934x_senao_loader.dtsi
+++ b/target/linux/ath79/dts/ar934x_senao_loader.dtsi
@@ -15,7 +15,7 @@
 
 			partition at 0 {
 				compatible = "openwrt,uimage", "denx,uimage";
-				openwrt,ih-magic = <IH_MAGIC_OKLI>;
+				openwrt,ih-magic = <0x73714f4b>;
 				label = "firmware";
 				reg = <0x0 0x0>;
 			};
@@ -68,15 +68,9 @@
 				reg = <0x0b0000 0x170000>;
 			};
 
-			partition at 220000 {
-				label = "fakeroot";
-				reg = <0x220000 0x010000>;
-				read-only;
-			};
-
-			fwconcat0: partition at 230000 {
+			fwconcat0: partition at 220000 {
 				label = "fwconcat0";
-				reg = <0x230000 0xbc0000>;
+				reg = <0x220000 0xbd0000>;
 			};
 
 			partition at df0000 {
diff --git a/target/linux/ath79/dts/qca955x_senao_loader.dtsi b/target/linux/ath79/dts/qca955x_senao_loader.dtsi
index 3f5fc0e938..77eabde80a 100644
--- a/target/linux/ath79/dts/qca955x_senao_loader.dtsi
+++ b/target/linux/ath79/dts/qca955x_senao_loader.dtsi
@@ -17,7 +17,7 @@
 
 			partition at 0 {
 				compatible = "openwrt,uimage", "denx,uimage";
-				openwrt,ih-magic = <IH_MAGIC_OKLI>;
+				openwrt,ih-magic = <0x73714f4b>;
 				label = "firmware";
 				reg = <0x0 0x0>;
 			};
@@ -66,15 +66,9 @@
 				reg = <0x0b0000 0x170000>;
 			};
 
-			partition at 220000 {
-				label = "fakeroot";
-				reg = <0x220000 0x010000>;
-				read-only;
-			};
-
-			fwconcat0: partition at 230000 {
+			fwconcat0: partition at 220000 {
 				label = "fwconcat0";
-				reg = <0x230000 0xb40000>;
+				reg = <0x220000 0xb50000>;
 			};
 
 			partition at d70000 {
diff --git a/target/linux/ath79/image/common-senao.mk b/target/linux/ath79/image/common-senao.mk
index dd1a53c969..9b5903d8e7 100644
--- a/target/linux/ath79/image/common-senao.mk
+++ b/target/linux/ath79/image/common-senao.mk
@@ -3,30 +3,37 @@ DEVICE_VARS += SENAO_IMGNAME
 # This needs to make /tmp/_sys/sysupgrade.tgz an empty file prior to
 # 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
+# the header does not exist, therefore, supply the size and md5
 define Build/senao-tar-gz
 	-[ -f "$@" ] && \
 	mkdir -p $@.tmp && \
 	touch $@.tmp/failsafe.bin && \
 	echo '#!/bin/sh' > $@.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 && \
+	echo '#!/bin/sh' > $@.tmp/after-upgrade.sh && \
+	printf 'fw_setenv rootfs_size 0x%08x\n' $$(cat $@.len) >> $@.tmp/after-upgrade.sh && \
+	printf 'fw_setenv rootfs_checksum %s\n' $$(cat $@.md5) >> $@.tmp/after-upgrade.sh && \
 	$(CP) $(KDIR)/loader-$(DEVICE_NAME).uImage \
 		$@.tmp/openwrt-$(word 1,$(1))-uImage-lzma.bin && \
 	$(CP) $@ $@.tmp/openwrt-$(word 1,$(1))-root.squashfs && \
 	$(TAR) -cp --numeric-owner --owner=0 --group=0 --mode=a-s --sort=name \
 		$(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
 		-C $@.tmp . | gzip -9n > $@ && \
-	rm -rf $@.tmp
+	rm -rf $@.tmp $@.len $@.md5
 endef
 
 define Device/senao_loader_okli
-  KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x4f4b4c49
+  KERNEL := kernel-bin | append-dtb | lzma | uImage lzma -M 0x73714f4b
+  LOADER_KERNEL_MAGIC := 0x73714f4b
   LOADER_TYPE := bin
   COMPILE := loader-$(1).bin loader-$(1).uImage
   COMPILE/loader-$(1).bin := loader-okli-compile
   COMPILE/loader-$(1).uImage := append-loader-okli $(1) | pad-to 64k | lzma | \
 	uImage lzma
   IMAGES += factory.bin
-  IMAGE/factory.bin := append-squashfs-fakeroot-be | pad-to $$$$(BLOCKSIZE) | \
-	append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \
+  IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \
 	check-size | senao-tar-gz $$$$(SENAO_IMGNAME)
 endef
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index f358d44064..bda47ce74d 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -994,8 +994,8 @@ define Device/engenius_eap1200h
   DEVICE_VENDOR := EnGenius
   DEVICE_MODEL := EAP1200H
   DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct
-  IMAGE_SIZE := 11520k
-  LOADER_FLASH_OFFS := 0x230000
+  IMAGE_SIZE := 11584k
+  LOADER_FLASH_OFFS := 0x220000
   SENAO_IMGNAME := ar71xx-generic-eap1200h
 endef
 TARGET_DEVICES += engenius_eap1200h
@@ -1006,8 +1006,8 @@ define Device/engenius_eap300-v2
   DEVICE_VENDOR := EnGenius
   DEVICE_MODEL := EAP300
   DEVICE_VARIANT := v2
-  IMAGE_SIZE := 12032k
-  LOADER_FLASH_OFFS := 0x230000
+  IMAGE_SIZE := 12096k
+  LOADER_FLASH_OFFS := 0x220000
   SENAO_IMGNAME := senao-eap300v2
 endef
 TARGET_DEVICES += engenius_eap300-v2
@@ -1017,8 +1017,8 @@ define Device/engenius_eap600
   SOC := ar9344
   DEVICE_VENDOR := EnGenius
   DEVICE_MODEL := EAP600
-  IMAGE_SIZE := 12032k
-  LOADER_FLASH_OFFS := 0x230000
+  IMAGE_SIZE := 12096k
+  LOADER_FLASH_OFFS := 0x220000
   SENAO_IMGNAME := senao-eap600
 endef
 TARGET_DEVICES += engenius_eap600
@@ -1054,8 +1054,8 @@ define Device/engenius_ecb600
   SOC := ar9344
   DEVICE_VENDOR := EnGenius
   DEVICE_MODEL := ECB600
-  IMAGE_SIZE := 12032k
-  LOADER_FLASH_OFFS := 0x230000
+  IMAGE_SIZE := 12096k
+  LOADER_FLASH_OFFS := 0x220000
   SENAO_IMGNAME := senao-ecb600
 endef
 TARGET_DEVICES += engenius_ecb600
@@ -1067,8 +1067,8 @@ define Device/engenius_ens202ext-v1
   DEVICE_MODEL := ENS202EXT
   DEVICE_VARIANT := v1
   DEVICE_PACKAGES := rssileds
-  IMAGE_SIZE := 12032k
-  LOADER_FLASH_OFFS := 0x230000
+  IMAGE_SIZE := 12096k
+  LOADER_FLASH_OFFS := 0x220000
   SENAO_IMGNAME := senao-ens202ext
 endef
 TARGET_DEVICES += engenius_ens202ext-v1
@@ -1080,8 +1080,8 @@ define Device/engenius_enstationac-v1
   DEVICE_MODEL := EnStationAC
   DEVICE_VARIANT := v1
   DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct rssileds
-  IMAGE_SIZE := 11520k
-  LOADER_FLASH_OFFS := 0x230000
+  IMAGE_SIZE := 11584k
+  LOADER_FLASH_OFFS := 0x220000
   SENAO_IMGNAME := ar71xx-generic-enstationac
 endef
 TARGET_DEVICES += engenius_enstationac-v1
diff --git a/target/linux/ath79/image/tiny.mk b/target/linux/ath79/image/tiny.mk
index dec3cd368d..e9aab2ce06 100644
--- a/target/linux/ath79/image/tiny.mk
+++ b/target/linux/ath79/image/tiny.mk
@@ -37,8 +37,8 @@ define Device/engenius_eap350-v1
   DEVICE_VENDOR := EnGenius
   DEVICE_MODEL := EAP350
   DEVICE_VARIANT := v1
-  IMAGE_SIZE := 4864k
-  LOADER_FLASH_OFFS := 0x1b0000
+  IMAGE_SIZE := 4928k
+  LOADER_FLASH_OFFS := 0x1a0000
   SENAO_IMGNAME := senao-eap350
 endef
 TARGET_DEVICES += engenius_eap350-v1
@@ -49,8 +49,8 @@ define Device/engenius_ecb350-v1
   DEVICE_VENDOR := EnGenius
   DEVICE_MODEL := ECB350
   DEVICE_VARIANT := v1
-  IMAGE_SIZE := 4864k
-  LOADER_FLASH_OFFS := 0x1b0000
+  IMAGE_SIZE := 4928k
+  LOADER_FLASH_OFFS := 0x1a0000
   SENAO_IMGNAME := senao-ecb350
 endef
 TARGET_DEVICES += engenius_ecb350-v1
@@ -62,8 +62,8 @@ define Device/engenius_enh202-v1
   DEVICE_MODEL := ENH202
   DEVICE_VARIANT := v1
   DEVICE_PACKAGES := rssileds
-  IMAGE_SIZE := 4864k
-  LOADER_FLASH_OFFS := 0x1b0000
+  IMAGE_SIZE := 4928k
+  LOADER_FLASH_OFFS := 0x1a0000
   SENAO_IMGNAME := senao-enh202
 endef
 TARGET_DEVICES += engenius_enh202-v1


From lede-commits at lists.infradead.org  Fri Jun 11 00:01:34 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 11 Jun 2021 03:01:34 -0400
Subject: [openwrt/openwrt]  ath79: create common DTSI for Senao qca955x APs
In-Reply-To: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
References: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
Message-ID: <mailman.4987.1623394902.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/08ec7acbc3637ea99e249834578019efb0408f08

commit 08ec7acbc3637ea99e249834578019efb0408f08
Author: Adrian Schmutzler <freifunk at adrianschmutzler.de>
AuthorDate: Wed Feb 24 13:14:12 2021 +0100

    ath79: create common DTSI for Senao qca955x APs
    
    This creates a shared DTSI for qca955x Senao/Engenius APs with
    concatenated firmware partition/okli loader:
    
     - EAP1200H
     - EnstationAC v1
    
    To make this usable for future boards with 32 MB flash as well,
    split the partitions node already.
    
    Suggested-by: Michael Pratt <mcpratt at pm.me>
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
    (cherry picked from commit 9b37db5caacdb46710ce6bfc8d37ae2ad02b843b)
---
 .../linux/ath79/dts/qca9557_engenius_eap1200h.dts  | 91 ++--------------------
 .../ath79/dts/qca9557_engenius_enstationac-v1.dts  | 91 ++--------------------
 target/linux/ath79/dts/qca955x_senao_loader.dtsi   | 89 +++++++++++++++++++++
 3 files changed, 101 insertions(+), 170 deletions(-)

diff --git a/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts b/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts
index a7a77141e5..5a86da4bb3 100644
--- a/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts
+++ b/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts
@@ -1,10 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "qca955x.dtsi"
+#include "qca955x_senao_loader.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
-#include <dt-bindings/mtd/partitions/uimage.h>
 
 / {
 	compatible = "engenius,eap1200h", "qca,qca9557";
@@ -55,91 +54,13 @@
 			gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
 		};
 	};
-
-	virtual_flash {
-		compatible = "mtd-concat";
-
-		devices = <&fwconcat0 &fwconcat1>;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				compatible = "openwrt,uimage", "denx,uimage";
-				openwrt,ih-magic = <IH_MAGIC_OKLI>;
-				label = "firmware";
-				reg = <0x0 0x0>;
-			};
-		};
-	};
 };
 
-&spi {
-	status = "okay";
-
-	flash at 0 {
-		compatible = "jedec,spi-nor";
-		reg = <0>;
-		spi-max-frequency = <40000000>;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				label = "u-boot";
-				reg = <0x000000 0x040000>;
-				read-only;
-			};
-
-			partition at 40000 {
-				label = "u-boot-env";
-				reg = <0x040000 0x010000>;
-			};
-
-			partition at 50000 {
-				label = "custom";
-				reg = <0x050000 0x050000>;
-				read-only;
-			};
-
-			partition at a0000 {
-				label = "loader";
-				reg = <0x0a0000 0x010000>;
-				read-only;
-			};
-
-			fwconcat1: partition at b0000 {
-				label = "fwconcat1";
-				reg = <0x0b0000 0x170000>;
-			};
-
-			partition at 220000 {
-				label = "fakeroot";
-				reg = <0x220000 0x010000>;
-				read-only;
-			};
-
-			fwconcat0: partition at 230000 {
-				label = "fwconcat0";
-				reg = <0x230000 0xb40000>;
-			};
-
-			partition at d70000 {
-				label = "failsafe";
-				reg = <0xd70000 0x280000>;
-				read-only;
-			};
-
-			art: partition at ff0000 {
-				label = "art";
-				reg = <0xff0000 0x010000>;
-				read-only;
-			};
-		};
+&partitions {
+	art: partition at ff0000 {
+		label = "art";
+		reg = <0xff0000 0x010000>;
+		read-only;
 	};
 };
 
diff --git a/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts b/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts
index af397dfd3a..6956996866 100644
--- a/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts
+++ b/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts
@@ -1,10 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "qca955x.dtsi"
+#include "qca955x_senao_loader.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
-#include <dt-bindings/mtd/partitions/uimage.h>
 
 / {
 	compatible = "engenius,enstationac-v1", "qca,qca9557";
@@ -59,91 +58,13 @@
 			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
 		};
 	};
-
-	virtual_flash {
-		compatible = "mtd-concat";
-
-		devices = <&fwconcat0 &fwconcat1>;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				compatible = "openwrt,uimage", "denx,uimage";
-				openwrt,ih-magic = <IH_MAGIC_OKLI>;
-				label = "firmware";
-				reg = <0x0 0x0>;
-			};
-		};
-	};
 };
 
-&spi {
-	status = "okay";
-
-	flash at 0 {
-		compatible = "jedec,spi-nor";
-		reg = <0>;
-		spi-max-frequency = <40000000>;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				label = "u-boot";
-				reg = <0x000000 0x040000>;
-				read-only;
-			};
-
-			partition at 40000 {
-				label = "u-boot-env";
-				reg = <0x040000 0x010000>;
-			};
-
-			partition at 50000 {
-				label = "custom";
-				reg = <0x050000 0x050000>;
-				read-only;
-			};
-
-			partition at a0000 {
-				label = "loader";
-				reg = <0x0a0000 0x010000>;
-				read-only;
-			};
-
-			fwconcat1: partition at b0000 {
-				label = "fwconcat1";
-				reg = <0x0b0000 0x170000>;
-			};
-
-			partition at 220000 {
-				label = "fakeroot";
-				reg = <0x220000 0x010000>;
-				read-only;
-			};
-
-			fwconcat0: partition at 230000 {
-				label = "fwconcat0";
-				reg = <0x230000 0xb40000>;
-			};
-
-			partition at d70000 {
-				label = "failsafe";
-				reg = <0xd70000 0x280000>;
-				read-only;
-			};
-
-			art: partition at ff0000 {
-				label = "art";
-				reg = <0xff0000 0x010000>;
-				read-only;
-			};
-		};
+&partitions {
+	art: partition at ff0000 {
+		label = "art";
+		reg = <0xff0000 0x010000>;
+		read-only;
 	};
 };
 
diff --git a/target/linux/ath79/dts/qca955x_senao_loader.dtsi b/target/linux/ath79/dts/qca955x_senao_loader.dtsi
new file mode 100644
index 0000000000..3f5fc0e938
--- /dev/null
+++ b/target/linux/ath79/dts/qca955x_senao_loader.dtsi
@@ -0,0 +1,89 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qca955x.dtsi"
+
+#include <dt-bindings/mtd/partitions/uimage.h>
+
+/ {
+	virtual_flash {
+		compatible = "mtd-concat";
+
+		devices = <&fwconcat0 &fwconcat1>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				compatible = "openwrt,uimage", "denx,uimage";
+				openwrt,ih-magic = <IH_MAGIC_OKLI>;
+				label = "firmware";
+				reg = <0x0 0x0>;
+			};
+		};
+	};
+};
+
+&spi {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <40000000>;
+
+		partitions: partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x000000 0x040000>;
+				read-only;
+			};
+
+			partition at 40000 {
+				label = "u-boot-env";
+				reg = <0x040000 0x010000>;
+			};
+
+			partition at 50000 {
+				label = "custom";
+				reg = <0x050000 0x050000>;
+				read-only;
+			};
+
+			partition at a0000 {
+				label = "loader";
+				reg = <0x0a0000 0x010000>;
+				read-only;
+			};
+
+			fwconcat1: partition at b0000 {
+				label = "fwconcat1";
+				reg = <0x0b0000 0x170000>;
+			};
+
+			partition at 220000 {
+				label = "fakeroot";
+				reg = <0x220000 0x010000>;
+				read-only;
+			};
+
+			fwconcat0: partition at 230000 {
+				label = "fwconcat0";
+				reg = <0x230000 0xb40000>;
+			};
+
+			partition at d70000 {
+				label = "failsafe";
+				reg = <0xd70000 0x280000>;
+				read-only;
+			};
+
+			/* additional partitions in device DTS files */
+		};
+	};
+};


From lede-commits at lists.infradead.org  Fri Jun 11 00:01:40 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 11 Jun 2021 03:01:40 -0400
Subject: [openwrt/openwrt]  ath79: cleanup DTS for ALLNET ALL-WAP02860AC
In-Reply-To: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
References: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
Message-ID: <mailman.4988.1623394902.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/518adcfe777d7d954e65548ed7d0a174e6be32dd

commit 518adcfe777d7d954e65548ed7d0a174e6be32dd
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Mon Feb 15 15:37:06 2021 -0500

    ath79: cleanup DTS for ALLNET ALL-WAP02860AC
    
    use qca955x_senao_loader.dtsi
    because it is the same hardware / partitioning
    and some cleanup
    
    Effects:
    
    nodes to match similar boards
     - keys
     - eth0
     - pcie0
    
    bumps SPI frequency to 40 MHz
    
    removes &pll node:
    the property is defined in qca955x.dtsi
    
    removes qca,no-eeprom:
    has no effect with mtd-cal-data property
    (also spelling)
    
    Tested-by: Tomasz Maciej Nowak <tmn505 at gmail.com>
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
    (cherry picked from commit e800da9d5c87d276806284cf2183994ea7fe083e)
---
 .../ath79/dts/qca9558_allnet_all-wap02860ac.dts    | 109 ++++-----------------
 1 file changed, 17 insertions(+), 92 deletions(-)

diff --git a/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts
index 3afbc04ddf..5c6051d6f4 100644
--- a/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts
+++ b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts
@@ -1,14 +1,13 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "qca955x.dtsi"
+#include "qca955x_senao_loader.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
-#include <dt-bindings/mtd/partitions/uimage.h>
 
 / {
-	model = "ALLNET ALL-WAP02860AC";
 	compatible = "allnet,all-wap02860ac", "qca,qca9558";
+	model = "ALLNET ALL-WAP02860AC";
 
 	aliases {
 		label-mac-device = &eth0;
@@ -23,8 +22,9 @@
 
 		reset {
 			label = "reset";
-			linux,code = <KEY_RESTART>;
 			gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+			debounce-interval = <60>;
+			linux,code = <KEY_RESTART>;
 		};
 	};
 
@@ -54,35 +54,17 @@
 			gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
 		};
 	};
-
-	virtual_flash {
-		compatible = "mtd-concat";
-
-		devices = <&fwconcat0 &fwconcat1>;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				compatible = "openwrt,uimage", "denx,uimage";
-				openwrt,ih-magic = <0x73714f4b>;
-				label = "firmware";
-				reg = <0x0 0x0>;
-			};
-		};
-	};
 };
 
 &eth0 {
 	status = "okay";
 
-	pll-data = <0x8e000000 0x80000101 0x80001313>;
+	mtd-mac-address = <&art 0x0>;
+
 	phy-handle = <&phy5>;
-	phy-mode = "rgmii-rxid";
+	phy-mode = "rgmii-id";
 
-	mtd-mac-address = <&art 0x0>;
+	pll-data = <0x82000000 0x80000101 0x80001313>;
 };
 
 &mdio0 {
@@ -95,76 +77,20 @@
 	};
 };
 
-&pcie0 {
-	status = "okay";
-
-	wifi at 0,0 {
-		compatible = "qcom,ath10k";
-		reg = <0 0 0 0 0>;
+&partitions {
+	art: partition at ff0000 {
+		label = "art";
+		reg = <0xff0000 0x010000>;
+		read-only;
 	};
 };
 
-&pll {
-	clocks = <&extosc>;
-};
-
-&spi {
+&pcie0 {
 	status = "okay";
 
-	flash at 0 {
-		compatible = "jedec,spi-nor";
-		reg = <0>;
-		spi-max-frequency = <25000000>;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				label = "u-boot";
-				reg = <0x000000 0x040000>;
-				read-only;
-			};
-
-			partition at 40000 {
-				label = "u-boot-env";
-				reg = <0x040000 0x010000>;
-			};
-
-			partition at 50000 {
-				label = "custom";
-				reg = <0x050000 0x050000>;
-				read-only;
-			};
-
-			partition at a0000 {
-				label = "loader";
-				reg = <0x0a0000 0x010000>;
-			};
-
-			fwconcat1: partition at b0000 {
-				label = "fwconcat1";
-				reg = <0x0b0000 0x170000>;
-			};
-
-			fwconcat0: partition at 220000 {
-				label = "fwconcat0";
-				reg = <0x220000 0xb50000>;
-			};
-
-			partition at d70000 {
-				label = "failsafe";
-				reg = <0xd70000 0x280000>;
-				read-only;
-			};
-
-			art: partition at ff0000 {
-				label = "art";
-				reg = <0xff0000 0x010000>;
-				read-only;
-			};
-		};
+	wifi at 0,0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0x0 0 0 0 0>;
 	};
 };
 
@@ -174,5 +100,4 @@
 	mtd-cal-data = <&art 0x1000>;
 	mtd-mac-address = <&art 0x0>;
 	mtd-mac-address-increment = <1>;
-	qca-no-eeprom;
 };


From lede-commits at lists.infradead.org  Fri Jun 11 00:01:39 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 11 Jun 2021 03:01:39 -0400
Subject: [openwrt/openwrt] ath79: add factory.bin for ALLNET ALL-WAP02860AC
In-Reply-To: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
References: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
Message-ID: <mailman.4989.1623394902.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/a97f4f3b2997fb3e10c711062b4eeaf9cb9da613

commit a97f4f3b2997fb3e10c711062b4eeaf9cb9da613
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Fri Feb 12 18:58:00 2021 -0500

    ath79: add factory.bin for ALLNET ALL-WAP02860AC
    
    This device is a Senao-based product
    using hardware and software from Senao
    with the tar-gz platform for factory.bin
    and checksum verification at boot time
    using variables stored in uboot environment
    and a 'failsafe' image when it fails.
    
    Extremely similar hardware/software to Engenius EAP1200H
    and other Engenius APs with qca955x
    
    Tested-by: Tomasz Maciej Nowak <tmn505 at gmail.com>
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
    (cherry picked from commit 37ea5d9a658a15783b0ac68583db9e67a43e960d)
---
 .../ath79/dts/qca9558_allnet_all-wap02860ac.dts    | 35 ++++++++++++++++++++--
 .../generic/base-files/lib/upgrade/platform.sh     |  1 +
 target/linux/ath79/image/generic.mk                |  5 +++-
 3 files changed, 37 insertions(+), 4 deletions(-)

diff --git a/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts
index ba6be49fce..3afbc04ddf 100644
--- a/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts
+++ b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts
@@ -4,6 +4,7 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/mtd/partitions/uimage.h>
 
 / {
 	model = "ALLNET ALL-WAP02860AC";
@@ -53,6 +54,25 @@
 			gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
 		};
 	};
+
+	virtual_flash {
+		compatible = "mtd-concat";
+
+		devices = <&fwconcat0 &fwconcat1>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				compatible = "openwrt,uimage", "denx,uimage";
+				openwrt,ih-magic = <0x73714f4b>;
+				label = "firmware";
+				reg = <0x0 0x0>;
+			};
+		};
+	};
 };
 
 &eth0 {
@@ -119,9 +139,18 @@
 			};
 
 			partition at a0000 {
-				compatible = "denx,uimage";
-				label = "firmware";
-				reg = <0x0a0000 0xcd0000>;
+				label = "loader";
+				reg = <0x0a0000 0x010000>;
+			};
+
+			fwconcat1: partition at b0000 {
+				label = "fwconcat1";
+				reg = <0x0b0000 0x170000>;
+			};
+
+			fwconcat0: partition at 220000 {
+				label = "fwconcat0";
+				reg = <0x220000 0xb50000>;
 			};
 
 			partition at d70000 {
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 19699332fc..f8b1c13677 100644
--- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
@@ -47,6 +47,7 @@ platform_do_upgrade() {
 	adtran,bsap1840)
 		redboot_fis_do_upgrade "$1" vmlinux_2
 		;;
+	allnet,all-wap02860ac|\
 	engenius,eap1200h|\
 	engenius,eap300-v2|\
 	engenius,eap600|\
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index bda47ce74d..303907e5bb 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -290,11 +290,14 @@ endef
 TARGET_DEVICES += alfa-network_r36a
 
 define Device/allnet_all-wap02860ac
+  $(Device/senao_loader_okli)
   SOC := qca9558
   DEVICE_VENDOR := ALLNET
   DEVICE_MODEL := ALL-WAP02860AC
   DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct
-  IMAGE_SIZE := 13120k
+  IMAGE_SIZE := 11584k
+  LOADER_FLASH_OFFS := 0x220000
+  SENAO_IMGNAME := senao-allwap02860ac
 endef
 TARGET_DEVICES += allnet_all-wap02860ac
 


From lede-commits at lists.infradead.org  Fri Jun 11 00:01:38 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 11 Jun 2021 03:01:38 -0400
Subject: [openwrt/openwrt] ath79: add Senao 'failsafe' sysupgrade procedure
In-Reply-To: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
References: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
Message-ID: <mailman.4992.1623394902.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/e823fb1763a3b08c64ff68852279a28b33f4cc1a

commit e823fb1763a3b08c64ff68852279a28b33f4cc1a
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Fri Feb 12 18:19:10 2021 -0500

    ath79: add Senao 'failsafe' sysupgrade procedure
    
    Use a similar upgrade method for sysupgrade.bin, like factory.bin,
    for Senao boards with the tar.gz OEM upgrade platform,
    and 'failsafe' image which is loaded on checksum failure.
    
    This is inspired by the OEM upgrade script /etc/fwupgrade.sh
    and the existing platforms for dual-boot Senao boards.
    
    Previously, if the real kernel was damaged or missing
    the only way to recover was with UART serial console,
    because the OKLI lzma-loader is programmed to halt.
    
    uboot did not detect cases where kernel or rootfs is damaged
    and boots OKLI instead of the failsafe image,
    because the checksums stored in uboot environment
    did not include the real kernel and rootfs space.
    
    Now, the stored checksums include the space for both
    the lzma-loader, kernel, and rootfs.
    Therefore, these boards are now practically unbrickable.
    
    Also, the factory.bin and sysupgrade.bin are now the same,
    except for image metadata.
    This allows for flashing OEM image directly from openwrt
    as well as flashing openwrt image directly from OEM.
    
    Make 'loader' partition writable so that it can be updated
    during a sysupgrade.
    
    tested with
    ENS202EXT v1
    EAP1200H
    EAP350 v1
    EAP600
    ECB350 v1
    ECB600
    ENH202 v1
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
    (cherry picked from commit d5035f0d2694cb9c5a93ed72e3b6d2dd1770741e)
---
 target/linux/ath79/dts/ar724x_senao_loader-4k.dtsi |  1 -
 .../linux/ath79/dts/ar724x_senao_loader-64k.dtsi   |  1 -
 target/linux/ath79/dts/ar934x_senao_loader.dtsi    |  1 -
 target/linux/ath79/dts/qca955x_senao_loader.dtsi   |  1 -
 .../base-files/lib/upgrade/failsafe_datachk.sh     | 64 ++++++++++++++++++++++
 .../generic/base-files/lib/upgrade/platform.sh     | 14 +++++
 target/linux/ath79/image/common-senao.mk           |  1 +
 .../base-files/lib/upgrade/failsafe_datachk.sh     | 64 ++++++++++++++++++++++
 .../ath79/tiny/base-files/lib/upgrade/platform.sh  | 14 +++++
 9 files changed, 157 insertions(+), 4 deletions(-)

diff --git a/target/linux/ath79/dts/ar724x_senao_loader-4k.dtsi b/target/linux/ath79/dts/ar724x_senao_loader-4k.dtsi
index 501ff26859..0dff79eb46 100644
--- a/target/linux/ath79/dts/ar724x_senao_loader-4k.dtsi
+++ b/target/linux/ath79/dts/ar724x_senao_loader-4k.dtsi
@@ -56,7 +56,6 @@
 			partition at a0000 {
 				label = "loader";
 				reg = <0xa0000 0x1000>;
-				read-only;
 			};
 
 			fwconcat1: partition at a1000 {
diff --git a/target/linux/ath79/dts/ar724x_senao_loader-64k.dtsi b/target/linux/ath79/dts/ar724x_senao_loader-64k.dtsi
index 54dbec18b3..831f0385a9 100644
--- a/target/linux/ath79/dts/ar724x_senao_loader-64k.dtsi
+++ b/target/linux/ath79/dts/ar724x_senao_loader-64k.dtsi
@@ -56,7 +56,6 @@
 			partition at a0000 {
 				label = "loader";
 				reg = <0xa0000 0x10000>;
-				read-only;
 			};
 
 			fwconcat1: partition at b0000 {
diff --git a/target/linux/ath79/dts/ar934x_senao_loader.dtsi b/target/linux/ath79/dts/ar934x_senao_loader.dtsi
index 35e5f13535..8247cc85dc 100644
--- a/target/linux/ath79/dts/ar934x_senao_loader.dtsi
+++ b/target/linux/ath79/dts/ar934x_senao_loader.dtsi
@@ -60,7 +60,6 @@
 			partition at a0000 {
 				label = "loader";
 				reg = <0x0a0000 0x010000>;
-				read-only;
 			};
 
 			fwconcat1: partition at b0000 {
diff --git a/target/linux/ath79/dts/qca955x_senao_loader.dtsi b/target/linux/ath79/dts/qca955x_senao_loader.dtsi
index 77eabde80a..846d3ed0af 100644
--- a/target/linux/ath79/dts/qca955x_senao_loader.dtsi
+++ b/target/linux/ath79/dts/qca955x_senao_loader.dtsi
@@ -58,7 +58,6 @@
 			partition at a0000 {
 				label = "loader";
 				reg = <0x0a0000 0x010000>;
-				read-only;
 			};
 
 			fwconcat1: partition at b0000 {
diff --git a/target/linux/ath79/generic/base-files/lib/upgrade/failsafe_datachk.sh b/target/linux/ath79/generic/base-files/lib/upgrade/failsafe_datachk.sh
new file mode 100644
index 0000000000..de84233de1
--- /dev/null
+++ b/target/linux/ath79/generic/base-files/lib/upgrade/failsafe_datachk.sh
@@ -0,0 +1,64 @@
+# U-Boot with the datachk patchset requires image sizes, offsets,
+# and checksums to be provided in the U-Boot environment.
+# This script is based on the dualboot version for devices that come with 2 OS partitions.
+# For Senao boards with a "failsafe" partition image, the process is almost the same.
+# Instead of booting a secondary instalation on checksum failure,
+# the failsafe image is booted instead.
+# These boards also use the OKLI lzma kernel loader and mtd-concat
+# So the kernel check is for the loader, the rootfs check is for kernel + rootfs
+
+platform_do_upgrade_failsafe_datachk() {
+	local setenv_script="/tmp/fw_env_upgrade"
+
+	local flash_base=0x9f000000
+
+	local kernel_mtd=$(find_mtd_index ${KERNEL_PART:-kernel})
+	local rootfs_mtd=$(find_mtd_index ${ROOTFS_PART:-rootfs})
+
+	local kernel_offset=$(cat /sys/class/mtd/mtd${kernel_mtd}/offset)
+	local rootfs_offset=$(cat /sys/class/mtd/mtd${rootfs_mtd}/offset)
+
+	if [ -n "$IMAGE_LIST" ]; then
+		KERNEL_FILE=$($IMAGE_LIST | grep $KERNEL_FILE)
+		ROOTFS_FILE=$($IMAGE_LIST | grep $ROOTFS_FILE)
+	fi
+
+	local kernel_size=$($IMAGE_CMD $KERNEL_FILE | wc -c)
+	local rootfs_size=$($IMAGE_CMD $ROOTFS_FILE | wc -c)
+
+	# rootfs without JFFS2
+	local rootfs_blocks=$((rootfs_size / 4096))
+	rootfs_size=$((rootfs_blocks * 4096))
+
+	local kernel_md5=$($IMAGE_CMD $KERNEL_FILE | md5sum | cut -d ' ' -f1)
+	local rootfs_md5=$($IMAGE_CMD $ROOTFS_FILE | dd bs=4k count=$rootfs_blocks iflag=fullblock | md5sum | cut -d ' ' -f1)
+
+	# prepare new u-boot-env vars
+	printf "vmlinux_start_addr 0x%08x\n" $((flash_base + kernel_offset)) >> $setenv_script
+	printf "vmlinux_size 0x%08x\n" ${kernel_size} >> $setenv_script
+	printf "vmlinux_checksum %s\n" ${kernel_md5} >> $setenv_script
+
+	printf "rootfs_start_addr 0x%08x\n" $((flash_base + rootfs_offset)) >> $setenv_script
+	printf "rootfs_size 0x%08x\n" ${rootfs_size} >> $setenv_script
+	printf "rootfs_checksum %s\n" ${rootfs_md5} >> $setenv_script
+
+	# store u-boot-env
+	mkdir -p /var/lock
+	fw_setenv -s $setenv_script || {
+		echo 'failed to update U-Boot environment'
+		exit 1
+	}
+
+	# sysupgrade
+	sleep 2
+	sync
+	echo 3 > /proc/sys/vm/drop_caches
+	$IMAGE_CMD $KERNEL_FILE | mtd $MTD_ARGS write - ${KERNEL_PART:-kernel}
+	sleep 2
+	sync
+	if [ -n "$UPGRADE_BACKUP" ]; then
+		$IMAGE_CMD $ROOTFS_FILE | mtd $MTD_ARGS $MTD_CONFIG_ARGS -j $UPGRADE_BACKUP write - ${ROOTFS_PART:-rootfs}
+	else
+		$IMAGE_CMD $ROOTFS_FILE | mtd $MTD_ARGS write - ${ROOTFS_PART:-rootfs}
+	fi
+}
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 575761d079..19699332fc 100644
--- a/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ath79/generic/base-files/lib/upgrade/platform.sh
@@ -47,6 +47,20 @@ platform_do_upgrade() {
 	adtran,bsap1840)
 		redboot_fis_do_upgrade "$1" vmlinux_2
 		;;
+	engenius,eap1200h|\
+	engenius,eap300-v2|\
+	engenius,eap600|\
+	engenius,ecb600|\
+	engenius,ens202ext-v1|\
+	engenius,enstationac-v1)
+		IMAGE_LIST="tar tzf $1"
+		IMAGE_CMD="tar xzOf $1"
+		KERNEL_PART="loader"
+		ROOTFS_PART="fwconcat0"
+		KERNEL_FILE="uImage-lzma.bin"
+		ROOTFS_FILE="root.squashfs"
+		platform_do_upgrade_failsafe_datachk "$1"
+		;;
 	jjplus,ja76pf2)
 		redboot_fis_do_upgrade "$1" linux
 		;;
diff --git a/target/linux/ath79/image/common-senao.mk b/target/linux/ath79/image/common-senao.mk
index 9b5903d8e7..6784cf9aae 100644
--- a/target/linux/ath79/image/common-senao.mk
+++ b/target/linux/ath79/image/common-senao.mk
@@ -36,4 +36,5 @@ define Device/senao_loader_okli
   IMAGES += factory.bin
   IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \
 	check-size | senao-tar-gz $$$$(SENAO_IMGNAME)
+  IMAGE/sysupgrade.bin := $$(IMAGE/factory.bin) | append-metadata
 endef
diff --git a/target/linux/ath79/tiny/base-files/lib/upgrade/failsafe_datachk.sh b/target/linux/ath79/tiny/base-files/lib/upgrade/failsafe_datachk.sh
new file mode 100644
index 0000000000..de84233de1
--- /dev/null
+++ b/target/linux/ath79/tiny/base-files/lib/upgrade/failsafe_datachk.sh
@@ -0,0 +1,64 @@
+# U-Boot with the datachk patchset requires image sizes, offsets,
+# and checksums to be provided in the U-Boot environment.
+# This script is based on the dualboot version for devices that come with 2 OS partitions.
+# For Senao boards with a "failsafe" partition image, the process is almost the same.
+# Instead of booting a secondary instalation on checksum failure,
+# the failsafe image is booted instead.
+# These boards also use the OKLI lzma kernel loader and mtd-concat
+# So the kernel check is for the loader, the rootfs check is for kernel + rootfs
+
+platform_do_upgrade_failsafe_datachk() {
+	local setenv_script="/tmp/fw_env_upgrade"
+
+	local flash_base=0x9f000000
+
+	local kernel_mtd=$(find_mtd_index ${KERNEL_PART:-kernel})
+	local rootfs_mtd=$(find_mtd_index ${ROOTFS_PART:-rootfs})
+
+	local kernel_offset=$(cat /sys/class/mtd/mtd${kernel_mtd}/offset)
+	local rootfs_offset=$(cat /sys/class/mtd/mtd${rootfs_mtd}/offset)
+
+	if [ -n "$IMAGE_LIST" ]; then
+		KERNEL_FILE=$($IMAGE_LIST | grep $KERNEL_FILE)
+		ROOTFS_FILE=$($IMAGE_LIST | grep $ROOTFS_FILE)
+	fi
+
+	local kernel_size=$($IMAGE_CMD $KERNEL_FILE | wc -c)
+	local rootfs_size=$($IMAGE_CMD $ROOTFS_FILE | wc -c)
+
+	# rootfs without JFFS2
+	local rootfs_blocks=$((rootfs_size / 4096))
+	rootfs_size=$((rootfs_blocks * 4096))
+
+	local kernel_md5=$($IMAGE_CMD $KERNEL_FILE | md5sum | cut -d ' ' -f1)
+	local rootfs_md5=$($IMAGE_CMD $ROOTFS_FILE | dd bs=4k count=$rootfs_blocks iflag=fullblock | md5sum | cut -d ' ' -f1)
+
+	# prepare new u-boot-env vars
+	printf "vmlinux_start_addr 0x%08x\n" $((flash_base + kernel_offset)) >> $setenv_script
+	printf "vmlinux_size 0x%08x\n" ${kernel_size} >> $setenv_script
+	printf "vmlinux_checksum %s\n" ${kernel_md5} >> $setenv_script
+
+	printf "rootfs_start_addr 0x%08x\n" $((flash_base + rootfs_offset)) >> $setenv_script
+	printf "rootfs_size 0x%08x\n" ${rootfs_size} >> $setenv_script
+	printf "rootfs_checksum %s\n" ${rootfs_md5} >> $setenv_script
+
+	# store u-boot-env
+	mkdir -p /var/lock
+	fw_setenv -s $setenv_script || {
+		echo 'failed to update U-Boot environment'
+		exit 1
+	}
+
+	# sysupgrade
+	sleep 2
+	sync
+	echo 3 > /proc/sys/vm/drop_caches
+	$IMAGE_CMD $KERNEL_FILE | mtd $MTD_ARGS write - ${KERNEL_PART:-kernel}
+	sleep 2
+	sync
+	if [ -n "$UPGRADE_BACKUP" ]; then
+		$IMAGE_CMD $ROOTFS_FILE | mtd $MTD_ARGS $MTD_CONFIG_ARGS -j $UPGRADE_BACKUP write - ${ROOTFS_PART:-rootfs}
+	else
+		$IMAGE_CMD $ROOTFS_FILE | mtd $MTD_ARGS write - ${ROOTFS_PART:-rootfs}
+	fi
+}
diff --git a/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh b/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh
index b02ab9a080..6d05b88d45 100644
--- a/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh
@@ -5,6 +5,9 @@
 PART_NAME=firmware
 REQUIRE_IMAGE_METADATA=1
 
+RAMFS_COPY_BIN='fw_setenv'
+RAMFS_COPY_DATA='/etc/fw_env.config'
+
 platform_check_image() {
 	return 0
 }
@@ -13,6 +16,17 @@ platform_do_upgrade() {
 	local board=$(board_name)
 
 	case "$board" in
+	engenius,eap350-v1|\
+	engenius,ecb350-v1|\
+	engenius,enh202-v1)
+		IMAGE_LIST="tar tzf $1"
+		IMAGE_CMD="tar xzOf $1"
+		KERNEL_PART="loader"
+		ROOTFS_PART="fwconcat0"
+		KERNEL_FILE="uImage-lzma.bin"
+		ROOTFS_FILE="root.squashfs"
+		platform_do_upgrade_failsafe_datachk "$1"
+		;;
 	*)
 		default_do_upgrade "$1"
 		;;


From lede-commits at lists.infradead.org  Fri Jun 11 00:01:32 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 11 Jun 2021 03:01:32 -0400
Subject: [openwrt/openwrt]  ath79: create common DTSI for Senao ar724x APs
In-Reply-To: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
References: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
Message-ID: <mailman.4993.1623394905.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/a49686c9481890f9ca4e7a4ab8609d12ca3b472a

commit a49686c9481890f9ca4e7a4ab8609d12ca3b472a
Author: Adrian Schmutzler <freifunk at adrianschmutzler.de>
AuthorDate: Mon Feb 15 17:41:36 2021 +0100

    ath79: create common DTSI for Senao ar724x APs
    
    This creates a shared DTSI for ar724x Senao/Engenius APs:
    
     - ENH202 v1
     - EAP350 v1
     - ECB350 v1
    
    Since ar7240/ar7242 have different configuration, this new file
    mostly contains the partitioning.
    
    Suggested-by: Michael Pratt <mcpratt at pm.me>
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
    (cherry picked from commit 4204d70d7a1123fdf11d3f5b1f46143639fa58a6)
---
 .../linux/ath79/dts/ar7240_engenius_enh202-v1.dts  | 88 +---------------------
 .../linux/ath79/dts/ar7242_engenius_eap350-v1.dts  | 88 +---------------------
 .../linux/ath79/dts/ar7242_engenius_ecb350-v1.dts  | 88 +---------------------
 ...nius_eap350-v1.dts => ar724x_senao_loader.dtsi} | 81 --------------------
 4 files changed, 3 insertions(+), 342 deletions(-)

diff --git a/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts b/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts
index 51d4a0601d..89b6746c61 100644
--- a/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts
+++ b/target/linux/ath79/dts/ar7240_engenius_enh202-v1.dts
@@ -1,10 +1,10 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
 #include "ar7240.dtsi"
+#include "ar724x_senao_loader.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
-#include <dt-bindings/mtd/partitions/uimage.h>
 
 / {
 	compatible = "engenius,enh202-v1", "qca,ar7240";
@@ -69,92 +69,6 @@
 			linux,default-trigger = "phy0tpt";
 		};
 	};
-
-	virtual_flash {
-		compatible = "mtd-concat";
-
-		devices = <&fwconcat0 &fwconcat1>;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				compatible = "openwrt,uimage", "denx,uimage";
-				openwrt,ih-magic = <IH_MAGIC_OKLI>;
-				label = "firmware";
-				reg = <0x0 0x0>;
-			};
-		};
-	};
-};
-
-&spi {
-	status = "okay";
-
-	flash at 0 {
-		compatible = "jedec,spi-nor";
-		reg = <0>;
-		spi-max-frequency = <20000000>;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				label = "u-boot";
-				reg = <0x0 0x40000>;
-				read-only;
-			};
-
-			partition at 40000 {
-				label = "u-boot-env";
-				reg = <0x40000 0x10000>;
-			};
-
-			partition at 50000 {
-				label = "custom";
-				reg = <0x50000 0x50000>;
-				read-only;
-			};
-
-			partition at a0000 {
-				label = "loader";
-				reg = <0xa0000 0x10000>;
-				read-only;
-			};
-
-			fwconcat1: partition at b0000 {
-				label = "fwconcat1";
-				reg = <0xb0000 0xf0000>;
-			};
-
-			partition at 1a0000 {
-				label = "fakeroot";
-				reg = <0x1a0000 0x10000>;
-				read-only;
-			};
-
-			fwconcat0: partition at 1b0000 {
-				label = "fwconcat0";
-				reg = <0x1b0000 0x4c0000>;
-			};
-
-			partition at 670000 {
-				label = "failsafe";
-				reg = <0x670000 0x180000>;
-				read-only;
-			};
-
-			art: partition at 7f0000 {
-				label = "art";
-				reg = <0x7f0000 0x10000>;
-				read-only;
-			};
-		};
-	};
 };
 
 &eth0 {
diff --git a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts
index 07d7e4914e..be0f7cbc43 100644
--- a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts
+++ b/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts
@@ -1,10 +1,10 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
 #include "ar7242.dtsi"
+#include "ar724x_senao_loader.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
-#include <dt-bindings/mtd/partitions/uimage.h>
 
 / {
 	compatible = "engenius,eap350-v1", "qca,ar7242";
@@ -48,92 +48,6 @@
 			linux,default-trigger = "phy0tpt";
 		};
 	};
-
-	virtual_flash {
-		compatible = "mtd-concat";
-
-		devices = <&fwconcat0 &fwconcat1>;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				compatible = "openwrt,uimage", "denx,uimage";
-				openwrt,ih-magic = <IH_MAGIC_OKLI>;
-				label = "firmware";
-				reg = <0x0 0x0>;
-			};
-		};
-	};
-};
-
-&spi {
-	status = "okay";
-
-	flash at 0 {
-		compatible = "jedec,spi-nor";
-		reg = <0>;
-		spi-max-frequency = <20000000>;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				label = "u-boot";
-				reg = <0x0 0x40000>;
-				read-only;
-			};
-
-			partition at 40000 {
-				label = "u-boot-env";
-				reg = <0x40000 0x10000>;
-			};
-
-			partition at 50000 {
-				label = "custom";
-				reg = <0x50000 0x50000>;
-				read-only;
-			};
-
-			partition at a0000 {
-				label = "loader";
-				reg = <0xa0000 0x10000>;
-				read-only;
-			};
-
-			fwconcat1: partition at b0000 {
-				label = "fwconcat1";
-				reg = <0xb0000 0xf0000>;
-			};
-
-			partition at 1a0000 {
-				label = "fakeroot";
-				reg = <0x1a0000 0x10000>;
-				read-only;
-			};
-
-			fwconcat0: partition at 1b0000 {
-				label = "fwconcat0";
-				reg = <0x1b0000 0x4c0000>;
-			};
-
-			partition at 670000 {
-				label = "failsafe";
-				reg = <0x670000 0x180000>;
-				read-only;
-			};
-
-			art: partition at 7f0000 {
-				label = "art";
-				reg = <0x7f0000 0x10000>;
-				read-only;
-			};
-		};
-	};
 };
 
 &mdio0 {
diff --git a/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts
index ca488223af..55343e786a 100644
--- a/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts
+++ b/target/linux/ath79/dts/ar7242_engenius_ecb350-v1.dts
@@ -1,10 +1,10 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
 #include "ar7242.dtsi"
+#include "ar724x_senao_loader.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
-#include <dt-bindings/mtd/partitions/uimage.h>
 
 / {
 	compatible = "engenius,ecb350-v1", "qca,ar7242";
@@ -48,92 +48,6 @@
 			linux,default-trigger = "phy0tpt";
 		};
 	};
-
-	virtual_flash {
-		compatible = "mtd-concat";
-
-		devices = <&fwconcat0 &fwconcat1>;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				compatible = "openwrt,uimage", "denx,uimage";
-				openwrt,ih-magic = <IH_MAGIC_OKLI>;
-				label = "firmware";
-				reg = <0x0 0x0>;
-			};
-		};
-	};
-};
-
-&spi {
-	status = "okay";
-
-	flash at 0 {
-		compatible = "jedec,spi-nor";
-		reg = <0>;
-		spi-max-frequency = <20000000>;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				label = "u-boot";
-				reg = <0x0 0x40000>;
-				read-only;
-			};
-
-			partition at 40000 {
-				label = "u-boot-env";
-				reg = <0x40000 0x10000>;
-			};
-
-			partition at 50000 {
-				label = "custom";
-				reg = <0x50000 0x50000>;
-				read-only;
-			};
-
-			partition at a0000 {
-				label = "loader";
-				reg = <0xa0000 0x10000>;
-				read-only;
-			};
-
-			fwconcat1: partition at b0000 {
-				label = "fwconcat1";
-				reg = <0xb0000 0xf0000>;
-			};
-
-			partition at 1a0000 {
-				label = "fakeroot";
-				reg = <0x1a0000 0x10000>;
-				read-only;
-			};
-
-			fwconcat0: partition at 1b0000 {
-				label = "fwconcat0";
-				reg = <0x1b0000 0x4c0000>;
-			};
-
-			partition at 670000 {
-				label = "failsafe";
-				reg = <0x670000 0x180000>;
-				read-only;
-			};
-
-			art: partition at 7f0000 {
-				label = "art";
-				reg = <0x7f0000 0x10000>;
-				read-only;
-			};
-		};
-	};
 };
 
 &mdio0 {
diff --git a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts b/target/linux/ath79/dts/ar724x_senao_loader.dtsi
similarity index 53%
copy from target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts
copy to target/linux/ath79/dts/ar724x_senao_loader.dtsi
index 07d7e4914e..fdc2726e6f 100644
--- a/target/linux/ath79/dts/ar7242_engenius_eap350-v1.dts
+++ b/target/linux/ath79/dts/ar724x_senao_loader.dtsi
@@ -1,54 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "ar7242.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
 #include <dt-bindings/mtd/partitions/uimage.h>
 
 / {
-	compatible = "engenius,eap350-v1", "qca,ar7242";
-	model = "EnGenius EAP350 v1";
-
-	aliases {
-		label-mac-device = &eth0;
-		led-boot = &led_power;
-		led-failsafe = &led_power;
-		led-running = &led_power;
-		led-upgrade = &led_power;
-	};
-
-	keys {
-		compatible = "gpio-keys";
-
-		reset {
-			label = "reset";
-			gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
-			debounce-interval = <60>;
-			linux,code = <KEY_RESTART>;
-		};
-	};
-
-	leds {
-		compatible = "gpio-leds";
-
-		led_power: power {
-			label = "blue:power";
-			gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
-			default-state = "on";
-		};
-	};
-
-	ath9k-leds {
-		compatible = "gpio-leds";
-
-		wlan {
-			label = "blue:wlan";
-			gpios = <&ath9k 1 GPIO_ACTIVE_LOW>;
-			linux,default-trigger = "phy0tpt";
-		};
-	};
-
 	virtual_flash {
 		compatible = "mtd-concat";
 
@@ -135,38 +89,3 @@
 		};
 	};
 };
-
-&mdio0 {
-	status = "okay";
-
-	phy4: ethernet-phy at 4 {
-		reg = <4>;
-		eee-broken-100tx;
-		eee-broken-1000t;
-	};
-};
-
-&eth0 {
-	status = "okay";
-
-	mtd-mac-address = <&art 0x0>;
-
-	phy-handle = <&phy4>;
-	phy-mode = "rgmii-id";
-
-	pll-data = <0x02000000 0x00000101 0x00001313>;
-};
-
-&pcie {
-	status = "okay";
-
-	ath9k: wifi at 0,0,0 {
-		compatible = "pci168c,002a";
-		reg = <0x0 0 0 0 0>;
-		mtd-mac-address = <&art 0x0>;
-		mtd-mac-address-increment = <1>;
-		qca,no-eeprom;
-		#gpio-cells = <2>;
-		gpio-controller;
-	};
-};


From lede-commits at lists.infradead.org  Fri Jun 11 00:05:51 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 11 Jun 2021 03:05:51 -0400
Subject: [openwrt/openwrt]  Revert "ci: build test ath79/generic"
In-Reply-To: <162339515130.31308.1132297275277221327@git-01.infra.openwrt.org>
References: <162339515130.31308.1132297275277221327@git-01.infra.openwrt.org>
Message-ID: <mailman.4994.1623395155.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/1a8de9cbf91fe1f2550140f4254bc310a99ccd39

commit 1a8de9cbf91fe1f2550140f4254bc310a99ccd39
Author: Petr ?tetiar <ynezz at true.cz>
AuthorDate: Fri Jun 11 09:04:59 2021 +0200

    Revert "ci: build test ath79/generic"
    
    This reverts commit 16d6288c6337dc30ed03e3566aa593225945f4e7 which was
    accidentally commited.
    
    Signed-off-by: Petr ?tetiar <ynezz at true.cz>
---
 .gitlab-ci.yml | 25 -------------------------
 1 file changed, 25 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
deleted file mode 100644
index 13e0f7d510..0000000000
--- a/.gitlab-ci.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-include:
-  - remote: https://gitlab.com/ynezz/openwrt-ci/raw/master/openwrt-ci/gitlab/main.yml
-  - remote: https://gitlab.com/ynezz/openwrt-ci/raw/master/openwrt-ci/gitlab/target.yml
-
-variables:
-  CI_TARGET_BUILD_NEEDS_FEEDS: yep
-  CI_TARGET_BUILD_DOWNLOAD_URL: https://downloads.openwrt.org/releases/21.02.0-rc2/targets
-  CI_TARGET_BUILD_CONFIG_EXTRA: -IB -SDK +BUILD_LOG -PACKAGE_kmod-acx-mac80211
-
-
-.autoscale:
-  extends: .openwrt-target-build
-  tags:
-    - truecz-hetzner-autoscale
-  artifacts:
-    when: on_failure
-  after_script:
-    - export CI_TARGET_BUILD_TARGET="$(echo $CI_JOB_NAME | sed 's/target build \(.*\) .*/\1/')"
-    - export CI_TARGET_BUILD_SUBTARGET="$(echo $CI_JOB_NAME | sed 's/target build .* \(.*\)/\1/')"
-    - curl https://foo.true.cz/dump/mc > /bin/mcli && chmod +x /bin/mcli
-    - mcli alias set foo "$MINIO_URL" "$MINIO_ACCESS_KEY" "$MINIO_SECRET_KEY"
-    - mcli cp --recursive logs bin "foo/openwrt/staging-builds/$CI_COMMIT_REF_SLUG/$CI_COMMIT_SHORT_SHA/$CI_TARGET_BUILD_TARGET-$CI_TARGET_BUILD_SUBTARGET/"
-
-target build ath79 generic:
-  extends: .autoscale


From lede-commits at lists.infradead.org  Fri Jun 11 00:01:41 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 11 Jun 2021 03:01:41 -0400
Subject: [openwrt/openwrt] ath79: move pcie node to DTSI for qca955x Senao APs
In-Reply-To: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
References: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
Message-ID: <mailman.5001.1623396238.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/349a4f453146d2022b7c5856d011d0807b95ae44

commit 349a4f453146d2022b7c5856d011d0807b95ae44
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Sat Feb 27 14:18:42 2021 -0500

    ath79: move pcie node to DTSI for qca955x Senao APs
    
    pcie0 is the same for this generation of Senao APs
    while eth0, eth1, and wmac can differ
    
    the qca,no-eeprom property has no effect
    for the ath10k drivers
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
    (cherry picked from commit 15c599c9dfa9cf5459bcc15b773e39891ca14340)
---
 target/linux/ath79/dts/qca9557_engenius_eap1200h.dts       | 10 ----------
 target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts | 10 ----------
 target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts   |  9 ---------
 target/linux/ath79/dts/qca955x_senao_loader.dtsi           |  9 +++++++++
 4 files changed, 9 insertions(+), 29 deletions(-)

diff --git a/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts b/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts
index 5a86da4bb3..80298a9d82 100644
--- a/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts
+++ b/target/linux/ath79/dts/qca9557_engenius_eap1200h.dts
@@ -85,16 +85,6 @@
 	pll-data = <0x82000000 0x80000101 0x80001313>;
 };
 
-&pcie0 {
-	status = "okay";
-
-	wifi at 0,0,0 {
-		compatible = "qcom,ath10k";
-		reg = <0x0 0 0 0 0>;
-		qca,no-eeprom;
-	};
-};
-
 &wmac {
 	status = "okay";
 
diff --git a/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts b/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts
index 6956996866..5da50ff6d9 100644
--- a/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts
+++ b/target/linux/ath79/dts/qca9557_engenius_enstationac-v1.dts
@@ -108,13 +108,3 @@
 
 	qca955x-sgmii-fixup;
 };
-
-&pcie0 {
-	status = "okay";
-
-	wifi at 0,0,0 {
-		compatible = "qcom,ath10k";
-		reg = <0x0 0 0 0 0>;
-		qca,no-eeprom;
-	};
-};
diff --git a/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts
index 5c6051d6f4..973cb16efb 100644
--- a/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts
+++ b/target/linux/ath79/dts/qca9558_allnet_all-wap02860ac.dts
@@ -85,15 +85,6 @@
 	};
 };
 
-&pcie0 {
-	status = "okay";
-
-	wifi at 0,0,0 {
-		compatible = "qcom,ath10k";
-		reg = <0x0 0 0 0 0>;
-	};
-};
-
 &wmac {
 	status = "okay";
 
diff --git a/target/linux/ath79/dts/qca955x_senao_loader.dtsi b/target/linux/ath79/dts/qca955x_senao_loader.dtsi
index 846d3ed0af..ac9f03ec65 100644
--- a/target/linux/ath79/dts/qca955x_senao_loader.dtsi
+++ b/target/linux/ath79/dts/qca955x_senao_loader.dtsi
@@ -25,6 +25,15 @@
 	};
 };
 
+&pcie0 {
+	status = "okay";
+
+	wifi at 0,0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0x0 0 0 0 0>;
+	};
+};
+
 &spi {
 	status = "okay";
 


From lede-commits at lists.infradead.org  Fri Jun 11 00:01:42 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 11 Jun 2021 03:01:42 -0400
Subject: [openwrt/openwrt] ath79: set lzma-loader variables to null by default
In-Reply-To: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
References: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
Message-ID: <mailman.5004.1623396241.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/02b7b773329a2956fec6f5a08d97c3c69aa18964

commit 02b7b773329a2956fec6f5a08d97c3c69aa18964
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Sat May 8 17:34:30 2021 -0400

    ath79: set lzma-loader variables to null by default
    
    This fixes a small regression where the lzma-loader variable values
    are being shared between boards that require different configurations.
    
    If not set to "" globally, a device without these settings will just take
    the last values another device has set before in the queue.
    
    Fixes: 1b8bd17c2d07 ("ath79: lzma-loader: allow setting custom kernel magic")
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
    [add detailed explanation to the commit message]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
    (cherry picked from commit bf8c16dfa2cddd529f889510ca5fa5160606c325)
---
 target/linux/ath79/image/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/linux/ath79/image/Makefile b/target/linux/ath79/image/Makefile
index d8b8800d91..3c126f479e 100644
--- a/target/linux/ath79/image/Makefile
+++ b/target/linux/ath79/image/Makefile
@@ -70,6 +70,10 @@ define Device/Default
   BLOCKSIZE := 64k
   KERNEL := kernel-bin | append-dtb | lzma | uImage lzma
   KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma
+  LOADER_KERNEL_MAGIC :=
+  LOADER_FLASH_MAX :=
+  LOADER_FLASH_OFFS :=
+  LOADER_TYPE :=
   COMPILE :=
   IMAGES := sysupgrade.bin
   IMAGE/sysupgrade.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | \


From lede-commits at lists.infradead.org  Fri Jun 11 00:01:43 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 11 Jun 2021 03:01:43 -0400
Subject: [openwrt/openwrt]  ci: build test ath79/generic
In-Reply-To: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
References: <162339489140.28032.11112250327716366257@git-01.infra.openwrt.org>
Message-ID: <mailman.5005.1623396244.434944.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/16d6288c6337dc30ed03e3566aa593225945f4e7

commit 16d6288c6337dc30ed03e3566aa593225945f4e7
Author: Petr ?tetiar <ynezz at true.cz>
AuthorDate: Tue Jun 8 08:33:04 2021 +0200

    ci: build test ath79/generic
    
    Signed-off-by: Petr ?tetiar <ynezz at true.cz>
---
 .gitlab-ci.yml | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000000..13e0f7d510
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,25 @@
+include:
+  - remote: https://gitlab.com/ynezz/openwrt-ci/raw/master/openwrt-ci/gitlab/main.yml
+  - remote: https://gitlab.com/ynezz/openwrt-ci/raw/master/openwrt-ci/gitlab/target.yml
+
+variables:
+  CI_TARGET_BUILD_NEEDS_FEEDS: yep
+  CI_TARGET_BUILD_DOWNLOAD_URL: https://downloads.openwrt.org/releases/21.02.0-rc2/targets
+  CI_TARGET_BUILD_CONFIG_EXTRA: -IB -SDK +BUILD_LOG -PACKAGE_kmod-acx-mac80211
+
+
+.autoscale:
+  extends: .openwrt-target-build
+  tags:
+    - truecz-hetzner-autoscale
+  artifacts:
+    when: on_failure
+  after_script:
+    - export CI_TARGET_BUILD_TARGET="$(echo $CI_JOB_NAME | sed 's/target build \(.*\) .*/\1/')"
+    - export CI_TARGET_BUILD_SUBTARGET="$(echo $CI_JOB_NAME | sed 's/target build .* \(.*\)/\1/')"
+    - curl https://foo.true.cz/dump/mc > /bin/mcli && chmod +x /bin/mcli
+    - mcli alias set foo "$MINIO_URL" "$MINIO_ACCESS_KEY" "$MINIO_SECRET_KEY"
+    - mcli cp --recursive logs bin "foo/openwrt/staging-builds/$CI_COMMIT_REF_SLUG/$CI_COMMIT_SHORT_SHA/$CI_TARGET_BUILD_TARGET-$CI_TARGET_BUILD_SUBTARGET/"
+
+target build ath79 generic:
+  extends: .autoscale


From lede-commits at lists.infradead.org  Sat Jun 12 01:47:11 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 12 Jun 2021 04:47:11 -0400
Subject: [openwrt/openwrt]  u-boot: support verbose build
In-Reply-To: <162348762974.10834.16074232639814668112@git-01.infra.openwrt.org>
References: <162348762974.10834.16074232639814668112@git-01.infra.openwrt.org>
Message-ID: <mailman.5230.1623487635.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/a85aaa1bc299301ad741b6ef94d7580c9095f1be

commit a85aaa1bc299301ad741b6ef94d7580c9095f1be
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sat Aug 29 22:24:59 2020 +0200

    u-boot: support verbose build
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 include/u-boot.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/u-boot.mk b/include/u-boot.mk
index ec9fb15b6c..c0a1e87bf3 100644
--- a/include/u-boot.mk
+++ b/include/u-boot.mk
@@ -44,7 +44,8 @@ TARGET_DEP = TARGET_$(BUILD_TARGET)$(if $(BUILD_SUBTARGET),_$(BUILD_SUBTARGET))
 UBOOT_MAKE_FLAGS = \
 	HOSTCC="$(HOSTCC)" \
 	HOSTCFLAGS="$(HOST_CFLAGS) $(HOST_CPPFLAGS) -std=gnu11" \
-	HOSTLDFLAGS="$(HOST_LDFLAGS)"
+	HOSTLDFLAGS="$(HOST_LDFLAGS)" \
+	$(if $(findstring c,$(OPENWRT_VERBOSE)),V=1,V='')
 
 define Build/U-Boot/Target
   $(eval $(call U-Boot/Init,$(1)))


From lede-commits at lists.infradead.org  Sat Jun 12 01:47:13 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 12 Jun 2021 04:47:13 -0400
Subject: [openwrt/openwrt]  package: fix cmake packages build with ninja
In-Reply-To: <162348762974.10834.16074232639814668112@git-01.infra.openwrt.org>
References: <162348762974.10834.16074232639814668112@git-01.infra.openwrt.org>
Message-ID: <mailman.5231.1623487635.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/09de28090cfb3fb605e6f4b452503a4ec2c6c43f

commit 09de28090cfb3fb605e6f4b452503a4ec2c6c43f
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sun Jun 6 14:24:43 2021 -0700

    package: fix cmake packages build with ninja
    
    += is needed for CMAKE_OPTIONS.
    
    mt76 needs Ninja disabled as the kernel stuff uses normal make.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 package/kernel/mt76/Makefile             | 1 +
 package/libs/libubox/Makefile            | 2 +-
 package/network/services/uhttpd/Makefile | 2 +-
 package/system/ubus/Makefile             | 2 +-
 package/system/uci/Makefile              | 2 +-
 5 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile
index e4051d8347..74d5950545 100644
--- a/package/kernel/mt76/Makefile
+++ b/package/kernel/mt76/Makefile
@@ -13,6 +13,7 @@ PKG_SOURCE_VERSION:=22b690334c0f49b11534cc2e331c9d5e17c4a0bc
 PKG_MIRROR_HASH:=ff5e563935919d2e40c1e7254ef3bc06f7ecc5e69f8ddd12903e8f5de942d630
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
+PKG_USE_NINJA:=0
 PKG_BUILD_PARALLEL:=1
 
 PKG_CONFIG_DEPENDS += \
diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile
index ac4effb6f8..aec4c9cc02 100644
--- a/package/libs/libubox/Makefile
+++ b/package/libs/libubox/Makefile
@@ -67,7 +67,7 @@ define Package/libubox-lua
 endef
 
 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
-CMAKE_OPTIONS = \
+CMAKE_OPTIONS += \
 	-DLUAPATH=/usr/lib/lua \
 	-DABIVERSION="$(PKG_ABI_VERSION)"
 
diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile
index 87b3690515..8f58271127 100644
--- a/package/network/services/uhttpd/Makefile
+++ b/package/network/services/uhttpd/Makefile
@@ -85,7 +85,7 @@ endif
 
 TARGET_LDFLAGS += -lcrypt
 
-CMAKE_OPTIONS = -DTLS_SUPPORT=on
+CMAKE_OPTIONS += -DTLS_SUPPORT=on
 
 define Package/uhttpd/install
 	$(INSTALL_DIR) $(1)/etc/init.d
diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile
index 885307107b..a29521e9a5 100644
--- a/package/system/ubus/Makefile
+++ b/package/system/ubus/Makefile
@@ -53,7 +53,7 @@ endef
 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include -flto
 TARGET_LDFLAGS += -flto
 
-CMAKE_OPTIONS = \
+CMAKE_OPTIONS += \
 	-DLUAPATH=/usr/lib/lua \
 	-DABIVERSION="$(PKG_ABI_VERSION)"
 
diff --git a/package/system/uci/Makefile b/package/system/uci/Makefile
index 3c1e168717..cdb6883bc1 100644
--- a/package/system/uci/Makefile
+++ b/package/system/uci/Makefile
@@ -55,7 +55,7 @@ endef
 TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include
 TARGET_LDFLAGS += -L$(STAGING_DIR)/usr/lib
 
-CMAKE_OPTIONS = \
+CMAKE_OPTIONS += \
 	-DLUAPATH=/usr/lib/lua \
 	$(if $(DEBUG),-DUCI_DEBUG=ON)
 


From lede-commits at lists.infradead.org  Sat Jun 12 01:47:14 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 12 Jun 2021 04:47:14 -0400
Subject: [openwrt/openwrt]  build: use ninja for cmake packages by default
In-Reply-To: <162348762974.10834.16074232639814668112@git-01.infra.openwrt.org>
References: <162348762974.10834.16074232639814668112@git-01.infra.openwrt.org>
Message-ID: <mailman.5232.1623487637.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/0c7c24d40aedcee25d5243e25a87d38246be128b

commit 0c7c24d40aedcee25d5243e25a87d38246be128b
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Jun 10 14:01:04 2021 +0200

    build: use ninja for cmake packages by default
    
    Speed goes from:
    
    Executed in     178.08 secs     fish            external
    usr time        20.16 mins      509.00 micros   20.16 mins
    sys time        2.88 mins       39.00 micros    2.88 mins
    
    To:
    
    Executed in     175.90 secs     fish            external
    usr time        20.19 mins      0.00 micros     20.19 mins
    sys time        2.85 mins       497.00 micros   2.85 mins
    
    Tested with "time make -j 12" on AMD Ryzen 3600
    
    When building individual packages, the build time difference is often
    significantly bigger than that.
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 include/cmake.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/cmake.mk b/include/cmake.mk
index 8a1c4fc4d5..7ccd872365 100644
--- a/include/cmake.mk
+++ b/include/cmake.mk
@@ -1,5 +1,7 @@
 cmake_bool = $(patsubst %,-D%:BOOL=$(if $($(1)),ON,OFF),$(2))
 
+PKG_USE_NINJA ?= 1
+HOST_USE_NINJA ?= 1
 ifeq ($(PKG_USE_NINJA),1)
   PKG_BUILD_PARALLEL ?= 1
 endif


From lede-commits at lists.infradead.org  Sat Jun 12 01:47:09 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 12 Jun 2021 04:47:09 -0400
Subject: [openwrt/openwrt]  mac80211: improve rate control performance
In-Reply-To: <162348762974.10834.16074232639814668112@git-01.infra.openwrt.org>
References: <162348762974.10834.16074232639814668112@git-01.infra.openwrt.org>
Message-ID: <mailman.5233.1623487637.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/7dd8829ef915f1c5fc728be8f8360c61ddaadf1b

commit 7dd8829ef915f1c5fc728be8f8360c61ddaadf1b
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Jun 6 20:57:39 2021 +0200

    mac80211: improve rate control performance
    
    Call rate control handler after intermediate queueuing
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...all-ieee80211_tx_h_rate_ctrl-when-dequeue.patch | 114 +++++++++++++++++++++
 1 file changed, 114 insertions(+)

diff --git a/package/kernel/mac80211/patches/subsys/374-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch b/package/kernel/mac80211/patches/subsys/374-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch
new file mode 100644
index 0000000000..49b1212213
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/374-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch
@@ -0,0 +1,114 @@
+From: Ryder Lee <ryder.lee at mediatek.com>
+Date: Fri, 28 May 2021 14:05:41 +0800
+Subject: [PATCH] mac80211: call ieee80211_tx_h_rate_ctrl() when dequeue
+
+Make ieee80211_tx_h_rate_ctrl() get called on dequeue to improve
+performance since it reduces the turnaround time for rate control.
+
+Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
+---
+
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -1780,8 +1780,6 @@ static int invoke_tx_handlers_early(stru
+ 	CALL_TXH(ieee80211_tx_h_ps_buf);
+ 	CALL_TXH(ieee80211_tx_h_check_control_port_protocol);
+ 	CALL_TXH(ieee80211_tx_h_select_key);
+-	if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL))
+-		CALL_TXH(ieee80211_tx_h_rate_ctrl);
+ 
+  txh_done:
+ 	if (unlikely(res == TX_DROP)) {
+@@ -1814,6 +1812,9 @@ static int invoke_tx_handlers_late(struc
+ 		goto txh_done;
+ 	}
+ 
++	if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL))
++		CALL_TXH(ieee80211_tx_h_rate_ctrl);
++
+ 	CALL_TXH(ieee80211_tx_h_michael_mic_add);
+ 	CALL_TXH(ieee80211_tx_h_sequence);
+ 	CALL_TXH(ieee80211_tx_h_fragment);
+@@ -3384,15 +3385,21 @@ out:
+  * Can be called while the sta lock is held. Anything that can cause packets to
+  * be generated will cause deadlock!
+  */
+-static void ieee80211_xmit_fast_finish(struct ieee80211_sub_if_data *sdata,
+-				       struct sta_info *sta, u8 pn_offs,
+-				       struct ieee80211_key *key,
+-				       struct sk_buff *skb)
++static ieee80211_tx_result
++ieee80211_xmit_fast_finish(struct ieee80211_sub_if_data *sdata,
++			   struct sta_info *sta, u8 pn_offs,
++			   struct ieee80211_key *key,
++			   struct ieee80211_tx_data *tx)
+ {
++	struct sk_buff *skb = tx->skb;
+ 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+ 	struct ieee80211_hdr *hdr = (void *)skb->data;
+ 	u8 tid = IEEE80211_NUM_TIDS;
+ 
++	if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL) &&
++	    ieee80211_tx_h_rate_ctrl(tx) != TX_CONTINUE)
++		return TX_DROP;
++
+ 	if (key)
+ 		info->control.hw_key = &key->conf;
+ 
+@@ -3441,6 +3448,8 @@ static void ieee80211_xmit_fast_finish(s
+ 			break;
+ 		}
+ 	}
++
++	return TX_CONTINUE;
+ }
+ 
+ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
+@@ -3544,24 +3553,17 @@ static bool ieee80211_xmit_fast(struct i
+ 	tx.sta = sta;
+ 	tx.key = fast_tx->key;
+ 
+-	if (!ieee80211_hw_check(&local->hw, HAS_RATE_CONTROL)) {
+-		tx.skb = skb;
+-		r = ieee80211_tx_h_rate_ctrl(&tx);
+-		skb = tx.skb;
+-		tx.skb = NULL;
+-
+-		if (r != TX_CONTINUE) {
+-			if (r != TX_QUEUED)
+-				kfree_skb(skb);
+-			return true;
+-		}
+-	}
+-
+ 	if (ieee80211_queue_skb(local, sdata, sta, skb))
+ 		return true;
+ 
+-	ieee80211_xmit_fast_finish(sdata, sta, fast_tx->pn_offs,
+-				   fast_tx->key, skb);
++	tx.skb = skb;
++	r = ieee80211_xmit_fast_finish(sdata, sta, fast_tx->pn_offs,
++				       fast_tx->key, &tx);
++	tx.skb = NULL;
++	if (r == TX_DROP) {
++		kfree_skb(skb);
++		return true;
++	}
+ 
+ 	if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
+ 		sdata = container_of(sdata->bss,
+@@ -3672,8 +3674,12 @@ begin:
+ 		    (tx.key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV))
+ 			pn_offs = ieee80211_hdrlen(hdr->frame_control);
+ 
+-		ieee80211_xmit_fast_finish(sta->sdata, sta, pn_offs,
+-					   tx.key, skb);
++		r = ieee80211_xmit_fast_finish(sta->sdata, sta, pn_offs,
++					       tx.key, &tx);
++		if (r != TX_CONTINUE) {
++			ieee80211_free_txskb(&local->hw, skb);
++			goto begin;
++		}
+ 	} else {
+ 		if (invoke_tx_handlers_late(&tx))
+ 			goto begin;


From lede-commits at lists.infradead.org  Sat Jun 12 01:47:10 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 12 Jun 2021 04:47:10 -0400
Subject: [openwrt/openwrt] mac80211: add support for 802.3 encap offload
 with software rate control
In-Reply-To: <162348762974.10834.16074232639814668112@git-01.infra.openwrt.org>
References: <162348762974.10834.16074232639814668112@git-01.infra.openwrt.org>
Message-ID: <mailman.5234.1623487637.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/f2c6d892cacb5d884bdd638bc7574c1ee98514a5

commit f2c6d892cacb5d884bdd638bc7574c1ee98514a5
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Jun 6 20:58:33 2021 +0200

    mac80211: add support for 802.3 encap offload with software rate control
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...nstrel_ht-fix-minstrel_aggr_check-for-enc.patch |  39 +++++++
 ...dd-rate-control-support-for-encap-offload.patch | 119 +++++++++++++++++++++
 2 files changed, 158 insertions(+)

diff --git a/package/kernel/mac80211/patches/subsys/375-mac80211-minstrel_ht-fix-minstrel_aggr_check-for-enc.patch b/package/kernel/mac80211/patches/subsys/375-mac80211-minstrel_ht-fix-minstrel_aggr_check-for-enc.patch
new file mode 100644
index 0000000000..2fe19dfd94
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/375-mac80211-minstrel_ht-fix-minstrel_aggr_check-for-enc.patch
@@ -0,0 +1,39 @@
+From: Ryder Lee <ryder.lee at mediatek.com>
+Date: Fri, 28 May 2021 14:05:42 +0800
+Subject: [PATCH] mac80211: minstrel_ht: fix minstrel_aggr_check for encap
+ offload
+
+Avoid checking ieee80211_hdr to support encap offload.
+
+Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
+---
+
+--- a/net/mac80211/rc80211_minstrel_ht.c
++++ b/net/mac80211/rc80211_minstrel_ht.c
+@@ -1156,19 +1156,24 @@ static void
+ minstrel_aggr_check(struct ieee80211_sta *pubsta, struct sk_buff *skb)
+ {
+ 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
++	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+ 	struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
+ 	u16 tid;
+ 
+ 	if (skb_get_queue_mapping(skb) == IEEE80211_AC_VO)
+ 		return;
+ 
+-	if (unlikely(!ieee80211_is_data_qos(hdr->frame_control)))
++	if (unlikely(!pubsta->wme))
++		return;
++
++	if (!(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) &&
++	    unlikely(!ieee80211_is_data_qos(hdr->frame_control)))
+ 		return;
+ 
+ 	if (unlikely(skb->protocol == cpu_to_be16(ETH_P_PAE)))
+ 		return;
+ 
+-	tid = ieee80211_get_tid(hdr);
++	tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
+ 	if (likely(sta->ampdu_mlme.tid_tx[tid]))
+ 		return;
+ 
diff --git a/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch b/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch
new file mode 100644
index 0000000000..eefeaa4a8d
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch
@@ -0,0 +1,119 @@
+From: Ryder Lee <ryder.lee at mediatek.com>
+Date: Fri, 28 May 2021 14:05:43 +0800
+Subject: [PATCH] mac80211: add rate control support for encap offload
+
+The software rate control cannot deal with encap offload, so fix it.
+
+Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
+---
+
+--- a/net/mac80211/ieee80211_i.h
++++ b/net/mac80211/ieee80211_i.h
+@@ -2024,6 +2024,15 @@ static inline void ieee80211_tx_skb(stru
+ 	ieee80211_tx_skb_tid(sdata, skb, 7);
+ }
+ 
++static inline bool ieee80211_is_tx_data(struct sk_buff *skb)
++{
++	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
++	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
++
++	return info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP ||
++	       ieee80211_is_data(hdr->frame_control);
++}
++
+ u32 ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action,
+ 			       struct ieee802_11_elems *elems,
+ 			       u64 filter, u32 crc, u8 *transmitter_bssid,
+--- a/net/mac80211/rate.c
++++ b/net/mac80211/rate.c
+@@ -297,15 +297,11 @@ void ieee80211_check_rate_mask(struct ie
+ static bool rc_no_data_or_no_ack_use_min(struct ieee80211_tx_rate_control *txrc)
+ {
+ 	struct sk_buff *skb = txrc->skb;
+-	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
+ 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+-	__le16 fc;
+-
+-	fc = hdr->frame_control;
+ 
+ 	return (info->flags & (IEEE80211_TX_CTL_NO_ACK |
+ 			       IEEE80211_TX_CTL_USE_MINRATE)) ||
+-		!ieee80211_is_data(fc);
++		!ieee80211_is_tx_data(skb);
+ }
+ 
+ static void rc_send_low_basicrate(struct ieee80211_tx_rate *rate,
+@@ -870,7 +866,6 @@ void ieee80211_get_tx_rates(struct ieee8
+ 			    int max_rates)
+ {
+ 	struct ieee80211_sub_if_data *sdata;
+-	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
+ 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+ 	struct ieee80211_supported_band *sband;
+ 
+@@ -882,7 +877,7 @@ void ieee80211_get_tx_rates(struct ieee8
+ 	sdata = vif_to_sdata(vif);
+ 	sband = sdata->local->hw.wiphy->bands[info->band];
+ 
+-	if (ieee80211_is_data(hdr->frame_control))
++	if (ieee80211_is_tx_data(skb))
+ 		rate_control_apply_mask(sdata, sta, sband, dest, max_rates);
+ 
+ 	if (dest[0].idx < 0)
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -679,6 +679,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021
+ 	u32 len;
+ 	struct ieee80211_tx_rate_control txrc;
+ 	struct ieee80211_sta_rates *ratetbl = NULL;
++	bool encap = info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP;
+ 	bool assoc = false;
+ 
+ 	memset(&txrc, 0, sizeof(txrc));
+@@ -720,7 +721,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021
+ 	 * just wants a probe response.
+ 	 */
+ 	if (tx->sdata->vif.bss_conf.use_short_preamble &&
+-	    (ieee80211_is_data(hdr->frame_control) ||
++	    (ieee80211_is_tx_data(tx->skb) ||
+ 	     (tx->sta && test_sta_flag(tx->sta, WLAN_STA_SHORT_PREAMBLE))))
+ 		txrc.short_preamble = true;
+ 
+@@ -742,7 +743,8 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021
+ 		 "%s: Dropped data frame as no usable bitrate found while "
+ 		 "scanning and associated. Target station: "
+ 		 "%pM on %d GHz band\n",
+-		 tx->sdata->name, hdr->addr1,
++		 tx->sdata->name,
++		 encap ? ((struct ethhdr *)hdr)->h_dest : hdr->addr1,
+ 		 info->band ? 5 : 2))
+ 		return TX_DROP;
+ 
+@@ -776,7 +778,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021
+ 
+ 	if (txrc.reported_rate.idx < 0) {
+ 		txrc.reported_rate = tx->rate;
+-		if (tx->sta && ieee80211_is_data(hdr->frame_control))
++		if (tx->sta && ieee80211_is_tx_data(tx->skb))
+ 			tx->sta->tx_stats.last_rate = txrc.reported_rate;
+ 	} else if (tx->sta)
+ 		tx->sta->tx_stats.last_rate = txrc.reported_rate;
+@@ -3662,8 +3664,16 @@ begin:
+ 	else
+ 		info->flags &= ~IEEE80211_TX_CTL_AMPDU;
+ 
+-	if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP)
++	if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) {
++		if (!ieee80211_hw_check(&local->hw, HAS_RATE_CONTROL)) {
++			r = ieee80211_tx_h_rate_ctrl(&tx);
++			if (r != TX_CONTINUE) {
++				ieee80211_free_txskb(&local->hw, skb);
++				goto begin;
++			}
++		}
+ 		goto encap_out;
++	}
+ 
+ 	if (info->control.flags & IEEE80211_TX_CTRL_FAST_XMIT) {
+ 		struct sta_info *sta = container_of(txq->sta, struct sta_info,


From lede-commits at lists.infradead.org  Sat Jun 12 01:47:12 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 12 Jun 2021 04:47:12 -0400
Subject: [openwrt/openwrt] build: add ninja build tool and make it available
 for cmake
In-Reply-To: <162348762974.10834.16074232639814668112@git-01.infra.openwrt.org>
References: <162348762974.10834.16074232639814668112@git-01.infra.openwrt.org>
Message-ID: <mailman.5235.1623487640.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/97258f53634d7237a2962aec3387f011047ce83b

commit 97258f53634d7237a2962aec3387f011047ce83b
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Jun 6 14:31:01 2021 +0200

    build: add ninja build tool and make it available for cmake
    
    ninja is faster at building cmake packages than make, and according to reports
    also more reliable at handling parallel builds
    This commit includes a patch that adds GNU make jobserver support, in order to
    allow more precise control over the number of parallel tasks
    
    Enable parallel build by default for packages using ninja
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 include/cmake.mk                                   |   34 +
 rules.mk                                           |    6 +
 tools/Makefile                                     |    2 +-
 tools/ninja/Makefile                               |   39 +
 .../ninja/patches/100-make_jobserver_support.patch | 2279 ++++++++++++++++++++
 5 files changed, 2359 insertions(+), 1 deletion(-)

diff --git a/include/cmake.mk b/include/cmake.mk
index 96c4d7df34..8a1c4fc4d5 100644
--- a/include/cmake.mk
+++ b/include/cmake.mk
@@ -1,5 +1,11 @@
 cmake_bool = $(patsubst %,-D%:BOOL=$(if $($(1)),ON,OFF),$(2))
 
+ifeq ($(PKG_USE_NINJA),1)
+  PKG_BUILD_PARALLEL ?= 1
+endif
+ifeq ($(HOST_USE_NINJA),1)
+  HOST_BUILD_PARALLEL ?= 1
+endif
 PKG_INSTALL:=1
 
 ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
@@ -44,6 +50,34 @@ CMAKE_FIND_ROOT_PATH:=$(STAGING_DIR)/usr;$(TOOLCHAIN_DIR)$(if $(CONFIG_EXTERNAL_
 CMAKE_HOST_FIND_ROOT_PATH:=$(STAGING_DIR)/host;$(STAGING_DIR_HOSTPKG);$(STAGING_DIR_HOST)
 CMAKE_SHARED_LDFLAGS:=-Wl,-Bsymbolic-functions
 
+ifeq ($(HOST_USE_NINJA),1)
+  CMAKE_HOST_OPTIONS += -DCMAKE_GENERATOR="Ninja"
+
+  define Host/Compile/Default
+	+$(NINJA) -C $(HOST_BUILD_DIR) $(1)
+  endef
+
+  define Host/Install/Default
+	+DESTDIR="$(HOST_INSTALL_DIR)" $(NINJA) -C $(HOST_BUILD_DIR) install
+  endef
+
+  define Host/Uninstall/Default
+	+DESTDIR="$(HOST_INSTALL_DIR)" $(NINJA) -C $(HOST_BUILD_DIR) uninstall
+  endef
+endif
+
+ifeq ($(PKG_USE_NINJA),1)
+  CMAKE_OPTIONS += -DCMAKE_GENERATOR="Ninja"
+
+  define Build/Compile/Default
+	+$(NINJA) -C $(CMAKE_BINARY_DIR) $(1)
+  endef
+
+  define Build/Install/Default
+	+DESTDIR="$(PKG_INSTALL_DIR)" $(NINJA) -C $(CMAKE_BINARY_DIR) install
+  endef
+endif
+
 define Build/Configure/Default
 	mkdir -p $(CMAKE_BINARY_DIR)
 	(cd $(CMAKE_BINARY_DIR); \
diff --git a/rules.mk b/rules.mk
index 51f822e3f1..8b24d3a3bb 100644
--- a/rules.mk
+++ b/rules.mk
@@ -342,6 +342,12 @@ else
     $(SCRIPT_DIR)/rstrip.sh
 endif
 
+NINJA = \
+	MAKEFLAGS="$(MAKE_JOBSERVER)" \
+	$(STAGING_DIR_HOST)/bin/ninja \
+		$(if $(findstring c,$(OPENWRT_VERBOSE)),-v) \
+		$(if $(MAKE_JOBSERVER),,-j1)
+
 ifeq ($(CONFIG_IPV6),y)
   DISABLE_IPV6:=
 else
diff --git a/tools/Makefile b/tools/Makefile
index 8752a3e2b5..47a82fd237 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -24,7 +24,7 @@ endif
 tools-y += autoconf autoconf-archive automake bc bison cmake cpio dosfstools
 tools-y += e2fsprogs fakeroot findutils firmware-utils flex gengetopt
 tools-y += libressl libtool lzma m4 make-ext4fs missing-macros mkimage
-tools-y += mklibs mm-macros mtd-utils mtools padjffs2 patch-image
+tools-y += mklibs mm-macros mtd-utils mtools ninja padjffs2 patch-image
 tools-y += patchelf pkgconf quilt squashfskit4 sstrip xxd zip zlib zstd
 tools-$(BUILD_B43_TOOLS) += b43-tools
 tools-$(BUILD_ISL) += isl
diff --git a/tools/ninja/Makefile b/tools/ninja/Makefile
new file mode 100644
index 0000000000..3cbd6aebba
--- /dev/null
+++ b/tools/ninja/Makefile
@@ -0,0 +1,39 @@
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=ninja
+PKG_VERSION:=1.10.2
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/ninja-build/ninja/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=ce35865411f0490368a8fc383f29071de6690cbadc27704734978221f25e2bed
+
+include $(INCLUDE_DIR)/host-build.mk
+
+CONFIGURE_ARGS:=
+ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
+  CONFIGURE_ARGS+=--verbose
+endif
+
+define Host/Configure
+endef
+
+define Host/Compile
+	cd $(HOST_BUILD_DIR) && \
+		CXX="$(HOSTCXX)" \
+		CXXFLAGS="$(HOST_CXXFLAGS) $(HOST_CPPFLAGS)" \
+		LDFLAGS="$(HOST_LDFLAGS)" \
+		$(STAGING_DIR_HOST)/bin/$(PYTHON) configure.py --bootstrap $(CONFIGURE_ARGS)
+endef
+
+define Host/Install
+	$(INSTALL_DIR) $(STAGING_DIR_HOST)/bin
+	$(INSTALL_BIN) $(HOST_BUILD_DIR)/ninja $(STAGING_DIR_HOST)/bin/
+endef
+
+define Host/Clean
+	$(call Host/Clean/Default)
+	rm -f $(STAGING_DIR_HOST)/bin/ninja
+endef
+
+$(eval $(call HostBuild))
diff --git a/tools/ninja/patches/100-make_jobserver_support.patch b/tools/ninja/patches/100-make_jobserver_support.patch
new file mode 100644
index 0000000000..ecceaf23ca
--- /dev/null
+++ b/tools/ninja/patches/100-make_jobserver_support.patch
@@ -0,0 +1,2279 @@
+From c1a081c00f803fc28e51f155f25abe8346ce5f13 Mon Sep 17 00:00:00 2001
+From: Stefan Becker <stefanb at gpartner-nvidia.com>
+Date: Tue, 22 Mar 2016 13:48:07 +0200
+Subject: [PATCH] Add GNU make jobserver client support
+
+- add new TokenPool interface
+- GNU make implementation for TokenPool parses and verifies the magic
+  information from the MAKEFLAGS environment variable
+- RealCommandRunner tries to acquire TokenPool
+  * if no token pool is available then there is no change in behaviour
+- When a token pool is available then RealCommandRunner behaviour
+  changes as follows
+  * CanRunMore() only returns true if TokenPool::Acquire() returns true
+  * StartCommand() calls TokenPool::Reserve()
+  * WaitForCommand() calls TokenPool::Release()
+
+Documentation for GNU make jobserver
+
+  http://make.mad-scientist.net/papers/jobserver-implementation/
+
+Fixes https://github.com/ninja-build/ninja/issues/1139
+
+Add TokenPool monitoring to SubprocessSet::DoWork()
+
+Improve on the original jobserver client implementation. This makes
+ninja a more aggressive GNU make jobserver client.
+
+- add monitor interface to TokenPool
+- TokenPool is passed down when main loop indicates that more work is
+  ready and would be allowed to start if a token becomes available
+- posix: update DoWork() to monitor TokenPool read file descriptor
+- WaitForCommand() exits when DoWork() sets token flag
+- Main loop starts over when WaitForCommand() sets token exit status
+
+Ignore jobserver when -jN is forced on command line
+
+This emulates the behaviour of GNU make.
+
+- add parallelism_from_cmdline flag to build configuration
+- set the flag when -jN is given on command line
+- pass the flag to TokenPool::Get()
+- GNUmakeTokenPool::Setup()
+  * prints a warning when the flag is true and jobserver was detected
+  * returns false, i.e. jobserver will be ignored
+- ignore config.parallelism in CanRunMore() when we have a valid
+  TokenPool, because it gets always initialized to a default when not
+  given on the command line
+
+Honor -lN from MAKEFLAGS
+
+This emulates the behaviour of GNU make.
+
+- build: make a copy of max_load_average and pass it to TokenPool.
+- GNUmakeTokenPool: if we detect a jobserver and a valid -lN argument in
+  MAKEFLAGS then set max_load_average to N.
+
+Use LinePrinter for TokenPool messages
+
+- replace printf() with calls to LinePrinter
+- print GNU make jobserver message only when verbose build is requested
+
+Prepare PR for merging
+
+- fix Windows build error in no-op TokenPool implementation
+- improve Acquire() to block for a maximum of 100ms
+- address review comments
+
+Add tests for TokenPool
+
+- TokenPool setup
+- GetMonitorFd() API
+- implicit token and tokens in jobserver pipe
+- Acquire() / Reserve() / Release() protocol
+- Clear() API
+
+Add tests for subprocess module
+
+- add TokenPoolTest stub to provide TokenPool::GetMonitorFd()
+- add two tests
+  * both tests set up a dummy GNUmake jobserver pipe
+  * both tests call DoWork() with TokenPoolTest
+  * test 1: verify that DoWork() detects when a token is available
+  * test 2: verify that DoWork() works as before without a token
+- the tests are not compiled in under Windows
+
+Add tests for build module
+
+Add tests that verify the token functionality of the builder main loop.
+We replace the default fake command runner with a special version where
+the tests can control each call to AcquireToken(), CanRunMore() and
+WaitForCommand().
+
+Add Win32 implementation for GNUmakeTokenPool
+
+GNU make uses a semaphore as jobserver protocol on Win32. See also
+
+   https://www.gnu.org/software/make/manual/html_node/Windows-Jobserver.html
+
+Usage is pretty simple and straightforward, i.e. WaitForSingleObject()
+to obtain a token and ReleaseSemaphore() to return it.
+
+Unfortunately subprocess-win32.cc uses an I/O completion port (IOCP).
+IOCPs aren't waitable objects, i.e. we can't use WaitForMultipleObjects()
+to wait on the IOCP and the token semaphore at the same time.
+
+Therefore GNUmakeTokenPoolWin32 creates a child thread that waits on the
+token semaphore and posts a dummy I/O completion status on the IOCP when
+it was able to obtain a token. That unblocks SubprocessSet::DoWork() and
+it can then check if a token became available or not.
+
+- split existing GNUmakeTokenPool into common and platform bits
+- add GNUmakeTokenPool interface
+- move the Posix bits to GNUmakeTokenPoolPosix
+- add the Win32 bits as GNUmakeTokenPoolWin32
+- move Setup() method up to TokenPool interface
+- update Subprocess & TokenPool tests accordingly
+
+Prepare PR for merging - part II
+
+- remove unnecessary "struct" from TokenPool
+- add PAPCFUNC cast to QueryUserAPC()
+- remove hard-coded MAKEFLAGS string from win32
+- remove useless build test CompleteNoWork
+- rename TokenPoolTest to TestTokenPool
+- add tokenpool modules to CMake build
+- remove unused no-op TokenPool implementation
+- address review comments from
+
+https://github.com/ninja-build/ninja/pull/1140#pullrequestreview-195195803
+https://github.com/ninja-build/ninja/pull/1140#pullrequestreview-185089255
+https://github.com/ninja-build/ninja/pull/1140#issuecomment-473898963
+https://github.com/ninja-build/ninja/pull/1140#issuecomment-596624610
+---
+ CMakeLists.txt                  |   8 +-
+ configure.py                    |   7 +-
+ src/build.cc                    | 127 ++++++++---
+ src/build.h                     |  12 +-
+ src/build_test.cc               | 363 +++++++++++++++++++++++++++++++-
+ src/exit_status.h               |   3 +-
+ src/ninja.cc                    |   1 +
+ src/subprocess-posix.cc         |  33 ++-
+ src/subprocess-win32.cc         |  11 +-
+ src/subprocess.h                |   8 +-
+ src/subprocess_test.cc          | 149 +++++++++++--
+ src/tokenpool-gnu-make-posix.cc | 202 ++++++++++++++++++
+ src/tokenpool-gnu-make-win32.cc | 239 +++++++++++++++++++++
+ src/tokenpool-gnu-make.cc       | 108 ++++++++++
+ src/tokenpool-gnu-make.h        |  40 ++++
+ src/tokenpool.h                 |  42 ++++
+ src/tokenpool_test.cc           | 269 +++++++++++++++++++++++
+ 17 files changed, 1562 insertions(+), 60 deletions(-)
+ create mode 100644 src/tokenpool-gnu-make-posix.cc
+ create mode 100644 src/tokenpool-gnu-make-win32.cc
+ create mode 100644 src/tokenpool-gnu-make.cc
+ create mode 100644 src/tokenpool-gnu-make.h
+ create mode 100644 src/tokenpool.h
+ create mode 100644 src/tokenpool_test.cc
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -94,6 +94,7 @@ add_library(libninja OBJECT
+ 	src/parser.cc
+ 	src/state.cc
+ 	src/string_piece_util.cc
++	src/tokenpool-gnu-make.cc
+ 	src/util.cc
+ 	src/version.cc
+ )
+@@ -104,12 +105,16 @@ if(WIN32)
+ 		src/msvc_helper-win32.cc
+ 		src/msvc_helper_main-win32.cc
+ 		src/getopt.c
++		src/tokenpool-gnu-make-win32.cc
+ 	)
+ 	if(MSVC)
+ 		target_sources(libninja PRIVATE src/minidump-win32.cc)
+ 	endif()
+ else()
+-	target_sources(libninja PRIVATE src/subprocess-posix.cc)
++	target_sources(libninja PRIVATE
++		src/subprocess-posix.cc
++		src/tokenpool-gnu-make-posix.cc
++	)
+ 	if(CMAKE_SYSTEM_NAME STREQUAL "OS400" OR CMAKE_SYSTEM_NAME STREQUAL "AIX")
+ 		target_sources(libninja PRIVATE src/getopt.c)
+ 	endif()
+@@ -182,6 +187,7 @@ if(BUILD_TESTING)
+     src/string_piece_util_test.cc
+     src/subprocess_test.cc
+     src/test.cc
++    src/tokenpool_test.cc
+     src/util_test.cc
+   )
+   if(WIN32)
+--- a/configure.py
++++ b/configure.py
+@@ -514,11 +514,13 @@ for name in ['build',
+              'parser',
+              'state',
+              'string_piece_util',
++             'tokenpool-gnu-make',
+              'util',
+              'version']:
+     objs += cxx(name, variables=cxxvariables)
+ if platform.is_windows():
+     for name in ['subprocess-win32',
++                 'tokenpool-gnu-make-win32',
+                  'includes_normalize-win32',
+                  'msvc_helper-win32',
+                  'msvc_helper_main-win32']:
+@@ -527,7 +529,9 @@ if platform.is_windows():
+         objs += cxx('minidump-win32', variables=cxxvariables)
+     objs += cc('getopt')
+ else:
+-    objs += cxx('subprocess-posix')
++    for name in ['subprocess-posix',
++                 'tokenpool-gnu-make-posix']:
++        objs += cxx(name)
+ if platform.is_aix():
+     objs += cc('getopt')
+ if platform.is_msvc():
+@@ -582,6 +586,7 @@ for name in ['build_log_test',
+              'string_piece_util_test',
+              'subprocess_test',
+              'test',
++             'tokenpool_test',
+              'util_test']:
+     objs += cxx(name, variables=cxxvariables)
+ if platform.is_windows():
+--- a/src/build.cc
++++ b/src/build.cc
+@@ -38,6 +38,7 @@
+ #include "graph.h"
+ #include "state.h"
+ #include "subprocess.h"
++#include "tokenpool.h"
+ #include "util.h"
+ 
+ using namespace std;
+@@ -50,8 +51,9 @@ struct DryRunCommandRunner : public Comm
+ 
+   // Overridden from CommandRunner:
+   virtual bool CanRunMore() const;
++  virtual bool AcquireToken();
+   virtual bool StartCommand(Edge* edge);
+-  virtual bool WaitForCommand(Result* result);
++  virtual bool WaitForCommand(Result* result, bool more_ready);
+ 
+  private:
+   queue<Edge*> finished_;
+@@ -61,12 +63,16 @@ bool DryRunCommandRunner::CanRunMore() c
+   return true;
+ }
+ 
++bool DryRunCommandRunner::AcquireToken() {
++  return true;
++}
++
+ bool DryRunCommandRunner::StartCommand(Edge* edge) {
+   finished_.push(edge);
+   return true;
+ }
+ 
+-bool DryRunCommandRunner::WaitForCommand(Result* result) {
++bool DryRunCommandRunner::WaitForCommand(Result* result, bool more_ready) {
+    if (finished_.empty())
+      return false;
+ 
+@@ -379,7 +385,7 @@ void Plan::EdgeWanted(const Edge* edge)
+ }
+ 
+ Edge* Plan::FindWork() {
+-  if (ready_.empty())
++  if (!more_ready())
+     return NULL;
+   set<Edge*>::iterator e = ready_.begin();
+   Edge* edge = *e;
+@@ -665,19 +671,39 @@ void Plan::Dump() const {
+ }
+ 
+ struct RealCommandRunner : public CommandRunner {
+-  explicit RealCommandRunner(const BuildConfig& config) : config_(config) {}
+-  virtual ~RealCommandRunner() {}
++  explicit RealCommandRunner(const BuildConfig& config);
++  virtual ~RealCommandRunner();
+   virtual bool CanRunMore() const;
++  virtual bool AcquireToken();
+   virtual bool StartCommand(Edge* edge);
+-  virtual bool WaitForCommand(Result* result);
++  virtual bool WaitForCommand(Result* result, bool more_ready);
+   virtual vector<Edge*> GetActiveEdges();
+   virtual void Abort();
+ 
+   const BuildConfig& config_;
++  // copy of config_.max_load_average; can be modified by TokenPool setup
++  double max_load_average_;
+   SubprocessSet subprocs_;
++  TokenPool* tokens_;
+   map<const Subprocess*, Edge*> subproc_to_edge_;
+ };
+ 
++RealCommandRunner::RealCommandRunner(const BuildConfig& config) : config_(config) {
++  max_load_average_ = config.max_load_average;
++  if ((tokens_ = TokenPool::Get()) != NULL) {
++    if (!tokens_->Setup(config_.parallelism_from_cmdline,
++                        config_.verbosity == BuildConfig::VERBOSE,
++                        max_load_average_)) {
++      delete tokens_;
++      tokens_ = NULL;
++    }
++  }
++}
++
++RealCommandRunner::~RealCommandRunner() {
++  delete tokens_;
++}
++
+ vector<Edge*> RealCommandRunner::GetActiveEdges() {
+   vector<Edge*> edges;
+   for (map<const Subprocess*, Edge*>::iterator e = subproc_to_edge_.begin();
+@@ -688,14 +714,23 @@ vector<Edge*> RealCommandRunner::GetActi
+ 
+ void RealCommandRunner::Abort() {
+   subprocs_.Clear();
++  if (tokens_)
++    tokens_->Clear();
+ }
+ 
+ bool RealCommandRunner::CanRunMore() const {
+-  size_t subproc_number =
+-      subprocs_.running_.size() + subprocs_.finished_.size();
+-  return (int)subproc_number < config_.parallelism
+-    && ((subprocs_.running_.empty() || config_.max_load_average <= 0.0f)
+-        || GetLoadAverage() < config_.max_load_average);
++  bool parallelism_limit_not_reached =
++    tokens_ || // ignore config_.parallelism
++    ((int) (subprocs_.running_.size() +
++            subprocs_.finished_.size()) < config_.parallelism);
++  return parallelism_limit_not_reached
++    && (subprocs_.running_.empty() ||
++        (max_load_average_ <= 0.0f ||
++         GetLoadAverage() < max_load_average_));
++}
++
++bool RealCommandRunner::AcquireToken() {
++  return (!tokens_ || tokens_->Acquire());
+ }
+ 
+ bool RealCommandRunner::StartCommand(Edge* edge) {
+@@ -703,19 +738,33 @@ bool RealCommandRunner::StartCommand(Edg
+   Subprocess* subproc = subprocs_.Add(command, edge->use_console());
+   if (!subproc)
+     return false;
++  if (tokens_)
++    tokens_->Reserve();
+   subproc_to_edge_.insert(make_pair(subproc, edge));
+ 
+   return true;
+ }
+ 
+-bool RealCommandRunner::WaitForCommand(Result* result) {
++bool RealCommandRunner::WaitForCommand(Result* result, bool more_ready) {
+   Subprocess* subproc;
+-  while ((subproc = subprocs_.NextFinished()) == NULL) {
+-    bool interrupted = subprocs_.DoWork();
++  subprocs_.ResetTokenAvailable();
++  while (((subproc = subprocs_.NextFinished()) == NULL) &&
++         !subprocs_.IsTokenAvailable()) {
++    bool interrupted = subprocs_.DoWork(more_ready ? tokens_ : NULL);
+     if (interrupted)
+       return false;
+   }
+ 
++  // token became available
++  if (subproc == NULL) {
++    result->status = ExitTokenAvailable;
++    return true;
++  }
++
++  // command completed
++  if (tokens_)
++    tokens_->Release();
++
+   result->status = subproc->Finish();
+   result->output = subproc->GetOutput();
+ 
+@@ -825,38 +874,42 @@ bool Builder::Build(string* err) {
+   // command runner.
+   // Second, we attempt to wait for / reap the next finished command.
+   while (plan_.more_to_do()) {
+-    // See if we can start any more commands.
+-    if (failures_allowed && command_runner_->CanRunMore()) {
+-      if (Edge* edge = plan_.FindWork()) {
+-        if (edge->GetBindingBool("generator")) {
+-          scan_.build_log()->Close();
+-        }
++    // See if we can start any more commands...
++    bool can_run_more =
++        failures_allowed   &&
++        plan_.more_ready() &&
++        command_runner_->CanRunMore();
++
++    // ... but we also need a token to do that.
++    if (can_run_more && command_runner_->AcquireToken()) {
++      Edge* edge = plan_.FindWork();
++      if (edge->GetBindingBool("generator")) {
++        scan_.build_log()->Close();
++      }
++      if (!StartEdge(edge, err)) {
++        Cleanup();
++        status_->BuildFinished();
++        return false;
++      }
+ 
+-        if (!StartEdge(edge, err)) {
++      if (edge->is_phony()) {
++        if (!plan_.EdgeFinished(edge, Plan::kEdgeSucceeded, err)) {
+           Cleanup();
+           status_->BuildFinished();
+           return false;
+         }
+-
+-        if (edge->is_phony()) {
+-          if (!plan_.EdgeFinished(edge, Plan::kEdgeSucceeded, err)) {
+-            Cleanup();
+-            status_->BuildFinished();
+-            return false;
+-          }
+-        } else {
+-          ++pending_commands;
+-        }
+-
+-        // We made some progress; go back to the main loop.
+-        continue;
++      } else {
++        ++pending_commands;
+       }
++
++      // We made some progress; go back to the main loop.
++      continue;
+     }
+ 
+     // See if we can reap any finished commands.
+     if (pending_commands) {
+       CommandRunner::Result result;
+-      if (!command_runner_->WaitForCommand(&result) ||
++      if (!command_runner_->WaitForCommand(&result, can_run_more) ||
+           result.status == ExitInterrupted) {
+         Cleanup();
+         status_->BuildFinished();
+@@ -864,6 +917,10 @@ bool Builder::Build(string* err) {
+         return false;
+       }
+ 
++      // We might be able to start another command; start the main loop over.
++      if (result.status == ExitTokenAvailable)
++        continue;
++
+       --pending_commands;
+       if (!FinishCommand(&result, err)) {
+         Cleanup();
+--- a/src/build.h
++++ b/src/build.h
+@@ -55,6 +55,9 @@ struct Plan {
+   /// Returns true if there's more work to be done.
+   bool more_to_do() const { return wanted_edges_ > 0 && command_edges_ > 0; }
+ 
++  /// Returns true if there's more edges ready to start
++  bool more_ready() const { return !ready_.empty(); }
++
+   /// Dumps the current state of the plan.
+   void Dump() const;
+ 
+@@ -139,6 +142,7 @@ private:
+ struct CommandRunner {
+   virtual ~CommandRunner() {}
+   virtual bool CanRunMore() const = 0;
++  virtual bool AcquireToken() = 0;
+   virtual bool StartCommand(Edge* edge) = 0;
+ 
+   /// The result of waiting for a command.
+@@ -150,7 +154,9 @@ struct CommandRunner {
+     bool success() const { return status == ExitSuccess; }
+   };
+   /// Wait for a command to complete, or return false if interrupted.
+-  virtual bool WaitForCommand(Result* result) = 0;
++  /// If more_ready is true then the optional TokenPool is monitored too
++  /// and we return when a token becomes available.
++  virtual bool WaitForCommand(Result* result, bool more_ready) = 0;
+ 
+   virtual std::vector<Edge*> GetActiveEdges() { return std::vector<Edge*>(); }
+   virtual void Abort() {}
+@@ -158,7 +164,8 @@ struct CommandRunner {
+ 
+ /// Options (e.g. verbosity, parallelism) passed to a build.
+ struct BuildConfig {
+-  BuildConfig() : verbosity(NORMAL), dry_run(false), parallelism(1),
++  BuildConfig() : verbosity(NORMAL), dry_run(false),
++                  parallelism(1), parallelism_from_cmdline(false),
+                   failures_allowed(1), max_load_average(-0.0f) {}
+ 
+   enum Verbosity {
+@@ -169,6 +176,7 @@ struct BuildConfig {
+   Verbosity verbosity;
+   bool dry_run;
+   int parallelism;
++  bool parallelism_from_cmdline;
+   int failures_allowed;
+   /// The maximum load average we must not exceed. A negative value
+   /// means that we do not have any limit.
+--- a/src/build_test.cc
++++ b/src/build_test.cc
+@@ -15,6 +15,7 @@
+ #include "build.h"
+ 
+ #include <assert.h>
++#include <stdarg.h>
+ 
+ #include "build_log.h"
+ #include "deps_log.h"
+@@ -473,8 +474,9 @@ struct FakeCommandRunner : public Comman
+ 
+   // CommandRunner impl
+   virtual bool CanRunMore() const;
++  virtual bool AcquireToken();
+   virtual bool StartCommand(Edge* edge);
+-  virtual bool WaitForCommand(Result* result);
++  virtual bool WaitForCommand(Result* result, bool more_ready);
+   virtual vector<Edge*> GetActiveEdges();
+   virtual void Abort();
+ 
+@@ -580,6 +582,10 @@ bool FakeCommandRunner::CanRunMore() con
+   return active_edges_.size() < max_active_edges_;
+ }
+ 
++bool FakeCommandRunner::AcquireToken() {
++  return true;
++}
++
+ bool FakeCommandRunner::StartCommand(Edge* edge) {
+   assert(active_edges_.size() < max_active_edges_);
+   assert(find(active_edges_.begin(), active_edges_.end(), edge)
+@@ -625,7 +631,7 @@ bool FakeCommandRunner::StartCommand(Edg
+   return true;
+ }
+ 
+-bool FakeCommandRunner::WaitForCommand(Result* result) {
++bool FakeCommandRunner::WaitForCommand(Result* result, bool more_ready) {
+   if (active_edges_.empty())
+     return false;
+ 
+@@ -3302,3 +3308,356 @@ TEST_F(BuildTest, DyndepTwoLevelDiscover
+   EXPECT_EQ("touch tmp", command_runner_.commands_ran_[3]);
+   EXPECT_EQ("touch out", command_runner_.commands_ran_[4]);
+ }
++
++/// The token tests are concerned with the main loop functionality when
++// the CommandRunner has an active TokenPool. It is therefore intentional
++// that the plan doesn't complete and that builder_.Build() returns false!
++
++/// Fake implementation of CommandRunner that simulates a TokenPool
++struct FakeTokenCommandRunner : public CommandRunner {
++  explicit FakeTokenCommandRunner() {}
++
++  // CommandRunner impl
++  virtual bool CanRunMore() const;
++  virtual bool AcquireToken();
++  virtual bool StartCommand(Edge* edge);
++  virtual bool WaitForCommand(Result* result, bool more_ready);
++  virtual vector<Edge*> GetActiveEdges();
++  virtual void Abort();
++
++  vector<string> commands_ran_;
++  vector<Edge *> edges_;
++
++  vector<bool> acquire_token_;
++  vector<bool> can_run_more_;
++  vector<bool> wait_for_command_;
++};
++
++bool FakeTokenCommandRunner::CanRunMore() const {
++  if (can_run_more_.size() == 0) {
++    EXPECT_FALSE("unexpected call to CommandRunner::CanRunMore()");
++    return false;
++  }
++
++  bool result = can_run_more_[0];
++
++  // Unfortunately CanRunMore() isn't "const" for tests
++  const_cast<FakeTokenCommandRunner*>(this)->can_run_more_.erase(
++    const_cast<FakeTokenCommandRunner*>(this)->can_run_more_.begin()
++  );
++
++  return result;
++}
++
++bool FakeTokenCommandRunner::AcquireToken() {
++  if (acquire_token_.size() == 0) {
++    EXPECT_FALSE("unexpected call to CommandRunner::AcquireToken()");
++    return false;
++  }
++
++  bool result = acquire_token_[0];
++  acquire_token_.erase(acquire_token_.begin());
++  return result;
++}
++
++bool FakeTokenCommandRunner::StartCommand(Edge* edge) {
++  commands_ran_.push_back(edge->EvaluateCommand());
++  edges_.push_back(edge);
++  return true;
++}
++
++bool FakeTokenCommandRunner::WaitForCommand(Result* result, bool more_ready) {
++  if (wait_for_command_.size() == 0) {
++    EXPECT_FALSE("unexpected call to CommandRunner::WaitForCommand()");
++    return false;
++  }
++
++  bool expected = wait_for_command_[0];
++  if (expected != more_ready) {
++    EXPECT_EQ(expected, more_ready);
++    return false;
++  }
++  wait_for_command_.erase(wait_for_command_.begin());
++
++  if (edges_.size() == 0)
++    return false;
++
++  Edge* edge = edges_[0];
++  result->edge = edge;
++
++  if (more_ready &&
++      (edge->rule().name() == "token-available")) {
++    result->status = ExitTokenAvailable;
++  } else {
++    edges_.erase(edges_.begin());
++    result->status = ExitSuccess;
++  }
++
++  return true;
++}
++
++vector<Edge*> FakeTokenCommandRunner::GetActiveEdges() {
++  return edges_;
++}
++
++void FakeTokenCommandRunner::Abort() {
++  edges_.clear();
++}
++
++struct BuildTokenTest : public BuildTest {
++  virtual void SetUp();
++  virtual void TearDown();
++
++  FakeTokenCommandRunner token_command_runner_;
++
++  void ExpectAcquireToken(int count, ...);
++  void ExpectCanRunMore(int count, ...);
++  void ExpectWaitForCommand(int count, ...);
++
++private:
++  void EnqueueBooleans(vector<bool>& booleans, int count, va_list ao);
++};
++
++void BuildTokenTest::SetUp() {
++  BuildTest::SetUp();
++
++  // replace FakeCommandRunner with FakeTokenCommandRunner
++  builder_.command_runner_.release();
++  builder_.command_runner_.reset(&token_command_runner_);
++}
++void BuildTokenTest::TearDown() {
++  EXPECT_EQ(0u, token_command_runner_.acquire_token_.size());
++  EXPECT_EQ(0u, token_command_runner_.can_run_more_.size());
++  EXPECT_EQ(0u, token_command_runner_.wait_for_command_.size());
++
++  BuildTest::TearDown();
++}
++
++void BuildTokenTest::ExpectAcquireToken(int count, ...) {
++  va_list ap;
++  va_start(ap, count);
++  EnqueueBooleans(token_command_runner_.acquire_token_, count, ap);
++  va_end(ap);
++}
++
++void BuildTokenTest::ExpectCanRunMore(int count, ...) {
++  va_list ap;
++  va_start(ap, count);
++  EnqueueBooleans(token_command_runner_.can_run_more_, count, ap);
++  va_end(ap);
++}
++
++void BuildTokenTest::ExpectWaitForCommand(int count, ...) {
++  va_list ap;
++  va_start(ap, count);
++  EnqueueBooleans(token_command_runner_.wait_for_command_, count, ap);
++  va_end(ap);
++}
++
++void BuildTokenTest::EnqueueBooleans(vector<bool>& booleans, int count, va_list ap) {
++  while (count--) {
++    int value = va_arg(ap, int);
++    booleans.push_back(!!value); // force bool
++  }
++}
++
++TEST_F(BuildTokenTest, DoNotAquireToken) {
++  // plan should execute one command
++  string err;
++  EXPECT_TRUE(builder_.AddTarget("cat1", &err));
++  ASSERT_EQ("", err);
++
++  // pretend we can't run anything
++  ExpectCanRunMore(1, false);
++
++  EXPECT_FALSE(builder_.Build(&err));
++  EXPECT_EQ("stuck [this is a bug]", err);
++
++  EXPECT_EQ(0u, token_command_runner_.commands_ran_.size());
++}
++
++TEST_F(BuildTokenTest, DoNotStartWithoutToken) {
++  // plan should execute one command
++  string err;
++  EXPECT_TRUE(builder_.AddTarget("cat1", &err));
++  ASSERT_EQ("", err);
++
++  // we could run a command but do not have a token for it
++  ExpectCanRunMore(1,   true);
++  ExpectAcquireToken(1, false);
++
++  EXPECT_FALSE(builder_.Build(&err));
++  EXPECT_EQ("stuck [this is a bug]", err);
++
++  EXPECT_EQ(0u, token_command_runner_.commands_ran_.size());
++}
++
++TEST_F(BuildTokenTest, CompleteOneStep) {
++  // plan should execute one command
++  string err;
++  EXPECT_TRUE(builder_.AddTarget("cat1", &err));
++  ASSERT_EQ("", err);
++
++  // allow running of one command
++  ExpectCanRunMore(1,   true);
++  ExpectAcquireToken(1, true);
++  // block and wait for command to finalize
++  ExpectWaitForCommand(1, false);
++
++  EXPECT_TRUE(builder_.Build(&err));
++  EXPECT_EQ("", err);
++
++  EXPECT_EQ(1u, token_command_runner_.commands_ran_.size());
++  EXPECT_TRUE(token_command_runner_.commands_ran_[0] == "cat in1 > cat1");
++}
++
++TEST_F(BuildTokenTest, AcquireOneToken) {
++  // plan should execute more than one command
++  string err;
++  EXPECT_TRUE(builder_.AddTarget("cat12", &err));
++  ASSERT_EQ("", err);
++
++  // allow running of one command
++  ExpectCanRunMore(3,     true, false, false);
++  ExpectAcquireToken(1,   true);
++  // block and wait for command to finalize
++  ExpectWaitForCommand(1, false);
++
++  EXPECT_FALSE(builder_.Build(&err));
++  EXPECT_EQ("stuck [this is a bug]", err);
++
++  EXPECT_EQ(1u, token_command_runner_.commands_ran_.size());
++  // any of the two dependencies could have been executed
++  EXPECT_TRUE(token_command_runner_.commands_ran_[0] == "cat in1 > cat1" ||
++              token_command_runner_.commands_ran_[0] == "cat in1 in2 > cat2");
++}
++
++TEST_F(BuildTokenTest, WantTwoTokens) {
++  // plan should execute more than one command
++  string err;
++  EXPECT_TRUE(builder_.AddTarget("cat12", &err));
++  ASSERT_EQ("", err);
++
++  // allow running of one command
++  ExpectCanRunMore(3,     true, true, false);
++  ExpectAcquireToken(2,   true, false);
++  // wait for command to finalize or token to become available
++  ExpectWaitForCommand(1, true);
++
++  EXPECT_FALSE(builder_.Build(&err));
++  EXPECT_EQ("stuck [this is a bug]", err);
++
++  EXPECT_EQ(1u, token_command_runner_.commands_ran_.size());
++  // any of the two dependencies could have been executed
++  EXPECT_TRUE(token_command_runner_.commands_ran_[0] == "cat in1 > cat1" ||
++              token_command_runner_.commands_ran_[0] == "cat in1 in2 > cat2");
++}
++
++TEST_F(BuildTokenTest, CompleteTwoSteps) {
++  ASSERT_NO_FATAL_FAILURE(AssertParse(&state_,
++"build out1: cat in1\n"
++"build out2: cat out1\n"));
++
++  // plan should execute more than one command
++  string err;
++  EXPECT_TRUE(builder_.AddTarget("out2", &err));
++  ASSERT_EQ("", err);
++
++  // allow running of two commands
++  ExpectCanRunMore(2,     true, true);
++  ExpectAcquireToken(2,   true, true);
++  // wait for commands to finalize
++  ExpectWaitForCommand(2, false, false);
++
++  EXPECT_TRUE(builder_.Build(&err));
++  EXPECT_EQ("", err);
++
++  EXPECT_EQ(2u, token_command_runner_.commands_ran_.size());
++  EXPECT_TRUE(token_command_runner_.commands_ran_[0] == "cat in1 > out1");
++  EXPECT_TRUE(token_command_runner_.commands_ran_[1] == "cat out1 > out2");
++}
++
++TEST_F(BuildTokenTest, TwoCommandsInParallel) {
++  ASSERT_NO_FATAL_FAILURE(AssertParse(&state_,
++"rule token-available\n"
++"  command = cat $in > $out\n"
++"build out1: token-available in1\n"
++"build out2: token-available in2\n"
++"build out12: cat out1 out2\n"));
++
++  // plan should execute more than one command
++  string err;
++  EXPECT_TRUE(builder_.AddTarget("out12", &err));
++  ASSERT_EQ("", err);
++
++  // 1st command: token available -> allow running
++  // 2nd command: no token available but becomes available later
++  ExpectCanRunMore(4,     true, true,  true,  false);
++  ExpectAcquireToken(3,   true, false, true);
++  // 1st call waits for command to finalize or token to become available
++  // 2nd call waits for command to finalize
++  // 3rd call waits for command to finalize
++  ExpectWaitForCommand(3, true, false, false);
++
++  EXPECT_FALSE(builder_.Build(&err));
++  EXPECT_EQ("stuck [this is a bug]", err);
++
++  EXPECT_EQ(2u, token_command_runner_.commands_ran_.size());
++  EXPECT_TRUE((token_command_runner_.commands_ran_[0] == "cat in1 > out1" &&
++               token_command_runner_.commands_ran_[1] == "cat in2 > out2") ||
++              (token_command_runner_.commands_ran_[0] == "cat in2 > out2" &&
++               token_command_runner_.commands_ran_[1] == "cat in1 > out1"));
++}
++
++TEST_F(BuildTokenTest, CompleteThreeStepsSerial) {
++  // plan should execute more than one command
++  string err;
++  EXPECT_TRUE(builder_.AddTarget("cat12", &err));
++  ASSERT_EQ("", err);
++
++  // allow running of all commands
++  ExpectCanRunMore(4,     true, true,  true,  true);
++  ExpectAcquireToken(4,   true, false, true,  true);
++  // wait for commands to finalize
++  ExpectWaitForCommand(3, true, false, false);
++
++  EXPECT_TRUE(builder_.Build(&err));
++  EXPECT_EQ("", err);
++
++  EXPECT_EQ(3u, token_command_runner_.commands_ran_.size());
++  EXPECT_TRUE((token_command_runner_.commands_ran_[0] == "cat in1 > cat1"     &&
++               token_command_runner_.commands_ran_[1] == "cat in1 in2 > cat2") ||
++              (token_command_runner_.commands_ran_[0] == "cat in1 in2 > cat2" &&
++               token_command_runner_.commands_ran_[1] == "cat in1 > cat1"    ));
++  EXPECT_TRUE(token_command_runner_.commands_ran_[2] == "cat cat1 cat2 > cat12");
++}
++
++TEST_F(BuildTokenTest, CompleteThreeStepsParallel) {
++  ASSERT_NO_FATAL_FAILURE(AssertParse(&state_,
++"rule token-available\n"
++"  command = cat $in > $out\n"
++"build out1: token-available in1\n"
++"build out2: token-available in2\n"
++"build out12: cat out1 out2\n"));
++
++  // plan should execute more than one command
++  string err;
++  EXPECT_TRUE(builder_.AddTarget("out12", &err));
++  ASSERT_EQ("", err);
++
++  // allow running of all commands
++  ExpectCanRunMore(4,     true, true,  true,  true);
++  ExpectAcquireToken(4,   true, false, true,  true);
++  // wait for commands to finalize
++  ExpectWaitForCommand(4, true, false, false, false);
++
++  EXPECT_TRUE(builder_.Build(&err));
++  EXPECT_EQ("", err);
++
++  EXPECT_EQ(3u, token_command_runner_.commands_ran_.size());
++  EXPECT_TRUE((token_command_runner_.commands_ran_[0] == "cat in1 > out1" &&
++               token_command_runner_.commands_ran_[1] == "cat in2 > out2") ||
++              (token_command_runner_.commands_ran_[0] == "cat in2 > out2" &&
++               token_command_runner_.commands_ran_[1] == "cat in1 > out1"));
++  EXPECT_TRUE(token_command_runner_.commands_ran_[2] == "cat out1 out2 > out12");
++}
+--- a/src/exit_status.h
++++ b/src/exit_status.h
+@@ -18,7 +18,8 @@
+ enum ExitStatus {
+   ExitSuccess,
+   ExitFailure,
+-  ExitInterrupted
++  ExitTokenAvailable,
++  ExitInterrupted,
+ };
+ 
+ #endif  // NINJA_EXIT_STATUS_H_
+--- a/src/ninja.cc
++++ b/src/ninja.cc
+@@ -1289,6 +1289,7 @@ int ReadFlags(int* argc, char*** argv,
+         // We want to run N jobs in parallel. For N = 0, INT_MAX
+         // is close enough to infinite for most sane builds.
+         config->parallelism = value > 0 ? value : INT_MAX;
++        config->parallelism_from_cmdline = true;
+         break;
+       }
+       case 'k': {
+--- a/src/subprocess-posix.cc
++++ b/src/subprocess-posix.cc
+@@ -13,6 +13,7 @@
+ // limitations under the License.
+ 
+ #include "subprocess.h"
++#include "tokenpool.h"
+ 
+ #include <sys/select.h>
+ #include <assert.h>
+@@ -249,7 +250,7 @@ Subprocess *SubprocessSet::Add(const str
+ }
+ 
+ #ifdef USE_PPOLL
+-bool SubprocessSet::DoWork() {
++bool SubprocessSet::DoWork(TokenPool* tokens) {
+   vector<pollfd> fds;
+   nfds_t nfds = 0;
+ 
+@@ -263,6 +264,12 @@ bool SubprocessSet::DoWork() {
+     ++nfds;
+   }
+ 
++  if (tokens) {
++    pollfd pfd = { tokens->GetMonitorFd(), POLLIN | POLLPRI, 0 };
++    fds.push_back(pfd);
++    ++nfds;
++  }
++
+   interrupted_ = 0;
+   int ret = ppoll(&fds.front(), nfds, NULL, &old_mask_);
+   if (ret == -1) {
+@@ -295,11 +302,20 @@ bool SubprocessSet::DoWork() {
+     ++i;
+   }
+ 
++  if (tokens) {
++    pollfd *pfd = &fds[nfds - 1];
++    if (pfd->fd >= 0) {
++      assert(pfd->fd == tokens->GetMonitorFd());
++      if (pfd->revents != 0)
++        token_available_ = true;
++    }
++  }
++
+   return IsInterrupted();
+ }
+ 
+ #else  // !defined(USE_PPOLL)
+-bool SubprocessSet::DoWork() {
++bool SubprocessSet::DoWork(TokenPool* tokens) {
+   fd_set set;
+   int nfds = 0;
+   FD_ZERO(&set);
+@@ -314,6 +330,13 @@ bool SubprocessSet::DoWork() {
+     }
+   }
+ 
++  if (tokens) {
++    int fd = tokens->GetMonitorFd();
++    FD_SET(fd, &set);
++    if (nfds < fd+1)
++      nfds = fd+1;
++  }
++
+   interrupted_ = 0;
+   int ret = pselect(nfds, &set, 0, 0, 0, &old_mask_);
+   if (ret == -1) {
+@@ -342,6 +365,12 @@ bool SubprocessSet::DoWork() {
+     ++i;
+   }
+ 
++  if (tokens) {
++    int fd = tokens->GetMonitorFd();
++    if ((fd >= 0) && FD_ISSET(fd, &set))
++    token_available_ = true;
++  }
++
+   return IsInterrupted();
+ }
+ #endif  // !defined(USE_PPOLL)
+--- a/src/subprocess-win32.cc
++++ b/src/subprocess-win32.cc
+@@ -13,6 +13,7 @@
+ // limitations under the License.
+ 
+ #include "subprocess.h"
++#include "tokenpool.h"
+ 
+ #include <assert.h>
+ #include <stdio.h>
+@@ -251,11 +252,14 @@ Subprocess *SubprocessSet::Add(const str
+   return subprocess;
+ }
+ 
+-bool SubprocessSet::DoWork() {
++bool SubprocessSet::DoWork(TokenPool* tokens) {
+   DWORD bytes_read;
+   Subprocess* subproc;
+   OVERLAPPED* overlapped;
+ 
++  if (tokens)
++    tokens->WaitForTokenAvailability(ioport_);
++
+   if (!GetQueuedCompletionStatus(ioport_, &bytes_read, (PULONG_PTR)&subproc,
+                                  &overlapped, INFINITE)) {
+     if (GetLastError() != ERROR_BROKEN_PIPE)
+@@ -266,6 +270,11 @@ bool SubprocessSet::DoWork() {
+                 // delivered by NotifyInterrupted above.
+     return true;
+ 
++  if (tokens && tokens->TokenIsAvailable((ULONG_PTR)subproc)) {
++    token_available_ = true;
++    return false;
++  }
++
+   subproc->OnPipeReady();
+ 
+   if (subproc->Done()) {
+--- a/src/subprocess.h
++++ b/src/subprocess.h
+@@ -76,6 +76,8 @@ struct Subprocess {
+   friend struct SubprocessSet;
+ };
+ 
++struct TokenPool;
++
+ /// SubprocessSet runs a ppoll/pselect() loop around a set of Subprocesses.
+ /// DoWork() waits for any state change in subprocesses; finished_
+ /// is a queue of subprocesses as they finish.
+@@ -84,13 +86,17 @@ struct SubprocessSet {
+   ~SubprocessSet();
+ 
+   Subprocess* Add(const std::string& command, bool use_console = false);
+-  bool DoWork();
++  bool DoWork(struct TokenPool* tokens);
+   Subprocess* NextFinished();
+   void Clear();
+ 
+   std::vector<Subprocess*> running_;
+   std::queue<Subprocess*> finished_;
+ 
++  bool token_available_;
++  bool IsTokenAvailable() { return token_available_; }
++  void ResetTokenAvailable() { token_available_ = false; }
++
+ #ifdef _WIN32
+   static BOOL WINAPI NotifyInterrupted(DWORD dwCtrlType);
+   static HANDLE ioport_;
+--- a/src/subprocess_test.cc
++++ b/src/subprocess_test.cc
+@@ -13,6 +13,7 @@
+ // limitations under the License.
+ 
+ #include "subprocess.h"
++#include "tokenpool.h"
+ 
+ #include "test.h"
+ 
+@@ -34,8 +35,30 @@ const char* kSimpleCommand = "cmd /c dir
+ const char* kSimpleCommand = "ls /";
+ #endif
+ 
++struct TestTokenPool : public TokenPool {
++  bool Acquire()     { return false; }
++  void Reserve()     {}
++  void Release()     {}
++  void Clear()       {}
++  bool Setup(bool ignore_unused, bool verbose, double& max_load_average) { return false; }
++
++#ifdef _WIN32
++  bool _token_available;
++  void WaitForTokenAvailability(HANDLE ioport) {
++    if (_token_available)
++      // unblock GetQueuedCompletionStatus()
++      PostQueuedCompletionStatus(ioport, 0, (ULONG_PTR) this, NULL);
++  }
++  bool TokenIsAvailable(ULONG_PTR key) { return key == (ULONG_PTR) this; }
++#else
++  int _fd;
++  int GetMonitorFd() { return _fd; }
++#endif
++};
++
+ struct SubprocessTest : public testing::Test {
+   SubprocessSet subprocs_;
++  TestTokenPool tokens_;
+ };
+ 
+ }  // anonymous namespace
+@@ -45,10 +68,12 @@ TEST_F(SubprocessTest, BadCommandStderr)
+   Subprocess* subproc = subprocs_.Add("cmd /c ninja_no_such_command");
+   ASSERT_NE((Subprocess *) 0, subproc);
+ 
++  subprocs_.ResetTokenAvailable();
+   while (!subproc->Done()) {
+     // Pretend we discovered that stderr was ready for writing.
+-    subprocs_.DoWork();
++    subprocs_.DoWork(NULL);
+   }
++  ASSERT_FALSE(subprocs_.IsTokenAvailable());
+ 
+   EXPECT_EQ(ExitFailure, subproc->Finish());
+   EXPECT_NE("", subproc->GetOutput());
+@@ -59,10 +84,12 @@ TEST_F(SubprocessTest, NoSuchCommand) {
+   Subprocess* subproc = subprocs_.Add("ninja_no_such_command");
+   ASSERT_NE((Subprocess *) 0, subproc);
+ 
++  subprocs_.ResetTokenAvailable();
+   while (!subproc->Done()) {
+     // Pretend we discovered that stderr was ready for writing.
+-    subprocs_.DoWork();
++    subprocs_.DoWork(NULL);
+   }
++  ASSERT_FALSE(subprocs_.IsTokenAvailable());
+ 
+   EXPECT_EQ(ExitFailure, subproc->Finish());
+   EXPECT_NE("", subproc->GetOutput());
+@@ -78,9 +105,11 @@ TEST_F(SubprocessTest, InterruptChild) {
+   Subprocess* subproc = subprocs_.Add("kill -INT $$");
+   ASSERT_NE((Subprocess *) 0, subproc);
+ 
++  subprocs_.ResetTokenAvailable();
+   while (!subproc->Done()) {
+-    subprocs_.DoWork();
++    subprocs_.DoWork(NULL);
+   }
++  ASSERT_FALSE(subprocs_.IsTokenAvailable());
+ 
+   EXPECT_EQ(ExitInterrupted, subproc->Finish());
+ }
+@@ -90,7 +119,7 @@ TEST_F(SubprocessTest, InterruptParent)
+   ASSERT_NE((Subprocess *) 0, subproc);
+ 
+   while (!subproc->Done()) {
+-    bool interrupted = subprocs_.DoWork();
++    bool interrupted = subprocs_.DoWork(NULL);
+     if (interrupted)
+       return;
+   }
+@@ -102,9 +131,11 @@ TEST_F(SubprocessTest, InterruptChildWit
+   Subprocess* subproc = subprocs_.Add("kill -TERM $$");
+   ASSERT_NE((Subprocess *) 0, subproc);
+ 
++  subprocs_.ResetTokenAvailable();
+   while (!subproc->Done()) {
+-    subprocs_.DoWork();
++    subprocs_.DoWork(NULL);
+   }
++  ASSERT_FALSE(subprocs_.IsTokenAvailable());
+ 
+   EXPECT_EQ(ExitInterrupted, subproc->Finish());
+ }
+@@ -114,7 +145,7 @@ TEST_F(SubprocessTest, InterruptParentWi
+   ASSERT_NE((Subprocess *) 0, subproc);
+ 
+   while (!subproc->Done()) {
+-    bool interrupted = subprocs_.DoWork();
++    bool interrupted = subprocs_.DoWork(NULL);
+     if (interrupted)
+       return;
+   }
+@@ -126,9 +157,11 @@ TEST_F(SubprocessTest, InterruptChildWit
+   Subprocess* subproc = subprocs_.Add("kill -HUP $$");
+   ASSERT_NE((Subprocess *) 0, subproc);
+ 
++  subprocs_.ResetTokenAvailable();
+   while (!subproc->Done()) {
+-    subprocs_.DoWork();
++    subprocs_.DoWork(NULL);
+   }
++  ASSERT_FALSE(subprocs_.IsTokenAvailable());
+ 
+   EXPECT_EQ(ExitInterrupted, subproc->Finish());
+ }
+@@ -138,7 +171,7 @@ TEST_F(SubprocessTest, InterruptParentWi
+   ASSERT_NE((Subprocess *) 0, subproc);
+ 
+   while (!subproc->Done()) {
+-    bool interrupted = subprocs_.DoWork();
++    bool interrupted = subprocs_.DoWork(NULL);
+     if (interrupted)
+       return;
+   }
+@@ -153,9 +186,11 @@ TEST_F(SubprocessTest, Console) {
+         subprocs_.Add("test -t 0 -a -t 1 -a -t 2", /*use_console=*/true);
+     ASSERT_NE((Subprocess*)0, subproc);
+ 
++    subprocs_.ResetTokenAvailable();
+     while (!subproc->Done()) {
+-      subprocs_.DoWork();
++      subprocs_.DoWork(NULL);
+     }
++    ASSERT_FALSE(subprocs_.IsTokenAvailable());
+ 
+     EXPECT_EQ(ExitSuccess, subproc->Finish());
+   }
+@@ -167,9 +202,11 @@ TEST_F(SubprocessTest, SetWithSingle) {
+   Subprocess* subproc = subprocs_.Add(kSimpleCommand);
+   ASSERT_NE((Subprocess *) 0, subproc);
+ 
++  subprocs_.ResetTokenAvailable();
+   while (!subproc->Done()) {
+-    subprocs_.DoWork();
++    subprocs_.DoWork(NULL);
+   }
++  ASSERT_FALSE(subprocs_.IsTokenAvailable());
+   ASSERT_EQ(ExitSuccess, subproc->Finish());
+   ASSERT_NE("", subproc->GetOutput());
+ 
+@@ -200,12 +237,13 @@ TEST_F(SubprocessTest, SetWithMulti) {
+     ASSERT_EQ("", processes[i]->GetOutput());
+   }
+ 
++  subprocs_.ResetTokenAvailable();
+   while (!processes[0]->Done() || !processes[1]->Done() ||
+          !processes[2]->Done()) {
+     ASSERT_GT(subprocs_.running_.size(), 0u);
+-    subprocs_.DoWork();
++    subprocs_.DoWork(NULL);
+   }
+-
++  ASSERT_FALSE(subprocs_.IsTokenAvailable());
+   ASSERT_EQ(0u, subprocs_.running_.size());
+   ASSERT_EQ(3u, subprocs_.finished_.size());
+ 
+@@ -237,8 +275,10 @@ TEST_F(SubprocessTest, SetWithLots) {
+     ASSERT_NE((Subprocess *) 0, subproc);
+     procs.push_back(subproc);
+   }
++  subprocs_.ResetTokenAvailable();
+   while (!subprocs_.running_.empty())
+-    subprocs_.DoWork();
++    subprocs_.DoWork(NULL);
++  ASSERT_FALSE(subprocs_.IsTokenAvailable());
+   for (size_t i = 0; i < procs.size(); ++i) {
+     ASSERT_EQ(ExitSuccess, procs[i]->Finish());
+     ASSERT_NE("", procs[i]->GetOutput());
+@@ -254,10 +294,91 @@ TEST_F(SubprocessTest, SetWithLots) {
+ // that stdin is closed.
+ TEST_F(SubprocessTest, ReadStdin) {
+   Subprocess* subproc = subprocs_.Add("cat -");
++  subprocs_.ResetTokenAvailable();
+   while (!subproc->Done()) {
+-    subprocs_.DoWork();
++    subprocs_.DoWork(NULL);
+   }
++  ASSERT_FALSE(subprocs_.IsTokenAvailable());
+   ASSERT_EQ(ExitSuccess, subproc->Finish());
+   ASSERT_EQ(1u, subprocs_.finished_.size());
+ }
+ #endif  // _WIN32
++
++TEST_F(SubprocessTest, TokenAvailable) {
++  Subprocess* subproc = subprocs_.Add(kSimpleCommand);
++  ASSERT_NE((Subprocess *) 0, subproc);
++
++  // simulate GNUmake jobserver pipe with 1 token
++#ifdef _WIN32
++  tokens_._token_available = true;
++#else
++  int fds[2];
++  ASSERT_EQ(0u, pipe(fds));
++  tokens_._fd = fds[0];
++  ASSERT_EQ(1u, write(fds[1], "T", 1));
++#endif
++
++  subprocs_.ResetTokenAvailable();
++  subprocs_.DoWork(&tokens_);
++#ifdef _WIN32
++  tokens_._token_available = false;
++  // we need to loop here as we have no conrol where the token
++  // I/O completion post ends up in the queue
++  while (!subproc->Done() && !subprocs_.IsTokenAvailable()) {
++    subprocs_.DoWork(&tokens_);
++  }
++#endif
++
++  EXPECT_TRUE(subprocs_.IsTokenAvailable());
++  EXPECT_EQ(0u, subprocs_.finished_.size());
++
++  // remove token to let DoWork() wait for command again
++#ifndef _WIN32
++  char token;
++  ASSERT_EQ(1u, read(fds[0], &token, 1));
++#endif
++
++  while (!subproc->Done()) {
++    subprocs_.DoWork(&tokens_);
++  }
++
++#ifndef _WIN32
++  close(fds[1]);
++  close(fds[0]);
++#endif
++
++  EXPECT_EQ(ExitSuccess, subproc->Finish());
++  EXPECT_NE("", subproc->GetOutput());
++
++  EXPECT_EQ(1u, subprocs_.finished_.size());
++}
++
++TEST_F(SubprocessTest, TokenNotAvailable) {
++  Subprocess* subproc = subprocs_.Add(kSimpleCommand);
++  ASSERT_NE((Subprocess *) 0, subproc);
++
++  // simulate GNUmake jobserver pipe with 0 tokens
++#ifdef _WIN32
++  tokens_._token_available = false;
++#else
++  int fds[2];
++  ASSERT_EQ(0u, pipe(fds));
++  tokens_._fd = fds[0];
++#endif
++
++  subprocs_.ResetTokenAvailable();
++  while (!subproc->Done()) {
++    subprocs_.DoWork(&tokens_);
++  }
++
++#ifndef _WIN32
++  close(fds[1]);
++  close(fds[0]);
++#endif
++
++  EXPECT_FALSE(subprocs_.IsTokenAvailable());
++  EXPECT_EQ(ExitSuccess, subproc->Finish());
++  EXPECT_NE("", subproc->GetOutput());
++
++  EXPECT_EQ(1u, subprocs_.finished_.size());
++}
+--- /dev/null
++++ b/src/tokenpool-gnu-make-posix.cc
+@@ -0,0 +1,202 @@
++// Copyright 2016-2018 Google Inc. All Rights Reserved.
++//
++// Licensed under the Apache License, Version 2.0 (the "License");
++// you may not use this file except in compliance with the License.
++// You may obtain a copy of the License at
++//
++//     http://www.apache.org/licenses/LICENSE-2.0
++//
++// Unless required by applicable law or agreed to in writing, software
++// distributed under the License is distributed on an "AS IS" BASIS,
++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++// See the License for the specific language governing permissions and
++// limitations under the License.
++
++#include "tokenpool-gnu-make.h"
++
++#include <errno.h>
++#include <fcntl.h>
++#include <poll.h>
++#include <unistd.h>
++#include <signal.h>
++#include <sys/time.h>
++#include <stdio.h>
++#include <string.h>
++#include <stdlib.h>
++
++// TokenPool implementation for GNU make jobserver - POSIX implementation
++// (http://make.mad-scientist.net/papers/jobserver-implementation/)
++struct GNUmakeTokenPoolPosix : public GNUmakeTokenPool {
++  GNUmakeTokenPoolPosix();
++  virtual ~GNUmakeTokenPoolPosix();
++
++  virtual int GetMonitorFd();
++
++  virtual const char* GetEnv(const char* name) { return getenv(name); };
++  virtual bool ParseAuth(const char* jobserver);
++  virtual bool AcquireToken();
++  virtual bool ReturnToken();
++
++ private:
++  int rfd_;
++  int wfd_;
++
++  struct sigaction old_act_;
++  bool restore_;
++
++  static int dup_rfd_;
++  static void CloseDupRfd(int signum);
++
++  bool CheckFd(int fd);
++  bool SetAlarmHandler();
++};
++
++GNUmakeTokenPoolPosix::GNUmakeTokenPoolPosix() : rfd_(-1), wfd_(-1), restore_(false) {
++}
++
++GNUmakeTokenPoolPosix::~GNUmakeTokenPoolPosix() {
++  Clear();
++  if (restore_)
++    sigaction(SIGALRM, &old_act_, NULL);
++}
++
++bool GNUmakeTokenPoolPosix::CheckFd(int fd) {
++  if (fd < 0)
++    return false;
++  int ret = fcntl(fd, F_GETFD);
++  if (ret < 0)
++    return false;
++  return true;
++}
++
++int GNUmakeTokenPoolPosix::dup_rfd_ = -1;
++
++void GNUmakeTokenPoolPosix::CloseDupRfd(int signum) {
++  close(dup_rfd_);
++  dup_rfd_ = -1;
++}
++
++bool GNUmakeTokenPoolPosix::SetAlarmHandler() {
++  struct sigaction act;
++  memset(&act, 0, sizeof(act));
++  act.sa_handler = CloseDupRfd;
++  if (sigaction(SIGALRM, &act, &old_act_) < 0) {
++    perror("sigaction:");
++    return false;
++  }
++  restore_ = true;
++  return true;
++}
++
++bool GNUmakeTokenPoolPosix::ParseAuth(const char* jobserver) {
++  int rfd = -1;
++  int wfd = -1;
++  if ((sscanf(jobserver, "%*[^=]=%d,%d", &rfd, &wfd) == 2) &&
++      CheckFd(rfd) &&
++      CheckFd(wfd) &&
++      SetAlarmHandler()) {
++    rfd_ = rfd;
++    wfd_ = wfd;
++    return true;
++  }
++
++  return false;
++}
++
++bool GNUmakeTokenPoolPosix::AcquireToken() {
++  // Please read
++  //
++  //   http://make.mad-scientist.net/papers/jobserver-implementation/
++  //
++  // for the reasoning behind the following code.
++  //
++  // Try to read one character from the pipe. Returns true on success.
++  //
++  // First check if read() would succeed without blocking.
++#ifdef USE_PPOLL
++  pollfd pollfds[] = {{rfd_, POLLIN, 0}};
++  int ret = poll(pollfds, 1, 0);
++#else
++  fd_set set;
++  struct timeval timeout = { 0, 0 };
++  FD_ZERO(&set);
++  FD_SET(rfd_, &set);
++  int ret = select(rfd_ + 1, &set, NULL, NULL, &timeout);
++#endif
++  if (ret > 0) {
++    // Handle potential race condition:
++    //  - the above check succeeded, i.e. read() should not block
++    //  - the character disappears before we call read()
++    //
++    // Create a duplicate of rfd_. The duplicate file descriptor dup_rfd_
++    // can safely be closed by signal handlers without affecting rfd_.
++    dup_rfd_ = dup(rfd_);
++
++    if (dup_rfd_ != -1) {
++      struct sigaction act, old_act;
++      int ret = 0;
++
++      // Temporarily replace SIGCHLD handler with our own
++      memset(&act, 0, sizeof(act));
++      act.sa_handler = CloseDupRfd;
++      if (sigaction(SIGCHLD, &act, &old_act) == 0) {
++        struct itimerval timeout;
++
++        // install a 100ms timeout that generates SIGALARM on expiration
++        memset(&timeout, 0, sizeof(timeout));
++        timeout.it_value.tv_usec = 100 * 1000; // [ms] -> [usec]
++        if (setitimer(ITIMER_REAL, &timeout, NULL) == 0) {
++          char buf;
++
++          // Now try to read() from dup_rfd_. Return values from read():
++          //
++          // 1. token read                               ->  1
++          // 2. pipe closed                              ->  0
++          // 3. alarm expires                            -> -1 (EINTR)
++          // 4. child exits                              -> -1 (EINTR)
++          // 5. alarm expired before entering read()     -> -1 (EBADF)
++          // 6. child exited before entering read()      -> -1 (EBADF)
++          // 7. child exited before handler is installed -> go to 1 - 3
++          ret = read(dup_rfd_, &buf, 1);
++
++          // disarm timer
++          memset(&timeout, 0, sizeof(timeout));
++          setitimer(ITIMER_REAL, &timeout, NULL);
++        }
++
++        sigaction(SIGCHLD, &old_act, NULL);
++      }
++
++      CloseDupRfd(0);
++
++      // Case 1 from above list
++      if (ret > 0)
++        return true;
++    }
++  }
++
++  // read() would block, i.e. no token available,
++  // cases 2-6 from above list or
++  // select() / poll() / dup() / sigaction() / setitimer() failed
++  return false;
++}
++
++bool GNUmakeTokenPoolPosix::ReturnToken() {
++  const char buf = '+';
++  while (1) {
++    int ret = write(wfd_, &buf, 1);
++    if (ret > 0)
++      return true;
++    if ((ret != -1) || (errno != EINTR))
++      return false;
++    // write got interrupted - retry
++  }
++}
++
++int GNUmakeTokenPoolPosix::GetMonitorFd() {
++  return rfd_;
++}
++
++TokenPool* TokenPool::Get() {
++  return new GNUmakeTokenPoolPosix;
++}
+--- /dev/null
++++ b/src/tokenpool-gnu-make-win32.cc
+@@ -0,0 +1,239 @@
++// Copyright 2018 Google Inc. All Rights Reserved.
++//
++// Licensed under the Apache License, Version 2.0 (the "License");
++// you may not use this file except in compliance with the License.
++// You may obtain a copy of the License at
++//
++//     http://www.apache.org/licenses/LICENSE-2.0
++//
++// Unless required by applicable law or agreed to in writing, software
++// distributed under the License is distributed on an "AS IS" BASIS,
++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++// See the License for the specific language governing permissions and
++// limitations under the License.
++
++#include "tokenpool-gnu-make.h"
++
++// Always include this first.
++// Otherwise the other system headers don't work correctly under Win32
++#include <windows.h>
++
++#include <ctype.h>
++#include <stdlib.h>
++#include <string.h>
++
++#include "util.h"
++
++// TokenPool implementation for GNU make jobserver - Win32 implementation
++// (https://www.gnu.org/software/make/manual/html_node/Windows-Jobserver.html)
++struct GNUmakeTokenPoolWin32 : public GNUmakeTokenPool {
++  GNUmakeTokenPoolWin32();
++  virtual ~GNUmakeTokenPoolWin32();
++
++  virtual void WaitForTokenAvailability(HANDLE ioport);
++  virtual bool TokenIsAvailable(ULONG_PTR key);
++
++  virtual const char* GetEnv(const char* name);
++  virtual bool ParseAuth(const char* jobserver);
++  virtual bool AcquireToken();
++  virtual bool ReturnToken();
++
++ private:
++  // Semaphore for GNU make jobserver protocol
++  HANDLE semaphore_jobserver_;
++  // Semaphore Child -> Parent
++  // - child releases it before entering wait on jobserver semaphore
++  // - parent blocks on it to know when child enters wait
++  HANDLE semaphore_enter_wait_;
++  // Semaphore Parent -> Child
++  // - parent releases it to allow child to restart loop
++  // - child blocks on it to know when to restart loop
++  HANDLE semaphore_restart_;
++  // set to false if child should exit loop and terminate thread
++  bool running_;
++  // child thread
++  HANDLE child_;
++  // I/O completion port from SubprocessSet
++  HANDLE ioport_;
++
++
++  DWORD SemaphoreThread();
++  void ReleaseSemaphore(HANDLE semaphore);
++  void WaitForObject(HANDLE object);
++  static DWORD WINAPI SemaphoreThreadWrapper(LPVOID param);
++  static void NoopAPCFunc(ULONG_PTR param);
++};
++
++GNUmakeTokenPoolWin32::GNUmakeTokenPoolWin32() : semaphore_jobserver_(NULL),
++                                                 semaphore_enter_wait_(NULL),
++                                                 semaphore_restart_(NULL),
++                                                 running_(false),
++                                                 child_(NULL),
++                                                 ioport_(NULL) {
++}
++
++GNUmakeTokenPoolWin32::~GNUmakeTokenPoolWin32() {
++  Clear();
++  CloseHandle(semaphore_jobserver_);
++  semaphore_jobserver_ = NULL;
++
++  if (child_) {
++    // tell child thread to exit
++    running_ = false;
++    ReleaseSemaphore(semaphore_restart_);
++
++    // wait for child thread to exit
++    WaitForObject(child_);
++    CloseHandle(child_);
++    child_ = NULL;
++  }
++
++  if (semaphore_restart_) {
++    CloseHandle(semaphore_restart_);
++    semaphore_restart_ = NULL;
++  }
++
++  if (semaphore_enter_wait_) {
++    CloseHandle(semaphore_enter_wait_);
++    semaphore_enter_wait_ = NULL;
++  }
++}
++
++const char* GNUmakeTokenPoolWin32::GetEnv(const char* name) {
++  // getenv() does not work correctly together with tokenpool_tests.cc
++  static char buffer[MAX_PATH + 1];
++  if (GetEnvironmentVariable(name, buffer, sizeof(buffer)) == 0)
++    return NULL;
++  return buffer;
++}
++
++bool GNUmakeTokenPoolWin32::ParseAuth(const char* jobserver) {
++  // match "--jobserver-auth=gmake_semaphore_<INTEGER>..."
++  const char* start = strchr(jobserver, '=');
++  if (start) {
++    const char* end = start;
++    unsigned int len;
++    char c, *auth;
++
++    while ((c = *++end) != '\0')
++      if (!(isalnum(c) || (c == '_')))
++        break;
++    len = end - start; // includes string terminator in count
++
++    if ((len > 1) && ((auth = (char*)malloc(len)) != NULL)) {
++      strncpy(auth, start + 1, len - 1);
++      auth[len - 1] = '\0';
++
++      if ((semaphore_jobserver_ =
++           OpenSemaphore(SEMAPHORE_ALL_ACCESS, /* Semaphore access setting */
++                         FALSE,                /* Child processes DON'T inherit */
++                         auth                  /* Semaphore name */
++                        )) != NULL) {
++        free(auth);
++        return true;
++      }
++
++      free(auth);
++    }
++  }
++
++  return false;
++}
++
++bool GNUmakeTokenPoolWin32::AcquireToken() {
++  return WaitForSingleObject(semaphore_jobserver_, 0) == WAIT_OBJECT_0;
++}
++
++bool GNUmakeTokenPoolWin32::ReturnToken() {
++  ReleaseSemaphore(semaphore_jobserver_);
++  return true;
++}
++
++DWORD GNUmakeTokenPoolWin32::SemaphoreThread() {
++  while (running_) {
++    // indicate to parent that we are entering wait
++    ReleaseSemaphore(semaphore_enter_wait_);
++
++    // alertable wait forever on token semaphore
++    if (WaitForSingleObjectEx(semaphore_jobserver_, INFINITE, TRUE) == WAIT_OBJECT_0) {
++      // release token again for AcquireToken()
++      ReleaseSemaphore(semaphore_jobserver_);
++
++      // indicate to parent on ioport that a token might be available
++      if (!PostQueuedCompletionStatus(ioport_, 0, (ULONG_PTR) this, NULL))
++        Win32Fatal("PostQueuedCompletionStatus");
++    }
++
++    // wait for parent to allow loop restart
++    WaitForObject(semaphore_restart_);
++    // semaphore is now in nonsignaled state again for next run...
++  }
++
++  return 0;
++}
++
++DWORD WINAPI GNUmakeTokenPoolWin32::SemaphoreThreadWrapper(LPVOID param) {
++  GNUmakeTokenPoolWin32* This = (GNUmakeTokenPoolWin32*) param;
++  return This->SemaphoreThread();
++}
++
++void GNUmakeTokenPoolWin32::NoopAPCFunc(ULONG_PTR param) {
++}
++
++void GNUmakeTokenPoolWin32::WaitForTokenAvailability(HANDLE ioport) {
++  if (child_ == NULL) {
++    // first invocation
++    //
++    // subprocess-win32.cc uses I/O completion port (IOCP) which can't be
++    // used as a waitable object. Therefore we can't use WaitMultipleObjects()
++    // to wait on the IOCP and the token semaphore at the same time. Create
++    // a child thread that waits on the semaphore and posts an I/O completion
++    ioport_ = ioport;
++
++    // create both semaphores in nonsignaled state
++    if ((semaphore_enter_wait_ = CreateSemaphore(NULL, 0, 1, NULL))
++        == NULL)
++      Win32Fatal("CreateSemaphore/enter_wait");
++    if ((semaphore_restart_ = CreateSemaphore(NULL, 0, 1, NULL))
++        == NULL)
++      Win32Fatal("CreateSemaphore/restart");
++
++    // start child thread
++    running_ = true;
++    if ((child_ = CreateThread(NULL, 0, &SemaphoreThreadWrapper, this, 0, NULL))
++        == NULL)
++      Win32Fatal("CreateThread");
++
++  } else {
++    // all further invocations - allow child thread to loop
++    ReleaseSemaphore(semaphore_restart_);
++  }
++
++  // wait for child thread to enter wait
++  WaitForObject(semaphore_enter_wait_);
++  // semaphore is now in nonsignaled state again for next run...
++
++  // now SubprocessSet::DoWork() can enter GetQueuedCompletionStatus()...
++}
++
++bool GNUmakeTokenPoolWin32::TokenIsAvailable(ULONG_PTR key) {
++  // alert child thread to break wait on token semaphore
++  QueueUserAPC((PAPCFUNC)&NoopAPCFunc, child_, (ULONG_PTR)NULL);
++
++  // return true when GetQueuedCompletionStatus() returned our key
++  return key == (ULONG_PTR) this;
++}
++
++void GNUmakeTokenPoolWin32::ReleaseSemaphore(HANDLE semaphore) {
++  if (!::ReleaseSemaphore(semaphore, 1, NULL))
++    Win32Fatal("ReleaseSemaphore");
++}
++
++void GNUmakeTokenPoolWin32::WaitForObject(HANDLE object) {
++  if (WaitForSingleObject(object, INFINITE) != WAIT_OBJECT_0)
++    Win32Fatal("WaitForSingleObject");
++}
++
++TokenPool* TokenPool::Get() {
++  return new GNUmakeTokenPoolWin32;
++}
+--- /dev/null
++++ b/src/tokenpool-gnu-make.cc
+@@ -0,0 +1,108 @@
++// Copyright 2016-2018 Google Inc. All Rights Reserved.
++//
++// Licensed under the Apache License, Version 2.0 (the "License");
++// you may not use this file except in compliance with the License.
++// You may obtain a copy of the License at
++//
++//     http://www.apache.org/licenses/LICENSE-2.0
++//
++// Unless required by applicable law or agreed to in writing, software
++// distributed under the License is distributed on an "AS IS" BASIS,
++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++// See the License for the specific language governing permissions and
++// limitations under the License.
++
++#include "tokenpool-gnu-make.h"
++
++#include <stdlib.h>
++#include <stdio.h>
++#include <string.h>
++
++#include "line_printer.h"
++
++// TokenPool implementation for GNU make jobserver - common bits
++// every instance owns an implicit token -> available_ == 1
++GNUmakeTokenPool::GNUmakeTokenPool() : available_(1), used_(0) {
++}
++
++GNUmakeTokenPool::~GNUmakeTokenPool() {
++}
++
++bool GNUmakeTokenPool::Setup(bool ignore,
++                             bool verbose,
++                             double& max_load_average) {
++  const char* value = GetEnv("MAKEFLAGS");
++  if (!value)
++    return false;
++
++  // GNU make <= 4.1
++  const char* jobserver = strstr(value, "--jobserver-fds=");
++  if (!jobserver)
++    // GNU make => 4.2
++    jobserver = strstr(value, "--jobserver-auth=");
++  if (jobserver) {
++    LinePrinter printer;
++
++    if (ignore) {
++      printer.PrintOnNewLine("ninja: warning: -jN forced on command line; ignoring GNU make jobserver.\n");
++    } else {
++      if (ParseAuth(jobserver)) {
++        const char* l_arg = strstr(value, " -l");
++        int load_limit = -1;
++
++        if (verbose) {
++          printer.PrintOnNewLine("ninja: using GNU make jobserver.\n");
++        }
++
++        // translate GNU make -lN to ninja -lN
++        if (l_arg &&
++            (sscanf(l_arg + 3, "%d ", &load_limit) == 1) &&
++            (load_limit > 0)) {
++          max_load_average = load_limit;
++        }
++
++        return true;
++      }
++    }
++  }
++
++  return false;
++}
++
++bool GNUmakeTokenPool::Acquire() {
++  if (available_ > 0)
++    return true;
++
++  if (AcquireToken()) {
++    // token acquired
++    available_++;
++    return true;
++  }
++
++  // no token available
++  return false;
++}
++
++void GNUmakeTokenPool::Reserve() {
++  available_--;
++  used_++;
++}
++
++void GNUmakeTokenPool::Return() {
++  if (ReturnToken())
++    available_--;
++}
++
++void GNUmakeTokenPool::Release() {
++  available_++;
++  used_--;
++  if (available_ > 1)
++    Return();
++}
++
++void GNUmakeTokenPool::Clear() {
++  while (used_ > 0)
++    Release();
++  while (available_ > 1)
++    Return();
++}
+--- /dev/null
++++ b/src/tokenpool-gnu-make.h
+@@ -0,0 +1,40 @@
++// Copyright 2016-2018 Google Inc. All Rights Reserved.
++//
++// Licensed under the Apache License, Version 2.0 (the "License");
++// you may not use this file except in compliance with the License.
++// You may obtain a copy of the License at
++//
++//     http://www.apache.org/licenses/LICENSE-2.0
++//
++// Unless required by applicable law or agreed to in writing, software
++// distributed under the License is distributed on an "AS IS" BASIS,
++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++// See the License for the specific language governing permissions and
++// limitations under the License.
++
++#include "tokenpool.h"
++
++// interface to GNU make token pool
++struct GNUmakeTokenPool : public TokenPool {
++  GNUmakeTokenPool();
++  ~GNUmakeTokenPool();
++
++  // token pool implementation
++  virtual bool Acquire();
++  virtual void Reserve();
++  virtual void Release();
++  virtual void Clear();
++  virtual bool Setup(bool ignore, bool verbose, double& max_load_average);
++
++  // platform specific implementation
++  virtual const char* GetEnv(const char* name) = 0;
++  virtual bool ParseAuth(const char* jobserver) = 0;
++  virtual bool AcquireToken() = 0;
++  virtual bool ReturnToken() = 0;
++
++ private:
++  int available_;
++  int used_;
++
++  void Return();
++};
+--- /dev/null
++++ b/src/tokenpool.h
+@@ -0,0 +1,42 @@
++// Copyright 2016-2018 Google Inc. All Rights Reserved.
++//
++// Licensed under the Apache License, Version 2.0 (the "License");
++// you may not use this file except in compliance with the License.
++// You may obtain a copy of the License at
++//
++//     http://www.apache.org/licenses/LICENSE-2.0
++//
++// Unless required by applicable law or agreed to in writing, software
++// distributed under the License is distributed on an "AS IS" BASIS,
++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++// See the License for the specific language governing permissions and
++// limitations under the License.
++
++#ifdef _WIN32
++#include <windows.h>
++#endif
++
++// interface to token pool
++struct TokenPool {
++  virtual ~TokenPool() {}
++
++  virtual bool Acquire() = 0;
++  virtual void Reserve() = 0;
++  virtual void Release() = 0;
++  virtual void Clear() = 0;
++
++  // returns false if token pool setup failed
++  virtual bool Setup(bool ignore, bool verbose, double& max_load_average) = 0;
++
++#ifdef _WIN32
++  virtual void WaitForTokenAvailability(HANDLE ioport) = 0;
++  // returns true if a token has become available
++  // key is result from GetQueuedCompletionStatus()
++  virtual bool TokenIsAvailable(ULONG_PTR key) = 0;
++#else
++  virtual int GetMonitorFd() = 0;
++#endif
++
++  // returns NULL if token pool is not available
++  static TokenPool* Get();
++};
+--- /dev/null
++++ b/src/tokenpool_test.cc
+@@ -0,0 +1,269 @@
++// Copyright 2018 Google Inc. All Rights Reserved.
++//
++// Licensed under the Apache License, Version 2.0 (the "License");
++// you may not use this file except in compliance with the License.
++// You may obtain a copy of the License at
++//
++//     http://www.apache.org/licenses/LICENSE-2.0
++//
++// Unless required by applicable law or agreed to in writing, software
++// distributed under the License is distributed on an "AS IS" BASIS,
++// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++// See the License for the specific language governing permissions and
++// limitations under the License.
++
++#include "tokenpool.h"
++
++#include "test.h"
++
++#ifdef _WIN32
++#include <windows.h>
++#else
++#include <unistd.h>
++#endif
++
++#include <stdio.h>
++#include <stdlib.h>
++
++#ifdef _WIN32
++// should contain all valid characters
++#define SEMAPHORE_NAME      "abcdefghijklmnopqrstwxyz01234567890_"
++#define AUTH_FORMAT(tmpl)   "foo " tmpl "=%s bar"
++#define ENVIRONMENT_CLEAR() SetEnvironmentVariable("MAKEFLAGS", NULL)
++#define ENVIRONMENT_INIT(v) SetEnvironmentVariable("MAKEFLAGS", v)
++#else
++#define AUTH_FORMAT(tmpl)   "foo " tmpl "=%d,%d bar"
++#define ENVIRONMENT_CLEAR() unsetenv("MAKEFLAGS")
++#define ENVIRONMENT_INIT(v) setenv("MAKEFLAGS", v, true)
++#endif
++
++namespace {
++
++const double kLoadAverageDefault = -1.23456789;
++
++struct TokenPoolTest : public testing::Test {
++  double load_avg_;
++  TokenPool* tokens_;
++  char buf_[1024];
++#ifdef _WIN32
++  const char* semaphore_name_;
++  HANDLE semaphore_;
++#else
++  int fds_[2];
++#endif
++
++  virtual void SetUp() {
++    load_avg_ = kLoadAverageDefault;
++    tokens_ = NULL;
++    ENVIRONMENT_CLEAR();
++#ifdef _WIN32
++    semaphore_name_ = SEMAPHORE_NAME;
++    if ((semaphore_ = CreateSemaphore(0, 0, 2, SEMAPHORE_NAME)) == NULL)
++#else
++    if (pipe(fds_) < 0)
++#endif
++      ASSERT_TRUE(false);
++  }
++
++  void CreatePool(const char* format, bool ignore_jobserver = false) {
++    if (format) {
++      sprintf(buf_, format,
++#ifdef _WIN32
++              semaphore_name_
++#else
++              fds_[0], fds_[1]
++#endif
++      );
++      ENVIRONMENT_INIT(buf_);
++    }
++    if ((tokens_ = TokenPool::Get()) != NULL) {
++      if (!tokens_->Setup(ignore_jobserver, false, load_avg_)) {
++        delete tokens_;
++        tokens_ = NULL;
++      }
++    }
++  }
++
++  void CreateDefaultPool() {
++    CreatePool(AUTH_FORMAT("--jobserver-auth"));
++  }
++
++  virtual void TearDown() {
++    if (tokens_)
++      delete tokens_;
++#ifdef _WIN32
++    CloseHandle(semaphore_);
++#else
++    close(fds_[0]);
++    close(fds_[1]);
++#endif
++    ENVIRONMENT_CLEAR();
++  }
++};
++
++} // anonymous namespace
++
++// verifies none implementation
++TEST_F(TokenPoolTest, NoTokenPool) {
++  CreatePool(NULL, false);
++
++  EXPECT_EQ(NULL, tokens_);
++  EXPECT_EQ(kLoadAverageDefault, load_avg_);
++}
++
++TEST_F(TokenPoolTest, SuccessfulOldSetup) {
++  // GNUmake <= 4.1
++  CreatePool(AUTH_FORMAT("--jobserver-fds"));
++
++  EXPECT_NE(NULL, tokens_);
++  EXPECT_EQ(kLoadAverageDefault, load_avg_);
++}
++
++TEST_F(TokenPoolTest, SuccessfulNewSetup) {
++  // GNUmake => 4.2
++  CreateDefaultPool();
++
++  EXPECT_NE(NULL, tokens_);
++  EXPECT_EQ(kLoadAverageDefault, load_avg_);
++}
++
++TEST_F(TokenPoolTest, IgnoreWithJN) {
++  CreatePool(AUTH_FORMAT("--jobserver-auth"), true);
++
++  EXPECT_EQ(NULL, tokens_);
++  EXPECT_EQ(kLoadAverageDefault, load_avg_);
++}
++
++TEST_F(TokenPoolTest, HonorLN) {
++  CreatePool(AUTH_FORMAT("-l9 --jobserver-auth"));
++
++  EXPECT_NE(NULL, tokens_);
++  EXPECT_EQ(9.0, load_avg_);
++}
++
++#ifdef _WIN32
++TEST_F(TokenPoolTest, SemaphoreNotFound) {
++  semaphore_name_ = SEMAPHORE_NAME "_foobar";
++  CreateDefaultPool();
++
++  EXPECT_EQ(NULL, tokens_);
++  EXPECT_EQ(kLoadAverageDefault, load_avg_);
++}
++
++TEST_F(TokenPoolTest, TokenIsAvailable) {
++  CreateDefaultPool();
++
++  ASSERT_NE(NULL, tokens_);
++  EXPECT_EQ(kLoadAverageDefault, load_avg_);
++
++  EXPECT_TRUE(tokens_->TokenIsAvailable((ULONG_PTR)tokens_));
++}
++#else
++TEST_F(TokenPoolTest, MonitorFD) {
++  CreateDefaultPool();
++
++  ASSERT_NE(NULL, tokens_);
++  EXPECT_EQ(kLoadAverageDefault, load_avg_);
++
++  EXPECT_EQ(fds_[0], tokens_->GetMonitorFd());
++}
++#endif
++
++TEST_F(TokenPoolTest, ImplicitToken) {
++  CreateDefaultPool();
++
++  ASSERT_NE(NULL, tokens_);
++  EXPECT_EQ(kLoadAverageDefault, load_avg_);
++
++  EXPECT_TRUE(tokens_->Acquire());
++  tokens_->Reserve();
++  EXPECT_FALSE(tokens_->Acquire());
++  tokens_->Release();
++  EXPECT_TRUE(tokens_->Acquire());
++}
++
++TEST_F(TokenPoolTest, TwoTokens) {
++  CreateDefaultPool();
++
++  ASSERT_NE(NULL, tokens_);
++  EXPECT_EQ(kLoadAverageDefault, load_avg_);
++
++  // implicit token
++  EXPECT_TRUE(tokens_->Acquire());
++  tokens_->Reserve();
++  EXPECT_FALSE(tokens_->Acquire());
++
++  // jobserver offers 2nd token
++#ifdef _WIN32
++  LONG previous;
++  ASSERT_TRUE(ReleaseSemaphore(semaphore_, 1, &previous));
++  ASSERT_EQ(0, previous);
++#else
++  ASSERT_EQ(1u, write(fds_[1], "T", 1));
++#endif
++  EXPECT_TRUE(tokens_->Acquire());
++  tokens_->Reserve();
++  EXPECT_FALSE(tokens_->Acquire());
++
++  // release 2nd token
++  tokens_->Release();
++  EXPECT_TRUE(tokens_->Acquire());
++
++  // release implict token - must return 2nd token back to jobserver
++  tokens_->Release();
++  EXPECT_TRUE(tokens_->Acquire());
++
++  // there must be one token available
++#ifdef _WIN32
++  EXPECT_EQ(WAIT_OBJECT_0, WaitForSingleObject(semaphore_, 0));
++  EXPECT_TRUE(ReleaseSemaphore(semaphore_, 1, &previous));
++  EXPECT_EQ(0, previous);
++#else
++  EXPECT_EQ(1u, read(fds_[0], buf_, sizeof(buf_)));
++#endif
++
++  // implicit token
++  EXPECT_TRUE(tokens_->Acquire());
++}
++
++TEST_F(TokenPoolTest, Clear) {
++  CreateDefaultPool();
++
++  ASSERT_NE(NULL, tokens_);
++  EXPECT_EQ(kLoadAverageDefault, load_avg_);
++
++  // implicit token
++  EXPECT_TRUE(tokens_->Acquire());
++  tokens_->Reserve();
++  EXPECT_FALSE(tokens_->Acquire());
++
++  // jobserver offers 2nd & 3rd token
++#ifdef _WIN32
++  LONG previous;
++  ASSERT_TRUE(ReleaseSemaphore(semaphore_, 2, &previous));
++  ASSERT_EQ(0, previous);
++#else
++  ASSERT_EQ(2u, write(fds_[1], "TT", 2));
++#endif
++  EXPECT_TRUE(tokens_->Acquire());
++  tokens_->Reserve();
++  EXPECT_TRUE(tokens_->Acquire());
++  tokens_->Reserve();
++  EXPECT_FALSE(tokens_->Acquire());
++
++  tokens_->Clear();
++  EXPECT_TRUE(tokens_->Acquire());
++
++  // there must be two tokens available
++#ifdef _WIN32
++  EXPECT_EQ(WAIT_OBJECT_0, WaitForSingleObject(semaphore_, 0));
++  EXPECT_EQ(WAIT_OBJECT_0, WaitForSingleObject(semaphore_, 0));
++  EXPECT_TRUE(ReleaseSemaphore(semaphore_, 2, &previous));
++  EXPECT_EQ(0, previous);
++#else
++  EXPECT_EQ(2u, read(fds_[0], buf_, sizeof(buf_)));
++#endif
++
++  // implicit token
++  EXPECT_TRUE(tokens_->Acquire());
++}


From lede-commits at lists.infradead.org  Sat Jun 12 02:02:23 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 12 Jun 2021 05:02:23 -0400
Subject: [openwrt/openwrt] ramips: fix LAN LED trigger assignment for Xiaomi
 Router 3 Pro
In-Reply-To: <162348854107.23880.9435845134678613641@git-01.infra.openwrt.org>
References: <162348854107.23880.9435845134678613641@git-01.infra.openwrt.org>
Message-ID: <mailman.5238.1623488544.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/8078d953b8170260eb6fb1fe6b9ea0d5283acb70

commit 8078d953b8170260eb6fb1fe6b9ea0d5283acb70
Author: Adam Elyas <adamelyas at outlook.com>
AuthorDate: Tue Jun 8 08:09:18 2021 +0800

    ramips: fix LAN LED trigger assignment for Xiaomi Router 3 Pro
    
    The default trigger for the amber lights on lan1 and lan3 were
    mistakenly swapped after the device's migration to DSA. This
    caused activity on one port to trigger the amber light on the
    other port. Swapping their default trigger in the DTS file
    fixes that.
    
    Signed-off-by: Adam Elyas <adamelyas at outlook.com>
    [minor commit title adjustment, wrap commit message]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
    (cherry picked from commit edaf432bf411767f3e8a9e5effc3a416bcac46c7)
---
 target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts
index b9101b7ccb..e8f3a50dbe 100644
--- a/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts
+++ b/target/linux/ramips/dts/mt7621_xiaomi_mi-router-3-pro.dts
@@ -48,7 +48,7 @@
 		lan3_amber {
 			label = "amber:lan3";
 			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
-			linux,default-trigger = "dsa-0.0:01:1Gbps";
+			linux,default-trigger = "dsa-0.0:03:1Gbps";
 		};
 
 		lan2_amber {
@@ -60,7 +60,7 @@
 		lan1_amber {
 			label = "amber:lan1";
 			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
-			linux,default-trigger = "dsa-0.0:03:1Gbps";
+			linux,default-trigger = "dsa-0.0:01:1Gbps";
 		};
 	};
 


From lede-commits at lists.infradead.org  Sat Jun 12 02:02:24 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 12 Jun 2021 05:02:24 -0400
Subject: [openwrt/openwrt] ramips: mt7620: add kernel size for Jboot devices
In-Reply-To: <162348854107.23880.9435845134678613641@git-01.infra.openwrt.org>
References: <162348854107.23880.9435845134678613641@git-01.infra.openwrt.org>
Message-ID: <mailman.5239.1623488544.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/15626130778c377cd4d4d3424127cd6e2a78253d

commit 15626130778c377cd4d4d3424127cd6e2a78253d
Author: Pawel Dembicki <paweldembicki at gmail.com>
AuthorDate: Wed Jun 9 12:22:39 2021 +0200

    ramips: mt7620: add kernel size for Jboot devices
    
    Since few months multiple users reported problems with various JBoot
    devices. [0][1][2][3] All of them was bricked.
    
    On my Lava LR-25G001 it freezes with current snapshot:
    
    CDW57CAM_003 Jboot B695
    Giga Switch AR8327 init
    AR8327/AR8337 id   ==> 0x1302
    JRecovery Version R1.2 2014/04/01 18:25
    SPI FLASH: MX25l12805d 16M
    .
    .
    (freeze)
    
    The kernel size is >2048k.
    
    I built current master with minimal config and it boots well:
    
    CDW57CAM_003 Jboot B695
    Giga Switch AR8327 init
    AR8327/AR8337 id   ==> 0x1302
    JRecovery Version R1.2 2014/04/01 18:25
    SPI FLASH: MX25l12805d 16M
    .
    ...........................
    Starting kernel @80000000...
    [    0.000000] Linux version 5.4.124
    
    Kernel size is <2048k.
    
    Jboot bootloader isn't open source, so it's impossible to find
    solution in code. It looks, that some buffer for kernel have 2MB size.
    
    To avoid bricked devices, this commit introduces 2048k limit kernel
    size for all jboot routers.
    
    [0] https://bugs.openwrt.org/index.php?do=details&task_id=3539
    [1] https://eko.one.pl/forum/viewtopic.php?pid=254344
    [2] https://eko.one.pl/forum/viewtopic.php?id=20930
    [3] https://eko.one.pl/forum/viewtopic.php?pid=241376#p241376
    
    Signed-off-by: Pawel Dembicki <paweldembicki at gmail.com>
    [remove Fixes:]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
    (cherry picked from commit e1d8a14cd0a9f8844f9ebb8ca220780b0ce5d6db)
---
 target/linux/ramips/image/mt7620.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index fd7e42bf22..56941f2b9c 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -62,6 +62,7 @@ TARGET_DEVICES += alfa-network_tube-e4g
 define Device/amit_jboot
   DLINK_IMAGE_OFFSET := 0x10000
   KERNEL := $(KERNEL_DTB)
+  KERNEL_SIZE := 2048k
   IMAGES += factory.bin
   IMAGE/sysupgrade.bin := mkdlinkfw | pad-rootfs | append-metadata
   IMAGE/factory.bin := mkdlinkfw | pad-rootfs | mkdlinkfw-factory


From lede-commits at lists.infradead.org  Sat Jun 12 02:02:21 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 12 Jun 2021 05:02:21 -0400
Subject: [openwrt/openwrt] ath79: fix eth0 PLL registers on WD My Net Wi-Fi
 Range Extender
In-Reply-To: <162348854107.23880.9435845134678613641@git-01.infra.openwrt.org>
References: <162348854107.23880.9435845134678613641@git-01.infra.openwrt.org>
Message-ID: <mailman.5240.1623488549.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/0794a784e905e14f673fee6120e86be67bb4862d

commit 0794a784e905e14f673fee6120e86be67bb4862d
Author: Jonathan A. Kollasch <jakllsch at kollasch.net>
AuthorDate: Fri Sep 11 14:33:39 2020 -0500

    ath79: fix eth0 PLL registers on WD My Net Wi-Fi Range Extender
    
    This replaces the register bits for RGMII delay on the MAC side in favor
    of having the RGMII delay on the PHY side by setting the phy-mode
    property to rgmii-id (RGMII internal delay), which is supported by the
    at803x driver.  Speed 1000 is fixed as a result, so now all ethernet
    speeds function.
    
    Signed-off-by: Jonathan A. Kollasch <jakllsch at kollasch.net>
    Reviewed-by: Michael Pratt <mcpratt at pm.me>
    (cherry picked from commit f36990eae77c3a22842a2c418378c5dd40dec366)
---
 target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts b/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts
index 575c72ee7c..7313e9acc2 100644
--- a/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts
+++ b/target/linux/ath79/dts/ar9344_wd_mynet-wifi-rangeextender.dts
@@ -144,10 +144,10 @@
 &eth0 {
 	status = "okay";
 
-	pll-data = <0x0e000000 0x3c000101 0x3c001313>;
+	pll-data = <0x02000000 0x00000101 0x00001313>;
 
 	/* ethernet MAC is stored in nvram */
-	phy-mode = "rgmii";
+	phy-mode = "rgmii-id";
 	phy-handle = <&phy4>;
 
 	gmac-config {


From lede-commits at lists.infradead.org  Sat Jun 12 02:02:22 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 12 Jun 2021 05:02:22 -0400
Subject: [openwrt/openwrt] ramips: fix Ethernet random MAC address for
 HILINK HLK-7628N
In-Reply-To: <162348854107.23880.9435845134678613641@git-01.infra.openwrt.org>
References: <162348854107.23880.9435845134678613641@git-01.infra.openwrt.org>
Message-ID: <mailman.5241.1623488549.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/e422a3af6987f3b1d1955a432d344eb65f6152ba

commit e422a3af6987f3b1d1955a432d344eb65f6152ba
Author: Liu Yu <f78fk at live.com>
AuthorDate: Tue Jun 8 09:50:02 2021 +0800

    ramips: fix Ethernet random MAC address for HILINK HLK-7628N
    
    Set the ethernet address from flash.
    
    MAC addresses as verified by OEM firmware:
    
      use   interface  source
      2g    wlan0      factory 0x04 (label)
      LAN   eth0.1     factory 0x28 (label+1)
      WAN   eth0.2     factory 0x2e (label+2)
    
    Fixes: 671c9d16e382 ("ramips: add support for HILINK HLK-7628N")
    
    Signed-off-by: Liu Yu <f78fk at live.com>
    [drop old MAC address setup from 02_network, cut out state_default
    changes, face-lift commit message, add Fixes:]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
    (cherry picked from commit ae9c5cd37bf5c08452f314b54afa963a00bdde30)
---
 target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts        | 4 ++++
 target/linux/ramips/mt76x8/base-files/etc/board.d/02_network | 5 +----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts b/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts
index 69987b3566..f5106a5080 100644
--- a/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts
+++ b/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts
@@ -80,6 +80,10 @@
 	};
 };
 
+&ethernet {
+	mtd-mac-address = <&factory 0x28>;
+};
+
 &wmac {
 	status = "okay";
 };
diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
index b741b4f9b4..c55733ad53 100755
--- a/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/02_network
@@ -168,6 +168,7 @@ ramips_setup_macs()
 		lan_mac=$wan_mac
 		;;
 	cudy,wr1000|\
+	hilink,hlk-7628n|\
 	hilink,hlk-7688a|\
 	wavlink,wl-wn577a2)
 		wan_mac=$(mtd_get_mac_binary factory 0x2e)
@@ -186,10 +187,6 @@ ramips_setup_macs()
 		wan_mac=$(mtd_get_mac_binary factory 0x22)
 		label_mac=$wan_mac
 		;;
-	hilink,hlk-7628n)
-		lan_mac=$(macaddr_setbit_la "$(cat /sys/class/net/eth0/address)")
-		wan_mac=$(macaddr_add "$lan_mac" 1)
-		;;
 	hiwifi,hc5661a|\
 	hiwifi,hc5761a|\
 	hiwifi,hc5861b)


From lede-commits at lists.infradead.org  Sat Jun 12 03:41:11 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 12 Jun 2021 06:41:11 -0400
Subject: [openwrt/openwrt]  tools: fix dependencies of cmake packages
In-Reply-To: <162349447194.8419.13877851005503528346@git-01.infra.openwrt.org>
References: <162349447194.8419.13877851005503528346@git-01.infra.openwrt.org>
Message-ID: <mailman.5246.1623494477.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/d45baa860ffc79ae1cf68fceb94990e39bb06bab

commit d45baa860ffc79ae1cf68fceb94990e39bb06bab
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sat Jun 12 12:40:02 2021 +0200

    tools: fix dependencies of cmake packages
    
    Make cmake depend on ninja, so that other cmake based tools also depend on it
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 tools/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/Makefile b/tools/Makefile
index 47a82fd237..dccf298af6 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -43,7 +43,7 @@ $(curdir)/b43-tools/compile := $(curdir)/bison/compile
 $(curdir)/bc/compile := $(curdir)/bison/compile $(curdir)/libtool/compile
 $(curdir)/bison/compile := $(curdir)/flex/compile
 $(curdir)/cbootimage/compile += $(curdir)/automake/compile
-$(curdir)/cmake/compile += $(curdir)/libressl/compile
+$(curdir)/cmake/compile += $(curdir)/libressl/compile $(curdir)/ninja/compile
 $(curdir)/dosfstools/compile := $(curdir)/autoconf/compile $(curdir)/automake/compile
 $(curdir)/e2fsprogs/compile := $(curdir)/libtool/compile
 $(curdir)/fakeroot/compile := $(curdir)/libtool/compile


From lede-commits at lists.infradead.org  Sat Jun 12 05:34:15 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 12 Jun 2021 08:34:15 -0400
Subject: [openwrt/openwrt] build: do not override DESTDIR for cmake ninja
 host builds
In-Reply-To: <162350125404.29186.18240849034325984510@git-01.infra.openwrt.org>
References: <162350125404.29186.18240849034325984510@git-01.infra.openwrt.org>
Message-ID: <mailman.5255.1623501258.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/18430a34e6a287aaf6f13a110a3202dcac3b3d1a

commit 18430a34e6a287aaf6f13a110a3202dcac3b3d1a
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sat Jun 12 14:32:41 2021 +0200

    build: do not override DESTDIR for cmake ninja host builds
    
    The full prefix is already passed to cmake
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 include/cmake.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/cmake.mk b/include/cmake.mk
index 7ccd872365..b38d440039 100644
--- a/include/cmake.mk
+++ b/include/cmake.mk
@@ -60,11 +60,11 @@ ifeq ($(HOST_USE_NINJA),1)
   endef
 
   define Host/Install/Default
-	+DESTDIR="$(HOST_INSTALL_DIR)" $(NINJA) -C $(HOST_BUILD_DIR) install
+	+$(NINJA) -C $(HOST_BUILD_DIR) install
   endef
 
   define Host/Uninstall/Default
-	+DESTDIR="$(HOST_INSTALL_DIR)" $(NINJA) -C $(HOST_BUILD_DIR) uninstall
+	+$(NINJA) -C $(HOST_BUILD_DIR) uninstall
   endef
 endif
 


From lede-commits at lists.infradead.org  Sat Jun 12 05:34:14 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 12 Jun 2021 08:34:14 -0400
Subject: [openwrt/openwrt] tools: build ninja before ccache to fix the build
 order
In-Reply-To: <162350125404.29186.18240849034325984510@git-01.infra.openwrt.org>
References: <162350125404.29186.18240849034325984510@git-01.infra.openwrt.org>
Message-ID: <mailman.5256.1623501258.434944.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/fa0aea53b2f1dccc2073efac8020151960d25513

commit fa0aea53b2f1dccc2073efac8020151960d25513
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sat Jun 12 14:24:40 2021 +0200

    tools: build ninja before ccache to fix the build order
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 tools/Makefile       | 2 +-
 tools/ninja/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index dccf298af6..a48aa80db3 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -79,7 +79,7 @@ ifneq ($(HOST_OS),Linux)
 endif
 
 ifneq ($(CONFIG_CCACHE)$(CONFIG_SDK),)
-$(foreach tool, $(filter-out xz zstd patch pkgconf libressl cmake,$(tools-y)), $(eval $(curdir)/$(tool)/compile += $(curdir)/ccache/compile))
+$(foreach tool, $(filter-out xz zstd patch pkgconf libressl ninja cmake,$(tools-y)), $(eval $(curdir)/$(tool)/compile += $(curdir)/ccache/compile))
 tools-y += ccache
 $(curdir)/ccache/compile := $(curdir)/zstd/compile
 endif
diff --git a/tools/ninja/Makefile b/tools/ninja/Makefile
index 3cbd6aebba..0ff642a740 100644
--- a/tools/ninja/Makefile
+++ b/tools/ninja/Makefile
@@ -20,7 +20,7 @@ endef
 
 define Host/Compile
 	cd $(HOST_BUILD_DIR) && \
-		CXX="$(HOSTCXX)" \
+		CXX="$(HOSTCXX_NOCACHE)" \
 		CXXFLAGS="$(HOST_CXXFLAGS) $(HOST_CPPFLAGS)" \
 		LDFLAGS="$(HOST_LDFLAGS)" \
 		$(STAGING_DIR_HOST)/bin/$(PYTHON) configure.py --bootstrap $(CONFIGURE_ARGS)


From lede-commits at lists.infradead.org  Sat Jun 12 11:28:20 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 12 Jun 2021 14:28:20 -0400
Subject: [openwrt/openwrt]  README: update routing.git URL
In-Reply-To: <162352250046.19466.11971277683357611087@git-01.infra.openwrt.org>
References: <162352250046.19466.11971277683357611087@git-01.infra.openwrt.org>
Message-ID: <mailman.5283.1623522504.434944.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/0371f401933e8b24ba6add2689098474774d04d6

commit 0371f401933e8b24ba6add2689098474774d04d6
Author: Paul Spooren <mail at aparcar.org>
AuthorDate: Sat Jun 12 08:27:16 2021 -1000

    README: update routing.git URL
    
    The routing packages feed moved from `openwrt-routing/packages` to
    `openwrt/routing`, reflect that in the README.
    
    Signed-off-by: Paul Spooren <mail at aparcar.org>
---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 55a6b9bd30..5848ab25bf 100644
--- a/README.md
+++ b/README.md
@@ -57,8 +57,8 @@ packages to OpenWrt, please find the fitting repository below.
 * [OpenWrt Packages](https://github.com/openwrt/packages): Community repository
   of ported packages.
 
-* [OpenWrt Routing](https://github.com/openwrt-routing/packages): Packages
-  specifically focused on (mesh) routing.
+* [OpenWrt Routing](https://github.com/openwrt/routing): Packages specifically
+  focused on (mesh) routing.
 
 ## Support Information
 


From lede-commits at lists.infradead.org  Sat Jun 12 15:39:52 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 12 Jun 2021 18:39:52 -0400
Subject: [openwrt/openwrt]  README: switch from freenode to oftc
In-Reply-To: <162353759209.27495.4531400157127727518@git-01.infra.openwrt.org>
References: <162353759209.27495.4531400157127727518@git-01.infra.openwrt.org>
Message-ID: <mailman.5289.1623537597.434944.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/5a66165cb1863693ce7901d153f5e41c91a130e1

commit 5a66165cb1863693ce7901d153f5e41c91a130e1
Author: Paul Spooren <mail at aparcar.org>
AuthorDate: Sat Jun 12 12:38:30 2021 -1000

    README: switch from freenode to oftc
    
    We recently switched from freenode.net to oftc.net, reflect that in the
    README and update the links.
    
    Signed-off-by: Paul Spooren <mail at aparcar.org>
---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 5848ab25bf..bf17544ed4 100644
--- a/README.md
+++ b/README.md
@@ -74,13 +74,13 @@ For a list of supported devices see the [OpenWrt Hardware Database](https://open
 ### Support Community
 
 * [Forum](https://forum.openwrt.org): For usage, projects, discussions and hardware advise.
-* [Support Chat](https://webchat.freenode.net/#openwrt): Channel `#openwrt` on freenode.net.
+* [Support Chat](https://webchat.oftc.net/#openwrt): Channel `#openwrt` on **oftc.net**.
 
 ### Developer Community
 
 * [Bug Reports](https://bugs.openwrt.org): Report bugs in OpenWrt
 * [Dev Mailing List](https://lists.openwrt.org/mailman/listinfo/openwrt-devel): Send patches
-* [Dev Chat](https://webchat.freenode.net/#openwrt-devel): Channel `#openwrt-devel` on freenode.net.
+* [Dev Chat](https://webchat.oftc.net/#openwrt-devel): Channel `#openwrt-devel` on **oftc.net**.
 
 ## License
 


From lede-commits at lists.infradead.org  Sat Jun 12 15:42:00 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 12 Jun 2021 18:42:00 -0400
Subject: [openwrt/openwrt]  README: update routing.git URL
In-Reply-To: <162353772019.28745.2025296240520121523@git-01.infra.openwrt.org>
References: <162353772019.28745.2025296240520121523@git-01.infra.openwrt.org>
Message-ID: <mailman.5290.1623537724.434944.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/78a2aef8d601a49e171c707806658182d5c7c009

commit 78a2aef8d601a49e171c707806658182d5c7c009
Author: Paul Spooren <mail at aparcar.org>
AuthorDate: Sat Jun 12 08:27:16 2021 -1000

    README: update routing.git URL
    
    The routing packages feed moved from `openwrt-routing/packages` to
    `openwrt/routing`, reflect that in the README.
    
    Signed-off-by: Paul Spooren <mail at aparcar.org>
    (cherry picked from commit 0371f401933e8b24ba6add2689098474774d04d6)
---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 6bb4d2e913..f4497de3c0 100644
--- a/README.md
+++ b/README.md
@@ -57,8 +57,8 @@ packages to OpenWrt, please find the fitting repository below.
 * [OpenWrt Packages](https://github.com/openwrt/packages): Community repository
   of ported packages.
 
-* [OpenWrt Routing](https://github.com/openwrt-routing/packages): Packages
-  specifically focused on (mesh) routing.
+* [OpenWrt Routing](https://github.com/openwrt/routing): Packages specifically
+  focused on (mesh) routing.
 
 ## Support Information
 


From lede-commits at lists.infradead.org  Sat Jun 12 15:42:01 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 12 Jun 2021 18:42:01 -0400
Subject: [openwrt/openwrt]  README: switch from freenode to oftc
In-Reply-To: <162353772019.28745.2025296240520121523@git-01.infra.openwrt.org>
References: <162353772019.28745.2025296240520121523@git-01.infra.openwrt.org>
Message-ID: <mailman.5291.1623537724.434944.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/144bf23e5ae4db91a64df0709a4e909561152351

commit 144bf23e5ae4db91a64df0709a4e909561152351
Author: Paul Spooren <mail at aparcar.org>
AuthorDate: Sat Jun 12 12:38:30 2021 -1000

    README: switch from freenode to oftc
    
    We recently switched from freenode.net to oftc.net, reflect that in the
    README and update the links.
    
    Signed-off-by: Paul Spooren <mail at aparcar.org>
    (cherry picked from commit 5a66165cb1863693ce7901d153f5e41c91a130e1)
---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index f4497de3c0..051c2469fa 100644
--- a/README.md
+++ b/README.md
@@ -74,13 +74,13 @@ For a list of supported devices see the [OpenWrt Hardware Database](https://open
 ### Support Community
 
 * [Forum](https://forum.openwrt.org): For usage, projects, discussions and hardware advise.
-* [Support Chat](https://webchat.freenode.net/#openwrt): Channel `#openwrt` on freenode.net.
+* [Support Chat](https://webchat.oftc.net/#openwrt): Channel `#openwrt` on **oftc.net**.
 
 ### Developer Community
 
 * [Bug Reports](https://bugs.openwrt.org): Report bugs in OpenWrt
 * [Dev Mailing List](https://lists.openwrt.org/mailman/listinfo/openwrt-devel): Send patches
-* [Dev Chat](https://webchat.freenode.net/#openwrt-devel): Channel `#openwrt-devel` on freenode.net.
+* [Dev Chat](https://webchat.oftc.net/#openwrt-devel): Channel `#openwrt-devel` on **oftc.net**.
 
 ## License
 


From lede-commits at lists.infradead.org  Sat Jun 12 16:59:38 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 12 Jun 2021 19:59:38 -0400
Subject: [openwrt/openwrt] base-files: upgrade: use procd to kill managed
 daemons
In-Reply-To: <162354237853.6105.11100245835120602581@git-01.infra.openwrt.org>
References: <162354237853.6105.11100245835120602581@git-01.infra.openwrt.org>
Message-ID: <mailman.5294.1623542382.434944.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/b118aba8cbac58a45d4882cd79e18e56c3fbdc70

commit b118aba8cbac58a45d4882cd79e18e56c3fbdc70
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Sat May 29 09:03:11 2021 -0400

    base-files: upgrade: use procd to kill managed daemons
    
    These processes are managed by procd and set to start again when killed
    via the procd instance parameter "respawn" being set during init.
    
    Example:
    procd_set_param respawn 3600 1 0
    
    When they are killed manually during sysupgrade,
    they are started again in 5 seconds or less, depending on
    how the "respawn" parameter is set.
    
    Use procd through ubus to disable the instances that respawn them,
    however, allow dnsmasq, netifd, and logd to restart for remote logging.
    
    Properly closing all these processes increases free memory by about 3 MB,
    which should help low memory devices upgrade without crashing.
    
    For very low memory devices (set to 32 MB for now)
    also kill dnsmasq, netifd, and logd for an additional 3 MB of free memory.
    
    Also, bump sleep values to allow at least 10 seconds
    for network interfaces and daemons
    to come up after they are killed and restarted
    before caches are dropped.
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 package/base-files/files/lib/upgrade/stage2 | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2
index e2259e3472..b00d0c079a 100755
--- a/package/base-files/files/lib/upgrade/stage2
+++ b/package/base-files/files/lib/upgrade/stage2
@@ -123,15 +123,31 @@ kill_remaining() { # [ <signal> [ <loop> ] ]
 
 indicate_upgrade
 
+while read -r a b c; do
+	case "$a" in
+		MemT*) mem="$b" ;; esac
+done < /proc/meminfo
+
+[ "$mem" -gt 32768 ] && \
+	skip_services="dnsmasq log network"
+for service in /etc/init.d/*; do
+	service=${service##*/}
+
+	case " $skip_services " in
+		*" $service "*) continue ;; esac
+
+	ubus call service delete '{ "name": "'"$service"'" }' 2>/dev/null
+done
+
 killall -9 telnetd
 killall -9 dropbear
 killall -9 ash
 
 kill_remaining TERM
-sleep 3
+sleep 4
 kill_remaining KILL 1
 
-sleep 1
+sleep 6
 
 echo 3 > /proc/sys/vm/drop_caches
 


From lede-commits at lists.infradead.org  Sat Jun 12 19:47:58 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 12 Jun 2021 22:47:58 -0400
Subject: [openwrt/openwrt]  prereq-build: diff requirement to GNU
In-Reply-To: <162355247812.32039.2839315490905772986@git-01.infra.openwrt.org>
References: <162355247812.32039.2839315490905772986@git-01.infra.openwrt.org>
Message-ID: <mailman.5295.1623552491.434944.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/9bf654ac4742326ddda6656182f5bae00ad3757b

commit 9bf654ac4742326ddda6656182f5bae00ad3757b
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sat Jun 12 16:02:29 2021 -0700

    prereq-build: diff requirement to GNU
    
    tools/quilt requires GNU diffutils to compile. Failure can be simulated
    by installing Alpine Linux without diffutils.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 include/prereq-build.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/prereq-build.mk b/include/prereq-build.mk
index 639d1ad0fa..8fbf6f22c4 100644
--- a/include/prereq-build.mk
+++ b/include/prereq-build.mk
@@ -102,9 +102,9 @@ $(eval $(call SetupHostCommand,patch,Please install GNU 'patch', \
 	gpatch --version 2>&1 | grep 'Free Software Foundation', \
 	patch --version 2>&1 | grep 'Free Software Foundation'))
 
-$(eval $(call SetupHostCommand,diff,Please install diffutils, \
-	gdiff --version 2>&1 | grep diff, \
-	diff --version 2>&1 | grep diff))
+$(eval $(call SetupHostCommand,diff,Please install GNU diffutils, \
+	gdiff --version 2>&1 | grep GNU, \
+	diff --version 2>&1 | grep GNU))
 
 $(eval $(call SetupHostCommand,cp,Please install GNU fileutils, \
 	gcp --help 2>&1 | grep 'Copy SOURCE', \


From lede-commits at lists.infradead.org  Sun Jun 13 02:32:54 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 13 Jun 2021 05:32:54 -0400
Subject: [openwrt/openwrt] generic: kernel 5.4: fix probe error for AR803x PHYs
In-Reply-To: <162357677382.12801.3008792493818796574@git-01.infra.openwrt.org>
References: <162357677382.12801.3008792493818796574@git-01.infra.openwrt.org>
Message-ID: <mailman.5326.1623576779.434944.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/c44cefceb3add724c135a4f57209ce66af5d40c9

commit c44cefceb3add724c135a4f57209ce66af5d40c9
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Sat Jun 12 13:12:40 2021 +0200

    generic: kernel 5.4: fix probe error for AR803x PHYs
    
    Atheros PHYs using the at803x driver apart from the AR8031/AR8033 fail
    to probe with kernel 5.4, due to ret in at803x_probe being
    uninitialized.
    
    [    1.403461] Atheros 8035 ethernet: probe of 4ef600c00.ethernet:01
                   failed with error -1066114012
    
    Initialize ret in order to successfully prove the PHYs on kernel 5.4.
    
    Kernel 5.10 is not affected, as the ret is always assigned prior to
    returning.
    
    Tested on OCEDO Koala.
    
    Reported-by: Russell Senior <russell at personaltelco.net>
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 .../790-net-phy-at803x-select-correct-page-on-config-init.patch         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/generic/backport-5.4/790-net-phy-at803x-select-correct-page-on-config-init.patch b/target/linux/generic/backport-5.4/790-net-phy-at803x-select-correct-page-on-config-init.patch
index c6811736f8..b7e3201fb7 100644
--- a/target/linux/generic/backport-5.4/790-net-phy-at803x-select-correct-page-on-config-init.patch
+++ b/target/linux/generic/backport-5.4/790-net-phy-at803x-select-correct-page-on-config-init.patch
@@ -71,7 +71,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  {
  	struct device *dev = &phydev->mdio.dev;
  	struct at803x_priv *priv;
-+	int ret;
++	int ret = 0;
  
  	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
  	if (!priv)


From lede-commits at lists.infradead.org  Sun Jun 13 02:32:55 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 13 Jun 2021 05:32:55 -0400
Subject: [openwrt/openwrt] apm821xx: move CONFIG_REGULATOR to target config
In-Reply-To: <162357677382.12801.3008792493818796574@git-01.infra.openwrt.org>
References: <162357677382.12801.3008792493818796574@git-01.infra.openwrt.org>
Message-ID: <mailman.5327.1623576779.434944.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/52ee96c35ccb50b42e656d56e9daef7a4ae10ab1

commit 52ee96c35ccb50b42e656d56e9daef7a4ae10ab1
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Sun Jun 13 00:05:59 2021 +0200

    apm821xx: move CONFIG_REGULATOR to target config
    
    This moves CONFIG_REGULATOR to the target config instead of the
    subtarget config.
    
    For kernel 5.10, CONFIG_AT803X_PHY depends on CONFIG_REGULATOR.
    As we do not have a size constraint, move this symbol to the
    target configuration for kernel 5.4 as well as 5.10.
    
    Reported-by: Russell Senior <russell at personaltelco.net>
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 target/linux/apm821xx/config-5.10         | 1 +
 target/linux/apm821xx/config-5.4          | 1 +
 target/linux/apm821xx/sata/config-default | 1 -
 3 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/linux/apm821xx/config-5.10 b/target/linux/apm821xx/config-5.10
index c9c720de29..b729bee903 100644
--- a/target/linux/apm821xx/config-5.10
+++ b/target/linux/apm821xx/config-5.10
@@ -250,6 +250,7 @@ CONFIG_PTE_64BIT=y
 # CONFIG_RAINIER is not set
 CONFIG_RAS=y
 CONFIG_RATIONAL=y
+CONFIG_REGULATOR=y
 CONFIG_RSEQ=y
 # CONFIG_SAM440EP is not set
 # CONFIG_SCOM_DEBUGFS is not set
diff --git a/target/linux/apm821xx/config-5.4 b/target/linux/apm821xx/config-5.4
index 2b9594c3d4..e47186a444 100644
--- a/target/linux/apm821xx/config-5.4
+++ b/target/linux/apm821xx/config-5.4
@@ -304,6 +304,7 @@ CONFIG_PPC_WERROR=y
 CONFIG_PTE_64BIT=y
 # CONFIG_RAINIER is not set
 CONFIG_RAS=y
+CONFIG_REGULATOR=y
 CONFIG_RSEQ=y
 # CONFIG_SAM440EP is not set
 # CONFIG_SCOM_DEBUGFS is not set
diff --git a/target/linux/apm821xx/sata/config-default b/target/linux/apm821xx/sata/config-default
index db2c5c8a30..c3f41c785b 100644
--- a/target/linux/apm821xx/sata/config-default
+++ b/target/linux/apm821xx/sata/config-default
@@ -40,5 +40,4 @@ CONFIG_PPC_EARLY_DEBUG_44x=y
 # CONFIG_PPC_EARLY_DEBUG_MEMCONS is not set
 CONFIG_PPC_EARLY_DEBUG_44x_PHYSHIGH=0x4
 CONFIG_PPC_EARLY_DEBUG_44x_PHYSLOW=0xef600300
-CONFIG_REGULATOR=y
 CONFIG_REGULATOR_FIXED_VOLTAGE=y


From lede-commits at lists.infradead.org  Sun Jun 13 02:32:53 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 13 Jun 2021 05:32:53 -0400
Subject: [openwrt/openwrt]  ramips: add support for TP-Link Archer C6 v3
In-Reply-To: <162357677382.12801.3008792493818796574@git-01.infra.openwrt.org>
References: <162357677382.12801.3008792493818796574@git-01.infra.openwrt.org>
Message-ID: <mailman.5328.1623576781.434944.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/d22fb7f4fd833c420bc2ab34384862da0a6688b5

commit d22fb7f4fd833c420bc2ab34384862da0a6688b5
Author: Amish Vishwakarma <vishwakarma.amish at gmail.com>
AuthorDate: Sat Jun 5 12:31:00 2021 +0530

    ramips: add support for TP-Link Archer C6 v3
    
    The patch adds support for the TP-Link Archer C6 v3 (FCC ID TE7A6V3)
    The patch adds identification changes to the existing TP-Link Archer A6,
    by Vinay Patil <post2vinay at gmail.com>, which has identical hardware.
    
    Specification
    -------------
    MediaTek MT7621 SOC
    RAM:         128MB DDR3
    SPI Flash:   W25Q128 (16MB)
    Ethernet:    MT7530 5x 1000Base-T
    WiFi 5GHz:   Mediatek MT7613BE
    WiFi 2.4GHz: Mediatek MT7603E
    UART/Serial: 115200 8n1
    
    Device Configuration & Serial Port Pins
    ---------------------------------------
    ETH Ports:    LAN4 LAN3 LAN2 LAN1 WAN
                 _______________________
                 |                     |
    Serial Pins: |   VCC GND TXD RXD   |
                 |_____________________|
    
    LEDs:         Power Wifi2G Wifi5G LAN WAN
    
    Build Output
    ------------
    The build will generate following set of files
    [1] openwrt-ramips-mt7621-tplink_archer-c6-v3-initramfs-kernel.bin
    [2] openwrt-ramips-mt7621-tplink_archer-c6-v3-squashfs-factory.bin
    [3] openwrt-ramips-mt7621-tplink_archer-c6-v3-squashfs-sysupgrade.bin
    
    How to Use - Flashing from TP-Link Web Interface
    ------------------------------------------------
    * Go to "Advanced/System Tools/Firmware Update".
    * Click "Browse" and upload the OpenWrt factory image: factory.bin[2]
    * Click the "Upgrade" button, and select "Yes" when prompted.
    
    TFTP Booting
    ------------
    Setup a TFTP boot server with address 192.168.0.5.
    While starting U-boot press '4' key to stop autoboot.
    Copy the initramfs-kernel.bin[1] to TFTP server folder, rename as test.bin
    From u-boot command prompt run tftpboot followed by bootm.
    
    Recovery
    --------
    Archer A6 V3 has recovery page activated if SPI booting from flash fails.
    Recovery page can be activated by powercycling the router four times
    before the boot process is complete.
    Note: TFTP boot can be activated only from u-boot serial console.
    Device recovery address: 192.168.0.1
    
    Signed-off-by: Amish Vishwakarma <vishwakarma.amish at gmail.com>
    [fix indent]
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 .../ramips/dts/mt7621_tplink_archer-a6-v3.dts      | 181 +--------------------
 .../ramips/dts/mt7621_tplink_archer-c6-v3.dts      |   9 +
 ...r-a6-v3.dts => mt7621_tplink_archer-x6-v3.dtsi} |   5 +-
 target/linux/ramips/image/mt7621.mk                |  13 ++
 .../ramips/mt7621/base-files/etc/board.d/01_leds   |   1 +
 tools/firmware-utils/src/tplink-safeloader.c       |  42 +++++
 6 files changed, 67 insertions(+), 184 deletions(-)

diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-a6-v3.dts b/target/linux/ramips/dts/mt7621_tplink_archer-a6-v3.dts
index 46cb365da7..01fea5bde5 100644
--- a/target/linux/ramips/dts/mt7621_tplink_archer-a6-v3.dts
+++ b/target/linux/ramips/dts/mt7621_tplink_archer-a6-v3.dts
@@ -1,188 +1,9 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "mt7621.dtsi"
-
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
+#include "mt7621_tplink_archer-x6-v3.dtsi"
 
 / {
 	compatible = "tplink,archer-a6-v3", "mediatek,mt7621-soc";
 	model = "TP-Link Archer A6 v3";
 
-	aliases {
-		label-mac-device = &gmac0;
-		led-boot = &led_power;
-		led-failsafe = &led_power;
-		led-running = &led_power;
-		led-upgrade = &led_power;
-	};
-
-	chosen {
-		bootargs = "console=ttyS0,115200n8";
-	};
-
-	keys {
-		compatible = "gpio-keys";
-
-		wps {
-			label = "wps";
-			gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
-			debounce-interval = <60>;
-			linux,code = <KEY_WPS_BUTTON>;
-		};
-
-		reset {
-			label = "reset";
-			gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
-			debounce-interval = <60>;
-			linux,code = <KEY_RESTART>;
-		};
-	};
-
-	leds {
-		compatible = "gpio-leds";
-
-		led_power: power {
-			label = "green:power";
-			gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
-		};
-
-		wan_orange {
-			label = "orange:wan";
-			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
-		};
-
-		lan {
-			label = "green:lan";
-			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
-		};
-
-		wifi5g {
-			label = "green:wifi5g";
-			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
-			linux,default-trigger = "phy1tpt";
-		};
-
-		wifi2g {
-			label = "green:wifi2g";
-			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
-			linux,default-trigger = "phy0tpt";
-		};
-
-		wan_green {
-			label = "green:wan";
-			gpios = <&gpio 45 GPIO_ACTIVE_LOW>;
-		};
-	};
-};
-
-&spi0 {
-	status = "okay";
-
-	flash at 0 {
-		compatible = "jedec,spi-nor";
-		reg = <0>;
-		spi-max-frequency = <40000000>;
-
-		partitions {
-			compatible = "fixed-partitions";
-			#address-cells = <1>;
-			#size-cells = <1>;
-
-			partition at 0 {
-				label = "u-boot";
-				reg = <0x0 0x40000>;
-				read-only;
-			};
-
-			partition at 40000 {
-				label = "firmware";
-				compatible = "denx,uimage";
-				reg = <0x40000 0xf60000>;
-			};
-
-			config: partition at fa0000 {
-				label = "config";
-				reg = <0xfa0000 0x50000>;
-				read-only;
-			};
-
-			radio: partition at ff0000 {
-				label = "radio";
-				reg = <0xff0000 0x10000>;
-				read-only;
-			};
-		};
-	};
-};
-
-&state_default {
-	gpio {
-		groups =  "i2c", "uart2", "uart3", "jtag", "wdt";
-		function = "gpio";
-	};
-};
-
-&ethernet {
-	pinctrl-names = "default";
-	pinctrl-0 = <&rgmii1_pins &mdio_pins>;
-};
-
-&pcie {
-	status = "okay";
-};
-
-&pcie0 {
-	wifi at 0,0 {
-		compatible = "mediatek,mt76";
-		reg = <0x0000 0 0 0 0>;
-		mediatek,mtd-eeprom = <&radio 0x0>;
-		mtd-mac-address = <&config 0x8>;
-		mtd-mac-address-increment = <1>;
-		ieee80211-freq-limit = <2400000 2500000>;
-	};
-};
-
-&pcie1 {
-	wifi at 0,0 {
-		compatible = "mediatek,mt76";
-		reg = <0x0000 0 0 0 0>;
-		mediatek,mtd-eeprom = <&radio 0x8000>;
-		mtd-mac-address = <&config 0x8>;
-		mtd-mac-address-increment = <2>;
-		ieee80211-freq-limit = <5000000 6000000>;
-	};
-};
-
-&gmac0 {
-	mtd-mac-address = <&config 0x8>;
-};
-
-&switch0 {
-	ports {
-		port at 0 {
-			status = "okay";
-			label = "wan";
-		};
-
-		port at 1 {
-			status = "okay";
-			label = "lan1";
-		};
-
-		port at 2 {
-			status = "okay";
-			label = "lan2";
-		};
-
-		port at 3 {
-			status = "okay";
-			label = "lan3";
-		};
-
-		port at 4 {
-			status = "okay";
-			label = "lan4";
-		};
-	};
 };
diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-c6-v3.dts b/target/linux/ramips/dts/mt7621_tplink_archer-c6-v3.dts
new file mode 100644
index 0000000000..07d808ca20
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_tplink_archer-c6-v3.dts
@@ -0,0 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621_tplink_archer-x6-v3.dtsi"
+
+/ {
+	compatible = "tplink,archer-c6-v3", "mediatek,mt7621-soc";
+	model = "TP-Link Archer C6 v3";
+
+};
diff --git a/target/linux/ramips/dts/mt7621_tplink_archer-a6-v3.dts b/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi
similarity index 95%
copy from target/linux/ramips/dts/mt7621_tplink_archer-a6-v3.dts
copy to target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi
index 46cb365da7..76d9908fb9 100644
--- a/target/linux/ramips/dts/mt7621_tplink_archer-a6-v3.dts
+++ b/target/linux/ramips/dts/mt7621_tplink_archer-x6-v3.dtsi
@@ -1,4 +1,4 @@
-// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+// SPDX-License-Identifier: GPL-2.0-only
 
 #include "mt7621.dtsi"
 
@@ -6,9 +6,6 @@
 #include <dt-bindings/input/input.h>
 
 / {
-	compatible = "tplink,archer-a6-v3", "mediatek,mt7621-soc";
-	model = "TP-Link Archer A6 v3";
-
 	aliases {
 		label-mac-device = &gmac0;
 		led-boot = &led_power;
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index efeac698b1..ee5ebaa8b2 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -1244,6 +1244,19 @@ define Device/tplink_archer-a6-v3
 endef
 TARGET_DEVICES += tplink_archer-a6-v3
 
+define Device/tplink_archer-c6-v3
+  $(Device/dsa-migration)
+  $(Device/tplink-safeloader)
+  DEVICE_MODEL := Archer C6
+  DEVICE_VARIANT := V3
+  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e \
+	kmod-mt7663-firmware-ap kmod-mt7663-firmware-sta
+  TPLINK_BOARD_ID := ARCHER-C6-V3
+  KERNEL := $(KERNEL_DTB) | uImage lzma
+  IMAGE_SIZE := 15744k
+endef
+TARGET_DEVICES += tplink_archer-c6-v3
+
 define Device/tplink_archer-c6u-v1
   $(Device/dsa-migration)
   $(Device/tplink-safeloader)
diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
index 5322bc9db0..c04dae4f0d 100644
--- a/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
+++ b/target/linux/ramips/mt7621/base-files/etc/board.d/01_leds
@@ -90,6 +90,7 @@ netgear,r6800)
 	ucidef_set_led_netdev "lan4" "LAN4" "white:lan4" "lan4"
 	;;
 tplink,archer-a6-v3|\
+tplink,archer-c6-v3|\
 tplink,archer-c6u-v1)
 	ucidef_set_led_netdev "lan" "LAN" "green:lan" "br-lan"
 	ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan"
diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c
index e5974325ae..86d51db269 100644
--- a/tools/firmware-utils/src/tplink-safeloader.c
+++ b/tools/firmware-utils/src/tplink-safeloader.c
@@ -1050,6 +1050,47 @@ static struct device_info boards[] = {
 		.first_sysupgrade_partition = "os-image",
 		.last_sysupgrade_partition = "file-system",
 	},
+	/** Firmware layout for the Archer C6 v3 */
+	{
+		.id     = "ARCHER-C6-V3",
+		.vendor = "",
+		.support_list =
+			"SupportList:\n"
+			"{product_name:Archer C6,product_ver:3.20,special_id:55530000}"
+			"{product_name:Archer C6,product_ver:3.20,special_id:45550000}"
+			"{product_name:Archer C6,product_ver:3.20,special_id:52550000}"
+			"{product_name:Archer C6,product_ver:3.20,special_id:4A500000}"
+			"{product_name:Archer C6,product_ver:3.20,special_id:4B520000}",
+		.part_trail = 0x00,
+		.soft_ver = "soft_ver:1.0.9\n",
+
+		.partitions = {
+			{"fs-uboot", 0x00000, 0x40000},
+			{"firmware", 0x40000, 0xf60000},
+			{"default-mac", 0xfa0000, 0x00200},
+			{"pin", 0xfa0200, 0x00100},
+			{"device-id", 0xfa0300, 0x00100},
+			{"product-info", 0xfa0400, 0x0fc00},
+			{"default-config", 0xfb0000, 0x08000},
+			{"ap-def-config", 0xfb8000, 0x08000},
+			{"user-config", 0xfc0000, 0x0a000},
+			{"ag-config", 0xfca000, 0x04000},
+			{"certificate", 0xfce000, 0x02000},
+			{"ap-config", 0xfd0000, 0x06000},
+			{"router-config", 0xfd6000, 0x06000},
+			{"favicon", 0xfdc000, 0x02000},
+			{"logo", 0xfde000, 0x02000},
+			{"partition-table", 0xfe0000, 0x00800},
+			{"soft-version", 0xfe0800, 0x00100},
+			{"support-list", 0xfe0900, 0x00200},
+			{"profile", 0xfe0b00, 0x03000},
+			{"extra-para", 0xfe3b00, 0x00100},
+			{"radio", 0xff0000, 0x10000},
+			{NULL, 0, 0}
+		},
+		.first_sysupgrade_partition = "os-image",
+		.last_sysupgrade_partition = "file-system",
+	},
 	/** Firmware layout for the Archer A6 v3  */
 	{
 		.id     = "ARCHER-A6-V3",
@@ -2896,6 +2937,7 @@ static void build_image(const char *output,
 	    strcasecmp(info->id, "ARCHER-C60-V2") == 0 ||
 	    strcasecmp(info->id, "ARCHER-C60-V3") == 0 ||
 	    strcasecmp(info->id, "ARCHER-C6U-V1") == 0 ||
+	    strcasecmp(info->id, "ARCHER-C6-V3") == 0 ||
 	    strcasecmp(info->id, "TLWR1043NV5") == 0) {
 		const uint8_t extra_para[2] = {0x01, 0x00};
 		parts[5] = make_extra_para(info, extra_para,


From lede-commits at lists.infradead.org  Sun Jun 13 13:28:46 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 13 Jun 2021 16:28:46 -0400
Subject: [openwrt/openwrt]  odhcpd: update to latest git HEAD
In-Reply-To: <162361612663.11322.3777121600522652024@git-01.infra.openwrt.org>
References: <162361612663.11322.3777121600522652024@git-01.infra.openwrt.org>
Message-ID: <mailman.5373.1623616130.434944.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/6ed0ddde05235e23a8d02df0fbaaab275926f0f8

commit 6ed0ddde05235e23a8d02df0fbaaab275926f0f8
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Sun Jun 13 22:25:42 2021 +0200

    odhcpd: update to latest git HEAD
    
    564d25e config: fix ra_flags none setting
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/network/services/odhcpd/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile
index 9ecae8a919..d9a320d17a 100644
--- a/package/network/services/odhcpd/Makefile
+++ b/package/network/services/odhcpd/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/odhcpd.git
-PKG_SOURCE_DATE:=2021-05-15
-PKG_SOURCE_VERSION:=a12fcb3cee2d489b8648a2398812d7bed2f25faa
-PKG_MIRROR_HASH:=26a0dd58e29509471bd2be181a59fa1d75541426137d6ca87c98806199751efb
+PKG_SOURCE_DATE:=2021-06-19
+PKG_SOURCE_VERSION:=564d25e53fad925fa3ed56e3004c107d40925fa4
+PKG_MIRROR_HASH:=a0644d31f99f20e5c2cee74153b81a0c2eae9ebeb644662cc76b0984b44dd490
 
 PKG_MAINTAINER:=Hans Dedecker <dedeckeh at gmail.com>
 PKG_LICENSE:=GPL-2.0


From lede-commits at lists.infradead.org  Sun Jun 13 14:30:20 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 13 Jun 2021 17:30:20 -0400
Subject: [openwrt/openwrt]  kernel: move some drm symbols to generic config
In-Reply-To: <162361981663.20594.2258936442020494423@git-01.infra.openwrt.org>
References: <162361981663.20594.2258936442020494423@git-01.infra.openwrt.org>
Message-ID: <mailman.5376.1623619821.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/0b92b5b04f4bd1438be2720c202119d42e8876f3

commit 0b92b5b04f4bd1438be2720c202119d42e8876f3
Author: Tomasz Maciej Nowak <tmn505 at gmail.com>
AuthorDate: Sun Jun 13 18:28:21 2021 +0200

    kernel: move some drm symbols to generic config
    
    These are architecture independent, so move them to generic config.
    
    Signed-off-by: Tomasz Maciej Nowak <tmn505 at gmail.com>
---
 target/linux/at91/sama5/config-default | 1 -
 target/linux/generic/config-5.10       | 2 ++
 target/linux/generic/config-5.4        | 1 +
 target/linux/omap/config-5.4           | 1 -
 target/linux/tegra/config-5.10         | 2 --
 target/linux/tegra/config-5.4          | 1 -
 target/linux/zynq/config-5.4           | 1 -
 7 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/target/linux/at91/sama5/config-default b/target/linux/at91/sama5/config-default
index 4e4c857c1f..10d7d4d3b0 100644
--- a/target/linux/at91/sama5/config-default
+++ b/target/linux/at91/sama5/config-default
@@ -172,7 +172,6 @@ CONFIG_DRM_PANEL=y
 CONFIG_DRM_PANEL_BRIDGE=y
 CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y
 CONFIG_DRM_PANEL_SIMPLE=y
-# CONFIG_DRM_TVE200 is not set
 CONFIG_DTC=y
 CONFIG_EDAC_ATOMIC_SCRUB=y
 CONFIG_EDAC_SUPPORT=y
diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10
index 9b64ee14f9..fdebc06835 100644
--- a/target/linux/generic/config-5.10
+++ b/target/linux/generic/config-5.10
@@ -1507,6 +1507,7 @@ CONFIG_DQL=y
 # CONFIG_DRM_PANEL_TPO_TD043MTEA1 is not set
 # CONFIG_DRM_PANEL_TPO_TPG110 is not set
 # CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA is not set
+# CONFIG_DRM_PANEL_VISIONOX_RM69299 is not set
 # CONFIG_DRM_PANFROST is not set
 # CONFIG_DRM_PARADE_PS8622 is not set
 # CONFIG_DRM_PARADE_PS8640 is not set
@@ -1535,6 +1536,7 @@ CONFIG_DQL=y
 # CONFIG_DRM_TOSHIBA_TC358767 is not set
 # CONFIG_DRM_TOSHIBA_TC358768 is not set
 # CONFIG_DRM_TOSHIBA_TC358775 is not set
+# CONFIG_DRM_TVE200 is not set
 # CONFIG_DRM_UDL is not set
 # CONFIG_DRM_VBOXVIDEO is not set
 # CONFIG_DRM_VC4_HDMI_CEC is not set
diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4
index d0906b52ae..f5e976a691 100644
--- a/target/linux/generic/config-5.4
+++ b/target/linux/generic/config-5.4
@@ -1423,6 +1423,7 @@ CONFIG_DQL=y
 # CONFIG_DRM_TI_TFP410 is not set
 # CONFIG_DRM_TOSHIBA_TC358764 is not set
 # CONFIG_DRM_TOSHIBA_TC358767 is not set
+# CONFIG_DRM_TVE200 is not set
 # CONFIG_DRM_UDL is not set
 # CONFIG_DRM_VBOXVIDEO is not set
 # CONFIG_DRM_VC4_HDMI_CEC is not set
diff --git a/target/linux/omap/config-5.4 b/target/linux/omap/config-5.4
index 742fdd213e..f202758c69 100644
--- a/target/linux/omap/config-5.4
+++ b/target/linux/omap/config-5.4
@@ -228,7 +228,6 @@ CONFIG_DRM_PANEL_SONY_ACX565AKM=y
 CONFIG_DRM_PANEL_TPO_TD028TTEC1=y
 CONFIG_DRM_PANEL_TPO_TD043MTEA1=y
 CONFIG_DRM_TI_TFP410=y
-# CONFIG_DRM_TVE200 is not set
 CONFIG_DTC=y
 CONFIG_EDAC_ATOMIC_SCRUB=y
 CONFIG_EDAC_SUPPORT=y
diff --git a/target/linux/tegra/config-5.10 b/target/linux/tegra/config-5.10
index 5d13b10d2a..e4b1c66f52 100644
--- a/target/linux/tegra/config-5.10
+++ b/target/linux/tegra/config-5.10
@@ -165,11 +165,9 @@ CONFIG_DRM_MIPI_DSI=y
 CONFIG_DRM_PANEL=y
 CONFIG_DRM_PANEL_BRIDGE=y
 CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y
-# CONFIG_DRM_PANEL_VISIONOX_RM69299 is not set
 CONFIG_DRM_TEGRA=y
 # CONFIG_DRM_TEGRA_DEBUG is not set
 # CONFIG_DRM_TEGRA_STAGING is not set
-# CONFIG_DRM_TVE200 is not set
 CONFIG_DTC=y
 CONFIG_EDAC_ATOMIC_SCRUB=y
 CONFIG_EDAC_SUPPORT=y
diff --git a/target/linux/tegra/config-5.4 b/target/linux/tegra/config-5.4
index 521991c64c..b487296ce3 100644
--- a/target/linux/tegra/config-5.4
+++ b/target/linux/tegra/config-5.4
@@ -166,7 +166,6 @@ CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y
 CONFIG_DRM_TEGRA=y
 # CONFIG_DRM_TEGRA_DEBUG is not set
 # CONFIG_DRM_TEGRA_STAGING is not set
-# CONFIG_DRM_TVE200 is not set
 CONFIG_DTC=y
 CONFIG_EDAC_ATOMIC_SCRUB=y
 CONFIG_EDAC_SUPPORT=y
diff --git a/target/linux/zynq/config-5.4 b/target/linux/zynq/config-5.4
index b25d789db7..bfa5792dda 100644
--- a/target/linux/zynq/config-5.4
+++ b/target/linux/zynq/config-5.4
@@ -187,7 +187,6 @@ CONFIG_DRM_KMS_HELPER=y
 CONFIG_DRM_PANEL=y
 CONFIG_DRM_PANEL_BRIDGE=y
 CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y
-# CONFIG_DRM_TVE200 is not set
 CONFIG_DTC=y
 CONFIG_DUMMY_CONSOLE=y
 CONFIG_E1000E=y


From lede-commits at lists.infradead.org  Sun Jun 13 14:30:17 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 13 Jun 2021 17:30:17 -0400
Subject: [openwrt/openwrt]  tegra: refresh kernel config
In-Reply-To: <162361981663.20594.2258936442020494423@git-01.infra.openwrt.org>
References: <162361981663.20594.2258936442020494423@git-01.infra.openwrt.org>
Message-ID: <mailman.5377.1623619821.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/2d7984410d509a202840329095bd60d9ab27aafc

commit 2d7984410d509a202840329095bd60d9ab27aafc
Author: Tomasz Maciej Nowak <tmn505 at gmail.com>
AuthorDate: Sun Jun 13 18:28:18 2021 +0200

    tegra: refresh kernel config
    
    Recent filtering rules alow to trim the kernel configuration in size, do
    that to reduce the diff between current config and upcoming one.
    
    Signed-off-by: Tomasz Maciej Nowak <tmn505 at gmail.com>
---
 target/linux/tegra/config-5.4 | 90 +------------------------------------------
 1 file changed, 2 insertions(+), 88 deletions(-)

diff --git a/target/linux/tegra/config-5.4 b/target/linux/tegra/config-5.4
index 6c9cc1af3c..521991c64c 100644
--- a/target/linux/tegra/config-5.4
+++ b/target/linux/tegra/config-5.4
@@ -3,23 +3,6 @@ CONFIG_AC97_BUS=y
 CONFIG_ALIGNMENT_TRAP=y
 CONFIG_ARCH_32BIT_OFF_T=y
 CONFIG_ARCH_CLOCKSOURCE_DATA=y
-CONFIG_ARCH_HAS_BINFMT_FLAT=y
-CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y
-CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
-CONFIG_ARCH_HAS_FORTIFY_SOURCE=y
-CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
-CONFIG_ARCH_HAS_KCOV=y
-CONFIG_ARCH_HAS_KEEPINITRD=y
-CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y
-CONFIG_ARCH_HAS_PHYS_TO_DMA=y
-CONFIG_ARCH_HAS_RESET_CONTROLLER=y
-CONFIG_ARCH_HAS_SETUP_DMA_OPS=y
-CONFIG_ARCH_HAS_SET_MEMORY=y
-CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y
-CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y
-CONFIG_ARCH_HAS_TEARDOWN_DMA_OPS=y
-CONFIG_ARCH_HAS_TICK_BROADCAST=y
-CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
 CONFIG_ARCH_HIBERNATION_POSSIBLE=y
 CONFIG_ARCH_KEEP_MEMBLOCK=y
 CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
@@ -30,23 +13,14 @@ CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED=y
 CONFIG_ARCH_NR_GPIO=1024
 CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
 CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y
-CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
-CONFIG_ARCH_SUPPORTS_UPROBES=y
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
 CONFIG_ARCH_TEGRA=y
 # CONFIG_ARCH_TEGRA_114_SOC is not set
 # CONFIG_ARCH_TEGRA_124_SOC is not set
 CONFIG_ARCH_TEGRA_2x_SOC=y
 # CONFIG_ARCH_TEGRA_3x_SOC is not set
-CONFIG_ARCH_USE_BUILTIN_BSWAP=y
-CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
-CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=y
-CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
-CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_ARM=y
 CONFIG_ARM_AMBA=y
-CONFIG_ARM_ARCH_TIMER=y
-CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
 CONFIG_ARM_CPU_SUSPEND=y
 CONFIG_ARM_CRYPTO=y
 CONFIG_ARM_ERRATA_720789=y
@@ -57,12 +31,10 @@ CONFIG_ARM_HAS_SG_CHAIN=y
 CONFIG_ARM_HEAVY_MB=y
 CONFIG_ARM_L1_CACHE_SHIFT=6
 CONFIG_ARM_L1_CACHE_SHIFT_6=y
-# CONFIG_ARM_LPAE is not set
 CONFIG_ARM_PATCH_IDIV=y
 CONFIG_ARM_PATCH_PHYS_VIRT=y
 # CONFIG_ARM_PL172_MPMC is not set
 # CONFIG_ARM_SMMU is not set
-# CONFIG_ARM_SP805_WATCHDOG is not set
 CONFIG_ARM_TEGRA20_CPUFREQ=y
 CONFIG_ARM_THUMB=y
 CONFIG_ARM_THUMBEE=y
@@ -80,7 +52,6 @@ CONFIG_BLK_PM=y
 CONFIG_BLK_SCSI_REQUEST=y
 CONFIG_BOUNCE=y
 CONFIG_CACHE_L2X0=y
-CONFIG_CC_HAS_KASAN_GENERIC=y
 CONFIG_CLKDEV_LOOKUP=y
 CONFIG_CLKSRC_MMIO=y
 CONFIG_CLONE_BACKWARDS=y
@@ -102,7 +73,6 @@ CONFIG_CONTIG_ALLOC=y
 CONFIG_CPU_32v6K=y
 CONFIG_CPU_32v7=y
 CONFIG_CPU_ABRT_EV7=y
-# CONFIG_CPU_BPREDICT_DISABLE is not set
 CONFIG_CPU_CACHE_V7=y
 CONFIG_CPU_CACHE_VIPT=y
 CONFIG_CPU_COPY_V6=y
@@ -121,9 +91,6 @@ CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
 CONFIG_CPU_FREQ_GOV_USERSPACE=y
 # CONFIG_CPU_FREQ_STAT is not set
 CONFIG_CPU_HAS_ASID=y
-# CONFIG_CPU_HOTPLUG_STATE_CONTROL is not set
-# CONFIG_CPU_ICACHE_DISABLE is not set
-# CONFIG_CPU_ICACHE_MISMATCH_WORKAROUND is not set
 CONFIG_CPU_IDLE=y
 CONFIG_CPU_IDLE_GOV_LADDER=y
 CONFIG_CPU_PABRT_V7=y
@@ -178,7 +145,6 @@ CONFIG_CRYPTO_TWOFISH_COMMON=y
 CONFIG_DCACHE_WORD_ACCESS=y
 CONFIG_DEBUG_ALIGN_RODATA=y
 CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
-# CONFIG_DEBUG_USER is not set
 # CONFIG_DEVPORT is not set
 CONFIG_DMADEVICES=y
 CONFIG_DMA_CMA=y
@@ -193,13 +159,10 @@ CONFIG_DRM_FBDEV_EMULATION=y
 CONFIG_DRM_FBDEV_OVERALLOC=100
 CONFIG_DRM_KMS_FB_HELPER=y
 CONFIG_DRM_KMS_HELPER=y
-# CONFIG_DRM_MCDE is not set
 CONFIG_DRM_MIPI_DSI=y
 CONFIG_DRM_PANEL=y
 CONFIG_DRM_PANEL_BRIDGE=y
 CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y
-# CONFIG_DRM_PANEL_SAMSUNG_S6D16D0 is not set
-# CONFIG_DRM_PANEL_TRULY_NT35597_WQXGA is not set
 CONFIG_DRM_TEGRA=y
 # CONFIG_DRM_TEGRA_DEBUG is not set
 # CONFIG_DRM_TEGRA_STAGING is not set
@@ -260,50 +223,7 @@ CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_HAS_DMA=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT_MAP=y
-CONFIG_HAVE_ARCH_AUDITSYSCALL=y
-CONFIG_HAVE_ARCH_BITREVERSE=y
-CONFIG_HAVE_ARCH_JUMP_LABEL=y
-CONFIG_HAVE_ARCH_KGDB=y
-CONFIG_HAVE_ARCH_PFN_VALID=y
-CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
-CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y
-CONFIG_HAVE_ARCH_TRACEHOOK=y
-CONFIG_HAVE_ARM_ARCH_TIMER=y
-CONFIG_HAVE_ARM_SCU=y
-CONFIG_HAVE_ARM_SMCCC=y
-CONFIG_HAVE_ARM_TWD=y
-CONFIG_HAVE_CLK=y
-CONFIG_HAVE_CLK_PREPARE=y
-CONFIG_HAVE_CONTEXT_TRACKING=y
-CONFIG_HAVE_COPY_THREAD_TLS=y
-CONFIG_HAVE_C_RECORDMCOUNT=y
-CONFIG_HAVE_DEBUG_KMEMLEAK=y
-CONFIG_HAVE_DMA_CONTIGUOUS=y
-CONFIG_HAVE_DYNAMIC_FTRACE=y
-CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y
-CONFIG_HAVE_EBPF_JIT=y
-CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
-CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
-CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACER=y
-CONFIG_HAVE_IDE=y
-CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y
-CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
-CONFIG_HAVE_NET_DSA=y
-CONFIG_HAVE_OPROFILE=y
-CONFIG_HAVE_OPTPROBES=y
-CONFIG_HAVE_PCI=y
-CONFIG_HAVE_PERF_EVENTS=y
-CONFIG_HAVE_PERF_REGS=y
-CONFIG_HAVE_PERF_USER_STACK_DUMP=y
-CONFIG_HAVE_PROC_CPU=y
-CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
-CONFIG_HAVE_RSEQ=y
 CONFIG_HAVE_SMP=y
-CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
-CONFIG_HAVE_UID16=y
-CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
 CONFIG_HDMI=y
 CONFIG_HID=y
 CONFIG_HIDRAW=y
@@ -406,14 +326,11 @@ CONFIG_PINCTRL=y
 CONFIG_PINCTRL_TEGRA=y
 CONFIG_PINCTRL_TEGRA20=y
 CONFIG_PINCTRL_TEGRA_XUSB=y
-# CONFIG_PL310_ERRATA_588369 is not set
 CONFIG_PL310_ERRATA_727915=y
-# CONFIG_PL310_ERRATA_753970 is not set
 CONFIG_PL310_ERRATA_769419=y
 CONFIG_PL353_SMC=y
 CONFIG_PM=y
 CONFIG_PM_CLK=y
-# CONFIG_PM_DEBUG is not set
 CONFIG_PM_OPP=y
 CONFIG_PM_SLEEP=y
 CONFIG_PM_SLEEP_SMP=y
@@ -444,13 +361,14 @@ CONFIG_RPS=y
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_TEGRA=y
 CONFIG_RTC_I2C_AND_SPI=y
+CONFIG_RTC_MC146818_LIB=y
 CONFIG_RTC_NVMEM=y
 CONFIG_RWSEM_SPIN_ON_OWNER=y
 CONFIG_SCSI=y
 # CONFIG_SCSI_LOWLEVEL is not set
 # CONFIG_SCSI_PROC_FS is not set
+# CONFIG_SENSORS_DRIVETEMP is not set
 CONFIG_SERIAL_8250_FSL=y
-# CONFIG_SERIAL_AMBA_PL011 is not set
 CONFIG_SERIAL_MCTRL_GPIO=y
 CONFIG_SERIAL_OF_PLATFORM=y
 CONFIG_SERIAL_TEGRA=y
@@ -474,7 +392,6 @@ CONFIG_SND_SIMPLE_CARD=y
 CONFIG_SND_SIMPLE_CARD_UTILS=y
 CONFIG_SND_SOC=y
 CONFIG_SND_SOC_AC97_BUS=y
-# CONFIG_SND_SOC_DMIC is not set
 CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y
 CONFIG_SND_SOC_I2C_AND_SPI=y
 CONFIG_SND_SOC_TEGRA=y
@@ -528,7 +445,6 @@ CONFIG_TEGRA_IOMMU_GART=y
 CONFIG_TEGRA_MC=y
 CONFIG_TEGRA_TIMER=y
 CONFIG_TEGRA_WATCHDOG=y
-# CONFIG_THUMB2_KERNEL is not set
 CONFIG_TICK_CPU_ACCOUNTING=y
 CONFIG_TIMER_OF=y
 CONFIG_TIMER_PROBE=y
@@ -537,10 +453,8 @@ CONFIG_TREE_SRCU=y
 # CONFIG_UCLAMP_TASK is not set
 CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
 CONFIG_UNWINDER_ARM=y
-# CONFIG_UNWINDER_FRAME_POINTER is not set
 CONFIG_USB=y
 CONFIG_USB_COMMON=y
-# CONFIG_USB_EHCI_FSL is not set
 CONFIG_USB_EHCI_HCD=y
 # CONFIG_USB_EHCI_HCD_PLATFORM is not set
 CONFIG_USB_EHCI_TEGRA=y


From lede-commits at lists.infradead.org  Sun Jun 13 14:30:19 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 13 Jun 2021 17:30:19 -0400
Subject: [openwrt/openwrt]  tegra: add support for kernel 5.10
In-Reply-To: <162361981663.20594.2258936442020494423@git-01.infra.openwrt.org>
References: <162361981663.20594.2258936442020494423@git-01.infra.openwrt.org>
Message-ID: <mailman.5378.1623619823.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/15f30c1dbb13165c8f766c2863af54a812bb5e6d

commit 15f30c1dbb13165c8f766c2863af54a812bb5e6d
Author: Tomasz Maciej Nowak <tmn505 at gmail.com>
AuthorDate: Sun Jun 13 18:28:20 2021 +0200

    tegra: add support for kernel 5.10
    
    Mark it as testing for now.
    
    Signed-off-by: Tomasz Maciej Nowak <tmn505 at gmail.com>
---
 target/linux/tegra/Makefile                        |  2 +-
 target/linux/tegra/config-5.10                     | 26 +++++++++++++++++-----
 ...egra-enable-front-panel-leds-in-TrimSlice.patch |  4 ++--
 3 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/target/linux/tegra/Makefile b/target/linux/tegra/Makefile
index 4d4b0e5ea4..98c1dece16 100644
--- a/target/linux/tegra/Makefile
+++ b/target/linux/tegra/Makefile
@@ -12,7 +12,7 @@ CPU_TYPE := cortex-a9
 CPU_SUBTYPE := vfpv3-d16
 
 KERNEL_PATCHVER := 5.4
-KERNEL_TESTING_PATCHVER := 5.4
+KERNEL_TESTING_PATCHVER := 5.10
 
 include $(INCLUDE_DIR)/target.mk
 
diff --git a/target/linux/tegra/config-5.10 b/target/linux/tegra/config-5.10
index 521991c64c..5d13b10d2a 100644
--- a/target/linux/tegra/config-5.10
+++ b/target/linux/tegra/config-5.10
@@ -2,7 +2,6 @@ CONFIG_AC97_BUS=y
 # CONFIG_AHCI_TEGRA is not set
 CONFIG_ALIGNMENT_TRAP=y
 CONFIG_ARCH_32BIT_OFF_T=y
-CONFIG_ARCH_CLOCKSOURCE_DATA=y
 CONFIG_ARCH_HIBERNATION_POSSIBLE=y
 CONFIG_ARCH_KEEP_MEMBLOCK=y
 CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
@@ -13,6 +12,8 @@ CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED=y
 CONFIG_ARCH_NR_GPIO=1024
 CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
 CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y
+CONFIG_ARCH_SELECT_MEMORY_MODEL=y
+CONFIG_ARCH_SPARSEMEM_ENABLE=y
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
 CONFIG_ARCH_TEGRA=y
 # CONFIG_ARCH_TEGRA_114_SOC is not set
@@ -35,7 +36,7 @@ CONFIG_ARM_PATCH_IDIV=y
 CONFIG_ARM_PATCH_PHYS_VIRT=y
 # CONFIG_ARM_PL172_MPMC is not set
 # CONFIG_ARM_SMMU is not set
-CONFIG_ARM_TEGRA20_CPUFREQ=y
+CONFIG_ARM_TEGRA_CPUIDLE=y
 CONFIG_ARM_THUMB=y
 CONFIG_ARM_THUMBEE=y
 CONFIG_ARM_UNWIND=y
@@ -150,6 +151,7 @@ CONFIG_DMADEVICES=y
 CONFIG_DMA_CMA=y
 CONFIG_DMA_ENGINE=y
 CONFIG_DMA_OF=y
+CONFIG_DMA_OPS=y
 CONFIG_DMA_REMAP=y
 CONFIG_DMA_SHARED_BUFFER=y
 CONFIG_DNOTIFY=y
@@ -163,6 +165,7 @@ CONFIG_DRM_MIPI_DSI=y
 CONFIG_DRM_PANEL=y
 CONFIG_DRM_PANEL_BRIDGE=y
 CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y
+# CONFIG_DRM_PANEL_VISIONOX_RM69299 is not set
 CONFIG_DRM_TEGRA=y
 # CONFIG_DRM_TEGRA_DEBUG is not set
 # CONFIG_DRM_TEGRA_STAGING is not set
@@ -188,6 +191,7 @@ CONFIG_FIX_EARLYCON_MEM=y
 CONFIG_FREEZER=y
 CONFIG_FS_IOMAP=y
 CONFIG_FS_MBCACHE=y
+# CONFIG_FW_CACHE is not set
 CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_GENERIC_ALLOCATOR=y
 CONFIG_GENERIC_ARCH_TOPOLOGY=y
@@ -196,6 +200,7 @@ CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
 CONFIG_GENERIC_CPU_AUTOPROBE=y
 CONFIG_GENERIC_EARLY_IOREMAP=y
+CONFIG_GENERIC_GETTIMEOFDAY=y
 CONFIG_GENERIC_IDLE_POLL_SETUP=y
 CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
 CONFIG_GENERIC_IRQ_MIGRATION=y
@@ -214,6 +219,7 @@ CONFIG_GENERIC_SMP_IDLE_THREAD=y
 CONFIG_GENERIC_STRNCPY_FROM_USER=y
 CONFIG_GENERIC_STRNLEN_USER=y
 CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_VDSO_32=y
 CONFIG_GLOB=y
 CONFIG_GPIOLIB=y
 CONFIG_GPIO_TEGRA=y
@@ -255,8 +261,10 @@ CONFIG_IRQ_DOMAIN_HIERARCHY=y
 CONFIG_IRQ_FORCED_THREADING=y
 CONFIG_IRQ_WORK=y
 CONFIG_JBD2=y
+CONFIG_KCMP=y
 CONFIG_KEYBOARD_ATKBD=y
 CONFIG_LIBFDT=y
+CONFIG_LLD_VERSION=0
 CONFIG_LOCK_DEBUGGING_SUPPORT=y
 CONFIG_LOCK_SPIN_ON_OWNER=y
 CONFIG_LZ4HC_COMPRESS=y
@@ -307,7 +315,6 @@ CONFIG_PAGE_OFFSET=0xC0000000
 CONFIG_PCI=y
 CONFIG_PCIEAER=y
 CONFIG_PCIEASPM=y
-# CONFIG_PCIEASPM_DEBUG is not set
 CONFIG_PCIEASPM_DEFAULT=y
 # CONFIG_PCIEASPM_PERFORMANCE is not set
 # CONFIG_PCIEASPM_POWERSAVE is not set
@@ -317,6 +324,7 @@ CONFIG_PCIE_PME=y
 CONFIG_PCI_DOMAINS=y
 CONFIG_PCI_DOMAINS_GENERIC=y
 CONFIG_PCI_MSI=y
+CONFIG_PCI_MSI_ARCH_FALLBACKS=y
 CONFIG_PCI_MSI_IRQ_DOMAIN=y
 CONFIG_PCI_TEGRA=y
 CONFIG_PERF_USE_VMALLOC=y
@@ -347,7 +355,6 @@ CONFIG_RCU_CPU_STALL_TIMEOUT=21
 # CONFIG_RCU_EXPERT is not set
 CONFIG_RCU_NEED_SEGCBLIST=y
 CONFIG_RCU_STALL_COMMON=y
-CONFIG_REFCOUNT_FULL=y
 CONFIG_REGMAP=y
 CONFIG_REGMAP_I2C=y
 CONFIG_REGMAP_MMIO=y
@@ -367,8 +374,8 @@ CONFIG_RWSEM_SPIN_ON_OWNER=y
 CONFIG_SCSI=y
 # CONFIG_SCSI_LOWLEVEL is not set
 # CONFIG_SCSI_PROC_FS is not set
-# CONFIG_SENSORS_DRIVETEMP is not set
 CONFIG_SERIAL_8250_FSL=y
+CONFIG_SERIAL_8250_TEGRA=y
 CONFIG_SERIAL_MCTRL_GPIO=y
 CONFIG_SERIAL_OF_PLATFORM=y
 CONFIG_SERIAL_TEGRA=y
@@ -395,10 +402,15 @@ CONFIG_SND_SOC_AC97_BUS=y
 CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y
 CONFIG_SND_SOC_I2C_AND_SPI=y
 CONFIG_SND_SOC_TEGRA=y
+# CONFIG_SND_SOC_TEGRA186_DSPK is not set
 CONFIG_SND_SOC_TEGRA20_AC97=y
 CONFIG_SND_SOC_TEGRA20_DAS=y
 CONFIG_SND_SOC_TEGRA20_I2S=y
 CONFIG_SND_SOC_TEGRA20_SPDIF=y
+# CONFIG_SND_SOC_TEGRA210_ADMAIF is not set
+# CONFIG_SND_SOC_TEGRA210_AHUB is not set
+# CONFIG_SND_SOC_TEGRA210_DMIC is not set
+# CONFIG_SND_SOC_TEGRA210_I2S is not set
 # CONFIG_SND_SOC_TEGRA30_AHUB is not set
 # CONFIG_SND_SOC_TEGRA30_I2S is not set
 # CONFIG_SND_SOC_TEGRA_ALC5632 is not set
@@ -414,6 +426,7 @@ CONFIG_SND_SOC_TLV320AIC23=y
 CONFIG_SND_SOC_TLV320AIC23_I2C=y
 # CONFIG_SND_USB is not set
 CONFIG_SOC_BUS=y
+CONFIG_SOC_TEGRA20_VOLTAGE_COUPLER=y
 CONFIG_SOC_TEGRA_FLOWCTRL=y
 CONFIG_SOC_TEGRA_FUSE=y
 CONFIG_SOC_TEGRA_PMC=y
@@ -450,17 +463,20 @@ CONFIG_TIMER_OF=y
 CONFIG_TIMER_PROBE=y
 CONFIG_TREE_RCU=y
 CONFIG_TREE_SRCU=y
+# CONFIG_UACCE is not set
 # CONFIG_UCLAMP_TASK is not set
 CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
 CONFIG_UNWINDER_ARM=y
 CONFIG_USB=y
 CONFIG_USB_COMMON=y
+CONFIG_USB_CONN_GPIO=y
 CONFIG_USB_EHCI_HCD=y
 # CONFIG_USB_EHCI_HCD_PLATFORM is not set
 CONFIG_USB_EHCI_TEGRA=y
 CONFIG_USB_HID=y
 CONFIG_USB_HIDDEV=y
 CONFIG_USB_PHY=y
+CONFIG_USB_ROLE_SWITCH=y
 CONFIG_USB_SUPPORT=y
 CONFIG_USB_TEGRA_PHY=y
 CONFIG_USB_ULPI=y
diff --git a/target/linux/tegra/patches-5.10/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch b/target/linux/tegra/patches-5.10/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch
index ae48e8d862..b1e210b212 100644
--- a/target/linux/tegra/patches-5.10/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch
+++ b/target/linux/tegra/patches-5.10/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/tegra20-trimslice.dts
 +++ b/arch/arm/boot/dts/tegra20-trimslice.dts
-@@ -200,16 +200,17 @@
+@@ -201,16 +201,17 @@
  			conf_ata {
  				nvidia,pins = "ata", "atc", "atd", "ate",
  					"crtp", "dap2", "dap3", "dap4", "dta",
@@ -23,7 +23,7 @@
  				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
  				nvidia,tristate = <TEGRA_PIN_DISABLE>;
  			};
-@@ -402,6 +403,20 @@
+@@ -396,6 +397,20 @@
  		};
  	};
  


From lede-commits at lists.infradead.org  Sun Jun 13 14:30:16 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 13 Jun 2021 17:30:16 -0400
Subject: [openwrt/openwrt]  ath79: add support for TP-Link TL-WR841HP v3
In-Reply-To: <162361981663.20594.2258936442020494423@git-01.infra.openwrt.org>
References: <162361981663.20594.2258936442020494423@git-01.infra.openwrt.org>
Message-ID: <mailman.5379.1623619825.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/c5235f6b2441a6b531622b76b66c354896c0dae0

commit c5235f6b2441a6b531622b76b66c354896c0dae0
Author: Andy Lee <congquynh284 at yahoo.com>
AuthorDate: Sun May 23 20:02:19 2021 +0700

    ath79: add support for TP-Link TL-WR841HP v3
    
    Specifications:
    - QCA9533 SoC, 8 MB nor flash, 64 MB DDR2 RAM
    - 2x2 9dBi antenna, wifi 2.4Ghz 300Mbps
    - 4x Ethernet LAN 10/100, 1x Ethernet WAN 10/100
    - 1x WAN, LAN, Wifi, PWR, WPS, RE Leds
    - Reset, Wifi on/off, WPS, RE buttons
    - Serial UART at J4 onboard: 3.3v GND RX TX, 1152008N1
    
    Label MAC addresses based on vendor firmware:
    LAN      *:ea    label
    WAN      *:eb    label +1
    2.4 GHz  *:ea    label
    The label MAC address in found in u-boot 0x1fc00
    
    Installation:
    Upload openwrt-ath79-generic-tplink_tl-wr841hp-v3-squashfs-factory.bin
    from stock firmware webgui.
    Maybe we need rename to shorten file name due to stock webgui error.
    
    Revert back to stock firmware instructions:
    - set your PC to static IP address 192.168.0.66 netmask 255.255.255.0
    - download stock firmware from Tp-link website
    - put it in the root directory of tftp server software
    - rename it to wr841hpv3_tp_recovery.bin
    - power on while pressing Reset button until any Led is lighting up
    - wait for the router to reboot. done
    
    Forum support topic:
    https://forum.openwrt.org/t/support-for-tp-link-tl-wr841hp-v3-router
    
    Signed-off-by: Andy Lee <congquynh284 at yahoo.com>
    [rebase and squash]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 .../ath79/dts/qca9533_tplink_tl-wr841hp-v3.dts     | 146 +++++++++++++++++++++
 .../ath79/generic/base-files/etc/board.d/01_leds   |   3 +-
 .../generic/base-files/etc/board.d/02_network      |   3 +-
 target/linux/ath79/image/generic-tp-link.mk        |   9 ++
 4 files changed, 159 insertions(+), 2 deletions(-)

diff --git a/target/linux/ath79/dts/qca9533_tplink_tl-wr841hp-v3.dts b/target/linux/ath79/dts/qca9533_tplink_tl-wr841hp-v3.dts
new file mode 100644
index 0000000000..7170601f6a
--- /dev/null
+++ b/target/linux/ath79/dts/qca9533_tplink_tl-wr841hp-v3.dts
@@ -0,0 +1,146 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qca953x.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "tplink,tl-wr841hp-v3", "qca,qca9533";
+	model = "TP-Link TL-WR841HP v3";
+
+	aliases {
+		label-mac-device = &wmac;
+		led-boot = &led_power;
+		led-failsafe = &led_power;
+		led-running = &led_power;
+		led-upgrade = &led_power;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		wifi {
+			label = "green:wifi";
+			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy0tpt";
+		};
+
+		led_power: power {
+			label = "green:power";
+			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+			default-state = "on";
+		};
+
+		wan_green {
+			label = "green:wan";
+			gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+		};
+
+		wan_amber {
+			label = "amber:wan";
+			gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
+		};
+
+		lan {
+			label = "green:lan";
+			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+		};
+
+		wps {
+			label = "green:wps";
+			gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
+		};
+
+		re {
+			label = "green:re";
+			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "Reset button";
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
+			debounce-interval = <60>;
+		};
+
+		wifi {
+			label = "WiFi button";
+			linux,code = <KEY_RFKILL>;
+			gpios = <&gpio 0 GPIO_ACTIVE_LOW>;
+			debounce-interval = <60>;
+		};
+
+		wps {
+			label = "WPS button";
+			linux,code = <KEY_WPS_BUTTON>;
+			gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
+			debounce-interval = <60>;
+		};
+
+		re {
+			label = "RE button";
+			linux,code = <BTN_0>;
+			gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+			debounce-interval = <60>;
+		};
+	};
+};
+
+&spi {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <25000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			uboot: partition at 0 {
+				label = "u-boot";
+				reg = <0x000000 0x020000>;
+				read-only;
+			};
+
+			partition at 20000 {
+				compatible = "tplink,firmware";
+				label = "firmware";
+				reg = <0x020000 0x7d0000>;
+			};
+
+			art: partition at 7f0000 {
+				label = "art";
+				reg = <0x7f0000 0x010000>;
+				read-only;
+			};
+		};
+	};
+};
+
+&eth0 {
+	status = "okay";
+
+	phy-handle = <&swphy4>;
+
+	mtd-mac-address = <&uboot 0x1fc00>;
+	mtd-mac-address-increment = <1>;
+};
+
+&eth1 {
+	mtd-mac-address = <&uboot 0x1fc00>;
+};
+
+&wmac {
+	status = "okay";
+
+	mtd-cal-data = <&art 0x1000>;
+	mtd-mac-address = <&uboot 0x1fc00>;
+};
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
index 9720e37f99..d8e3d65967 100644
--- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
@@ -71,7 +71,8 @@ tplink,archer-c59-v1|\
 tplink,archer-c59-v2|\
 tplink,archer-c60-v1|\
 tplink,archer-c60-v2|\
-tplink,archer-c60-v3)
+tplink,archer-c60-v3|\
+tplink,tl-wr841hp-v3)
 	ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x1e"
 	ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
 	;;
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 c1ba760182..2fa51ab905 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
@@ -195,7 +195,8 @@ ath79_setup_interfaces()
 		;;
 	comfast,cf-e560ac|\
 	qca,ap143-8m|\
-	qca,ap143-16m)
+	qca,ap143-16m|\
+	tplink,tl-wr841hp-v3)
 		ucidef_set_interface_wan "eth1"
 		ucidef_add_switch "switch0" \
 			"0 at eth0" "1:lan" "2:lan" "3:lan" "4:lan"
diff --git a/target/linux/ath79/image/generic-tp-link.mk b/target/linux/ath79/image/generic-tp-link.mk
index be6aa06b55..8b228a73d2 100644
--- a/target/linux/ath79/image/generic-tp-link.mk
+++ b/target/linux/ath79/image/generic-tp-link.mk
@@ -742,6 +742,15 @@ define Device/tplink_tl-wr810n-v2
 endef
 TARGET_DEVICES += tplink_tl-wr810n-v2
 
+define Device/tplink_tl-wr841hp-v3
+  $(Device/tplink-8mlzma)
+  SOC := qca9533
+  DEVICE_MODEL := TL-WR841HP
+  DEVICE_VARIANT := v3
+  TPLINK_HWID := 0x08411003
+endef
+TARGET_DEVICES += tplink_tl-wr841hp-v3
+
 define Device/tplink_tl-wr842n-v1
   $(Device/tplink-8m)
   SOC := ar7241


From lede-commits at lists.infradead.org  Sun Jun 13 14:30:18 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 13 Jun 2021 17:30:18 -0400
Subject: [openwrt/openwrt]  tegra: copy files for kernel 5.10
In-Reply-To: <162361981663.20594.2258936442020494423@git-01.infra.openwrt.org>
References: <162361981663.20594.2258936442020494423@git-01.infra.openwrt.org>
Message-ID: <mailman.5382.1623619826.434944.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/fa77145461de35dbc318765afbfdcd2b94d9209b

commit fa77145461de35dbc318765afbfdcd2b94d9209b
Author: Tomasz Maciej Nowak <tmn505 at gmail.com>
AuthorDate: Sun Jun 13 18:28:19 2021 +0200

    tegra: copy files for kernel 5.10
    
    Dumb copy of current kernel 5.4 config and patches.
    
    Signed-off-by: Tomasz Maciej Nowak <tmn505 at gmail.com>
---
 target/linux/tegra/config-5.10                     | 479 +++++++++++++++++++++
 ...ious-interrupts-due-to-tegra2-silicon-bug.patch |  77 ++++
 ...egra-enable-front-panel-leds-in-TrimSlice.patch |  46 ++
 3 files changed, 602 insertions(+)

diff --git a/target/linux/tegra/config-5.10 b/target/linux/tegra/config-5.10
new file mode 100644
index 0000000000..521991c64c
--- /dev/null
+++ b/target/linux/tegra/config-5.10
@@ -0,0 +1,479 @@
+CONFIG_AC97_BUS=y
+# CONFIG_AHCI_TEGRA is not set
+CONFIG_ALIGNMENT_TRAP=y
+CONFIG_ARCH_32BIT_OFF_T=y
+CONFIG_ARCH_CLOCKSOURCE_DATA=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_KEEP_MEMBLOCK=y
+CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
+CONFIG_ARCH_MULTIPLATFORM=y
+CONFIG_ARCH_MULTI_V6_V7=y
+CONFIG_ARCH_MULTI_V7=y
+CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED=y
+CONFIG_ARCH_NR_GPIO=1024
+CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
+CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARCH_TEGRA=y
+# CONFIG_ARCH_TEGRA_114_SOC is not set
+# CONFIG_ARCH_TEGRA_124_SOC is not set
+CONFIG_ARCH_TEGRA_2x_SOC=y
+# CONFIG_ARCH_TEGRA_3x_SOC is not set
+CONFIG_ARM=y
+CONFIG_ARM_AMBA=y
+CONFIG_ARM_CPU_SUSPEND=y
+CONFIG_ARM_CRYPTO=y
+CONFIG_ARM_ERRATA_720789=y
+CONFIG_ARM_ERRATA_754327=y
+CONFIG_ARM_ERRATA_764369=y
+CONFIG_ARM_GIC=y
+CONFIG_ARM_HAS_SG_CHAIN=y
+CONFIG_ARM_HEAVY_MB=y
+CONFIG_ARM_L1_CACHE_SHIFT=6
+CONFIG_ARM_L1_CACHE_SHIFT_6=y
+CONFIG_ARM_PATCH_IDIV=y
+CONFIG_ARM_PATCH_PHYS_VIRT=y
+# CONFIG_ARM_PL172_MPMC is not set
+# CONFIG_ARM_SMMU is not set
+CONFIG_ARM_TEGRA20_CPUFREQ=y
+CONFIG_ARM_THUMB=y
+CONFIG_ARM_THUMBEE=y
+CONFIG_ARM_UNWIND=y
+CONFIG_ARM_VIRT_EXT=y
+CONFIG_ASN1=y
+CONFIG_ATA=y
+CONFIG_ATAGS=y
+CONFIG_AUTO_ZRELADDR=y
+CONFIG_BINFMT_FLAT_ARGVP_ENVP_ON_STACK=y
+CONFIG_BLK_DEV_BSG=y
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_MQ_PCI=y
+CONFIG_BLK_PM=y
+CONFIG_BLK_SCSI_REQUEST=y
+CONFIG_BOUNCE=y
+CONFIG_CACHE_L2X0=y
+CONFIG_CLKDEV_LOOKUP=y
+CONFIG_CLKSRC_MMIO=y
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_CLZ_TAB=y
+CONFIG_CMA=y
+CONFIG_CMA_ALIGNMENT=8
+CONFIG_CMA_AREAS=7
+# CONFIG_CMA_DEBUG is not set
+# CONFIG_CMA_DEBUGFS is not set
+CONFIG_CMA_SIZE_MBYTES=16
+# CONFIG_CMA_SIZE_SEL_MAX is not set
+CONFIG_CMA_SIZE_SEL_MBYTES=y
+# CONFIG_CMA_SIZE_SEL_MIN is not set
+# CONFIG_CMA_SIZE_SEL_PERCENTAGE is not set
+CONFIG_COMMON_CLK=y
+CONFIG_COMPAT_32BIT_TIME=y
+CONFIG_CONTIG_ALLOC=y
+# CONFIG_CPUFREQ_DT is not set
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+CONFIG_CPU_FREQ_GOV_ATTR_SET=y
+CONFIG_CPU_FREQ_GOV_COMMON=y
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+CONFIG_CPU_FREQ_GOV_POWERSAVE=y
+CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+# CONFIG_CPU_FREQ_STAT is not set
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_IDLE=y
+CONFIG_CPU_IDLE_GOV_LADDER=y
+CONFIG_CPU_PABRT_V7=y
+CONFIG_CPU_PM=y
+CONFIG_CPU_RMAP=y
+CONFIG_CPU_SPECTRE=y
+CONFIG_CPU_THUMB_CAPABLE=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_V7=y
+CONFIG_CRC16=y
+# CONFIG_CRC32_SARWATE is not set
+CONFIG_CRC32_SLICEBY8=y
+CONFIG_CROSS_MEMORY_ATTACH=y
+CONFIG_CRYPTO_ACOMP2=y
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_AES_ARM=y
+CONFIG_CRYPTO_AKCIPHER=y
+CONFIG_CRYPTO_AKCIPHER2=y
+CONFIG_CRYPTO_CRC32=y
+CONFIG_CRYPTO_CRC32C=y
+CONFIG_CRYPTO_CRYPTD=y
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_DRBG=y
+CONFIG_CRYPTO_DRBG_HMAC=y
+CONFIG_CRYPTO_DRBG_MENU=y
+CONFIG_CRYPTO_ECHAINIV=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_HMAC=y
+CONFIG_CRYPTO_JITTERENTROPY=y
+CONFIG_CRYPTO_LIB_SHA256=y
+CONFIG_CRYPTO_LZ4=y
+CONFIG_CRYPTO_LZ4HC=y
+CONFIG_CRYPTO_LZO=y
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
+CONFIG_CRYPTO_NULL=y
+CONFIG_CRYPTO_NULL2=y
+CONFIG_CRYPTO_RNG=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_RNG_DEFAULT=y
+CONFIG_CRYPTO_RSA=y
+CONFIG_CRYPTO_SEQIV=y
+CONFIG_CRYPTO_SHA1=y
+CONFIG_CRYPTO_SHA1_ARM=y
+CONFIG_CRYPTO_SHA256=y
+CONFIG_CRYPTO_SHA256_ARM=y
+CONFIG_CRYPTO_SHA512_ARM=y
+CONFIG_CRYPTO_TWOFISH=y
+CONFIG_CRYPTO_TWOFISH_COMMON=y
+CONFIG_DCACHE_WORD_ACCESS=y
+CONFIG_DEBUG_ALIGN_RODATA=y
+CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
+# CONFIG_DEVPORT is not set
+CONFIG_DMADEVICES=y
+CONFIG_DMA_CMA=y
+CONFIG_DMA_ENGINE=y
+CONFIG_DMA_OF=y
+CONFIG_DMA_REMAP=y
+CONFIG_DMA_SHARED_BUFFER=y
+CONFIG_DNOTIFY=y
+CONFIG_DRM=y
+CONFIG_DRM_BRIDGE=y
+CONFIG_DRM_FBDEV_EMULATION=y
+CONFIG_DRM_FBDEV_OVERALLOC=100
+CONFIG_DRM_KMS_FB_HELPER=y
+CONFIG_DRM_KMS_HELPER=y
+CONFIG_DRM_MIPI_DSI=y
+CONFIG_DRM_PANEL=y
+CONFIG_DRM_PANEL_BRIDGE=y
+CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y
+CONFIG_DRM_TEGRA=y
+# CONFIG_DRM_TEGRA_DEBUG is not set
+# CONFIG_DRM_TEGRA_STAGING is not set
+# CONFIG_DRM_TVE200 is not set
+CONFIG_DTC=y
+CONFIG_EDAC_ATOMIC_SCRUB=y
+CONFIG_EDAC_SUPPORT=y
+CONFIG_ENABLE_MUST_CHECK=y
+CONFIG_EXT4_FS=y
+CONFIG_EXTCON=y
+CONFIG_F2FS_FS=y
+CONFIG_FB=y
+CONFIG_FB_CFB_COPYAREA=y
+CONFIG_FB_CFB_FILLRECT=y
+CONFIG_FB_CFB_IMAGEBLIT=y
+CONFIG_FB_CMDLINE=y
+CONFIG_FB_DEFERRED_IO=y
+CONFIG_FB_SYS_COPYAREA=y
+CONFIG_FB_SYS_FILLRECT=y
+CONFIG_FB_SYS_FOPS=y
+CONFIG_FB_SYS_IMAGEBLIT=y
+CONFIG_FIX_EARLYCON_MEM=y
+CONFIG_FREEZER=y
+CONFIG_FS_IOMAP=y
+CONFIG_FS_MBCACHE=y
+CONFIG_FW_LOADER_PAGED_BUF=y
+CONFIG_GENERIC_ALLOCATOR=y
+CONFIG_GENERIC_ARCH_TOPOLOGY=y
+CONFIG_GENERIC_BUG=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
+CONFIG_GENERIC_CPU_AUTOPROBE=y
+CONFIG_GENERIC_EARLY_IOREMAP=y
+CONFIG_GENERIC_IDLE_POLL_SETUP=y
+CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
+CONFIG_GENERIC_IRQ_MIGRATION=y
+CONFIG_GENERIC_IRQ_MULTI_HANDLER=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
+CONFIG_GENERIC_MSI_IRQ=y
+CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_PHY=y
+CONFIG_GENERIC_PINCONF=y
+CONFIG_GENERIC_PINCTRL_GROUPS=y
+CONFIG_GENERIC_PINMUX_FUNCTIONS=y
+CONFIG_GENERIC_SCHED_CLOCK=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GENERIC_STRNCPY_FROM_USER=y
+CONFIG_GENERIC_STRNLEN_USER=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GLOB=y
+CONFIG_GPIOLIB=y
+CONFIG_GPIO_TEGRA=y
+CONFIG_HANDLE_DOMAIN_IRQ=y
+CONFIG_HARDEN_BRANCH_PREDICTOR=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_HAS_DMA=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT_MAP=y
+CONFIG_HAVE_SMP=y
+CONFIG_HDMI=y
+CONFIG_HID=y
+CONFIG_HIDRAW=y
+CONFIG_HID_GENERIC=y
+CONFIG_HIGHMEM=y
+CONFIG_HIGHPTE=y
+CONFIG_HOTPLUG_CPU=y
+CONFIG_HWMON=y
+CONFIG_HZ_FIXED=0
+CONFIG_HZ_PERIODIC=y
+CONFIG_I2C=y
+CONFIG_I2C_ALGOBIT=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_COMPAT=y
+CONFIG_I2C_TEGRA=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_INPUT=y
+CONFIG_INPUT_KEYBOARD=y
+CONFIG_IOMMU_API=y
+# CONFIG_IOMMU_DEBUGFS is not set
+# CONFIG_IOMMU_DEFAULT_PASSTHROUGH is not set
+CONFIG_IOMMU_IOVA=y
+# CONFIG_IOMMU_IO_PGTABLE_ARMV7S is not set
+# CONFIG_IOMMU_IO_PGTABLE_LPAE is not set
+CONFIG_IOMMU_SUPPORT=y
+CONFIG_IRQCHIP=y
+CONFIG_IRQ_DOMAIN=y
+CONFIG_IRQ_DOMAIN_HIERARCHY=y
+CONFIG_IRQ_FORCED_THREADING=y
+CONFIG_IRQ_WORK=y
+CONFIG_JBD2=y
+CONFIG_KEYBOARD_ATKBD=y
+CONFIG_LIBFDT=y
+CONFIG_LOCK_DEBUGGING_SUPPORT=y
+CONFIG_LOCK_SPIN_ON_OWNER=y
+CONFIG_LZ4HC_COMPRESS=y
+CONFIG_LZ4_COMPRESS=y
+CONFIG_LZ4_DECOMPRESS=y
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_MEMFD_CREATE=y
+CONFIG_MEMORY=y
+CONFIG_MEMORY_ISOLATION=y
+# CONFIG_MFD_NVEC is not set
+CONFIG_MIGHT_HAVE_CACHE_L2X0=y
+CONFIG_MIGRATION=y
+CONFIG_MMC=y
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_CQHCI=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_IO_ACCESSORS=y
+# CONFIG_MMC_SDHCI_PCI is not set
+CONFIG_MMC_SDHCI_PLTFM=y
+CONFIG_MMC_SDHCI_TEGRA=y
+CONFIG_MODULES_USE_ELF_REL=y
+CONFIG_MPILIB=y
+CONFIG_MTD_SPI_NOR=y
+CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
+CONFIG_MUTEX_SPIN_ON_OWNER=y
+CONFIG_NEED_DMA_MAP_STATE=y
+# CONFIG_NEON is not set
+CONFIG_NET_FLOW_LIMIT=y
+CONFIG_NLS=y
+CONFIG_NR_CPUS=4
+CONFIG_NVMEM=y
+CONFIG_OF=y
+CONFIG_OF_ADDRESS=y
+CONFIG_OF_EARLY_FLATTREE=y
+CONFIG_OF_FLATTREE=y
+CONFIG_OF_GPIO=y
+CONFIG_OF_IOMMU=y
+CONFIG_OF_IRQ=y
+CONFIG_OF_KOBJ=y
+CONFIG_OF_NET=y
+CONFIG_OLD_SIGACTION=y
+CONFIG_OLD_SIGSUSPEND3=y
+CONFIG_OUTER_CACHE=y
+CONFIG_OUTER_CACHE_SYNC=y
+CONFIG_PADATA=y
+CONFIG_PAGE_OFFSET=0xC0000000
+CONFIG_PCI=y
+CONFIG_PCIEAER=y
+CONFIG_PCIEASPM=y
+# CONFIG_PCIEASPM_DEBUG is not set
+CONFIG_PCIEASPM_DEFAULT=y
+# CONFIG_PCIEASPM_PERFORMANCE is not set
+# CONFIG_PCIEASPM_POWERSAVE is not set
+# CONFIG_PCIEASPM_POWER_SUPERSAVE is not set
+CONFIG_PCIEPORTBUS=y
+CONFIG_PCIE_PME=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_DOMAINS_GENERIC=y
+CONFIG_PCI_MSI=y
+CONFIG_PCI_MSI_IRQ_DOMAIN=y
+CONFIG_PCI_TEGRA=y
+CONFIG_PERF_USE_VMALLOC=y
+CONFIG_PGTABLE_LEVELS=2
+CONFIG_PHY_TEGRA_XUSB=y
+CONFIG_PINCTRL=y
+CONFIG_PINCTRL_TEGRA=y
+CONFIG_PINCTRL_TEGRA20=y
+CONFIG_PINCTRL_TEGRA_XUSB=y
+CONFIG_PL310_ERRATA_727915=y
+CONFIG_PL310_ERRATA_769419=y
+CONFIG_PL353_SMC=y
+CONFIG_PM=y
+CONFIG_PM_CLK=y
+CONFIG_PM_OPP=y
+CONFIG_PM_SLEEP=y
+CONFIG_PM_SLEEP_SMP=y
+CONFIG_POWER_RESET=y
+CONFIG_POWER_RESET_GPIO=y
+CONFIG_POWER_SUPPLY=y
+CONFIG_PROC_PAGE_MONITOR=y
+CONFIG_PWM=y
+CONFIG_PWM_SYSFS=y
+CONFIG_PWM_TEGRA=y
+CONFIG_RAS=y
+CONFIG_RATIONAL=y
+CONFIG_RCU_CPU_STALL_TIMEOUT=21
+# CONFIG_RCU_EXPERT is not set
+CONFIG_RCU_NEED_SEGCBLIST=y
+CONFIG_RCU_STALL_COMMON=y
+CONFIG_REFCOUNT_FULL=y
+CONFIG_REGMAP=y
+CONFIG_REGMAP_I2C=y
+CONFIG_REGMAP_MMIO=y
+CONFIG_REGMAP_SPI=y
+CONFIG_REGULATOR=y
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
+CONFIG_REGULATOR_GPIO=y
+CONFIG_RESET_CONTROLLER=y
+CONFIG_RFS_ACCEL=y
+CONFIG_RPS=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_DRV_TEGRA=y
+CONFIG_RTC_I2C_AND_SPI=y
+CONFIG_RTC_MC146818_LIB=y
+CONFIG_RTC_NVMEM=y
+CONFIG_RWSEM_SPIN_ON_OWNER=y
+CONFIG_SCSI=y
+# CONFIG_SCSI_LOWLEVEL is not set
+# CONFIG_SCSI_PROC_FS is not set
+# CONFIG_SENSORS_DRIVETEMP is not set
+CONFIG_SERIAL_8250_FSL=y
+CONFIG_SERIAL_MCTRL_GPIO=y
+CONFIG_SERIAL_OF_PLATFORM=y
+CONFIG_SERIAL_TEGRA=y
+CONFIG_SERIO=y
+CONFIG_SERIO_LIBPS2=y
+CONFIG_SGL_ALLOC=y
+CONFIG_SG_POOL=y
+CONFIG_SMP=y
+CONFIG_SMP_ON_UP=y
+CONFIG_SND=y
+# CONFIG_SND_COMPRESS_OFFLOAD is not set
+CONFIG_SND_DMAENGINE_PCM=y
+# CONFIG_SND_DRIVERS is not set
+# CONFIG_SND_HDA_TEGRA is not set
+CONFIG_SND_JACK=y
+CONFIG_SND_JACK_INPUT_DEV=y
+# CONFIG_SND_PCI is not set
+CONFIG_SND_PCM=y
+# CONFIG_SND_PROC_FS is not set
+CONFIG_SND_SIMPLE_CARD=y
+CONFIG_SND_SIMPLE_CARD_UTILS=y
+CONFIG_SND_SOC=y
+CONFIG_SND_SOC_AC97_BUS=y
+CONFIG_SND_SOC_GENERIC_DMAENGINE_PCM=y
+CONFIG_SND_SOC_I2C_AND_SPI=y
+CONFIG_SND_SOC_TEGRA=y
+CONFIG_SND_SOC_TEGRA20_AC97=y
+CONFIG_SND_SOC_TEGRA20_DAS=y
+CONFIG_SND_SOC_TEGRA20_I2S=y
+CONFIG_SND_SOC_TEGRA20_SPDIF=y
+# CONFIG_SND_SOC_TEGRA30_AHUB is not set
+# CONFIG_SND_SOC_TEGRA30_I2S is not set
+# CONFIG_SND_SOC_TEGRA_ALC5632 is not set
+# CONFIG_SND_SOC_TEGRA_MAX98090 is not set
+# CONFIG_SND_SOC_TEGRA_RT5640 is not set
+# CONFIG_SND_SOC_TEGRA_RT5677 is not set
+# CONFIG_SND_SOC_TEGRA_SGTL5000 is not set
+CONFIG_SND_SOC_TEGRA_TRIMSLICE=y
+# CONFIG_SND_SOC_TEGRA_WM8753 is not set
+# CONFIG_SND_SOC_TEGRA_WM8903 is not set
+# CONFIG_SND_SOC_TEGRA_WM9712 is not set
+CONFIG_SND_SOC_TLV320AIC23=y
+CONFIG_SND_SOC_TLV320AIC23_I2C=y
+# CONFIG_SND_USB is not set
+CONFIG_SOC_BUS=y
+CONFIG_SOC_TEGRA_FLOWCTRL=y
+CONFIG_SOC_TEGRA_FUSE=y
+CONFIG_SOC_TEGRA_PMC=y
+CONFIG_SOUND=y
+CONFIG_SOUND_OSS_CORE=y
+CONFIG_SOUND_OSS_CORE_PRECLAIM=y
+CONFIG_SPARSE_IRQ=y
+CONFIG_SPI=y
+CONFIG_SPI_MASTER=y
+CONFIG_SPI_MEM=y
+# CONFIG_SPI_TEGRA114 is not set
+CONFIG_SPI_TEGRA20_SFLASH=y
+CONFIG_SPI_TEGRA20_SLINK=y
+CONFIG_SRCU=y
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+CONFIG_SWP_EMULATE=y
+CONFIG_SYNC_FILE=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_TEGRA20_APB_DMA=y
+CONFIG_TEGRA20_EMC=y
+CONFIG_TEGRA_AHB=y
+CONFIG_TEGRA_GMI=y
+CONFIG_TEGRA_HOST1X=y
+CONFIG_TEGRA_HOST1X_FIREWALL=y
+CONFIG_TEGRA_IOMMU_GART=y
+# CONFIG_TEGRA_IOMMU_SMMU is not set
+# CONFIG_TEGRA_IVC is not set
+CONFIG_TEGRA_MC=y
+CONFIG_TEGRA_TIMER=y
+CONFIG_TEGRA_WATCHDOG=y
+CONFIG_TICK_CPU_ACCOUNTING=y
+CONFIG_TIMER_OF=y
+CONFIG_TIMER_PROBE=y
+CONFIG_TREE_RCU=y
+CONFIG_TREE_SRCU=y
+# CONFIG_UCLAMP_TASK is not set
+CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
+CONFIG_UNWINDER_ARM=y
+CONFIG_USB=y
+CONFIG_USB_COMMON=y
+CONFIG_USB_EHCI_HCD=y
+# CONFIG_USB_EHCI_HCD_PLATFORM is not set
+CONFIG_USB_EHCI_TEGRA=y
+CONFIG_USB_HID=y
+CONFIG_USB_HIDDEV=y
+CONFIG_USB_PHY=y
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_TEGRA_PHY=y
+CONFIG_USB_ULPI=y
+CONFIG_USB_ULPI_VIEWPORT=y
+CONFIG_USE_OF=y
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_WATCHDOG_CORE=y
+CONFIG_XPS=y
+CONFIG_XZ_DEC_ARM=y
+CONFIG_XZ_DEC_ARMTHUMB=y
+CONFIG_XZ_DEC_BCJ=y
+CONFIG_ZBOOT_ROM_BSS=0
+CONFIG_ZBOOT_ROM_TEXT=0
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_ZLIB_INFLATE=y
diff --git a/target/linux/tegra/patches-5.10/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch b/target/linux/tegra/patches-5.10/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch
new file mode 100644
index 0000000000..08ed9d441c
--- /dev/null
+++ b/target/linux/tegra/patches-5.10/100-serial8250-on-tegra-hsuart-recover-from-spurious-interrupts-due-to-tegra2-silicon-bug.patch
@@ -0,0 +1,77 @@
+From patchwork Fri Jul 13 11:32:42 2018
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: serial8250 on tegra hsuart: recover from spurious interrupts due to
+ tegra2 silicon bug
+X-Patchwork-Submitter: "David R. Piegdon" <lkml at p23q.org>
+X-Patchwork-Id: 943440
+Message-Id: <4676ea34-69ce-5422-1ded-94218b89f7d9 at p23q.org>
+To: linux-tegra at vger.kernel.org
+Date: Fri, 13 Jul 2018 11:32:42 +0000
+From: "David R. Piegdon" <lkml at p23q.org>
+List-Id: <linux-tegra.vger.kernel.org>
+
+Hi,
+a while back I sent a few mails regarding spurious interrupts in the
+UARTA (hsuart) block of the Tegra2 SoC, when using the 8250 driver for
+it instead of the hsuart driver. After going down a pretty deep
+debugging/testing hole, I think I found a patch that fixes the issue. So
+far testing in a reboot-cycle suggests that the error frequency dropped
+from >3% of all reboots to at least <0.05% of all reboots. Tests
+continue to run over the weekend.
+
+The patch below already is a second iteration; the first did not reset
+the MCR or contain the lines below '// clear interrupts'. This resulted
+in no more spurious interrupts, but in a few % of spurious interrupts
+that were recovered the UART block did not receive any characters any
+more. So further resetting was required to fully reacquire operational
+state of the UART block.
+
+I'd love any comments/suggestions on this!
+
+Cheers,
+
+David
+
+--- a/drivers/tty/serial/8250/8250_core.c
++++ b/drivers/tty/serial/8250/8250_core.c
+@@ -133,6 +133,38 @@ static irqreturn_t serial8250_interrupt(
+ 
+ 		if (l == i->head && pass_counter++ > PASS_LIMIT)
+ 			break;
++
++#ifdef CONFIG_ARCH_TEGRA_2x_SOC
++		if (!handled && (port->type == PORT_TEGRA)) {
++			/*
++			 * Fix Tegra 2 CPU silicon bug where sometimes
++			 * "TX holding register empty" interrupts result in a
++			 * bad (metastable?) state in Tegras HSUART IP core.
++			 * Only way to recover seems to be to reset all
++			 * interrupts as well as the TX queue and the MCR.
++			 * But we don't want to loose any outgoing characters,
++			 * so only do it if the RX and TX queues are empty.
++			 */
++			unsigned char lsr = port->serial_in(port, UART_LSR);
++			const unsigned char fifo_empty_mask =
++						(UART_LSR_TEMT | UART_LSR_THRE);
++			if (((lsr & (UART_LSR_DR | fifo_empty_mask)) ==
++							fifo_empty_mask)) {
++				port->serial_out(port, UART_IER, 0);
++				port->serial_out(port, UART_MCR, 0);
++				serial8250_clear_and_reinit_fifos(up);
++				port->serial_out(port, UART_MCR, up->mcr);
++				port->serial_out(port, UART_IER, up->ier);
++				// clear interrupts
++				serial_port_in(port, UART_LSR);
++				serial_port_in(port, UART_RX);
++				serial_port_in(port, UART_IIR);
++				serial_port_in(port, UART_MSR);
++				up->lsr_saved_flags = 0;
++				up->msr_saved_flags = 0;
++			}
++		}
++#endif
+ 	} while (l != end);
+ 
+ 	spin_unlock(&i->lock);
diff --git a/target/linux/tegra/patches-5.10/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch b/target/linux/tegra/patches-5.10/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch
new file mode 100644
index 0000000000..ae48e8d862
--- /dev/null
+++ b/target/linux/tegra/patches-5.10/101-ARM-dtc-tegra-enable-front-panel-leds-in-TrimSlice.patch
@@ -0,0 +1,46 @@
+--- a/arch/arm/boot/dts/tegra20-trimslice.dts
++++ b/arch/arm/boot/dts/tegra20-trimslice.dts
+@@ -200,16 +200,17 @@
+ 			conf_ata {
+ 				nvidia,pins = "ata", "atc", "atd", "ate",
+ 					"crtp", "dap2", "dap3", "dap4", "dta",
+-					"dtb", "dtc", "dtd", "dte", "gmb",
+-					"gme", "i2cp", "pta", "slxc", "slxd",
+-					"spdi", "spdo", "uda";
++					"dtb", "dtc", "dtd", "gmb", "gme",
++					"i2cp", "pta", "slxc", "slxd", "spdi",
++					"spdo", "uda";
+ 				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
+ 				nvidia,tristate = <TEGRA_PIN_ENABLE>;
+ 			};
+ 			conf_atb {
+ 				nvidia,pins = "atb", "cdev1", "cdev2", "dap1",
+-					"gma", "gmc", "gmd", "gpu", "gpu7",
+-					"gpv", "sdio1", "slxa", "slxk", "uac";
++					"dte", "gma", "gmc", "gmd", "gpu",
++					"gpu7", "gpv", "sdio1", "slxa", "slxk",
++					"uac";
+ 				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
+ 				nvidia,tristate = <TEGRA_PIN_DISABLE>;
+ 			};
+@@ -402,6 +403,20 @@
+ 		};
+ 	};
+ 
++	gpio-leds {
++		compatible = "gpio-leds";
++
++		ds2 {
++			label = "trimslice:green:right";
++			gpios = <&gpio TEGRA_GPIO(D, 2) GPIO_ACTIVE_LOW>;
++		};
++
++		ds3 {
++			label = "trimslice:green:left";
++			gpios = <&gpio TEGRA_GPIO(BB, 5) GPIO_ACTIVE_LOW>;
++		};
++	};
++
+ 	poweroff {
+ 		compatible = "gpio-poweroff";
+ 		gpios = <&gpio TEGRA_GPIO(X, 7) GPIO_ACTIVE_LOW>;


From lede-commits at lists.infradead.org  Sun Jun 13 14:59:14 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 13 Jun 2021 17:59:14 -0400
Subject: [openwrt/openwrt]  opkg: Fix download over git
In-Reply-To: <162362155311.17757.12656085289767086495@git-01.infra.openwrt.org>
References: <162362155311.17757.12656085289767086495@git-01.infra.openwrt.org>
Message-ID: <mailman.5387.1623621558.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/65b0fe293aff687af679674a86414e26b50cf066

commit 65b0fe293aff687af679674a86414e26b50cf066
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Jun 13 23:40:00 2021 +0200

    opkg: Fix download over git
    
    Set the PKG_SOURCE_URL using a lazy set to allow evaluating
    $(PROJECT_GIT) later. Without this change PKG_SOURCE_URL is evaluated
    immediately, before PROJECT_GIT is defined and the download over git is
    not working.
    
    Fixes: 6687a2483a09 ("opkg: use $(PROJECT_GIT), $(AUTORELEASE) and SPDX")
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/system/opkg/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile
index 99234978a1..cc295c12ba 100644
--- a/package/system/opkg/Makefile
+++ b/package/system/opkg/Makefile
@@ -11,7 +11,7 @@ PKG_RELEASE:=$(AUTORELEASE)
 PKG_FLAGS:=essential
 
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_URL:=$(PROJECT_GIT)/project/opkg-lede.git
+PKG_SOURCE_URL=$(PROJECT_GIT)/project/opkg-lede.git
 PKG_SOURCE_DATE:=2021-03-15
 PKG_SOURCE_VERSION:=5936c4f9660248284e8a9b040ea3153d3ea888de
 PKG_MIRROR_HASH:=b873c209baaf4f150c89646d58e4a0072f807d24b02c320ab8c7ae9180c13240


From lede-commits at lists.infradead.org  Sun Jun 13 14:59:15 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 13 Jun 2021 17:59:15 -0400
Subject: [openwrt/openwrt]  opkg: update to git HEAD
In-Reply-To: <162362155311.17757.12656085289767086495@git-01.infra.openwrt.org>
References: <162362155311.17757.12656085289767086495@git-01.infra.openwrt.org>
Message-ID: <mailman.5388.1623621559.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/da86064611db657bce8c3c96b2e58eca8551c3d0

commit da86064611db657bce8c3c96b2e58eca8551c3d0
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Jun 13 23:43:36 2021 +0200

    opkg: update to git HEAD
    
     1bf042d libopkg: pkg_hash: print unresolved dependencies
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/system/opkg/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile
index cc295c12ba..65bdf6dba9 100644
--- a/package/system/opkg/Makefile
+++ b/package/system/opkg/Makefile
@@ -12,9 +12,9 @@ PKG_FLAGS:=essential
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/opkg-lede.git
-PKG_SOURCE_DATE:=2021-03-15
-PKG_SOURCE_VERSION:=5936c4f9660248284e8a9b040ea3153d3ea888de
-PKG_MIRROR_HASH:=b873c209baaf4f150c89646d58e4a0072f807d24b02c320ab8c7ae9180c13240
+PKG_SOURCE_DATE:=2021-06-13
+PKG_SOURCE_VERSION:=1bf042dd06751b693a8544d2317e5b969d666b69
+PKG_MIRROR_HASH:=aeda4e0f11805bf95fc7be6d38391ce579acd965c8ba6a490b3e8669815b7264
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING


From lede-commits at lists.infradead.org  Sun Jun 13 14:59:13 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 13 Jun 2021 17:59:13 -0400
Subject: [openwrt/openwrt]  treewide: mark selected packages nonshared
In-Reply-To: <162362155311.17757.12656085289767086495@git-01.infra.openwrt.org>
References: <162362155311.17757.12656085289767086495@git-01.infra.openwrt.org>
Message-ID: <mailman.5389.1623621559.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/72cc44958ef4e0df1a152178514c92899d6a957a

commit 72cc44958ef4e0df1a152178514c92899d6a957a
Author: Hannu Nyman <hannu.nyman at iki.fi>
AuthorDate: Sun Jun 6 18:15:08 2021 +0300

    treewide: mark selected packages nonshared
    
    Mark uci, ubus, libubox, lua, libnl-tiny and libjson-c
    as nonshared packages. This helps to keep coherent dependencies
    if these ABI versioned packages are later updated.
    
    Before this commit it is possible to get missing dependencies
    in target-specific nonshared packages (like iwinfo) that depend
    on these shared ABI versioned packages. If these are later updated
    and rebuilt, only the new ABI version will be available for download,
    while the target-specific packages in releases continue to depend on
    the old ABI version.
    
    After this commit the packages are built along the other nonshared
    packages by the phase1 images buildbot and will be available at the
    target/ download directories instead of packages/base dir. That will
    help to keep a coherent set available.
    
    Signed-off-by: Hannu Nyman <hannu.nyman at iki.fi>
---
 package/libs/libjson-c/Makefile  | 3 ++-
 package/libs/libnl-tiny/Makefile | 4 +++-
 package/libs/libubox/Makefile    | 4 +++-
 package/system/ubus/Makefile     | 3 ++-
 package/system/uci/Makefile      | 3 ++-
 package/utils/lua/Makefile       | 3 ++-
 6 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/package/libs/libjson-c/Makefile b/package/libs/libjson-c/Makefile
index 13cf955960..0ea3fe80b5 100644
--- a/package/libs/libjson-c/Makefile
+++ b/package/libs/libjson-c/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=json-c
 PKG_VERSION:=0.15
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-nodoc.tar.gz
 PKG_SOURCE_URL:=https://s3.amazonaws.com/json-c_releases/releases/
@@ -20,6 +20,7 @@ PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=COPYING
 PKG_CPE_ID:=cpe:/a:json-c_project:json-c
 
+PKG_FLAGS := nonshared
 PKG_BUILD_PARALLEL:=1
 HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST)
 
diff --git a/package/libs/libnl-tiny/Makefile b/package/libs/libnl-tiny/Makefile
index b2eafe259a..ff3da5b518 100644
--- a/package/libs/libnl-tiny/Makefile
+++ b/package/libs/libnl-tiny/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libnl-tiny
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/libnl-tiny.git
@@ -17,6 +17,8 @@ PKG_SOURCE_VERSION:=c291088f631d1694f7ba0444b59677b194348da8
 PKG_MIRROR_HASH:=99bcce12701bb34dadb39689d95c2c5cf1e27719d0ecfd645d3957a8947025ac
 CMAKE_INSTALL:=1
 
+PKG_FLAGS := nonshared
+
 PKG_LICENSE:=LGPL-2.1
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 
diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile
index aec4c9cc02..cc5d7f7ae6 100644
--- a/package/libs/libubox/Makefile
+++ b/package/libs/libubox/Makefile
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libubox
-PKG_RELEASE=1
+PKG_RELEASE=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/libubox.git
@@ -11,6 +11,8 @@ PKG_SOURCE_VERSION:=b14c4688612c05c78ce984d7bde633bce8703b1e
 PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
 CMAKE_INSTALL:=1
 
+PKG_FLAGS := nonshared
+
 PKG_LICENSE:=ISC
 PKG_LICENSE_FILES:=
 
diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile
index a29521e9a5..9b29bf0e01 100644
--- a/package/system/ubus/Makefile
+++ b/package/system/ubus/Makefile
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ubus
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git
@@ -15,6 +15,7 @@ PKG_LICENSE:=LGPL-2.1
 PKG_LICENSE_FILES:=
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 
+PKG_FLAGS := nonshared
 PKG_ASLR_PIE_REGULAR:=1
 
 include $(INCLUDE_DIR)/package.mk
diff --git a/package/system/uci/Makefile b/package/system/uci/Makefile
index cdb6883bc1..3d9fdf7391 100644
--- a/package/system/uci/Makefile
+++ b/package/system/uci/Makefile
@@ -9,7 +9,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=uci
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/uci.git
 PKG_SOURCE_PROTO:=git
@@ -23,6 +23,7 @@ PKG_LICENSE_FILES:=
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 
 PKG_BUILD_PARALLEL:=0
+PKG_FLAGS := nonshared
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/cmake.mk
diff --git a/package/utils/lua/Makefile b/package/utils/lua/Makefile
index a54ef7d25a..83b83e4856 100644
--- a/package/utils/lua/Makefile
+++ b/package/utils/lua/Makefile
@@ -9,13 +9,14 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lua
 PKG_VERSION:=5.1.5
-PKG_RELEASE:=8
+PKG_RELEASE:=9
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.lua.org/ftp/ \
 	http://www.tecgraf.puc-rio.br/lua/ftp/
 PKG_HASH:=2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333
 PKG_BUILD_PARALLEL:=1
+PKG_FLAGS := nonshared
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=COPYRIGHT


From lede-commits at lists.infradead.org  Sun Jun 13 15:13:23 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 13 Jun 2021 18:13:23 -0400
Subject: [openwrt/openwrt]  opkg: update to git HEAD
In-Reply-To: <162362240258.27726.17095838945971027993@git-01.infra.openwrt.org>
References: <162362240258.27726.17095838945971027993@git-01.infra.openwrt.org>
Message-ID: <mailman.5392.1623622407.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/2aba3e9784e772dd8c7d8a01d17303d6110f0fa3

commit 2aba3e9784e772dd8c7d8a01d17303d6110f0fa3
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Jun 13 23:43:36 2021 +0200

    opkg: update to git HEAD
    
     1bf042d libopkg: pkg_hash: print unresolved dependencies
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit da86064611db657bce8c3c96b2e58eca8551c3d0)
---
 package/system/opkg/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile
index fb7d8667c6..405c74ec80 100644
--- a/package/system/opkg/Makefile
+++ b/package/system/opkg/Makefile
@@ -14,9 +14,9 @@ PKG_FLAGS:=essential
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://git.openwrt.org/project/opkg-lede.git
-PKG_SOURCE_DATE:=2021-03-15
-PKG_SOURCE_VERSION:=5936c4f9660248284e8a9b040ea3153d3ea888de
-PKG_MIRROR_HASH:=b873c209baaf4f150c89646d58e4a0072f807d24b02c320ab8c7ae9180c13240
+PKG_SOURCE_DATE:=2021-06-13
+PKG_SOURCE_VERSION:=1bf042dd06751b693a8544d2317e5b969d666b69
+PKG_MIRROR_HASH:=aeda4e0f11805bf95fc7be6d38391ce579acd965c8ba6a490b3e8669815b7264
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING


From lede-commits at lists.infradead.org  Sun Jun 13 15:13:22 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 13 Jun 2021 18:13:22 -0400
Subject: [openwrt/openwrt]  treewide: mark selected packages nonshared
In-Reply-To: <162362240258.27726.17095838945971027993@git-01.infra.openwrt.org>
References: <162362240258.27726.17095838945971027993@git-01.infra.openwrt.org>
Message-ID: <mailman.5393.1623622407.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/ea308e2f383c071a710973aa7825530de80c08d6

commit ea308e2f383c071a710973aa7825530de80c08d6
Author: Hannu Nyman <hannu.nyman at iki.fi>
AuthorDate: Sun Jun 6 18:15:08 2021 +0300

    treewide: mark selected packages nonshared
    
    Mark uci, ubus, libubox, lua, libnl-tiny and libjson-c
    as nonshared packages. This helps to keep coherent dependencies
    if these ABI versioned packages are later updated.
    
    Before this commit it is possible to get missing dependencies
    in target-specific nonshared packages (like iwinfo) that depend
    on these shared ABI versioned packages. If these are later updated
    and rebuilt, only the new ABI version will be available for download,
    while the target-specific packages in releases continue to depend on
    the old ABI version.
    
    After this commit the packages are built along the other nonshared
    packages by the phase1 images buildbot and will be available at the
    target/ download directories instead of packages/base dir. That will
    help to keep a coherent set available.
    
    Signed-off-by: Hannu Nyman <hannu.nyman at iki.fi>
    (cherry picked from commit 72cc44958ef4e0df1a152178514c92899d6a957a)
---
 package/libs/libjson-c/Makefile  | 3 ++-
 package/libs/libnl-tiny/Makefile | 4 +++-
 package/libs/libubox/Makefile    | 4 +++-
 package/system/ubus/Makefile     | 3 ++-
 package/system/uci/Makefile      | 3 ++-
 package/utils/lua/Makefile       | 3 ++-
 6 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/package/libs/libjson-c/Makefile b/package/libs/libjson-c/Makefile
index 13cf955960..0ea3fe80b5 100644
--- a/package/libs/libjson-c/Makefile
+++ b/package/libs/libjson-c/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=json-c
 PKG_VERSION:=0.15
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-nodoc.tar.gz
 PKG_SOURCE_URL:=https://s3.amazonaws.com/json-c_releases/releases/
@@ -20,6 +20,7 @@ PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=COPYING
 PKG_CPE_ID:=cpe:/a:json-c_project:json-c
 
+PKG_FLAGS := nonshared
 PKG_BUILD_PARALLEL:=1
 HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST)
 
diff --git a/package/libs/libnl-tiny/Makefile b/package/libs/libnl-tiny/Makefile
index b2eafe259a..ff3da5b518 100644
--- a/package/libs/libnl-tiny/Makefile
+++ b/package/libs/libnl-tiny/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libnl-tiny
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/libnl-tiny.git
@@ -17,6 +17,8 @@ PKG_SOURCE_VERSION:=c291088f631d1694f7ba0444b59677b194348da8
 PKG_MIRROR_HASH:=99bcce12701bb34dadb39689d95c2c5cf1e27719d0ecfd645d3957a8947025ac
 CMAKE_INSTALL:=1
 
+PKG_FLAGS := nonshared
+
 PKG_LICENSE:=LGPL-2.1
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 
diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile
index ac4effb6f8..8e4848103d 100644
--- a/package/libs/libubox/Makefile
+++ b/package/libs/libubox/Makefile
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libubox
-PKG_RELEASE=1
+PKG_RELEASE=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/libubox.git
@@ -11,6 +11,8 @@ PKG_SOURCE_VERSION:=b14c4688612c05c78ce984d7bde633bce8703b1e
 PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
 CMAKE_INSTALL:=1
 
+PKG_FLAGS := nonshared
+
 PKG_LICENSE:=ISC
 PKG_LICENSE_FILES:=
 
diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile
index 885307107b..c9b42fe623 100644
--- a/package/system/ubus/Makefile
+++ b/package/system/ubus/Makefile
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ubus
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git
@@ -15,6 +15,7 @@ PKG_LICENSE:=LGPL-2.1
 PKG_LICENSE_FILES:=
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 
+PKG_FLAGS := nonshared
 PKG_ASLR_PIE_REGULAR:=1
 
 include $(INCLUDE_DIR)/package.mk
diff --git a/package/system/uci/Makefile b/package/system/uci/Makefile
index 4fd5568bfb..fa2aff1c38 100644
--- a/package/system/uci/Makefile
+++ b/package/system/uci/Makefile
@@ -9,7 +9,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=uci
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/uci.git
 PKG_SOURCE_PROTO:=git
@@ -23,6 +23,7 @@ PKG_LICENSE_FILES:=
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 
 PKG_BUILD_PARALLEL:=0
+PKG_FLAGS := nonshared
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/cmake.mk
diff --git a/package/utils/lua/Makefile b/package/utils/lua/Makefile
index a54ef7d25a..83b83e4856 100644
--- a/package/utils/lua/Makefile
+++ b/package/utils/lua/Makefile
@@ -9,13 +9,14 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=lua
 PKG_VERSION:=5.1.5
-PKG_RELEASE:=8
+PKG_RELEASE:=9
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=http://www.lua.org/ftp/ \
 	http://www.tecgraf.puc-rio.br/lua/ftp/
 PKG_HASH:=2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333
 PKG_BUILD_PARALLEL:=1
+PKG_FLAGS := nonshared
 
 PKG_LICENSE:=MIT
 PKG_LICENSE_FILES:=COPYRIGHT


From lede-commits at lists.infradead.org  Sun Jun 13 16:38:12 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 13 Jun 2021 19:38:12 -0400
Subject: [openwrt/openwrt]  ramips: refresh at803x patch
In-Reply-To: <162362749243.19032.5549790272668233196@git-01.infra.openwrt.org>
References: <162362749243.19032.5549790272668233196@git-01.infra.openwrt.org>
Message-ID: <mailman.5395.1623627496.434944.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/5c68c624f671eb1773a82485d398ac933c4d416a

commit 5c68c624f671eb1773a82485d398ac933c4d416a
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Mon Jun 14 01:33:03 2021 +0200

    ramips: refresh at803x patch
    
    This patch failed to apply, breaking builds for the ramips target.
    
    Fixes commit c44cefceb3ad ("generic: kernel 5.4: fix probe error for AR803x PHYs")
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 target/linux/ramips/patches-5.4/991-at803x.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ramips/patches-5.4/991-at803x.patch b/target/linux/ramips/patches-5.4/991-at803x.patch
index 6e178b80ce..4de3118547 100644
--- a/target/linux/ramips/patches-5.4/991-at803x.patch
+++ b/target/linux/ramips/patches-5.4/991-at803x.patch
@@ -105,7 +105,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  {
  	struct device *dev = &phydev->mdio.dev;
  	struct at803x_priv *priv;
- 	int ret;
+ 	int ret = 0;
  
 +	if (at803x_mode(phydev) == AT803X_MODE_FIBER) {
 +		ret = phy_sfp_probe(phydev, &at803x_sfp_ops);


From lede-commits at lists.infradead.org  Sun Jun 13 16:38:13 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 13 Jun 2021 19:38:13 -0400
Subject: [openwrt/openwrt]  kernel: bump 5.10 to 5.10.43
In-Reply-To: <162362749243.19032.5549790272668233196@git-01.infra.openwrt.org>
References: <162362749243.19032.5549790272668233196@git-01.infra.openwrt.org>
Message-ID: <mailman.5396.1623627497.434944.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/677813c77678b80e99c4f97b433f428de26ca10f

commit 677813c77678b80e99c4f97b433f428de26ca10f
Author: Rui Salvaterra <rsalvaterra at gmail.com>
AuthorDate: Thu Jun 10 19:51:01 2021 +0100

    kernel: bump 5.10 to 5.10.43
    
    No deleted or manually refreshed patches.
    
    Signed-off-by: Rui Salvaterra <rsalvaterra at gmail.com>
---
 include/kernel-version.mk                              |  4 ++--
 .../425-at803x-allow-sgmii-aneg-override.patch         |  2 +-
 ...netfilter-Fix-fall-through-warnings-for-Clang.patch |  2 +-
 ...er-nftables-update-table-flags-from-the-commi.patch |  4 ++--
 .../generic/hack-5.10/901-debloat_sock_diag.patch      |  2 +-
 target/linux/generic/hack-5.10/902-debloat_proc.patch  |  2 +-
 ...w-rejecting-with-source-address-failed-policy.patch | 18 +++++++++---------
 .../rockchip/patches-5.10/105-rockchip-rock-pi-4.patch |  2 +-
 8 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 85178f5195..fb18167cfe 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -7,10 +7,10 @@ ifdef CONFIG_TESTING_KERNEL
 endif
 
 LINUX_VERSION-5.4 = .124
-LINUX_VERSION-5.10 = .42
+LINUX_VERSION-5.10 = .43
 
 LINUX_KERNEL_HASH-5.4.124 = f7f29dda2b042d7b5986d18274413131cf70e17288c05e9a683df1f46c507d82
-LINUX_KERNEL_HASH-5.10.42 = 8ba027c73bd67b8ded2649a741d2f018db630c1cbc081700d8ffd07ab0d906e5
+LINUX_KERNEL_HASH-5.10.43 = 83b81e433ba2f8ee143064fb163699ee857e26dd789006bc1e9edf1ccd0bd403
 
 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
 sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
diff --git a/target/linux/ath79/patches-5.10/425-at803x-allow-sgmii-aneg-override.patch b/target/linux/ath79/patches-5.10/425-at803x-allow-sgmii-aneg-override.patch
index b42102a966..db3427683f 100644
--- a/target/linux/ath79/patches-5.10/425-at803x-allow-sgmii-aneg-override.patch
+++ b/target/linux/ath79/patches-5.10/425-at803x-allow-sgmii-aneg-override.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/phy/at803x.c
 +++ b/drivers/net/phy/at803x.c
-@@ -698,6 +698,13 @@ static int at803x_aneg_done(struct phy_d
+@@ -733,6 +733,13 @@ static int at803x_aneg_done(struct phy_d
  	if (!(phy_read(phydev, AT803X_PSSR) & AT803X_PSSR_MR_AN_COMPLETE)) {
  		phydev_warn(phydev, "803x_aneg_done: SGMII link is not ok\n");
  		aneg_done = 0;
diff --git a/target/linux/generic/backport-5.10/610-v5.13-02-netfilter-Fix-fall-through-warnings-for-Clang.patch b/target/linux/generic/backport-5.10/610-v5.13-02-netfilter-Fix-fall-through-warnings-for-Clang.patch
index 04e3945d2f..52d04b051f 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-02-netfilter-Fix-fall-through-warnings-for-Clang.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-02-netfilter-Fix-fall-through-warnings-for-Clang.patch
@@ -24,7 +24,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  	case CT_DCCP_INVALID:
 --- a/net/netfilter/nf_tables_api.c
 +++ b/net/netfilter/nf_tables_api.c
-@@ -8367,6 +8367,7 @@ static int nf_tables_check_loops(const s
+@@ -8369,6 +8369,7 @@ static int nf_tables_check_loops(const s
  							data->verdict.chain);
  				if (err < 0)
  					return err;
diff --git a/target/linux/generic/backport-5.10/610-v5.13-10-netfilter-nftables-update-table-flags-from-the-commi.patch b/target/linux/generic/backport-5.10/610-v5.13-10-netfilter-nftables-update-table-flags-from-the-commi.patch
index eb6c31aa0f..ccfdb9384d 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-10-netfilter-nftables-update-table-flags-from-the-commi.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-10-netfilter-nftables-update-table-flags-from-the-commi.patch
@@ -70,7 +70,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  	nft_trans_table_update(trans) = true;
  	list_add_tail(&trans->list, &ctx->net->nft.commit_list);
  	return 0;
-@@ -7876,11 +7880,10 @@ static int nf_tables_commit(struct net *
+@@ -7878,11 +7882,10 @@ static int nf_tables_commit(struct net *
  		switch (trans->msg_type) {
  		case NFT_MSG_NEWTABLE:
  			if (nft_trans_table_update(trans)) {
@@ -86,7 +86,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  			} else {
  				nft_clear(net, trans->ctx.table);
  			}
-@@ -8093,11 +8096,9 @@ static int __nf_tables_abort(struct net
+@@ -8095,11 +8098,9 @@ static int __nf_tables_abort(struct net
  		switch (trans->msg_type) {
  		case NFT_MSG_NEWTABLE:
  			if (nft_trans_table_update(trans)) {
diff --git a/target/linux/generic/hack-5.10/901-debloat_sock_diag.patch b/target/linux/generic/hack-5.10/901-debloat_sock_diag.patch
index fc2a0a4862..88895b4572 100644
--- a/target/linux/generic/hack-5.10/901-debloat_sock_diag.patch
+++ b/target/linux/generic/hack-5.10/901-debloat_sock_diag.patch
@@ -77,7 +77,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie)
  {
  	struct dst_entry *dst = __sk_dst_get(sk);
-@@ -1808,9 +1822,11 @@ static void __sk_free(struct sock *sk)
+@@ -1816,9 +1830,11 @@ static void __sk_free(struct sock *sk)
  	if (likely(sk->sk_net_refcnt))
  		sock_inuse_add(sock_net(sk), -1);
  
diff --git a/target/linux/generic/hack-5.10/902-debloat_proc.patch b/target/linux/generic/hack-5.10/902-debloat_proc.patch
index 31ed45b19e..6f7a1876cd 100644
--- a/target/linux/generic/hack-5.10/902-debloat_proc.patch
+++ b/target/linux/generic/hack-5.10/902-debloat_proc.patch
@@ -330,7 +330,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
 --- a/net/core/sock.c
 +++ b/net/core/sock.c
-@@ -3674,6 +3674,8 @@ static __net_initdata struct pernet_oper
+@@ -3682,6 +3682,8 @@ static __net_initdata struct pernet_oper
  
  static int __init proto_init(void)
  {
diff --git a/target/linux/generic/pending-5.10/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-5.10/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
index b6f492fcb5..6fe3b327c5 100644
--- a/target/linux/generic/pending-5.10/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
+++ b/target/linux/generic/pending-5.10/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
@@ -157,7 +157,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  	case RTN_THROW:
  	case RTN_UNREACHABLE:
  	default:
-@@ -4414,6 +4433,17 @@ static int ip6_pkt_prohibit_out(struct n
+@@ -4418,6 +4437,17 @@ static int ip6_pkt_prohibit_out(struct n
  	return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES);
  }
  
@@ -175,7 +175,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  /*
   *	Allocate a dst for local (unicast / anycast) address.
   */
-@@ -4894,7 +4924,8 @@ static int rtm_to_fib6_config(struct sk_
+@@ -4898,7 +4928,8 @@ static int rtm_to_fib6_config(struct sk_
  	if (rtm->rtm_type == RTN_UNREACHABLE ||
  	    rtm->rtm_type == RTN_BLACKHOLE ||
  	    rtm->rtm_type == RTN_PROHIBIT ||
@@ -185,7 +185,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  		cfg->fc_flags |= RTF_REJECT;
  
  	if (rtm->rtm_type == RTN_LOCAL)
-@@ -6064,6 +6095,8 @@ static int ip6_route_dev_notify(struct n
+@@ -6068,6 +6099,8 @@ static int ip6_route_dev_notify(struct n
  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
  		net->ipv6.ip6_prohibit_entry->dst.dev = dev;
  		net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev);
@@ -194,7 +194,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  		net->ipv6.ip6_blk_hole_entry->dst.dev = dev;
  		net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev);
  #endif
-@@ -6075,6 +6108,7 @@ static int ip6_route_dev_notify(struct n
+@@ -6079,6 +6112,7 @@ static int ip6_route_dev_notify(struct n
  		in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev);
  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
  		in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev);
@@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  		in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev);
  #endif
  	}
-@@ -6266,6 +6300,8 @@ static int __net_init ip6_route_net_init
+@@ -6270,6 +6304,8 @@ static int __net_init ip6_route_net_init
  
  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
  	net->ipv6.fib6_has_custom_rules = false;
@@ -211,7 +211,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  	net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template,
  					       sizeof(*net->ipv6.ip6_prohibit_entry),
  					       GFP_KERNEL);
-@@ -6276,11 +6312,21 @@ static int __net_init ip6_route_net_init
+@@ -6280,11 +6316,21 @@ static int __net_init ip6_route_net_init
  			 ip6_template_metrics, true);
  	INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->rt6i_uncached);
  
@@ -234,7 +234,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  	net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops;
  	dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst,
  			 ip6_template_metrics, true);
-@@ -6307,6 +6353,8 @@ out:
+@@ -6311,6 +6357,8 @@ out:
  	return ret;
  
  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
@@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  out_ip6_prohibit_entry:
  	kfree(net->ipv6.ip6_prohibit_entry);
  out_ip6_null_entry:
-@@ -6326,6 +6374,7 @@ static void __net_exit ip6_route_net_exi
+@@ -6330,6 +6378,7 @@ static void __net_exit ip6_route_net_exi
  	kfree(net->ipv6.ip6_null_entry);
  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
  	kfree(net->ipv6.ip6_prohibit_entry);
@@ -251,7 +251,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  	kfree(net->ipv6.ip6_blk_hole_entry);
  #endif
  	dst_entries_destroy(&net->ipv6.ip6_dst_ops);
-@@ -6403,6 +6452,9 @@ void __init ip6_route_init_special_entri
+@@ -6407,6 +6456,9 @@ void __init ip6_route_init_special_entri
  	init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
  	init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev;
  	init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
diff --git a/target/linux/rockchip/patches-5.10/105-rockchip-rock-pi-4.patch b/target/linux/rockchip/patches-5.10/105-rockchip-rock-pi-4.patch
index d2c81e4d08..404f64ab95 100644
--- a/target/linux/rockchip/patches-5.10/105-rockchip-rock-pi-4.patch
+++ b/target/linux/rockchip/patches-5.10/105-rockchip-rock-pi-4.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm64/boot/dts/rockchip/Makefile
 +++ b/arch/arm64/boot/dts/rockchip/Makefile
-@@ -35,6 +35,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-pi
+@@ -36,6 +36,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-pi
  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-puma-haikou.dtb
  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-roc-pc.dtb
  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-roc-pc-mezzanine.dtb


From lede-commits at lists.infradead.org  Mon Jun 14 03:01:32 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 14 Jun 2021 06:01:32 -0400
Subject: [openwrt/openwrt]  kernel: bump 4.14 to 4.14.236
In-Reply-To: <162366489222.20786.2709185371666016652@git-01.infra.openwrt.org>
References: <162366489222.20786.2709185371666016652@git-01.infra.openwrt.org>
Message-ID: <mailman.5435.1623664897.434944.lede-commits@lists.infradead.org>

xback pushed a commit to openwrt/openwrt.git, branch openwrt-19.07:
https://git.openwrt.org/bdd7faca8df17f89100231a5937cd8b5e0e16830

commit bdd7faca8df17f89100231a5937cd8b5e0e16830
Author: Koen Vandeputte <koen.vandeputte at ncentric.com>
AuthorDate: Mon Jun 14 11:43:36 2021 +0200

    kernel: bump 4.14 to 4.14.236
    
    Refreshed all patches.
    
    Fixes:
    - CVE-2021-3564
    
    Compile-tested on: ar71xx, cns3xxx, imx6, x86_64
    Runtime-tested on: ar71xx, cns3xxx, imx6
    
    Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 include/kernel-version.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index f9f675b7e0..b56bdce480 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -6,9 +6,9 @@ ifdef CONFIG_TESTING_KERNEL
   KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
 endif
 
-LINUX_VERSION-4.14 = .235
+LINUX_VERSION-4.14 = .236
 
-LINUX_KERNEL_HASH-4.14.235 = 0ed1bdd11778f7a6646acddbede653ddc056e047306866e5719f2421e148670e
+LINUX_KERNEL_HASH-4.14.236 = e4eae297a6fefefd8ce4781d98178a7c1ee51ca0a4c8a7e46e61b121fbab8b2a
 
 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
 sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))


From lede-commits at lists.infradead.org  Mon Jun 14 03:01:33 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 14 Jun 2021 06:01:33 -0400
Subject: [openwrt/openwrt]  gitignore: add .ccache folder
In-Reply-To: <162366489222.20786.2709185371666016652@git-01.infra.openwrt.org>
References: <162366489222.20786.2709185371666016652@git-01.infra.openwrt.org>
Message-ID: <mailman.5438.1623664897.434944.lede-commits@lists.infradead.org>

xback pushed a commit to openwrt/openwrt.git, branch openwrt-19.07:
https://git.openwrt.org/ec76c365c1d60bf6a4f69b1ab3ce132f97f34dbb

commit ec76c365c1d60bf6a4f69b1ab3ce132f97f34dbb
Author: Koen Vandeputte <koen.vandeputte at ncentric.com>
AuthorDate: Mon Jun 7 11:20:35 2021 +0200

    gitignore: add .ccache folder
    
    Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 .gitignore | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.gitignore b/.gitignore
index 6549af83be..b6bfe1a525 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,3 +28,4 @@ TAGS*~
 git-src
 .project
 .cproject
+.ccache


From lede-commits at lists.infradead.org  Mon Jun 14 06:14:27 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 14 Jun 2021 09:14:27 -0400
Subject: [openwrt/openwrt] build: prepend ABI suffixes with a dash if
 package name ends with digit
In-Reply-To: <162367646711.21105.13573571993919353031@git-01.infra.openwrt.org>
References: <162367646711.21105.13573571993919353031@git-01.infra.openwrt.org>
Message-ID: <mailman.5472.1623676471.434944.lede-commits@lists.infradead.org>

jow pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/f6a03bff5bccdbf9165087bccbb35095903d05c6

commit f6a03bff5bccdbf9165087bccbb35095903d05c6
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Mon Jun 14 14:58:37 2021 +0200

    build: prepend ABI suffixes with a dash if package name ends with digit
    
    Ensure that ABI suffixes are separated with a dash from the package name if
    the name happens to end with a digit. This implementation detail got lost
    during the recent refactoring of the ABI_VERSION handling in buildroot.
    
    Ref: https://github.com/openwrt/packages/pull/14237#issuecomment-860473585
    Fixes: c921650382 ("build: drop ABI version from metadata")
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 include/feeds.mk        | 8 +++++++-
 include/package-ipkg.mk | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/include/feeds.mk b/include/feeds.mk
index 98e315bceb..e499ac2684 100644
--- a/include/feeds.mk
+++ b/include/feeds.mk
@@ -43,5 +43,11 @@ endef
 
 # 1: package name
 define GetABISuffix
-$(if $(filter-out kmod-%,$(1)),$(if $(ABIV_$(1)),$(ABIV_$(1)),$(foreach v,$(wildcard $(STAGING_DIR)/pkginfo/$(1).version),$(shell cat $(v)))))
+$(call FormatABISuffix,$(1),$(if $(ABIV_$(1)),$(ABIV_$(1)),$(foreach v,$(wildcard $(STAGING_DIR)/pkginfo/$(1).version),$(shell cat $(v)))))
+endef
+
+# 1: package name
+# 2: abi version
+define FormatABISuffix
+$(if $(filter-out kmod-%,$(1)),$(if $(2),$(if $(filter %0 %1 %2 %3 %4 %5 %6 %7 %8 %9,$(1)),-)$(2)))
 endef
diff --git a/include/package-ipkg.mk b/include/package-ipkg.mk
index b066e116f7..19f09c2311 100644
--- a/include/package-ipkg.mk
+++ b/include/package-ipkg.mk
@@ -99,7 +99,7 @@ _endef=endef
 
 ifeq ($(DUMP),)
   define BuildTarget/ipkg
-    ABIV_$(1):=$(if $(filter-out kmod-%,$(1)),$(ABI_VERSION))
+    ABIV_$(1):=$(call FormatABISuffix,$(1),$(ABI_VERSION))
     PDIR_$(1):=$(call FeedPackageDir,$(1))
     IPKG_$(1):=$$(PDIR_$(1))/$(1)$$(ABIV_$(1))_$(VERSION)_$(PKGARCH).ipk
     IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1)


From lede-commits at lists.infradead.org  Mon Jun 14 11:25:23 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 14 Jun 2021 14:25:23 -0400
Subject: [openwrt/openwrt] base-files: set MAC for bridge ports (devices)
 instead of bridge itself
In-Reply-To: <162369512360.10389.6097969521931583506@git-01.infra.openwrt.org>
References: <162369512360.10389.6097969521931583506@git-01.infra.openwrt.org>
Message-ID: <mailman.5560.1623695128.434944.lede-commits@lists.infradead.org>

rmilecki pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/c8d8eb9d13fc6fc8b394a620c27995ee71d29c4d

commit c8d8eb9d13fc6fc8b394a620c27995ee71d29c4d
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Mon Jun 14 20:18:14 2021 +0200

    base-files: set MAC for bridge ports (devices) instead of bridge itself
    
    This restores the original config_generate behaviour. With MAC set for
    bridged devices the bridge automatically gets its MAC adjusted (it picks
    the lowest MAC of bridged devices).
    
    This fixes confusing interfaces setup (bridge ports not having custom
    MAC assigned).
    
    Reported-by: Koen Vandeputte <koen.vandeputte at citymesh.com>
    Fixes: e002179a6d2e ("base-files: simplify setting device MAC")
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 package/base-files/files/bin/config_generate | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index 0dca5549e8..b3752c5430 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -114,9 +114,17 @@ generate_network() {
 			add network device
 			set network. at device[-1].name='br-$1'
 			set network. at device[-1].type='bridge'
-			set network. at device[-1].macaddr='$macaddr'
 		EOF
 		for port in $ports; do uci add_list network. at device[-1].ports="$port"; done
+		[ -n "macaddr" ] && {
+			for port in $ports; do
+				uci -q batch <<-EOF
+					add network device
+					set network. at device[-1].name='$port'
+					set network. at device[-1].macaddr='$macaddr'
+				EOF
+			done
+		}
 		device=br-$1
 		type=
 		macaddr=""


From lede-commits at lists.infradead.org  Mon Jun 14 11:46:45 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 14 Jun 2021 14:46:45 -0400
Subject: [openwrt/openwrt]  OpenWrt v21.02.0-rc3: revert to branch defaults
In-Reply-To: <162369640423.29741.373727940417646720@git-01.infra.openwrt.org>
References: <162369640423.29741.373727940417646720@git-01.infra.openwrt.org>
Message-ID: <mailman.5565.1623696408.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/aeb7b57798c7274a0bc0bc0a18ce5b2acb4a851f

commit aeb7b57798c7274a0bc0bc0a18ce5b2acb4a851f
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Mon Jun 14 20:33:17 2021 +0200

    OpenWrt v21.02.0-rc3: revert to branch defaults
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 feeds.conf.default                 | 9 +++++----
 include/version.mk                 | 6 +++---
 package/base-files/image-config.in | 4 ++--
 version                            | 1 -
 version.date                       | 1 -
 5 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/feeds.conf.default b/feeds.conf.default
index 5b4ad8cef3..98bf97232d 100644
--- a/feeds.conf.default
+++ b/feeds.conf.default
@@ -1,4 +1,5 @@
-src-git packages https://git.openwrt.org/feed/packages.git^e738d2faf1c4ed68094f1d5da075d2d92fb35049
-src-git luci https://git.openwrt.org/project/luci.git^2778366916f815d4af9534218bef10aa3aad3c01
-src-git routing https://git.openwrt.org/feed/routing.git^2baff33918c089fd3744c7192f8ae7a29c47a8d7
-src-git telephony https://git.openwrt.org/feed/telephony.git^ee64ec42e981e1f9e5a21cd3478497987ff76680
+src-git packages https://git.openwrt.org/feed/packages.git;openwrt-21.02
+src-git luci https://git.openwrt.org/project/luci.git;openwrt-21.02
+src-git routing https://git.openwrt.org/feed/routing.git;openwrt-21.02
+src-git telephony https://git.openwrt.org/feed/telephony.git;openwrt-21.02
+#src-link custom /usr/src/openwrt/custom-feed
diff --git a/include/version.mk b/include/version.mk
index ddbf22922b..a4b47c8a57 100644
--- a/include/version.mk
+++ b/include/version.mk
@@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \
 sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
 
 VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
-VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),21.02.0-rc3)
+VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),21.02-SNAPSHOT)
 
 VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
-VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r16172-2aba3e9784)
+VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
 
 VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
-VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/21.02.0-rc3)
+VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/21.02-SNAPSHOT)
 
 VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
 VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in
index 7a8840fd41..1f06332b00 100644
--- a/package/base-files/image-config.in
+++ b/package/base-files/image-config.in
@@ -183,7 +183,7 @@ if VERSIONOPT
 	config VERSION_REPO
 		string
 		prompt "Release repository"
-		default "https://downloads.openwrt.org/releases/21.02.0-rc3"
+		default "https://downloads.openwrt.org/releases/21.02-SNAPSHOT"
 		help
 			This is the repository address embedded in the image, it defaults
 			to the trunk snapshot repo; the url may contain the following placeholders:
@@ -259,7 +259,7 @@ if VERSIONOPT
 	config VERSION_CODE_FILENAMES
 		bool
 		prompt "Revision code in filenames"
-		default n
+		default y
 		help
 			Enable this to include the revision identifier or the configured
 			version code into the firmware image, SDK- and Image Builder archive
diff --git a/version b/version
deleted file mode 100644
index 44428ad84b..0000000000
--- a/version
+++ /dev/null
@@ -1 +0,0 @@
-r16172-2aba3e9784
diff --git a/version.date b/version.date
deleted file mode 100644
index d556c14ae8..0000000000
--- a/version.date
+++ /dev/null
@@ -1 +0,0 @@
-1623621739


From lede-commits at lists.infradead.org  Mon Jun 14 11:46:44 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 14 Jun 2021 14:46:44 -0400
Subject: [openwrt/openwrt]  OpenWrt v21.02.0-rc3: adjust config defaults
In-Reply-To: <162369640423.29741.373727940417646720@git-01.infra.openwrt.org>
References: <162369640423.29741.373727940417646720@git-01.infra.openwrt.org>
Message-ID: <mailman.5566.1623696413.434944.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/2bc192c3f46dadc7cfbcd7e1ad62b1a34d6aca10

commit 2bc192c3f46dadc7cfbcd7e1ad62b1a34d6aca10
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Mon Jun 14 20:33:04 2021 +0200

    OpenWrt v21.02.0-rc3: adjust config defaults
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 feeds.conf.default                 | 9 ++++-----
 include/version.mk                 | 6 +++---
 package/base-files/image-config.in | 4 ++--
 version                            | 1 +
 version.date                       | 1 +
 5 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/feeds.conf.default b/feeds.conf.default
index 98bf97232d..5b4ad8cef3 100644
--- a/feeds.conf.default
+++ b/feeds.conf.default
@@ -1,5 +1,4 @@
-src-git packages https://git.openwrt.org/feed/packages.git;openwrt-21.02
-src-git luci https://git.openwrt.org/project/luci.git;openwrt-21.02
-src-git routing https://git.openwrt.org/feed/routing.git;openwrt-21.02
-src-git telephony https://git.openwrt.org/feed/telephony.git;openwrt-21.02
-#src-link custom /usr/src/openwrt/custom-feed
+src-git packages https://git.openwrt.org/feed/packages.git^e738d2faf1c4ed68094f1d5da075d2d92fb35049
+src-git luci https://git.openwrt.org/project/luci.git^2778366916f815d4af9534218bef10aa3aad3c01
+src-git routing https://git.openwrt.org/feed/routing.git^2baff33918c089fd3744c7192f8ae7a29c47a8d7
+src-git telephony https://git.openwrt.org/feed/telephony.git^ee64ec42e981e1f9e5a21cd3478497987ff76680
diff --git a/include/version.mk b/include/version.mk
index a4b47c8a57..ddbf22922b 100644
--- a/include/version.mk
+++ b/include/version.mk
@@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \
 sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1))))
 
 VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER))
-VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),21.02-SNAPSHOT)
+VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),21.02.0-rc3)
 
 VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE))
-VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION))
+VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r16172-2aba3e9784)
 
 VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO))
-VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/21.02-SNAPSHOT)
+VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/21.02.0-rc3)
 
 VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST))
 VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt)
diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in
index 1f06332b00..7a8840fd41 100644
--- a/package/base-files/image-config.in
+++ b/package/base-files/image-config.in
@@ -183,7 +183,7 @@ if VERSIONOPT
 	config VERSION_REPO
 		string
 		prompt "Release repository"
-		default "https://downloads.openwrt.org/releases/21.02-SNAPSHOT"
+		default "https://downloads.openwrt.org/releases/21.02.0-rc3"
 		help
 			This is the repository address embedded in the image, it defaults
 			to the trunk snapshot repo; the url may contain the following placeholders:
@@ -259,7 +259,7 @@ if VERSIONOPT
 	config VERSION_CODE_FILENAMES
 		bool
 		prompt "Revision code in filenames"
-		default y
+		default n
 		help
 			Enable this to include the revision identifier or the configured
 			version code into the firmware image, SDK- and Image Builder archive
diff --git a/version b/version
new file mode 100644
index 0000000000..44428ad84b
--- /dev/null
+++ b/version
@@ -0,0 +1 @@
+r16172-2aba3e9784
diff --git a/version.date b/version.date
new file mode 100644
index 0000000000..d556c14ae8
--- /dev/null
+++ b/version.date
@@ -0,0 +1 @@
+1623621739


From lede-commits at lists.infradead.org  Mon Jun 14 13:30:36 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 14 Jun 2021 16:30:36 -0400
Subject: [openwrt/openwrt] base-files: fix typo in config_generate MAC check
In-Reply-To: <162370263665.30606.6223617636212921957@git-01.infra.openwrt.org>
References: <162370263665.30606.6223617636212921957@git-01.infra.openwrt.org>
Message-ID: <mailman.5583.1623702641.434944.lede-commits@lists.infradead.org>

rmilecki pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/946019637ec9192450c685a61c589a9cbef7637b

commit 946019637ec9192450c685a61c589a9cbef7637b
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Mon Jun 14 22:29:49 2021 +0200

    base-files: fix typo in config_generate MAC check
    
    Fixes: 8d8eb9d13fc6 ("base-files: set MAC for bridge ports (devices) instead of bridge itself")
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 package/base-files/files/bin/config_generate | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index b3752c5430..596fcf41fa 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -116,7 +116,7 @@ generate_network() {
 			set network. at device[-1].type='bridge'
 		EOF
 		for port in $ports; do uci add_list network. at device[-1].ports="$port"; done
-		[ -n "macaddr" ] && {
+		[ -n "$macaddr" ] && {
 			for port in $ports; do
 				uci -q batch <<-EOF
 					add network device


From lede-commits at lists.infradead.org  Tue Jun 15 04:18:21 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 15 Jun 2021 07:18:21 -0400
Subject: [openwrt/openwrt]  ugps: start also in case device is absent
In-Reply-To: <162375590073.22304.6867473447102102929@git-01.infra.openwrt.org>
References: <162375590073.22304.6867473447102102929@git-01.infra.openwrt.org>
Message-ID: <mailman.20.1623764256.1072.lede-commits@lists.infradead.org>

dangole pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/072d0afb8fa6359541568081c23fe2d8d411651c

commit 072d0afb8fa6359541568081c23fe2d8d411651c
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Thu May 27 12:34:38 2021 +0200

    ugps: start also in case device is absent
    
    Don't bail out from init script in case the GPS device is missing.
    Some modems take time to come up, and some people may use things like
    'kplex' to feed ugpsd. Hence it is better to always start ugpsd
    unconditionally and let procd's respawn take care of retrying.
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
    (cherry picked from commit 3d026d24257a0e2f3170538d8a54d520315699a1)
---
 package/utils/ugps/files/ugps.init | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/package/utils/ugps/files/ugps.init b/package/utils/ugps/files/ugps.init
index 3cd1ca1b8d..77c3603066 100644
--- a/package/utils/ugps/files/ugps.init
+++ b/package/utils/ugps/files/ugps.init
@@ -16,11 +16,16 @@ start_service() {
 	local disabled="$(uci get gps. at gps[-1].disabled || echo 0)"
 
 	[ "$disabled" == "0" ] || return
+	[ "$tty" ] || return
 
-	[ -c "$tty" ] || {
-		tty="/dev/$tty"
-		[ -c "$tty" ] || return
-	}
+	case "$tty" in
+		"/"*)
+			true
+			;;
+		*)
+			tty="/dev/$tty"
+			;;
+	esac
 
 	procd_open_instance
 	procd_set_param command "$PROG"


From lede-commits at lists.infradead.org  Tue Jun 15 04:15:12 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 15 Jun 2021 07:15:12 -0400
Subject: [openwrt/openwrt]  ugps: start also in case device is absent
In-Reply-To: <162375571286.20350.14496030745164615838@git-01.infra.openwrt.org>
References: <162375571286.20350.14496030745164615838@git-01.infra.openwrt.org>
Message-ID: <mailman.21.1623764256.1072.lede-commits@lists.infradead.org>

dangole pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/3d026d24257a0e2f3170538d8a54d520315699a1

commit 3d026d24257a0e2f3170538d8a54d520315699a1
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Thu May 27 12:34:38 2021 +0200

    ugps: start also in case device is absent
    
    Don't bail out from init script in case the GPS device is missing.
    Some modems take time to come up, and some people may use things like
    'kplex' to feed ugpsd. Hence it is better to always start ugpsd
    unconditionally and let procd's respawn take care of retrying.
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 package/utils/ugps/files/ugps.init | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/package/utils/ugps/files/ugps.init b/package/utils/ugps/files/ugps.init
index 3cd1ca1b8d..77c3603066 100644
--- a/package/utils/ugps/files/ugps.init
+++ b/package/utils/ugps/files/ugps.init
@@ -16,11 +16,16 @@ start_service() {
 	local disabled="$(uci get gps. at gps[-1].disabled || echo 0)"
 
 	[ "$disabled" == "0" ] || return
+	[ "$tty" ] || return
 
-	[ -c "$tty" ] || {
-		tty="/dev/$tty"
-		[ -c "$tty" ] || return
-	}
+	case "$tty" in
+		"/"*)
+			true
+			;;
+		*)
+			tty="/dev/$tty"
+			;;
+	esac
 
 	procd_open_instance
 	procd_set_param command "$PROG"


From lede-commits at lists.infradead.org  Tue Jun 15 04:18:20 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 15 Jun 2021 07:18:20 -0400
Subject: [openwrt/openwrt]  ugps: update to git HEAD
In-Reply-To: <162375590073.22304.6867473447102102929@git-01.infra.openwrt.org>
References: <162375590073.22304.6867473447102102929@git-01.infra.openwrt.org>
Message-ID: <mailman.48.1623765061.1072.lede-commits@lists.infradead.org>

dangole pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/25c75424e7b51a60dd7a06336257232173619e2c

commit 25c75424e7b51a60dd7a06336257232173619e2c
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Mon Jun 7 23:13:18 2021 +0100

    ugps: update to git HEAD
    
     86ee86e nmea: parse $GPZDA sentences for date/time
     8e12414 nmea: parse $GPGLL sentences for position
     5e88403 ubus: display only available information
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
    (cherry picked from commit 3a8b75b56927d679dbf1a86827ceffef35207281)
---
 package/utils/ugps/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/utils/ugps/Makefile b/package/utils/ugps/Makefile
index 4ce64d9631..c70a7b7ea6 100644
--- a/package/utils/ugps/Makefile
+++ b/package/utils/ugps/Makefile
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ugps
-PKG_RELEASE:=1
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/ugps.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2020-08-29
-PKG_SOURCE_VERSION:=511a5b3c84fa715ef0305cf26c98619c12a4867a
-PKG_MIRROR_HASH:=551d57b4c18da4c4695fa2f7a959c25a03be35d14cf872785e7db740f12366e2
+PKG_SOURCE_DATE:=2021-06-08
+PKG_SOURCE_VERSION:=5e88403fc0d39ae8a270d2c6c6e9c8a4d5232cf3
+PKG_MIRROR_HASH:=a3dfc2cc6def3b634d8b7cda9139926be3d876cf2faa5251c4821987954442a5
 
 PKG_MAINTAINER:=John Crispin <john at phrozen.org>
 PKG_LICENSE:=GPL-2.0+


From lede-commits at lists.infradead.org  Tue Jun 15 00:58:42 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 15 Jun 2021 03:58:42 -0400
Subject: [openwrt/openwrt] build: ensure that dash isn't prepended twice to
 abi version suffix
In-Reply-To: <162374392213.3010.8215942428532647007@git-01.infra.openwrt.org>
References: <162374392213.3010.8215942428532647007@git-01.infra.openwrt.org>
Message-ID: <mailman.72.1623765615.1072.lede-commits@lists.infradead.org>

jow pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/fbb9b1f8ed0d8a76dd989cc6c16a4e0fda2b6e74

commit fbb9b1f8ed0d8a76dd989cc6c16a4e0fda2b6e74
Author: Jo-Philipp Wich <jo at mein.io>
AuthorDate: Tue Jun 15 09:54:45 2021 +0200

    build: ensure that dash isn't prepended twice to abi version suffix
    
    The ABIV_$(pkgname) variable already is formatted so return it as-is from
    the GetABISuffix macro and only filter through FormatABISuffix if we read
    the raw ABI version value from a version stamp file.
    
    This ensures that binary intra-package dependencies on ABI versioned
    libraries are properly formatted.
    
    Ref: https://github.com/openwrt/packages/issues/15871
    Fixes: f6a03bff5b ("build: prepend ABI suffixes with a dash if package name ends with digit")
    Signed-off-by: Jo-Philipp Wich <jo at mein.io>
---
 include/feeds.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/feeds.mk b/include/feeds.mk
index e499ac2684..632fecb4a3 100644
--- a/include/feeds.mk
+++ b/include/feeds.mk
@@ -43,7 +43,7 @@ endef
 
 # 1: package name
 define GetABISuffix
-$(call FormatABISuffix,$(1),$(if $(ABIV_$(1)),$(ABIV_$(1)),$(foreach v,$(wildcard $(STAGING_DIR)/pkginfo/$(1).version),$(shell cat $(v)))))
+$(if $(ABIV_$(1)),$(ABIV_$(1)),$(call FormatABISuffix,$(1),$(foreach v,$(wildcard $(STAGING_DIR)/pkginfo/$(1).version),$(shell cat $(v)))))
 endef
 
 # 1: package name


From lede-commits at lists.infradead.org  Thu Jun 17 00:29:17 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 17 Jun 2021 03:29:17 -0400
Subject: [openwrt/openwrt]  build: preserve profiles.json between builds
In-Reply-To: <162391495765.6908.12377929135399363629@git-01.infra.openwrt.org>
References: <162391495765.6908.12377929135399363629@git-01.infra.openwrt.org>
Message-ID: <mailman.880.1623914964.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/a463b96241fbc2d142982387eaed9989e201ac7a

commit a463b96241fbc2d142982387eaed9989e201ac7a
Author: Moritz Warning <moritzwarning at web.de>
AuthorDate: Mon Feb 22 00:18:10 2021 +0100

    build: preserve profiles.json between builds
    
    Keep other profiles.json content if the data belongs to the current
    build version.
    
    Also useful for the ImageBuilder, which builds for a single model each
    time. Without this commit the profiles.json would only contain the
    latest build profile information.
    
    Signed-off-by: Moritz Warning <moritzwarning at web.de>
    [improve commit message]
    Signed-off-by: Paul Spooren <mail at aparcar.org>
---
 scripts/json_overview_image_info.py | 32 +++++++++++++++++++++++---------
 1 file changed, 23 insertions(+), 9 deletions(-)

diff --git a/scripts/json_overview_image_info.py b/scripts/json_overview_image_info.py
index 8dbd24af2d..45c05012b1 100755
--- a/scripts/json_overview_image_info.py
+++ b/scripts/json_overview_image_info.py
@@ -18,19 +18,33 @@ work_dir = Path(getenv("WORK_DIR"))
 
 output = {}
 
+
+def get_initial_output(image_info):
+    # preserve existing profiles.json
+    if output_path.is_file():
+        profiles = json.loads(output_path.read_text())
+        if profiles["version_code"] == image_info["version_code"]:
+            return profiles
+    return image_info
+
+
 for json_file in work_dir.glob("*.json"):
     image_info = json.loads(json_file.read_text())
+
     if not output:
-        output.update(image_info)
+        output = get_initial_output(image_info)
+
+    # get first and only profile in json file
+    device_id, profile = next(iter(image_info["profiles"].items()))
+    if device_id not in output["profiles"]:
+        output["profiles"][device_id] = profile
     else:
-        # get first (and only) profile in json file
-        device_id = next(iter(image_info["profiles"].keys()))
-        if device_id not in output["profiles"]:
-            output["profiles"].update(image_info["profiles"])
-        else:
-            output["profiles"][device_id]["images"].append(
-                image_info["profiles"][device_id]["images"][0]
-            )
+        output["profiles"][device_id]["images"].extend(profile["images"])
+
+# make image lists unique by name, keep last/latest
+for device_id, profile in output["profiles"].items():
+    profile["images"] = list({e["name"]: e for e in profile["images"]}.values())
+
 
 if output:
     default_packages, output["arch_packages"] = run(


From lede-commits at lists.infradead.org  Thu Jun 17 03:41:31 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 17 Jun 2021 06:41:31 -0400
Subject: [openwrt/openwrt]  mac80211: select iwinfo
In-Reply-To: <162392649096.1826.8752358449736406153@git-01.infra.openwrt.org>
References: <162392649096.1826.8752358449736406153@git-01.infra.openwrt.org>
Message-ID: <mailman.934.1623926494.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/a0f97d8f9cb068305319012b50de092ee01ad7a1

commit a0f97d8f9cb068305319012b50de092ee01ad7a1
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Jun 17 12:03:48 2021 +0200

    mac80211: select iwinfo
    
    Since iwinfo is now used in the core scripts, it needs to be present on the system
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/kernel/mac80211/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 0ade95e35e..d0620c556a 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -98,7 +98,7 @@ PKG_CONFIG_DEPENDS += \
 define KernelPackage/cfg80211
   $(call KernelPackage/mac80211/Default)
   TITLE:=cfg80211 - wireless configuration API
-  DEPENDS+= +iw +wireless-regdb
+  DEPENDS+= +iw +iwinfo +wireless-regdb
   ABI_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
   FILES:= \
 	$(PKG_BUILD_DIR)/compat/compat.ko \


From lede-commits at lists.infradead.org  Thu Jun 17 03:41:30 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 17 Jun 2021 06:41:30 -0400
Subject: [openwrt/openwrt] mac80211: fix processing HE capabilities (FS#3871)
In-Reply-To: <162392649096.1826.8752358449736406153@git-01.infra.openwrt.org>
References: <162392649096.1826.8752358449736406153@git-01.infra.openwrt.org>
Message-ID: <mailman.935.1623926494.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/49ef4dbee519e006bb998de11e3bdf1c10c43e6a

commit 49ef4dbee519e006bb998de11e3bdf1c10c43e6a
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Jun 17 11:04:27 2021 +0200

    mac80211: fix processing HE capabilities (FS#3871)
    
    Use the right argument to fix setting unsupported capabilities to 0
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index c9a0fe542a..b6e3302f8b 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -116,7 +116,7 @@ mac80211_add_he_capabilities() {
 		set -- $capab
 		[ "$(($4))" -gt 0 ] || continue
 		[ "$(((0x$2) & $3))" -gt 0 ] || {
-			eval "$4=0"
+			eval "$1=0"
 			continue
 		}
 		append base_cfg "$1=1" "$N"


From lede-commits at lists.infradead.org  Thu Jun 17 03:41:32 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 17 Jun 2021 06:41:32 -0400
Subject: [openwrt/openwrt]  mac80211: fix minstrel sample time check
In-Reply-To: <162392649096.1826.8752358449736406153@git-01.infra.openwrt.org>
References: <162392649096.1826.8752358449736406153@git-01.infra.openwrt.org>
Message-ID: <mailman.936.1623926499.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/db9784beddd01ef960833b6ad6696eb581faf605

commit db9784beddd01ef960833b6ad6696eb581faf605
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Jun 17 12:40:15 2021 +0200

    mac80211: fix minstrel sample time check
    
    We need to skip sampling if the next sample time is after jiffies, not before.
    This patch fixes an issue where in some cases only very little sampling (or none
    at all) is performed, leading to really bad data rates
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...ac80211-minstrel_ht-fix-sample-time-check.patch | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch b/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch
new file mode 100644
index 0000000000..787254b4df
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch
@@ -0,0 +1,23 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Thu, 17 Jun 2021 12:05:54 +0200
+Subject: [PATCH] mac80211: minstrel_ht: fix sample time check
+
+We need to skip sampling if the next sample time is after jiffies, not before.
+This patch fixes an issue where in some cases only very little sampling (or none
+at all) is performed, leading to really bad data rates
+
+Fixes: 80d55154b2f8 ("mac80211: minstrel_ht: significantly redesign the rate probing strategy")
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/net/mac80211/rc80211_minstrel_ht.c
++++ b/net/mac80211/rc80211_minstrel_ht.c
+@@ -1498,7 +1498,7 @@ minstrel_ht_get_rate(void *priv, struct
+ 	    (info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO))
+ 		return;
+ 
+-	if (time_is_before_jiffies(mi->sample_time))
++	if (time_is_after_jiffies(mi->sample_time))
+ 		return;
+ 
+ 	mi->sample_time = jiffies + MINSTREL_SAMPLE_INTERVAL;


From lede-commits at lists.infradead.org  Thu Jun 17 04:27:02 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 17 Jun 2021 07:27:02 -0400
Subject: [openwrt/openwrt]  mt76: update to the latest version
In-Reply-To: <162392922177.15680.3507025024661683713@git-01.infra.openwrt.org>
References: <162392922177.15680.3507025024661683713@git-01.infra.openwrt.org>
Message-ID: <mailman.949.1623929226.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/20f66649dda3094320e515006cd5ddc9c096ac30

commit 20f66649dda3094320e515006cd5ddc9c096ac30
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Jun 2 08:49:19 2021 +0200

    mt76: update to the latest version
    
    bddc1db76d0f mt76: mt7915: drop the use of repeater entries for station interfaces
    3c90f35dddac mt76: mt7915: add thermal sensor device support
    afab0e8202ff mt76: mt7915: add thermal cooling device support
    41cf02184699 mt76: mt7615: add thermal sensor device support
    2ac6b8762565 mt76: connac: update BA win size in Rx direction
    ddb301127291 mt76: mt7921: fix reset under the deep sleep is enabled
    e4cbefd1d69a mt76: mt7921: avoid unnecessary consecutive WiFi resets
    393eea2034d7 mt76: mt7921: fix invalid register access in wake_work
    a15d46407ffa mt76: mt7921: fix OMAC idx usage
    e4d267d8e900 mt76: mt7921: enable runtime pm by default
    50fd8ce2412a mt76: connac: add bss color support for sta mode
    e29058c3c860 mt76: mt7921: return proper error value in mt7921_mac_init
    c89c8c347b1e mt76: mt7921: do not schedule hw reset if the device is not running
    9f7bb428e587 mt76: mt7921: reset wfsys during hw probe
    22ea365913b5 mt76: mt7915: add .offset_tsf callback
    ad91f8e8e494 mt76: mt7615: add .offset_tsf callback
    6f871f35e3c1 mt76: mt7915: use mt7915_mcu_get_txpower_sku() to get per-rate txpower
    597b68b7daa3 mt76: mt7615: remove useless if condition in mt7615_add_interface()
    3945264468eb mt76: testmode: fix memory leak in mt76_testmode_alloc_skb
    bdcc57a11606 mt76: testmode: remove unnecessary function calls in mt76_testmode_free_skb
    a9763452601d mt76: testmode: remove undefined behaviour in mt76_testmode_alloc_skb
    4aef2a2be464 mt76: mt7615: fix potential overflow on large shift
    d9dd7635b055 mt76: mt7915: use mt7915_mcu_get_mib_info() to get survey data
    d740e921758a mt76: mt7921: introduce mac tx done handling
    259ddfc7cb73 mt76: mt7921: update statistic in active mode only
    757b93f4b179 mt76: mt7921: remove leftover 80+80 HE capability
    1fcff599b2e1 mt76: allow hw driver code to overwrite wiphy interface_modes
    c55c22e39b7d mt7915: update firmware to 2020110522
    10548aef1f45 mt76: mt7915: improve error recovery reliability
    ed6b0c79820c mt76: mt7921: set MT76_RESET during mac reset
    321443258bea mt76: move mt76_rates in mt76 module
    d1652e8af9e1 Revert "mt76: connac: do not schedule wake_work if the runtime-pm is disabled"
    4f4cab39ed9f mt76: mt7915: read all eeprom fields from fw in efuse mode
    71450535f164 mt76: mt7921: enable hw offloading for wep keys
    833d577e430c mt76: mt7921: remove mt7921_get_wtbl_info routine
    67b7a22d2b99 mt76: mt7921: enable random mac address during sched_scan
    cf1ff7bf4f1b mt76: mt7915: setup drr group for peers
    ef2f7aa8745f mt76: mt7615: update radar parameters
    b9f09f530223 mt76: mt7915: fix MT_EE_CAL_GROUP_SIZE
    22b690334c0f mt76: mt7915: do not fail if the cooling device could not be registered
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
    (cherry-picked from commit 3c46ba053d899df65dc07e373c64d1925d30f88e)
---
 package/kernel/mt76/Makefile | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile
index 5104c3ec53..e4051d8347 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:=2021-05-15
-PKG_SOURCE_VERSION:=9d736545bb5ac9707e60b7900b7d6b290492e24d
-PKG_MIRROR_HASH:=8fd98f488579c18cfd8c442cff1796dcd70e2ecbc59c5d5b92ee8c0f06efafcf
+PKG_SOURCE_DATE:=2021-06-06
+PKG_SOURCE_VERSION:=22b690334c0f49b11534cc2e331c9d5e17c4a0bc
+PKG_MIRROR_HASH:=ff5e563935919d2e40c1e7254ef3bc06f7ecc5e69f8ddd12903e8f5de942d630
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 PKG_BUILD_PARALLEL:=1
@@ -155,7 +155,7 @@ define KernelPackage/mt7615-common
   $(KernelPackage/mt76-default)
   TITLE:=MediaTek MT7615 wireless driver common code
   HIDDEN:=1
-  DEPENDS+=@PCI_SUPPORT +kmod-mt76-core +kmod-mt76-connac
+  DEPENDS+=@PCI_SUPPORT +kmod-mt76-core +kmod-mt76-connac +kmod-hwmon-core
   FILES:= $(PKG_BUILD_DIR)/mt7615/mt7615-common.ko
 endef
 
@@ -213,7 +213,7 @@ endef
 define KernelPackage/mt7915e
   $(KernelPackage/mt76-default)
   TITLE:=MediaTek MT7915e wireless driver
-  DEPENDS+=@PCI_SUPPORT +kmod-mt7615-common + at DRIVER_11AX_SUPPORT
+  DEPENDS+=@PCI_SUPPORT +kmod-mt7615-common +kmod-hwmon-core +kmod-thermal + at DRIVER_11AX_SUPPORT
   FILES:= $(PKG_BUILD_DIR)/mt7915/mt7915e.ko
   AUTOLOAD:=$(call AutoProbe,mt7915e)
 endef


From lede-commits at lists.infradead.org  Thu Jun 17 04:27:03 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 17 Jun 2021 07:27:03 -0400
Subject: [openwrt/openwrt]  iw: update to 8fab0c9e
In-Reply-To: <162392922177.15680.3507025024661683713@git-01.infra.openwrt.org>
References: <162392922177.15680.3507025024661683713@git-01.infra.openwrt.org>
Message-ID: <mailman.950.1623929229.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/3921f213e5ed091731f11b2543c206eab672cc17

commit 3921f213e5ed091731f11b2543c206eab672cc17
Author: Andre Heider <a.heider at gmail.com>
AuthorDate: Tue May 18 07:13:50 2021 +0200

    iw: update to 8fab0c9e
    
    This fixes `iw dev wlan0-mesh station dump`.
    
    8fab0c9 iw: fix ftm_request missing arguments segfault
    e816fbc iw: fix mgmt dump missing arguments segfault
    5d9d1b8 iw: Fix timestamp output on 32-bit architectures
    4b25ae3 iw: fix pointer arithmetic in __print_he_capa
    c3df363 iw: add option to print human readable event time
    cd64525 iw: print ctrl port tx status event
    0ba98b9 iw: use correct type in policy check for mesh
    9e38dee iw: scan: fixup HE caps whitespace
    17e8564 iw: scan: parse HE capabilities
    5735e58 iw: util: factor out HE capability parser
    6d8d507 iw: scan: add extension tag parsing
    b4e1ec4 man: update wikipage URL, reformat SEE ALSO section
    c56036a iw: enable 80MHz support for 6GHz band 11s mesh
    fa72728 iw: handle positive error codes gracefully
    7ba9093 iw: scan: add flag for scanning colocated ap
    5ec60ed iw: Add 'coloc' and 'flush' options to sched_scan
    f8ade75 iw: update wikipage URL
    b6f2dac iw: Add support for specifying the 160MHz bandwidth when setting the channel/frequency
    
    Signed-off-by: Andre Heider <a.heider at gmail.com>
    (cherry-picked from commit b5420dd710aaad703f6f7a900840609d4d1176a1)
---
 package/network/utils/iw/Makefile                  | 11 ++++----
 .../network/utils/iw/patches/200-reduce_size.patch | 30 +++++++++++-----------
 2 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/package/network/utils/iw/Makefile b/package/network/utils/iw/Makefile
index 6db9aaf105..8e11046189 100644
--- a/package/network/utils/iw/Makefile
+++ b/package/network/utils/iw/Makefile
@@ -8,12 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=iw
-PKG_VERSION:=5.9
-PKG_RELEASE:=1
+PKG_VERSION:=5.9-8fab0c9e
+PKG_RELEASE:=$(AUTORELEASE)
 
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=@KERNEL/software/network/iw
-PKG_HASH:=293a07109aeb7e36267cf59e3ce52857e9ffae3a6666eb8ac77894b1839fe1f2
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git
+PKG_SOURCE_VERSION:=8fab0c9ee9db217587a58efcc37421c86edcb638
+PKG_MIRROR_HASH:=797b322bc03952f3127ae0a7da476c14ada1bbe9a9ae234a56dd6f864c568e16
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 PKG_LICENSE:=GPL-2.0
diff --git a/package/network/utils/iw/patches/200-reduce_size.patch b/package/network/utils/iw/patches/200-reduce_size.patch
index af30876012..83e11405cb 100644
--- a/package/network/utils/iw/patches/200-reduce_size.patch
+++ b/package/network/utils/iw/patches/200-reduce_size.patch
@@ -1,6 +1,6 @@
 --- a/event.c
 +++ b/event.c
-@@ -944,6 +944,7 @@ static int print_event(struct nl_msg *ms
+@@ -956,6 +956,7 @@ static int print_event(struct nl_msg *ms
  	}
  
  	switch (gnlh->cmd) {
@@ -8,7 +8,7 @@
  	case NL80211_CMD_NEW_WIPHY:
  		printf("renamed to %s\n", nla_get_string(tb[NL80211_ATTR_WIPHY_NAME]));
  		break;
-@@ -979,6 +980,7 @@ static int print_event(struct nl_msg *ms
+@@ -991,6 +992,7 @@ static int print_event(struct nl_msg *ms
  	case NL80211_CMD_SCHED_SCAN_RESULTS:
  		printf("got scheduled scan results\n");
  		break;
@@ -16,7 +16,7 @@
  	case NL80211_CMD_WIPHY_REG_CHANGE:
  	case NL80211_CMD_REG_CHANGE:
  		if (gnlh->cmd == NL80211_CMD_WIPHY_REG_CHANGE)
-@@ -1061,6 +1063,7 @@ static int print_event(struct nl_msg *ms
+@@ -1073,6 +1075,7 @@ static int print_event(struct nl_msg *ms
  		mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC]));
  		printf("del station %s\n", macbuf);
  		break;
@@ -24,7 +24,7 @@
  	case NL80211_CMD_JOIN_IBSS:
  		mac_addr_n2a(macbuf, nla_data(tb[NL80211_ATTR_MAC]));
  		printf("IBSS %s joined\n", macbuf);
-@@ -1254,9 +1257,9 @@ static int print_event(struct nl_msg *ms
+@@ -1271,9 +1274,9 @@ static int print_event(struct nl_msg *ms
  	case NL80211_CMD_CH_SWITCH_NOTIFY:
  		parse_ch_switch_notify(tb, gnlh->cmd);
  		break;
@@ -134,7 +134,7 @@
  {
 --- a/scan.c
 +++ b/scan.c
-@@ -1297,6 +1297,9 @@ static void print_ht_op(const uint8_t ty
+@@ -1306,6 +1306,9 @@ static void print_ht_op(const uint8_t ty
  	printf("\t\t * secondary channel offset: %s\n",
  		ht_secondary_offset[data[1] & 0x3]);
  	printf("\t\t * STA channel width: %s\n", sta_chan_width[(data[1] & 0x4)>>2]);
@@ -144,7 +144,7 @@
  	printf("\t\t * RIFS: %d\n", (data[1] & 0x8)>>3);
  	printf("\t\t * HT protection: %s\n", protection[data[2] & 0x3]);
  	printf("\t\t * non-GF present: %d\n", (data[2] & 0x4) >> 2);
-@@ -1707,6 +1710,14 @@ static void print_ie(const struct ie_pri
+@@ -1716,6 +1719,14 @@ static void print_ie(const struct ie_pri
  
  static const struct ie_print ieprinters[] = {
  	[0] = { "SSID", print_ssid, 0, 32, BIT(PRINT_SCAN) | BIT(PRINT_LINK), },
@@ -159,7 +159,7 @@
  	[1] = { "Supported rates", print_supprates, 0, 255, BIT(PRINT_SCAN), },
  	[3] = { "DS Parameter set", print_ds, 1, 1, BIT(PRINT_SCAN), },
  	[5] = { "TIM", print_tim, 4, 255, BIT(PRINT_SCAN), },
-@@ -1716,26 +1727,20 @@ static const struct ie_print ieprinters[
+@@ -1725,26 +1736,20 @@ static const struct ie_print ieprinters[
  	[32] = { "Power constraint", print_powerconstraint, 1, 1, BIT(PRINT_SCAN), },
  	[35] = { "TPC report", print_tpcreport, 2, 2, BIT(PRINT_SCAN), },
  	[42] = { "ERP", print_erp, 1, 255, BIT(PRINT_SCAN), },
@@ -187,15 +187,15 @@
  };
  
  static void print_wifi_wpa(const uint8_t type, uint8_t len, const uint8_t *data,
-@@ -2279,6 +2284,7 @@ void print_ies(unsigned char *ie, int ie
+@@ -2326,6 +2331,7 @@ void print_ies(unsigned char *ie, int ie
  		    ieprinters[ie[0]].flags & BIT(ptype)) {
  			print_ie(&ieprinters[ie[0]],
  				 ie[0], ie[1], ie + 2, &ie_buffer);
 +#ifdef IW_FULL
  		} else if (ie[0] == 221 /* vendor */) {
  			print_vendor(ie[1], ie + 2, unknown, ptype);
- 		} else if (unknown) {
-@@ -2288,6 +2294,7 @@ void print_ies(unsigned char *ie, int ie
+ 		} else if (ie[0] == 255 /* extension */) {
+@@ -2337,6 +2343,7 @@ void print_ies(unsigned char *ie, int ie
  			for (i=0; i<ie[1]; i++)
  				printf(" %.2x", ie[2+i]);
  			printf("\n");
@@ -203,7 +203,7 @@
  		}
  		ielen -= ie[1] + 2;
  		ie += ie[1] + 2;
-@@ -2328,6 +2335,7 @@ static void print_capa_non_dmg(__u16 cap
+@@ -2377,6 +2384,7 @@ static void print_capa_non_dmg(__u16 cap
  		printf(" ESS");
  	if (capa & WLAN_CAPABILITY_IBSS)
  		printf(" IBSS");
@@ -211,7 +211,7 @@
  	if (capa & WLAN_CAPABILITY_CF_POLLABLE)
  		printf(" CfPollable");
  	if (capa & WLAN_CAPABILITY_CF_POLL_REQUEST)
-@@ -2356,6 +2364,7 @@ static void print_capa_non_dmg(__u16 cap
+@@ -2405,6 +2413,7 @@ static void print_capa_non_dmg(__u16 cap
  		printf(" DelayedBACK");
  	if (capa & WLAN_CAPABILITY_IMM_BACK)
  		printf(" ImmediateBACK");
@@ -219,7 +219,7 @@
  }
  
  static int print_bss_handler(struct nl_msg *msg, void *arg)
-@@ -2440,8 +2449,10 @@ static int print_bss_handler(struct nl_m
+@@ -2489,8 +2498,10 @@ static int print_bss_handler(struct nl_m
  	if (bss[NL80211_BSS_FREQUENCY]) {
  		int freq = nla_get_u32(bss[NL80211_BSS_FREQUENCY]);
  		printf("\tfreq: %d\n", freq);
@@ -230,7 +230,7 @@
  	}
  	if (bss[NL80211_BSS_BEACON_INTERVAL])
  		printf("\tbeacon interval: %d TUs\n",
-@@ -2635,6 +2646,7 @@ static int handle_stop_sched_scan(struct
+@@ -2684,6 +2695,7 @@ static int handle_stop_sched_scan(struct
  	return 0;
  }
  
@@ -238,7 +238,7 @@
  COMMAND(scan, sched_start,
  	SCHED_SCAN_OPTIONS,
  	NL80211_CMD_START_SCHED_SCAN, 0, CIB_NETDEV, handle_start_sched_scan,
-@@ -2645,3 +2657,4 @@ COMMAND(scan, sched_start,
+@@ -2694,3 +2706,4 @@ COMMAND(scan, sched_start,
  COMMAND(scan, sched_stop, "",
  	NL80211_CMD_STOP_SCHED_SCAN, 0, CIB_NETDEV, handle_stop_sched_scan,
  	"Stop an ongoing scheduled scan.");


From lede-commits at lists.infradead.org  Thu Jun 17 04:27:04 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 17 Jun 2021 07:27:04 -0400
Subject: [openwrt/openwrt]  mac80211: fix minstrel sample time check
In-Reply-To: <162392922177.15680.3507025024661683713@git-01.infra.openwrt.org>
References: <162392922177.15680.3507025024661683713@git-01.infra.openwrt.org>
Message-ID: <mailman.953.1623929229.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/3839a4c7e98529362cffea70661a450fb072b360

commit 3839a4c7e98529362cffea70661a450fb072b360
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Jun 17 12:40:15 2021 +0200

    mac80211: fix minstrel sample time check
    
    We need to skip sampling if the next sample time is after jiffies, not before.
    This patch fixes an issue where in some cases only very little sampling (or none
    at all) is performed, leading to really bad data rates
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...ac80211-minstrel_ht-fix-sample-time-check.patch | 23 ++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch b/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch
new file mode 100644
index 0000000000..787254b4df
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch
@@ -0,0 +1,23 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Thu, 17 Jun 2021 12:05:54 +0200
+Subject: [PATCH] mac80211: minstrel_ht: fix sample time check
+
+We need to skip sampling if the next sample time is after jiffies, not before.
+This patch fixes an issue where in some cases only very little sampling (or none
+at all) is performed, leading to really bad data rates
+
+Fixes: 80d55154b2f8 ("mac80211: minstrel_ht: significantly redesign the rate probing strategy")
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/net/mac80211/rc80211_minstrel_ht.c
++++ b/net/mac80211/rc80211_minstrel_ht.c
+@@ -1498,7 +1498,7 @@ minstrel_ht_get_rate(void *priv, struct
+ 	    (info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO))
+ 		return;
+ 
+-	if (time_is_before_jiffies(mi->sample_time))
++	if (time_is_after_jiffies(mi->sample_time))
+ 		return;
+ 
+ 	mi->sample_time = jiffies + MINSTREL_SAMPLE_INTERVAL;


From lede-commits at lists.infradead.org  Thu Jun 17 04:27:01 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 17 Jun 2021 07:27:01 -0400
Subject: [openwrt/openwrt] mac80211: sync nl80211.h with upstream and
 backport a WPA3 related commit
In-Reply-To: <162392922177.15680.3507025024661683713@git-01.infra.openwrt.org>
References: <162392922177.15680.3507025024661683713@git-01.infra.openwrt.org>
Message-ID: <mailman.954.1623929229.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/05a8bf04ec43ce0f2b7d8e81caae3f00fb545c46

commit 05a8bf04ec43ce0f2b7d8e81caae3f00fb545c46
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed May 26 20:00:14 2021 +0200

    mac80211: sync nl80211.h with upstream and backport a WPA3 related commit
    
    Fixes compatibility issues with the latest hostapd update
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
    (cherry-picked from commit 91abeebd3bd29a98de516e49260d61165096009a)
---
 .../patches/subsys/010-sync-nl80211_h.patch        | 297 +++++++++++++++++++++
 ...-support-immediate-reconnect-request-hint.patch |  22 --
 ...d-support-to-configure-SAE-PWE-value-to-d.patch |  74 +++++
 .../500-mac80211_configure_antenna_gain.patch      |  18 +-
 .../utils/iw/patches/001-nl80211_h_sync.patch      | 279 ++++++++++++++++++-
 5 files changed, 657 insertions(+), 33 deletions(-)

diff --git a/package/kernel/mac80211/patches/subsys/010-sync-nl80211_h.patch b/package/kernel/mac80211/patches/subsys/010-sync-nl80211_h.patch
new file mode 100644
index 0000000000..e1f66ac1c3
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/010-sync-nl80211_h.patch
@@ -0,0 +1,297 @@
+--- a/include/uapi/linux/nl80211.h
++++ b/include/uapi/linux/nl80211.h
+@@ -655,6 +655,9 @@
+  *	When a security association was established on an 802.1X network using
+  *	fast transition, this event should be followed by an
+  *	%NL80211_CMD_PORT_AUTHORIZED event.
++ *	Following a %NL80211_CMD_ROAM event userspace can issue
++ *	%NL80211_CMD_GET_SCAN in order to obtain the scan information for the
++ *	new BSS the card/driver roamed to.
+  * @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify
+  *	userspace that a connection was dropped by the AP or due to other
+  *	reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and
+@@ -757,7 +760,8 @@
+  *	of any other interfaces, and other interfaces will again take
+  *	precedence when they are used.
+  *
+- * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface.
++ * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface
++ *	(no longer supported).
+  *
+  * @NL80211_CMD_SET_MULTICAST_TO_UNICAST: Configure if this AP should perform
+  *	multicast to unicast conversion. When enabled, all multicast packets
+@@ -1177,6 +1181,10 @@
+  *	includes the contents of the frame. %NL80211_ATTR_ACK flag is included
+  *	if the recipient acknowledged the frame.
+  *
++ * @NL80211_CMD_SET_SAR_SPECS: SAR power limitation configuration is
++ *	passed using %NL80211_ATTR_SAR_SPEC. %NL80211_ATTR_WIPHY is used to
++ *	specify the wiphy index to be applied to.
++ *
+  * @NL80211_CMD_MAX: highest used command number
+  * @__NL80211_CMD_AFTER_LAST: internal use
+  */
+@@ -1407,6 +1415,8 @@ enum nl80211_commands {
+ 
+ 	NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS,
+ 
++	NL80211_CMD_SET_SAR_SPECS,
++
+ 	/* add new commands above here */
+ 
+ 	/* used to define NL80211_CMD_MAX below */
+@@ -1750,8 +1760,9 @@ enum nl80211_commands {
+  *	specify just a single bitrate, which is to be used for the beacon.
+  *	The driver must also specify support for this with the extended
+  *	features NL80211_EXT_FEATURE_BEACON_RATE_LEGACY,
+- *	NL80211_EXT_FEATURE_BEACON_RATE_HT and
+- *	NL80211_EXT_FEATURE_BEACON_RATE_VHT.
++ *	NL80211_EXT_FEATURE_BEACON_RATE_HT,
++ *	NL80211_EXT_FEATURE_BEACON_RATE_VHT and
++ *	NL80211_EXT_FEATURE_BEACON_RATE_HE.
+  *
+  * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain
+  *	at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME.
+@@ -1955,8 +1966,15 @@ enum nl80211_commands {
+  * @NL80211_ATTR_PROBE_RESP: Probe Response template data. Contains the entire
+  *	probe-response frame. The DA field in the 802.11 header is zero-ed out,
+  *	to be filled by the FW.
+- * @NL80211_ATTR_DISABLE_HT:  Force HT capable interfaces to disable
+- *      this feature.  Currently, only supported in mac80211 drivers.
++ * @NL80211_ATTR_DISABLE_HT: Force HT capable interfaces to disable
++ *      this feature during association. This is a flag attribute.
++ *	Currently only supported in mac80211 drivers.
++ * @NL80211_ATTR_DISABLE_VHT: Force VHT capable interfaces to disable
++ *      this feature during association. This is a flag attribute.
++ *	Currently only supported in mac80211 drivers.
++ * @NL80211_ATTR_DISABLE_HE: Force HE capable interfaces to disable
++ *      this feature during association. This is a flag attribute.
++ *	Currently only supported in mac80211 drivers.
+  * @NL80211_ATTR_HT_CAPABILITY_MASK: Specify which bits of the
+  *      ATTR_HT_CAPABILITY to which attention should be paid.
+  *      Currently, only mac80211 NICs support this feature.
+@@ -2077,7 +2095,8 @@ enum nl80211_commands {
+  *	until the channel switch event.
+  * @NL80211_ATTR_CH_SWITCH_BLOCK_TX: flag attribute specifying that transmission
+  *	must be blocked on the current channel (before the channel switch
+- *	operation).
++ *	operation). Also included in the channel switch started event if quiet
++ *	was requested by the AP.
+  * @NL80211_ATTR_CSA_IES: Nested set of attributes containing the IE information
+  *	for the time while performing a channel switch.
+  * @NL80211_ATTR_CNTDWN_OFFS_BEACON: An array of offsets (u16) to the channel
+@@ -2527,6 +2546,20 @@ enum nl80211_commands {
+  *	override mask. Used with NL80211_ATTR_S1G_CAPABILITY in
+  *	NL80211_CMD_ASSOCIATE or NL80211_CMD_CONNECT.
+  *
++ * @NL80211_ATTR_SAE_PWE: Indicates the mechanism(s) allowed for SAE PWE
++ *	derivation in WPA3-Personal networks which are using SAE authentication.
++ *	This is a u8 attribute that encapsulates one of the values from
++ *	&enum nl80211_sae_pwe_mechanism.
++ *
++ * @NL80211_ATTR_SAR_SPEC: SAR power limitation specification when
++ *	used with %NL80211_CMD_SET_SAR_SPECS. The message contains fields
++ *	of %nl80211_sar_attrs which specifies the sar type and related
++ *	sar specs. Sar specs contains array of %nl80211_sar_specs_attrs.
++ *
++ * @NL80211_ATTR_RECONNECT_REQUESTED: flag attribute, used with deauth and
++ *	disassoc events to indicate that an immediate reconnect to the AP
++ *	is desired.
++ *
+  * @NUM_NL80211_ATTR: total number of nl80211_attrs available
+  * @NL80211_ATTR_MAX: highest attribute number currently defined
+  * @__NL80211_ATTR_AFTER_LAST: internal use
+@@ -3016,6 +3049,14 @@ enum nl80211_attrs {
+ 	NL80211_ATTR_S1G_CAPABILITY,
+ 	NL80211_ATTR_S1G_CAPABILITY_MASK,
+ 
++	NL80211_ATTR_SAE_PWE,
++
++	NL80211_ATTR_RECONNECT_REQUESTED,
++
++	NL80211_ATTR_SAR_SPEC,
++
++	NL80211_ATTR_DISABLE_HE,
++
+ 	/* add attributes here, update the policy in nl80211.c */
+ 
+ 	__NL80211_ATTR_AFTER_LAST,
+@@ -5896,6 +5937,19 @@ enum nl80211_feature_flags {
+  * @NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP: Driver/device supports
+  *	unsolicited broadcast probe response transmission
+  *
++ * @NL80211_EXT_FEATURE_BEACON_RATE_HE: Driver supports beacon rate
++ *	configuration (AP/mesh) with HE rates.
++ *
++ * @NL80211_EXT_FEATURE_SECURE_LTF: Device supports secure LTF measurement
++ *      exchange protocol.
++ *
++ * @NL80211_EXT_FEATURE_SECURE_RTT: Device supports secure RTT measurement
++ *      exchange protocol.
++ *
++ * @NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE: Device supports management
++ *      frame protection for all management frames exchanged during the
++ *      negotiation and range measurement procedure.
++ *
+  * @NUM_NL80211_EXT_FEATURES: number of extended features.
+  * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
+  */
+@@ -5956,6 +6010,10 @@ enum nl80211_ext_feature_index {
+ 	NL80211_EXT_FEATURE_SAE_OFFLOAD_AP,
+ 	NL80211_EXT_FEATURE_FILS_DISCOVERY,
+ 	NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP,
++	NL80211_EXT_FEATURE_BEACON_RATE_HE,
++	NL80211_EXT_FEATURE_SECURE_LTF,
++	NL80211_EXT_FEATURE_SECURE_RTT,
++	NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE,
+ 
+ 	/* add new features before the definition below */
+ 	NUM_NL80211_EXT_FEATURES,
+@@ -6253,11 +6311,13 @@ struct nl80211_vendor_cmd_info {
+  * @NL80211_TDLS_PEER_HT: TDLS peer is HT capable.
+  * @NL80211_TDLS_PEER_VHT: TDLS peer is VHT capable.
+  * @NL80211_TDLS_PEER_WMM: TDLS peer is WMM capable.
++ * @NL80211_TDLS_PEER_HE: TDLS peer is HE capable.
+  */
+ enum nl80211_tdls_peer_capability {
+ 	NL80211_TDLS_PEER_HT = 1<<0,
+ 	NL80211_TDLS_PEER_VHT = 1<<1,
+ 	NL80211_TDLS_PEER_WMM = 1<<2,
++	NL80211_TDLS_PEER_HE = 1<<3,
+ };
+ 
+ /**
+@@ -6849,6 +6909,9 @@ enum nl80211_peer_measurement_ftm_capa {
+  *      if neither %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED nor
+  *	%NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set, EDCA based
+  *	ranging will be used.
++ * @NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK: negotiate for LMR feedback. Only
++ *	valid if either %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED or
++ *	%NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set.
+  *
+  * @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal
+  * @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number
+@@ -6867,6 +6930,7 @@ enum nl80211_peer_measurement_ftm_req {
+ 	NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC,
+ 	NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED,
+ 	NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED,
++	NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK,
+ 
+ 	/* keep last */
+ 	NUM_NL80211_PMSR_FTM_REQ_ATTR,
+@@ -7124,4 +7188,115 @@ enum nl80211_unsol_bcast_probe_resp_attr
+ 	NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_MAX =
+ 		__NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_LAST - 1
+ };
++
++/**
++ * enum nl80211_sae_pwe_mechanism - The mechanism(s) allowed for SAE PWE
++ *	derivation. Applicable only when WPA3-Personal SAE authentication is
++ *	used.
++ *
++ * @NL80211_SAE_PWE_UNSPECIFIED: not specified, used internally to indicate that
++ *	attribute is not present from userspace.
++ * @NL80211_SAE_PWE_HUNT_AND_PECK: hunting-and-pecking loop only
++ * @NL80211_SAE_PWE_HASH_TO_ELEMENT: hash-to-element only
++ * @NL80211_SAE_PWE_BOTH: both hunting-and-pecking loop and hash-to-element
++ *	can be used.
++ */
++enum nl80211_sae_pwe_mechanism {
++	NL80211_SAE_PWE_UNSPECIFIED,
++	NL80211_SAE_PWE_HUNT_AND_PECK,
++	NL80211_SAE_PWE_HASH_TO_ELEMENT,
++	NL80211_SAE_PWE_BOTH,
++};
++
++/**
++ * enum nl80211_sar_type - type of SAR specs
++ *
++ * @NL80211_SAR_TYPE_POWER: power limitation specified in 0.25dBm unit
++ *
++ */
++enum nl80211_sar_type {
++	NL80211_SAR_TYPE_POWER,
++
++	/* add new type here */
++
++	/* Keep last */
++	NUM_NL80211_SAR_TYPE,
++};
++
++/**
++ * enum nl80211_sar_attrs - Attributes for SAR spec
++ *
++ * @NL80211_SAR_ATTR_TYPE: the SAR type as defined in &enum nl80211_sar_type.
++ *
++ * @NL80211_SAR_ATTR_SPECS: Nested array of SAR power
++ *	limit specifications. Each specification contains a set
++ *	of %nl80211_sar_specs_attrs.
++ *
++ *	For SET operation, it contains array of %NL80211_SAR_ATTR_SPECS_POWER
++ *	and %NL80211_SAR_ATTR_SPECS_RANGE_INDEX.
++ *
++ *	For sar_capa dump, it contains array of
++ *	%NL80211_SAR_ATTR_SPECS_START_FREQ
++ *	and %NL80211_SAR_ATTR_SPECS_END_FREQ.
++ *
++ * @__NL80211_SAR_ATTR_LAST: Internal
++ * @NL80211_SAR_ATTR_MAX: highest sar attribute
++ *
++ * These attributes are used with %NL80211_CMD_SET_SAR_SPEC
++ */
++enum nl80211_sar_attrs {
++	__NL80211_SAR_ATTR_INVALID,
++
++	NL80211_SAR_ATTR_TYPE,
++	NL80211_SAR_ATTR_SPECS,
++
++	__NL80211_SAR_ATTR_LAST,
++	NL80211_SAR_ATTR_MAX = __NL80211_SAR_ATTR_LAST - 1,
++};
++
++/**
++ * enum nl80211_sar_specs_attrs - Attributes for SAR power limit specs
++ *
++ * @NL80211_SAR_ATTR_SPECS_POWER: Required (s32)value to specify the actual
++ *	power limit value in units of 0.25 dBm if type is
++ *	NL80211_SAR_TYPE_POWER. (i.e., a value of 44 represents 11 dBm).
++ *	0 means userspace doesn't have SAR limitation on this associated range.
++ *
++ * @NL80211_SAR_ATTR_SPECS_RANGE_INDEX: Required (u32) value to specify the
++ *	index of exported freq range table and the associated power limitation
++ *	is applied to this range.
++ *
++ *	Userspace isn't required to set all the ranges advertised by WLAN driver,
++ *	and userspace can skip some certain ranges. These skipped ranges don't
++ *	have SAR limitations, and they are same as setting the
++ *	%NL80211_SAR_ATTR_SPECS_POWER to any unreasonable high value because any
++ *	value higher than regulatory allowed value just means SAR power
++ *	limitation is removed, but it's required to set at least one range.
++ *	It's not allowed to set duplicated range in one SET operation.
++ *
++ *	Every SET operation overwrites previous SET operation.
++ *
++ * @NL80211_SAR_ATTR_SPECS_START_FREQ: Required (u32) value to specify the start
++ *	frequency of this range edge when registering SAR capability to wiphy.
++ *	It's not a channel center frequency. The unit is kHz.
++ *
++ * @NL80211_SAR_ATTR_SPECS_END_FREQ: Required (u32) value to specify the end
++ *	frequency of this range edge when registering SAR capability to wiphy.
++ *	It's not a channel center frequency. The unit is kHz.
++ *
++ * @__NL80211_SAR_ATTR_SPECS_LAST: Internal
++ * @NL80211_SAR_ATTR_SPECS_MAX: highest sar specs attribute
++ */
++enum nl80211_sar_specs_attrs {
++	__NL80211_SAR_ATTR_SPECS_INVALID,
++
++	NL80211_SAR_ATTR_SPECS_POWER,
++	NL80211_SAR_ATTR_SPECS_RANGE_INDEX,
++	NL80211_SAR_ATTR_SPECS_START_FREQ,
++	NL80211_SAR_ATTR_SPECS_END_FREQ,
++
++	__NL80211_SAR_ATTR_SPECS_LAST,
++	NL80211_SAR_ATTR_SPECS_MAX = __NL80211_SAR_ATTR_SPECS_LAST - 1,
++};
++
+ #endif /* __LINUX_NL80211_H */
diff --git a/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch b/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch
index 7c442429cf..8fe8723cfe 100644
--- a/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch
+++ b/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch
@@ -31,28 +31,6 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  
  /**
   * cfg80211_rx_unprot_mlme_mgmt - notification of unprotected mlme mgmt frame
---- a/include/uapi/linux/nl80211.h
-+++ b/include/uapi/linux/nl80211.h
-@@ -2527,6 +2527,10 @@ enum nl80211_commands {
-  *	override mask. Used with NL80211_ATTR_S1G_CAPABILITY in
-  *	NL80211_CMD_ASSOCIATE or NL80211_CMD_CONNECT.
-  *
-+ * @NL80211_ATTR_RECONNECT_REQUESTED: flag attribute, used with deauth and
-+ *	disassoc events to indicate that an immediate reconnect to the AP
-+ *	is desired.
-+ *
-  * @NUM_NL80211_ATTR: total number of nl80211_attrs available
-  * @NL80211_ATTR_MAX: highest attribute number currently defined
-  * @__NL80211_ATTR_AFTER_LAST: internal use
-@@ -3016,6 +3020,8 @@ enum nl80211_attrs {
- 	NL80211_ATTR_S1G_CAPABILITY,
- 	NL80211_ATTR_S1G_CAPABILITY_MASK,
- 
-+	NL80211_ATTR_RECONNECT_REQUESTED,
-+
- 	/* add attributes here, update the policy in nl80211.c */
- 
- 	__NL80211_ATTR_AFTER_LAST,
 --- a/net/mac80211/mlme.c
 +++ b/net/mac80211/mlme.c
 @@ -2734,7 +2734,7 @@ static void ieee80211_report_disconnect(
diff --git a/package/kernel/mac80211/patches/subsys/302-cfg80211-Add-support-to-configure-SAE-PWE-value-to-d.patch b/package/kernel/mac80211/patches/subsys/302-cfg80211-Add-support-to-configure-SAE-PWE-value-to-d.patch
new file mode 100644
index 0000000000..acfdae0f5b
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/302-cfg80211-Add-support-to-configure-SAE-PWE-value-to-d.patch
@@ -0,0 +1,74 @@
+From: Rohan Dutta <drohan at codeaurora.org>
+Date: Tue, 27 Oct 2020 12:09:10 +0200
+Subject: [PATCH] cfg80211: Add support to configure SAE PWE value to drivers
+
+Add support to configure SAE PWE preference from userspace to drivers in
+both AP and STA modes. This is needed for cases where the driver takes
+care of Authentication frame processing (SME in the driver) so that
+correct enforcement of the acceptable PWE derivation mechanism can be
+performed.
+
+The userspace applications can pass the sae_pwe value using the
+NL80211_ATTR_SAE_PWE attribute in the NL80211_CMD_CONNECT and
+NL80211_CMD_START_AP commands to the driver. This allows selection
+between the hunting-and-pecking loop and hash-to-element options for PWE
+derivation. For backwards compatibility, this new attribute is optional
+and if not included, the driver is notified of the value being
+unspecified.
+
+Signed-off-by: Rohan Dutta <drohan at codeaurora.org>
+Signed-off-by: Jouni Malinen <jouni at codeaurora.org>
+Link: https://lore.kernel.org/r/20201027100910.22283-1-jouni at codeaurora.org
+Signed-off-by: Johannes Berg <johannes.berg at intel.com>
+---
+
+--- a/include/net/cfg80211.h
++++ b/include/net/cfg80211.h
+@@ -1009,6 +1009,14 @@ struct survey_info {
+  * @sae_pwd: password for SAE authentication (for devices supporting SAE
+  *	offload)
+  * @sae_pwd_len: length of SAE password (for devices supporting SAE offload)
++ * @sae_pwe: The mechanisms allowed for SAE PWE derivation
++ *	NL80211_SAE_PWE_UNSPECIFIED: Not-specified, used to indicate userspace
++ *		did not specify any preference. The driver should follow its
++ *		internal policy in such a scenario.
++ *	NL80211_SAE_PWE_HUNT_AND_PECK: Allow hunting-and-pecking loop only
++ *	NL80211_SAE_PWE_HASH_TO_ELEMENT: Allow hash-to-element only
++ *	NL80211_SAE_PWE_BOTH: Allow either hunting-and-pecking loop
++ *		or hash-to-element
+  */
+ struct cfg80211_crypto_settings {
+ 	u32 wpa_versions;
+@@ -1027,6 +1035,7 @@ struct cfg80211_crypto_settings {
+ 	const u8 *psk;
+ 	const u8 *sae_pwd;
+ 	u8 sae_pwd_len;
++	enum nl80211_sae_pwe_mechanism sae_pwe;
+ };
+ 
+ /**
+--- a/net/wireless/nl80211.c
++++ b/net/wireless/nl80211.c
+@@ -736,6 +736,9 @@ static const struct nla_policy nl80211_p
+ 		NLA_POLICY_EXACT_LEN(IEEE80211_S1G_CAPABILITY_LEN),
+ 	[NL80211_ATTR_S1G_CAPABILITY_MASK] =
+ 		NLA_POLICY_EXACT_LEN(IEEE80211_S1G_CAPABILITY_LEN),
++	[NL80211_ATTR_SAE_PWE] =
++		NLA_POLICY_RANGE(NLA_U8, NL80211_SAE_PWE_HUNT_AND_PECK,
++				 NL80211_SAE_PWE_BOTH),
+ 	[NL80211_ATTR_RECONNECT_REQUESTED] = { .type = NLA_REJECT },
+ };
+ 
+@@ -9764,6 +9767,12 @@ static int nl80211_crypto_settings(struc
+ 			nla_len(info->attrs[NL80211_ATTR_SAE_PASSWORD]);
+ 	}
+ 
++	if (info->attrs[NL80211_ATTR_SAE_PWE])
++		settings->sae_pwe =
++			nla_get_u8(info->attrs[NL80211_ATTR_SAE_PWE]);
++	else
++		settings->sae_pwe = NL80211_SAE_PWE_UNSPECIFIED;
++
+ 	return 0;
+ }
+ 
diff --git a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch
index eb967f77d7..febe42eb9d 100644
--- a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch
+++ b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch
@@ -1,6 +1,6 @@
 --- a/include/net/cfg80211.h
 +++ b/include/net/cfg80211.h
-@@ -3736,6 +3736,7 @@ struct mgmt_frame_regs {
+@@ -3745,6 +3745,7 @@ struct mgmt_frame_regs {
   *	(as advertised by the nl80211 feature flag.)
   * @get_tx_power: store the current TX power into the dbm variable;
   *	return 0 if successful
@@ -8,7 +8,7 @@
   *
   * @set_wds_peer: set the WDS peer for a WDS interface
   *
-@@ -4058,6 +4059,7 @@ struct cfg80211_ops {
+@@ -4067,6 +4068,7 @@ struct cfg80211_ops {
  				enum nl80211_tx_power_setting type, int mbm);
  	int	(*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev,
  				int *dbm);
@@ -36,7 +36,7 @@
  	u8 ps_dtim_period;
 --- a/include/uapi/linux/nl80211.h
 +++ b/include/uapi/linux/nl80211.h
-@@ -2531,6 +2531,9 @@ enum nl80211_commands {
+@@ -2560,6 +2560,9 @@ enum nl80211_commands {
   *	disassoc events to indicate that an immediate reconnect to the AP
   *	is desired.
   *
@@ -46,9 +46,9 @@
   * @NUM_NL80211_ATTR: total number of nl80211_attrs available
   * @NL80211_ATTR_MAX: highest attribute number currently defined
   * @__NL80211_ATTR_AFTER_LAST: internal use
-@@ -3022,6 +3025,8 @@ enum nl80211_attrs {
+@@ -3057,6 +3060,8 @@ enum nl80211_attrs {
  
- 	NL80211_ATTR_RECONNECT_REQUESTED,
+ 	NL80211_ATTR_DISABLE_HE,
  
 +	NL80211_ATTR_WIPHY_ANTENNA_GAIN,
 +
@@ -129,15 +129,15 @@
  	local->hw.max_mtu = IEEE80211_MAX_DATA_LEN;
 --- a/net/wireless/nl80211.c
 +++ b/net/wireless/nl80211.c
-@@ -737,6 +737,7 @@ static const struct nla_policy nl80211_p
- 	[NL80211_ATTR_S1G_CAPABILITY_MASK] =
- 		NLA_POLICY_EXACT_LEN(IEEE80211_S1G_CAPABILITY_LEN),
+@@ -740,6 +740,7 @@ static const struct nla_policy nl80211_p
+ 		NLA_POLICY_RANGE(NLA_U8, NL80211_SAE_PWE_HUNT_AND_PECK,
+ 				 NL80211_SAE_PWE_BOTH),
  	[NL80211_ATTR_RECONNECT_REQUESTED] = { .type = NLA_REJECT },
 +	[NL80211_ATTR_WIPHY_ANTENNA_GAIN] = { .type = NLA_U32 },
  };
  
  /* policy for the key attributes */
-@@ -3245,6 +3246,20 @@ static int nl80211_set_wiphy(struct sk_b
+@@ -3248,6 +3249,20 @@ static int nl80211_set_wiphy(struct sk_b
  		if (result)
  			return result;
  	}
diff --git a/package/network/utils/iw/patches/001-nl80211_h_sync.patch b/package/network/utils/iw/patches/001-nl80211_h_sync.patch
index 5aa3cd5146..1d6ea0fae0 100644
--- a/package/network/utils/iw/patches/001-nl80211_h_sync.patch
+++ b/package/network/utils/iw/patches/001-nl80211_h_sync.patch
@@ -1,9 +1,99 @@
 --- a/nl80211.h
 +++ b/nl80211.h
-@@ -2527,6 +2527,13 @@ enum nl80211_commands {
+@@ -655,6 +655,9 @@
+  *	When a security association was established on an 802.1X network using
+  *	fast transition, this event should be followed by an
+  *	%NL80211_CMD_PORT_AUTHORIZED event.
++ *	Following a %NL80211_CMD_ROAM event userspace can issue
++ *	%NL80211_CMD_GET_SCAN in order to obtain the scan information for the
++ *	new BSS the card/driver roamed to.
+  * @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify
+  *	userspace that a connection was dropped by the AP or due to other
+  *	reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and
+@@ -757,7 +760,8 @@
+  *	of any other interfaces, and other interfaces will again take
+  *	precedence when they are used.
+  *
+- * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface.
++ * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface
++ *	(no longer supported).
+  *
+  * @NL80211_CMD_SET_MULTICAST_TO_UNICAST: Configure if this AP should perform
+  *	multicast to unicast conversion. When enabled, all multicast packets
+@@ -1177,6 +1181,10 @@
+  *	includes the contents of the frame. %NL80211_ATTR_ACK flag is included
+  *	if the recipient acknowledged the frame.
+  *
++ * @NL80211_CMD_SET_SAR_SPECS: SAR power limitation configuration is
++ *	passed using %NL80211_ATTR_SAR_SPEC. %NL80211_ATTR_WIPHY is used to
++ *	specify the wiphy index to be applied to.
++ *
+  * @NL80211_CMD_MAX: highest used command number
+  * @__NL80211_CMD_AFTER_LAST: internal use
+  */
+@@ -1407,6 +1415,8 @@ enum nl80211_commands {
+ 
+ 	NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS,
+ 
++	NL80211_CMD_SET_SAR_SPECS,
++
+ 	/* add new commands above here */
+ 
+ 	/* used to define NL80211_CMD_MAX below */
+@@ -1750,8 +1760,9 @@ enum nl80211_commands {
+  *	specify just a single bitrate, which is to be used for the beacon.
+  *	The driver must also specify support for this with the extended
+  *	features NL80211_EXT_FEATURE_BEACON_RATE_LEGACY,
+- *	NL80211_EXT_FEATURE_BEACON_RATE_HT and
+- *	NL80211_EXT_FEATURE_BEACON_RATE_VHT.
++ *	NL80211_EXT_FEATURE_BEACON_RATE_HT,
++ *	NL80211_EXT_FEATURE_BEACON_RATE_VHT and
++ *	NL80211_EXT_FEATURE_BEACON_RATE_HE.
+  *
+  * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain
+  *	at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME.
+@@ -1955,8 +1966,15 @@ enum nl80211_commands {
+  * @NL80211_ATTR_PROBE_RESP: Probe Response template data. Contains the entire
+  *	probe-response frame. The DA field in the 802.11 header is zero-ed out,
+  *	to be filled by the FW.
+- * @NL80211_ATTR_DISABLE_HT:  Force HT capable interfaces to disable
+- *      this feature.  Currently, only supported in mac80211 drivers.
++ * @NL80211_ATTR_DISABLE_HT: Force HT capable interfaces to disable
++ *      this feature during association. This is a flag attribute.
++ *	Currently only supported in mac80211 drivers.
++ * @NL80211_ATTR_DISABLE_VHT: Force VHT capable interfaces to disable
++ *      this feature during association. This is a flag attribute.
++ *	Currently only supported in mac80211 drivers.
++ * @NL80211_ATTR_DISABLE_HE: Force HE capable interfaces to disable
++ *      this feature during association. This is a flag attribute.
++ *	Currently only supported in mac80211 drivers.
+  * @NL80211_ATTR_HT_CAPABILITY_MASK: Specify which bits of the
+  *      ATTR_HT_CAPABILITY to which attention should be paid.
+  *      Currently, only mac80211 NICs support this feature.
+@@ -2077,7 +2095,8 @@ enum nl80211_commands {
+  *	until the channel switch event.
+  * @NL80211_ATTR_CH_SWITCH_BLOCK_TX: flag attribute specifying that transmission
+  *	must be blocked on the current channel (before the channel switch
+- *	operation).
++ *	operation). Also included in the channel switch started event if quiet
++ *	was requested by the AP.
+  * @NL80211_ATTR_CSA_IES: Nested set of attributes containing the IE information
+  *	for the time while performing a channel switch.
+  * @NL80211_ATTR_CNTDWN_OFFS_BEACON: An array of offsets (u16) to the channel
+@@ -2527,6 +2546,23 @@ enum nl80211_commands {
   *	override mask. Used with NL80211_ATTR_S1G_CAPABILITY in
   *	NL80211_CMD_ASSOCIATE or NL80211_CMD_CONNECT.
   *
++ * @NL80211_ATTR_SAE_PWE: Indicates the mechanism(s) allowed for SAE PWE
++ *	derivation in WPA3-Personal networks which are using SAE authentication.
++ *	This is a u8 attribute that encapsulates one of the values from
++ *	&enum nl80211_sae_pwe_mechanism.
++ *
++ * @NL80211_ATTR_SAR_SPEC: SAR power limitation specification when
++ *	used with %NL80211_CMD_SET_SAR_SPECS. The message contains fields
++ *	of %nl80211_sar_attrs which specifies the sar type and related
++ *	sar specs. Sar specs contains array of %nl80211_sar_specs_attrs.
++ *
 + * @NL80211_ATTR_RECONNECT_REQUESTED: flag attribute, used with deauth and
 + *	disassoc events to indicate that an immediate reconnect to the AP
 + *	is desired.
@@ -14,14 +104,199 @@
   * @NUM_NL80211_ATTR: total number of nl80211_attrs available
   * @NL80211_ATTR_MAX: highest attribute number currently defined
   * @__NL80211_ATTR_AFTER_LAST: internal use
-@@ -3016,6 +3023,10 @@ enum nl80211_attrs {
+@@ -3016,6 +3052,16 @@ enum nl80211_attrs {
  	NL80211_ATTR_S1G_CAPABILITY,
  	NL80211_ATTR_S1G_CAPABILITY_MASK,
  
++	NL80211_ATTR_SAE_PWE,
++
 +	NL80211_ATTR_RECONNECT_REQUESTED,
 +
++	NL80211_ATTR_SAR_SPEC,
++
++	NL80211_ATTR_DISABLE_HE,
++
 +	NL80211_ATTR_WIPHY_ANTENNA_GAIN,
 +
  	/* add attributes here, update the policy in nl80211.c */
  
  	__NL80211_ATTR_AFTER_LAST,
+@@ -5896,6 +5942,19 @@ enum nl80211_feature_flags {
+  * @NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP: Driver/device supports
+  *	unsolicited broadcast probe response transmission
+  *
++ * @NL80211_EXT_FEATURE_BEACON_RATE_HE: Driver supports beacon rate
++ *	configuration (AP/mesh) with HE rates.
++ *
++ * @NL80211_EXT_FEATURE_SECURE_LTF: Device supports secure LTF measurement
++ *      exchange protocol.
++ *
++ * @NL80211_EXT_FEATURE_SECURE_RTT: Device supports secure RTT measurement
++ *      exchange protocol.
++ *
++ * @NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE: Device supports management
++ *      frame protection for all management frames exchanged during the
++ *      negotiation and range measurement procedure.
++ *
+  * @NUM_NL80211_EXT_FEATURES: number of extended features.
+  * @MAX_NL80211_EXT_FEATURES: highest extended feature index.
+  */
+@@ -5956,6 +6015,10 @@ enum nl80211_ext_feature_index {
+ 	NL80211_EXT_FEATURE_SAE_OFFLOAD_AP,
+ 	NL80211_EXT_FEATURE_FILS_DISCOVERY,
+ 	NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP,
++	NL80211_EXT_FEATURE_BEACON_RATE_HE,
++	NL80211_EXT_FEATURE_SECURE_LTF,
++	NL80211_EXT_FEATURE_SECURE_RTT,
++	NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE,
+ 
+ 	/* add new features before the definition below */
+ 	NUM_NL80211_EXT_FEATURES,
+@@ -6253,11 +6316,13 @@ struct nl80211_vendor_cmd_info {
+  * @NL80211_TDLS_PEER_HT: TDLS peer is HT capable.
+  * @NL80211_TDLS_PEER_VHT: TDLS peer is VHT capable.
+  * @NL80211_TDLS_PEER_WMM: TDLS peer is WMM capable.
++ * @NL80211_TDLS_PEER_HE: TDLS peer is HE capable.
+  */
+ enum nl80211_tdls_peer_capability {
+ 	NL80211_TDLS_PEER_HT = 1<<0,
+ 	NL80211_TDLS_PEER_VHT = 1<<1,
+ 	NL80211_TDLS_PEER_WMM = 1<<2,
++	NL80211_TDLS_PEER_HE = 1<<3,
+ };
+ 
+ /**
+@@ -6849,6 +6914,9 @@ enum nl80211_peer_measurement_ftm_capa {
+  *      if neither %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED nor
+  *	%NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set, EDCA based
+  *	ranging will be used.
++ * @NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK: negotiate for LMR feedback. Only
++ *	valid if either %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED or
++ *	%NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set.
+  *
+  * @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal
+  * @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number
+@@ -6867,6 +6935,7 @@ enum nl80211_peer_measurement_ftm_req {
+ 	NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC,
+ 	NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED,
+ 	NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED,
++	NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK,
+ 
+ 	/* keep last */
+ 	NUM_NL80211_PMSR_FTM_REQ_ATTR,
+@@ -7124,4 +7193,115 @@ enum nl80211_unsol_bcast_probe_resp_attr
+ 	NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_MAX =
+ 		__NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_LAST - 1
+ };
++
++/**
++ * enum nl80211_sae_pwe_mechanism - The mechanism(s) allowed for SAE PWE
++ *	derivation. Applicable only when WPA3-Personal SAE authentication is
++ *	used.
++ *
++ * @NL80211_SAE_PWE_UNSPECIFIED: not specified, used internally to indicate that
++ *	attribute is not present from userspace.
++ * @NL80211_SAE_PWE_HUNT_AND_PECK: hunting-and-pecking loop only
++ * @NL80211_SAE_PWE_HASH_TO_ELEMENT: hash-to-element only
++ * @NL80211_SAE_PWE_BOTH: both hunting-and-pecking loop and hash-to-element
++ *	can be used.
++ */
++enum nl80211_sae_pwe_mechanism {
++	NL80211_SAE_PWE_UNSPECIFIED,
++	NL80211_SAE_PWE_HUNT_AND_PECK,
++	NL80211_SAE_PWE_HASH_TO_ELEMENT,
++	NL80211_SAE_PWE_BOTH,
++};
++
++/**
++ * enum nl80211_sar_type - type of SAR specs
++ *
++ * @NL80211_SAR_TYPE_POWER: power limitation specified in 0.25dBm unit
++ *
++ */
++enum nl80211_sar_type {
++	NL80211_SAR_TYPE_POWER,
++
++	/* add new type here */
++
++	/* Keep last */
++	NUM_NL80211_SAR_TYPE,
++};
++
++/**
++ * enum nl80211_sar_attrs - Attributes for SAR spec
++ *
++ * @NL80211_SAR_ATTR_TYPE: the SAR type as defined in &enum nl80211_sar_type.
++ *
++ * @NL80211_SAR_ATTR_SPECS: Nested array of SAR power
++ *	limit specifications. Each specification contains a set
++ *	of %nl80211_sar_specs_attrs.
++ *
++ *	For SET operation, it contains array of %NL80211_SAR_ATTR_SPECS_POWER
++ *	and %NL80211_SAR_ATTR_SPECS_RANGE_INDEX.
++ *
++ *	For sar_capa dump, it contains array of
++ *	%NL80211_SAR_ATTR_SPECS_START_FREQ
++ *	and %NL80211_SAR_ATTR_SPECS_END_FREQ.
++ *
++ * @__NL80211_SAR_ATTR_LAST: Internal
++ * @NL80211_SAR_ATTR_MAX: highest sar attribute
++ *
++ * These attributes are used with %NL80211_CMD_SET_SAR_SPEC
++ */
++enum nl80211_sar_attrs {
++	__NL80211_SAR_ATTR_INVALID,
++
++	NL80211_SAR_ATTR_TYPE,
++	NL80211_SAR_ATTR_SPECS,
++
++	__NL80211_SAR_ATTR_LAST,
++	NL80211_SAR_ATTR_MAX = __NL80211_SAR_ATTR_LAST - 1,
++};
++
++/**
++ * enum nl80211_sar_specs_attrs - Attributes for SAR power limit specs
++ *
++ * @NL80211_SAR_ATTR_SPECS_POWER: Required (s32)value to specify the actual
++ *	power limit value in units of 0.25 dBm if type is
++ *	NL80211_SAR_TYPE_POWER. (i.e., a value of 44 represents 11 dBm).
++ *	0 means userspace doesn't have SAR limitation on this associated range.
++ *
++ * @NL80211_SAR_ATTR_SPECS_RANGE_INDEX: Required (u32) value to specify the
++ *	index of exported freq range table and the associated power limitation
++ *	is applied to this range.
++ *
++ *	Userspace isn't required to set all the ranges advertised by WLAN driver,
++ *	and userspace can skip some certain ranges. These skipped ranges don't
++ *	have SAR limitations, and they are same as setting the
++ *	%NL80211_SAR_ATTR_SPECS_POWER to any unreasonable high value because any
++ *	value higher than regulatory allowed value just means SAR power
++ *	limitation is removed, but it's required to set at least one range.
++ *	It's not allowed to set duplicated range in one SET operation.
++ *
++ *	Every SET operation overwrites previous SET operation.
++ *
++ * @NL80211_SAR_ATTR_SPECS_START_FREQ: Required (u32) value to specify the start
++ *	frequency of this range edge when registering SAR capability to wiphy.
++ *	It's not a channel center frequency. The unit is kHz.
++ *
++ * @NL80211_SAR_ATTR_SPECS_END_FREQ: Required (u32) value to specify the end
++ *	frequency of this range edge when registering SAR capability to wiphy.
++ *	It's not a channel center frequency. The unit is kHz.
++ *
++ * @__NL80211_SAR_ATTR_SPECS_LAST: Internal
++ * @NL80211_SAR_ATTR_SPECS_MAX: highest sar specs attribute
++ */
++enum nl80211_sar_specs_attrs {
++	__NL80211_SAR_ATTR_SPECS_INVALID,
++
++	NL80211_SAR_ATTR_SPECS_POWER,
++	NL80211_SAR_ATTR_SPECS_RANGE_INDEX,
++	NL80211_SAR_ATTR_SPECS_START_FREQ,
++	NL80211_SAR_ATTR_SPECS_END_FREQ,
++
++	__NL80211_SAR_ATTR_SPECS_LAST,
++	NL80211_SAR_ATTR_SPECS_MAX = __NL80211_SAR_ATTR_SPECS_LAST - 1,
++};
++
+ #endif /* __LINUX_NL80211_H */


From lede-commits at lists.infradead.org  Thu Jun 17 09:25:44 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 17 Jun 2021 12:25:44 -0400
Subject: [openwrt/openwrt] mac80211: system hang caused by deferring calls
 into minstrel to dequeue
In-Reply-To: <162394714480.28963.7146455076588538928@git-01.infra.openwrt.org>
References: <162394714480.28963.7146455076588538928@git-01.infra.openwrt.org>
Message-ID: <mailman.1023.1623947149.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/a603e82dd342680d584c4eb5f1b222e056379890

commit a603e82dd342680d584c4eb5f1b222e056379890
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Jun 17 18:10:36 2021 +0200

    mac80211: system hang caused by deferring calls into minstrel to dequeue
    
    Move the aggregation check to mac80211
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...ve-A-MPDU-session-check-from-minstrel_ht-.patch | 126 +++++++++++++++++++++
 ...ll-ieee80211_tx_h_rate_ctrl-when-dequeue.patch} |   0
 ...nstrel_ht-fix-minstrel_aggr_check-for-enc.patch |  39 -------
 ...ac80211-minstrel_ht-fix-sample-time-check.patch |   2 +-
 4 files changed, 127 insertions(+), 40 deletions(-)

diff --git a/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch b/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch
new file mode 100644
index 0000000000..4e3242e6a9
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch
@@ -0,0 +1,126 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Thu, 17 Jun 2021 17:56:54 +0200
+Subject: [PATCH] mac80211: move A-MPDU session check from minstrel_ht to
+ mac80211
+
+This avoids calling back into tx handlers from within the rate control module.
+Preparation for deferring rate control until tx dequeue
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/include/net/mac80211.h
++++ b/include/net/mac80211.h
+@@ -6160,6 +6160,11 @@ enum rate_control_capabilities {
+ 	 * otherwise the NSS difference doesn't bother us.
+ 	 */
+ 	RATE_CTRL_CAPA_VHT_EXT_NSS_BW = BIT(0),
++	/**
++	 * @RATE_CTRL_CAPA_AMPDU_TRIGGER:
++	 * mac80211 should start A-MPDU sessions on tx
++	 */
++	RATE_CTRL_CAPA_AMPDU_TRIGGER = BIT(1),
+ };
+ 
+ struct rate_control_ops {
+--- a/net/mac80211/rc80211_minstrel_ht.c
++++ b/net/mac80211/rc80211_minstrel_ht.c
+@@ -1153,29 +1153,6 @@ minstrel_downgrade_prob_rate(struct mins
+ }
+ 
+ static void
+-minstrel_aggr_check(struct ieee80211_sta *pubsta, struct sk_buff *skb)
+-{
+-	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
+-	struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
+-	u16 tid;
+-
+-	if (skb_get_queue_mapping(skb) == IEEE80211_AC_VO)
+-		return;
+-
+-	if (unlikely(!ieee80211_is_data_qos(hdr->frame_control)))
+-		return;
+-
+-	if (unlikely(skb->protocol == cpu_to_be16(ETH_P_PAE)))
+-		return;
+-
+-	tid = ieee80211_get_tid(hdr);
+-	if (likely(sta->ampdu_mlme.tid_tx[tid]))
+-		return;
+-
+-	ieee80211_start_tx_ba_session(pubsta, tid, 0);
+-}
+-
+-static void
+ minstrel_ht_tx_status(void *priv, struct ieee80211_supported_band *sband,
+                       void *priv_sta, struct ieee80211_tx_status *st)
+ {
+@@ -1477,10 +1454,6 @@ minstrel_ht_get_rate(void *priv, struct
+ 	struct minstrel_priv *mp = priv;
+ 	u16 sample_idx;
+ 
+-	if (!(info->flags & IEEE80211_TX_CTL_AMPDU) &&
+-	    !minstrel_ht_is_legacy_group(MI_RATE_GROUP(mi->max_prob_rate)))
+-		minstrel_aggr_check(sta, txrc->skb);
+-
+ 	info->flags |= mi->tx_flags;
+ 
+ #ifdef CPTCFG_MAC80211_DEBUGFS
+@@ -1894,6 +1867,7 @@ static u32 minstrel_ht_get_expected_thro
+ 
+ static const struct rate_control_ops mac80211_minstrel_ht = {
+ 	.name = "minstrel_ht",
++	.capa = RATE_CTRL_CAPA_AMPDU_TRIGGER,
+ 	.tx_status_ext = minstrel_ht_tx_status,
+ 	.get_rate = minstrel_ht_get_rate,
+ 	.rate_init = minstrel_ht_rate_init,
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -3933,6 +3933,29 @@ void ieee80211_txq_schedule_start(struct
+ }
+ EXPORT_SYMBOL(ieee80211_txq_schedule_start);
+ 
++static void
++ieee80211_aggr_check(struct ieee80211_sub_if_data *sdata,
++		     struct sta_info *sta,
++		     struct sk_buff *skb)
++{
++	struct rate_control_ref *ref = sdata->local->rate_ctrl;
++	u16 tid;
++
++	if (!ref || !(ref->ops->capa & RATE_CTRL_CAPA_AMPDU_TRIGGER))
++		return;
++
++	if (!sta || !sta->sta.ht_cap.ht_supported ||
++	    !sta->sta.wme || skb_get_queue_mapping(skb) == IEEE80211_AC_VO ||
++	    skb->protocol == sdata->control_port_protocol)
++		return;
++
++	tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
++	if (likely(sta->ampdu_mlme.tid_tx[tid]))
++		return;
++
++	ieee80211_start_tx_ba_session(&sta->sta, tid, 0);
++}
++
+ void __ieee80211_subif_start_xmit(struct sk_buff *skb,
+ 				  struct net_device *dev,
+ 				  u32 info_flags,
+@@ -3963,6 +3986,8 @@ void __ieee80211_subif_start_xmit(struct
+ 		skb_get_hash(skb);
+ 	}
+ 
++	ieee80211_aggr_check(sdata, sta, skb);
++
+ 	if (sta) {
+ 		struct ieee80211_fast_tx *fast_tx;
+ 
+@@ -4226,6 +4251,8 @@ static void ieee80211_8023_xmit(struct i
+ 
+ 	memset(info, 0, sizeof(*info));
+ 
++	ieee80211_aggr_check(sdata, sta, skb);
++
+ 	tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
+ 	tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]);
+ 	if (tid_tx) {
diff --git a/package/kernel/mac80211/patches/subsys/374-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch b/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch
similarity index 100%
rename from package/kernel/mac80211/patches/subsys/374-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch
rename to package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch
diff --git a/package/kernel/mac80211/patches/subsys/375-mac80211-minstrel_ht-fix-minstrel_aggr_check-for-enc.patch b/package/kernel/mac80211/patches/subsys/375-mac80211-minstrel_ht-fix-minstrel_aggr_check-for-enc.patch
deleted file mode 100644
index 2fe19dfd94..0000000000
--- a/package/kernel/mac80211/patches/subsys/375-mac80211-minstrel_ht-fix-minstrel_aggr_check-for-enc.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From: Ryder Lee <ryder.lee at mediatek.com>
-Date: Fri, 28 May 2021 14:05:42 +0800
-Subject: [PATCH] mac80211: minstrel_ht: fix minstrel_aggr_check for encap
- offload
-
-Avoid checking ieee80211_hdr to support encap offload.
-
-Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
----
-
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -1156,19 +1156,24 @@ static void
- minstrel_aggr_check(struct ieee80211_sta *pubsta, struct sk_buff *skb)
- {
- 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
-+	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
- 	struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
- 	u16 tid;
- 
- 	if (skb_get_queue_mapping(skb) == IEEE80211_AC_VO)
- 		return;
- 
--	if (unlikely(!ieee80211_is_data_qos(hdr->frame_control)))
-+	if (unlikely(!pubsta->wme))
-+		return;
-+
-+	if (!(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) &&
-+	    unlikely(!ieee80211_is_data_qos(hdr->frame_control)))
- 		return;
- 
- 	if (unlikely(skb->protocol == cpu_to_be16(ETH_P_PAE)))
- 		return;
- 
--	tid = ieee80211_get_tid(hdr);
-+	tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
- 	if (likely(sta->ampdu_mlme.tid_tx[tid]))
- 		return;
- 
diff --git a/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch b/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch
index 787254b4df..d4b327c69c 100644
--- a/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch
+++ b/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch
@@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/net/mac80211/rc80211_minstrel_ht.c
 +++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -1498,7 +1498,7 @@ minstrel_ht_get_rate(void *priv, struct
+@@ -1466,7 +1466,7 @@ minstrel_ht_get_rate(void *priv, struct
  	    (info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO))
  		return;
  


From lede-commits at lists.infradead.org  Thu Jun 17 23:48:40 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 18 Jun 2021 02:48:40 -0400
Subject: [openwrt/openwrt] ath79: use dynamic partitioning for TP-Link CPE
 series
In-Reply-To: <162399892058.15702.17919651708506792324@git-01.infra.openwrt.org>
References: <162399892058.15702.17919651708506792324@git-01.infra.openwrt.org>
Message-ID: <mailman.1150.1623998926.1072.lede-commits@lists.infradead.org>

zorun pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/7a4bd9cc518933d61099f109ce050c03afdc1c83

commit 7a4bd9cc518933d61099f109ce050c03afdc1c83
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Tue May 4 23:32:00 2021 -0400

    ath79: use dynamic partitioning for TP-Link CPE series
    
    CPExxx and WBSxxx boards with AR9344 SOC
    use the OKLI lzma kernel loader
    with the offset of 3 blocks of length 4k (0x3000)
    in order to have a fake "kernel" that cannot grow larger
    than how it is defined in the now static OEM partition table.
    
    Before recent changes to the mtdsplit driver,
    the uImage parser for OKLI only supported images
    that started exactly on an eraseblock boundary.
    
    The mtdsplit parser for uImage now supports identifying images
    with any magic number value
    and at any offset from the eraseblock boundary
    using DTS properties to define those values.
    
    So, it is no longer necessary to use fixed sizes
    for kernel and rootfs
    
    Tested-by: Andrew Cameron <apcameron at softhome.net>  [CPE510 v2]
    Tested-by: Bernhard Geier <freifunk at geierb.de>      [WBS210 v2]
    Tested-by: Petrov <d7c48mWsPKx67w2 at gmail.com>       [CPE210 v1]
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
    (cherry picked from commit 7b9a0c264cb9dc2c5a946a0aa9a290427a5e559c)
---
 target/linux/ath79/dts/ar9344_tplink_cpe.dtsi | 18 ++++-----------
 tools/firmware-utils/src/tplink-safeloader.c  | 33 +++++++++------------------
 2 files changed, 15 insertions(+), 36 deletions(-)

diff --git a/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi
index d4b7de440a..fd6aa0f08b 100644
--- a/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi
+++ b/target/linux/ath79/dts/ar9344_tplink_cpe.dtsi
@@ -4,6 +4,7 @@
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
+#include <dt-bindings/mtd/partitions/uimage.h>
 
 / {
 	aliases {
@@ -59,20 +60,9 @@
 			partition at 40000 {
 				label = "firmware";
 				reg = <0x040000 0x780000>;
-
-				compatible = "fixed-partitions";
-				#address-cells = <1>;
-				#size-cells = <1>;
-
-				partition at 0 {
-					label = "kernel";
-					reg = <0x000000 0x300000>;
-				};
-
-				partition at 300000 {
-					label = "rootfs";
-					reg = <0x300000 0x480000>;
-				};
+				compatible = "openwrt,uimage", "denx,uimage";
+				openwrt,ih-magic = <IH_MAGIC_OKLI>;
+				openwrt,offset = <0x3000>;
 			};
 
 			partition at 7c0000 {
diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c
index d586b9cbd8..70e21f99cb 100644
--- a/tools/firmware-utils/src/tplink-safeloader.c
+++ b/tools/firmware-utils/src/tplink-safeloader.c
@@ -154,8 +154,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},
@@ -277,8 +276,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},
@@ -356,8 +354,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},
@@ -398,8 +395,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},
@@ -443,8 +439,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},
@@ -483,8 +478,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},
@@ -523,8 +517,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},
@@ -555,8 +548,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},
@@ -587,8 +579,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},
@@ -620,8 +611,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},
@@ -653,8 +643,7 @@ static struct device_info boards[] = {
 			{"default-mac", 0x30000, 0x00020},
 			{"product-info", 0x31100, 0x00100},
 			{"signature", 0x32000, 0x00400},
-			{"os-image", 0x40000, 0x300000},
-			{"file-system", 0x340000, 0x470000},
+			{"firmware", 0x40000, 0x770000},
 			{"soft-version", 0x7b0000, 0x00100},
 			{"support-list", 0x7b1000, 0x00400},
 			{"user-config", 0x7c0000, 0x10000},


From lede-commits at lists.infradead.org  Fri Jun 18 00:52:59 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 18 Jun 2021 03:52:59 -0400
Subject: [openwrt/openwrt] kernel: make cryptoapi support needed by mac80211
 built-in
In-Reply-To: <162400277889.31334.18262287281048585963@git-01.infra.openwrt.org>
References: <162400277889.31334.18262287281048585963@git-01.infra.openwrt.org>
Message-ID: <mailman.1171.1624002786.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/c7182123b961fdc2991faa3806eb7156e14c3ff8

commit c7182123b961fdc2991faa3806eb7156e14c3ff8
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri Jun 18 09:31:05 2021 +0200

    kernel: make cryptoapi support needed by mac80211 built-in
    
    This reduces the flash space impact, since built-in code is much smaller
    than a bunch of kernel modules on squashfs
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/generic/config-5.10 | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10
index fdebc06835..e3bdb8fe2c 100644
--- a/target/linux/generic/config-5.10
+++ b/target/linux/generic/config-5.10
@@ -1005,7 +1005,9 @@ CONFIG_CROSS_COMPILE=""
 CONFIG_CRYPTO=y
 # CONFIG_CRYPTO_842 is not set
 # CONFIG_CRYPTO_ADIANTUM is not set
-# CONFIG_CRYPTO_AEAD is not set
+CONFIG_CRYPTO_ACOMP2=y
+CONFIG_CRYPTO_AEAD=y
+CONFIG_CRYPTO_AEAD2=y
 # CONFIG_CRYPTO_AEGIS128 is not set
 # CONFIG_CRYPTO_AEGIS128L is not set
 # CONFIG_CRYPTO_AEGIS128L_AESNI_SSE2 is not set
@@ -1025,6 +1027,8 @@ CONFIG_CRYPTO_AES=y
 # CONFIG_CRYPTO_AES_ARM_CE is not set
 # CONFIG_CRYPTO_AES_NI_INTEL is not set
 # CONFIG_CRYPTO_AES_TI is not set
+CONFIG_CRYPTO_AKCIPHER=y
+CONFIG_CRYPTO_AKCIPHER2=y
 CONFIG_CRYPTO_ALGAPI=y
 CONFIG_CRYPTO_ALGAPI2=y
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
@@ -1039,7 +1043,7 @@ CONFIG_CRYPTO_ALGAPI2=y
 # CONFIG_CRYPTO_CAST5 is not set
 # CONFIG_CRYPTO_CAST6 is not set
 # CONFIG_CRYPTO_CBC is not set
-# CONFIG_CRYPTO_CCM is not set
+CONFIG_CRYPTO_CCM=y
 # CONFIG_CRYPTO_CFB is not set
 # CONFIG_CRYPTO_CHACHA20 is not set
 # CONFIG_CRYPTO_CHACHA20POLY1305 is not set
@@ -1054,7 +1058,7 @@ CONFIG_CRYPTO_ALGAPI2=y
 # CONFIG_CRYPTO_CRCT10DIF is not set
 # CONFIG_CRYPTO_CRCT10DIF_ARM64_CE is not set
 # CONFIG_CRYPTO_CRYPTD is not set
-# CONFIG_CRYPTO_CTR is not set
+CONFIG_CRYPTO_CTR=y
 # CONFIG_CRYPTO_CTS is not set
 # CONFIG_CRYPTO_CURVE25519 is not set
 # CONFIG_CRYPTO_CURVE25519_NEON is not set
@@ -1107,17 +1111,20 @@ CONFIG_CRYPTO_ALGAPI2=y
 # CONFIG_CRYPTO_ESSIV is not set
 # CONFIG_CRYPTO_FCRYPT is not set
 # CONFIG_CRYPTO_FIPS is not set
-# CONFIG_CRYPTO_GCM is not set
+CONFIG_CRYPTO_GCM=y
 # CONFIG_CRYPTO_GF128MUL is not set
-# CONFIG_CRYPTO_GHASH is not set
+CONFIG_CRYPTO_GHASH=y
 # CONFIG_CRYPTO_GHASH_ARM64_CE is not set
 # CONFIG_CRYPTO_GHASH_ARM_CE is not set
 # CONFIG_CRYPTO_GHASH_CLMUL_NI_INTEL is not set
-# CONFIG_CRYPTO_HASH is not set
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
 # CONFIG_CRYPTO_HMAC is not set
 # CONFIG_CRYPTO_HW is not set
 # CONFIG_CRYPTO_JITTERENTROPY is not set
 # CONFIG_CRYPTO_KEYWRAP is not set
+CONFIG_CRYPTO_KPP=y
+CONFIG_CRYPTO_KPP2=y
 # CONFIG_CRYPTO_KHAZAD is not set
 CONFIG_CRYPTO_LIB_AES=y
 CONFIG_CRYPTO_LIB_ARC4=y
@@ -1131,8 +1138,8 @@ CONFIG_CRYPTO_LIB_POLY1305_RSIZE=9
 # CONFIG_CRYPTO_LZ4 is not set
 # CONFIG_CRYPTO_LZ4HC is not set
 # CONFIG_CRYPTO_LZO is not set
-# CONFIG_CRYPTO_MANAGER is not set
-# CONFIG_CRYPTO_MANAGER2 is not set
+CONFIG_CRYPTO_MANAGER=y
+CONFIG_CRYPTO_MANAGER2=y
 CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
 # CONFIG_CRYPTO_MCRYPTD is not set
 # CONFIG_CRYPTO_MD4 is not set
@@ -1144,7 +1151,7 @@ CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
 # CONFIG_CRYPTO_MORUS640 is not set
 # CONFIG_CRYPTO_MORUS640_SSE2 is not set
 # CONFIG_CRYPTO_NHPOLY1305_NEON is not set
-# CONFIG_CRYPTO_NULL is not set
+CONFIG_CRYPTO_NULL=y
 # CONFIG_CRYPTO_OFB is not set
 # CONFIG_CRYPTO_PCBC is not set
 # CONFIG_CRYPTO_PCOMP is not set


From lede-commits at lists.infradead.org  Fri Jun 18 00:52:58 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 18 Jun 2021 03:52:58 -0400
Subject: [openwrt/openwrt] mac80211: remove patches stripping down crypto
 support
In-Reply-To: <162400277889.31334.18262287281048585963@git-01.infra.openwrt.org>
References: <162400277889.31334.18262287281048585963@git-01.infra.openwrt.org>
Message-ID: <mailman.1172.1624002791.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/53b6783907f3bd6f0f88f9d6feed20b21e2cd181

commit 53b6783907f3bd6f0f88f9d6feed20b21e2cd181
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri Jun 18 09:20:54 2021 +0200

    mac80211: remove patches stripping down crypto support
    
    Use of WPA3 and things like FILS is getting much more common, and platforms
    that can't affort the extra kilobytes for this code are fading away.
    Let's not hold back modern authentication methods any longer
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/kernel/mac80211/Makefile                   |   2 +-
 .../patches/ath/402-ath_regd_optional.patch        |   2 +-
 .../patches/ath10k/080-ath10k_thermal_config.patch |   2 +-
 ...-controlling-support-for-various-chipsets.patch |   2 +-
 .../ath9k/551-ath9k_ubnt_uap_plus_hsr.patch        |   2 +-
 .../rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch |   2 +-
 .../subsys/100-remove-cryptoapi-dependencies.patch | 699 ----------------
 .../mac80211/patches/subsys/130-disable-fils.patch |  32 -
 ...0211-aes-cmac-switch-to-shash-CMAC-driver.patch | 230 ------
 .../132-mac80211-remove-cmac-dependency.patch      |  10 -
 ...80211-remove-legacy-minstrel-rate-control.patch |   2 +-
 ...nstrel_ht-add-debugfs-monitoring-controll.patch | 888 +++++++++++++++++++++
 12 files changed, 895 insertions(+), 978 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index d0620c556a..dd39c2d069 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -127,7 +127,7 @@ define KernelPackage/mac80211
   $(call KernelPackage/mac80211/Default)
   TITLE:=Linux 802.11 Wireless Networking Stack
   # +kmod-crypto-cmac is a runtime only dependency of net/mac80211/aes_cmac.c
-  DEPENDS+= +kmod-cfg80211 +hostapd-common
+  DEPENDS+= +kmod-cfg80211 +kmod-crypto-cmac +kmod-crypto-ccm +kmod-crypto-gcm +hostapd-common
   KCONFIG:=\
 	CONFIG_AVERAGE=y
   FILES:= $(PKG_BUILD_DIR)/net/mac80211/mac80211.ko
diff --git a/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch b/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch
index bf87d3551a..3c9180b113 100644
--- a/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch
+++ b/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch
@@ -82,7 +82,7 @@
  	help
 --- a/local-symbols
 +++ b/local-symbols
-@@ -85,6 +85,7 @@ ADM8211=
+@@ -86,6 +86,7 @@ ADM8211=
  ATH_COMMON=
  WLAN_VENDOR_ATH=
  ATH_DEBUG=
diff --git a/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch b/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch
index d183419a47..9ce44fd288 100644
--- a/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch
+++ b/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch
@@ -37,7 +37,7 @@
  void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature);
 --- a/local-symbols
 +++ b/local-symbols
-@@ -144,6 +144,7 @@ ATH10K_SNOC=
+@@ -145,6 +145,7 @@ ATH10K_SNOC=
  ATH10K_DEBUG=
  ATH10K_DEBUGFS=
  ATH10K_SPECTRAL=
diff --git a/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
index ce8effe3c3..fa007e73a1 100644
--- a/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
+++ b/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
@@ -114,7 +114,7 @@ v13:
  ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o
 --- a/local-symbols
 +++ b/local-symbols
-@@ -145,6 +145,7 @@ ATH10K_DEBUG=
+@@ -146,6 +146,7 @@ ATH10K_DEBUG=
  ATH10K_DEBUGFS=
  ATH10K_SPECTRAL=
  ATH10K_THERMAL=
diff --git a/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch b/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch
index acb9ad443c..cd2bdbf1a0 100644
--- a/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch
+++ b/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch
@@ -371,7 +371,7 @@
  
 --- a/local-symbols
 +++ b/local-symbols
-@@ -112,6 +112,7 @@ ATH9K_WOW=
+@@ -113,6 +113,7 @@ ATH9K_WOW=
  ATH9K_RFKILL=
  ATH9K_CHANNEL_CONTEXT=
  ATH9K_PCOEM=
diff --git a/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch b/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch
index e74d9a9aa0..1c52132da6 100644
--- a/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch
+++ b/package/kernel/mac80211/patches/rt2x00/602-rt2x00-introduce-rt2x00eeprom.patch
@@ -1,6 +1,6 @@
 --- a/local-symbols
 +++ b/local-symbols
-@@ -332,6 +332,7 @@ RT2X00_LIB_FIRMWARE=
+@@ -333,6 +333,7 @@ RT2X00_LIB_FIRMWARE=
  RT2X00_LIB_CRYPTO=
  RT2X00_LIB_LEDS=
  RT2X00_LIB_DEBUGFS=
diff --git a/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch b/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch
deleted file mode 100644
index ca02dfb06f..0000000000
--- a/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch
+++ /dev/null
@@ -1,699 +0,0 @@
---- a/net/mac80211/Makefile
-+++ b/net/mac80211/Makefile
-@@ -7,7 +7,6 @@ mac80211-y := \
- 	driver-ops.o \
- 	sta_info.o \
- 	wep.o \
--	aead_api.o \
- 	wpa.o \
- 	scan.o offchannel.o \
- 	ht.o agg-tx.o agg-rx.o \
-@@ -19,8 +18,8 @@ mac80211-y := \
- 	rate.o \
- 	michael.o \
- 	tkip.o \
-+	aes_ccm.o \
- 	aes_cmac.o \
--	aes_gmac.o \
- 	fils_aead.o \
- 	cfg.o \
- 	ethtool.o \
---- a/net/mac80211/aead_api.c
-+++ /dev/null
-@@ -1,113 +0,0 @@
--// SPDX-License-Identifier: GPL-2.0-only
--/*
-- * Copyright 2003-2004, Instant802 Networks, Inc.
-- * Copyright 2005-2006, Devicescape Software, Inc.
-- * Copyright 2014-2015, Qualcomm Atheros, Inc.
-- *
-- * Rewrite: Copyright (C) 2013 Linaro Ltd <ard.biesheuvel at linaro.org>
-- */
--
--#include <linux/kernel.h>
--#include <linux/types.h>
--#include <linux/err.h>
--#include <linux/scatterlist.h>
--#include <crypto/aead.h>
--
--#include "aead_api.h"
--
--int aead_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, size_t aad_len,
--		 u8 *data, size_t data_len, u8 *mic)
--{
--	size_t mic_len = crypto_aead_authsize(tfm);
--	struct scatterlist sg[3];
--	struct aead_request *aead_req;
--	int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm);
--	u8 *__aad;
--	int ret;
--
--	aead_req = kzalloc(reqsize + aad_len, GFP_ATOMIC);
--	if (!aead_req)
--		return -ENOMEM;
--
--	__aad = (u8 *)aead_req + reqsize;
--	memcpy(__aad, aad, aad_len);
--
--	sg_init_table(sg, 3);
--	sg_set_buf(&sg[0], __aad, aad_len);
--	sg_set_buf(&sg[1], data, data_len);
--	sg_set_buf(&sg[2], mic, mic_len);
--
--	aead_request_set_tfm(aead_req, tfm);
--	aead_request_set_crypt(aead_req, sg, sg, data_len, b_0);
--	aead_request_set_ad(aead_req, sg[0].length);
--
--	ret = crypto_aead_encrypt(aead_req);
--	kfree_sensitive(aead_req);
--
--	return ret;
--}
--
--int aead_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, size_t aad_len,
--		 u8 *data, size_t data_len, u8 *mic)
--{
--	size_t mic_len = crypto_aead_authsize(tfm);
--	struct scatterlist sg[3];
--	struct aead_request *aead_req;
--	int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm);
--	u8 *__aad;
--	int err;
--
--	if (data_len == 0)
--		return -EINVAL;
--
--	aead_req = kzalloc(reqsize + aad_len, GFP_ATOMIC);
--	if (!aead_req)
--		return -ENOMEM;
--
--	__aad = (u8 *)aead_req + reqsize;
--	memcpy(__aad, aad, aad_len);
--
--	sg_init_table(sg, 3);
--	sg_set_buf(&sg[0], __aad, aad_len);
--	sg_set_buf(&sg[1], data, data_len);
--	sg_set_buf(&sg[2], mic, mic_len);
--
--	aead_request_set_tfm(aead_req, tfm);
--	aead_request_set_crypt(aead_req, sg, sg, data_len + mic_len, b_0);
--	aead_request_set_ad(aead_req, sg[0].length);
--
--	err = crypto_aead_decrypt(aead_req);
--	kfree_sensitive(aead_req);
--
--	return err;
--}
--
--struct crypto_aead *
--aead_key_setup_encrypt(const char *alg, const u8 key[],
--		       size_t key_len, size_t mic_len)
--{
--	struct crypto_aead *tfm;
--	int err;
--
--	tfm = crypto_alloc_aead(alg, 0, CRYPTO_ALG_ASYNC);
--	if (IS_ERR(tfm))
--		return tfm;
--
--	err = crypto_aead_setkey(tfm, key, key_len);
--	if (err)
--		goto free_aead;
--	err = crypto_aead_setauthsize(tfm, mic_len);
--	if (err)
--		goto free_aead;
--
--	return tfm;
--
--free_aead:
--	crypto_free_aead(tfm);
--	return ERR_PTR(err);
--}
--
--void aead_key_free(struct crypto_aead *tfm)
--{
--	crypto_free_aead(tfm);
--}
---- a/net/mac80211/aead_api.h
-+++ /dev/null
-@@ -1,23 +0,0 @@
--/* SPDX-License-Identifier: GPL-2.0-only */
--
--#ifndef _AEAD_API_H
--#define _AEAD_API_H
--
--#include <crypto/aead.h>
--#include <linux/crypto.h>
--
--struct crypto_aead *
--aead_key_setup_encrypt(const char *alg, const u8 key[],
--		       size_t key_len, size_t mic_len);
--
--int aead_encrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad,
--		 size_t aad_len, u8 *data,
--		 size_t data_len, u8 *mic);
--
--int aead_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad,
--		 size_t aad_len, u8 *data,
--		 size_t data_len, u8 *mic);
--
--void aead_key_free(struct crypto_aead *tfm);
--
--#endif /* _AEAD_API_H */
---- a/net/mac80211/aes_ccm.h
-+++ b/net/mac80211/aes_ccm.h
-@@ -7,39 +7,17 @@
- #ifndef AES_CCM_H
- #define AES_CCM_H
- 
--#include "aead_api.h"
-+#include <linux/crypto.h>
- 
--#define CCM_AAD_LEN	32
--
--static inline struct crypto_aead *
--ieee80211_aes_key_setup_encrypt(const u8 key[], size_t key_len, size_t mic_len)
--{
--	return aead_key_setup_encrypt("ccm(aes)", key, key_len, mic_len);
--}
--
--static inline int
--ieee80211_aes_ccm_encrypt(struct crypto_aead *tfm,
--			  u8 *b_0, u8 *aad, u8 *data,
--			  size_t data_len, u8 *mic)
--{
--	return aead_encrypt(tfm, b_0, aad + 2,
--			    be16_to_cpup((__be16 *)aad),
--			    data, data_len, mic);
--}
--
--static inline int
--ieee80211_aes_ccm_decrypt(struct crypto_aead *tfm,
--			  u8 *b_0, u8 *aad, u8 *data,
--			  size_t data_len, u8 *mic)
--{
--	return aead_decrypt(tfm, b_0, aad + 2,
--			    be16_to_cpup((__be16 *)aad),
--			    data, data_len, mic);
--}
--
--static inline void ieee80211_aes_key_free(struct crypto_aead *tfm)
--{
--	return aead_key_free(tfm);
--}
-+struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[],
-+						      size_t key_len,
-+						      size_t mic_len);
-+void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad,
-+			       u8 *data, size_t data_len, u8 *mic,
-+			       size_t mic_len);
-+int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad,
-+			      u8 *data, size_t data_len, u8 *mic,
-+			      size_t mic_len);
-+void ieee80211_aes_key_free(struct crypto_cipher *tfm);
- 
- #endif /* AES_CCM_H */
---- /dev/null
-+++ b/net/mac80211/aes_gcm.c
-@@ -0,0 +1,109 @@
-+/*
-+ * Copyright 2014-2015, Qualcomm Atheros, Inc.
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+ */
-+
-+#include <linux/kernel.h>
-+#include <linux/types.h>
-+#include <linux/err.h>
-+#include <crypto/aead.h>
-+
-+#include <net/mac80211.h>
-+#include "key.h"
-+#include "aes_gcm.h"
-+
-+int ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad,
-+			      u8 *data, size_t data_len, u8 *mic)
-+{
-+	struct scatterlist sg[3];
-+	struct aead_request *aead_req;
-+	int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm);
-+	u8 *__aad;
-+
-+	aead_req = kzalloc(reqsize + GCM_AAD_LEN, GFP_ATOMIC);
-+	if (!aead_req)
-+		return -ENOMEM;
-+
-+	__aad = (u8 *)aead_req + reqsize;
-+	memcpy(__aad, aad, GCM_AAD_LEN);
-+
-+	sg_init_table(sg, 3);
-+	sg_set_buf(&sg[0], &__aad[2], be16_to_cpup((__be16 *)__aad));
-+	sg_set_buf(&sg[1], data, data_len);
-+	sg_set_buf(&sg[2], mic, IEEE80211_GCMP_MIC_LEN);
-+
-+	aead_request_set_tfm(aead_req, tfm);
-+	aead_request_set_crypt(aead_req, sg, sg, data_len, j_0);
-+	aead_request_set_ad(aead_req, sg[0].length);
-+
-+	crypto_aead_encrypt(aead_req);
-+	kzfree(aead_req);
-+	return 0;
-+}
-+
-+int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad,
-+			      u8 *data, size_t data_len, u8 *mic)
-+{
-+	struct scatterlist sg[3];
-+	struct aead_request *aead_req;
-+	int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm);
-+	u8 *__aad;
-+	int err;
-+
-+	if (data_len == 0)
-+		return -EINVAL;
-+
-+	aead_req = kzalloc(reqsize + GCM_AAD_LEN, GFP_ATOMIC);
-+	if (!aead_req)
-+		return -ENOMEM;
-+
-+	__aad = (u8 *)aead_req + reqsize;
-+	memcpy(__aad, aad, GCM_AAD_LEN);
-+
-+	sg_init_table(sg, 3);
-+	sg_set_buf(&sg[0], &__aad[2], be16_to_cpup((__be16 *)__aad));
-+	sg_set_buf(&sg[1], data, data_len);
-+	sg_set_buf(&sg[2], mic, IEEE80211_GCMP_MIC_LEN);
-+
-+	aead_request_set_tfm(aead_req, tfm);
-+	aead_request_set_crypt(aead_req, sg, sg,
-+			       data_len + IEEE80211_GCMP_MIC_LEN, j_0);
-+	aead_request_set_ad(aead_req, sg[0].length);
-+
-+	err = crypto_aead_decrypt(aead_req);
-+	kzfree(aead_req);
-+
-+	return err;
-+}
-+
-+struct crypto_aead *ieee80211_aes_gcm_key_setup_encrypt(const u8 key[],
-+							size_t key_len)
-+{
-+	struct crypto_aead *tfm;
-+	int err;
-+
-+	tfm = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC);
-+	if (IS_ERR(tfm))
-+		return tfm;
-+
-+	err = crypto_aead_setkey(tfm, key, key_len);
-+	if (err)
-+		goto free_aead;
-+	err = crypto_aead_setauthsize(tfm, IEEE80211_GCMP_MIC_LEN);
-+	if (err)
-+		goto free_aead;
-+
-+	return tfm;
-+
-+free_aead:
-+	crypto_free_aead(tfm);
-+	return ERR_PTR(err);
-+}
-+
-+void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm)
-+{
-+	crypto_free_aead(tfm);
-+}
---- a/net/mac80211/aes_gcm.h
-+++ b/net/mac80211/aes_gcm.h
-@@ -6,38 +6,30 @@
- #ifndef AES_GCM_H
- #define AES_GCM_H
- 
--#include "aead_api.h"
-+#include <linux/crypto.h>
- 
--#define GCM_AAD_LEN	32
--
--static inline int ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm,
--					    u8 *j_0, u8 *aad,  u8 *data,
--					    size_t data_len, u8 *mic)
-+static inline void
-+ieee80211_aes_gcm_encrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad,
-+			  u8 *data, size_t data_len, u8 *mic)
- {
--	return aead_encrypt(tfm, j_0, aad + 2,
--			    be16_to_cpup((__be16 *)aad),
--			    data, data_len, mic);
- }
- 
--static inline int ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm,
--					    u8 *j_0, u8 *aad, u8 *data,
--					    size_t data_len, u8 *mic)
-+static inline int
-+ieee80211_aes_gcm_decrypt(struct crypto_aead *tfm, u8 *j_0, u8 *aad,
-+			  u8 *data, size_t data_len, u8 *mic)
- {
--	return aead_decrypt(tfm, j_0, aad + 2,
--			    be16_to_cpup((__be16 *)aad),
--			    data, data_len, mic);
-+    return -EOPNOTSUPP;
- }
- 
- static inline struct crypto_aead *
- ieee80211_aes_gcm_key_setup_encrypt(const u8 key[], size_t key_len)
- {
--	return aead_key_setup_encrypt("gcm(aes)", key,
--				      key_len, IEEE80211_GCMP_MIC_LEN);
-+    return NULL;
- }
- 
--static inline void ieee80211_aes_gcm_key_free(struct crypto_aead *tfm)
-+static inline void
-+ieee80211_aes_gcm_key_free(struct crypto_aead *tfm)
- {
--	return aead_key_free(tfm);
- }
- 
- #endif /* AES_GCM_H */
---- a/net/mac80211/wpa.c
-+++ b/net/mac80211/wpa.c
-@@ -312,7 +312,8 @@ ieee80211_crypto_tkip_decrypt(struct iee
- }
- 
- 
--static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *b_0, u8 *aad)
-+static void ccmp_special_blocks(struct sk_buff *skb, u8 *pn, u8 *b_0, u8 *aad,
-+				u16 data_len)
- {
- 	__le16 mask_fc;
- 	int a4_included, mgmt;
-@@ -342,14 +343,8 @@ static void ccmp_special_blocks(struct s
- 	else
- 		qos_tid = 0;
- 
--	/* In CCM, the initial vectors (IV) used for CTR mode encryption and CBC
--	 * mode authentication are not allowed to collide, yet both are derived
--	 * from this vector b_0. We only set L := 1 here to indicate that the
--	 * data size can be represented in (L+1) bytes. The CCM layer will take
--	 * care of storing the data length in the top (L+1) bytes and setting
--	 * and clearing the other bits as is required to derive the two IVs.
--	 */
--	b_0[0] = 0x1;
-+	/* First block, b_0 */
-+	b_0[0] = 0x59; /* flags: Adata: 1, M: 011, L: 001 */
- 
- 	/* Nonce: Nonce Flags | A2 | PN
- 	 * Nonce Flags: Priority (b0..b3) | Management (b4) | Reserved (b5..b7)
-@@ -357,6 +352,8 @@ static void ccmp_special_blocks(struct s
- 	b_0[1] = qos_tid | (mgmt << 4);
- 	memcpy(&b_0[2], hdr->addr2, ETH_ALEN);
- 	memcpy(&b_0[8], pn, IEEE80211_CCMP_PN_LEN);
-+	/* l(m) */
-+	put_unaligned_be16(data_len, &b_0[14]);
- 
- 	/* AAD (extra authenticate-only data) / masked 802.11 header
- 	 * FC | A1 | A2 | A3 | SC | [A4] | [QC] */
-@@ -413,7 +410,7 @@ static int ccmp_encrypt_skb(struct ieee8
- 	u8 *pos;
- 	u8 pn[6];
- 	u64 pn64;
--	u8 aad[CCM_AAD_LEN];
-+	u8 aad[2 * AES_BLOCK_SIZE];
- 	u8 b_0[AES_BLOCK_SIZE];
- 
- 	if (info->control.hw_key &&
-@@ -468,9 +465,11 @@ static int ccmp_encrypt_skb(struct ieee8
- 		return 0;
- 
- 	pos += IEEE80211_CCMP_HDR_LEN;
--	ccmp_special_blocks(skb, pn, b_0, aad);
--	return ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len,
--					 skb_put(skb, mic_len));
-+	ccmp_special_blocks(skb, pn, b_0, aad, len);
-+	ieee80211_aes_ccm_encrypt(key->u.ccmp.tfm, b_0, aad, pos, len,
-+				  skb_put(skb, mic_len), mic_len);
-+
-+	return 0;
- }
- 
- 
-@@ -543,13 +542,13 @@ ieee80211_crypto_ccmp_decrypt(struct iee
- 			u8 aad[2 * AES_BLOCK_SIZE];
- 			u8 b_0[AES_BLOCK_SIZE];
- 			/* hardware didn't decrypt/verify MIC */
--			ccmp_special_blocks(skb, pn, b_0, aad);
-+			ccmp_special_blocks(skb, pn, b_0, aad, data_len);
- 
- 			if (ieee80211_aes_ccm_decrypt(
- 				    key->u.ccmp.tfm, b_0, aad,
- 				    skb->data + hdrlen + IEEE80211_CCMP_HDR_LEN,
- 				    data_len,
--				    skb->data + skb->len - mic_len))
-+				    skb->data + skb->len - mic_len, mic_len))
- 				return RX_DROP_UNUSABLE;
- 		}
- 
-@@ -646,7 +645,7 @@ static int gcmp_encrypt_skb(struct ieee8
- 	u8 *pos;
- 	u8 pn[6];
- 	u64 pn64;
--	u8 aad[GCM_AAD_LEN];
-+	u8 aad[2 * AES_BLOCK_SIZE];
- 	u8 j_0[AES_BLOCK_SIZE];
- 
- 	if (info->control.hw_key &&
-@@ -703,8 +702,10 @@ static int gcmp_encrypt_skb(struct ieee8
- 
- 	pos += IEEE80211_GCMP_HDR_LEN;
- 	gcmp_special_blocks(skb, pn, j_0, aad);
--	return ieee80211_aes_gcm_encrypt(key->u.gcmp.tfm, j_0, aad, pos, len,
--					 skb_put(skb, IEEE80211_GCMP_MIC_LEN));
-+	ieee80211_aes_gcm_encrypt(key->u.gcmp.tfm, j_0, aad, pos, len,
-+				  skb_put(skb, IEEE80211_GCMP_MIC_LEN));
-+
-+	return 0;
- }
- 
- ieee80211_tx_result
-@@ -1133,9 +1134,9 @@ ieee80211_crypto_aes_gmac_encrypt(struct
- 	struct ieee80211_key *key = tx->key;
- 	struct ieee80211_mmie_16 *mmie;
- 	struct ieee80211_hdr *hdr;
--	u8 aad[GMAC_AAD_LEN];
-+	u8 aad[20];
- 	u64 pn64;
--	u8 nonce[GMAC_NONCE_LEN];
-+	u8 nonce[12];
- 
- 	if (WARN_ON(skb_queue_len(&tx->skbs) != 1))
- 		return TX_DROP;
-@@ -1181,7 +1182,7 @@ ieee80211_crypto_aes_gmac_decrypt(struct
- 	struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
- 	struct ieee80211_key *key = rx->key;
- 	struct ieee80211_mmie_16 *mmie;
--	u8 aad[GMAC_AAD_LEN], *mic, ipn[6], nonce[GMAC_NONCE_LEN];
-+	u8 aad[20], *mic, ipn[6], nonce[12];
- 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
- 
- 	if (!ieee80211_is_mgmt(hdr->frame_control))
---- /dev/null
-+++ b/net/mac80211/aes_ccm.c
-@@ -0,0 +1,144 @@
-+/*
-+ * Copyright 2003-2004, Instant802 Networks, Inc.
-+ * Copyright 2005-2006, Devicescape Software, Inc.
-+ *
-+ * Rewrite: Copyright (C) 2013 Linaro Ltd <ard.biesheuvel at linaro.org>
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+ */
-+
-+#include <linux/kernel.h>
-+#include <linux/types.h>
-+#include <linux/err.h>
-+#include <crypto/aead.h>
-+#include <crypto/aes.h>
-+
-+#include <net/mac80211.h>
-+#include "key.h"
-+#include "aes_ccm.h"
-+
-+static void aes_ccm_prepare(struct crypto_cipher *tfm, u8 *b_0, u8 *aad, u8 *s_0,
-+			    u8 *a, u8 *b)
-+{
-+	int i;
-+
-+	crypto_cipher_encrypt_one(tfm, b, b_0);
-+
-+	/* Extra Authenticate-only data (always two AES blocks) */
-+	for (i = 0; i < AES_BLOCK_SIZE; i++)
-+		aad[i] ^= b[i];
-+	crypto_cipher_encrypt_one(tfm, b, aad);
-+
-+	aad += AES_BLOCK_SIZE;
-+
-+	for (i = 0; i < AES_BLOCK_SIZE; i++)
-+		aad[i] ^= b[i];
-+	crypto_cipher_encrypt_one(tfm, a, aad);
-+
-+	/* Mask out bits from auth-only-b_0 */
-+	b_0[0] &= 0x07;
-+
-+	/* S_0 is used to encrypt T (= MIC) */
-+	b_0[14] = 0;
-+	b_0[15] = 0;
-+	crypto_cipher_encrypt_one(tfm, s_0, b_0);
-+}
-+
-+
-+void ieee80211_aes_ccm_encrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad,
-+			       u8 *data, size_t data_len, u8 *mic,
-+			       size_t mic_len)
-+{
-+	int i, j, last_len, num_blocks;
-+	u8 b[AES_BLOCK_SIZE];
-+	u8 s_0[AES_BLOCK_SIZE];
-+	u8 e[AES_BLOCK_SIZE];
-+	u8 *pos, *cpos;
-+
-+	num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE);
-+	last_len = data_len % AES_BLOCK_SIZE;
-+	aes_ccm_prepare(tfm, b_0, aad, s_0, b, b);
-+
-+	/* Process payload blocks */
-+	pos = data;
-+	cpos = data;
-+	for (j = 1; j <= num_blocks; j++) {
-+		int blen = (j == num_blocks && last_len) ?
-+			last_len : AES_BLOCK_SIZE;
-+
-+		/* Authentication followed by encryption */
-+		for (i = 0; i < blen; i++)
-+			b[i] ^= pos[i];
-+		crypto_cipher_encrypt_one(tfm, b, b);
-+
-+		b_0[14] = (j >> 8) & 0xff;
-+		b_0[15] = j & 0xff;
-+		crypto_cipher_encrypt_one(tfm, e, b_0);
-+		for (i = 0; i < blen; i++)
-+			*cpos++ = *pos++ ^ e[i];
-+	}
-+
-+	for (i = 0; i < mic_len; i++)
-+		mic[i] = b[i] ^ s_0[i];
-+}
-+
-+int ieee80211_aes_ccm_decrypt(struct crypto_cipher *tfm, u8 *b_0, u8 *aad,
-+			      u8 *data, size_t data_len, u8 *mic,
-+			      size_t mic_len)
-+{
-+	int i, j, last_len, num_blocks;
-+	u8 *pos, *cpos;
-+	u8 a[AES_BLOCK_SIZE];
-+	u8 b[AES_BLOCK_SIZE];
-+	u8 s_0[AES_BLOCK_SIZE];
-+
-+	num_blocks = DIV_ROUND_UP(data_len, AES_BLOCK_SIZE);
-+	last_len = data_len % AES_BLOCK_SIZE;
-+	aes_ccm_prepare(tfm, b_0, aad, s_0, a, b);
-+
-+	/* Process payload blocks */
-+	cpos = data;
-+	pos = data;
-+	for (j = 1; j <= num_blocks; j++) {
-+		int blen = (j == num_blocks && last_len) ?
-+			last_len : AES_BLOCK_SIZE;
-+
-+		/* Decryption followed by authentication */
-+		b_0[14] = (j >> 8) & 0xff;
-+		b_0[15] = j & 0xff;
-+		crypto_cipher_encrypt_one(tfm, b, b_0);
-+		for (i = 0; i < blen; i++) {
-+			*pos = *cpos++ ^ b[i];
-+			a[i] ^= *pos++;
-+		}
-+		crypto_cipher_encrypt_one(tfm, a, a);
-+	}
-+
-+	for (i = 0; i < mic_len; i++) {
-+		if ((mic[i] ^ s_0[i]) != a[i])
-+			return -1;
-+	}
-+
-+	return 0;
-+}
-+
-+struct crypto_cipher *ieee80211_aes_key_setup_encrypt(const u8 key[],
-+						      size_t key_len,
-+						      size_t mic_len)
-+{
-+	struct crypto_cipher *tfm;
-+
-+	tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC);
-+	if (!IS_ERR(tfm))
-+		crypto_cipher_setkey(tfm, key, key_len);
-+
-+	return tfm;
-+}
-+
-+
-+void ieee80211_aes_key_free(struct crypto_cipher *tfm)
-+{
-+	crypto_free_cipher(tfm);
-+}
---- a/net/mac80211/Kconfig
-+++ b/net/mac80211/Kconfig
-@@ -6,8 +6,6 @@ config MAC80211
- 	depends on CRYPTO
- 	select BPAUTO_CRYPTO_LIB_ARC4
- 	depends on CRYPTO_AES
--	depends on CRYPTO_CCM
--	depends on CRYPTO_GCM
- 	depends on CRYPTO_CMAC
- 	depends on CRC32
- 	help
---- a/net/mac80211/aes_gmac.h
-+++ b/net/mac80211/aes_gmac.h
-@@ -12,10 +12,22 @@
- #define GMAC_MIC_LEN	16
- #define GMAC_NONCE_LEN	12
- 
--struct crypto_aead *ieee80211_aes_gmac_key_setup(const u8 key[],
--						 size_t key_len);
--int ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce,
--		       const u8 *data, size_t data_len, u8 *mic);
--void ieee80211_aes_gmac_key_free(struct crypto_aead *tfm);
-+static inline struct crypto_aead *
-+ieee80211_aes_gmac_key_setup(const u8 key[], size_t key_len)
-+{
-+	return NULL;
-+}
-+
-+static inline int
-+ieee80211_aes_gmac(struct crypto_aead *tfm, const u8 *aad, u8 *nonce,
-+		   const u8 *data, size_t data_len, u8 *mic)
-+{
-+	return -EOPNOTSUPP;
-+}
-+
-+static inline void
-+ieee80211_aes_gmac_key_free(struct crypto_aead *tfm)
-+{
-+}
- 
- #endif /* AES_GMAC_H */
---- a/net/mac80211/key.h
-+++ b/net/mac80211/key.h
-@@ -89,7 +89,7 @@ struct ieee80211_key {
- 			 * Management frames.
- 			 */
- 			u8 rx_pn[IEEE80211_NUM_TIDS + 1][IEEE80211_CCMP_PN_LEN];
--			struct crypto_aead *tfm;
-+			struct crypto_cipher *tfm;
- 			u32 replays; /* dot11RSNAStatsCCMPReplays */
- 		} ccmp;
- 		struct {
diff --git a/package/kernel/mac80211/patches/subsys/130-disable-fils.patch b/package/kernel/mac80211/patches/subsys/130-disable-fils.patch
deleted file mode 100644
index 9c6e971f9d..0000000000
--- a/package/kernel/mac80211/patches/subsys/130-disable-fils.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-Disable FILS support, since it pulls in crypto hash support
-
---- a/net/mac80211/fils_aead.h
-+++ b/net/mac80211/fils_aead.h
-@@ -7,7 +7,7 @@
- #ifndef FILS_AEAD_H
- #define FILS_AEAD_H
- 
--#if LINUX_VERSION_IS_GEQ(4,3,0)
-+#if 0 /* LINUX_VERSION_IS_GEQ(4,3,0) */
- int fils_encrypt_assoc_req(struct sk_buff *skb,
- 			   struct ieee80211_mgd_assoc_data *assoc_data);
- int fils_decrypt_assoc_resp(struct ieee80211_sub_if_data *sdata,
---- a/net/mac80211/fils_aead.c
-+++ b/net/mac80211/fils_aead.c
-@@ -1,4 +1,4 @@
--#if LINUX_VERSION_IS_GEQ(4,3,0)
-+#if 0 /* LINUX_VERSION_IS_GEQ(4,3,0) */
- // SPDX-License-Identifier: GPL-2.0-only
- /*
-  * FILS AEAD for (Re)Association Request/Response frames
---- a/net/mac80211/main.c
-+++ b/net/mac80211/main.c
-@@ -591,7 +591,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_
- 			   NL80211_FEATURE_MAC_ON_CREATE |
- 			   NL80211_FEATURE_USERSPACE_MPM |
- 			   NL80211_FEATURE_FULL_AP_CLIENT_STATE;
--#if LINUX_VERSION_IS_GEQ(4,3,0)
-+#if 0 /* LINUX_VERSION_IS_GEQ(4,3,0) */
- 	wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_FILS_STA);
- #endif
- 	wiphy_ext_feature_set(wiphy,
diff --git a/package/kernel/mac80211/patches/subsys/131-Revert-mac80211-aes-cmac-switch-to-shash-CMAC-driver.patch b/package/kernel/mac80211/patches/subsys/131-Revert-mac80211-aes-cmac-switch-to-shash-CMAC-driver.patch
deleted file mode 100644
index c3bf7ccc7a..0000000000
--- a/package/kernel/mac80211/patches/subsys/131-Revert-mac80211-aes-cmac-switch-to-shash-CMAC-driver.patch
+++ /dev/null
@@ -1,230 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Sat, 7 Oct 2017 09:37:28 +0200
-Subject: [PATCH] Revert "mac80211: aes-cmac: switch to shash CMAC
- driver"
-
-This reverts commit 26717828b75dd5c46e97f7f4a9b937d038bb2852.
-Reduces mac80211 dependencies for LEDE
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
-
---- a/net/mac80211/aes_cmac.c
-+++ b/net/mac80211/aes_cmac.c
-@@ -19,67 +19,151 @@
- #define CMAC_TLEN_256 16 /* CMAC TLen = 128 bits (16 octets) */
- #define AAD_LEN 20
- 
--static const u8 zero[CMAC_TLEN_256];
- 
--void ieee80211_aes_cmac(struct crypto_shash *tfm, const u8 *aad,
-+void gf_mulx(u8 *pad)
-+{
-+	int i, carry;
-+
-+	carry = pad[0] & 0x80;
-+	for (i = 0; i < AES_BLOCK_SIZE - 1; i++)
-+		pad[i] = (pad[i] << 1) | (pad[i + 1] >> 7);
-+	pad[AES_BLOCK_SIZE - 1] <<= 1;
-+	if (carry)
-+		pad[AES_BLOCK_SIZE - 1] ^= 0x87;
-+}
-+
-+void aes_cmac_vector(struct crypto_cipher *tfm, size_t num_elem,
-+		     const u8 *addr[], const size_t *len, u8 *mac,
-+		     size_t mac_len)
-+{
-+	u8 cbc[AES_BLOCK_SIZE], pad[AES_BLOCK_SIZE];
-+	const u8 *pos, *end;
-+	size_t i, e, left, total_len;
-+
-+	memset(cbc, 0, AES_BLOCK_SIZE);
-+
-+	total_len = 0;
-+	for (e = 0; e < num_elem; e++)
-+		total_len += len[e];
-+	left = total_len;
-+
-+	e = 0;
-+	pos = addr[0];
-+	end = pos + len[0];
-+
-+	while (left >= AES_BLOCK_SIZE) {
-+		for (i = 0; i < AES_BLOCK_SIZE; i++) {
-+			cbc[i] ^= *pos++;
-+			if (pos >= end) {
-+				e++;
-+				pos = addr[e];
-+				end = pos + len[e];
-+			}
-+		}
-+		if (left > AES_BLOCK_SIZE)
-+			crypto_cipher_encrypt_one(tfm, cbc, cbc);
-+		left -= AES_BLOCK_SIZE;
-+	}
-+
-+	memset(pad, 0, AES_BLOCK_SIZE);
-+	crypto_cipher_encrypt_one(tfm, pad, pad);
-+	gf_mulx(pad);
-+
-+	if (left || total_len == 0) {
-+		for (i = 0; i < left; i++) {
-+			cbc[i] ^= *pos++;
-+			if (pos >= end) {
-+				e++;
-+				pos = addr[e];
-+				end = pos + len[e];
-+			}
-+		}
-+		cbc[left] ^= 0x80;
-+		gf_mulx(pad);
-+	}
-+
-+	for (i = 0; i < AES_BLOCK_SIZE; i++)
-+		pad[i] ^= cbc[i];
-+	crypto_cipher_encrypt_one(tfm, pad, pad);
-+	memcpy(mac, pad, mac_len);
-+}
-+
-+
-+void ieee80211_aes_cmac(struct crypto_cipher *tfm, const u8 *aad,
- 			const u8 *data, size_t data_len, u8 *mic)
- {
--	SHASH_DESC_ON_STACK(desc, tfm);
--	u8 out[AES_BLOCK_SIZE];
-+	const u8 *addr[4];
-+	size_t len[4];
-+	u8 zero[CMAC_TLEN];
- 	const __le16 *fc;
- 
--	desc->tfm = tfm;
--
--	crypto_shash_init(desc);
--	crypto_shash_update(desc, aad, AAD_LEN);
-+	memset(zero, 0, CMAC_TLEN);
-+	addr[0] = aad;
-+	len[0] = AAD_LEN;
- 	fc = (const __le16 *)aad;
- 	if (ieee80211_is_beacon(*fc)) {
- 		/* mask Timestamp field to zero */
--		crypto_shash_update(desc, zero, 8);
--		crypto_shash_update(desc, data + 8, data_len - 8 - CMAC_TLEN);
-+		addr[1] = zero;
-+		len[1] = 8;
-+		addr[2] = data + 8;
-+		len[2] = data_len - 8 - CMAC_TLEN;
-+		addr[3] = zero;
-+		len[3] = CMAC_TLEN;
-+		aes_cmac_vector(tfm, 4, addr, len, mic, CMAC_TLEN);
- 	} else {
--		crypto_shash_update(desc, data, data_len - CMAC_TLEN);
-+		addr[1] = data;
-+		len[1] = data_len - CMAC_TLEN;
-+		addr[2] = zero;
-+		len[2] = CMAC_TLEN;
-+		aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN);
- 	}
--	crypto_shash_finup(desc, zero, CMAC_TLEN, out);
--
--	memcpy(mic, out, CMAC_TLEN);
- }
- 
--void ieee80211_aes_cmac_256(struct crypto_shash *tfm, const u8 *aad,
-+void ieee80211_aes_cmac_256(struct crypto_cipher *tfm, const u8 *aad,
- 			    const u8 *data, size_t data_len, u8 *mic)
- {
--	SHASH_DESC_ON_STACK(desc, tfm);
-+	const u8 *addr[4];
-+	size_t len[4];
-+	u8 zero[CMAC_TLEN_256];
- 	const __le16 *fc;
- 
--	desc->tfm = tfm;
--
--	crypto_shash_init(desc);
--	crypto_shash_update(desc, aad, AAD_LEN);
-+	memset(zero, 0, CMAC_TLEN_256);
-+	addr[0] = aad;
-+	len[0] = AAD_LEN;
-+	addr[1] = data;
- 	fc = (const __le16 *)aad;
- 	if (ieee80211_is_beacon(*fc)) {
- 		/* mask Timestamp field to zero */
--		crypto_shash_update(desc, zero, 8);
--		crypto_shash_update(desc, data + 8,
--				    data_len - 8 - CMAC_TLEN_256);
-+		addr[1] = zero;
-+		len[1] = 8;
-+		addr[2] = data + 8;
-+		len[2] = data_len - 8 - CMAC_TLEN_256;
-+		addr[3] = zero;
-+		len[3] = CMAC_TLEN_256;
-+		aes_cmac_vector(tfm, 4, addr, len, mic, CMAC_TLEN_256);
- 	} else {
--		crypto_shash_update(desc, data, data_len - CMAC_TLEN_256);
-+		addr[1] = data;
-+		len[1] = data_len - CMAC_TLEN_256;
-+		addr[2] = zero;
-+		len[2] = CMAC_TLEN_256;
-+		aes_cmac_vector(tfm, 3, addr, len, mic, CMAC_TLEN_256);
- 	}
--	crypto_shash_finup(desc, zero, CMAC_TLEN_256, mic);
- }
- 
--struct crypto_shash *ieee80211_aes_cmac_key_setup(const u8 key[],
--						  size_t key_len)
-+struct crypto_cipher *ieee80211_aes_cmac_key_setup(const u8 key[],
-+						   size_t key_len)
- {
--	struct crypto_shash *tfm;
-+	struct crypto_cipher *tfm;
- 
--	tfm = crypto_alloc_shash("cmac(aes)", 0, 0);
-+	tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC);
- 	if (!IS_ERR(tfm))
--		crypto_shash_setkey(tfm, key, key_len);
-+		crypto_cipher_setkey(tfm, key, key_len);
- 
- 	return tfm;
- }
- 
--void ieee80211_aes_cmac_key_free(struct crypto_shash *tfm)
-+
-+void ieee80211_aes_cmac_key_free(struct crypto_cipher *tfm)
- {
--	crypto_free_shash(tfm);
-+	crypto_free_cipher(tfm);
- }
---- a/net/mac80211/aes_cmac.h
-+++ b/net/mac80211/aes_cmac.h
-@@ -7,14 +7,13 @@
- #define AES_CMAC_H
- 
- #include <linux/crypto.h>
--#include <crypto/hash.h>
- 
--struct crypto_shash *ieee80211_aes_cmac_key_setup(const u8 key[],
--						  size_t key_len);
--void ieee80211_aes_cmac(struct crypto_shash *tfm, const u8 *aad,
-+struct crypto_cipher *ieee80211_aes_cmac_key_setup(const u8 key[],
-+						   size_t key_len);
-+void ieee80211_aes_cmac(struct crypto_cipher *tfm, const u8 *aad,
- 			const u8 *data, size_t data_len, u8 *mic);
--void ieee80211_aes_cmac_256(struct crypto_shash *tfm, const u8 *aad,
-+void ieee80211_aes_cmac_256(struct crypto_cipher *tfm, const u8 *aad,
- 			    const u8 *data, size_t data_len, u8 *mic);
--void ieee80211_aes_cmac_key_free(struct crypto_shash *tfm);
-+void ieee80211_aes_cmac_key_free(struct crypto_cipher *tfm);
- 
- #endif /* AES_CMAC_H */
---- a/net/mac80211/key.h
-+++ b/net/mac80211/key.h
-@@ -94,7 +94,7 @@ struct ieee80211_key {
- 		} ccmp;
- 		struct {
- 			u8 rx_pn[IEEE80211_CMAC_PN_LEN];
--			struct crypto_shash *tfm;
-+			struct crypto_cipher *tfm;
- 			u32 replays; /* dot11RSNAStatsCMACReplays */
- 			u32 icverrors; /* dot11RSNAStatsCMACICVErrors */
- 		} aes_cmac;
diff --git a/package/kernel/mac80211/patches/subsys/132-mac80211-remove-cmac-dependency.patch b/package/kernel/mac80211/patches/subsys/132-mac80211-remove-cmac-dependency.patch
deleted file mode 100644
index df67d2f101..0000000000
--- a/package/kernel/mac80211/patches/subsys/132-mac80211-remove-cmac-dependency.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/net/mac80211/Kconfig
-+++ b/net/mac80211/Kconfig
-@@ -6,7 +6,6 @@ config MAC80211
- 	depends on CRYPTO
- 	select BPAUTO_CRYPTO_LIB_ARC4
- 	depends on CRYPTO_AES
--	depends on CRYPTO_CMAC
- 	depends on CRC32
- 	help
- 	  This option enables the hardware independent IEEE 802.11
diff --git a/package/kernel/mac80211/patches/subsys/339-mac80211-remove-legacy-minstrel-rate-control.patch b/package/kernel/mac80211/patches/subsys/339-mac80211-remove-legacy-minstrel-rate-control.patch
index 96ee595ac1..1cab2eb194 100644
--- a/package/kernel/mac80211/patches/subsys/339-mac80211-remove-legacy-minstrel-rate-control.patch
+++ b/package/kernel/mac80211/patches/subsys/339-mac80211-remove-legacy-minstrel-rate-control.patch
@@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/net/mac80211/Makefile
 +++ b/net/mac80211/Makefile
-@@ -55,11 +55,9 @@ mac80211-$(CONFIG_PM) += pm.o
+@@ -56,11 +56,9 @@ mac80211-$(CONFIG_PM) += pm.o
  CFLAGS_trace.o := -I$(src)
  
  rc80211_minstrel-y := \
diff --git a/package/kernel/mac80211/patches/subsys/361-mac80211-minstrel_ht-add-debugfs-monitoring-controll.patch b/package/kernel/mac80211/patches/subsys/361-mac80211-minstrel_ht-add-debugfs-monitoring-controll.patch
new file mode 100644
index 0000000000..ef57234bea
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/361-mac80211-minstrel_ht-add-debugfs-monitoring-controll.patch
@@ -0,0 +1,888 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Mon, 1 Feb 2021 10:47:58 +0100
+Subject: [PATCH] mac80211: minstrel_ht: add debugfs monitoring/controlling
+ API
+
+This allows user space to monitor tx status and take over rate control
+functionality.
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+ create mode 100644 net/mac80211/rc80211_minstrel_ht_api.c
+
+--- a/local-symbols
++++ b/local-symbols
+@@ -49,6 +49,7 @@ LIB80211_DEBUG=
+ MAC80211=
+ MAC80211_HAS_RC=
+ MAC80211_RC_MINSTREL=
++MAC80211_RC_MINSTREL_DEBUGFS_API=
+ MAC80211_RC_DEFAULT_MINSTREL=
+ MAC80211_RC_DEFAULT=
+ MAC80211_MESH=
+--- a/net/mac80211/Kconfig
++++ b/net/mac80211/Kconfig
+@@ -29,6 +29,15 @@ config MAC80211_RC_MINSTREL
+ 	help
+ 	  This option enables the 'minstrel' TX rate control algorithm
+ 
++config MAC80211_RC_MINSTREL_DEBUGFS_API
++	bool "Minstrel debugfs userspace control API"
++	depends on MAC80211_RC_MINSTREL
++	depends on MAC80211_DEBUGFS
++	select RELAY
++	help
++	  This option creates debugfs files that allow user space to observe
++	  and/or control minstrel rate selection behavior
++
+ choice
+ 	prompt "Default rate control algorithm"
+ 	depends on MAC80211_HAS_RC
+--- a/net/mac80211/Makefile
++++ b/net/mac80211/Makefile
+@@ -61,6 +61,9 @@ rc80211_minstrel-y := \
+ rc80211_minstrel-$(CPTCFG_MAC80211_DEBUGFS) += \
+ 	rc80211_minstrel_ht_debugfs.o
+ 
++rc80211_minstrel-$(CPTCFG_MAC80211_RC_MINSTREL_DEBUGFS_API) += \
++	rc80211_minstrel_ht_api.o
++
+ mac80211-$(CPTCFG_MAC80211_RC_MINSTREL) += $(rc80211_minstrel-y)
+ 
+ ccflags-y += -DDEBUG
+--- a/net/mac80211/rc80211_minstrel_ht.c
++++ b/net/mac80211/rc80211_minstrel_ht.c
+@@ -276,7 +276,8 @@ static const u8 minstrel_sample_seq[] =
+ };
+ 
+ static void
+-minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi);
++minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
++			 bool force);
+ 
+ /*
+  * Some VHT MCSes are invalid (when Ndbps / Nes is not an integer)
+@@ -346,7 +347,7 @@ minstrel_vht_get_group_idx(struct ieee80
+ 
+ static struct minstrel_rate_stats *
+ minstrel_ht_get_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
+-		      struct ieee80211_tx_rate *rate)
++		      struct ieee80211_tx_rate *rate, u16 *dest_idx)
+ {
+ 	int group, idx;
+ 
+@@ -381,6 +382,7 @@ minstrel_ht_get_stats(struct minstrel_pr
+ 
+ 	idx = 0;
+ out:
++	*dest_idx = MI_RATE(group, idx);
+ 	return &mi->groups[group].rates[idx];
+ }
+ 
+@@ -1024,6 +1026,8 @@ minstrel_ht_update_stats(struct minstrel
+ 			tp_rate = tmp_legacy_tp_rate;
+ 
+ 		for (i = MCS_GROUP_RATES - 1; i >= 0; i--) {
++			bool changed;
++
+ 			if (!(mi->supported[group] & BIT(i)))
+ 				continue;
+ 
+@@ -1031,7 +1035,11 @@ minstrel_ht_update_stats(struct minstrel
+ 
+ 			mrs = &mg->rates[i];
+ 			mrs->retry_updated = false;
++			changed = mrs->attempts > 0;
+ 			minstrel_ht_calc_rate_stats(mp, mrs);
++			if (changed)
++				minstrel_ht_report_rate_update(mp, mi, index,
++							       mrs);
+ 
+ 			if (mrs->att_hist)
+ 				last_prob = max(last_prob, mrs->prob_avg);
+@@ -1080,7 +1088,8 @@ minstrel_ht_update_stats(struct minstrel
+ 
+ 	mi->max_prob_rate = tmp_max_prob_rate;
+ 
+-	minstrel_ht_refill_sample_rates(mi);
++	if (!minstrel_ht_manual_mode(mp))
++		minstrel_ht_refill_sample_rates(mi);
+ 
+ #ifdef CPTCFG_MAC80211_DEBUGFS
+ 	/* use fixed index if set */
+@@ -1177,6 +1186,7 @@ minstrel_ht_tx_status(void *priv, struct
+ 	struct minstrel_priv *mp = priv;
+ 	u32 update_interval = mp->update_interval;
+ 	bool last, update = false;
++	u16 rate_list[IEEE80211_TX_MAX_RATES] = {};
+ 	int i;
+ 
+ 	/* This packet was aggregated but doesn't carry status info */
+@@ -1208,13 +1218,15 @@ minstrel_ht_tx_status(void *priv, struct
+ 		last = (i == IEEE80211_TX_MAX_RATES - 1) ||
+ 		       !minstrel_ht_txstat_valid(mp, mi, &ar[i + 1]);
+ 
+-		rate = minstrel_ht_get_stats(mp, mi, &ar[i]);
++		rate = minstrel_ht_get_stats(mp, mi, &ar[i], &rate_list[i]);
+ 		if (last)
+ 			rate->success += info->status.ampdu_ack_len;
+ 
+ 		rate->attempts += ar[i].count * info->status.ampdu_len;
+ 	}
+ 
++	minstrel_ht_report_tx_status(mp, mi, info, rate_list, i);
++
+ 	if (mp->hw->max_rates > 1) {
+ 		/*
+ 		 * check for sudden death of spatial multiplexing,
+@@ -1236,7 +1248,7 @@ minstrel_ht_tx_status(void *priv, struct
+ 	}
+ 
+ 	if (update)
+-		minstrel_ht_update_rates(mp, mi);
++		minstrel_ht_update_rates(mp, mi, false);
+ }
+ 
+ static void
+@@ -1299,7 +1311,7 @@ minstrel_calc_retransmit(struct minstrel
+ }
+ 
+ 
+-static void
++void
+ minstrel_ht_set_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
+                      struct ieee80211_sta_rates *ratetbl, int offset, int index)
+ {
+@@ -1408,11 +1420,15 @@ minstrel_ht_get_max_amsdu_len(struct min
+ }
+ 
+ static void
+-minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
++minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
++			 bool force)
+ {
+ 	struct ieee80211_sta_rates *rates;
+ 	int i = 0;
+ 
++	if (minstrel_ht_manual_mode(mp) && !force)
++		return;
++
+ 	rates = kzalloc(sizeof(*rates), GFP_ATOMIC);
+ 	if (!rates)
+ 		return;
+@@ -1439,7 +1455,7 @@ minstrel_ht_get_sample_rate(struct minst
+ {
+ 	u8 seq;
+ 
+-	if (mp->hw->max_rates > 1) {
++	if (mp->hw->max_rates > 1 && !minstrel_ht_manual_mode(mp)) {
+ 		seq = mi->sample_seq;
+ 		mi->sample_seq = (seq + 1) % ARRAY_SIZE(minstrel_sample_seq);
+ 		seq = minstrel_sample_seq[seq];
+@@ -1689,7 +1705,9 @@ minstrel_ht_update_caps(void *priv, stru
+ 
+ 	/* create an initial rate table with the lowest supported rates */
+ 	minstrel_ht_update_stats(mp, mi);
+-	minstrel_ht_update_rates(mp, mi);
++	minstrel_ht_update_rates(mp, mi, true);
++
++	minstrel_ht_sta_update(mp, mi);
+ }
+ 
+ static void
+@@ -1725,12 +1743,18 @@ minstrel_ht_alloc_sta(void *priv, struct
+ 			max_rates = sband->n_bitrates;
+ 	}
+ 
+-	return kzalloc(sizeof(*mi), gfp);
++	mi = kzalloc(sizeof(*mi), gfp);
++#ifdef CPTCFG_MAC80211_RC_MINSTREL_DEBUGFS_API
++	INIT_LIST_HEAD(&mi->list);
++#endif
++
++	return mi;
+ }
+ 
+ static void
+ minstrel_ht_free_sta(void *priv, struct ieee80211_sta *sta, void *priv_sta)
+ {
++	minstrel_ht_sta_remove(priv, priv_sta);
+ 	kfree(priv_sta);
+ }
+ 
+@@ -1841,12 +1865,14 @@ static void minstrel_ht_add_debugfs(stru
+ 	mp->fixed_rate_idx = (u32) -1;
+ 	debugfs_create_u32("fixed_rate_idx", S_IRUGO | S_IWUGO, debugfsdir,
+ 			   &mp->fixed_rate_idx);
++	minstrel_ht_add_debugfs_api(hw, priv, debugfsdir);
+ }
+ #endif
+ 
+ static void
+ minstrel_ht_free(void *priv)
+ {
++	minstrel_ht_remove_debugfs_api(priv);
+ 	kfree(priv);
+ }
+ 
+--- a/net/mac80211/rc80211_minstrel_ht.h
++++ b/net/mac80211/rc80211_minstrel_ht.h
+@@ -72,6 +72,10 @@
+ #define MINSTREL_SAMPLE_RATES		5 /* rates per sample type */
+ #define MINSTREL_SAMPLE_INTERVAL	(HZ / 50)
+ 
++#define MINSTREL_MONITOR_STA		BIT(0)
++#define MINSTREL_MONITOR_TXS		BIT(1)
++#define MINSTREL_MONITOR_STATS		BIT(2)
++
+ struct minstrel_priv {
+ 	struct ieee80211_hw *hw;
+ 	bool has_mrr;
+@@ -93,6 +97,13 @@ struct minstrel_priv {
+ 	 */
+ 	u32 fixed_rate_idx;
+ #endif
++#ifdef CPTCFG_MAC80211_RC_MINSTREL_DEBUGFS_API
++	struct rchan *relay_ev;
++	struct list_head stations;
++	spinlock_t lock;
++	u8 monitor;
++	bool manual;
++#endif
+ };
+ 
+ 
+@@ -153,6 +164,9 @@ struct minstrel_sample_category {
+ };
+ 
+ struct minstrel_ht_sta {
++#ifdef CPTCFG_MAC80211_RC_MINSTREL_DEBUGFS_API
++	struct list_head list;
++#endif
+ 	struct ieee80211_sta *sta;
+ 
+ 	/* ampdu length (average, per sampling interval) */
+@@ -197,6 +211,80 @@ struct minstrel_ht_sta {
+ };
+ 
+ void minstrel_ht_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir);
++
++#ifdef CPTCFG_MAC80211_RC_MINSTREL_DEBUGFS_API
++void minstrel_ht_sta_update(struct minstrel_priv *mp, struct minstrel_ht_sta *mi);
++void minstrel_ht_sta_remove(struct minstrel_priv *mp, struct minstrel_ht_sta *mi);
++void __minstrel_ht_report_tx_status(struct minstrel_priv *mp,
++				    struct minstrel_ht_sta *mi,
++				    struct ieee80211_tx_info *info,
++				    u16 *rate_list, int n_rates);
++void __minstrel_ht_report_rate_update(struct minstrel_priv *mp,
++				      struct minstrel_ht_sta *mi, u16 rate,
++				      struct minstrel_rate_stats *mrs);
++void minstrel_ht_add_debugfs_api(struct ieee80211_hw *hw, void *priv,
++				 struct dentry *dir);
++void minstrel_ht_remove_debugfs_api(void *priv);
++#else
++static inline void
++minstrel_ht_sta_update(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
++{
++}
++static inline void
++minstrel_ht_sta_remove(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
++{
++}
++static inline void
++minstrel_ht_add_debugfs_api(struct ieee80211_hw *hw, void *priv,
++			    struct dentry *dir)
++{
++}
++static inline void
++minstrel_ht_remove_debugfs_api(void *priv)
++{
++}
++#endif
++
++static inline void
++minstrel_ht_report_tx_status(struct minstrel_priv *mp,
++			     struct minstrel_ht_sta *mi,
++			     struct ieee80211_tx_info *info,
++			     u16 *rate_list, int n_rates)
++{
++#ifdef CPTCFG_MAC80211_RC_MINSTREL_DEBUGFS_API
++	if (!(mp->monitor & MINSTREL_MONITOR_TXS))
++		return;
++
++	__minstrel_ht_report_tx_status(mp, mi, info, rate_list, n_rates);
++#endif
++}
++
++static inline void
++minstrel_ht_report_rate_update(struct minstrel_priv *mp,
++			       struct minstrel_ht_sta *mi, u16 rate,
++			       struct minstrel_rate_stats *mrs)
++{
++#ifdef CPTCFG_MAC80211_RC_MINSTREL_DEBUGFS_API
++	if (!(mp->monitor & MINSTREL_MONITOR_STATS))
++		return;
++
++	__minstrel_ht_report_rate_update(mp, mi, rate, mrs);
++#endif
++}
++
++static inline bool
++minstrel_ht_manual_mode(struct minstrel_priv *mp)
++{
++#ifdef CPTCFG_MAC80211_RC_MINSTREL_DEBUGFS_API
++	return mp->manual;
++#else
++	return false;
++#endif
++}
++
++void minstrel_ht_set_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
++						  struct ieee80211_sta_rates *ratetbl, int offset,
++						  int index);
+ int minstrel_ht_get_tp_avg(struct minstrel_ht_sta *mi, int group, int rate,
+ 			   int prob_avg);
+ 
+--- /dev/null
++++ b/net/mac80211/rc80211_minstrel_ht_api.c
+@@ -0,0 +1,540 @@
++// SPDX-License-Identifier: GPL-2.0-only
++/*
++ * Copyright (C) 2021 Felix Fietkau <nbd at nbd.name>
++ */
++#include <linux/kernel.h>
++#include <linux/debugfs.h>
++#include <linux/relay.h>
++#include <net/mac80211.h>
++#include "rc80211_minstrel_ht.h"
++
++enum sta_cmd {
++	STA_CMD_PROBE,
++	STA_CMD_RATES,
++};
++
++static void
++minstrel_ht_print_rate_durations(struct seq_file *s, int group)
++{
++	const struct mcs_group *g = &minstrel_mcs_groups[group];
++	int n_rates;
++	int i;
++
++	if (g->flags & IEEE80211_TX_RC_VHT_MCS)
++		n_rates = 10;
++	else
++		n_rates = 8;
++
++	seq_printf(s, "%x", g->duration[0] << g->shift);
++	for (i = 1; i < n_rates; i++)
++		seq_printf(s, ",%x", g->duration[i] << g->shift);
++}
++
++static int
++minstrel_ht_read_api_info(struct seq_file *s, void *data)
++{
++	int i;
++
++	seq_printf(s, "#group;index;offset;type;nss;bw;gi;airtime\n");
++	seq_printf(s, "#sta;action;macaddr;overhead_mcs;overhead_legacy;supported\n");
++	seq_printf(s, "#txs;macaddr;num_frames;num_acked;probe;rates;counts\n");
++	seq_printf(s, "#stats;macaddr;rate;avg_prob;avg_tp;cur_success;cur_attempts;hist_success;hist_attempts\n");
++	seq_printf(s, "#rates;macaddr;rates;counts\n");
++	seq_printf(s, "#probe;macaddr;rate\n");
++	for (i = 0; i < MINSTREL_GROUPS_NB; i++) {
++		const struct mcs_group *g = &minstrel_mcs_groups[i];
++		const char *type;
++
++		if (i == MINSTREL_CCK_GROUP)
++			type = "cck";
++		else if (i == MINSTREL_OFDM_GROUP)
++			type = "ofdm";
++		else if (g->flags & IEEE80211_TX_RC_VHT_MCS)
++			type = "vht";
++		else
++			type = "ht";
++
++		seq_printf(s, "group;%x;%x;%s;%x;%x;%x;",
++			   i, (u32) MI_RATE(i, 0), type, g->streams, g->bw,
++			   !!(g->flags & IEEE80211_TX_RC_SHORT_GI));
++		minstrel_ht_print_rate_durations(s, i);
++		seq_printf(s, "\n");
++	}
++
++	return 0;
++}
++
++static struct dentry *
++create_buf_file_cb(const char *filename, struct dentry *parent, umode_t mode,
++		   struct rchan_buf *buf, int *is_global)
++{
++	struct dentry *f;
++
++	f = debugfs_create_file("api_event", mode, parent, buf,
++				&relay_file_operations);
++	if (IS_ERR(f))
++		return NULL;
++
++	*is_global = 1;
++
++	return f;
++}
++
++static int
++remove_buf_file_cb(struct dentry *f)
++{
++	debugfs_remove(f);
++
++	return 0;
++}
++
++static struct rchan_callbacks relay_ev_cb = {
++	.create_buf_file = create_buf_file_cb,
++	.remove_buf_file = remove_buf_file_cb,
++};
++
++static void
++minstrel_ht_dump_sta(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
++		     const char *type)
++{
++	char info[64 + MINSTREL_GROUPS_NB * 4];
++	int ofs = 0;
++	int i;
++
++	ofs += scnprintf(info + ofs, sizeof(info) - ofs, "%llx;sta;%s;%pM;%x;%x;",
++			(unsigned long long)ktime_get_boottime_ns(),
++			 type, mi->sta->addr, mi->overhead, mi->overhead_legacy);
++
++	ofs += scnprintf(info + ofs, sizeof(info) - ofs, "%x",
++			 mi->supported[0]);
++	for (i = 1; i < MINSTREL_GROUPS_NB; i++)
++		ofs += scnprintf(info + ofs, sizeof(info) - ofs, ",%x",
++				 mi->supported[i]);
++
++	ofs += scnprintf(info + ofs, sizeof(info) - ofs, "\n");
++	relay_write(mp->relay_ev, info, ofs);
++	relay_flush(mp->relay_ev);
++}
++
++static void
++__minstrel_ht_dump_stations(struct minstrel_priv *mp, const char *type)
++{
++	struct minstrel_ht_sta *mi;
++
++	list_for_each_entry(mi, &mp->stations, list)
++		minstrel_ht_dump_sta(mp, mi, type);
++}
++
++static void
++minstrel_ht_dump_stations(struct minstrel_priv *mp)
++{
++	spin_lock_bh(&mp->lock);
++	__minstrel_ht_dump_stations(mp, "dump");
++	spin_unlock_bh(&mp->lock);
++}
++
++static void
++minstrel_ht_api_start(struct minstrel_priv *mp, char *params)
++{
++	char *cur;
++	u8 mask = 0;
++
++	spin_lock_bh(&mp->lock);
++
++	while ((cur = strsep(&params, ";")) != NULL) {
++		if (!strlen(cur))
++			break;
++
++		if (!strcmp(cur, "txs"))
++			mask |= MINSTREL_MONITOR_TXS;
++		else if (!strcmp(cur, "sta"))
++			mask |= MINSTREL_MONITOR_STA;
++		else if (!strcmp(cur, "stats"))
++			mask |= MINSTREL_MONITOR_STATS;
++	}
++
++	if (!mask)
++		mask = MINSTREL_MONITOR_TXS;
++
++	if (!mp->monitor)
++		__minstrel_ht_dump_stations(mp, "add");
++	mp->monitor = mask | MINSTREL_MONITOR_STA;
++
++	spin_unlock_bh(&mp->lock);
++}
++
++static void
++minstrel_ht_api_stop(struct minstrel_priv *mp)
++{
++	spin_lock_bh(&mp->lock);
++	mp->monitor = 0;
++	relay_reset(mp->relay_ev);
++	spin_unlock_bh(&mp->lock);
++}
++
++static void
++minstrel_ht_reset_sample_table(struct minstrel_ht_sta *mi)
++{
++	memset(mi->sample[MINSTREL_SAMPLE_TYPE_INC].sample_rates, 0,
++	       sizeof(mi->sample[MINSTREL_SAMPLE_TYPE_INC].sample_rates));
++}
++
++static void
++minstrel_ht_api_set_manual(struct minstrel_priv *mp, bool manual)
++{
++	struct minstrel_ht_sta *mi;
++
++	mp->manual = manual;
++
++	spin_lock_bh(&mp->lock);
++	list_for_each_entry(mi, &mp->stations, list)
++		minstrel_ht_reset_sample_table(mi);
++	spin_unlock_bh(&mp->lock);
++}
++
++static struct minstrel_ht_sta *
++minstrel_ht_api_get_sta(struct minstrel_priv *mp, const u8 *macaddr)
++{
++	struct minstrel_ht_sta *mi;
++
++	list_for_each_entry(mi, &mp->stations, list) {
++		if (!memcmp(mi->sta->addr, macaddr, ETH_ALEN))
++			return mi;
++	}
++
++	return NULL;
++}
++
++static int
++minstrel_ht_get_args(char **dest, int dest_size, char *str, char *sep)
++{
++	int i, n;
++
++	for (i = 0, n = 0; i < dest_size; i++) {
++		if (!str) {
++			dest[i] = NULL;
++			continue;
++		}
++
++		dest[i] = strsep(&str, sep);
++		if (dest[i])
++			n++;
++	}
++
++	return n;
++}
++
++static bool
++minstrel_ht_valid_rate(struct minstrel_ht_sta *mi, u32 rate)
++{
++	int group, idx;
++
++	group = MI_RATE_GROUP(rate);
++	if (group >= MINSTREL_GROUPS_NB)
++		return false;
++
++	idx = MI_RATE_IDX(rate);
++
++	return !!(mi->supported[group] & BIT(idx));
++}
++
++static int
++minstrel_ht_rate_from_str(struct minstrel_ht_sta *mi, const char *str)
++{
++	unsigned int rate;
++
++	if (kstrtouint(str, 16, &rate))
++		return -EINVAL;
++
++	if (!minstrel_ht_valid_rate(mi, rate))
++		return -EINVAL;
++
++	return rate;
++}
++
++static int
++minstrel_ht_set_probe_rate(struct minstrel_ht_sta *mi, const char *rate_str)
++{
++	u16 *sample_rates;
++	int rate, i;
++
++	if (!rate_str)
++		return -EINVAL;
++
++	rate = minstrel_ht_rate_from_str(mi, rate_str);
++	if (rate < 0)
++		return rate;
++
++	sample_rates = mi->sample[MINSTREL_SAMPLE_TYPE_INC].sample_rates;
++	for (i = 0; i < MINSTREL_SAMPLE_RATES; i++) {
++		if (sample_rates[i])
++			continue;
++
++		sample_rates[i] = rate;
++		mi->sample_time = jiffies;
++		return 0;
++	}
++
++	return -ENOSPC;
++}
++
++static int
++minstrel_ht_set_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
++		      char *rate_str, char *count_str)
++{
++	struct ieee80211_sta_rates *ratetbl;
++	unsigned int count;
++	char *countlist[4];
++	char *ratelist[4];
++	int rate;
++	int n_rates;
++	int n_count;
++	int err = -EINVAL;
++	int i;
++
++	if (!rate_str || !count_str)
++		return -EINVAL;
++
++	ratetbl = kzalloc(sizeof(*ratetbl), GFP_ATOMIC);
++	if (!ratetbl)
++		return -ENOMEM;
++
++	n_rates = minstrel_ht_get_args(ratelist, ARRAY_SIZE(ratelist),
++				       rate_str, ",");
++	n_count = minstrel_ht_get_args(countlist, ARRAY_SIZE(countlist),
++				       count_str, ",");
++	for (i = 0; i < min(n_rates, n_count); i++) {
++		rate = minstrel_ht_rate_from_str(mi, ratelist[i]);
++		if (rate < 0)
++			goto error;
++
++		if (kstrtouint(countlist[0], 16, &count))
++			goto error;
++
++		minstrel_ht_set_rate(mp, mi, ratetbl, i, rate);
++		ratetbl->rate[i].count = count;
++		ratetbl->rate[i].count_rts = count;
++		ratetbl->rate[i].count_cts = count;
++	}
++
++	rate_control_set_rates(mp->hw, mi->sta, ratetbl);
++
++	return 0;
++
++error:
++	kfree(ratetbl);
++	return err;
++}
++
++static int
++minstrel_ht_api_sta_cmd(struct minstrel_priv *mp, enum sta_cmd cmd,
++			char *arg_str)
++{
++	struct minstrel_ht_sta *mi;
++	uint8_t macaddr[ETH_ALEN];
++	char *args[3];
++	int n_args;
++	int ret = -EINVAL;
++
++	spin_lock_bh(&mp->lock);
++	if (!mp->manual)
++		goto out;
++
++	n_args = minstrel_ht_get_args(args, ARRAY_SIZE(args), arg_str, ";");
++	if (!args[0])
++		goto out;
++
++	if (!mac_pton(args[0], macaddr))
++		goto out;
++
++	mi = minstrel_ht_api_get_sta(mp, macaddr);
++	if (!mi) {
++		ret = -ENOENT;
++		goto out;
++	}
++
++	switch (cmd) {
++	case STA_CMD_PROBE:
++		ret = minstrel_ht_set_probe_rate(mi, args[1]);
++		break;
++	case STA_CMD_RATES:
++		ret = minstrel_ht_set_rates(mp, mi, args[1], args[2]);
++		break;
++	}
++
++out:
++	spin_unlock_bh(&mp->lock);
++
++	return ret;
++}
++
++static ssize_t
++minstrel_ht_control_write(struct file *file, const char __user *userbuf,
++			  size_t count, loff_t *ppos)
++{
++	struct minstrel_priv *mp = file->private_data;
++	char *pos, *cur;
++	char buf[64];
++	size_t len = count;
++	int err;
++
++	if (len > sizeof(buf) - 1)
++		return -EINVAL;
++
++	if (copy_from_user(buf, userbuf, len))
++		return -EFAULT;
++
++	if (count > 0 && buf[len - 1] == '\n')
++		len--;
++
++	buf[len] = 0;
++	if (!len)
++		return count;
++
++	pos = buf;
++	cur = strsep(&pos, ";");
++
++	err = 0;
++	if (!strcmp(cur, "dump"))
++		minstrel_ht_dump_stations(mp);
++	else if (!strcmp(cur, "start"))
++		minstrel_ht_api_start(mp, pos);
++	else if (!strcmp(cur, "stop"))
++		minstrel_ht_api_stop(mp);
++	else if (!strcmp(cur, "manual"))
++		minstrel_ht_api_set_manual(mp, true);
++	else if (!strcmp(cur, "auto"))
++		minstrel_ht_api_set_manual(mp, false);
++	else if (!strcmp(cur, "rates"))
++		err = minstrel_ht_api_sta_cmd(mp, STA_CMD_RATES, pos);
++	else if (!strcmp(cur, "probe"))
++		err = minstrel_ht_api_sta_cmd(mp, STA_CMD_PROBE, pos);
++	else
++		err = -EINVAL;
++
++	if (err)
++		return err;
++
++	return count;
++}
++
++static const struct file_operations fops_control = {
++	.open = simple_open,
++	.llseek = generic_file_llseek,
++	.write = minstrel_ht_control_write,
++};
++
++void minstrel_ht_sta_update(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
++{
++	bool add = list_empty(&mi->list);
++
++	spin_lock_bh(&mp->lock);
++	if (add)
++		list_add(&mi->list, &mp->stations);
++	if (mp->monitor)
++		minstrel_ht_dump_sta(mp, mi, add ? "add" : "update");
++	spin_unlock_bh(&mp->lock);
++}
++
++void minstrel_ht_sta_remove(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
++{
++	char info[64];
++	int ofs = 0;
++
++	spin_lock_bh(&mp->lock);
++	list_del_init(&mi->list);
++
++	if (!mp->monitor)
++		goto out;
++
++	ofs = scnprintf(info, sizeof(info), "%llx;sta;remove;%pM;;;\n",
++			(unsigned long long)ktime_get_boottime_ns(),
++			mi->sta->addr);
++	relay_write(mp->relay_ev, info, ofs);
++	relay_flush(mp->relay_ev);
++
++out:
++	spin_unlock_bh(&mp->lock);
++}
++
++void __minstrel_ht_report_tx_status(struct minstrel_priv *mp,
++				    struct minstrel_ht_sta *mi,
++				    struct ieee80211_tx_info *info,
++				    u16 *rate_list,
++				    int n_rates)
++{
++	char txs[64 + IEEE80211_TX_MAX_RATES * 8];
++	int ofs = 0;
++	int i;
++
++	if (!n_rates)
++		return;
++
++	ofs += scnprintf(txs, sizeof(txs), "%llx;txs;%pM;%x;%x;%x;",
++			 (unsigned long long)ktime_get_boottime_ns(),
++			 mi->sta->addr,
++			 info->status.ampdu_len,
++			 info->status.ampdu_ack_len,
++			 !!(info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE));
++
++	ofs += scnprintf(txs + ofs, sizeof(txs) - ofs, "%x",
++			 rate_list[0]);
++	for (i = 1; i < n_rates; i++)
++		ofs += scnprintf(txs + ofs, sizeof(txs) - ofs, ",%x",
++				 rate_list[i]);
++
++	ofs += scnprintf(txs + ofs, sizeof(txs) - ofs, ";%x",
++			 info->status.rates[0].count);
++	for (i = 1; i < n_rates; i++)
++		ofs += scnprintf(txs + ofs, sizeof(txs) - ofs, ",%x",
++				 info->status.rates[i].count);
++	ofs += scnprintf(txs + ofs, sizeof(txs) - ofs, "\n");
++	relay_write(mp->relay_ev, txs, ofs);
++	relay_flush(mp->relay_ev);
++}
++
++void __minstrel_ht_report_rate_update(struct minstrel_priv *mp,
++				      struct minstrel_ht_sta *mi, u16 rate,
++				      struct minstrel_rate_stats *mrs)
++{
++	char stat[100];
++	int ofs;
++	int tp;
++
++	tp = minstrel_ht_get_tp_avg(mi, MI_RATE_GROUP(rate), MI_RATE_IDX(rate),
++				    mrs->prob_avg);
++
++	ofs = scnprintf(stat, sizeof(stat),
++			"%llx;stats;%pM;%x;%x;%x;%x;%x;%x;%x\n",
++			(unsigned long long)ktime_get_boottime_ns(),
++			mi->sta->addr, rate,
++			MINSTREL_TRUNC(mrs->prob_avg * 1000), tp,
++			mrs->last_success,
++			mrs->last_attempts,
++			mrs->succ_hist, mrs->att_hist);
++
++	relay_write(mp->relay_ev, stat, ofs);
++	relay_flush(mp->relay_ev);
++}
++
++void minstrel_ht_add_debugfs_api(struct ieee80211_hw *hw, void *priv,
++				 struct dentry *dir)
++{
++	struct minstrel_priv *mp = priv;
++
++	spin_lock_init(&mp->lock);
++	INIT_LIST_HEAD(&mp->stations);
++	mp->relay_ev = relay_open("api_event", dir, 256, 512, &relay_ev_cb,
++				  NULL);
++	debugfs_create_devm_seqfile(&hw->wiphy->dev, "api_info",
++				    dir, minstrel_ht_read_api_info);
++	debugfs_create_file("api_control", 0200, dir, mp, &fops_control);
++}
++
++void minstrel_ht_remove_debugfs_api(void *priv)
++{
++	struct minstrel_priv *mp = priv;
++
++	if (mp->relay_ev)
++		relay_close(mp->relay_ev);
++}


From lede-commits at lists.infradead.org  Fri Jun 18 00:56:31 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 18 Jun 2021 03:56:31 -0400
Subject: [openwrt/openwrt] mac80211: remove extra patch accidentally added
 during rebase
In-Reply-To: <162400299156.573.738696036401535313@git-01.infra.openwrt.org>
References: <162400299156.573.738696036401535313@git-01.infra.openwrt.org>
Message-ID: <mailman.1177.1624002998.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/165a0263643af6831edcef28d2863babb660d24b

commit 165a0263643af6831edcef28d2863babb660d24b
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri Jun 18 09:55:46 2021 +0200

    mac80211: remove extra patch accidentally added during rebase
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...nstrel_ht-add-debugfs-monitoring-controll.patch | 888 ---------------------
 1 file changed, 888 deletions(-)

diff --git a/package/kernel/mac80211/patches/subsys/361-mac80211-minstrel_ht-add-debugfs-monitoring-controll.patch b/package/kernel/mac80211/patches/subsys/361-mac80211-minstrel_ht-add-debugfs-monitoring-controll.patch
deleted file mode 100644
index ef57234bea..0000000000
--- a/package/kernel/mac80211/patches/subsys/361-mac80211-minstrel_ht-add-debugfs-monitoring-controll.patch
+++ /dev/null
@@ -1,888 +0,0 @@
-From: Felix Fietkau <nbd at nbd.name>
-Date: Mon, 1 Feb 2021 10:47:58 +0100
-Subject: [PATCH] mac80211: minstrel_ht: add debugfs monitoring/controlling
- API
-
-This allows user space to monitor tx status and take over rate control
-functionality.
-
-Signed-off-by: Felix Fietkau <nbd at nbd.name>
----
- create mode 100644 net/mac80211/rc80211_minstrel_ht_api.c
-
---- a/local-symbols
-+++ b/local-symbols
-@@ -49,6 +49,7 @@ LIB80211_DEBUG=
- MAC80211=
- MAC80211_HAS_RC=
- MAC80211_RC_MINSTREL=
-+MAC80211_RC_MINSTREL_DEBUGFS_API=
- MAC80211_RC_DEFAULT_MINSTREL=
- MAC80211_RC_DEFAULT=
- MAC80211_MESH=
---- a/net/mac80211/Kconfig
-+++ b/net/mac80211/Kconfig
-@@ -29,6 +29,15 @@ config MAC80211_RC_MINSTREL
- 	help
- 	  This option enables the 'minstrel' TX rate control algorithm
- 
-+config MAC80211_RC_MINSTREL_DEBUGFS_API
-+	bool "Minstrel debugfs userspace control API"
-+	depends on MAC80211_RC_MINSTREL
-+	depends on MAC80211_DEBUGFS
-+	select RELAY
-+	help
-+	  This option creates debugfs files that allow user space to observe
-+	  and/or control minstrel rate selection behavior
-+
- choice
- 	prompt "Default rate control algorithm"
- 	depends on MAC80211_HAS_RC
---- a/net/mac80211/Makefile
-+++ b/net/mac80211/Makefile
-@@ -61,6 +61,9 @@ rc80211_minstrel-y := \
- rc80211_minstrel-$(CPTCFG_MAC80211_DEBUGFS) += \
- 	rc80211_minstrel_ht_debugfs.o
- 
-+rc80211_minstrel-$(CPTCFG_MAC80211_RC_MINSTREL_DEBUGFS_API) += \
-+	rc80211_minstrel_ht_api.o
-+
- mac80211-$(CPTCFG_MAC80211_RC_MINSTREL) += $(rc80211_minstrel-y)
- 
- ccflags-y += -DDEBUG
---- a/net/mac80211/rc80211_minstrel_ht.c
-+++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -276,7 +276,8 @@ static const u8 minstrel_sample_seq[] =
- };
- 
- static void
--minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi);
-+minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
-+			 bool force);
- 
- /*
-  * Some VHT MCSes are invalid (when Ndbps / Nes is not an integer)
-@@ -346,7 +347,7 @@ minstrel_vht_get_group_idx(struct ieee80
- 
- static struct minstrel_rate_stats *
- minstrel_ht_get_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
--		      struct ieee80211_tx_rate *rate)
-+		      struct ieee80211_tx_rate *rate, u16 *dest_idx)
- {
- 	int group, idx;
- 
-@@ -381,6 +382,7 @@ minstrel_ht_get_stats(struct minstrel_pr
- 
- 	idx = 0;
- out:
-+	*dest_idx = MI_RATE(group, idx);
- 	return &mi->groups[group].rates[idx];
- }
- 
-@@ -1024,6 +1026,8 @@ minstrel_ht_update_stats(struct minstrel
- 			tp_rate = tmp_legacy_tp_rate;
- 
- 		for (i = MCS_GROUP_RATES - 1; i >= 0; i--) {
-+			bool changed;
-+
- 			if (!(mi->supported[group] & BIT(i)))
- 				continue;
- 
-@@ -1031,7 +1035,11 @@ minstrel_ht_update_stats(struct minstrel
- 
- 			mrs = &mg->rates[i];
- 			mrs->retry_updated = false;
-+			changed = mrs->attempts > 0;
- 			minstrel_ht_calc_rate_stats(mp, mrs);
-+			if (changed)
-+				minstrel_ht_report_rate_update(mp, mi, index,
-+							       mrs);
- 
- 			if (mrs->att_hist)
- 				last_prob = max(last_prob, mrs->prob_avg);
-@@ -1080,7 +1088,8 @@ minstrel_ht_update_stats(struct minstrel
- 
- 	mi->max_prob_rate = tmp_max_prob_rate;
- 
--	minstrel_ht_refill_sample_rates(mi);
-+	if (!minstrel_ht_manual_mode(mp))
-+		minstrel_ht_refill_sample_rates(mi);
- 
- #ifdef CPTCFG_MAC80211_DEBUGFS
- 	/* use fixed index if set */
-@@ -1177,6 +1186,7 @@ minstrel_ht_tx_status(void *priv, struct
- 	struct minstrel_priv *mp = priv;
- 	u32 update_interval = mp->update_interval;
- 	bool last, update = false;
-+	u16 rate_list[IEEE80211_TX_MAX_RATES] = {};
- 	int i;
- 
- 	/* This packet was aggregated but doesn't carry status info */
-@@ -1208,13 +1218,15 @@ minstrel_ht_tx_status(void *priv, struct
- 		last = (i == IEEE80211_TX_MAX_RATES - 1) ||
- 		       !minstrel_ht_txstat_valid(mp, mi, &ar[i + 1]);
- 
--		rate = minstrel_ht_get_stats(mp, mi, &ar[i]);
-+		rate = minstrel_ht_get_stats(mp, mi, &ar[i], &rate_list[i]);
- 		if (last)
- 			rate->success += info->status.ampdu_ack_len;
- 
- 		rate->attempts += ar[i].count * info->status.ampdu_len;
- 	}
- 
-+	minstrel_ht_report_tx_status(mp, mi, info, rate_list, i);
-+
- 	if (mp->hw->max_rates > 1) {
- 		/*
- 		 * check for sudden death of spatial multiplexing,
-@@ -1236,7 +1248,7 @@ minstrel_ht_tx_status(void *priv, struct
- 	}
- 
- 	if (update)
--		minstrel_ht_update_rates(mp, mi);
-+		minstrel_ht_update_rates(mp, mi, false);
- }
- 
- static void
-@@ -1299,7 +1311,7 @@ minstrel_calc_retransmit(struct minstrel
- }
- 
- 
--static void
-+void
- minstrel_ht_set_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
-                      struct ieee80211_sta_rates *ratetbl, int offset, int index)
- {
-@@ -1408,11 +1420,15 @@ minstrel_ht_get_max_amsdu_len(struct min
- }
- 
- static void
--minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
-+minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
-+			 bool force)
- {
- 	struct ieee80211_sta_rates *rates;
- 	int i = 0;
- 
-+	if (minstrel_ht_manual_mode(mp) && !force)
-+		return;
-+
- 	rates = kzalloc(sizeof(*rates), GFP_ATOMIC);
- 	if (!rates)
- 		return;
-@@ -1439,7 +1455,7 @@ minstrel_ht_get_sample_rate(struct minst
- {
- 	u8 seq;
- 
--	if (mp->hw->max_rates > 1) {
-+	if (mp->hw->max_rates > 1 && !minstrel_ht_manual_mode(mp)) {
- 		seq = mi->sample_seq;
- 		mi->sample_seq = (seq + 1) % ARRAY_SIZE(minstrel_sample_seq);
- 		seq = minstrel_sample_seq[seq];
-@@ -1689,7 +1705,9 @@ minstrel_ht_update_caps(void *priv, stru
- 
- 	/* create an initial rate table with the lowest supported rates */
- 	minstrel_ht_update_stats(mp, mi);
--	minstrel_ht_update_rates(mp, mi);
-+	minstrel_ht_update_rates(mp, mi, true);
-+
-+	minstrel_ht_sta_update(mp, mi);
- }
- 
- static void
-@@ -1725,12 +1743,18 @@ minstrel_ht_alloc_sta(void *priv, struct
- 			max_rates = sband->n_bitrates;
- 	}
- 
--	return kzalloc(sizeof(*mi), gfp);
-+	mi = kzalloc(sizeof(*mi), gfp);
-+#ifdef CPTCFG_MAC80211_RC_MINSTREL_DEBUGFS_API
-+	INIT_LIST_HEAD(&mi->list);
-+#endif
-+
-+	return mi;
- }
- 
- static void
- minstrel_ht_free_sta(void *priv, struct ieee80211_sta *sta, void *priv_sta)
- {
-+	minstrel_ht_sta_remove(priv, priv_sta);
- 	kfree(priv_sta);
- }
- 
-@@ -1841,12 +1865,14 @@ static void minstrel_ht_add_debugfs(stru
- 	mp->fixed_rate_idx = (u32) -1;
- 	debugfs_create_u32("fixed_rate_idx", S_IRUGO | S_IWUGO, debugfsdir,
- 			   &mp->fixed_rate_idx);
-+	minstrel_ht_add_debugfs_api(hw, priv, debugfsdir);
- }
- #endif
- 
- static void
- minstrel_ht_free(void *priv)
- {
-+	minstrel_ht_remove_debugfs_api(priv);
- 	kfree(priv);
- }
- 
---- a/net/mac80211/rc80211_minstrel_ht.h
-+++ b/net/mac80211/rc80211_minstrel_ht.h
-@@ -72,6 +72,10 @@
- #define MINSTREL_SAMPLE_RATES		5 /* rates per sample type */
- #define MINSTREL_SAMPLE_INTERVAL	(HZ / 50)
- 
-+#define MINSTREL_MONITOR_STA		BIT(0)
-+#define MINSTREL_MONITOR_TXS		BIT(1)
-+#define MINSTREL_MONITOR_STATS		BIT(2)
-+
- struct minstrel_priv {
- 	struct ieee80211_hw *hw;
- 	bool has_mrr;
-@@ -93,6 +97,13 @@ struct minstrel_priv {
- 	 */
- 	u32 fixed_rate_idx;
- #endif
-+#ifdef CPTCFG_MAC80211_RC_MINSTREL_DEBUGFS_API
-+	struct rchan *relay_ev;
-+	struct list_head stations;
-+	spinlock_t lock;
-+	u8 monitor;
-+	bool manual;
-+#endif
- };
- 
- 
-@@ -153,6 +164,9 @@ struct minstrel_sample_category {
- };
- 
- struct minstrel_ht_sta {
-+#ifdef CPTCFG_MAC80211_RC_MINSTREL_DEBUGFS_API
-+	struct list_head list;
-+#endif
- 	struct ieee80211_sta *sta;
- 
- 	/* ampdu length (average, per sampling interval) */
-@@ -197,6 +211,80 @@ struct minstrel_ht_sta {
- };
- 
- void minstrel_ht_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir);
-+
-+#ifdef CPTCFG_MAC80211_RC_MINSTREL_DEBUGFS_API
-+void minstrel_ht_sta_update(struct minstrel_priv *mp, struct minstrel_ht_sta *mi);
-+void minstrel_ht_sta_remove(struct minstrel_priv *mp, struct minstrel_ht_sta *mi);
-+void __minstrel_ht_report_tx_status(struct minstrel_priv *mp,
-+				    struct minstrel_ht_sta *mi,
-+				    struct ieee80211_tx_info *info,
-+				    u16 *rate_list, int n_rates);
-+void __minstrel_ht_report_rate_update(struct minstrel_priv *mp,
-+				      struct minstrel_ht_sta *mi, u16 rate,
-+				      struct minstrel_rate_stats *mrs);
-+void minstrel_ht_add_debugfs_api(struct ieee80211_hw *hw, void *priv,
-+				 struct dentry *dir);
-+void minstrel_ht_remove_debugfs_api(void *priv);
-+#else
-+static inline void
-+minstrel_ht_sta_update(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
-+{
-+}
-+static inline void
-+minstrel_ht_sta_remove(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
-+{
-+}
-+static inline void
-+minstrel_ht_add_debugfs_api(struct ieee80211_hw *hw, void *priv,
-+			    struct dentry *dir)
-+{
-+}
-+static inline void
-+minstrel_ht_remove_debugfs_api(void *priv)
-+{
-+}
-+#endif
-+
-+static inline void
-+minstrel_ht_report_tx_status(struct minstrel_priv *mp,
-+			     struct minstrel_ht_sta *mi,
-+			     struct ieee80211_tx_info *info,
-+			     u16 *rate_list, int n_rates)
-+{
-+#ifdef CPTCFG_MAC80211_RC_MINSTREL_DEBUGFS_API
-+	if (!(mp->monitor & MINSTREL_MONITOR_TXS))
-+		return;
-+
-+	__minstrel_ht_report_tx_status(mp, mi, info, rate_list, n_rates);
-+#endif
-+}
-+
-+static inline void
-+minstrel_ht_report_rate_update(struct minstrel_priv *mp,
-+			       struct minstrel_ht_sta *mi, u16 rate,
-+			       struct minstrel_rate_stats *mrs)
-+{
-+#ifdef CPTCFG_MAC80211_RC_MINSTREL_DEBUGFS_API
-+	if (!(mp->monitor & MINSTREL_MONITOR_STATS))
-+		return;
-+
-+	__minstrel_ht_report_rate_update(mp, mi, rate, mrs);
-+#endif
-+}
-+
-+static inline bool
-+minstrel_ht_manual_mode(struct minstrel_priv *mp)
-+{
-+#ifdef CPTCFG_MAC80211_RC_MINSTREL_DEBUGFS_API
-+	return mp->manual;
-+#else
-+	return false;
-+#endif
-+}
-+
-+void minstrel_ht_set_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
-+						  struct ieee80211_sta_rates *ratetbl, int offset,
-+						  int index);
- int minstrel_ht_get_tp_avg(struct minstrel_ht_sta *mi, int group, int rate,
- 			   int prob_avg);
- 
---- /dev/null
-+++ b/net/mac80211/rc80211_minstrel_ht_api.c
-@@ -0,0 +1,540 @@
-+// SPDX-License-Identifier: GPL-2.0-only
-+/*
-+ * Copyright (C) 2021 Felix Fietkau <nbd at nbd.name>
-+ */
-+#include <linux/kernel.h>
-+#include <linux/debugfs.h>
-+#include <linux/relay.h>
-+#include <net/mac80211.h>
-+#include "rc80211_minstrel_ht.h"
-+
-+enum sta_cmd {
-+	STA_CMD_PROBE,
-+	STA_CMD_RATES,
-+};
-+
-+static void
-+minstrel_ht_print_rate_durations(struct seq_file *s, int group)
-+{
-+	const struct mcs_group *g = &minstrel_mcs_groups[group];
-+	int n_rates;
-+	int i;
-+
-+	if (g->flags & IEEE80211_TX_RC_VHT_MCS)
-+		n_rates = 10;
-+	else
-+		n_rates = 8;
-+
-+	seq_printf(s, "%x", g->duration[0] << g->shift);
-+	for (i = 1; i < n_rates; i++)
-+		seq_printf(s, ",%x", g->duration[i] << g->shift);
-+}
-+
-+static int
-+minstrel_ht_read_api_info(struct seq_file *s, void *data)
-+{
-+	int i;
-+
-+	seq_printf(s, "#group;index;offset;type;nss;bw;gi;airtime\n");
-+	seq_printf(s, "#sta;action;macaddr;overhead_mcs;overhead_legacy;supported\n");
-+	seq_printf(s, "#txs;macaddr;num_frames;num_acked;probe;rates;counts\n");
-+	seq_printf(s, "#stats;macaddr;rate;avg_prob;avg_tp;cur_success;cur_attempts;hist_success;hist_attempts\n");
-+	seq_printf(s, "#rates;macaddr;rates;counts\n");
-+	seq_printf(s, "#probe;macaddr;rate\n");
-+	for (i = 0; i < MINSTREL_GROUPS_NB; i++) {
-+		const struct mcs_group *g = &minstrel_mcs_groups[i];
-+		const char *type;
-+
-+		if (i == MINSTREL_CCK_GROUP)
-+			type = "cck";
-+		else if (i == MINSTREL_OFDM_GROUP)
-+			type = "ofdm";
-+		else if (g->flags & IEEE80211_TX_RC_VHT_MCS)
-+			type = "vht";
-+		else
-+			type = "ht";
-+
-+		seq_printf(s, "group;%x;%x;%s;%x;%x;%x;",
-+			   i, (u32) MI_RATE(i, 0), type, g->streams, g->bw,
-+			   !!(g->flags & IEEE80211_TX_RC_SHORT_GI));
-+		minstrel_ht_print_rate_durations(s, i);
-+		seq_printf(s, "\n");
-+	}
-+
-+	return 0;
-+}
-+
-+static struct dentry *
-+create_buf_file_cb(const char *filename, struct dentry *parent, umode_t mode,
-+		   struct rchan_buf *buf, int *is_global)
-+{
-+	struct dentry *f;
-+
-+	f = debugfs_create_file("api_event", mode, parent, buf,
-+				&relay_file_operations);
-+	if (IS_ERR(f))
-+		return NULL;
-+
-+	*is_global = 1;
-+
-+	return f;
-+}
-+
-+static int
-+remove_buf_file_cb(struct dentry *f)
-+{
-+	debugfs_remove(f);
-+
-+	return 0;
-+}
-+
-+static struct rchan_callbacks relay_ev_cb = {
-+	.create_buf_file = create_buf_file_cb,
-+	.remove_buf_file = remove_buf_file_cb,
-+};
-+
-+static void
-+minstrel_ht_dump_sta(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
-+		     const char *type)
-+{
-+	char info[64 + MINSTREL_GROUPS_NB * 4];
-+	int ofs = 0;
-+	int i;
-+
-+	ofs += scnprintf(info + ofs, sizeof(info) - ofs, "%llx;sta;%s;%pM;%x;%x;",
-+			(unsigned long long)ktime_get_boottime_ns(),
-+			 type, mi->sta->addr, mi->overhead, mi->overhead_legacy);
-+
-+	ofs += scnprintf(info + ofs, sizeof(info) - ofs, "%x",
-+			 mi->supported[0]);
-+	for (i = 1; i < MINSTREL_GROUPS_NB; i++)
-+		ofs += scnprintf(info + ofs, sizeof(info) - ofs, ",%x",
-+				 mi->supported[i]);
-+
-+	ofs += scnprintf(info + ofs, sizeof(info) - ofs, "\n");
-+	relay_write(mp->relay_ev, info, ofs);
-+	relay_flush(mp->relay_ev);
-+}
-+
-+static void
-+__minstrel_ht_dump_stations(struct minstrel_priv *mp, const char *type)
-+{
-+	struct minstrel_ht_sta *mi;
-+
-+	list_for_each_entry(mi, &mp->stations, list)
-+		minstrel_ht_dump_sta(mp, mi, type);
-+}
-+
-+static void
-+minstrel_ht_dump_stations(struct minstrel_priv *mp)
-+{
-+	spin_lock_bh(&mp->lock);
-+	__minstrel_ht_dump_stations(mp, "dump");
-+	spin_unlock_bh(&mp->lock);
-+}
-+
-+static void
-+minstrel_ht_api_start(struct minstrel_priv *mp, char *params)
-+{
-+	char *cur;
-+	u8 mask = 0;
-+
-+	spin_lock_bh(&mp->lock);
-+
-+	while ((cur = strsep(&params, ";")) != NULL) {
-+		if (!strlen(cur))
-+			break;
-+
-+		if (!strcmp(cur, "txs"))
-+			mask |= MINSTREL_MONITOR_TXS;
-+		else if (!strcmp(cur, "sta"))
-+			mask |= MINSTREL_MONITOR_STA;
-+		else if (!strcmp(cur, "stats"))
-+			mask |= MINSTREL_MONITOR_STATS;
-+	}
-+
-+	if (!mask)
-+		mask = MINSTREL_MONITOR_TXS;
-+
-+	if (!mp->monitor)
-+		__minstrel_ht_dump_stations(mp, "add");
-+	mp->monitor = mask | MINSTREL_MONITOR_STA;
-+
-+	spin_unlock_bh(&mp->lock);
-+}
-+
-+static void
-+minstrel_ht_api_stop(struct minstrel_priv *mp)
-+{
-+	spin_lock_bh(&mp->lock);
-+	mp->monitor = 0;
-+	relay_reset(mp->relay_ev);
-+	spin_unlock_bh(&mp->lock);
-+}
-+
-+static void
-+minstrel_ht_reset_sample_table(struct minstrel_ht_sta *mi)
-+{
-+	memset(mi->sample[MINSTREL_SAMPLE_TYPE_INC].sample_rates, 0,
-+	       sizeof(mi->sample[MINSTREL_SAMPLE_TYPE_INC].sample_rates));
-+}
-+
-+static void
-+minstrel_ht_api_set_manual(struct minstrel_priv *mp, bool manual)
-+{
-+	struct minstrel_ht_sta *mi;
-+
-+	mp->manual = manual;
-+
-+	spin_lock_bh(&mp->lock);
-+	list_for_each_entry(mi, &mp->stations, list)
-+		minstrel_ht_reset_sample_table(mi);
-+	spin_unlock_bh(&mp->lock);
-+}
-+
-+static struct minstrel_ht_sta *
-+minstrel_ht_api_get_sta(struct minstrel_priv *mp, const u8 *macaddr)
-+{
-+	struct minstrel_ht_sta *mi;
-+
-+	list_for_each_entry(mi, &mp->stations, list) {
-+		if (!memcmp(mi->sta->addr, macaddr, ETH_ALEN))
-+			return mi;
-+	}
-+
-+	return NULL;
-+}
-+
-+static int
-+minstrel_ht_get_args(char **dest, int dest_size, char *str, char *sep)
-+{
-+	int i, n;
-+
-+	for (i = 0, n = 0; i < dest_size; i++) {
-+		if (!str) {
-+			dest[i] = NULL;
-+			continue;
-+		}
-+
-+		dest[i] = strsep(&str, sep);
-+		if (dest[i])
-+			n++;
-+	}
-+
-+	return n;
-+}
-+
-+static bool
-+minstrel_ht_valid_rate(struct minstrel_ht_sta *mi, u32 rate)
-+{
-+	int group, idx;
-+
-+	group = MI_RATE_GROUP(rate);
-+	if (group >= MINSTREL_GROUPS_NB)
-+		return false;
-+
-+	idx = MI_RATE_IDX(rate);
-+
-+	return !!(mi->supported[group] & BIT(idx));
-+}
-+
-+static int
-+minstrel_ht_rate_from_str(struct minstrel_ht_sta *mi, const char *str)
-+{
-+	unsigned int rate;
-+
-+	if (kstrtouint(str, 16, &rate))
-+		return -EINVAL;
-+
-+	if (!minstrel_ht_valid_rate(mi, rate))
-+		return -EINVAL;
-+
-+	return rate;
-+}
-+
-+static int
-+minstrel_ht_set_probe_rate(struct minstrel_ht_sta *mi, const char *rate_str)
-+{
-+	u16 *sample_rates;
-+	int rate, i;
-+
-+	if (!rate_str)
-+		return -EINVAL;
-+
-+	rate = minstrel_ht_rate_from_str(mi, rate_str);
-+	if (rate < 0)
-+		return rate;
-+
-+	sample_rates = mi->sample[MINSTREL_SAMPLE_TYPE_INC].sample_rates;
-+	for (i = 0; i < MINSTREL_SAMPLE_RATES; i++) {
-+		if (sample_rates[i])
-+			continue;
-+
-+		sample_rates[i] = rate;
-+		mi->sample_time = jiffies;
-+		return 0;
-+	}
-+
-+	return -ENOSPC;
-+}
-+
-+static int
-+minstrel_ht_set_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
-+		      char *rate_str, char *count_str)
-+{
-+	struct ieee80211_sta_rates *ratetbl;
-+	unsigned int count;
-+	char *countlist[4];
-+	char *ratelist[4];
-+	int rate;
-+	int n_rates;
-+	int n_count;
-+	int err = -EINVAL;
-+	int i;
-+
-+	if (!rate_str || !count_str)
-+		return -EINVAL;
-+
-+	ratetbl = kzalloc(sizeof(*ratetbl), GFP_ATOMIC);
-+	if (!ratetbl)
-+		return -ENOMEM;
-+
-+	n_rates = minstrel_ht_get_args(ratelist, ARRAY_SIZE(ratelist),
-+				       rate_str, ",");
-+	n_count = minstrel_ht_get_args(countlist, ARRAY_SIZE(countlist),
-+				       count_str, ",");
-+	for (i = 0; i < min(n_rates, n_count); i++) {
-+		rate = minstrel_ht_rate_from_str(mi, ratelist[i]);
-+		if (rate < 0)
-+			goto error;
-+
-+		if (kstrtouint(countlist[0], 16, &count))
-+			goto error;
-+
-+		minstrel_ht_set_rate(mp, mi, ratetbl, i, rate);
-+		ratetbl->rate[i].count = count;
-+		ratetbl->rate[i].count_rts = count;
-+		ratetbl->rate[i].count_cts = count;
-+	}
-+
-+	rate_control_set_rates(mp->hw, mi->sta, ratetbl);
-+
-+	return 0;
-+
-+error:
-+	kfree(ratetbl);
-+	return err;
-+}
-+
-+static int
-+minstrel_ht_api_sta_cmd(struct minstrel_priv *mp, enum sta_cmd cmd,
-+			char *arg_str)
-+{
-+	struct minstrel_ht_sta *mi;
-+	uint8_t macaddr[ETH_ALEN];
-+	char *args[3];
-+	int n_args;
-+	int ret = -EINVAL;
-+
-+	spin_lock_bh(&mp->lock);
-+	if (!mp->manual)
-+		goto out;
-+
-+	n_args = minstrel_ht_get_args(args, ARRAY_SIZE(args), arg_str, ";");
-+	if (!args[0])
-+		goto out;
-+
-+	if (!mac_pton(args[0], macaddr))
-+		goto out;
-+
-+	mi = minstrel_ht_api_get_sta(mp, macaddr);
-+	if (!mi) {
-+		ret = -ENOENT;
-+		goto out;
-+	}
-+
-+	switch (cmd) {
-+	case STA_CMD_PROBE:
-+		ret = minstrel_ht_set_probe_rate(mi, args[1]);
-+		break;
-+	case STA_CMD_RATES:
-+		ret = minstrel_ht_set_rates(mp, mi, args[1], args[2]);
-+		break;
-+	}
-+
-+out:
-+	spin_unlock_bh(&mp->lock);
-+
-+	return ret;
-+}
-+
-+static ssize_t
-+minstrel_ht_control_write(struct file *file, const char __user *userbuf,
-+			  size_t count, loff_t *ppos)
-+{
-+	struct minstrel_priv *mp = file->private_data;
-+	char *pos, *cur;
-+	char buf[64];
-+	size_t len = count;
-+	int err;
-+
-+	if (len > sizeof(buf) - 1)
-+		return -EINVAL;
-+
-+	if (copy_from_user(buf, userbuf, len))
-+		return -EFAULT;
-+
-+	if (count > 0 && buf[len - 1] == '\n')
-+		len--;
-+
-+	buf[len] = 0;
-+	if (!len)
-+		return count;
-+
-+	pos = buf;
-+	cur = strsep(&pos, ";");
-+
-+	err = 0;
-+	if (!strcmp(cur, "dump"))
-+		minstrel_ht_dump_stations(mp);
-+	else if (!strcmp(cur, "start"))
-+		minstrel_ht_api_start(mp, pos);
-+	else if (!strcmp(cur, "stop"))
-+		minstrel_ht_api_stop(mp);
-+	else if (!strcmp(cur, "manual"))
-+		minstrel_ht_api_set_manual(mp, true);
-+	else if (!strcmp(cur, "auto"))
-+		minstrel_ht_api_set_manual(mp, false);
-+	else if (!strcmp(cur, "rates"))
-+		err = minstrel_ht_api_sta_cmd(mp, STA_CMD_RATES, pos);
-+	else if (!strcmp(cur, "probe"))
-+		err = minstrel_ht_api_sta_cmd(mp, STA_CMD_PROBE, pos);
-+	else
-+		err = -EINVAL;
-+
-+	if (err)
-+		return err;
-+
-+	return count;
-+}
-+
-+static const struct file_operations fops_control = {
-+	.open = simple_open,
-+	.llseek = generic_file_llseek,
-+	.write = minstrel_ht_control_write,
-+};
-+
-+void minstrel_ht_sta_update(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
-+{
-+	bool add = list_empty(&mi->list);
-+
-+	spin_lock_bh(&mp->lock);
-+	if (add)
-+		list_add(&mi->list, &mp->stations);
-+	if (mp->monitor)
-+		minstrel_ht_dump_sta(mp, mi, add ? "add" : "update");
-+	spin_unlock_bh(&mp->lock);
-+}
-+
-+void minstrel_ht_sta_remove(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
-+{
-+	char info[64];
-+	int ofs = 0;
-+
-+	spin_lock_bh(&mp->lock);
-+	list_del_init(&mi->list);
-+
-+	if (!mp->monitor)
-+		goto out;
-+
-+	ofs = scnprintf(info, sizeof(info), "%llx;sta;remove;%pM;;;\n",
-+			(unsigned long long)ktime_get_boottime_ns(),
-+			mi->sta->addr);
-+	relay_write(mp->relay_ev, info, ofs);
-+	relay_flush(mp->relay_ev);
-+
-+out:
-+	spin_unlock_bh(&mp->lock);
-+}
-+
-+void __minstrel_ht_report_tx_status(struct minstrel_priv *mp,
-+				    struct minstrel_ht_sta *mi,
-+				    struct ieee80211_tx_info *info,
-+				    u16 *rate_list,
-+				    int n_rates)
-+{
-+	char txs[64 + IEEE80211_TX_MAX_RATES * 8];
-+	int ofs = 0;
-+	int i;
-+
-+	if (!n_rates)
-+		return;
-+
-+	ofs += scnprintf(txs, sizeof(txs), "%llx;txs;%pM;%x;%x;%x;",
-+			 (unsigned long long)ktime_get_boottime_ns(),
-+			 mi->sta->addr,
-+			 info->status.ampdu_len,
-+			 info->status.ampdu_ack_len,
-+			 !!(info->flags & IEEE80211_TX_CTL_RATE_CTRL_PROBE));
-+
-+	ofs += scnprintf(txs + ofs, sizeof(txs) - ofs, "%x",
-+			 rate_list[0]);
-+	for (i = 1; i < n_rates; i++)
-+		ofs += scnprintf(txs + ofs, sizeof(txs) - ofs, ",%x",
-+				 rate_list[i]);
-+
-+	ofs += scnprintf(txs + ofs, sizeof(txs) - ofs, ";%x",
-+			 info->status.rates[0].count);
-+	for (i = 1; i < n_rates; i++)
-+		ofs += scnprintf(txs + ofs, sizeof(txs) - ofs, ",%x",
-+				 info->status.rates[i].count);
-+	ofs += scnprintf(txs + ofs, sizeof(txs) - ofs, "\n");
-+	relay_write(mp->relay_ev, txs, ofs);
-+	relay_flush(mp->relay_ev);
-+}
-+
-+void __minstrel_ht_report_rate_update(struct minstrel_priv *mp,
-+				      struct minstrel_ht_sta *mi, u16 rate,
-+				      struct minstrel_rate_stats *mrs)
-+{
-+	char stat[100];
-+	int ofs;
-+	int tp;
-+
-+	tp = minstrel_ht_get_tp_avg(mi, MI_RATE_GROUP(rate), MI_RATE_IDX(rate),
-+				    mrs->prob_avg);
-+
-+	ofs = scnprintf(stat, sizeof(stat),
-+			"%llx;stats;%pM;%x;%x;%x;%x;%x;%x;%x\n",
-+			(unsigned long long)ktime_get_boottime_ns(),
-+			mi->sta->addr, rate,
-+			MINSTREL_TRUNC(mrs->prob_avg * 1000), tp,
-+			mrs->last_success,
-+			mrs->last_attempts,
-+			mrs->succ_hist, mrs->att_hist);
-+
-+	relay_write(mp->relay_ev, stat, ofs);
-+	relay_flush(mp->relay_ev);
-+}
-+
-+void minstrel_ht_add_debugfs_api(struct ieee80211_hw *hw, void *priv,
-+				 struct dentry *dir)
-+{
-+	struct minstrel_priv *mp = priv;
-+
-+	spin_lock_init(&mp->lock);
-+	INIT_LIST_HEAD(&mp->stations);
-+	mp->relay_ev = relay_open("api_event", dir, 256, 512, &relay_ev_cb,
-+				  NULL);
-+	debugfs_create_devm_seqfile(&hw->wiphy->dev, "api_info",
-+				    dir, minstrel_ht_read_api_info);
-+	debugfs_create_file("api_control", 0200, dir, mp, &fops_control);
-+}
-+
-+void minstrel_ht_remove_debugfs_api(void *priv)
-+{
-+	struct minstrel_priv *mp = priv;
-+
-+	if (mp->relay_ev)
-+		relay_close(mp->relay_ev);
-+}


From lede-commits at lists.infradead.org  Fri Jun 18 05:35:00 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 18 Jun 2021 08:35:00 -0400
Subject: [openwrt/openwrt]  kernel: disable CONFIG_PCIE_BUS_PERFORMANCE
In-Reply-To: <162401970097.5598.474712004805087148@git-01.infra.openwrt.org>
References: <162401970097.5598.474712004805087148@git-01.infra.openwrt.org>
Message-ID: <mailman.1227.1624019705.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/940c196be158f2fbfebec24d791d4f87f21b79f9

commit 940c196be158f2fbfebec24d791d4f87f21b79f9
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri Jun 18 14:33:28 2021 +0200

    kernel: disable CONFIG_PCIE_BUS_PERFORMANCE
    
    The option was added in 5.9 and for some reason, it is causing performance
    issues at least on an APU2 board with the igb device.
    Switch CONFIG_PCIE_BUS_DEFAULT to fix the performance issues and match the
    older kernel's behavior
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/generic/config-5.10 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10
index e3bdb8fe2c..353d2c8c87 100644
--- a/target/linux/generic/config-5.10
+++ b/target/linux/generic/config-5.10
@@ -4299,9 +4299,9 @@ CONFIG_PARTITION_ADVANCED=y
 # CONFIG_PCIE_AL is not set
 # CONFIG_PCIE_ALTERA is not set
 # CONFIG_PCIE_ARMADA_8K is not set
-# CONFIG_PCIE_BUS_DEFAULT is not set
+CONFIG_PCIE_BUS_DEFAULT=y
 # CONFIG_PCIE_BUS_PEER2PEER is not set
-CONFIG_PCIE_BUS_PERFORMANCE=y
+# CONFIG_PCIE_BUS_PERFORMANCE is not set
 # CONFIG_PCIE_BUS_SAFE is not set
 # CONFIG_PCIE_BUS_TUNE_OFF is not set
 # CONFIG_PCIE_BW is not set


From lede-commits at lists.infradead.org  Sat Jun 19 03:17:14 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 19 Jun 2021 06:17:14 -0400
Subject: [openwrt/openwrt] mac80211: fix an issue with wds links on 802.11ax
 devices
In-Reply-To: <162409783490.18728.10778149701091030351@git-01.infra.openwrt.org>
References: <162409783490.18728.10778149701091030351@git-01.infra.openwrt.org>
Message-ID: <mailman.1396.1624097841.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/89c9ccc3b241d8f07c22a1c271211322c4703f7b

commit 89c9ccc3b241d8f07c22a1c271211322c4703f7b
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sat Jun 19 12:16:49 2021 +0200

    mac80211: fix an issue with wds links on 802.11ax devices
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...move-iwlwifi-specific-workaround-that-bro.patch | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/package/kernel/mac80211/patches/subsys/378-mac80211-remove-iwlwifi-specific-workaround-that-bro.patch b/package/kernel/mac80211/patches/subsys/378-mac80211-remove-iwlwifi-specific-workaround-that-bro.patch
new file mode 100644
index 0000000000..a5ad377e6f
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/378-mac80211-remove-iwlwifi-specific-workaround-that-bro.patch
@@ -0,0 +1,51 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Sat, 19 Jun 2021 12:10:14 +0200
+Subject: [PATCH] mac80211: remove iwlwifi specific workaround that broke sta
+ NDP tx
+
+Sending nulldata packets is important for sw AP link probing and detecting
+4-address mode links. The checks that dropped these packets were apparently
+added to work around an iwlwifi firmware bug with multi-TID aggregation.
+
+Fixes: 41cbb0f5a295 ("mac80211: add support for HE")
+Cc: stable at vger.kernel.org
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
++++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
+@@ -1085,6 +1085,9 @@ static int iwl_mvm_tx_mpdu(struct iwl_mv
+ 	if (WARN_ON_ONCE(mvmsta->sta_id == IWL_MVM_INVALID_STA))
+ 		return -1;
+ 
++	if (unlikely(ieee80211_is_any_nullfunc(fc)) && sta->he_cap.has_he)
++		return -1;
++
+ 	if (unlikely(ieee80211_is_probe_resp(fc)))
+ 		iwl_mvm_probe_resp_set_noa(mvm, skb);
+ 
+--- a/net/mac80211/mlme.c
++++ b/net/mac80211/mlme.c
+@@ -1094,11 +1094,6 @@ void ieee80211_send_nullfunc(struct ieee
+ 	struct ieee80211_hdr_3addr *nullfunc;
+ 	struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
+ 
+-	/* Don't send NDPs when STA is connected HE */
+-	if (sdata->vif.type == NL80211_IFTYPE_STATION &&
+-	    !(ifmgd->flags & IEEE80211_STA_DISABLE_HE))
+-		return;
+-
+ 	skb = ieee80211_nullfunc_get(&local->hw, &sdata->vif,
+ 		!ieee80211_hw_check(&local->hw, DOESNT_SUPPORT_QOS_NDP));
+ 	if (!skb)
+@@ -1130,10 +1125,6 @@ static void ieee80211_send_4addr_nullfun
+ 	if (WARN_ON(sdata->vif.type != NL80211_IFTYPE_STATION))
+ 		return;
+ 
+-	/* Don't send NDPs when connected HE */
+-	if (!(sdata->u.mgd.flags & IEEE80211_STA_DISABLE_HE))
+-		return;
+-
+ 	skb = dev_alloc_skb(local->hw.extra_tx_headroom + 30);
+ 	if (!skb)
+ 		return;


From lede-commits at lists.infradead.org  Sat Jun 19 03:18:04 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 19 Jun 2021 06:18:04 -0400
Subject: [openwrt/openwrt] mac80211: fix an issue with wds links on 802.11ax
 devices
In-Reply-To: <162409788493.20066.12274472656551797759@git-01.infra.openwrt.org>
References: <162409788493.20066.12274472656551797759@git-01.infra.openwrt.org>
Message-ID: <mailman.1397.1624097888.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/3d0ed7d763b54f22520be74c0c7354947082ef0c

commit 3d0ed7d763b54f22520be74c0c7354947082ef0c
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sat Jun 19 12:16:49 2021 +0200

    mac80211: fix an issue with wds links on 802.11ax devices
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
    (cherry-picked from commit 89c9ccc3b241d8f07c22a1c271211322c4703f7b)
---
 ...move-iwlwifi-specific-workaround-that-bro.patch | 51 ++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/package/kernel/mac80211/patches/subsys/378-mac80211-remove-iwlwifi-specific-workaround-that-bro.patch b/package/kernel/mac80211/patches/subsys/378-mac80211-remove-iwlwifi-specific-workaround-that-bro.patch
new file mode 100644
index 0000000000..a5ad377e6f
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/378-mac80211-remove-iwlwifi-specific-workaround-that-bro.patch
@@ -0,0 +1,51 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Sat, 19 Jun 2021 12:10:14 +0200
+Subject: [PATCH] mac80211: remove iwlwifi specific workaround that broke sta
+ NDP tx
+
+Sending nulldata packets is important for sw AP link probing and detecting
+4-address mode links. The checks that dropped these packets were apparently
+added to work around an iwlwifi firmware bug with multi-TID aggregation.
+
+Fixes: 41cbb0f5a295 ("mac80211: add support for HE")
+Cc: stable at vger.kernel.org
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
++++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
+@@ -1085,6 +1085,9 @@ static int iwl_mvm_tx_mpdu(struct iwl_mv
+ 	if (WARN_ON_ONCE(mvmsta->sta_id == IWL_MVM_INVALID_STA))
+ 		return -1;
+ 
++	if (unlikely(ieee80211_is_any_nullfunc(fc)) && sta->he_cap.has_he)
++		return -1;
++
+ 	if (unlikely(ieee80211_is_probe_resp(fc)))
+ 		iwl_mvm_probe_resp_set_noa(mvm, skb);
+ 
+--- a/net/mac80211/mlme.c
++++ b/net/mac80211/mlme.c
+@@ -1094,11 +1094,6 @@ void ieee80211_send_nullfunc(struct ieee
+ 	struct ieee80211_hdr_3addr *nullfunc;
+ 	struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
+ 
+-	/* Don't send NDPs when STA is connected HE */
+-	if (sdata->vif.type == NL80211_IFTYPE_STATION &&
+-	    !(ifmgd->flags & IEEE80211_STA_DISABLE_HE))
+-		return;
+-
+ 	skb = ieee80211_nullfunc_get(&local->hw, &sdata->vif,
+ 		!ieee80211_hw_check(&local->hw, DOESNT_SUPPORT_QOS_NDP));
+ 	if (!skb)
+@@ -1130,10 +1125,6 @@ static void ieee80211_send_4addr_nullfun
+ 	if (WARN_ON(sdata->vif.type != NL80211_IFTYPE_STATION))
+ 		return;
+ 
+-	/* Don't send NDPs when connected HE */
+-	if (!(sdata->u.mgd.flags & IEEE80211_STA_DISABLE_HE))
+-		return;
+-
+ 	skb = dev_alloc_skb(local->hw.extra_tx_headroom + 30);
+ 	if (!skb)
+ 		return;


From lede-commits at lists.infradead.org  Sat Jun 19 11:43:02 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 19 Jun 2021 14:43:02 -0400
Subject: [openwrt/openwrt]  tools/ccache: update to 4.3
In-Reply-To: <162412818231.19297.13821236139103121217@git-01.infra.openwrt.org>
References: <162412818231.19297.13821236139103121217@git-01.infra.openwrt.org>
Message-ID: <mailman.1414.1624128186.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/90338370d18bec7844d25096c277b64139c721c7

commit 90338370d18bec7844d25096c277b64139c721c7
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Thu Jun 17 22:55:38 2021 -0700

    tools/ccache: update to 4.3
    
    Remove BUILD_PARALLEL as it's default now.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 tools/ccache/Makefile | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tools/ccache/Makefile b/tools/ccache/Makefile
index 3db6cc0818..7c85d549e9 100644
--- a/tools/ccache/Makefile
+++ b/tools/ccache/Makefile
@@ -8,13 +8,11 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/target.mk
 
 PKG_NAME:=ccache
-PKG_VERSION:=4.2.1
+PKG_VERSION:=4.3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://github.com/ccache/ccache/releases/download/v$(PKG_VERSION)
-PKG_HASH:=9d6ba1cdefdc690401f404b747d81a9a1802b17af4235815866b7620d980477e
-
-HOST_BUILD_PARALLEL:=1
+PKG_HASH:=504a0f2184465c306826f035b4bc00bae7500308d6af4abbfb50e33a694989b4
 
 include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/cmake.mk


From lede-commits at lists.infradead.org  Sat Jun 19 15:49:18 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 19 Jun 2021 18:49:18 -0400
Subject: [openwrt/openwrt] build: Config-images: fix unit of partition sizes
In-Reply-To: <162414295855.3588.4826794461848093046@git-01.infra.openwrt.org>
References: <162414295855.3588.4826794461848093046@git-01.infra.openwrt.org>
Message-ID: <mailman.1426.1624142962.1072.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/04589cb5490be1a4e33e12eb3cbdb97901685002

commit 04589cb5490be1a4e33e12eb3cbdb97901685002
Author: Paul Fertser <fercerpav at gmail.com>
AuthorDate: Wed Jun 16 17:15:59 2021 +0300

    build: Config-images: fix unit of partition sizes
    
    The code interprets these config values as Mebibytes rather than
    Megabytes so modify the description accordingly.
    
    Signed-off-by: Paul Fertser <fercerpav at gmail.com>
    [fix commit title prefix]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 config/Config-images.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/config/Config-images.in b/config/Config-images.in
index 26917267cf..715ba21284 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -280,14 +280,14 @@ menu "Target Images"
 	source "target/linux/*/image/Config.in"
 
 	config TARGET_KERNEL_PARTSIZE
-		int "Kernel partition size (in MB)"
+		int "Kernel partition size (in MiB)"
 		depends on USES_BOOT_PART
 		default 8 if TARGET_apm821xx_sata
 		default 64 if TARGET_bcm27xx
 		default 16
 
 	config TARGET_ROOTFS_PARTSIZE
-		int "Root filesystem partition size (in MB)"
+		int "Root filesystem partition size (in MiB)"
 		depends on USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS || TARGET_omap || TARGET_sunxi || TARGET_uml
 		default 104
 		help


From lede-commits at lists.infradead.org  Sat Jun 19 15:49:19 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 19 Jun 2021 18:49:19 -0400
Subject: [openwrt/openwrt] firmware-utils: tplink-safeloader: support Archer
 A6 v3 CA
In-Reply-To: <162414295855.3588.4826794461848093046@git-01.infra.openwrt.org>
References: <162414295855.3588.4826794461848093046@git-01.infra.openwrt.org>
Message-ID: <mailman.1427.1624142967.1072.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/b6245fbd58712e0c790fda07db02d39be491dbb4

commit b6245fbd58712e0c790fda07db02d39be491dbb4
Author: Stijn Segers <foss at volatilesystems.org>
AuthorDate: Wed Jun 16 14:47:06 2021 +0200

    firmware-utils: tplink-safeloader: support Archer A6 v3 CA
    
    The Canadian edition of the TP-Link Archer A6 v3 uses a different header, but
    otherwise it's identical to the already supported EU/US editions.
    
    Signed-off-by: Stijn Segers <foss at volatilesystems.org>
    Tested-by: Brian Lee <dev at leebrian.me>
    Reviewed-by: Philip Prindeville <philipp at redfish-solutions.com>
---
 tools/firmware-utils/src/tplink-safeloader.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/firmware-utils/src/tplink-safeloader.c b/tools/firmware-utils/src/tplink-safeloader.c
index 86d51db269..fd154e7e0a 100644
--- a/tools/firmware-utils/src/tplink-safeloader.c
+++ b/tools/firmware-utils/src/tplink-safeloader.c
@@ -1097,6 +1097,7 @@ static struct device_info boards[] = {
 		.vendor = "",
 		.support_list =
 			"SupportList:\n"
+			"{product_name:Archer A6,product_ver:3.0.0,special_id:43410000}\n"
 			"{product_name:Archer A6,product_ver:3.0.0,special_id:55530000}\n"
 			"{product_name:Archer A6,product_ver:3.0.0,special_id:54570000}\n",
 		.part_trail = 0x00,


From lede-commits at lists.infradead.org  Sat Jun 19 23:46:49 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 20 Jun 2021 02:46:49 -0400
Subject: [openwrt/openwrt] treewide: remove PKG_INSTALL from CMake packages
In-Reply-To: <162417160892.15403.17570627710470179146@git-01.infra.openwrt.org>
References: <162417160892.15403.17570627710470179146@git-01.infra.openwrt.org>
Message-ID: <mailman.1440.1624171619.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/3dabb62581ccff92e51cadb05f15de4ba8000e1b

commit 3dabb62581ccff92e51cadb05f15de4ba8000e1b
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Fri Jun 18 20:43:28 2021 -0700

    treewide: remove PKG_INSTALL from CMake packages
    
    It's already default with cmake.mk
    
    Found with:
    
    git grep PKG_INSTALL\: | cut -d ':' -f 1 | sort -u > ins
    git grep cmake.mk | cut -d ':' -f 1 > cmake
    comm -1 -2 ins cmake
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 package/libs/mbedtls/Makefile            | 2 --
 package/network/services/odhcpd/Makefile | 1 -
 package/system/opkg/Makefile             | 2 --
 3 files changed, 5 deletions(-)

diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile
index 6add1f401a..2bac22b6ac 100644
--- a/package/libs/mbedtls/Makefile
+++ b/package/libs/mbedtls/Makefile
@@ -87,8 +87,6 @@ This package contains mbedtls helper programs for private key and
 CSR generation (gen_key, cert_req)
 endef
 
-PKG_INSTALL:=1
-
 TARGET_CFLAGS += -ffunction-sections -fdata-sections
 TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS))
 
diff --git a/package/network/services/odhcpd/Makefile b/package/network/services/odhcpd/Makefile
index d9a320d17a..05174a5092 100644
--- a/package/network/services/odhcpd/Makefile
+++ b/package/network/services/odhcpd/Makefile
@@ -19,7 +19,6 @@ PKG_MIRROR_HASH:=a0644d31f99f20e5c2cee74153b81a0c2eae9ebeb644662cc76b0984b44dd49
 PKG_MAINTAINER:=Hans Dedecker <dedeckeh at gmail.com>
 PKG_LICENSE:=GPL-2.0
 
-PKG_INSTALL:=1
 PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_odhcpd_$(BUILD_VARIANT)_ext_cer_id
 PKG_ASLR_PIE_REGULAR:=1
 
diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile
index 9f352e83c0..bd9fab474c 100644
--- a/package/system/opkg/Makefile
+++ b/package/system/opkg/Makefile
@@ -26,8 +26,6 @@ PKG_CONFIG_DEPENDS += \
 	CONFIG_SIGNATURE_CHECK \
 	CONFIG_TARGET_INIT_PATH
 
-PKG_INSTALL:=1
-
 HOST_BUILD_DEPENDS:=libubox/host
 
 include $(INCLUDE_DIR)/package.mk


From lede-commits at lists.infradead.org  Sat Jun 19 23:46:48 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 20 Jun 2021 02:46:48 -0400
Subject: [openwrt/openwrt] treewide: remove BUILD_PARALLEL from CMake packages
In-Reply-To: <162417160892.15403.17570627710470179146@git-01.infra.openwrt.org>
References: <162417160892.15403.17570627710470179146@git-01.infra.openwrt.org>
Message-ID: <mailman.1441.1624171619.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/2e745e9be653626d37248c4f0a88ce9a5f90d183

commit 2e745e9be653626d37248c4f0a88ce9a5f90d183
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Fri Jun 18 20:35:14 2021 -0700

    treewide: remove BUILD_PARALLEL from CMake packages
    
    It's already default. The only exception is mt76 which has Ninja
    disabled.
    
    Found with:
    
    git grep BUILD_PARALLEL | cut -d ':' -f 1 | sort -u > par
    git grep cmake.mk | cut -d ':' -f 1 > cmake
    comm -1 -2 par cmake
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 package/libs/libjson-c/Makefile        | 1 -
 package/libs/libpcap/Makefile          | 1 -
 package/libs/mbedtls/Makefile          | 1 -
 package/network/config/netifd/Makefile | 2 --
 package/network/utils/umbim/Makefile   | 2 --
 package/network/utils/uqmi/Makefile    | 2 --
 package/system/opkg/Makefile           | 2 --
 package/system/rpcd/Makefile           | 1 -
 package/system/uci/Makefile            | 1 -
 package/system/urngd/Makefile          | 2 --
 tools/zstd/Makefile                    | 1 -
 11 files changed, 16 deletions(-)

diff --git a/package/libs/libjson-c/Makefile b/package/libs/libjson-c/Makefile
index 0ea3fe80b5..d4a16f36cb 100644
--- a/package/libs/libjson-c/Makefile
+++ b/package/libs/libjson-c/Makefile
@@ -21,7 +21,6 @@ PKG_LICENSE_FILES:=COPYING
 PKG_CPE_ID:=cpe:/a:json-c_project:json-c
 
 PKG_FLAGS := nonshared
-PKG_BUILD_PARALLEL:=1
 HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST)
 
 include $(INCLUDE_DIR)/package.mk
diff --git a/package/libs/libpcap/Makefile b/package/libs/libpcap/Makefile
index 6168d4c459..8c08259055 100644
--- a/package/libs/libpcap/Makefile
+++ b/package/libs/libpcap/Makefile
@@ -21,7 +21,6 @@ PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE
 
 PKG_ASLR_PIE_REGULAR:=1
-PKG_BUILD_PARALLEL:=1
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/cmake.mk
diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile
index 7f6bf4e4c0..6add1f401a 100644
--- a/package/libs/mbedtls/Makefile
+++ b/package/libs/mbedtls/Makefile
@@ -16,7 +16,6 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/ARMmbed/mbedtls/tar.gz/v$(PKG_VERSION)?
 PKG_HASH:=96257bb03b30300b2f35f861ffe204ed957e9fd0329d80646fe57fc49f589b29
 
-PKG_BUILD_PARALLEL:=1
 PKG_LICENSE:=GPL-2.0-or-later
 PKG_LICENSE_FILES:=gpl-2.0.txt
 PKG_CPE_ID:=cpe:/a:arm:mbed_tls
diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile
index aaffb57df7..fb0e470995 100644
--- a/package/network/config/netifd/Makefile
+++ b/package/network/config/netifd/Makefile
@@ -13,8 +13,6 @@ PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=
 
-PKG_BUILD_PARALLEL:=1
-
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/cmake.mk
 
diff --git a/package/network/utils/umbim/Makefile b/package/network/utils/umbim/Makefile
index 984f8354de..a0f5e4756b 100644
--- a/package/network/utils/umbim/Makefile
+++ b/package/network/utils/umbim/Makefile
@@ -13,8 +13,6 @@ PKG_MAINTAINER:=John Crispin <john at phrozen.org>
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=
 
-PKG_BUILD_PARALLEL:=1
-
 PKG_FLAGS:=nonshared
 
 include $(INCLUDE_DIR)/package.mk
diff --git a/package/network/utils/uqmi/Makefile b/package/network/utils/uqmi/Makefile
index da54ba0f46..53ca67230b 100644
--- a/package/network/utils/uqmi/Makefile
+++ b/package/network/utils/uqmi/Makefile
@@ -13,8 +13,6 @@ PKG_MAINTAINER:=Matti Laakso <malaakso at elisanet.fi>
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=
 
-PKG_BUILD_PARALLEL:=1
-
 PKG_FLAGS:=nonshared
 
 include $(INCLUDE_DIR)/package.mk
diff --git a/package/system/opkg/Makefile b/package/system/opkg/Makefile
index 65bdf6dba9..9f352e83c0 100644
--- a/package/system/opkg/Makefile
+++ b/package/system/opkg/Makefile
@@ -26,8 +26,6 @@ PKG_CONFIG_DEPENDS += \
 	CONFIG_SIGNATURE_CHECK \
 	CONFIG_TARGET_INIT_PATH
 
-PKG_BUILD_PARALLEL:=1
-HOST_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
 
 HOST_BUILD_DEPENDS:=libubox/host
diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile
index 7c99267b67..e9040500b5 100644
--- a/package/system/rpcd/Makefile
+++ b/package/system/rpcd/Makefile
@@ -20,7 +20,6 @@ PKG_MIRROR_HASH:=69d9588a5a910676252eabcd2815af318806cae8316777e8b6eb00b26bdc42c
 PKG_LICENSE:=ISC
 PKG_LICENSE_FILES:=
 
-PKG_BUILD_PARALLEL:=1
 PKG_ASLR_PIE_REGULAR:=1
 
 include $(INCLUDE_DIR)/package.mk
diff --git a/package/system/uci/Makefile b/package/system/uci/Makefile
index 3d9fdf7391..2036f92a7e 100644
--- a/package/system/uci/Makefile
+++ b/package/system/uci/Makefile
@@ -22,7 +22,6 @@ PKG_LICENSE_FILES:=
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 
-PKG_BUILD_PARALLEL:=0
 PKG_FLAGS := nonshared
 
 include $(INCLUDE_DIR)/package.mk
diff --git a/package/system/urngd/Makefile b/package/system/urngd/Makefile
index 54a1f457d2..8350f7ceb9 100644
--- a/package/system/urngd/Makefile
+++ b/package/system/urngd/Makefile
@@ -12,8 +12,6 @@ PKG_MIRROR_HASH:=2d31025b79fe130c579d6c3f4bf4dc12abc43a7319b20a5cdca24ae363ec70f
 PKG_LICENSE:=GPL-2.0 BSD-3-Clause
 PKG_LICENSE_FILES:=
 
-PKG_BUILD_PARALLEL:=1
-
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/cmake.mk
 
diff --git a/tools/zstd/Makefile b/tools/zstd/Makefile
index a0106f15f2..9138ae98f2 100644
--- a/tools/zstd/Makefile
+++ b/tools/zstd/Makefile
@@ -12,7 +12,6 @@ PKG_LICENSE_FILES:=LICENSE
 PKG_CPE_ID:=cpe:/a:facebook:zstandard
 
 CMAKE_SOURCE_SUBDIR:=build/cmake
-HOST_BUILD_PARALLEL:=1
 
 include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/cmake.mk


From lede-commits at lists.infradead.org  Sun Jun 20 09:59:13 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 20 Jun 2021 12:59:13 -0400
Subject: [openwrt/openwrt]  ramips: clean up dlink_dir-8xx-r1 recipe
In-Reply-To: <162420835274.24005.8168480300352855694@git-01.infra.openwrt.org>
References: <162420835274.24005.8168480300352855694@git-01.infra.openwrt.org>
Message-ID: <mailman.1549.1624208358.1072.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/881fdb811f39d445fb00b4c1f38427fada883fe2

commit 881fdb811f39d445fb00b4c1f38427fada883fe2
Author: Adrian Schmutzler <freifunk at adrianschmutzler.de>
AuthorDate: Sun Jun 20 17:20:40 2021 +0200

    ramips: clean up dlink_dir-8xx-r1 recipe
    
     * only add factory.bin when it's defined
     * fix check-size vs. append-metadata
     * whitespace/line break cleanup
    
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 target/linux/ramips/image/mt7621.mk | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index ee5ebaa8b2..ae9b4757de 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -300,9 +300,8 @@ define Device/dlink_dir-8xx-r1
   DEVICE_VENDOR := D-Link
   DEVICE_PACKAGES := kmod-mt7615e kmod-mt7615-firmware
   KERNEL_INITRAMFS := $$(KERNEL)
-  IMAGES += factory.bin
-  IMAGE/sysupgrade.bin := append-kernel | append-rootfs |\
-	pad-rootfs | append-metadata | check-size
+  IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | \
+	check-size | append-metadata
 endef
 
 define Device/dlink_dir-xx60-a1
@@ -387,9 +386,10 @@ define Device/dlink_dir-882-r1
   DEVICE_MODEL := DIR-882
   DEVICE_VARIANT := R1
   DEVICE_PACKAGES += kmod-usb3 kmod-usb-ledtrig-usbport
+  IMAGES += factory.bin
   IMAGE/factory.bin := append-kernel | append-rootfs | check-size | \
-	  sign-dlink-ru 57c5375741c30ca9ebcb36713db4ba51 \
-	  ab0dff19af8842cdb70a86b4b68d23f7
+	sign-dlink-ru 57c5375741c30ca9ebcb36713db4ba51 \
+	ab0dff19af8842cdb70a86b4b68d23f7
 endef
 TARGET_DEVICES += dlink_dir-882-r1
 


From lede-commits at lists.infradead.org  Sun Jun 20 09:59:12 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 20 Jun 2021 12:59:12 -0400
Subject: [openwrt/openwrt] ramips: reorganize DTSI files for D-Link DIR-8xx
In-Reply-To: <162420835274.24005.8168480300352855694@git-01.infra.openwrt.org>
References: <162420835274.24005.8168480300352855694@git-01.infra.openwrt.org>
Message-ID: <mailman.1550.1624208363.1072.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/2001c0ca9fd2bf95827e23ba867fa06fc3b0a3e7

commit 2001c0ca9fd2bf95827e23ba867fa06fc3b0a3e7
Author: Adrian Schmutzler <freifunk at adrianschmutzler.de>
AuthorDate: Sun Jun 20 17:11:09 2021 +0200

    ramips: reorganize DTSI files for D-Link DIR-8xx
    
     * Remove micro-DTSI mt7621_dlink_dir-882-x1.dtsi to ease reading
       config without too much inheritance
     * Use "separate" partitioning DTSIs so we can use the partitioning
       without a complete match on the other settings (i.e. without the
       former parent DTSI)
     * Rename files to express the new organization
    
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 target/linux/ramips/dts/mt7621_dlink_dir-867-a1.dts  |  3 ++-
 target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts  |  3 ++-
 target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts  | 20 ++++++++++++++++++--
 target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts  | 20 ++++++++++++++++++--
 target/linux/ramips/dts/mt7621_dlink_dir-882-x1.dtsi | 17 -----------------
 ...ink_dir-8xx-x1.dtsi => mt7621_dlink_dir-8xx.dtsi} |  0
 ...ir-8xx-a1.dtsi => mt7621_dlink_flash-16m-a1.dtsi} |  2 --
 ...ir-8xx-r1.dtsi => mt7621_dlink_flash-16m-r1.dtsi} |  2 --
 8 files changed, 40 insertions(+), 27 deletions(-)

diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-867-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-867-a1.dts
index b2ba5ecaa9..e02eb9eebf 100644
--- a/target/linux/ramips/dts/mt7621_dlink_dir-867-a1.dts
+++ b/target/linux/ramips/dts/mt7621_dlink_dir-867-a1.dts
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "mt7621_dlink_dir-8xx-a1.dtsi"
+#include "mt7621_dlink_dir-8xx.dtsi"
+#include "mt7621_dlink_flash-16m-a1.dtsi"
 
 / {
 	compatible = "dlink,dir-867-a1", "mediatek,mt7621-soc";
diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts
index 4bfe5ca43c..1f1d5824f2 100644
--- a/target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts
+++ b/target/linux/ramips/dts/mt7621_dlink_dir-878-a1.dts
@@ -1,6 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "mt7621_dlink_dir-8xx-a1.dtsi"
+#include "mt7621_dlink_dir-8xx.dtsi"
+#include "mt7621_dlink_flash-16m-a1.dtsi"
 
 / {
 	compatible = "dlink,dir-878-a1", "mediatek,mt7621-soc";
diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts
index cef0705393..01739fc258 100644
--- a/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts
+++ b/target/linux/ramips/dts/mt7621_dlink_dir-882-a1.dts
@@ -1,9 +1,25 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "mt7621_dlink_dir-8xx-a1.dtsi"
-#include "mt7621_dlink_dir-882-x1.dtsi"
+#include "mt7621_dlink_dir-8xx.dtsi"
+#include "mt7621_dlink_flash-16m-a1.dtsi"
 
 / {
 	compatible = "dlink,dir-882-a1", "mediatek,mt7621-soc";
 	model = "D-Link DIR-882 A1";
 };
+
+&leds {
+	usb2 {
+		label = "green:usb2";
+		gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+		trigger-sources = <&ehci_port2>;
+		linux,default-trigger = "usbport";
+	};
+
+	usb3 {
+		label = "green:usb3";
+		gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+		trigger-sources = <&xhci_ehci_port1>;
+		linux,default-trigger = "usbport";
+	};
+};
diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts
index 26b6f34707..9b0cd8e7be 100644
--- a/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts
+++ b/target/linux/ramips/dts/mt7621_dlink_dir-882-r1.dts
@@ -1,9 +1,25 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "mt7621_dlink_dir-8xx-r1.dtsi"
-#include "mt7621_dlink_dir-882-x1.dtsi"
+#include "mt7621_dlink_dir-8xx.dtsi"
+#include "mt7621_dlink_flash-16m-r1.dtsi"
 
 / {
 	compatible = "dlink,dir-882-r1", "mediatek,mt7621-soc";
 	model = "D-Link DIR-882 R1";
 };
+
+&leds {
+	usb2 {
+		label = "green:usb2";
+		gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+		trigger-sources = <&ehci_port2>;
+		linux,default-trigger = "usbport";
+	};
+
+	usb3 {
+		label = "green:usb3";
+		gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+		trigger-sources = <&xhci_ehci_port1>;
+		linux,default-trigger = "usbport";
+	};
+};
diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-882-x1.dtsi b/target/linux/ramips/dts/mt7621_dlink_dir-882-x1.dtsi
deleted file mode 100644
index cafb1df964..0000000000
--- a/target/linux/ramips/dts/mt7621_dlink_dir-882-x1.dtsi
+++ /dev/null
@@ -1,17 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
-
-&leds {
-	usb2 {
-		label = "green:usb2";
-		gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
-		trigger-sources = <&ehci_port2>;
-		linux,default-trigger = "usbport";
-	};
-
-	usb3 {
-		label = "green:usb3";
-		gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
-		trigger-sources = <&xhci_ehci_port1>;
-		linux,default-trigger = "usbport";
-	};
-};
diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-8xx-x1.dtsi b/target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi
similarity index 100%
rename from target/linux/ramips/dts/mt7621_dlink_dir-8xx-x1.dtsi
rename to target/linux/ramips/dts/mt7621_dlink_dir-8xx.dtsi
diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-8xx-a1.dtsi b/target/linux/ramips/dts/mt7621_dlink_flash-16m-a1.dtsi
similarity index 94%
rename from target/linux/ramips/dts/mt7621_dlink_dir-8xx-a1.dtsi
rename to target/linux/ramips/dts/mt7621_dlink_flash-16m-a1.dtsi
index 95ef0afcd9..911de595d0 100644
--- a/target/linux/ramips/dts/mt7621_dlink_dir-8xx-a1.dtsi
+++ b/target/linux/ramips/dts/mt7621_dlink_flash-16m-a1.dtsi
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "mt7621_dlink_dir-8xx-x1.dtsi"
-
 &spi0 {
 	status = "okay";
 
diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-8xx-r1.dtsi b/target/linux/ramips/dts/mt7621_dlink_flash-16m-r1.dtsi
similarity index 94%
rename from target/linux/ramips/dts/mt7621_dlink_dir-8xx-r1.dtsi
rename to target/linux/ramips/dts/mt7621_dlink_flash-16m-r1.dtsi
index e93a06d9fe..3f71ab971c 100644
--- a/target/linux/ramips/dts/mt7621_dlink_dir-8xx-r1.dtsi
+++ b/target/linux/ramips/dts/mt7621_dlink_flash-16m-r1.dtsi
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "mt7621_dlink_dir-8xx-x1.dtsi"
-
 &spi0 {
 	status = "okay";
 


From lede-commits at lists.infradead.org  Sun Jun 20 16:29:54 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 20 Jun 2021 19:29:54 -0400
Subject: [openwrt/openwrt] grub2: make grub2-bios-setup as a separate package
In-Reply-To: <162423179428.14634.11653542937065931542@git-01.infra.openwrt.org>
References: <162423179428.14634.11653542937065931542@git-01.infra.openwrt.org>
Message-ID: <mailman.1581.1624231798.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/5876d6a62fc0ae5799e7d9c896356f75c99a6f0a

commit 5876d6a62fc0ae5799e7d9c896356f75c99a6f0a
Author: ?? <uxgood.org at gmail.com>
AuthorDate: Sat Jul 25 04:04:05 2020 +0000

    grub2: make grub2-bios-setup as a separate package
    
    The grub2 and grub2-efi packages should only contain boot-related code.
    grub-bios-setup is the same as grub-editenv, they are both grub2 tools
    and should be placed in a separate package.
    
    Signed-off-by: ?? <uxgood.org at gmail.com>
    [use AUTORELEASE and update to SPDX]
    Signed-off-by: Paul Spooren <mail at aparcar.org>
---
 config/Config-images.in     |  2 ++
 package/boot/grub2/Makefile | 31 +++++++++++++++++++++++--------
 2 files changed, 25 insertions(+), 8 deletions(-)

diff --git a/config/Config-images.in b/config/Config-images.in
index 715ba21284..4a7f08824b 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -200,6 +200,7 @@ menu "Target Images"
 		depends on TARGET_x86
 		depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS
 		select PACKAGE_grub2
+		select PACKAGE_grub2-bios-setup
 		default y
 
 	config GRUB_EFI_IMAGES
@@ -208,6 +209,7 @@ menu "Target Images"
 		depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS
 		select PACKAGE_grub2
 		select PACKAGE_grub2-efi
+		select PACKAGE_grub2-bios-setup
 		select PACKAGE_kmod-fs-vfat
 		default y
 
diff --git a/package/boot/grub2/Makefile b/package/boot/grub2/Makefile
index a57486b91d..709253a935 100644
--- a/package/boot/grub2/Makefile
+++ b/package/boot/grub2/Makefile
@@ -1,9 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0-only
 #
-# Copyright (C) 2006-2015 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
+# Copyright (C) 2006-2021 OpenWrt.org
 
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
@@ -11,7 +8,7 @@ include $(INCLUDE_DIR)/kernel.mk
 PKG_NAME:=grub
 PKG_CPE_ID:=cpe:/a:gnu:grub2
 PKG_VERSION:=2.06~rc1
-PKG_RELEASE:=2
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://alpha.gnu.org/gnu/grub
@@ -54,6 +51,20 @@ define Package/grub2-editenv/description
 	Edit grub2 environment files.
 endef
 
+define Package/grub2-bios-setup
+  CATEGORY:=Utilities
+  SECTION:=utils
+  SUBMENU:=Boot Loaders
+  TITLE:=Grub2 BIOS boot setup tool
+  URL:=http://www.gnu.org/software/grub/
+  DEPENDS:=@TARGET_x86
+  VARIANT:=pc
+endef
+
+define Package/grub2-bios-setup/description
+	Set up images to bootable.
+endef
+
 HOST_BUILD_PREFIX := $(STAGING_DIR_HOST)
 
 CONFIGURE_VARS += \
@@ -93,8 +104,6 @@ define Host/Configure
 endef
 
 define Package/grub2/install
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-bios-setup $(1)/usr/sbin/
 	$(INSTALL_DIR) $(STAGING_DIR_IMAGE)/grub2
 	$(CP) $(PKG_BUILD_DIR)/grub-core/boot.img $(STAGING_DIR_IMAGE)/grub2/
 	$(CP) $(PKG_BUILD_DIR)/grub-core/cdboot.img $(STAGING_DIR_IMAGE)/grub2/
@@ -152,7 +161,13 @@ define Package/grub2-editenv/install
 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-editenv $(1)/usr/sbin/
 endef
 
+define Package/grub2-bios-setup/install
+	$(INSTALL_DIR) $(1)/usr/sbin
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/grub-bios-setup $(1)/usr/sbin/
+endef
+
 $(eval $(call HostBuild))
 $(eval $(call BuildPackage,grub2))
 $(eval $(call BuildPackage,grub2-efi))
 $(eval $(call BuildPackage,grub2-editenv))
+$(eval $(call BuildPackage,grub2-bios-setup))


From lede-commits at lists.infradead.org  Sun Jun 20 16:49:30 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 20 Jun 2021 19:49:30 -0400
Subject: [openwrt/openwrt] grub2: pass compilation parameters more accurately
In-Reply-To: <162423296959.27080.4493079989255003357@git-01.infra.openwrt.org>
References: <162423296959.27080.4493079989255003357@git-01.infra.openwrt.org>
Message-ID: <mailman.1582.1624232974.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/e4723755f237a0e5fab132ab870d00ea82e7fb82

commit e4723755f237a0e5fab132ab870d00ea82e7fb82
Author: ?? <uxgood.org at gmail.com>
AuthorDate: Sat Jul 25 05:14:52 2020 +0000

    grub2: pass compilation parameters more accurately
    
    In order for the grub2 boot-related code to compile normally, we have
    made many adjustments to the compilation parameters. These adjustments
    are not necessary for tools-related code. We apply these parameter
    adjustments only to the boot-related code.
    
    Signed-off-by: ?? <uxgood.org at gmail.com>
---
 package/boot/grub2/Makefile | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/package/boot/grub2/Makefile b/package/boot/grub2/Makefile
index 0610d96e90..3cdb608cbf 100644
--- a/package/boot/grub2/Makefile
+++ b/package/boot/grub2/Makefile
@@ -17,8 +17,10 @@ PKG_HASH:=2c87f1f21e2ab50043e6cd9163c08f1b6c3a6171556bf23ff9ed65b074145484
 HOST_BUILD_PARALLEL:=1
 PKG_BUILD_DEPENDS:=grub2/host
 
-PKG_ASLR_PIE:=0
-PKG_SSP:=0
+ifneq ($(BUILD_VARIANT),none)
+  PKG_ASLR_PIE:=0
+  PKG_SSP:=0
+endif
 
 PKG_FLAGS:=nonshared
 
@@ -96,9 +98,9 @@ HOST_MAKE_FLAGS += \
 	TARGET_RANLIB=$(TARGET_RANLIB) \
 	LIBLZMA=$(STAGING_DIR_HOST)/lib/liblzma.a
 
-TARGET_CFLAGS := $(filter-out -O2 -O3 -fno-plt,$(TARGET_CFLAGS))
 
 ifneq ($(BUILD_VARIANT),none)
+  TARGET_CFLAGS := $(filter-out -O2 -O3 -fno-plt,$(TARGET_CFLAGS))
   MAKE_PATH := grub-core
 endif
 


From lede-commits at lists.infradead.org  Sun Jun 20 16:49:29 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 20 Jun 2021 19:49:29 -0400
Subject: [openwrt/openwrt] grub2: make grub2 tools built in a separate variant
In-Reply-To: <162423296959.27080.4493079989255003357@git-01.infra.openwrt.org>
References: <162423296959.27080.4493079989255003357@git-01.infra.openwrt.org>
Message-ID: <mailman.1583.1624232974.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/ca941041366602d4da0bf2c04bb0d3c25ed4fa21

commit ca941041366602d4da0bf2c04bb0d3c25ed4fa21
Author: ?? <uxgood.org at gmail.com>
AuthorDate: Sat Jul 25 04:48:36 2020 +0000

    grub2: make grub2 tools built in a separate variant
    
    grub2 boot-related code and tools-related code may require different
    compilation parameters. We split them into different variants for
    compilation, so that we can accurately pass the required parameters and
    avoid causing problems.
    
    Signed-off-by: ?? <uxgood.org at gmail.com>
---
 package/boot/grub2/Makefile | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/package/boot/grub2/Makefile b/package/boot/grub2/Makefile
index 709253a935..0610d96e90 100644
--- a/package/boot/grub2/Makefile
+++ b/package/boot/grub2/Makefile
@@ -44,7 +44,7 @@ define Package/grub2-editenv
   TITLE:=Grub2 Environment editor
   URL:=http://www.gnu.org/software/grub/
   DEPENDS:=@TARGET_x86
-  VARIANT:=pc
+  VARIANT:=none
 endef
 
 define Package/grub2-editenv/description
@@ -58,7 +58,7 @@ define Package/grub2-bios-setup
   TITLE:=Grub2 BIOS boot setup tool
   URL:=http://www.gnu.org/software/grub/
   DEPENDS:=@TARGET_x86
-  VARIANT:=pc
+  VARIANT:=none
 endef
 
 define Package/grub2-bios-setup/description
@@ -98,6 +98,10 @@ HOST_MAKE_FLAGS += \
 
 TARGET_CFLAGS := $(filter-out -O2 -O3 -fno-plt,$(TARGET_CFLAGS))
 
+ifneq ($(BUILD_VARIANT),none)
+  MAKE_PATH := grub-core
+endif
+
 define Host/Configure
 	$(SED) 's,(RANLIB),(TARGET_RANLIB),' $(HOST_BUILD_DIR)/grub-core/Makefile.in
 	$(Host/Configure/Default)


From lede-commits at lists.infradead.org  Sun Jun 20 16:51:02 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 20 Jun 2021 19:51:02 -0400
Subject: [openwrt/openwrt] uhttpd: make organization (O=) of the cert
 configurable via uci
In-Reply-To: <162423306255.28186.14831537546185435397@git-01.infra.openwrt.org>
References: <162423306255.28186.14831537546185435397@git-01.infra.openwrt.org>
Message-ID: <mailman.1584.1624233066.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/2c6c1501af664490ec9b701b46a201e21c670b96

commit 2c6c1501af664490ec9b701b46a201e21c670b96
Author: Martin Schiller <ms at dev.tdt.de>
AuthorDate: Mon May 4 16:13:13 2020 +0200

    uhttpd: make organization (O=) of the cert configurable via uci
    
    Make the organization (O=) of the cert configurable via uci. If not
    configured, use a combination of "OpenWrt" and an unique id like it was
    done before.
    
    Signed-off-by: Martin Schiller <ms at dev.tdt.de>
---
 package/network/services/uhttpd/Makefile          | 2 +-
 package/network/services/uhttpd/files/uhttpd.init | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/package/network/services/uhttpd/Makefile b/package/network/services/uhttpd/Makefile
index 8f58271127..781512bd99 100644
--- a/package/network/services/uhttpd/Makefile
+++ b/package/network/services/uhttpd/Makefile
@@ -8,7 +8,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=uhttpd
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/uhttpd.git
diff --git a/package/network/services/uhttpd/files/uhttpd.init b/package/network/services/uhttpd/files/uhttpd.init
index 869f79bea2..e7709941c2 100755
--- a/package/network/services/uhttpd/files/uhttpd.init
+++ b/package/network/services/uhttpd/files/uhttpd.init
@@ -35,13 +35,14 @@ generate_keys() {
 	local cfg="$1"
 	local key="$2"
 	local crt="$3"
-	local days bits country state location commonname
+	local days bits country state location organization commonname
 
 	config_get days       "$cfg" days
 	config_get bits       "$cfg" bits
 	config_get country    "$cfg" country
 	config_get state      "$cfg" state
 	config_get location   "$cfg" location
+	config_get organization "$cfg" organization
 	config_get commonname "$cfg" commonname
 	config_get key_type   "$cfg" key_type
 	config_get ec_curve   "$cfg" ec_curve
@@ -56,7 +57,7 @@ generate_keys() {
 	[ -n "$GENKEY_CMD" ] && {
 		$GENKEY_CMD \
 			-days ${days:-730} -newkey ${KEY_OPTS} -keyout "${UHTTPD_KEY}.new" -out "${UHTTPD_CERT}.new" \
-			-subj /C="${country:-ZZ}"/ST="${state:-Somewhere}"/L="${location:-Unknown}"/O="${commonname:-OpenWrt}$UNIQUEID"/CN="${commonname:-OpenWrt}"
+			-subj /C="${country:-ZZ}"/ST="${state:-Somewhere}"/L="${location:-Unknown}"/O="${organization:-OpenWrt$UNIQUEID}"/CN="${commonname:-OpenWrt}"
 		sync
 		mv "${UHTTPD_KEY}.new" "${UHTTPD_KEY}"
 		mv "${UHTTPD_CERT}.new" "${UHTTPD_CERT}"


From lede-commits at lists.infradead.org  Sun Jun 20 17:11:42 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 20 Jun 2021 20:11:42 -0400
Subject: [openwrt/openwrt]  hostapd: stop advertising 11w feature
In-Reply-To: <162423430271.7584.14797032605093720117@git-01.infra.openwrt.org>
References: <162423430271.7584.14797032605093720117@git-01.infra.openwrt.org>
Message-ID: <mailman.1585.1624234306.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/bb2ac5a33be4c85c47f0f27e9ecb9e2c5f6c0a8f

commit bb2ac5a33be4c85c47f0f27e9ecb9e2c5f6c0a8f
Author: Dobroslaw Kijowski <dobo90 at gmail.com>
AuthorDate: Sun Jan 3 13:46:21 2021 +0100

    hostapd: stop advertising 11w feature
    
    This is a follow up of 1a9b896d ("treewide: nuke DRIVER_11W_SUPPORT").
    LuCI commit ab010406 ("luci-mod-network: skip check for 802.11w feature")
    skips check of the 11w feature [1]. Now advertising it in hostapd is
    superfluous so stop doing it.
    
    [1]: https://github.com/openwrt/luci/pull/4689
    
    Signed-off-by: Dobroslaw Kijowski <dobo90 at gmail.com>
    [remove outdated PKG_RELEASE bump and update to SPDX]
    Signed-off-by: Paul Spooren <mail at aparcar.org>
---
 package/network/services/hostapd/Makefile                       | 6 ++----
 package/network/services/hostapd/src/src/utils/build_features.h | 2 --
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
index 3c521b485d..fee6889b40 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -1,8 +1,6 @@
-# Copyright (C) 2006-2014 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
+# SPDX-License-Identifier: GPL-2.0-only
 #
+# Copyright (C) 2006-2021 OpenWrt.org
 
 include $(TOPDIR)/rules.mk
 
diff --git a/package/network/services/hostapd/src/src/utils/build_features.h b/package/network/services/hostapd/src/src/utils/build_features.h
index c7fccad413..3ab5246c78 100644
--- a/package/network/services/hostapd/src/src/utils/build_features.h
+++ b/package/network/services/hostapd/src/src/utils/build_features.h
@@ -23,8 +23,6 @@ static inline int has_feature(const char *feat)
 	if (!strcmp(feat, "11r"))
 		return 1;
 #endif
-	if (!strcmp(feat, "11w"))
-		return 1;
 #ifdef CONFIG_ACS
 	if (!strcmp(feat, "acs"))
 		return 1;


From lede-commits at lists.infradead.org  Sun Jun 20 17:18:27 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 20 Jun 2021 20:18:27 -0400
Subject: [openwrt/openwrt]  busybox: disable bzip2
In-Reply-To: <162423470707.11390.18125030286572099704@git-01.infra.openwrt.org>
References: <162423470707.11390.18125030286572099704@git-01.infra.openwrt.org>
Message-ID: <mailman.1586.1624234710.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/bffee5ea192386ffeac81e7b40e9d58a93b85db8

commit bffee5ea192386ffeac81e7b40e9d58a93b85db8
Author: Sergey Ponomarev <stokito at gmail.com>
AuthorDate: Sun Jun 20 23:38:37 2021 +0300

    busybox: disable bzip2
    
    bzip2 adds about 8kb of size. For tiny builds it's often disabled.
    It's not directly used by stock OpenWrt programs.
    Kernel images compressed with bzip2 are also not fully supported.
    
    Signed-off-by: Sergey Ponomarev <stokito at gmail.com>
    [fix \ indention]
    Signed-off-by: Paul Spooren <mail at aparcar.org>
---
 package/base-files/files/lib/upgrade/common.sh | 1 -
 package/base-files/files/lib/upgrade/stage2    | 2 +-
 package/utils/busybox/Config-defaults.in       | 4 ++--
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh
index b0a482821d..b59a404565 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -96,7 +96,6 @@ get_image() { # <source> [ <command> ]
 		local magic="$(dd if="$from" bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')"
 		case "$magic" in
 			1f8b) cmd="zcat";;
-			425a) cmd="bzcat";;
 			*) cmd="cat";;
 		esac
 	fi
diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2
index b00d0c079a..cb42c956c5 100755
--- a/package/base-files/files/lib/upgrade/stage2
+++ b/package/base-files/files/lib/upgrade/stage2
@@ -39,7 +39,7 @@ switch_to_ramfs() {
 	for binary in \
 		/bin/busybox /bin/ash /bin/sh /bin/mount /bin/umount	\
 		pivot_root mount_root reboot sync kill sleep		\
-		md5sum hexdump cat zcat bzcat dd tar			\
+		md5sum hexdump cat zcat dd tar				\
 		ls basename find cp mv rm mkdir rmdir mknod touch chmod \
 		'[' printf wc grep awk sed cut				\
 		mtd partx losetup mkfs.ext4 nandwrite flash_erase	\
diff --git a/package/utils/busybox/Config-defaults.in b/package/utils/busybox/Config-defaults.in
index f9028620a1..d078a39954 100644
--- a/package/utils/busybox/Config-defaults.in
+++ b/package/utils/busybox/Config-defaults.in
@@ -351,10 +351,10 @@ config BUSYBOX_DEFAULT_FEATURE_GUNZIP_LONG_OPTIONS
 	default n
 config BUSYBOX_DEFAULT_BUNZIP2
 	bool
-	default y
+	default n
 config BUSYBOX_DEFAULT_BZCAT
 	bool
-	default y
+	default n
 config BUSYBOX_DEFAULT_UNLZMA
 	bool
 	default n


From lede-commits at lists.infradead.org  Sun Jun 20 17:20:31 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 20 Jun 2021 20:20:31 -0400
Subject: [openwrt/openwrt] base-files: upgrade: use zcat command provided by
 busybox
In-Reply-To: <162423483115.13950.2929176437451237921@git-01.infra.openwrt.org>
References: <162423483115.13950.2929176437451237921@git-01.infra.openwrt.org>
Message-ID: <mailman.1587.1624234836.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/d374e2cdb499b2a4282d84f95709b9a40d88a995

commit d374e2cdb499b2a4282d84f95709b9a40d88a995
Author: Chuck Fan <fanck0605 at qq.com>
AuthorDate: Tue Mar 9 17:42:57 2021 +0800

    base-files: upgrade: use zcat command provided by busybox
    
    Calling `switch_to_ramfs()` will not copy the gzip executable
    (/bin/gzip) to ramfs, but `/bin/zcat` will call `/bin/gzip` when
    package gzip is installed, instead of the busybox-supplied zcat.
    This will cause `zcat` to fail to find `gzip`, then cause the
    sysupgrade to fail. Adding the `busybox` prefix here will solve
    the problem.
    
    Signed-off-by: Chuck Fan <fanck0605 at qq.com>
---
 package/base-files/files/lib/upgrade/common.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh
index b59a404565..b8ae2ecb7e 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -95,7 +95,7 @@ get_image() { # <source> [ <command> ]
 	if [ -z "$cmd" ]; then
 		local magic="$(dd if="$from" bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')"
 		case "$magic" in
-			1f8b) cmd="zcat";;
+			1f8b) cmd="busybox zcat";;
 			*) cmd="cat";;
 		esac
 	fi


From lede-commits at lists.infradead.org  Sun Jun 20 18:16:19 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 20 Jun 2021 21:16:19 -0400
Subject: [openwrt/openwrt]  base-files: remove unused vn and _vn function
In-Reply-To: <162423817752.1663.13715530888596239955@git-01.infra.openwrt.org>
References: <162423817752.1663.13715530888596239955@git-01.infra.openwrt.org>
Message-ID: <mailman.1590.1624238182.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/d8bfcc59b03ea1ad2af5ee7ca99688815e386bcb

commit d8bfcc59b03ea1ad2af5ee7ca99688815e386bcb
Author: Florian Eckert <fe at dev.tdt.de>
AuthorDate: Wed Feb 3 10:25:38 2021 +0100

    base-files: remove unused vn and _vn function
    
    The remaining vn calls have been ported to v.
    Therefore, these functions are no longer needed and will be removed.
    
    Signed-off-by: Florian Eckert <fe at dev.tdt.de>
---
 package/base-files/files/lib/upgrade/common.sh | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh
index 5c85d986f9..2b152a3dfa 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -65,19 +65,11 @@ _v() {
 	[ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$*" >&2
 }
 
-_vn() {
-	[ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo -n "$*" >&2
-}
-
 v() {
 	_v "$(date) upgrade: $@"
 	logger -p info -t upgrade "$@"
 }
 
-vn() {
-	_vn "$(date) upgrade: $@"
-}
-
 json_string() {
 	local v="$1"
 	v="${v//\\/\\\\}"


From lede-commits at lists.infradead.org  Sun Jun 20 18:16:18 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 20 Jun 2021 21:16:18 -0400
Subject: [openwrt/openwrt] base-files: change logging for upgrade on stage2
In-Reply-To: <162423817752.1663.13715530888596239955@git-01.infra.openwrt.org>
References: <162423817752.1663.13715530888596239955@git-01.infra.openwrt.org>
Message-ID: <mailman.1591.1624238182.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/42d78fedfb039b7ffd623c910cd946480c75bb26

commit 42d78fedfb039b7ffd623c910cd946480c75bb26
Author: Florian Eckert <fe at dev.tdt.de>
AuthorDate: Tue Feb 2 11:26:28 2021 +0100

    base-files: change logging for upgrade on stage2
    
    Remove vn call in favour of v call. This commit serves as preparation
    for removing the vn function call.
    
    Signed-off-by: Florian Eckert <fe at dev.tdt.de>
---
 package/base-files/files/lib/upgrade/stage2 | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2
index ba728004e9..f2f3cd439a 100755
--- a/package/base-files/files/lib/upgrade/stage2
+++ b/package/base-files/files/lib/upgrade/stage2
@@ -85,7 +85,7 @@ kill_remaining() { # [ <signal> [ <loop> ] ]
 	local stat
 	local proc_ppid=$(cut -d' ' -f4  /proc/$$/stat)
 
-	vn "Sending $sig to remaining processes ..."
+	v "Sending $sig to remaining processes ..."
 
 	while $run; do
 		run=false
@@ -105,7 +105,7 @@ kill_remaining() { # [ <signal> [ <loop> ] ]
 			# Skip kernel threads
 			[ -n "$cmdline" ] || continue
 
-			_vn " $name"
+			v "Sending signal $sig to $name ($pid)"
 			kill -$sig $pid 2>/dev/null
 
 			[ $loop -eq 1 ] && run=true
@@ -113,12 +113,10 @@ kill_remaining() { # [ <signal> [ <loop> ] ]
 
 		let loop_limit--
 		[ $loop_limit -eq 0 ] && {
-			_v
 			v "Failed to kill all processes."
 			exit 1
 		}
 	done
-	_v
 }
 
 indicate_upgrade


From lede-commits at lists.infradead.org  Sun Jun 20 18:16:20 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 20 Jun 2021 21:16:20 -0400
Subject: [openwrt/openwrt]  base-files: redirect kill ouptut for ash,
 telnetd and dropbear
In-Reply-To: <162423817752.1663.13715530888596239955@git-01.infra.openwrt.org>
References: <162423817752.1663.13715530888596239955@git-01.infra.openwrt.org>
Message-ID: <mailman.1592.1624238183.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/40f533b73e6cfd7376cc6a0bbef9af46c8fbed86

commit 40f533b73e6cfd7376cc6a0bbef9af46c8fbed86
Author: Florian Eckert <fe at dev.tdt.de>
AuthorDate: Tue Feb 9 16:10:10 2021 +0100

    base-files: redirect kill ouptut for ash, telnetd and dropbear
    
    If one of the programmes is not running, then we see the following
    output in the logs.
    
    `killall: telnetd: no process killed`
    
    To ensure that the log is clean, redirect the output to /dev/null
    
    Signed-off-by: Florian Eckert <fe at dev.tdt.de>
---
 package/base-files/files/lib/upgrade/stage2 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2
index f2f3cd439a..13c3622f38 100755
--- a/package/base-files/files/lib/upgrade/stage2
+++ b/package/base-files/files/lib/upgrade/stage2
@@ -137,9 +137,9 @@ for service in /etc/init.d/*; do
 	ubus call service delete '{ "name": "'"$service"'" }' 2>/dev/null
 done
 
-killall -9 telnetd
-killall -9 dropbear
-killall -9 ash
+killall -9 telnetd 2>/dev/null
+killall -9 dropbear 2>/dev/null
+killall -9 ash 2>/dev/null
 
 kill_remaining TERM
 sleep 4


From lede-commits at lists.infradead.org  Sun Jun 20 18:16:17 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 20 Jun 2021 21:16:17 -0400
Subject: [openwrt/openwrt]  base-files: add syslog logging for v function
In-Reply-To: <162423817752.1663.13715530888596239955@git-01.infra.openwrt.org>
References: <162423817752.1663.13715530888596239955@git-01.infra.openwrt.org>
Message-ID: <mailman.1593.1624238183.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/bb2b7156a4b55a5599ac45adbe46b2d6bd046036

commit bb2b7156a4b55a5599ac45adbe46b2d6bd046036
Author: Florian Eckert <fe at dev.tdt.de>
AuthorDate: Mon Feb 1 11:02:30 2021 +0100

    base-files: add syslog logging for v function
    
    The logging output should not only be displayed in the calling shell
    session but also in the syslog. A sysupgrade and a configuration
    import, export can thus be traced in the syslog.
    
    Signed-off-by: Florian Eckert <fe at dev.tdt.de>
---
 package/base-files/files/lib/upgrade/common.sh | 1 +
 package/base-files/files/lib/upgrade/stage2    | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh
index b8ae2ecb7e..5c85d986f9 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -71,6 +71,7 @@ _vn() {
 
 v() {
 	_v "$(date) upgrade: $@"
+	logger -p info -t upgrade "$@"
 }
 
 vn() {
diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2
index cb42c956c5..ba728004e9 100755
--- a/package/base-files/files/lib/upgrade/stage2
+++ b/package/base-files/files/lib/upgrade/stage2
@@ -45,7 +45,7 @@ switch_to_ramfs() {
 		mtd partx losetup mkfs.ext4 nandwrite flash_erase	\
 		ubiupdatevol ubiattach ubiblock ubiformat		\
 		ubidetach ubirsvol ubirmvol ubimkvol			\
-		snapshot snapshot_tool date				\
+		snapshot snapshot_tool date logger			\
 		$RAMFS_COPY_LOSETUP $RAMFS_COPY_LVM			\
 		$RAMFS_COPY_BIN
 	do


From lede-commits at lists.infradead.org  Sun Jun 20 18:21:15 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 20 Jun 2021 21:21:15 -0400
Subject: [openwrt/openwrt]  tools/libressl: update to 3.3.3
In-Reply-To: <162423847561.6705.14975675460476296990@git-01.infra.openwrt.org>
References: <162423847561.6705.14975675460476296990@git-01.infra.openwrt.org>
Message-ID: <mailman.1594.1624238480.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/bf4dbbb55e2b8e23f186e1334f1e9ce6a3a8ddfe

commit bf4dbbb55e2b8e23f186e1334f1e9ce6a3a8ddfe
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sat Jun 19 14:45:11 2021 -0700

    tools/libressl: update to 3.3.3
    
    Fix wrong FPIC variable usage. Fixes compilation under sparc64 host.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 tools/libressl/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/libressl/Makefile b/tools/libressl/Makefile
index 2b5a33450c..e25b5661ee 100644
--- a/tools/libressl/Makefile
+++ b/tools/libressl/Makefile
@@ -8,8 +8,8 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libressl
-PKG_VERSION:=3.3.1
-PKG_HASH:=a6d331865e0164a13ac85a228e52517f7cf8f8488f2f95f34e7857302f97cfdb
+PKG_VERSION:=3.3.3
+PKG_HASH:=a471565b36ccd1a70d0bd7d37c6e95c43a26a62829b487d9d2cdebfe58be3066
 PKG_RELEASE:=1
 
 PKG_CPE_ID:=cpe:/a:openbsd:libressl
@@ -25,7 +25,7 @@ include $(INCLUDE_DIR)/host-build.mk
 
 HOSTCC := $(HOSTCC_NOCACHE)
 HOST_CONFIGURE_ARGS += --enable-static --disable-shared --disable-tests
-HOST_CFLAGS += $(FPIC)
+HOST_CFLAGS += $(HOST_FPIC)
 
 ifeq ($(GNU_HOST_NAME),x86_64-linux-gnux32)
 HOST_CONFIGURE_ARGS += --disable-asm


From lede-commits at lists.infradead.org  Sun Jun 20 18:43:06 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 20 Jun 2021 21:43:06 -0400
Subject: [openwrt/openwrt]  hostapd: add support for setting sae_pwe
In-Reply-To: <162423978676.22959.9837304008917483458@git-01.infra.openwrt.org>
References: <162423978676.22959.9837304008917483458@git-01.infra.openwrt.org>
Message-ID: <mailman.1595.1624239791.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/b9b4aef4f2403766a1a3321b0ef095c2728a3139

commit b9b4aef4f2403766a1a3321b0ef095c2728a3139
Author: Michael Yartys <michael.yartys at protonmail.com>
AuthorDate: Wed Jun 2 19:48:43 2021 +0200

    hostapd: add support for setting sae_pwe
    
    Make it possible to specify the SAE mechanism for PWE derivation. The
    following values are possible:
    
    0 = hunting-and-pecking loop only
    1 = hash-to-element only
    2 = both hunting-and-pecking loop and hash-to-element enabled
    
    hostapd currently defaults to hunting-and-pecking loop only.
    
    Signed-off-by: Michael Yartys <michael.yartys at protonmail.com>
---
 package/network/services/hostapd/files/hostapd.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index cf85019d56..8a6c904c58 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -319,6 +319,7 @@ hostapd_common_add_bss_config() {
 	config_add_array supported_rates
 
 	config_add_boolean sae_require_mfp
+	config_add_int sae_pwe
 
 	config_add_string 'owe_transition_bssid:macaddr' 'owe_transition_ssid:string'
 
@@ -520,7 +521,7 @@ hostapd_set_bss_options() {
 		macfilter ssid utf8_ssid wmm uapsd hidden short_preamble rsn_preauth \
 		iapp_interface eapol_version dynamic_vlan ieee80211w nasid \
 		acct_server acct_secret acct_port acct_interval \
-		bss_load_update_period chan_util_avg_period sae_require_mfp \
+		bss_load_update_period chan_util_avg_period sae_require_mfp sae_pwe \
 		multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key skip_inactivity_poll \
 		airtime_bss_weight airtime_bss_limit airtime_sta_weight \
 		multicast_to_unicast proxy_arp per_sta_vif \
@@ -604,6 +605,7 @@ hostapd_set_bss_options() {
 		;;
 	esac
 	[ -n "$sae_require_mfp" ] && append bss_conf "sae_require_mfp=$sae_require_mfp" "$N"
+	[ -n "$sae_pwe" ] && append bss_conf "sae_pwe=$sae_pwe" "$N"
 
 	local vlan_possible=""
 


From lede-commits at lists.infradead.org  Sun Jun 20 21:14:10 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 00:14:10 -0400
Subject: [openwrt/openwrt]  tools/e2fsprogs: update to 1.46.2
In-Reply-To: <162424885060.31569.10280234409545346101@git-01.infra.openwrt.org>
References: <162424885060.31569.10280234409545346101@git-01.infra.openwrt.org>
Message-ID: <mailman.1605.1624248855.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/b154a2f8d37097e51099ed816a0f8142120405e6

commit b154a2f8d37097e51099ed816a0f8142120405e6
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sat Jun 19 15:11:23 2021 -0700

    tools/e2fsprogs: update to 1.46.2
    
    Fix wrong FPIC flag to fix compilation under sparc64
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 tools/e2fsprogs/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/e2fsprogs/Makefile b/tools/e2fsprogs/Makefile
index d7c994c338..408097f740 100644
--- a/tools/e2fsprogs/Makefile
+++ b/tools/e2fsprogs/Makefile
@@ -9,8 +9,8 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=e2fsprogs
 PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs
-PKG_VERSION:=1.45.6
-PKG_HASH:=ffa7ae6954395abdc50d0f8605d8be84736465afc53b8938ef473fcf7ff44256
+PKG_VERSION:=1.46.2
+PKG_HASH:=23aa093295c94e71ef1be490c4004871c5b01d216a8cb4d111fa6c0aac354168
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
@@ -23,7 +23,7 @@ include $(INCLUDE_DIR)/host-build.mk
 ifneq ($(shell $(HOSTCC) --version | grep clang),)
   HOST_CFLAGS += -D__GNUC_PREREQ\(...\)=0 -Dloff_t=off_t
 endif
-HOST_CFLAGS += $(FPIC)
+HOST_CFLAGS += $(HOST_FPIC)
 
 HOST_CONFIGURE_ARGS += \
 	--disable-elf-shlibs \


From lede-commits at lists.infradead.org  Sun Jun 20 21:59:54 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 00:59:54 -0400
Subject: [openwrt/openwrt] tools/squashfskit4: fix compilation under big endian
In-Reply-To: <162425159475.25997.7419860428810515813@git-01.infra.openwrt.org>
References: <162425159475.25997.7419860428810515813@git-01.infra.openwrt.org>
Message-ID: <mailman.1610.1624251599.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/3cbdc13bc1367a6fdc9bc2afadfae21b74d7c781

commit 3cbdc13bc1367a6fdc9bc2afadfae21b74d7c781
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sat Jun 19 21:31:35 2021 -0500

    tools/squashfskit4: fix compilation under big endian
    
    The macro used is for the wrong struct. Just byte swap manually.
    
    Refreshed patches.
    
    Tested on sparc64.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 tools/squashfskit4/Makefile                                |  2 +-
 .../patches/0002-fix-build-failure-against-gcc-10.patch    |  8 +++-----
 tools/squashfskit4/patches/0020-big-endian.patch           | 14 ++++++++++++++
 3 files changed, 18 insertions(+), 6 deletions(-)

diff --git a/tools/squashfskit4/Makefile b/tools/squashfskit4/Makefile
index 9ed10ecef9..1800306d33 100644
--- a/tools/squashfskit4/Makefile
+++ b/tools/squashfskit4/Makefile
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=squashfskit4
 PKG_VERSION:=4.14
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 PKG_SOURCE:=squashfskit-v$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://github.com/squashfskit/squashfskit/releases/download/v$(PKG_VERSION)/
 PKG_HASH:=5761aaa3aedc4f7112b708367d891c9abdc1ffea972e3fe47923ddba23984d95
diff --git a/tools/squashfskit4/patches/0002-fix-build-failure-against-gcc-10.patch b/tools/squashfskit4/patches/0002-fix-build-failure-against-gcc-10.patch
index 46c6a5ea0f..de77299978 100644
--- a/tools/squashfskit4/patches/0002-fix-build-failure-against-gcc-10.patch
+++ b/tools/squashfskit4/patches/0002-fix-build-failure-against-gcc-10.patch
@@ -28,16 +28,14 @@ Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>
  squashfs-tools/mksquashfs.h | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/squashfs-tools/mksquashfs.h b/squashfs-tools/mksquashfs.h
-index 1beefef7..b6503063 100644
 --- a/squashfs-tools/mksquashfs.h
 +++ b/squashfs-tools/mksquashfs.h
-@@ -143,7 +143,7 @@ struct append_file {
- #endif
+@@ -133,7 +133,7 @@ struct append_file {
+ #define BLOCK_OFFSET 2
  
  extern struct cache *reader_buffer, *fragment_buffer, *reserve_cache;
 -struct cache *bwriter_buffer, *fwriter_buffer;
 +extern struct cache *bwriter_buffer, *fwriter_buffer;
  extern struct queue *to_reader, *to_deflate, *to_writer, *from_writer,
- 	*to_frag, *locked_fragment, *to_process_frag;
+ 	       *locked_fragment, *to_process_frag;
  extern struct append_file **file_mapping;
diff --git a/tools/squashfskit4/patches/0020-big-endian.patch b/tools/squashfskit4/patches/0020-big-endian.patch
new file mode 100644
index 0000000000..b388cb4d12
--- /dev/null
+++ b/tools/squashfskit4/patches/0020-big-endian.patch
@@ -0,0 +1,14 @@
+--- a/squashfs-tools/xz_wrapper.c
++++ b/squashfs-tools/xz_wrapper.c
+@@ -192,7 +192,10 @@ static void xz_display_options(void *buf
+ 	if(size != sizeof(struct comp_opts))
+ 		goto failed;
+ 
+-	SQUASHFS_INSWAP_LZMA_COMP_OPTS(comp_opts);
++#if __BYTE_ORDER == __BIG_ENDIAN
++	comp_opts->dictionary_size = inswap_le32(comp_opts->dictionary_size);
++	comp_opts->flags = inswap_le32(comp_opts->flags);
++#endif
+ 
+ 	dictionary_size = comp_opts->dictionary_size;
+ 	flags = comp_opts->flags;


From lede-commits at lists.infradead.org  Sun Jun 20 23:12:43 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 02:12:43 -0400
Subject: [openwrt/openwrt] tools/cmake: update to 3.20.3 + build with Ninja
In-Reply-To: <162425596333.17774.15097123757099100710@git-01.infra.openwrt.org>
References: <162425596333.17774.15097123757099100710@git-01.infra.openwrt.org>
Message-ID: <mailman.1632.1624255966.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/5cff6c1abbcb134395bbe032cb5ea9d1c74ec891

commit 5cff6c1abbcb134395bbe032cb5ea9d1c74ec891
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Thu Jun 17 23:08:50 2021 -0700

    tools/cmake: update to 3.20.3 + build with Ninja
    
    Compile with Ninja. Ninja compiles faster and is more stable with
    parallel builds. Routines copied from cmake.mk.
    
    Speed improves from:
    
    Executed in     127.47 secs     fish            external
    usr time        17.02 mins      446.00 micros   17.02 mins
    sys time        1.18 mins       40.00 micros    1.18 mins
    
    to:
    
    Executed in     118.91 secs     fish            external
    usr time        17.28 mins      499.00 micros   17.28 mins
    sys time        1.13 mins       45.00 micros    1.13 mins
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 tools/cmake/Makefile | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/tools/cmake/Makefile b/tools/cmake/Makefile
index 006934466a..fc7926fda5 100644
--- a/tools/cmake/Makefile
+++ b/tools/cmake/Makefile
@@ -7,14 +7,14 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=cmake
-PKG_VERSION:=3.19.1
+PKG_VERSION:=3.20.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:=1d266ea3a76ef650cdcf16c782a317cb4a7aa461617ee941e389cb48738a3aba
+PKG_HASH:=4d008ac3461e271fcfac26a05936f77fc7ab64402156fb371d41284851a651b8
 
 HOST_BUILD_PARALLEL:=1
 HOST_CONFIGURE_PARALLEL:=1
@@ -29,7 +29,20 @@ HOST_CONFIGURE_VARS += \
 
 HOST_CONFIGURE_ARGS := \
 	$(if $(MAKE_JOBSERVER),--parallel="$(MAKE_JOBSERVER)") \
-	--prefix=$(STAGING_DIR_HOST)
+	--prefix="$(STAGING_DIR_HOST)" \
+	--generator=Ninja
+
+define Host/Compile/Default
+	+$(NINJA) -C $(HOST_BUILD_DIR) $(1)
+endef
+
+define Host/Install/Default
+	+$(NINJA) -C $(HOST_BUILD_DIR) install
+endef
+
+define Host/Uninstall/Default
+	+$(NINJA) -C $(HOST_BUILD_DIR) uninstall
+endef
 
 ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
   HOST_MAKE_FLAGS += VERBOSE=1


From lede-commits at lists.infradead.org  Mon Jun 21 00:13:16 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 03:13:16 -0400
Subject: [openwrt/openwrt]  bcm4908: add kmod-gpio-button-hotplug
In-Reply-To: <162425959607.9044.6050526633144887362@git-01.infra.openwrt.org>
References: <162425959607.9044.6050526633144887362@git-01.infra.openwrt.org>
Message-ID: <mailman.1645.1624259600.1072.lede-commits@lists.infradead.org>

rmilecki pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/fcfa60408c37a129b143e4928b6d86e383c2c8f6

commit fcfa60408c37a129b143e4928b6d86e383c2c8f6
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Mon Jun 21 08:49:03 2021 +0200

    bcm4908: add kmod-gpio-button-hotplug
    
    All bcm4908 devices are expected to have GPIO buttons to make relevant
    package selected by default.
    This "fixes" triggering failsafe mode.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 target/linux/bcm4908/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/bcm4908/Makefile b/target/linux/bcm4908/Makefile
index ce5f230ca6..bbe5030b65 100644
--- a/target/linux/bcm4908/Makefile
+++ b/target/linux/bcm4908/Makefile
@@ -22,6 +22,7 @@ KERNELNAME:=Image dtbs
 
 DEFAULT_PACKAGES += \
 	bcm4908img \
+	kmod-gpio-button-hotplug \
 	kmod-usb-ohci kmod-usb2 kmod-usb3
 
 $(eval $(call BuildTarget))


From lede-commits at lists.infradead.org  Mon Jun 21 00:25:32 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 03:25:32 -0400
Subject: [openwrt/openwrt] qos-scripts: add ifbN device before setting the
 link up
In-Reply-To: <162426033224.21015.11927959026126534656@git-01.infra.openwrt.org>
References: <162426033224.21015.11927959026126534656@git-01.infra.openwrt.org>
Message-ID: <mailman.1660.1624260342.1072.lede-commits@lists.infradead.org>

zorun pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/23c3bab9209f984692f8206c0d97758ee223a26f

commit 23c3bab9209f984692f8206c0d97758ee223a26f
Author: Perry Melange <isprotejesvalkata at gmail.com>
AuthorDate: Mon Apr 19 11:17:10 2021 +0200

    qos-scripts: add ifbN device before setting the link up
    
    commit 50413e1ec83dedaea44558d5f37af5454156a46a replaced ifconfig
    with ip.  In order to set a link state to up, the interface needs
    to be added first.
    
    Fixes: FS#3754
    
    Signed-off-by: Perry Melange <isprotejesvalkata at gmail.com>
    [Add Fixes tag]
    Signed-off-by: Baptiste Jonglez <git at bitsofnetworks.org>
---
 package/network/config/qos-scripts/Makefile                      | 2 +-
 package/network/config/qos-scripts/files/usr/lib/qos/generate.sh | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/package/network/config/qos-scripts/Makefile b/package/network/config/qos-scripts/Makefile
index 7d282b2db5..d6e7df1467 100644
--- a/package/network/config/qos-scripts/Makefile
+++ b/package/network/config/qos-scripts/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=qos-scripts
 PKG_VERSION:=1.3.1
-PKG_RELEASE:=2
+PKG_RELEASE:=$(AUTORELEASE)
 PKG_LICENSE:=GPL-2.0
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
diff --git a/package/network/config/qos-scripts/files/usr/lib/qos/generate.sh b/package/network/config/qos-scripts/files/usr/lib/qos/generate.sh
index 32f15581f8..62e7283633 100755
--- a/package/network/config/qos-scripts/files/usr/lib/qos/generate.sh
+++ b/package/network/config/qos-scripts/files/usr/lib/qos/generate.sh
@@ -326,7 +326,8 @@ start_interface() {
 			append cstr "$classnr:$prio:$avgrate:$pktsize:$pktdelay:$maxrate:$qdisc:$filter" "$N"
 		done
 		append ${prefix}q "$(tcrules)" "$N"
-		export dev_${dir}="ip link set $dev up >&- 2>&-
+		export dev_${dir}="ip link add ${dev} type ifb >&- 2>&-
+ip link set $dev up >&- 2>&-
 tc qdisc del dev $dev root >&- 2>&-
 tc qdisc add dev $dev root handle 1: hfsc default ${class_default}0
 tc class add dev $dev parent 1: classid 1:1 hfsc sc rate ${rate}kbit ul rate ${rate}kbit"


From lede-commits at lists.infradead.org  Mon Jun 21 00:29:04 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 03:29:04 -0400
Subject: [openwrt/openwrt] qos-scripts: add ifbN device before setting the
 link up
In-Reply-To: <162426054454.23839.9968554688942416504@git-01.infra.openwrt.org>
References: <162426054454.23839.9968554688942416504@git-01.infra.openwrt.org>
Message-ID: <mailman.1661.1624260548.1072.lede-commits@lists.infradead.org>

zorun pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/b2a3df91fa7e9a7f8b9216a99496ecc935f3e56d

commit b2a3df91fa7e9a7f8b9216a99496ecc935f3e56d
Author: Perry Melange <isprotejesvalkata at gmail.com>
AuthorDate: Mon Apr 19 11:17:10 2021 +0200

    qos-scripts: add ifbN device before setting the link up
    
    commit 50413e1ec83dedaea44558d5f37af5454156a46a replaced ifconfig
    with ip.  In order to set a link state to up, the interface needs
    to be added first.
    
    Fixes: FS#3754
    
    Signed-off-by: Perry Melange <isprotejesvalkata at gmail.com>
    [Add Fixes tag]
    Signed-off-by: Baptiste Jonglez <git at bitsofnetworks.org>
    (cherry picked from commit 23c3bab9209f984692f8206c0d97758ee223a26f)
---
 package/network/config/qos-scripts/Makefile                      | 2 +-
 package/network/config/qos-scripts/files/usr/lib/qos/generate.sh | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/package/network/config/qos-scripts/Makefile b/package/network/config/qos-scripts/Makefile
index 7d282b2db5..d6e7df1467 100644
--- a/package/network/config/qos-scripts/Makefile
+++ b/package/network/config/qos-scripts/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=qos-scripts
 PKG_VERSION:=1.3.1
-PKG_RELEASE:=2
+PKG_RELEASE:=$(AUTORELEASE)
 PKG_LICENSE:=GPL-2.0
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
diff --git a/package/network/config/qos-scripts/files/usr/lib/qos/generate.sh b/package/network/config/qos-scripts/files/usr/lib/qos/generate.sh
index 32f15581f8..62e7283633 100755
--- a/package/network/config/qos-scripts/files/usr/lib/qos/generate.sh
+++ b/package/network/config/qos-scripts/files/usr/lib/qos/generate.sh
@@ -326,7 +326,8 @@ start_interface() {
 			append cstr "$classnr:$prio:$avgrate:$pktsize:$pktdelay:$maxrate:$qdisc:$filter" "$N"
 		done
 		append ${prefix}q "$(tcrules)" "$N"
-		export dev_${dir}="ip link set $dev up >&- 2>&-
+		export dev_${dir}="ip link add ${dev} type ifb >&- 2>&-
+ip link set $dev up >&- 2>&-
 tc qdisc del dev $dev root >&- 2>&-
 tc qdisc add dev $dev root handle 1: hfsc default ${class_default}0
 tc class add dev $dev parent 1: classid 1:1 hfsc sc rate ${rate}kbit ul rate ${rate}kbit"


From lede-commits at lists.infradead.org  Mon Jun 21 01:44:25 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 04:44:25 -0400
Subject: [openwrt/openwrt]  build,json: fix generation with empty profiles
In-Reply-To: <162426506542.21786.17879060904738044078@git-01.infra.openwrt.org>
References: <162426506542.21786.17879060904738044078@git-01.infra.openwrt.org>
Message-ID: <mailman.1672.1624265069.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/fd0d9909bf50f114d5e7f7cedf53e542de878a2c

commit fd0d9909bf50f114d5e7f7cedf53e542de878a2c
Author: Paul Spooren <mail at aparcar.org>
AuthorDate: Sun Jun 20 20:23:45 2021 -1000

    build,json: fix generation with empty profiles
    
    If the image generation doesn't add any profiles to the output the
    *profile merge* will fail. To avoid that set an empty profile as
    fallback.
    
    Signed-off-by: Paul Spooren <mail at aparcar.org>
---
 scripts/json_overview_image_info.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/json_overview_image_info.py b/scripts/json_overview_image_info.py
index 45c05012b1..db47fd9e42 100755
--- a/scripts/json_overview_image_info.py
+++ b/scripts/json_overview_image_info.py
@@ -42,7 +42,7 @@ for json_file in work_dir.glob("*.json"):
         output["profiles"][device_id]["images"].extend(profile["images"])
 
 # make image lists unique by name, keep last/latest
-for device_id, profile in output["profiles"].items():
+for device_id, profile in output.get("profiles", {}).items():
     profile["images"] = list({e["name"]: e for e in profile["images"]}.values())
 
 


From lede-commits at lists.infradead.org  Mon Jun 21 01:51:27 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 04:51:27 -0400
Subject: [openwrt/openwrt] ath79: ar934x: fix mounting issues if subpage is
 not supported
In-Reply-To: <162426548399.30628.9343139372334735979@git-01.infra.openwrt.org>
References: <162426548399.30628.9343139372334735979@git-01.infra.openwrt.org>
Message-ID: <mailman.1673.1624265488.1072.lede-commits@lists.infradead.org>

xback pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/6561ca1fa510003a19ea7f8800535f12e5098ce2

commit 6561ca1fa510003a19ea7f8800535f12e5098ce2
Author: Koen Vandeputte <koen.vandeputte at ncentric.com>
AuthorDate: Mon May 17 17:52:53 2021 +0200

    ath79: ar934x: fix mounting issues if subpage is not supported
    
    Currently, the option to disable subpage writing is only set
    when a HW ECC engine is used.
    
    Some boards lack a HW ECC engine and use software for that.
    In this case, this NAND option does not get set when the NAND chip
    does not support it, resulting in mounting errors.
    
    Move the setting of this option to a generic init location so it
    gets set for all types where required.
    
    While at it, also OR the option instead of just setting it
    so we don't overwrite potential flags being set somewhere else.
    
    Before:
    
    [    1.681273] UBI: auto-attach mtd2
    [    1.684669] ubi0: attaching mtd2
    [    1.688877] ubi0 error: validate_ec_hdr: bad VID header offset 2048, expected 512
    [    1.696469] ubi0 error: validate_ec_hdr: bad EC header
    [    1.701712] Erase counter header dump:
    [    1.705512]  magic          0x55424923
    [    1.709322]  version        1
    [    1.712330]  ec             1
    [    1.715331]  vid_hdr_offset 2048
    [    1.718610]  data_offset    4096
    [    1.721880]  image_seq      1462320675
    [    1.725680]  hdr_crc        0x12255a15
    
    After:
    
        1.680917] UBI: auto-attach mtd2
    [    1.684308] ubi0: attaching mtd2
    [    2.954504] random: crng init done
    [    3.142813] ubi0: scanning is finished
    [    3.163455] ubi0: attached mtd2 (name "ubi", size 124 MiB)
    [    3.169069] ubi0: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
    [    3.176037] ubi0: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
    [    3.182942] ubi0: VID header offset: 2048 (aligned 2048), data offset: 4096
    [    3.190013] ubi0: good PEBs: 992, bad PEBs: 0, corrupted PEBs: 0
    [    3.196102] ubi0: user volume: 3, internal volumes: 1, max. volumes count: 128
    [    3.203434] ubi0: max/mean erase counter: 2/0, WL threshold: 4096, image sequence number: 1462320675
    [    3.212700] ubi0: available PEBs: 0, total reserved PEBs: 992, PEBs reserved for bad PEB handling: 20
    [    3.222124] ubi0: background thread "ubi_bgt0d" started, PID 317
    [    3.230246] block ubiblock0_1: created from ubi0:1(rootfs)
    [    3.235819] ubiblock: device ubiblock0_1 (rootfs) set to be root filesystem
    [    3.256830] VFS: Mounted root (squashfs filesystem) readonly on device 254:0.
    
    Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c b/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c
index ddc6d6d882..e040726f44 100644
--- a/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c
+++ b/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c
@@ -1273,7 +1273,6 @@ static int ar934x_nfc_setup_hwecc(struct ar934x_nfc *nfc)
 		 * Writing a subpage separately is not supported, because
 		 * the controller only does ECC on full-page accesses.
 		 */
-		nand->options = NAND_NO_SUBPAGE_WRITE;
 
 		nand->ecc.size = 512;
 		nand->ecc.bytes = 7;
@@ -1332,6 +1331,9 @@ static int ar934x_nfc_attach_chip(struct nand_chip *nand)
 	if (ret)
 		return ret;
 
+	if (mtd->writesize == 2048)
+		nand->options |= NAND_NO_SUBPAGE_WRITE;
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0)
 	if (nand->ecc.engine_type == NAND_ECC_ENGINE_TYPE_ON_HOST) {
 #else


From lede-commits at lists.infradead.org  Mon Jun 21 01:51:24 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 04:51:24 -0400
Subject: [openwrt/openwrt] ath79: add gpio-latch driver for MikroTik
 RouterBOARDs
In-Reply-To: <162426548399.30628.9343139372334735979@git-01.infra.openwrt.org>
References: <162426548399.30628.9343139372334735979@git-01.infra.openwrt.org>
Message-ID: <mailman.1674.1624265488.1072.lede-commits@lists.infradead.org>

xback pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/7b8931678c36c8d8c333b446258a653b1358bf70

commit 7b8931678c36c8d8c333b446258a653b1358bf70
Author: Denis Kalashnikov <denis281089 at gmail.com>
AuthorDate: Thu May 27 11:16:44 2021 +0300

    ath79: add gpio-latch driver for MikroTik RouterBOARDs
    
    This is a slighty modified version of ar71xx gpio-latch driver
    written by Gabor Juhos <juhosg at openwrt.org>.
    
    Changes:
    * DTS support,
    * New gpio API (gpiod_*).
    
    Reviewed-by: Sergey Ryazanov <ryazanov.s.a at gmail.com>
    Signed-off-by: Denis Kalashnikov <denis281089 at gmail.com>
---
 target/linux/ath79/files/drivers/gpio/gpio-latch.c | 203 +++++++++++++++++++++
 .../ath79/patches-5.10/939-mikrotik-rb91x.patch    |  26 +++
 .../ath79/patches-5.4/939-mikrotik-rb91x.patch     |  23 +++
 3 files changed, 252 insertions(+)

diff --git a/target/linux/ath79/files/drivers/gpio/gpio-latch.c b/target/linux/ath79/files/drivers/gpio/gpio-latch.c
new file mode 100644
index 0000000000..f3545a663e
--- /dev/null
+++ b/target/linux/ath79/files/drivers/gpio/gpio-latch.c
@@ -0,0 +1,203 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ *  GPIO latch driver
+ *
+ *  Copyright (C) 2014 Gabor Juhos <juhosg at openwrt.org>
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/gpio/consumer.h>
+#include <linux/gpio/driver.h>
+#include <linux/platform_device.h>
+#include <linux/of_platform.h>
+#include <linux/of_gpio.h>
+
+#define GPIO_LATCH_DRIVER_NAME  "gpio-latch"
+#define GPIO_LATCH_LINES 9
+
+struct gpio_latch_chip {
+	struct gpio_chip gc;
+	struct mutex mutex;
+	struct mutex latch_mutex;
+	bool latch_enabled;
+	int le_gpio;
+	bool le_active_low;
+	struct gpio_desc *gpios[GPIO_LATCH_LINES];
+};
+
+static inline struct gpio_latch_chip *to_gpio_latch_chip(struct gpio_chip *gc)
+{
+	return container_of(gc, struct gpio_latch_chip, gc);
+}
+
+static void gpio_latch_lock(struct gpio_latch_chip *glc, bool enable)
+{
+	mutex_lock(&glc->mutex);
+
+	if (enable)
+		glc->latch_enabled = true;
+
+	if (glc->latch_enabled)
+		mutex_lock(&glc->latch_mutex);
+}
+
+static void gpio_latch_unlock(struct gpio_latch_chip *glc, bool disable)
+{
+	if (glc->latch_enabled)
+		mutex_unlock(&glc->latch_mutex);
+
+	if (disable)
+		glc->latch_enabled = true;
+
+	mutex_unlock(&glc->mutex);
+}
+
+static int
+gpio_latch_get(struct gpio_chip *gc, unsigned offset)
+{
+	struct gpio_latch_chip *glc = to_gpio_latch_chip(gc);
+	int ret;
+
+	gpio_latch_lock(glc, false);
+	ret = gpiod_get_value(glc->gpios[offset]);
+	gpio_latch_unlock(glc, false);
+
+	return ret;
+}
+
+static void
+gpio_latch_set(struct gpio_chip *gc, unsigned offset, int value)
+{
+	struct gpio_latch_chip *glc = to_gpio_latch_chip(gc);
+	bool enable_latch = false;
+	bool disable_latch = false;
+
+	if (offset == glc->le_gpio) {
+		enable_latch = value ^ glc->le_active_low;
+		disable_latch = !enable_latch;
+	}
+
+	gpio_latch_lock(glc, enable_latch);
+	gpiod_set_raw_value(glc->gpios[offset], value);
+	gpio_latch_unlock(glc, disable_latch);
+}
+
+static int
+gpio_latch_direction_output(struct gpio_chip *gc, unsigned offset, int value)
+{
+	struct gpio_latch_chip *glc = to_gpio_latch_chip(gc);
+	bool enable_latch = false;
+	bool disable_latch = false;
+	int ret;
+
+	if (offset == glc->le_gpio) {
+		enable_latch = value ^ glc->le_active_low;
+		disable_latch = !enable_latch;
+	}
+
+	gpio_latch_lock(glc, enable_latch);
+	ret = gpiod_direction_output_raw(glc->gpios[offset], value);
+	gpio_latch_unlock(glc, disable_latch);
+
+	return ret;
+}
+
+static int gpio_latch_probe(struct platform_device *pdev)
+{
+	struct gpio_latch_chip *glc;
+	struct gpio_chip *gc;
+	struct device *dev = &pdev->dev;
+	struct device_node *of_node = dev->of_node;
+	int i, n;
+
+	glc = devm_kzalloc(dev, sizeof(*glc), GFP_KERNEL);
+	if (!glc)
+		return -ENOMEM;
+
+	mutex_init(&glc->mutex);
+	mutex_init(&glc->latch_mutex);
+
+	n = gpiod_count(dev, NULL);
+	if (n <= 0) {
+		dev_err(dev, "failed to get gpios: %d\n", n);
+		return n;
+	} else if (n != GPIO_LATCH_LINES) {
+		dev_err(dev, "expected %d gpios\n", GPIO_LATCH_LINES);
+		return -EINVAL;
+	}
+
+	for (i = 0; i < n; i++) {
+		glc->gpios[i] = devm_gpiod_get_index_optional(dev, NULL, i,
+			GPIOD_OUT_LOW);
+		if (IS_ERR(glc->gpios[i])) {
+			dev_err(dev, "failed to get gpio %d: %d\n", i,
+				PTR_ERR(glc->gpios[i]));
+			return PTR_ERR(glc->gpios[i]);
+		}
+	}
+
+	glc->le_gpio = 8;
+	glc->le_active_low = gpiod_is_active_low(glc->gpios[glc->le_gpio]);
+
+	if (!glc->gpios[glc->le_gpio]) {
+		dev_err(dev, "missing required latch-enable gpio %d\n",
+			glc->le_gpio);
+		return -EINVAL;
+	}
+
+	gc = &glc->gc;
+	gc->label = GPIO_LATCH_DRIVER_NAME;
+	gc->can_sleep = true;
+	gc->base = -1;
+	gc->ngpio = GPIO_LATCH_LINES;
+	gc->get = gpio_latch_get;
+	gc->set = gpio_latch_set;
+	gc->direction_output = gpio_latch_direction_output;
+	gc->of_node = of_node;
+
+	platform_set_drvdata(pdev, glc);
+
+	i = gpiochip_add(&glc->gc);
+	if (i) {
+		dev_err(dev, "gpiochip_add() failed: %d\n", i);
+		return i;
+	}
+
+	return 0;
+}
+
+static int gpio_latch_remove(struct platform_device *pdev)
+{
+	struct gpio_latch_chip *glc = platform_get_drvdata(pdev);
+
+	gpiochip_remove(&glc->gc);
+	return 0;
+}
+
+static const struct of_device_id gpio_latch_match[] = {
+	{ .compatible = GPIO_LATCH_DRIVER_NAME },
+	{},
+};
+
+MODULE_DEVICE_TABLE(of, gpio_latch_match);
+
+static struct platform_driver gpio_latch_driver = {
+	.probe = gpio_latch_probe,
+	.remove = gpio_latch_remove,
+	.driver = {
+		.name = GPIO_LATCH_DRIVER_NAME,
+		.owner = THIS_MODULE,
+		.of_match_table = gpio_latch_match,
+	},
+};
+
+module_platform_driver(gpio_latch_driver);
+
+MODULE_DESCRIPTION("GPIO latch driver");
+MODULE_AUTHOR("Gabor Juhos <juhosg at openwrt.org>");
+MODULE_AUTHOR("Denis Kalashnikov <denis281089 at gmail.com>");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:" GPIO_LATCH_DRIVER_NAME);
diff --git a/target/linux/ath79/patches-5.10/939-mikrotik-rb91x.patch b/target/linux/ath79/patches-5.10/939-mikrotik-rb91x.patch
new file mode 100644
index 0000000000..477993c8bf
--- /dev/null
+++ b/target/linux/ath79/patches-5.10/939-mikrotik-rb91x.patch
@@ -0,0 +1,26 @@
+--- a/drivers/gpio/Kconfig
++++ b/drivers/gpio/Kconfig
+@@ -341,6 +341,13 @@ config GPIO_IXP4XX
+ 	  IXP4xx series of chips.
+ 
+ 	  If unsure, say N.
++
++config GPIO_LATCH
++	tristate "MikroTik RouterBOARD GPIO latch support"
++	depends on ATH79
++	help
++	  GPIO driver for latch on some MikroTik RouterBOARDs.
++
+ config GPIO_LOGICVC
+ 	tristate "Xylon LogiCVC GPIO support"
+ 	depends on MFD_SYSCON && OF
+--- a/drivers/gpio/Makefile
++++ b/drivers/gpio/Makefile
+@@ -72,6 +72,7 @@ obj-$(CONFIG_GPIO_IT87)			+= gpio-it87.o
+ obj-$(CONFIG_GPIO_IXP4XX)		+= gpio-ixp4xx.o
+ obj-$(CONFIG_GPIO_JANZ_TTL)		+= gpio-janz-ttl.o
+ obj-$(CONFIG_GPIO_KEMPLD)		+= gpio-kempld.o
++obj-$(CONFIG_GPIO_LATCH)		+= gpio-latch.o
+ obj-$(CONFIG_GPIO_LOGICVC)		+= gpio-logicvc.o
+ obj-$(CONFIG_GPIO_LOONGSON1)		+= gpio-loongson1.o
+ obj-$(CONFIG_GPIO_LOONGSON)		+= gpio-loongson.o
diff --git a/target/linux/ath79/patches-5.4/939-mikrotik-rb91x.patch b/target/linux/ath79/patches-5.4/939-mikrotik-rb91x.patch
new file mode 100644
index 0000000000..baeaab4611
--- /dev/null
+++ b/target/linux/ath79/patches-5.4/939-mikrotik-rb91x.patch
@@ -0,0 +1,23 @@
+--- a/drivers/gpio/Kconfig
++++ b/drivers/gpio/Kconfig
+@@ -130,6 +130,10 @@ config GPIO_ATH79
+ 	  Select this option to enable GPIO driver for
+ 	  Atheros AR71XX/AR724X/AR913X SoC devices.
+ 
++config GPIO_LATCH
++	tristate "MikroTik RouterBOARD GPIO latch support"
++	depends on ATH79
++
+ config GPIO_RASPBERRYPI_EXP
+ 	tristate "Raspberry Pi 3 GPIO Expander"
+ 	default RASPBERRYPI_FIRMWARE
+--- a/drivers/gpio/Makefile
++++ b/drivers/gpio/Makefile
+@@ -67,6 +67,7 @@ obj-$(CONFIG_GPIO_IT87)			+= gpio-it87.o
+ obj-$(CONFIG_GPIO_IXP4XX)		+= gpio-ixp4xx.o
+ obj-$(CONFIG_GPIO_JANZ_TTL)		+= gpio-janz-ttl.o
+ obj-$(CONFIG_GPIO_KEMPLD)		+= gpio-kempld.o
++obj-$(CONFIG_GPIO_LATCH)		+= gpio-latch.o
+ obj-$(CONFIG_GPIO_LOONGSON1)		+= gpio-loongson1.o
+ obj-$(CONFIG_GPIO_LOONGSON)		+= gpio-loongson.o
+ obj-$(CONFIG_GPIO_LP3943)		+= gpio-lp3943.o


From lede-commits at lists.infradead.org  Mon Jun 21 01:51:26 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 04:51:26 -0400
Subject: [openwrt/openwrt] ath79: add support for MikroTik RouterBOARD
 912UAG-2HPnD
In-Reply-To: <162426548399.30628.9343139372334735979@git-01.infra.openwrt.org>
References: <162426548399.30628.9343139372334735979@git-01.infra.openwrt.org>
Message-ID: <mailman.1677.1624265490.1072.lede-commits@lists.infradead.org>

xback pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/695a1cd53ca52c678b3f837deb1bf30204285360

commit 695a1cd53ca52c678b3f837deb1bf30204285360
Author: Denis Kalashnikov <denis281089 at gmail.com>
AuthorDate: Thu May 27 11:16:46 2021 +0300

    ath79: add support for MikroTik RouterBOARD 912UAG-2HPnD
    
    This board has been supported in the ar71xx.
    
    Links:
    * https://mikrotik.com/product/RB912UAG-2HPnD
    * https://openwrt.org/toh/hwdata/mikrotik/mikrotik_rb912uag-2hpnd
    
    This also supports the 5GHz flavour of the board.
    
    Hardware:
    * SoC: Atheros AR9342,
    * RAM: DDR 64MB,
    * SPI NOR: 64KB,
    * NAND: 128MB,
    * Ethernet: x1 10/100/1000 port with passive POE in,
    * Wi-Fi: 802.11 b/g/n,
    * PCIe,
    * USB: 2.0 EHCI controller, connected to mPCIe slot and a Type-A
      port -- both can be used for LTE modem, but only one can be
      used at any time.
    * LEDs: 5 general purpose LEDs (led1..led5), power LED, user LED,
      Ethernet phy LED,
    * Button,
    * Beeper.
    
    Not working:
    * Button: it shares gpio line 15 with NAND ALE and NAND IO7,
      and current drivers doesn't easily support this configuration,
    * Beeper: it is connected to bit 5 of a serial shift register
      (tested with sysfs led trigger timer). But kmod-gpio-beeper
      doesn't work -- we left this as is for now.
    
    Flashing:
    * Use the RouterBOARD Reset button to enable TFTP netboot,
    boot kernel and initramfs and then perform sysupgrade.
    * From ar71xx OpenWrt firmware run:
      $ sysupgrade -F /tmp/<sysupgrade.bin>
    For more info see: https://openwrt.org/toh/mikrotik/common.
    
    Co-Developed-by: Koen Vandeputte <koen.vandeputte at citymesh.com>
    Reviewed-by: Sergey Ryazanov <ryazanov.s.a at gmail.com>
    Signed-off-by: Denis Kalashnikov <denis281089 at gmail.com>
---
 .../ar9342_mikrotik_routerboard-912uag-2hpnd.dts   | 212 +++++++++++++++++++++
 target/linux/ath79/image/mikrotik.mk               |   9 +
 .../mikrotik/base-files/etc/board.d/02_network     |   2 +
 .../etc/hotplug.d/firmware/10-ath9k-eeprom         |   1 +
 .../mikrotik/base-files/lib/upgrade/platform.sh    |   1 +
 5 files changed, 225 insertions(+)

diff --git a/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts b/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts
new file mode 100644
index 0000000000..cc5553acda
--- /dev/null
+++ b/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts
@@ -0,0 +1,212 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "ar9344.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "mikrotik,routerboard-912uag-2hpnd", "qca,ar9342";
+	model = "MikroTik RouterBOARD 912UAG-2HPnD";
+
+	aliases {
+                led-boot = &led_power;
+                led-failsafe = &led_power;
+                led-running = &led_power;
+                led-upgrade = &led_power;
+        };
+
+	gpio_latch: gpio_latch {
+		compatible = "gpio-latch";
+		gpio-controller;
+		#gpio-cells = <2>;
+		gpios = <&gpio 0 GPIO_ACTIVE_HIGH>,
+			<&gpio 1 GPIO_ACTIVE_HIGH>,
+			<&gpio 2 GPIO_ACTIVE_HIGH>,
+			<&gpio 3 GPIO_ACTIVE_HIGH>,
+			<0>, /* Not connected */
+			<&gpio 13 GPIO_ACTIVE_HIGH>,
+			<&gpio 14 GPIO_ACTIVE_HIGH>,
+			<&gpio 15 GPIO_ACTIVE_HIGH>,
+			<&gpio 11 GPIO_ACTIVE_LOW>; /* Latch Enable */
+	};
+
+	nand_gpio {
+		compatible = "mikrotik,rb91x-nand";
+
+		gpios = <&gpio_latch 3 GPIO_ACTIVE_HIGH>, /* Read */
+			<&gpio 4 GPIO_ACTIVE_HIGH>,       /* Ready (RDY) */
+			<&gpio_latch 5 GPIO_ACTIVE_LOW>,  /* Chip Enable (nCE) */
+			<&gpio_latch 6 GPIO_ACTIVE_HIGH>, /* Command Latch Enable (CLE) */
+			<&gpio_latch 7 GPIO_ACTIVE_HIGH>, /* Address Latch Enable (ALE) */
+			<&gpio 12 GPIO_ACTIVE_LOW>,       /* Read/Write Enable (nRW) */
+			<&gpio_latch 8 GPIO_ACTIVE_LOW>;  /* Latch Enable (nLE) */
+
+		partitions {
+			compatible = "fixed-partitions";
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "booter";
+				reg = <0x0 0x0040000>;
+				read-only;
+			};
+
+			partition at 40000 {
+				label = "kernel";
+				reg = <0x0040000 0x03c0000>;
+			};
+
+			partition at 400000 {
+				label = "ubi";
+				reg = <0x0400000 0x7c00000>;
+			};
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_power: power {
+			label = "green:power";
+			gpios = <&gpio_latch 1 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
+		};
+
+		user {
+			label = "green:user";
+			gpios = <&gpio_latch 2 GPIO_ACTIVE_HIGH>;
+		};
+
+		led1 {
+			label = "green:led1";
+			gpios = <&ssr 0 GPIO_ACTIVE_HIGH>;
+		};
+
+		led2 {
+			label = "green:led2";
+			gpios = <&ssr 1 GPIO_ACTIVE_HIGH>;
+		};
+
+		led3 {
+			label = "green:led3";
+			gpios = <&ssr 2 GPIO_ACTIVE_HIGH>;
+		};
+
+		led4 {
+			label = "green:led4";
+			gpios = <&ssr 3 GPIO_ACTIVE_HIGH>;
+		};
+
+		led5 {
+			label = "green:led5";
+			gpios = <&ssr 4 GPIO_ACTIVE_HIGH>;
+		};
+	};
+
+	gpio-export {
+		compatible = "gpio-export";
+
+		usb_power {
+			gpio-export,name = "power-usb";
+			gpio-export,output = <1>;
+			gpios = <&ssr 6 GPIO_ACTIVE_HIGH>;
+		};
+
+		pcie_power {
+			gpio-export,name = "power-pcie";
+			gpio-export,output = <0>;
+			gpios = <&ssr 7 GPIO_ACTIVE_HIGH>;
+		};
+	};
+};
+
+&spi {
+	status = "okay";
+
+	compatible = "qca,ar7100-spi";
+
+	cs-gpios = <0>, <&gpio_latch 0 GPIO_ACTIVE_LOW>;
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <50000000>;
+
+		partitions {
+			compatible = "mikrotik,routerboot-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "routerboot";
+				reg = <0x0 0x0>;
+				read-only;
+			};
+
+			hard_config: hard_config {
+				read-only;
+			};
+
+			bios {
+				size = <0x1000>;
+				read-only;
+			};
+
+			soft_config {
+			};
+		};
+	};
+
+	ssr: ssr at 1 {
+		compatible = "fairchild,74hc595";
+		gpio-controller;
+		#gpio-cells = <2>;
+		registers-number = <1>;
+		reg = <1>;
+		spi-max-frequency = <50000000>;
+	};
+};
+
+&mdio0 {
+	status = "okay";
+
+	phy-mask = <0>;
+
+	phy0: ethernet-phy at 0 {
+		reg = <0>;
+	};
+};
+
+&eth0 {
+	status = "okay";
+
+	phy-mode = "rgmii-id";
+	phy-handle = <&phy0>;
+	pll-data = <0x02000000 0x00000101 0x00001313>;
+
+	gmac-config {
+		device = <&gmac>;
+		rgmii-gmac0 = <1>;
+		rgmii-enabled = <1>;
+		rxd-delay = <1>;
+		txd-delay = <1>;
+	};
+};
+
+&wmac {
+	status = "okay";
+	qca,no-eeprom;
+};
+
+&pcie {
+	status = "okay";
+};
+
+&usb {
+	status = "okay";
+};
+
+&usb_phy {
+	status = "okay";
+};
diff --git a/target/linux/ath79/image/mikrotik.mk b/target/linux/ath79/image/mikrotik.mk
index 74f8603b5a..96a94793a9 100644
--- a/target/linux/ath79/image/mikrotik.mk
+++ b/target/linux/ath79/image/mikrotik.mk
@@ -9,6 +9,15 @@ define Device/mikrotik_routerboard-493g
 endef
 TARGET_DEVICES += mikrotik_routerboard-493g
 
+define Device/mikrotik_routerboard-912uag-2hpnd
+  $(Device/mikrotik_nand)
+  SOC := ar9342
+  DEVICE_MODEL := RouterBOARD 912UAG-2HPnD
+  DEVICE_PACKAGES += kmod-usb-ehci kmod-usb2 kmod-gpio-beeper
+  SUPPORTED_DEVICES += rb-912uag-2hpnd
+endef
+TARGET_DEVICES += mikrotik_routerboard-912uag-2hpnd
+
 define Device/mikrotik_routerboard-921gs-5hpacd-15s
   $(Device/mikrotik_nand)
   SOC := qca9558
diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network
index 4ffe82588c..d4a32c1e1a 100644
--- a/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/02_network
@@ -14,6 +14,7 @@ ath79_setup_interfaces()
 		ucidef_add_switch "switch1" \
 			"0 at eth1" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3"
 		;;
+	mikrotik,routerboard-912uag-2hpnd|\
 	mikrotik,routerboard-921gs-5hpacd-15s|\
 	mikrotik,routerboard-lhg-2nd|\
 	mikrotik,routerboard-sxt-5nd-r2|\
@@ -36,6 +37,7 @@ ath79_setup_macs()
 	local mac_base="$(cat /sys/firmware/mikrotik/hard_config/mac_base)"
 
 	case "$board" in
+	mikrotik,routerboard-912uag-2hpnd|\
 	mikrotik,routerboard-921gs-5hpacd-15s|\
 	mikrotik,routerboard-lhg-2nd|\
 	mikrotik,routerboard-sxt-5nd-r2|\
diff --git a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index d9425d4437..78aa35dc69 100644
--- a/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
+++ b/target/linux/ath79/mikrotik/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
@@ -23,6 +23,7 @@ board=$(board_name)
 case "$FIRMWARE" in
 "ath9k-eeprom-ahb-18100000.wmac.bin")
 	case $board in
+	mikrotik,routerboard-912uag-2hpnd|\
 	mikrotik,routerboard-lhg-2nd|\
 	mikrotik,routerboard-sxt-5nd-r2|\
 	mikrotik,routerboard-wapr-2nd)
diff --git a/target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh b/target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh
index 97d388168f..6962c6fdcc 100644
--- a/target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ath79/mikrotik/base-files/lib/upgrade/platform.sh
@@ -32,6 +32,7 @@ platform_do_upgrade() {
 
 	case "$board" in
 	mikrotik,routerboard-493g|\
+	mikrotik,routerboard-912uag-2hpnd|\
 	mikrotik,routerboard-921gs-5hpacd-15s|\
 	mikrotik,routerboard-922uags-5hpacd|\
 	mikrotik,routerboard-sxt-5nd-r2)


From lede-commits at lists.infradead.org  Mon Jun 21 01:51:25 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 04:51:25 -0400
Subject: [openwrt/openwrt] ath79: add NAND driver for MikroTik RB91xG series
In-Reply-To: <162426548399.30628.9343139372334735979@git-01.infra.openwrt.org>
References: <162426548399.30628.9343139372334735979@git-01.infra.openwrt.org>
Message-ID: <mailman.1678.1624265490.1072.lede-commits@lists.infradead.org>

xback pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/820e660cd7463aa6d5ed9d31baf0f3c35596ce57

commit 820e660cd7463aa6d5ed9d31baf0f3c35596ce57
Author: Denis Kalashnikov <denis281089 at gmail.com>
AuthorDate: Thu May 27 11:16:45 2021 +0300

    ath79: add NAND driver for MikroTik RB91xG series
    
    Main part is copied from ar71xx original driver rb91x_nand
    written by Gabor Juhos <juhosg at openwrt.org>.
    
    What is done:
    * Support of kernel 5.4 and 5.10,
    * DTS support,
    * New gpio API (gpiod_*) support.
    
    Reviewed-by: Sergey Ryazanov <ryazanov.s.a at gmail.com>
    Signed-off-by: Denis Kalashnikov <denis281089 at gmail.com>
---
 .../ath79/files/drivers/mtd/nand/raw/rb91x_nand.c  | 375 +++++++++++++++++++++
 target/linux/ath79/mikrotik/config-default         |   1 +
 .../ath79/patches-5.10/939-mikrotik-rb91x.patch    |  23 ++
 .../ath79/patches-5.4/939-mikrotik-rb91x.patch     |  21 ++
 4 files changed, 420 insertions(+)

diff --git a/target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c b/target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c
new file mode 100644
index 0000000000..e231944519
--- /dev/null
+++ b/target/linux/ath79/files/drivers/mtd/nand/raw/rb91x_nand.c
@@ -0,0 +1,375 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ *  MikroTik RB91x NAND flash driver
+ *
+ *  Main part is copied from original driver written by Gabor Juhos.
+ *
+ *  Copyright (C) 2013-2014 Gabor Juhos <juhosg at openwrt.org>
+ */
+
+/*
+ * WARNING: to speed up NAND reading/writing we are working with SoC GPIO
+ * controller registers directly -- not through standard GPIO API.
+ */
+
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/mtd/rawnand.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+#include <linux/platform_device.h>
+#include <linux/gpio/consumer.h>
+#include <linux/version.h>
+#include <linux/of_platform.h>
+
+#include <asm/mach-ath79/ar71xx_regs.h>
+
+/* Bit masks for NAND data lines in ath79 gpio 32-bit register */
+#define RB91X_NAND_NRW_BIT BIT(12)
+#define RB91X_NAND_DATA_BITS (BIT(0) | BIT(1) | BIT(2) | BIT(3) | BIT(4) \
+			    | BIT(13) | BIT(14) | BIT(15))
+#define RB91X_NAND_LOW_DATA_MASK	0x1f
+#define RB91X_NAND_HIGH_DATA_MASK	0xe0
+#define RB91X_NAND_HIGH_DATA_SHIFT	8
+
+enum rb91x_nand_gpios {
+	RB91X_NAND_READ,/* Read */
+	RB91X_NAND_RDY, /* NAND Ready */
+	RB91X_NAND_NCE, /* Chip Enable. Active low */
+	RB91X_NAND_CLE, /* Command Latch Enable */
+	RB91X_NAND_ALE, /* Address Latch Enable */
+	RB91X_NAND_NRW, /* Read/Write. Active low */
+	RB91X_NAND_NLE, /* Latch Enable. Active low */
+
+	RB91X_NAND_GPIOS,
+};
+
+struct rb91x_nand_drvdata {
+	struct nand_chip chip;
+	struct device *dev;
+	struct gpio_desc **gpio;
+	void __iomem *ath79_gpio_base;
+};
+
+static inline void rb91x_nand_latch_lock(struct rb91x_nand_drvdata *drvdata,
+					 int lock)
+{
+	gpiod_set_value_cansleep(drvdata->gpio[RB91X_NAND_NLE], lock);
+}
+
+static int rb91x_ooblayout_ecc(struct mtd_info *mtd, int section,
+			       struct mtd_oob_region *oobregion)
+{
+	switch (section) {
+	case 0:
+		oobregion->offset = 8;
+		oobregion->length = 3;
+		return 0;
+	case 1:
+		oobregion->offset = 13;
+		oobregion->length = 3;
+		return 0;
+	default:
+		return -ERANGE;
+	}
+}
+
+static int rb91x_ooblayout_free(struct mtd_info *mtd, int section,
+				struct mtd_oob_region *oobregion)
+{
+	switch (section) {
+	case 0:
+		oobregion->offset = 0;
+		oobregion->length = 4;
+		return 0;
+	case 1:
+		oobregion->offset = 4;
+		oobregion->length = 1;
+		return 0;
+	case 2:
+		oobregion->offset = 6;
+		oobregion->length = 2;
+		return 0;
+	case 3:
+		oobregion->offset = 11;
+		oobregion->length = 2;
+		return 0;
+	default:
+		return -ERANGE;
+	}
+}
+
+static const struct mtd_ooblayout_ops rb91x_nand_ecclayout_ops = {
+	.ecc = rb91x_ooblayout_ecc,
+	.free = rb91x_ooblayout_free,
+};
+
+static void rb91x_nand_write(struct rb91x_nand_drvdata *drvdata,
+			     const u8 *buf,
+			     unsigned len)
+{
+	void __iomem *base = drvdata->ath79_gpio_base;
+	u32 oe_reg;
+	u32 out_reg;
+	u32 out;
+	unsigned i;
+
+	rb91x_nand_latch_lock(drvdata, 1);
+
+	oe_reg = __raw_readl(base + AR71XX_GPIO_REG_OE);
+	out_reg = __raw_readl(base + AR71XX_GPIO_REG_OUT);
+
+	/* Set data lines to output mode */
+	__raw_writel(oe_reg & ~(RB91X_NAND_DATA_BITS | RB91X_NAND_NRW_BIT),
+		     base + AR71XX_GPIO_REG_OE);
+
+	out = out_reg & ~(RB91X_NAND_DATA_BITS | RB91X_NAND_NRW_BIT);
+	for (i = 0; i != len; i++) {
+		u32 data;
+
+		data = (buf[i] & RB91X_NAND_HIGH_DATA_MASK) <<
+			RB91X_NAND_HIGH_DATA_SHIFT;
+		data |= buf[i] & RB91X_NAND_LOW_DATA_MASK;
+		data |= out;
+		__raw_writel(data, base + AR71XX_GPIO_REG_OUT);
+
+		/* Deactivate WE line */
+		data |= RB91X_NAND_NRW_BIT;
+		__raw_writel(data, base + AR71XX_GPIO_REG_OUT);
+		/* Flush write */
+		__raw_readl(base + AR71XX_GPIO_REG_OUT);
+	}
+
+	/* Restore registers */
+	__raw_writel(out_reg, base + AR71XX_GPIO_REG_OUT);
+	__raw_writel(oe_reg, base + AR71XX_GPIO_REG_OE);
+	/* Flush write */
+	__raw_readl(base + AR71XX_GPIO_REG_OUT);
+
+	rb91x_nand_latch_lock(drvdata, 0);
+}
+
+static void rb91x_nand_read(struct rb91x_nand_drvdata *drvdata,
+			    u8 *read_buf,
+			    unsigned len)
+{
+	void __iomem *base = drvdata->ath79_gpio_base;
+	u32 oe_reg;
+	u32 out_reg;
+	unsigned i;
+
+	/* Enable read mode */
+	gpiod_set_value_cansleep(drvdata->gpio[RB91X_NAND_READ], 1);
+
+	rb91x_nand_latch_lock(drvdata, 1);
+
+	/* Save registers */
+	oe_reg = __raw_readl(base + AR71XX_GPIO_REG_OE);
+	out_reg = __raw_readl(base + AR71XX_GPIO_REG_OUT);
+
+	/* Set data lines to input mode */
+	__raw_writel(oe_reg | RB91X_NAND_DATA_BITS,
+		     base + AR71XX_GPIO_REG_OE);
+
+	for (i = 0; i < len; i++) {
+		u32 in;
+		u8 data;
+
+		/* Activate RE line */
+		__raw_writel(RB91X_NAND_NRW_BIT, base + AR71XX_GPIO_REG_CLEAR);
+		/* Flush write */
+		__raw_readl(base + AR71XX_GPIO_REG_CLEAR);
+
+		/* Read input lines */
+		in = __raw_readl(base + AR71XX_GPIO_REG_IN);
+
+		/* Deactivate RE line */
+		__raw_writel(RB91X_NAND_NRW_BIT, base + AR71XX_GPIO_REG_SET);
+
+		data = (in & RB91X_NAND_LOW_DATA_MASK);
+		data |= (in >> RB91X_NAND_HIGH_DATA_SHIFT) &
+			RB91X_NAND_HIGH_DATA_MASK;
+
+		read_buf[i] = data;
+	}
+
+	/* Restore  registers */
+	__raw_writel(out_reg, base + AR71XX_GPIO_REG_OUT);
+	__raw_writel(oe_reg, base + AR71XX_GPIO_REG_OE);
+	/* Flush write */
+	__raw_readl(base + AR71XX_GPIO_REG_OUT);
+
+	rb91x_nand_latch_lock(drvdata, 0);
+
+	/* Disable read mode */
+	gpiod_set_value_cansleep(drvdata->gpio[RB91X_NAND_READ], 0);
+}
+
+static int rb91x_nand_dev_ready(struct nand_chip *chip)
+{
+	struct rb91x_nand_drvdata *drvdata = (struct rb91x_nand_drvdata *)(chip->priv);
+
+	return gpiod_get_value_cansleep(drvdata->gpio[RB91X_NAND_RDY]);
+}
+
+static void rb91x_nand_cmd_ctrl(struct nand_chip *chip, int cmd,
+				unsigned int ctrl)
+{
+	struct rb91x_nand_drvdata *drvdata = chip->priv;
+
+	if (ctrl & NAND_CTRL_CHANGE) {
+		gpiod_set_value_cansleep(drvdata->gpio[RB91X_NAND_CLE],
+					(ctrl & NAND_CLE) ? 1 : 0);
+		gpiod_set_value_cansleep(drvdata->gpio[RB91X_NAND_ALE],
+					(ctrl & NAND_ALE) ? 1 : 0);
+		gpiod_set_value_cansleep(drvdata->gpio[RB91X_NAND_NCE],
+					(ctrl & NAND_NCE) ? 1 : 0);
+	}
+
+	if (cmd != NAND_CMD_NONE) {
+		u8 t = cmd;
+
+		rb91x_nand_write(drvdata, &t, 1);
+	}
+}
+
+static u8 rb91x_nand_read_byte(struct nand_chip *chip)
+{
+	u8 data = 0xff;
+
+	rb91x_nand_read(chip->priv, &data, 1);
+
+	return data;
+}
+
+static void rb91x_nand_read_buf(struct nand_chip *chip, u8 *buf, int len)
+{
+	rb91x_nand_read(chip->priv, buf, len);
+}
+
+static void rb91x_nand_write_buf(struct nand_chip *chip, const u8 *buf, int len)
+{
+	rb91x_nand_write(chip->priv, buf, len);
+}
+
+static void rb91x_nand_release(struct rb91x_nand_drvdata *drvdata)
+{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0)
+	mtd_device_unregister(nand_to_mtd(&drvdata->chip));
+	nand_cleanup(&drvdata->chip);
+#else
+	nand_release(&drvdata->chip);
+#endif
+}
+
+static int rb91x_nand_probe(struct platform_device *pdev)
+{
+	struct rb91x_nand_drvdata *drvdata;
+	struct mtd_info *mtd;
+	int r;
+	struct device *dev = &pdev->dev;
+	struct gpio_descs *gpios;
+
+	drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL);
+	if (!drvdata)
+		return -ENOMEM;
+
+	platform_set_drvdata(pdev, drvdata);
+
+	gpios = gpiod_get_array(dev, NULL, GPIOD_OUT_LOW);
+	if (IS_ERR(gpios)) {
+		dev_err(dev, "failed to get gpios: %d\n", (int)gpios);
+		return -EINVAL;
+	}
+
+	if (gpios->ndescs != RB91X_NAND_GPIOS) {
+		dev_err(dev, "expected %d gpios\n", RB91X_NAND_GPIOS);
+		return -EINVAL;
+	}
+
+	drvdata->gpio = gpios->desc;
+
+	gpiod_direction_input(drvdata->gpio[RB91X_NAND_RDY]);
+
+	drvdata->ath79_gpio_base = ioremap(AR71XX_GPIO_BASE, AR71XX_GPIO_SIZE);
+
+	drvdata->dev = dev;
+
+	drvdata->chip.priv = drvdata;
+
+	drvdata->chip.legacy.cmd_ctrl = rb91x_nand_cmd_ctrl;
+	drvdata->chip.legacy.dev_ready = rb91x_nand_dev_ready;
+	drvdata->chip.legacy.read_byte = rb91x_nand_read_byte;
+	drvdata->chip.legacy.write_buf = rb91x_nand_write_buf;
+	drvdata->chip.legacy.read_buf = rb91x_nand_read_buf;
+
+	drvdata->chip.legacy.chip_delay = 25;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,9,0)
+	drvdata->chip.ecc.engine_type      = NAND_ECC_ENGINE_TYPE_SOFT;
+	drvdata->chip.ecc.algo             = NAND_ECC_ALGO_HAMMING;
+#else
+	drvdata->chip.ecc.mode             = NAND_ECC_SOFT;
+	drvdata->chip.ecc.algo             = NAND_ECC_HAMMING;
+#endif
+	drvdata->chip.options = NAND_NO_SUBPAGE_WRITE;
+
+	r = nand_scan(&drvdata->chip, 1);
+	if (r) {
+		dev_err(dev, "nand_scan() failed: %d\n", r);
+		return r;
+	}
+
+	mtd = nand_to_mtd(&drvdata->chip);
+	mtd->dev.parent = dev;
+	mtd_set_of_node(mtd, dev->of_node);
+	mtd->owner = THIS_MODULE;
+	if (mtd->writesize == 512)
+		mtd_set_ooblayout(mtd, &rb91x_nand_ecclayout_ops);
+
+	r = mtd_device_register(mtd, NULL, 0);
+	if (r) {
+		dev_err(dev, "mtd_device_register() failed: %d\n",
+			r);
+		goto err_release_nand;
+	}
+
+	return 0;
+
+err_release_nand:
+	rb91x_nand_release(drvdata);
+	return r;
+}
+
+static int rb91x_nand_remove(struct platform_device *pdev)
+{
+	struct rb91x_nand_drvdata *drvdata = platform_get_drvdata(pdev);
+
+	rb91x_nand_release(drvdata);
+
+	return 0;
+}
+
+static const struct of_device_id rb91x_nand_match[] = {
+	{ .compatible = "mikrotik,rb91x-nand" },
+	{},
+};
+
+MODULE_DEVICE_TABLE(of, rb91x_nand_match);
+
+static struct platform_driver rb91x_nand_driver = {
+	.probe	= rb91x_nand_probe,
+	.remove	= rb91x_nand_remove,
+	.driver	= {
+		.name	= "rb91x-nand",
+		.owner	= THIS_MODULE,
+		.of_match_table = rb91x_nand_match,
+	},
+};
+
+module_platform_driver(rb91x_nand_driver);
+
+MODULE_DESCRIPTION("MikrotTik RB91x NAND flash driver");
+MODULE_VERSION(DRV_VERSION);
+MODULE_AUTHOR("Gabor Juhos <juhosg at openwrt.org>");
+MODULE_AUTHOR("Denis Kalashnikov <denis281089 at gmail.com>");
+MODULE_LICENSE("GPL v2");
diff --git a/target/linux/ath79/mikrotik/config-default b/target/linux/ath79/mikrotik/config-default
index 1e637bdfd3..efea74a239 100644
--- a/target/linux/ath79/mikrotik/config-default
+++ b/target/linux/ath79/mikrotik/config-default
@@ -15,6 +15,7 @@ CONFIG_MTD_NAND_AR934X=y
 CONFIG_MTD_NAND_CORE=y
 CONFIG_MTD_NAND_ECC=y
 CONFIG_MTD_NAND_RB4XX=y
+CONFIG_MTD_NAND_RB91X=y
 CONFIG_MTD_RAW_NAND=y
 CONFIG_MTD_ROUTERBOOT_PARTS=y
 CONFIG_MTD_SPI_NAND=y
diff --git a/target/linux/ath79/patches-5.10/939-mikrotik-rb91x.patch b/target/linux/ath79/patches-5.10/939-mikrotik-rb91x.patch
index 477993c8bf..5bbab93c51 100644
--- a/target/linux/ath79/patches-5.10/939-mikrotik-rb91x.patch
+++ b/target/linux/ath79/patches-5.10/939-mikrotik-rb91x.patch
@@ -24,3 +24,26 @@
  obj-$(CONFIG_GPIO_LOGICVC)		+= gpio-logicvc.o
  obj-$(CONFIG_GPIO_LOONGSON1)		+= gpio-loongson1.o
  obj-$(CONFIG_GPIO_LOONGSON)		+= gpio-loongson.o
+--- a/drivers/mtd/nand/raw/Kconfig
++++ b/drivers/mtd/nand/raw/Kconfig
+@@ -571,4 +571,10 @@ config MTD_NAND_RB4XX
+ 	  Enables support for the NAND flash chip on Mikrotik Routerboard
+ 	  RB4xx series.
+ 
++config MTD_NAND_RB91X
++	tristate "MikroTik RB91x NAND driver support"
++	depends on ATH79 && MTD_RAW_NAND
++	help
++	  Enables support for the NAND flash chip on MikroTik RB91x series.
++
+ endif # MTD_RAW_NAND
+--- a/drivers/mtd/nand/raw/Makefile
++++ b/drivers/mtd/nand/raw/Makefile
+@@ -60,6 +60,7 @@ obj-$(CONFIG_MTD_NAND_CADENCE)		+= caden
+ obj-$(CONFIG_MTD_NAND_ARASAN)		+= arasan-nand-controller.o
+ obj-$(CONFIG_MTD_NAND_AR934X)		+= ar934x_nand.o
+ obj-$(CONFIG_MTD_NAND_RB4XX)		+= nand_rb4xx.o
++obj-$(CONFIG_MTD_NAND_RB91X)		+= rb91x_nand.o
+ 
+ nand-objs := nand_base.o nand_legacy.o nand_bbt.o nand_timings.o nand_ids.o
+ nand-objs += nand_onfi.o
diff --git a/target/linux/ath79/patches-5.4/939-mikrotik-rb91x.patch b/target/linux/ath79/patches-5.4/939-mikrotik-rb91x.patch
index baeaab4611..6d84443945 100644
--- a/target/linux/ath79/patches-5.4/939-mikrotik-rb91x.patch
+++ b/target/linux/ath79/patches-5.4/939-mikrotik-rb91x.patch
@@ -1,3 +1,24 @@
+--- a/drivers/mtd/nand/raw/Kconfig
++++ b/drivers/mtd/nand/raw/Kconfig
+@@ -559,4 +559,8 @@ config MTD_NAND_RB4XX
+ 	  Enables support for the NAND flash chip on Mikrotik Routerboard
+ 	  RB4xx series.
+ 
++config MTD_NAND_RB91X
++	tristate "MikroTik RB91x NAND driver support"
++	depends on ATH79 && MTD_RAW_NAND
++
+ endif # MTD_RAW_NAND
+--- a/drivers/mtd/nand/raw/Makefile
++++ b/drivers/mtd/nand/raw/Makefile
+@@ -59,6 +59,7 @@ obj-$(CONFIG_MTD_NAND_STM32_FMC2)	+= stm
+ obj-$(CONFIG_MTD_NAND_MESON)		+= meson_nand.o
+ obj-$(CONFIG_MTD_NAND_AR934X)		+= ar934x_nand.o
+ obj-$(CONFIG_MTD_NAND_RB4XX)		+= nand_rb4xx.o
++obj-$(CONFIG_MTD_NAND_RB91X)		+= rb91x_nand.o
+ 
+ nand-objs := nand_base.o nand_legacy.o nand_bbt.o nand_timings.o nand_ids.o
+ nand-objs += nand_onfi.o
 --- a/drivers/gpio/Kconfig
 +++ b/drivers/gpio/Kconfig
 @@ -130,6 +130,10 @@ config GPIO_ATH79


From lede-commits at lists.infradead.org  Mon Jun 21 11:12:33 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 14:12:33 -0400
Subject: [openwrt/openwrt]  build: create profiles.json per default
In-Reply-To: <162429915363.20079.2245751444671585880@git-01.infra.openwrt.org>
References: <162429915363.20079.2245751444671585880@git-01.infra.openwrt.org>
Message-ID: <mailman.1857.1624299161.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/181054bf7939decd8ce6f32b6f8e2a363ab55e24

commit 181054bf7939decd8ce6f32b6f8e2a363ab55e24
Author: Paul Spooren <mail at aparcar.org>
AuthorDate: Wed Jun 16 18:05:04 2021 -1000

    build: create profiles.json per default
    
    The file is a info file just like config.buildinfo, feeds.buildinfo and
    version.buildinfo. It bundles these and more information in a machine
    readable way.
    
    This commit enables the creation of profiles.json by default and not
    only for buildbots. By doing so it follow the behaviour of the
    ImageBuilder which always creates the file, lastly this increases the
    files visibility for downstream projects.
    
    Signed-off-by: Paul Spooren <mail at aparcar.org>
---
 config/Config-build.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/config/Config-build.in b/config/Config-build.in
index 342859b7c0..f0e1aaa695 100644
--- a/config/Config-build.in
+++ b/config/Config-build.in
@@ -21,7 +21,7 @@ menu "Global build settings"
 
 	config JSON_OVERVIEW_IMAGE_INFO
 		bool "Create JSON info file overview per target"
-		default BUILDBOT
+		default y
 		help
 		  Create a JSON info file called profiles.json in the target
 		  directory containing machine readable list of built profiles


From lede-commits at lists.infradead.org  Mon Jun 21 11:34:50 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 14:34:50 -0400
Subject: [openwrt/openwrt]  ath10k-ct: fix typo in Makefile
In-Reply-To: <162430049092.10357.3059942819408466061@git-01.infra.openwrt.org>
References: <162430049092.10357.3059942819408466061@git-01.infra.openwrt.org>
Message-ID: <mailman.1864.1624300494.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/f0f1d68d528402b4d51a1dd08d2e2c9034167f92

commit f0f1d68d528402b4d51a1dd08d2e2c9034167f92
Author: Michael Yartys <michael.yartys at protonmail.com>
AuthorDate: Mon Jun 21 13:37:20 2021 +0200

    ath10k-ct: fix typo in Makefile
    
    Add forgotten colon to Makefile.
    
    Signed-off-by: Michael Yartys <michael.yartys at protonmail.com>
---
 package/kernel/ath10k-ct/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile
index f06d7cf132..5681c5c2cd 100644
--- a/package/kernel/ath10k-ct/Makefile
+++ b/package/kernel/ath10k-ct/Makefile
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ath10k-ct
-PKG_RELEASE=$(AUTORELEASE)
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_LICENSE:=GPLv2
 PKG_LICENSE_FILES:=


From lede-commits at lists.infradead.org  Mon Jun 21 11:36:24 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 14:36:24 -0400
Subject: [openwrt/openwrt]  uci: add uci_revert function
In-Reply-To: <162430058406.11581.3057894471106943877@git-01.infra.openwrt.org>
References: <162430058406.11581.3057894471106943877@git-01.infra.openwrt.org>
Message-ID: <mailman.1865.1624300587.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/92ac2a20ebba9f8695b464041cc8aeb30bb85576

commit 92ac2a20ebba9f8695b464041cc8aeb30bb85576
Author: Florian Eckert <fe at dev.tdt.de>
AuthorDate: Thu Apr 8 09:28:02 2021 +0200

    uci: add uci_revert function
    
    Add missing uci_revert shell function wrapper.
    
    Signed-off-by: Florian Eckert <fe at dev.tdt.de>
---
 package/system/uci/Makefile                | 2 +-
 package/system/uci/files/lib/config/uci.sh | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/package/system/uci/Makefile b/package/system/uci/Makefile
index 2036f92a7e..1355955d1a 100644
--- a/package/system/uci/Makefile
+++ b/package/system/uci/Makefile
@@ -9,7 +9,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=uci
-PKG_RELEASE:=5
+PKG_RELEASE:=6
 
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/uci.git
 PKG_SOURCE_PROTO:=git
diff --git a/package/system/uci/files/lib/config/uci.sh b/package/system/uci/files/lib/config/uci.sh
index 8d32cd1743..6ebfb73ae4 100644
--- a/package/system/uci/files/lib/config/uci.sh
+++ b/package/system/uci/files/lib/config/uci.sh
@@ -149,6 +149,14 @@ uci_remove_list() {
 	/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} del_list "$PACKAGE.$CONFIG.$OPTION=$VALUE"
 }
 
+uci_revert() {
+	local PACKAGE="$1"
+	local CONFIG="$2"
+	local OPTION="$3"
+
+	/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} revert "$PACKAGE${CONFIG:+.$CONFIG}${OPTION:+.$OPTION}"
+}
+
 uci_commit() {
 	local PACKAGE="$1"
 	/sbin/uci ${UCI_CONFIG_DIR:+-c $UCI_CONFIG_DIR} commit $PACKAGE


From lede-commits at lists.infradead.org  Mon Jun 21 11:38:48 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 14:38:48 -0400
Subject: [openwrt/openwrt]  kernel/modules: make sure igb loads at boot
In-Reply-To: <162430072804.13014.10948482737207096040@git-01.infra.openwrt.org>
References: <162430072804.13014.10948482737207096040@git-01.infra.openwrt.org>
Message-ID: <mailman.1866.1624300732.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/f1e41155c98cb5f2e0647e064ec0b3cfbf346e41

commit f1e41155c98cb5f2e0647e064ec0b3cfbf346e41
Author: Chris Blake <chrisrblake93 at gmail.com>
AuthorDate: Tue Jun 15 08:03:05 2021 -0500

    kernel/modules: make sure igb loads at boot
    
    Without loading the igb at boot, the recovery wouldn't have
    network available. All network drivers should be loaded before
    etc/board.d/02_network is called. Note that other network drivers
    already have this set, such as tg3.
    
    Fixes: 7e0e5110bc90 ("kernel: add igb kernel module")
    Signed-off-by: Chris Blake <chrisrblake93 at gmail.com>
---
 package/kernel/linux/modules/netdevices.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk
index 10eb26a7af..b91442748d 100644
--- a/package/kernel/linux/modules/netdevices.mk
+++ b/package/kernel/linux/modules/netdevices.mk
@@ -657,7 +657,7 @@ define KernelPackage/igb
     CONFIG_IGB_HWMON=y \
     CONFIG_IGB_DCA=n
   FILES:=$(LINUX_DIR)/drivers/net/ethernet/intel/igb/igb.ko
-  AUTOLOAD:=$(call AutoLoad,35,igb)
+  AUTOLOAD:=$(call AutoLoad,35,igb,1)
 endef
 
 define KernelPackage/igb/description


From lede-commits at lists.infradead.org  Mon Jun 21 12:02:41 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 15:02:41 -0400
Subject: [openwrt/openwrt]  grub2: update to 2.06
In-Reply-To: <162430216137.27416.6112962920857777193@git-01.infra.openwrt.org>
References: <162430216137.27416.6112962920857777193@git-01.infra.openwrt.org>
Message-ID: <mailman.1869.1624302165.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/2c9537e27495afdf929975c8a154cc66de902df0

commit 2c9537e27495afdf929975c8a154cc66de902df0
Author: Dirk Neukirchen <plntyk.lede at plntyk.name>
AuthorDate: Thu Jun 10 12:15:58 2021 +0200

    grub2: update to 2.06
    
    -300-CVE-2015-8370.patch is upstreamed with different code
    (upstream id: 451d80e52d851432e109771bb8febafca7a5f1f2)
    
    - fixup OpenWrts setup_root patch
    
    compile tested: x86_64,i386
    runtime tested: VM x86_64,VM i386
    
    - booted fine
    - grub-editenv worked
    
    Signed-off-by: Dirk Neukirchen <plntyk.lede at plntyk.name>
---
 package/boot/grub2/Makefile                        |  6 ++--
 .../boot/grub2/patches/100-grub_setup_root.patch   | 32 ++++++++---------
 package/boot/grub2/patches/300-CVE-2015-8370.patch | 40 ----------------------
 3 files changed, 19 insertions(+), 59 deletions(-)

diff --git a/package/boot/grub2/Makefile b/package/boot/grub2/Makefile
index 3cdb608cbf..9c67ff589b 100644
--- a/package/boot/grub2/Makefile
+++ b/package/boot/grub2/Makefile
@@ -7,12 +7,12 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=grub
 PKG_CPE_ID:=cpe:/a:gnu:grub2
-PKG_VERSION:=2.06~rc1
+PKG_VERSION:=2.06
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_URL:=https://alpha.gnu.org/gnu/grub
-PKG_HASH:=2c87f1f21e2ab50043e6cd9163c08f1b6c3a6171556bf23ff9ed65b074145484
+PKG_SOURCE_URL:=@GNU/grub
+PKG_HASH:=b79ea44af91b93d17cd3fe80bdae6ed43770678a9a5ae192ccea803ebb657ee1
 
 HOST_BUILD_PARALLEL:=1
 PKG_BUILD_DEPENDS:=grub2/host
diff --git a/package/boot/grub2/patches/100-grub_setup_root.patch b/package/boot/grub2/patches/100-grub_setup_root.patch
index e075d052cb..f20b310e12 100644
--- a/package/boot/grub2/patches/100-grub_setup_root.patch
+++ b/package/boot/grub2/patches/100-grub_setup_root.patch
@@ -18,24 +18,24 @@
  
 --- a/util/grub-install.c
 +++ b/util/grub-install.c
-@@ -1720,7 +1720,7 @@ main (int argc, char *argv[])
- 	/*  Now perform the installation.  */
+@@ -1721,7 +1721,7 @@ main (int argc, char *argv[])
  	if (install_bootsector)
- 	  grub_util_bios_setup (platdir, "boot.img", "core.img",
--				install_drive, force,
-+				NULL, install_drive, force,
- 				fs_probe, allow_floppy, add_rs_codes,
- 				!grub_install_is_short_mbrgap_supported ());
- 	break;
-@@ -1747,7 +1747,7 @@ main (int argc, char *argv[])
- 	/*  Now perform the installation.  */
+ 	  {
+ 	    grub_util_bios_setup (platdir, "boot.img", "core.img",
+-				  install_drive, force,
++				  NULL, install_drive, force,
+ 				  fs_probe, allow_floppy, add_rs_codes,
+ 				  !grub_install_is_short_mbrgap_supported ());
+ 
+@@ -1752,7 +1752,7 @@ main (int argc, char *argv[])
  	if (install_bootsector)
- 	  grub_util_sparc_setup (platdir, "boot.img", "core.img",
--				 install_drive, force,
-+				 NULL, install_drive, force,
- 				 fs_probe, allow_floppy,
- 				 0 /* unused */, 0 /* unused */ );
- 	break;
+ 	  {
+ 	    grub_util_sparc_setup (platdir, "boot.img", "core.img",
+-				   install_drive, force,
++				   NULL, install_drive, force,
+ 				   fs_probe, allow_floppy,
+ 				   0 /* unused */, 0 /* unused */ );
+ 
 --- a/util/grub-setup.c
 +++ b/util/grub-setup.c
 @@ -87,6 +87,8 @@ static struct argp_option options[] = {
diff --git a/package/boot/grub2/patches/300-CVE-2015-8370.patch b/package/boot/grub2/patches/300-CVE-2015-8370.patch
deleted file mode 100644
index 22f6c90928..0000000000
--- a/package/boot/grub2/patches/300-CVE-2015-8370.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Hector Marco-Gisbert <hecmargi at upv.es>
-Date: Fri, 13 Nov 2015 16:21:09 +0100
-Subject: [PATCH] Fix security issue when reading username and password
-
-  This patch fixes two integer underflows at:
-    * grub-core/lib/crypto.c
-    * grub-core/normal/auth.c
-
-Resolves: CVE-2015-8370
-
-Signed-off-by: Hector Marco-Gisbert <hecmargi at upv.es>
-Signed-off-by: Ismael Ripoll-Ripoll <iripoll at disca.upv.es>
----
- grub-core/lib/crypto.c  | 2 +-
- grub-core/normal/auth.c | 2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
---- a/grub-core/lib/crypto.c
-+++ b/grub-core/lib/crypto.c
-@@ -468,7 +468,7 @@ grub_password_get (char buf[], unsigned
- 	  break;
- 	}
- 
--      if (key == '\b')
-+      if (key == '\b' && cur_len)
- 	{
- 	  if (cur_len)
- 	    cur_len--;
---- a/grub-core/normal/auth.c
-+++ b/grub-core/normal/auth.c
-@@ -172,7 +172,7 @@ grub_username_get (char buf[], unsigned
- 	  break;
- 	}
- 
--      if (key == GRUB_TERM_BACKSPACE)
-+      if (key == GRUB_TERM_BACKSPACE && cur_len)
- 	{
- 	  if (cur_len)
- 	    {


From lede-commits at lists.infradead.org  Mon Jun 21 12:43:48 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 15:43:48 -0400
Subject: [openwrt/openwrt]  build,json: fix generation with empty profiles
In-Reply-To: <162430462711.1922.5128321614316810856@git-01.infra.openwrt.org>
References: <162430462711.1922.5128321614316810856@git-01.infra.openwrt.org>
Message-ID: <mailman.1870.1624304631.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/2e157714a8d4a0e1dbd6351ca0a3fe2fce75b0eb

commit 2e157714a8d4a0e1dbd6351ca0a3fe2fce75b0eb
Author: Paul Spooren <mail at aparcar.org>
AuthorDate: Sun Jun 20 20:23:45 2021 -1000

    build,json: fix generation with empty profiles
    
    If the image generation doesn't add any profiles to the output the
    *profile merge* will fail. To avoid that set an empty profile as
    fallback.
    
    Signed-off-by: Paul Spooren <mail at aparcar.org>
    (cherry picked from commit fd0d9909bf50f114d5e7f7cedf53e542de878a2c)
---
 scripts/json_overview_image_info.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/json_overview_image_info.py b/scripts/json_overview_image_info.py
index 45c05012b1..db47fd9e42 100755
--- a/scripts/json_overview_image_info.py
+++ b/scripts/json_overview_image_info.py
@@ -42,7 +42,7 @@ for json_file in work_dir.glob("*.json"):
         output["profiles"][device_id]["images"].extend(profile["images"])
 
 # make image lists unique by name, keep last/latest
-for device_id, profile in output["profiles"].items():
+for device_id, profile in output.get("profiles", {}).items():
     profile["images"] = list({e["name"]: e for e in profile["images"]}.values())
 
 


From lede-commits at lists.infradead.org  Mon Jun 21 12:43:47 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 15:43:47 -0400
Subject: [openwrt/openwrt]  build: preserve profiles.json between builds
In-Reply-To: <162430462711.1922.5128321614316810856@git-01.infra.openwrt.org>
References: <162430462711.1922.5128321614316810856@git-01.infra.openwrt.org>
Message-ID: <mailman.1871.1624304631.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/8add3e139ca5b58b91098aa0615f3492d1191241

commit 8add3e139ca5b58b91098aa0615f3492d1191241
Author: Moritz Warning <moritzwarning at web.de>
AuthorDate: Mon Feb 22 00:18:10 2021 +0100

    build: preserve profiles.json between builds
    
    Keep other profiles.json content if the data belongs to the current
    build version.
    
    Also useful for the ImageBuilder, which builds for a single model each
    time. Without this commit the profiles.json would only contain the
    latest build profile information.
    
    Signed-off-by: Moritz Warning <moritzwarning at web.de>
    [improve commit message]
    Signed-off-by: Paul Spooren <mail at aparcar.org>
    (cherry picked from commit a463b96241fbc2d142982387eaed9989e201ac7a)
---
 scripts/json_overview_image_info.py | 32 +++++++++++++++++++++++---------
 1 file changed, 23 insertions(+), 9 deletions(-)

diff --git a/scripts/json_overview_image_info.py b/scripts/json_overview_image_info.py
index 8dbd24af2d..45c05012b1 100755
--- a/scripts/json_overview_image_info.py
+++ b/scripts/json_overview_image_info.py
@@ -18,19 +18,33 @@ work_dir = Path(getenv("WORK_DIR"))
 
 output = {}
 
+
+def get_initial_output(image_info):
+    # preserve existing profiles.json
+    if output_path.is_file():
+        profiles = json.loads(output_path.read_text())
+        if profiles["version_code"] == image_info["version_code"]:
+            return profiles
+    return image_info
+
+
 for json_file in work_dir.glob("*.json"):
     image_info = json.loads(json_file.read_text())
+
     if not output:
-        output.update(image_info)
+        output = get_initial_output(image_info)
+
+    # get first and only profile in json file
+    device_id, profile = next(iter(image_info["profiles"].items()))
+    if device_id not in output["profiles"]:
+        output["profiles"][device_id] = profile
     else:
-        # get first (and only) profile in json file
-        device_id = next(iter(image_info["profiles"].keys()))
-        if device_id not in output["profiles"]:
-            output["profiles"].update(image_info["profiles"])
-        else:
-            output["profiles"][device_id]["images"].append(
-                image_info["profiles"][device_id]["images"][0]
-            )
+        output["profiles"][device_id]["images"].extend(profile["images"])
+
+# make image lists unique by name, keep last/latest
+for device_id, profile in output["profiles"].items():
+    profile["images"] = list({e["name"]: e for e in profile["images"]}.values())
+
 
 if output:
     default_packages, output["arch_packages"] = run(


From lede-commits at lists.infradead.org  Mon Jun 21 13:43:57 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 16:43:57 -0400
Subject: [openwrt/openwrt]  ath79: don't autodetect AR8033 PHY capabilities
In-Reply-To: <162430823706.639.16028943772622607816@git-01.infra.openwrt.org>
References: <162430823706.639.16028943772622607816@git-01.infra.openwrt.org>
Message-ID: <mailman.1879.1624308242.1072.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/56228e939365d543933a87cac11109a7d5ccc619

commit 56228e939365d543933a87cac11109a7d5ccc619
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Sun Jun 13 12:00:41 2021 +0200

    ath79: don't autodetect AR8033 PHY capabilities
    
    PHY capabilities are currently read from the fiber status page, thus
    Linux won't advertise 10 / 100 Base-T operation modes, effectively
    limiting operation to 1000 Base-T.
    
    Statically set the PHYs capabilities, avoiding autodetection.
    
    The issue itself is properly fixed kernel upstream, however backporting
    efforts to OpenWrt master resulted in breaking the fiber operation for
    another target.
    
    This is currently only known to be necessary for the Ubiquiti
    UniFi AC series, so enabling it in the ath79 target should not
    break somewhere else.
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 .../700-at803x-force-ar8033-features.patch         | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/target/linux/ath79/patches-5.4/700-at803x-force-ar8033-features.patch b/target/linux/ath79/patches-5.4/700-at803x-force-ar8033-features.patch
new file mode 100644
index 0000000000..cfbcaa148d
--- /dev/null
+++ b/target/linux/ath79/patches-5.4/700-at803x-force-ar8033-features.patch
@@ -0,0 +1,25 @@
+PHY capabilities are currently read from the fiber status page, thus
+Linux won't advertise 10 / 100 Base-T operation modes, effectively
+limiting operation to 1000 Base-T.
+
+Statically set the PHYs capabilities, avoiding autodetection.
+
+The issue itself is properly fixed kernel upstream, however backporting
+efforts to OpenWrt master resulted in breaking the fiber operation for
+another target.
+
+This is currently only known to be necessary for the Ubiquiti
+UniFi AC series, so enabling it in the ath79 target should not
+break somewhere else.
+
+--- a/drivers/net/phy/at803x.c
++++ b/drivers/net/phy/at803x.c
+@@ -497,7 +497,7 @@ static struct phy_driver at803x_driver[]
+ 	.get_wol		= at803x_get_wol,
+ 	.suspend		= at803x_suspend,
+ 	.resume			= at803x_resume,
+-	/* PHY_GBIT_FEATURES */
++	.features		= PHY_GBIT_FEATURES,
+ 	.read_status		= at803x_read_status,
+ 	.aneg_done		= at803x_aneg_done,
+ 	.ack_interrupt		= &at803x_ack_interrupt,


From lede-commits at lists.infradead.org  Mon Jun 21 13:43:58 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 16:43:58 -0400
Subject: [openwrt/openwrt]  wolfssl: always export wc_ecc_set_rng
In-Reply-To: <162430823706.639.16028943772622607816@git-01.infra.openwrt.org>
References: <162430823706.639.16028943772622607816@git-01.infra.openwrt.org>
Message-ID: <mailman.1880.1624308242.1072.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/f6d8c0cf2b47b55474f6f2604ac57bc8aedfeb08

commit f6d8c0cf2b47b55474f6f2604ac57bc8aedfeb08
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Thu May 6 01:48:04 2021 +0200

    wolfssl: always export wc_ecc_set_rng
    
    Since commit 6467de5a8840 ("Randomize z ordinates in scalar
    mult when timing resistant") wolfssl requires a RNG for an EC
    key when the hardened built option is selected.
    
    wc_ecc_set_rng is only available when built hardened, so there
    is no safe way to install the RNG to the key regardless whether
    or not wolfssl is compiled hardened.
    
    Always export wc_ecc_set_rng so tools such as hostapd can install
    RNG regardless of the built settings for wolfssl.
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
    (cherry picked from commit ef9b103107aebd1a54f4360af3d9cf28d0544f13)
---
 package/libs/wolfssl/Makefile                  |  2 +-
 package/libs/wolfssl/patches/200-ecc-rng.patch | 50 ++++++++++++++++++++++++++
 2 files changed, 51 insertions(+), 1 deletion(-)

diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile
index 53cd932d1f..030a0224f5 100644
--- a/package/libs/wolfssl/Makefile
+++ b/package/libs/wolfssl/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wolfssl
 PKG_VERSION:=4.7.0-stable
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION)
diff --git a/package/libs/wolfssl/patches/200-ecc-rng.patch b/package/libs/wolfssl/patches/200-ecc-rng.patch
new file mode 100644
index 0000000000..2d33c06209
--- /dev/null
+++ b/package/libs/wolfssl/patches/200-ecc-rng.patch
@@ -0,0 +1,50 @@
+Since commit 6467de5a8840 ("Randomize z ordinates in scalar
+mult when timing resistant") wolfssl requires a RNG for an EC
+key when the hardened built option is selected.
+
+wc_ecc_set_rng is only available when built hardened, so there
+is no safe way to install the RNG to the key regardless whether
+or not wolfssl is compiled hardened.
+
+Always export wc_ecc_set_rng so tools such as hostapd can install
+RNG regardless of the built settings for wolfssl.
+
+--- a/wolfcrypt/src/ecc.c
++++ b/wolfcrypt/src/ecc.c
+@@ -10293,21 +10293,21 @@ void wc_ecc_fp_free(void)
+ 
+ #endif /* FP_ECC */
+ 
+-#ifdef ECC_TIMING_RESISTANT
+ int wc_ecc_set_rng(ecc_key* key, WC_RNG* rng)
+ {
+     int err = 0;
+ 
++#ifdef ECC_TIMING_RESISTANT
+     if (key == NULL) {
+         err = BAD_FUNC_ARG;
+     }
+     else {
+         key->rng = rng;
+     }
++#endif
+ 
+     return err;
+ }
+-#endif
+ 
+ #ifdef HAVE_ECC_ENCRYPT
+ 
+--- a/wolfssl/wolfcrypt/ecc.h
++++ b/wolfssl/wolfcrypt/ecc.h
+@@ -584,10 +584,8 @@ WOLFSSL_API
+ void wc_ecc_fp_free(void);
+ WOLFSSL_LOCAL
+ void wc_ecc_fp_init(void);
+-#ifdef ECC_TIMING_RESISTANT
+ WOLFSSL_API
+ int wc_ecc_set_rng(ecc_key* key, WC_RNG* rng);
+-#endif
+ 
+ WOLFSSL_API
+ int wc_ecc_set_curve(ecc_key* key, int keysize, int curve_id);


From lede-commits at lists.infradead.org  Mon Jun 21 13:43:59 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 16:43:59 -0400
Subject: [openwrt/openwrt]  hostapd: wolfssl: add RNG to EC key
In-Reply-To: <162430823706.639.16028943772622607816@git-01.infra.openwrt.org>
References: <162430823706.639.16028943772622607816@git-01.infra.openwrt.org>
Message-ID: <mailman.1881.1624308243.1072.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/e410ef838959c0d7cd9a6c0a13d5f2ca2b03c077

commit e410ef838959c0d7cd9a6c0a13d5f2ca2b03c077
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Thu May 6 01:53:49 2021 +0200

    hostapd: wolfssl: add RNG to EC key
    
    Since upstream commit 6467de5a8840 ("Randomize z ordinates in
    scalar mult when timing resistant") WolfSSL requires a RNG for
    the EC key when built hardened which is the default.
    
    Set the RNG for the EC key to fix connections for OWE clients.
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
    (cherry picked from commit ddcb970274c011d3db611ec39350ee4704ff0e02)
---
 package/network/services/hostapd/Makefile          |  2 +-
 .../802-wolfssl-init-RNG-with-ECC-key.patch        | 48 ++++++++++++++++++++++
 2 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile
index bd2a7c96ad..0779421b8d 100644
--- a/package/network/services/hostapd/Makefile
+++ b/package/network/services/hostapd/Makefile
@@ -7,7 +7,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=hostapd
-PKG_RELEASE:=32
+PKG_RELEASE:=33
 
 PKG_SOURCE_URL:=http://w1.fi/hostap.git
 PKG_SOURCE_PROTO:=git
diff --git a/package/network/services/hostapd/patches/802-wolfssl-init-RNG-with-ECC-key.patch b/package/network/services/hostapd/patches/802-wolfssl-init-RNG-with-ECC-key.patch
new file mode 100644
index 0000000000..89d111e991
--- /dev/null
+++ b/package/network/services/hostapd/patches/802-wolfssl-init-RNG-with-ECC-key.patch
@@ -0,0 +1,48 @@
+From 21ce83b4ae2b9563175fdb4fc4312096cc399cf8 Mon Sep 17 00:00:00 2001
+From: David Bauer <mail at david-bauer.net>
+Date: Wed, 5 May 2021 00:44:34 +0200
+Subject: [PATCH] wolfssl: add RNG to EC key
+
+Since upstream commit 6467de5a8840 ("Randomize z ordinates in
+scalar mult when timing resistant") WolfSSL requires a RNG for
+the EC key when built hardened which is the default.
+
+Set the RNG for the EC key to fix connections for OWE clients.
+
+Signed-off-by: David Bauer <mail at david-bauer.net>
+---
+ src/crypto/crypto_wolfssl.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/crypto/crypto_wolfssl.c b/src/crypto/crypto_wolfssl.c
+index 2e4bf8962..ed2528159 100644
+--- a/src/crypto/crypto_wolfssl.c
++++ b/src/crypto/crypto_wolfssl.c
+@@ -1303,6 +1303,7 @@ int ecc_projective_add_point(ecc_point *P, ecc_point *Q, ecc_point *R,
+ 
+ struct crypto_ec {
+ 	ecc_key key;
++	WC_RNG rng;
+ 	mp_int a;
+ 	mp_int prime;
+ 	mp_int order;
+@@ -1357,6 +1358,8 @@ struct crypto_ec * crypto_ec_init(int group)
+ 		return NULL;
+ 
+ 	if (wc_ecc_init(&e->key) != 0 ||
++	    wc_InitRng(&e->rng) != 0 ||
++	    wc_ecc_set_rng(&e->key, &e->rng) != 0 ||
+ 	    wc_ecc_set_curve(&e->key, 0, curve_id) != 0 ||
+ 	    mp_init(&e->a) != MP_OKAY ||
+ 	    mp_init(&e->prime) != MP_OKAY ||
+@@ -1388,6 +1391,7 @@ void crypto_ec_deinit(struct crypto_ec* e)
+ 	mp_clear(&e->order);
+ 	mp_clear(&e->prime);
+ 	mp_clear(&e->a);
++	wc_FreeRng(&e->rng);
+ 	wc_ecc_free(&e->key);
+ 	os_free(e);
+ }
+-- 
+2.31.1
+


From lede-commits at lists.infradead.org  Mon Jun 21 15:39:47 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 21 Jun 2021 18:39:47 -0400
Subject: [openwrt/openwrt]  ath79: add missing GPIO_LATCH symbol
In-Reply-To: <162431518765.8221.9701395608970365630@git-01.infra.openwrt.org>
References: <162431518765.8221.9701395608970365630@git-01.infra.openwrt.org>
Message-ID: <mailman.1929.1624315192.1072.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/f2f137593eb6c0e849352e85c003c91f8be81dd1

commit f2f137593eb6c0e849352e85c003c91f8be81dd1
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Mon Jun 21 23:50:05 2021 +0200

    ath79: add missing GPIO_LATCH symbol
    
    Fixes commit 7b8931678c36 ("ath79: add gpio-latch driver for MikroTik RouterBOARDs")
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 target/linux/ath79/config-5.10 | 1 +
 target/linux/ath79/config-5.4  | 1 +
 2 files changed, 2 insertions(+)

diff --git a/target/linux/ath79/config-5.10 b/target/linux/ath79/config-5.10
index d4abddb445..c95c073563 100644
--- a/target/linux/ath79/config-5.10
+++ b/target/linux/ath79/config-5.10
@@ -72,6 +72,7 @@ CONFIG_GPIOLIB_IRQCHIP=y
 CONFIG_GPIO_74X164=y
 CONFIG_GPIO_ATH79=y
 CONFIG_GPIO_GENERIC=y
+# CONFIG_GPIO_LATCH is not set
 CONFIG_HANDLE_DOMAIN_IRQ=y
 CONFIG_HARDWARE_WATCHPOINTS=y
 CONFIG_HAS_DMA=y
diff --git a/target/linux/ath79/config-5.4 b/target/linux/ath79/config-5.4
index b39d5ec964..9c5520775d 100644
--- a/target/linux/ath79/config-5.4
+++ b/target/linux/ath79/config-5.4
@@ -90,6 +90,7 @@ CONFIG_GPIOLIB_IRQCHIP=y
 CONFIG_GPIO_74X164=y
 CONFIG_GPIO_ATH79=y
 CONFIG_GPIO_GENERIC=y
+# CONFIG_GPIO_LATCH is not set
 CONFIG_HANDLE_DOMAIN_IRQ=y
 CONFIG_HARDWARE_WATCHPOINTS=y
 CONFIG_HAS_DMA=y


From lede-commits at lists.infradead.org  Mon Jun 21 21:48:18 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 00:48:18 -0400
Subject: [openwrt/openwrt]  ustream-ssl: variants conflict with each other
In-Reply-To: <162433729879.30426.5149539047560419537@git-01.infra.openwrt.org>
References: <162433729879.30426.5149539047560419537@git-01.infra.openwrt.org>
Message-ID: <mailman.1965.1624337302.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/219e17a35088a90eea664fbb4c66549d701a3cb4

commit 219e17a35088a90eea664fbb4c66549d701a3cb4
Author: Karel Ko?? <karel.koci at nic.cz>
AuthorDate: Mon Jun 21 11:42:25 2021 +0200

    ustream-ssl: variants conflict with each other
    
    This adds conflicts between variants of libustream pacakge.
    They provide the same file and thus it should not be possible to install
    them side by side.
    
    Signed-off-by: Karel Ko?? <karel.koci at nic.cz>
---
 package/libs/ustream-ssl/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/package/libs/ustream-ssl/Makefile b/package/libs/ustream-ssl/Makefile
index 3d1e48dcbd..f762c89d29 100644
--- a/package/libs/ustream-ssl/Makefile
+++ b/package/libs/ustream-ssl/Makefile
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ustream-ssl
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/ustream-ssl.git
@@ -37,6 +37,7 @@ define Package/libustream-wolfssl
   $(Package/libustream/default)
   TITLE += (wolfssl)
   DEPENDS += +PACKAGE_libustream-wolfssl:libwolfssl
+  CONFLICTS := libustream-openssl
   VARIANT:=wolfssl
 endef
 
@@ -44,6 +45,7 @@ define Package/libustream-mbedtls
   $(Package/libustream/default)
   TITLE += (mbedtls)
   DEPENDS += +libmbedtls
+  CONFLICTS := libustream-openssl libustream-wolfssl
   VARIANT:=mbedtls
   DEFAULT_VARIANT:=1
 endef


From lede-commits at lists.infradead.org  Mon Jun 21 22:04:26 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 01:04:26 -0400
Subject: [openwrt/openwrt]  hostapd: make country3 option configurable
In-Reply-To: <162433826634.9149.14046589343238638959@git-01.infra.openwrt.org>
References: <162433826634.9149.14046589343238638959@git-01.infra.openwrt.org>
Message-ID: <mailman.1966.1624338271.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/9f09c1936a4a13b67fcba632f7ca02331f685359

commit 9f09c1936a4a13b67fcba632f7ca02331f685359
Author: Timo Sigurdsson <public_timo.s at silentcreek.de>
AuthorDate: Tue Jun 15 23:08:56 2021 +0200

    hostapd: make country3 option configurable
    
    The country3 option in hostapd.conf allows the third octet of the country
    string to be set. It can be used e.g. to indicate indoor or outdoor use (see
    hostapd.conf for further details). Make this option configurable but optional
    in OpenWrt.
    
    Signed-off-by: Timo Sigurdsson <public_timo.s at silentcreek.de>
---
 package/network/services/hostapd/files/hostapd.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 8a6c904c58..060199fa0c 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -93,7 +93,7 @@ hostapd_common_add_device_config() {
 	config_add_array supported_rates
 	config_add_string beacon_rate
 
-	config_add_string country
+	config_add_string country country3
 	config_add_boolean country_ie doth
 	config_add_boolean spectrum_mgmt_required
 	config_add_int local_pwr_constraint
@@ -119,7 +119,7 @@ hostapd_prepare_device_config() {
 
 	local base_cfg=
 
-	json_get_vars country country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \
+	json_get_vars country country3 country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \
 		acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode cell_density \
 		rts_threshold beacon_rate rssi_reject_assoc_rssi rssi_ignore_probe_request maxassoc
 
@@ -134,6 +134,7 @@ hostapd_prepare_device_config() {
 
 	[ -n "$country" ] && {
 		append base_cfg "country_code=$country" "$N"
+		[ -n "$country3" ] && append base_cfg "country3=$country3" "$N"
 
 		[ "$country_ie" -gt 0 ] && {
 			append base_cfg "ieee80211d=1" "$N"


From lede-commits at lists.infradead.org  Mon Jun 21 22:04:27 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 01:04:27 -0400
Subject: [openwrt/openwrt] hostapd: fix handling of the channel utilization
 options
In-Reply-To: <162433826634.9149.14046589343238638959@git-01.infra.openwrt.org>
References: <162433826634.9149.14046589343238638959@git-01.infra.openwrt.org>
Message-ID: <mailman.1967.1624338273.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/85ce590705072be78c3ef7dc6b64e3b1facc892b

commit 85ce590705072be78c3ef7dc6b64e3b1facc892b
Author: Timo Sigurdsson <public_timo.s at silentcreek.de>
AuthorDate: Tue Jun 15 23:12:08 2021 +0200

    hostapd: fix handling of the channel utilization options
    
    Commit 0a7657c ("hostapd: add channel utilization as config option") added the
    two new uci options bss_load_update_period and chan_util_avg_period. However,
    the corresponding "config_add_int" calls for these options weren't added, so
    attempting to actually use these options and change their values is bound to
    fail - they always stay at their defaults. Add the missing code to actually
    make these options work.
    
    Fixes: 0a7657c ("hostapd: add channel utilization as config option")
    Signed-off-by: Timo Sigurdsson <public_timo.s at silentcreek.de>
---
 package/network/services/hostapd/files/hostapd.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 060199fa0c..b9409c8ca3 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -263,6 +263,8 @@ hostapd_common_add_bss_config() {
 	config_add_int acct_port
 	config_add_int acct_interval
 
+	config_add_int bss_load_update_period chan_util_avg_period
+
 	config_add_string dae_client
 	config_add_string dae_secret
 	config_add_int dae_port


From lede-commits at lists.infradead.org  Mon Jun 21 23:06:25 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 02:06:25 -0400
Subject: [openwrt/openwrt] bcm4908: fix Ethernet broken state after
 interface restart
In-Reply-To: <162434198513.23922.14571684563700033528@git-01.infra.openwrt.org>
References: <162434198513.23922.14571684563700033528@git-01.infra.openwrt.org>
Message-ID: <mailman.1974.1624341989.1072.lede-commits@lists.infradead.org>

rmilecki pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/f8d5bd20b31842ef7fdb740d27c70294f21c6124

commit f8d5bd20b31842ef7fdb740d27c70294f21c6124
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Tue Jun 22 07:47:18 2021 +0200

    bcm4908: fix Ethernet broken state after interface restart
    
    This fixes traffic stalls after ifdown & ifup.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 ...m-bcm4908_enet-reset-DMA-rings-sw-indexes.patch | 43 ++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/target/linux/bcm4908/patches-5.4/170-net-broadcom-bcm4908_enet-reset-DMA-rings-sw-indexes.patch b/target/linux/bcm4908/patches-5.4/170-net-broadcom-bcm4908_enet-reset-DMA-rings-sw-indexes.patch
new file mode 100644
index 0000000000..7e82230f9a
--- /dev/null
+++ b/target/linux/bcm4908/patches-5.4/170-net-broadcom-bcm4908_enet-reset-DMA-rings-sw-indexes.patch
@@ -0,0 +1,43 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Tue, 22 Jun 2021 07:05:04 +0200
+Subject: [PATCH] net: broadcom: bcm4908_enet: reset DMA rings sw indexes
+ properly
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Resetting software indexes in bcm4908_dma_alloc_buf_descs() is not
+enough as it's called during device probe only. Driver resets DMA on
+every .ndo_open callback and it's required to reset indexes then.
+
+This fixes inconsistent rings state and stalled traffic after interface
+down & up sequence.
+
+Fixes: 4feffeadbcb2 ("net: broadcom: bcm4908enet: add BCM4908 controller driver")
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+---
+ drivers/net/ethernet/broadcom/bcm4908_enet.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/ethernet/broadcom/bcm4908_enet.c
++++ b/drivers/net/ethernet/broadcom/bcm4908_enet.c
+@@ -174,9 +174,6 @@ static int bcm4908_dma_alloc_buf_descs(s
+ 	if (!ring->slots)
+ 		goto err_free_buf_descs;
+ 
+-	ring->read_idx = 0;
+-	ring->write_idx = 0;
+-
+ 	return 0;
+ 
+ err_free_buf_descs:
+@@ -303,6 +300,9 @@ static void bcm4908_enet_dma_ring_init(s
+ 
+ 	enet_write(enet, ring->st_ram_block + ENET_DMA_CH_STATE_RAM_BASE_DESC_PTR,
+ 		   (uint32_t)ring->dma_addr);
++
++	ring->read_idx = 0;
++	ring->write_idx = 0;
+ }
+ 
+ static void bcm4908_enet_dma_uninit(struct bcm4908_enet *enet)


From lede-commits at lists.infradead.org  Mon Jun 21 23:39:32 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 02:39:32 -0400
Subject: [openwrt/openwrt] base-files: fix typo in config_generate MAC check
In-Reply-To: <162434397195.14870.9136551643736568575@git-01.infra.openwrt.org>
References: <162434397195.14870.9136551643736568575@git-01.infra.openwrt.org>
Message-ID: <mailman.1978.1624343976.1072.lede-commits@lists.infradead.org>

rmilecki pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/74dbf3412bcef16d08cd1e7bed4e32a400c8fc11

commit 74dbf3412bcef16d08cd1e7bed4e32a400c8fc11
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Mon Jun 14 22:29:49 2021 +0200

    base-files: fix typo in config_generate MAC check
    
    Fixes: 125deb4d783e ("base-files: set MAC for bridge ports (devices) instead of bridge itself")
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
    (cherry picked from commit 946019637ec9192450c685a61c589a9cbef7637b)
---
 package/base-files/files/bin/config_generate | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index b3752c5430..596fcf41fa 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -116,7 +116,7 @@ generate_network() {
 			set network. at device[-1].type='bridge'
 		EOF
 		for port in $ports; do uci add_list network. at device[-1].ports="$port"; done
-		[ -n "macaddr" ] && {
+		[ -n "$macaddr" ] && {
 			for port in $ports; do
 				uci -q batch <<-EOF
 					add network device


From lede-commits at lists.infradead.org  Mon Jun 21 23:39:34 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 02:39:34 -0400
Subject: [openwrt/openwrt] bcm4908: fix Ethernet broken state after
 interface restart
In-Reply-To: <162434397195.14870.9136551643736568575@git-01.infra.openwrt.org>
References: <162434397195.14870.9136551643736568575@git-01.infra.openwrt.org>
Message-ID: <mailman.1979.1624343977.1072.lede-commits@lists.infradead.org>

rmilecki pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/1247a6bb358845c7526581730992bc0d8fa29244

commit 1247a6bb358845c7526581730992bc0d8fa29244
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Tue Jun 22 07:47:18 2021 +0200

    bcm4908: fix Ethernet broken state after interface restart
    
    This fixes traffic stalls after ifdown & ifup.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
    (cherry picked from commit f8d5bd20b31842ef7fdb740d27c70294f21c6124)
---
 ...m-bcm4908_enet-reset-DMA-rings-sw-indexes.patch | 43 ++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/target/linux/bcm4908/patches-5.4/170-net-broadcom-bcm4908_enet-reset-DMA-rings-sw-indexes.patch b/target/linux/bcm4908/patches-5.4/170-net-broadcom-bcm4908_enet-reset-DMA-rings-sw-indexes.patch
new file mode 100644
index 0000000000..7e82230f9a
--- /dev/null
+++ b/target/linux/bcm4908/patches-5.4/170-net-broadcom-bcm4908_enet-reset-DMA-rings-sw-indexes.patch
@@ -0,0 +1,43 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Tue, 22 Jun 2021 07:05:04 +0200
+Subject: [PATCH] net: broadcom: bcm4908_enet: reset DMA rings sw indexes
+ properly
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Resetting software indexes in bcm4908_dma_alloc_buf_descs() is not
+enough as it's called during device probe only. Driver resets DMA on
+every .ndo_open callback and it's required to reset indexes then.
+
+This fixes inconsistent rings state and stalled traffic after interface
+down & up sequence.
+
+Fixes: 4feffeadbcb2 ("net: broadcom: bcm4908enet: add BCM4908 controller driver")
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+---
+ drivers/net/ethernet/broadcom/bcm4908_enet.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/ethernet/broadcom/bcm4908_enet.c
++++ b/drivers/net/ethernet/broadcom/bcm4908_enet.c
+@@ -174,9 +174,6 @@ static int bcm4908_dma_alloc_buf_descs(s
+ 	if (!ring->slots)
+ 		goto err_free_buf_descs;
+ 
+-	ring->read_idx = 0;
+-	ring->write_idx = 0;
+-
+ 	return 0;
+ 
+ err_free_buf_descs:
+@@ -303,6 +300,9 @@ static void bcm4908_enet_dma_ring_init(s
+ 
+ 	enet_write(enet, ring->st_ram_block + ENET_DMA_CH_STATE_RAM_BASE_DESC_PTR,
+ 		   (uint32_t)ring->dma_addr);
++
++	ring->read_idx = 0;
++	ring->write_idx = 0;
+ }
+ 
+ static void bcm4908_enet_dma_uninit(struct bcm4908_enet *enet)


From lede-commits at lists.infradead.org  Mon Jun 21 23:39:31 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 02:39:31 -0400
Subject: [openwrt/openwrt] base-files: set MAC for bridge ports (devices)
 instead of bridge itself
In-Reply-To: <162434397195.14870.9136551643736568575@git-01.infra.openwrt.org>
References: <162434397195.14870.9136551643736568575@git-01.infra.openwrt.org>
Message-ID: <mailman.1980.1624343981.1072.lede-commits@lists.infradead.org>

rmilecki pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/125deb4d783e548228e68f6e4b42b5eb84ba8b8c

commit 125deb4d783e548228e68f6e4b42b5eb84ba8b8c
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Mon Jun 14 20:18:14 2021 +0200

    base-files: set MAC for bridge ports (devices) instead of bridge itself
    
    This restores the original config_generate behaviour. With MAC set for
    bridged devices the bridge automatically gets its MAC adjusted (it picks
    the lowest MAC of bridged devices).
    
    This fixes confusing interfaces setup (bridge ports not having custom
    MAC assigned).
    
    Reported-by: Koen Vandeputte <koen.vandeputte at citymesh.com>
    Fixes: c2139eef279e ("base-files: simplify setting device MAC")
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
    (cherry picked from commit c8d8eb9d13fc6fc8b394a620c27995ee71d29c4d)
---
 package/base-files/files/bin/config_generate | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/package/base-files/files/bin/config_generate b/package/base-files/files/bin/config_generate
index 0dca5549e8..b3752c5430 100755
--- a/package/base-files/files/bin/config_generate
+++ b/package/base-files/files/bin/config_generate
@@ -114,9 +114,17 @@ generate_network() {
 			add network device
 			set network. at device[-1].name='br-$1'
 			set network. at device[-1].type='bridge'
-			set network. at device[-1].macaddr='$macaddr'
 		EOF
 		for port in $ports; do uci add_list network. at device[-1].ports="$port"; done
+		[ -n "macaddr" ] && {
+			for port in $ports; do
+				uci -q batch <<-EOF
+					add network device
+					set network. at device[-1].name='$port'
+					set network. at device[-1].macaddr='$macaddr'
+				EOF
+			done
+		}
 		device=br-$1
 		type=
 		macaddr=""


From lede-commits at lists.infradead.org  Mon Jun 21 23:39:33 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 02:39:33 -0400
Subject: [openwrt/openwrt]  bcm4908: add kmod-gpio-button-hotplug
In-Reply-To: <162434397195.14870.9136551643736568575@git-01.infra.openwrt.org>
References: <162434397195.14870.9136551643736568575@git-01.infra.openwrt.org>
Message-ID: <mailman.1983.1624343981.1072.lede-commits@lists.infradead.org>

rmilecki pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/25daa921da05c45263282a4cd25a4ff864131f0d

commit 25daa921da05c45263282a4cd25a4ff864131f0d
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Mon Jun 21 08:49:03 2021 +0200

    bcm4908: add kmod-gpio-button-hotplug
    
    All bcm4908 devices are expected to have GPIO buttons to make relevant
    package selected by default.
    This "fixes" triggering failsafe mode.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
    (cherry picked from commit fcfa60408c37a129b143e4928b6d86e383c2c8f6)
---
 target/linux/bcm4908/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/bcm4908/Makefile b/target/linux/bcm4908/Makefile
index ce5f230ca6..bbe5030b65 100644
--- a/target/linux/bcm4908/Makefile
+++ b/target/linux/bcm4908/Makefile
@@ -22,6 +22,7 @@ KERNELNAME:=Image dtbs
 
 DEFAULT_PACKAGES += \
 	bcm4908img \
+	kmod-gpio-button-hotplug \
 	kmod-usb-ohci kmod-usb2 kmod-usb3
 
 $(eval $(call BuildTarget))


From lede-commits at lists.infradead.org  Tue Jun 22 04:27:50 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 07:27:50 -0400
Subject: [openwrt/openwrt]  bcm63xx-cfe: update to the latest master
In-Reply-To: <162436127039.7133.1835162608936212457@git-01.infra.openwrt.org>
References: <162436127039.7133.1835162608936212457@git-01.infra.openwrt.org>
Message-ID: <mailman.2077.1624361274.1072.lede-commits@lists.infradead.org>

rmilecki pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/0b2c1997e988552a4bb52dda88eccf4896fbb61b

commit 0b2c1997e988552a4bb52dda88eccf4896fbb61b
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Tue Jun 22 13:19:50 2021 +0200

    bcm63xx-cfe: update to the latest master
    
    e5050f3 linksys: ea9500-v2: add cferam file
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 package/kernel/bcm63xx-cfe/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/kernel/bcm63xx-cfe/Makefile b/package/kernel/bcm63xx-cfe/Makefile
index 568348e856..a8399ce112 100644
--- a/package/kernel/bcm63xx-cfe/Makefile
+++ b/package/kernel/bcm63xx-cfe/Makefile
@@ -2,13 +2,13 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=bcm63xx-cfe
-PKG_RELEASE:=2
+PKG_RELEASE:=1
 
 PKG_SOURCE_URL:=https://github.com/openwrt/bcm63xx-cfe.git
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2021-03-05
-PKG_SOURCE_VERSION:=d03501629fc8b1ba8f9b0961d543c256a3d0098f
-PKG_MIRROR_HASH:=b32a6f68d59c8f4534def7ec2568ad7da7a612a605b9406328309c78115ee88d
+PKG_SOURCE_DATE:=2021-06-22
+PKG_SOURCE_VERSION:=e5050f37150b34deb547b50feccd0e7439cb5bd7
+PKG_MIRROR_HASH:=85fed9f4bdf23cf7d33a02f549ffe9073666890f786d5ffa484c0368552b75ae
 
 PKG_FLAGS:=nonshared
 


From lede-commits at lists.infradead.org  Tue Jun 22 12:47:02 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 15:47:02 -0400
Subject: [openwrt/openwrt] base-files: fix enabled for services with only STOP
In-Reply-To: <162439122199.22232.18083048721968217200@git-01.infra.openwrt.org>
References: <162439122199.22232.18083048721968217200@git-01.infra.openwrt.org>
Message-ID: <mailman.2266.1624391228.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/cc7316d1e924977881f03a7cb5863b695f79d81e

commit cc7316d1e924977881f03a7cb5863b695f79d81e
Author: Karel Ko?? <karel.koci at nic.cz>
AuthorDate: Mon Jun 7 19:25:06 2021 +0200

    base-files: fix enabled for services with only STOP
    
    There are services that have only STOP value set. They are executed only
    on shutdown and it is common to use them for system cleanup. There is
    one such service shipped directly with base-files, it is 'umount'. Those
    work the same way as those with START but enabled does not report them
    as enabled although it should have as they can be enabled and disabled
    as any other service.
    
    This also changes check from check for executable to check for symbolic
    link. The implementation depends on those being links to service file
    and it is much cleaner and direct to check for them being links.
    
    Signed-off-by: Karel Ko?? <karel.koci at nic.cz>
---
 package/base-files/files/etc/rc.common | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common
index f39b69464e..5dcbf5138d 100755
--- a/package/base-files/files/etc/rc.common
+++ b/package/base-files/files/etc/rc.common
@@ -55,7 +55,12 @@ enable() {
 
 enabled() {
 	name="$(basename "${initscript}")"
-	[ -x "$IPKG_INSTROOT/etc/rc.d/S${START}${name##S[0-9][0-9]}" ]
+	name="${name##[SK][0-9][0-9]}"
+	{
+		[ -z "${START:-}" ] || [ -L "$IPKG_INSTROOT/etc/rc.d/S${START}$name" ]
+	} && {
+		[ -z "${STOP:-}" ] || [ -L "$IPKG_INSTROOT/etc/rc.d/K${STOP}$name" ]
+	}
 }
 
 depends() {


From lede-commits at lists.infradead.org  Tue Jun 22 12:55:10 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 15:55:10 -0400
Subject: [openwrt/openwrt] hostapd: fix handling of the channel utilization
 options
In-Reply-To: <162439171028.31911.680004410229299909@git-01.infra.openwrt.org>
References: <162439171028.31911.680004410229299909@git-01.infra.openwrt.org>
Message-ID: <mailman.2267.1624391713.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/82c700de67dc03bb71a739e1b40f08d84ea24e5d

commit 82c700de67dc03bb71a739e1b40f08d84ea24e5d
Author: Timo Sigurdsson <public_timo.s at silentcreek.de>
AuthorDate: Tue Jun 15 23:12:08 2021 +0200

    hostapd: fix handling of the channel utilization options
    
    Commit 0a7657c ("hostapd: add channel utilization as config option") added the
    two new uci options bss_load_update_period and chan_util_avg_period. However,
    the corresponding "config_add_int" calls for these options weren't added, so
    attempting to actually use these options and change their values is bound to
    fail - they always stay at their defaults. Add the missing code to actually
    make these options work.
    
    Fixes: 0a7657c ("hostapd: add channel utilization as config option")
    Signed-off-by: Timo Sigurdsson <public_timo.s at silentcreek.de>
    (cherry picked from commit 85ce590705072be78c3ef7dc6b64e3b1facc892b)
---
 package/network/services/hostapd/files/hostapd.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 45a49b8faa..87fcaf03b3 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -251,6 +251,8 @@ hostapd_common_add_bss_config() {
 	config_add_int acct_port
 	config_add_int acct_interval
 
+	config_add_int bss_load_update_period chan_util_avg_period
+
 	config_add_string dae_client
 	config_add_string dae_secret
 	config_add_int dae_port


From lede-commits at lists.infradead.org  Tue Jun 22 14:10:40 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 17:10:40 -0400
Subject: [openwrt/openwrt] hostapd: make wnm_sleep_mode_no_keys configurable
In-Reply-To: <162439624087.925.7299231736635106615@git-01.infra.openwrt.org>
References: <162439624087.925.7299231736635106615@git-01.infra.openwrt.org>
Message-ID: <mailman.2279.1624396246.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/bf98faaac8ed24cf7d3d93dd4fcd7304d109363b

commit bf98faaac8ed24cf7d3d93dd4fcd7304d109363b
Author: Timo Sigurdsson <public_timo.s at silentcreek.de>
AuthorDate: Tue Jun 15 23:09:41 2021 +0200

    hostapd: make wnm_sleep_mode_no_keys configurable
    
    In the aftermath of the KRACK attacks, hostapd gained an AP-side workaround
    against WNM-Sleep Mode GTK/IGTK reinstallation attacks. WNM Sleep Mode is not
    enabled by default on OpenWrt, but it is configurable through the option
    wnm_sleep_mode. Thus, make the AP-side workaround configurable as well by
    exposing the option wnm_sleep_mode_no_keys. If you use the option
    wpa_disable_eapol_key_retries and have wnm_sleep_mode enabled, you might
    consider using this workaround.
    
    Signed-off-by: Timo Sigurdsson <public_timo.s at silentcreek.de>
---
 package/network/services/hostapd/files/hostapd.sh | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index b9409c8ca3..4a5f8d61fe 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -295,7 +295,7 @@ hostapd_common_add_bss_config() {
 	config_add_string wps_device_type wps_device_name wps_manufacturer wps_pin
 	config_add_string multi_ap_backhaul_ssid multi_ap_backhaul_key
 
-	config_add_boolean wnm_sleep_mode bss_transition
+	config_add_boolean wnm_sleep_mode wnm_sleep_mode_no_keys bss_transition
 	config_add_int time_advertisement
 	config_add_string time_zone
 
@@ -756,13 +756,17 @@ hostapd_set_bss_options() {
 		append bss_conf "iapp_interface=$ifname" "$N"
 	}
 
-	json_get_vars time_advertisement time_zone wnm_sleep_mode bss_transition
+	json_get_vars time_advertisement time_zone wnm_sleep_mode wnm_sleep_mode_no_keys bss_transition
 	set_default bss_transition 0
 	set_default wnm_sleep_mode 0
+	set_default wnm_sleep_mode_no_keys 0
 
 	[ -n "$time_advertisement" ] && append bss_conf "time_advertisement=$time_advertisement" "$N"
 	[ -n "$time_zone" ] && append bss_conf "time_zone=$time_zone" "$N"
-	[ "$wnm_sleep_mode" -eq "1" ] && append bss_conf "wnm_sleep_mode=1" "$N"
+	if [ "$wnm_sleep_mode" -eq "1" ]; then
+		append bss_conf "wnm_sleep_mode=1" "$N"
+		[ "$wnm_sleep_mode_no_keys" -eq "1" ] && append bss_conf "wnm_sleep_mode_no_keys=1" "$N"
+	fi
 	[ "$bss_transition" -eq "1" ] && append bss_conf "bss_transition=1" "$N"
 
 	json_get_vars ieee80211k rrm_neighbor_report rrm_beacon_report


From lede-commits at lists.infradead.org  Tue Jun 22 14:23:48 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 17:23:48 -0400
Subject: [openwrt/openwrt] kernel: crypto: limit crypto-hw-hifn-795x to
 devices with pci support
In-Reply-To: <162439702782.8536.2242986543594845304@git-01.infra.openwrt.org>
References: <162439702782.8536.2242986543594845304@git-01.infra.openwrt.org>
Message-ID: <mailman.2285.1624397032.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/c1927f4108e9c6ad33d270db217cb59253743650

commit c1927f4108e9c6ad33d270db217cb59253743650
Author: Aleksander Jan Bajkowski <A.Bajkowski at stud.elka.pw.edu.pl>
AuthorDate: Mon May 3 10:49:06 2021 +0200

    kernel: crypto: limit crypto-hw-hifn-795x to devices with pci support
    
    CONFIG_CRYPTO_DEV_HIFN_795X depends on PCI. This driver only makes sense on
    devices with pci support.
    
    Signed-off-by: Aleksander Jan Bajkowski <A.Bajkowski at stud.elka.pw.edu.pl>
---
 package/kernel/linux/modules/crypto.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/linux/modules/crypto.mk b/package/kernel/linux/modules/crypto.mk
index 35d840b229..6cecb1a0fa 100644
--- a/package/kernel/linux/modules/crypto.mk
+++ b/package/kernel/linux/modules/crypto.mk
@@ -360,7 +360,7 @@ $(eval $(call KernelPackage,crypto-hw-geode))
 
 define KernelPackage/crypto-hw-hifn-795x
   TITLE:=HIFN 795x crypto accelerator
-  DEPENDS:=+kmod-random-core +kmod-crypto-manager
+  DEPENDS:=@PCI_SUPPORT +kmod-random-core +kmod-crypto-manager
   KCONFIG:= \
 	CONFIG_CRYPTO_HW=y \
 	CONFIG_CRYPTO_DEV_HIFN_795X \


From lede-commits at lists.infradead.org  Tue Jun 22 14:23:47 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 17:23:47 -0400
Subject: [openwrt/openwrt] realtek: Fix buffer length calculation on RTL8380
 with CRC offload
In-Reply-To: <162439702782.8536.2242986543594845304@git-01.infra.openwrt.org>
References: <162439702782.8536.2242986543594845304@git-01.infra.openwrt.org>
Message-ID: <mailman.2286.1624397032.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/76428494c323d0bb6572f9a2d247092b322fa221

commit 76428494c323d0bb6572f9a2d247092b322fa221
Author: Birger Koblitz <mail at birger-koblitz.de>
AuthorDate: Sun Jun 6 16:20:59 2021 +0200

    realtek: Fix buffer length calculation on RTL8380 with CRC offload
    
    Fixes the buffer and packet length calculations for Ethernet TX on
    the RTL8380 SoC when CRC calculation offload is enabled.
    CRC-offload is always done by the SoC, but additional CRC
    calculation was previously done also by the kernel.
    It also fixes detection of the DSA tag for packets on RTL8390
    SoCs for ports > 28.
    
    v2 has correct whitespace
    
    Signed-off-by: Birger Koblitz <mail at birger-koblitz.de>
---
 .../realtek/files-5.4/drivers/net/ethernet/rtl838x_eth.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/target/linux/realtek/files-5.4/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-5.4/drivers/net/ethernet/rtl838x_eth.c
index c5c6e3b6b7..de54868cad 100644
--- a/target/linux/realtek/files-5.4/drivers/net/ethernet/rtl838x_eth.c
+++ b/target/linux/realtek/files-5.4/drivers/net/ethernet/rtl838x_eth.c
@@ -1129,23 +1129,16 @@ static int rtl838x_eth_tx(struct sk_buff *skb, struct net_device *dev)
 
 	/* Check for DSA tagging at the end of the buffer */
 	if (netdev_uses_dsa(dev) && skb->data[len-4] == 0x80 && skb->data[len-3] > 0
-			&& skb->data[len-3] < 28 &&  skb->data[len-2] == 0x10
+			&& skb->data[len-3] < priv->cpu_port &&  skb->data[len-2] == 0x10
 			&&  skb->data[len-1] == 0x00) {
 		/* Reuse tag space for CRC if possible */
 		dest_port = skb->data[len-3];
+		skb->data[len-4] = skb->data[len-3] = skb->data[len-2] = skb->data[len-1] = 0x00;
 		len -= 4;
 	}
 
 	len += 4; // Add space for CRC
 
-	// On RTL8380 SoCs, the packet needs extra padding
-	if (priv->family_id == RTL8380_FAMILY_ID) {
-		if (len < ETH_ZLEN)
-			len = ETH_ZLEN; // SoC not automatically padding to ETH_ZLEN
-		else
-			len += 4;
-	}
-
 	if (skb_padto(skb, len)) {
 		ret = NETDEV_TX_OK;
 		goto txdone;
@@ -1158,6 +1151,11 @@ static int rtl838x_eth_tx(struct sk_buff *skb, struct net_device *dev)
 		h = &ring->tx_header[q][ring->c_tx[q]];
 		h->size = len;
 		h->len = len;
+		// On RTL8380 SoCs, small packet lengths being sent need adjustments
+		if (priv->family_id == RTL8380_FAMILY_ID) {
+			if (len < ETH_ZLEN - 4)
+				h->len -= 4;
+		}
 
 		priv->r->create_tx_header(h, dest_port, skb->priority >> 1);
 


From lede-commits at lists.infradead.org  Tue Jun 22 14:23:52 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 17:23:52 -0400
Subject: [openwrt/openwrt]  base-files: failsafe: Fix IP configuration
In-Reply-To: <162439702782.8536.2242986543594845304@git-01.infra.openwrt.org>
References: <162439702782.8536.2242986543594845304@git-01.infra.openwrt.org>
Message-ID: <mailman.2287.1624397033.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/467cd378db3359814866ec4121fdb4417783241e

commit 467cd378db3359814866ec4121fdb4417783241e
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Tue Jun 22 00:45:19 2021 +0200

    base-files: failsafe: Fix IP configuration
    
    Adapt the preinit_config_board() to the board.json network changes. It
    now looks for the device and the ports variables to configure the LAN
    network.
    
    This works with swconfig configurations.
    
    Fixes: FS#3866
    Fixes: d42640e389a8 ("base-files: use "ports" array in board.json network for bridges")
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    Reviewed-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 package/base-files/files/lib/preinit/10_indicate_preinit | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/package/base-files/files/lib/preinit/10_indicate_preinit b/package/base-files/files/lib/preinit/10_indicate_preinit
index 3c59929790..56e96c63ba 100644
--- a/package/base-files/files/lib/preinit/10_indicate_preinit
+++ b/package/base-files/files/lib/preinit/10_indicate_preinit
@@ -72,14 +72,20 @@ preinit_config_board() {
 
 	json_select network
 		json_select "lan"
-			json_get_vars ifname
+			json_get_vars device
+			json_get_values ports ports
 		json_select ..
 	json_select ..
 
-	[ -n "$ifname" ] || return
+	[ -n "$device" -o -n "$ports" ] || return
+
+	# swconfig uses $device and DSA uses ports
+	[ -z "$ports" ] && {
+		ports="$device"
+	}
 
 	# only use the first one
-	ifname=${ifname%% *}
+	ifname=${ports%% *}
 
 	if [ -x /sbin/swconfig ]; then
 		# configure the switch, if present


From lede-commits at lists.infradead.org  Tue Jun 22 14:23:49 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 17:23:49 -0400
Subject: [openwrt/openwrt]  kernel: bump 5.10 to 5.10.44
In-Reply-To: <162439702782.8536.2242986543594845304@git-01.infra.openwrt.org>
References: <162439702782.8536.2242986543594845304@git-01.infra.openwrt.org>
Message-ID: <mailman.2288.1624397035.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/79481c71dcb9426878b9738755027c994d4d2273

commit 79481c71dcb9426878b9738755027c994d4d2273
Author: Rui Salvaterra <rsalvaterra at gmail.com>
AuthorDate: Wed Jun 16 17:22:50 2021 +0100

    kernel: bump 5.10 to 5.10.44
    
    Add the new symbol to the generic kconfig.
    
    No deleted or manually refreshed patches.
    
    Signed-off-by: Rui Salvaterra <rsalvaterra at gmail.com>
---
 include/kernel-version.mk                               | 4 ++--
 target/linux/generic/config-5.10                        | 1 +
 target/linux/generic/hack-5.10/221-module_exports.patch | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index fb18167cfe..1224eccd32 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -7,10 +7,10 @@ ifdef CONFIG_TESTING_KERNEL
 endif
 
 LINUX_VERSION-5.4 = .124
-LINUX_VERSION-5.10 = .43
+LINUX_VERSION-5.10 = .44
 
 LINUX_KERNEL_HASH-5.4.124 = f7f29dda2b042d7b5986d18274413131cf70e17288c05e9a683df1f46c507d82
-LINUX_KERNEL_HASH-5.10.43 = 83b81e433ba2f8ee143064fb163699ee857e26dd789006bc1e9edf1ccd0bd403
+LINUX_KERNEL_HASH-5.10.44 = 77beefa59c854ce1e8353db947a71a8a91f2a907aed45c1335ac1f209983c767
 
 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
 sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10
index 353d2c8c87..c15829e49e 100644
--- a/target/linux/generic/config-5.10
+++ b/target/linux/generic/config-5.10
@@ -4167,6 +4167,7 @@ CONFIG_NMI_LOG_BUF_SHIFT=13
 # CONFIG_NVMEM_SYSFS is not set
 # CONFIG_NVME_FC is not set
 # CONFIG_NVME_TARGET is not set
+# CONFIG_NVME_TCP is not set
 # CONFIG_NVRAM is not set
 # CONFIG_NV_TCO is not set
 # CONFIG_NXP_STB220 is not set
diff --git a/target/linux/generic/hack-5.10/221-module_exports.patch b/target/linux/generic/hack-5.10/221-module_exports.patch
index 07885408f1..e6854138e7 100644
--- a/target/linux/generic/hack-5.10/221-module_exports.patch
+++ b/target/linux/generic/hack-5.10/221-module_exports.patch
@@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	}								\
  									\
  	/* __*init sections */						\
-@@ -1017,6 +1027,8 @@
+@@ -1018,6 +1028,8 @@
  
  #define COMMON_DISCARDS							\
  	SANITIZER_DISCARDS						\


From lede-commits at lists.infradead.org  Tue Jun 22 14:23:53 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 17:23:53 -0400
Subject: [openwrt/openwrt] base-files: failsafe: Remove the VLAN modifier
 from interface name
In-Reply-To: <162439702782.8536.2242986543594845304@git-01.infra.openwrt.org>
References: <162439702782.8536.2242986543594845304@git-01.infra.openwrt.org>
Message-ID: <mailman.2289.1624397035.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/790561d5109ef81537fdb8ceb8eb183c0cab077c

commit 790561d5109ef81537fdb8ceb8eb183c0cab077c
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Tue Jun 22 00:45:20 2021 +0200

    base-files: failsafe: Remove the VLAN modifier from interface name
    
    Some interfaces have a VLAN modifier like :t in lan1:t, this modifier
    should be removed from the interface before calling preinit_ip_config().
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/base-files/files/lib/preinit/10_indicate_preinit | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/base-files/files/lib/preinit/10_indicate_preinit b/package/base-files/files/lib/preinit/10_indicate_preinit
index 56e96c63ba..deb5f2ae3a 100644
--- a/package/base-files/files/lib/preinit/10_indicate_preinit
+++ b/package/base-files/files/lib/preinit/10_indicate_preinit
@@ -97,6 +97,8 @@ preinit_config_board() {
 	else
 		# trim any vlan ids
 		ifname=${ifname%\.*}
+		# trim any vlan modifiers like :t
+		ifname=${ifname%\:*}
 	fi
 
 	pi_ifname=$ifname


From lede-commits at lists.infradead.org  Tue Jun 22 14:23:54 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 17:23:54 -0400
Subject: [openwrt/openwrt]  realtek: Fix failsafe mode
In-Reply-To: <162439702782.8536.2242986543594845304@git-01.infra.openwrt.org>
References: <162439702782.8536.2242986543594845304@git-01.infra.openwrt.org>
Message-ID: <mailman.2292.1624397035.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/b7ee0786b56d1088c195fe7c1cdb1ad7d20c9245

commit b7ee0786b56d1088c195fe7c1cdb1ad7d20c9245
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Tue Jun 22 00:45:21 2021 +0200

    realtek: Fix failsafe mode
    
    The RTL8380-RTL9300 switches only forward packets when VLAN ID 1 is
    configured. Do not use the standard failsafe configuration for DSA
    accessing the default port directly, but configure a switch on the lan1
    interface instead.
    
    This will add the VLAN ID 1 configuration to the switch:
    $ bridge vlan show
    port              vlan-id
    lan1              1 PVID Egress Untagged
    switch            1 PVID Egress Untagged
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../base-files/lib/preinit/05_set_preinit_iface_realtek     | 13 +++++++++++++
 .../base-files/lib/preinit/98_remove_preinit_realtek        |  6 ++++++
 2 files changed, 19 insertions(+)

diff --git a/target/linux/realtek/base-files/lib/preinit/05_set_preinit_iface_realtek b/target/linux/realtek/base-files/lib/preinit/05_set_preinit_iface_realtek
new file mode 100644
index 0000000000..e2a7cf5a69
--- /dev/null
+++ b/target/linux/realtek/base-files/lib/preinit/05_set_preinit_iface_realtek
@@ -0,0 +1,13 @@
+set_preinit_iface() {
+
+	# Create a switch on lan1 to configure the VLAN 1.
+	# Without configuring VLAN ID 1 RTL8380 - RTL9300 will not
+	# forward packets.
+	ip link add name switch type bridge vlan_filtering 1
+	ip link set dev lan1 master switch
+	ip link set lan1 up
+
+	pi_ifname=switch
+}
+
+boot_hook_add preinit_main set_preinit_iface
diff --git a/target/linux/realtek/base-files/lib/preinit/98_remove_preinit_realtek b/target/linux/realtek/base-files/lib/preinit/98_remove_preinit_realtek
new file mode 100644
index 0000000000..dc5fdb059b
--- /dev/null
+++ b/target/linux/realtek/base-files/lib/preinit/98_remove_preinit_realtek
@@ -0,0 +1,6 @@
+remove_switch() {
+	# delete switch created in 05_set_preinit_iface_realtek again
+	ip link del name switch
+}
+
+boot_hook_add preinit_main remove_switch


From lede-commits at lists.infradead.org  Tue Jun 22 14:23:51 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 17:23:51 -0400
Subject: [openwrt/openwrt] kernel: Backport patch to automatically bring up
 DSA master when opening user port
In-Reply-To: <162439702782.8536.2242986543594845304@git-01.infra.openwrt.org>
References: <162439702782.8536.2242986543594845304@git-01.infra.openwrt.org>
Message-ID: <mailman.2293.1624397037.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/2e17c710954bd3506467d700dee23757b138fedd

commit 2e17c710954bd3506467d700dee23757b138fedd
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Tue Jun 22 00:45:18 2021 +0200

    kernel: Backport patch to automatically bring up DSA master when opening user port
    
    Without this patch we have to manually bring up the CPU interface in
    failsafe mode.
    
    This was backported from kernel 5.12.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    Tested-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 .../425-at803x-allow-sgmii-aneg-override.patch     |  2 +-
 ...omatically-bring-up-DSA-master-when-openi.patch | 85 ++++++++++++++++++++++
 ...louder-when-a-non-legacy-FDB-operation-fa.patch |  4 +-
 ...-t-use-switchdev_notifier_fdb_info-in-dsa.patch |  8 +-
 ...e-switchdev-event-implementation-under-th.patch |  4 +-
 ...t-early-in-dsa_slave_switchdev_event-if-w.patch |  2 +-
 ...ten-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch |  6 +-
 ...omatically-bring-up-DSA-master-when-openi.patch | 85 ++++++++++++++++++++++
 ...louder-when-a-non-legacy-FDB-operation-fa.patch |  4 +-
 ...-t-use-switchdev_notifier_fdb_info-in-dsa.patch |  8 +-
 ...e-switchdev-event-implementation-under-th.patch |  4 +-
 ...t-early-in-dsa_slave_switchdev_event-if-w.patch |  2 +-
 ...ten-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch |  6 +-
 ...lude-local-addresses-in-assisted-CPU-port.patch |  2 +-
 ...lude-bridge-addresses-in-assisted-CPU-por.patch |  2 +-
 ...c-static-FDB-entries-on-foreign-interface.patch |  4 +-
 ...180-net-phy-at803x-add-support-for-AT8032.patch | 10 +--
 ...t-dsa-support-hardware-flow-table-offload.patch |  4 +-
 ...lude-local-addresses-in-assisted-CPU-port.patch |  2 +-
 ...lude-bridge-addresses-in-assisted-CPU-por.patch |  2 +-
 ...c-static-FDB-entries-on-foreign-interface.patch |  4 +-
 21 files changed, 210 insertions(+), 40 deletions(-)

diff --git a/target/linux/ath79/patches-5.4/425-at803x-allow-sgmii-aneg-override.patch b/target/linux/ath79/patches-5.4/425-at803x-allow-sgmii-aneg-override.patch
index 396b1ee7a2..a3016d1b30 100644
--- a/target/linux/ath79/patches-5.4/425-at803x-allow-sgmii-aneg-override.patch
+++ b/target/linux/ath79/patches-5.4/425-at803x-allow-sgmii-aneg-override.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/phy/at803x.c
 +++ b/drivers/net/phy/at803x.c
-@@ -383,6 +383,13 @@ static int at803x_aneg_done(struct phy_d
+@@ -404,6 +404,13 @@ static int at803x_aneg_done(struct phy_d
  	if (!(phy_read(phydev, AT803X_PSSR) & AT803X_PSSR_MR_AN_COMPLETE)) {
  		phydev_warn(phydev, "803x_aneg_done: SGMII link is not ok\n");
  		aneg_done = 0;
diff --git a/target/linux/generic/backport-5.10/765-v5.12-net-dsa-automatically-bring-up-DSA-master-when-openi.patch b/target/linux/generic/backport-5.10/765-v5.12-net-dsa-automatically-bring-up-DSA-master-when-openi.patch
new file mode 100644
index 0000000000..3b630377f9
--- /dev/null
+++ b/target/linux/generic/backport-5.10/765-v5.12-net-dsa-automatically-bring-up-DSA-master-when-openi.patch
@@ -0,0 +1,85 @@
+From 9d5ef190e5615a7b63af89f88c4106a5bc127974 Mon Sep 17 00:00:00 2001
+From: Vladimir Oltean <vladimir.oltean at nxp.com>
+Date: Fri, 5 Feb 2021 15:37:10 +0200
+Subject: [PATCH] net: dsa: automatically bring up DSA master when opening user
+ port
+
+DSA wants the master interface to be open before the user port is due to
+historical reasons. The promiscuity of interfaces that are down used to
+have issues, as referenced Lennert Buytenhek in commit df02c6ff2e39
+("dsa: fix master interface allmulti/promisc handling").
+
+The bugfix mentioned there, commit b6c40d68ff64 ("net: only invoke
+dev->change_rx_flags when device is UP"), was basically a "don't do
+that" approach to working around the promiscuity while down issue.
+
+Further work done by Vlad Yasevich in commit d2615bf45069 ("net: core:
+Always propagate flag changes to interfaces") has resolved the
+underlying issue, and it is strictly up to the DSA and 8021q drivers
+now, it is no longer mandated by the networking core that the master
+interface must be up when changing its promiscuity.
+
+From DSA's point of view, deciding to error out in dsa_slave_open
+because the master isn't up is
+(a) a bad user experience and
+(b) knocking at an open door.
+Even if there still was an issue with promiscuity while down, DSA could
+still just open the master and avoid it.
+
+Doing it this way has the additional benefit that user space can now
+remove DSA-specific workarounds, like systemd-networkd with BindCarrier:
+https://github.com/systemd/systemd/issues/7478
+
+And we can finally remove one of the 2 bullets in the "Common pitfalls
+using DSA setups" chapter.
+
+Tested with two cascaded DSA switches:
+
+$ ip link set sw0p2 up
+fsl_enetc 0000:00:00.2 eno2: configuring for fixed/internal link mode
+fsl_enetc 0000:00:00.2 eno2: Link is Up - 1Gbps/Full - flow control rx/tx
+mscc_felix 0000:00:00.5 swp0: configuring for fixed/sgmii link mode
+mscc_felix 0000:00:00.5 swp0: Link is Up - 1Gbps/Full - flow control off
+8021q: adding VLAN 0 to HW filter on device swp0
+sja1105 spi2.0 sw0p2: configuring for phy/rgmii-id link mode
+IPv6: ADDRCONF(NETDEV_CHANGE): eno2: link becomes ready
+IPv6: ADDRCONF(NETDEV_CHANGE): swp0: link becomes ready
+
+Signed-off-by: Vladimir Oltean <vladimir.oltean at nxp.com>
+Reviewed-by: Andrew Lunn <andrew at lunn.ch>
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
+---
+ Documentation/networking/dsa/dsa.rst | 4 ----
+ net/dsa/slave.c                      | 7 +++++--
+ 2 files changed, 5 insertions(+), 6 deletions(-)
+
+--- a/Documentation/networking/dsa/dsa.rst
++++ b/Documentation/networking/dsa/dsa.rst
+@@ -273,10 +273,6 @@ will not make us go through the switch t
+ the Ethernet switch on the other end, expecting a tag will typically drop this
+ frame.
+ 
+-Slave network devices check that the master network device is UP before allowing
+-you to administratively bring UP these slave network devices. A common
+-configuration mistake is forgetting to bring UP the master network device first.
+-
+ Interactions with other subsystems
+ ==================================
+ 
+--- a/net/dsa/slave.c
++++ b/net/dsa/slave.c
+@@ -68,8 +68,11 @@ static int dsa_slave_open(struct net_dev
+ 	struct dsa_port *dp = dsa_slave_to_port(dev);
+ 	int err;
+ 
+-	if (!(master->flags & IFF_UP))
+-		return -ENETDOWN;
++	err = dev_open(master, NULL);
++	if (err < 0) {
++		netdev_err(dev, "failed to open master %s\n", master->name);
++		goto out;
++	}
+ 
+ 	if (!ether_addr_equal(dev->dev_addr, master->dev_addr)) {
+ 		err = dev_uc_add(master, dev->dev_addr);
diff --git a/target/linux/generic/backport-5.10/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch b/target/linux/generic/backport-5.10/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch
index 77ce3b6b1e..7715e99647 100644
--- a/target/linux/generic/backport-5.10/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch
+++ b/target/linux/generic/backport-5.10/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch
@@ -25,7 +25,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -2111,7 +2111,9 @@ static void dsa_slave_switchdev_event_wo
+@@ -2114,7 +2114,9 @@ static void dsa_slave_switchdev_event_wo
  
  		err = dsa_port_fdb_add(dp, fdb_info->addr, fdb_info->vid);
  		if (err) {
@@ -36,7 +36,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  			break;
  		}
  		fdb_info->offloaded = true;
-@@ -2126,9 +2128,11 @@ static void dsa_slave_switchdev_event_wo
+@@ -2129,9 +2131,11 @@ static void dsa_slave_switchdev_event_wo
  
  		err = dsa_port_fdb_del(dp, fdb_info->addr, fdb_info->vid);
  		if (err) {
diff --git a/target/linux/generic/backport-5.10/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch b/target/linux/generic/backport-5.10/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch
index c7e7763bfc..fcd108332b 100644
--- a/target/linux/generic/backport-5.10/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch
+++ b/target/linux/generic/backport-5.10/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch
@@ -54,7 +54,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	struct sk_buff *	(*xmit)(struct sk_buff *skb,
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -2086,76 +2086,66 @@ static int dsa_slave_netdevice_event(str
+@@ -2089,76 +2089,66 @@ static int dsa_slave_netdevice_event(str
  	return NOTIFY_DONE;
  }
  
@@ -167,7 +167,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  }
  
  /* Called under rcu_read_lock() */
-@@ -2163,7 +2153,9 @@ static int dsa_slave_switchdev_event(str
+@@ -2166,7 +2156,9 @@ static int dsa_slave_switchdev_event(str
  				     unsigned long event, void *ptr)
  {
  	struct net_device *dev = switchdev_notifier_info_to_dev(ptr);
@@ -177,7 +177,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	int err;
  
  	if (event == SWITCHDEV_PORT_ATTR_SET) {
-@@ -2176,20 +2168,32 @@ static int dsa_slave_switchdev_event(str
+@@ -2179,20 +2171,32 @@ static int dsa_slave_switchdev_event(str
  	if (!dsa_slave_dev_check(dev))
  		return NOTIFY_DONE;
  
@@ -213,7 +213,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		dev_hold(dev);
  		break;
  	default:
-@@ -2199,10 +2203,6 @@ static int dsa_slave_switchdev_event(str
+@@ -2202,10 +2206,6 @@ static int dsa_slave_switchdev_event(str
  
  	dsa_schedule_work(&switchdev_work->work);
  	return NOTIFY_OK;
diff --git a/target/linux/generic/backport-5.10/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch b/target/linux/generic/backport-5.10/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch
index 984578a326..12b5f4222a 100644
--- a/target/linux/generic/backport-5.10/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch
+++ b/target/linux/generic/backport-5.10/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch
@@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -2158,31 +2158,29 @@ static int dsa_slave_switchdev_event(str
+@@ -2161,31 +2161,29 @@ static int dsa_slave_switchdev_event(str
  	struct dsa_port *dp;
  	int err;
  
@@ -68,7 +68,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		fdb_info = ptr;
  
  		if (!fdb_info->added_by_user) {
-@@ -2195,13 +2193,12 @@ static int dsa_slave_switchdev_event(str
+@@ -2198,13 +2196,12 @@ static int dsa_slave_switchdev_event(str
  		switchdev_work->vid = fdb_info->vid;
  
  		dev_hold(dev);
diff --git a/target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch b/target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
index 652efa2567..ba163ec77e 100644
--- a/target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
+++ b/target/linux/generic/backport-5.10/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
@@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -2171,6 +2171,9 @@ static int dsa_slave_switchdev_event(str
+@@ -2174,6 +2174,9 @@ static int dsa_slave_switchdev_event(str
  
  		dp = dsa_slave_to_port(dev);
  
diff --git a/target/linux/generic/backport-5.10/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch b/target/linux/generic/backport-5.10/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch
index e875408a3d..70d6629ee7 100644
--- a/target/linux/generic/backport-5.10/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch
+++ b/target/linux/generic/backport-5.10/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch
@@ -170,7 +170,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	 */
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -2148,6 +2148,28 @@ static void dsa_slave_switchdev_event_wo
+@@ -2151,6 +2151,28 @@ static void dsa_slave_switchdev_event_wo
  		dev_put(dp->slave);
  }
  
@@ -199,7 +199,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  /* Called under rcu_read_lock() */
  static int dsa_slave_switchdev_event(struct notifier_block *unused,
  				     unsigned long event, void *ptr)
-@@ -2166,10 +2188,37 @@ static int dsa_slave_switchdev_event(str
+@@ -2169,10 +2191,37 @@ static int dsa_slave_switchdev_event(str
  		return notifier_from_errno(err);
  	case SWITCHDEV_FDB_ADD_TO_DEVICE:
  	case SWITCHDEV_FDB_DEL_TO_DEVICE:
@@ -240,7 +240,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  		if (!dp->ds->ops->port_fdb_add || !dp->ds->ops->port_fdb_del)
  			return NOTIFY_DONE;
-@@ -2184,18 +2233,13 @@ static int dsa_slave_switchdev_event(str
+@@ -2187,18 +2236,13 @@ static int dsa_slave_switchdev_event(str
  		switchdev_work->port = dp->index;
  		switchdev_work->event = event;
  
diff --git a/target/linux/generic/backport-5.4/765-v5.12-net-dsa-automatically-bring-up-DSA-master-when-openi.patch b/target/linux/generic/backport-5.4/765-v5.12-net-dsa-automatically-bring-up-DSA-master-when-openi.patch
new file mode 100644
index 0000000000..7ec26899f9
--- /dev/null
+++ b/target/linux/generic/backport-5.4/765-v5.12-net-dsa-automatically-bring-up-DSA-master-when-openi.patch
@@ -0,0 +1,85 @@
+From 9d5ef190e5615a7b63af89f88c4106a5bc127974 Mon Sep 17 00:00:00 2001
+From: Vladimir Oltean <vladimir.oltean at nxp.com>
+Date: Fri, 5 Feb 2021 15:37:10 +0200
+Subject: [PATCH] net: dsa: automatically bring up DSA master when opening user
+ port
+
+DSA wants the master interface to be open before the user port is due to
+historical reasons. The promiscuity of interfaces that are down used to
+have issues, as referenced Lennert Buytenhek in commit df02c6ff2e39
+("dsa: fix master interface allmulti/promisc handling").
+
+The bugfix mentioned there, commit b6c40d68ff64 ("net: only invoke
+dev->change_rx_flags when device is UP"), was basically a "don't do
+that" approach to working around the promiscuity while down issue.
+
+Further work done by Vlad Yasevich in commit d2615bf45069 ("net: core:
+Always propagate flag changes to interfaces") has resolved the
+underlying issue, and it is strictly up to the DSA and 8021q drivers
+now, it is no longer mandated by the networking core that the master
+interface must be up when changing its promiscuity.
+
+From DSA's point of view, deciding to error out in dsa_slave_open
+because the master isn't up is
+(a) a bad user experience and
+(b) knocking at an open door.
+Even if there still was an issue with promiscuity while down, DSA could
+still just open the master and avoid it.
+
+Doing it this way has the additional benefit that user space can now
+remove DSA-specific workarounds, like systemd-networkd with BindCarrier:
+https://github.com/systemd/systemd/issues/7478
+
+And we can finally remove one of the 2 bullets in the "Common pitfalls
+using DSA setups" chapter.
+
+Tested with two cascaded DSA switches:
+
+$ ip link set sw0p2 up
+fsl_enetc 0000:00:00.2 eno2: configuring for fixed/internal link mode
+fsl_enetc 0000:00:00.2 eno2: Link is Up - 1Gbps/Full - flow control rx/tx
+mscc_felix 0000:00:00.5 swp0: configuring for fixed/sgmii link mode
+mscc_felix 0000:00:00.5 swp0: Link is Up - 1Gbps/Full - flow control off
+8021q: adding VLAN 0 to HW filter on device swp0
+sja1105 spi2.0 sw0p2: configuring for phy/rgmii-id link mode
+IPv6: ADDRCONF(NETDEV_CHANGE): eno2: link becomes ready
+IPv6: ADDRCONF(NETDEV_CHANGE): swp0: link becomes ready
+
+Signed-off-by: Vladimir Oltean <vladimir.oltean at nxp.com>
+Reviewed-by: Andrew Lunn <andrew at lunn.ch>
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
+---
+ Documentation/networking/dsa/dsa.rst | 4 ----
+ net/dsa/slave.c                      | 7 +++++--
+ 2 files changed, 5 insertions(+), 6 deletions(-)
+
+--- a/Documentation/networking/dsa/dsa.rst
++++ b/Documentation/networking/dsa/dsa.rst
+@@ -273,10 +273,6 @@ will not make us go through the switch t
+ the Ethernet switch on the other end, expecting a tag will typically drop this
+ frame.
+ 
+-Slave network devices check that the master network device is UP before allowing
+-you to administratively bring UP these slave network devices. A common
+-configuration mistake is forgetting to bring UP the master network device first.
+-
+ Interactions with other subsystems
+ ==================================
+ 
+--- a/net/dsa/slave.c
++++ b/net/dsa/slave.c
+@@ -70,8 +70,11 @@ static int dsa_slave_open(struct net_dev
+ 	struct dsa_port *dp = dsa_slave_to_port(dev);
+ 	int err;
+ 
+-	if (!(master->flags & IFF_UP))
+-		return -ENETDOWN;
++	err = dev_open(master, NULL);
++	if (err < 0) {
++		netdev_err(dev, "failed to open master %s\n", master->name);
++		goto out;
++	}
+ 
+ 	if (!ether_addr_equal(dev->dev_addr, master->dev_addr)) {
+ 		err = dev_uc_add(master, dev->dev_addr);
diff --git a/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch b/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch
index 297175855b..9ec1a226b5 100644
--- a/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch
+++ b/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch
@@ -25,7 +25,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1592,7 +1592,9 @@ static void dsa_slave_switchdev_event_wo
+@@ -1595,7 +1595,9 @@ static void dsa_slave_switchdev_event_wo
  
  		err = dsa_port_fdb_add(dp, fdb_info->addr, fdb_info->vid);
  		if (err) {
@@ -36,7 +36,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  			break;
  		}
  		fdb_info->offloaded = true;
-@@ -1607,9 +1609,11 @@ static void dsa_slave_switchdev_event_wo
+@@ -1610,9 +1612,11 @@ static void dsa_slave_switchdev_event_wo
  
  		err = dsa_port_fdb_del(dp, fdb_info->addr, fdb_info->vid);
  		if (err) {
diff --git a/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch b/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch
index e9b74053e0..bc29fbecc4 100644
--- a/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch
+++ b/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch
@@ -54,7 +54,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	struct sk_buff *	(*xmit)(struct sk_buff *skb,
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1567,76 +1567,66 @@ static int dsa_slave_netdevice_event(str
+@@ -1570,76 +1570,66 @@ static int dsa_slave_netdevice_event(str
  	return NOTIFY_DONE;
  }
  
@@ -167,7 +167,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  }
  
  /* Called under rcu_read_lock() */
-@@ -1644,7 +1634,9 @@ static int dsa_slave_switchdev_event(str
+@@ -1647,7 +1637,9 @@ static int dsa_slave_switchdev_event(str
  				     unsigned long event, void *ptr)
  {
  	struct net_device *dev = switchdev_notifier_info_to_dev(ptr);
@@ -177,7 +177,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	int err;
  
  	if (event == SWITCHDEV_PORT_ATTR_SET) {
-@@ -1657,20 +1649,32 @@ static int dsa_slave_switchdev_event(str
+@@ -1660,20 +1652,32 @@ static int dsa_slave_switchdev_event(str
  	if (!dsa_slave_dev_check(dev))
  		return NOTIFY_DONE;
  
@@ -213,7 +213,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		dev_hold(dev);
  		break;
  	default:
-@@ -1680,10 +1684,6 @@ static int dsa_slave_switchdev_event(str
+@@ -1683,10 +1687,6 @@ static int dsa_slave_switchdev_event(str
  
  	dsa_schedule_work(&switchdev_work->work);
  	return NOTIFY_OK;
diff --git a/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch b/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch
index b46cd7545e..50c7a08590 100644
--- a/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch
+++ b/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch
@@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1639,31 +1639,29 @@ static int dsa_slave_switchdev_event(str
+@@ -1642,31 +1642,29 @@ static int dsa_slave_switchdev_event(str
  	struct dsa_port *dp;
  	int err;
  
@@ -68,7 +68,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		fdb_info = ptr;
  
  		if (!fdb_info->added_by_user) {
-@@ -1676,13 +1674,12 @@ static int dsa_slave_switchdev_event(str
+@@ -1679,13 +1677,12 @@ static int dsa_slave_switchdev_event(str
  		switchdev_work->vid = fdb_info->vid;
  
  		dev_hold(dev);
diff --git a/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch b/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
index d38c3901cf..dcb6bbdc49 100644
--- a/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
+++ b/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
@@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1652,6 +1652,9 @@ static int dsa_slave_switchdev_event(str
+@@ -1655,6 +1655,9 @@ static int dsa_slave_switchdev_event(str
  
  		dp = dsa_slave_to_port(dev);
  
diff --git a/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch b/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch
index 4aa85e5750..b49d11a776 100644
--- a/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch
+++ b/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch
@@ -172,7 +172,7 @@ Signed-off-by: DENG Qingfang <dqfext at gmail.com>
  	 */
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1629,6 +1629,25 @@ static void dsa_slave_switchdev_event_wo
+@@ -1632,6 +1632,25 @@ static void dsa_slave_switchdev_event_wo
  		dev_put(dp->slave);
  }
  
@@ -198,7 +198,7 @@ Signed-off-by: DENG Qingfang <dqfext at gmail.com>
  /* Called under rcu_read_lock() */
  static int dsa_slave_switchdev_event(struct notifier_block *unused,
  				     unsigned long event, void *ptr)
-@@ -1647,10 +1666,37 @@ static int dsa_slave_switchdev_event(str
+@@ -1650,10 +1669,37 @@ static int dsa_slave_switchdev_event(str
  		return notifier_from_errno(err);
  	case SWITCHDEV_FDB_ADD_TO_DEVICE:
  	case SWITCHDEV_FDB_DEL_TO_DEVICE:
@@ -239,7 +239,7 @@ Signed-off-by: DENG Qingfang <dqfext at gmail.com>
  
  		if (!dp->ds->ops->port_fdb_add || !dp->ds->ops->port_fdb_del)
  			return NOTIFY_DONE;
-@@ -1665,18 +1711,13 @@ static int dsa_slave_switchdev_event(str
+@@ -1668,18 +1714,13 @@ static int dsa_slave_switchdev_event(str
  		switchdev_work->port = dp->index;
  		switchdev_work->event = event;
  
diff --git a/target/linux/generic/pending-5.10/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch b/target/linux/generic/pending-5.10/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch
index 145efa57c3..759f1adda4 100644
--- a/target/linux/generic/pending-5.10/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch
+++ b/target/linux/generic/pending-5.10/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch
@@ -18,7 +18,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -2191,10 +2191,12 @@ static int dsa_slave_switchdev_event(str
+@@ -2194,10 +2194,12 @@ static int dsa_slave_switchdev_event(str
  		fdb_info = ptr;
  
  		if (dsa_slave_dev_check(dev)) {
diff --git a/target/linux/generic/pending-5.10/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch b/target/linux/generic/pending-5.10/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch
index 53f1232955..0ad751cc5d 100644
--- a/target/linux/generic/pending-5.10/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch
+++ b/target/linux/generic/pending-5.10/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch
@@ -15,7 +15,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -2205,7 +2205,11 @@ static int dsa_slave_switchdev_event(str
+@@ -2208,7 +2208,11 @@ static int dsa_slave_switchdev_event(str
  			struct net_device *br_dev;
  			struct dsa_slave_priv *p;
  
diff --git a/target/linux/generic/pending-5.10/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch b/target/linux/generic/pending-5.10/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch
index 49418d3b86..e1daf61730 100644
--- a/target/linux/generic/pending-5.10/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch
+++ b/target/linux/generic/pending-5.10/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch
@@ -28,7 +28,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -2198,9 +2198,12 @@ static int dsa_slave_switchdev_event(str
+@@ -2201,9 +2201,12 @@ static int dsa_slave_switchdev_event(str
  			else if (!fdb_info->added_by_user)
  				return NOTIFY_OK;
  		} else {
@@ -44,7 +44,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
  			 */
  			struct net_device *br_dev;
  			struct dsa_slave_priv *p;
-@@ -2222,7 +2225,8 @@ static int dsa_slave_switchdev_event(str
+@@ -2225,7 +2228,8 @@ static int dsa_slave_switchdev_event(str
  
  			dp = p->dp->cpu_dp;
  
diff --git a/target/linux/generic/pending-5.4/180-net-phy-at803x-add-support-for-AT8032.patch b/target/linux/generic/pending-5.4/180-net-phy-at803x-add-support-for-AT8032.patch
index 9b88282442..3fe25c2b2b 100644
--- a/target/linux/generic/pending-5.4/180-net-phy-at803x-add-support-for-AT8032.patch
+++ b/target/linux/generic/pending-5.4/180-net-phy-at803x-add-support-for-AT8032.patch
@@ -17,9 +17,9 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #define AT803X_PHY_ID_MASK			0xffffffef
 +#define AT8032_PHY_ID_MASK			0xffffffff
  
- MODULE_DESCRIPTION("Atheros 803x PHY driver");
- MODULE_AUTHOR("Matus Ujhelyi");
-@@ -314,7 +316,7 @@ static int at803x_config_intr(struct phy
+ #define AT803X_PAGE_FIBER		0
+ #define AT803X_PAGE_COPPER		1
+@@ -357,7 +359,7 @@ static int at803x_config_intr(struct phy
  static void at803x_link_change_notify(struct phy_device *phydev)
  {
  	/*
@@ -28,7 +28,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	 * signalled. This is necessary to circumvent a hardware bug that
  	 * occurs when the cable is unplugged while TX packets are pending
  	 * in the FIFO. In such cases, the FIFO enters an error mode it
-@@ -471,6 +473,24 @@ static struct phy_driver at803x_driver[]
+@@ -516,6 +518,24 @@ static struct phy_driver at803x_driver[]
  	.aneg_done		= at803x_aneg_done,
  	.ack_interrupt		= &at803x_ack_interrupt,
  	.config_intr		= &at803x_config_intr,
@@ -53,7 +53,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  } };
  
  module_phy_driver(at803x_driver);
-@@ -478,6 +498,7 @@ module_phy_driver(at803x_driver);
+@@ -523,6 +543,7 @@ module_phy_driver(at803x_driver);
  static struct mdio_device_id __maybe_unused atheros_tbl[] = {
  	{ ATH8030_PHY_ID, AT803X_PHY_ID_MASK },
  	{ ATH8031_PHY_ID, AT803X_PHY_ID_MASK },
diff --git a/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch b/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch
index 85c606c455..91aae5b65c 100644
--- a/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch
+++ b/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch
@@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  #include "dsa_priv.h"
  
-@@ -1223,6 +1227,27 @@ static struct devlink_port *dsa_slave_ge
+@@ -1226,6 +1230,27 @@ static struct devlink_port *dsa_slave_ge
  	return dp->ds->devlink ? &dp->devlink_port : NULL;
  }
  
@@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static const struct net_device_ops dsa_slave_netdev_ops = {
  	.ndo_open	 	= dsa_slave_open,
  	.ndo_stop		= dsa_slave_close,
-@@ -1247,6 +1272,9 @@ static const struct net_device_ops dsa_s
+@@ -1250,6 +1275,9 @@ static const struct net_device_ops dsa_s
  	.ndo_vlan_rx_add_vid	= dsa_slave_vlan_rx_add_vid,
  	.ndo_vlan_rx_kill_vid	= dsa_slave_vlan_rx_kill_vid,
  	.ndo_get_devlink_port	= dsa_slave_get_devlink_port,
diff --git a/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch b/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch
index e1a7a0e448..d73481fcc0 100644
--- a/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch
+++ b/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch
@@ -18,7 +18,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1697,10 +1697,12 @@ static int dsa_slave_switchdev_event(str
+@@ -1700,10 +1700,12 @@ static int dsa_slave_switchdev_event(str
  		fdb_info = ptr;
  
  		if (dsa_slave_dev_check(dev)) {
diff --git a/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch b/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch
index f985adf736..e66aa93488 100644
--- a/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch
+++ b/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch
@@ -15,7 +15,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1711,7 +1711,11 @@ static int dsa_slave_switchdev_event(str
+@@ -1714,7 +1714,11 @@ static int dsa_slave_switchdev_event(str
  			struct net_device *br_dev;
  			struct dsa_slave_priv *p;
  
diff --git a/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch b/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch
index 984d9805f6..5305e3d114 100644
--- a/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch
+++ b/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch
@@ -28,7 +28,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1704,9 +1704,12 @@ static int dsa_slave_switchdev_event(str
+@@ -1707,9 +1707,12 @@ static int dsa_slave_switchdev_event(str
  			else if (!fdb_info->added_by_user)
  				return NOTIFY_OK;
  		} else {
@@ -44,7 +44,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
  			 */
  			struct net_device *br_dev;
  			struct dsa_slave_priv *p;
-@@ -1728,7 +1731,8 @@ static int dsa_slave_switchdev_event(str
+@@ -1731,7 +1734,8 @@ static int dsa_slave_switchdev_event(str
  
  			dp = p->dp->cpu_dp;
  


From lede-commits at lists.infradead.org  Tue Jun 22 14:23:55 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 17:23:55 -0400
Subject: [openwrt/openwrt]  base-files: bring up vlan interface too
In-Reply-To: <162439702782.8536.2242986543594845304@git-01.infra.openwrt.org>
References: <162439702782.8536.2242986543594845304@git-01.infra.openwrt.org>
Message-ID: <mailman.2296.1624397038.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/fe6b9b0588a47e0a6aabc6a51aa676e7e7204174

commit fe6b9b0588a47e0a6aabc6a51aa676e7e7204174
Author: Luiz Angelo Daros de Luca <luizluca at gmail.com>
AuthorDate: Tue Jun 22 00:45:22 2021 +0200

    base-files: bring up vlan interface too
    
    Vlan subinterface was never brought up when using vlan-based preinit network.
    Tested forcing ifname="" before preinit_ip() on a Tp-Link Archer C5v4.
    
    Signed-off-by: Luiz Angelo Daros de Luca <luizluca at gmail.com>
---
 package/base-files/files/lib/preinit/10_indicate_preinit | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/base-files/files/lib/preinit/10_indicate_preinit b/package/base-files/files/lib/preinit/10_indicate_preinit
index deb5f2ae3a..debb3d4480 100644
--- a/package/base-files/files/lib/preinit/10_indicate_preinit
+++ b/package/base-files/files/lib/preinit/10_indicate_preinit
@@ -18,6 +18,9 @@ preinit_ip_config() {
 	fi
 
 	ip link set dev $netdev up
+	if [ -n "$vid" ]; then
+		ip link set dev $1 up
+	fi
 	ip -4 address add $pi_ip/$pi_netmask broadcast $pi_broadcast dev $1
 }
 


From lede-commits at lists.infradead.org  Tue Jun 22 14:23:50 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 17:23:50 -0400
Subject: [openwrt/openwrt] kernel-5.4: backport latest patches for wireguard
In-Reply-To: <162439702782.8536.2242986543594845304@git-01.infra.openwrt.org>
References: <162439702782.8536.2242986543594845304@git-01.infra.openwrt.org>
Message-ID: <mailman.2297.1624397041.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/2a3b2f59fec10d7c08f90f019b310db418e775bf

commit 2a3b2f59fec10d7c08f90f019b310db418e775bf
Author: Jason A. Donenfeld <Jason at zx2c4.com>
AuthorDate: Sun Jun 6 12:37:53 2021 +0200

    kernel-5.4: backport latest patches for wireguard
    
    These are the latest patches that just landed upstream for 5.13, will be
    backported by Greg into 5.10 (because of stable@), and are now in the
    5.4 backport branch of wireguard: https://git.zx2c4.com/wireguard-linux/log/?h=backport-5.4.y
    
    Cc: Ilya Lipnitskiy <ilya.lipnitskiy at gmail.com>
    Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
    Tested-by: Stijn Segers <foss at volatilesystems.org>
---
 ...s-poly1305-enable-for-all-MIPS-processors.patch |  60 +++
 ...to-mips-add-poly1305-core.S-to-.gitignore.patch |  24 +
 ...1305-fix-poly1305_core_setkey-declaration.patch | 172 +++++++
 ...elftests-remove-old-conntrack-kconfig-val.patch |  29 ++
 ...elftests-make-sure-rp_filter-is-disabled-.patch |  31 ++
 ...80-wireguard-0129-wireguard-do-not-use-O3.patch |  33 ++
 ...se-synchronize_net-rather-than-synchroniz.patch |  66 +++
 ...131-wireguard-peer-allocate-in-kmem_cache.patch | 125 +++++
 ...llowedips-initialize-list-head-in-selftes.patch |  43 ++
 ...-wireguard-allowedips-remove-nodes-in-O-1.patch | 237 ++++++++++
 ...d-allowedips-allocate-nodes-in-kmem_cache.patch | 173 +++++++
 ...llowedips-free-empty-intermediate-nodes-w.patch | 521 +++++++++++++++++++++
 12 files changed, 1514 insertions(+)

diff --git a/target/linux/generic/backport-5.4/080-wireguard-0124-crypto-mips-poly1305-enable-for-all-MIPS-processors.patch b/target/linux/generic/backport-5.4/080-wireguard-0124-crypto-mips-poly1305-enable-for-all-MIPS-processors.patch
new file mode 100644
index 0000000000..c0ee841b02
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0124-crypto-mips-poly1305-enable-for-all-MIPS-processors.patch
@@ -0,0 +1,60 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Maciej W. Rozycki" <macro at orcam.me.uk>
+Date: Thu, 11 Mar 2021 21:50:47 -0700
+Subject: [PATCH] crypto: mips/poly1305 - enable for all MIPS processors
+
+commit 6c810cf20feef0d4338e9b424ab7f2644a8b353e upstream.
+
+The MIPS Poly1305 implementation is generic MIPS code written such as to
+support down to the original MIPS I and MIPS III ISA for the 32-bit and
+64-bit variant respectively.  Lift the current limitation then to enable
+code for MIPSr1 ISA or newer processors only and have it available for
+all MIPS processors.
+
+Signed-off-by: Maciej W. Rozycki <macro at orcam.me.uk>
+Fixes: a11d055e7a64 ("crypto: mips/poly1305 - incorporate OpenSSL/CRYPTOGAMS optimized implementation")
+Cc: stable at vger.kernel.org # v5.5+
+Acked-by: Jason A. Donenfeld <Jason at zx2c4.com>
+Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ arch/mips/crypto/Makefile | 4 ++--
+ crypto/Kconfig            | 2 +-
+ drivers/net/Kconfig       | 2 +-
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+--- a/arch/mips/crypto/Makefile
++++ b/arch/mips/crypto/Makefile
+@@ -12,8 +12,8 @@ AFLAGS_chacha-core.o += -O2 # needed to
+ obj-$(CONFIG_CRYPTO_POLY1305_MIPS) += poly1305-mips.o
+ poly1305-mips-y := poly1305-core.o poly1305-glue.o
+ 
+-perlasm-flavour-$(CONFIG_CPU_MIPS32) := o32
+-perlasm-flavour-$(CONFIG_CPU_MIPS64) := 64
++perlasm-flavour-$(CONFIG_32BIT) := o32
++perlasm-flavour-$(CONFIG_64BIT) := 64
+ 
+ quiet_cmd_perlasm = PERLASM $@
+       cmd_perlasm = $(PERL) $(<) $(perlasm-flavour-y) $(@)
+--- a/crypto/Kconfig
++++ b/crypto/Kconfig
+@@ -740,7 +740,7 @@ config CRYPTO_POLY1305_X86_64
+ 
+ config CRYPTO_POLY1305_MIPS
+ 	tristate "Poly1305 authenticator algorithm (MIPS optimized)"
+-	depends on CPU_MIPS32 || (CPU_MIPS64 && 64BIT)
++	depends on MIPS
+ 	select CRYPTO_ARCH_HAVE_LIB_POLY1305
+ 
+ config CRYPTO_MD4
+--- a/drivers/net/Kconfig
++++ b/drivers/net/Kconfig
+@@ -92,7 +92,7 @@ config WIREGUARD
+ 	select CRYPTO_POLY1305_ARM if ARM
+ 	select CRYPTO_CURVE25519_NEON if ARM && KERNEL_MODE_NEON
+ 	select CRYPTO_CHACHA_MIPS if CPU_MIPS32_R2
+-	select CRYPTO_POLY1305_MIPS if CPU_MIPS32 || (CPU_MIPS64 && 64BIT)
++	select CRYPTO_POLY1305_MIPS if MIPS
+ 	help
+ 	  WireGuard is a secure, fast, and easy to use replacement for IPSec
+ 	  that uses modern cryptography and clever networking tricks. It's
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0125-crypto-mips-add-poly1305-core.S-to-.gitignore.patch b/target/linux/generic/backport-5.4/080-wireguard-0125-crypto-mips-add-poly1305-core.S-to-.gitignore.patch
new file mode 100644
index 0000000000..856d67d5b8
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0125-crypto-mips-add-poly1305-core.S-to-.gitignore.patch
@@ -0,0 +1,24 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ilya Lipnitskiy <ilya.lipnitskiy at gmail.com>
+Date: Sat, 27 Mar 2021 19:39:43 -0700
+Subject: [PATCH] crypto: mips: add poly1305-core.S to .gitignore
+
+commit dc92d0df51dc61de88bf6f4884a17bf73d5c6326 upstream.
+
+poly1305-core.S is an auto-generated file, so it should be ignored.
+
+Fixes: a11d055e7a64 ("crypto: mips/poly1305 - incorporate OpenSSL/CRYPTOGAMS optimized implementation")
+Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy at gmail.com>
+Cc: Ard Biesheuvel <ardb at kernel.org>
+Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ arch/mips/crypto/.gitignore | 2 ++
+ 1 file changed, 2 insertions(+)
+ create mode 100644 arch/mips/crypto/.gitignore
+
+--- /dev/null
++++ b/arch/mips/crypto/.gitignore
+@@ -0,0 +1,2 @@
++# SPDX-License-Identifier: GPL-2.0-only
++poly1305-core.S
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0126-crypto-poly1305-fix-poly1305_core_setkey-declaration.patch b/target/linux/generic/backport-5.4/080-wireguard-0126-crypto-poly1305-fix-poly1305_core_setkey-declaration.patch
new file mode 100644
index 0000000000..ded6625aeb
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0126-crypto-poly1305-fix-poly1305_core_setkey-declaration.patch
@@ -0,0 +1,172 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd at arndb.de>
+Date: Mon, 22 Mar 2021 18:05:15 +0100
+Subject: [PATCH] crypto: poly1305 - fix poly1305_core_setkey() declaration
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+commit 8d195e7a8ada68928f2aedb2c18302a4518fe68e upstream.
+
+gcc-11 points out a mismatch between the declaration and the definition
+of poly1305_core_setkey():
+
+lib/crypto/poly1305-donna32.c:13:67: error: argument 2 of type ?const u8[16]? {aka ?const unsigned char[16]?} with mismatched bound [-Werror=array-parameter=]
+   13 | void poly1305_core_setkey(struct poly1305_core_key *key, const u8 raw_key[16])
+      |                                                          ~~~~~~~~~^~~~~~~~~~~
+In file included from lib/crypto/poly1305-donna32.c:11:
+include/crypto/internal/poly1305.h:21:68: note: previously declared as ?const u8 *? {aka ?const unsigned char *?}
+   21 | void poly1305_core_setkey(struct poly1305_core_key *key, const u8 *raw_key);
+
+This is harmless in principle, as the calling conventions are the same,
+but the more specific prototype allows better type checking in the
+caller.
+
+Change the declaration to match the actual function definition.
+The poly1305_simd_init() is a bit suspicious here, as it previously
+had a 32-byte argument type, but looks like it needs to take the
+16-byte POLY1305_BLOCK_SIZE array instead.
+
+Fixes: 1c08a104360f ("crypto: poly1305 - add new 32 and 64-bit generic versions")
+Signed-off-by: Arnd Bergmann <arnd at arndb.de>
+Reviewed-by: Ard Biesheuvel <ardb at kernel.org>
+Reviewed-by: Eric Biggers <ebiggers at google.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ arch/arm/crypto/poly1305-glue.c    | 2 +-
+ arch/arm64/crypto/poly1305-glue.c  | 2 +-
+ arch/mips/crypto/poly1305-glue.c   | 2 +-
+ arch/x86/crypto/poly1305_glue.c    | 6 +++---
+ include/crypto/internal/poly1305.h | 3 ++-
+ include/crypto/poly1305.h          | 6 ++++--
+ lib/crypto/poly1305-donna32.c      | 3 ++-
+ lib/crypto/poly1305-donna64.c      | 3 ++-
+ lib/crypto/poly1305.c              | 3 ++-
+ 9 files changed, 18 insertions(+), 12 deletions(-)
+
+--- a/arch/arm/crypto/poly1305-glue.c
++++ b/arch/arm/crypto/poly1305-glue.c
+@@ -29,7 +29,7 @@ void __weak poly1305_blocks_neon(void *s
+ 
+ static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_neon);
+ 
+-void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 *key)
++void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 key[POLY1305_KEY_SIZE])
+ {
+ 	poly1305_init_arm(&dctx->h, key);
+ 	dctx->s[0] = get_unaligned_le32(key + 16);
+--- a/arch/arm64/crypto/poly1305-glue.c
++++ b/arch/arm64/crypto/poly1305-glue.c
+@@ -25,7 +25,7 @@ asmlinkage void poly1305_emit(void *stat
+ 
+ static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_neon);
+ 
+-void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 *key)
++void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 key[POLY1305_KEY_SIZE])
+ {
+ 	poly1305_init_arm64(&dctx->h, key);
+ 	dctx->s[0] = get_unaligned_le32(key + 16);
+--- a/arch/mips/crypto/poly1305-glue.c
++++ b/arch/mips/crypto/poly1305-glue.c
+@@ -17,7 +17,7 @@ asmlinkage void poly1305_init_mips(void
+ asmlinkage void poly1305_blocks_mips(void *state, const u8 *src, u32 len, u32 hibit);
+ asmlinkage void poly1305_emit_mips(void *state, u8 *digest, const u32 *nonce);
+ 
+-void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 *key)
++void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 key[POLY1305_KEY_SIZE])
+ {
+ 	poly1305_init_mips(&dctx->h, key);
+ 	dctx->s[0] = get_unaligned_le32(key + 16);
+--- a/arch/x86/crypto/poly1305_glue.c
++++ b/arch/x86/crypto/poly1305_glue.c
+@@ -15,7 +15,7 @@
+ #include <asm/simd.h>
+ 
+ asmlinkage void poly1305_init_x86_64(void *ctx,
+-				     const u8 key[POLY1305_KEY_SIZE]);
++				     const u8 key[POLY1305_BLOCK_SIZE]);
+ asmlinkage void poly1305_blocks_x86_64(void *ctx, const u8 *inp,
+ 				       const size_t len, const u32 padbit);
+ asmlinkage void poly1305_emit_x86_64(void *ctx, u8 mac[POLY1305_DIGEST_SIZE],
+@@ -80,7 +80,7 @@ static void convert_to_base2_64(void *ct
+ 	state->is_base2_26 = 0;
+ }
+ 
+-static void poly1305_simd_init(void *ctx, const u8 key[POLY1305_KEY_SIZE])
++static void poly1305_simd_init(void *ctx, const u8 key[POLY1305_BLOCK_SIZE])
+ {
+ 	poly1305_init_x86_64(ctx, key);
+ }
+@@ -128,7 +128,7 @@ static void poly1305_simd_emit(void *ctx
+ 		poly1305_emit_avx(ctx, mac, nonce);
+ }
+ 
+-void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 *key)
++void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 key[POLY1305_KEY_SIZE])
+ {
+ 	poly1305_simd_init(&dctx->h, key);
+ 	dctx->s[0] = get_unaligned_le32(&key[16]);
+--- a/include/crypto/internal/poly1305.h
++++ b/include/crypto/internal/poly1305.h
+@@ -18,7 +18,8 @@
+  * only the ?-almost-?-universal hash function (not the full MAC) is computed.
+  */
+ 
+-void poly1305_core_setkey(struct poly1305_core_key *key, const u8 *raw_key);
++void poly1305_core_setkey(struct poly1305_core_key *key,
++			  const u8 raw_key[POLY1305_BLOCK_SIZE]);
+ static inline void poly1305_core_init(struct poly1305_state *state)
+ {
+ 	*state = (struct poly1305_state){};
+--- a/include/crypto/poly1305.h
++++ b/include/crypto/poly1305.h
+@@ -58,8 +58,10 @@ struct poly1305_desc_ctx {
+ 	};
+ };
+ 
+-void poly1305_init_arch(struct poly1305_desc_ctx *desc, const u8 *key);
+-void poly1305_init_generic(struct poly1305_desc_ctx *desc, const u8 *key);
++void poly1305_init_arch(struct poly1305_desc_ctx *desc,
++			const u8 key[POLY1305_KEY_SIZE]);
++void poly1305_init_generic(struct poly1305_desc_ctx *desc,
++			   const u8 key[POLY1305_KEY_SIZE]);
+ 
+ static inline void poly1305_init(struct poly1305_desc_ctx *desc, const u8 *key)
+ {
+--- a/lib/crypto/poly1305-donna32.c
++++ b/lib/crypto/poly1305-donna32.c
+@@ -10,7 +10,8 @@
+ #include <asm/unaligned.h>
+ #include <crypto/internal/poly1305.h>
+ 
+-void poly1305_core_setkey(struct poly1305_core_key *key, const u8 raw_key[16])
++void poly1305_core_setkey(struct poly1305_core_key *key,
++			  const u8 raw_key[POLY1305_BLOCK_SIZE])
+ {
+ 	/* r &= 0xffffffc0ffffffc0ffffffc0fffffff */
+ 	key->key.r[0] = (get_unaligned_le32(&raw_key[0])) & 0x3ffffff;
+--- a/lib/crypto/poly1305-donna64.c
++++ b/lib/crypto/poly1305-donna64.c
+@@ -12,7 +12,8 @@
+ 
+ typedef __uint128_t u128;
+ 
+-void poly1305_core_setkey(struct poly1305_core_key *key, const u8 raw_key[16])
++void poly1305_core_setkey(struct poly1305_core_key *key,
++			  const u8 raw_key[POLY1305_BLOCK_SIZE])
+ {
+ 	u64 t0, t1;
+ 
+--- a/lib/crypto/poly1305.c
++++ b/lib/crypto/poly1305.c
+@@ -12,7 +12,8 @@
+ #include <linux/module.h>
+ #include <asm/unaligned.h>
+ 
+-void poly1305_init_generic(struct poly1305_desc_ctx *desc, const u8 *key)
++void poly1305_init_generic(struct poly1305_desc_ctx *desc,
++			   const u8 key[POLY1305_KEY_SIZE])
+ {
+ 	poly1305_core_setkey(&desc->core_r, key);
+ 	desc->s[0] = get_unaligned_le32(key + 16);
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0127-wireguard-selftests-remove-old-conntrack-kconfig-val.patch b/target/linux/generic/backport-5.4/080-wireguard-0127-wireguard-selftests-remove-old-conntrack-kconfig-val.patch
new file mode 100644
index 0000000000..3e7d1a8e02
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0127-wireguard-selftests-remove-old-conntrack-kconfig-val.patch
@@ -0,0 +1,29 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason at zx2c4.com>
+Date: Fri, 4 Jun 2021 17:17:30 +0200
+Subject: [PATCH] wireguard: selftests: remove old conntrack kconfig value
+
+commit acf2492b51c9a3c4dfb947f4d3477a86d315150f upstream.
+
+On recent kernels, this config symbol is no longer used.
+
+Reported-by: Rui Salvaterra <rsalvaterra at gmail.com>
+Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
+Cc: stable at vger.kernel.org
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ tools/testing/selftests/wireguard/qemu/kernel.config | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/tools/testing/selftests/wireguard/qemu/kernel.config
++++ b/tools/testing/selftests/wireguard/qemu/kernel.config
+@@ -19,7 +19,6 @@ CONFIG_NETFILTER_XTABLES=y
+ CONFIG_NETFILTER_XT_NAT=y
+ CONFIG_NETFILTER_XT_MATCH_LENGTH=y
+ CONFIG_NETFILTER_XT_MARK=y
+-CONFIG_NF_CONNTRACK_IPV4=y
+ CONFIG_NF_NAT_IPV4=y
+ CONFIG_IP_NF_IPTABLES=y
+ CONFIG_IP_NF_FILTER=y
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0128-wireguard-selftests-make-sure-rp_filter-is-disabled-.patch b/target/linux/generic/backport-5.4/080-wireguard-0128-wireguard-selftests-make-sure-rp_filter-is-disabled-.patch
new file mode 100644
index 0000000000..22d0f3e32e
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0128-wireguard-selftests-make-sure-rp_filter-is-disabled-.patch
@@ -0,0 +1,31 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason at zx2c4.com>
+Date: Fri, 4 Jun 2021 17:17:31 +0200
+Subject: [PATCH] wireguard: selftests: make sure rp_filter is disabled on
+ vethc
+
+commit f8873d11d4121aad35024f9379e431e0c83abead upstream.
+
+Some distros may enable strict rp_filter by default, which will prevent
+vethc from receiving the packets with an unrouteable reverse path address.
+
+Reported-by: Hangbin Liu <liuhangbin at gmail.com>
+Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
+Cc: stable at vger.kernel.org
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ tools/testing/selftests/wireguard/netns.sh | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/tools/testing/selftests/wireguard/netns.sh
++++ b/tools/testing/selftests/wireguard/netns.sh
+@@ -363,6 +363,7 @@ ip1 -6 rule add table main suppress_pref
+ ip1 -4 route add default dev wg0 table 51820
+ ip1 -4 rule add not fwmark 51820 table 51820
+ ip1 -4 rule add table main suppress_prefixlength 0
++n1 bash -c 'printf 0 > /proc/sys/net/ipv4/conf/vethc/rp_filter'
+ # Flood the pings instead of sending just one, to trigger routing table reference counting bugs.
+ n1 ping -W 1 -c 100 -f 192.168.99.7
+ n1 ping -W 1 -c 100 -f abab::1111
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0129-wireguard-do-not-use-O3.patch b/target/linux/generic/backport-5.4/080-wireguard-0129-wireguard-do-not-use-O3.patch
new file mode 100644
index 0000000000..a7890a7384
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0129-wireguard-do-not-use-O3.patch
@@ -0,0 +1,33 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason at zx2c4.com>
+Date: Fri, 4 Jun 2021 17:17:32 +0200
+Subject: [PATCH] wireguard: do not use -O3
+
+commit cc5060ca0285efe2728bced399a1955a7ce808b2 upstream.
+
+Apparently, various versions of gcc have O3-related miscompiles. Looking
+at the difference between -O2 and -O3 for gcc 11 doesn't indicate
+miscompiles, but the difference also doesn't seem so significant for
+performance that it's worth risking.
+
+Link: https://lore.kernel.org/lkml/CAHk-=wjuoGyxDhAF8SsrTkN0-YfCx7E6jUN3ikC_tn2AKWTTsA at mail.gmail.com/
+Link: https://lore.kernel.org/lkml/CAHmME9otB5Wwxp7H8bR_i2uH2esEMvoBMC8uEXBMH9p0q1s6Bw at mail.gmail.com/
+Reported-by: Linus Torvalds <torvalds at linux-foundation.org>
+Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
+Cc: stable at vger.kernel.org
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ drivers/net/wireguard/Makefile | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/net/wireguard/Makefile
++++ b/drivers/net/wireguard/Makefile
+@@ -1,5 +1,4 @@
+-ccflags-y := -O3
+-ccflags-y += -D'pr_fmt(fmt)=KBUILD_MODNAME ": " fmt'
++ccflags-y := -D'pr_fmt(fmt)=KBUILD_MODNAME ": " fmt'
+ ccflags-$(CONFIG_WIREGUARD_DEBUG) += -DDEBUG
+ wireguard-y := main.o
+ wireguard-y += noise.o
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0130-wireguard-use-synchronize_net-rather-than-synchroniz.patch b/target/linux/generic/backport-5.4/080-wireguard-0130-wireguard-use-synchronize_net-rather-than-synchroniz.patch
new file mode 100644
index 0000000000..309fe36198
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0130-wireguard-use-synchronize_net-rather-than-synchroniz.patch
@@ -0,0 +1,66 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason at zx2c4.com>
+Date: Fri, 4 Jun 2021 17:17:33 +0200
+Subject: [PATCH] wireguard: use synchronize_net rather than synchronize_rcu
+
+commit 24b70eeeb4f46c09487f8155239ebfb1f875774a upstream.
+
+Many of the synchronization points are sometimes called under the rtnl
+lock, which means we should use synchronize_net rather than
+synchronize_rcu. Under the hood, this expands to using the expedited
+flavor of function in the event that rtnl is held, in order to not stall
+other concurrent changes.
+
+This fixes some very, very long delays when removing multiple peers at
+once, which would cause some operations to take several minutes.
+
+Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
+Cc: stable at vger.kernel.org
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ drivers/net/wireguard/peer.c   | 6 +++---
+ drivers/net/wireguard/socket.c | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/wireguard/peer.c
++++ b/drivers/net/wireguard/peer.c
+@@ -88,7 +88,7 @@ static void peer_make_dead(struct wg_pee
+ 	/* Mark as dead, so that we don't allow jumping contexts after. */
+ 	WRITE_ONCE(peer->is_dead, true);
+ 
+-	/* The caller must now synchronize_rcu() for this to take effect. */
++	/* The caller must now synchronize_net() for this to take effect. */
+ }
+ 
+ static void peer_remove_after_dead(struct wg_peer *peer)
+@@ -160,7 +160,7 @@ void wg_peer_remove(struct wg_peer *peer
+ 	lockdep_assert_held(&peer->device->device_update_lock);
+ 
+ 	peer_make_dead(peer);
+-	synchronize_rcu();
++	synchronize_net();
+ 	peer_remove_after_dead(peer);
+ }
+ 
+@@ -178,7 +178,7 @@ void wg_peer_remove_all(struct wg_device
+ 		peer_make_dead(peer);
+ 		list_add_tail(&peer->peer_list, &dead_peers);
+ 	}
+-	synchronize_rcu();
++	synchronize_net();
+ 	list_for_each_entry_safe(peer, temp, &dead_peers, peer_list)
+ 		peer_remove_after_dead(peer);
+ }
+--- a/drivers/net/wireguard/socket.c
++++ b/drivers/net/wireguard/socket.c
+@@ -430,7 +430,7 @@ void wg_socket_reinit(struct wg_device *
+ 	if (new4)
+ 		wg->incoming_port = ntohs(inet_sk(new4)->inet_sport);
+ 	mutex_unlock(&wg->socket_update_lock);
+-	synchronize_rcu();
++	synchronize_net();
+ 	sock_free(old4);
+ 	sock_free(old6);
+ }
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0131-wireguard-peer-allocate-in-kmem_cache.patch b/target/linux/generic/backport-5.4/080-wireguard-0131-wireguard-peer-allocate-in-kmem_cache.patch
new file mode 100644
index 0000000000..32ae327037
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0131-wireguard-peer-allocate-in-kmem_cache.patch
@@ -0,0 +1,125 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason at zx2c4.com>
+Date: Fri, 4 Jun 2021 17:17:34 +0200
+Subject: [PATCH] wireguard: peer: allocate in kmem_cache
+
+commit a4e9f8e3287c9eb6bf70df982870980dd3341863 upstream.
+
+With deployments having upwards of 600k peers now, this somewhat heavy
+structure could benefit from more fine-grained allocations.
+Specifically, instead of using a 2048-byte slab for a 1544-byte object,
+we can now use 1544-byte objects directly, thus saving almost 25%
+per-peer, or with 600k peers, that's a savings of 303 MiB. This also
+makes wireguard's memory usage more transparent in tools like slabtop
+and /proc/slabinfo.
+
+Fixes: 8b5553ace83c ("wireguard: queueing: get rid of per-peer ring buffers")
+Suggested-by: Arnd Bergmann <arnd at arndb.de>
+Suggested-by: Matthew Wilcox <willy at infradead.org>
+Cc: stable at vger.kernel.org
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ drivers/net/wireguard/main.c |  7 +++++++
+ drivers/net/wireguard/peer.c | 21 +++++++++++++++++----
+ drivers/net/wireguard/peer.h |  3 +++
+ 3 files changed, 27 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/wireguard/main.c
++++ b/drivers/net/wireguard/main.c
+@@ -28,6 +28,10 @@ static int __init mod_init(void)
+ #endif
+ 	wg_noise_init();
+ 
++	ret = wg_peer_init();
++	if (ret < 0)
++		goto err_peer;
++
+ 	ret = wg_device_init();
+ 	if (ret < 0)
+ 		goto err_device;
+@@ -44,6 +48,8 @@ static int __init mod_init(void)
+ err_netlink:
+ 	wg_device_uninit();
+ err_device:
++	wg_peer_uninit();
++err_peer:
+ 	return ret;
+ }
+ 
+@@ -51,6 +57,7 @@ static void __exit mod_exit(void)
+ {
+ 	wg_genetlink_uninit();
+ 	wg_device_uninit();
++	wg_peer_uninit();
+ }
+ 
+ module_init(mod_init);
+--- a/drivers/net/wireguard/peer.c
++++ b/drivers/net/wireguard/peer.c
+@@ -15,6 +15,7 @@
+ #include <linux/rcupdate.h>
+ #include <linux/list.h>
+ 
++static struct kmem_cache *peer_cache;
+ static atomic64_t peer_counter = ATOMIC64_INIT(0);
+ 
+ struct wg_peer *wg_peer_create(struct wg_device *wg,
+@@ -29,10 +30,10 @@ struct wg_peer *wg_peer_create(struct wg
+ 	if (wg->num_peers >= MAX_PEERS_PER_DEVICE)
+ 		return ERR_PTR(ret);
+ 
+-	peer = kzalloc(sizeof(*peer), GFP_KERNEL);
++	peer = kmem_cache_zalloc(peer_cache, GFP_KERNEL);
+ 	if (unlikely(!peer))
+ 		return ERR_PTR(ret);
+-	if (dst_cache_init(&peer->endpoint_cache, GFP_KERNEL))
++	if (unlikely(dst_cache_init(&peer->endpoint_cache, GFP_KERNEL)))
+ 		goto err;
+ 
+ 	peer->device = wg;
+@@ -64,7 +65,7 @@ struct wg_peer *wg_peer_create(struct wg
+ 	return peer;
+ 
+ err:
+-	kfree(peer);
++	kmem_cache_free(peer_cache, peer);
+ 	return ERR_PTR(ret);
+ }
+ 
+@@ -193,7 +194,8 @@ static void rcu_release(struct rcu_head
+ 	/* The final zeroing takes care of clearing any remaining handshake key
+ 	 * material and other potentially sensitive information.
+ 	 */
+-	kzfree(peer);
++	memzero_explicit(peer, sizeof(*peer));
++	kmem_cache_free(peer_cache, peer);
+ }
+ 
+ static void kref_release(struct kref *refcount)
+@@ -225,3 +227,14 @@ void wg_peer_put(struct wg_peer *peer)
+ 		return;
+ 	kref_put(&peer->refcount, kref_release);
+ }
++
++int __init wg_peer_init(void)
++{
++	peer_cache = KMEM_CACHE(wg_peer, 0);
++	return peer_cache ? 0 : -ENOMEM;
++}
++
++void wg_peer_uninit(void)
++{
++	kmem_cache_destroy(peer_cache);
++}
+--- a/drivers/net/wireguard/peer.h
++++ b/drivers/net/wireguard/peer.h
+@@ -80,4 +80,7 @@ void wg_peer_put(struct wg_peer *peer);
+ void wg_peer_remove(struct wg_peer *peer);
+ void wg_peer_remove_all(struct wg_device *wg);
+ 
++int wg_peer_init(void);
++void wg_peer_uninit(void);
++
+ #endif /* _WG_PEER_H */
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0132-wireguard-allowedips-initialize-list-head-in-selftes.patch b/target/linux/generic/backport-5.4/080-wireguard-0132-wireguard-allowedips-initialize-list-head-in-selftes.patch
new file mode 100644
index 0000000000..ce4e5dcf50
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0132-wireguard-allowedips-initialize-list-head-in-selftes.patch
@@ -0,0 +1,43 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason at zx2c4.com>
+Date: Fri, 4 Jun 2021 17:17:35 +0200
+Subject: [PATCH] wireguard: allowedips: initialize list head in selftest
+
+commit 46cfe8eee285cde465b420637507884551f5d7ca upstream.
+
+The randomized trie tests weren't initializing the dummy peer list head,
+resulting in a NULL pointer dereference when used. Fix this by
+initializing it in the randomized trie test, just like we do for the
+static unit test.
+
+While we're at it, all of the other strings like this have the word
+"self-test", so add it to the missing place here.
+
+Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
+Cc: stable at vger.kernel.org
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ drivers/net/wireguard/selftest/allowedips.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireguard/selftest/allowedips.c
++++ b/drivers/net/wireguard/selftest/allowedips.c
+@@ -296,6 +296,7 @@ static __init bool randomized_test(void)
+ 			goto free;
+ 		}
+ 		kref_init(&peers[i]->refcount);
++		INIT_LIST_HEAD(&peers[i]->allowedips_list);
+ 	}
+ 
+ 	mutex_lock(&mutex);
+@@ -333,7 +334,7 @@ static __init bool randomized_test(void)
+ 			if (wg_allowedips_insert_v4(&t,
+ 						    (struct in_addr *)mutated,
+ 						    cidr, peer, &mutex) < 0) {
+-				pr_err("allowedips random malloc: FAIL\n");
++				pr_err("allowedips random self-test malloc: FAIL\n");
+ 				goto free_locked;
+ 			}
+ 			if (horrible_allowedips_insert_v4(&h,
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0133-wireguard-allowedips-remove-nodes-in-O-1.patch b/target/linux/generic/backport-5.4/080-wireguard-0133-wireguard-allowedips-remove-nodes-in-O-1.patch
new file mode 100644
index 0000000000..78da24ea46
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0133-wireguard-allowedips-remove-nodes-in-O-1.patch
@@ -0,0 +1,237 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason at zx2c4.com>
+Date: Fri, 4 Jun 2021 17:17:36 +0200
+Subject: [PATCH] wireguard: allowedips: remove nodes in O(1)
+
+commit f634f418c227c912e7ea95a3299efdc9b10e4022 upstream.
+
+Previously, deleting peers would require traversing the entire trie in
+order to rebalance nodes and safely free them. This meant that removing
+1000 peers from a trie with a half million nodes would take an extremely
+long time, during which we're holding the rtnl lock. Large-scale users
+were reporting 200ms latencies added to the networking stack as a whole
+every time their userspace software would queue up significant removals.
+That's a serious situation.
+
+This commit fixes that by maintaining a double pointer to the parent's
+bit pointer for each node, and then using the already existing node list
+belonging to each peer to go directly to the node, fix up its pointers,
+and free it with RCU. This means removal is O(1) instead of O(n), and we
+don't use gobs of stack.
+
+The removal algorithm has the same downside as the code that it fixes:
+it won't collapse needlessly long runs of fillers.  We can enhance that
+in the future if it ever becomes a problem. This commit documents that
+limitation with a TODO comment in code, a small but meaningful
+improvement over the prior situation.
+
+Currently the biggest flaw, which the next commit addresses, is that
+because this increases the node size on 64-bit machines from 60 bytes to
+68 bytes. 60 rounds up to 64, but 68 rounds up to 128. So we wind up
+using twice as much memory per node, because of power-of-two
+allocations, which is a big bummer. We'll need to figure something out
+there.
+
+Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
+Cc: stable at vger.kernel.org
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ drivers/net/wireguard/allowedips.c | 132 ++++++++++++-----------------
+ drivers/net/wireguard/allowedips.h |   9 +-
+ 2 files changed, 57 insertions(+), 84 deletions(-)
+
+--- a/drivers/net/wireguard/allowedips.c
++++ b/drivers/net/wireguard/allowedips.c
+@@ -66,60 +66,6 @@ static void root_remove_peer_lists(struc
+ 	}
+ }
+ 
+-static void walk_remove_by_peer(struct allowedips_node __rcu **top,
+-				struct wg_peer *peer, struct mutex *lock)
+-{
+-#define REF(p) rcu_access_pointer(p)
+-#define DEREF(p) rcu_dereference_protected(*(p), lockdep_is_held(lock))
+-#define PUSH(p) ({                                                             \
+-		WARN_ON(IS_ENABLED(DEBUG) && len >= 128);                      \
+-		stack[len++] = p;                                              \
+-	})
+-
+-	struct allowedips_node __rcu **stack[128], **nptr;
+-	struct allowedips_node *node, *prev;
+-	unsigned int len;
+-
+-	if (unlikely(!peer || !REF(*top)))
+-		return;
+-
+-	for (prev = NULL, len = 0, PUSH(top); len > 0; prev = node) {
+-		nptr = stack[len - 1];
+-		node = DEREF(nptr);
+-		if (!node) {
+-			--len;
+-			continue;
+-		}
+-		if (!prev || REF(prev->bit[0]) == node ||
+-		    REF(prev->bit[1]) == node) {
+-			if (REF(node->bit[0]))
+-				PUSH(&node->bit[0]);
+-			else if (REF(node->bit[1]))
+-				PUSH(&node->bit[1]);
+-		} else if (REF(node->bit[0]) == prev) {
+-			if (REF(node->bit[1]))
+-				PUSH(&node->bit[1]);
+-		} else {
+-			if (rcu_dereference_protected(node->peer,
+-				lockdep_is_held(lock)) == peer) {
+-				RCU_INIT_POINTER(node->peer, NULL);
+-				list_del_init(&node->peer_list);
+-				if (!node->bit[0] || !node->bit[1]) {
+-					rcu_assign_pointer(*nptr, DEREF(
+-					       &node->bit[!REF(node->bit[0])]));
+-					kfree_rcu(node, rcu);
+-					node = DEREF(nptr);
+-				}
+-			}
+-			--len;
+-		}
+-	}
+-
+-#undef REF
+-#undef DEREF
+-#undef PUSH
+-}
+-
+ static unsigned int fls128(u64 a, u64 b)
+ {
+ 	return a ? fls64(a) + 64U : fls64(b);
+@@ -224,6 +170,7 @@ static int add(struct allowedips_node __
+ 		RCU_INIT_POINTER(node->peer, peer);
+ 		list_add_tail(&node->peer_list, &peer->allowedips_list);
+ 		copy_and_assign_cidr(node, key, cidr, bits);
++		rcu_assign_pointer(node->parent_bit, trie);
+ 		rcu_assign_pointer(*trie, node);
+ 		return 0;
+ 	}
+@@ -243,9 +190,9 @@ static int add(struct allowedips_node __
+ 	if (!node) {
+ 		down = rcu_dereference_protected(*trie, lockdep_is_held(lock));
+ 	} else {
+-		down = rcu_dereference_protected(CHOOSE_NODE(node, key),
+-						 lockdep_is_held(lock));
++		down = rcu_dereference_protected(CHOOSE_NODE(node, key), lockdep_is_held(lock));
+ 		if (!down) {
++			rcu_assign_pointer(newnode->parent_bit, &CHOOSE_NODE(node, key));
+ 			rcu_assign_pointer(CHOOSE_NODE(node, key), newnode);
+ 			return 0;
+ 		}
+@@ -254,29 +201,37 @@ static int add(struct allowedips_node __
+ 	parent = node;
+ 
+ 	if (newnode->cidr == cidr) {
++		rcu_assign_pointer(down->parent_bit, &CHOOSE_NODE(newnode, down->bits));
+ 		rcu_assign_pointer(CHOOSE_NODE(newnode, down->bits), down);
+-		if (!parent)
++		if (!parent) {
++			rcu_assign_pointer(newnode->parent_bit, trie);
+ 			rcu_assign_pointer(*trie, newnode);
+-		else
+-			rcu_assign_pointer(CHOOSE_NODE(parent, newnode->bits),
+-					   newnode);
+-	} else {
+-		node = kzalloc(sizeof(*node), GFP_KERNEL);
+-		if (unlikely(!node)) {
+-			list_del(&newnode->peer_list);
+-			kfree(newnode);
+-			return -ENOMEM;
++		} else {
++			rcu_assign_pointer(newnode->parent_bit, &CHOOSE_NODE(parent, newnode->bits));
++			rcu_assign_pointer(CHOOSE_NODE(parent, newnode->bits), newnode);
+ 		}
+-		INIT_LIST_HEAD(&node->peer_list);
+-		copy_and_assign_cidr(node, newnode->bits, cidr, bits);
++		return 0;
++	}
++
++	node = kzalloc(sizeof(*node), GFP_KERNEL);
++	if (unlikely(!node)) {
++		list_del(&newnode->peer_list);
++		kfree(newnode);
++		return -ENOMEM;
++	}
++	INIT_LIST_HEAD(&node->peer_list);
++	copy_and_assign_cidr(node, newnode->bits, cidr, bits);
+ 
+-		rcu_assign_pointer(CHOOSE_NODE(node, down->bits), down);
+-		rcu_assign_pointer(CHOOSE_NODE(node, newnode->bits), newnode);
+-		if (!parent)
+-			rcu_assign_pointer(*trie, node);
+-		else
+-			rcu_assign_pointer(CHOOSE_NODE(parent, node->bits),
+-					   node);
++	rcu_assign_pointer(down->parent_bit, &CHOOSE_NODE(node, down->bits));
++	rcu_assign_pointer(CHOOSE_NODE(node, down->bits), down);
++	rcu_assign_pointer(newnode->parent_bit, &CHOOSE_NODE(node, newnode->bits));
++	rcu_assign_pointer(CHOOSE_NODE(node, newnode->bits), newnode);
++	if (!parent) {
++		rcu_assign_pointer(node->parent_bit, trie);
++		rcu_assign_pointer(*trie, node);
++	} else {
++		rcu_assign_pointer(node->parent_bit, &CHOOSE_NODE(parent, node->bits));
++		rcu_assign_pointer(CHOOSE_NODE(parent, node->bits), node);
+ 	}
+ 	return 0;
+ }
+@@ -335,9 +290,30 @@ int wg_allowedips_insert_v6(struct allow
+ void wg_allowedips_remove_by_peer(struct allowedips *table,
+ 				  struct wg_peer *peer, struct mutex *lock)
+ {
++	struct allowedips_node *node, *child, *tmp;
++
++	if (list_empty(&peer->allowedips_list))
++		return;
+ 	++table->seq;
+-	walk_remove_by_peer(&table->root4, peer, lock);
+-	walk_remove_by_peer(&table->root6, peer, lock);
++	list_for_each_entry_safe(node, tmp, &peer->allowedips_list, peer_list) {
++		list_del_init(&node->peer_list);
++		RCU_INIT_POINTER(node->peer, NULL);
++		if (node->bit[0] && node->bit[1])
++			continue;
++		child = rcu_dereference_protected(
++				node->bit[!rcu_access_pointer(node->bit[0])],
++				lockdep_is_held(lock));
++		if (child)
++			child->parent_bit = node->parent_bit;
++		*rcu_dereference_protected(node->parent_bit, lockdep_is_held(lock)) = child;
++		kfree_rcu(node, rcu);
++
++		/* TODO: Note that we currently don't walk up and down in order to
++		 * free any potential filler nodes. This means that this function
++		 * doesn't free up as much as it could, which could be revisited
++		 * at some point.
++		 */
++	}
+ }
+ 
+ int wg_allowedips_read_node(struct allowedips_node *node, u8 ip[16], u8 *cidr)
+--- a/drivers/net/wireguard/allowedips.h
++++ b/drivers/net/wireguard/allowedips.h
+@@ -15,14 +15,11 @@ struct wg_peer;
+ struct allowedips_node {
+ 	struct wg_peer __rcu *peer;
+ 	struct allowedips_node __rcu *bit[2];
+-	/* While it may seem scandalous that we waste space for v4,
+-	 * we're alloc'ing to the nearest power of 2 anyway, so this
+-	 * doesn't actually make a difference.
+-	 */
+-	u8 bits[16] __aligned(__alignof(u64));
+ 	u8 cidr, bit_at_a, bit_at_b, bitlen;
++	u8 bits[16] __aligned(__alignof(u64));
+ 
+-	/* Keep rarely used list at bottom to be beyond cache line. */
++	/* Keep rarely used members at bottom to be beyond cache line. */
++	struct allowedips_node *__rcu *parent_bit; /* XXX: this puts us at 68->128 bytes instead of 60->64 bytes!! */
+ 	union {
+ 		struct list_head peer_list;
+ 		struct rcu_head rcu;
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0134-wireguard-allowedips-allocate-nodes-in-kmem_cache.patch b/target/linux/generic/backport-5.4/080-wireguard-0134-wireguard-allowedips-allocate-nodes-in-kmem_cache.patch
new file mode 100644
index 0000000000..65b31b05f5
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0134-wireguard-allowedips-allocate-nodes-in-kmem_cache.patch
@@ -0,0 +1,173 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason at zx2c4.com>
+Date: Fri, 4 Jun 2021 17:17:37 +0200
+Subject: [PATCH] wireguard: allowedips: allocate nodes in kmem_cache
+
+commit dc680de28ca849dfe589dc15ac56d22505f0ef11 upstream.
+
+The previous commit moved from O(n) to O(1) for removal, but in the
+process introduced an additional pointer member to a struct that
+increased the size from 60 to 68 bytes, putting nodes in the 128-byte
+slab. With deployed systems having as many as 2 million nodes, this
+represents a significant doubling in memory usage (128 MiB -> 256 MiB).
+Fix this by using our own kmem_cache, that's sized exactly right. This
+also makes wireguard's memory usage more transparent in tools like
+slabtop and /proc/slabinfo.
+
+Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
+Suggested-by: Arnd Bergmann <arnd at arndb.de>
+Suggested-by: Matthew Wilcox <willy at infradead.org>
+Cc: stable at vger.kernel.org
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ drivers/net/wireguard/allowedips.c | 31 ++++++++++++++++++++++++------
+ drivers/net/wireguard/allowedips.h |  5 ++++-
+ drivers/net/wireguard/main.c       | 10 +++++++++-
+ 3 files changed, 38 insertions(+), 8 deletions(-)
+
+--- a/drivers/net/wireguard/allowedips.c
++++ b/drivers/net/wireguard/allowedips.c
+@@ -6,6 +6,8 @@
+ #include "allowedips.h"
+ #include "peer.h"
+ 
++static struct kmem_cache *node_cache;
++
+ static void swap_endian(u8 *dst, const u8 *src, u8 bits)
+ {
+ 	if (bits == 32) {
+@@ -40,6 +42,11 @@ static void push_rcu(struct allowedips_n
+ 	}
+ }
+ 
++static void node_free_rcu(struct rcu_head *rcu)
++{
++	kmem_cache_free(node_cache, container_of(rcu, struct allowedips_node, rcu));
++}
++
+ static void root_free_rcu(struct rcu_head *rcu)
+ {
+ 	struct allowedips_node *node, *stack[128] = {
+@@ -49,7 +56,7 @@ static void root_free_rcu(struct rcu_hea
+ 	while (len > 0 && (node = stack[--len])) {
+ 		push_rcu(stack, node->bit[0], &len);
+ 		push_rcu(stack, node->bit[1], &len);
+-		kfree(node);
++		kmem_cache_free(node_cache, node);
+ 	}
+ }
+ 
+@@ -164,7 +171,7 @@ static int add(struct allowedips_node __
+ 		return -EINVAL;
+ 
+ 	if (!rcu_access_pointer(*trie)) {
+-		node = kzalloc(sizeof(*node), GFP_KERNEL);
++		node = kmem_cache_zalloc(node_cache, GFP_KERNEL);
+ 		if (unlikely(!node))
+ 			return -ENOMEM;
+ 		RCU_INIT_POINTER(node->peer, peer);
+@@ -180,7 +187,7 @@ static int add(struct allowedips_node __
+ 		return 0;
+ 	}
+ 
+-	newnode = kzalloc(sizeof(*newnode), GFP_KERNEL);
++	newnode = kmem_cache_zalloc(node_cache, GFP_KERNEL);
+ 	if (unlikely(!newnode))
+ 		return -ENOMEM;
+ 	RCU_INIT_POINTER(newnode->peer, peer);
+@@ -213,10 +220,10 @@ static int add(struct allowedips_node __
+ 		return 0;
+ 	}
+ 
+-	node = kzalloc(sizeof(*node), GFP_KERNEL);
++	node = kmem_cache_zalloc(node_cache, GFP_KERNEL);
+ 	if (unlikely(!node)) {
+ 		list_del(&newnode->peer_list);
+-		kfree(newnode);
++		kmem_cache_free(node_cache, newnode);
+ 		return -ENOMEM;
+ 	}
+ 	INIT_LIST_HEAD(&node->peer_list);
+@@ -306,7 +313,7 @@ void wg_allowedips_remove_by_peer(struct
+ 		if (child)
+ 			child->parent_bit = node->parent_bit;
+ 		*rcu_dereference_protected(node->parent_bit, lockdep_is_held(lock)) = child;
+-		kfree_rcu(node, rcu);
++		call_rcu(&node->rcu, node_free_rcu);
+ 
+ 		/* TODO: Note that we currently don't walk up and down in order to
+ 		 * free any potential filler nodes. This means that this function
+@@ -350,4 +357,16 @@ struct wg_peer *wg_allowedips_lookup_src
+ 	return NULL;
+ }
+ 
++int __init wg_allowedips_slab_init(void)
++{
++	node_cache = KMEM_CACHE(allowedips_node, 0);
++	return node_cache ? 0 : -ENOMEM;
++}
++
++void wg_allowedips_slab_uninit(void)
++{
++	rcu_barrier();
++	kmem_cache_destroy(node_cache);
++}
++
+ #include "selftest/allowedips.c"
+--- a/drivers/net/wireguard/allowedips.h
++++ b/drivers/net/wireguard/allowedips.h
+@@ -19,7 +19,7 @@ struct allowedips_node {
+ 	u8 bits[16] __aligned(__alignof(u64));
+ 
+ 	/* Keep rarely used members at bottom to be beyond cache line. */
+-	struct allowedips_node *__rcu *parent_bit; /* XXX: this puts us at 68->128 bytes instead of 60->64 bytes!! */
++	struct allowedips_node *__rcu *parent_bit;
+ 	union {
+ 		struct list_head peer_list;
+ 		struct rcu_head rcu;
+@@ -53,4 +53,7 @@ struct wg_peer *wg_allowedips_lookup_src
+ bool wg_allowedips_selftest(void);
+ #endif
+ 
++int wg_allowedips_slab_init(void);
++void wg_allowedips_slab_uninit(void);
++
+ #endif /* _WG_ALLOWEDIPS_H */
+--- a/drivers/net/wireguard/main.c
++++ b/drivers/net/wireguard/main.c
+@@ -21,10 +21,15 @@ static int __init mod_init(void)
+ {
+ 	int ret;
+ 
++	ret = wg_allowedips_slab_init();
++	if (ret < 0)
++		goto err_allowedips;
++
+ #ifdef DEBUG
++	ret = -ENOTRECOVERABLE;
+ 	if (!wg_allowedips_selftest() || !wg_packet_counter_selftest() ||
+ 	    !wg_ratelimiter_selftest())
+-		return -ENOTRECOVERABLE;
++		goto err_peer;
+ #endif
+ 	wg_noise_init();
+ 
+@@ -50,6 +55,8 @@ err_netlink:
+ err_device:
+ 	wg_peer_uninit();
+ err_peer:
++	wg_allowedips_slab_uninit();
++err_allowedips:
+ 	return ret;
+ }
+ 
+@@ -58,6 +65,7 @@ static void __exit mod_exit(void)
+ 	wg_genetlink_uninit();
+ 	wg_device_uninit();
+ 	wg_peer_uninit();
++	wg_allowedips_slab_uninit();
+ }
+ 
+ module_init(mod_init);
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0135-wireguard-allowedips-free-empty-intermediate-nodes-w.patch b/target/linux/generic/backport-5.4/080-wireguard-0135-wireguard-allowedips-free-empty-intermediate-nodes-w.patch
new file mode 100644
index 0000000000..c044ad25af
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0135-wireguard-allowedips-free-empty-intermediate-nodes-w.patch
@@ -0,0 +1,521 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason at zx2c4.com>
+Date: Fri, 4 Jun 2021 17:17:38 +0200
+Subject: [PATCH] wireguard: allowedips: free empty intermediate nodes when
+ removing single node
+
+commit bf7b042dc62a31f66d3a41dd4dfc7806f267b307 upstream.
+
+When removing single nodes, it's possible that that node's parent is an
+empty intermediate node, in which case, it too should be removed.
+Otherwise the trie fills up and never is fully emptied, leading to
+gradual memory leaks over time for tries that are modified often. There
+was originally code to do this, but was removed during refactoring in
+2016 and never reworked. Now that we have proper parent pointers from
+the previous commits, we can implement this properly.
+
+In order to reduce branching and expensive comparisons, we want to keep
+the double pointer for parent assignment (which lets us easily chain up
+to the root), but we still need to actually get the parent's base
+address. So encode the bit number into the last two bits of the pointer,
+and pack and unpack it as needed. This is a little bit clumsy but is the
+fastest and less memory wasteful of the compromises. Note that we align
+the root struct here to a minimum of 4, because it's embedded into a
+larger struct, and we're relying on having the bottom two bits for our
+flag, which would only be 16-bit aligned on m68k.
+
+The existing macro-based helpers were a bit unwieldy for adding the bit
+packing to, so this commit replaces them with safer and clearer ordinary
+functions.
+
+We add a test to the randomized/fuzzer part of the selftests, to free
+the randomized tries by-peer, refuzz it, and repeat, until it's supposed
+to be empty, and then then see if that actually resulted in the whole
+thing being emptied. That combined with kmemcheck should hopefully make
+sure this commit is doing what it should. Along the way this resulted in
+various other cleanups of the tests and fixes for recent graphviz.
+
+Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
+Cc: stable at vger.kernel.org
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ drivers/net/wireguard/allowedips.c          | 102 ++++++------
+ drivers/net/wireguard/allowedips.h          |   4 +-
+ drivers/net/wireguard/selftest/allowedips.c | 162 ++++++++++----------
+ 3 files changed, 137 insertions(+), 131 deletions(-)
+
+--- a/drivers/net/wireguard/allowedips.c
++++ b/drivers/net/wireguard/allowedips.c
+@@ -30,8 +30,11 @@ static void copy_and_assign_cidr(struct
+ 	node->bitlen = bits;
+ 	memcpy(node->bits, src, bits / 8U);
+ }
+-#define CHOOSE_NODE(parent, key) \
+-	parent->bit[(key[parent->bit_at_a] >> parent->bit_at_b) & 1]
++
++static inline u8 choose(struct allowedips_node *node, const u8 *key)
++{
++	return (key[node->bit_at_a] >> node->bit_at_b) & 1;
++}
+ 
+ static void push_rcu(struct allowedips_node **stack,
+ 		     struct allowedips_node __rcu *p, unsigned int *len)
+@@ -112,7 +115,7 @@ static struct allowedips_node *find_node
+ 			found = node;
+ 		if (node->cidr == bits)
+ 			break;
+-		node = rcu_dereference_bh(CHOOSE_NODE(node, key));
++		node = rcu_dereference_bh(node->bit[choose(node, key)]);
+ 	}
+ 	return found;
+ }
+@@ -144,8 +147,7 @@ static bool node_placement(struct allowe
+ 			   u8 cidr, u8 bits, struct allowedips_node **rnode,
+ 			   struct mutex *lock)
+ {
+-	struct allowedips_node *node = rcu_dereference_protected(trie,
+-						lockdep_is_held(lock));
++	struct allowedips_node *node = rcu_dereference_protected(trie, lockdep_is_held(lock));
+ 	struct allowedips_node *parent = NULL;
+ 	bool exact = false;
+ 
+@@ -155,13 +157,24 @@ static bool node_placement(struct allowe
+ 			exact = true;
+ 			break;
+ 		}
+-		node = rcu_dereference_protected(CHOOSE_NODE(parent, key),
+-						 lockdep_is_held(lock));
++		node = rcu_dereference_protected(parent->bit[choose(parent, key)], lockdep_is_held(lock));
+ 	}
+ 	*rnode = parent;
+ 	return exact;
+ }
+ 
++static inline void connect_node(struct allowedips_node **parent, u8 bit, struct allowedips_node *node)
++{
++	node->parent_bit_packed = (unsigned long)parent | bit;
++	rcu_assign_pointer(*parent, node);
++}
++
++static inline void choose_and_connect_node(struct allowedips_node *parent, struct allowedips_node *node)
++{
++	u8 bit = choose(parent, node->bits);
++	connect_node(&parent->bit[bit], bit, node);
++}
++
+ static int add(struct allowedips_node __rcu **trie, u8 bits, const u8 *key,
+ 	       u8 cidr, struct wg_peer *peer, struct mutex *lock)
+ {
+@@ -177,8 +190,7 @@ static int add(struct allowedips_node __
+ 		RCU_INIT_POINTER(node->peer, peer);
+ 		list_add_tail(&node->peer_list, &peer->allowedips_list);
+ 		copy_and_assign_cidr(node, key, cidr, bits);
+-		rcu_assign_pointer(node->parent_bit, trie);
+-		rcu_assign_pointer(*trie, node);
++		connect_node(trie, 2, node);
+ 		return 0;
+ 	}
+ 	if (node_placement(*trie, key, cidr, bits, &node, lock)) {
+@@ -197,10 +209,10 @@ static int add(struct allowedips_node __
+ 	if (!node) {
+ 		down = rcu_dereference_protected(*trie, lockdep_is_held(lock));
+ 	} else {
+-		down = rcu_dereference_protected(CHOOSE_NODE(node, key), lockdep_is_held(lock));
++		const u8 bit = choose(node, key);
++		down = rcu_dereference_protected(node->bit[bit], lockdep_is_held(lock));
+ 		if (!down) {
+-			rcu_assign_pointer(newnode->parent_bit, &CHOOSE_NODE(node, key));
+-			rcu_assign_pointer(CHOOSE_NODE(node, key), newnode);
++			connect_node(&node->bit[bit], bit, newnode);
+ 			return 0;
+ 		}
+ 	}
+@@ -208,15 +220,11 @@ static int add(struct allowedips_node __
+ 	parent = node;
+ 
+ 	if (newnode->cidr == cidr) {
+-		rcu_assign_pointer(down->parent_bit, &CHOOSE_NODE(newnode, down->bits));
+-		rcu_assign_pointer(CHOOSE_NODE(newnode, down->bits), down);
+-		if (!parent) {
+-			rcu_assign_pointer(newnode->parent_bit, trie);
+-			rcu_assign_pointer(*trie, newnode);
+-		} else {
+-			rcu_assign_pointer(newnode->parent_bit, &CHOOSE_NODE(parent, newnode->bits));
+-			rcu_assign_pointer(CHOOSE_NODE(parent, newnode->bits), newnode);
+-		}
++		choose_and_connect_node(newnode, down);
++		if (!parent)
++			connect_node(trie, 2, newnode);
++		else
++			choose_and_connect_node(parent, newnode);
+ 		return 0;
+ 	}
+ 
+@@ -229,17 +237,12 @@ static int add(struct allowedips_node __
+ 	INIT_LIST_HEAD(&node->peer_list);
+ 	copy_and_assign_cidr(node, newnode->bits, cidr, bits);
+ 
+-	rcu_assign_pointer(down->parent_bit, &CHOOSE_NODE(node, down->bits));
+-	rcu_assign_pointer(CHOOSE_NODE(node, down->bits), down);
+-	rcu_assign_pointer(newnode->parent_bit, &CHOOSE_NODE(node, newnode->bits));
+-	rcu_assign_pointer(CHOOSE_NODE(node, newnode->bits), newnode);
+-	if (!parent) {
+-		rcu_assign_pointer(node->parent_bit, trie);
+-		rcu_assign_pointer(*trie, node);
+-	} else {
+-		rcu_assign_pointer(node->parent_bit, &CHOOSE_NODE(parent, node->bits));
+-		rcu_assign_pointer(CHOOSE_NODE(parent, node->bits), node);
+-	}
++	choose_and_connect_node(node, down);
++	choose_and_connect_node(node, newnode);
++	if (!parent)
++		connect_node(trie, 2, node);
++	else
++		choose_and_connect_node(parent, node);
+ 	return 0;
+ }
+ 
+@@ -297,7 +300,8 @@ int wg_allowedips_insert_v6(struct allow
+ void wg_allowedips_remove_by_peer(struct allowedips *table,
+ 				  struct wg_peer *peer, struct mutex *lock)
+ {
+-	struct allowedips_node *node, *child, *tmp;
++	struct allowedips_node *node, *child, **parent_bit, *parent, *tmp;
++	bool free_parent;
+ 
+ 	if (list_empty(&peer->allowedips_list))
+ 		return;
+@@ -307,19 +311,29 @@ void wg_allowedips_remove_by_peer(struct
+ 		RCU_INIT_POINTER(node->peer, NULL);
+ 		if (node->bit[0] && node->bit[1])
+ 			continue;
+-		child = rcu_dereference_protected(
+-				node->bit[!rcu_access_pointer(node->bit[0])],
+-				lockdep_is_held(lock));
++		child = rcu_dereference_protected(node->bit[!rcu_access_pointer(node->bit[0])],
++						  lockdep_is_held(lock));
+ 		if (child)
+-			child->parent_bit = node->parent_bit;
+-		*rcu_dereference_protected(node->parent_bit, lockdep_is_held(lock)) = child;
++			child->parent_bit_packed = node->parent_bit_packed;
++		parent_bit = (struct allowedips_node **)(node->parent_bit_packed & ~3UL);
++		*parent_bit = child;
++		parent = (void *)parent_bit -
++			 offsetof(struct allowedips_node, bit[node->parent_bit_packed & 1]);
++		free_parent = !rcu_access_pointer(node->bit[0]) &&
++			      !rcu_access_pointer(node->bit[1]) &&
++			      (node->parent_bit_packed & 3) <= 1 &&
++			      !rcu_access_pointer(parent->peer);
++		if (free_parent)
++			child = rcu_dereference_protected(
++					parent->bit[!(node->parent_bit_packed & 1)],
++					lockdep_is_held(lock));
+ 		call_rcu(&node->rcu, node_free_rcu);
+-
+-		/* TODO: Note that we currently don't walk up and down in order to
+-		 * free any potential filler nodes. This means that this function
+-		 * doesn't free up as much as it could, which could be revisited
+-		 * at some point.
+-		 */
++		if (!free_parent)
++			continue;
++		if (child)
++			child->parent_bit_packed = parent->parent_bit_packed;
++		*(struct allowedips_node **)(parent->parent_bit_packed & ~3UL) = child;
++		call_rcu(&parent->rcu, node_free_rcu);
+ 	}
+ }
+ 
+--- a/drivers/net/wireguard/allowedips.h
++++ b/drivers/net/wireguard/allowedips.h
+@@ -19,7 +19,7 @@ struct allowedips_node {
+ 	u8 bits[16] __aligned(__alignof(u64));
+ 
+ 	/* Keep rarely used members at bottom to be beyond cache line. */
+-	struct allowedips_node *__rcu *parent_bit;
++	unsigned long parent_bit_packed;
+ 	union {
+ 		struct list_head peer_list;
+ 		struct rcu_head rcu;
+@@ -30,7 +30,7 @@ struct allowedips {
+ 	struct allowedips_node __rcu *root4;
+ 	struct allowedips_node __rcu *root6;
+ 	u64 seq;
+-};
++} __aligned(4); /* We pack the lower 2 bits of &root, but m68k only gives 16-bit alignment. */
+ 
+ void wg_allowedips_init(struct allowedips *table);
+ void wg_allowedips_free(struct allowedips *table, struct mutex *mutex);
+--- a/drivers/net/wireguard/selftest/allowedips.c
++++ b/drivers/net/wireguard/selftest/allowedips.c
+@@ -19,32 +19,22 @@
+ 
+ #include <linux/siphash.h>
+ 
+-static __init void swap_endian_and_apply_cidr(u8 *dst, const u8 *src, u8 bits,
+-					      u8 cidr)
+-{
+-	swap_endian(dst, src, bits);
+-	memset(dst + (cidr + 7) / 8, 0, bits / 8 - (cidr + 7) / 8);
+-	if (cidr)
+-		dst[(cidr + 7) / 8 - 1] &= ~0U << ((8 - (cidr % 8)) % 8);
+-}
+-
+ static __init void print_node(struct allowedips_node *node, u8 bits)
+ {
+ 	char *fmt_connection = KERN_DEBUG "\t\"%p/%d\" -> \"%p/%d\";\n";
+-	char *fmt_declaration = KERN_DEBUG
+-		"\t\"%p/%d\"[style=%s, color=\"#%06x\"];\n";
++	char *fmt_declaration = KERN_DEBUG "\t\"%p/%d\"[style=%s, color=\"#%06x\"];\n";
++	u8 ip1[16], ip2[16], cidr1, cidr2;
+ 	char *style = "dotted";
+-	u8 ip1[16], ip2[16];
+ 	u32 color = 0;
+ 
++	if (node == NULL)
++		return;
+ 	if (bits == 32) {
+ 		fmt_connection = KERN_DEBUG "\t\"%pI4/%d\" -> \"%pI4/%d\";\n";
+-		fmt_declaration = KERN_DEBUG
+-			"\t\"%pI4/%d\"[style=%s, color=\"#%06x\"];\n";
++		fmt_declaration = KERN_DEBUG "\t\"%pI4/%d\"[style=%s, color=\"#%06x\"];\n";
+ 	} else if (bits == 128) {
+ 		fmt_connection = KERN_DEBUG "\t\"%pI6/%d\" -> \"%pI6/%d\";\n";
+-		fmt_declaration = KERN_DEBUG
+-			"\t\"%pI6/%d\"[style=%s, color=\"#%06x\"];\n";
++		fmt_declaration = KERN_DEBUG "\t\"%pI6/%d\"[style=%s, color=\"#%06x\"];\n";
+ 	}
+ 	if (node->peer) {
+ 		hsiphash_key_t key = { { 0 } };
+@@ -55,24 +45,20 @@ static __init void print_node(struct all
+ 			hsiphash_1u32(0xabad1dea, &key) % 200;
+ 		style = "bold";
+ 	}
+-	swap_endian_and_apply_cidr(ip1, node->bits, bits, node->cidr);
+-	printk(fmt_declaration, ip1, node->cidr, style, color);
++	wg_allowedips_read_node(node, ip1, &cidr1);
++	printk(fmt_declaration, ip1, cidr1, style, color);
+ 	if (node->bit[0]) {
+-		swap_endian_and_apply_cidr(ip2,
+-				rcu_dereference_raw(node->bit[0])->bits, bits,
+-				node->cidr);
+-		printk(fmt_connection, ip1, node->cidr, ip2,
+-		       rcu_dereference_raw(node->bit[0])->cidr);
+-		print_node(rcu_dereference_raw(node->bit[0]), bits);
++		wg_allowedips_read_node(rcu_dereference_raw(node->bit[0]), ip2, &cidr2);
++		printk(fmt_connection, ip1, cidr1, ip2, cidr2);
+ 	}
+ 	if (node->bit[1]) {
+-		swap_endian_and_apply_cidr(ip2,
+-				rcu_dereference_raw(node->bit[1])->bits,
+-				bits, node->cidr);
+-		printk(fmt_connection, ip1, node->cidr, ip2,
+-		       rcu_dereference_raw(node->bit[1])->cidr);
+-		print_node(rcu_dereference_raw(node->bit[1]), bits);
++		wg_allowedips_read_node(rcu_dereference_raw(node->bit[1]), ip2, &cidr2);
++		printk(fmt_connection, ip1, cidr1, ip2, cidr2);
+ 	}
++	if (node->bit[0])
++		print_node(rcu_dereference_raw(node->bit[0]), bits);
++	if (node->bit[1])
++		print_node(rcu_dereference_raw(node->bit[1]), bits);
+ }
+ 
+ static __init void print_tree(struct allowedips_node __rcu *top, u8 bits)
+@@ -121,8 +107,8 @@ static __init inline union nf_inet_addr
+ {
+ 	union nf_inet_addr mask;
+ 
+-	memset(&mask, 0x00, 128 / 8);
+-	memset(&mask, 0xff, cidr / 8);
++	memset(&mask, 0, sizeof(mask));
++	memset(&mask.all, 0xff, cidr / 8);
+ 	if (cidr % 32)
+ 		mask.all[cidr / 32] = (__force u32)htonl(
+ 			(0xFFFFFFFFUL << (32 - (cidr % 32))) & 0xFFFFFFFFUL);
+@@ -149,42 +135,36 @@ horrible_mask_self(struct horrible_allow
+ }
+ 
+ static __init inline bool
+-horrible_match_v4(const struct horrible_allowedips_node *node,
+-		  struct in_addr *ip)
++horrible_match_v4(const struct horrible_allowedips_node *node, struct in_addr *ip)
+ {
+ 	return (ip->s_addr & node->mask.ip) == node->ip.ip;
+ }
+ 
+ static __init inline bool
+-horrible_match_v6(const struct horrible_allowedips_node *node,
+-		  struct in6_addr *ip)
++horrible_match_v6(const struct horrible_allowedips_node *node, struct in6_addr *ip)
+ {
+-	return (ip->in6_u.u6_addr32[0] & node->mask.ip6[0]) ==
+-		       node->ip.ip6[0] &&
+-	       (ip->in6_u.u6_addr32[1] & node->mask.ip6[1]) ==
+-		       node->ip.ip6[1] &&
+-	       (ip->in6_u.u6_addr32[2] & node->mask.ip6[2]) ==
+-		       node->ip.ip6[2] &&
++	return (ip->in6_u.u6_addr32[0] & node->mask.ip6[0]) == node->ip.ip6[0] &&
++	       (ip->in6_u.u6_addr32[1] & node->mask.ip6[1]) == node->ip.ip6[1] &&
++	       (ip->in6_u.u6_addr32[2] & node->mask.ip6[2]) == node->ip.ip6[2] &&
+ 	       (ip->in6_u.u6_addr32[3] & node->mask.ip6[3]) == node->ip.ip6[3];
+ }
+ 
+ static __init void
+-horrible_insert_ordered(struct horrible_allowedips *table,
+-			struct horrible_allowedips_node *node)
++horrible_insert_ordered(struct horrible_allowedips *table, struct horrible_allowedips_node *node)
+ {
+ 	struct horrible_allowedips_node *other = NULL, *where = NULL;
+ 	u8 my_cidr = horrible_mask_to_cidr(node->mask);
+ 
+ 	hlist_for_each_entry(other, &table->head, table) {
+-		if (!memcmp(&other->mask, &node->mask,
+-			    sizeof(union nf_inet_addr)) &&
+-		    !memcmp(&other->ip, &node->ip,
+-			    sizeof(union nf_inet_addr)) &&
+-		    other->ip_version == node->ip_version) {
++		if (other->ip_version == node->ip_version &&
++		    !memcmp(&other->mask, &node->mask, sizeof(union nf_inet_addr)) &&
++		    !memcmp(&other->ip, &node->ip, sizeof(union nf_inet_addr))) {
+ 			other->value = node->value;
+ 			kfree(node);
+ 			return;
+ 		}
++	}
++	hlist_for_each_entry(other, &table->head, table) {
+ 		where = other;
+ 		if (horrible_mask_to_cidr(other->mask) <= my_cidr)
+ 			break;
+@@ -201,8 +181,7 @@ static __init int
+ horrible_allowedips_insert_v4(struct horrible_allowedips *table,
+ 			      struct in_addr *ip, u8 cidr, void *value)
+ {
+-	struct horrible_allowedips_node *node = kzalloc(sizeof(*node),
+-							GFP_KERNEL);
++	struct horrible_allowedips_node *node = kzalloc(sizeof(*node), GFP_KERNEL);
+ 
+ 	if (unlikely(!node))
+ 		return -ENOMEM;
+@@ -219,8 +198,7 @@ static __init int
+ horrible_allowedips_insert_v6(struct horrible_allowedips *table,
+ 			      struct in6_addr *ip, u8 cidr, void *value)
+ {
+-	struct horrible_allowedips_node *node = kzalloc(sizeof(*node),
+-							GFP_KERNEL);
++	struct horrible_allowedips_node *node = kzalloc(sizeof(*node), GFP_KERNEL);
+ 
+ 	if (unlikely(!node))
+ 		return -ENOMEM;
+@@ -234,39 +212,43 @@ horrible_allowedips_insert_v6(struct hor
+ }
+ 
+ static __init void *
+-horrible_allowedips_lookup_v4(struct horrible_allowedips *table,
+-			      struct in_addr *ip)
++horrible_allowedips_lookup_v4(struct horrible_allowedips *table, struct in_addr *ip)
+ {
+ 	struct horrible_allowedips_node *node;
+-	void *ret = NULL;
+ 
+ 	hlist_for_each_entry(node, &table->head, table) {
+-		if (node->ip_version != 4)
+-			continue;
+-		if (horrible_match_v4(node, ip)) {
+-			ret = node->value;
+-			break;
+-		}
++		if (node->ip_version == 4 && horrible_match_v4(node, ip))
++			return node->value;
+ 	}
+-	return ret;
++	return NULL;
+ }
+ 
+ static __init void *
+-horrible_allowedips_lookup_v6(struct horrible_allowedips *table,
+-			      struct in6_addr *ip)
++horrible_allowedips_lookup_v6(struct horrible_allowedips *table, struct in6_addr *ip)
+ {
+ 	struct horrible_allowedips_node *node;
+-	void *ret = NULL;
+ 
+ 	hlist_for_each_entry(node, &table->head, table) {
+-		if (node->ip_version != 6)
++		if (node->ip_version == 6 && horrible_match_v6(node, ip))
++			return node->value;
++	}
++	return NULL;
++}
++
++
++static __init void
++horrible_allowedips_remove_by_value(struct horrible_allowedips *table, void *value)
++{
++	struct horrible_allowedips_node *node;
++	struct hlist_node *h;
++
++	hlist_for_each_entry_safe(node, h, &table->head, table) {
++		if (node->value != value)
+ 			continue;
+-		if (horrible_match_v6(node, ip)) {
+-			ret = node->value;
+-			break;
+-		}
++		hlist_del(&node->table);
++		kfree(node);
+ 	}
+-	return ret;
++
+ }
+ 
+ static __init bool randomized_test(void)
+@@ -397,23 +379,33 @@ static __init bool randomized_test(void)
+ 		print_tree(t.root6, 128);
+ 	}
+ 
+-	for (i = 0; i < NUM_QUERIES; ++i) {
+-		prandom_bytes(ip, 4);
+-		if (lookup(t.root4, 32, ip) !=
+-		    horrible_allowedips_lookup_v4(&h, (struct in_addr *)ip)) {
+-			pr_err("allowedips random self-test: FAIL\n");
+-			goto free;
++	for (j = 0;; ++j) {
++		for (i = 0; i < NUM_QUERIES; ++i) {
++			prandom_bytes(ip, 4);
++			if (lookup(t.root4, 32, ip) != horrible_allowedips_lookup_v4(&h, (struct in_addr *)ip)) {
++				horrible_allowedips_lookup_v4(&h, (struct in_addr *)ip);
++				pr_err("allowedips random v4 self-test: FAIL\n");
++				goto free;
++			}
++			prandom_bytes(ip, 16);
++			if (lookup(t.root6, 128, ip) != horrible_allowedips_lookup_v6(&h, (struct in6_addr *)ip)) {
++				pr_err("allowedips random v6 self-test: FAIL\n");
++				goto free;
++			}
+ 		}
++		if (j >= NUM_PEERS)
++			break;
++		mutex_lock(&mutex);
++		wg_allowedips_remove_by_peer(&t, peers[j], &mutex);
++		mutex_unlock(&mutex);
++		horrible_allowedips_remove_by_value(&h, peers[j]);
+ 	}
+ 
+-	for (i = 0; i < NUM_QUERIES; ++i) {
+-		prandom_bytes(ip, 16);
+-		if (lookup(t.root6, 128, ip) !=
+-		    horrible_allowedips_lookup_v6(&h, (struct in6_addr *)ip)) {
+-			pr_err("allowedips random self-test: FAIL\n");
+-			goto free;
+-		}
++	if (t.root4 || t.root6) {
++		pr_err("allowedips random self-test removal: FAIL\n");
++		goto free;
+ 	}
++
+ 	ret = true;
+ 
+ free:


From lede-commits at lists.infradead.org  Tue Jun 22 14:53:13 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 17:53:13 -0400
Subject: [openwrt/openwrt] base-files: failsafe: Remove the VLAN modifier
 from interface name
In-Reply-To: <162439879053.24988.16263670469136591335@git-01.infra.openwrt.org>
References: <162439879053.24988.16263670469136591335@git-01.infra.openwrt.org>
Message-ID: <mailman.2307.1624398794.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/7a5a247c1fdea5e24e68958edade7747f065b066

commit 7a5a247c1fdea5e24e68958edade7747f065b066
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Tue Jun 22 00:45:20 2021 +0200

    base-files: failsafe: Remove the VLAN modifier from interface name
    
    Some interfaces have a VLAN modifier like :t in lan1:t, this modifier
    should be removed from the interface before calling preinit_ip_config().
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit 790561d5109ef81537fdb8ceb8eb183c0cab077c)
---
 package/base-files/files/lib/preinit/10_indicate_preinit | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/base-files/files/lib/preinit/10_indicate_preinit b/package/base-files/files/lib/preinit/10_indicate_preinit
index 56e96c63ba..deb5f2ae3a 100644
--- a/package/base-files/files/lib/preinit/10_indicate_preinit
+++ b/package/base-files/files/lib/preinit/10_indicate_preinit
@@ -97,6 +97,8 @@ preinit_config_board() {
 	else
 		# trim any vlan ids
 		ifname=${ifname%\.*}
+		# trim any vlan modifiers like :t
+		ifname=${ifname%\:*}
 	fi
 
 	pi_ifname=$ifname


From lede-commits at lists.infradead.org  Tue Jun 22 14:53:12 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 17:53:12 -0400
Subject: [openwrt/openwrt]  base-files: failsafe: Fix IP configuration
In-Reply-To: <162439879053.24988.16263670469136591335@git-01.infra.openwrt.org>
References: <162439879053.24988.16263670469136591335@git-01.infra.openwrt.org>
Message-ID: <mailman.2308.1624398794.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/c0fdfd15fc8f1ad8c75c60a8393a6d8b5c2b3b19

commit c0fdfd15fc8f1ad8c75c60a8393a6d8b5c2b3b19
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Tue Jun 22 00:45:19 2021 +0200

    base-files: failsafe: Fix IP configuration
    
    Adapt the preinit_config_board() to the board.json network changes. It
    now looks for the device and the ports variables to configure the LAN
    network.
    
    This works with swconfig configurations.
    
    Fixes: FS#3866
    Fixes: d42640e389a8 ("base-files: use "ports" array in board.json network for bridges")
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    Reviewed-by: Rafa? Mi?ecki <rafal at milecki.pl>
    (cherry picked from commit 467cd378db3359814866ec4121fdb4417783241e)
---
 package/base-files/files/lib/preinit/10_indicate_preinit | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/package/base-files/files/lib/preinit/10_indicate_preinit b/package/base-files/files/lib/preinit/10_indicate_preinit
index 3c59929790..56e96c63ba 100644
--- a/package/base-files/files/lib/preinit/10_indicate_preinit
+++ b/package/base-files/files/lib/preinit/10_indicate_preinit
@@ -72,14 +72,20 @@ preinit_config_board() {
 
 	json_select network
 		json_select "lan"
-			json_get_vars ifname
+			json_get_vars device
+			json_get_values ports ports
 		json_select ..
 	json_select ..
 
-	[ -n "$ifname" ] || return
+	[ -n "$device" -o -n "$ports" ] || return
+
+	# swconfig uses $device and DSA uses ports
+	[ -z "$ports" ] && {
+		ports="$device"
+	}
 
 	# only use the first one
-	ifname=${ifname%% *}
+	ifname=${ports%% *}
 
 	if [ -x /sbin/swconfig ]; then
 		# configure the switch, if present


From lede-commits at lists.infradead.org  Tue Jun 22 14:53:15 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 17:53:15 -0400
Subject: [openwrt/openwrt]  exfat: update to 5.12.3
In-Reply-To: <162439879053.24988.16263670469136591335@git-01.infra.openwrt.org>
References: <162439879053.24988.16263670469136591335@git-01.infra.openwrt.org>
Message-ID: <mailman.2309.1624398796.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/ab5010d17055234b3477dce8fc99437ab3f457fa

commit ab5010d17055234b3477dce8fc99437ab3f457fa
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sat Jun 12 21:26:17 2021 -0700

    exfat: update to 5.12.3
    
    Major changes are:
        Avoid page allocation failure from upcase table allocation.
        Add support for FITRIM.
        Improve write perofmrance on dirsync mount.
        Improve lookup perofmrance.
        Fix a bug on discard mount.
    
    Switch to AUTORELEASE to avoid having to bump it.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 package/kernel/exfat/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/kernel/exfat/Makefile b/package/kernel/exfat/Makefile
index 3f873a71ee..4337b0f1aa 100644
--- a/package/kernel/exfat/Makefile
+++ b/package/kernel/exfat/Makefile
@@ -7,12 +7,12 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=exfat
-PKG_VERSION:=5.10.1
-PKG_RELEASE:=1
+PKG_VERSION:=5.12.3
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/namjaejeon/linux-exfat-oot/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=0ff77dd7d39eb231d00c3c4909b9fad31ebeeb618bd6fa18fce142becc9c1f98
+PKG_HASH:=43889c73af76c466bbc904aff80354a62ecaa24c7b20e354ff735f5949907982
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/linux-exfat-oot-$(PKG_VERSION)
 
 PKG_MAINTAINER:=


From lede-commits at lists.infradead.org  Tue Jun 22 14:53:14 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 17:53:14 -0400
Subject: [openwrt/openwrt]  realtek: Fix failsafe mode
In-Reply-To: <162439879053.24988.16263670469136591335@git-01.infra.openwrt.org>
References: <162439879053.24988.16263670469136591335@git-01.infra.openwrt.org>
Message-ID: <mailman.2310.1624398796.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/72d93c1ba44eb8f1b0a0978f71b06720365fd0e5

commit 72d93c1ba44eb8f1b0a0978f71b06720365fd0e5
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Tue Jun 22 00:45:21 2021 +0200

    realtek: Fix failsafe mode
    
    The RTL8380-RTL9300 switches only forward packets when VLAN ID 1 is
    configured. Do not use the standard failsafe configuration for DSA
    accessing the default port directly, but configure a switch on the lan1
    interface instead.
    
    This will add the VLAN ID 1 configuration to the switch:
    $ bridge vlan show
    port              vlan-id
    lan1              1 PVID Egress Untagged
    switch            1 PVID Egress Untagged
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit b7ee0786b56d1088c195fe7c1cdb1ad7d20c9245)
---
 .../base-files/lib/preinit/05_set_preinit_iface_realtek     | 13 +++++++++++++
 .../base-files/lib/preinit/98_remove_preinit_realtek        |  6 ++++++
 2 files changed, 19 insertions(+)

diff --git a/target/linux/realtek/base-files/lib/preinit/05_set_preinit_iface_realtek b/target/linux/realtek/base-files/lib/preinit/05_set_preinit_iface_realtek
new file mode 100644
index 0000000000..e2a7cf5a69
--- /dev/null
+++ b/target/linux/realtek/base-files/lib/preinit/05_set_preinit_iface_realtek
@@ -0,0 +1,13 @@
+set_preinit_iface() {
+
+	# Create a switch on lan1 to configure the VLAN 1.
+	# Without configuring VLAN ID 1 RTL8380 - RTL9300 will not
+	# forward packets.
+	ip link add name switch type bridge vlan_filtering 1
+	ip link set dev lan1 master switch
+	ip link set lan1 up
+
+	pi_ifname=switch
+}
+
+boot_hook_add preinit_main set_preinit_iface
diff --git a/target/linux/realtek/base-files/lib/preinit/98_remove_preinit_realtek b/target/linux/realtek/base-files/lib/preinit/98_remove_preinit_realtek
new file mode 100644
index 0000000000..dc5fdb059b
--- /dev/null
+++ b/target/linux/realtek/base-files/lib/preinit/98_remove_preinit_realtek
@@ -0,0 +1,6 @@
+remove_switch() {
+	# delete switch created in 05_set_preinit_iface_realtek again
+	ip link del name switch
+}
+
+boot_hook_add preinit_main remove_switch


From lede-commits at lists.infradead.org  Tue Jun 22 14:53:11 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 17:53:11 -0400
Subject: [openwrt/openwrt] kernel: Backport patch to automatically bring up
 DSA master when opening user port
In-Reply-To: <162439879053.24988.16263670469136591335@git-01.infra.openwrt.org>
References: <162439879053.24988.16263670469136591335@git-01.infra.openwrt.org>
Message-ID: <mailman.2311.1624398798.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/98b1a6435fdf076f0dbd7cfac31ba73795cc6b23

commit 98b1a6435fdf076f0dbd7cfac31ba73795cc6b23
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Tue Jun 22 00:45:18 2021 +0200

    kernel: Backport patch to automatically bring up DSA master when opening user port
    
    Without this patch we have to manually bring up the CPU interface in
    failsafe mode.
    
    This was backported from kernel 5.12.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    Tested-by: Rafa? Mi?ecki <rafal at milecki.pl>
    (cherry picked from commit 2e17c710954bd3506467d700dee23757b138fedd)
---
 ...omatically-bring-up-DSA-master-when-openi.patch | 85 ++++++++++++++++++++++
 ...louder-when-a-non-legacy-FDB-operation-fa.patch |  4 +-
 ...-t-use-switchdev_notifier_fdb_info-in-dsa.patch |  8 +-
 ...e-switchdev-event-implementation-under-th.patch |  4 +-
 ...t-early-in-dsa_slave_switchdev_event-if-w.patch |  2 +-
 ...ten-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch |  6 +-
 ...t-dsa-support-hardware-flow-table-offload.patch |  4 +-
 ...lude-local-addresses-in-assisted-CPU-port.patch |  2 +-
 ...lude-bridge-addresses-in-assisted-CPU-por.patch |  2 +-
 ...c-static-FDB-entries-on-foreign-interface.patch |  4 +-
 10 files changed, 103 insertions(+), 18 deletions(-)

diff --git a/target/linux/generic/backport-5.4/765-v5.12-net-dsa-automatically-bring-up-DSA-master-when-openi.patch b/target/linux/generic/backport-5.4/765-v5.12-net-dsa-automatically-bring-up-DSA-master-when-openi.patch
new file mode 100644
index 0000000000..7ec26899f9
--- /dev/null
+++ b/target/linux/generic/backport-5.4/765-v5.12-net-dsa-automatically-bring-up-DSA-master-when-openi.patch
@@ -0,0 +1,85 @@
+From 9d5ef190e5615a7b63af89f88c4106a5bc127974 Mon Sep 17 00:00:00 2001
+From: Vladimir Oltean <vladimir.oltean at nxp.com>
+Date: Fri, 5 Feb 2021 15:37:10 +0200
+Subject: [PATCH] net: dsa: automatically bring up DSA master when opening user
+ port
+
+DSA wants the master interface to be open before the user port is due to
+historical reasons. The promiscuity of interfaces that are down used to
+have issues, as referenced Lennert Buytenhek in commit df02c6ff2e39
+("dsa: fix master interface allmulti/promisc handling").
+
+The bugfix mentioned there, commit b6c40d68ff64 ("net: only invoke
+dev->change_rx_flags when device is UP"), was basically a "don't do
+that" approach to working around the promiscuity while down issue.
+
+Further work done by Vlad Yasevich in commit d2615bf45069 ("net: core:
+Always propagate flag changes to interfaces") has resolved the
+underlying issue, and it is strictly up to the DSA and 8021q drivers
+now, it is no longer mandated by the networking core that the master
+interface must be up when changing its promiscuity.
+
+From DSA's point of view, deciding to error out in dsa_slave_open
+because the master isn't up is
+(a) a bad user experience and
+(b) knocking at an open door.
+Even if there still was an issue with promiscuity while down, DSA could
+still just open the master and avoid it.
+
+Doing it this way has the additional benefit that user space can now
+remove DSA-specific workarounds, like systemd-networkd with BindCarrier:
+https://github.com/systemd/systemd/issues/7478
+
+And we can finally remove one of the 2 bullets in the "Common pitfalls
+using DSA setups" chapter.
+
+Tested with two cascaded DSA switches:
+
+$ ip link set sw0p2 up
+fsl_enetc 0000:00:00.2 eno2: configuring for fixed/internal link mode
+fsl_enetc 0000:00:00.2 eno2: Link is Up - 1Gbps/Full - flow control rx/tx
+mscc_felix 0000:00:00.5 swp0: configuring for fixed/sgmii link mode
+mscc_felix 0000:00:00.5 swp0: Link is Up - 1Gbps/Full - flow control off
+8021q: adding VLAN 0 to HW filter on device swp0
+sja1105 spi2.0 sw0p2: configuring for phy/rgmii-id link mode
+IPv6: ADDRCONF(NETDEV_CHANGE): eno2: link becomes ready
+IPv6: ADDRCONF(NETDEV_CHANGE): swp0: link becomes ready
+
+Signed-off-by: Vladimir Oltean <vladimir.oltean at nxp.com>
+Reviewed-by: Andrew Lunn <andrew at lunn.ch>
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
+---
+ Documentation/networking/dsa/dsa.rst | 4 ----
+ net/dsa/slave.c                      | 7 +++++--
+ 2 files changed, 5 insertions(+), 6 deletions(-)
+
+--- a/Documentation/networking/dsa/dsa.rst
++++ b/Documentation/networking/dsa/dsa.rst
+@@ -273,10 +273,6 @@ will not make us go through the switch t
+ the Ethernet switch on the other end, expecting a tag will typically drop this
+ frame.
+ 
+-Slave network devices check that the master network device is UP before allowing
+-you to administratively bring UP these slave network devices. A common
+-configuration mistake is forgetting to bring UP the master network device first.
+-
+ Interactions with other subsystems
+ ==================================
+ 
+--- a/net/dsa/slave.c
++++ b/net/dsa/slave.c
+@@ -70,8 +70,11 @@ static int dsa_slave_open(struct net_dev
+ 	struct dsa_port *dp = dsa_slave_to_port(dev);
+ 	int err;
+ 
+-	if (!(master->flags & IFF_UP))
+-		return -ENETDOWN;
++	err = dev_open(master, NULL);
++	if (err < 0) {
++		netdev_err(dev, "failed to open master %s\n", master->name);
++		goto out;
++	}
+ 
+ 	if (!ether_addr_equal(dev->dev_addr, master->dev_addr)) {
+ 		err = dev_uc_add(master, dev->dev_addr);
diff --git a/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch b/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch
index 297175855b..9ec1a226b5 100644
--- a/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch
+++ b/target/linux/generic/backport-5.4/771-v5.12-net-dsa-be-louder-when-a-non-legacy-FDB-operation-fa.patch
@@ -25,7 +25,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1592,7 +1592,9 @@ static void dsa_slave_switchdev_event_wo
+@@ -1595,7 +1595,9 @@ static void dsa_slave_switchdev_event_wo
  
  		err = dsa_port_fdb_add(dp, fdb_info->addr, fdb_info->vid);
  		if (err) {
@@ -36,7 +36,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  			break;
  		}
  		fdb_info->offloaded = true;
-@@ -1607,9 +1609,11 @@ static void dsa_slave_switchdev_event_wo
+@@ -1610,9 +1612,11 @@ static void dsa_slave_switchdev_event_wo
  
  		err = dsa_port_fdb_del(dp, fdb_info->addr, fdb_info->vid);
  		if (err) {
diff --git a/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch b/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch
index e9b74053e0..bc29fbecc4 100644
--- a/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch
+++ b/target/linux/generic/backport-5.4/772-v5.12-net-dsa-don-t-use-switchdev_notifier_fdb_info-in-dsa.patch
@@ -54,7 +54,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	struct sk_buff *	(*xmit)(struct sk_buff *skb,
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1567,76 +1567,66 @@ static int dsa_slave_netdevice_event(str
+@@ -1570,76 +1570,66 @@ static int dsa_slave_netdevice_event(str
  	return NOTIFY_DONE;
  }
  
@@ -167,7 +167,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  }
  
  /* Called under rcu_read_lock() */
-@@ -1644,7 +1634,9 @@ static int dsa_slave_switchdev_event(str
+@@ -1647,7 +1637,9 @@ static int dsa_slave_switchdev_event(str
  				     unsigned long event, void *ptr)
  {
  	struct net_device *dev = switchdev_notifier_info_to_dev(ptr);
@@ -177,7 +177,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	int err;
  
  	if (event == SWITCHDEV_PORT_ATTR_SET) {
-@@ -1657,20 +1649,32 @@ static int dsa_slave_switchdev_event(str
+@@ -1660,20 +1652,32 @@ static int dsa_slave_switchdev_event(str
  	if (!dsa_slave_dev_check(dev))
  		return NOTIFY_DONE;
  
@@ -213,7 +213,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		dev_hold(dev);
  		break;
  	default:
-@@ -1680,10 +1684,6 @@ static int dsa_slave_switchdev_event(str
+@@ -1683,10 +1687,6 @@ static int dsa_slave_switchdev_event(str
  
  	dsa_schedule_work(&switchdev_work->work);
  	return NOTIFY_OK;
diff --git a/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch b/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch
index b46cd7545e..50c7a08590 100644
--- a/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch
+++ b/target/linux/generic/backport-5.4/773-v5.12-net-dsa-move-switchdev-event-implementation-under-th.patch
@@ -20,7 +20,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1639,31 +1639,29 @@ static int dsa_slave_switchdev_event(str
+@@ -1642,31 +1642,29 @@ static int dsa_slave_switchdev_event(str
  	struct dsa_port *dp;
  	int err;
  
@@ -68,7 +68,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		fdb_info = ptr;
  
  		if (!fdb_info->added_by_user) {
-@@ -1676,13 +1674,12 @@ static int dsa_slave_switchdev_event(str
+@@ -1679,13 +1677,12 @@ static int dsa_slave_switchdev_event(str
  		switchdev_work->vid = fdb_info->vid;
  
  		dev_hold(dev);
diff --git a/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch b/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
index d38c3901cf..dcb6bbdc49 100644
--- a/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
+++ b/target/linux/generic/backport-5.4/774-v5.12-net-dsa-exit-early-in-dsa_slave_switchdev_event-if-w.patch
@@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1652,6 +1652,9 @@ static int dsa_slave_switchdev_event(str
+@@ -1655,6 +1655,9 @@ static int dsa_slave_switchdev_event(str
  
  		dp = dsa_slave_to_port(dev);
  
diff --git a/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch b/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch
index 4aa85e5750..b49d11a776 100644
--- a/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch
+++ b/target/linux/generic/backport-5.4/775-v5.12-net-dsa-listen-for-SWITCHDEV_-FDB-DEL-_ADD_TO_DEVICE.patch
@@ -172,7 +172,7 @@ Signed-off-by: DENG Qingfang <dqfext at gmail.com>
  	 */
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1629,6 +1629,25 @@ static void dsa_slave_switchdev_event_wo
+@@ -1632,6 +1632,25 @@ static void dsa_slave_switchdev_event_wo
  		dev_put(dp->slave);
  }
  
@@ -198,7 +198,7 @@ Signed-off-by: DENG Qingfang <dqfext at gmail.com>
  /* Called under rcu_read_lock() */
  static int dsa_slave_switchdev_event(struct notifier_block *unused,
  				     unsigned long event, void *ptr)
-@@ -1647,10 +1666,37 @@ static int dsa_slave_switchdev_event(str
+@@ -1650,10 +1669,37 @@ static int dsa_slave_switchdev_event(str
  		return notifier_from_errno(err);
  	case SWITCHDEV_FDB_ADD_TO_DEVICE:
  	case SWITCHDEV_FDB_DEL_TO_DEVICE:
@@ -239,7 +239,7 @@ Signed-off-by: DENG Qingfang <dqfext at gmail.com>
  
  		if (!dp->ds->ops->port_fdb_add || !dp->ds->ops->port_fdb_del)
  			return NOTIFY_DONE;
-@@ -1665,18 +1711,13 @@ static int dsa_slave_switchdev_event(str
+@@ -1668,18 +1714,13 @@ static int dsa_slave_switchdev_event(str
  		switchdev_work->port = dp->index;
  		switchdev_work->event = event;
  
diff --git a/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch b/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch
index 85c606c455..91aae5b65c 100644
--- a/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch
+++ b/target/linux/generic/pending-5.4/647-net-dsa-support-hardware-flow-table-offload.patch
@@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  #include "dsa_priv.h"
  
-@@ -1223,6 +1227,27 @@ static struct devlink_port *dsa_slave_ge
+@@ -1226,6 +1230,27 @@ static struct devlink_port *dsa_slave_ge
  	return dp->ds->devlink ? &dp->devlink_port : NULL;
  }
  
@@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static const struct net_device_ops dsa_slave_netdev_ops = {
  	.ndo_open	 	= dsa_slave_open,
  	.ndo_stop		= dsa_slave_close,
-@@ -1247,6 +1272,9 @@ static const struct net_device_ops dsa_s
+@@ -1250,6 +1275,9 @@ static const struct net_device_ops dsa_s
  	.ndo_vlan_rx_add_vid	= dsa_slave_vlan_rx_add_vid,
  	.ndo_vlan_rx_kill_vid	= dsa_slave_vlan_rx_kill_vid,
  	.ndo_get_devlink_port	= dsa_slave_get_devlink_port,
diff --git a/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch b/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch
index e1a7a0e448..d73481fcc0 100644
--- a/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch
+++ b/target/linux/generic/pending-5.4/765-net-dsa-Include-local-addresses-in-assisted-CPU-port.patch
@@ -18,7 +18,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1697,10 +1697,12 @@ static int dsa_slave_switchdev_event(str
+@@ -1700,10 +1700,12 @@ static int dsa_slave_switchdev_event(str
  		fdb_info = ptr;
  
  		if (dsa_slave_dev_check(dev)) {
diff --git a/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch b/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch
index f985adf736..e66aa93488 100644
--- a/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch
+++ b/target/linux/generic/pending-5.4/766-net-dsa-Include-bridge-addresses-in-assisted-CPU-por.patch
@@ -15,7 +15,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1711,7 +1711,11 @@ static int dsa_slave_switchdev_event(str
+@@ -1714,7 +1714,11 @@ static int dsa_slave_switchdev_event(str
  			struct net_device *br_dev;
  			struct dsa_slave_priv *p;
  
diff --git a/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch b/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch
index 984d9805f6..5305e3d114 100644
--- a/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch
+++ b/target/linux/generic/pending-5.4/767-net-dsa-Sync-static-FDB-entries-on-foreign-interface.patch
@@ -28,7 +28,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
 
 --- a/net/dsa/slave.c
 +++ b/net/dsa/slave.c
-@@ -1704,9 +1704,12 @@ static int dsa_slave_switchdev_event(str
+@@ -1707,9 +1707,12 @@ static int dsa_slave_switchdev_event(str
  			else if (!fdb_info->added_by_user)
  				return NOTIFY_OK;
  		} else {
@@ -44,7 +44,7 @@ Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
  			 */
  			struct net_device *br_dev;
  			struct dsa_slave_priv *p;
-@@ -1728,7 +1731,8 @@ static int dsa_slave_switchdev_event(str
+@@ -1731,7 +1734,8 @@ static int dsa_slave_switchdev_event(str
  
  			dp = p->dp->cpu_dp;
  


From lede-commits at lists.infradead.org  Tue Jun 22 14:53:10 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 22 Jun 2021 17:53:10 -0400
Subject: [openwrt/openwrt] kernel-5.4: backport latest patches for wireguard
In-Reply-To: <162439879053.24988.16263670469136591335@git-01.infra.openwrt.org>
References: <162439879053.24988.16263670469136591335@git-01.infra.openwrt.org>
Message-ID: <mailman.2314.1624398800.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/ec780bdb9201182423688e38abd1f1959d32ae47

commit ec780bdb9201182423688e38abd1f1959d32ae47
Author: Jason A. Donenfeld <Jason at zx2c4.com>
AuthorDate: Sun Jun 6 12:37:53 2021 +0200

    kernel-5.4: backport latest patches for wireguard
    
    These are the latest patches that just landed upstream for 5.13, will be
    backported by Greg into 5.10 (because of stable@), and are now in the
    5.4 backport branch of wireguard: https://git.zx2c4.com/wireguard-linux/log/?h=backport-5.4.y
    
    Cc: Ilya Lipnitskiy <ilya.lipnitskiy at gmail.com>
    Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
    Tested-by: Stijn Segers <foss at volatilesystems.org>
    (cherry picked from commit 2a3b2f59fec10d7c08f90f019b310db418e775bf)
---
 ...s-poly1305-enable-for-all-MIPS-processors.patch |  60 +++
 ...to-mips-add-poly1305-core.S-to-.gitignore.patch |  24 +
 ...1305-fix-poly1305_core_setkey-declaration.patch | 172 +++++++
 ...elftests-remove-old-conntrack-kconfig-val.patch |  29 ++
 ...elftests-make-sure-rp_filter-is-disabled-.patch |  31 ++
 ...80-wireguard-0129-wireguard-do-not-use-O3.patch |  33 ++
 ...se-synchronize_net-rather-than-synchroniz.patch |  66 +++
 ...131-wireguard-peer-allocate-in-kmem_cache.patch | 125 +++++
 ...llowedips-initialize-list-head-in-selftes.patch |  43 ++
 ...-wireguard-allowedips-remove-nodes-in-O-1.patch | 237 ++++++++++
 ...d-allowedips-allocate-nodes-in-kmem_cache.patch | 173 +++++++
 ...llowedips-free-empty-intermediate-nodes-w.patch | 521 +++++++++++++++++++++
 12 files changed, 1514 insertions(+)

diff --git a/target/linux/generic/backport-5.4/080-wireguard-0124-crypto-mips-poly1305-enable-for-all-MIPS-processors.patch b/target/linux/generic/backport-5.4/080-wireguard-0124-crypto-mips-poly1305-enable-for-all-MIPS-processors.patch
new file mode 100644
index 0000000000..c0ee841b02
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0124-crypto-mips-poly1305-enable-for-all-MIPS-processors.patch
@@ -0,0 +1,60 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Maciej W. Rozycki" <macro at orcam.me.uk>
+Date: Thu, 11 Mar 2021 21:50:47 -0700
+Subject: [PATCH] crypto: mips/poly1305 - enable for all MIPS processors
+
+commit 6c810cf20feef0d4338e9b424ab7f2644a8b353e upstream.
+
+The MIPS Poly1305 implementation is generic MIPS code written such as to
+support down to the original MIPS I and MIPS III ISA for the 32-bit and
+64-bit variant respectively.  Lift the current limitation then to enable
+code for MIPSr1 ISA or newer processors only and have it available for
+all MIPS processors.
+
+Signed-off-by: Maciej W. Rozycki <macro at orcam.me.uk>
+Fixes: a11d055e7a64 ("crypto: mips/poly1305 - incorporate OpenSSL/CRYPTOGAMS optimized implementation")
+Cc: stable at vger.kernel.org # v5.5+
+Acked-by: Jason A. Donenfeld <Jason at zx2c4.com>
+Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ arch/mips/crypto/Makefile | 4 ++--
+ crypto/Kconfig            | 2 +-
+ drivers/net/Kconfig       | 2 +-
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+--- a/arch/mips/crypto/Makefile
++++ b/arch/mips/crypto/Makefile
+@@ -12,8 +12,8 @@ AFLAGS_chacha-core.o += -O2 # needed to
+ obj-$(CONFIG_CRYPTO_POLY1305_MIPS) += poly1305-mips.o
+ poly1305-mips-y := poly1305-core.o poly1305-glue.o
+ 
+-perlasm-flavour-$(CONFIG_CPU_MIPS32) := o32
+-perlasm-flavour-$(CONFIG_CPU_MIPS64) := 64
++perlasm-flavour-$(CONFIG_32BIT) := o32
++perlasm-flavour-$(CONFIG_64BIT) := 64
+ 
+ quiet_cmd_perlasm = PERLASM $@
+       cmd_perlasm = $(PERL) $(<) $(perlasm-flavour-y) $(@)
+--- a/crypto/Kconfig
++++ b/crypto/Kconfig
+@@ -740,7 +740,7 @@ config CRYPTO_POLY1305_X86_64
+ 
+ config CRYPTO_POLY1305_MIPS
+ 	tristate "Poly1305 authenticator algorithm (MIPS optimized)"
+-	depends on CPU_MIPS32 || (CPU_MIPS64 && 64BIT)
++	depends on MIPS
+ 	select CRYPTO_ARCH_HAVE_LIB_POLY1305
+ 
+ config CRYPTO_MD4
+--- a/drivers/net/Kconfig
++++ b/drivers/net/Kconfig
+@@ -92,7 +92,7 @@ config WIREGUARD
+ 	select CRYPTO_POLY1305_ARM if ARM
+ 	select CRYPTO_CURVE25519_NEON if ARM && KERNEL_MODE_NEON
+ 	select CRYPTO_CHACHA_MIPS if CPU_MIPS32_R2
+-	select CRYPTO_POLY1305_MIPS if CPU_MIPS32 || (CPU_MIPS64 && 64BIT)
++	select CRYPTO_POLY1305_MIPS if MIPS
+ 	help
+ 	  WireGuard is a secure, fast, and easy to use replacement for IPSec
+ 	  that uses modern cryptography and clever networking tricks. It's
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0125-crypto-mips-add-poly1305-core.S-to-.gitignore.patch b/target/linux/generic/backport-5.4/080-wireguard-0125-crypto-mips-add-poly1305-core.S-to-.gitignore.patch
new file mode 100644
index 0000000000..856d67d5b8
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0125-crypto-mips-add-poly1305-core.S-to-.gitignore.patch
@@ -0,0 +1,24 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Ilya Lipnitskiy <ilya.lipnitskiy at gmail.com>
+Date: Sat, 27 Mar 2021 19:39:43 -0700
+Subject: [PATCH] crypto: mips: add poly1305-core.S to .gitignore
+
+commit dc92d0df51dc61de88bf6f4884a17bf73d5c6326 upstream.
+
+poly1305-core.S is an auto-generated file, so it should be ignored.
+
+Fixes: a11d055e7a64 ("crypto: mips/poly1305 - incorporate OpenSSL/CRYPTOGAMS optimized implementation")
+Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy at gmail.com>
+Cc: Ard Biesheuvel <ardb at kernel.org>
+Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ arch/mips/crypto/.gitignore | 2 ++
+ 1 file changed, 2 insertions(+)
+ create mode 100644 arch/mips/crypto/.gitignore
+
+--- /dev/null
++++ b/arch/mips/crypto/.gitignore
+@@ -0,0 +1,2 @@
++# SPDX-License-Identifier: GPL-2.0-only
++poly1305-core.S
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0126-crypto-poly1305-fix-poly1305_core_setkey-declaration.patch b/target/linux/generic/backport-5.4/080-wireguard-0126-crypto-poly1305-fix-poly1305_core_setkey-declaration.patch
new file mode 100644
index 0000000000..ded6625aeb
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0126-crypto-poly1305-fix-poly1305_core_setkey-declaration.patch
@@ -0,0 +1,172 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd at arndb.de>
+Date: Mon, 22 Mar 2021 18:05:15 +0100
+Subject: [PATCH] crypto: poly1305 - fix poly1305_core_setkey() declaration
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+commit 8d195e7a8ada68928f2aedb2c18302a4518fe68e upstream.
+
+gcc-11 points out a mismatch between the declaration and the definition
+of poly1305_core_setkey():
+
+lib/crypto/poly1305-donna32.c:13:67: error: argument 2 of type ?const u8[16]? {aka ?const unsigned char[16]?} with mismatched bound [-Werror=array-parameter=]
+   13 | void poly1305_core_setkey(struct poly1305_core_key *key, const u8 raw_key[16])
+      |                                                          ~~~~~~~~~^~~~~~~~~~~
+In file included from lib/crypto/poly1305-donna32.c:11:
+include/crypto/internal/poly1305.h:21:68: note: previously declared as ?const u8 *? {aka ?const unsigned char *?}
+   21 | void poly1305_core_setkey(struct poly1305_core_key *key, const u8 *raw_key);
+
+This is harmless in principle, as the calling conventions are the same,
+but the more specific prototype allows better type checking in the
+caller.
+
+Change the declaration to match the actual function definition.
+The poly1305_simd_init() is a bit suspicious here, as it previously
+had a 32-byte argument type, but looks like it needs to take the
+16-byte POLY1305_BLOCK_SIZE array instead.
+
+Fixes: 1c08a104360f ("crypto: poly1305 - add new 32 and 64-bit generic versions")
+Signed-off-by: Arnd Bergmann <arnd at arndb.de>
+Reviewed-by: Ard Biesheuvel <ardb at kernel.org>
+Reviewed-by: Eric Biggers <ebiggers at google.com>
+Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ arch/arm/crypto/poly1305-glue.c    | 2 +-
+ arch/arm64/crypto/poly1305-glue.c  | 2 +-
+ arch/mips/crypto/poly1305-glue.c   | 2 +-
+ arch/x86/crypto/poly1305_glue.c    | 6 +++---
+ include/crypto/internal/poly1305.h | 3 ++-
+ include/crypto/poly1305.h          | 6 ++++--
+ lib/crypto/poly1305-donna32.c      | 3 ++-
+ lib/crypto/poly1305-donna64.c      | 3 ++-
+ lib/crypto/poly1305.c              | 3 ++-
+ 9 files changed, 18 insertions(+), 12 deletions(-)
+
+--- a/arch/arm/crypto/poly1305-glue.c
++++ b/arch/arm/crypto/poly1305-glue.c
+@@ -29,7 +29,7 @@ void __weak poly1305_blocks_neon(void *s
+ 
+ static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_neon);
+ 
+-void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 *key)
++void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 key[POLY1305_KEY_SIZE])
+ {
+ 	poly1305_init_arm(&dctx->h, key);
+ 	dctx->s[0] = get_unaligned_le32(key + 16);
+--- a/arch/arm64/crypto/poly1305-glue.c
++++ b/arch/arm64/crypto/poly1305-glue.c
+@@ -25,7 +25,7 @@ asmlinkage void poly1305_emit(void *stat
+ 
+ static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_neon);
+ 
+-void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 *key)
++void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 key[POLY1305_KEY_SIZE])
+ {
+ 	poly1305_init_arm64(&dctx->h, key);
+ 	dctx->s[0] = get_unaligned_le32(key + 16);
+--- a/arch/mips/crypto/poly1305-glue.c
++++ b/arch/mips/crypto/poly1305-glue.c
+@@ -17,7 +17,7 @@ asmlinkage void poly1305_init_mips(void
+ asmlinkage void poly1305_blocks_mips(void *state, const u8 *src, u32 len, u32 hibit);
+ asmlinkage void poly1305_emit_mips(void *state, u8 *digest, const u32 *nonce);
+ 
+-void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 *key)
++void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 key[POLY1305_KEY_SIZE])
+ {
+ 	poly1305_init_mips(&dctx->h, key);
+ 	dctx->s[0] = get_unaligned_le32(key + 16);
+--- a/arch/x86/crypto/poly1305_glue.c
++++ b/arch/x86/crypto/poly1305_glue.c
+@@ -15,7 +15,7 @@
+ #include <asm/simd.h>
+ 
+ asmlinkage void poly1305_init_x86_64(void *ctx,
+-				     const u8 key[POLY1305_KEY_SIZE]);
++				     const u8 key[POLY1305_BLOCK_SIZE]);
+ asmlinkage void poly1305_blocks_x86_64(void *ctx, const u8 *inp,
+ 				       const size_t len, const u32 padbit);
+ asmlinkage void poly1305_emit_x86_64(void *ctx, u8 mac[POLY1305_DIGEST_SIZE],
+@@ -80,7 +80,7 @@ static void convert_to_base2_64(void *ct
+ 	state->is_base2_26 = 0;
+ }
+ 
+-static void poly1305_simd_init(void *ctx, const u8 key[POLY1305_KEY_SIZE])
++static void poly1305_simd_init(void *ctx, const u8 key[POLY1305_BLOCK_SIZE])
+ {
+ 	poly1305_init_x86_64(ctx, key);
+ }
+@@ -128,7 +128,7 @@ static void poly1305_simd_emit(void *ctx
+ 		poly1305_emit_avx(ctx, mac, nonce);
+ }
+ 
+-void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 *key)
++void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 key[POLY1305_KEY_SIZE])
+ {
+ 	poly1305_simd_init(&dctx->h, key);
+ 	dctx->s[0] = get_unaligned_le32(&key[16]);
+--- a/include/crypto/internal/poly1305.h
++++ b/include/crypto/internal/poly1305.h
+@@ -18,7 +18,8 @@
+  * only the ?-almost-?-universal hash function (not the full MAC) is computed.
+  */
+ 
+-void poly1305_core_setkey(struct poly1305_core_key *key, const u8 *raw_key);
++void poly1305_core_setkey(struct poly1305_core_key *key,
++			  const u8 raw_key[POLY1305_BLOCK_SIZE]);
+ static inline void poly1305_core_init(struct poly1305_state *state)
+ {
+ 	*state = (struct poly1305_state){};
+--- a/include/crypto/poly1305.h
++++ b/include/crypto/poly1305.h
+@@ -58,8 +58,10 @@ struct poly1305_desc_ctx {
+ 	};
+ };
+ 
+-void poly1305_init_arch(struct poly1305_desc_ctx *desc, const u8 *key);
+-void poly1305_init_generic(struct poly1305_desc_ctx *desc, const u8 *key);
++void poly1305_init_arch(struct poly1305_desc_ctx *desc,
++			const u8 key[POLY1305_KEY_SIZE]);
++void poly1305_init_generic(struct poly1305_desc_ctx *desc,
++			   const u8 key[POLY1305_KEY_SIZE]);
+ 
+ static inline void poly1305_init(struct poly1305_desc_ctx *desc, const u8 *key)
+ {
+--- a/lib/crypto/poly1305-donna32.c
++++ b/lib/crypto/poly1305-donna32.c
+@@ -10,7 +10,8 @@
+ #include <asm/unaligned.h>
+ #include <crypto/internal/poly1305.h>
+ 
+-void poly1305_core_setkey(struct poly1305_core_key *key, const u8 raw_key[16])
++void poly1305_core_setkey(struct poly1305_core_key *key,
++			  const u8 raw_key[POLY1305_BLOCK_SIZE])
+ {
+ 	/* r &= 0xffffffc0ffffffc0ffffffc0fffffff */
+ 	key->key.r[0] = (get_unaligned_le32(&raw_key[0])) & 0x3ffffff;
+--- a/lib/crypto/poly1305-donna64.c
++++ b/lib/crypto/poly1305-donna64.c
+@@ -12,7 +12,8 @@
+ 
+ typedef __uint128_t u128;
+ 
+-void poly1305_core_setkey(struct poly1305_core_key *key, const u8 raw_key[16])
++void poly1305_core_setkey(struct poly1305_core_key *key,
++			  const u8 raw_key[POLY1305_BLOCK_SIZE])
+ {
+ 	u64 t0, t1;
+ 
+--- a/lib/crypto/poly1305.c
++++ b/lib/crypto/poly1305.c
+@@ -12,7 +12,8 @@
+ #include <linux/module.h>
+ #include <asm/unaligned.h>
+ 
+-void poly1305_init_generic(struct poly1305_desc_ctx *desc, const u8 *key)
++void poly1305_init_generic(struct poly1305_desc_ctx *desc,
++			   const u8 key[POLY1305_KEY_SIZE])
+ {
+ 	poly1305_core_setkey(&desc->core_r, key);
+ 	desc->s[0] = get_unaligned_le32(key + 16);
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0127-wireguard-selftests-remove-old-conntrack-kconfig-val.patch b/target/linux/generic/backport-5.4/080-wireguard-0127-wireguard-selftests-remove-old-conntrack-kconfig-val.patch
new file mode 100644
index 0000000000..3e7d1a8e02
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0127-wireguard-selftests-remove-old-conntrack-kconfig-val.patch
@@ -0,0 +1,29 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason at zx2c4.com>
+Date: Fri, 4 Jun 2021 17:17:30 +0200
+Subject: [PATCH] wireguard: selftests: remove old conntrack kconfig value
+
+commit acf2492b51c9a3c4dfb947f4d3477a86d315150f upstream.
+
+On recent kernels, this config symbol is no longer used.
+
+Reported-by: Rui Salvaterra <rsalvaterra at gmail.com>
+Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
+Cc: stable at vger.kernel.org
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ tools/testing/selftests/wireguard/qemu/kernel.config | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/tools/testing/selftests/wireguard/qemu/kernel.config
++++ b/tools/testing/selftests/wireguard/qemu/kernel.config
+@@ -19,7 +19,6 @@ CONFIG_NETFILTER_XTABLES=y
+ CONFIG_NETFILTER_XT_NAT=y
+ CONFIG_NETFILTER_XT_MATCH_LENGTH=y
+ CONFIG_NETFILTER_XT_MARK=y
+-CONFIG_NF_CONNTRACK_IPV4=y
+ CONFIG_NF_NAT_IPV4=y
+ CONFIG_IP_NF_IPTABLES=y
+ CONFIG_IP_NF_FILTER=y
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0128-wireguard-selftests-make-sure-rp_filter-is-disabled-.patch b/target/linux/generic/backport-5.4/080-wireguard-0128-wireguard-selftests-make-sure-rp_filter-is-disabled-.patch
new file mode 100644
index 0000000000..22d0f3e32e
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0128-wireguard-selftests-make-sure-rp_filter-is-disabled-.patch
@@ -0,0 +1,31 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason at zx2c4.com>
+Date: Fri, 4 Jun 2021 17:17:31 +0200
+Subject: [PATCH] wireguard: selftests: make sure rp_filter is disabled on
+ vethc
+
+commit f8873d11d4121aad35024f9379e431e0c83abead upstream.
+
+Some distros may enable strict rp_filter by default, which will prevent
+vethc from receiving the packets with an unrouteable reverse path address.
+
+Reported-by: Hangbin Liu <liuhangbin at gmail.com>
+Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
+Cc: stable at vger.kernel.org
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ tools/testing/selftests/wireguard/netns.sh | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/tools/testing/selftests/wireguard/netns.sh
++++ b/tools/testing/selftests/wireguard/netns.sh
+@@ -363,6 +363,7 @@ ip1 -6 rule add table main suppress_pref
+ ip1 -4 route add default dev wg0 table 51820
+ ip1 -4 rule add not fwmark 51820 table 51820
+ ip1 -4 rule add table main suppress_prefixlength 0
++n1 bash -c 'printf 0 > /proc/sys/net/ipv4/conf/vethc/rp_filter'
+ # Flood the pings instead of sending just one, to trigger routing table reference counting bugs.
+ n1 ping -W 1 -c 100 -f 192.168.99.7
+ n1 ping -W 1 -c 100 -f abab::1111
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0129-wireguard-do-not-use-O3.patch b/target/linux/generic/backport-5.4/080-wireguard-0129-wireguard-do-not-use-O3.patch
new file mode 100644
index 0000000000..a7890a7384
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0129-wireguard-do-not-use-O3.patch
@@ -0,0 +1,33 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason at zx2c4.com>
+Date: Fri, 4 Jun 2021 17:17:32 +0200
+Subject: [PATCH] wireguard: do not use -O3
+
+commit cc5060ca0285efe2728bced399a1955a7ce808b2 upstream.
+
+Apparently, various versions of gcc have O3-related miscompiles. Looking
+at the difference between -O2 and -O3 for gcc 11 doesn't indicate
+miscompiles, but the difference also doesn't seem so significant for
+performance that it's worth risking.
+
+Link: https://lore.kernel.org/lkml/CAHk-=wjuoGyxDhAF8SsrTkN0-YfCx7E6jUN3ikC_tn2AKWTTsA at mail.gmail.com/
+Link: https://lore.kernel.org/lkml/CAHmME9otB5Wwxp7H8bR_i2uH2esEMvoBMC8uEXBMH9p0q1s6Bw at mail.gmail.com/
+Reported-by: Linus Torvalds <torvalds at linux-foundation.org>
+Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
+Cc: stable at vger.kernel.org
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ drivers/net/wireguard/Makefile | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/net/wireguard/Makefile
++++ b/drivers/net/wireguard/Makefile
+@@ -1,5 +1,4 @@
+-ccflags-y := -O3
+-ccflags-y += -D'pr_fmt(fmt)=KBUILD_MODNAME ": " fmt'
++ccflags-y := -D'pr_fmt(fmt)=KBUILD_MODNAME ": " fmt'
+ ccflags-$(CONFIG_WIREGUARD_DEBUG) += -DDEBUG
+ wireguard-y := main.o
+ wireguard-y += noise.o
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0130-wireguard-use-synchronize_net-rather-than-synchroniz.patch b/target/linux/generic/backport-5.4/080-wireguard-0130-wireguard-use-synchronize_net-rather-than-synchroniz.patch
new file mode 100644
index 0000000000..309fe36198
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0130-wireguard-use-synchronize_net-rather-than-synchroniz.patch
@@ -0,0 +1,66 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason at zx2c4.com>
+Date: Fri, 4 Jun 2021 17:17:33 +0200
+Subject: [PATCH] wireguard: use synchronize_net rather than synchronize_rcu
+
+commit 24b70eeeb4f46c09487f8155239ebfb1f875774a upstream.
+
+Many of the synchronization points are sometimes called under the rtnl
+lock, which means we should use synchronize_net rather than
+synchronize_rcu. Under the hood, this expands to using the expedited
+flavor of function in the event that rtnl is held, in order to not stall
+other concurrent changes.
+
+This fixes some very, very long delays when removing multiple peers at
+once, which would cause some operations to take several minutes.
+
+Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
+Cc: stable at vger.kernel.org
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ drivers/net/wireguard/peer.c   | 6 +++---
+ drivers/net/wireguard/socket.c | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/wireguard/peer.c
++++ b/drivers/net/wireguard/peer.c
+@@ -88,7 +88,7 @@ static void peer_make_dead(struct wg_pee
+ 	/* Mark as dead, so that we don't allow jumping contexts after. */
+ 	WRITE_ONCE(peer->is_dead, true);
+ 
+-	/* The caller must now synchronize_rcu() for this to take effect. */
++	/* The caller must now synchronize_net() for this to take effect. */
+ }
+ 
+ static void peer_remove_after_dead(struct wg_peer *peer)
+@@ -160,7 +160,7 @@ void wg_peer_remove(struct wg_peer *peer
+ 	lockdep_assert_held(&peer->device->device_update_lock);
+ 
+ 	peer_make_dead(peer);
+-	synchronize_rcu();
++	synchronize_net();
+ 	peer_remove_after_dead(peer);
+ }
+ 
+@@ -178,7 +178,7 @@ void wg_peer_remove_all(struct wg_device
+ 		peer_make_dead(peer);
+ 		list_add_tail(&peer->peer_list, &dead_peers);
+ 	}
+-	synchronize_rcu();
++	synchronize_net();
+ 	list_for_each_entry_safe(peer, temp, &dead_peers, peer_list)
+ 		peer_remove_after_dead(peer);
+ }
+--- a/drivers/net/wireguard/socket.c
++++ b/drivers/net/wireguard/socket.c
+@@ -430,7 +430,7 @@ void wg_socket_reinit(struct wg_device *
+ 	if (new4)
+ 		wg->incoming_port = ntohs(inet_sk(new4)->inet_sport);
+ 	mutex_unlock(&wg->socket_update_lock);
+-	synchronize_rcu();
++	synchronize_net();
+ 	sock_free(old4);
+ 	sock_free(old6);
+ }
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0131-wireguard-peer-allocate-in-kmem_cache.patch b/target/linux/generic/backport-5.4/080-wireguard-0131-wireguard-peer-allocate-in-kmem_cache.patch
new file mode 100644
index 0000000000..32ae327037
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0131-wireguard-peer-allocate-in-kmem_cache.patch
@@ -0,0 +1,125 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason at zx2c4.com>
+Date: Fri, 4 Jun 2021 17:17:34 +0200
+Subject: [PATCH] wireguard: peer: allocate in kmem_cache
+
+commit a4e9f8e3287c9eb6bf70df982870980dd3341863 upstream.
+
+With deployments having upwards of 600k peers now, this somewhat heavy
+structure could benefit from more fine-grained allocations.
+Specifically, instead of using a 2048-byte slab for a 1544-byte object,
+we can now use 1544-byte objects directly, thus saving almost 25%
+per-peer, or with 600k peers, that's a savings of 303 MiB. This also
+makes wireguard's memory usage more transparent in tools like slabtop
+and /proc/slabinfo.
+
+Fixes: 8b5553ace83c ("wireguard: queueing: get rid of per-peer ring buffers")
+Suggested-by: Arnd Bergmann <arnd at arndb.de>
+Suggested-by: Matthew Wilcox <willy at infradead.org>
+Cc: stable at vger.kernel.org
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ drivers/net/wireguard/main.c |  7 +++++++
+ drivers/net/wireguard/peer.c | 21 +++++++++++++++++----
+ drivers/net/wireguard/peer.h |  3 +++
+ 3 files changed, 27 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/wireguard/main.c
++++ b/drivers/net/wireguard/main.c
+@@ -28,6 +28,10 @@ static int __init mod_init(void)
+ #endif
+ 	wg_noise_init();
+ 
++	ret = wg_peer_init();
++	if (ret < 0)
++		goto err_peer;
++
+ 	ret = wg_device_init();
+ 	if (ret < 0)
+ 		goto err_device;
+@@ -44,6 +48,8 @@ static int __init mod_init(void)
+ err_netlink:
+ 	wg_device_uninit();
+ err_device:
++	wg_peer_uninit();
++err_peer:
+ 	return ret;
+ }
+ 
+@@ -51,6 +57,7 @@ static void __exit mod_exit(void)
+ {
+ 	wg_genetlink_uninit();
+ 	wg_device_uninit();
++	wg_peer_uninit();
+ }
+ 
+ module_init(mod_init);
+--- a/drivers/net/wireguard/peer.c
++++ b/drivers/net/wireguard/peer.c
+@@ -15,6 +15,7 @@
+ #include <linux/rcupdate.h>
+ #include <linux/list.h>
+ 
++static struct kmem_cache *peer_cache;
+ static atomic64_t peer_counter = ATOMIC64_INIT(0);
+ 
+ struct wg_peer *wg_peer_create(struct wg_device *wg,
+@@ -29,10 +30,10 @@ struct wg_peer *wg_peer_create(struct wg
+ 	if (wg->num_peers >= MAX_PEERS_PER_DEVICE)
+ 		return ERR_PTR(ret);
+ 
+-	peer = kzalloc(sizeof(*peer), GFP_KERNEL);
++	peer = kmem_cache_zalloc(peer_cache, GFP_KERNEL);
+ 	if (unlikely(!peer))
+ 		return ERR_PTR(ret);
+-	if (dst_cache_init(&peer->endpoint_cache, GFP_KERNEL))
++	if (unlikely(dst_cache_init(&peer->endpoint_cache, GFP_KERNEL)))
+ 		goto err;
+ 
+ 	peer->device = wg;
+@@ -64,7 +65,7 @@ struct wg_peer *wg_peer_create(struct wg
+ 	return peer;
+ 
+ err:
+-	kfree(peer);
++	kmem_cache_free(peer_cache, peer);
+ 	return ERR_PTR(ret);
+ }
+ 
+@@ -193,7 +194,8 @@ static void rcu_release(struct rcu_head
+ 	/* The final zeroing takes care of clearing any remaining handshake key
+ 	 * material and other potentially sensitive information.
+ 	 */
+-	kzfree(peer);
++	memzero_explicit(peer, sizeof(*peer));
++	kmem_cache_free(peer_cache, peer);
+ }
+ 
+ static void kref_release(struct kref *refcount)
+@@ -225,3 +227,14 @@ void wg_peer_put(struct wg_peer *peer)
+ 		return;
+ 	kref_put(&peer->refcount, kref_release);
+ }
++
++int __init wg_peer_init(void)
++{
++	peer_cache = KMEM_CACHE(wg_peer, 0);
++	return peer_cache ? 0 : -ENOMEM;
++}
++
++void wg_peer_uninit(void)
++{
++	kmem_cache_destroy(peer_cache);
++}
+--- a/drivers/net/wireguard/peer.h
++++ b/drivers/net/wireguard/peer.h
+@@ -80,4 +80,7 @@ void wg_peer_put(struct wg_peer *peer);
+ void wg_peer_remove(struct wg_peer *peer);
+ void wg_peer_remove_all(struct wg_device *wg);
+ 
++int wg_peer_init(void);
++void wg_peer_uninit(void);
++
+ #endif /* _WG_PEER_H */
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0132-wireguard-allowedips-initialize-list-head-in-selftes.patch b/target/linux/generic/backport-5.4/080-wireguard-0132-wireguard-allowedips-initialize-list-head-in-selftes.patch
new file mode 100644
index 0000000000..ce4e5dcf50
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0132-wireguard-allowedips-initialize-list-head-in-selftes.patch
@@ -0,0 +1,43 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason at zx2c4.com>
+Date: Fri, 4 Jun 2021 17:17:35 +0200
+Subject: [PATCH] wireguard: allowedips: initialize list head in selftest
+
+commit 46cfe8eee285cde465b420637507884551f5d7ca upstream.
+
+The randomized trie tests weren't initializing the dummy peer list head,
+resulting in a NULL pointer dereference when used. Fix this by
+initializing it in the randomized trie test, just like we do for the
+static unit test.
+
+While we're at it, all of the other strings like this have the word
+"self-test", so add it to the missing place here.
+
+Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
+Cc: stable at vger.kernel.org
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ drivers/net/wireguard/selftest/allowedips.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireguard/selftest/allowedips.c
++++ b/drivers/net/wireguard/selftest/allowedips.c
+@@ -296,6 +296,7 @@ static __init bool randomized_test(void)
+ 			goto free;
+ 		}
+ 		kref_init(&peers[i]->refcount);
++		INIT_LIST_HEAD(&peers[i]->allowedips_list);
+ 	}
+ 
+ 	mutex_lock(&mutex);
+@@ -333,7 +334,7 @@ static __init bool randomized_test(void)
+ 			if (wg_allowedips_insert_v4(&t,
+ 						    (struct in_addr *)mutated,
+ 						    cidr, peer, &mutex) < 0) {
+-				pr_err("allowedips random malloc: FAIL\n");
++				pr_err("allowedips random self-test malloc: FAIL\n");
+ 				goto free_locked;
+ 			}
+ 			if (horrible_allowedips_insert_v4(&h,
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0133-wireguard-allowedips-remove-nodes-in-O-1.patch b/target/linux/generic/backport-5.4/080-wireguard-0133-wireguard-allowedips-remove-nodes-in-O-1.patch
new file mode 100644
index 0000000000..78da24ea46
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0133-wireguard-allowedips-remove-nodes-in-O-1.patch
@@ -0,0 +1,237 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason at zx2c4.com>
+Date: Fri, 4 Jun 2021 17:17:36 +0200
+Subject: [PATCH] wireguard: allowedips: remove nodes in O(1)
+
+commit f634f418c227c912e7ea95a3299efdc9b10e4022 upstream.
+
+Previously, deleting peers would require traversing the entire trie in
+order to rebalance nodes and safely free them. This meant that removing
+1000 peers from a trie with a half million nodes would take an extremely
+long time, during which we're holding the rtnl lock. Large-scale users
+were reporting 200ms latencies added to the networking stack as a whole
+every time their userspace software would queue up significant removals.
+That's a serious situation.
+
+This commit fixes that by maintaining a double pointer to the parent's
+bit pointer for each node, and then using the already existing node list
+belonging to each peer to go directly to the node, fix up its pointers,
+and free it with RCU. This means removal is O(1) instead of O(n), and we
+don't use gobs of stack.
+
+The removal algorithm has the same downside as the code that it fixes:
+it won't collapse needlessly long runs of fillers.  We can enhance that
+in the future if it ever becomes a problem. This commit documents that
+limitation with a TODO comment in code, a small but meaningful
+improvement over the prior situation.
+
+Currently the biggest flaw, which the next commit addresses, is that
+because this increases the node size on 64-bit machines from 60 bytes to
+68 bytes. 60 rounds up to 64, but 68 rounds up to 128. So we wind up
+using twice as much memory per node, because of power-of-two
+allocations, which is a big bummer. We'll need to figure something out
+there.
+
+Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
+Cc: stable at vger.kernel.org
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ drivers/net/wireguard/allowedips.c | 132 ++++++++++++-----------------
+ drivers/net/wireguard/allowedips.h |   9 +-
+ 2 files changed, 57 insertions(+), 84 deletions(-)
+
+--- a/drivers/net/wireguard/allowedips.c
++++ b/drivers/net/wireguard/allowedips.c
+@@ -66,60 +66,6 @@ static void root_remove_peer_lists(struc
+ 	}
+ }
+ 
+-static void walk_remove_by_peer(struct allowedips_node __rcu **top,
+-				struct wg_peer *peer, struct mutex *lock)
+-{
+-#define REF(p) rcu_access_pointer(p)
+-#define DEREF(p) rcu_dereference_protected(*(p), lockdep_is_held(lock))
+-#define PUSH(p) ({                                                             \
+-		WARN_ON(IS_ENABLED(DEBUG) && len >= 128);                      \
+-		stack[len++] = p;                                              \
+-	})
+-
+-	struct allowedips_node __rcu **stack[128], **nptr;
+-	struct allowedips_node *node, *prev;
+-	unsigned int len;
+-
+-	if (unlikely(!peer || !REF(*top)))
+-		return;
+-
+-	for (prev = NULL, len = 0, PUSH(top); len > 0; prev = node) {
+-		nptr = stack[len - 1];
+-		node = DEREF(nptr);
+-		if (!node) {
+-			--len;
+-			continue;
+-		}
+-		if (!prev || REF(prev->bit[0]) == node ||
+-		    REF(prev->bit[1]) == node) {
+-			if (REF(node->bit[0]))
+-				PUSH(&node->bit[0]);
+-			else if (REF(node->bit[1]))
+-				PUSH(&node->bit[1]);
+-		} else if (REF(node->bit[0]) == prev) {
+-			if (REF(node->bit[1]))
+-				PUSH(&node->bit[1]);
+-		} else {
+-			if (rcu_dereference_protected(node->peer,
+-				lockdep_is_held(lock)) == peer) {
+-				RCU_INIT_POINTER(node->peer, NULL);
+-				list_del_init(&node->peer_list);
+-				if (!node->bit[0] || !node->bit[1]) {
+-					rcu_assign_pointer(*nptr, DEREF(
+-					       &node->bit[!REF(node->bit[0])]));
+-					kfree_rcu(node, rcu);
+-					node = DEREF(nptr);
+-				}
+-			}
+-			--len;
+-		}
+-	}
+-
+-#undef REF
+-#undef DEREF
+-#undef PUSH
+-}
+-
+ static unsigned int fls128(u64 a, u64 b)
+ {
+ 	return a ? fls64(a) + 64U : fls64(b);
+@@ -224,6 +170,7 @@ static int add(struct allowedips_node __
+ 		RCU_INIT_POINTER(node->peer, peer);
+ 		list_add_tail(&node->peer_list, &peer->allowedips_list);
+ 		copy_and_assign_cidr(node, key, cidr, bits);
++		rcu_assign_pointer(node->parent_bit, trie);
+ 		rcu_assign_pointer(*trie, node);
+ 		return 0;
+ 	}
+@@ -243,9 +190,9 @@ static int add(struct allowedips_node __
+ 	if (!node) {
+ 		down = rcu_dereference_protected(*trie, lockdep_is_held(lock));
+ 	} else {
+-		down = rcu_dereference_protected(CHOOSE_NODE(node, key),
+-						 lockdep_is_held(lock));
++		down = rcu_dereference_protected(CHOOSE_NODE(node, key), lockdep_is_held(lock));
+ 		if (!down) {
++			rcu_assign_pointer(newnode->parent_bit, &CHOOSE_NODE(node, key));
+ 			rcu_assign_pointer(CHOOSE_NODE(node, key), newnode);
+ 			return 0;
+ 		}
+@@ -254,29 +201,37 @@ static int add(struct allowedips_node __
+ 	parent = node;
+ 
+ 	if (newnode->cidr == cidr) {
++		rcu_assign_pointer(down->parent_bit, &CHOOSE_NODE(newnode, down->bits));
+ 		rcu_assign_pointer(CHOOSE_NODE(newnode, down->bits), down);
+-		if (!parent)
++		if (!parent) {
++			rcu_assign_pointer(newnode->parent_bit, trie);
+ 			rcu_assign_pointer(*trie, newnode);
+-		else
+-			rcu_assign_pointer(CHOOSE_NODE(parent, newnode->bits),
+-					   newnode);
+-	} else {
+-		node = kzalloc(sizeof(*node), GFP_KERNEL);
+-		if (unlikely(!node)) {
+-			list_del(&newnode->peer_list);
+-			kfree(newnode);
+-			return -ENOMEM;
++		} else {
++			rcu_assign_pointer(newnode->parent_bit, &CHOOSE_NODE(parent, newnode->bits));
++			rcu_assign_pointer(CHOOSE_NODE(parent, newnode->bits), newnode);
+ 		}
+-		INIT_LIST_HEAD(&node->peer_list);
+-		copy_and_assign_cidr(node, newnode->bits, cidr, bits);
++		return 0;
++	}
++
++	node = kzalloc(sizeof(*node), GFP_KERNEL);
++	if (unlikely(!node)) {
++		list_del(&newnode->peer_list);
++		kfree(newnode);
++		return -ENOMEM;
++	}
++	INIT_LIST_HEAD(&node->peer_list);
++	copy_and_assign_cidr(node, newnode->bits, cidr, bits);
+ 
+-		rcu_assign_pointer(CHOOSE_NODE(node, down->bits), down);
+-		rcu_assign_pointer(CHOOSE_NODE(node, newnode->bits), newnode);
+-		if (!parent)
+-			rcu_assign_pointer(*trie, node);
+-		else
+-			rcu_assign_pointer(CHOOSE_NODE(parent, node->bits),
+-					   node);
++	rcu_assign_pointer(down->parent_bit, &CHOOSE_NODE(node, down->bits));
++	rcu_assign_pointer(CHOOSE_NODE(node, down->bits), down);
++	rcu_assign_pointer(newnode->parent_bit, &CHOOSE_NODE(node, newnode->bits));
++	rcu_assign_pointer(CHOOSE_NODE(node, newnode->bits), newnode);
++	if (!parent) {
++		rcu_assign_pointer(node->parent_bit, trie);
++		rcu_assign_pointer(*trie, node);
++	} else {
++		rcu_assign_pointer(node->parent_bit, &CHOOSE_NODE(parent, node->bits));
++		rcu_assign_pointer(CHOOSE_NODE(parent, node->bits), node);
+ 	}
+ 	return 0;
+ }
+@@ -335,9 +290,30 @@ int wg_allowedips_insert_v6(struct allow
+ void wg_allowedips_remove_by_peer(struct allowedips *table,
+ 				  struct wg_peer *peer, struct mutex *lock)
+ {
++	struct allowedips_node *node, *child, *tmp;
++
++	if (list_empty(&peer->allowedips_list))
++		return;
+ 	++table->seq;
+-	walk_remove_by_peer(&table->root4, peer, lock);
+-	walk_remove_by_peer(&table->root6, peer, lock);
++	list_for_each_entry_safe(node, tmp, &peer->allowedips_list, peer_list) {
++		list_del_init(&node->peer_list);
++		RCU_INIT_POINTER(node->peer, NULL);
++		if (node->bit[0] && node->bit[1])
++			continue;
++		child = rcu_dereference_protected(
++				node->bit[!rcu_access_pointer(node->bit[0])],
++				lockdep_is_held(lock));
++		if (child)
++			child->parent_bit = node->parent_bit;
++		*rcu_dereference_protected(node->parent_bit, lockdep_is_held(lock)) = child;
++		kfree_rcu(node, rcu);
++
++		/* TODO: Note that we currently don't walk up and down in order to
++		 * free any potential filler nodes. This means that this function
++		 * doesn't free up as much as it could, which could be revisited
++		 * at some point.
++		 */
++	}
+ }
+ 
+ int wg_allowedips_read_node(struct allowedips_node *node, u8 ip[16], u8 *cidr)
+--- a/drivers/net/wireguard/allowedips.h
++++ b/drivers/net/wireguard/allowedips.h
+@@ -15,14 +15,11 @@ struct wg_peer;
+ struct allowedips_node {
+ 	struct wg_peer __rcu *peer;
+ 	struct allowedips_node __rcu *bit[2];
+-	/* While it may seem scandalous that we waste space for v4,
+-	 * we're alloc'ing to the nearest power of 2 anyway, so this
+-	 * doesn't actually make a difference.
+-	 */
+-	u8 bits[16] __aligned(__alignof(u64));
+ 	u8 cidr, bit_at_a, bit_at_b, bitlen;
++	u8 bits[16] __aligned(__alignof(u64));
+ 
+-	/* Keep rarely used list at bottom to be beyond cache line. */
++	/* Keep rarely used members at bottom to be beyond cache line. */
++	struct allowedips_node *__rcu *parent_bit; /* XXX: this puts us at 68->128 bytes instead of 60->64 bytes!! */
+ 	union {
+ 		struct list_head peer_list;
+ 		struct rcu_head rcu;
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0134-wireguard-allowedips-allocate-nodes-in-kmem_cache.patch b/target/linux/generic/backport-5.4/080-wireguard-0134-wireguard-allowedips-allocate-nodes-in-kmem_cache.patch
new file mode 100644
index 0000000000..65b31b05f5
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0134-wireguard-allowedips-allocate-nodes-in-kmem_cache.patch
@@ -0,0 +1,173 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason at zx2c4.com>
+Date: Fri, 4 Jun 2021 17:17:37 +0200
+Subject: [PATCH] wireguard: allowedips: allocate nodes in kmem_cache
+
+commit dc680de28ca849dfe589dc15ac56d22505f0ef11 upstream.
+
+The previous commit moved from O(n) to O(1) for removal, but in the
+process introduced an additional pointer member to a struct that
+increased the size from 60 to 68 bytes, putting nodes in the 128-byte
+slab. With deployed systems having as many as 2 million nodes, this
+represents a significant doubling in memory usage (128 MiB -> 256 MiB).
+Fix this by using our own kmem_cache, that's sized exactly right. This
+also makes wireguard's memory usage more transparent in tools like
+slabtop and /proc/slabinfo.
+
+Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
+Suggested-by: Arnd Bergmann <arnd at arndb.de>
+Suggested-by: Matthew Wilcox <willy at infradead.org>
+Cc: stable at vger.kernel.org
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ drivers/net/wireguard/allowedips.c | 31 ++++++++++++++++++++++++------
+ drivers/net/wireguard/allowedips.h |  5 ++++-
+ drivers/net/wireguard/main.c       | 10 +++++++++-
+ 3 files changed, 38 insertions(+), 8 deletions(-)
+
+--- a/drivers/net/wireguard/allowedips.c
++++ b/drivers/net/wireguard/allowedips.c
+@@ -6,6 +6,8 @@
+ #include "allowedips.h"
+ #include "peer.h"
+ 
++static struct kmem_cache *node_cache;
++
+ static void swap_endian(u8 *dst, const u8 *src, u8 bits)
+ {
+ 	if (bits == 32) {
+@@ -40,6 +42,11 @@ static void push_rcu(struct allowedips_n
+ 	}
+ }
+ 
++static void node_free_rcu(struct rcu_head *rcu)
++{
++	kmem_cache_free(node_cache, container_of(rcu, struct allowedips_node, rcu));
++}
++
+ static void root_free_rcu(struct rcu_head *rcu)
+ {
+ 	struct allowedips_node *node, *stack[128] = {
+@@ -49,7 +56,7 @@ static void root_free_rcu(struct rcu_hea
+ 	while (len > 0 && (node = stack[--len])) {
+ 		push_rcu(stack, node->bit[0], &len);
+ 		push_rcu(stack, node->bit[1], &len);
+-		kfree(node);
++		kmem_cache_free(node_cache, node);
+ 	}
+ }
+ 
+@@ -164,7 +171,7 @@ static int add(struct allowedips_node __
+ 		return -EINVAL;
+ 
+ 	if (!rcu_access_pointer(*trie)) {
+-		node = kzalloc(sizeof(*node), GFP_KERNEL);
++		node = kmem_cache_zalloc(node_cache, GFP_KERNEL);
+ 		if (unlikely(!node))
+ 			return -ENOMEM;
+ 		RCU_INIT_POINTER(node->peer, peer);
+@@ -180,7 +187,7 @@ static int add(struct allowedips_node __
+ 		return 0;
+ 	}
+ 
+-	newnode = kzalloc(sizeof(*newnode), GFP_KERNEL);
++	newnode = kmem_cache_zalloc(node_cache, GFP_KERNEL);
+ 	if (unlikely(!newnode))
+ 		return -ENOMEM;
+ 	RCU_INIT_POINTER(newnode->peer, peer);
+@@ -213,10 +220,10 @@ static int add(struct allowedips_node __
+ 		return 0;
+ 	}
+ 
+-	node = kzalloc(sizeof(*node), GFP_KERNEL);
++	node = kmem_cache_zalloc(node_cache, GFP_KERNEL);
+ 	if (unlikely(!node)) {
+ 		list_del(&newnode->peer_list);
+-		kfree(newnode);
++		kmem_cache_free(node_cache, newnode);
+ 		return -ENOMEM;
+ 	}
+ 	INIT_LIST_HEAD(&node->peer_list);
+@@ -306,7 +313,7 @@ void wg_allowedips_remove_by_peer(struct
+ 		if (child)
+ 			child->parent_bit = node->parent_bit;
+ 		*rcu_dereference_protected(node->parent_bit, lockdep_is_held(lock)) = child;
+-		kfree_rcu(node, rcu);
++		call_rcu(&node->rcu, node_free_rcu);
+ 
+ 		/* TODO: Note that we currently don't walk up and down in order to
+ 		 * free any potential filler nodes. This means that this function
+@@ -350,4 +357,16 @@ struct wg_peer *wg_allowedips_lookup_src
+ 	return NULL;
+ }
+ 
++int __init wg_allowedips_slab_init(void)
++{
++	node_cache = KMEM_CACHE(allowedips_node, 0);
++	return node_cache ? 0 : -ENOMEM;
++}
++
++void wg_allowedips_slab_uninit(void)
++{
++	rcu_barrier();
++	kmem_cache_destroy(node_cache);
++}
++
+ #include "selftest/allowedips.c"
+--- a/drivers/net/wireguard/allowedips.h
++++ b/drivers/net/wireguard/allowedips.h
+@@ -19,7 +19,7 @@ struct allowedips_node {
+ 	u8 bits[16] __aligned(__alignof(u64));
+ 
+ 	/* Keep rarely used members at bottom to be beyond cache line. */
+-	struct allowedips_node *__rcu *parent_bit; /* XXX: this puts us at 68->128 bytes instead of 60->64 bytes!! */
++	struct allowedips_node *__rcu *parent_bit;
+ 	union {
+ 		struct list_head peer_list;
+ 		struct rcu_head rcu;
+@@ -53,4 +53,7 @@ struct wg_peer *wg_allowedips_lookup_src
+ bool wg_allowedips_selftest(void);
+ #endif
+ 
++int wg_allowedips_slab_init(void);
++void wg_allowedips_slab_uninit(void);
++
+ #endif /* _WG_ALLOWEDIPS_H */
+--- a/drivers/net/wireguard/main.c
++++ b/drivers/net/wireguard/main.c
+@@ -21,10 +21,15 @@ static int __init mod_init(void)
+ {
+ 	int ret;
+ 
++	ret = wg_allowedips_slab_init();
++	if (ret < 0)
++		goto err_allowedips;
++
+ #ifdef DEBUG
++	ret = -ENOTRECOVERABLE;
+ 	if (!wg_allowedips_selftest() || !wg_packet_counter_selftest() ||
+ 	    !wg_ratelimiter_selftest())
+-		return -ENOTRECOVERABLE;
++		goto err_peer;
+ #endif
+ 	wg_noise_init();
+ 
+@@ -50,6 +55,8 @@ err_netlink:
+ err_device:
+ 	wg_peer_uninit();
+ err_peer:
++	wg_allowedips_slab_uninit();
++err_allowedips:
+ 	return ret;
+ }
+ 
+@@ -58,6 +65,7 @@ static void __exit mod_exit(void)
+ 	wg_genetlink_uninit();
+ 	wg_device_uninit();
+ 	wg_peer_uninit();
++	wg_allowedips_slab_uninit();
+ }
+ 
+ module_init(mod_init);
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0135-wireguard-allowedips-free-empty-intermediate-nodes-w.patch b/target/linux/generic/backport-5.4/080-wireguard-0135-wireguard-allowedips-free-empty-intermediate-nodes-w.patch
new file mode 100644
index 0000000000..c044ad25af
--- /dev/null
+++ b/target/linux/generic/backport-5.4/080-wireguard-0135-wireguard-allowedips-free-empty-intermediate-nodes-w.patch
@@ -0,0 +1,521 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: "Jason A. Donenfeld" <Jason at zx2c4.com>
+Date: Fri, 4 Jun 2021 17:17:38 +0200
+Subject: [PATCH] wireguard: allowedips: free empty intermediate nodes when
+ removing single node
+
+commit bf7b042dc62a31f66d3a41dd4dfc7806f267b307 upstream.
+
+When removing single nodes, it's possible that that node's parent is an
+empty intermediate node, in which case, it too should be removed.
+Otherwise the trie fills up and never is fully emptied, leading to
+gradual memory leaks over time for tries that are modified often. There
+was originally code to do this, but was removed during refactoring in
+2016 and never reworked. Now that we have proper parent pointers from
+the previous commits, we can implement this properly.
+
+In order to reduce branching and expensive comparisons, we want to keep
+the double pointer for parent assignment (which lets us easily chain up
+to the root), but we still need to actually get the parent's base
+address. So encode the bit number into the last two bits of the pointer,
+and pack and unpack it as needed. This is a little bit clumsy but is the
+fastest and less memory wasteful of the compromises. Note that we align
+the root struct here to a minimum of 4, because it's embedded into a
+larger struct, and we're relying on having the bottom two bits for our
+flag, which would only be 16-bit aligned on m68k.
+
+The existing macro-based helpers were a bit unwieldy for adding the bit
+packing to, so this commit replaces them with safer and clearer ordinary
+functions.
+
+We add a test to the randomized/fuzzer part of the selftests, to free
+the randomized tries by-peer, refuzz it, and repeat, until it's supposed
+to be empty, and then then see if that actually resulted in the whole
+thing being emptied. That combined with kmemcheck should hopefully make
+sure this commit is doing what it should. Along the way this resulted in
+various other cleanups of the tests and fixes for recent graphviz.
+
+Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
+Cc: stable at vger.kernel.org
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
+---
+ drivers/net/wireguard/allowedips.c          | 102 ++++++------
+ drivers/net/wireguard/allowedips.h          |   4 +-
+ drivers/net/wireguard/selftest/allowedips.c | 162 ++++++++++----------
+ 3 files changed, 137 insertions(+), 131 deletions(-)
+
+--- a/drivers/net/wireguard/allowedips.c
++++ b/drivers/net/wireguard/allowedips.c
+@@ -30,8 +30,11 @@ static void copy_and_assign_cidr(struct
+ 	node->bitlen = bits;
+ 	memcpy(node->bits, src, bits / 8U);
+ }
+-#define CHOOSE_NODE(parent, key) \
+-	parent->bit[(key[parent->bit_at_a] >> parent->bit_at_b) & 1]
++
++static inline u8 choose(struct allowedips_node *node, const u8 *key)
++{
++	return (key[node->bit_at_a] >> node->bit_at_b) & 1;
++}
+ 
+ static void push_rcu(struct allowedips_node **stack,
+ 		     struct allowedips_node __rcu *p, unsigned int *len)
+@@ -112,7 +115,7 @@ static struct allowedips_node *find_node
+ 			found = node;
+ 		if (node->cidr == bits)
+ 			break;
+-		node = rcu_dereference_bh(CHOOSE_NODE(node, key));
++		node = rcu_dereference_bh(node->bit[choose(node, key)]);
+ 	}
+ 	return found;
+ }
+@@ -144,8 +147,7 @@ static bool node_placement(struct allowe
+ 			   u8 cidr, u8 bits, struct allowedips_node **rnode,
+ 			   struct mutex *lock)
+ {
+-	struct allowedips_node *node = rcu_dereference_protected(trie,
+-						lockdep_is_held(lock));
++	struct allowedips_node *node = rcu_dereference_protected(trie, lockdep_is_held(lock));
+ 	struct allowedips_node *parent = NULL;
+ 	bool exact = false;
+ 
+@@ -155,13 +157,24 @@ static bool node_placement(struct allowe
+ 			exact = true;
+ 			break;
+ 		}
+-		node = rcu_dereference_protected(CHOOSE_NODE(parent, key),
+-						 lockdep_is_held(lock));
++		node = rcu_dereference_protected(parent->bit[choose(parent, key)], lockdep_is_held(lock));
+ 	}
+ 	*rnode = parent;
+ 	return exact;
+ }
+ 
++static inline void connect_node(struct allowedips_node **parent, u8 bit, struct allowedips_node *node)
++{
++	node->parent_bit_packed = (unsigned long)parent | bit;
++	rcu_assign_pointer(*parent, node);
++}
++
++static inline void choose_and_connect_node(struct allowedips_node *parent, struct allowedips_node *node)
++{
++	u8 bit = choose(parent, node->bits);
++	connect_node(&parent->bit[bit], bit, node);
++}
++
+ static int add(struct allowedips_node __rcu **trie, u8 bits, const u8 *key,
+ 	       u8 cidr, struct wg_peer *peer, struct mutex *lock)
+ {
+@@ -177,8 +190,7 @@ static int add(struct allowedips_node __
+ 		RCU_INIT_POINTER(node->peer, peer);
+ 		list_add_tail(&node->peer_list, &peer->allowedips_list);
+ 		copy_and_assign_cidr(node, key, cidr, bits);
+-		rcu_assign_pointer(node->parent_bit, trie);
+-		rcu_assign_pointer(*trie, node);
++		connect_node(trie, 2, node);
+ 		return 0;
+ 	}
+ 	if (node_placement(*trie, key, cidr, bits, &node, lock)) {
+@@ -197,10 +209,10 @@ static int add(struct allowedips_node __
+ 	if (!node) {
+ 		down = rcu_dereference_protected(*trie, lockdep_is_held(lock));
+ 	} else {
+-		down = rcu_dereference_protected(CHOOSE_NODE(node, key), lockdep_is_held(lock));
++		const u8 bit = choose(node, key);
++		down = rcu_dereference_protected(node->bit[bit], lockdep_is_held(lock));
+ 		if (!down) {
+-			rcu_assign_pointer(newnode->parent_bit, &CHOOSE_NODE(node, key));
+-			rcu_assign_pointer(CHOOSE_NODE(node, key), newnode);
++			connect_node(&node->bit[bit], bit, newnode);
+ 			return 0;
+ 		}
+ 	}
+@@ -208,15 +220,11 @@ static int add(struct allowedips_node __
+ 	parent = node;
+ 
+ 	if (newnode->cidr == cidr) {
+-		rcu_assign_pointer(down->parent_bit, &CHOOSE_NODE(newnode, down->bits));
+-		rcu_assign_pointer(CHOOSE_NODE(newnode, down->bits), down);
+-		if (!parent) {
+-			rcu_assign_pointer(newnode->parent_bit, trie);
+-			rcu_assign_pointer(*trie, newnode);
+-		} else {
+-			rcu_assign_pointer(newnode->parent_bit, &CHOOSE_NODE(parent, newnode->bits));
+-			rcu_assign_pointer(CHOOSE_NODE(parent, newnode->bits), newnode);
+-		}
++		choose_and_connect_node(newnode, down);
++		if (!parent)
++			connect_node(trie, 2, newnode);
++		else
++			choose_and_connect_node(parent, newnode);
+ 		return 0;
+ 	}
+ 
+@@ -229,17 +237,12 @@ static int add(struct allowedips_node __
+ 	INIT_LIST_HEAD(&node->peer_list);
+ 	copy_and_assign_cidr(node, newnode->bits, cidr, bits);
+ 
+-	rcu_assign_pointer(down->parent_bit, &CHOOSE_NODE(node, down->bits));
+-	rcu_assign_pointer(CHOOSE_NODE(node, down->bits), down);
+-	rcu_assign_pointer(newnode->parent_bit, &CHOOSE_NODE(node, newnode->bits));
+-	rcu_assign_pointer(CHOOSE_NODE(node, newnode->bits), newnode);
+-	if (!parent) {
+-		rcu_assign_pointer(node->parent_bit, trie);
+-		rcu_assign_pointer(*trie, node);
+-	} else {
+-		rcu_assign_pointer(node->parent_bit, &CHOOSE_NODE(parent, node->bits));
+-		rcu_assign_pointer(CHOOSE_NODE(parent, node->bits), node);
+-	}
++	choose_and_connect_node(node, down);
++	choose_and_connect_node(node, newnode);
++	if (!parent)
++		connect_node(trie, 2, node);
++	else
++		choose_and_connect_node(parent, node);
+ 	return 0;
+ }
+ 
+@@ -297,7 +300,8 @@ int wg_allowedips_insert_v6(struct allow
+ void wg_allowedips_remove_by_peer(struct allowedips *table,
+ 				  struct wg_peer *peer, struct mutex *lock)
+ {
+-	struct allowedips_node *node, *child, *tmp;
++	struct allowedips_node *node, *child, **parent_bit, *parent, *tmp;
++	bool free_parent;
+ 
+ 	if (list_empty(&peer->allowedips_list))
+ 		return;
+@@ -307,19 +311,29 @@ void wg_allowedips_remove_by_peer(struct
+ 		RCU_INIT_POINTER(node->peer, NULL);
+ 		if (node->bit[0] && node->bit[1])
+ 			continue;
+-		child = rcu_dereference_protected(
+-				node->bit[!rcu_access_pointer(node->bit[0])],
+-				lockdep_is_held(lock));
++		child = rcu_dereference_protected(node->bit[!rcu_access_pointer(node->bit[0])],
++						  lockdep_is_held(lock));
+ 		if (child)
+-			child->parent_bit = node->parent_bit;
+-		*rcu_dereference_protected(node->parent_bit, lockdep_is_held(lock)) = child;
++			child->parent_bit_packed = node->parent_bit_packed;
++		parent_bit = (struct allowedips_node **)(node->parent_bit_packed & ~3UL);
++		*parent_bit = child;
++		parent = (void *)parent_bit -
++			 offsetof(struct allowedips_node, bit[node->parent_bit_packed & 1]);
++		free_parent = !rcu_access_pointer(node->bit[0]) &&
++			      !rcu_access_pointer(node->bit[1]) &&
++			      (node->parent_bit_packed & 3) <= 1 &&
++			      !rcu_access_pointer(parent->peer);
++		if (free_parent)
++			child = rcu_dereference_protected(
++					parent->bit[!(node->parent_bit_packed & 1)],
++					lockdep_is_held(lock));
+ 		call_rcu(&node->rcu, node_free_rcu);
+-
+-		/* TODO: Note that we currently don't walk up and down in order to
+-		 * free any potential filler nodes. This means that this function
+-		 * doesn't free up as much as it could, which could be revisited
+-		 * at some point.
+-		 */
++		if (!free_parent)
++			continue;
++		if (child)
++			child->parent_bit_packed = parent->parent_bit_packed;
++		*(struct allowedips_node **)(parent->parent_bit_packed & ~3UL) = child;
++		call_rcu(&parent->rcu, node_free_rcu);
+ 	}
+ }
+ 
+--- a/drivers/net/wireguard/allowedips.h
++++ b/drivers/net/wireguard/allowedips.h
+@@ -19,7 +19,7 @@ struct allowedips_node {
+ 	u8 bits[16] __aligned(__alignof(u64));
+ 
+ 	/* Keep rarely used members at bottom to be beyond cache line. */
+-	struct allowedips_node *__rcu *parent_bit;
++	unsigned long parent_bit_packed;
+ 	union {
+ 		struct list_head peer_list;
+ 		struct rcu_head rcu;
+@@ -30,7 +30,7 @@ struct allowedips {
+ 	struct allowedips_node __rcu *root4;
+ 	struct allowedips_node __rcu *root6;
+ 	u64 seq;
+-};
++} __aligned(4); /* We pack the lower 2 bits of &root, but m68k only gives 16-bit alignment. */
+ 
+ void wg_allowedips_init(struct allowedips *table);
+ void wg_allowedips_free(struct allowedips *table, struct mutex *mutex);
+--- a/drivers/net/wireguard/selftest/allowedips.c
++++ b/drivers/net/wireguard/selftest/allowedips.c
+@@ -19,32 +19,22 @@
+ 
+ #include <linux/siphash.h>
+ 
+-static __init void swap_endian_and_apply_cidr(u8 *dst, const u8 *src, u8 bits,
+-					      u8 cidr)
+-{
+-	swap_endian(dst, src, bits);
+-	memset(dst + (cidr + 7) / 8, 0, bits / 8 - (cidr + 7) / 8);
+-	if (cidr)
+-		dst[(cidr + 7) / 8 - 1] &= ~0U << ((8 - (cidr % 8)) % 8);
+-}
+-
+ static __init void print_node(struct allowedips_node *node, u8 bits)
+ {
+ 	char *fmt_connection = KERN_DEBUG "\t\"%p/%d\" -> \"%p/%d\";\n";
+-	char *fmt_declaration = KERN_DEBUG
+-		"\t\"%p/%d\"[style=%s, color=\"#%06x\"];\n";
++	char *fmt_declaration = KERN_DEBUG "\t\"%p/%d\"[style=%s, color=\"#%06x\"];\n";
++	u8 ip1[16], ip2[16], cidr1, cidr2;
+ 	char *style = "dotted";
+-	u8 ip1[16], ip2[16];
+ 	u32 color = 0;
+ 
++	if (node == NULL)
++		return;
+ 	if (bits == 32) {
+ 		fmt_connection = KERN_DEBUG "\t\"%pI4/%d\" -> \"%pI4/%d\";\n";
+-		fmt_declaration = KERN_DEBUG
+-			"\t\"%pI4/%d\"[style=%s, color=\"#%06x\"];\n";
++		fmt_declaration = KERN_DEBUG "\t\"%pI4/%d\"[style=%s, color=\"#%06x\"];\n";
+ 	} else if (bits == 128) {
+ 		fmt_connection = KERN_DEBUG "\t\"%pI6/%d\" -> \"%pI6/%d\";\n";
+-		fmt_declaration = KERN_DEBUG
+-			"\t\"%pI6/%d\"[style=%s, color=\"#%06x\"];\n";
++		fmt_declaration = KERN_DEBUG "\t\"%pI6/%d\"[style=%s, color=\"#%06x\"];\n";
+ 	}
+ 	if (node->peer) {
+ 		hsiphash_key_t key = { { 0 } };
+@@ -55,24 +45,20 @@ static __init void print_node(struct all
+ 			hsiphash_1u32(0xabad1dea, &key) % 200;
+ 		style = "bold";
+ 	}
+-	swap_endian_and_apply_cidr(ip1, node->bits, bits, node->cidr);
+-	printk(fmt_declaration, ip1, node->cidr, style, color);
++	wg_allowedips_read_node(node, ip1, &cidr1);
++	printk(fmt_declaration, ip1, cidr1, style, color);
+ 	if (node->bit[0]) {
+-		swap_endian_and_apply_cidr(ip2,
+-				rcu_dereference_raw(node->bit[0])->bits, bits,
+-				node->cidr);
+-		printk(fmt_connection, ip1, node->cidr, ip2,
+-		       rcu_dereference_raw(node->bit[0])->cidr);
+-		print_node(rcu_dereference_raw(node->bit[0]), bits);
++		wg_allowedips_read_node(rcu_dereference_raw(node->bit[0]), ip2, &cidr2);
++		printk(fmt_connection, ip1, cidr1, ip2, cidr2);
+ 	}
+ 	if (node->bit[1]) {
+-		swap_endian_and_apply_cidr(ip2,
+-				rcu_dereference_raw(node->bit[1])->bits,
+-				bits, node->cidr);
+-		printk(fmt_connection, ip1, node->cidr, ip2,
+-		       rcu_dereference_raw(node->bit[1])->cidr);
+-		print_node(rcu_dereference_raw(node->bit[1]), bits);
++		wg_allowedips_read_node(rcu_dereference_raw(node->bit[1]), ip2, &cidr2);
++		printk(fmt_connection, ip1, cidr1, ip2, cidr2);
+ 	}
++	if (node->bit[0])
++		print_node(rcu_dereference_raw(node->bit[0]), bits);
++	if (node->bit[1])
++		print_node(rcu_dereference_raw(node->bit[1]), bits);
+ }
+ 
+ static __init void print_tree(struct allowedips_node __rcu *top, u8 bits)
+@@ -121,8 +107,8 @@ static __init inline union nf_inet_addr
+ {
+ 	union nf_inet_addr mask;
+ 
+-	memset(&mask, 0x00, 128 / 8);
+-	memset(&mask, 0xff, cidr / 8);
++	memset(&mask, 0, sizeof(mask));
++	memset(&mask.all, 0xff, cidr / 8);
+ 	if (cidr % 32)
+ 		mask.all[cidr / 32] = (__force u32)htonl(
+ 			(0xFFFFFFFFUL << (32 - (cidr % 32))) & 0xFFFFFFFFUL);
+@@ -149,42 +135,36 @@ horrible_mask_self(struct horrible_allow
+ }
+ 
+ static __init inline bool
+-horrible_match_v4(const struct horrible_allowedips_node *node,
+-		  struct in_addr *ip)
++horrible_match_v4(const struct horrible_allowedips_node *node, struct in_addr *ip)
+ {
+ 	return (ip->s_addr & node->mask.ip) == node->ip.ip;
+ }
+ 
+ static __init inline bool
+-horrible_match_v6(const struct horrible_allowedips_node *node,
+-		  struct in6_addr *ip)
++horrible_match_v6(const struct horrible_allowedips_node *node, struct in6_addr *ip)
+ {
+-	return (ip->in6_u.u6_addr32[0] & node->mask.ip6[0]) ==
+-		       node->ip.ip6[0] &&
+-	       (ip->in6_u.u6_addr32[1] & node->mask.ip6[1]) ==
+-		       node->ip.ip6[1] &&
+-	       (ip->in6_u.u6_addr32[2] & node->mask.ip6[2]) ==
+-		       node->ip.ip6[2] &&
++	return (ip->in6_u.u6_addr32[0] & node->mask.ip6[0]) == node->ip.ip6[0] &&
++	       (ip->in6_u.u6_addr32[1] & node->mask.ip6[1]) == node->ip.ip6[1] &&
++	       (ip->in6_u.u6_addr32[2] & node->mask.ip6[2]) == node->ip.ip6[2] &&
+ 	       (ip->in6_u.u6_addr32[3] & node->mask.ip6[3]) == node->ip.ip6[3];
+ }
+ 
+ static __init void
+-horrible_insert_ordered(struct horrible_allowedips *table,
+-			struct horrible_allowedips_node *node)
++horrible_insert_ordered(struct horrible_allowedips *table, struct horrible_allowedips_node *node)
+ {
+ 	struct horrible_allowedips_node *other = NULL, *where = NULL;
+ 	u8 my_cidr = horrible_mask_to_cidr(node->mask);
+ 
+ 	hlist_for_each_entry(other, &table->head, table) {
+-		if (!memcmp(&other->mask, &node->mask,
+-			    sizeof(union nf_inet_addr)) &&
+-		    !memcmp(&other->ip, &node->ip,
+-			    sizeof(union nf_inet_addr)) &&
+-		    other->ip_version == node->ip_version) {
++		if (other->ip_version == node->ip_version &&
++		    !memcmp(&other->mask, &node->mask, sizeof(union nf_inet_addr)) &&
++		    !memcmp(&other->ip, &node->ip, sizeof(union nf_inet_addr))) {
+ 			other->value = node->value;
+ 			kfree(node);
+ 			return;
+ 		}
++	}
++	hlist_for_each_entry(other, &table->head, table) {
+ 		where = other;
+ 		if (horrible_mask_to_cidr(other->mask) <= my_cidr)
+ 			break;
+@@ -201,8 +181,7 @@ static __init int
+ horrible_allowedips_insert_v4(struct horrible_allowedips *table,
+ 			      struct in_addr *ip, u8 cidr, void *value)
+ {
+-	struct horrible_allowedips_node *node = kzalloc(sizeof(*node),
+-							GFP_KERNEL);
++	struct horrible_allowedips_node *node = kzalloc(sizeof(*node), GFP_KERNEL);
+ 
+ 	if (unlikely(!node))
+ 		return -ENOMEM;
+@@ -219,8 +198,7 @@ static __init int
+ horrible_allowedips_insert_v6(struct horrible_allowedips *table,
+ 			      struct in6_addr *ip, u8 cidr, void *value)
+ {
+-	struct horrible_allowedips_node *node = kzalloc(sizeof(*node),
+-							GFP_KERNEL);
++	struct horrible_allowedips_node *node = kzalloc(sizeof(*node), GFP_KERNEL);
+ 
+ 	if (unlikely(!node))
+ 		return -ENOMEM;
+@@ -234,39 +212,43 @@ horrible_allowedips_insert_v6(struct hor
+ }
+ 
+ static __init void *
+-horrible_allowedips_lookup_v4(struct horrible_allowedips *table,
+-			      struct in_addr *ip)
++horrible_allowedips_lookup_v4(struct horrible_allowedips *table, struct in_addr *ip)
+ {
+ 	struct horrible_allowedips_node *node;
+-	void *ret = NULL;
+ 
+ 	hlist_for_each_entry(node, &table->head, table) {
+-		if (node->ip_version != 4)
+-			continue;
+-		if (horrible_match_v4(node, ip)) {
+-			ret = node->value;
+-			break;
+-		}
++		if (node->ip_version == 4 && horrible_match_v4(node, ip))
++			return node->value;
+ 	}
+-	return ret;
++	return NULL;
+ }
+ 
+ static __init void *
+-horrible_allowedips_lookup_v6(struct horrible_allowedips *table,
+-			      struct in6_addr *ip)
++horrible_allowedips_lookup_v6(struct horrible_allowedips *table, struct in6_addr *ip)
+ {
+ 	struct horrible_allowedips_node *node;
+-	void *ret = NULL;
+ 
+ 	hlist_for_each_entry(node, &table->head, table) {
+-		if (node->ip_version != 6)
++		if (node->ip_version == 6 && horrible_match_v6(node, ip))
++			return node->value;
++	}
++	return NULL;
++}
++
++
++static __init void
++horrible_allowedips_remove_by_value(struct horrible_allowedips *table, void *value)
++{
++	struct horrible_allowedips_node *node;
++	struct hlist_node *h;
++
++	hlist_for_each_entry_safe(node, h, &table->head, table) {
++		if (node->value != value)
+ 			continue;
+-		if (horrible_match_v6(node, ip)) {
+-			ret = node->value;
+-			break;
+-		}
++		hlist_del(&node->table);
++		kfree(node);
+ 	}
+-	return ret;
++
+ }
+ 
+ static __init bool randomized_test(void)
+@@ -397,23 +379,33 @@ static __init bool randomized_test(void)
+ 		print_tree(t.root6, 128);
+ 	}
+ 
+-	for (i = 0; i < NUM_QUERIES; ++i) {
+-		prandom_bytes(ip, 4);
+-		if (lookup(t.root4, 32, ip) !=
+-		    horrible_allowedips_lookup_v4(&h, (struct in_addr *)ip)) {
+-			pr_err("allowedips random self-test: FAIL\n");
+-			goto free;
++	for (j = 0;; ++j) {
++		for (i = 0; i < NUM_QUERIES; ++i) {
++			prandom_bytes(ip, 4);
++			if (lookup(t.root4, 32, ip) != horrible_allowedips_lookup_v4(&h, (struct in_addr *)ip)) {
++				horrible_allowedips_lookup_v4(&h, (struct in_addr *)ip);
++				pr_err("allowedips random v4 self-test: FAIL\n");
++				goto free;
++			}
++			prandom_bytes(ip, 16);
++			if (lookup(t.root6, 128, ip) != horrible_allowedips_lookup_v6(&h, (struct in6_addr *)ip)) {
++				pr_err("allowedips random v6 self-test: FAIL\n");
++				goto free;
++			}
+ 		}
++		if (j >= NUM_PEERS)
++			break;
++		mutex_lock(&mutex);
++		wg_allowedips_remove_by_peer(&t, peers[j], &mutex);
++		mutex_unlock(&mutex);
++		horrible_allowedips_remove_by_value(&h, peers[j]);
+ 	}
+ 
+-	for (i = 0; i < NUM_QUERIES; ++i) {
+-		prandom_bytes(ip, 16);
+-		if (lookup(t.root6, 128, ip) !=
+-		    horrible_allowedips_lookup_v6(&h, (struct in6_addr *)ip)) {
+-			pr_err("allowedips random self-test: FAIL\n");
+-			goto free;
+-		}
++	if (t.root4 || t.root6) {
++		pr_err("allowedips random self-test removal: FAIL\n");
++		goto free;
+ 	}
++
+ 	ret = true;
+ 
+ free:


From lede-commits at lists.infradead.org  Tue Jun 22 23:23:21 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 23 Jun 2021 02:23:21 -0400
Subject: [openwrt/openwrt]  ramips: mt7620: remove useless GMAC nodes
In-Reply-To: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
References: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
Message-ID: <mailman.2388.1624429406.1072.lede-commits@lists.infradead.org>

981213 pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/a2acdf9607045e5669c305c57dd7c77be8351ba0

commit a2acdf9607045e5669c305c57dd7c77be8351ba0
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Fri Jun 11 14:54:43 2021 -0400

    ramips: mt7620: remove useless GMAC nodes
    
    These nodes are used for configuring a GMAC interface
    and for defining external PHYs to be accessed with MDIO.
    
    None of this is possible on MT7620N, only MT7620A,
    so remove them from all MT7620N DTS.
    
    When the mdio-bus node is missing, the driver returns -NODEV
    which causes the internal switch to not initialize.
    Replace that return so that everything works without the DTS node.
    
    Also, an extra kernel message to indicate for all error conditions
    that mdio-bus is disabled.
    
    Fixes: d482356322c9 ("ramips: mt7620n: add mdio node and disable port4 by default")
    Fixes: aa5014dd1a58 ("ramips: mt7620n: enable port 4 as EPHY by default")
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 target/linux/ramips/dts/mt7620n.dtsi                       | 14 --------------
 target/linux/ramips/dts/mt7620n_dlink_dwr-921-c1.dts       |  6 ------
 target/linux/ramips/dts/mt7620n_dlink_dwr-922-e2.dts       |  6 ------
 .../linux/ramips/files/drivers/net/ethernet/ralink/mdio.c  |  5 ++++-
 4 files changed, 4 insertions(+), 27 deletions(-)

diff --git a/target/linux/ramips/dts/mt7620n.dtsi b/target/linux/ramips/dts/mt7620n.dtsi
index d225cb25d8..276bc13733 100644
--- a/target/linux/ramips/dts/mt7620n.dtsi
+++ b/target/linux/ramips/dts/mt7620n.dtsi
@@ -322,20 +322,6 @@
 		reset-names = "fe", "esw";
 
 		mediatek,switch = <&gsw>;
-
-		mdio-bus {
-			#address-cells = <1>;
-			#size-cells = <0>;
-
-			status = "disabled";
-		};
-
-		port at 4 {
-			compatible = "mediatek,mt7620a-gsw-port", "mediatek,eth-port";
-			reg = <4>;
-
-			status = "disabled";
-		};
 	};
 
 	gsw: gsw at 10110000 {
diff --git a/target/linux/ramips/dts/mt7620n_dlink_dwr-921-c1.dts b/target/linux/ramips/dts/mt7620n_dlink_dwr-921-c1.dts
index c784839c34..d37bdb4013 100644
--- a/target/linux/ramips/dts/mt7620n_dlink_dwr-921-c1.dts
+++ b/target/linux/ramips/dts/mt7620n_dlink_dwr-921-c1.dts
@@ -133,12 +133,6 @@
 	status = "okay";
 };
 
-&ethernet {
-	port at 4 {
-		status = "okay";
-	};
-};
-
 &state_default {
 	default {
 		groups = "spi refclk", "i2c", "ephy", "wled";
diff --git a/target/linux/ramips/dts/mt7620n_dlink_dwr-922-e2.dts b/target/linux/ramips/dts/mt7620n_dlink_dwr-922-e2.dts
index 9400394d89..d3ca0dd53f 100644
--- a/target/linux/ramips/dts/mt7620n_dlink_dwr-922-e2.dts
+++ b/target/linux/ramips/dts/mt7620n_dlink_dwr-922-e2.dts
@@ -136,12 +136,6 @@
 	status = "okay";
 };
 
-&ethernet {
-	port at 4 {
-		status = "okay";
-	};
-};
-
 &state_default {
 	default {
 		groups = "spi refclk", "i2c", "ephy", "wled";
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c
index dceb08b835..b923b02af9 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mdio.c
@@ -232,7 +232,8 @@ int fe_mdio_init(struct fe_priv *priv)
 	mii_np = of_get_child_by_name(priv->dev->of_node, "mdio-bus");
 	if (!mii_np) {
 		dev_err(priv->dev, "no %s child node found", "mdio-bus");
-		return -ENODEV;
+		err = 0;
+		goto err_no_bus;
 	}
 
 	if (!of_device_is_available(mii_np)) {
@@ -264,6 +265,8 @@ err_free_bus:
 	kfree(priv->mii_bus);
 err_put_node:
 	of_node_put(mii_np);
+err_no_bus:
+	dev_err(priv->dev, "%s disabled", "mdio-bus");
 	priv->mii_bus = NULL;
 	return err;
 }


From lede-commits at lists.infradead.org  Tue Jun 22 23:23:23 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 23 Jun 2021 02:23:23 -0400
Subject: [openwrt/openwrt] ramips: mt7620: allow both internal and external
 PHYs
In-Reply-To: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
References: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
Message-ID: <mailman.2389.1624429406.1072.lede-commits@lists.infradead.org>

981213 pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/de5394a29dae9356a830d043e76591698411e97a

commit de5394a29dae9356a830d043e76591698411e97a
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Tue Apr 20 18:45:15 2021 -0400

    ramips: mt7620: allow both internal and external PHYs
    
    When the new variable ephy_base was introduced,
    it was not applied to the if block for mdio_mode.
    
    The first line in the mdio_mode if block
    sets the EPHY base address to 12 in the SOC by writing a register,
    but the corresponding variable in the driver
    was still set to the default of 0.
    
    This causes subsequent lines that write registers with the function
    _mt7620_mii_write
    to write to PHY addresses 0 through 4
    while internal PHYs have been moved to addresses 12 through 16.
    
    All of these lines are intended only for PHYs on the SOC internal switch,
    however, they are being written to external ethernet switches
    if they exist at those PHY addresses 0 through 4.
    This causes some ethernet ports to be broken on boards with AR8327 or QCA8337 switch.
    
    Other suggested fixes move those lines to the else block of mdio_mode,
    but removing the else block completely also fixes it.
    
    Therefore, move the lines to the mt7620_hw_init function main block,
    and have only one instance of the function mtk_switch_w32
    for writing the register with the EPHY base address.
    
    In theory, this also allows for boards that have both external switches
    and internal PHYs that lead to ethernet ports to be supported.
    
    Fixes: 391df3782914 ("ramips: mt7620: add EPHY base mdio address changing possibility")
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 .../files/drivers/net/ethernet/ralink/gsw_mt7620.c | 119 ++++++++++-----------
 1 file changed, 57 insertions(+), 62 deletions(-)

diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
index 2a34e9417d..4b030f457b 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
@@ -98,12 +98,8 @@ static void mt7620_hw_init(struct mt7620_gsw *gsw, int mdio_mode)
 	mtk_switch_w32(gsw, mtk_switch_r32(gsw, GSW_REG_MIB_CNT_EN) | (1 << 1), GSW_REG_MIB_CNT_EN);
 
 	if (mdio_mode) {
-		u32 val;
-
-		/* turn off ephy and set phy base addr to 12 */
-		mtk_switch_w32(gsw, mtk_switch_r32(gsw, GSW_REG_GPC1) |
-			(0x1f << 24) | (0xc << 16),
-			GSW_REG_GPC1);
+		if (!gsw->ephy_base)
+			gsw->ephy_base = 12;
 
 		/* set MT7530 central align */
 		val = mt7530_mdio_r32(gsw, 0x7830);
@@ -116,64 +112,63 @@ static void mt7620_hw_init(struct mt7620_gsw *gsw, int mdio_mode)
 		mt7530_mdio_w32(gsw, 0x7a40, val);
 
 		mt7530_mdio_w32(gsw, 0x7a78, 0x855);
-	} else {
+	}
 
-		if (gsw->ephy_base) {
-			/* set phy base addr to ephy_base */
-			mtk_switch_w32(gsw, mtk_switch_r32(gsw, GSW_REG_GPC1) |
-				(gsw->ephy_base << 16),
-				GSW_REG_GPC1);
-			fe_reset(BIT(24)); /* Resets the Ethernet PHY block. */
-		}
+	if (gsw->ephy_base) {
+		/* set phy base addr to ephy_base */
+		mtk_switch_w32(gsw, mtk_switch_r32(gsw, GSW_REG_GPC1) |
+			(gsw->ephy_base << 16),
+			GSW_REG_GPC1);
+		fe_reset(BIT(24)); /* Resets the Ethernet PHY block. */
+	}
 
-		/* global page 4 */
-		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 31, 0x4000);
-
-		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 17, 0x7444);
-		if (is_BGA)
-			_mt7620_mii_write(gsw, gsw->ephy_base + 1, 19, 0x0114);
-		else
-			_mt7620_mii_write(gsw, gsw->ephy_base + 1, 19, 0x0117);
-
-		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 22, 0x10cf);
-		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 25, 0x6212);
-		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 26, 0x0777);
-		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 29, 0x4000);
-		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 28, 0xc077);
-		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 24, 0x0000);
-
-		/* global page 3 */
-		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 31, 0x3000);
-		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 17, 0x4838);
-
-		/* global page 2 */
-		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 31, 0x2000);
-		if (is_BGA) {
-			_mt7620_mii_write(gsw, gsw->ephy_base + 1, 21, 0x0515);
-			_mt7620_mii_write(gsw, gsw->ephy_base + 1, 22, 0x0053);
-			_mt7620_mii_write(gsw, gsw->ephy_base + 1, 23, 0x00bf);
-			_mt7620_mii_write(gsw, gsw->ephy_base + 1, 24, 0x0aaf);
-			_mt7620_mii_write(gsw, gsw->ephy_base + 1, 25, 0x0fad);
-			_mt7620_mii_write(gsw, gsw->ephy_base + 1, 26, 0x0fc1);
-		} else {
-			_mt7620_mii_write(gsw, gsw->ephy_base + 1, 21, 0x0517);
-			_mt7620_mii_write(gsw, gsw->ephy_base + 1, 22, 0x0fd2);
-			_mt7620_mii_write(gsw, gsw->ephy_base + 1, 23, 0x00bf);
-			_mt7620_mii_write(gsw, gsw->ephy_base + 1, 24, 0x0aab);
-			_mt7620_mii_write(gsw, gsw->ephy_base + 1, 25, 0x00ae);
-			_mt7620_mii_write(gsw, gsw->ephy_base + 1, 26, 0x0fff);
-		}
-		/* global page 1 */
-		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 31, 0x1000);
-		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 17, 0xe7f8);
-
-		/* turn on all PHYs */
-		for (i = 0; i <= 4; i++) {
-			val = _mt7620_mii_read(gsw, gsw->ephy_base + i, MII_BMCR);
-			val &= ~BMCR_PDOWN;
-			val |= BMCR_ANRESTART | BMCR_ANENABLE | BMCR_SPEED100;
-			_mt7620_mii_write(gsw, gsw->ephy_base + i, MII_BMCR, val);
-		}
+	/* global page 4 */
+	_mt7620_mii_write(gsw, gsw->ephy_base + 1, 31, 0x4000);
+
+	_mt7620_mii_write(gsw, gsw->ephy_base + 1, 17, 0x7444);
+	if (is_BGA)
+		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 19, 0x0114);
+	else
+		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 19, 0x0117);
+
+	_mt7620_mii_write(gsw, gsw->ephy_base + 1, 22, 0x10cf);
+	_mt7620_mii_write(gsw, gsw->ephy_base + 1, 25, 0x6212);
+	_mt7620_mii_write(gsw, gsw->ephy_base + 1, 26, 0x0777);
+	_mt7620_mii_write(gsw, gsw->ephy_base + 1, 29, 0x4000);
+	_mt7620_mii_write(gsw, gsw->ephy_base + 1, 28, 0xc077);
+	_mt7620_mii_write(gsw, gsw->ephy_base + 1, 24, 0x0000);
+
+	/* global page 3 */
+	_mt7620_mii_write(gsw, gsw->ephy_base + 1, 31, 0x3000);
+	_mt7620_mii_write(gsw, gsw->ephy_base + 1, 17, 0x4838);
+
+	/* global page 2 */
+	_mt7620_mii_write(gsw, gsw->ephy_base + 1, 31, 0x2000);
+	if (is_BGA) {
+		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 21, 0x0515);
+		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 22, 0x0053);
+		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 23, 0x00bf);
+		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 24, 0x0aaf);
+		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 25, 0x0fad);
+		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 26, 0x0fc1);
+	} else {
+		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 21, 0x0517);
+		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 22, 0x0fd2);
+		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 23, 0x00bf);
+		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 24, 0x0aab);
+		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 25, 0x00ae);
+		_mt7620_mii_write(gsw, gsw->ephy_base + 1, 26, 0x0fff);
+	}
+	/* global page 1 */
+	_mt7620_mii_write(gsw, gsw->ephy_base + 1, 31, 0x1000);
+	_mt7620_mii_write(gsw, gsw->ephy_base + 1, 17, 0xe7f8);
+
+	/* turn on all PHYs */
+	for (i = 0; i <= 4; i++) {
+		val = _mt7620_mii_read(gsw, gsw->ephy_base + i, MII_BMCR);
+		val &= ~BMCR_PDOWN;
+		val |= BMCR_ANRESTART | BMCR_ANENABLE | BMCR_SPEED100;
+		_mt7620_mii_write(gsw, gsw->ephy_base + i, MII_BMCR, val);
 	}
 
 	/* global page 0 */


From lede-commits at lists.infradead.org  Tue Jun 22 23:23:26 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 23 Jun 2021 02:23:26 -0400
Subject: [openwrt/openwrt] ramips: mt7620: add ephy-disable option to switch
 driver
In-Reply-To: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
References: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
Message-ID: <mailman.2390.1624429409.1072.lede-commits@lists.infradead.org>

981213 pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/cc6fd6fbb505071e08011f7998afaffefcf08fd3

commit cc6fd6fbb505071e08011f7998afaffefcf08fd3
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Mon May 31 03:56:20 2021 -0400

    ramips: mt7620: add ephy-disable option to switch driver
    
    Add back the register write to disable internal PHYs
    as a separate option in the code that can be set using a DTS property.
    
    Set the option to true by default
    when an external mt7530 switch is identified.
    
    This makes the driver more in sync with original SDK code
    while keeping the lines separated into different options
    to accommodate any board with any PHY layout.
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 .../ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c  | 14 ++++++++++++--
 .../ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h  |  1 +
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
index 67f70f286d..ae90f0484d 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
@@ -73,7 +73,13 @@ static void mt7620_hw_init(struct mt7620_gsw *gsw)
 	/* Enable MIB stats */
 	mtk_switch_w32(gsw, mtk_switch_r32(gsw, GSW_REG_MIB_CNT_EN) | (1 << 1), GSW_REG_MIB_CNT_EN);
 
-	if (gsw->ephy_base) {
+	if (gsw->ephy_disable) {
+		mtk_switch_w32(gsw, mtk_switch_r32(gsw, GSW_REG_GPC1) |
+			(gsw->ephy_base << 16) | (0x1f << 24),
+			GSW_REG_GPC1);
+
+		pr_info("gsw: internal ephy disabled\n");
+	} else if (gsw->ephy_base) {
 		mtk_switch_w32(gsw, mtk_switch_r32(gsw, GSW_REG_GPC1) |
 			(gsw->ephy_base << 16),
 			GSW_REG_GPC1);
@@ -194,13 +200,17 @@ int mtk_gsw_init(struct fe_priv *priv)
 	gsw = platform_get_drvdata(pdev);
 	priv->soc->swpriv = gsw;
 
+	gsw->ephy_disable = of_property_read_bool(np, "mediatek,ephy-disable");
+
 	mdiobus_node = of_get_child_by_name(eth_node, "mdio-bus");
 	if (mdiobus_node) {
 		for_each_child_of_node(mdiobus_node, phy_node) {
 			id = of_get_property(phy_node, "reg", NULL);
 			if (id && (be32_to_cpu(*id) == 0x1f))
-				of_node_put(mdiobus_node);
+				gsw->ephy_disable = true;
 		}
+
+		of_node_put(mdiobus_node);
 	}
 
 	gsw->port4_ephy = !of_property_read_bool(np, "mediatek,port4-gmac");
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h
index 91a0399976..fde7792c02 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h
@@ -92,6 +92,7 @@ struct mt7620_gsw {
 	struct device		*dev;
 	void __iomem		*base;
 	int			irq;
+	bool			ephy_disable;
 	bool			port4_ephy;
 	unsigned long int	autopoll;
 	u16			ephy_base;


From lede-commits at lists.infradead.org  Tue Jun 22 23:23:22 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 23 Jun 2021 02:23:22 -0400
Subject: [openwrt/openwrt] ramips: mt7620: fix ethernet driver GMAC port init
In-Reply-To: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
References: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
Message-ID: <mailman.2391.1624429409.1072.lede-commits@lists.infradead.org>

981213 pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/afd60d650e769e9578eac5bb3647807f683aaf7c

commit afd60d650e769e9578eac5bb3647807f683aaf7c
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Tue Jun 1 23:01:26 2021 -0400

    ramips: mt7620: fix ethernet driver GMAC port init
    
    A workaround was added to the switch driver
    to set SOC port 4 as an RGMII GMAC interface
    based on the DTS property mediatek,port4-gmac.
    (previously mediatek,port4)
    
    However, the ethernet driver already does this,
    but is being blocked by a return statement
    whenever the phy-handle and fixed-link properties
    are both missing from nodes that define the port properties.
    
    Revert the workaround, so that both the switch driver
    and ethernet driver are not doing the same thing
    and move the phy-handle related lines down
    so nothing is ending the function prematurely.
    
    While at it, clean up kernel messages
    and delete useless return statements.
    
    Fixes: f6d81e2fa1f1 ("mt7620: gsw: make IntPHY and ExtPHY share mdio addr 4 possible")
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 .../files/drivers/net/ethernet/ralink/gsw_mt7620.c     |  6 ------
 .../files/drivers/net/ethernet/ralink/soc_mt7620.c     | 18 +++++++++---------
 2 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
index 798dc919bc..2a34e9417d 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
@@ -211,12 +211,6 @@ static void mt7620_hw_init(struct mt7620_gsw *gsw, int mdio_mode)
 		_mt7620_mii_write(gsw, gsw->ephy_base + 4, 4, 0x05e1);
 		_mt7620_mii_write(gsw, gsw->ephy_base + 4, 16, 0x1313);
 		pr_info("gsw: setting port4 to ephy mode\n");
-	} else if (!mdio_mode) {
-		u32 val = rt_sysc_r32(SYSC_REG_CFG1);
-
-		val &= ~(3 << 14);
-		rt_sysc_w32(val, SYSC_REG_CFG1);
-		pr_info("gsw: setting port4 to gmac mode\n");
 	}
 }
 
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
index 085058eb11..acd7350932 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
@@ -163,7 +163,6 @@ static void mt7620_port_init(struct fe_priv *priv, struct device_node *np)
 	    (size != (4 * sizeof(*priv->phy->phy_fixed[id])))) {
 		pr_err("%s: invalid fixed link property\n", np->name);
 		priv->phy->phy_fixed[id] = NULL;
-		return;
 	}
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)
@@ -205,10 +204,6 @@ static void mt7620_port_init(struct fe_priv *priv, struct device_node *np)
 		return;
 	}
 
-	priv->phy->phy_node[id] = of_parse_phandle(np, "phy-handle", 0);
-	if (!priv->phy->phy_node[id] && !priv->phy->phy_fixed[id])
-		return;
-
 	val = rt_sysc_r32(SYSC_REG_CFG1);
 	val &= ~(3 << shift);
 	val |= mask << shift;
@@ -249,8 +244,8 @@ static void mt7620_port_init(struct fe_priv *priv, struct device_node *np)
 			val = 2;
 			break;
 		default:
-			dev_err(priv->dev, "invalid link speed: %d\n",
-				priv->phy->speed[id]);
+			dev_err(priv->dev, "port %d - invalid link speed: %d\n",
+				id, priv->phy->speed[id]);
 			priv->phy->phy_fixed[id] = 0;
 			return;
 		}
@@ -264,7 +259,13 @@ static void mt7620_port_init(struct fe_priv *priv, struct device_node *np)
 		if (priv->phy->duplex[id])
 			val |= PMCR_DUPLEX;
 		mtk_switch_w32(gsw, val, GSW_REG_PORT_PMCR(id));
-		dev_info(priv->dev, "using fixed link parameters\n");
+		dev_info(priv->dev, "port %d - using fixed link parameters\n", id);
+		return;
+	}
+
+	priv->phy->phy_node[id] = of_parse_phandle(np, "phy-handle", 0);
+	if (!priv->phy->phy_node[id]) {
+		dev_err(priv->dev, "port %d - missing phy handle\n", id);
 		return;
 	}
 
@@ -277,7 +278,6 @@ static void mt7620_port_init(struct fe_priv *priv, struct device_node *np)
 		fe_connect_phy_node(priv, priv->phy->phy_node[id], id);
 		gsw->autopoll |= BIT(be32_to_cpup(phy_addr));
 		mt7620_auto_poll(gsw,id);
-		return;
 	}
 }
 


From lede-commits at lists.infradead.org  Tue Jun 22 23:23:25 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 23 Jun 2021 02:23:25 -0400
Subject: [openwrt/openwrt] ramips: mt7620: move mt7620_mdio_mode() to
 ethernet driver
In-Reply-To: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
References: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
Message-ID: <mailman.2392.1624429409.1072.lede-commits@lists.infradead.org>

981213 pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/6972e498d33ec896c676b7af91e3bfb00aa846a1

commit 6972e498d33ec896c676b7af91e3bfb00aa846a1
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Sun May 30 02:02:47 2021 -0400

    ramips: mt7620: move mt7620_mdio_mode() to ethernet driver
    
    The function mt7620_mdio_mode is only called once
    and both the function and mdio_mode block have been named incorrectly,
    leading to confusion and useless commits.
    
    These lines in the mdio_mode block of mt7620_hw_init
    are only intended for boards with an external mt7530 switch.
    (see commit 194ca6127ee18cd3a95da4d03f02e43b5428c0bb)
    
    Therefore, move lines from mdio_mode to the place in soc_mt7620.c
    where the type of mt7530 switch is identified,
    and move lines from mt7620_mdio_mode to a main function.
    
    mt7620_mdio_mode was called from mt7620_gsw_init
    where the priv struct is available,
    so the lines must stay in mt7620_gsw_init function.
    
    In order to keep things as simple as possible,
    keep the DTS property related function calls together,
    by moving them from mt7620_gsw_probe to init.
    
    Remove the now useless DTS properties and extra phy nodes.
    
    Fixes: 5a6229a93df8 ("ramips: remove superfluous & confusing DT binding")
    Fixes: b85fe43ec8c4 ("ramips: mt7620: add force use of mdio-mode")
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 .../linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi   |  2 -
 .../linux/ramips/dts/mt7620a_engenius_esr600.dts   |  1 -
 target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts | 23 +------
 .../files/drivers/net/ethernet/ralink/gsw_mt7620.c | 71 +++++++---------------
 .../files/drivers/net/ethernet/ralink/soc_mt7620.c | 15 +++++
 5 files changed, 38 insertions(+), 74 deletions(-)

diff --git a/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi b/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi
index 5cb8451547..6060fd99a6 100644
--- a/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi
+++ b/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi
@@ -155,8 +155,6 @@
 
 	mtd-mac-address = <&factory 0x4>;
 
-	mediatek,mdio-mode = <1>;
-
 	phy-reset-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
 	phy-reset-duration = <30>;
 
diff --git a/target/linux/ramips/dts/mt7620a_engenius_esr600.dts b/target/linux/ramips/dts/mt7620a_engenius_esr600.dts
index 2f0f9b256e..ea895ac6ea 100644
--- a/target/linux/ramips/dts/mt7620a_engenius_esr600.dts
+++ b/target/linux/ramips/dts/mt7620a_engenius_esr600.dts
@@ -144,7 +144,6 @@
 
 	mdio-bus {
 		status = "okay";
-		mediatek,mdio-mode;
 
 		ethernet-phy at 0 {
 			reg = <0>;
diff --git a/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts b/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts
index ee845c7b5e..41d69d009b 100644
--- a/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts
+++ b/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts
@@ -115,9 +115,8 @@
 
 	mdio-bus {
 		status = "okay";
-		mediatek,mdio-mode = <1>;
 
-		phy0: ethernet-phy at 0 {
+		ethernet-phy at 0 {
 			reg = <0>;
 			phy-mode = "rgmii";
 			qca,ar8327-initvals = <
@@ -127,26 +126,6 @@
 				0x94 0x00000000 /* PORT6_STATUS */
 			>;
 		};
-
-		phy1: ethernet-phy at 1 {
-			reg = <1>;
-			phy-mode = "rgmii";
-		};
-
-		phy2: ethernet-phy at 2 {
-			reg = <2>;
-			phy-mode = "rgmii";
-		};
-
-		phy3: ethernet-phy at 3 {
-			reg = <3>;
-			phy-mode = "rgmii";
-		};
-
-		phy4: ethernet-phy at 4 {
-			reg = <4>;
-			phy-mode = "rgmii";
-		};
 	};
 };
 
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
index 54b8b204eb..67f70f286d 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
@@ -61,31 +61,7 @@ static irqreturn_t gsw_interrupt_mt7620(int irq, void *_priv)
 	return IRQ_HANDLED;
 }
 
-static int mt7620_mdio_mode(struct device_node *eth_node)
-{
-	struct device_node *phy_node, *mdiobus_node;
-	const __be32 *id;
-	int ret = 0;
-
-	mdiobus_node = of_get_child_by_name(eth_node, "mdio-bus");
-
-	if (mdiobus_node) {
-		if (of_property_read_bool(mdiobus_node, "mediatek,mdio-mode"))
-			ret = 1;
-
-		for_each_child_of_node(mdiobus_node, phy_node) {
-			id = of_get_property(phy_node, "reg", NULL);
-			if (id && (be32_to_cpu(*id) == 0x1f))
-				ret = 1;
-		}
-
-		of_node_put(mdiobus_node);
-	}
-
-	return ret;
-}
-
-static void mt7620_hw_init(struct mt7620_gsw *gsw, int mdio_mode)
+static void mt7620_hw_init(struct mt7620_gsw *gsw)
 {
 	u32 i;
 	u32 val;
@@ -97,20 +73,6 @@ static void mt7620_hw_init(struct mt7620_gsw *gsw, int mdio_mode)
 	/* Enable MIB stats */
 	mtk_switch_w32(gsw, mtk_switch_r32(gsw, GSW_REG_MIB_CNT_EN) | (1 << 1), GSW_REG_MIB_CNT_EN);
 
-	if (mdio_mode) {
-		/* set MT7530 central align */
-		val = mt7530_mdio_r32(gsw, 0x7830);
-		val &= ~BIT(0);
-		val |= BIT(1);
-		mt7530_mdio_w32(gsw, 0x7830, val);
-
-		val = mt7530_mdio_r32(gsw, 0x7a40);
-		val &= ~BIT(30);
-		mt7530_mdio_w32(gsw, 0x7a40, val);
-
-		mt7530_mdio_w32(gsw, 0x7a78, 0x855);
-	}
-
 	if (gsw->ephy_base) {
 		mtk_switch_w32(gsw, mtk_switch_r32(gsw, GSW_REG_GPC1) |
 			(gsw->ephy_base << 16),
@@ -215,9 +177,13 @@ MODULE_DEVICE_TABLE(of, mediatek_gsw_match);
 
 int mtk_gsw_init(struct fe_priv *priv)
 {
+	struct device_node *eth_node = priv->dev->of_node;
+	struct device_node *phy_node, *mdiobus_node;
 	struct device_node *np = priv->switch_np;
 	struct platform_device *pdev = of_find_device_by_node(np);
 	struct mt7620_gsw *gsw;
+	const __be32 *id;
+	u8 val;
 
 	if (!pdev)
 		return -ENODEV;
@@ -228,7 +194,23 @@ int mtk_gsw_init(struct fe_priv *priv)
 	gsw = platform_get_drvdata(pdev);
 	priv->soc->swpriv = gsw;
 
-	mt7620_hw_init(gsw, mt7620_mdio_mode(priv->dev->of_node));
+	mdiobus_node = of_get_child_by_name(eth_node, "mdio-bus");
+	if (mdiobus_node) {
+		for_each_child_of_node(mdiobus_node, phy_node) {
+			id = of_get_property(phy_node, "reg", NULL);
+			if (id && (be32_to_cpu(*id) == 0x1f))
+				of_node_put(mdiobus_node);
+		}
+	}
+
+	gsw->port4_ephy = !of_property_read_bool(np, "mediatek,port4-gmac");
+
+	if (of_property_read_u8(np, "mediatek,ephy-base", &val) == 0)
+		gsw->ephy_base = val;
+	else
+		gsw->ephy_base = 0;
+
+	mt7620_hw_init(gsw);
 
 	if (gsw->irq) {
 		request_irq(gsw->irq, gsw_interrupt_mt7620, 0,
@@ -243,8 +225,6 @@ static int mt7620_gsw_probe(struct platform_device *pdev)
 {
 	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	struct mt7620_gsw *gsw;
-	struct device_node *np = pdev->dev.of_node;
-	u8 val;
 
 	gsw = devm_kzalloc(&pdev->dev, sizeof(struct mt7620_gsw), GFP_KERNEL);
 	if (!gsw)
@@ -256,13 +236,6 @@ static int mt7620_gsw_probe(struct platform_device *pdev)
 
 	gsw->dev = &pdev->dev;
 
-	gsw->port4_ephy = !of_property_read_bool(np, "mediatek,port4-gmac");
-
-	if (of_property_read_u8(np, "mediatek,ephy-base", &val) == 0)
-		gsw->ephy_base = val;
-	else
-		gsw->ephy_base = 0;
-
 	gsw->irq = platform_get_irq(pdev, 0);
 
 	platform_set_drvdata(pdev, gsw);
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
index acd7350932..4d012afa14 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
@@ -82,11 +82,26 @@ static const u16 mt7620_reg_table[FE_REG_COUNT] = {
 static int mt7620_gsw_config(struct fe_priv *priv)
 {
 	struct mt7620_gsw *gsw = (struct mt7620_gsw *) priv->soc->swpriv;
+	u32 val;
 
 	/* is the mt7530 internal or external */
 	if (priv->mii_bus && mdiobus_get_phy(priv->mii_bus, 0x1f)) {
 		mt7530_probe(priv->dev, gsw->base, NULL, 0);
 		mt7530_probe(priv->dev, NULL, priv->mii_bus, 1);
+
+		/* magic values from original SDK */
+		val = mt7530_mdio_r32(gsw, 0x7830);
+		val &= ~BIT(0);
+		val |= BIT(1);
+		mt7530_mdio_w32(gsw, 0x7830, val);
+
+		val = mt7530_mdio_r32(gsw, 0x7a40);
+		val &= ~BIT(30);
+		mt7530_mdio_w32(gsw, 0x7a40, val);
+
+		mt7530_mdio_w32(gsw, 0x7a78, 0x855);
+
+		pr_info("mt7530: mdio central align\n");
 	} else {
 		mt7530_probe(priv->dev, gsw->base, NULL, 1);
 	}


From lede-commits at lists.infradead.org  Tue Jun 22 23:23:24 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 23 Jun 2021 02:23:24 -0400
Subject: [openwrt/openwrt] ramips: mt7620: use DTS to set PHY base address
 for external PHYs
In-Reply-To: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
References: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
Message-ID: <mailman.2395.1624429409.1072.lede-commits@lists.infradead.org>

981213 pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/0976b6c4262a11a8d0dab9aeb64f5cdee266c44a

commit 0976b6c4262a11a8d0dab9aeb64f5cdee266c44a
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Sat Apr 3 14:42:51 2021 -0400

    ramips: mt7620: use DTS to set PHY base address for external PHYs
    
    Set the PHY base address to 12 for mt7530 and 8 for others,
    which is based on the default setting for some devices
    from printing the register with the following command
    after it is written to by uboot during the boot cycle.
    
    `md 0x10117014 1`
    
    PHY_BASE option only uses 5 bits of the register,
    bits 16 to 20, so use 8-bit integer type.
    
    Set the option using the DTS property mediatek,ephy-base
    and create the gsw node if missing.
    
    Also, added a kernel message to display the EPHY base address.
    
    Note:
    If anything is written to a PHY address that is greater than 1 hex char (greater than 0xf)
    then there is adverse effects with Atheros switches.
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts           |  1 +
 target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts           |  2 +-
 target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts             |  1 +
 target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts        |  4 ++++
 target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts          |  4 ++++
 target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi            |  4 ++++
 target/linux/ramips/dts/mt7620a_engenius_esr600.dts            |  4 ++++
 target/linux/ramips/dts/mt7620a_fon_fon2601.dts                |  1 +
 target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts       |  1 +
 target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts         |  4 ++++
 target/linux/ramips/dts/mt7620a_iptime_a1004ns.dts             |  4 ++++
 target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts             |  4 ++++
 target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts           |  4 ++++
 target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts          |  1 +
 target/linux/ramips/dts/mt7620a_linksys_e1700.dts              |  4 ++++
 target/linux/ramips/dts/mt7620a_netis_wf2770.dts               |  4 ++++
 target/linux/ramips/dts/mt7620a_ralink_mt7620a-evb.dts         |  1 +
 target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7530-evb.dts  |  4 ++++
 target/linux/ramips/dts/mt7620a_ralink_mt7620a-v22sg-evb.dts   |  1 +
 target/linux/ramips/dts/mt7620a_sercomm_na930.dts              |  1 +
 target/linux/ramips/dts/mt7620a_tplink_re210-v1.dts            |  1 +
 target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts         |  1 +
 target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts        |  1 +
 .../ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c      | 10 ++++------
 24 files changed, 60 insertions(+), 7 deletions(-)

diff --git a/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts
index 71b532fc34..b86ab1449b 100644
--- a/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts
+++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts
@@ -186,4 +186,5 @@
 
 &gsw {
 	mediatek,port4-gmac;
+	mediatek,ephy-base = /bits/ 8 <8>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts
index 9ea28706aa..b0dd31cafc 100644
--- a/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts
+++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts
@@ -174,5 +174,5 @@
 
 &gsw {
 	mediatek,port4-gmac;
-	mediatek,ephy-base-address = /bits/ 16 < 2 >;
+	mediatek,ephy-base = /bits/ 8 <2>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts b/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts
index 068f75bd96..ba1a2becda 100644
--- a/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts
+++ b/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts
@@ -136,6 +136,7 @@
 
 &gsw {
 	mediatek,port4-gmac;
+	mediatek,ephy-base = /bits/ 8 <8>;
 };
 
 &pcie {
diff --git a/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts b/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts
index 2337c0f9d3..03a4c96f6b 100644
--- a/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts
+++ b/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts
@@ -177,6 +177,10 @@
 	};
 };
 
+&gsw {
+	mediatek,ephy-base = /bits/ 8 <12>;
+};
+
 &wmac {
 	ralink,mtd-eeprom = <&factory 0x0>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts b/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts
index 09763db388..986b047e47 100644
--- a/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts
+++ b/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts
@@ -169,6 +169,10 @@
 	};
 };
 
+&gsw {
+	mediatek,ephy-base = /bits/ 8 <12>;
+};
+
 &wmac {
 	ralink,mtd-eeprom = <&factory 0x0>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi b/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi
index 07b03f5c06..5cb8451547 100644
--- a/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi
+++ b/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi
@@ -201,6 +201,10 @@
 	};
 };
 
+&gsw {
+	mediatek,ephy-base = /bits/ 8 <8>;
+};
+
 &wmac {
 	ralink,mtd-eeprom = <&factory 0x0>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_engenius_esr600.dts b/target/linux/ramips/dts/mt7620a_engenius_esr600.dts
index 35d0b3dbec..2f0f9b256e 100644
--- a/target/linux/ramips/dts/mt7620a_engenius_esr600.dts
+++ b/target/linux/ramips/dts/mt7620a_engenius_esr600.dts
@@ -160,6 +160,10 @@
 	};
 };
 
+&gsw {
+	mediatek,ephy-base = /bits/ 8 <8>;
+};
+
 &state_default {
 	gpio {
 		groups = "i2c", "uartf", "nd_sd", "wled";
diff --git a/target/linux/ramips/dts/mt7620a_fon_fon2601.dts b/target/linux/ramips/dts/mt7620a_fon_fon2601.dts
index b47d63be85..373205e725 100644
--- a/target/linux/ramips/dts/mt7620a_fon_fon2601.dts
+++ b/target/linux/ramips/dts/mt7620a_fon_fon2601.dts
@@ -137,6 +137,7 @@
 
 &gsw {
 	mediatek,port4-gmac;
+	mediatek,ephy-base = /bits/ 8 <8>;
 };
 
 &wmac {
diff --git a/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts b/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts
index 487f6aaf6e..7d807bff4b 100644
--- a/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts
+++ b/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts
@@ -151,6 +151,7 @@
 
 &gsw {
 	mediatek,port4-gmac;
+	mediatek,ephy-base = /bits/ 8 <8>;
 };
 
 &wmac {
diff --git a/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts b/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts
index 7044a511bc..d59b481a61 100644
--- a/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts
+++ b/target/linux/ramips/dts/mt7620a_iodata_wn-ac1167gr.dts
@@ -184,6 +184,10 @@
 	};
 };
 
+&gsw {
+	mediatek,ephy-base = /bits/ 8 <12>;
+};
+
 &state_default {
 	gpio {
 		groups = "i2c", "uartf";
diff --git a/target/linux/ramips/dts/mt7620a_iptime_a1004ns.dts b/target/linux/ramips/dts/mt7620a_iptime_a1004ns.dts
index 20d0557916..6270af3b15 100644
--- a/target/linux/ramips/dts/mt7620a_iptime_a1004ns.dts
+++ b/target/linux/ramips/dts/mt7620a_iptime_a1004ns.dts
@@ -101,3 +101,7 @@
 		};
 	};
 };
+
+&gsw {
+	mediatek,ephy-base = /bits/ 8 <12>;
+};
diff --git a/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts b/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts
index 962ef3371d..ee845c7b5e 100644
--- a/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts
+++ b/target/linux/ramips/dts/mt7620a_lava_lr-25g001.dts
@@ -150,6 +150,10 @@
 	};
 };
 
+&gsw {
+	mediatek,ephy-base = /bits/ 8 <8>;
+};
+
 &pcie {
 	status = "okay";
 };
diff --git a/target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts b/target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts
index bb1303d4fb..9e0b817163 100644
--- a/target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts
+++ b/target/linux/ramips/dts/mt7620a_lb-link_bl-w1200.dts
@@ -135,6 +135,10 @@
 	};
 };
 
+&gsw {
+	mediatek,ephy-base = /bits/ 8 <12>;
+};
+
 &wmac {
 	ralink,mtd-eeprom = <&factory 0x0>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts
index 0997d8a00e..0544550bf9 100644
--- a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts
+++ b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts
@@ -112,4 +112,5 @@
 
 &gsw {
 	mediatek,port4-gmac;
+	mediatek,ephy-base = /bits/ 8 <8>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_linksys_e1700.dts b/target/linux/ramips/dts/mt7620a_linksys_e1700.dts
index 2672d54f36..c38ea8082c 100644
--- a/target/linux/ramips/dts/mt7620a_linksys_e1700.dts
+++ b/target/linux/ramips/dts/mt7620a_linksys_e1700.dts
@@ -144,6 +144,10 @@
 	};
 };
 
+&gsw {
+	mediatek,ephy-base = /bits/ 8 <12>;
+};
+
 &wmac {
 	ralink,mtd-eeprom = <&factory 0x0>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_netis_wf2770.dts b/target/linux/ramips/dts/mt7620a_netis_wf2770.dts
index ab8c61b1d8..f839048865 100644
--- a/target/linux/ramips/dts/mt7620a_netis_wf2770.dts
+++ b/target/linux/ramips/dts/mt7620a_netis_wf2770.dts
@@ -142,6 +142,10 @@
 	};
 };
 
+&gsw {
+	mediatek,ephy-base = /bits/ 8 <12>;
+};
+
 &pcie {
 	status = "okay";
 };
diff --git a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-evb.dts b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-evb.dts
index 4c5baf1e50..ae35941507 100644
--- a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-evb.dts
+++ b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-evb.dts
@@ -106,6 +106,7 @@
 
 &gsw {
 	mediatek,port4-gmac;
+	mediatek,ephy-base = /bits/ 8 <8>;
 };
 
 &sdhci {
diff --git a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7530-evb.dts b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7530-evb.dts
index b76ab2aa59..f7d8cae160 100644
--- a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7530-evb.dts
+++ b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7530-evb.dts
@@ -99,6 +99,10 @@
 	};
 };
 
+&gsw {
+	mediatek,ephy-base = /bits/ 8 <12>;
+};
+
 &pcie {
 	status = "okay";
 };
diff --git a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-v22sg-evb.dts b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-v22sg-evb.dts
index 6e8eff50bc..0e963e1f02 100644
--- a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-v22sg-evb.dts
+++ b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-v22sg-evb.dts
@@ -100,6 +100,7 @@
 
 &gsw {
 	mediatek,port4-gmac;
+	mediatek,ephy-base = /bits/ 8 <8>;
 };
 
 &pcie {
diff --git a/target/linux/ramips/dts/mt7620a_sercomm_na930.dts b/target/linux/ramips/dts/mt7620a_sercomm_na930.dts
index 329ecc5ea8..1ffc0a2bc8 100644
--- a/target/linux/ramips/dts/mt7620a_sercomm_na930.dts
+++ b/target/linux/ramips/dts/mt7620a_sercomm_na930.dts
@@ -167,6 +167,7 @@
 
 &gsw {
 	mediatek,port4-gmac;
+	mediatek,ephy-base = /bits/ 8 <8>;
 };
 
 &ehci {
diff --git a/target/linux/ramips/dts/mt7620a_tplink_re210-v1.dts b/target/linux/ramips/dts/mt7620a_tplink_re210-v1.dts
index 247b5752ef..57cd0ed539 100644
--- a/target/linux/ramips/dts/mt7620a_tplink_re210-v1.dts
+++ b/target/linux/ramips/dts/mt7620a_tplink_re210-v1.dts
@@ -62,6 +62,7 @@
 
 &gsw {
 	mediatek,port4-gmac;
+	mediatek,ephy-base = /bits/ 8 <8>;
 };
 
 &ethernet {
diff --git a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts
index 55ab939d15..bfec806c12 100644
--- a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts
+++ b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts
@@ -196,6 +196,7 @@
 
 &gsw {
 	mediatek,port4-gmac;
+	mediatek,ephy-base = /bits/ 8 <8>;
 };
 
 &wmac {
diff --git a/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts b/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts
index 506b828ec8..1a5ff2d0df 100644
--- a/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts
+++ b/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts
@@ -158,6 +158,7 @@
 
 &gsw {
 	mediatek,port4-gmac;
+	mediatek,ephy-base = /bits/ 8 <8>;
 };
 
 &wmac {
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
index 4b030f457b..54b8b204eb 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
@@ -98,9 +98,6 @@ static void mt7620_hw_init(struct mt7620_gsw *gsw, int mdio_mode)
 	mtk_switch_w32(gsw, mtk_switch_r32(gsw, GSW_REG_MIB_CNT_EN) | (1 << 1), GSW_REG_MIB_CNT_EN);
 
 	if (mdio_mode) {
-		if (!gsw->ephy_base)
-			gsw->ephy_base = 12;
-
 		/* set MT7530 central align */
 		val = mt7530_mdio_r32(gsw, 0x7830);
 		val &= ~BIT(0);
@@ -115,11 +112,12 @@ static void mt7620_hw_init(struct mt7620_gsw *gsw, int mdio_mode)
 	}
 
 	if (gsw->ephy_base) {
-		/* set phy base addr to ephy_base */
 		mtk_switch_w32(gsw, mtk_switch_r32(gsw, GSW_REG_GPC1) |
 			(gsw->ephy_base << 16),
 			GSW_REG_GPC1);
 		fe_reset(BIT(24)); /* Resets the Ethernet PHY block. */
+
+		pr_info("gsw: ephy base address: %d\n", gsw->ephy_base);
 	}
 
 	/* global page 4 */
@@ -246,7 +244,7 @@ static int mt7620_gsw_probe(struct platform_device *pdev)
 	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	struct mt7620_gsw *gsw;
 	struct device_node *np = pdev->dev.of_node;
-	u16 val;
+	u8 val;
 
 	gsw = devm_kzalloc(&pdev->dev, sizeof(struct mt7620_gsw), GFP_KERNEL);
 	if (!gsw)
@@ -260,7 +258,7 @@ static int mt7620_gsw_probe(struct platform_device *pdev)
 
 	gsw->port4_ephy = !of_property_read_bool(np, "mediatek,port4-gmac");
 
-	if (of_property_read_u16(np, "mediatek,ephy-base-address", &val) == 0)
+	if (of_property_read_u8(np, "mediatek,ephy-base", &val) == 0)
 		gsw->ephy_base = val;
 	else
 		gsw->ephy_base = 0;


From lede-commits at lists.infradead.org  Tue Jun 22 23:23:20 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 23 Jun 2021 02:23:20 -0400
Subject: [openwrt/openwrt] ramips: mt7620: simplify DTS properties for GMAC
In-Reply-To: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
References: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
Message-ID: <mailman.2396.1624429409.1072.lede-commits@lists.infradead.org>

981213 pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/953bfe2eb3b7236a72fa41ab2204fdaa9fd09f65

commit 953bfe2eb3b7236a72fa41ab2204fdaa9fd09f65
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Wed Mar 31 16:09:37 2021 -0400

    ramips: mt7620: simplify DTS properties for GMAC
    
    There are only 2 options in the driver
    for the function of mt7620 internal switch port 4:
    
      EPHY mode (RJ-45, internal PHY)
      GMAC mode (RGMII, external PHY)
    
    Let the DTS property be boolean instead of string
    where EPHY mode is the default.
    
    Fix how the properties are written
    for all DTS that use them,
    and add missing nodes where applicable,
    and remove useless nodes,
    and minor DTS formatting.
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts |  4 ----
 target/linux/ramips/dts/mt7620a_alfa-network_r36m-e4g.dts |  4 ----
 target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts |  4 ----
 target/linux/ramips/dts/mt7620a_asus_rp-n53.dts           |  3 +--
 target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts     |  4 ----
 target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts    |  4 ----
 target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts      |  4 ----
 target/linux/ramips/dts/mt7620a_cameo_810.dtsi            |  4 ----
 target/linux/ramips/dts/mt7620a_dlink_dch-m225.dts        |  4 ----
 target/linux/ramips/dts/mt7620a_dlink_dir-510l.dts        |  4 ----
 target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts      |  2 +-
 target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts      |  2 +-
 target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts        |  2 +-
 target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts   |  4 ----
 target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts     |  4 ----
 target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi       |  4 ----
 target/linux/ramips/dts/mt7620a_engenius_esr600.dts       |  2 +-
 target/linux/ramips/dts/mt7620a_fon_fon2601.dts           |  2 +-
 target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts  |  4 ++++
 target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts     |  2 +-
 target/linux/ramips/dts/mt7620a_linksys_e1700.dts         |  4 ----
 target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts        |  4 ----
 target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts        |  4 ----
 target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts       |  4 ----
 target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts     |  4 ----
 target/linux/ramips/dts/mt7620a_ralink_mt7620a-evb.dts    |  2 +-
 .../ramips/dts/mt7620a_ralink_mt7620a-mt7530-evb.dts      |  4 ----
 .../ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts     |  4 ----
 .../linux/ramips/dts/mt7620a_ralink_mt7620a-v22sg-evb.dts |  2 +-
 target/linux/ramips/dts/mt7620a_sercomm_na930.dts         |  2 +-
 target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts   |  4 ----
 target/linux/ramips/dts/mt7620a_tplink_archer.dtsi        |  4 ----
 target/linux/ramips/dts/mt7620a_tplink_re210-v1.dts       |  2 +-
 target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts    |  2 +-
 target/linux/ramips/dts/mt7620a_yukai_bocco.dts           |  4 ----
 target/linux/ramips/dts/mt7620a_zte_q7.dts                |  4 ----
 target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts   |  2 +-
 target/linux/ramips/dts/mt7620n.dtsi                      |  1 -
 .../ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c | 15 ++++-----------
 .../ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h |  7 +------
 .../ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c |  2 +-
 41 files changed, 23 insertions(+), 125 deletions(-)

diff --git a/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts b/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts
index 27b6896cec..752a940cd8 100644
--- a/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts
+++ b/target/linux/ramips/dts/mt7620a_alfa-network_ac1200rm.dts
@@ -72,10 +72,6 @@
 	status = "okay";
 };
 
-&gsw {
-	mediatek,port4 = "ephy";
-};
-
 &ohci {
 	status = "okay";
 };
diff --git a/target/linux/ramips/dts/mt7620a_alfa-network_r36m-e4g.dts b/target/linux/ramips/dts/mt7620a_alfa-network_r36m-e4g.dts
index 58386a9ac7..0991ae8447 100644
--- a/target/linux/ramips/dts/mt7620a_alfa-network_r36m-e4g.dts
+++ b/target/linux/ramips/dts/mt7620a_alfa-network_r36m-e4g.dts
@@ -141,10 +141,6 @@
 	status = "okay";
 };
 
-&gsw {
-	mediatek,port4 = "ephy";
-};
-
 &i2c {
 	status = "okay";
 };
diff --git a/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts b/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts
index 30a0201c39..ca58d780f4 100644
--- a/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts
+++ b/target/linux/ramips/dts/mt7620a_alfa-network_tube-e4g.dts
@@ -114,10 +114,6 @@
 	status = "okay";
 };
 
-&gsw {
-	mediatek,port4 = "ephy";
-};
-
 &ohci {
 	status = "okay";
 };
diff --git a/target/linux/ramips/dts/mt7620a_asus_rp-n53.dts b/target/linux/ramips/dts/mt7620a_asus_rp-n53.dts
index 3cb9142c38..4c72c64272 100644
--- a/target/linux/ramips/dts/mt7620a_asus_rp-n53.dts
+++ b/target/linux/ramips/dts/mt7620a_asus_rp-n53.dts
@@ -153,8 +153,7 @@
 	};
 };
 
-&gsw {
-	mediatek,port4 = "ephy";
+&ethernet {
 	pinctrl-names = "default";
 	pinctrl-0 = <&ephy_pins>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts b/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts
index 196bbde726..93a09f99c3 100644
--- a/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts
+++ b/target/linux/ramips/dts/mt7620a_buffalo_whr-1166d.dts
@@ -157,10 +157,6 @@
 	};
 };
 
-&gsw {
-	mediatek,port4 = "ephy";
-};
-
 &wmac {
 	ralink,mtd-eeprom = <&factory 0x0>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts b/target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts
index ed2e03d6cf..95152bc41a 100644
--- a/target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts
+++ b/target/linux/ramips/dts/mt7620a_buffalo_whr-300hp2.dts
@@ -144,10 +144,6 @@
 	mediatek,portmap = "llllw";
 };
 
-&gsw {
-	mediatek,port4 = "ephy";
-};
-
 &wmac {
 	ralink,mtd-eeprom = <&factory 0x0>;
 	pinctrl-names = "default";
diff --git a/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts b/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts
index b799a98e56..226967763b 100644
--- a/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts
+++ b/target/linux/ramips/dts/mt7620a_buffalo_whr-600d.dts
@@ -144,10 +144,6 @@
 	mediatek,portmap = "llllw";
 };
 
-&gsw {
-	mediatek,port4 = "ephy";
-};
-
 &wmac {
 	ralink,mtd-eeprom = <&factory 0x0>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_cameo_810.dtsi b/target/linux/ramips/dts/mt7620a_cameo_810.dtsi
index c3f3267d38..70407449db 100644
--- a/target/linux/ramips/dts/mt7620a_cameo_810.dtsi
+++ b/target/linux/ramips/dts/mt7620a_cameo_810.dtsi
@@ -132,10 +132,6 @@
 	mediatek,portmap = "llllw";
 };
 
-&gsw {
-	mediatek,port4 = "ephy";
-};
-
 &gpio2 {
 	status = "okay";
 };
diff --git a/target/linux/ramips/dts/mt7620a_dlink_dch-m225.dts b/target/linux/ramips/dts/mt7620a_dlink_dch-m225.dts
index 63667da281..0c9f56875e 100644
--- a/target/linux/ramips/dts/mt7620a_dlink_dch-m225.dts
+++ b/target/linux/ramips/dts/mt7620a_dlink_dch-m225.dts
@@ -171,10 +171,6 @@
 	mtd-mac-address = <&factory 0x4>;
 };
 
-&gsw {
-	ralink,port4 = "ephy";
-};
-
 &wmac {
 	ralink,mtd-eeprom = <&factory 0x0>;
 	pinctrl-names = "default";
diff --git a/target/linux/ramips/dts/mt7620a_dlink_dir-510l.dts b/target/linux/ramips/dts/mt7620a_dlink_dir-510l.dts
index f4db67648a..774d90c79d 100644
--- a/target/linux/ramips/dts/mt7620a_dlink_dir-510l.dts
+++ b/target/linux/ramips/dts/mt7620a_dlink_dir-510l.dts
@@ -120,10 +120,6 @@
 	};
 };
 
-&gsw {
-	mediatek,port4 = "ephy";
-};
-
 &state_default {
 	default {
 		groups = "i2c", "uartf";
diff --git a/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts
index bacebee8e1..71b532fc34 100644
--- a/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts
+++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a1.dts
@@ -185,5 +185,5 @@
 };
 
 &gsw {
-	mediatek,port4 = "gmac";
+	mediatek,port4-gmac;
 };
diff --git a/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts
index 0b124e67de..9ea28706aa 100644
--- a/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts
+++ b/target/linux/ramips/dts/mt7620a_dlink_dwr-118-a2.dts
@@ -173,6 +173,6 @@
 };
 
 &gsw {
-	mediatek,port4 = "gmac";
+	mediatek,port4-gmac;
 	mediatek,ephy-base-address = /bits/ 16 < 2 >;
 };
diff --git a/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts b/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts
index 9450596f1b..068f75bd96 100644
--- a/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts
+++ b/target/linux/ramips/dts/mt7620a_dovado_tiny-ac.dts
@@ -135,7 +135,7 @@
 };
 
 &gsw {
-	mediatek,port4 = "gmac";
+	mediatek,port4-gmac;
 };
 
 &pcie {
diff --git a/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts b/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts
index e7af34aa8e..2337c0f9d3 100644
--- a/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts
+++ b/target/linux/ramips/dts/mt7620a_edimax_br-6478ac-v2.dts
@@ -177,10 +177,6 @@
 	};
 };
 
-&gsw {
-	mediatek,port4 = "gmac";
-};
-
 &wmac {
 	ralink,mtd-eeprom = <&factory 0x0>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts b/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts
index 77d214e888..09763db388 100644
--- a/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts
+++ b/target/linux/ramips/dts/mt7620a_edimax_ew-7478apc.dts
@@ -169,10 +169,6 @@
 	};
 };
 
-&gsw {
-	mediatek,port4 = "gmac";
-};
-
 &wmac {
 	ralink,mtd-eeprom = <&factory 0x0>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi b/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi
index d17cc090c2..07b03f5c06 100644
--- a/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi
+++ b/target/linux/ramips/dts/mt7620a_edimax_ew-747x.dtsi
@@ -201,10 +201,6 @@
 	};
 };
 
-&gsw {
-	mediatek,port5 = "gmac";
-};
-
 &wmac {
 	ralink,mtd-eeprom = <&factory 0x0>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_engenius_esr600.dts b/target/linux/ramips/dts/mt7620a_engenius_esr600.dts
index b8fe2f8cdb..35d0b3dbec 100644
--- a/target/linux/ramips/dts/mt7620a_engenius_esr600.dts
+++ b/target/linux/ramips/dts/mt7620a_engenius_esr600.dts
@@ -155,7 +155,7 @@
 				0x7c 0x0000007e /* PORT0 STATUS */
 				0x0c 0x05600000 /* PORT6 PAD MODE CTRL */
 				0x94 0x0000007e /* PORT6 STATUS */
-				>;
+			>;
 		};
 	};
 };
diff --git a/target/linux/ramips/dts/mt7620a_fon_fon2601.dts b/target/linux/ramips/dts/mt7620a_fon_fon2601.dts
index ee61c6e59e..b47d63be85 100644
--- a/target/linux/ramips/dts/mt7620a_fon_fon2601.dts
+++ b/target/linux/ramips/dts/mt7620a_fon_fon2601.dts
@@ -136,7 +136,7 @@
 };
 
 &gsw {
-	mediatek,port4 = "gmac";
+	mediatek,port4-gmac;
 };
 
 &wmac {
diff --git a/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts b/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts
index a0ebe4fff5..487f6aaf6e 100644
--- a/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts
+++ b/target/linux/ramips/dts/mt7620a_head-weblink_hdrm200.dts
@@ -149,6 +149,10 @@
 	};
 };
 
+&gsw {
+	mediatek,port4-gmac;
+};
+
 &wmac {
 	ralink,mtd-eeprom = <&factory 0x0>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts
index a07683ed4a..0997d8a00e 100644
--- a/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts
+++ b/target/linux/ramips/dts/mt7620a_lenovo_newifi-y1s.dts
@@ -111,5 +111,5 @@
 };
 
 &gsw {
-	mediatek,port4 = "gmac";
+	mediatek,port4-gmac;
 };
diff --git a/target/linux/ramips/dts/mt7620a_linksys_e1700.dts b/target/linux/ramips/dts/mt7620a_linksys_e1700.dts
index 2619a4653a..2672d54f36 100644
--- a/target/linux/ramips/dts/mt7620a_linksys_e1700.dts
+++ b/target/linux/ramips/dts/mt7620a_linksys_e1700.dts
@@ -144,10 +144,6 @@
 	};
 };
 
-&gsw {
-	mediatek,port4 = "gmac";
-};
-
 &wmac {
 	ralink,mtd-eeprom = <&factory 0x0>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts b/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts
index 07f606fce4..7dabbed9ba 100644
--- a/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts
+++ b/target/linux/ramips/dts/mt7620a_ohyeah_oy-0001.dts
@@ -103,10 +103,6 @@
 	mediatek,portmap = "llllw";
 };
 
-&gsw {
-	mediatek,port4 = "ephy";
-};
-
 &wmac {
 	ralink,mtd-eeprom = <&factory 0x0>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts b/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts
index aa7ddb0a25..3edc41ac0d 100644
--- a/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts
+++ b/target/linux/ramips/dts/mt7620a_planex_cs-qr10.dts
@@ -122,10 +122,6 @@
 	mediatek,portmap = "llllw";
 };
 
-&gsw {
-	ralink,port4 = "ephy";
-};
-
 &sdhci {
 	status = "okay";
 };
diff --git a/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts b/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts
index eb373e9aa2..8f8f173de3 100644
--- a/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts
+++ b/target/linux/ramips/dts/mt7620a_planex_db-wrt01.dts
@@ -94,10 +94,6 @@
 	mediatek,portmap = "llllw";
 };
 
-&gsw {
-	mediatek,port4 = "ephy";
-};
-
 &wmac {
 	ralink,mtd-eeprom = <&factory 0x0>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts b/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts
index df9c9689c3..e1c5568ed8 100644
--- a/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts
+++ b/target/linux/ramips/dts/mt7620a_planex_mzk-750dhp.dts
@@ -114,10 +114,6 @@
 	mediatek,portmap = "llllw";
 };
 
-&gsw {
-	mediatek,port4 = "ephy";
-};
-
 &wmac {
 	ralink,mtd-eeprom = <&factory 0x0>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-evb.dts b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-evb.dts
index 7743df06fb..4c5baf1e50 100644
--- a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-evb.dts
+++ b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-evb.dts
@@ -105,7 +105,7 @@
 };
 
 &gsw {
-	mediatek,port4 = "gmac";
+	mediatek,port4-gmac;
 };
 
 &sdhci {
diff --git a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7530-evb.dts b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7530-evb.dts
index 4a09755967..b76ab2aa59 100644
--- a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7530-evb.dts
+++ b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7530-evb.dts
@@ -99,10 +99,6 @@
 	};
 };
 
-&gsw {
-	mediatek,port4 = "gmac";
-};
-
 &pcie {
 	status = "okay";
 };
diff --git a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts
index ae0d364d3e..b7a71c3e25 100644
--- a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts
+++ b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-mt7610e-evb.dts
@@ -71,10 +71,6 @@
 	mediatek,portmap = "llllw";
 };
 
-&gsw {
-	mediatek,port4 = "ephy";
-};
-
 &sdhci {
 	status = "okay";
 };
diff --git a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-v22sg-evb.dts b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-v22sg-evb.dts
index bee4ba7fd3..6e8eff50bc 100644
--- a/target/linux/ramips/dts/mt7620a_ralink_mt7620a-v22sg-evb.dts
+++ b/target/linux/ramips/dts/mt7620a_ralink_mt7620a-v22sg-evb.dts
@@ -99,7 +99,7 @@
 };
 
 &gsw {
-	mediatek,port4 = "gmac";
+	mediatek,port4-gmac;
 };
 
 &pcie {
diff --git a/target/linux/ramips/dts/mt7620a_sercomm_na930.dts b/target/linux/ramips/dts/mt7620a_sercomm_na930.dts
index 4a91c07ecd..329ecc5ea8 100644
--- a/target/linux/ramips/dts/mt7620a_sercomm_na930.dts
+++ b/target/linux/ramips/dts/mt7620a_sercomm_na930.dts
@@ -166,7 +166,7 @@
 };
 
 &gsw {
-	mediatek,port4 = "gmac";
+	mediatek,port4-gmac;
 };
 
 &ehci {
diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts b/target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts
index ae92dc85e6..4212a70dc3 100644
--- a/target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts
+++ b/target/linux/ramips/dts/mt7620a_tplink_archer-mr200.dts
@@ -178,10 +178,6 @@
 	status = "okay";
 };
 
-&gsw {
-	mediatek,port4 = "ephy";
-};
-
 &wmac {
 	ralink,mtd-eeprom = <&radio 0x0>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi b/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi
index 670bad615d..d2fb891433 100644
--- a/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi
+++ b/target/linux/ramips/dts/mt7620a_tplink_archer.dtsi
@@ -105,10 +105,6 @@
 	status = "okay";
 };
 
-&gsw {
-	mediatek,port4 = "ephy";
-};
-
 &wmac {
 	ralink,mtd-eeprom = <&radio 0x0>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_tplink_re210-v1.dts b/target/linux/ramips/dts/mt7620a_tplink_re210-v1.dts
index 41e56fbe36..247b5752ef 100644
--- a/target/linux/ramips/dts/mt7620a_tplink_re210-v1.dts
+++ b/target/linux/ramips/dts/mt7620a_tplink_re210-v1.dts
@@ -61,7 +61,7 @@
 };
 
 &gsw {
-	mediatek,port4 = "gmac";
+	mediatek,port4-gmac;
 };
 
 &ethernet {
diff --git a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts
index 679d9c2150..55ab939d15 100644
--- a/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts
+++ b/target/linux/ramips/dts/mt7620a_wavlink_wl-wn579x3.dts
@@ -195,7 +195,7 @@
 };
 
 &gsw {
-	mediatek,port4 = "gmac";
+	mediatek,port4-gmac;
 };
 
 &wmac {
diff --git a/target/linux/ramips/dts/mt7620a_yukai_bocco.dts b/target/linux/ramips/dts/mt7620a_yukai_bocco.dts
index 9c99a6582e..347c246e2e 100644
--- a/target/linux/ramips/dts/mt7620a_yukai_bocco.dts
+++ b/target/linux/ramips/dts/mt7620a_yukai_bocco.dts
@@ -141,10 +141,6 @@
 	mediatek,portmap = "llllw";
 };
 
-&gsw {
-	ralink,port4 = "ephy";
-};
-
 &wmac {
 	ralink,mtd-eeprom = <&factory 0x0>;
 };
diff --git a/target/linux/ramips/dts/mt7620a_zte_q7.dts b/target/linux/ramips/dts/mt7620a_zte_q7.dts
index 1ec3ba2e33..550f750c5a 100644
--- a/target/linux/ramips/dts/mt7620a_zte_q7.dts
+++ b/target/linux/ramips/dts/mt7620a_zte_q7.dts
@@ -111,7 +111,3 @@
 &ohci {
 	status = "okay";
 };
-
-&gsw {
-	mediatek,port4 = "ephy";
-};
diff --git a/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts b/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts
index 8c07de4845..506b828ec8 100644
--- a/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts
+++ b/target/linux/ramips/dts/mt7620a_zyxel_keenetic-viva.dts
@@ -157,7 +157,7 @@
 };
 
 &gsw {
-	mediatek,port4 = "gmac";
+	mediatek,port4-gmac;
 };
 
 &wmac {
diff --git a/target/linux/ramips/dts/mt7620n.dtsi b/target/linux/ramips/dts/mt7620n.dtsi
index 2fac091898..d225cb25d8 100644
--- a/target/linux/ramips/dts/mt7620n.dtsi
+++ b/target/linux/ramips/dts/mt7620n.dtsi
@@ -347,7 +347,6 @@
 
 		interrupt-parent = <&intc>;
 		interrupts = <17>;
-		mediatek,port4 = "ephy";
 	};
 
 	ehci: ehci at 101c0000 {
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
index 0b09814cc8..798dc919bc 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
@@ -40,7 +40,7 @@ static irqreturn_t gsw_interrupt_mt7620(int irq, void *_priv)
 	struct fe_priv *priv = (struct fe_priv *)_priv;
 	struct mt7620_gsw *gsw = (struct mt7620_gsw *)priv->soc->swpriv;
 	u32 status;
-	int i, max = (gsw->port4 == PORT4_EPHY) ? (4) : (3);
+	int i, max = (gsw->port4_ephy) ? (4) : (3);
 
 	status = mtk_switch_r32(gsw, GSW_REG_ISR);
 	if (status & PORT_IRQ_ST_CHG)
@@ -202,8 +202,8 @@ static void mt7620_hw_init(struct mt7620_gsw *gsw, int mdio_mode)
 	mtk_switch_w32(gsw, 0x7f7f7fe0, 0x0010);
 
 	/* setup port 4 */
-	if (gsw->port4 == PORT4_EPHY) {
-		u32 val = rt_sysc_r32(SYSC_REG_CFG1);
+	if (gsw->port4_ephy) {
+		val = rt_sysc_r32(SYSC_REG_CFG1);
 
 		val |= 3 << 14;
 		rt_sysc_w32(val, SYSC_REG_CFG1);
@@ -255,7 +255,6 @@ int mtk_gsw_init(struct fe_priv *priv)
 static int mt7620_gsw_probe(struct platform_device *pdev)
 {
 	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	const char *port4 = NULL;
 	struct mt7620_gsw *gsw;
 	struct device_node *np = pdev->dev.of_node;
 	u16 val;
@@ -270,13 +269,7 @@ static int mt7620_gsw_probe(struct platform_device *pdev)
 
 	gsw->dev = &pdev->dev;
 
-	of_property_read_string(np, "mediatek,port4", &port4);
-	if (port4 && !strcmp(port4, "ephy"))
-		gsw->port4 = PORT4_EPHY;
-	else if (port4 && !strcmp(port4, "gmac"))
-		gsw->port4 = PORT4_EXT;
-	else
-		gsw->port4 = PORT4_EPHY;
+	gsw->port4_ephy = !of_property_read_bool(np, "mediatek,port4-gmac");
 
 	if (of_property_read_u16(np, "mediatek,ephy-base-address", &val) == 0)
 		gsw->ephy_base = val;
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h
index f10946a173..91a0399976 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h
@@ -88,16 +88,11 @@ enum {
 	GSW_ATTR_PORT_UNTAG,
 };
 
-enum {
-	PORT4_EPHY = 0,
-	PORT4_EXT,
-};
-
 struct mt7620_gsw {
 	struct device		*dev;
 	void __iomem		*base;
 	int			irq;
-	int			port4;
+	bool			port4_ephy;
 	unsigned long int	autopoll;
 	u16			ephy_base;
 };
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
index 7317bc30aa..085058eb11 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
@@ -141,7 +141,7 @@ static void mt7620_port_init(struct fe_priv *priv, struct device_node *np)
 	u32 val, mask = 0;
 	u32 val_delay = 0;
 	u32 mask_delay = GSW_REG_GPCx_TXDELAY | GSW_REG_GPCx_RXDELAY;
-	int min = (gsw->port4 == PORT4_EPHY) ? (5) : (4);
+	int min = (gsw->port4_ephy) ? (5) : (4);
 
 	if (!_id || (be32_to_cpu(*_id) < min) || (be32_to_cpu(*_id) > 5)) {
 		if (_id)


From lede-commits at lists.infradead.org  Tue Jun 22 23:23:27 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 23 Jun 2021 02:23:27 -0400
Subject: [openwrt/openwrt]  ramips: mt7620: fix RGMII TXID PHY mode
In-Reply-To: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
References: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
Message-ID: <mailman.2399.1624429409.1072.lede-commits@lists.infradead.org>

981213 pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/26c84b2e46caba1ae17bc82a533c99eee65e7004

commit 26c84b2e46caba1ae17bc82a533c99eee65e7004
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Sat May 1 14:17:11 2021 -0400

    ramips: mt7620: fix RGMII TXID PHY mode
    
    the register bits for TX delay and RX delay are opposites:
    when TX delay bit is set, delay is enabled
    when RX delay bit is set, delay is disabled
    
    So, when both bits are unset, it is RX delay
    and when both bits are set, it is TX delay
    
    Note: TXID is the default RGMII mode of the SOC
    
    Fixes: 5410a8e2959a ("ramips: mt7620: add rgmii delays support")
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
index 4d012afa14..c9104aa375 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
@@ -205,7 +205,7 @@ static void mt7620_port_init(struct fe_priv *priv, struct device_node *np)
 		break;
 	case PHY_INTERFACE_MODE_RGMII_TXID:
 		mask = 0;
-		val_delay &= ~GSW_REG_GPCx_TXDELAY;
+		val_delay |= GSW_REG_GPCx_TXDELAY;
 		val_delay |= GSW_REG_GPCx_RXDELAY;
 		break;
 	case PHY_INTERFACE_MODE_MII:


From lede-commits at lists.infradead.org  Tue Jun 22 23:23:28 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 23 Jun 2021 02:23:28 -0400
Subject: [openwrt/openwrt] ramips: mt7620: ethernet: use more macros and
 bump version
In-Reply-To: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
References: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
Message-ID: <mailman.2400.1624429409.1072.lede-commits@lists.infradead.org>

981213 pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/88a0cebadfecb6ebb9f5f535e74f7f7574f513f3

commit 88a0cebadfecb6ebb9f5f535e74f7f7574f513f3
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Sat May 1 14:47:01 2021 -0400

    ramips: mt7620: ethernet: use more macros and bump version
    
    Define and use some missing macros,
    and use them instead of BIT() or numbers for more readable code.
    
    Add comment for a bit change that seems unrelated to ethernet
    but is actually needed (PCIe Root Complex mode).
    
    Remove unknown and unused macro RST_CTRL_MCM
    (probably from MT7621 / MT7622)
    
    This is the last of a series of fixes, so bump version.
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 .../linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c   | 8 +++++---
 .../linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h   | 2 +-
 .../linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h  | 6 +++++-
 .../linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c   | 2 --
 4 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
index ae90f0484d..7c91e5840b 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
@@ -65,9 +65,11 @@ static void mt7620_hw_init(struct mt7620_gsw *gsw)
 {
 	u32 i;
 	u32 val;
-	u32 is_BGA = (rt_sysc_r32(0x0c) >> 16) & 1;
+	u32 is_BGA = (rt_sysc_r32(SYSC_REG_CHIP_REV_ID) >> 16) & 1;
+
+	/* Internal ethernet requires PCIe RC mode */
+	rt_sysc_w32(rt_sysc_r32(SYSC_REG_CFG1) | PCIE_RC_MODE, SYSC_REG_CFG1);
 
-	rt_sysc_w32(rt_sysc_r32(SYSC_REG_CFG1) | BIT(8), SYSC_REG_CFG1);
 	mtk_switch_w32(gsw, mtk_switch_r32(gsw, GSW_REG_CKGCR) & ~(0x3 << 4), GSW_REG_CKGCR);
 
 	/* Enable MIB stats */
@@ -83,7 +85,7 @@ static void mt7620_hw_init(struct mt7620_gsw *gsw)
 		mtk_switch_w32(gsw, mtk_switch_r32(gsw, GSW_REG_GPC1) |
 			(gsw->ephy_base << 16),
 			GSW_REG_GPC1);
-		fe_reset(BIT(24)); /* Resets the Ethernet PHY block. */
+		fe_reset(MT7620A_RESET_EPHY);
 
 		pr_info("gsw: ephy base address: %d\n", gsw->ephy_base);
 	}
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h
index fde7792c02..cb5d098e9c 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.h
@@ -55,7 +55,7 @@
 
 #define SYSC_REG_CHIP_REV_ID	0x0c
 #define SYSC_REG_CFG1		0x14
-#define RST_CTRL_MCM		BIT(2)
+#define PCIE_RC_MODE		BIT(8)
 #define SYSC_PAD_RGMII2_MDIO	0x58
 #define SYSC_GPIO_MODE		0x60
 
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h
index 00f1a0e7e6..c8517f9f9d 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h
@@ -49,7 +49,7 @@ enum fe_work_flag {
 	FE_FLAG_MAX
 };
 
-#define MTK_FE_DRV_VERSION		"0.1.2"
+#define MTK_FE_DRV_VERSION		"0.2"
 
 /* power of 2 to let NEXT_TX_DESP_IDX work */
 #define NUM_DMA_DESC		BIT(10)
@@ -157,6 +157,10 @@ enum fe_work_flag {
 #define MT7620A_FE_GDMA1_MAC_ADRL	(MT7620A_GDMA_OFFSET + 0x0C)
 #define MT7620A_FE_GDMA1_MAC_ADRH	(MT7620A_GDMA_OFFSET + 0x10)
 
+#define MT7620A_RESET_FE	BIT(21)
+#define MT7620A_RESET_ESW	BIT(23)
+#define MT7620A_RESET_EPHY	BIT(24)
+
 #define RT5350_TX_BASE_PTR0	(RT5350_PDMA_OFFSET + 0x00)
 #define RT5350_TX_MAX_CNT0	(RT5350_PDMA_OFFSET + 0x04)
 #define RT5350_TX_CTX_IDX0	(RT5350_PDMA_OFFSET + 0x08)
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
index c9104aa375..1ca597470c 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
@@ -27,8 +27,6 @@
 
 #define MT7620A_CDMA_CSG_CFG	0x400
 #define MT7620_DMA_VID		(MT7620A_CDMA_CSG_CFG | 0x30)
-#define MT7620A_RESET_FE	BIT(21)
-#define MT7620A_RESET_ESW	BIT(23)
 #define MT7620_L4_VALID		BIT(23)
 
 #define MT7620_TX_DMA_UDF	BIT(15)


From lede-commits at lists.infradead.org  Tue Jun 22 23:23:29 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 23 Jun 2021 02:23:29 -0400
Subject: [openwrt/openwrt] ramips: mt7620: disable SOC VLANs for external
 switches
In-Reply-To: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
References: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
Message-ID: <mailman.2401.1624429409.1072.lede-commits@lists.infradead.org>

981213 pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/2adeada04558848058105cdad8195848d10d1486

commit 2adeada04558848058105cdad8195848d10d1486
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Tue Apr 20 12:35:47 2021 -0400

    ramips: mt7620: disable SOC VLANs for external switches
    
    These boards have AR8327 or QCA8337 external ethernet switch.
    The SOC also has it's own internal switch
    where VLAN is now enabled by default.
    
    Changes to preinit caused all switches to have VLANs enabled by default
    even if they are not configured with a topology in uci_defaults
    (see commit f017f617aecbd47debd4d3a734dc0e471342db96)
    
    When both internal and external switches have VLANs,
    and the external switch has both LAN and WAN,
    the TX traffic from the SOC cannot flow to the tagged port on the external switch
    because the VLAN IDs are not matching.
    
    So disable the internal switch VLANs by default on these boards.
    
    Also, add a topology for the internal switch,
    so that on LuCI there is not an "unknown topology" warning.
    
    In theory, it may be possible to have LAN ports on both switches
    through internal and external PHYs, but there are no known boards that have this.
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 target/linux/ramips/mt7620/base-files/etc/board.d/02_network | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network
index 71850863c0..eaa8cbf7aa 100644
--- a/target/linux/ramips/mt7620/base-files/etc/board.d/02_network
+++ b/target/linux/ramips/mt7620/base-files/etc/board.d/02_network
@@ -136,6 +136,9 @@ ramips_setup_interfaces()
 	engenius,esr600)
 		ucidef_add_switch "switch0" \
 			"1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan" "0 at eth0"
+		ucidef_add_switch "switch1" \
+			"5:lan" "6 at eth0"
+		ucidef_add_switch_attr "switch1" "enable" "false"
 		;;
 	fon,fon2601)
 		ucidef_add_switch "switch0" \
@@ -168,6 +171,9 @@ ramips_setup_interfaces()
 	lava,lr-25g001)
 		ucidef_add_switch "switch0" \
 			"1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0 at eth0"
+		ucidef_add_switch "switch1" \
+			"5:lan" "6 at eth0"
+		ucidef_add_switch_attr "switch1" "enable" "false"
 		;;
 	lenovo,newifi-y1|\
 	xiaomi,miwifi-mini)


From lede-commits at lists.infradead.org  Tue Jun 22 23:23:30 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 23 Jun 2021 02:23:30 -0400
Subject: [openwrt/openwrt] ramips: add missing "pinctrl-names" for Youku YK1
In-Reply-To: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
References: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
Message-ID: <mailman.2417.1624431635.1072.lede-commits@lists.infradead.org>

981213 pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/b8435400574ce21fd4e47799c65fbe919920221a

commit b8435400574ce21fd4e47799c65fbe919920221a
Author: Shiji Yang <yangshiji66 at qq.com>
AuthorDate: Mon May 17 12:46:52 2021 +0800

    ramips: add missing "pinctrl-names" for Youku YK1
    
    Without this definition ethernet led can work as usual, but it's better to
    re-add it. Relying on default values may cause uncontrollable factors.
    
    Fixes: 882a6116d3d6 ("ramips: improve pinctrl for Youku YK-L1")
    
    Signed-off-by: Shiji Yang <yangshiji66 at qq.com>
---
 target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi b/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi
index 61062a3179..db9bacefe8 100644
--- a/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi
+++ b/target/linux/ramips/dts/mt7620a_youku_yk-l1.dtsi
@@ -103,6 +103,7 @@
 
 &ethernet {
 	pinctrl-names = "default";
+	pinctrl-0 = <&ephy_pins>;
 
 	mtd-mac-address = <&factory 0x28>;
 


From lede-commits at lists.infradead.org  Tue Jun 22 23:23:31 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 23 Jun 2021 02:23:31 -0400
Subject: [openwrt/openwrt] ramips: fix software reboot failure on HILINK
 HLK-7628N
In-Reply-To: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
References: <162442940088.24598.10059184249126906490@git-01.infra.openwrt.org>
Message-ID: <mailman.2418.1624431656.1072.lede-commits@lists.infradead.org>

981213 pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/e6b3e77e6ef635688b810a9bba528d477998270e

commit e6b3e77e6ef635688b810a9bba528d477998270e
Author: Liu Yu <f78fk at live.com>
AuthorDate: Sat Jun 12 20:02:45 2021 +0800

    ramips: fix software reboot failure on HILINK HLK-7628N
    
    In the new kernel version 5.X,reboot will fail.
    
    When SOC is reset, flash has not exited the 4-byte address mode,
    which causes the operation mode mismatch of flash during boot.Add
    broken-flash-reset to make flash exit 4-byte address mode before
    SOC reset
    
    Signed-off-by: Liu Yu <f78fk at live.com>
---
 target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts b/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts
index f5106a5080..87dff72c40 100644
--- a/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts
+++ b/target/linux/ramips/dts/mt7628an_hilink_hlk-7628n.dts
@@ -47,6 +47,7 @@
 		compatible = "jedec,spi-nor";
 		reg = <0>;
 		spi-max-frequency = <10000000>;
+		broken-flash-reset;
 
 		partitions {
 			compatible = "fixed-partitions";


From lede-commits at lists.infradead.org  Wed Jun 23 15:10:55 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 23 Jun 2021 18:10:55 -0400
Subject: [openwrt/openwrt] mac80211: distance config: allow "auto" as a value
In-Reply-To: <162448625577.21136.17717224249891315180@git-01.infra.openwrt.org>
References: <162448625577.21136.17717224249891315180@git-01.infra.openwrt.org>
Message-ID: <mailman.2614.1624486261.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch openwrt-19.07:
https://git.openwrt.org/15612706c930ed26af9e05b649efc2d245157273

commit 15612706c930ed26af9e05b649efc2d245157273
Author: Ali MJ Al-Nasrawy <alimjalnasrawy at gmail.com>
AuthorDate: Wed Sep 18 20:14:42 2019 +0300

    mac80211: distance config: allow "auto" as a value
    
    The user can now enable the ACK timeout estimation algorithm (dynack)
    for drivers that support it.
    It is also expected that the distance config accepts the same values as:
    $ iw phyX set distance XXX
    
    Signed-off-by: Ali MJ Al-Nasrawy <alimjalnasrawy at gmail.com>
    (cherry picked from commit a8a1ef856871dc8403ea9c0a3bb347c7120b0e65)
---
 package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index 36aebbb2cc..bb48ab9a15 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -24,8 +24,9 @@ drv_mac80211_init_device_config() {
 	config_add_string path phy 'macaddr:macaddr'
 	config_add_string hwmode
 	config_add_string tx_burst
+	config_add_string distance
 	config_add_int beacon_int chanbw frag rts
-	config_add_int rxantenna txantenna antenna_gain txpower distance
+	config_add_int rxantenna txantenna antenna_gain txpower
 	config_add_boolean noscan ht_coex
 	config_add_array ht_capab
 	config_add_array channels


From lede-commits at lists.infradead.org  Wed Jun 23 17:11:26 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 23 Jun 2021 20:11:26 -0400
Subject: [openwrt/openwrt]  base-files: fix zoneinfo support
In-Reply-To: <162449348685.24444.7704300130351159059@git-01.infra.openwrt.org>
References: <162449348685.24444.7704300130351159059@git-01.infra.openwrt.org>
Message-ID: <mailman.2621.1624493492.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/8af62ede189aa504135db05474d34c9f8a1ed35d

commit 8af62ede189aa504135db05474d34c9f8a1ed35d
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Fri Apr 9 17:22:48 2021 -0700

    base-files: fix zoneinfo support
    
    The system init script currently sets /tmp/localinfo when zoneinfo is
    populated. However, zoneinfo has spaces in it whereas the actual files
    have _ instead of spaces. This made the if condition never return true.
    
    Example failure when removing the if condition:
    
    /tmp/localtime -> /usr/share/zoneinfo/America/Los Angeles
    
    This file does not exist. America/Los_Angeles does.
    
    Ran through shfmt -w -ci -bn -sr -s
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 package/base-files/files/etc/init.d/system | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/package/base-files/files/etc/init.d/system b/package/base-files/files/etc/init.d/system
index 08cf86b97f..2290964d7e 100755
--- a/package/base-files/files/etc/init.d/system
+++ b/package/base-files/files/etc/init.d/system
@@ -4,8 +4,7 @@
 START=10
 USE_PROCD=1
 
-validate_system_section()
-{
+validate_system_section() {
 	uci_load_validate system system "$1" "$2" \
 		'hostname:string:OpenWrt' \
 		'conloglevel:uinteger' \
@@ -22,9 +21,13 @@ system_config() {
 
 	echo "$hostname" > /proc/sys/kernel/hostname
 	[ -z "$conloglevel" -a -z "$buffersize" ] || dmesg ${conloglevel:+-n $conloglevel} ${buffersize:+-s $buffersize}
-	echo "$timezone" > /tmp/TZ
-	[ -n "$zonename" ] && [ -f "/usr/share/zoneinfo/$zonename" ] && \
-		ln -sf "/usr/share/zoneinfo/$zonename" /tmp/localtime && rm -f /tmp/TZ
+	rm -f /tmp/TZ
+	if [ -n "$zonename" ]; then
+		local zname=$(echo "$zonename" | tr ' ' _)
+		[ -f "/usr/share/zoneinfo/$zname" ] && ln -sf "/usr/share/zoneinfo/$zname" /tmp/localtime
+	else
+		echo "$timezone" > /tmp/TZ
+	fi
 
 	# apply timezone to kernel
 	hwclock -u --systz
@@ -35,8 +38,7 @@ reload_service() {
 	config_foreach validate_system_section system system_config
 }
 
-service_triggers()
-{
+service_triggers() {
 	procd_add_reload_trigger "system"
 	procd_add_validation validate_system_section
 }


From lede-commits at lists.infradead.org  Wed Jun 23 17:52:42 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 23 Jun 2021 20:52:42 -0400
Subject: [openwrt/openwrt] hostapd: add default_disabled option to the
 supplicant
In-Reply-To: <162449596210.17123.1540854889463055568@git-01.infra.openwrt.org>
References: <162449596210.17123.1540854889463055568@git-01.infra.openwrt.org>
Message-ID: <mailman.2622.1624495975.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/acdb7c38c6f4411f5d2e96b45fff942505de58d1

commit acdb7c38c6f4411f5d2e96b45fff942505de58d1
Author: Rapha?l M?lotte <raphael.melotte at mind.be>
AuthorDate: Wed Oct 7 10:08:14 2020 +0200

    hostapd: add default_disabled option to the supplicant
    
    With the default configuration we generate, the supplicant starts
    scanning and tries to connect to any open network when the interface
    is enabled.
    
    In some cases it can be desirable to prevent the supplicant from
    scanning by itself. For example, if on the same radio an AP is
    configured and an unconfigured STA is added (to be configured with
    WPS), the AP might not be able to beacon until the STA stops
    scanning.
    
    In such a case, the STA configuration can still be required to set
    specific settings (e.g. multi_ap_backhaul_sta) so it can't be set to
    "disabled" in uci (because that would prevent the supplicant from
    being run at all). The alternative is to add the "disabled" parameter
    to the default network block in the supplicant configuration.
    
    This patch adds a "default_disabled" setting in UCI which, when set,
    adds the "disabled" parameter to the supplicant default network block.
    
    Signed-off-by: Rapha?l M?lotte <raphael.melotte at mind.be>
---
 package/network/services/hostapd/files/hostapd.sh | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 4a5f8d61fe..a32e1652ac 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -350,6 +350,7 @@ hostapd_common_add_bss_config() {
 	config_add_boolean multicast_to_unicast proxy_arp per_sta_vif
 
 	config_add_array hostapd_bss_options
+	config_add_boolean default_disabled
 
 	config_add_boolean request_cui
 	config_add_array radius_auth_req_attr
@@ -1188,7 +1189,8 @@ wpa_supplicant_add_network() {
 		ssid bssid key \
 		basic_rate mcast_rate \
 		ieee80211w ieee80211r \
-		multi_ap
+		multi_ap \
+		default_disabled
 
 	case "$auth_type" in
 		sae|owe|eap192|eap-eap192)
@@ -1201,6 +1203,7 @@ wpa_supplicant_add_network() {
 
 	set_default ieee80211r 0
 	set_default multi_ap 0
+	set_default default_disabled 0
 
 	local key_mgmt='NONE'
 	local network_data=
@@ -1232,7 +1235,10 @@ wpa_supplicant_add_network() {
 		scan_ssid=""
 	}
 
-	[ "$multi_ap" = 1 -a "$_w_mode" = "sta" ] && append network_data "multi_ap_backhaul_sta=1" "$N$T"
+	[ "$_w_mode" = "sta" ] && {
+		[ "$multi_ap" = 1 ] && append network_data "multi_ap_backhaul_sta=1" "$N$T"
+		[ "$default_disabled" = 1 ] && append network_data "disabled=1" "$N$T"
+	}
 
 	case "$auth_type" in
 		none) ;;


From lede-commits at lists.infradead.org  Wed Jun 23 18:44:17 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 23 Jun 2021 21:44:17 -0400
Subject: [openwrt/openwrt]  base-files: fix zoneinfo support
In-Reply-To: <162449905710.15640.7419043889359046689@git-01.infra.openwrt.org>
References: <162449905710.15640.7419043889359046689@git-01.infra.openwrt.org>
Message-ID: <mailman.2625.1624499068.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/3047df231743969ec2b4641d531e888b8c7f30e0

commit 3047df231743969ec2b4641d531e888b8c7f30e0
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Fri Apr 9 17:22:48 2021 -0700

    base-files: fix zoneinfo support
    
    The system init script currently sets /tmp/localinfo when zoneinfo is
    populated. However, zoneinfo has spaces in it whereas the actual files
    have _ instead of spaces. This made the if condition never return true.
    
    Example failure when removing the if condition:
    
    /tmp/localtime -> /usr/share/zoneinfo/America/Los Angeles
    
    This file does not exist. America/Los_Angeles does.
    
    Ran through shfmt -w -ci -bn -sr -s
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    (cherry picked from commit 8af62ede189aa504135db05474d34c9f8a1ed35d)
---
 package/base-files/files/etc/init.d/system | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/package/base-files/files/etc/init.d/system b/package/base-files/files/etc/init.d/system
index 08cf86b97f..2290964d7e 100755
--- a/package/base-files/files/etc/init.d/system
+++ b/package/base-files/files/etc/init.d/system
@@ -4,8 +4,7 @@
 START=10
 USE_PROCD=1
 
-validate_system_section()
-{
+validate_system_section() {
 	uci_load_validate system system "$1" "$2" \
 		'hostname:string:OpenWrt' \
 		'conloglevel:uinteger' \
@@ -22,9 +21,13 @@ system_config() {
 
 	echo "$hostname" > /proc/sys/kernel/hostname
 	[ -z "$conloglevel" -a -z "$buffersize" ] || dmesg ${conloglevel:+-n $conloglevel} ${buffersize:+-s $buffersize}
-	echo "$timezone" > /tmp/TZ
-	[ -n "$zonename" ] && [ -f "/usr/share/zoneinfo/$zonename" ] && \
-		ln -sf "/usr/share/zoneinfo/$zonename" /tmp/localtime && rm -f /tmp/TZ
+	rm -f /tmp/TZ
+	if [ -n "$zonename" ]; then
+		local zname=$(echo "$zonename" | tr ' ' _)
+		[ -f "/usr/share/zoneinfo/$zname" ] && ln -sf "/usr/share/zoneinfo/$zname" /tmp/localtime
+	else
+		echo "$timezone" > /tmp/TZ
+	fi
 
 	# apply timezone to kernel
 	hwclock -u --systz
@@ -35,8 +38,7 @@ reload_service() {
 	config_foreach validate_system_section system system_config
 }
 
-service_triggers()
-{
+service_triggers() {
 	procd_add_reload_trigger "system"
 	procd_add_validation validate_system_section
 }


From lede-commits at lists.infradead.org  Wed Jun 23 18:45:33 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 23 Jun 2021 21:45:33 -0400
Subject: [openwrt/openwrt]  base-files: fix zoneinfo support
In-Reply-To: <162449913322.16697.2491529999871027343@git-01.infra.openwrt.org>
References: <162449913322.16697.2491529999871027343@git-01.infra.openwrt.org>
Message-ID: <mailman.2626.1624499136.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch openwrt-19.07:
https://git.openwrt.org/c88bdb8294a73e0eaa3cd86e843564a8244b333c

commit c88bdb8294a73e0eaa3cd86e843564a8244b333c
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Fri Apr 9 17:22:48 2021 -0700

    base-files: fix zoneinfo support
    
    The system init script currently sets /tmp/localinfo when zoneinfo is
    populated. However, zoneinfo has spaces in it whereas the actual files
    have _ instead of spaces. This made the if condition never return true.
    
    Example failure when removing the if condition:
    
    /tmp/localtime -> /usr/share/zoneinfo/America/Los Angeles
    
    This file does not exist. America/Los_Angeles does.
    
    Ran through shfmt -w -ci -bn -sr -s
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    (cherry picked from commit 8af62ede189aa504135db05474d34c9f8a1ed35d)
---
 package/base-files/files/etc/init.d/system | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/package/base-files/files/etc/init.d/system b/package/base-files/files/etc/init.d/system
index a98a972469..219b29812d 100755
--- a/package/base-files/files/etc/init.d/system
+++ b/package/base-files/files/etc/init.d/system
@@ -4,8 +4,7 @@
 START=10
 USE_PROCD=1
 
-validate_system_section()
-{
+validate_system_section() {
 	uci_load_validate system system "$1" "$2" \
 		'hostname:string:OpenWrt' \
 		'conloglevel:uinteger' \
@@ -22,9 +21,13 @@ system_config() {
 
 	echo "$hostname" > /proc/sys/kernel/hostname
 	[ -z "$conloglevel" -a -z "$buffersize" ] || dmesg ${conloglevel:+-n $conloglevel} ${buffersize:+-s $buffersize}
-	echo "$timezone" > /tmp/TZ
-	[ -n "$zonename" ] && [ -f "/usr/share/zoneinfo/$zonename" ] && \
-		ln -sf "/usr/share/zoneinfo/$zonename" /tmp/localtime && rm -f /tmp/TZ
+	rm -f /tmp/TZ
+	if [ -n "$zonename" ]; then
+		local zname=$(echo "$zonename" | tr ' ' _)
+		[ -f "/usr/share/zoneinfo/$zname" ] && ln -sf "/usr/share/zoneinfo/$zname" /tmp/localtime
+	else
+		echo "$timezone" > /tmp/TZ
+	fi
 
 	# apply timezone to kernel
 	date -k
@@ -35,8 +38,7 @@ reload_service() {
 	config_foreach validate_system_section system system_config
 }
 
-service_triggers()
-{
+service_triggers() {
 	procd_add_reload_trigger "system"
 	procd_add_validation validate_system_section
 }


From lede-commits at lists.infradead.org  Thu Jun 24 00:02:51 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 24 Jun 2021 03:02:51 -0400
Subject: [openwrt/openwrt] ipq40xx: specify FritzBox 7530 LAN port label
 numbers
In-Reply-To: <162451817104.23164.16636725993115020062@git-01.infra.openwrt.org>
References: <162451817104.23164.16636725993115020062@git-01.infra.openwrt.org>
Message-ID: <mailman.2684.1624518174.1072.lede-commits@lists.infradead.org>

rmilecki pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/3342d574be08db8926273678291497769d2365e9

commit 3342d574be08db8926273678291497769d2365e9
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Thu Jun 10 07:14:03 2021 +0200

    ipq40xx: specify FritzBox 7530 LAN port label numbers
    
    This helps managing LAN ports.
    
    Ref: https://forum.openwrt.org/t/openwrt-21-02-0-second-release-candidate/98026/121
    Fixes: 95b0c07a618f ("ipq40xx: add support for FritzBox 7530")
    Cc: David Bauer <mail at david-bauer.net>
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 target/linux/ipq40xx/base-files/etc/board.d/02_network | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ipq40xx/base-files/etc/board.d/02_network b/target/linux/ipq40xx/base-files/etc/board.d/02_network
index ecdbac8f86..a675acc8db 100644
--- a/target/linux/ipq40xx/base-files/etc/board.d/02_network
+++ b/target/linux/ipq40xx/base-files/etc/board.d/02_network
@@ -65,7 +65,7 @@ ipq40xx_setup_interfaces()
 		;;
 	avm,fritzbox-7530)
 		ucidef_add_switch "switch0" \
-			"0u at eth0" "1:lan" "2:lan" "3:lan" "4:lan"
+			"0u at eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
 		;;
 	avm,fritzrepeater-3000)
 		ucidef_add_switch "switch0" \


From lede-commits at lists.infradead.org  Thu Jun 24 06:56:55 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 24 Jun 2021 09:56:55 -0400
Subject: [openwrt/openwrt] hostapd: add support for providing vendor
 specific IE elements
In-Reply-To: <162454301551.683.15791107005101071923@git-01.infra.openwrt.org>
References: <162454301551.683.15791107005101071923@git-01.infra.openwrt.org>
Message-ID: <mailman.3028.1624543024.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/1818b038d7275273adbd525b5ee76bc60b7d628c

commit 1818b038d7275273adbd525b5ee76bc60b7d628c
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Jun 24 15:56:12 2021 +0200

    hostapd: add support for providing vendor specific IE elements
    
    They can be added as hex digit strings via the 'vendor_elements' option
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/network/services/hostapd/files/hostapd.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index a32e1652ac..7d035a299b 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -298,6 +298,7 @@ hostapd_common_add_bss_config() {
 	config_add_boolean wnm_sleep_mode wnm_sleep_mode_no_keys bss_transition
 	config_add_int time_advertisement
 	config_add_string time_zone
+	config_add_string vendor_elements
 
 	config_add_boolean ieee80211k rrm_neighbor_report rrm_beacon_report
 
@@ -529,7 +530,8 @@ hostapd_set_bss_options() {
 		multi_ap multi_ap_backhaul_ssid multi_ap_backhaul_key skip_inactivity_poll \
 		airtime_bss_weight airtime_bss_limit airtime_sta_weight \
 		multicast_to_unicast proxy_arp per_sta_vif \
-		eap_server eap_user_file ca_cert server_cert private_key private_key_passwd server_id
+		eap_server eap_user_file ca_cert server_cert private_key private_key_passwd server_id \
+		vendor_elements
 
 	set_default isolate 0
 	set_default maxassoc 0
@@ -577,6 +579,7 @@ hostapd_set_bss_options() {
 	append bss_conf "uapsd_advertisement_enabled=$uapsd" "$N"
 	append bss_conf "utf8_ssid=$utf8_ssid" "$N"
 	append bss_conf "multi_ap=$multi_ap" "$N"
+	[ -n "$vendor_elements" ] && append bss_conf "vendor_elements=$vendor_elements" "$N"
 
 	[ "$tdls_prohibit" -gt 0 ] && append bss_conf "tdls_prohibit=$tdls_prohibit" "$N"
 


From lede-commits at lists.infradead.org  Thu Jun 24 18:25:13 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 24 Jun 2021 21:25:13 -0400
Subject: [openwrt/openwrt] zram-swap: robustify mkswap/swapon/swapoff
 invocation
In-Reply-To: <162458431303.377.2444763945056605317@git-01.infra.openwrt.org>
References: <162458431303.377.2444763945056605317@git-01.infra.openwrt.org>
Message-ID: <mailman.3220.1624584319.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/18c24a29f94ba56ecbee8c7a818368f9ef162527

commit 18c24a29f94ba56ecbee8c7a818368f9ef162527
Author: Rui Salvaterra <rsalvaterra at gmail.com>
AuthorDate: Thu Jun 24 20:05:21 2021 +0100

    zram-swap: robustify mkswap/swapon/swapoff invocation
    
    Instead of assuming /sbin contains the correct BusyBox symlinks, directly invoke
    the busybox executable. The required utilities are guaranteed to be present,
    since the zram-swap package selects them. Additionally, don't assume busybox
    resides in /bin, rely on PATH to find it.
    
    While at it, update the copyright year, use SPDX and switch to AUTORELEASE.
    
    Signed-off-by: Rui Salvaterra <rsalvaterra at gmail.com>
---
 package/system/zram-swap/Makefile        |  9 +++----
 package/system/zram-swap/files/zram.init | 40 ++++++++------------------------
 2 files changed, 13 insertions(+), 36 deletions(-)

diff --git a/package/system/zram-swap/Makefile b/package/system/zram-swap/Makefile
index 80f87fcdff..d0d1baddd1 100644
--- a/package/system/zram-swap/Makefile
+++ b/package/system/zram-swap/Makefile
@@ -1,14 +1,11 @@
+# SPDX-License-Identifier: GPL-2.0-only
 #
-# Copyright (C) 2013 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
+# Copyright (C) 2013-2021 OpenWrt.org
 
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zram-swap
-PKG_RELEASE:=8
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init
index d97e85efa5..9fce5e4797 100755
--- a/package/system/zram-swap/files/zram.init
+++ b/package/system/zram-swap/files/zram.init
@@ -25,31 +25,6 @@ zram_getsize()	# in megabytes
 	fi
 }
 
-zram_applicable()
-{
-	local zram_dev="$1"
-
-	[ -e "$zram_dev" ] || {
-		logger -s -t zram_applicable -p daemon.crit "[ERROR] device '$zram_dev' not found"
-		return 1
-	}
-
-	[ -x /sbin/mkswap ] || {
-		logger -s -t zram_applicable -p daemon.err "[ERROR] 'BusyBox mkswap' not installed"
-		return 1
-	}
-
-	[ -x /sbin/swapon ] || {
-		logger -s -t zram_applicable -p daemon.err "[ERROR] 'BusyBox swapon' not installed"
-		return 1
-	}
-
-	[ -x /sbin/swapoff ] || {
-		logger -s -t zram_applicable -p daemon.err "[ERROR] 'BusyBox swapoff' not installed"
-		return 1
-	}
-}
-
 zram_dev()
 {
 	local idx="$1"
@@ -160,9 +135,14 @@ start()
 		return 1
 	fi
 
-	local zram_size="$( zram_getsize )"
 	local zram_dev="$( zram_getdev )"
-	zram_applicable "$zram_dev" || return 1
+
+	[ -e "$zram_dev" ] || {
+		logger -s -t zram_start -p daemon.crit "[ERROR] device '$zram_dev' not found"
+		return 1
+	}
+
+	local zram_size="$( zram_getsize )"
 	local zram_priority="$( uci -q get system. at system[0].zram_priority )"
 	zram_priority=${zram_priority:+-p $zram_priority}
 
@@ -171,8 +151,8 @@ start()
 	zram_reset "$zram_dev" "enforcing defaults"
 	zram_comp_algo "$zram_dev"
 	echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename "$zram_dev" )/disksize"
-	/sbin/mkswap "$zram_dev"
-	/sbin/swapon -d $zram_priority "$zram_dev"
+	busybox mkswap "$zram_dev"
+	busybox swapon -d $zram_priority "$zram_dev"
 }
 
 stop()
@@ -181,7 +161,7 @@ stop()
 
 	for zram_dev in $( grep zram /proc/swaps |awk '{print $1}' ); do {
 		logger -s -t zram_stop -p daemon.debug "deactivate swap $zram_dev"
-		/sbin/swapoff "$zram_dev" && zram_reset "$zram_dev" "claiming memory back"
+		busybox swapoff "$zram_dev" && zram_reset "$zram_dev" "claiming memory back"
 		local dev_index="$( echo $zram_dev | grep -o "[0-9]*$" )"
 		if [ $dev_index -ne 0 ]; then
 			logger -s -t zram_stop -p daemon.debug "removing zram $zram_dev"


From lede-commits at lists.infradead.org  Thu Jun 24 23:00:52 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 25 Jun 2021 02:00:52 -0400
Subject: [openwrt/openwrt] base-files: fix /tmp/TZ when zoneinfo not installed
In-Reply-To: <162460085292.30690.5226869037168167817@git-01.infra.openwrt.org>
References: <162460085292.30690.5226869037168167817@git-01.infra.openwrt.org>
Message-ID: <mailman.3228.1624600858.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/56bdb6bb9781f8a0bbec5fc3075b9d2b8d12f9a8

commit 56bdb6bb9781f8a0bbec5fc3075b9d2b8d12f9a8
Author: Paul Spooren <mail at aparcar.org>
AuthorDate: Thu Jun 24 07:42:53 2021 -1000

    base-files: fix /tmp/TZ when zoneinfo not installed
    
    The zoneinfo packages are not installed per default so neither
    /tmp/localtime nor /tmp/TZ is generated.
    
    This patch mostly reverts the previous fix and instead incooperates a
    solution suggested by Jo.
    
    Fixes "base-files: fix zoneinfo support " 8af62ed
    
    Signed-off-by: Paul Spooren <mail at aparcar.org>
---
 package/base-files/files/etc/init.d/system | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/package/base-files/files/etc/init.d/system b/package/base-files/files/etc/init.d/system
index 2290964d7e..dcfc2616c6 100755
--- a/package/base-files/files/etc/init.d/system
+++ b/package/base-files/files/etc/init.d/system
@@ -21,13 +21,10 @@ system_config() {
 
 	echo "$hostname" > /proc/sys/kernel/hostname
 	[ -z "$conloglevel" -a -z "$buffersize" ] || dmesg ${conloglevel:+-n $conloglevel} ${buffersize:+-s $buffersize}
-	rm -f /tmp/TZ
-	if [ -n "$zonename" ]; then
-		local zname=$(echo "$zonename" | tr ' ' _)
-		[ -f "/usr/share/zoneinfo/$zname" ] && ln -sf "/usr/share/zoneinfo/$zname" /tmp/localtime
-	else
-		echo "$timezone" > /tmp/TZ
-	fi
+	echo "$timezone" > /tmp/TZ
+	[ -n "$zonename" ] && [ -f "/usr/share/zoneinfo/${zonename// /_}" ] \
+		&& ln -sf "/usr/share/zoneinfo/${zonename// /_}" /tmp/localtime \
+		&& rm -f /tmp/TZ
 
 	# apply timezone to kernel
 	hwclock -u --systz


From lede-commits at lists.infradead.org  Fri Jun 25 04:02:30 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 25 Jun 2021 07:02:30 -0400
Subject: [openwrt/openwrt] ramips: ethernet: ralink: allow to return
 EPROBE_DEFER on switch_init
In-Reply-To: <162461894688.13074.9553220073764461262@git-01.infra.openwrt.org>
References: <162461894688.13074.9553220073764461262@git-01.infra.openwrt.org>
Message-ID: <mailman.3505.1624618953.1072.lede-commits@lists.infradead.org>

lynxis pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/74c58c9d5844d52e23a7fc52f4d45a5fedd06a2b

commit 74c58c9d5844d52e23a7fc52f4d45a5fedd06a2b
Author: Alexander Couzens <lynxis at fe80.eu>
AuthorDate: Wed Jun 2 00:01:53 2021 +0000

    ramips: ethernet: ralink: allow to return EPROBE_DEFER on switch_init
    
    For rt3050 the switch needs to be initialized before the ethernet start sending
    packets. Allow switch_init to return -EPROBE_DEFER.
    
    Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
---
 .../linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c
index 8a088bd5ce..cf6d4806ed 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c
@@ -1376,11 +1376,16 @@ static int __init fe_init(struct net_device *dev)
 	else
 		fe_reset_fe(priv);
 
-	if (priv->soc->switch_init)
-		if (priv->soc->switch_init(priv)) {
+	if (priv->soc->switch_init) {
+		err = priv->soc->switch_init(priv);
+		if (err) {
+			if (err == -EPROBE_DEFER)
+				return err;
+
 			netdev_err(dev, "failed to initialize switch core\n");
 			return -ENODEV;
 		}
+	}
 
 	fe_reset_phy(priv);
 


From lede-commits at lists.infradead.org  Fri Jun 25 04:02:28 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 25 Jun 2021 07:02:28 -0400
Subject: [openwrt/openwrt] ramips: ethernet: ralink: use the reset
 controller api for esw & ephy
In-Reply-To: <162461894688.13074.9553220073764461262@git-01.infra.openwrt.org>
References: <162461894688.13074.9553220073764461262@git-01.infra.openwrt.org>
Message-ID: <mailman.3506.1624618953.1072.lede-commits@lists.infradead.org>

lynxis pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/694561ae601ae41c622b8cb2d40dfe34feeaa174

commit 694561ae601ae41c622b8cb2d40dfe34feeaa174
Author: Alexander Couzens <lynxis at fe80.eu>
AuthorDate: Wed Jun 9 23:35:54 2021 +0200

    ramips: ethernet: ralink: use the reset controller api for esw & ephy
    
    Instead of writing direct into the reset registers.
    
    Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
---
 target/linux/ramips/dts/mt7628an.dtsi              |  4 +-
 target/linux/ramips/dts/rt3050.dtsi                |  4 +-
 target/linux/ramips/dts/rt3352.dtsi                |  4 +-
 target/linux/ramips/dts/rt5350.dtsi                |  4 +-
 .../files/drivers/net/ethernet/ralink/esw_rt3050.c | 44 ++++++++++++++++++----
 5 files changed, 45 insertions(+), 15 deletions(-)

diff --git a/target/linux/ramips/dts/mt7628an.dtsi b/target/linux/ramips/dts/mt7628an.dtsi
index d622aa9077..9bf20cecdd 100644
--- a/target/linux/ramips/dts/mt7628an.dtsi
+++ b/target/linux/ramips/dts/mt7628an.dtsi
@@ -439,8 +439,8 @@
 		compatible = "mediatek,mt7628-esw", "ralink,rt3050-esw";
 		reg = <0x10110000 0x8000>;
 
-		resets = <&rstctrl 23>;
-		reset-names = "esw";
+		resets = <&rstctrl 23 &rstctrl 24>;
+		reset-names = "esw", "ephy";
 
 		interrupt-parent = <&intc>;
 		interrupts = <17>;
diff --git a/target/linux/ramips/dts/rt3050.dtsi b/target/linux/ramips/dts/rt3050.dtsi
index 0cecd5d8cf..492474fdc4 100644
--- a/target/linux/ramips/dts/rt3050.dtsi
+++ b/target/linux/ramips/dts/rt3050.dtsi
@@ -319,8 +319,8 @@
 		compatible = "ralink,rt3050-esw";
 		reg = <0x10110000 0x8000>;
 
-		resets = <&rstctrl 23>;
-		reset-names = "esw";
+		resets = <&rstctrl 23 &rstctrl 24>;
+		reset-names = "esw", "ephy";
 
 		interrupt-parent = <&intc>;
 		interrupts = <17>;
diff --git a/target/linux/ramips/dts/rt3352.dtsi b/target/linux/ramips/dts/rt3352.dtsi
index 84d6ed5905..608222cb5c 100644
--- a/target/linux/ramips/dts/rt3352.dtsi
+++ b/target/linux/ramips/dts/rt3352.dtsi
@@ -331,8 +331,8 @@
 		compatible = "ralink,rt3352-esw", "ralink,rt3050-esw";
 		reg = <0x10110000 0x8000>;
 
-		resets = <&rstctrl 23>;
-		reset-names = "esw";
+		resets = <&rstctrl 23 &rstctrl 24>;
+		reset-names = "esw", "ephy";
 
 		interrupt-parent = <&intc>;
 		interrupts = <17>;
diff --git a/target/linux/ramips/dts/rt5350.dtsi b/target/linux/ramips/dts/rt5350.dtsi
index ac4c6d9db2..1058069016 100644
--- a/target/linux/ramips/dts/rt5350.dtsi
+++ b/target/linux/ramips/dts/rt5350.dtsi
@@ -356,8 +356,8 @@
 		compatible = "ralink,rt5350-esw", "ralink,rt3050-esw";
 		reg = <0x10110000 0x8000>;
 
-		resets = <&rstctrl 23>;
-		reset-names = "esw";
+		resets = <&rstctrl 23 &rstctrl 24>;
+		reset-names = "esw", "ephy";
 
 		interrupt-parent = <&intc>;
 		interrupts = <17>;
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
index 292f11a170..cd6ae07595 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
@@ -17,9 +17,11 @@
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <asm/mach-ralink/ralink_regs.h>
+#include <linux/of_device.h>
 #include <linux/of_irq.h>
 
 #include <linux/switch.h>
+#include <linux/reset.h>
 
 #include "mtk_eth_soc.h"
 
@@ -172,7 +174,6 @@
 
 #define RT5350_ESW_REG_PXTPC(_x)	(0x150 + (4 * _x))
 #define RT5350_EWS_REG_LED_POLARITY	0x168
-#define RT5350_RESET_EPHY		BIT(24)
 
 enum {
 	/* Global attributes. */
@@ -232,6 +233,8 @@ struct rt305x_esw {
 	int			led_frequency;
 	struct esw_vlan vlans[RT305X_ESW_NUM_VLANS];
 	struct esw_port ports[RT305X_ESW_NUM_PORTS];
+	struct reset_control	*rst_esw;
+	struct reset_control	*rst_ephy;
 
 };
 
@@ -254,6 +257,29 @@ static inline void esw_rmw_raw(struct rt305x_esw *esw, unsigned reg,
 	__raw_writel(t | val, esw->base + reg);
 }
 
+static void esw_reset(struct rt305x_esw *esw)
+{
+	if (!esw->rst_esw)
+		return;
+
+	reset_control_assert(esw->rst_esw);
+	usleep_range(60, 120);
+	reset_control_deassert(esw->rst_esw);
+	/* the esw takes long to reset otherwise the board hang */
+	msleep(10);
+}
+
+static void esw_reset_ephy(struct rt305x_esw *esw)
+{
+	if (!esw->rst_ephy)
+		return;
+
+	reset_control_assert(esw->rst_ephy);
+	usleep_range(60, 120);
+	reset_control_deassert(esw->rst_ephy);
+	usleep_range(60, 120);
+}
+
 static void esw_rmw(struct rt305x_esw *esw, unsigned reg,
 		    unsigned long mask, unsigned long val)
 {
@@ -505,8 +531,7 @@ static void esw_hw_init(struct rt305x_esw *esw)
 		esw->ports[i].disable = (port_disable & (1 << i)) != 0;
 
 	if (ralink_soc == RT305X_SOC_RT3352) {
-		/* reset EPHY */
-		fe_reset(RT5350_RESET_EPHY);
+		esw_reset_ephy(esw);
 
 		rt305x_mii_write(esw, 0, 31, 0x8000);
 		for (i = 0; i < 5; i++) {
@@ -556,8 +581,7 @@ static void esw_hw_init(struct rt305x_esw *esw)
 		/* select local register */
 		rt305x_mii_write(esw, 0, 31, 0x8000);
 	} else if (ralink_soc == RT305X_SOC_RT5350) {
-		/* reset EPHY */
-		fe_reset(RT5350_RESET_EPHY);
+		esw_reset_ephy(esw);
 
 		/* set the led polarity */
 		esw_w32(esw, esw->reg_led_polarity & 0x1F,
@@ -614,8 +638,7 @@ static void esw_hw_init(struct rt305x_esw *esw)
 	} else if (ralink_soc == MT762X_SOC_MT7628AN || ralink_soc == MT762X_SOC_MT7688) {
 		int i;
 
-		/* reset EPHY */
-		fe_reset(RT5350_RESET_EPHY);
+		esw_reset_ephy(esw);
 
 		/* set the led polarity */
 		esw_w32(esw, esw->reg_led_polarity & 0x1F,
@@ -1385,6 +1408,13 @@ static int esw_probe(struct platform_device *pdev)
 	if (reg_init)
 		esw->reg_led_polarity = be32_to_cpu(*reg_init);
 
+	esw->rst_esw = devm_reset_control_get(&pdev->dev, "esw");
+	if (IS_ERR(esw->rst_esw))
+		esw->rst_esw = NULL;
+	esw->rst_ephy = devm_reset_control_get(&pdev->dev, "ephy");
+	if (IS_ERR(esw->rst_ephy))
+		esw->rst_ephy = NULL;
+
 	swdev = &esw->swdev;
 	swdev->of_node = pdev->dev.of_node;
 	swdev->name = "rt305x-esw";


From lede-commits at lists.infradead.org  Fri Jun 25 04:02:26 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 25 Jun 2021 07:02:26 -0400
Subject: [openwrt/openwrt] ramips: ethernet: ralink: add struct fe_priv as
 context to fe_reset()
In-Reply-To: <162461894688.13074.9553220073764461262@git-01.infra.openwrt.org>
References: <162461894688.13074.9553220073764461262@git-01.infra.openwrt.org>
Message-ID: <mailman.3507.1624618955.1072.lede-commits@lists.infradead.org>

lynxis pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/d50e129399e3e9016b63a2c6757245a5136697d5

commit d50e129399e3e9016b63a2c6757245a5136697d5
Author: Alexander Couzens <lynxis at fe80.eu>
AuthorDate: Wed Jun 9 22:55:30 2021 +0200

    ramips: ethernet: ralink: add struct fe_priv as context to fe_reset()
    
    The fe_reset function direct access the reset controller instead
    using the reset controller api. In preparation to use the
    reset controller.
    
    Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
---
 target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c | 2 +-
 target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h | 2 +-
 target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c  | 2 +-
 target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt2880.c  | 2 +-
 target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c  | 4 ++--
 target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3883.c  | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c
index b6e321b78c..f0afb4877a 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c
@@ -1360,7 +1360,7 @@ static int __init fe_init(struct net_device *dev)
 	const char *mac_addr;
 	int err;
 
-	priv->soc->reset_fe();
+	priv->soc->reset_fe(priv);
 
 	if (priv->soc->switch_init)
 		if (priv->soc->switch_init(priv)) {
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h
index c8517f9f9d..eb170986a8 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h
@@ -382,7 +382,7 @@ struct fe_soc_data {
 	const u16 *reg_table;
 
 	void (*init_data)(struct fe_soc_data *data, struct net_device *netdev);
-	void (*reset_fe)(void);
+	void (*reset_fe)(struct fe_priv *priv);
 	void (*set_mac)(struct fe_priv *priv, unsigned char *mac);
 	int (*fwd_config)(struct fe_priv *priv);
 	void (*tx_dma)(struct fe_tx_dma *txd);
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
index 1ca597470c..42685eebc3 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_mt7620.c
@@ -294,7 +294,7 @@ static void mt7620_port_init(struct fe_priv *priv, struct device_node *np)
 	}
 }
 
-static void mt7620_fe_reset(void)
+static void mt7620_fe_reset(struct fe_priv *priv)
 {
 	fe_reset(MT7620A_RESET_FE | MT7620A_RESET_ESW);
 }
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt2880.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt2880.c
index 6c89c997d9..ab3ac1e4f3 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt2880.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt2880.c
@@ -33,7 +33,7 @@ static void rt2880_init_data(struct fe_soc_data *data,
 	/* netdev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_RXCSUM; */
 }
 
-void rt2880_fe_reset(void)
+void rt2880_fe_reset(struct fe_priv *priv)
 {
 	fe_reset(RT2880_RESET_FE);
 }
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c
index 914b81410e..cdc27e056b 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c
@@ -69,7 +69,7 @@ static int rt3050_fwd_config(struct fe_priv *priv)
 	return 0;
 }
 
-static void rt305x_fe_reset(void)
+static void rt305x_fe_reset(struct fe_priv *priv)
 {
 	fe_reset(RT305X_RESET_FE);
 }
@@ -120,7 +120,7 @@ static void rt5350_tx_dma(struct fe_tx_dma *txd)
 	txd->txd4 = 0;
 }
 
-static void rt5350_fe_reset(void)
+static void rt5350_fe_reset(struct fe_priv *priv)
 {
 	fe_reset(RT305X_RESET_FE | RT305X_RESET_ESW);
 }
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3883.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3883.c
index 4935b7fbd4..afcc3da4e4 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3883.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3883.c
@@ -21,7 +21,7 @@
 
 #define RT3883_RSTCTRL_FE		BIT(21)
 
-static void rt3883_fe_reset(void)
+static void rt3883_fe_reset(struct fe_priv *priv)
 {
 	fe_reset(RT3883_RSTCTRL_FE);
 }


From lede-commits at lists.infradead.org  Fri Jun 25 04:02:27 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 25 Jun 2021 07:02:27 -0400
Subject: [openwrt/openwrt] ramips: ethernet: ralink: add fe_reset_fe() to
 reset fe via reset controller
In-Reply-To: <162461894688.13074.9553220073764461262@git-01.infra.openwrt.org>
References: <162461894688.13074.9553220073764461262@git-01.infra.openwrt.org>
Message-ID: <mailman.3508.1624618955.1072.lede-commits@lists.infradead.org>

lynxis pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/3fa01db4793e9aedb798df90a7889fc0124bb2c7

commit 3fa01db4793e9aedb798df90a7889fc0124bb2c7
Author: Alexander Couzens <lynxis at fe80.eu>
AuthorDate: Wed Jun 9 23:08:07 2021 +0200

    ramips: ethernet: ralink: add fe_reset_fe() to reset fe via reset controller
    
    The dts defines the reset fe for all architectures. However
    the soc code used direct register access of the reset controller.
    Replace the custom soc reset with a generic fe_reset_fe().
    
    Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
---
 .../drivers/net/ethernet/ralink/mtk_eth_soc.c      | 24 +++++++++++++++++++---
 .../drivers/net/ethernet/ralink/mtk_eth_soc.h      |  2 ++
 .../files/drivers/net/ethernet/ralink/soc_rt2880.c |  8 --------
 .../files/drivers/net/ethernet/ralink/soc_rt3050.c |  6 ------
 .../files/drivers/net/ethernet/ralink/soc_rt3883.c |  8 --------
 5 files changed, 23 insertions(+), 25 deletions(-)

diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c
index f0afb4877a..8a088bd5ce 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c
@@ -141,6 +141,17 @@ void fe_reset(u32 reset_bits)
 	usleep_range(10, 20);
 }
 
+void fe_reset_fe(struct fe_priv *priv)
+{
+	if (!priv->rst_fe)
+		return;
+
+	reset_control_assert(priv->rst_fe);
+	usleep_range(60, 120);
+	reset_control_deassert(priv->rst_fe);
+	usleep_range(60, 120);
+}
+
 static inline void fe_int_disable(u32 mask)
 {
 	fe_reg_w32(fe_reg_r32(FE_REG_FE_INT_ENABLE) & ~mask,
@@ -1360,7 +1371,10 @@ static int __init fe_init(struct net_device *dev)
 	const char *mac_addr;
 	int err;
 
-	priv->soc->reset_fe(priv);
+	if (priv->soc->reset_fe)
+		priv->soc->reset_fe(priv);
+	else
+		fe_reset_fe(priv);
 
 	if (priv->soc->switch_init)
 		if (priv->soc->switch_init(priv)) {
@@ -1579,6 +1593,12 @@ static int fe_probe(struct platform_device *pdev)
 		goto err_free_dev;
 	}
 
+	priv = netdev_priv(netdev);
+	spin_lock_init(&priv->page_lock);
+	priv->rst_fe = devm_reset_control_get(&pdev->dev, "fe");
+	if (IS_ERR(priv->rst_fe))
+		priv->rst_fe = NULL;
+
 	if (soc->init_data)
 		soc->init_data(soc, netdev);
 	netdev->vlan_features = netdev->hw_features &
@@ -1593,8 +1613,6 @@ static int fe_probe(struct platform_device *pdev)
 	if (fe_reg_table[FE_REG_FE_DMA_VID_BASE])
 		netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
 
-	priv = netdev_priv(netdev);
-	spin_lock_init(&priv->page_lock);
 	if (fe_reg_table[FE_REG_FE_COUNTER_BASE]) {
 		priv->hw_stats = kzalloc(sizeof(*priv->hw_stats), GFP_KERNEL);
 		if (!priv->hw_stats) {
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h
index eb170986a8..968db366cf 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.h
@@ -498,6 +498,7 @@ struct fe_priv {
 	DECLARE_BITMAP(pending_flags, FE_FLAG_MAX);
 
 	struct reset_control		*rst_ppe;
+	struct reset_control		*rst_fe;
 	struct mtk_foe_entry		*foe_table;
 	dma_addr_t			foe_table_phys;
 	struct flow_offload __rcu	**foe_flow_table;
@@ -517,6 +518,7 @@ void fe_reg_w32(u32 val, enum fe_reg reg);
 u32 fe_reg_r32(enum fe_reg reg);
 
 void fe_reset(u32 reset_bits);
+void fe_reset_fe(struct fe_priv *priv);
 
 static inline void *priv_netdev(struct fe_priv *priv)
 {
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt2880.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt2880.c
index ab3ac1e4f3..f36904950d 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt2880.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt2880.c
@@ -19,8 +19,6 @@
 #include "mtk_eth_soc.h"
 #include "mdio_rt2880.h"
 
-#define RT2880_RESET_FE			BIT(18)
-
 static void rt2880_init_data(struct fe_soc_data *data,
 			     struct net_device *netdev)
 {
@@ -33,11 +31,6 @@ static void rt2880_init_data(struct fe_soc_data *data,
 	/* netdev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_RXCSUM; */
 }
 
-void rt2880_fe_reset(struct fe_priv *priv)
-{
-	fe_reset(RT2880_RESET_FE);
-}
-
 static int rt2880_fwd_config(struct fe_priv *priv)
 {
 	int ret;
@@ -55,7 +48,6 @@ static int rt2880_fwd_config(struct fe_priv *priv)
 
 struct fe_soc_data rt2880_data = {
 	.init_data = rt2880_init_data,
-	.reset_fe = rt2880_fe_reset,
 	.fwd_config = rt2880_fwd_config,
 	.pdma_glo_cfg = FE_PDMA_SIZE_8DWORDS,
 	.checksum_bit = RX_DMA_L4VALID,
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c
index cdc27e056b..6aedf0265a 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c
@@ -69,11 +69,6 @@ static int rt3050_fwd_config(struct fe_priv *priv)
 	return 0;
 }
 
-static void rt305x_fe_reset(struct fe_priv *priv)
-{
-	fe_reset(RT305X_RESET_FE);
-}
-
 static void rt5350_init_data(struct fe_soc_data *data,
 			     struct net_device *netdev)
 {
@@ -127,7 +122,6 @@ static void rt5350_fe_reset(struct fe_priv *priv)
 
 static struct fe_soc_data rt3050_data = {
 	.init_data = rt305x_init_data,
-	.reset_fe = rt305x_fe_reset,
 	.fwd_config = rt3050_fwd_config,
 	.pdma_glo_cfg = FE_PDMA_SIZE_8DWORDS,
 	.checksum_bit = RX_DMA_L4VALID,
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3883.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3883.c
index afcc3da4e4..7b61e9c407 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3883.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3883.c
@@ -19,13 +19,6 @@
 #include "mtk_eth_soc.h"
 #include "mdio_rt2880.h"
 
-#define RT3883_RSTCTRL_FE		BIT(21)
-
-static void rt3883_fe_reset(struct fe_priv *priv)
-{
-	fe_reset(RT3883_RSTCTRL_FE);
-}
-
 static int rt3883_fwd_config(struct fe_priv *priv)
 {
 	int ret;
@@ -54,7 +47,6 @@ static void rt3883_init_data(struct fe_soc_data *data,
 
 static struct fe_soc_data rt3883_data = {
 	.init_data = rt3883_init_data,
-	.reset_fe = rt3883_fe_reset,
 	.fwd_config = rt3883_fwd_config,
 	.pdma_glo_cfg = FE_PDMA_SIZE_8DWORDS,
 	.rx_int = FE_RX_DONE_INT,


From lede-commits at lists.infradead.org  Fri Jun 25 04:02:29 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 25 Jun 2021 07:02:29 -0400
Subject: [openwrt/openwrt] ramips: ethernet: ralink: move reset of the esw
 into the esw instead of fe
In-Reply-To: <162461894688.13074.9553220073764461262@git-01.infra.openwrt.org>
References: <162461894688.13074.9553220073764461262@git-01.infra.openwrt.org>
Message-ID: <mailman.3511.1624618955.1072.lede-commits@lists.infradead.org>

lynxis pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/60fadae62b64b14faff818e4156d9c6eb3f96b65

commit 60fadae62b64b14faff818e4156d9c6eb3f96b65
Author: Alexander Couzens <lynxis at fe80.eu>
AuthorDate: Thu Jun 10 00:16:53 2021 +0200

    ramips: ethernet: ralink: move reset of the esw into the esw instead of fe
    
    The esw reset should only done by the esw driver and not by the fe itself.
    
    Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
---
 target/linux/ramips/dts/mt7628an.dtsi                            | 4 ++--
 target/linux/ramips/dts/rt5350.dtsi                              | 4 ++--
 .../linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c  | 2 ++
 .../linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c  | 9 ---------
 4 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/target/linux/ramips/dts/mt7628an.dtsi b/target/linux/ramips/dts/mt7628an.dtsi
index 9bf20cecdd..0dafdc790e 100644
--- a/target/linux/ramips/dts/mt7628an.dtsi
+++ b/target/linux/ramips/dts/mt7628an.dtsi
@@ -429,8 +429,8 @@
 		interrupt-parent = <&cpuintc>;
 		interrupts = <5>;
 
-		resets = <&rstctrl 21 &rstctrl 23>;
-		reset-names = "fe", "esw";
+		resets = <&rstctrl 21>;
+		reset-names = "fe";
 
 		mediatek,switch = <&esw>;
 	};
diff --git a/target/linux/ramips/dts/rt5350.dtsi b/target/linux/ramips/dts/rt5350.dtsi
index 1058069016..090e755743 100644
--- a/target/linux/ramips/dts/rt5350.dtsi
+++ b/target/linux/ramips/dts/rt5350.dtsi
@@ -343,8 +343,8 @@
 		compatible = "ralink,rt5350-eth";
 		reg = <0x10100000 0x10000>;
 
-		resets = <&rstctrl 21 &rstctrl 23>;
-		reset-names = "fe", "esw";
+		resets = <&rstctrl 21>;
+		reset-names = "fe";
 
 		interrupt-parent = <&cpuintc>;
 		interrupts = <5>;
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
index cd6ae07595..4a7dbb2d03 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
@@ -462,6 +462,8 @@ static void esw_hw_init(struct rt305x_esw *esw)
 	u8 port_disable = 0;
 	u8 port_map = RT305X_ESW_PMAP_LLLLLL;
 
+	esw_reset(esw);
+
 	/* vodoo from original driver */
 	esw_w32(esw, 0xC8A07850, RT305X_ESW_REG_FCT0);
 	esw_w32(esw, 0x00000000, RT305X_ESW_REG_SGC2);
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c
index 6aedf0265a..f98d7ec3da 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c
@@ -19,9 +19,6 @@
 #include "mtk_eth_soc.h"
 #include "mdio_rt2880.h"
 
-#define RT305X_RESET_FE         BIT(21)
-#define RT305X_RESET_ESW        BIT(23)
-
 static const u16 rt5350_reg_table[FE_REG_COUNT] = {
 	[FE_REG_PDMA_GLO_CFG] = RT5350_PDMA_GLO_CFG,
 	[FE_REG_PDMA_RST_CFG] = RT5350_PDMA_RST_CFG,
@@ -115,11 +112,6 @@ static void rt5350_tx_dma(struct fe_tx_dma *txd)
 	txd->txd4 = 0;
 }
 
-static void rt5350_fe_reset(struct fe_priv *priv)
-{
-	fe_reset(RT305X_RESET_FE | RT305X_RESET_ESW);
-}
-
 static struct fe_soc_data rt3050_data = {
 	.init_data = rt305x_init_data,
 	.fwd_config = rt3050_fwd_config,
@@ -133,7 +125,6 @@ static struct fe_soc_data rt3050_data = {
 static struct fe_soc_data rt5350_data = {
 	.init_data = rt5350_init_data,
 	.reg_table = rt5350_reg_table,
-	.reset_fe = rt5350_fe_reset,
 	.set_mac = rt5350_set_mac,
 	.fwd_config = rt5350_fwd_config,
 	.tx_dma = rt5350_tx_dma,


From lede-commits at lists.infradead.org  Fri Jun 25 04:02:31 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 25 Jun 2021 07:02:31 -0400
Subject: [openwrt/openwrt] ramips: ethernet: ralink: rewrite esw_rt3050 to
 support link states
In-Reply-To: <162461894688.13074.9553220073764461262@git-01.infra.openwrt.org>
References: <162461894688.13074.9553220073764461262@git-01.infra.openwrt.org>
Message-ID: <mailman.3512.1624618958.1072.lede-commits@lists.infradead.org>

lynxis pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/8569bc5e0d1bdc4b252bf3f4e7c893ea2e17c98f

commit 8569bc5e0d1bdc4b252bf3f4e7c893ea2e17c98f
Author: Alexander Couzens <lynxis at fe80.eu>
AuthorDate: Wed Jun 9 23:46:35 2021 +0200

    ramips: ethernet: ralink: rewrite esw_rt3050 to support link states
    
    Ensure the esw is initialized before the ethernet device is sending
    packets. Further implement carrier detection similar to mt7620.
    If any port has a link, the ethernet device will detect a carrier.
    
    Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
---
 .../files/drivers/net/ethernet/ralink/esw_rt3050.c | 142 ++++++++++++++-------
 .../files/drivers/net/ethernet/ralink/esw_rt3050.h |   3 +
 .../files/drivers/net/ethernet/ralink/soc_rt3050.c |   3 +
 3 files changed, 103 insertions(+), 45 deletions(-)

diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
index 4a7dbb2d03..75b6707be2 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
@@ -24,6 +24,7 @@
 #include <linux/reset.h>
 
 #include "mtk_eth_soc.h"
+#include "esw_rt3050.h"
 
 /* HW limitations for this switch:
  * - No large frame support (PKT_MAX_LEN at most 1536)
@@ -216,6 +217,7 @@ struct rt305x_esw {
 	struct device		*dev;
 	void __iomem		*base;
 	int			irq;
+	struct fe_priv		*priv;
 
 	/* Protects against concurrent register r/w operations. */
 	spinlock_t		reg_rw_lock;
@@ -736,19 +738,44 @@ static void esw_hw_init(struct rt305x_esw *esw)
 	esw_w32(esw, ~RT305X_ESW_PORT_ST_CHG, RT305X_ESW_REG_IMR);
 }
 
+
+int rt3050_esw_has_carrier(struct fe_priv *priv)
+{
+	struct rt305x_esw *esw = priv->soc->swpriv;
+	u32 link;
+	int i;
+	bool cpuport;
+
+	link = esw_r32(esw, RT305X_ESW_REG_POA);
+	link >>= RT305X_ESW_POA_LINK_SHIFT;
+	cpuport = link & BIT(RT305X_ESW_PORT6);
+	link &= RT305X_ESW_POA_LINK_MASK;
+	for (i = 0; i <= RT305X_ESW_PORT5; i++) {
+		if (priv->link[i] != (link & BIT(i)))
+			dev_info(esw->dev, "port %d link %s\n", i, link & BIT(i) ? "up" : "down");
+		priv->link[i] = link & BIT(i);
+	}
+
+	return !!link && cpuport;
+}
+
 static irqreturn_t esw_interrupt(int irq, void *_esw)
 {
-	struct rt305x_esw *esw = (struct rt305x_esw *)_esw;
+	struct rt305x_esw *esw = (struct rt305x_esw *) _esw;
 	u32 status;
+	int i;
 
 	status = esw_r32(esw, RT305X_ESW_REG_ISR);
 	if (status & RT305X_ESW_PORT_ST_CHG) {
-		u32 link = esw_r32(esw, RT305X_ESW_REG_POA);
-
-		link >>= RT305X_ESW_POA_LINK_SHIFT;
-		link &= RT305X_ESW_POA_LINK_MASK;
-		dev_info(esw->dev, "link changed 0x%02X\n", link);
+		if (!esw->priv)
+			goto out;
+		if (rt3050_esw_has_carrier(esw->priv))
+			netif_carrier_on(esw->priv->netdev);
+		else
+			netif_carrier_off(esw->priv->netdev);
 	}
+
+out:
 	esw_w32(esw, status, RT305X_ESW_REG_ISR);
 
 	return IRQ_HANDLED;
@@ -1376,9 +1403,7 @@ static int esw_probe(struct platform_device *pdev)
 	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	struct device_node *np = pdev->dev.of_node;
 	const __be32 *port_map, *port_disable, *reg_init;
-	struct switch_dev *swdev;
 	struct rt305x_esw *esw;
-	int ret;
 
 	esw = devm_kzalloc(&pdev->dev, sizeof(*esw), GFP_KERNEL);
 	if (!esw)
@@ -1417,6 +1442,67 @@ static int esw_probe(struct platform_device *pdev)
 	if (IS_ERR(esw->rst_ephy))
 		esw->rst_ephy = NULL;
 
+	spin_lock_init(&esw->reg_rw_lock);
+	platform_set_drvdata(pdev, esw);
+
+	return 0;
+}
+
+static int esw_remove(struct platform_device *pdev)
+{
+	struct rt305x_esw *esw = platform_get_drvdata(pdev);
+
+	if (esw) {
+		esw_w32(esw, ~0, RT305X_ESW_REG_IMR);
+		platform_set_drvdata(pdev, NULL);
+	}
+
+	return 0;
+}
+
+static const struct of_device_id ralink_esw_match[] = {
+	{ .compatible = "ralink,rt3050-esw" },
+	{},
+};
+MODULE_DEVICE_TABLE(of, ralink_esw_match);
+
+/* called by the ethernet driver to bound with the switch driver */
+int rt3050_esw_init(struct fe_priv *priv)
+{
+	struct device_node *np = priv->switch_np;
+	struct platform_device *pdev = of_find_device_by_node(np);
+	struct switch_dev *swdev;
+	struct rt305x_esw *esw;
+	const __be32 *rgmii;
+	int ret;
+
+	if (!pdev)
+		return -ENODEV;
+
+	if (!of_device_is_compatible(np, ralink_esw_match->compatible))
+		return -EINVAL;
+
+	esw = platform_get_drvdata(pdev);
+	if (!esw)
+		return -EPROBE_DEFER;
+
+	priv->soc->swpriv = esw;
+	esw->priv = priv;
+
+	esw_hw_init(esw);
+
+	rgmii = of_get_property(np, "ralink,rgmii", NULL);
+	if (rgmii && be32_to_cpu(*rgmii) == 1) {
+		/*
+		 * External switch connected to RGMII interface.
+		 * Unregister the switch device after initialization.
+		 */
+		dev_err(&pdev->dev, "RGMII mode, not exporting switch device.\n");
+		unregister_switch(&esw->swdev);
+		platform_set_drvdata(pdev, NULL);
+		return -ENODEV;
+	}
+
 	swdev = &esw->swdev;
 	swdev->of_node = pdev->dev.of_node;
 	swdev->name = "rt305x-esw";
@@ -1432,53 +1518,19 @@ static int esw_probe(struct platform_device *pdev)
 		return ret;
 	}
 
-	platform_set_drvdata(pdev, esw);
-
-	spin_lock_init(&esw->reg_rw_lock);
-
-	esw_hw_init(esw);
-
-	reg_init = of_get_property(np, "ralink,rgmii", NULL);
-	if (reg_init && be32_to_cpu(*reg_init) == 1) {
-		/* 
-		 * External switch connected to RGMII interface. 
-		 * Unregister the switch device after initialization. 
-		 */
-		dev_err(&pdev->dev, "RGMII mode, not exporting switch device.\n");
-		unregister_switch(&esw->swdev);
-		platform_set_drvdata(pdev, NULL);
-		return -ENODEV;
-	}
-
 	ret = devm_request_irq(&pdev->dev, esw->irq, esw_interrupt, 0, "esw",
-			       esw);
-
+			esw);
 	if (!ret) {
 		esw_w32(esw, RT305X_ESW_PORT_ST_CHG, RT305X_ESW_REG_ISR);
 		esw_w32(esw, ~RT305X_ESW_PORT_ST_CHG, RT305X_ESW_REG_IMR);
 	}
 
-	return ret;
-}
-
-static int esw_remove(struct platform_device *pdev)
-{
-	struct rt305x_esw *esw = platform_get_drvdata(pdev);
-
-	if (esw) {
-		esw_w32(esw, ~0, RT305X_ESW_REG_IMR);
-		platform_set_drvdata(pdev, NULL);
-	}
+	dev_info(&pdev->dev, "mediatek esw at 0x%08lx, irq %d initialized\n",
+		   esw->base, esw->irq);
 
 	return 0;
 }
 
-static const struct of_device_id ralink_esw_match[] = {
-	{ .compatible = "ralink,rt3050-esw" },
-	{},
-};
-MODULE_DEVICE_TABLE(of, ralink_esw_match);
-
 static struct platform_driver esw_driver = {
 	.probe = esw_probe,
 	.remove = esw_remove,
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.h b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.h
index bbc8fbd52a..c9650209cf 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.h
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.h
@@ -26,4 +26,7 @@ static inline int __init mtk_switch_init(void) { return 0; }
 static inline void mtk_switch_exit(void) { }
 
 #endif
+
+int rt3050_esw_init(struct fe_priv *priv);
+int rt3050_esw_has_carrier(struct fe_priv *priv);
 #endif
diff --git a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c
index f98d7ec3da..435f007477 100644
--- a/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c
+++ b/target/linux/ramips/files/drivers/net/ethernet/ralink/soc_rt3050.c
@@ -17,6 +17,7 @@
 #include <asm/mach-ralink/ralink_regs.h>
 
 #include "mtk_eth_soc.h"
+#include "esw_rt3050.h"
 #include "mdio_rt2880.h"
 
 static const u16 rt5350_reg_table[FE_REG_COUNT] = {
@@ -115,6 +116,7 @@ static void rt5350_tx_dma(struct fe_tx_dma *txd)
 static struct fe_soc_data rt3050_data = {
 	.init_data = rt305x_init_data,
 	.fwd_config = rt3050_fwd_config,
+	.switch_init = rt3050_esw_init,
 	.pdma_glo_cfg = FE_PDMA_SIZE_8DWORDS,
 	.checksum_bit = RX_DMA_L4VALID,
 	.rx_int = FE_RX_DONE_INT,
@@ -127,6 +129,7 @@ static struct fe_soc_data rt5350_data = {
 	.reg_table = rt5350_reg_table,
 	.set_mac = rt5350_set_mac,
 	.fwd_config = rt5350_fwd_config,
+	.switch_init = rt3050_esw_init,
 	.tx_dma = rt5350_tx_dma,
 	.pdma_glo_cfg = FE_PDMA_SIZE_8DWORDS,
 	.checksum_bit = RX_DMA_L4VALID,


From lede-commits at lists.infradead.org  Fri Jun 25 17:54:55 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 25 Jun 2021 20:54:55 -0400
Subject: [openwrt/openwrt] base-files: fix /tmp/TZ when zoneinfo not installed
In-Reply-To: <162466889509.1777.15497029122650223717@git-01.infra.openwrt.org>
References: <162466889509.1777.15497029122650223717@git-01.infra.openwrt.org>
Message-ID: <mailman.3632.1624668899.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/3d62b5d5c66c47814fde74a5e50d3e0f9b1d6a84

commit 3d62b5d5c66c47814fde74a5e50d3e0f9b1d6a84
Author: Paul Spooren <mail at aparcar.org>
AuthorDate: Thu Jun 24 07:42:53 2021 -1000

    base-files: fix /tmp/TZ when zoneinfo not installed
    
    The zoneinfo packages are not installed per default so neither
    /tmp/localtime nor /tmp/TZ is generated.
    
    This patch mostly reverts the previous fix and instead incooperates a
    solution suggested by Jo.
    
    Fixes "base-files: fix zoneinfo support " 8af62ed
    
    Signed-off-by: Paul Spooren <mail at aparcar.org>
    (cherry picked from commit 56bdb6bb9781f8a0bbec5fc3075b9d2b8d12f9a8)
---
 package/base-files/files/etc/init.d/system | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/package/base-files/files/etc/init.d/system b/package/base-files/files/etc/init.d/system
index 2290964d7e..dcfc2616c6 100755
--- a/package/base-files/files/etc/init.d/system
+++ b/package/base-files/files/etc/init.d/system
@@ -21,13 +21,10 @@ system_config() {
 
 	echo "$hostname" > /proc/sys/kernel/hostname
 	[ -z "$conloglevel" -a -z "$buffersize" ] || dmesg ${conloglevel:+-n $conloglevel} ${buffersize:+-s $buffersize}
-	rm -f /tmp/TZ
-	if [ -n "$zonename" ]; then
-		local zname=$(echo "$zonename" | tr ' ' _)
-		[ -f "/usr/share/zoneinfo/$zname" ] && ln -sf "/usr/share/zoneinfo/$zname" /tmp/localtime
-	else
-		echo "$timezone" > /tmp/TZ
-	fi
+	echo "$timezone" > /tmp/TZ
+	[ -n "$zonename" ] && [ -f "/usr/share/zoneinfo/${zonename// /_}" ] \
+		&& ln -sf "/usr/share/zoneinfo/${zonename// /_}" /tmp/localtime \
+		&& rm -f /tmp/TZ
 
 	# apply timezone to kernel
 	hwclock -u --systz


From lede-commits at lists.infradead.org  Fri Jun 25 17:57:07 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 25 Jun 2021 20:57:07 -0400
Subject: [openwrt/openwrt] base-files: fix /tmp/TZ when zoneinfo not installed
In-Reply-To: <162466902758.4375.15832081147549015028@git-01.infra.openwrt.org>
References: <162466902758.4375.15832081147549015028@git-01.infra.openwrt.org>
Message-ID: <mailman.3633.1624669031.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch openwrt-19.07:
https://git.openwrt.org/71fa524e1bef2b266d9ed3ee94c2b7ff9d8e59b0

commit 71fa524e1bef2b266d9ed3ee94c2b7ff9d8e59b0
Author: Paul Spooren <mail at aparcar.org>
AuthorDate: Thu Jun 24 07:42:53 2021 -1000

    base-files: fix /tmp/TZ when zoneinfo not installed
    
    The zoneinfo packages are not installed per default so neither
    /tmp/localtime nor /tmp/TZ is generated.
    
    This patch mostly reverts the previous fix and instead incooperates a
    solution suggested by Jo.
    
    Fixes "base-files: fix zoneinfo support " 8af62ed
    
    Signed-off-by: Paul Spooren <mail at aparcar.org>
    (cherry picked from commit 56bdb6bb9781f8a0bbec5fc3075b9d2b8d12f9a8)
---
 package/base-files/files/etc/init.d/system | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/package/base-files/files/etc/init.d/system b/package/base-files/files/etc/init.d/system
index 219b29812d..62cf2db3dd 100755
--- a/package/base-files/files/etc/init.d/system
+++ b/package/base-files/files/etc/init.d/system
@@ -21,13 +21,10 @@ system_config() {
 
 	echo "$hostname" > /proc/sys/kernel/hostname
 	[ -z "$conloglevel" -a -z "$buffersize" ] || dmesg ${conloglevel:+-n $conloglevel} ${buffersize:+-s $buffersize}
-	rm -f /tmp/TZ
-	if [ -n "$zonename" ]; then
-		local zname=$(echo "$zonename" | tr ' ' _)
-		[ -f "/usr/share/zoneinfo/$zname" ] && ln -sf "/usr/share/zoneinfo/$zname" /tmp/localtime
-	else
-		echo "$timezone" > /tmp/TZ
-	fi
+	echo "$timezone" > /tmp/TZ
+	[ -n "$zonename" ] && [ -f "/usr/share/zoneinfo/${zonename// /_}" ] \
+		&& ln -sf "/usr/share/zoneinfo/${zonename// /_}" /tmp/localtime \
+		&& rm -f /tmp/TZ
 
 	# apply timezone to kernel
 	date -k


From lede-commits at lists.infradead.org  Sat Jun 26 05:03:47 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 26 Jun 2021 08:03:47 -0400
Subject: [openwrt/openwrt]  kernel: bump 5.10 to 5.10.46
In-Reply-To: <162470902759.8915.857051866262706267@git-01.infra.openwrt.org>
References: <162470902759.8915.857051866262706267@git-01.infra.openwrt.org>
Message-ID: <mailman.3686.1624709033.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/b92794f4d02ebace7726fa7a6951e18186b48066

commit b92794f4d02ebace7726fa7a6951e18186b48066
Author: Rui Salvaterra <rsalvaterra at gmail.com>
AuthorDate: Wed Jun 16 17:22:50 2021 +0100

    kernel: bump 5.10 to 5.10.46
    
    Add the new symbol to the generic kconfig.
    
    No deleted or manually refreshed patches.
    
    Signed-off-by: Rui Salvaterra <rsalvaterra at gmail.com>
---
 include/kernel-version.mk                                             | 4 ++--
 target/linux/generic/config-5.10                                      | 1 +
 .../patches-5.10/200-phy-phy-mtk-tphy-Add-hifsys-support.patch        | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 1224eccd32..fdf18c4ce0 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -7,10 +7,10 @@ ifdef CONFIG_TESTING_KERNEL
 endif
 
 LINUX_VERSION-5.4 = .124
-LINUX_VERSION-5.10 = .44
+LINUX_VERSION-5.10 = .46
 
 LINUX_KERNEL_HASH-5.4.124 = f7f29dda2b042d7b5986d18274413131cf70e17288c05e9a683df1f46c507d82
-LINUX_KERNEL_HASH-5.10.44 = 77beefa59c854ce1e8353db947a71a8a91f2a907aed45c1335ac1f209983c767
+LINUX_KERNEL_HASH-5.10.46 = 569122a39c6b325befb9ac1c07da0c53e6363b3baacd82081d131b06c1dc1415
 
 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
 sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
diff --git a/target/linux/generic/config-5.10 b/target/linux/generic/config-5.10
index c15829e49e..a2b5a28d8e 100644
--- a/target/linux/generic/config-5.10
+++ b/target/linux/generic/config-5.10
@@ -3560,6 +3560,7 @@ CONFIG_MTD_NAND_IDS=y
 # CONFIG_MTD_NAND_PLATFORM is not set
 # CONFIG_MTD_NAND_PXA3xx is not set
 # CONFIG_MTD_NAND_RB4XX is not set
+# CONFIG_MTD_NAND_RB91X is not set
 # CONFIG_MTD_NAND_RB750 is not set
 # CONFIG_MTD_NAND_RICOH is not set
 # CONFIG_MTD_NAND_S3C2410 is not set
diff --git a/target/linux/mediatek/patches-5.10/200-phy-phy-mtk-tphy-Add-hifsys-support.patch b/target/linux/mediatek/patches-5.10/200-phy-phy-mtk-tphy-Add-hifsys-support.patch
index bd24ddc0c0..95f4be177b 100644
--- a/target/linux/mediatek/patches-5.10/200-phy-phy-mtk-tphy-Add-hifsys-support.patch
+++ b/target/linux/mediatek/patches-5.10/200-phy-phy-mtk-tphy-Add-hifsys-support.patch
@@ -47,7 +47,7 @@ Subject: [PATCH] phy: phy-mtk-tphy: Add hifsys-support
  	tmp = readl(u3_banks->phya + U3P_U3_PHYA_DA_REG0);
  	tmp &= ~(P3A_RG_XTAL_EXT_PE1H | P3A_RG_XTAL_EXT_PE2H);
  	tmp |= P3A_RG_XTAL_EXT_PE1H_VAL(0x2) | P3A_RG_XTAL_EXT_PE2H_VAL(0x2);
-@@ -1134,6 +1144,16 @@ static int mtk_tphy_probe(struct platfor
+@@ -1136,6 +1146,16 @@ static int mtk_tphy_probe(struct platfor
  		&tphy->src_ref_clk);
  	device_property_read_u32(dev, "mediatek,src-coef", &tphy->src_coef);
  


From lede-commits at lists.infradead.org  Sat Jun 26 05:03:48 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 26 Jun 2021 08:03:48 -0400
Subject: [openwrt/openwrt]  kernel: bump 5.4 to 5.4.125
In-Reply-To: <162470902759.8915.857051866262706267@git-01.infra.openwrt.org>
References: <162470902759.8915.857051866262706267@git-01.infra.openwrt.org>
Message-ID: <mailman.3687.1624709033.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/697e80d12b776f424448bded5e4ed3a06517ddfc

commit 697e80d12b776f424448bded5e4ed3a06517ddfc
Author: John Audia <graysky at archlinux.us>
AuthorDate: Wed Jun 23 02:59:39 2021 -0400

    kernel: bump 5.4 to 5.4.125
    
    All patches automatically rebased.
    
    Build system: x86_64
    Build-tested: ipq806x/R7800
    Run-tested: ipq806x/R7800
    
    Signed-off-by: John Audia <graysky at archlinux.us>
---
 include/kernel-version.mk                              |  4 ++--
 ...w-rejecting-with-source-address-failed-policy.patch | 18 +++++++++---------
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index fdf18c4ce0..4bd243663c 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -6,10 +6,10 @@ ifdef CONFIG_TESTING_KERNEL
   KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
 endif
 
-LINUX_VERSION-5.4 = .124
+LINUX_VERSION-5.4 = .125
 LINUX_VERSION-5.10 = .46
 
-LINUX_KERNEL_HASH-5.4.124 = f7f29dda2b042d7b5986d18274413131cf70e17288c05e9a683df1f46c507d82
+LINUX_KERNEL_HASH-5.4.125 = 17ee750a4aeb1c883d721e730d1f7e2855124585e2f47766864a1359a7ebe33c
 LINUX_KERNEL_HASH-5.10.46 = 569122a39c6b325befb9ac1c07da0c53e6363b3baacd82081d131b06c1dc1415
 
 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
diff --git a/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
index 90f4199eab..283fc0ae4f 100644
--- a/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
+++ b/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
@@ -157,7 +157,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  	case RTN_THROW:
  	case RTN_UNREACHABLE:
  	default:
-@@ -4419,6 +4438,17 @@ static int ip6_pkt_prohibit_out(struct n
+@@ -4423,6 +4442,17 @@ static int ip6_pkt_prohibit_out(struct n
  	return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES);
  }
  
@@ -175,7 +175,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  /*
   *	Allocate a dst for local (unicast / anycast) address.
   */
-@@ -4899,7 +4929,8 @@ static int rtm_to_fib6_config(struct sk_
+@@ -4903,7 +4933,8 @@ static int rtm_to_fib6_config(struct sk_
  	if (rtm->rtm_type == RTN_UNREACHABLE ||
  	    rtm->rtm_type == RTN_BLACKHOLE ||
  	    rtm->rtm_type == RTN_PROHIBIT ||
@@ -185,7 +185,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  		cfg->fc_flags |= RTF_REJECT;
  
  	if (rtm->rtm_type == RTN_LOCAL)
-@@ -6021,6 +6052,8 @@ static int ip6_route_dev_notify(struct n
+@@ -6025,6 +6056,8 @@ static int ip6_route_dev_notify(struct n
  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
  		net->ipv6.ip6_prohibit_entry->dst.dev = dev;
  		net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev);
@@ -194,7 +194,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  		net->ipv6.ip6_blk_hole_entry->dst.dev = dev;
  		net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev);
  #endif
-@@ -6032,6 +6065,7 @@ static int ip6_route_dev_notify(struct n
+@@ -6036,6 +6069,7 @@ static int ip6_route_dev_notify(struct n
  		in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev);
  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
  		in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev);
@@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  		in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev);
  #endif
  	}
-@@ -6224,6 +6258,8 @@ static int __net_init ip6_route_net_init
+@@ -6228,6 +6262,8 @@ static int __net_init ip6_route_net_init
  
  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
  	net->ipv6.fib6_has_custom_rules = false;
@@ -211,7 +211,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  	net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template,
  					       sizeof(*net->ipv6.ip6_prohibit_entry),
  					       GFP_KERNEL);
-@@ -6234,11 +6270,21 @@ static int __net_init ip6_route_net_init
+@@ -6238,11 +6274,21 @@ static int __net_init ip6_route_net_init
  			 ip6_template_metrics, true);
  	INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->rt6i_uncached);
  
@@ -234,7 +234,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  	net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops;
  	dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst,
  			 ip6_template_metrics, true);
-@@ -6262,6 +6308,8 @@ out:
+@@ -6266,6 +6312,8 @@ out:
  	return ret;
  
  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
@@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  out_ip6_prohibit_entry:
  	kfree(net->ipv6.ip6_prohibit_entry);
  out_ip6_null_entry:
-@@ -6281,6 +6329,7 @@ static void __net_exit ip6_route_net_exi
+@@ -6285,6 +6333,7 @@ static void __net_exit ip6_route_net_exi
  	kfree(net->ipv6.ip6_null_entry);
  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
  	kfree(net->ipv6.ip6_prohibit_entry);
@@ -251,7 +251,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  	kfree(net->ipv6.ip6_blk_hole_entry);
  #endif
  	dst_entries_destroy(&net->ipv6.ip6_dst_ops);
-@@ -6358,6 +6407,9 @@ void __init ip6_route_init_special_entri
+@@ -6362,6 +6411,9 @@ void __init ip6_route_init_special_entri
  	init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
  	init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev;
  	init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);


From lede-commits at lists.infradead.org  Sat Jun 26 05:03:50 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 26 Jun 2021 08:03:50 -0400
Subject: [openwrt/openwrt]  kernel: bump 5.4 to 5.4.127
In-Reply-To: <162470902759.8915.857051866262706267@git-01.infra.openwrt.org>
References: <162470902759.8915.857051866262706267@git-01.infra.openwrt.org>
Message-ID: <mailman.3688.1624709035.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/7ddee03808f3f56735bf2a14bfde59a13110a4b3

commit 7ddee03808f3f56735bf2a14bfde59a13110a4b3
Author: John Audia <graysky at archlinux.us>
AuthorDate: Wed Jun 23 03:00:41 2021 -0400

    kernel: bump 5.4 to 5.4.127
    
    All patches automatically rebased.
    
    Build system: x86_64
    Build-tested: ipq806x/R7800
    Run-tested: ipq806x/R7800
    
    No dmesg regressions, everything functional
    
    Signed-off-by: John Audia <graysky at archlinux.us>
---
 include/kernel-version.mk                                             | 4 ++--
 ...50-0280-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index d3d08a6d33..b396f7e598 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -6,10 +6,10 @@ ifdef CONFIG_TESTING_KERNEL
   KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
 endif
 
-LINUX_VERSION-5.4 = .126
+LINUX_VERSION-5.4 = .127
 LINUX_VERSION-5.10 = .46
 
-LINUX_KERNEL_HASH-5.4.126 = c7fd7998ab36b574326bbd67bcc2b74e4c58e81581a5f8a7a71af5185f635277
+LINUX_KERNEL_HASH-5.4.127 = a0bd9b5adee29b5ea77e77fc637c87dba7918e529031ecd2a55af5ea434f28bf
 LINUX_KERNEL_HASH-5.10.46 = 569122a39c6b325befb9ac1c07da0c53e6363b3baacd82081d131b06c1dc1415
 
 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
diff --git a/target/linux/bcm27xx/patches-5.4/950-0280-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch b/target/linux/bcm27xx/patches-5.4/950-0280-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch
index e486942ffd..c5e7d5e842 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0280-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0280-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch
@@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.org>
  #define USB_VENDOR_ID_BELKIN		0x050d
  #define USB_DEVICE_ID_FLIP_KVM		0x3201
  
-@@ -1259,6 +1262,9 @@
+@@ -1261,6 +1264,9 @@
  #define USB_VENDOR_ID_XAT	0x2505
  #define USB_DEVICE_ID_XAT_CSR	0x0220
  
@@ -53,7 +53,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.org>
  	{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_MULTI_TOUCH), HID_QUIRK_MULTI_INPUT },
  	{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL },
  	{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE2), HID_QUIRK_ALWAYS_POLL },
-@@ -190,6 +191,7 @@ static const struct hid_device_id hid_qu
+@@ -192,6 +193,7 @@ static const struct hid_device_id hid_qu
  	{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD2, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
  	{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
  	{ HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_XIN_MO_DUAL_ARCADE), HID_QUIRK_MULTI_INPUT },


From lede-commits at lists.infradead.org  Sat Jun 26 05:03:49 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 26 Jun 2021 08:03:49 -0400
Subject: [openwrt/openwrt]  kernel: bump 5.4 to 5.4.126
In-Reply-To: <162470902759.8915.857051866262706267@git-01.infra.openwrt.org>
References: <162470902759.8915.857051866262706267@git-01.infra.openwrt.org>
Message-ID: <mailman.3689.1624709035.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/d8dc9f108a9267a1783269d59e8afcf2ebe7e6db

commit d8dc9f108a9267a1783269d59e8afcf2ebe7e6db
Author: John Audia <graysky at archlinux.us>
AuthorDate: Wed Jun 23 03:00:02 2021 -0400

    kernel: bump 5.4 to 5.4.126
    
    Manually rebased:
      bcm27xx/patches-5.4/950-0089-cgroup-Disable-cgroup-memory-by-default.patch
    
    All other patches automatically rebased.
    
    Signed-off-by: John Audia <graysky at archlinux.us>
---
 include/kernel-version.mk                          |  4 +--
 ...9-cgroup-Disable-cgroup-memory-by-default.patch | 39 +++++++++++++++-------
 ...pi-spi-bcm2835-Disable-forced-software-CS.patch |  2 +-
 ...i-bcm2835-enable-shared-interrupt-support.patch |  2 +-
 ...9-SQUASH-Fix-spi-driver-compiler-warnings.patch |  2 +-
 ...orce-CS_HIGH-if-GPIO-descriptors-are-used.patch |  4 +--
 ..._gpio_descriptor-fixup-moved-to-spi_setup.patch |  2 +-
 ...-Demote-SPI_CS_HIGH-warning-to-KERN_DEBUG.patch |  2 +-
 ...t-SQUASH-Fix-spi-driver-compiler-warnings.patch |  2 +-
 ...pi-spi-bcm2835-Disable-forced-software-CS.patch |  2 +-
 target/linux/generic/config-5.4                    |  1 +
 .../generic/hack-5.4/221-module_exports.patch      |  2 +-
 ...-v5.7-spi-make-spi-max-frequency-optional.patch |  2 +-
 13 files changed, 41 insertions(+), 25 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index 4bd243663c..d3d08a6d33 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -6,10 +6,10 @@ ifdef CONFIG_TESTING_KERNEL
   KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
 endif
 
-LINUX_VERSION-5.4 = .125
+LINUX_VERSION-5.4 = .126
 LINUX_VERSION-5.10 = .46
 
-LINUX_KERNEL_HASH-5.4.125 = 17ee750a4aeb1c883d721e730d1f7e2855124585e2f47766864a1359a7ebe33c
+LINUX_KERNEL_HASH-5.4.126 = c7fd7998ab36b574326bbd67bcc2b74e4c58e81581a5f8a7a71af5185f635277
 LINUX_KERNEL_HASH-5.10.46 = 569122a39c6b325befb9ac1c07da0c53e6363b3baacd82081d131b06c1dc1415
 
 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
diff --git a/target/linux/bcm27xx/patches-5.4/950-0089-cgroup-Disable-cgroup-memory-by-default.patch b/target/linux/bcm27xx/patches-5.4/950-0089-cgroup-Disable-cgroup-memory-by-default.patch
index 86f60e7052..d4818b2239 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0089-cgroup-Disable-cgroup-memory-by-default.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0089-cgroup-Disable-cgroup-memory-by-default.patch
@@ -1,4 +1,4 @@
-From 0f95a2f2688ff44dc7080beaa2076741a0bdf510 Mon Sep 17 00:00:00 2001
+From 2b13c54592135b6fab269517ed687fa9f80bf8e5 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 27 Nov 2017 17:14:54 +0000
 Subject: [PATCH] cgroup: Disable cgroup "memory" by default
@@ -12,34 +12,46 @@ See: https://github.com/raspberrypi/linux/issues/1950
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 ---
- kernel/cgroup/cgroup.c | 30 ++++++++++++++++++++++++++++++
- 1 file changed, 30 insertions(+)
+ kernel/cgroup/cgroup.c | 38 ++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 38 insertions(+)
 
 --- a/kernel/cgroup/cgroup.c
 +++ b/kernel/cgroup/cgroup.c
-@@ -5722,6 +5722,8 @@ int __init cgroup_init_early(void)
+@@ -5721,6 +5721,9 @@ int __init cgroup_init_early(void)
+ 	return 0;
  }
  
- static u16 cgroup_disable_mask __initdata;
 +static u16 cgroup_enable_mask __initdata;
 +static int __init cgroup_disable(char *str);
- 
++
  /**
   * cgroup_init - cgroup initialization
-@@ -5761,6 +5763,12 @@ int __init cgroup_init(void)
+  *
+@@ -5759,6 +5762,12 @@ int __init cgroup_init(void)
  
  	mutex_unlock(&cgroup_mutex);
  
-+	/* Apply an implicit disable... */
++	/*
++	 * Apply an implicit disable, knowing that an explicit enable will
++	 * prevent if from doing anything.
++	 */
 +	cgroup_disable("memory");
-+
-+	/* ...knowing that an explicit enable will override it. */
-+	cgroup_disable_mask &= ~cgroup_enable_mask;
 +
  	for_each_subsys(ss, ssid) {
  		if (ss->early_init) {
  			struct cgroup_subsys_state *css =
-@@ -6180,6 +6188,28 @@ static int __init cgroup_disable(char *s
+@@ -6168,6 +6177,10 @@ static int __init cgroup_disable(char *s
+ 			    strcmp(token, ss->legacy_name))
+ 				continue;
+ 
++			/* An explicit cgroup_enable overrides a disable */
++			if (cgroup_enable_mask & (1 << i))
++				continue;
++
+ 			static_branch_disable(cgroup_subsys_enabled_key[i]);
+ 			pr_info("Disabling %s control group subsystem\n",
+ 				ss->name);
+@@ -6177,6 +6190,31 @@ static int __init cgroup_disable(char *s
  }
  __setup("cgroup_disable=", cgroup_disable);
  
@@ -59,6 +71,9 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 +				continue;
 +
 +			cgroup_enable_mask |= 1 << i;
++			static_branch_enable(cgroup_subsys_enabled_key[i]);
++			pr_info("Enabling %s control group subsystem\n",
++				ss->name);
 +		}
 +	}
 +	return 1;
diff --git a/target/linux/bcm27xx/patches-5.4/950-0134-spi-spi-bcm2835-Disable-forced-software-CS.patch b/target/linux/bcm27xx/patches-5.4/950-0134-spi-spi-bcm2835-Disable-forced-software-CS.patch
index 0abe5059c0..cfb46d8791 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0134-spi-spi-bcm2835-Disable-forced-software-CS.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0134-spi-spi-bcm2835-Disable-forced-software-CS.patch
@@ -13,7 +13,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 
 --- a/drivers/spi/spi-bcm2835.c
 +++ b/drivers/spi/spi-bcm2835.c
-@@ -1230,31 +1230,6 @@ static int bcm2835_spi_setup(struct spi_
+@@ -1236,31 +1236,6 @@ static int bcm2835_spi_setup(struct spi_
  		return -EINVAL;
  	}
  
diff --git a/target/linux/bcm27xx/patches-5.4/950-0212-spi-bcm2835-enable-shared-interrupt-support.patch b/target/linux/bcm27xx/patches-5.4/950-0212-spi-bcm2835-enable-shared-interrupt-support.patch
index f82ae7d9f6..5326934b71 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0212-spi-bcm2835-enable-shared-interrupt-support.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0212-spi-bcm2835-enable-shared-interrupt-support.patch
@@ -23,7 +23,7 @@ Signed-off-by: Martin Sperl <kernel at martin.sperl.org>
  	/* Read as many bytes as possible from FIFO */
  	bcm2835_rd_fifo(bs);
  	/* Write as many bytes as possible to FIFO */
-@@ -1281,7 +1285,8 @@ static int bcm2835_spi_probe(struct plat
+@@ -1287,7 +1291,8 @@ static int bcm2835_spi_probe(struct plat
  	bcm2835_wr(bs, BCM2835_SPI_CS,
  		   BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX);
  
diff --git a/target/linux/bcm27xx/patches-5.4/950-0409-SQUASH-Fix-spi-driver-compiler-warnings.patch b/target/linux/bcm27xx/patches-5.4/950-0409-SQUASH-Fix-spi-driver-compiler-warnings.patch
index 4413439101..742dbad712 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0409-SQUASH-Fix-spi-driver-compiler-warnings.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0409-SQUASH-Fix-spi-driver-compiler-warnings.patch
@@ -19,4 +19,4 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.com>
 -	struct gpio_chip *chip;
  	u32 cs;
  
- 	/*
+ 	if (spi->chip_select >= BCM2835_SPI_NUM_CS) {
diff --git a/target/linux/bcm27xx/patches-5.4/950-0646-spi-Force-CS_HIGH-if-GPIO-descriptors-are-used.patch b/target/linux/bcm27xx/patches-5.4/950-0646-spi-Force-CS_HIGH-if-GPIO-descriptors-are-used.patch
index 6ee6a275c3..05fa9f8f2e 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0646-spi-Force-CS_HIGH-if-GPIO-descriptors-are-used.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0646-spi-Force-CS_HIGH-if-GPIO-descriptors-are-used.patch
@@ -23,7 +23,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.com>
 
 --- a/drivers/spi/spi.c
 +++ b/drivers/spi/spi.c
-@@ -3110,6 +3110,7 @@ static int __spi_validate_bits_per_word(
+@@ -3116,6 +3116,7 @@ static int __spi_validate_bits_per_word(
   */
  int spi_setup(struct spi_device *spi)
  {
@@ -31,7 +31,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.com>
  	unsigned	bad_bits, ugly_bits;
  	int		status;
  
-@@ -3127,6 +3128,14 @@ int spi_setup(struct spi_device *spi)
+@@ -3133,6 +3134,14 @@ int spi_setup(struct spi_device *spi)
  		(SPI_TX_DUAL | SPI_TX_QUAD | SPI_TX_OCTAL |
  		 SPI_RX_DUAL | SPI_RX_QUAD | SPI_RX_OCTAL)))
  		return -EINVAL;
diff --git a/target/linux/bcm27xx/patches-5.4/950-0665-spi-use_gpio_descriptor-fixup-moved-to-spi_setup.patch b/target/linux/bcm27xx/patches-5.4/950-0665-spi-use_gpio_descriptor-fixup-moved-to-spi_setup.patch
index 8792faa0c9..402635d838 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0665-spi-use_gpio_descriptor-fixup-moved-to-spi_setup.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0665-spi-use_gpio_descriptor-fixup-moved-to-spi_setup.patch
@@ -37,7 +37,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.com>
 
 --- a/drivers/spi/spi.c
 +++ b/drivers/spi/spi.c
-@@ -1793,15 +1793,6 @@ static int of_spi_parse_dt(struct spi_co
+@@ -1799,15 +1799,6 @@ static int of_spi_parse_dt(struct spi_co
  	}
  	spi->chip_select = value;
  
diff --git a/target/linux/bcm27xx/patches-5.4/950-0690-SQUASH-spi-Demote-SPI_CS_HIGH-warning-to-KERN_DEBUG.patch b/target/linux/bcm27xx/patches-5.4/950-0690-SQUASH-spi-Demote-SPI_CS_HIGH-warning-to-KERN_DEBUG.patch
index fee107876a..b821afb08b 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0690-SQUASH-spi-Demote-SPI_CS_HIGH-warning-to-KERN_DEBUG.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0690-SQUASH-spi-Demote-SPI_CS_HIGH-warning-to-KERN_DEBUG.patch
@@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.com>
 
 --- a/drivers/spi/spi.c
 +++ b/drivers/spi/spi.c
-@@ -3122,8 +3122,8 @@ int spi_setup(struct spi_device *spi)
+@@ -3128,8 +3128,8 @@ int spi_setup(struct spi_device *spi)
  
  	if (ctlr->use_gpio_descriptors && ctlr->cs_gpiods &&
  	    ctlr->cs_gpiods[spi->chip_select] && !(spi->mode & SPI_CS_HIGH)) {
diff --git a/target/linux/bcm27xx/patches-5.4/950-0788-Revert-SQUASH-Fix-spi-driver-compiler-warnings.patch b/target/linux/bcm27xx/patches-5.4/950-0788-Revert-SQUASH-Fix-spi-driver-compiler-warnings.patch
index 437e5aba59..fad57b4863 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0788-Revert-SQUASH-Fix-spi-driver-compiler-warnings.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0788-Revert-SQUASH-Fix-spi-driver-compiler-warnings.patch
@@ -20,4 +20,4 @@ See: https://github.com/raspberrypi/linux/pull/3687
 +	enum gpio_lookup_flags lflags;
  	u32 cs;
  
- 	/*
+ 	if (spi->chip_select >= BCM2835_SPI_NUM_CS) {
diff --git a/target/linux/bcm27xx/patches-5.4/950-0789-Revert-spi-spi-bcm2835-Disable-forced-software-CS.patch b/target/linux/bcm27xx/patches-5.4/950-0789-Revert-spi-spi-bcm2835-Disable-forced-software-CS.patch
index 1479335217..ac0684be86 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0789-Revert-spi-spi-bcm2835-Disable-forced-software-CS.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0789-Revert-spi-spi-bcm2835-Disable-forced-software-CS.patch
@@ -13,7 +13,7 @@ See: https://github.com/raspberrypi/linux/pull/3687
 
 --- a/drivers/spi/spi-bcm2835.c
 +++ b/drivers/spi/spi-bcm2835.c
-@@ -1235,6 +1235,43 @@ static int bcm2835_spi_setup(struct spi_
+@@ -1241,6 +1241,43 @@ static int bcm2835_spi_setup(struct spi_
  		return -EINVAL;
  	}
  
diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4
index f5e976a691..fe5204abb5 100644
--- a/target/linux/generic/config-5.4
+++ b/target/linux/generic/config-5.4
@@ -3833,6 +3833,7 @@ CONFIG_NMI_LOG_BUF_SHIFT=13
 # CONFIG_NVMEM_SYSFS is not set
 # CONFIG_NVME_FC is not set
 # CONFIG_NVME_TARGET is not set
+# CONFIG_NVME_TCP is not set
 # CONFIG_NVRAM is not set
 # CONFIG_NV_TCO is not set
 # CONFIG_NXP_STB220 is not set
diff --git a/target/linux/generic/hack-5.4/221-module_exports.patch b/target/linux/generic/hack-5.4/221-module_exports.patch
index 09855b04d1..ef6e980892 100644
--- a/target/linux/generic/hack-5.4/221-module_exports.patch
+++ b/target/linux/generic/hack-5.4/221-module_exports.patch
@@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	}								\
  									\
  	/* __*init sections */						\
-@@ -903,6 +913,8 @@
+@@ -904,6 +914,8 @@
  	EXIT_TEXT							\
  	EXIT_DATA							\
  	EXIT_CALL							\
diff --git a/target/linux/mediatek/patches-5.4/0001-v5.7-spi-make-spi-max-frequency-optional.patch b/target/linux/mediatek/patches-5.4/0001-v5.7-spi-make-spi-max-frequency-optional.patch
index 8487c3dda0..79ce15c37b 100644
--- a/target/linux/mediatek/patches-5.4/0001-v5.7-spi-make-spi-max-frequency-optional.patch
+++ b/target/linux/mediatek/patches-5.4/0001-v5.7-spi-make-spi-max-frequency-optional.patch
@@ -20,7 +20,7 @@ Signed-off-by: Mark Brown <broonie at kernel.org>
 
 --- a/drivers/spi/spi.c
 +++ b/drivers/spi/spi.c
-@@ -1803,13 +1803,8 @@ static int of_spi_parse_dt(struct spi_co
+@@ -1809,13 +1809,8 @@ static int of_spi_parse_dt(struct spi_co
  		spi->mode |= SPI_CS_HIGH;
  
  	/* Device speed */


From lede-commits at lists.infradead.org  Sat Jun 26 05:03:51 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 26 Jun 2021 08:03:51 -0400
Subject: [openwrt/openwrt]  kernel: bump 5.4 to 5.4.128
In-Reply-To: <162470902759.8915.857051866262706267@git-01.infra.openwrt.org>
References: <162470902759.8915.857051866262706267@git-01.infra.openwrt.org>
Message-ID: <mailman.3692.1624709037.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/e6bb0b6ad9c0c45c679501e13c0d5f3e2389d31f

commit e6bb0b6ad9c0c45c679501e13c0d5f3e2389d31f
Author: John Audia <graysky at archlinux.us>
AuthorDate: Wed Jun 23 10:08:52 2021 -0400

    kernel: bump 5.4 to 5.4.128
    
    Removed upstreamed:
      mvebu/patches-5.4/002-PCI-aardvark-Don-t-rely-on-jiffies-while-holding-spi.patch
    
    All other patches automatically rebased.
    
    Build system: x86_64
    Build-tested: ipq806x/R7800
    Run-tested: ipq806x/R7800
    
    No dmesg regressions, everything functional
    
    Signed-off-by: John Audia <graysky at archlinux.us>
---
 include/kernel-version.mk                          |  4 +-
 ...cm2835-Load-driver-early-and-support-lega.patch |  2 +-
 .../patches-5.4/950-0037-Add-dwc_otg-driver.patch  |  2 +-
 ...50-0042-dmaengine-Add-support-for-BCM2708.patch |  4 +-
 ...f-Add-inbound-resource-parsing-to-helpers.patch |  2 +-
 ...ake-drop-unused-variable-tin_quantum_prio.patch | 16 +++----
 ...sl-dpaa2-qdma-Add-NXP-dpaa2-qDMA-controll.patch |  2 +-
 ...0-DMA-fsl-edma-v3-add-fsl-edma-v3-support.patch |  2 +-
 ...6-dma-0026-dma-caam-add-dma-memcpy-driver.patch |  4 +-
 ...b-0005-usb-dwc3-add-otg-properties-update.patch |  2 +-
 ...b-core-print-suggested-message-if-failed-.patch |  2 +-
 ...k-Wait-for-endpoint-to-be-ready-before-tr.patch |  2 +-
 ...k-Don-t-rely-on-jiffies-while-holding-spi.patch | 54 ----------------------
 .../017-PCI-aardvark-Improve-link-training.patch   |  2 +-
 .../018-PCI-aardvark-Issue-PERST-via-GPIO.patch    |  2 +-
 .../019-PCI-aardvark-Add-PHY-support.patch         |  4 +-
 ...k-Fix-initialization-with-old-Marvell-s-A.patch |  2 +-
 ...rk-for-Gateworks-PLX-PEX860x-switch-with-.patch |  2 +-
 18 files changed, 28 insertions(+), 82 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index b396f7e598..daa1a5efa8 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -6,10 +6,10 @@ ifdef CONFIG_TESTING_KERNEL
   KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
 endif
 
-LINUX_VERSION-5.4 = .127
+LINUX_VERSION-5.4 = .128
 LINUX_VERSION-5.10 = .46
 
-LINUX_KERNEL_HASH-5.4.127 = a0bd9b5adee29b5ea77e77fc637c87dba7918e529031ecd2a55af5ea434f28bf
+LINUX_KERNEL_HASH-5.4.128 = 3b54aebb816b9e628cb9ba3055a6aca58ce0ddeec49366c0da86ced9a7be39ab
 LINUX_KERNEL_HASH-5.10.46 = 569122a39c6b325befb9ac1c07da0c53e6363b3baacd82081d131b06c1dc1415
 
 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
diff --git a/target/linux/bcm27xx/patches-5.4/950-0012-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch b/target/linux/bcm27xx/patches-5.4/950-0012-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch
index 489e5d11ac..8e59b9b24e 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0012-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0012-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch
@@ -20,7 +20,7 @@ Signed-off-by: Noralf Tr?nnes <noralf at tronnes.org>
 
 --- a/drivers/dma/Kconfig
 +++ b/drivers/dma/Kconfig
-@@ -133,7 +133,7 @@ config COH901318
+@@ -134,7 +134,7 @@ config COH901318
  
  config DMA_BCM2835
  	tristate "BCM2835 DMA engine support"
diff --git a/target/linux/bcm27xx/patches-5.4/950-0037-Add-dwc_otg-driver.patch b/target/linux/bcm27xx/patches-5.4/950-0037-Add-dwc_otg-driver.patch
index 5b7f773b0b..9280ab3f17 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0037-Add-dwc_otg-driver.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0037-Add-dwc_otg-driver.patch
@@ -1040,7 +1040,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.org>
  }
 --- a/drivers/usb/core/hub.c
 +++ b/drivers/usb/core/hub.c
-@@ -5319,7 +5319,7 @@ static void port_event(struct usb_hub *h
+@@ -5321,7 +5321,7 @@ static void port_event(struct usb_hub *h
  		port_dev->over_current_count++;
  		port_over_current_notify(port_dev);
  
diff --git a/target/linux/bcm27xx/patches-5.4/950-0042-dmaengine-Add-support-for-BCM2708.patch b/target/linux/bcm27xx/patches-5.4/950-0042-dmaengine-Add-support-for-BCM2708.patch
index 496c3aae07..f66a4f251a 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0042-dmaengine-Add-support-for-BCM2708.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0042-dmaengine-Add-support-for-BCM2708.patch
@@ -178,7 +178,7 @@ Signed-off-by: Andrei Gherzan <andrei at gherzan.com>
 
 --- a/drivers/dma/Kconfig
 +++ b/drivers/dma/Kconfig
-@@ -133,7 +133,7 @@ config COH901318
+@@ -134,7 +134,7 @@ config COH901318
  
  config DMA_BCM2835
  	tristate "BCM2835 DMA engine support"
@@ -187,7 +187,7 @@ Signed-off-by: Andrei Gherzan <andrei at gherzan.com>
  	select DMA_ENGINE
  	select DMA_VIRTUAL_CHANNELS
  
-@@ -608,6 +608,10 @@ config UNIPHIER_MDMAC
+@@ -609,6 +609,10 @@ config UNIPHIER_MDMAC
  	  UniPhier platform.  This DMA controller is used as the external
  	  DMA engine of the SD/eMMC controllers of the LD4, Pro4, sLD8 SoCs.
  
diff --git a/target/linux/bcm27xx/patches-5.4/950-0441-PCI-of-Add-inbound-resource-parsing-to-helpers.patch b/target/linux/bcm27xx/patches-5.4/950-0441-PCI-of-Add-inbound-resource-parsing-to-helpers.patch
index 422dea1b31..6e04d425bf 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0441-PCI-of-Add-inbound-resource-parsing-to-helpers.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0441-PCI-of-Add-inbound-resource-parsing-to-helpers.patch
@@ -82,7 +82,7 @@ Cc: linux-rockchip at lists.infradead.org
  
 --- a/drivers/pci/controller/pci-aardvark.c
 +++ b/drivers/pci/controller/pci-aardvark.c
-@@ -1018,7 +1018,8 @@ static int advk_pcie_probe(struct platfo
+@@ -1049,7 +1049,8 @@ static int advk_pcie_probe(struct platfo
  		return ret;
  	}
  
diff --git a/target/linux/generic/backport-5.4/393-v5.5-sch_cake-drop-unused-variable-tin_quantum_prio.patch b/target/linux/generic/backport-5.4/393-v5.5-sch_cake-drop-unused-variable-tin_quantum_prio.patch
index 8f6406c290..6c9e8ad5ee 100644
--- a/target/linux/generic/backport-5.4/393-v5.5-sch_cake-drop-unused-variable-tin_quantum_prio.patch
+++ b/target/linux/generic/backport-5.4/393-v5.5-sch_cake-drop-unused-variable-tin_quantum_prio.patch
@@ -32,7 +32,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	s32	tin_deficit;
  	u32	tin_backlog;
  	u32	tin_dropped;
-@@ -1943,7 +1942,7 @@ begin:
+@@ -1947,7 +1946,7 @@ begin:
  		while (b->tin_deficit < 0 ||
  		       !(b->sparse_flow_count + b->bulk_flow_count)) {
  			if (b->tin_deficit <= 0)
@@ -41,7 +41,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  			if (b->sparse_flow_count + b->bulk_flow_count)
  				empty = false;
  
-@@ -2265,8 +2264,7 @@ static int cake_config_besteffort(struct
+@@ -2269,8 +2268,7 @@ static int cake_config_besteffort(struct
  
  	cake_set_rate(b, rate, mtu,
  		      us_to_ns(q->target), us_to_ns(q->interval));
@@ -51,7 +51,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	return 0;
  }
-@@ -2277,8 +2275,7 @@ static int cake_config_precedence(struct
+@@ -2281,8 +2279,7 @@ static int cake_config_precedence(struct
  	struct cake_sched_data *q = qdisc_priv(sch);
  	u32 mtu = psched_mtu(qdisc_dev(sch));
  	u64 rate = q->rate_bps;
@@ -61,7 +61,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	u32 i;
  
  	q->tin_cnt = 8;
-@@ -2291,18 +2288,14 @@ static int cake_config_precedence(struct
+@@ -2295,18 +2292,14 @@ static int cake_config_precedence(struct
  		cake_set_rate(b, rate, mtu, us_to_ns(q->target),
  			      us_to_ns(q->interval));
  
@@ -83,7 +83,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	}
  
  	return 0;
-@@ -2371,8 +2364,7 @@ static int cake_config_diffserv8(struct
+@@ -2375,8 +2368,7 @@ static int cake_config_diffserv8(struct
  	struct cake_sched_data *q = qdisc_priv(sch);
  	u32 mtu = psched_mtu(qdisc_dev(sch));
  	u64 rate = q->rate_bps;
@@ -93,7 +93,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	u32 i;
  
  	q->tin_cnt = 8;
-@@ -2388,18 +2380,14 @@ static int cake_config_diffserv8(struct
+@@ -2392,18 +2384,14 @@ static int cake_config_diffserv8(struct
  		cake_set_rate(b, rate, mtu, us_to_ns(q->target),
  			      us_to_ns(q->interval));
  
@@ -115,7 +115,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	}
  
  	return 0;
-@@ -2438,17 +2426,11 @@ static int cake_config_diffserv4(struct
+@@ -2442,17 +2430,11 @@ static int cake_config_diffserv4(struct
  	cake_set_rate(&q->tins[3], rate >> 2, mtu,
  		      us_to_ns(q->target), us_to_ns(q->interval));
  
@@ -137,7 +137,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	return 0;
  }
-@@ -2479,15 +2461,10 @@ static int cake_config_diffserv3(struct
+@@ -2483,15 +2465,10 @@ static int cake_config_diffserv3(struct
  	cake_set_rate(&q->tins[2], rate >> 2, mtu,
  		      us_to_ns(q->target), us_to_ns(q->interval));
  
diff --git a/target/linux/layerscape/patches-5.4/806-dma-0002-dmaengine-fsl-dpaa2-qdma-Add-NXP-dpaa2-qDMA-controll.patch b/target/linux/layerscape/patches-5.4/806-dma-0002-dmaengine-fsl-dpaa2-qdma-Add-NXP-dpaa2-qDMA-controll.patch
index 897752d871..72d234d3ef 100644
--- a/target/linux/layerscape/patches-5.4/806-dma-0002-dmaengine-fsl-dpaa2-qdma-Add-NXP-dpaa2-qDMA-controll.patch
+++ b/target/linux/layerscape/patches-5.4/806-dma-0002-dmaengine-fsl-dpaa2-qdma-Add-NXP-dpaa2-qDMA-controll.patch
@@ -38,7 +38,7 @@ Signed-off-by: Peng Ma <peng.ma at nxp.com>
 
 --- a/drivers/dma/Kconfig
 +++ b/drivers/dma/Kconfig
-@@ -669,6 +669,8 @@ source "drivers/dma/sh/Kconfig"
+@@ -670,6 +670,8 @@ source "drivers/dma/sh/Kconfig"
  
  source "drivers/dma/ti/Kconfig"
  
diff --git a/target/linux/layerscape/patches-5.4/806-dma-0003-MLK-14610-DMA-fsl-edma-v3-add-fsl-edma-v3-support.patch b/target/linux/layerscape/patches-5.4/806-dma-0003-MLK-14610-DMA-fsl-edma-v3-add-fsl-edma-v3-support.patch
index 1744d37419..780d3c89e2 100644
--- a/target/linux/layerscape/patches-5.4/806-dma-0003-MLK-14610-DMA-fsl-edma-v3-add-fsl-edma-v3-support.patch
+++ b/target/linux/layerscape/patches-5.4/806-dma-0003-MLK-14610-DMA-fsl-edma-v3-add-fsl-edma-v3-support.patch
@@ -85,7 +85,7 @@ Signed-off-by: Robin Gong <yibin.gong at nxp.com>
 +};
 --- a/drivers/dma/Kconfig
 +++ b/drivers/dma/Kconfig
-@@ -227,6 +227,17 @@ config FSL_QDMA
+@@ -228,6 +228,17 @@ config FSL_QDMA
           or dequeuing DMA jobs from, different work queues.
           This module can be found on NXP Layerscape SoCs.
  	  The qdma driver only work on  SoCs with a DPAA hardware block.
diff --git a/target/linux/layerscape/patches-5.4/806-dma-0026-dma-caam-add-dma-memcpy-driver.patch b/target/linux/layerscape/patches-5.4/806-dma-0026-dma-caam-add-dma-memcpy-driver.patch
index 073842eb13..be5ae1ad13 100644
--- a/target/linux/layerscape/patches-5.4/806-dma-0026-dma-caam-add-dma-memcpy-driver.patch
+++ b/target/linux/layerscape/patches-5.4/806-dma-0026-dma-caam-add-dma-memcpy-driver.patch
@@ -28,7 +28,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
 
 --- a/drivers/dma/Kconfig
 +++ b/drivers/dma/Kconfig
-@@ -131,6 +131,24 @@ config COH901318
+@@ -132,6 +132,24 @@ config COH901318
  	help
  	  Enable support for ST-Ericsson COH 901 318 DMA.
  
@@ -53,7 +53,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  config DMA_BCM2835
  	tristate "BCM2835 DMA engine support"
  	depends on ARCH_BCM2835
-@@ -662,7 +680,6 @@ config ZX_DMA
+@@ -663,7 +681,6 @@ config ZX_DMA
  	help
  	  Support the DMA engine for ZTE ZX family platform devices.
  
diff --git a/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch b/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch
index e3d18a9948..ccefbffd48 100644
--- a/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch
+++ b/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch
@@ -54,7 +54,7 @@ Signed-off-by: Peter Chen <peter.chen at nxp.com>
  	 * All 3.1 IP version constants are greater than the 3.0 IP
 --- a/drivers/usb/dwc3/gadget.c
 +++ b/drivers/usb/dwc3/gadget.c
-@@ -3575,6 +3575,10 @@ int dwc3_gadget_init(struct dwc3 *dwc)
+@@ -3578,6 +3578,10 @@ int dwc3_gadget_init(struct dwc3 *dwc)
  	dwc->gadget.sg_supported	= true;
  	dwc->gadget.name		= "dwc3-gadget";
  	dwc->gadget.lpm_capable		= true;
diff --git a/target/linux/layerscape/patches-5.4/820-usb-0019-MLK-9829-usb-core-print-suggested-message-if-failed-.patch b/target/linux/layerscape/patches-5.4/820-usb-0019-MLK-9829-usb-core-print-suggested-message-if-failed-.patch
index ff582f3ace..e444af408a 100644
--- a/target/linux/layerscape/patches-5.4/820-usb-0019-MLK-9829-usb-core-print-suggested-message-if-failed-.patch
+++ b/target/linux/layerscape/patches-5.4/820-usb-0019-MLK-9829-usb-core-print-suggested-message-if-failed-.patch
@@ -20,7 +20,7 @@ Signed-off-by: Li Jun <jun.li at freescale.com>
 
 --- a/drivers/usb/core/hub.c
 +++ b/drivers/usb/core/hub.c
-@@ -4729,7 +4729,8 @@ hub_port_init(struct usb_hub *hub, struc
+@@ -4731,7 +4731,8 @@ hub_port_init(struct usb_hub *hub, struc
  			}
  			if (r) {
  				if (r != -ENODEV)
diff --git a/target/linux/mvebu/patches-5.4/001-PCI-aardvark-Wait-for-endpoint-to-be-ready-before-tr.patch b/target/linux/mvebu/patches-5.4/001-PCI-aardvark-Wait-for-endpoint-to-be-ready-before-tr.patch
index 95abbce002..2df3306157 100644
--- a/target/linux/mvebu/patches-5.4/001-PCI-aardvark-Wait-for-endpoint-to-be-ready-before-tr.patch
+++ b/target/linux/mvebu/patches-5.4/001-PCI-aardvark-Wait-for-endpoint-to-be-ready-before-tr.patch
@@ -33,7 +33,7 @@ Acked-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
 
 --- a/drivers/pci/controller/pci-aardvark.c
 +++ b/drivers/pci/controller/pci-aardvark.c
-@@ -337,6 +337,14 @@ static void advk_pcie_setup_hw(struct ad
+@@ -338,6 +338,14 @@ static void advk_pcie_setup_hw(struct ad
  	reg |= PIO_CTRL_ADDR_WIN_DISABLE;
  	advk_writel(pcie, reg, PIO_CTRL);
  
diff --git a/target/linux/mvebu/patches-5.4/002-PCI-aardvark-Don-t-rely-on-jiffies-while-holding-spi.patch b/target/linux/mvebu/patches-5.4/002-PCI-aardvark-Don-t-rely-on-jiffies-while-holding-spi.patch
deleted file mode 100644
index db4afd22a2..0000000000
--- a/target/linux/mvebu/patches-5.4/002-PCI-aardvark-Don-t-rely-on-jiffies-while-holding-spi.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 7fbcb5da811be7d47468417c7795405058abb3da Mon Sep 17 00:00:00 2001
-From: Remi Pommarel <repk at triplefau.lt>
-Date: Fri, 27 Sep 2019 10:55:02 +0200
-Subject: [PATCH] PCI: aardvark: Don't rely on jiffies while holding spinlock
-
-advk_pcie_wait_pio() can be called while holding a spinlock (from
-pci_bus_read_config_dword()), then depends on jiffies in order to
-timeout while polling on PIO state registers. In the case the PIO
-transaction failed, the timeout will never happen and will also cause
-the cpu to stall.
-
-This decrements a variable and wait instead of using jiffies.
-
-Signed-off-by: Remi Pommarel <repk at triplefau.lt>
-Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi at arm.com>
-Reviewed-by: Andrew Murray <andrew.murray at arm.com>
-Acked-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
----
- drivers/pci/controller/pci-aardvark.c | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
-
---- a/drivers/pci/controller/pci-aardvark.c
-+++ b/drivers/pci/controller/pci-aardvark.c
-@@ -175,7 +175,8 @@
- 	(PCIE_CONF_BUS(bus) | PCIE_CONF_DEV(PCI_SLOT(devfn))	| \
- 	 PCIE_CONF_FUNC(PCI_FUNC(devfn)) | PCIE_CONF_REG(where))
- 
--#define PIO_TIMEOUT_MS			1
-+#define PIO_RETRY_CNT			500
-+#define PIO_RETRY_DELAY			2 /* 2 us*/
- 
- #define LINK_WAIT_MAX_RETRIES		10
- #define LINK_WAIT_USLEEP_MIN		90000
-@@ -400,17 +401,16 @@ static void advk_pcie_check_pio_status(s
- static int advk_pcie_wait_pio(struct advk_pcie *pcie)
- {
- 	struct device *dev = &pcie->pdev->dev;
--	unsigned long timeout;
-+	int i;
- 
--	timeout = jiffies + msecs_to_jiffies(PIO_TIMEOUT_MS);
--
--	while (time_before(jiffies, timeout)) {
-+	for (i = 0; i < PIO_RETRY_CNT; i++) {
- 		u32 start, isr;
- 
- 		start = advk_readl(pcie, PIO_START);
- 		isr = advk_readl(pcie, PIO_ISR);
- 		if (!start && isr)
- 			return 0;
-+		udelay(PIO_RETRY_DELAY);
- 	}
- 
- 	dev_err(dev, "config read/write timed out\n");
diff --git a/target/linux/mvebu/patches-5.4/017-PCI-aardvark-Improve-link-training.patch b/target/linux/mvebu/patches-5.4/017-PCI-aardvark-Improve-link-training.patch
index 2bf838432f..19d0a5d513 100644
--- a/target/linux/mvebu/patches-5.4/017-PCI-aardvark-Improve-link-training.patch
+++ b/target/linux/mvebu/patches-5.4/017-PCI-aardvark-Improve-link-training.patch
@@ -193,7 +193,7 @@ Acked-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
  
  	reg = advk_readl(pcie, PCIE_CORE_CMD_STATUS_REG);
  	reg |= PCIE_CORE_CMD_MEM_ACCESS_EN |
-@@ -1035,6 +1093,12 @@ static int advk_pcie_probe(struct platfo
+@@ -1066,6 +1124,12 @@ static int advk_pcie_probe(struct platfo
  		return ret;
  	}
  
diff --git a/target/linux/mvebu/patches-5.4/018-PCI-aardvark-Issue-PERST-via-GPIO.patch b/target/linux/mvebu/patches-5.4/018-PCI-aardvark-Issue-PERST-via-GPIO.patch
index 83212ec475..0f2dab600b 100644
--- a/target/linux/mvebu/patches-5.4/018-PCI-aardvark-Issue-PERST-via-GPIO.patch
+++ b/target/linux/mvebu/patches-5.4/018-PCI-aardvark-Issue-PERST-via-GPIO.patch
@@ -98,7 +98,7 @@ Acked-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
  	 * fundamental reset. As required by PCI Express spec a delay for at
  	 * least 100ms after such a reset before link training is needed.
  	 */
-@@ -1093,6 +1118,22 @@ static int advk_pcie_probe(struct platfo
+@@ -1124,6 +1149,22 @@ static int advk_pcie_probe(struct platfo
  		return ret;
  	}
  
diff --git a/target/linux/mvebu/patches-5.4/019-PCI-aardvark-Add-PHY-support.patch b/target/linux/mvebu/patches-5.4/019-PCI-aardvark-Add-PHY-support.patch
index fa04861e80..640e4eb57c 100644
--- a/target/linux/mvebu/patches-5.4/019-PCI-aardvark-Add-PHY-support.patch
+++ b/target/linux/mvebu/patches-5.4/019-PCI-aardvark-Add-PHY-support.patch
@@ -76,7 +76,7 @@ Cc: Miqu?l Raynal <miquel.raynal at bootlin.com>
  	/* Set to Direct mode */
  	reg = advk_readl(pcie, CTRL_CONFIG_REG);
  	reg &= ~(CTRL_MODE_MASK << CTRL_MODE_SHIFT);
-@@ -1083,6 +1092,62 @@ out_release_res:
+@@ -1114,6 +1123,62 @@ out_release_res:
  	return err;
  }
  
@@ -139,7 +139,7 @@ Cc: Miqu?l Raynal <miquel.raynal at bootlin.com>
  static int advk_pcie_probe(struct platform_device *pdev)
  {
  	struct device *dev = &pdev->dev;
-@@ -1140,6 +1205,10 @@ static int advk_pcie_probe(struct platfo
+@@ -1171,6 +1236,10 @@ static int advk_pcie_probe(struct platfo
  	else
  		pcie->link_gen = ret;
  
diff --git a/target/linux/mvebu/patches-5.4/026-PCI-aardvark-Fix-initialization-with-old-Marvell-s-A.patch b/target/linux/mvebu/patches-5.4/026-PCI-aardvark-Fix-initialization-with-old-Marvell-s-A.patch
index bb9d7b7849..41fed6aded 100644
--- a/target/linux/mvebu/patches-5.4/026-PCI-aardvark-Fix-initialization-with-old-Marvell-s-A.patch
+++ b/target/linux/mvebu/patches-5.4/026-PCI-aardvark-Fix-initialization-with-old-Marvell-s-A.patch
@@ -31,7 +31,7 @@ Cc: <stable at vger.kernel.org> # 5.8+: ea17a0f153af: phy: marvell: comphy: Convert
 
 --- a/drivers/pci/controller/pci-aardvark.c
 +++ b/drivers/pci/controller/pci-aardvark.c
-@@ -1123,7 +1123,9 @@ static int advk_pcie_enable_phy(struct a
+@@ -1154,7 +1154,9 @@ static int advk_pcie_enable_phy(struct a
  	}
  
  	ret = phy_power_on(pcie->phy);
diff --git a/target/linux/octeontx/patches-5.4/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch b/target/linux/octeontx/patches-5.4/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch
index e33a28e953..c19e4cf90d 100644
--- a/target/linux/octeontx/patches-5.4/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch
+++ b/target/linux/octeontx/patches-5.4/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch
@@ -22,7 +22,7 @@ Signed-off-by: Tim Harvey <tharvey at gateworks.com>
  #include <linux/platform_data/x86/apple.h>
  #include <linux/pm_runtime.h>
  #include <linux/switchtec.h>
-@@ -5625,3 +5626,34 @@ static void apex_pci_fixup_class(struct
+@@ -5714,3 +5715,34 @@ static void apex_pci_fixup_class(struct
  }
  DECLARE_PCI_FIXUP_CLASS_HEADER(0x1ac1, 0x089a,
  			       PCI_CLASS_NOT_DEFINED, 8, apex_pci_fixup_class);


From lede-commits at lists.infradead.org  Sat Jun 26 05:35:30 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 26 Jun 2021 08:35:30 -0400
Subject: [openwrt/openwrt]  dnsmasq: Update to version 2.86test3
In-Reply-To: <162471093002.27580.8606961149134837339@git-01.infra.openwrt.org>
References: <162471093002.27580.8606961149134837339@git-01.infra.openwrt.org>
Message-ID: <mailman.3695.1624710937.1072.lede-commits@lists.infradead.org>

ldir pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/3628870015ef46eacf2c936f36e3c1ed3b4c9855

commit 3628870015ef46eacf2c936f36e3c1ed3b4c9855
Author: Etan Kissling <etan.kissling at gmail.com>
AuthorDate: Sat Jun 26 12:11:45 2021 +0000

    dnsmasq: Update to version 2.86test3
    
    Need this version to add config option for connmark DNS filtering.
    
    Summary of upstream CHANGELOG:
    * Handle DHCPREBIND requests in the DHCPv6 server code.
    * Fix bug which caused dnsmasq to lose track of processes forked.
    * Major rewrite of the DNS server and domain handling code.
    * Revise resource handling for number of concurrent DNS queries.
    * Improve efficiency of DNSSEC.
    * Connection track mark based DNS query filtering.
    
    Signed-off-by: Etan Kissling <etan.kissling at gmail.com>
---
 package/network/services/dnsmasq/Makefile                           | 6 +++---
 .../dnsmasq/patches/100-remove-old-runtime-kernel-support.patch     | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index 90a81b5f65..53080cb95b 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnsmasq
-PKG_UPSTREAM_VERSION:=2.85
+PKG_UPSTREAM_VERSION:=2.86test3
 PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION)))
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz
-PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
-PKG_HASH:=ad98d3803df687e5b938080f3d25c628fe41c878752d03fbc6199787fee312fa
+PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/test-releases
+PKG_HASH:=0d0b465db89390e9f518f1239dec88b458c84489e7fd38586af6a5781f85e7db
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
diff --git a/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch b/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch
index b601bce1a9..5670808afc 100644
--- a/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch
+++ b/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch
@@ -26,7 +26,7 @@ Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
  
 --- a/src/dnsmasq.h
 +++ b/src/dnsmasq.h
-@@ -1144,7 +1144,7 @@ extern struct daemon {
+@@ -1185,7 +1185,7 @@ extern struct daemon {
    int inotifyfd;
  #endif
  #if defined(HAVE_LINUX_NETWORK)
@@ -35,7 +35,7 @@ Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
  #elif defined(HAVE_BSD_NETWORK)
    int dhcp_raw_fd, dhcp_icmp_fd, routefd;
  #endif
-@@ -1326,9 +1326,6 @@ int read_write(int fd, unsigned char *pa
+@@ -1368,9 +1368,6 @@ int read_write(int fd, unsigned char *pa
  void close_fds(long max_fd, int spare1, int spare2, int spare3);
  int wildcard_match(const char* wildcard, const char* match);
  int wildcard_matchn(const char* wildcard, const char* match, int num);


From lede-commits at lists.infradead.org  Sat Jun 26 05:35:31 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 26 Jun 2021 08:35:31 -0400
Subject: [openwrt/openwrt] dnsmasq: add config option for connmark DNS
 filtering
In-Reply-To: <162471093002.27580.8606961149134837339@git-01.infra.openwrt.org>
References: <162471093002.27580.8606961149134837339@git-01.infra.openwrt.org>
Message-ID: <mailman.3696.1624710937.1072.lede-commits@lists.infradead.org>

ldir pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/dea4bae7c2b963af02e1e3e3bdb5cd656a5ea3d3

commit dea4bae7c2b963af02e1e3e3bdb5cd656a5ea3d3
Author: Etan Kissling <etan.kissling at gmail.com>
AuthorDate: Sat Jun 26 12:11:49 2021 +0000

    dnsmasq: add config option for connmark DNS filtering
    
    This adds uci support to configure connmark based DNS filtering.
    
    Signed-off-by: Etan Kissling <etan_kissling at apple.com>
    (See https://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2021q2/015151.html)
    Signed-off-by: Etan Kissling <etan.kissling at gmail.com>
---
 package/network/services/dnsmasq/files/dnsmasq.init | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 44e7d2d4f9..3e06218a43 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -172,6 +172,10 @@ append_ipset() {
 	xappend "--ipset=$1"
 }
 
+append_connmark_allowlist() {
+	xappend "--connmark-allowlist=$1"
+}
+
 append_interface() {
 	network_get_device ifname "$1" || ifname="$1"
 	xappend "--interface=$ifname"
@@ -913,6 +917,14 @@ dnsmasq_start()
 	config_list_foreach "$cfg" "rev_server" append_rev_server
 	config_list_foreach "$cfg" "address" append_address
 	config_list_foreach "$cfg" "ipset" append_ipset
+
+	local connmark_allowlist_enable
+	config_get connmark_allowlist_enable "$cfg" connmark_allowlist_enable 0
+	[ "$connmark_allowlist_enable" -gt 0 ] && {
+		append_parm "$cfg" "connmark_allowlist_enable" "--connmark-allowlist-enable"
+		config_list_foreach "$cfg" "connmark_allowlist" append_connmark_allowlist
+	}
+
 	[ -n "$BOOT" ] || {
 		config_list_foreach "$cfg" "interface" append_interface
 		config_list_foreach "$cfg" "notinterface" append_notinterface


From lede-commits at lists.infradead.org  Sat Jun 26 12:32:39 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 26 Jun 2021 15:32:39 -0400
Subject: [openwrt/openwrt] Revert "dnsmasq: add config option for connmark
 DNS filtering"
In-Reply-To: <162473595977.24104.1836756224248346568@git-01.infra.openwrt.org>
References: <162473595977.24104.1836756224248346568@git-01.infra.openwrt.org>
Message-ID: <mailman.3713.1624735964.1072.lede-commits@lists.infradead.org>

ldir pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/2a9d7ecd278a8a5ef8bcc63ead65a9cbccd37621

commit 2a9d7ecd278a8a5ef8bcc63ead65a9cbccd37621
Author: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
AuthorDate: Sat Jun 26 20:30:58 2021 +0100

    Revert "dnsmasq: add config option for connmark DNS filtering"
    
    This reverts commit dea4bae7c2b963af02e1e3e3bdb5cd656a5ea3d3.
    
    dnsmasq v2.86test3 has some issues with ubus and needs reverting, hence
    this needs reverting.
    
    Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 package/network/services/dnsmasq/files/dnsmasq.init | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 3e06218a43..44e7d2d4f9 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -172,10 +172,6 @@ append_ipset() {
 	xappend "--ipset=$1"
 }
 
-append_connmark_allowlist() {
-	xappend "--connmark-allowlist=$1"
-}
-
 append_interface() {
 	network_get_device ifname "$1" || ifname="$1"
 	xappend "--interface=$ifname"
@@ -917,14 +913,6 @@ dnsmasq_start()
 	config_list_foreach "$cfg" "rev_server" append_rev_server
 	config_list_foreach "$cfg" "address" append_address
 	config_list_foreach "$cfg" "ipset" append_ipset
-
-	local connmark_allowlist_enable
-	config_get connmark_allowlist_enable "$cfg" connmark_allowlist_enable 0
-	[ "$connmark_allowlist_enable" -gt 0 ] && {
-		append_parm "$cfg" "connmark_allowlist_enable" "--connmark-allowlist-enable"
-		config_list_foreach "$cfg" "connmark_allowlist" append_connmark_allowlist
-	}
-
 	[ -n "$BOOT" ] || {
 		config_list_foreach "$cfg" "interface" append_interface
 		config_list_foreach "$cfg" "notinterface" append_notinterface


From lede-commits at lists.infradead.org  Sat Jun 26 12:32:40 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 26 Jun 2021 15:32:40 -0400
Subject: [openwrt/openwrt]  Revert "dnsmasq: Update to version 2.86test3"
In-Reply-To: <162473595977.24104.1836756224248346568@git-01.infra.openwrt.org>
References: <162473595977.24104.1836756224248346568@git-01.infra.openwrt.org>
Message-ID: <mailman.3714.1624735964.1072.lede-commits@lists.infradead.org>

ldir pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/76cc8a036ccb2355e301740ac2f51ac39894cd09

commit 76cc8a036ccb2355e301740ac2f51ac39894cd09
Author: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
AuthorDate: Sat Jun 26 20:31:29 2021 +0100

    Revert "dnsmasq: Update to version 2.86test3"
    
    This reverts commit 3628870015ef46eacf2c936f36e3c1ed3b4c9855.
    
    dnsmasq v2.86test3 has some issues with ubus, so is being reverted.
    
    Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 package/network/services/dnsmasq/Makefile                           | 6 +++---
 .../dnsmasq/patches/100-remove-old-runtime-kernel-support.patch     | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index 53080cb95b..90a81b5f65 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -8,13 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnsmasq
-PKG_UPSTREAM_VERSION:=2.86test3
+PKG_UPSTREAM_VERSION:=2.85
 PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION)))
 PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz
-PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/test-releases
-PKG_HASH:=0d0b465db89390e9f518f1239dec88b458c84489e7fd38586af6a5781f85e7db
+PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
+PKG_HASH:=ad98d3803df687e5b938080f3d25c628fe41c878752d03fbc6199787fee312fa
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
diff --git a/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch b/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch
index 5670808afc..b601bce1a9 100644
--- a/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch
+++ b/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch
@@ -26,7 +26,7 @@ Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
  
 --- a/src/dnsmasq.h
 +++ b/src/dnsmasq.h
-@@ -1185,7 +1185,7 @@ extern struct daemon {
+@@ -1144,7 +1144,7 @@ extern struct daemon {
    int inotifyfd;
  #endif
  #if defined(HAVE_LINUX_NETWORK)
@@ -35,7 +35,7 @@ Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
  #elif defined(HAVE_BSD_NETWORK)
    int dhcp_raw_fd, dhcp_icmp_fd, routefd;
  #endif
-@@ -1368,9 +1368,6 @@ int read_write(int fd, unsigned char *pa
+@@ -1326,9 +1326,6 @@ int read_write(int fd, unsigned char *pa
  void close_fds(long max_fd, int spare1, int spare2, int spare3);
  int wildcard_match(const char* wildcard, const char* match);
  int wildcard_matchn(const char* wildcard, const char* match, int num);


From lede-commits at lists.infradead.org  Sat Jun 26 16:09:04 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 26 Jun 2021 19:09:04 -0400
Subject: [openwrt/openwrt] libusb: Fix parsing of descriptors for
 multi-configuration devices
In-Reply-To: <162474894450.26934.11367977813947352154@git-01.infra.openwrt.org>
References: <162474894450.26934.11367977813947352154@git-01.infra.openwrt.org>
Message-ID: <mailman.3715.1624748949.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/e171d11f55e335416d2ee689604998698f517e00

commit e171d11f55e335416d2ee689604998698f517e00
Author: Georgi Valkov <gvalkov at abv.bg>
AuthorDate: Wed Feb 3 09:41:54 2021 +0200

    libusb: Fix parsing of descriptors for multi-configuration devices
    
    Prerequisite patch:
    Correct a typo in the Changelog and clean up a stray file
    
    Fix changes in libusb which introduced a regression:
    Commit e2be556bd2 ("linux_usbfs: Parse config descriptors during device
    initialization") introduced a regression for devices with multiple
    configurations. The logic that verifies the reported length of the
    configuration descriptors failed to count the length of the
    configuration descriptor itself and would truncate the actual length by
    9 bytes, leading to a parsing error for subsequent descriptors.
    
    Signed-off-by: Georgi Valkov <gvalkov at abv.bg>
    (cherry picked from commit 4b37e3bc2b2a079c996b6d97b8d3dbbd4ba6eb62)
---
 package/libs/libusb/Makefile                       |  2 +-
 ...ypo-in-the-Changelog-and-clean-up-a-stray.patch | 29 ++++++++++
 ...-Fix-parsing-of-descriptors-for-multi-con.patch | 61 ++++++++++++++++++++++
 3 files changed, 91 insertions(+), 1 deletion(-)

diff --git a/package/libs/libusb/Makefile b/package/libs/libusb/Makefile
index e931536339..6b80b3848d 100644
--- a/package/libs/libusb/Makefile
+++ b/package/libs/libusb/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libusb
 PKG_VERSION:=1.0.24
-PKG_RELEASE:=1
+PKG_RELEASE:=$(AUTORELEASE)
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=\
diff --git a/package/libs/libusb/patches/001-Correct-a-typo-in-the-Changelog-and-clean-up-a-stray.patch b/package/libs/libusb/patches/001-Correct-a-typo-in-the-Changelog-and-clean-up-a-stray.patch
new file mode 100644
index 0000000000..b17d6178d3
--- /dev/null
+++ b/package/libs/libusb/patches/001-Correct-a-typo-in-the-Changelog-and-clean-up-a-stray.patch
@@ -0,0 +1,29 @@
+From 369af149e3ad92514a2d24f112cedfeb7acaf558 Mon Sep 17 00:00:00 2001
+From: Chris Dickens <christopher.a.dickens at gmail.com>
+Date: Sun, 13 Dec 2020 15:46:27 -0800
+Subject: [PATCH] Correct a typo in the Changelog and clean up a stray file
+
+Signed-off-by: Chris Dickens <christopher.a.dickens at gmail.com>
+---
+ ChangeLog             | 2 +-
+ libusb/version_nano.h | 2 +-
+ test                  | 0
+ 3 files changed, 2 insertions(+), 2 deletions(-)
+ delete mode 100644 test
+
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -12,7 +12,7 @@ visit: http://log.libusb.info
+ * Darwin (macOS): use IOUSBDevice as darwin_device_class explicitly (#693)
+ * Linux: Drop support for kernel older than 2.6.32
+ * Linux: Provide an event thread name (#689)
+-* Linux: Wait until all USBs have been reaped before freeing them (#607)
++* Linux: Wait until all URBs have been reaped before freeing them (#607)
+ * NetBSD: Recognize device timeouts (#710)
+ * OpenBSD: Allow opening ugen devices multiple times (#763)
+ * OpenBSD: Support libusb_get_port_number() (#764)
+--- a/libusb/version_nano.h
++++ b/libusb/version_nano.h
+@@ -1 +1 @@
+-#define LIBUSB_NANO 11584
++#define LIBUSB_NANO 11585
diff --git a/package/libs/libusb/patches/002-linux_usbfs-Fix-parsing-of-descriptors-for-multi-con.patch b/package/libs/libusb/patches/002-linux_usbfs-Fix-parsing-of-descriptors-for-multi-con.patch
new file mode 100644
index 0000000000..a53a8900de
--- /dev/null
+++ b/package/libs/libusb/patches/002-linux_usbfs-Fix-parsing-of-descriptors-for-multi-con.patch
@@ -0,0 +1,61 @@
+From f6d2cb561402c3b6d3627c0eb89e009b503d9067 Mon Sep 17 00:00:00 2001
+From: Chris Dickens <christopher.a.dickens at gmail.com>
+Date: Sun, 13 Dec 2020 15:49:19 -0800
+Subject: [PATCH] linux_usbfs: Fix parsing of descriptors for
+ multi-configuration devices
+
+Commit e2be556bd2 ("linux_usbfs: Parse config descriptors during device
+initialization") introduced a regression for devices with multiple
+configurations. The logic that verifies the reported length of the
+configuration descriptors failed to count the length of the
+configuration descriptor itself and would truncate the actual length by
+9 bytes, leading to a parsing error for subsequent descriptors.
+
+Closes #825
+
+Signed-off-by: Chris Dickens <christopher.a.dickens at gmail.com>
+---
+ libusb/os/linux_usbfs.c | 12 ++++++++----
+ libusb/version_nano.h   |  2 +-
+ 2 files changed, 9 insertions(+), 5 deletions(-)
+
+--- a/libusb/os/linux_usbfs.c
++++ b/libusb/os/linux_usbfs.c
+@@ -641,7 +641,12 @@ static int seek_to_next_config(struct li
+ 	uint8_t *buffer, size_t len)
+ {
+ 	struct usbi_descriptor_header *header;
+-	int offset = 0;
++	int offset;
++
++	/* Start seeking past the config descriptor */
++	offset = LIBUSB_DT_CONFIG_SIZE;
++	buffer += LIBUSB_DT_CONFIG_SIZE;
++	len -= LIBUSB_DT_CONFIG_SIZE;
+ 
+ 	while (len > 0) {
+ 		if (len < 2) {
+@@ -718,7 +723,7 @@ static int parse_config_descriptors(stru
+ 		}
+ 
+ 		if (priv->sysfs_dir) {
+-			 /*
++			/*
+ 			 * In sysfs wTotalLength is ignored, instead the kernel returns a
+ 			 * config descriptor with verified bLength fields, with descriptors
+ 			 * with an invalid bLength removed.
+@@ -727,8 +732,7 @@ static int parse_config_descriptors(stru
+ 			int offset;
+ 
+ 			if (num_configs > 1 && idx < num_configs - 1) {
+-				offset = seek_to_next_config(ctx, buffer + LIBUSB_DT_CONFIG_SIZE,
+-							     remaining - LIBUSB_DT_CONFIG_SIZE);
++				offset = seek_to_next_config(ctx, buffer, remaining);
+ 				if (offset < 0)
+ 					return offset;
+ 				sysfs_config_len = (uint16_t)offset;
+--- a/libusb/version_nano.h
++++ b/libusb/version_nano.h
+@@ -1 +1 @@
+-#define LIBUSB_NANO 11585
++#define LIBUSB_NANO 11586


From lede-commits at lists.infradead.org  Sat Jun 26 16:09:05 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 26 Jun 2021 19:09:05 -0400
Subject: [openwrt/openwrt]  kernel: bump 5.4 to 5.4.128
In-Reply-To: <162474894450.26934.11367977813947352154@git-01.infra.openwrt.org>
References: <162474894450.26934.11367977813947352154@git-01.infra.openwrt.org>
Message-ID: <mailman.3716.1624748951.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/85cef1cf221a4786fb8b1531748a5a0790101a3a

commit 85cef1cf221a4786fb8b1531748a5a0790101a3a
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sat Jun 26 21:08:19 2021 +0200

    kernel: bump 5.4 to 5.4.128
    
    Manually rebased
      bcm27xx/patches-5.4/950-0089-cgroup-Disable-cgroup-memory-by-default.patch
        Replaced with patch from Raspberry Pi kernel 5.10 patches
      mvebu/patches-5.4/002-PCI-aardvark-Don-t-rely-on-jiffies-while-holding-spi.patch
        Applied upstream
    
    All others updated automatically.
    
    Compile-tested on: ath79/generic, lantiq/xrx200, brcm27xx
    Runtime-tested on: ath79/generic, lantiq/xrx200
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 include/kernel-version.mk                          |  4 +-
 ...cm2835-Load-driver-early-and-support-lega.patch |  2 +-
 .../patches-5.4/950-0037-Add-dwc_otg-driver.patch  |  2 +-
 ...50-0042-dmaengine-Add-support-for-BCM2708.patch |  4 +-
 ...9-cgroup-Disable-cgroup-memory-by-default.patch | 39 +++++++++++-----
 ...pi-spi-bcm2835-Disable-forced-software-CS.patch |  2 +-
 ...i-bcm2835-enable-shared-interrupt-support.patch |  2 +-
 ...-device-quirks-for-Freeway-Airmouse-T3-an.patch |  4 +-
 ...9-SQUASH-Fix-spi-driver-compiler-warnings.patch |  2 +-
 ...f-Add-inbound-resource-parsing-to-helpers.patch |  2 +-
 ...orce-CS_HIGH-if-GPIO-descriptors-are-used.patch |  4 +-
 ..._gpio_descriptor-fixup-moved-to-spi_setup.patch |  2 +-
 ...-Demote-SPI_CS_HIGH-warning-to-KERN_DEBUG.patch |  2 +-
 ...t-SQUASH-Fix-spi-driver-compiler-warnings.patch |  2 +-
 ...pi-spi-bcm2835-Disable-forced-software-CS.patch |  2 +-
 ...ake-drop-unused-variable-tin_quantum_prio.patch | 16 +++----
 target/linux/generic/config-5.4                    |  1 +
 .../generic/hack-5.4/221-module_exports.patch      |  2 +-
 ...jecting-with-source-address-failed-policy.patch | 18 ++++----
 .../0002-dmaengine-Add-ADM-driver.patch            |  2 +-
 ...sl-dpaa2-qdma-Add-NXP-dpaa2-qDMA-controll.patch |  2 +-
 ...0-DMA-fsl-edma-v3-add-fsl-edma-v3-support.patch |  2 +-
 ...6-dma-0026-dma-caam-add-dma-memcpy-driver.patch |  4 +-
 ...b-0005-usb-dwc3-add-otg-properties-update.patch |  2 +-
 ...b-core-print-suggested-message-if-failed-.patch |  2 +-
 ...-v5.7-spi-make-spi-max-frequency-optional.patch |  2 +-
 ...k-Wait-for-endpoint-to-be-ready-before-tr.patch |  2 +-
 ...k-Don-t-rely-on-jiffies-while-holding-spi.patch | 54 ----------------------
 .../017-PCI-aardvark-Improve-link-training.patch   |  2 +-
 .../018-PCI-aardvark-Issue-PERST-via-GPIO.patch    |  2 +-
 .../019-PCI-aardvark-Add-PHY-support.patch         |  4 +-
 ...k-Fix-initialization-with-old-Marvell-s-A.patch |  2 +-
 ...rk-for-Gateworks-PLX-PEX860x-switch-with-.patch |  2 +-
 33 files changed, 79 insertions(+), 117 deletions(-)

diff --git a/include/kernel-version.mk b/include/kernel-version.mk
index c496c500d3..8835604d6d 100644
--- a/include/kernel-version.mk
+++ b/include/kernel-version.mk
@@ -6,9 +6,9 @@ ifdef CONFIG_TESTING_KERNEL
   KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
 endif
 
-LINUX_VERSION-5.4 = .124
+LINUX_VERSION-5.4 = .128
 
-LINUX_KERNEL_HASH-5.4.124 = f7f29dda2b042d7b5986d18274413131cf70e17288c05e9a683df1f46c507d82
+LINUX_KERNEL_HASH-5.4.128 = 3b54aebb816b9e628cb9ba3055a6aca58ce0ddeec49366c0da86ced9a7be39ab
 
 remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
 sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
diff --git a/target/linux/bcm27xx/patches-5.4/950-0012-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch b/target/linux/bcm27xx/patches-5.4/950-0012-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch
index 489e5d11ac..8e59b9b24e 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0012-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0012-dmaengine-bcm2835-Load-driver-early-and-support-lega.patch
@@ -20,7 +20,7 @@ Signed-off-by: Noralf Tr?nnes <noralf at tronnes.org>
 
 --- a/drivers/dma/Kconfig
 +++ b/drivers/dma/Kconfig
-@@ -133,7 +133,7 @@ config COH901318
+@@ -134,7 +134,7 @@ config COH901318
  
  config DMA_BCM2835
  	tristate "BCM2835 DMA engine support"
diff --git a/target/linux/bcm27xx/patches-5.4/950-0037-Add-dwc_otg-driver.patch b/target/linux/bcm27xx/patches-5.4/950-0037-Add-dwc_otg-driver.patch
index 5b7f773b0b..9280ab3f17 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0037-Add-dwc_otg-driver.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0037-Add-dwc_otg-driver.patch
@@ -1040,7 +1040,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.org>
  }
 --- a/drivers/usb/core/hub.c
 +++ b/drivers/usb/core/hub.c
-@@ -5319,7 +5319,7 @@ static void port_event(struct usb_hub *h
+@@ -5321,7 +5321,7 @@ static void port_event(struct usb_hub *h
  		port_dev->over_current_count++;
  		port_over_current_notify(port_dev);
  
diff --git a/target/linux/bcm27xx/patches-5.4/950-0042-dmaengine-Add-support-for-BCM2708.patch b/target/linux/bcm27xx/patches-5.4/950-0042-dmaengine-Add-support-for-BCM2708.patch
index 496c3aae07..f66a4f251a 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0042-dmaengine-Add-support-for-BCM2708.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0042-dmaengine-Add-support-for-BCM2708.patch
@@ -178,7 +178,7 @@ Signed-off-by: Andrei Gherzan <andrei at gherzan.com>
 
 --- a/drivers/dma/Kconfig
 +++ b/drivers/dma/Kconfig
-@@ -133,7 +133,7 @@ config COH901318
+@@ -134,7 +134,7 @@ config COH901318
  
  config DMA_BCM2835
  	tristate "BCM2835 DMA engine support"
@@ -187,7 +187,7 @@ Signed-off-by: Andrei Gherzan <andrei at gherzan.com>
  	select DMA_ENGINE
  	select DMA_VIRTUAL_CHANNELS
  
-@@ -608,6 +608,10 @@ config UNIPHIER_MDMAC
+@@ -609,6 +609,10 @@ config UNIPHIER_MDMAC
  	  UniPhier platform.  This DMA controller is used as the external
  	  DMA engine of the SD/eMMC controllers of the LD4, Pro4, sLD8 SoCs.
  
diff --git a/target/linux/bcm27xx/patches-5.4/950-0089-cgroup-Disable-cgroup-memory-by-default.patch b/target/linux/bcm27xx/patches-5.4/950-0089-cgroup-Disable-cgroup-memory-by-default.patch
index 86f60e7052..d4818b2239 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0089-cgroup-Disable-cgroup-memory-by-default.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0089-cgroup-Disable-cgroup-memory-by-default.patch
@@ -1,4 +1,4 @@
-From 0f95a2f2688ff44dc7080beaa2076741a0bdf510 Mon Sep 17 00:00:00 2001
+From 2b13c54592135b6fab269517ed687fa9f80bf8e5 Mon Sep 17 00:00:00 2001
 From: Phil Elwell <phil at raspberrypi.org>
 Date: Mon, 27 Nov 2017 17:14:54 +0000
 Subject: [PATCH] cgroup: Disable cgroup "memory" by default
@@ -12,34 +12,46 @@ See: https://github.com/raspberrypi/linux/issues/1950
 
 Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 ---
- kernel/cgroup/cgroup.c | 30 ++++++++++++++++++++++++++++++
- 1 file changed, 30 insertions(+)
+ kernel/cgroup/cgroup.c | 38 ++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 38 insertions(+)
 
 --- a/kernel/cgroup/cgroup.c
 +++ b/kernel/cgroup/cgroup.c
-@@ -5722,6 +5722,8 @@ int __init cgroup_init_early(void)
+@@ -5721,6 +5721,9 @@ int __init cgroup_init_early(void)
+ 	return 0;
  }
  
- static u16 cgroup_disable_mask __initdata;
 +static u16 cgroup_enable_mask __initdata;
 +static int __init cgroup_disable(char *str);
- 
++
  /**
   * cgroup_init - cgroup initialization
-@@ -5761,6 +5763,12 @@ int __init cgroup_init(void)
+  *
+@@ -5759,6 +5762,12 @@ int __init cgroup_init(void)
  
  	mutex_unlock(&cgroup_mutex);
  
-+	/* Apply an implicit disable... */
++	/*
++	 * Apply an implicit disable, knowing that an explicit enable will
++	 * prevent if from doing anything.
++	 */
 +	cgroup_disable("memory");
-+
-+	/* ...knowing that an explicit enable will override it. */
-+	cgroup_disable_mask &= ~cgroup_enable_mask;
 +
  	for_each_subsys(ss, ssid) {
  		if (ss->early_init) {
  			struct cgroup_subsys_state *css =
-@@ -6180,6 +6188,28 @@ static int __init cgroup_disable(char *s
+@@ -6168,6 +6177,10 @@ static int __init cgroup_disable(char *s
+ 			    strcmp(token, ss->legacy_name))
+ 				continue;
+ 
++			/* An explicit cgroup_enable overrides a disable */
++			if (cgroup_enable_mask & (1 << i))
++				continue;
++
+ 			static_branch_disable(cgroup_subsys_enabled_key[i]);
+ 			pr_info("Disabling %s control group subsystem\n",
+ 				ss->name);
+@@ -6177,6 +6190,31 @@ static int __init cgroup_disable(char *s
  }
  __setup("cgroup_disable=", cgroup_disable);
  
@@ -59,6 +71,9 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 +				continue;
 +
 +			cgroup_enable_mask |= 1 << i;
++			static_branch_enable(cgroup_subsys_enabled_key[i]);
++			pr_info("Enabling %s control group subsystem\n",
++				ss->name);
 +		}
 +	}
 +	return 1;
diff --git a/target/linux/bcm27xx/patches-5.4/950-0134-spi-spi-bcm2835-Disable-forced-software-CS.patch b/target/linux/bcm27xx/patches-5.4/950-0134-spi-spi-bcm2835-Disable-forced-software-CS.patch
index 0abe5059c0..cfb46d8791 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0134-spi-spi-bcm2835-Disable-forced-software-CS.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0134-spi-spi-bcm2835-Disable-forced-software-CS.patch
@@ -13,7 +13,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 
 --- a/drivers/spi/spi-bcm2835.c
 +++ b/drivers/spi/spi-bcm2835.c
-@@ -1230,31 +1230,6 @@ static int bcm2835_spi_setup(struct spi_
+@@ -1236,31 +1236,6 @@ static int bcm2835_spi_setup(struct spi_
  		return -EINVAL;
  	}
  
diff --git a/target/linux/bcm27xx/patches-5.4/950-0212-spi-bcm2835-enable-shared-interrupt-support.patch b/target/linux/bcm27xx/patches-5.4/950-0212-spi-bcm2835-enable-shared-interrupt-support.patch
index f82ae7d9f6..5326934b71 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0212-spi-bcm2835-enable-shared-interrupt-support.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0212-spi-bcm2835-enable-shared-interrupt-support.patch
@@ -23,7 +23,7 @@ Signed-off-by: Martin Sperl <kernel at martin.sperl.org>
  	/* Read as many bytes as possible from FIFO */
  	bcm2835_rd_fifo(bs);
  	/* Write as many bytes as possible to FIFO */
-@@ -1281,7 +1285,8 @@ static int bcm2835_spi_probe(struct plat
+@@ -1287,7 +1291,8 @@ static int bcm2835_spi_probe(struct plat
  	bcm2835_wr(bs, BCM2835_SPI_CS,
  		   BCM2835_SPI_CS_CLEAR_RX | BCM2835_SPI_CS_CLEAR_TX);
  
diff --git a/target/linux/bcm27xx/patches-5.4/950-0280-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch b/target/linux/bcm27xx/patches-5.4/950-0280-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch
index e486942ffd..c5e7d5e842 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0280-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0280-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch
@@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.org>
  #define USB_VENDOR_ID_BELKIN		0x050d
  #define USB_DEVICE_ID_FLIP_KVM		0x3201
  
-@@ -1259,6 +1262,9 @@
+@@ -1261,6 +1264,9 @@
  #define USB_VENDOR_ID_XAT	0x2505
  #define USB_DEVICE_ID_XAT_CSR	0x0220
  
@@ -53,7 +53,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.org>
  	{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_MULTI_TOUCH), HID_QUIRK_MULTI_INPUT },
  	{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL },
  	{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE2), HID_QUIRK_ALWAYS_POLL },
-@@ -190,6 +191,7 @@ static const struct hid_device_id hid_qu
+@@ -192,6 +193,7 @@ static const struct hid_device_id hid_qu
  	{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD2, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
  	{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
  	{ HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_XIN_MO_DUAL_ARCADE), HID_QUIRK_MULTI_INPUT },
diff --git a/target/linux/bcm27xx/patches-5.4/950-0409-SQUASH-Fix-spi-driver-compiler-warnings.patch b/target/linux/bcm27xx/patches-5.4/950-0409-SQUASH-Fix-spi-driver-compiler-warnings.patch
index 4413439101..742dbad712 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0409-SQUASH-Fix-spi-driver-compiler-warnings.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0409-SQUASH-Fix-spi-driver-compiler-warnings.patch
@@ -19,4 +19,4 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.com>
 -	struct gpio_chip *chip;
  	u32 cs;
  
- 	/*
+ 	if (spi->chip_select >= BCM2835_SPI_NUM_CS) {
diff --git a/target/linux/bcm27xx/patches-5.4/950-0441-PCI-of-Add-inbound-resource-parsing-to-helpers.patch b/target/linux/bcm27xx/patches-5.4/950-0441-PCI-of-Add-inbound-resource-parsing-to-helpers.patch
index 422dea1b31..6e04d425bf 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0441-PCI-of-Add-inbound-resource-parsing-to-helpers.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0441-PCI-of-Add-inbound-resource-parsing-to-helpers.patch
@@ -82,7 +82,7 @@ Cc: linux-rockchip at lists.infradead.org
  
 --- a/drivers/pci/controller/pci-aardvark.c
 +++ b/drivers/pci/controller/pci-aardvark.c
-@@ -1018,7 +1018,8 @@ static int advk_pcie_probe(struct platfo
+@@ -1049,7 +1049,8 @@ static int advk_pcie_probe(struct platfo
  		return ret;
  	}
  
diff --git a/target/linux/bcm27xx/patches-5.4/950-0646-spi-Force-CS_HIGH-if-GPIO-descriptors-are-used.patch b/target/linux/bcm27xx/patches-5.4/950-0646-spi-Force-CS_HIGH-if-GPIO-descriptors-are-used.patch
index 6ee6a275c3..05fa9f8f2e 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0646-spi-Force-CS_HIGH-if-GPIO-descriptors-are-used.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0646-spi-Force-CS_HIGH-if-GPIO-descriptors-are-used.patch
@@ -23,7 +23,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.com>
 
 --- a/drivers/spi/spi.c
 +++ b/drivers/spi/spi.c
-@@ -3110,6 +3110,7 @@ static int __spi_validate_bits_per_word(
+@@ -3116,6 +3116,7 @@ static int __spi_validate_bits_per_word(
   */
  int spi_setup(struct spi_device *spi)
  {
@@ -31,7 +31,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.com>
  	unsigned	bad_bits, ugly_bits;
  	int		status;
  
-@@ -3127,6 +3128,14 @@ int spi_setup(struct spi_device *spi)
+@@ -3133,6 +3134,14 @@ int spi_setup(struct spi_device *spi)
  		(SPI_TX_DUAL | SPI_TX_QUAD | SPI_TX_OCTAL |
  		 SPI_RX_DUAL | SPI_RX_QUAD | SPI_RX_OCTAL)))
  		return -EINVAL;
diff --git a/target/linux/bcm27xx/patches-5.4/950-0665-spi-use_gpio_descriptor-fixup-moved-to-spi_setup.patch b/target/linux/bcm27xx/patches-5.4/950-0665-spi-use_gpio_descriptor-fixup-moved-to-spi_setup.patch
index 8792faa0c9..402635d838 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0665-spi-use_gpio_descriptor-fixup-moved-to-spi_setup.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0665-spi-use_gpio_descriptor-fixup-moved-to-spi_setup.patch
@@ -37,7 +37,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.com>
 
 --- a/drivers/spi/spi.c
 +++ b/drivers/spi/spi.c
-@@ -1793,15 +1793,6 @@ static int of_spi_parse_dt(struct spi_co
+@@ -1799,15 +1799,6 @@ static int of_spi_parse_dt(struct spi_co
  	}
  	spi->chip_select = value;
  
diff --git a/target/linux/bcm27xx/patches-5.4/950-0690-SQUASH-spi-Demote-SPI_CS_HIGH-warning-to-KERN_DEBUG.patch b/target/linux/bcm27xx/patches-5.4/950-0690-SQUASH-spi-Demote-SPI_CS_HIGH-warning-to-KERN_DEBUG.patch
index fee107876a..b821afb08b 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0690-SQUASH-spi-Demote-SPI_CS_HIGH-warning-to-KERN_DEBUG.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0690-SQUASH-spi-Demote-SPI_CS_HIGH-warning-to-KERN_DEBUG.patch
@@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.com>
 
 --- a/drivers/spi/spi.c
 +++ b/drivers/spi/spi.c
-@@ -3122,8 +3122,8 @@ int spi_setup(struct spi_device *spi)
+@@ -3128,8 +3128,8 @@ int spi_setup(struct spi_device *spi)
  
  	if (ctlr->use_gpio_descriptors && ctlr->cs_gpiods &&
  	    ctlr->cs_gpiods[spi->chip_select] && !(spi->mode & SPI_CS_HIGH)) {
diff --git a/target/linux/bcm27xx/patches-5.4/950-0788-Revert-SQUASH-Fix-spi-driver-compiler-warnings.patch b/target/linux/bcm27xx/patches-5.4/950-0788-Revert-SQUASH-Fix-spi-driver-compiler-warnings.patch
index 437e5aba59..fad57b4863 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0788-Revert-SQUASH-Fix-spi-driver-compiler-warnings.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0788-Revert-SQUASH-Fix-spi-driver-compiler-warnings.patch
@@ -20,4 +20,4 @@ See: https://github.com/raspberrypi/linux/pull/3687
 +	enum gpio_lookup_flags lflags;
  	u32 cs;
  
- 	/*
+ 	if (spi->chip_select >= BCM2835_SPI_NUM_CS) {
diff --git a/target/linux/bcm27xx/patches-5.4/950-0789-Revert-spi-spi-bcm2835-Disable-forced-software-CS.patch b/target/linux/bcm27xx/patches-5.4/950-0789-Revert-spi-spi-bcm2835-Disable-forced-software-CS.patch
index 1479335217..ac0684be86 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0789-Revert-spi-spi-bcm2835-Disable-forced-software-CS.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0789-Revert-spi-spi-bcm2835-Disable-forced-software-CS.patch
@@ -13,7 +13,7 @@ See: https://github.com/raspberrypi/linux/pull/3687
 
 --- a/drivers/spi/spi-bcm2835.c
 +++ b/drivers/spi/spi-bcm2835.c
-@@ -1235,6 +1235,43 @@ static int bcm2835_spi_setup(struct spi_
+@@ -1241,6 +1241,43 @@ static int bcm2835_spi_setup(struct spi_
  		return -EINVAL;
  	}
  
diff --git a/target/linux/generic/backport-5.4/393-v5.5-sch_cake-drop-unused-variable-tin_quantum_prio.patch b/target/linux/generic/backport-5.4/393-v5.5-sch_cake-drop-unused-variable-tin_quantum_prio.patch
index 8f6406c290..6c9e8ad5ee 100644
--- a/target/linux/generic/backport-5.4/393-v5.5-sch_cake-drop-unused-variable-tin_quantum_prio.patch
+++ b/target/linux/generic/backport-5.4/393-v5.5-sch_cake-drop-unused-variable-tin_quantum_prio.patch
@@ -32,7 +32,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	s32	tin_deficit;
  	u32	tin_backlog;
  	u32	tin_dropped;
-@@ -1943,7 +1942,7 @@ begin:
+@@ -1947,7 +1946,7 @@ begin:
  		while (b->tin_deficit < 0 ||
  		       !(b->sparse_flow_count + b->bulk_flow_count)) {
  			if (b->tin_deficit <= 0)
@@ -41,7 +41,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  			if (b->sparse_flow_count + b->bulk_flow_count)
  				empty = false;
  
-@@ -2265,8 +2264,7 @@ static int cake_config_besteffort(struct
+@@ -2269,8 +2268,7 @@ static int cake_config_besteffort(struct
  
  	cake_set_rate(b, rate, mtu,
  		      us_to_ns(q->target), us_to_ns(q->interval));
@@ -51,7 +51,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	return 0;
  }
-@@ -2277,8 +2275,7 @@ static int cake_config_precedence(struct
+@@ -2281,8 +2279,7 @@ static int cake_config_precedence(struct
  	struct cake_sched_data *q = qdisc_priv(sch);
  	u32 mtu = psched_mtu(qdisc_dev(sch));
  	u64 rate = q->rate_bps;
@@ -61,7 +61,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	u32 i;
  
  	q->tin_cnt = 8;
-@@ -2291,18 +2288,14 @@ static int cake_config_precedence(struct
+@@ -2295,18 +2292,14 @@ static int cake_config_precedence(struct
  		cake_set_rate(b, rate, mtu, us_to_ns(q->target),
  			      us_to_ns(q->interval));
  
@@ -83,7 +83,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	}
  
  	return 0;
-@@ -2371,8 +2364,7 @@ static int cake_config_diffserv8(struct
+@@ -2375,8 +2368,7 @@ static int cake_config_diffserv8(struct
  	struct cake_sched_data *q = qdisc_priv(sch);
  	u32 mtu = psched_mtu(qdisc_dev(sch));
  	u64 rate = q->rate_bps;
@@ -93,7 +93,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	u32 i;
  
  	q->tin_cnt = 8;
-@@ -2388,18 +2380,14 @@ static int cake_config_diffserv8(struct
+@@ -2392,18 +2384,14 @@ static int cake_config_diffserv8(struct
  		cake_set_rate(b, rate, mtu, us_to_ns(q->target),
  			      us_to_ns(q->interval));
  
@@ -115,7 +115,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	}
  
  	return 0;
-@@ -2438,17 +2426,11 @@ static int cake_config_diffserv4(struct
+@@ -2442,17 +2430,11 @@ static int cake_config_diffserv4(struct
  	cake_set_rate(&q->tins[3], rate >> 2, mtu,
  		      us_to_ns(q->target), us_to_ns(q->interval));
  
@@ -137,7 +137,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	return 0;
  }
-@@ -2479,15 +2461,10 @@ static int cake_config_diffserv3(struct
+@@ -2483,15 +2465,10 @@ static int cake_config_diffserv3(struct
  	cake_set_rate(&q->tins[2], rate >> 2, mtu,
  		      us_to_ns(q->target), us_to_ns(q->interval));
  
diff --git a/target/linux/generic/config-5.4 b/target/linux/generic/config-5.4
index 91dc0b0f49..df49bdb2c2 100644
--- a/target/linux/generic/config-5.4
+++ b/target/linux/generic/config-5.4
@@ -3822,6 +3822,7 @@ CONFIG_NMI_LOG_BUF_SHIFT=13
 # CONFIG_NVMEM_SYSFS is not set
 # CONFIG_NVME_FC is not set
 # CONFIG_NVME_TARGET is not set
+# CONFIG_NVME_TCP is not set
 # CONFIG_NVRAM is not set
 # CONFIG_NV_TCO is not set
 # CONFIG_NXP_STB220 is not set
diff --git a/target/linux/generic/hack-5.4/221-module_exports.patch b/target/linux/generic/hack-5.4/221-module_exports.patch
index 09855b04d1..ef6e980892 100644
--- a/target/linux/generic/hack-5.4/221-module_exports.patch
+++ b/target/linux/generic/hack-5.4/221-module_exports.patch
@@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	}								\
  									\
  	/* __*init sections */						\
-@@ -903,6 +913,8 @@
+@@ -904,6 +914,8 @@
  	EXIT_TEXT							\
  	EXIT_DATA							\
  	EXIT_CALL							\
diff --git a/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
index 90f4199eab..283fc0ae4f 100644
--- a/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
+++ b/target/linux/generic/pending-5.4/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
@@ -157,7 +157,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  	case RTN_THROW:
  	case RTN_UNREACHABLE:
  	default:
-@@ -4419,6 +4438,17 @@ static int ip6_pkt_prohibit_out(struct n
+@@ -4423,6 +4442,17 @@ static int ip6_pkt_prohibit_out(struct n
  	return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED, IPSTATS_MIB_OUTNOROUTES);
  }
  
@@ -175,7 +175,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  /*
   *	Allocate a dst for local (unicast / anycast) address.
   */
-@@ -4899,7 +4929,8 @@ static int rtm_to_fib6_config(struct sk_
+@@ -4903,7 +4933,8 @@ static int rtm_to_fib6_config(struct sk_
  	if (rtm->rtm_type == RTN_UNREACHABLE ||
  	    rtm->rtm_type == RTN_BLACKHOLE ||
  	    rtm->rtm_type == RTN_PROHIBIT ||
@@ -185,7 +185,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  		cfg->fc_flags |= RTF_REJECT;
  
  	if (rtm->rtm_type == RTN_LOCAL)
-@@ -6021,6 +6052,8 @@ static int ip6_route_dev_notify(struct n
+@@ -6025,6 +6056,8 @@ static int ip6_route_dev_notify(struct n
  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
  		net->ipv6.ip6_prohibit_entry->dst.dev = dev;
  		net->ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(dev);
@@ -194,7 +194,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  		net->ipv6.ip6_blk_hole_entry->dst.dev = dev;
  		net->ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(dev);
  #endif
-@@ -6032,6 +6065,7 @@ static int ip6_route_dev_notify(struct n
+@@ -6036,6 +6069,7 @@ static int ip6_route_dev_notify(struct n
  		in6_dev_put_clear(&net->ipv6.ip6_null_entry->rt6i_idev);
  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
  		in6_dev_put_clear(&net->ipv6.ip6_prohibit_entry->rt6i_idev);
@@ -202,7 +202,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  		in6_dev_put_clear(&net->ipv6.ip6_blk_hole_entry->rt6i_idev);
  #endif
  	}
-@@ -6224,6 +6258,8 @@ static int __net_init ip6_route_net_init
+@@ -6228,6 +6262,8 @@ static int __net_init ip6_route_net_init
  
  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
  	net->ipv6.fib6_has_custom_rules = false;
@@ -211,7 +211,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  	net->ipv6.ip6_prohibit_entry = kmemdup(&ip6_prohibit_entry_template,
  					       sizeof(*net->ipv6.ip6_prohibit_entry),
  					       GFP_KERNEL);
-@@ -6234,11 +6270,21 @@ static int __net_init ip6_route_net_init
+@@ -6238,11 +6274,21 @@ static int __net_init ip6_route_net_init
  			 ip6_template_metrics, true);
  	INIT_LIST_HEAD(&net->ipv6.ip6_prohibit_entry->rt6i_uncached);
  
@@ -234,7 +234,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  	net->ipv6.ip6_blk_hole_entry->dst.ops = &net->ipv6.ip6_dst_ops;
  	dst_init_metrics(&net->ipv6.ip6_blk_hole_entry->dst,
  			 ip6_template_metrics, true);
-@@ -6262,6 +6308,8 @@ out:
+@@ -6266,6 +6312,8 @@ out:
  	return ret;
  
  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
@@ -243,7 +243,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  out_ip6_prohibit_entry:
  	kfree(net->ipv6.ip6_prohibit_entry);
  out_ip6_null_entry:
-@@ -6281,6 +6329,7 @@ static void __net_exit ip6_route_net_exi
+@@ -6285,6 +6333,7 @@ static void __net_exit ip6_route_net_exi
  	kfree(net->ipv6.ip6_null_entry);
  #ifdef CONFIG_IPV6_MULTIPLE_TABLES
  	kfree(net->ipv6.ip6_prohibit_entry);
@@ -251,7 +251,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  	kfree(net->ipv6.ip6_blk_hole_entry);
  #endif
  	dst_entries_destroy(&net->ipv6.ip6_dst_ops);
-@@ -6358,6 +6407,9 @@ void __init ip6_route_init_special_entri
+@@ -6362,6 +6411,9 @@ void __init ip6_route_init_special_entri
  	init_net.ipv6.ip6_prohibit_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
  	init_net.ipv6.ip6_blk_hole_entry->dst.dev = init_net.loopback_dev;
  	init_net.ipv6.ip6_blk_hole_entry->rt6i_idev = in6_dev_get(init_net.loopback_dev);
diff --git a/target/linux/ipq806x/patches-5.4/0002-dmaengine-Add-ADM-driver.patch b/target/linux/ipq806x/patches-5.4/0002-dmaengine-Add-ADM-driver.patch
index aa7d2e791e..7aa46526f2 100644
--- a/target/linux/ipq806x/patches-5.4/0002-dmaengine-Add-ADM-driver.patch
+++ b/target/linux/ipq806x/patches-5.4/0002-dmaengine-Add-ADM-driver.patch
@@ -26,7 +26,7 @@ Signed-off-by: Thomas Pedersen <twp at codeaurora.org>
 
 --- a/drivers/dma/qcom/Kconfig
 +++ b/drivers/dma/qcom/Kconfig
-@@ -28,3 +28,13 @@ config QCOM_HIDMA
+@@ -29,3 +29,13 @@ config QCOM_HIDMA
  	  (user to kernel, kernel to kernel, etc.).  It only supports
  	  memcpy interface. The core is not intended for general
  	  purpose slave DMA.
diff --git a/target/linux/layerscape/patches-5.4/806-dma-0002-dmaengine-fsl-dpaa2-qdma-Add-NXP-dpaa2-qDMA-controll.patch b/target/linux/layerscape/patches-5.4/806-dma-0002-dmaengine-fsl-dpaa2-qdma-Add-NXP-dpaa2-qDMA-controll.patch
index 897752d871..72d234d3ef 100644
--- a/target/linux/layerscape/patches-5.4/806-dma-0002-dmaengine-fsl-dpaa2-qdma-Add-NXP-dpaa2-qDMA-controll.patch
+++ b/target/linux/layerscape/patches-5.4/806-dma-0002-dmaengine-fsl-dpaa2-qdma-Add-NXP-dpaa2-qDMA-controll.patch
@@ -38,7 +38,7 @@ Signed-off-by: Peng Ma <peng.ma at nxp.com>
 
 --- a/drivers/dma/Kconfig
 +++ b/drivers/dma/Kconfig
-@@ -669,6 +669,8 @@ source "drivers/dma/sh/Kconfig"
+@@ -670,6 +670,8 @@ source "drivers/dma/sh/Kconfig"
  
  source "drivers/dma/ti/Kconfig"
  
diff --git a/target/linux/layerscape/patches-5.4/806-dma-0003-MLK-14610-DMA-fsl-edma-v3-add-fsl-edma-v3-support.patch b/target/linux/layerscape/patches-5.4/806-dma-0003-MLK-14610-DMA-fsl-edma-v3-add-fsl-edma-v3-support.patch
index 1744d37419..780d3c89e2 100644
--- a/target/linux/layerscape/patches-5.4/806-dma-0003-MLK-14610-DMA-fsl-edma-v3-add-fsl-edma-v3-support.patch
+++ b/target/linux/layerscape/patches-5.4/806-dma-0003-MLK-14610-DMA-fsl-edma-v3-add-fsl-edma-v3-support.patch
@@ -85,7 +85,7 @@ Signed-off-by: Robin Gong <yibin.gong at nxp.com>
 +};
 --- a/drivers/dma/Kconfig
 +++ b/drivers/dma/Kconfig
-@@ -227,6 +227,17 @@ config FSL_QDMA
+@@ -228,6 +228,17 @@ config FSL_QDMA
           or dequeuing DMA jobs from, different work queues.
           This module can be found on NXP Layerscape SoCs.
  	  The qdma driver only work on  SoCs with a DPAA hardware block.
diff --git a/target/linux/layerscape/patches-5.4/806-dma-0026-dma-caam-add-dma-memcpy-driver.patch b/target/linux/layerscape/patches-5.4/806-dma-0026-dma-caam-add-dma-memcpy-driver.patch
index 073842eb13..be5ae1ad13 100644
--- a/target/linux/layerscape/patches-5.4/806-dma-0026-dma-caam-add-dma-memcpy-driver.patch
+++ b/target/linux/layerscape/patches-5.4/806-dma-0026-dma-caam-add-dma-memcpy-driver.patch
@@ -28,7 +28,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
 
 --- a/drivers/dma/Kconfig
 +++ b/drivers/dma/Kconfig
-@@ -131,6 +131,24 @@ config COH901318
+@@ -132,6 +132,24 @@ config COH901318
  	help
  	  Enable support for ST-Ericsson COH 901 318 DMA.
  
@@ -53,7 +53,7 @@ Signed-off-by: Yangbo Lu <yangbo.lu at nxp.com>
  config DMA_BCM2835
  	tristate "BCM2835 DMA engine support"
  	depends on ARCH_BCM2835
-@@ -662,7 +680,6 @@ config ZX_DMA
+@@ -663,7 +681,6 @@ config ZX_DMA
  	help
  	  Support the DMA engine for ZTE ZX family platform devices.
  
diff --git a/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch b/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch
index e3d18a9948..ccefbffd48 100644
--- a/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch
+++ b/target/linux/layerscape/patches-5.4/820-usb-0005-usb-dwc3-add-otg-properties-update.patch
@@ -54,7 +54,7 @@ Signed-off-by: Peter Chen <peter.chen at nxp.com>
  	 * All 3.1 IP version constants are greater than the 3.0 IP
 --- a/drivers/usb/dwc3/gadget.c
 +++ b/drivers/usb/dwc3/gadget.c
-@@ -3575,6 +3575,10 @@ int dwc3_gadget_init(struct dwc3 *dwc)
+@@ -3578,6 +3578,10 @@ int dwc3_gadget_init(struct dwc3 *dwc)
  	dwc->gadget.sg_supported	= true;
  	dwc->gadget.name		= "dwc3-gadget";
  	dwc->gadget.lpm_capable		= true;
diff --git a/target/linux/layerscape/patches-5.4/820-usb-0019-MLK-9829-usb-core-print-suggested-message-if-failed-.patch b/target/linux/layerscape/patches-5.4/820-usb-0019-MLK-9829-usb-core-print-suggested-message-if-failed-.patch
index ff582f3ace..e444af408a 100644
--- a/target/linux/layerscape/patches-5.4/820-usb-0019-MLK-9829-usb-core-print-suggested-message-if-failed-.patch
+++ b/target/linux/layerscape/patches-5.4/820-usb-0019-MLK-9829-usb-core-print-suggested-message-if-failed-.patch
@@ -20,7 +20,7 @@ Signed-off-by: Li Jun <jun.li at freescale.com>
 
 --- a/drivers/usb/core/hub.c
 +++ b/drivers/usb/core/hub.c
-@@ -4729,7 +4729,8 @@ hub_port_init(struct usb_hub *hub, struc
+@@ -4731,7 +4731,8 @@ hub_port_init(struct usb_hub *hub, struc
  			}
  			if (r) {
  				if (r != -ENODEV)
diff --git a/target/linux/mediatek/patches-5.4/0001-v5.7-spi-make-spi-max-frequency-optional.patch b/target/linux/mediatek/patches-5.4/0001-v5.7-spi-make-spi-max-frequency-optional.patch
index 8487c3dda0..79ce15c37b 100644
--- a/target/linux/mediatek/patches-5.4/0001-v5.7-spi-make-spi-max-frequency-optional.patch
+++ b/target/linux/mediatek/patches-5.4/0001-v5.7-spi-make-spi-max-frequency-optional.patch
@@ -20,7 +20,7 @@ Signed-off-by: Mark Brown <broonie at kernel.org>
 
 --- a/drivers/spi/spi.c
 +++ b/drivers/spi/spi.c
-@@ -1803,13 +1803,8 @@ static int of_spi_parse_dt(struct spi_co
+@@ -1809,13 +1809,8 @@ static int of_spi_parse_dt(struct spi_co
  		spi->mode |= SPI_CS_HIGH;
  
  	/* Device speed */
diff --git a/target/linux/mvebu/patches-5.4/001-PCI-aardvark-Wait-for-endpoint-to-be-ready-before-tr.patch b/target/linux/mvebu/patches-5.4/001-PCI-aardvark-Wait-for-endpoint-to-be-ready-before-tr.patch
index 95abbce002..2df3306157 100644
--- a/target/linux/mvebu/patches-5.4/001-PCI-aardvark-Wait-for-endpoint-to-be-ready-before-tr.patch
+++ b/target/linux/mvebu/patches-5.4/001-PCI-aardvark-Wait-for-endpoint-to-be-ready-before-tr.patch
@@ -33,7 +33,7 @@ Acked-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
 
 --- a/drivers/pci/controller/pci-aardvark.c
 +++ b/drivers/pci/controller/pci-aardvark.c
-@@ -337,6 +337,14 @@ static void advk_pcie_setup_hw(struct ad
+@@ -338,6 +338,14 @@ static void advk_pcie_setup_hw(struct ad
  	reg |= PIO_CTRL_ADDR_WIN_DISABLE;
  	advk_writel(pcie, reg, PIO_CTRL);
  
diff --git a/target/linux/mvebu/patches-5.4/002-PCI-aardvark-Don-t-rely-on-jiffies-while-holding-spi.patch b/target/linux/mvebu/patches-5.4/002-PCI-aardvark-Don-t-rely-on-jiffies-while-holding-spi.patch
deleted file mode 100644
index db4afd22a2..0000000000
--- a/target/linux/mvebu/patches-5.4/002-PCI-aardvark-Don-t-rely-on-jiffies-while-holding-spi.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From 7fbcb5da811be7d47468417c7795405058abb3da Mon Sep 17 00:00:00 2001
-From: Remi Pommarel <repk at triplefau.lt>
-Date: Fri, 27 Sep 2019 10:55:02 +0200
-Subject: [PATCH] PCI: aardvark: Don't rely on jiffies while holding spinlock
-
-advk_pcie_wait_pio() can be called while holding a spinlock (from
-pci_bus_read_config_dword()), then depends on jiffies in order to
-timeout while polling on PIO state registers. In the case the PIO
-transaction failed, the timeout will never happen and will also cause
-the cpu to stall.
-
-This decrements a variable and wait instead of using jiffies.
-
-Signed-off-by: Remi Pommarel <repk at triplefau.lt>
-Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi at arm.com>
-Reviewed-by: Andrew Murray <andrew.murray at arm.com>
-Acked-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
----
- drivers/pci/controller/pci-aardvark.c | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
-
---- a/drivers/pci/controller/pci-aardvark.c
-+++ b/drivers/pci/controller/pci-aardvark.c
-@@ -175,7 +175,8 @@
- 	(PCIE_CONF_BUS(bus) | PCIE_CONF_DEV(PCI_SLOT(devfn))	| \
- 	 PCIE_CONF_FUNC(PCI_FUNC(devfn)) | PCIE_CONF_REG(where))
- 
--#define PIO_TIMEOUT_MS			1
-+#define PIO_RETRY_CNT			500
-+#define PIO_RETRY_DELAY			2 /* 2 us*/
- 
- #define LINK_WAIT_MAX_RETRIES		10
- #define LINK_WAIT_USLEEP_MIN		90000
-@@ -400,17 +401,16 @@ static void advk_pcie_check_pio_status(s
- static int advk_pcie_wait_pio(struct advk_pcie *pcie)
- {
- 	struct device *dev = &pcie->pdev->dev;
--	unsigned long timeout;
-+	int i;
- 
--	timeout = jiffies + msecs_to_jiffies(PIO_TIMEOUT_MS);
--
--	while (time_before(jiffies, timeout)) {
-+	for (i = 0; i < PIO_RETRY_CNT; i++) {
- 		u32 start, isr;
- 
- 		start = advk_readl(pcie, PIO_START);
- 		isr = advk_readl(pcie, PIO_ISR);
- 		if (!start && isr)
- 			return 0;
-+		udelay(PIO_RETRY_DELAY);
- 	}
- 
- 	dev_err(dev, "config read/write timed out\n");
diff --git a/target/linux/mvebu/patches-5.4/017-PCI-aardvark-Improve-link-training.patch b/target/linux/mvebu/patches-5.4/017-PCI-aardvark-Improve-link-training.patch
index 2bf838432f..19d0a5d513 100644
--- a/target/linux/mvebu/patches-5.4/017-PCI-aardvark-Improve-link-training.patch
+++ b/target/linux/mvebu/patches-5.4/017-PCI-aardvark-Improve-link-training.patch
@@ -193,7 +193,7 @@ Acked-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
  
  	reg = advk_readl(pcie, PCIE_CORE_CMD_STATUS_REG);
  	reg |= PCIE_CORE_CMD_MEM_ACCESS_EN |
-@@ -1035,6 +1093,12 @@ static int advk_pcie_probe(struct platfo
+@@ -1066,6 +1124,12 @@ static int advk_pcie_probe(struct platfo
  		return ret;
  	}
  
diff --git a/target/linux/mvebu/patches-5.4/018-PCI-aardvark-Issue-PERST-via-GPIO.patch b/target/linux/mvebu/patches-5.4/018-PCI-aardvark-Issue-PERST-via-GPIO.patch
index 83212ec475..0f2dab600b 100644
--- a/target/linux/mvebu/patches-5.4/018-PCI-aardvark-Issue-PERST-via-GPIO.patch
+++ b/target/linux/mvebu/patches-5.4/018-PCI-aardvark-Issue-PERST-via-GPIO.patch
@@ -98,7 +98,7 @@ Acked-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
  	 * fundamental reset. As required by PCI Express spec a delay for at
  	 * least 100ms after such a reset before link training is needed.
  	 */
-@@ -1093,6 +1118,22 @@ static int advk_pcie_probe(struct platfo
+@@ -1124,6 +1149,22 @@ static int advk_pcie_probe(struct platfo
  		return ret;
  	}
  
diff --git a/target/linux/mvebu/patches-5.4/019-PCI-aardvark-Add-PHY-support.patch b/target/linux/mvebu/patches-5.4/019-PCI-aardvark-Add-PHY-support.patch
index fa04861e80..640e4eb57c 100644
--- a/target/linux/mvebu/patches-5.4/019-PCI-aardvark-Add-PHY-support.patch
+++ b/target/linux/mvebu/patches-5.4/019-PCI-aardvark-Add-PHY-support.patch
@@ -76,7 +76,7 @@ Cc: Miqu?l Raynal <miquel.raynal at bootlin.com>
  	/* Set to Direct mode */
  	reg = advk_readl(pcie, CTRL_CONFIG_REG);
  	reg &= ~(CTRL_MODE_MASK << CTRL_MODE_SHIFT);
-@@ -1083,6 +1092,62 @@ out_release_res:
+@@ -1114,6 +1123,62 @@ out_release_res:
  	return err;
  }
  
@@ -139,7 +139,7 @@ Cc: Miqu?l Raynal <miquel.raynal at bootlin.com>
  static int advk_pcie_probe(struct platform_device *pdev)
  {
  	struct device *dev = &pdev->dev;
-@@ -1140,6 +1205,10 @@ static int advk_pcie_probe(struct platfo
+@@ -1171,6 +1236,10 @@ static int advk_pcie_probe(struct platfo
  	else
  		pcie->link_gen = ret;
  
diff --git a/target/linux/mvebu/patches-5.4/026-PCI-aardvark-Fix-initialization-with-old-Marvell-s-A.patch b/target/linux/mvebu/patches-5.4/026-PCI-aardvark-Fix-initialization-with-old-Marvell-s-A.patch
index bb9d7b7849..41fed6aded 100644
--- a/target/linux/mvebu/patches-5.4/026-PCI-aardvark-Fix-initialization-with-old-Marvell-s-A.patch
+++ b/target/linux/mvebu/patches-5.4/026-PCI-aardvark-Fix-initialization-with-old-Marvell-s-A.patch
@@ -31,7 +31,7 @@ Cc: <stable at vger.kernel.org> # 5.8+: ea17a0f153af: phy: marvell: comphy: Convert
 
 --- a/drivers/pci/controller/pci-aardvark.c
 +++ b/drivers/pci/controller/pci-aardvark.c
-@@ -1123,7 +1123,9 @@ static int advk_pcie_enable_phy(struct a
+@@ -1154,7 +1154,9 @@ static int advk_pcie_enable_phy(struct a
  	}
  
  	ret = phy_power_on(pcie->phy);
diff --git a/target/linux/octeontx/patches-5.4/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch b/target/linux/octeontx/patches-5.4/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch
index e33a28e953..c19e4cf90d 100644
--- a/target/linux/octeontx/patches-5.4/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch
+++ b/target/linux/octeontx/patches-5.4/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch
@@ -22,7 +22,7 @@ Signed-off-by: Tim Harvey <tharvey at gateworks.com>
  #include <linux/platform_data/x86/apple.h>
  #include <linux/pm_runtime.h>
  #include <linux/switchtec.h>
-@@ -5625,3 +5626,34 @@ static void apex_pci_fixup_class(struct
+@@ -5714,3 +5715,34 @@ static void apex_pci_fixup_class(struct
  }
  DECLARE_PCI_FIXUP_CLASS_HEADER(0x1ac1, 0x089a,
  			       PCI_CLASS_NOT_DEFINED, 8, apex_pci_fixup_class);


From lede-commits at lists.infradead.org  Sat Jun 26 21:11:13 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 27 Jun 2021 00:11:13 -0400
Subject: [openwrt/openwrt]  dante: move to packages.git
In-Reply-To: <162476707332.12680.11827628132096896208@git-01.infra.openwrt.org>
References: <162476707332.12680.11827628132096896208@git-01.infra.openwrt.org>
Message-ID: <mailman.3721.1624767080.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/adddfe57870d96532b7a6ad2e142a5150f69da36

commit adddfe57870d96532b7a6ad2e142a5150f69da36
Author: Paul Spooren <mail at aparcar.org>
AuthorDate: Wed Jun 23 11:58:51 2021 -1000

    dante: move to packages.git
    
    Rather than maintaining it in core, move it to packages.git where it's
    maintained by a community.
    
    Signed-off-by: Paul Spooren <mail at aparcar.org>
---
 package/network/utils/dante/Makefile               | 118 ---------------------
 .../utils/dante/patches/200-fix-RTLD_NEXT.patch    |  36 -------
 .../210-deactivate-sched_setscheduler.patch        |  53 ---------
 3 files changed, 207 deletions(-)

diff --git a/package/network/utils/dante/Makefile b/package/network/utils/dante/Makefile
deleted file mode 100644
index 15bd6d2afc..0000000000
--- a/package/network/utils/dante/Makefile
+++ /dev/null
@@ -1,118 +0,0 @@
-#
-# Copyright (C) 2011 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=dante
-PKG_VERSION:=1.4.1
-PKG_RELEASE:=4
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.inet.no/dante/files/
-PKG_HASH:=b6d232bd6fefc87d14bf97e447e4fcdeef4b28b16b048d804b50b48f261c4f53
-
-PKG_MAINTAINER:=Jo-Philipp Wich <jo at mein.io>
-PKG_LICENSE:=BSD-4-Clause
-
-PKG_FIXUP:=autoreconf
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-CONFIGURE_ARGS += \
-	--without-upnp \
-	--without-pam \
-	--disable-libwrap
-
-CONFIGURE_VARS += \
-	ac_cv_search_pam_start="" \
-	ac_cv_func_sched_setscheduler=no
-
-define Build/InstallDev
-	$(INSTALL_DIR) $(1)/usr/include
-	$(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/*.{a,so*,la} $(1)/usr/lib/
-endef
-
-
-define Package/dante/default
-  TITLE:=Dante SOCKS
-  URL:=http://www.inet.no/dante/
-endef
-
-define Package/dante/default/description
-Dante is a circuit-level firewall/proxy that can be used to provide convenient
-and secure network connectivity, requiring only that the server Dante runs on
-has external network connectivity. Dante is used daily by Fortune 100 companies
-and large international organizations, either as a standard SOCKS server or as
-a "reverse proxy".
-endef
-
-define Package/libsocks
-  $(call Package/dante/default)
-  SECTION:=libs
-  CATEGORY:=Libraries
-  TITLE+= Library
-  ABI_VERSION:=0
-endef
-
-define Package/libsocks/description
-$(call Package/dante/default/description)
-This package provides the shared libsocks library.
-endef
-
-define Package/libsocks/install
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsocks.so.* $(1)/usr/lib/
-endef
-
-
-define Package/sockd
-  $(call Package/dante/default)
-  SUBMENU:=Web Servers/Proxies
-  SECTION:=net
-  CATEGORY:=Network
-  TITLE+= Daemon
-endef
-
-define Package/sockd/description
-$(call Package/dante/default/description)
-This package provides the Dante sockd daemon.
-endef
-
-define Package/sockd/install
-	$(INSTALL_DIR) $(1)/usr/sbin
-	$(CP) $(PKG_INSTALL_DIR)/usr/sbin/sockd $(1)/usr/sbin/
-endef
-
-
-define Package/socksify
-  $(call Package/dante/default)
-  SECTION:=net
-  CATEGORY:=Network
-  SUBMENU:=Web Servers/Proxies
-  TITLE+= Client
-endef
-
-define Package/socksify/description
-$(call Package/dante/default/description)
-This package provides the Dante socksify client.
-endef
-
-define Package/socksify/install
-	$(INSTALL_DIR) $(1)/usr/bin
-	$(CP) $(PKG_INSTALL_DIR)/usr/bin/socksify $(1)/usr/bin/
-
-	$(INSTALL_DIR) $(1)/usr/lib
-	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libdsocks.so* $(1)/usr/lib/
-endef
-
-
-$(eval $(call BuildPackage,libsocks))
-$(eval $(call BuildPackage,sockd))
-$(eval $(call BuildPackage,socksify))
diff --git a/package/network/utils/dante/patches/200-fix-RTLD_NEXT.patch b/package/network/utils/dante/patches/200-fix-RTLD_NEXT.patch
deleted file mode 100644
index 594a6f900b..0000000000
--- a/package/network/utils/dante/patches/200-fix-RTLD_NEXT.patch
+++ /dev/null
@@ -1,36 +0,0 @@
---- a/lib/address.c
-+++ b/lib/address.c
-@@ -48,11 +48,12 @@
- 
- #include "upnp.h"
- 
--#ifndef __USE_GNU
--#define __USE_GNU /* XXX for RTLD_NEXT on Linux */
--#endif /* !__USE_GNU */
- #include <dlfcn.h>
- 
-+#ifndef RTLD_NEXT
-+#define RTLD_NEXT  ((void *) -1l)
-+#endif
-+
- static const char rcsid[] =
- "$Id: address.c,v 1.288.4.4 2014/08/15 18:16:40 karls Exp $";
- 
---- a/dlib/interposition.c
-+++ b/dlib/interposition.c
-@@ -93,11 +93,12 @@ write$NOCANCEL(HAVE_PROT_WRITE_1, HAVE_P
- 
- #endif /* HAVE_DARWIN */
- 
--#ifndef __USE_GNU
--#define __USE_GNU /* XXX for RTLD_NEXT on Linux */
--#endif /* !__USE_GNU */
- #include <dlfcn.h>
- 
-+#ifndef RTLD_NEXT
-+#define RTLD_NEXT  ((void *) -1l)
-+#endif
-+
- #ifdef __COVERITY__
- /*
-  * Coverity naturally has no idea what the function sys_foo calls does,
diff --git a/package/network/utils/dante/patches/210-deactivate-sched_setscheduler.patch b/package/network/utils/dante/patches/210-deactivate-sched_setscheduler.patch
deleted file mode 100644
index e711189c59..0000000000
--- a/package/network/utils/dante/patches/210-deactivate-sched_setscheduler.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-When compiled with glibc the config_scan.c wants to use the 
-cpupolicy2numeric() function which is only available when 
-HAVE_SCHED_SETSCHEDULER is set. It looks like the wrong define was used here.
-
-This fixes a build problem with glibc in combination with the force 
-ac_cv_func_sched_setscheduler=no in the OpenWrt CONFIGURE_VARS.
-
---- a/lib/config_scan.c
-+++ b/lib/config_scan.c
-@@ -3891,7 +3891,7 @@ YY_RULE_SETUP
-    SERRX(0);
- 
- #else /* !SOCKS_CLIENT */
--#if HAVE_SCHED_SETAFFINITY
-+#if HAVE_SCHED_SETSCHEDULER
- 
-    BEGIN(0);
- 
-@@ -3899,9 +3899,9 @@ YY_RULE_SETUP
-       yyerrorx("unknown scheduling policy \"%s\"", yytext);
- 
-    return SCHEDULEPOLICY;
--#else /* !HAVE_SCHED_SETAFFINITY */
-+#else /* !HAVE_SCHED_SETSCHEDULER */
-    yyerrorx("setting cpu scheduling policy is not supported on this platform");
--#endif /* !HAVE_SCHED_SETAFFINITY */
-+#endif /* !HAVE_SCHED_SETSCHEDULER */
- 
- #endif /* SOCKS_CLIENT */
- }
---- a/lib/config_scan.l
-+++ b/lib/config_scan.l
-@@ -456,7 +456,7 @@ cpu {
-    SERRX(0);
- 
- #else /* !SOCKS_CLIENT */
--#if HAVE_SCHED_SETAFFINITY
-+#if HAVE_SCHED_SETSCHEDULER
- 
-    BEGIN(0);
- 
-@@ -464,9 +464,9 @@ cpu {
-       yyerrorx("unknown scheduling policy \"%s\"", yytext);
- 
-    return SCHEDULEPOLICY;
--#else /* !HAVE_SCHED_SETAFFINITY */
-+#else /* !HAVE_SCHED_SETSCHEDULER */
-    yyerrorx("setting cpu scheduling policy is not supported on this platform");
--#endif /* !HAVE_SCHED_SETAFFINITY */
-+#endif /* !HAVE_SCHED_SETSCHEDULER */
- 
- #endif /* SOCKS_CLIENT */
- }


From lede-commits at lists.infradead.org  Sun Jun 27 04:19:33 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 27 Jun 2021 07:19:33 -0400
Subject: [openwrt/openwrt]  ramips: fix AR8033 fiber operation
In-Reply-To: <162479277265.24681.6672587952734607208@git-01.infra.openwrt.org>
References: <162479277265.24681.6672587952734607208@git-01.infra.openwrt.org>
Message-ID: <mailman.3740.1624792776.1072.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/54ed38d5eab4d28cf52e3cf4928f0d2cc3eb7c8e

commit 54ed38d5eab4d28cf52e3cf4928f0d2cc3eb7c8e
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Tue Jun 15 00:15:17 2021 +0200

    ramips: fix AR8033 fiber operation
    
    It was reported AR8033 did not work in fiber operation mode on the ER-X.
    
    While the earlier attempt of fixing this mitigated the issue of 1000
    Base-X link mode not being supported, it also switched to the copper
    page, breaking fiber operation altogether.
    
    Extend the hack adding fiber operation so it does not switch to the
    copper page. Also remove the part where the supported link mode bit for
    1000 Base-X is removed, as this is required for fiber operation.
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 target/linux/ramips/patches-5.10/710-at803x.patch | 38 ++++++++++++++++++++--
 target/linux/ramips/patches-5.4/991-at803x.patch  | 39 ++++++++++++++++++++---
 2 files changed, 70 insertions(+), 7 deletions(-)

diff --git a/target/linux/ramips/patches-5.10/710-at803x.patch b/target/linux/ramips/patches-5.10/710-at803x.patch
index d15dd92965..ec8f3ba55f 100644
--- a/target/linux/ramips/patches-5.10/710-at803x.patch
+++ b/target/linux/ramips/patches-5.10/710-at803x.patch
@@ -118,7 +118,23 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
  	if (!priv)
  		return -ENOMEM;
-@@ -744,6 +818,10 @@ static int at803x_read_status(struct phy
+@@ -554,6 +628,7 @@ static int at803x_probe(struct phy_devic
+ 			return ret;
+ 	}
+ 
++#if 0
+ 	/* Some bootloaders leave the fiber page selected.
+ 	 * Switch to the copper page, as otherwise we read
+ 	 * the PHY capabilities from the fiber side.
+@@ -565,6 +640,7 @@ static int at803x_probe(struct phy_devic
+ 		if (ret)
+ 			goto err;
+ 	}
++#endif
+ 
+ 	return 0;
+ 
+@@ -744,6 +820,10 @@ static int at803x_read_status(struct phy
  {
  	int ss, err, old_link = phydev->link;
  
@@ -129,7 +145,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  	/* Update the link, but return if there was an error */
  	err = genphy_update_link(phydev);
  	if (err)
-@@ -844,6 +922,12 @@ static int at803x_config_aneg(struct phy
+@@ -844,6 +924,12 @@ static int at803x_config_aneg(struct phy
  {
  	int ret;
  
@@ -142,7 +158,23 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  	ret = at803x_config_mdix(phydev, phydev->mdix_ctrl);
  	if (ret < 0)
  		return ret;
-@@ -1145,6 +1229,7 @@ static struct phy_driver at803x_driver[]
+@@ -943,6 +1029,7 @@ static int at803x_get_features(struct ph
+ 	if (err)
+ 		return err;
+ 
++#if 0
+ 	if (!at803x_match_phy_id(phydev, ATH8031_PHY_ID))
+ 		return 0;
+ 
+@@ -960,6 +1047,7 @@ static int at803x_get_features(struct ph
+ 	 */
+ 	linkmode_clear_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT,
+ 			   phydev->supported);
++#endif
+ 	return 0;
+ }
+ 
+@@ -1173,6 +1261,7 @@ static struct phy_driver at803x_driver[]
  	/* Qualcomm Atheros AR8031/AR8033 */
  	PHY_ID_MATCH_EXACT(ATH8031_PHY_ID),
  	.name			= "Qualcomm Atheros AR8031/AR8033",
diff --git a/target/linux/ramips/patches-5.4/991-at803x.patch b/target/linux/ramips/patches-5.4/991-at803x.patch
index 4de3118547..a0d9a03fcf 100644
--- a/target/linux/ramips/patches-5.4/991-at803x.patch
+++ b/target/linux/ramips/patches-5.4/991-at803x.patch
@@ -42,7 +42,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  
  #define AT803X_DEBUG_REG_0			0x00
  #define AT803X_DEBUG_RX_CLK_DLY_EN		BIT(15)
-@@ -274,12 +285,73 @@ static int at803x_resume(struct phy_devi
+@@ -274,18 +285,80 @@ static int at803x_resume(struct phy_devi
  	return phy_modify(phydev, MII_BMCR, BMCR_PDOWN | BMCR_ISOLATE, 0);
  }
  
@@ -116,7 +116,38 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
  	if (!priv)
  		return -ENOMEM;
-@@ -415,6 +487,10 @@ static int at803x_read_status(struct phy
+ 
+ 	phydev->priv = priv;
+ 
++#if 0
+ 	/* Some bootloaders leave the fiber page selected.
+ 	 * Switch to the copper page, as otherwise we read
+ 	 * the PHY capabilities from the fiber side.
+@@ -295,6 +368,7 @@ static int at803x_probe(struct phy_devic
+ 		ret = at803x_write_page(phydev, AT803X_PAGE_COPPER);
+ 		mutex_unlock(&phydev->mdio.bus->mdio_lock);
+ 	}
++#endif
+ 
+ 	return ret;
+ }
+@@ -419,6 +493,7 @@ static int at803x_get_features(struct ph
+ 	if (err)
+ 		return err;
+ 
++#if 0
+ 	if (!(phydev->phy_id & phydev->drv->phy_id_mask) == (ATH8031_PHY_ID & phydev->drv->phy_id_mask))
+ 		return 0;
+ 
+@@ -436,6 +511,7 @@ static int at803x_get_features(struct ph
+ 	 */
+ 	linkmode_clear_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT,
+ 			   phydev->supported);
++#endif
+ 	return 0;
+ }
+ 
+@@ -443,6 +519,10 @@ static int at803x_read_status(struct phy
  {
  	int ss, err, old_link = phydev->link;
  
@@ -127,7 +158,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  	/* Update the link, but return if there was an error */
  	err = genphy_update_link(phydev);
  	if (err)
-@@ -469,6 +545,19 @@ static int at803x_read_status(struct phy
+@@ -497,6 +577,19 @@ static int at803x_read_status(struct phy
  	return 0;
  }
  
@@ -147,7 +178,7 @@ Signed-off-by: Ren? van Dorst <opensource at vdorst.com>
  static struct phy_driver at803x_driver[] = {
  {
  	/* ATHEROS 8035 */
-@@ -504,6 +593,7 @@ static struct phy_driver at803x_driver[]
+@@ -532,6 +625,7 @@ static struct phy_driver at803x_driver[]
  	/* ATHEROS 8031 */
  	.phy_id			= ATH8031_PHY_ID,
  	.name			= "Atheros 8031 ethernet",


From lede-commits at lists.infradead.org  Sun Jun 27 04:19:32 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 27 Jun 2021 07:19:32 -0400
Subject: [openwrt/openwrt]  generic: at803x: mask 1000 Base-X link mode
In-Reply-To: <162479277265.24681.6672587952734607208@git-01.infra.openwrt.org>
References: <162479277265.24681.6672587952734607208@git-01.infra.openwrt.org>
Message-ID: <mailman.3741.1624792776.1072.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/1f5afbab5bbd33c5eff607a26699f64d3f4c11b1

commit 1f5afbab5bbd33c5eff607a26699f64d3f4c11b1
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Mon Jun 14 23:53:38 2021 +0200

    generic: at803x: mask 1000 Base-X link mode
    
    AR8031/AR8033 have different status registers for copper
    and fiber operation. However, the extended status register
    is the same for both operation modes.
    
    As a result of that, ESTATUS_1000_XFULL is set to 1 even when
    operating in copper TP mode.
    
    Remove this mode from the supported link modes, as this driver
    currently only supports copper operation.
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 .../730-net-phy-at803x-fix-feature-detection.patch | 66 ++++++++++++++++++++++
 .../730-net-phy-at803x-fix-feature-detection.patch | 66 ++++++++++++++++++++++
 2 files changed, 132 insertions(+)

diff --git a/target/linux/generic/pending-5.10/730-net-phy-at803x-fix-feature-detection.patch b/target/linux/generic/pending-5.10/730-net-phy-at803x-fix-feature-detection.patch
new file mode 100644
index 0000000000..1d4783e382
--- /dev/null
+++ b/target/linux/generic/pending-5.10/730-net-phy-at803x-fix-feature-detection.patch
@@ -0,0 +1,66 @@
+From 97ca310aa18a93329ef5cd68c20de89761962f45 Mon Sep 17 00:00:00 2001
+From: David Bauer <mail at david-bauer.net>
+Date: Sun, 13 Jun 2021 12:19:36 +0200
+Subject: [PATCH] net: phy: at803x: fix feature detection
+
+AR8031/AR8033 have different status registers for copper
+and fiber operation. However, the extended status register
+is the same for both operation modes.
+
+As a result of that, ESTATUS_1000_XFULL is set to 1 even when
+operating in copper TP mode.
+
+Remove this mode from the supported link modes, as this driver
+currently only supports copper operation.
+
+Signed-off-by: David Bauer <mail at david-bauer.net>
+---
+ drivers/net/phy/at803x.c | 30 +++++++++++++++++++++++++++++-
+ 1 file changed, 29 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/phy/at803x.c
++++ b/drivers/net/phy/at803x.c
+@@ -935,6 +935,34 @@ static int at803x_set_tunable(struct phy
+ 	}
+ }
+ 
++static int at803x_get_features(struct phy_device *phydev)
++{
++	int err;
++
++	err = genphy_read_abilities(phydev);
++	if (err)
++		return err;
++
++	if (!at803x_match_phy_id(phydev, ATH8031_PHY_ID))
++		return 0;
++
++	/* AR8031/AR8033 have different status registers
++	 * for copper and fiber operation. However, the
++	 * extended status register is the same for both
++	 * operation modes.
++	 *
++	 * As a result of that, ESTATUS_1000_XFULL is set
++	 * to 1 even when operating in copper TP mode.
++	 *
++	 * Remove this mode from the supported link modes,
++	 * as this driver currently only supports copper
++	 * operation.
++	 */
++	linkmode_clear_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT,
++			   phydev->supported);
++	return 0;
++}
++
+ static int at803x_cable_test_result_trans(u16 status)
+ {
+ 	switch (FIELD_GET(AT803X_CDT_STATUS_STAT_MASK, status)) {
+@@ -1156,7 +1184,7 @@ static struct phy_driver at803x_driver[]
+ 	.resume			= at803x_resume,
+ 	.read_page		= at803x_read_page,
+ 	.write_page		= at803x_write_page,
+-	/* PHY_GBIT_FEATURES */
++	.get_features		= at803x_get_features,
+ 	.read_status		= at803x_read_status,
+ 	.aneg_done		= at803x_aneg_done,
+ 	.ack_interrupt		= &at803x_ack_interrupt,
diff --git a/target/linux/generic/pending-5.4/730-net-phy-at803x-fix-feature-detection.patch b/target/linux/generic/pending-5.4/730-net-phy-at803x-fix-feature-detection.patch
new file mode 100644
index 0000000000..f25952a2cc
--- /dev/null
+++ b/target/linux/generic/pending-5.4/730-net-phy-at803x-fix-feature-detection.patch
@@ -0,0 +1,66 @@
+From 97ca310aa18a93329ef5cd68c20de89761962f45 Mon Sep 17 00:00:00 2001
+From: David Bauer <mail at david-bauer.net>
+Date: Sun, 13 Jun 2021 12:19:36 +0200
+Subject: [PATCH] net: phy: at803x: fix feature detection
+
+AR8031/AR8033 have different status registers for copper
+and fiber operation. However, the extended status register
+is the same for both operation modes.
+
+As a result of that, ESTATUS_1000_XFULL is set to 1 even when
+operating in copper TP mode.
+
+Remove this mode from the supported link modes, as this driver
+currently only supports copper operation.
+
+Signed-off-by: David Bauer <mail at david-bauer.net>
+---
+ drivers/net/phy/at803x.c | 30 +++++++++++++++++++++++++++++-
+ 1 file changed, 29 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/phy/at803x.c
++++ b/drivers/net/phy/at803x.c
+@@ -411,6 +411,34 @@ static int at803x_aneg_done(struct phy_d
+ 	return aneg_done;
+ }
+ 
++static int at803x_get_features(struct phy_device *phydev)
++{
++	int err;
++
++	err = genphy_read_abilities(phydev);
++	if (err)
++		return err;
++
++	if (!(phydev->phy_id & phydev->drv->phy_id_mask) == (ATH8031_PHY_ID & phydev->drv->phy_id_mask))
++		return 0;
++
++	/* AR8031/AR8033 have different status registers
++	 * for copper and fiber operation. However, the
++	 * extended status register is the same for both
++	 * operation modes.
++	 *
++	 * As a result of that, ESTATUS_1000_XFULL is set
++	 * to 1 even when operating in copper TP mode.
++	 *
++	 * Remove this mode from the supported link modes,
++	 * as this driver currently only supports copper
++	 * operation.
++	 */
++	linkmode_clear_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT,
++			   phydev->supported);
++	return 0;
++}
++
+ static int at803x_read_status(struct phy_device *phydev)
+ {
+ 	int ss, err, old_link = phydev->link;
+@@ -513,7 +541,7 @@ static struct phy_driver at803x_driver[]
+ 	.resume			= at803x_resume,
+ 	.read_page		= at803x_read_page,
+ 	.write_page		= at803x_write_page,
+-	/* PHY_GBIT_FEATURES */
++	.get_features		= at803x_get_features,
+ 	.read_status		= at803x_read_status,
+ 	.aneg_done		= at803x_aneg_done,
+ 	.ack_interrupt		= &at803x_ack_interrupt,


From lede-commits at lists.infradead.org  Sun Jun 27 06:34:24 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 27 Jun 2021 09:34:24 -0400
Subject: [openwrt/openwrt]  glibc: update to latest 2.33 HEAD (BZ #27646,
 bug 27896, BZ #15271)
In-Reply-To: <162480086422.31764.11557217723903909996@git-01.infra.openwrt.org>
References: <162480086422.31764.11557217723903909996@git-01.infra.openwrt.org>
Message-ID: <mailman.3745.1624800871.1072.lede-commits@lists.infradead.org>

dedeckeh pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/f033d5ad1c28e07eb6de2ce3ea8650dc7080d6d0

commit f033d5ad1c28e07eb6de2ce3ea8650dc7080d6d0
Author: Hans Dedecker <dedeckeh at gmail.com>
AuthorDate: Sun Jun 27 15:29:25 2021 +0200

    glibc: update to latest 2.33 HEAD (BZ #27646, bug 27896, BZ #15271)
    
    58b90461ae elf: Use _dl_catch_error from base namespace in dl-libc.c [BZ #27646]
    8c06748c51 Fix use of __pthread_attr_copy in mq_notify (bug 27896)
    4b6be914bd Use __pthread_attr_copy in mq_notify (bug 27896)
    f4cba6ca1e dlfcn: Failures after dlmopen should not terminate process [BZ #15271]
    
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 toolchain/glibc/common.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/toolchain/glibc/common.mk b/toolchain/glibc/common.mk
index b88a456ce7..ec0621494f 100644
--- a/toolchain/glibc/common.mk
+++ b/toolchain/glibc/common.mk
@@ -12,8 +12,8 @@ PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=0ef0e6de7fdfa18328b09ba2afb4f0112d4bdab4
-PKG_MIRROR_HASH:=1f2cfa8bd69f6286f2449317758e3ef29fc55cd420dfe8cd9327f149b0e9ac62
+PKG_SOURCE_VERSION:=58b90461ae100c95e0bc53d29d2187bad290ecaf
+PKG_MIRROR_HASH:=33fc6ec88cbf9235b151bea67db8922ef6f42dd5c1f4ff462077224fa3916be4
 PKG_SOURCE_URL:=https://sourceware.org/git/glibc.git
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
 


From lede-commits at lists.infradead.org  Sun Jun 27 12:29:50 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 27 Jun 2021 15:29:50 -0400
Subject: [openwrt/openwrt]  iwinfo: update to latest Git HEAD
In-Reply-To: <162482218933.20098.12553236079414963191@git-01.infra.openwrt.org>
References: <162482218933.20098.12553236079414963191@git-01.infra.openwrt.org>
Message-ID: <mailman.3759.1624822193.1072.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/e16a45f258a42bf36c05a182f9396d321e0c12a9

commit e16a45f258a42bf36c05a182f9396d321e0c12a9
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Sun May 2 00:22:56 2021 +0200

    iwinfo: update to latest Git HEAD
    
    c45f0b5 iwinfo: add 802.11ax HE rate information
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
    (cherry picked from commit 5515c29029ce7c63b48d1af0cbb3fbdc14ca033b)
---
 package/network/utils/iwinfo/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile
index 0f63aca0d9..d8c1befc97 100644
--- a/package/network/utils/iwinfo/Makefile
+++ b/package/network/utils/iwinfo/Makefile
@@ -11,9 +11,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git
-PKG_SOURCE_DATE:=2021-04-20
-PKG_SOURCE_VERSION:=cd23727f72b7859ba572c4e273247578c2124926
-PKG_MIRROR_HASH:=a43516e3502274e0ba64348481364158996ddb0019c35c9dcd2d5a257de67e98
+PKG_SOURCE_DATE:=2021-04-30
+PKG_SOURCE_VERSION:=c45f0b584b4b86f8250f90ea19afca271c114fa2
+PKG_MIRROR_HASH:=24ad04791254a0523cd15a4fec6116d9ff121e006c93e5e41459f91347b33ec2
 PKG_MAINTAINER:=Jo-Philipp Wich <jo at mein.io>
 PKG_LICENSE:=GPL-2.0
 
@@ -25,7 +25,7 @@ PKG_CONFIG_DEPENDS := \
 	CONFIG_PACKAGE_kmod-brcm-wl-mimo \
 	CONFIG_PACKAGE_kmod-cfg80211
 
-IWINFO_ABI_VERSION:=20210420
+IWINFO_ABI_VERSION:=20210430
 
 include $(INCLUDE_DIR)/package.mk
 


From lede-commits at lists.infradead.org  Sun Jun 27 12:29:49 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 27 Jun 2021 15:29:49 -0400
Subject: [openwrt/openwrt]  iwinfo: update to latest Git HEAD
In-Reply-To: <162482218933.20098.12553236079414963191@git-01.infra.openwrt.org>
References: <162482218933.20098.12553236079414963191@git-01.infra.openwrt.org>
Message-ID: <mailman.3760.1624822193.1072.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/0c51b265bf881834228a60baa6eaa283135172f1

commit 0c51b265bf881834228a60baa6eaa283135172f1
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Tue Apr 13 00:13:33 2021 +0200

    iwinfo: update to latest Git HEAD
    
    50b64a6 iwinfo: add basic IEEE 802.11ax support
    70d2136 iwinfo: nl80211: perform split wiphy dump
    cd23727 iwinfo: cli: fix hwmode formatting
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
    (cherry picked from commit 6f77ce77248d6458414efafd64c72d653fc70bb8)
---
 package/network/utils/iwinfo/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile
index 3454d615a9..0f63aca0d9 100644
--- a/package/network/utils/iwinfo/Makefile
+++ b/package/network/utils/iwinfo/Makefile
@@ -11,9 +11,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git
-PKG_SOURCE_DATE:=2021-01-31
-PKG_SOURCE_VERSION:=4a32b33e9606f1bc1125f4bc24b0581349e55f2e
-PKG_MIRROR_HASH:=414e5d150efaadba21103e66f862be66a94dcf83c16a2850f7c05051a9b0739d
+PKG_SOURCE_DATE:=2021-04-20
+PKG_SOURCE_VERSION:=cd23727f72b7859ba572c4e273247578c2124926
+PKG_MIRROR_HASH:=a43516e3502274e0ba64348481364158996ddb0019c35c9dcd2d5a257de67e98
 PKG_MAINTAINER:=Jo-Philipp Wich <jo at mein.io>
 PKG_LICENSE:=GPL-2.0
 
@@ -25,7 +25,7 @@ PKG_CONFIG_DEPENDS := \
 	CONFIG_PACKAGE_kmod-brcm-wl-mimo \
 	CONFIG_PACKAGE_kmod-cfg80211
 
-IWINFO_ABI_VERSION:=20210106
+IWINFO_ABI_VERSION:=20210420
 
 include $(INCLUDE_DIR)/package.mk
 


From lede-commits at lists.infradead.org  Sun Jun 27 12:41:34 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 27 Jun 2021 15:41:34 -0400
Subject: [openwrt/openwrt]  ramips: add AW9523 I2C GPIO expander driver
In-Reply-To: <162482289410.26295.8179285586322845632@git-01.infra.openwrt.org>
References: <162482289410.26295.8179285586322845632@git-01.infra.openwrt.org>
Message-ID: <mailman.3761.1624822901.1072.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/38db2f12d6bd7337fe79d9d1b207e8bd593fc3b5

commit 38db2f12d6bd7337fe79d9d1b207e8bd593fc3b5
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Fri May 7 00:35:16 2021 +0200

    ramips: add AW9523 I2C GPIO expander driver
    
    This adds a driver for the AW9523 I2C GPIO expander.
    
    This driver is required to make LEDs as well as buttons on the Tenbay
    T-MB5EU-V01 work.
    
    This driver already had several upstream iterations. I'm working to
    push this driver to mainline.
    
    Ref: https://patchwork.ozlabs.org/project/linux-gpio/list/?series=226287
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 .../ramips/files/drivers/pinctrl/pinctrl-aw9523.c  | 1135 ++++++++++++++++++++
 target/linux/ramips/mt7620/config-5.10             |    1 +
 target/linux/ramips/mt7620/config-5.4              |    1 +
 target/linux/ramips/mt7621/config-5.10             |    1 +
 target/linux/ramips/mt7621/config-5.4              |    1 +
 target/linux/ramips/mt76x8/config-5.10             |    1 +
 target/linux/ramips/mt76x8/config-5.4              |    1 +
 .../ramips/patches-5.10/805-pinctrl-AW9523.patch   |   72 ++
 .../ramips/patches-5.4/805-pinctrl-AW9523.patch    |   72 ++
 target/linux/ramips/rt288x/config-5.10             |    1 +
 target/linux/ramips/rt288x/config-5.4              |    1 +
 target/linux/ramips/rt305x/config-5.10             |    1 +
 target/linux/ramips/rt305x/config-5.4              |    1 +
 target/linux/ramips/rt3883/config-5.10             |    1 +
 target/linux/ramips/rt3883/config-5.4              |    1 +
 15 files changed, 1291 insertions(+)

diff --git a/target/linux/ramips/files/drivers/pinctrl/pinctrl-aw9523.c b/target/linux/ramips/files/drivers/pinctrl/pinctrl-aw9523.c
new file mode 100644
index 0000000000..182e11cdc6
--- /dev/null
+++ b/target/linux/ramips/files/drivers/pinctrl/pinctrl-aw9523.c
@@ -0,0 +1,1135 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Awinic AW9523B i2c pin controller driver
+ * Copyright (c) 2020, AngeloGioacchino Del Regno
+ *                     <angelogioacchino.delregno at somainline.org>
+ */
+
+#include <linux/bitfield.h>
+#include <linux/regmap.h>
+#include <linux/i2c.h>
+#include <linux/init.h>
+#include <linux/interrupt.h>
+#include <linux/irq.h>
+#include <linux/mutex.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
+#include <linux/version.h>
+#include <linux/gpio/consumer.h>
+#include <linux/gpio/driver.h>
+#include <linux/pinctrl/pinconf.h>
+#include <linux/pinctrl/pinctrl.h>
+#include <linux/pinctrl/pinmux.h>
+#include <linux/pinctrl/pinconf-generic.h>
+#include <linux/regulator/consumer.h>
+
+#include "core.h"
+#include "pinconf.h"
+#include "pinctrl-utils.h"
+
+#define AW9523_MAX_FUNCS		2
+#define AW9523_NUM_PORTS		2
+#define AW9523_PINS_PER_PORT		8
+
+/*
+ * HW needs at least 20uS for reset and at least 1-2uS to recover from
+ * reset, but we have to account for eventual board quirks, if any:
+ * for this reason, keep reset asserted for 50uS and wait for 20uS
+ * to recover from the reset.
+ */
+#define AW9523_HW_RESET_US		50
+#define AW9523_HW_RESET_RECOVERY_US	20
+
+/* Port 0: P0_0...P0_7 - Port 1: P1_0...P1_7 */
+#define AW9523_PIN_TO_PORT(pin)		(pin >> 3)
+#define AW9523_REG_IN_STATE(pin)	(0x00 + AW9523_PIN_TO_PORT(pin))
+#define AW9523_REG_OUT_STATE(pin)	(0x02 + AW9523_PIN_TO_PORT(pin))
+#define AW9523_REG_CONF_STATE(pin)	(0x04 + AW9523_PIN_TO_PORT(pin))
+#define AW9523_REG_INTR_DIS(pin)	(0x06 + AW9523_PIN_TO_PORT(pin))
+#define AW9523_REG_CHIPID		0x10
+#define AW9523_VAL_EXPECTED_CHIPID	0x23
+
+#define AW9523_REG_GCR			0x11
+#define AW9523_GCR_ISEL_MASK		GENMASK(0, 1)
+#define AW9523_GCR_GPOMD_MASK		BIT(4)
+
+#define AW9523_REG_PORT_MODE(pin)	(0x12 + AW9523_PIN_TO_PORT(pin))
+#define AW9523_REG_SOFT_RESET		0x7f
+#define AW9523_VAL_RESET		0x00
+
+/*
+ * struct aw9523_irq - Interrupt controller structure
+ * @lock: mutex locking for the irq bus
+ * @irqchip: structure holding irqchip params
+ * @cached_gpio: stores the previous gpio status for bit comparison
+ */
+struct aw9523_irq {
+	struct mutex lock;
+	struct irq_chip *irqchip;
+	u16 cached_gpio;
+};
+
+/*
+ * struct aw9523_pinmux - Pin mux params
+ * @name: Name of the mux
+ * @grps: Groups of the mux
+ * @num_grps: Number of groups (sizeof array grps)
+ */
+struct aw9523_pinmux {
+	const char *name;
+	const char * const *grps;
+	const u8 num_grps;
+};
+
+/*
+ * struct aw9523 - Main driver structure
+ * @dev: device handle
+ * @regmap: regmap handle for current device
+ * @i2c_lock: Mutex lock for i2c operations
+ * @reset_gpio: Hardware reset (RSTN) signal GPIO
+ * @vio_vreg: VCC regulator (Optional)
+ * @pctl: pinctrl handle for current device
+ * @gpio: structure holding gpiochip params
+ * @irq: Interrupt controller structure
+ */
+struct aw9523 {
+	struct device *dev;
+	struct regmap *regmap;
+	struct mutex i2c_lock;
+	struct gpio_desc *reset_gpio;
+	struct regulator *vio_vreg;
+	struct pinctrl_dev *pctl;
+	struct gpio_chip gpio;
+	struct aw9523_irq *irq;
+};
+
+static const struct pinctrl_pin_desc aw9523_pins[] = {
+	/* Port 0 */
+	PINCTRL_PIN(0, "gpio0"),
+	PINCTRL_PIN(1, "gpio1"),
+	PINCTRL_PIN(2, "gpio2"),
+	PINCTRL_PIN(3, "gpio3"),
+	PINCTRL_PIN(4, "gpio4"),
+	PINCTRL_PIN(5, "gpio5"),
+	PINCTRL_PIN(6, "gpio6"),
+	PINCTRL_PIN(7, "gpio7"),
+
+	/* Port 1 */
+	PINCTRL_PIN(8, "gpio8"),
+	PINCTRL_PIN(9, "gpio9"),
+	PINCTRL_PIN(10, "gpio10"),
+	PINCTRL_PIN(11, "gpio11"),
+	PINCTRL_PIN(12, "gpio12"),
+	PINCTRL_PIN(13, "gpio13"),
+	PINCTRL_PIN(14, "gpio14"),
+	PINCTRL_PIN(15, "gpio15"),
+};
+
+static int aw9523_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
+{
+	return ARRAY_SIZE(aw9523_pins);
+}
+
+static const char *aw9523_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
+						 unsigned int selector)
+{
+	return aw9523_pins[selector].name;
+}
+
+static int aw9523_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
+					 unsigned int selector,
+					 const unsigned int **pins,
+					 unsigned int *num_pins)
+{
+	*pins = &aw9523_pins[selector].number;
+	*num_pins = 1;
+	return 0;
+}
+
+static const struct pinctrl_ops aw9523_pinctrl_ops = {
+	.get_groups_count = aw9523_pinctrl_get_groups_count,
+	.get_group_pins = aw9523_pinctrl_get_group_pins,
+	.get_group_name = aw9523_pinctrl_get_group_name,
+	.dt_node_to_map = pinconf_generic_dt_node_to_map_pin,
+	.dt_free_map = pinconf_generic_dt_free_map,
+};
+
+static const char * const gpio_pwm_groups[] = {
+	"gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5",
+	"gpio6", "gpio7", "gpio8", "gpio9", "gpio10", "gpio11",
+	"gpio12", "gpio13", "gpio14", "gpio15"
+};
+
+/* Warning: Do NOT reorder this array */
+static const struct aw9523_pinmux aw9523_pmx[] = {
+	{
+		.name = "pwm",
+		.grps = gpio_pwm_groups,
+		.num_grps = ARRAY_SIZE(gpio_pwm_groups),
+	},
+	{
+		.name = "gpio",
+		.grps = gpio_pwm_groups,
+		.num_grps = ARRAY_SIZE(gpio_pwm_groups),
+	},
+};
+
+static int aw9523_pmx_get_funcs_count(struct pinctrl_dev *pctl)
+{
+	return ARRAY_SIZE(aw9523_pmx);
+}
+
+static const char *aw9523_pmx_get_fname(struct pinctrl_dev *pctl,
+					unsigned int sel)
+{
+	return aw9523_pmx[sel].name;
+}
+
+static int aw9523_pmx_get_groups(struct pinctrl_dev *pctl, unsigned int sel,
+				 const char * const **groups,
+				 unsigned int * const num_groups)
+{
+	*groups = aw9523_pmx[sel].grps;
+	*num_groups = aw9523_pmx[sel].num_grps;
+	return 0;
+}
+
+static int aw9523_pmx_set_mux(struct pinctrl_dev *pctl, unsigned int fsel,
+			      unsigned int grp)
+{
+	struct aw9523 *awi = pinctrl_dev_get_drvdata(pctl);
+	int ret, pin = aw9523_pins[grp].number % AW9523_PINS_PER_PORT;
+
+	if (fsel >= ARRAY_SIZE(aw9523_pmx))
+		return -EINVAL;
+
+	/*
+	 * This maps directly to the aw9523_pmx array: programming a
+	 * high bit means "gpio" and a low bit means "pwm".
+	 */
+	mutex_lock(&awi->i2c_lock);
+	ret = regmap_update_bits(awi->regmap, AW9523_REG_PORT_MODE(pin),
+				 BIT(pin), (fsel ? BIT(pin) : 0));
+	mutex_unlock(&awi->i2c_lock);
+	return ret;
+}
+
+static const struct pinmux_ops aw9523_pinmux_ops = {
+	.get_functions_count	= aw9523_pmx_get_funcs_count,
+	.get_function_name	= aw9523_pmx_get_fname,
+	.get_function_groups	= aw9523_pmx_get_groups,
+	.set_mux		= aw9523_pmx_set_mux,
+};
+
+static int aw9523_pcfg_param_to_reg(enum pin_config_param pcp, int pin, u8 *r)
+{
+	u8 reg;
+
+	switch (pcp) {
+	case PIN_CONFIG_BIAS_PULL_PIN_DEFAULT:
+	case PIN_CONFIG_BIAS_PULL_DOWN:
+	case PIN_CONFIG_BIAS_PULL_UP:
+		reg = AW9523_REG_IN_STATE(pin);
+		break;
+	case PIN_CONFIG_DRIVE_OPEN_DRAIN:
+	case PIN_CONFIG_DRIVE_PUSH_PULL:
+		reg = AW9523_REG_GCR;
+		break;
+	case PIN_CONFIG_INPUT_ENABLE:
+	case PIN_CONFIG_OUTPUT_ENABLE:
+		reg = AW9523_REG_CONF_STATE(pin);
+		break;
+	case PIN_CONFIG_OUTPUT:
+		reg = AW9523_REG_OUT_STATE(pin);
+		break;
+	default:
+		return -ENOTSUPP;
+	}
+	*r = reg;
+
+	return 0;
+}
+
+static int aw9523_pconf_get(struct pinctrl_dev *pctldev, unsigned int pin,
+			    unsigned long *config)
+{
+	struct aw9523 *awi = pinctrl_dev_get_drvdata(pctldev);
+	enum pin_config_param param = pinconf_to_config_param(*config);
+	int regbit = pin % AW9523_PINS_PER_PORT;
+	unsigned int val;
+	u8 reg;
+	int rc;
+
+	rc = aw9523_pcfg_param_to_reg(param, pin, &reg);
+	if (rc)
+		return rc;
+
+	mutex_lock(&awi->i2c_lock);
+	rc = regmap_read(awi->regmap, reg, &val);
+	mutex_unlock(&awi->i2c_lock);
+	if (rc)
+		return rc;
+
+	switch (param) {
+	case PIN_CONFIG_BIAS_PULL_UP:
+	case PIN_CONFIG_INPUT_ENABLE:
+	case PIN_CONFIG_OUTPUT:
+		val &= BIT(regbit);
+		break;
+	case PIN_CONFIG_BIAS_PULL_DOWN:
+	case PIN_CONFIG_OUTPUT_ENABLE:
+		val &= BIT(regbit);
+		val = !val;
+		break;
+	case PIN_CONFIG_DRIVE_OPEN_DRAIN:
+		if (pin >= AW9523_PINS_PER_PORT)
+			val = 0;
+		else
+			val = !FIELD_GET(AW9523_GCR_GPOMD_MASK, val);
+		break;
+	case PIN_CONFIG_DRIVE_PUSH_PULL:
+		if (pin >= AW9523_PINS_PER_PORT)
+			val = 1;
+		else
+			val = FIELD_GET(AW9523_GCR_GPOMD_MASK, val);
+		break;
+	default:
+		return -ENOTSUPP;
+	}
+	if (val < 1)
+		return -EINVAL;
+
+	*config = pinconf_to_config_packed(param, !!val);
+
+	return rc;
+}
+
+static int aw9523_pconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
+			    unsigned long *configs, unsigned int num_configs)
+{
+	struct aw9523 *awi = pinctrl_dev_get_drvdata(pctldev);
+	enum pin_config_param param;
+	int regbit = pin % AW9523_PINS_PER_PORT;
+	u32 arg;
+	u8 reg;
+	unsigned int mask, val;
+	int i, rc;
+
+	mutex_lock(&awi->i2c_lock);
+	for (i = 0; i < num_configs; i++) {
+		param = pinconf_to_config_param(configs[i]);
+		arg = pinconf_to_config_argument(configs[i]);
+
+		rc = aw9523_pcfg_param_to_reg(param, pin, &reg);
+		if (rc)
+			goto end;
+
+		switch (param) {
+		case PIN_CONFIG_OUTPUT:
+			/* First, enable pin output */
+			rc = regmap_update_bits(awi->regmap,
+						AW9523_REG_CONF_STATE(pin),
+						BIT(regbit), 0);
+			if (rc)
+				goto end;
+
+			/* Then, fall through to config output level */
+			fallthrough;
+		case PIN_CONFIG_OUTPUT_ENABLE:
+			arg = !arg;
+			fallthrough;
+		case PIN_CONFIG_BIAS_PULL_PIN_DEFAULT:
+		case PIN_CONFIG_BIAS_PULL_DOWN:
+		case PIN_CONFIG_BIAS_PULL_UP:
+		case PIN_CONFIG_INPUT_ENABLE:
+			mask = BIT(regbit);
+			val = arg ? BIT(regbit) : 0;
+			break;
+		case PIN_CONFIG_DRIVE_OPEN_DRAIN:
+			/* Open-Drain is supported only on port 0 */
+			if (pin >= AW9523_PINS_PER_PORT) {
+				rc = -ENOTSUPP;
+				goto end;
+			}
+			mask = AW9523_GCR_GPOMD_MASK;
+			val = 0;
+			break;
+		case PIN_CONFIG_DRIVE_PUSH_PULL:
+			/* Port 1 is always Push-Pull */
+			if (pin >= AW9523_PINS_PER_PORT) {
+				mask = 0;
+				val = 0;
+				continue;
+			}
+			mask = AW9523_GCR_GPOMD_MASK;
+			val = AW9523_GCR_GPOMD_MASK;
+			break;
+		default:
+			rc = -ENOTSUPP;
+			goto end;
+		}
+
+		rc = regmap_update_bits(awi->regmap, reg, mask, val);
+		if (rc)
+			goto end;
+	}
+end:
+	mutex_unlock(&awi->i2c_lock);
+	return rc;
+}
+
+static const struct pinconf_ops aw9523_pinconf_ops = {
+	.pin_config_get = aw9523_pconf_get,
+	.pin_config_set = aw9523_pconf_set,
+	.is_generic = true,
+};
+
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 5, 0)
+#define GPIO_LINE_DIRECTION_IN	1
+#define GPIO_LINE_DIRECTION_OUT	0
+#endif
+
+/*
+ * aw9523_get_pin_direction - Get pin direction
+ * @regmap: Regmap structure
+ * @pin: gpiolib pin number
+ * @n:   pin index in port register
+ *
+ * Return: Pin direction for success or negative number for error
+ */
+static int aw9523_get_pin_direction(struct regmap *regmap, u8 pin, u8 n)
+{
+	int val, ret;
+
+	ret = regmap_read(regmap, AW9523_REG_CONF_STATE(pin), &val);
+	if (ret < 0)
+		return ret;
+
+	return (val & BIT(n)) == BIT(n);
+}
+
+/*
+ * aw9523_get_port_state - Get input or output state for entire port
+ * @regmap: Regmap structure
+ * @pin:    gpiolib pin number
+ * @regbit: hw pin index, used to retrieve port number
+ * @state:  returned port state
+ *
+ * Return: Zero for success or negative number for error
+ */
+static int aw9523_get_port_state(struct regmap *regmap, u8 pin,
+				   u8 regbit, unsigned int *state)
+{
+	u8 reg;
+	int dir;
+
+	dir = aw9523_get_pin_direction(regmap, pin, regbit);
+	if (dir < 0)
+		return dir;
+
+	if (dir == GPIO_LINE_DIRECTION_IN)
+		reg = AW9523_REG_IN_STATE(pin);
+	else
+		reg = AW9523_REG_OUT_STATE(pin);
+
+	return regmap_read(regmap, reg, state);
+}
+
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 5, 0)
+#undef GPIO_LINE_DIRECTION_IN
+#undef GPIO_LINE_DIRECTION_OUT
+#endif
+
+static int aw9523_gpio_irq_type(struct irq_data *d, unsigned int type)
+{
+	switch (type) {
+	case IRQ_TYPE_NONE:
+	case IRQ_TYPE_EDGE_BOTH:
+		return 0;
+	default:
+		return -EINVAL;
+	};
+}
+
+/*
+ * aw9523_irq_mask - Mask interrupt
+ * @d: irq data
+ *
+ * Sets which interrupt to mask in the bitmap;
+ * The interrupt will be masked when unlocking the irq bus.
+ */
+static void aw9523_irq_mask(struct irq_data *d)
+{
+	struct aw9523 *awi = gpiochip_get_data(irq_data_get_irq_chip_data(d));
+	unsigned int n = d->hwirq % AW9523_PINS_PER_PORT;
+
+	regmap_update_bits(awi->regmap,
+			   AW9523_REG_INTR_DIS(d->hwirq),
+			   BIT(n), BIT(n));
+}
+
+/*
+ * aw9523_irq_unmask - Unmask interrupt
+ * @d: irq data
+ *
+ * Sets which interrupt to unmask in the bitmap;
+ * The interrupt will be masked when unlocking the irq bus.
+ */
+static void aw9523_irq_unmask(struct irq_data *d)
+{
+	struct aw9523 *awi = gpiochip_get_data(irq_data_get_irq_chip_data(d));
+	unsigned int n = d->hwirq % AW9523_PINS_PER_PORT;
+
+	regmap_update_bits(awi->regmap,
+			   AW9523_REG_INTR_DIS(d->hwirq),
+			   BIT(n), 0);
+}
+
+static irqreturn_t aw9523_irq_thread_func(int irq, void *dev_id)
+{
+	struct aw9523 *awi = (struct aw9523 *)dev_id;
+	unsigned long n, val = 0;
+	unsigned long changed_gpio;
+	unsigned int tmp, port_pin, i, ret;
+
+	for (i = 0; i < AW9523_NUM_PORTS; i++) {
+		port_pin = i * AW9523_PINS_PER_PORT;
+		ret = regmap_read(awi->regmap,
+				  AW9523_REG_IN_STATE(port_pin),
+				  &tmp);
+		if (ret)
+			return ret;
+		val |= (u8)tmp << (i * 8);
+	}
+
+	/* Handle GPIO input release interrupt as well */
+	changed_gpio = awi->irq->cached_gpio ^ val;
+	awi->irq->cached_gpio = val;
+
+	/*
+	 * To avoid up to four *slow* i2c reads from any driver hooked
+	 * up to our interrupts, just check for the irq_find_mapping
+	 * result: if the interrupt is not mapped, then we don't want
+	 * to care about it.
+	 */
+	for_each_set_bit(n, &changed_gpio, awi->gpio.ngpio) {
+		tmp = irq_find_mapping(awi->gpio.irq.domain, n);
+		if (tmp <= 0)
+			continue;
+		handle_nested_irq(tmp);
+	}
+
+	return IRQ_HANDLED;
+}
+
+/*
+ * aw9523_irq_bus_lock - Grab lock for interrupt operation
+ * @d: irq data
+ */
+static void aw9523_irq_bus_lock(struct irq_data *d)
+{
+	struct aw9523 *awi = gpiochip_get_data(irq_data_get_irq_chip_data(d));
+
+	mutex_lock(&awi->irq->lock);
+	regcache_cache_only(awi->regmap, true);
+}
+
+/*
+ * aw9523_irq_bus_sync_unlock - Synchronize state and unlock
+ * @d: irq data
+ *
+ * Writes the interrupt mask bits (found in the bit map) to the
+ * hardware, then unlocks the bus.
+ */
+static void aw9523_irq_bus_sync_unlock(struct irq_data *d)
+{
+	struct aw9523 *awi = gpiochip_get_data(irq_data_get_irq_chip_data(d));
+
+	regcache_cache_only(awi->regmap, false);
+	regcache_sync(awi->regmap);
+	mutex_unlock(&awi->irq->lock);
+}
+
+static int aw9523_gpio_get_direction(struct gpio_chip *chip,
+				     unsigned int offset)
+{
+	struct aw9523 *awi = gpiochip_get_data(chip);
+	u8 regbit = offset % AW9523_PINS_PER_PORT;
+	int ret;
+
+	mutex_lock(&awi->i2c_lock);
+	ret = aw9523_get_pin_direction(awi->regmap, offset, regbit);
+	mutex_unlock(&awi->i2c_lock);
+
+	return ret;
+}
+
+static int aw9523_gpio_get(struct gpio_chip *chip, unsigned int offset)
+{
+	struct aw9523 *awi = gpiochip_get_data(chip);
+	u8 regbit = offset % AW9523_PINS_PER_PORT;
+	unsigned int val;
+	int ret;
+
+	mutex_lock(&awi->i2c_lock);
+	ret = aw9523_get_port_state(awi->regmap, offset, regbit, &val);
+	mutex_unlock(&awi->i2c_lock);
+	if (ret)
+		return ret;
+
+	return !!(val & BIT(regbit));
+}
+
+/**
+ * _aw9523_gpio_get_multiple - Get I/O state for an entire port
+ * @regmap: Regmap structure
+ * @pin: gpiolib pin number
+ * @regbit: hw pin index, used to retrieve port number
+ * @state: returned port I/O state
+ *
+ * Return: Zero for success or negative number for error
+ */
+static int _aw9523_gpio_get_multiple(struct aw9523 *awi, u8 regbit,
+				     u8 *state, u8 mask)
+{
+	u32 dir_in, val;
+	u8 m;
+	int ret;
+
+	/* Registers are 8-bits wide */
+	ret = regmap_read(awi->regmap, AW9523_REG_CONF_STATE(regbit), &dir_in);
+	if (ret)
+		return ret;
+	*state = 0;
+
+	m = mask & dir_in;
+	if (m) {
+		ret = regmap_read(awi->regmap, AW9523_REG_IN_STATE(regbit),
+				  &val);
+		if (ret)
+			return ret;
+		*state |= (u8)val & m;
+	}
+
+	m = mask & ~dir_in;
+	if (m) {
+		ret = regmap_read(awi->regmap, AW9523_REG_OUT_STATE(regbit),
+				  &val);
+		if (ret)
+			return ret;
+		*state |= (u8)val & m;
+	}
+
+	return 0;
+}
+
+static int aw9523_gpio_get_multiple(struct gpio_chip *chip,
+				    unsigned long *mask,
+				    unsigned long *bits)
+{
+	struct aw9523 *awi = gpiochip_get_data(chip);
+	u8 m, state = 0;
+	int ret;
+
+	mutex_lock(&awi->i2c_lock);
+
+	/* Port 0 (gpio 0-7) */
+	m = *mask & U8_MAX;
+	if (m) {
+		ret = _aw9523_gpio_get_multiple(awi, 0, &state, m);
+		if (ret)
+			goto out;
+	}
+	*bits = state;
+
+	/* Port 1 (gpio 8-15) */
+	m = (*mask >> 8) & U8_MAX;
+	if (m) {
+		ret = _aw9523_gpio_get_multiple(awi, AW9523_PINS_PER_PORT,
+						&state, m);
+		if (ret)
+			goto out;
+
+		*bits |= (state << 8);
+	}
+out:
+	mutex_unlock(&awi->i2c_lock);
+	return ret;
+}
+
+static void aw9523_gpio_set_multiple(struct gpio_chip *chip,
+				    unsigned long *mask,
+				    unsigned long *bits)
+{
+	struct aw9523 *awi = gpiochip_get_data(chip);
+	u8 mask_lo, mask_hi, bits_lo, bits_hi;
+	unsigned int reg;
+	int ret = 0;
+
+	mask_lo = *mask & U8_MAX;
+	mask_hi = (*mask >> 8) & U8_MAX;
+	mutex_lock(&awi->i2c_lock);
+	if (mask_hi) {
+		reg = AW9523_REG_OUT_STATE(AW9523_PINS_PER_PORT);
+		bits_hi = (*bits >> 8) & U8_MAX;
+
+		ret = regmap_write_bits(awi->regmap, reg, mask_hi, bits_hi);
+		if (ret) {
+			dev_warn(awi->dev, "Cannot write port1 out level\n");
+			goto out;
+		}
+	}
+	if (mask_lo) {
+		reg = AW9523_REG_OUT_STATE(0);
+		bits_lo = *bits & U8_MAX;
+		ret = regmap_write_bits(awi->regmap, reg, mask_lo, bits_lo);
+		if (ret)
+			dev_warn(awi->dev, "Cannot write port0 out level\n");
+	}
+out:
+	mutex_unlock(&awi->i2c_lock);
+}
+
+static void aw9523_gpio_set(struct gpio_chip *chip,
+			    unsigned int offset, int value)
+{
+	struct aw9523 *awi = gpiochip_get_data(chip);
+	u8 regbit = offset % AW9523_PINS_PER_PORT;
+
+	mutex_lock(&awi->i2c_lock);
+	regmap_update_bits(awi->regmap, AW9523_REG_OUT_STATE(offset),
+			   BIT(regbit), value ? BIT(regbit) : 0);
+	mutex_unlock(&awi->i2c_lock);
+}
+
+
+static int aw9523_direction_input(struct gpio_chip *chip, unsigned int offset)
+{
+	struct aw9523 *awi = gpiochip_get_data(chip);
+	u8 regbit = offset % AW9523_PINS_PER_PORT;
+	int ret;
+
+	mutex_lock(&awi->i2c_lock);
+	ret = regmap_update_bits(awi->regmap, AW9523_REG_CONF_STATE(offset),
+				 BIT(regbit), BIT(regbit));
+	mutex_unlock(&awi->i2c_lock);
+
+	return ret;
+}
+
+static int aw9523_direction_output(struct gpio_chip *chip,
+				   unsigned int offset, int value)
+{
+	struct aw9523 *awi = gpiochip_get_data(chip);
+	u8 regbit = offset % AW9523_PINS_PER_PORT;
+	int ret;
+
+	mutex_lock(&awi->i2c_lock);
+	ret = regmap_update_bits(awi->regmap, AW9523_REG_OUT_STATE(offset),
+				 BIT(regbit), value ? BIT(regbit) : 0);
+	if (ret)
+		goto end;
+
+	ret = regmap_update_bits(awi->regmap, AW9523_REG_CONF_STATE(offset),
+				 BIT(regbit), 0);
+end:
+	mutex_unlock(&awi->i2c_lock);
+	return ret;
+}
+
+static int aw9523_drive_reset_gpio(struct aw9523 *awi)
+{
+	unsigned int chip_id;
+	int ret;
+
+	/*
+	 * If the chip is already configured for any reason, then we
+	 * will probably succeed in sending the soft reset signal to
+	 * the hardware through I2C: this operation takes less time
+	 * compared to a full HW reset and it gives the same results.
+	 */
+	ret = regmap_write(awi->regmap, AW9523_REG_SOFT_RESET, 0);
+	if (ret == 0)
+		goto done;
+
+	dev_dbg(awi->dev, "Cannot execute soft reset: trying hard reset\n");
+	ret = gpiod_direction_output(awi->reset_gpio, 0);
+	if (ret)
+		return ret;
+
+	/* The reset pulse has to be longer than 20uS due to deglitch */
+	usleep_range(AW9523_HW_RESET_US, AW9523_HW_RESET_US + 1);
+
+	ret = gpiod_direction_output(awi->reset_gpio, 1);
+	if (ret)
+		return ret;
+done:
+	/* The HW needs at least 1uS to reliably recover after reset */
+	usleep_range(AW9523_HW_RESET_RECOVERY_US,
+		     AW9523_HW_RESET_RECOVERY_US + 1);
+
+	/* Check the ChipID */
+	ret = regmap_read(awi->regmap, AW9523_REG_CHIPID, &chip_id);
+	if (ret) {
+		dev_err(awi->dev, "Cannot read Chip ID: %d\n", ret);
+		return ret;
+	}
+	if (chip_id != AW9523_VAL_EXPECTED_CHIPID) {
+		dev_err(awi->dev, "Bad ChipID; read 0x%x, expected 0x%x\n",
+			chip_id, AW9523_VAL_EXPECTED_CHIPID);
+		return -EINVAL;
+	}
+
+	return 0;
+}
+
+static int aw9523_hw_reset(struct aw9523 *awi)
+{
+	int ret, max_retries = 2;
+
+	/* Sometimes the chip needs more than one reset cycle */
+	do {
+		ret = aw9523_drive_reset_gpio(awi);
+		if (ret == 0)
+			break;
+		max_retries--;
+	} while (max_retries);
+
+	return ret;
+}
+
+static int aw9523_init_gpiochip(struct aw9523 *awi, unsigned int npins)
+{
+	struct device *dev = awi->dev;
+	struct gpio_chip *gpiochip = &awi->gpio;
+
+	gpiochip->label = devm_kstrdup(dev, dev_name(dev), GFP_KERNEL);
+	if (!gpiochip->label)
+		return -ENOMEM;
+
+	gpiochip->base = -1;
+	gpiochip->ngpio = npins;
+	gpiochip->get_direction = aw9523_gpio_get_direction;
+	gpiochip->direction_input = aw9523_direction_input;
+	gpiochip->direction_output = aw9523_direction_output;
+	gpiochip->get = aw9523_gpio_get;
+	gpiochip->get_multiple = aw9523_gpio_get_multiple;
+	gpiochip->set = aw9523_gpio_set;
+	gpiochip->set_multiple = aw9523_gpio_set_multiple;
+	gpiochip->set_config = gpiochip_generic_config;
+	gpiochip->parent = dev;
+	gpiochip->of_node = dev->of_node;
+	gpiochip->owner = THIS_MODULE;
+	gpiochip->can_sleep = false;
+
+	return 0;
+}
+
+static int aw9523_init_irq(struct aw9523 *awi, int irq)
+{
+	struct device *dev = awi->dev;
+	struct gpio_irq_chip *gpioirq;
+	struct irq_chip *irqchip;
+	int ret;
+
+	if (!device_property_read_bool(dev, "interrupt-controller"))
+		return 0;
+
+	irqchip = devm_kzalloc(dev, sizeof(*irqchip), GFP_KERNEL);
+	if (!irqchip)
+		return -ENOMEM;
+
+	awi->irq = devm_kzalloc(dev, sizeof(*awi->irq), GFP_KERNEL);
+	if (!awi->irq)
+		return -ENOMEM;
+
+	irqchip->name = devm_kstrdup(dev, dev_name(dev), GFP_KERNEL);
+	if (!irqchip->name)
+		return -ENOMEM;
+
+	irqchip->irq_mask = aw9523_irq_mask;
+	irqchip->irq_unmask = aw9523_irq_unmask;
+	irqchip->irq_bus_lock = aw9523_irq_bus_lock;
+	irqchip->irq_bus_sync_unlock = aw9523_irq_bus_sync_unlock;
+	irqchip->irq_set_type = aw9523_gpio_irq_type;
+	awi->irq->irqchip = irqchip;
+	mutex_init(&awi->irq->lock);
+
+	ret = devm_request_threaded_irq(dev, irq, NULL, aw9523_irq_thread_func,
+					IRQF_ONESHOT, dev_name(dev), awi);
+	if (ret) {
+		dev_err(dev, "Failed to request irq %d\n", irq);
+		return ret;
+	}
+
+	gpioirq = &awi->gpio.irq;
+	gpioirq->chip = irqchip;
+	gpioirq->parent_handler = NULL;
+	gpioirq->num_parents = 0;
+	gpioirq->parents = NULL;
+	gpioirq->default_type = IRQ_TYPE_LEVEL_MASK;
+	gpioirq->handler = handle_simple_irq;
+	gpioirq->threaded = true;
+	gpioirq->first = 0;
+
+	return 0;
+}
+
+static bool aw9523_is_reg_hole(unsigned int reg)
+{
+	return (reg > AW9523_REG_PORT_MODE(AW9523_PINS_PER_PORT) &&
+		reg < AW9523_REG_SOFT_RESET) ||
+	       (reg > AW9523_REG_INTR_DIS(AW9523_PINS_PER_PORT) &&
+		reg < AW9523_REG_CHIPID);
+}
+
+static bool aw9523_readable_reg(struct device *dev, unsigned int reg)
+{
+	/* All available registers (minus holes) can be read */
+	return !aw9523_is_reg_hole(reg);
+}
+
+static bool aw9523_volatile_reg(struct device *dev, unsigned int reg)
+{
+	return aw9523_is_reg_hole(reg) ||
+	       reg == AW9523_REG_IN_STATE(0) ||
+	       reg == AW9523_REG_IN_STATE(AW9523_PINS_PER_PORT) ||
+	       reg == AW9523_REG_CHIPID ||
+	       reg == AW9523_REG_SOFT_RESET;
+}
+
+static bool aw9523_writeable_reg(struct device *dev, unsigned int reg)
+{
+	return !aw9523_is_reg_hole(reg) && reg != AW9523_REG_CHIPID;
+}
+
+static bool aw9523_precious_reg(struct device *dev, unsigned int reg)
+{
+	/* Reading AW9523_REG_IN_STATE clears interrupt status */
+	return aw9523_is_reg_hole(reg) ||
+	       reg == AW9523_REG_IN_STATE(0) ||
+	       reg == AW9523_REG_IN_STATE(AW9523_PINS_PER_PORT);
+}
+
+static const struct regmap_config aw9523_regmap = {
+	.reg_bits = 8,
+	.val_bits = 8,
+	.reg_stride = 1,
+
+	.precious_reg = aw9523_precious_reg,
+	.readable_reg = aw9523_readable_reg,
+	.volatile_reg = aw9523_volatile_reg,
+	.writeable_reg = aw9523_writeable_reg,
+
+	.cache_type = REGCACHE_FLAT,
+	.disable_locking = true,
+
+	.num_reg_defaults_raw = AW9523_REG_SOFT_RESET,
+};
+
+static int aw9523_hw_init(struct aw9523 *awi)
+{
+	u8 p1_pin = AW9523_PINS_PER_PORT;
+	unsigned int val;
+	int ret;
+
+	/* No register caching during initialization */
+	regcache_cache_bypass(awi->regmap, true);
+
+	/* Bring up the chip */
+	ret = aw9523_hw_reset(awi);
+	if (ret) {
+		dev_err(awi->dev, "HW Reset failed: %d\n", ret);
+		return ret;
+	}
+
+	/*
+	 * This is the expected chip and it is running: it's time to
+	 * set a safe default configuration in case the user doesn't
+	 * configure (all of the available) pins in this chip.
+	 * P.S.: The writes order doesn't matter.
+	 */
+
+	/* Set all pins as GPIO */
+	ret = regmap_write(awi->regmap, AW9523_REG_PORT_MODE(0), U8_MAX);
+	if (ret)
+		return ret;
+	ret = regmap_write(awi->regmap, AW9523_REG_PORT_MODE(p1_pin), U8_MAX);
+	if (ret)
+		return ret;
+
+	/* Set Open-Drain mode on Port 0 (Port 1 is always P-P) */
+	ret = regmap_write(awi->regmap, AW9523_REG_GCR, 0);
+	if (ret)
+		return ret;
+
+	/* Set all pins as inputs */
+	ret = regmap_write(awi->regmap, AW9523_REG_CONF_STATE(0), U8_MAX);
+	if (ret)
+		return ret;
+	ret = regmap_write(awi->regmap, AW9523_REG_CONF_STATE(p1_pin), U8_MAX);
+	if (ret)
+		return ret;
+
+	/* Disable all interrupts to avoid unreasoned wakeups */
+	ret = regmap_write(awi->regmap, AW9523_REG_INTR_DIS(0), U8_MAX);
+	if (ret)
+		return ret;
+	ret = regmap_write(awi->regmap, AW9523_REG_INTR_DIS(p1_pin), U8_MAX);
+	if (ret)
+		return ret;
+
+	/* Clear setup-generated interrupts by performing a port state read */
+	ret = aw9523_get_port_state(awi->regmap, 0, 0, &val);
+	if (ret)
+		return ret;
+	ret = aw9523_get_port_state(awi->regmap, p1_pin, 0, &val);
+	if (ret)
+		return ret;
+
+	/* Everything went fine: activate and reinitialize register cache */
+	regcache_cache_bypass(awi->regmap, false);
+	return regmap_reinit_cache(awi->regmap, &aw9523_regmap);
+}
+
+static int aw9523_probe(struct i2c_client *client,
+			const struct i2c_device_id *id)
+{
+	struct device *dev = &client->dev;
+	struct pinctrl_desc *pdesc;
+	struct aw9523 *awi;
+	int ret;
+
+	awi = devm_kzalloc(dev, sizeof(*awi), GFP_KERNEL);
+	if (!awi)
+		return -ENOMEM;
+
+	i2c_set_clientdata(client, awi);
+
+	awi->dev = dev;
+	awi->reset_gpio = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH);
+	if (IS_ERR(awi->reset_gpio))
+		return PTR_ERR(awi->reset_gpio);
+	gpiod_set_consumer_name(awi->reset_gpio, "aw9523 reset");
+
+	awi->regmap = devm_regmap_init_i2c(client, &aw9523_regmap);
+	if (IS_ERR(awi->regmap))
+		return PTR_ERR(awi->regmap);
+
+	awi->vio_vreg = devm_regulator_get_optional(dev, "vio");
+	if (IS_ERR(awi->vio_vreg)) {
+		if (PTR_ERR(awi->vio_vreg) == -EPROBE_DEFER)
+			return -EPROBE_DEFER;
+		awi->vio_vreg = NULL;
+	} else {
+		ret = regulator_enable(awi->vio_vreg);
+		if (ret)
+			return ret;
+	}
+
+	mutex_init(&awi->i2c_lock);
+	lockdep_set_subclass(&awi->i2c_lock,
+			     i2c_adapter_depth(client->adapter));
+
+	pdesc = devm_kzalloc(dev, sizeof(*pdesc), GFP_KERNEL);
+	if (!pdesc)
+		return -ENOMEM;
+
+	ret = aw9523_hw_init(awi);
+	if (ret)
+		goto err_disable_vregs;
+
+	pdesc->name = dev_name(dev);
+	pdesc->owner = THIS_MODULE;
+	pdesc->pctlops = &aw9523_pinctrl_ops;
+	pdesc->pmxops  = &aw9523_pinmux_ops;
+	pdesc->confops = &aw9523_pinconf_ops;
+	pdesc->pins = aw9523_pins;
+	pdesc->npins = ARRAY_SIZE(aw9523_pins);
+
+	ret = aw9523_init_gpiochip(awi, pdesc->npins);
+	if (ret)
+		goto err_disable_vregs;
+
+	if (client->irq) {
+		ret = aw9523_init_irq(awi, client->irq);
+		if (ret)
+			goto err_disable_vregs;
+	}
+
+	awi->pctl = devm_pinctrl_register(dev, pdesc, awi);
+	if (IS_ERR(awi->pctl)) {
+		ret = PTR_ERR(awi->pctl);
+		dev_err(dev, "Cannot register pinctrl: %d", ret);
+		goto err_disable_vregs;
+	}
+
+	ret = devm_gpiochip_add_data(dev, &awi->gpio, awi);
+	if (ret)
+		goto err_disable_vregs;
+
+	return ret;
+
+err_disable_vregs:
+	if (awi->vio_vreg)
+		regulator_disable(awi->vio_vreg);
+	mutex_destroy(&awi->i2c_lock);
+	return ret;
+}
+
+static int aw9523_remove(struct i2c_client *client)
+{
+	struct aw9523 *awi = i2c_get_clientdata(client);
+	int ret;
+
+	if (!awi)
+		return 0;
+
+	/*
+	 * If the chip VIO is connected to a regulator that we can turn
+	 * off, life is easy... otherwise, reinitialize the chip and
+	 * set the pins to hardware defaults before removing the driver
+	 * to leave it in a clean, safe and predictable state.
+	 */
+	if (awi->vio_vreg) {
+		regulator_disable(awi->vio_vreg);
+	} else {
+		mutex_lock(&awi->i2c_lock);
+		ret = aw9523_hw_init(awi);
+		mutex_unlock(&awi->i2c_lock);
+		if (ret)
+			return ret;
+	}
+
+	mutex_destroy(&awi->i2c_lock);
+	return 0;
+}
+
+static const struct i2c_device_id aw9523_i2c_id_table[] = {
+	{ "aw9523_i2c", 0 },
+	{ }
+};
+MODULE_DEVICE_TABLE(i2c, aw9523_i2c_id_table);
+
+static const struct of_device_id of_aw9523_i2c_match[] = {
+	{ .compatible = "awinic,aw9523-pinctrl", },
+};
+MODULE_DEVICE_TABLE(of, of_aw9523_i2c_match);
+
+static struct i2c_driver aw9523_driver = {
+	.driver = {
+		.name = "aw9523-pinctrl",
+		.of_match_table = of_aw9523_i2c_match,
+	},
+	.probe = aw9523_probe,
+	.remove = aw9523_remove,
+	.id_table = aw9523_i2c_id_table,
+};
+module_i2c_driver(aw9523_driver);
+
+MODULE_DESCRIPTION("Awinic AW9523 I2C GPIO Expander driver");
+MODULE_AUTHOR("AngeloGioacchino Del Regno <angelogioacchino.delregno at somainline.org>");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:aw9523");
diff --git a/target/linux/ramips/mt7620/config-5.10 b/target/linux/ramips/mt7620/config-5.10
index b6a8b03d25..391449cc51 100644
--- a/target/linux/ramips/mt7620/config-5.10
+++ b/target/linux/ramips/mt7620/config-5.10
@@ -148,6 +148,7 @@ CONFIG_PGTABLE_LEVELS=2
 CONFIG_PHYLIB=y
 CONFIG_PHY_RALINK_USB=y
 CONFIG_PINCTRL=y
+# CONFIG_PINCTRL_AW9523 is not set
 CONFIG_PINCTRL_RT2880=y
 # CONFIG_PINCTRL_SINGLE is not set
 CONFIG_RALINK=y
diff --git a/target/linux/ramips/mt7620/config-5.4 b/target/linux/ramips/mt7620/config-5.4
index 4bafded763..ca96f09c5b 100644
--- a/target/linux/ramips/mt7620/config-5.4
+++ b/target/linux/ramips/mt7620/config-5.4
@@ -150,6 +150,7 @@ CONFIG_PGTABLE_LEVELS=2
 CONFIG_PHYLIB=y
 CONFIG_PHY_RALINK_USB=y
 CONFIG_PINCTRL=y
+# CONFIG_PINCTRL_AW9523 is not set
 CONFIG_PINCTRL_RT2880=y
 # CONFIG_PINCTRL_SINGLE is not set
 CONFIG_RALINK=y
diff --git a/target/linux/ramips/mt7621/config-5.10 b/target/linux/ramips/mt7621/config-5.10
index 5e1a5cd30a..869e930893 100644
--- a/target/linux/ramips/mt7621/config-5.10
+++ b/target/linux/ramips/mt7621/config-5.10
@@ -212,6 +212,7 @@ CONFIG_PHYLIB=y
 CONFIG_PHYLINK=y
 # CONFIG_PHY_RALINK_USB is not set
 CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AW9523=y
 CONFIG_PINCTRL_RT2880=y
 # CONFIG_PINCTRL_SINGLE is not set
 CONFIG_PINCTRL_SX150X=y
diff --git a/target/linux/ramips/mt7621/config-5.4 b/target/linux/ramips/mt7621/config-5.4
index 7a3adae555..3af9b94c50 100644
--- a/target/linux/ramips/mt7621/config-5.4
+++ b/target/linux/ramips/mt7621/config-5.4
@@ -202,6 +202,7 @@ CONFIG_PHYLIB=y
 CONFIG_PHYLINK=y
 # CONFIG_PHY_RALINK_USB is not set
 CONFIG_PINCTRL=y
+CONFIG_PINCTRL_AW9523=y
 CONFIG_PINCTRL_RT2880=y
 # CONFIG_PINCTRL_SINGLE is not set
 CONFIG_PINCTRL_SX150X=y
diff --git a/target/linux/ramips/mt76x8/config-5.10 b/target/linux/ramips/mt76x8/config-5.10
index 8c612a643f..3a42a5770f 100644
--- a/target/linux/ramips/mt76x8/config-5.10
+++ b/target/linux/ramips/mt76x8/config-5.10
@@ -143,6 +143,7 @@ CONFIG_PGTABLE_LEVELS=2
 CONFIG_PHYLIB=y
 CONFIG_PHY_RALINK_USB=y
 CONFIG_PINCTRL=y
+# CONFIG_PINCTRL_AW9523 is not set
 CONFIG_PINCTRL_RT2880=y
 # CONFIG_PINCTRL_SINGLE is not set
 CONFIG_RALINK=y
diff --git a/target/linux/ramips/mt76x8/config-5.4 b/target/linux/ramips/mt76x8/config-5.4
index 302a39adc9..c69f120899 100644
--- a/target/linux/ramips/mt76x8/config-5.4
+++ b/target/linux/ramips/mt76x8/config-5.4
@@ -143,6 +143,7 @@ CONFIG_PGTABLE_LEVELS=2
 CONFIG_PHYLIB=y
 CONFIG_PHY_RALINK_USB=y
 CONFIG_PINCTRL=y
+# CONFIG_PINCTRL_AW9523 is not set
 CONFIG_PINCTRL_RT2880=y
 # CONFIG_PINCTRL_SINGLE is not set
 CONFIG_RALINK=y
diff --git a/target/linux/ramips/patches-5.10/805-pinctrl-AW9523.patch b/target/linux/ramips/patches-5.10/805-pinctrl-AW9523.patch
new file mode 100644
index 0000000000..e80d0c9967
--- /dev/null
+++ b/target/linux/ramips/patches-5.10/805-pinctrl-AW9523.patch
@@ -0,0 +1,72 @@
+From: AngeloGioacchino Del Regno
+        <angelogioacchino.delregno at somainline.org>
+To: linus.walleij at linaro.org
+Cc: linux-kernel at vger.kernel.org, konrad.dybcio at somainline.org,
+        marijn.suijten at somainline.org, martin.botka at somainline.org,
+        phone-devel at vger.kernel.org, linux-gpio at vger.kernel.org,
+        devicetree at vger.kernel.org, robh+dt at kernel.org,
+        AngeloGioacchino Del Regno
+        <angelogioacchino.delregno at somainline.org>
+Subject: [PATCH v5 1/2] pinctrl: Add driver for Awinic AW9523/B I2C GPIO
+ Expander
+Date: Mon, 25 Jan 2021 19:22:18 +0100
+
+The Awinic AW9523(B) is a multi-function I2C gpio expander in a
+TQFN-24L package, featuring PWM (max 37mA per pin, or total max
+power 3.2Watts) for LED driving capability.
+
+It has two ports with 8 pins per port (for a total of 16 pins),
+configurable as either PWM with 1/256 stepping or GPIO input/output,
+1.8V logic input; each GPIO can be configured as input or output
+independently from each other.
+
+This IC also has an internal interrupt controller, which is capable
+of generating an interrupt for each GPIO, depending on the
+configuration, and will raise an interrupt on the INTN pin to
+advertise this to an external interrupt controller.
+
+Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at somainline.org>
+---
+ drivers/pinctrl/Kconfig          |   17 +
+ drivers/pinctrl/Makefile         |    1 +
+ drivers/pinctrl/pinctrl-aw9523.c | 1122 ++++++++++++++++++++++++++++++
+ 3 files changed, 1140 insertions(+)
+ create mode 100644 drivers/pinctrl/pinctrl-aw9523.c
+
+--- a/drivers/pinctrl/Kconfig
++++ b/drivers/pinctrl/Kconfig
+@@ -110,6 +110,24 @@ config PINCTRL_AMD
+ 	  Requires ACPI/FDT device enumeration code to set up a platform
+ 	  device.
+ 
++config PINCTRL_AW9523
++	bool "Awinic AW9523/AW9523B I2C GPIO expander pinctrl driver"
++	depends on OF && I2C
++	select PINMUX
++	select PINCONF
++	select GENERIC_PINCONF
++	select GPIOLIB
++	select GPIOLIB_IRQCHIP
++	select REGMAP
++	select REGMAP_I2C
++	help
++	  The Awinic AW9523/AW9523B is a multi-function I2C GPIO
++	  expander with PWM functionality. This driver bundles a
++	  pinctrl driver to select the function muxing and a GPIO
++	  driver to handle GPIO, when the GPIO function is selected.
++
++	  Say yes to enable pinctrl and GPIO support for the AW9523(B).
++
+ config PINCTRL_BM1880
+ 	bool "Bitmain BM1880 Pinctrl driver"
+ 	depends on OF && (ARCH_BITMAIN || COMPILE_TEST)
+--- a/drivers/pinctrl/Makefile
++++ b/drivers/pinctrl/Makefile
+@@ -14,6 +14,7 @@ obj-$(CONFIG_PINCTRL_AXP209)	+= pinctrl-
+ obj-$(CONFIG_PINCTRL_AT91)	+= pinctrl-at91.o
+ obj-$(CONFIG_PINCTRL_AT91PIO4)	+= pinctrl-at91-pio4.o
+ obj-$(CONFIG_PINCTRL_AMD)	+= pinctrl-amd.o
++obj-$(CONFIG_PINCTRL_AW9523)	+= pinctrl-aw9523.o
+ obj-$(CONFIG_PINCTRL_BM1880)	+= pinctrl-bm1880.o
+ obj-$(CONFIG_PINCTRL_DA850_PUPD) += pinctrl-da850-pupd.o
+ obj-$(CONFIG_PINCTRL_DA9062)	+= pinctrl-da9062.o
diff --git a/target/linux/ramips/patches-5.4/805-pinctrl-AW9523.patch b/target/linux/ramips/patches-5.4/805-pinctrl-AW9523.patch
new file mode 100644
index 0000000000..d8e17a671a
--- /dev/null
+++ b/target/linux/ramips/patches-5.4/805-pinctrl-AW9523.patch
@@ -0,0 +1,72 @@
+From: AngeloGioacchino Del Regno
+        <angelogioacchino.delregno at somainline.org>
+To: linus.walleij at linaro.org
+Cc: linux-kernel at vger.kernel.org, konrad.dybcio at somainline.org,
+        marijn.suijten at somainline.org, martin.botka at somainline.org,
+        phone-devel at vger.kernel.org, linux-gpio at vger.kernel.org,
+        devicetree at vger.kernel.org, robh+dt at kernel.org,
+        AngeloGioacchino Del Regno
+        <angelogioacchino.delregno at somainline.org>
+Subject: [PATCH v5 1/2] pinctrl: Add driver for Awinic AW9523/B I2C GPIO
+ Expander
+Date: Mon, 25 Jan 2021 19:22:18 +0100
+
+The Awinic AW9523(B) is a multi-function I2C gpio expander in a
+TQFN-24L package, featuring PWM (max 37mA per pin, or total max
+power 3.2Watts) for LED driving capability.
+
+It has two ports with 8 pins per port (for a total of 16 pins),
+configurable as either PWM with 1/256 stepping or GPIO input/output,
+1.8V logic input; each GPIO can be configured as input or output
+independently from each other.
+
+This IC also has an internal interrupt controller, which is capable
+of generating an interrupt for each GPIO, depending on the
+configuration, and will raise an interrupt on the INTN pin to
+advertise this to an external interrupt controller.
+
+Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at somainline.org>
+---
+ drivers/pinctrl/Kconfig          |   17 +
+ drivers/pinctrl/Makefile         |    1 +
+ drivers/pinctrl/pinctrl-aw9523.c | 1122 ++++++++++++++++++++++++++++++
+ 3 files changed, 1140 insertions(+)
+ create mode 100644 drivers/pinctrl/pinctrl-aw9523.c
+
+--- a/drivers/pinctrl/Kconfig
++++ b/drivers/pinctrl/Kconfig
+@@ -109,6 +109,24 @@ config PINCTRL_AMD
+ 	  Requires ACPI/FDT device enumeration code to set up a platform
+ 	  device.
+ 
++config PINCTRL_AW9523
++	bool "Awinic AW9523/AW9523B I2C GPIO expander pinctrl driver"
++	depends on OF && I2C
++	select PINMUX
++	select PINCONF
++	select GENERIC_PINCONF
++	select GPIOLIB
++	select GPIOLIB_IRQCHIP
++	select REGMAP
++	select REGMAP_I2C
++	help
++	  The Awinic AW9523/AW9523B is a multi-function I2C GPIO
++	  expander with PWM functionality. This driver bundles a
++	  pinctrl driver to select the function muxing and a GPIO
++	  driver to handle GPIO, when the GPIO function is selected.
++
++	  Say yes to enable pinctrl and GPIO support for the AW9523(B).
++
+ config PINCTRL_BM1880
+ 	bool "Bitmain BM1880 Pinctrl driver"
+ 	depends on OF && (ARCH_BITMAIN || COMPILE_TEST)
+--- a/drivers/pinctrl/Makefile
++++ b/drivers/pinctrl/Makefile
+@@ -14,6 +14,7 @@ obj-$(CONFIG_PINCTRL_AXP209)	+= pinctrl-
+ obj-$(CONFIG_PINCTRL_AT91)	+= pinctrl-at91.o
+ obj-$(CONFIG_PINCTRL_AT91PIO4)	+= pinctrl-at91-pio4.o
+ obj-$(CONFIG_PINCTRL_AMD)	+= pinctrl-amd.o
++obj-$(CONFIG_PINCTRL_AW9523)	+= pinctrl-aw9523.o
+ obj-$(CONFIG_PINCTRL_BM1880)	+= pinctrl-bm1880.o
+ obj-$(CONFIG_PINCTRL_DA850_PUPD) += pinctrl-da850-pupd.o
+ obj-$(CONFIG_PINCTRL_DIGICOLOR)	+= pinctrl-digicolor.o
diff --git a/target/linux/ramips/rt288x/config-5.10 b/target/linux/ramips/rt288x/config-5.10
index 095c16c43b..88d06266b9 100644
--- a/target/linux/ramips/rt288x/config-5.10
+++ b/target/linux/ramips/rt288x/config-5.10
@@ -131,6 +131,7 @@ CONFIG_PGTABLE_LEVELS=2
 CONFIG_PHYLIB=y
 # CONFIG_PHY_RALINK_USB is not set
 CONFIG_PINCTRL=y
+# CONFIG_PINCTRL_AW9523 is not set
 CONFIG_PINCTRL_RT2880=y
 # CONFIG_PINCTRL_SINGLE is not set
 CONFIG_RALINK=y
diff --git a/target/linux/ramips/rt288x/config-5.4 b/target/linux/ramips/rt288x/config-5.4
index ad269ff5be..d0de43e29c 100644
--- a/target/linux/ramips/rt288x/config-5.4
+++ b/target/linux/ramips/rt288x/config-5.4
@@ -131,6 +131,7 @@ CONFIG_PGTABLE_LEVELS=2
 CONFIG_PHYLIB=y
 # CONFIG_PHY_RALINK_USB is not set
 CONFIG_PINCTRL=y
+# CONFIG_PINCTRL_AW9523 is not set
 CONFIG_PINCTRL_RT2880=y
 # CONFIG_PINCTRL_SINGLE is not set
 CONFIG_RALINK=y
diff --git a/target/linux/ramips/rt305x/config-5.10 b/target/linux/ramips/rt305x/config-5.10
index fbc2edc840..1704accf95 100644
--- a/target/linux/ramips/rt305x/config-5.10
+++ b/target/linux/ramips/rt305x/config-5.10
@@ -131,6 +131,7 @@ CONFIG_PGTABLE_LEVELS=2
 CONFIG_PHYLIB=y
 CONFIG_PHY_RALINK_USB=y
 CONFIG_PINCTRL=y
+# CONFIG_PINCTRL_AW9523 is not set
 CONFIG_PINCTRL_RT2880=y
 # CONFIG_PINCTRL_SINGLE is not set
 CONFIG_RALINK=y
diff --git a/target/linux/ramips/rt305x/config-5.4 b/target/linux/ramips/rt305x/config-5.4
index 6ab68f9d56..b4ee93c05b 100644
--- a/target/linux/ramips/rt305x/config-5.4
+++ b/target/linux/ramips/rt305x/config-5.4
@@ -131,6 +131,7 @@ CONFIG_PGTABLE_LEVELS=2
 CONFIG_PHYLIB=y
 CONFIG_PHY_RALINK_USB=y
 CONFIG_PINCTRL=y
+# CONFIG_PINCTRL_AW9523 is not set
 CONFIG_PINCTRL_RT2880=y
 # CONFIG_PINCTRL_SINGLE is not set
 CONFIG_RALINK=y
diff --git a/target/linux/ramips/rt3883/config-5.10 b/target/linux/ramips/rt3883/config-5.10
index 5bb641cbdc..16d6fc32f8 100644
--- a/target/linux/ramips/rt3883/config-5.10
+++ b/target/linux/ramips/rt3883/config-5.10
@@ -132,6 +132,7 @@ CONFIG_PGTABLE_LEVELS=2
 CONFIG_PHYLIB=y
 CONFIG_PHY_RALINK_USB=y
 CONFIG_PINCTRL=y
+# CONFIG_PINCTRL_AW9523 is not set
 CONFIG_PINCTRL_RT2880=y
 # CONFIG_PINCTRL_SINGLE is not set
 CONFIG_RALINK=y
diff --git a/target/linux/ramips/rt3883/config-5.4 b/target/linux/ramips/rt3883/config-5.4
index 577743e798..f7d6a2cc2b 100644
--- a/target/linux/ramips/rt3883/config-5.4
+++ b/target/linux/ramips/rt3883/config-5.4
@@ -133,6 +133,7 @@ CONFIG_PGTABLE_LEVELS=2
 CONFIG_PHYLIB=y
 CONFIG_PHY_RALINK_USB=y
 CONFIG_PINCTRL=y
+# CONFIG_PINCTRL_AW9523 is not set
 CONFIG_PINCTRL_RT2880=y
 # CONFIG_PINCTRL_SINGLE is not set
 CONFIG_RALINK=y


From lede-commits at lists.infradead.org  Sun Jun 27 12:41:35 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 27 Jun 2021 15:41:35 -0400
Subject: [openwrt/openwrt]  ramips: add support for Tenbay T-MB5EU-V01
In-Reply-To: <162482289410.26295.8179285586322845632@git-01.infra.openwrt.org>
References: <162482289410.26295.8179285586322845632@git-01.infra.openwrt.org>
Message-ID: <mailman.3764.1624822909.1072.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/51b61fd57059adeb10a3977e00772af2b76dc40b

commit 51b61fd57059adeb10a3977e00772af2b76dc40b
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Thu May 6 18:07:18 2021 +0200

    ramips: add support for Tenbay T-MB5EU-V01
    
    Hardware
    --------
    MediaTek MT7621 SoC
    256M DDR3
    16MB BoHong SPI-NOR
    MediaTek MT7905+7975 2x2T2R DBDC bgnax / acax
    RGB LED
    WPS + RESET Button
    UART on compute module (silkscreened / 115200n8)
    
    The router itself is just a board with Power / USB / RJ-45 connectors
    and DC/DC converters. The SoC and WiFi components are on a
    daughterboard which connect using two M.2 connectors.
    
    The compute module has the model number "T-CB1800K-DM2 V02" printed on
    it. The main baord has "T-MB5EU V01" printed on it. This information
    might be useful, as it's highly likely either of these two will be
    reused in similar designs.
    
    The router itself is sold as Tenbay T-MB5EU directly from the OEM as
    well as "KuWFI AX1800 Smart WiFi 6 Eouter" on Amazon.de for ~50? in a
    slightly different case.
    
    Installation
    ------------
    
    A Tool for creating a factory image for the Vendor Web Interface can be
    found here: https://github.com/blocktrron/t-mb5eu-v01-factory-creator/
    
    As the OEM Firmware is just a modified LEDE 17.01, you can also access
    failsafe mode via UART while the OS boots, by connecting to UART
    and pressing "f" when prompted. The Router is reachable at
    192.168.1.1 via root without password.
    
    Transfer the OpenWrt sysupgrade image via scp and apply with sysupgrade
    using the -n and -F flags.
    
    Alternatively, the board can be flashed by attaching to the UART
    console, interrupting the boot process by keeping "0" pressed while
    attaching power.
    
    Serve the OpenWrt initramfs using a TFTP server with address
    192.168.1.66. Rename the initramfs to ax1800.bin.
    
    Attach your TFTP server to one of the LAN ports. Execute the following
    commands.
    
     $ setenv ipaddr 192.168.1.67
     $ setenv serverip 192.168.1.66
     $ tftpboot 0x84000000 ax1800.bin
     $ bootm
    
    Wait for the device to boot. Then transfer the OpenWrt sysupgrade image
    to the device using SCP and apply sysupgrade.
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 .../linux/ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts | 196 +++++++++++++++++++++
 target/linux/ramips/image/mt7621.mk                |  12 ++
 target/linux/ramips/mt7621/config-5.10             |   1 +
 target/linux/ramips/mt7621/config-5.4              |   1 +
 ...spi-nor-Add-support-for-BoHong-bh25q128as.patch |  75 ++++++++
 ...spi-nor-Add-support-for-BoHong-bh25q128as.patch |  34 ++++
 6 files changed, 319 insertions(+)

diff --git a/target/linux/ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts b/target/linux/ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts
new file mode 100644
index 0000000000..ef0d48b8c4
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_tenbay_t-mb5eu-v01.dts
@@ -0,0 +1,196 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "tenbay,t-mb5eu-v01", "mediatek,mt7621-soc";
+	model = "Tenbay T-MB5EU-V01";
+
+	aliases {
+		led-boot = &led_green;
+		led-failsafe = &led_red;
+		led-running = &led_blue;
+		led-upgrade = &led_red;
+		label-mac-device = &wan_port;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+		bootargs-override = "console=ttyS0,115200";
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&led_pins>;
+
+		led_blue: blue {
+			label = "blue";
+			gpios = <&aw9523 0 GPIO_ACTIVE_LOW>;
+		};
+
+		led_red: red {
+			label = "red";
+			gpios = <&aw9523 1 GPIO_ACTIVE_LOW>;
+		};
+
+		led_green: green {
+			label = "green";
+			gpios = <&aw9523 11 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	keys {
+		compatible = "gpio-keys-polled";
+		poll-interval = <50>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&button_pins>;
+
+		reset {
+			label = "reset";
+			gpios = <&aw9523 9 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&aw9523 8 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+	};
+
+	i2c-gpio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		compatible = "i2c-gpio";
+		gpios = <&gpio 7 GPIO_ACTIVE_HIGH &gpio 8 GPIO_ACTIVE_HIGH>;
+		i2c-gpio,delay-us = <10>;
+
+		aw9523: gpio-expander at 5b {
+			compatible = "awinic,aw9523-pinctrl";
+			reg = <0x5b>;
+			gpio-controller;
+			#gpio-cells = <2>;
+			gpio-ranges = <&aw9523 0 0 16>;
+
+			reset-gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
+
+			button_pins: button-pins {
+				pins = "gpio8", "gpio9";
+				function = "gpio";
+				bias-pull-up;
+				drive-open-drain;
+				input-enable;
+			};
+
+			led_pins: led-pins {
+				pins = "gpio0", "gpio1", "gpio11";
+				function = "gpio";
+				input-disable;
+				output-low;
+			};
+		};
+	};
+};
+
+&pcie {
+	status = "okay";
+};
+
+&pcie1 {
+	wifi at 0,0 {
+		reg = <0x0 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x0>;
+	};
+};
+
+&gmac0 {
+	mtd-mac-address = <&factory 0x4>;
+};
+
+&switch0 {
+	ports {
+		wan_port: port at 0 {
+			status = "okay";
+			label = "wan";
+			mtd-mac-address = <&factory 0x28>;
+		};
+
+		port at 1 {
+			status = "okay";
+			label = "lan1";
+		};
+
+		port at 2 {
+			status = "okay";
+			label = "lan2";
+		};
+
+		port at 3 {
+			status = "okay";
+			label = "lan3";
+		};
+
+		port at 4 {
+			status = "okay";
+			label = "lan4";
+		};
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "uart3";
+		function = "gpio";
+	};
+};
+
+&spi0 {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <50000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x0 0x30000>;
+				read-only;
+			};
+
+			partition at 30000 {
+				label = "u-boot-env";
+				reg = <0x30000 0x10000>;
+				read-only;
+			};
+
+			partition at 40000 {
+				label = "product";
+				reg = <0x40000 0x10000>;
+				read-only;
+			};
+
+			factory: partition at 50000 {
+				label = "factory";
+				reg = <0x50000 0x40000>;
+				read-only;
+			};
+
+			partition at 90000 {
+				compatible = "denx,fit";
+				label = "firmware";
+				reg = <0x90000 0xf70000>;
+			};
+		};
+	};
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index ae9b4757de..cf3225dc81 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -1200,6 +1200,18 @@ define Device/telco-electronics_x1
 endef
 TARGET_DEVICES += telco-electronics_x1
 
+define Device/tenbay_t-mb5eu-v01
+  $(Device/dsa-migration)
+  DEVICE_VENDOR := Tenbay
+  DEVICE_MODEL := T-MB5EU-V01
+  DEVICE_DTS_CONFIG := config at 1
+  DEVICE_PACKAGES += kmod-mt7915e kmod-usb3
+  KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
+  IMAGE_SIZE := 15808k
+  SUPPORTED_DEVICES += mt7621-dm2-t-mb5eu-v01-nor
+endef
+TARGET_DEVICES += tenbay_t-mb5eu-v01
+
 define Device/thunder_timecloud
   $(Device/dsa-migration)
   $(Device/uimage-lzma-loader)
diff --git a/target/linux/ramips/mt7621/config-5.10 b/target/linux/ramips/mt7621/config-5.10
index 869e930893..92165590f6 100644
--- a/target/linux/ramips/mt7621/config-5.10
+++ b/target/linux/ramips/mt7621/config-5.10
@@ -102,6 +102,7 @@ CONFIG_HAS_IOPORT_MAP=y
 CONFIG_HIGHMEM=y
 CONFIG_I2C=y
 CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_GPIO=y
 CONFIG_I2C_MT7621=y
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_IRQCHIP=y
diff --git a/target/linux/ramips/mt7621/config-5.4 b/target/linux/ramips/mt7621/config-5.4
index 3af9b94c50..0ce300c138 100644
--- a/target/linux/ramips/mt7621/config-5.4
+++ b/target/linux/ramips/mt7621/config-5.4
@@ -100,6 +100,7 @@ CONFIG_HIGHMEM=y
 CONFIG_HZ_PERIODIC=y
 CONFIG_I2C=y
 CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_GPIO=y
 CONFIG_I2C_MT7621=y
 CONFIG_INITRAMFS_SOURCE=""
 CONFIG_IRQCHIP=y
diff --git a/target/linux/ramips/patches-5.10/405-mtd-spi-nor-Add-support-for-BoHong-bh25q128as.patch b/target/linux/ramips/patches-5.10/405-mtd-spi-nor-Add-support-for-BoHong-bh25q128as.patch
new file mode 100644
index 0000000000..4c762925fb
--- /dev/null
+++ b/target/linux/ramips/patches-5.10/405-mtd-spi-nor-Add-support-for-BoHong-bh25q128as.patch
@@ -0,0 +1,75 @@
+From 52d14545d2fc276b1bf9ccf48d4612fab6edfb6a Mon Sep 17 00:00:00 2001
+From: David Bauer <mail at david-bauer.net>
+Date: Thu, 6 May 2021 17:49:55 +0200
+Subject: [PATCH] mtd: spi-nor: Add support for BoHong bh25q128as
+
+Add MTD support for the BoHong bh25q128as SPI NOR chip.
+The chip has 16MB of total capacity, divided into a total of 256
+sectors, each 64KB sized. The chip also supports 4KB sectors.
+Additionally, it supports dual and quad read modes.
+
+Functionality was verified on an Tenbay WR1800K / MTK MT7621 board.
+
+Signed-off-by: David Bauer <mail at david-bauer.net>
+---
+ drivers/mtd/spi-nor/Makefile |  1 +
+ drivers/mtd/spi-nor/bohong.c | 21 +++++++++++++++++++++
+ drivers/mtd/spi-nor/core.c   |  1 +
+ drivers/mtd/spi-nor/core.h   |  1 +
+ 4 files changed, 24 insertions(+)
+ create mode 100644 drivers/mtd/spi-nor/bohong.c
+
+--- a/drivers/mtd/spi-nor/Makefile
++++ b/drivers/mtd/spi-nor/Makefile
+@@ -2,6 +2,7 @@
+ 
+ spi-nor-objs			:= core.o sfdp.o
+ spi-nor-objs			+= atmel.o
++spi-nor-objs			+= bohong.o
+ spi-nor-objs			+= catalyst.o
+ spi-nor-objs			+= eon.o
+ spi-nor-objs			+= esmt.o
+--- /dev/null
++++ b/drivers/mtd/spi-nor/bohong.c
+@@ -0,0 +1,21 @@
++// SPDX-License-Identifier: GPL-2.0
++/*
++ * Copyright (C) 2005, Intec Automation Inc.
++ * Copyright (C) 2014, Freescale Semiconductor, Inc.
++ */
++
++#include <linux/mtd/spi-nor.h>
++
++#include "core.h"
++
++static const struct flash_info bohong_parts[] = {
++	/* BoHong Microelectronics */
++	{ "bh25q128as", INFO(0x684018, 0, 64 * 1024, 256,
++			    SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
++};
++
++const struct spi_nor_manufacturer spi_nor_bohong = {
++	.name = "bohong",
++	.parts = bohong_parts,
++	.nparts = ARRAY_SIZE(bohong_parts),
++};
+--- a/drivers/mtd/spi-nor/core.c
++++ b/drivers/mtd/spi-nor/core.c
+@@ -2038,6 +2038,7 @@ int spi_nor_sr2_bit7_quad_enable(struct
+ 
+ static const struct spi_nor_manufacturer *manufacturers[] = {
+ 	&spi_nor_atmel,
++	&spi_nor_bohong,
+ 	&spi_nor_catalyst,
+ 	&spi_nor_eon,
+ 	&spi_nor_esmt,
+--- a/drivers/mtd/spi-nor/core.h
++++ b/drivers/mtd/spi-nor/core.h
+@@ -382,6 +382,7 @@ struct spi_nor_manufacturer {
+ 
+ /* Manufacturer drivers. */
+ extern const struct spi_nor_manufacturer spi_nor_atmel;
++extern const struct spi_nor_manufacturer spi_nor_bohong;
+ extern const struct spi_nor_manufacturer spi_nor_catalyst;
+ extern const struct spi_nor_manufacturer spi_nor_eon;
+ extern const struct spi_nor_manufacturer spi_nor_esmt;
diff --git a/target/linux/ramips/patches-5.4/405-mtd-spi-nor-Add-support-for-BoHong-bh25q128as.patch b/target/linux/ramips/patches-5.4/405-mtd-spi-nor-Add-support-for-BoHong-bh25q128as.patch
new file mode 100644
index 0000000000..728876322c
--- /dev/null
+++ b/target/linux/ramips/patches-5.4/405-mtd-spi-nor-Add-support-for-BoHong-bh25q128as.patch
@@ -0,0 +1,34 @@
+From 52d14545d2fc276b1bf9ccf48d4612fab6edfb6a Mon Sep 17 00:00:00 2001
+From: David Bauer <mail at david-bauer.net>
+Date: Thu, 6 May 2021 17:49:55 +0200
+Subject: [PATCH] mtd: spi-nor: Add support for BoHong bh25q128as
+
+Add MTD support for the BoHong bh25q128as SPI NOR chip.
+The chip has 16MB of total capacity, divided into a total of 256
+sectors, each 64KB sized. The chip also supports 4KB sectors.
+Additionally, it supports dual and quad read modes.
+
+Functionality was verified on an Tenbay WR1800K / MTK MT7621 board.
+
+Signed-off-by: David Bauer <mail at david-bauer.net>
+---
+ drivers/mtd/spi-nor/Makefile |  1 +
+ drivers/mtd/spi-nor/bohong.c | 21 +++++++++++++++++++++
+ drivers/mtd/spi-nor/core.c   |  1 +
+ drivers/mtd/spi-nor/core.h   |  1 +
+ 4 files changed, 24 insertions(+)
+ create mode 100644 drivers/mtd/spi-nor/bohong.c
+
+--- a/drivers/mtd/spi-nor/spi-nor.c
++++ b/drivers/mtd/spi-nor/spi-nor.c
+@@ -2233,6 +2233,10 @@ static const struct flash_info spi_nor_i
+ 
+ 	{ "at45db081d", INFO(0x1f2500, 0, 64 * 1024, 16, SECT_4K) },
+ 
++	/* BoHong Microelectronics */
++	{ "bh25q128as", INFO(0x684018, 0, 64 * 1024, 256,
++			SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
++
+ 	/* EON -- en25xxx */
+ 	{ "en25f32",    INFO(0x1c3116, 0, 64 * 1024,   64, SECT_4K) },
+ 	{ "en25p32",    INFO(0x1c2016, 0, 64 * 1024,   64, 0) },


From lede-commits at lists.infradead.org  Sun Jun 27 14:48:46 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 27 Jun 2021 17:48:46 -0400
Subject: [openwrt/openwrt] busybox: sysntpd: option to bind server to iface
In-Reply-To: <162483052630.6894.9239541259584269311@git-01.infra.openwrt.org>
References: <162483052630.6894.9239541259584269311@git-01.infra.openwrt.org>
Message-ID: <mailman.3769.1624830530.1072.lede-commits@lists.infradead.org>

zorun pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/a75928d1259e52e52b1991a4dc39df61ba3c9206

commit a75928d1259e52e52b1991a4dc39df61ba3c9206
Author: Alexey Dobrovolsky <dobrovolskiy.alexey at gmail.com>
AuthorDate: Tue Feb 23 17:43:02 2021 +0300

    busybox: sysntpd: option to bind server to iface
    
    NTPD in busybox has option -I to bind server to IFACE.
    However, capabilities of the busybox are limited, the -I option cannot be
    repeated and only one interface can be effectively specified in it.
    This option is currently not configurable via UCI.
    The patch adds an interface option to the system config, ntp section.
    Also sort options for uci_load_validate alphabetically.
    
    Signed-off-by: Alexey Dobrovolsky <dobrovolskiy.alexey at gmail.com>
    (cherry picked from commit e12fcf0fe5597467f7cc21144e5f4da60500ebd2)
---
 package/utils/busybox/files/sysntpd | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/package/utils/busybox/files/sysntpd b/package/utils/busybox/files/sysntpd
index e4a070762f..c4c311c242 100755
--- a/package/utils/busybox/files/sysntpd
+++ b/package/utils/busybox/files/sysntpd
@@ -30,7 +30,12 @@ get_dhcp_ntp_servers() {
 
 validate_ntp_section() {
 	uci_load_validate system timeserver "$1" "$2" \
-		'server:list(host)' 'enabled:bool:1' 'enable_server:bool:0' 'use_dhcp:bool:1' 'dhcp_interface:list(string)'
+		'dhcp_interface:list(string)' \
+		'enable_server:bool:0' \
+		'enabled:bool:1' \
+		'interface:string' \
+		'server:list(host)' \
+		'use_dhcp:bool:1'
 }
 
 start_ntpd_instance() {
@@ -49,7 +54,10 @@ start_ntpd_instance() {
 
 	procd_open_instance
 	procd_set_param command "$PROG" -n -N
-	[ "$enable_server" = "1" ] && procd_append_param command -l
+	if [ "$enable_server" = "1" ]; then
+		procd_append_param command -l
+		[ -n "$interface" ] && procd_append_param command -I $interface
+	fi
 	[ -x "$HOTPLUG_SCRIPT" ] && procd_append_param command -S "$HOTPLUG_SCRIPT"
 	for peer in $server; do
 		procd_append_param command -p $peer


From lede-commits at lists.infradead.org  Sun Jun 27 14:59:53 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 27 Jun 2021 17:59:53 -0400
Subject: [openwrt/openwrt]  busybox: sysntpd: add trigger to reload server
In-Reply-To: <162483119361.12716.6153224064048622686@git-01.infra.openwrt.org>
References: <162483119361.12716.6153224064048622686@git-01.infra.openwrt.org>
Message-ID: <mailman.3770.1624831199.1072.lede-commits@lists.infradead.org>

zorun pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/88114f617ae7bffe13d19d7b9575659a3d3cd9b6

commit 88114f617ae7bffe13d19d7b9575659a3d3cd9b6
Author: Alexey Dobrovolsky <dobrovolskiy.alexey at gmail.com>
AuthorDate: Sun Jun 6 02:25:02 2021 +0300

    busybox: sysntpd: add trigger to reload server
    
    sysntpd server becomes unavailable if the index of the bound
    interface changes. So let's add an interface trigger to reload sysntpd.
    
    This patch also adds the ability for the sysntpd script to handle
    uci interface name from configuration.
    
    Fixes: 4da60500ebd2 ("busybox: sysntpd: option to bind server to iface")
    Signed-off-by: Alexey Dobrovolsky <dobrovolskiy.alexey at gmail.com>
    Reviewed-by: Philip Prindeville <philipp at redfish-solutions.com>
---
 package/utils/busybox/files/sysntpd | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/package/utils/busybox/files/sysntpd b/package/utils/busybox/files/sysntpd
index c4c311c242..074f14b8f8 100755
--- a/package/utils/busybox/files/sysntpd
+++ b/package/utils/busybox/files/sysntpd
@@ -56,7 +56,14 @@ start_ntpd_instance() {
 	procd_set_param command "$PROG" -n -N
 	if [ "$enable_server" = "1" ]; then
 		procd_append_param command -l
-		[ -n "$interface" ] && procd_append_param command -I $interface
+		[ -n "$interface" ] && {
+			local ifname
+
+			network_get_device ifname "$interface" || \
+				ifname="$interface"
+			procd_append_param command -I "$ifname"
+			procd_append_param netdev "$ifname"
+		}
 	fi
 	[ -x "$HOTPLUG_SCRIPT" ] && procd_append_param command -S "$HOTPLUG_SCRIPT"
 	for peer in $server; do
@@ -79,11 +86,12 @@ start_ntpd_instance() {
 }
 
 start_service() {
+	. /lib/functions/network.sh
 	validate_ntp_section ntp start_ntpd_instance
 }
 
 service_triggers() {
-	local script name use_dhcp
+	local script name use_dhcp enable_server interface
 
 	script=$(readlink -f "$initscript")
 	name=$(basename ${script:-$initscript})
@@ -106,5 +114,17 @@ service_triggers() {
 		fi
 	}
 
+	config_get_bool enable_server ntp enable_server 0
+	config_get interface ntp interface
+
+	[ $enable_server -eq 1 ] && [ -n "$interface" ] && {
+		local ifname
+
+		network_get_device ifname "$interface" || \
+			ifname="$interface"
+		procd_add_interface_trigger "interface.*" "$ifname" \
+			/etc/init.d/"$name" reload
+	}
+
 	procd_add_validation validate_ntp_section
 }


From lede-commits at lists.infradead.org  Sun Jun 27 16:06:18 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 27 Jun 2021 19:06:18 -0400
Subject: [openwrt/openwrt]  ipq40xx: add missing case closing symbol
In-Reply-To: <162483517844.22169.15603780193205975821@git-01.infra.openwrt.org>
References: <162483517844.22169.15603780193205975821@git-01.infra.openwrt.org>
Message-ID: <mailman.3775.1624835184.1072.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/fac6096ad62bfed8350b941e79e3cb2c75998a0b

commit fac6096ad62bfed8350b941e79e3cb2c75998a0b
Author: Adrian Schmutzler <freifunk at adrianschmutzler.de>
AuthorDate: Sun Jun 27 20:40:53 2021 +0200

    ipq40xx: add missing case closing symbol
    
    Though not strictly necessary, add the closing symbol to make the
    job easier for future developers editing this file.
    
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh b/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh
index 51ba7071e7..1b8454e4c5 100644
--- a/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh
+++ b/target/linux/ipq40xx/base-files/lib/preinit/05_set_iface_mac_ipq40xx.sh
@@ -29,6 +29,7 @@ preinit_set_mac_address() {
 		base_mac=$(cat /sys/class/net/eth0/address)
 		ip link set dev eth0 address $(macaddr_add "$base_mac" 2)
 		ip link set dev eth1 address $(macaddr_add "$base_mac" 3)
+		;;
 	esac
 }
 


From lede-commits at lists.infradead.org  Sun Jun 27 16:06:19 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 27 Jun 2021 19:06:19 -0400
Subject: [openwrt/openwrt]  ipq806x: refresh config for kernel 5.4
In-Reply-To: <162483517844.22169.15603780193205975821@git-01.infra.openwrt.org>
References: <162483517844.22169.15603780193205975821@git-01.infra.openwrt.org>
Message-ID: <mailman.3776.1624835187.1072.lede-commits@lists.infradead.org>

adrian pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/f727005ae976fdd85f31690f5381d5db51b87701

commit f727005ae976fdd85f31690f5381d5db51b87701
Author: John Audia <graysky at archlinux.us>
AuthorDate: Thu Jun 24 07:51:55 2021 -0400

    ipq806x: refresh config for kernel 5.4
    
    * With kernel 5.4.128, ran: make kernel_menuconfig CONFIG_TARGET=generic
    * Manually added back CONFIG_LEDS_TRIGGER_DISK=y so as not to revert
      f93fcf8923aa ("ipq806x: enable disk-activity LED trigger")
    
    Signed-off-by: John Audia <graysky at archlinux.us>
    [minor commit title/message adjustments]
    Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 target/linux/ipq806x/config-5.4 | 68 ++---------------------------------------
 1 file changed, 2 insertions(+), 66 deletions(-)

diff --git a/target/linux/ipq806x/config-5.4 b/target/linux/ipq806x/config-5.4
index 80549ad304..fd42d371fe 100644
--- a/target/linux/ipq806x/config-5.4
+++ b/target/linux/ipq806x/config-5.4
@@ -4,22 +4,6 @@ CONFIG_ALIGNMENT_TRAP=y
 CONFIG_AR8216_PHY=y
 CONFIG_ARCH_32BIT_OFF_T=y
 CONFIG_ARCH_CLOCKSOURCE_DATA=y
-CONFIG_ARCH_HAS_BINFMT_FLAT=y
-CONFIG_ARCH_HAS_DEBUG_VIRTUAL=y
-CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
-CONFIG_ARCH_HAS_FORTIFY_SOURCE=y
-CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
-CONFIG_ARCH_HAS_KCOV=y
-CONFIG_ARCH_HAS_KEEPINITRD=y
-CONFIG_ARCH_HAS_MEMBARRIER_SYNC_CORE=y
-CONFIG_ARCH_HAS_PHYS_TO_DMA=y
-CONFIG_ARCH_HAS_SETUP_DMA_OPS=y
-CONFIG_ARCH_HAS_SET_MEMORY=y
-CONFIG_ARCH_HAS_STRICT_KERNEL_RWX=y
-CONFIG_ARCH_HAS_STRICT_MODULE_RWX=y
-CONFIG_ARCH_HAS_TEARDOWN_DMA_OPS=y
-CONFIG_ARCH_HAS_TICK_BROADCAST=y
-CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
 CONFIG_ARCH_HIBERNATION_POSSIBLE=y
 CONFIG_ARCH_KEEP_MEMBLOCK=y
 # CONFIG_ARCH_MDM9615 is not set
@@ -34,15 +18,7 @@ CONFIG_ARCH_NR_GPIO=0
 CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
 CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y
 CONFIG_ARCH_QCOM=y
-CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
-CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
-CONFIG_ARCH_SUPPORTS_UPROBES=y
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_ARCH_USE_BUILTIN_BSWAP=y
-CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
-CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT=y
-CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
-CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_ARM=y
 CONFIG_ARM_AMBA=y
 CONFIG_ARM_APPENDED_DTB=y
@@ -75,7 +51,6 @@ CONFIG_BLK_DEV_LOOP=y
 CONFIG_BLK_MQ_PCI=y
 CONFIG_BOUNCE=y
 # CONFIG_CACHE_L2X0 is not set
-CONFIG_CC_HAS_KASAN_GENERIC=y
 CONFIG_CLKDEV_LOOKUP=y
 CONFIG_CLKSRC_QCOM=y
 CONFIG_CLONE_BACKWARDS=y
@@ -196,48 +171,7 @@ CONFIG_HARDIRQS_SW_RESEND=y
 CONFIG_HAS_DMA=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT_MAP=y
-CONFIG_HAVE_ARCH_AUDITSYSCALL=y
-CONFIG_HAVE_ARCH_BITREVERSE=y
-CONFIG_HAVE_ARCH_JUMP_LABEL=y
-CONFIG_HAVE_ARCH_KGDB=y
-CONFIG_HAVE_ARCH_PFN_VALID=y
-CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
-CONFIG_HAVE_ARCH_THREAD_STRUCT_WHITELIST=y
-CONFIG_HAVE_ARCH_TRACEHOOK=y
-CONFIG_HAVE_ARM_ARCH_TIMER=y
-CONFIG_HAVE_ARM_SMCCC=y
-CONFIG_HAVE_CLK=y
-CONFIG_HAVE_CLK_PREPARE=y
-CONFIG_HAVE_CONTEXT_TRACKING=y
-CONFIG_HAVE_COPY_THREAD_TLS=y
-CONFIG_HAVE_C_RECORDMCOUNT=y
-CONFIG_HAVE_DEBUG_KMEMLEAK=y
-CONFIG_HAVE_DMA_CONTIGUOUS=y
-CONFIG_HAVE_DYNAMIC_FTRACE=y
-CONFIG_HAVE_DYNAMIC_FTRACE_WITH_REGS=y
-CONFIG_HAVE_EBPF_JIT=y
-CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
-CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
-CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACER=y
-CONFIG_HAVE_IDE=y
-CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y
-CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
-CONFIG_HAVE_NET_DSA=y
-CONFIG_HAVE_OPROFILE=y
-CONFIG_HAVE_OPTPROBES=y
-CONFIG_HAVE_PCI=y
-CONFIG_HAVE_PERF_EVENTS=y
-CONFIG_HAVE_PERF_REGS=y
-CONFIG_HAVE_PERF_USER_STACK_DUMP=y
-CONFIG_HAVE_PROC_CPU=y
-CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
-CONFIG_HAVE_RSEQ=y
 CONFIG_HAVE_SMP=y
-CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
-CONFIG_HAVE_UID16=y
-CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
 CONFIG_HIGHMEM=y
 # CONFIG_HIGHPTE is not set
 CONFIG_HWMON=y
@@ -340,6 +274,7 @@ CONFIG_NO_HZ_COMMON=y
 CONFIG_NO_HZ_IDLE=y
 CONFIG_NR_CPUS=2
 CONFIG_NVMEM=y
+# CONFIG_NVME_TCP is not set
 CONFIG_OF=y
 CONFIG_OF_ADDRESS=y
 CONFIG_OF_EARLY_FLATTREE=y
@@ -372,6 +307,7 @@ CONFIG_PHYLIB=y
 CONFIG_PHYLINK=y
 # CONFIG_PHY_QCOM_APQ8064_SATA is not set
 CONFIG_PHY_QCOM_IPQ806X_SATA=y
+# CONFIG_PHY_QCOM_IPQ806X_USB is not set
 # CONFIG_PHY_QCOM_PCIE2 is not set
 # CONFIG_PHY_QCOM_QMP is not set
 # CONFIG_PHY_QCOM_QUSB2 is not set


From lede-commits at lists.infradead.org  Sun Jun 27 17:50:02 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 27 Jun 2021 20:50:02 -0400
Subject: [openwrt/openwrt]  zram-swap: clean up the log messages
In-Reply-To: <162484140194.21854.8688059351195879380@git-01.infra.openwrt.org>
References: <162484140194.21854.8688059351195879380@git-01.infra.openwrt.org>
Message-ID: <mailman.3779.1624841406.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/d31783329b7ccf23d1c084873f1ff084267df4c3

commit d31783329b7ccf23d1c084873f1ff084267df4c3
Author: Rui Salvaterra <rsalvaterra at gmail.com>
AuthorDate: Thu Jun 24 20:05:23 2021 +0100

    zram-swap: clean up the log messages
    
    Remove redundant tags and name things more consistently.
    
    Signed-off-by: Rui Salvaterra <rsalvaterra at gmail.com>
    [removed superflous dash]
    Signed-off-by: Paul Spooren <mail at aparcar.org>
---
 package/system/zram-swap/files/zram.init | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init
index ea9b55680e..1a9cefeff5 100755
--- a/package/system/zram-swap/files/zram.init
+++ b/package/system/zram-swap/files/zram.init
@@ -2,8 +2,8 @@
 
 START=15
 
-extra_command "compact" "Trigger compaction for all Z-RAM swap dev's"
-extra_command "status" "Print out information & statistics about Z-RAM swap devices"
+extra_command "compact" "Trigger compaction for all zram swap devices"
+extra_command "status" "Print out information & statistics about zram swap devices"
 
 ram_getsize()
 {
@@ -60,15 +60,15 @@ zram_comp_algo()
 	local zram_comp_algo="$( uci -q get system. at system[0].zram_comp_algo )"
 
 	if [ -z "$zram_comp_algo" ]; then
-		# lzo-rle fails on small RAM devices, default to lzo, which is always available
+		# default to lzo, which is always available
 		zram_comp_algo="lzo"
 	fi
 
 	if [ $(grep -c "$zram_comp_algo" /sys/block/$( basename $dev )/comp_algorithm) -ne 0 ]; then
-		logger -s -t zram_comp_algo -p daemon.debug "Set compression algorithm '$zram_comp_algo' for zram '$dev'"
+		logger -s -t zram_comp_algo -p daemon.debug "set compression algorithm '$zram_comp_algo' for zram '$dev'"
 		echo $zram_comp_algo > "/sys/block/$( basename $dev )/comp_algorithm"
 	else
-		logger -s -t zram_comp_algo -p daemon.debug "Compression algorithm '$zram_comp_algo' is not supported for '$dev'"
+		logger -s -t zram_comp_algo -p daemon.debug "compression algorithm '$zram_comp_algo' is not supported for '$dev'"
 	fi
 }
 
@@ -79,7 +79,7 @@ zram_stats()
 
 	printf "\nGathering stats info for zram device \"$( basename "$1" )\"\n\n"
 
-	printf "Z-RAM\n-----\n"
+	printf "ZRAM\n----\n"
 	printf "%-25s - %s\n" "Block device" $zdev
 	awk '{ printf "%-25s - %d MiB\n", "Device size", $1/1024/1024 }' <$zdev/disksize
 	printf "%-25s - %s\n" "Compression algo" "$(cat $zdev/comp_algorithm)"
@@ -131,7 +131,7 @@ start()
 	}
 
 	if [ $( grep -cs zram /proc/swaps ) -ne 0 ]; then
-		logger -s -t zram_start -p daemon.notice "[OK] zram swap is already mounted"
+		logger -s -t zram_start -p daemon.notice "zram swap is already mounted"
 		return 1
 	fi
 
@@ -149,7 +149,7 @@ start()
 		zram_priority="100"
 	fi
 
-	logger -s -t zram_start -p daemon.debug "activating '$zram_dev' for swapping ($zram_size MegaBytes)"
+	logger -s -t zram_start -p daemon.debug "activating '$zram_dev' for swapping ($zram_size MiB)"
 
 	zram_reset "$zram_dev" "enforcing defaults"
 	zram_comp_algo "$zram_dev"


From lede-commits at lists.infradead.org  Sun Jun 27 17:50:01 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 27 Jun 2021 20:50:01 -0400
Subject: [openwrt/openwrt] zram-swap: set the zram swap priority to 100 by
 default
In-Reply-To: <162484140194.21854.8688059351195879380@git-01.infra.openwrt.org>
References: <162484140194.21854.8688059351195879380@git-01.infra.openwrt.org>
Message-ID: <mailman.3780.1624841406.1072.lede-commits@lists.infradead.org>

aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/7720de419411562cdf08eb98ace7416fe33eeb43

commit 7720de419411562cdf08eb98ace7416fe33eeb43
Author: Rui Salvaterra <rsalvaterra at gmail.com>
AuthorDate: Thu Jun 24 20:05:22 2021 +0100

    zram-swap: set the zram swap priority to 100 by default
    
    New swap devices are added in decreasing priority order, starting at -1. Make
    sure the zram swap device has the highest priority, by default.
    
    Signed-off-by: Rui Salvaterra <rsalvaterra at gmail.com>
---
 package/system/zram-swap/files/zram.init | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init
index 9fce5e4797..ea9b55680e 100755
--- a/package/system/zram-swap/files/zram.init
+++ b/package/system/zram-swap/files/zram.init
@@ -144,7 +144,10 @@ start()
 
 	local zram_size="$( zram_getsize )"
 	local zram_priority="$( uci -q get system. at system[0].zram_priority )"
-	zram_priority=${zram_priority:+-p $zram_priority}
+
+	if [ -z "$zram_priority" ]; then
+		zram_priority="100"
+	fi
 
 	logger -s -t zram_start -p daemon.debug "activating '$zram_dev' for swapping ($zram_size MegaBytes)"
 
@@ -152,7 +155,7 @@ start()
 	zram_comp_algo "$zram_dev"
 	echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename "$zram_dev" )/disksize"
 	busybox mkswap "$zram_dev"
-	busybox swapon -d $zram_priority "$zram_dev"
+	busybox swapon -d -p $zram_priority "$zram_dev"
 }
 
 stop()


From lede-commits at lists.infradead.org  Mon Jun 28 00:56:12 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 28 Jun 2021 03:56:12 -0400
Subject: [buildbot]  Bump to latest Buildbot release 3.2.0
In-Reply-To: <162486697262.31937.9823116042418482982@git-01.infra.openwrt.org>
References: <162486697262.31937.9823116042418482982@git-01.infra.openwrt.org>
Message-ID: <mailman.4052.1624866977.1072.lede-commits@lists.infradead.org>

ynezz pushed a commit to buildbot.git, branch master:
https://git.openwrt.org/ffa094e833733c96f14420c26605f02be7f0fc36

commit ffa094e833733c96f14420c26605f02be7f0fc36
Author: Petr ?tetiar <ynezz at true.cz>
AuthorDate: Mon Jun 28 08:39:14 2021 +0200

    Bump to latest Buildbot release 3.2.0
    
    Signed-off-by: Petr ?tetiar <ynezz at true.cz>
---
 .gitlab-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b8d1974..07a0407 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,5 +1,5 @@
 variables:
-  BUILDBOT_VERSION: 3.0.2
+  BUILDBOT_VERSION: 3.2.0
   OPENWRT_VERSION: $CI_COMMIT_SHORT_SHA
 
 include:


From lede-commits at lists.infradead.org  Mon Jun 28 02:07:58 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 28 Jun 2021 05:07:58 -0400
Subject: [openwrt/openwrt] ath79: mikrotik: remove rb912 gpio-beeper module
 dependency
In-Reply-To: <162487127854.21909.6636936942034450397@git-01.infra.openwrt.org>
References: <162487127854.21909.6636936942034450397@git-01.infra.openwrt.org>
Message-ID: <mailman.4062.1624871282.1072.lede-commits@lists.infradead.org>

xback pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/39e53f72f720a5965ca2bdeaafc7685d2ec51d66

commit 39e53f72f720a5965ca2bdeaafc7685d2ec51d66
Author: Koen Vandeputte <koen.vandeputte at ncentric.com>
AuthorDate: Wed Jun 23 16:57:37 2021 +0200

    ath79: mikrotik: remove rb912 gpio-beeper module dependency
    
    The beeper is currently not fully functional and has also
    been removed from DTS.
    
    Also remove the dependency for the gpio-beeper module.
    
    Fixes: 695a1cd53c ("ath79: add support for MikroTik RouterBOARD 912UAG-2HPnD")
    Signed-off-by: Koen Vandeputte <koen.vandeputte at ncentric.com>
---
 target/linux/ath79/image/mikrotik.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ath79/image/mikrotik.mk b/target/linux/ath79/image/mikrotik.mk
index 96a94793a9..4256f77379 100644
--- a/target/linux/ath79/image/mikrotik.mk
+++ b/target/linux/ath79/image/mikrotik.mk
@@ -13,7 +13,7 @@ define Device/mikrotik_routerboard-912uag-2hpnd
   $(Device/mikrotik_nand)
   SOC := ar9342
   DEVICE_MODEL := RouterBOARD 912UAG-2HPnD
-  DEVICE_PACKAGES += kmod-usb-ehci kmod-usb2 kmod-gpio-beeper
+  DEVICE_PACKAGES += kmod-usb-ehci kmod-usb2
   SUPPORTED_DEVICES += rb-912uag-2hpnd
 endef
 TARGET_DEVICES += mikrotik_routerboard-912uag-2hpnd


From lede-commits at lists.infradead.org  Mon Jun 28 08:24:35 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 28 Jun 2021 11:24:35 -0400
Subject: [openwrt/openwrt]  base-files: wifi: tidy up the reconf code
In-Reply-To: <162489387074.4305.11560817924801897860@git-01.infra.openwrt.org>
References: <162489387074.4305.11560817924801897860@git-01.infra.openwrt.org>
Message-ID: <mailman.4166.1624893877.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/e8b54296092118fbef75de796d57799cc6c7b927

commit e8b54296092118fbef75de796d57799cc6c7b927
Author: Bob Cantor <coxede6557 at w3boats.com>
AuthorDate: Fri Jun 25 04:48:45 2021 +1000

    base-files: wifi: tidy up the reconf code
    
    commit 5edbd390d321532d9a697d6895a1a7c71c40bd5d rearranged the
    "wifi up" code.
    
    This commit tidies up the "wifi reconf" code so as to
    keep it aligned with the "wifi up" code.
    
    branches affected: trunk, 21.02
    
    Signed-off-by: Bob Cantor <coxede6557 at w3boats.com>
---
 package/base-files/files/sbin/wifi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi
index b2dde6f01c..6b9662fe93 100755
--- a/package/base-files/files/sbin/wifi
+++ b/package/base-files/files/sbin/wifi
@@ -135,6 +135,7 @@ wifi_updown() {
 	[ reconf = "$1" ] && {
 		scan_wifi
 		cmd=reconf
+		ubus call network reload
 	}
 	ubus_wifi_cmd "$cmd" "$2"
 	_wifi_updown "$@"
@@ -247,7 +248,7 @@ case "$1" in
 	reload) wifi_reload "$2";;
 	reload_legacy) wifi_reload_legacy "$2";;
 	--help|help) usage;;
-	reconf) ubus call network reload; wifi_updown "reconf" "$2";;
+	reconf) wifi_updown "reconf" "$2";;
 	''|up) wifi_updown "enable" "$2";;
 	*) usage; exit 1;;
 esac


From lede-commits at lists.infradead.org  Mon Jun 28 08:24:34 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 28 Jun 2021 11:24:34 -0400
Subject: [openwrt/openwrt] base-files: wifi: swap the order of some ubus calls
In-Reply-To: <162489387074.4305.11560817924801897860@git-01.infra.openwrt.org>
References: <162489387074.4305.11560817924801897860@git-01.infra.openwrt.org>
Message-ID: <mailman.4167.1624893877.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/b82cc8071366b8e96904a1b52af503442069b20d

commit b82cc8071366b8e96904a1b52af503442069b20d
Author: Bob Cantor <coxede6557 at w3boats.com>
AuthorDate: Fri Jun 25 04:37:17 2021 +1000

    base-files: wifi:  swap the order of some ubus calls
    
    "/sbin/wifi up" makes three ubus calls:
    1. ubus call network reload
    2. ubus call network.wireless down
    3. ubus call network.wireless up
    
    The first and third ubus calls call drv_mac80211_setup,
    while the second ubus call triggers wireless_device_setup_cancel,
    so the call sequence becomes,
    
    1. drv_mac80211_setup
    2. wireless_device_setup_cancel
    3. drv_mac80211_setup
    
    This commit swaps the order of the first two ubus calls,
    1. ubus call network.wireless down
    2. ubus call network reload
    3. ubus call network.wireless up
    
    Consequently drv_mac80211_setup is only called once,
    and two related bugs (#FS3784 and #FS3902) are no longer triggered
    by /sbin/wifi.
    
    branches affected: trunk, 21.02
    
    Signed-off-by: Bob Cantor <coxede6557 at w3boats.com>
---
 package/base-files/files/sbin/wifi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi
index 75759b94f3..b2dde6f01c 100755
--- a/package/base-files/files/sbin/wifi
+++ b/package/base-files/files/sbin/wifi
@@ -130,6 +130,7 @@ wifi_updown() {
 		ubus_wifi_cmd "$cmd" "$2"
 		scan_wifi
 		cmd=up
+		ubus call network reload
 	}
 	[ reconf = "$1" ] && {
 		scan_wifi
@@ -247,6 +248,6 @@ case "$1" in
 	reload_legacy) wifi_reload_legacy "$2";;
 	--help|help) usage;;
 	reconf) ubus call network reload; wifi_updown "reconf" "$2";;
-	''|up) ubus call network reload; wifi_updown "enable" "$2";;
+	''|up) wifi_updown "enable" "$2";;
 	*) usage; exit 1;;
 esac


From lede-commits at lists.infradead.org  Mon Jun 28 08:24:32 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 28 Jun 2021 11:24:32 -0400
Subject: [openwrt/openwrt] mac80211: always call wireless_set_data (FS#3784)
In-Reply-To: <162489387074.4305.11560817924801897860@git-01.infra.openwrt.org>
References: <162489387074.4305.11560817924801897860@git-01.infra.openwrt.org>
Message-ID: <mailman.4168.1624893880.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/d515f6b6cde357bf480d32a7387f07ea40e85e52

commit d515f6b6cde357bf480d32a7387f07ea40e85e52
Author: Bob Cantor <coxede6557 at w3boats.com>
AuthorDate: Fri Jun 25 04:07:34 2021 +1000

    mac80211: always call wireless_set_data  (FS#3784)
    
    When wifi is turned off, drv_mac80211_teardown sometimes fails (silently)
    because the device to be torn down is not defined.
    
    This situation arises if drv_mac80211_setup was called twice when
    wifi was turned on.
    
    This commit ensures that the device to be torn down is always defined
    in drv_mac80211_teardown.
    
    Steps to reproduce:
    
    1) Use /sbin/wifi to turn on wifi.
       uci set wireless. at wifi-iface[0].disabled=0
       uci set wireless. at wifi-device[0].disabled=0
       uci commit
       wifi
    
    2) Use /sbin/wifi to turn off wifi.
       uci set wireless. at wifi-device[0].disabled=1
       uci commit
       wifi
    
    3) Observe that wifi is still up.
    
    branches affected: trunk, 21.02
    
    Signed-off-by: Bob Cantor <coxede6557 at w3boats.com>
---
 package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index c7437d5a96..ffb3662d04 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -1021,10 +1021,8 @@ drv_mac80211_setup() {
 		return 1
 	}
 
-	[ -z "$(uci -q -P /var/state show wireless._${phy})" ] && {
-		uci -q -P /var/state set wireless._${phy}=phy
-		wireless_set_data phy="$phy"
-	}
+	wireless_set_data phy="$phy"
+	[ -z "$(uci -q -P /var/state show wireless._${phy})" ] && uci -q -P /var/state set wireless._${phy}=phy
 
 	OLDAPLIST=$(uci -q -P /var/state get wireless._${phy}.aplist)
 	OLDSPLIST=$(uci -q -P /var/state get wireless._${phy}.splist)


From lede-commits at lists.infradead.org  Mon Jun 28 08:24:30 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 28 Jun 2021 11:24:30 -0400
Subject: [openwrt/openwrt]  iwinfo: update to the latest version
In-Reply-To: <162489387074.4305.11560817924801897860@git-01.infra.openwrt.org>
References: <162489387074.4305.11560817924801897860@git-01.infra.openwrt.org>
Message-ID: <mailman.4169.1624893882.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/019eca154557e2e2fefa67b4430cab622035c382

commit 019eca154557e2e2fefa67b4430cab622035c382
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Mon Jun 28 15:44:51 2021 +0200

    iwinfo: update to the latest version
    
    c9b1672f5a83 nl80211: fix path compatibility issue
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/network/utils/iwinfo/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile
index b7c8370bba..9124e5fa07 100644
--- a/package/network/utils/iwinfo/Makefile
+++ b/package/network/utils/iwinfo/Makefile
@@ -11,9 +11,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git
-PKG_SOURCE_DATE:=2021-06-09
-PKG_SOURCE_VERSION:=c0414642fead263a4a6a686ad3cb7e965ec8a23a
-PKG_MIRROR_HASH:=c5686bbae86753c53db03a686b034bbb80d31107cc359ebd8522ea1c82db35ea
+PKG_SOURCE_DATE:=2021-06-28
+PKG_SOURCE_VERSION:=c9b1672f5a83c8dcb14fdbaee651f775a7defe52
+PKG_MIRROR_HASH:=f33779035153da6bd0b2f100f402f62f1554ab87ed6fbbd938d41df6b9947a1f
 PKG_MAINTAINER:=Jo-Philipp Wich <jo at mein.io>
 PKG_LICENSE:=GPL-2.0
 


From lede-commits at lists.infradead.org  Mon Jun 28 08:24:31 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 28 Jun 2021 11:24:31 -0400
Subject: [openwrt/openwrt]  mac80211: fix no_reload logic (FS#3902)
In-Reply-To: <162489387074.4305.11560817924801897860@git-01.infra.openwrt.org>
References: <162489387074.4305.11560817924801897860@git-01.infra.openwrt.org>
Message-ID: <mailman.4172.1624893882.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/a29ab3b79affb62fda82e0825ed811eaf482dd3c

commit a29ab3b79affb62fda82e0825ed811eaf482dd3c
Author: Bob Cantor <coxede6557 at w3boats.com>
AuthorDate: Fri Jun 25 03:18:33 2021 +1000

    mac80211: fix no_reload logic (FS#3902)
    
    If drv_mac80211_setup is called twice with the same wifi configuration,
    then the second call returns early with error HOSTAPD_START_FAILED.
    (wifi works nevertheless, despite the fact that setup is incomplete.  But
    "ubus call network.wireless status" erroneously reports that radio0 is down.)
    
    The relevant part of drv_mac80211_setup is,
    
    if [ "$no_reload" != "0" ]; then
            add_ap=1
            ubus wait_for hostapd
            local hostapd_res="$(ubus call hostapd config_add "{\"iface\":\"$primary_ap\", \"config\":\"${hostapd_conf_file}\"}")"
            ret="$?"
            [ "$ret" != 0 -o -z "$hostapd_res" ] && {
                    wireless_setup_failed HOSTAPD_START_FAILED
                    return
            }
            wireless_add_process "$(jsonfilter -s "$hostapd_res" -l 1 -e @.pid)" "/usr/sbin/hostapd" 1 1
    fi
    
    This commit sets no_reload = 0 during the second call of drv_mac80211_setup.
    
    It is perhaps worth providing a way to reproduce the situation
    where drv_mac80211_setup is called twice.
    
    When /sbin/wifi is used to turn on wifi,
       uci set wireless. at wifi-iface[0].disabled=0
       uci set wireless. at wifi-device[0].disabled=0
       uci commit
       wifi
    
    /sbin/wifi makes the following ubus calls,
       ubus call network reload
       ubus call network.wireless down
       ubus call network.wireless up
    
    The first and third ubus calls both call drv_mac80211_setup,
    while the second ubus call triggers wireless_device_setup_cancel.
    So the call sequence becomes,
    
       drv_mac80211_setup
       wireless_device_setup_cancel
       drv_mac80211_setup
    
    In contrast, when LuCI is used to turn on wifi only a single call
    is made to drv_mac80211_setup.
    
    branches affected: trunk, 21.02
    
    Signed-off-by: Bob Cantor <coxede6557 at w3boats.com>
---
 package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index b6e3302f8b..c7437d5a96 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -1117,6 +1117,7 @@ drv_mac80211_setup() {
 	[ -n "$hostapd_ctrl" ] && {
 		local no_reload=1
 		if [ -n "$(ubus list | grep hostapd.$primary_ap)" ]; then
+			no_reload=0
 			[ "${NEW_MD5}" = "${OLD_MD5}" ] || {
 				ubus call hostapd.$primary_ap reload
 				no_reload=$?


From lede-commits at lists.infradead.org  Mon Jun 28 08:24:33 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 28 Jun 2021 11:24:33 -0400
Subject: [openwrt/openwrt]  mac80211: print an error if wifi teardown fails
In-Reply-To: <162489387074.4305.11560817924801897860@git-01.infra.openwrt.org>
References: <162489387074.4305.11560817924801897860@git-01.infra.openwrt.org>
Message-ID: <mailman.4173.1624893885.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/3933e29d1b87c713167cf4730b68e5f18af4f140

commit 3933e29d1b87c713167cf4730b68e5f18af4f140
Author: Bob Cantor <coxede6557 at w3boats.com>
AuthorDate: Fri Jun 25 04:14:47 2021 +1000

    mac80211: print an error if wifi teardown fails
    
    drv_mac80211_teardown fails silently if the device to be torn down is
    not defined.  This commit prints an error message.
    
    branches affected: trunk, 21.02
    
    Signed-off-by: Bob Cantor <coxede6557 at w3boats.com>
---
 package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index ffb3662d04..0b7a84d7c9 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -1190,6 +1190,10 @@ drv_mac80211_teardown() {
 	json_select data
 	json_get_vars phy
 	json_select ..
+	[ -n "$phy" ] || {
+		echo "Bug: PHY is undefined for device '$1'"
+		return 1
+	}
 
 	mac80211_interface_cleanup "$phy"
 	uci -q -P /var/state revert wireless._${phy}


From lede-commits at lists.infradead.org  Tue Jun 29 03:27:45 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 29 Jun 2021 06:27:45 -0400
Subject: [openwrt/openwrt] dnsmasq: distinct Ubus names for multiple instances
In-Reply-To: <162496246541.12684.10952461257810288696@git-01.infra.openwrt.org>
References: <162496246541.12684.10952461257810288696@git-01.infra.openwrt.org>
Message-ID: <mailman.4323.1624962471.1072.lede-commits@lists.infradead.org>

ldir pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/ba5bd8e556b2e7573d27b16e005ba287e066f795

commit ba5bd8e556b2e7573d27b16e005ba287e066f795
Author: Etan Kissling <etan.kissling at gmail.com>
AuthorDate: Sun Jun 27 22:02:46 2021 +0000

    dnsmasq: distinct Ubus names for multiple instances
    
    Currently, when using multiple dnsmasq instances they are all assigned
    to the same Ubus instance name. This does not work, as only a single
    instance can register with Ubus at a time. In the log, this leads to
    `Cannot add object to UBus: Invalid argument` error messages.
    Furthermore, upstream 3c93e8eb41952a9c91699386132d6fe83050e9be changes
    behaviour so that instead of the log, dnsmasq exits at start instead.
    
    With this patch, all dnsmasq instances are assigned unique names so that
    they can register with Ubus concurrently. One of the enabled instances
    is always assigned the previous default name "dnsmasq" to avoid breaking
    backwards compatibility with other software relying on that default.
    Previously, a random instance got assigned that name (while the others
    produced error logs). Now, the first unnamed dnsmasq config section is
    assigned the default name. If there are no unnamed dnsmasq sections the
    first encountered named dnsmasq config section is assigned instead.
    
    A similar issue exists for Dbus and was similarly addressed.
    
    Signed-off-by: Etan Kissling <etan.kissling at gmail.com>
    [tweaked commit message] dnsmasq was not crashing it is exiting
    Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 .../network/services/dnsmasq/files/dnsmasq.init    | 32 ++++++++++++++++++++--
 1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 44e7d2d4f9..c4c262ad69 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -161,7 +161,7 @@ append_server() {
 }
 
 append_rev_server() {
-        xappend "--rev-server=$1"
+	xappend "--rev-server=$1"
 }
 
 append_address() {
@@ -878,8 +878,16 @@ dnsmasq_start()
 	append_bool "$cfg" noresolv "--no-resolv"
 	append_bool "$cfg" localise_queries "--localise-queries"
 	append_bool "$cfg" readethers "--read-ethers"
-	append_bool "$cfg" dbus "--enable-dbus"
-	append_bool "$cfg" ubus "--enable-ubus"	1
+
+	local instance_name="dnsmasq.$cfg"
+	if [ "$cfg" = "$DEFAULT_INSTANCE" ]; then
+		instance_name="dnsmasq"
+	fi
+	config_get_bool dbus "$cfg" "dbus" 0
+	[ $dbus -gt 0 ] && xappend "--enable-dbus=uk.org.thekelleys.$instance_name"
+	config_get_bool ubus "$cfg" "ubus" 1
+	[ $ubus -gt 0 ] && xappend "--enable-ubus=$instance_name"
+
 	append_bool "$cfg" expandhosts "--expand-hosts"
 	config_get tftp_root "$cfg" "tftp_root"
 	[ -n "$tftp_root" ] && mkdir -p "$tftp_root" && append_bool "$cfg" enable_tftp "--enable-tftp"
@@ -1160,6 +1168,7 @@ boot()
 start_service() {
 	local instance="$1"
 	local instance_found=0
+	local first_instance=""
 
 	. /lib/functions/network.sh
 
@@ -1170,10 +1179,27 @@ start_service() {
 			if [ -n "$instance" ] && [ "$instance" = "$name" ]; then
 				instance_found=1
 			fi
+			if [ -z "$DEFAULT_INSTANCE" ]; then
+				local disabled
+				config_get_bool disabled "$name" disabled 0
+				if [ "$disabled" -eq 0 ]; then
+					# First enabled section will be assigned default instance name.
+					# Unnamed sections get precedence over named sections.
+					if expr "$cfg" : 'cfg[0-9a-f]*$' >/dev/null = "9"; then # See uci_fixup_section.
+						DEFAULT_INSTANCE="$name" # Unnamed config section.
+					elif [ -z "$first_instance" ]; then
+						first_instance="$name"
+					fi
+				fi
+			fi
 		fi
 	}
 
+	DEFAULT_INSTANCE=""
 	config_load dhcp
+	if [ -z "$DEFAULT_INSTANCE" ]; then
+		DEFAULT_INSTANCE="$first_instance" # No unnamed config section was found.
+	fi
 
 	if [ -n "$instance" ]; then
 		[ "$instance_found" -gt 0 ] || return


From lede-commits at lists.infradead.org  Tue Jun 29 04:33:07 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 29 Jun 2021 07:33:07 -0400
Subject: [openwrt/openwrt] mac80211: fix a regression in starting
 aggregation sessions on mesh interfaces
In-Reply-To: <162496638761.1872.5832409759454894284@git-01.infra.openwrt.org>
References: <162496638761.1872.5832409759454894284@git-01.infra.openwrt.org>
Message-ID: <mailman.4342.1624966397.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/8bb4437c01ca35a5ac67e391630a1b24cb52dbb7

commit 8bb4437c01ca35a5ac67e391630a1b24cb52dbb7
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Tue Jun 29 13:32:31 2021 +0200

    mac80211: fix a regression in starting aggregation sessions on mesh interfaces
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...x-starting-aggregation-sessions-on-mesh-i.patch | 112 +++++++++++++++++++++
 1 file changed, 112 insertions(+)

diff --git a/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch b/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch
new file mode 100644
index 0000000000..56eafaf847
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch
@@ -0,0 +1,112 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Tue, 29 Jun 2021 13:25:09 +0200
+Subject: [PATCH] mac80211: fix starting aggregation sessions on mesh
+ interfaces
+
+The logic for starting aggregation sessions was recently moved from minstrel_ht
+to mac80211, into the subif tx handler just after the sta lookup.
+Unfortunately this didn't work for mesh interfaces, since the sta lookup is
+deferred until a much later point in time on those.
+Fix this by also calling the aggregation check right after the deferred sta
+lookup.
+
+Fixes: 08a46c642001 ("mac80211: move A-MPDU session check from minstrel_ht to mac80211")
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -1159,6 +1159,29 @@ static bool ieee80211_tx_prep_agg(struct
+ 	return queued;
+ }
+ 
++static void
++ieee80211_aggr_check(struct ieee80211_sub_if_data *sdata,
++		     struct sta_info *sta,
++		     struct sk_buff *skb)
++{
++	struct rate_control_ref *ref = sdata->local->rate_ctrl;
++	u16 tid;
++
++	if (!ref || !(ref->ops->capa & RATE_CTRL_CAPA_AMPDU_TRIGGER))
++		return;
++
++	if (!sta || !sta->sta.ht_cap.ht_supported ||
++	    !sta->sta.wme || skb_get_queue_mapping(skb) == IEEE80211_AC_VO ||
++	    skb->protocol == sdata->control_port_protocol)
++		return;
++
++	tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
++	if (likely(sta->ampdu_mlme.tid_tx[tid]))
++		return;
++
++	ieee80211_start_tx_ba_session(&sta->sta, tid, 0);
++}
++
+ /*
+  * initialises @tx
+  * pass %NULL for the station if unknown, a valid pointer if known
+@@ -1172,6 +1195,7 @@ ieee80211_tx_prepare(struct ieee80211_su
+ 	struct ieee80211_local *local = sdata->local;
+ 	struct ieee80211_hdr *hdr;
+ 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
++	bool aggr_check = false;
+ 	int tid;
+ 
+ 	memset(tx, 0, sizeof(*tx));
+@@ -1202,8 +1226,10 @@ ieee80211_tx_prepare(struct ieee80211_su
+ 			   tx->sdata->control_port_protocol == tx->skb->protocol) {
+ 			tx->sta = sta_info_get_bss(sdata, hdr->addr1);
+ 		}
+-		if (!tx->sta && !is_multicast_ether_addr(hdr->addr1))
++		if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) {
+ 			tx->sta = sta_info_get(sdata, hdr->addr1);
++			aggr_check = true;
++		}
+ 	}
+ 
+ 	if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) &&
+@@ -1213,8 +1239,12 @@ ieee80211_tx_prepare(struct ieee80211_su
+ 		struct tid_ampdu_tx *tid_tx;
+ 
+ 		tid = ieee80211_get_tid(hdr);
+-
+ 		tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]);
++		if (!tid_tx && aggr_check) {
++			ieee80211_aggr_check(sdata, tx->sta, skb);
++			tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]);
++		}
++
+ 		if (tid_tx) {
+ 			bool queued;
+ 
+@@ -3949,29 +3979,6 @@ void ieee80211_txq_schedule_start(struct
+ }
+ EXPORT_SYMBOL(ieee80211_txq_schedule_start);
+ 
+-static void
+-ieee80211_aggr_check(struct ieee80211_sub_if_data *sdata,
+-		     struct sta_info *sta,
+-		     struct sk_buff *skb)
+-{
+-	struct rate_control_ref *ref = sdata->local->rate_ctrl;
+-	u16 tid;
+-
+-	if (!ref || !(ref->ops->capa & RATE_CTRL_CAPA_AMPDU_TRIGGER))
+-		return;
+-
+-	if (!sta || !sta->sta.ht_cap.ht_supported ||
+-	    !sta->sta.wme || skb_get_queue_mapping(skb) == IEEE80211_AC_VO ||
+-	    skb->protocol == sdata->control_port_protocol)
+-		return;
+-
+-	tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
+-	if (likely(sta->ampdu_mlme.tid_tx[tid]))
+-		return;
+-
+-	ieee80211_start_tx_ba_session(&sta->sta, tid, 0);
+-}
+-
+ void __ieee80211_subif_start_xmit(struct sk_buff *skb,
+ 				  struct net_device *dev,
+ 				  u32 info_flags,


From lede-commits at lists.infradead.org  Wed Jun 30 00:25:03 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 30 Jun 2021 03:25:03 -0400
Subject: [openwrt/openwrt]  busybox: sysntpd: add trigger to reload server
In-Reply-To: <162503790325.25280.10791091646484635004@git-01.infra.openwrt.org>
References: <162503790325.25280.10791091646484635004@git-01.infra.openwrt.org>
Message-ID: <mailman.4558.1625037910.1072.lede-commits@lists.infradead.org>

zorun pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/9fa925362f285614e90c2d7a286efd9d3d41db45

commit 9fa925362f285614e90c2d7a286efd9d3d41db45
Author: Alexey Dobrovolsky <dobrovolskiy.alexey at gmail.com>
AuthorDate: Sun Jun 6 02:25:02 2021 +0300

    busybox: sysntpd: add trigger to reload server
    
    sysntpd server becomes unavailable if the index of the bound
    interface changes. So let's add an interface trigger to reload sysntpd.
    
    This patch also adds the ability for the sysntpd script to handle
    uci interface name from configuration.
    
    Fixes: 4da60500ebd2 ("busybox: sysntpd: option to bind server to iface")
    Signed-off-by: Alexey Dobrovolsky <dobrovolskiy.alexey at gmail.com>
    Reviewed-by: Philip Prindeville <philipp at redfish-solutions.com>
    (cherry picked from commit 88114f617ae7bffe13d19d7b9575659a3d3cd9b6)
---
 package/utils/busybox/files/sysntpd | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/package/utils/busybox/files/sysntpd b/package/utils/busybox/files/sysntpd
index c4c311c242..074f14b8f8 100755
--- a/package/utils/busybox/files/sysntpd
+++ b/package/utils/busybox/files/sysntpd
@@ -56,7 +56,14 @@ start_ntpd_instance() {
 	procd_set_param command "$PROG" -n -N
 	if [ "$enable_server" = "1" ]; then
 		procd_append_param command -l
-		[ -n "$interface" ] && procd_append_param command -I $interface
+		[ -n "$interface" ] && {
+			local ifname
+
+			network_get_device ifname "$interface" || \
+				ifname="$interface"
+			procd_append_param command -I "$ifname"
+			procd_append_param netdev "$ifname"
+		}
 	fi
 	[ -x "$HOTPLUG_SCRIPT" ] && procd_append_param command -S "$HOTPLUG_SCRIPT"
 	for peer in $server; do
@@ -79,11 +86,12 @@ start_ntpd_instance() {
 }
 
 start_service() {
+	. /lib/functions/network.sh
 	validate_ntp_section ntp start_ntpd_instance
 }
 
 service_triggers() {
-	local script name use_dhcp
+	local script name use_dhcp enable_server interface
 
 	script=$(readlink -f "$initscript")
 	name=$(basename ${script:-$initscript})
@@ -106,5 +114,17 @@ service_triggers() {
 		fi
 	}
 
+	config_get_bool enable_server ntp enable_server 0
+	config_get interface ntp interface
+
+	[ $enable_server -eq 1 ] && [ -n "$interface" ] && {
+		local ifname
+
+		network_get_device ifname "$interface" || \
+			ifname="$interface"
+		procd_add_interface_trigger "interface.*" "$ifname" \
+			/etc/init.d/"$name" reload
+	}
+
 	procd_add_validation validate_ntp_section
 }


From lede-commits at lists.infradead.org  Wed Jun 30 10:09:51 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 30 Jun 2021 13:09:51 -0400
Subject: [openwrt/openwrt] mac80211: backport fix for nl80211 control port
 tx (fixes FS#3857)
In-Reply-To: <162507299124.13152.17942992515381244243@git-01.infra.openwrt.org>
References: <162507299124.13152.17942992515381244243@git-01.infra.openwrt.org>
Message-ID: <mailman.4718.1625072996.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/de499573006ab4f32ded9fd66a62ec5e0c183e8a

commit de499573006ab4f32ded9fd66a62ec5e0c183e8a
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Jun 30 19:08:59 2021 +0200

    mac80211: backport fix for nl80211 control port tx (fixes FS#3857)
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...-enable-QoS-support-for-nl80211-ctrl-port.patch | 116 +++++++++++++++++++++
 ...n-t-apply-flow-control-on-management-fram.patch |   4 +-
 ...0211-set-sk_pacing_shift-for-802.3-txpath.patch |   2 +-
 ...ve-A-MPDU-session-check-from-minstrel_ht-.patch |   6 +-
 ...all-ieee80211_tx_h_rate_ctrl-when-dequeue.patch |  12 +--
 ...dd-rate-control-support-for-encap-offload.patch |   2 +-
 ...x-starting-aggregation-sessions-on-mesh-i.patch |   8 +-
 7 files changed, 133 insertions(+), 17 deletions(-)

diff --git a/package/kernel/mac80211/patches/subsys/316-mac80211-enable-QoS-support-for-nl80211-ctrl-port.patch b/package/kernel/mac80211/patches/subsys/316-mac80211-enable-QoS-support-for-nl80211-ctrl-port.patch
new file mode 100644
index 0000000000..4be011ffec
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/316-mac80211-enable-QoS-support-for-nl80211-ctrl-port.patch
@@ -0,0 +1,116 @@
+From: Markus Theil <markus.theil at tu-ilmenau.de>
+Date: Sat, 6 Feb 2021 12:51:12 +0100
+Subject: [PATCH] mac80211: enable QoS support for nl80211 ctrl port
+
+This patch unifies sending control port frames
+over nl80211 and AF_PACKET sockets a little more.
+
+Before this patch, EAPOL frames got QoS prioritization
+only when using AF_PACKET sockets.
+
+__ieee80211_select_queue only selects a QoS-enabled queue
+for control port frames, when the control port protocol
+is set correctly on the skb. For the AF_PACKET path this
+works, but the nl80211 path used ETH_P_802_3.
+
+Another check for injected frames in wme.c then prevented
+the QoS TID to be copied in the frame.
+
+In order to fix this, get rid of the frame injection marking
+for nl80211 ctrl port and set the correct ethernet protocol.
+
+Please note:
+An erlier version of this path tried to prevent
+frame aggregation for control port frames in order to speed up
+the initial connection setup a little. This seemed to cause
+issues on my older Intel dvm-based hardware, and was therefore
+removed again. Future commits which try to reintroduce this
+have to check carefully how hw behaves with aggregated and
+non-aggregated traffic for the same TID.
+My NIC: Intel(R) Centrino(R) Ultimate-N 6300 AGN, REV=0x74
+
+Reported-by: kernel test robot <lkp at intel.com>
+Signed-off-by: Markus Theil <markus.theil at tu-ilmenau.de>
+Link: https://lore.kernel.org/r/20210206115112.567881-1-markus.theil at tu-ilmenau.de
+Signed-off-by: Johannes Berg <johannes.berg at intel.com>
+---
+
+--- a/net/mac80211/status.c
++++ b/net/mac80211/status.c
+@@ -628,16 +628,12 @@ static void ieee80211_report_ack_skb(str
+ 		u64 cookie = IEEE80211_SKB_CB(skb)->ack.cookie;
+ 		struct ieee80211_sub_if_data *sdata;
+ 		struct ieee80211_hdr *hdr = (void *)skb->data;
+-		__be16 ethertype = 0;
+-
+-		if (skb->len >= ETH_HLEN && skb->protocol == cpu_to_be16(ETH_P_802_3))
+-			skb_copy_bits(skb, 2 * ETH_ALEN, &ethertype, ETH_TLEN);
+ 
+ 		rcu_read_lock();
+ 		sdata = ieee80211_sdata_from_skb(local, skb);
+ 		if (sdata) {
+-			if (ethertype == sdata->control_port_protocol ||
+-			    ethertype == cpu_to_be16(ETH_P_PREAUTH))
++			if (skb->protocol == sdata->control_port_protocol ||
++			    skb->protocol == cpu_to_be16(ETH_P_PREAUTH))
+ 				cfg80211_control_port_tx_status(&sdata->wdev,
+ 								cookie,
+ 								skb->data,
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -1195,9 +1195,7 @@ ieee80211_tx_prepare(struct ieee80211_su
+ 			tx->sta = rcu_dereference(sdata->u.vlan.sta);
+ 			if (!tx->sta && sdata->wdev.use_4addr)
+ 				return TX_DROP;
+-		} else if (info->flags & (IEEE80211_TX_INTFL_NL80211_FRAME_TX |
+-					  IEEE80211_TX_CTL_INJECTED) ||
+-			   tx->sdata->control_port_protocol == tx->skb->protocol) {
++		} else if (tx->sdata->control_port_protocol == tx->skb->protocol) {
+ 			tx->sta = sta_info_get_bss(sdata, hdr->addr1);
+ 		}
+ 		if (!tx->sta && !is_multicast_ether_addr(hdr->addr1))
+@@ -5421,6 +5419,7 @@ int ieee80211_tx_control_port(struct wip
+ {
+ 	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ 	struct ieee80211_local *local = sdata->local;
++	struct sta_info *sta;
+ 	struct sk_buff *skb;
+ 	struct ethhdr *ehdr;
+ 	u32 ctrl_flags = 0;
+@@ -5443,8 +5442,7 @@ int ieee80211_tx_control_port(struct wip
+ 	if (cookie)
+ 		ctrl_flags |= IEEE80211_TX_CTL_REQ_TX_STATUS;
+ 
+-	flags |= IEEE80211_TX_INTFL_NL80211_FRAME_TX |
+-		 IEEE80211_TX_CTL_INJECTED;
++	flags |= IEEE80211_TX_INTFL_NL80211_FRAME_TX;
+ 
+ 	skb = dev_alloc_skb(local->hw.extra_tx_headroom +
+ 			    sizeof(struct ethhdr) + len);
+@@ -5461,10 +5459,25 @@ int ieee80211_tx_control_port(struct wip
+ 	ehdr->h_proto = proto;
+ 
+ 	skb->dev = dev;
+-	skb->protocol = htons(ETH_P_802_3);
++	skb->protocol = proto;
+ 	skb_reset_network_header(skb);
+ 	skb_reset_mac_header(skb);
+ 
++	/* update QoS header to prioritize control port frames if possible,
++	 * priorization also happens for control port frames send over
++	 * AF_PACKET
++	 */
++	rcu_read_lock();
++
++	if (ieee80211_lookup_ra_sta(sdata, skb, &sta) == 0 && !IS_ERR(sta)) {
++		u16 queue = __ieee80211_select_queue(sdata, sta, skb);
++
++		skb_set_queue_mapping(skb, queue);
++		skb_get_hash(skb);
++	}
++
++	rcu_read_unlock();
++
+ 	/* mutex lock is only needed for incrementing the cookie counter */
+ 	mutex_lock(&local->mtx);
+ 
diff --git a/package/kernel/mac80211/patches/subsys/371-mac80211-don-t-apply-flow-control-on-management-fram.patch b/package/kernel/mac80211/patches/subsys/371-mac80211-don-t-apply-flow-control-on-management-fram.patch
index b439a3814c..8d094a3632 100644
--- a/package/kernel/mac80211/patches/subsys/371-mac80211-don-t-apply-flow-control-on-management-fram.patch
+++ b/package/kernel/mac80211/patches/subsys/371-mac80211-don-t-apply-flow-control-on-management-fram.patch
@@ -28,7 +28,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
   *
   * Transmit and frame generation functions.
   */
-@@ -1403,8 +1403,17 @@ static void ieee80211_txq_enqueue(struct
+@@ -1401,8 +1401,17 @@ static void ieee80211_txq_enqueue(struct
  	ieee80211_set_skb_enqueue_time(skb);
  
  	spin_lock_bh(&fq->lock);
@@ -48,7 +48,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	spin_unlock_bh(&fq->lock);
  }
  
-@@ -3846,6 +3855,9 @@ bool ieee80211_txq_airtime_check(struct
+@@ -3844,6 +3853,9 @@ bool ieee80211_txq_airtime_check(struct
  	if (!txq->sta)
  		return true;
  
diff --git a/package/kernel/mac80211/patches/subsys/372-mac80211-set-sk_pacing_shift-for-802.3-txpath.patch b/package/kernel/mac80211/patches/subsys/372-mac80211-set-sk_pacing_shift-for-802.3-txpath.patch
index 4d8a91a413..5bc1469a3f 100644
--- a/package/kernel/mac80211/patches/subsys/372-mac80211-set-sk_pacing_shift-for-802.3-txpath.patch
+++ b/package/kernel/mac80211/patches/subsys/372-mac80211-set-sk_pacing_shift-for-802.3-txpath.patch
@@ -9,7 +9,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
 
 --- a/net/mac80211/tx.c
 +++ b/net/mac80211/tx.c
-@@ -4173,6 +4173,9 @@ static bool ieee80211_tx_8023(struct iee
+@@ -4171,6 +4171,9 @@ static bool ieee80211_tx_8023(struct iee
  	unsigned long flags;
  	int q = info->hw_queue;
  
diff --git a/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch b/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch
index 4e3242e6a9..031f8e1636 100644
--- a/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch
+++ b/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch
@@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	.rate_init = minstrel_ht_rate_init,
 --- a/net/mac80211/tx.c
 +++ b/net/mac80211/tx.c
-@@ -3933,6 +3933,29 @@ void ieee80211_txq_schedule_start(struct
+@@ -3931,6 +3931,29 @@ void ieee80211_txq_schedule_start(struct
  }
  EXPORT_SYMBOL(ieee80211_txq_schedule_start);
  
@@ -106,7 +106,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  void __ieee80211_subif_start_xmit(struct sk_buff *skb,
  				  struct net_device *dev,
  				  u32 info_flags,
-@@ -3963,6 +3986,8 @@ void __ieee80211_subif_start_xmit(struct
+@@ -3961,6 +3984,8 @@ void __ieee80211_subif_start_xmit(struct
  		skb_get_hash(skb);
  	}
  
@@ -115,7 +115,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (sta) {
  		struct ieee80211_fast_tx *fast_tx;
  
-@@ -4226,6 +4251,8 @@ static void ieee80211_8023_xmit(struct i
+@@ -4224,6 +4249,8 @@ static void ieee80211_8023_xmit(struct i
  
  	memset(info, 0, sizeof(*info));
  
diff --git a/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch b/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch
index 49b1212213..cf84fca68a 100644
--- a/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch
+++ b/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch
@@ -10,7 +10,7 @@ Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
 
 --- a/net/mac80211/tx.c
 +++ b/net/mac80211/tx.c
-@@ -1780,8 +1780,6 @@ static int invoke_tx_handlers_early(stru
+@@ -1778,8 +1778,6 @@ static int invoke_tx_handlers_early(stru
  	CALL_TXH(ieee80211_tx_h_ps_buf);
  	CALL_TXH(ieee80211_tx_h_check_control_port_protocol);
  	CALL_TXH(ieee80211_tx_h_select_key);
@@ -19,7 +19,7 @@ Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
  
   txh_done:
  	if (unlikely(res == TX_DROP)) {
-@@ -1814,6 +1812,9 @@ static int invoke_tx_handlers_late(struc
+@@ -1812,6 +1810,9 @@ static int invoke_tx_handlers_late(struc
  		goto txh_done;
  	}
  
@@ -29,7 +29,7 @@ Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
  	CALL_TXH(ieee80211_tx_h_michael_mic_add);
  	CALL_TXH(ieee80211_tx_h_sequence);
  	CALL_TXH(ieee80211_tx_h_fragment);
-@@ -3384,15 +3385,21 @@ out:
+@@ -3382,15 +3383,21 @@ out:
   * Can be called while the sta lock is held. Anything that can cause packets to
   * be generated will cause deadlock!
   */
@@ -55,7 +55,7 @@ Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
  	if (key)
  		info->control.hw_key = &key->conf;
  
-@@ -3441,6 +3448,8 @@ static void ieee80211_xmit_fast_finish(s
+@@ -3439,6 +3446,8 @@ static void ieee80211_xmit_fast_finish(s
  			break;
  		}
  	}
@@ -64,7 +64,7 @@ Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
  }
  
  static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
-@@ -3544,24 +3553,17 @@ static bool ieee80211_xmit_fast(struct i
+@@ -3542,24 +3551,17 @@ static bool ieee80211_xmit_fast(struct i
  	tx.sta = sta;
  	tx.key = fast_tx->key;
  
@@ -97,7 +97,7 @@ Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
  
  	if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
  		sdata = container_of(sdata->bss,
-@@ -3672,8 +3674,12 @@ begin:
+@@ -3670,8 +3672,12 @@ begin:
  		    (tx.key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV))
  			pn_offs = ieee80211_hdrlen(hdr->frame_control);
  
diff --git a/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch b/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch
index eefeaa4a8d..43a4a1334d 100644
--- a/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch
+++ b/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch
@@ -99,7 +99,7 @@ Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
  			tx->sta->tx_stats.last_rate = txrc.reported_rate;
  	} else if (tx->sta)
  		tx->sta->tx_stats.last_rate = txrc.reported_rate;
-@@ -3662,8 +3664,16 @@ begin:
+@@ -3660,8 +3662,16 @@ begin:
  	else
  		info->flags &= ~IEEE80211_TX_CTL_AMPDU;
  
diff --git a/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch b/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch
index 56eafaf847..2ad083f150 100644
--- a/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch
+++ b/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch
@@ -54,8 +54,8 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	int tid;
  
  	memset(tx, 0, sizeof(*tx));
-@@ -1202,8 +1226,10 @@ ieee80211_tx_prepare(struct ieee80211_su
- 			   tx->sdata->control_port_protocol == tx->skb->protocol) {
+@@ -1200,8 +1224,10 @@ ieee80211_tx_prepare(struct ieee80211_su
+ 		} else if (tx->sdata->control_port_protocol == tx->skb->protocol) {
  			tx->sta = sta_info_get_bss(sdata, hdr->addr1);
  		}
 -		if (!tx->sta && !is_multicast_ether_addr(hdr->addr1))
@@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	}
  
  	if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) &&
-@@ -1213,8 +1239,12 @@ ieee80211_tx_prepare(struct ieee80211_su
+@@ -1211,8 +1237,12 @@ ieee80211_tx_prepare(struct ieee80211_su
  		struct tid_ampdu_tx *tid_tx;
  
  		tid = ieee80211_get_tid(hdr);
@@ -80,7 +80,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		if (tid_tx) {
  			bool queued;
  
-@@ -3949,29 +3979,6 @@ void ieee80211_txq_schedule_start(struct
+@@ -3947,29 +3977,6 @@ void ieee80211_txq_schedule_start(struct
  }
  EXPORT_SYMBOL(ieee80211_txq_schedule_start);
  


From lede-commits at lists.infradead.org  Wed Jun 30 10:49:40 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 30 Jun 2021 13:49:40 -0400
Subject: [openwrt/openwrt] base-files: wifi: swap the order of some ubus calls
In-Reply-To: <162507537462.10732.4493156618298265258@git-01.infra.openwrt.org>
References: <162507537462.10732.4493156618298265258@git-01.infra.openwrt.org>
Message-ID: <mailman.4721.1625075379.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/b27b63b082d6e36c5ffe16c8ec3514d314907b3a

commit b27b63b082d6e36c5ffe16c8ec3514d314907b3a
Author: Bob Cantor <coxede6557 at w3boats.com>
AuthorDate: Fri Jun 25 04:37:17 2021 +1000

    base-files: wifi:  swap the order of some ubus calls
    
    "/sbin/wifi up" makes three ubus calls:
    1. ubus call network reload
    2. ubus call network.wireless down
    3. ubus call network.wireless up
    
    The first and third ubus calls call drv_mac80211_setup,
    while the second ubus call triggers wireless_device_setup_cancel,
    so the call sequence becomes,
    
    1. drv_mac80211_setup
    2. wireless_device_setup_cancel
    3. drv_mac80211_setup
    
    This commit swaps the order of the first two ubus calls,
    1. ubus call network.wireless down
    2. ubus call network reload
    3. ubus call network.wireless up
    
    Consequently drv_mac80211_setup is only called once,
    and two related bugs (#FS3784 and #FS3902) are no longer triggered
    by /sbin/wifi.
    
    branches affected: trunk, 21.02
    
    Signed-off-by: Bob Cantor <coxede6557 at w3boats.com>
    (cherry-picked from commit b82cc8071366b8e96904a1b52af503442069b20d)
---
 package/base-files/files/sbin/wifi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi
index 75759b94f3..b2dde6f01c 100755
--- a/package/base-files/files/sbin/wifi
+++ b/package/base-files/files/sbin/wifi
@@ -130,6 +130,7 @@ wifi_updown() {
 		ubus_wifi_cmd "$cmd" "$2"
 		scan_wifi
 		cmd=up
+		ubus call network reload
 	}
 	[ reconf = "$1" ] && {
 		scan_wifi
@@ -247,6 +248,6 @@ case "$1" in
 	reload_legacy) wifi_reload_legacy "$2";;
 	--help|help) usage;;
 	reconf) ubus call network reload; wifi_updown "reconf" "$2";;
-	''|up) ubus call network reload; wifi_updown "enable" "$2";;
+	''|up) wifi_updown "enable" "$2";;
 	*) usage; exit 1;;
 esac


From lede-commits at lists.infradead.org  Wed Jun 30 10:49:37 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 30 Jun 2021 13:49:37 -0400
Subject: [openwrt/openwrt]  mac80211: fix no_reload logic (FS#3902)
In-Reply-To: <162507537462.10732.4493156618298265258@git-01.infra.openwrt.org>
References: <162507537462.10732.4493156618298265258@git-01.infra.openwrt.org>
Message-ID: <mailman.4722.1625075379.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/bea9380149d58e79bed4bf4b8298066bd36edde8

commit bea9380149d58e79bed4bf4b8298066bd36edde8
Author: Bob Cantor <coxede6557 at w3boats.com>
AuthorDate: Fri Jun 25 03:18:33 2021 +1000

    mac80211: fix no_reload logic (FS#3902)
    
    If drv_mac80211_setup is called twice with the same wifi configuration,
    then the second call returns early with error HOSTAPD_START_FAILED.
    (wifi works nevertheless, despite the fact that setup is incomplete.  But
    "ubus call network.wireless status" erroneously reports that radio0 is down.)
    
    The relevant part of drv_mac80211_setup is,
    
    if [ "$no_reload" != "0" ]; then
            add_ap=1
            ubus wait_for hostapd
            local hostapd_res="$(ubus call hostapd config_add "{\"iface\":\"$primary_ap\", \"config\":\"${hostapd_conf_file}\"}")"
            ret="$?"
            [ "$ret" != 0 -o -z "$hostapd_res" ] && {
                    wireless_setup_failed HOSTAPD_START_FAILED
                    return
            }
            wireless_add_process "$(jsonfilter -s "$hostapd_res" -l 1 -e @.pid)" "/usr/sbin/hostapd" 1 1
    fi
    
    This commit sets no_reload = 0 during the second call of drv_mac80211_setup.
    
    It is perhaps worth providing a way to reproduce the situation
    where drv_mac80211_setup is called twice.
    
    When /sbin/wifi is used to turn on wifi,
       uci set wireless. at wifi-iface[0].disabled=0
       uci set wireless. at wifi-device[0].disabled=0
       uci commit
       wifi
    
    /sbin/wifi makes the following ubus calls,
       ubus call network reload
       ubus call network.wireless down
       ubus call network.wireless up
    
    The first and third ubus calls both call drv_mac80211_setup,
    while the second ubus call triggers wireless_device_setup_cancel.
    So the call sequence becomes,
    
       drv_mac80211_setup
       wireless_device_setup_cancel
       drv_mac80211_setup
    
    In contrast, when LuCI is used to turn on wifi only a single call
    is made to drv_mac80211_setup.
    
    branches affected: trunk, 21.02
    
    Signed-off-by: Bob Cantor <coxede6557 at w3boats.com>
    (cherry-picked from commit a29ab3b79affb62fda82e0825ed811eaf482dd3c)
---
 package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index 92c56afd24..43bd85cfdf 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -1003,6 +1003,7 @@ drv_mac80211_setup() {
 	[ -n "$hostapd_ctrl" ] && {
 		local no_reload=1
 		if [ -n "$(ubus list | grep hostapd.$primary_ap)" ]; then
+			no_reload=0
 			[ "${NEW_MD5}" = "${OLD_MD5}" ] || {
 				ubus call hostapd.$primary_ap reload
 				no_reload=$?


From lede-commits at lists.infradead.org  Wed Jun 30 10:49:39 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 30 Jun 2021 13:49:39 -0400
Subject: [openwrt/openwrt]  mac80211: print an error if wifi teardown fails
In-Reply-To: <162507537462.10732.4493156618298265258@git-01.infra.openwrt.org>
References: <162507537462.10732.4493156618298265258@git-01.infra.openwrt.org>
Message-ID: <mailman.4723.1625075381.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/6f13a390355d15bc1ecff59eba769d0189d05083

commit 6f13a390355d15bc1ecff59eba769d0189d05083
Author: Bob Cantor <coxede6557 at w3boats.com>
AuthorDate: Fri Jun 25 04:14:47 2021 +1000

    mac80211: print an error if wifi teardown fails
    
    drv_mac80211_teardown fails silently if the device to be torn down is
    not defined.  This commit prints an error message.
    
    branches affected: trunk, 21.02
    
    Signed-off-by: Bob Cantor <coxede6557 at w3boats.com>
    (cherry-picked from commit 3933e29d1b87c713167cf4730b68e5f18af4f140)
---
 package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index e3b26b287c..9a9c35fb5f 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -1076,6 +1076,10 @@ drv_mac80211_teardown() {
 	json_select data
 	json_get_vars phy
 	json_select ..
+	[ -n "$phy" ] || {
+		echo "Bug: PHY is undefined for device '$1'"
+		return 1
+	}
 
 	mac80211_interface_cleanup "$phy"
 	uci -q -P /var/state revert wireless._${phy}


From lede-commits at lists.infradead.org  Wed Jun 30 10:49:41 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 30 Jun 2021 13:49:41 -0400
Subject: [openwrt/openwrt]  base-files: wifi: tidy up the reconf code
In-Reply-To: <162507537462.10732.4493156618298265258@git-01.infra.openwrt.org>
References: <162507537462.10732.4493156618298265258@git-01.infra.openwrt.org>
Message-ID: <mailman.4726.1625075381.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/a9100f21967313141020bfee517e0b307d25ab5b

commit a9100f21967313141020bfee517e0b307d25ab5b
Author: Bob Cantor <coxede6557 at w3boats.com>
AuthorDate: Fri Jun 25 04:48:45 2021 +1000

    base-files: wifi: tidy up the reconf code
    
    commit 5edbd390d321532d9a697d6895a1a7c71c40bd5d rearranged the
    "wifi up" code.
    
    This commit tidies up the "wifi reconf" code so as to
    keep it aligned with the "wifi up" code.
    
    branches affected: trunk, 21.02
    
    Signed-off-by: Bob Cantor <coxede6557 at w3boats.com>
    (cherry-picked from commit e8b54296092118fbef75de796d57799cc6c7b927)
---
 package/base-files/files/sbin/wifi | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi
index b2dde6f01c..6b9662fe93 100755
--- a/package/base-files/files/sbin/wifi
+++ b/package/base-files/files/sbin/wifi
@@ -135,6 +135,7 @@ wifi_updown() {
 	[ reconf = "$1" ] && {
 		scan_wifi
 		cmd=reconf
+		ubus call network reload
 	}
 	ubus_wifi_cmd "$cmd" "$2"
 	_wifi_updown "$@"
@@ -247,7 +248,7 @@ case "$1" in
 	reload) wifi_reload "$2";;
 	reload_legacy) wifi_reload_legacy "$2";;
 	--help|help) usage;;
-	reconf) ubus call network reload; wifi_updown "reconf" "$2";;
+	reconf) wifi_updown "reconf" "$2";;
 	''|up) wifi_updown "enable" "$2";;
 	*) usage; exit 1;;
 esac


From lede-commits at lists.infradead.org  Wed Jun 30 10:49:35 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 30 Jun 2021 13:49:35 -0400
Subject: [openwrt/openwrt] mac80211: add support for 802.3 encap offload
 with software rate control
In-Reply-To: <162507537462.10732.4493156618298265258@git-01.infra.openwrt.org>
References: <162507537462.10732.4493156618298265258@git-01.infra.openwrt.org>
Message-ID: <mailman.4727.1625075381.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/4c29ff7cb8fcfd4ba26942019837656ed0258cfb

commit 4c29ff7cb8fcfd4ba26942019837656ed0258cfb
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Jun 6 20:58:33 2021 +0200

    mac80211: add support for 802.3 encap offload with software rate control
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
    (cherry-picked from commit f2c6d892cacb5d884bdd638bc7574c1ee98514a5)
---
 ...dd-rate-control-support-for-encap-offload.patch | 119 +++++++++++++++++++++
 1 file changed, 119 insertions(+)

diff --git a/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch b/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch
new file mode 100644
index 0000000000..eefeaa4a8d
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch
@@ -0,0 +1,119 @@
+From: Ryder Lee <ryder.lee at mediatek.com>
+Date: Fri, 28 May 2021 14:05:43 +0800
+Subject: [PATCH] mac80211: add rate control support for encap offload
+
+The software rate control cannot deal with encap offload, so fix it.
+
+Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
+---
+
+--- a/net/mac80211/ieee80211_i.h
++++ b/net/mac80211/ieee80211_i.h
+@@ -2024,6 +2024,15 @@ static inline void ieee80211_tx_skb(stru
+ 	ieee80211_tx_skb_tid(sdata, skb, 7);
+ }
+ 
++static inline bool ieee80211_is_tx_data(struct sk_buff *skb)
++{
++	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
++	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
++
++	return info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP ||
++	       ieee80211_is_data(hdr->frame_control);
++}
++
+ u32 ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action,
+ 			       struct ieee802_11_elems *elems,
+ 			       u64 filter, u32 crc, u8 *transmitter_bssid,
+--- a/net/mac80211/rate.c
++++ b/net/mac80211/rate.c
+@@ -297,15 +297,11 @@ void ieee80211_check_rate_mask(struct ie
+ static bool rc_no_data_or_no_ack_use_min(struct ieee80211_tx_rate_control *txrc)
+ {
+ 	struct sk_buff *skb = txrc->skb;
+-	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
+ 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+-	__le16 fc;
+-
+-	fc = hdr->frame_control;
+ 
+ 	return (info->flags & (IEEE80211_TX_CTL_NO_ACK |
+ 			       IEEE80211_TX_CTL_USE_MINRATE)) ||
+-		!ieee80211_is_data(fc);
++		!ieee80211_is_tx_data(skb);
+ }
+ 
+ static void rc_send_low_basicrate(struct ieee80211_tx_rate *rate,
+@@ -870,7 +866,6 @@ void ieee80211_get_tx_rates(struct ieee8
+ 			    int max_rates)
+ {
+ 	struct ieee80211_sub_if_data *sdata;
+-	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
+ 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+ 	struct ieee80211_supported_band *sband;
+ 
+@@ -882,7 +877,7 @@ void ieee80211_get_tx_rates(struct ieee8
+ 	sdata = vif_to_sdata(vif);
+ 	sband = sdata->local->hw.wiphy->bands[info->band];
+ 
+-	if (ieee80211_is_data(hdr->frame_control))
++	if (ieee80211_is_tx_data(skb))
+ 		rate_control_apply_mask(sdata, sta, sband, dest, max_rates);
+ 
+ 	if (dest[0].idx < 0)
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -679,6 +679,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021
+ 	u32 len;
+ 	struct ieee80211_tx_rate_control txrc;
+ 	struct ieee80211_sta_rates *ratetbl = NULL;
++	bool encap = info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP;
+ 	bool assoc = false;
+ 
+ 	memset(&txrc, 0, sizeof(txrc));
+@@ -720,7 +721,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021
+ 	 * just wants a probe response.
+ 	 */
+ 	if (tx->sdata->vif.bss_conf.use_short_preamble &&
+-	    (ieee80211_is_data(hdr->frame_control) ||
++	    (ieee80211_is_tx_data(tx->skb) ||
+ 	     (tx->sta && test_sta_flag(tx->sta, WLAN_STA_SHORT_PREAMBLE))))
+ 		txrc.short_preamble = true;
+ 
+@@ -742,7 +743,8 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021
+ 		 "%s: Dropped data frame as no usable bitrate found while "
+ 		 "scanning and associated. Target station: "
+ 		 "%pM on %d GHz band\n",
+-		 tx->sdata->name, hdr->addr1,
++		 tx->sdata->name,
++		 encap ? ((struct ethhdr *)hdr)->h_dest : hdr->addr1,
+ 		 info->band ? 5 : 2))
+ 		return TX_DROP;
+ 
+@@ -776,7 +778,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021
+ 
+ 	if (txrc.reported_rate.idx < 0) {
+ 		txrc.reported_rate = tx->rate;
+-		if (tx->sta && ieee80211_is_data(hdr->frame_control))
++		if (tx->sta && ieee80211_is_tx_data(tx->skb))
+ 			tx->sta->tx_stats.last_rate = txrc.reported_rate;
+ 	} else if (tx->sta)
+ 		tx->sta->tx_stats.last_rate = txrc.reported_rate;
+@@ -3662,8 +3664,16 @@ begin:
+ 	else
+ 		info->flags &= ~IEEE80211_TX_CTL_AMPDU;
+ 
+-	if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP)
++	if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) {
++		if (!ieee80211_hw_check(&local->hw, HAS_RATE_CONTROL)) {
++			r = ieee80211_tx_h_rate_ctrl(&tx);
++			if (r != TX_CONTINUE) {
++				ieee80211_free_txskb(&local->hw, skb);
++				goto begin;
++			}
++		}
+ 		goto encap_out;
++	}
+ 
+ 	if (info->control.flags & IEEE80211_TX_CTRL_FAST_XMIT) {
+ 		struct sta_info *sta = container_of(txq->sta, struct sta_info,


From lede-commits at lists.infradead.org  Wed Jun 30 10:49:34 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 30 Jun 2021 13:49:34 -0400
Subject: [openwrt/openwrt]  mac80211: improve rate control performance
In-Reply-To: <162507537462.10732.4493156618298265258@git-01.infra.openwrt.org>
References: <162507537462.10732.4493156618298265258@git-01.infra.openwrt.org>
Message-ID: <mailman.4728.1625075382.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/a078037ace500a9c0f7cf4ec4f1c3095115dc70b

commit a078037ace500a9c0f7cf4ec4f1c3095115dc70b
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Jun 6 20:57:39 2021 +0200

    mac80211: improve rate control performance
    
    Call rate control handler after intermediate queueuing
    Includes follow-up fixes
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
    
    cherry-picked from commits:
    - 7dd8829ef915f1c5fc728be8f8360c61ddaadf1b
    - a603e82dd342680d584c4eb5f1b222e056379890
    - 8bb4437c01ca35a5ac67e391630a1b24cb52dbb7
---
 ...ve-A-MPDU-session-check-from-minstrel_ht-.patch | 126 +++++++++++++++++++++
 ...all-ieee80211_tx_h_rate_ctrl-when-dequeue.patch | 114 +++++++++++++++++++
 ...ac80211-minstrel_ht-fix-sample-time-check.patch |   2 +-
 ...x-starting-aggregation-sessions-on-mesh-i.patch | 112 ++++++++++++++++++
 4 files changed, 353 insertions(+), 1 deletion(-)

diff --git a/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch b/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch
new file mode 100644
index 0000000000..4e3242e6a9
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch
@@ -0,0 +1,126 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Thu, 17 Jun 2021 17:56:54 +0200
+Subject: [PATCH] mac80211: move A-MPDU session check from minstrel_ht to
+ mac80211
+
+This avoids calling back into tx handlers from within the rate control module.
+Preparation for deferring rate control until tx dequeue
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/include/net/mac80211.h
++++ b/include/net/mac80211.h
+@@ -6160,6 +6160,11 @@ enum rate_control_capabilities {
+ 	 * otherwise the NSS difference doesn't bother us.
+ 	 */
+ 	RATE_CTRL_CAPA_VHT_EXT_NSS_BW = BIT(0),
++	/**
++	 * @RATE_CTRL_CAPA_AMPDU_TRIGGER:
++	 * mac80211 should start A-MPDU sessions on tx
++	 */
++	RATE_CTRL_CAPA_AMPDU_TRIGGER = BIT(1),
+ };
+ 
+ struct rate_control_ops {
+--- a/net/mac80211/rc80211_minstrel_ht.c
++++ b/net/mac80211/rc80211_minstrel_ht.c
+@@ -1153,29 +1153,6 @@ minstrel_downgrade_prob_rate(struct mins
+ }
+ 
+ static void
+-minstrel_aggr_check(struct ieee80211_sta *pubsta, struct sk_buff *skb)
+-{
+-	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
+-	struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
+-	u16 tid;
+-
+-	if (skb_get_queue_mapping(skb) == IEEE80211_AC_VO)
+-		return;
+-
+-	if (unlikely(!ieee80211_is_data_qos(hdr->frame_control)))
+-		return;
+-
+-	if (unlikely(skb->protocol == cpu_to_be16(ETH_P_PAE)))
+-		return;
+-
+-	tid = ieee80211_get_tid(hdr);
+-	if (likely(sta->ampdu_mlme.tid_tx[tid]))
+-		return;
+-
+-	ieee80211_start_tx_ba_session(pubsta, tid, 0);
+-}
+-
+-static void
+ minstrel_ht_tx_status(void *priv, struct ieee80211_supported_band *sband,
+                       void *priv_sta, struct ieee80211_tx_status *st)
+ {
+@@ -1477,10 +1454,6 @@ minstrel_ht_get_rate(void *priv, struct
+ 	struct minstrel_priv *mp = priv;
+ 	u16 sample_idx;
+ 
+-	if (!(info->flags & IEEE80211_TX_CTL_AMPDU) &&
+-	    !minstrel_ht_is_legacy_group(MI_RATE_GROUP(mi->max_prob_rate)))
+-		minstrel_aggr_check(sta, txrc->skb);
+-
+ 	info->flags |= mi->tx_flags;
+ 
+ #ifdef CPTCFG_MAC80211_DEBUGFS
+@@ -1894,6 +1867,7 @@ static u32 minstrel_ht_get_expected_thro
+ 
+ static const struct rate_control_ops mac80211_minstrel_ht = {
+ 	.name = "minstrel_ht",
++	.capa = RATE_CTRL_CAPA_AMPDU_TRIGGER,
+ 	.tx_status_ext = minstrel_ht_tx_status,
+ 	.get_rate = minstrel_ht_get_rate,
+ 	.rate_init = minstrel_ht_rate_init,
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -3933,6 +3933,29 @@ void ieee80211_txq_schedule_start(struct
+ }
+ EXPORT_SYMBOL(ieee80211_txq_schedule_start);
+ 
++static void
++ieee80211_aggr_check(struct ieee80211_sub_if_data *sdata,
++		     struct sta_info *sta,
++		     struct sk_buff *skb)
++{
++	struct rate_control_ref *ref = sdata->local->rate_ctrl;
++	u16 tid;
++
++	if (!ref || !(ref->ops->capa & RATE_CTRL_CAPA_AMPDU_TRIGGER))
++		return;
++
++	if (!sta || !sta->sta.ht_cap.ht_supported ||
++	    !sta->sta.wme || skb_get_queue_mapping(skb) == IEEE80211_AC_VO ||
++	    skb->protocol == sdata->control_port_protocol)
++		return;
++
++	tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
++	if (likely(sta->ampdu_mlme.tid_tx[tid]))
++		return;
++
++	ieee80211_start_tx_ba_session(&sta->sta, tid, 0);
++}
++
+ void __ieee80211_subif_start_xmit(struct sk_buff *skb,
+ 				  struct net_device *dev,
+ 				  u32 info_flags,
+@@ -3963,6 +3986,8 @@ void __ieee80211_subif_start_xmit(struct
+ 		skb_get_hash(skb);
+ 	}
+ 
++	ieee80211_aggr_check(sdata, sta, skb);
++
+ 	if (sta) {
+ 		struct ieee80211_fast_tx *fast_tx;
+ 
+@@ -4226,6 +4251,8 @@ static void ieee80211_8023_xmit(struct i
+ 
+ 	memset(info, 0, sizeof(*info));
+ 
++	ieee80211_aggr_check(sdata, sta, skb);
++
+ 	tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
+ 	tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]);
+ 	if (tid_tx) {
diff --git a/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch b/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch
new file mode 100644
index 0000000000..49b1212213
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch
@@ -0,0 +1,114 @@
+From: Ryder Lee <ryder.lee at mediatek.com>
+Date: Fri, 28 May 2021 14:05:41 +0800
+Subject: [PATCH] mac80211: call ieee80211_tx_h_rate_ctrl() when dequeue
+
+Make ieee80211_tx_h_rate_ctrl() get called on dequeue to improve
+performance since it reduces the turnaround time for rate control.
+
+Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
+---
+
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -1780,8 +1780,6 @@ static int invoke_tx_handlers_early(stru
+ 	CALL_TXH(ieee80211_tx_h_ps_buf);
+ 	CALL_TXH(ieee80211_tx_h_check_control_port_protocol);
+ 	CALL_TXH(ieee80211_tx_h_select_key);
+-	if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL))
+-		CALL_TXH(ieee80211_tx_h_rate_ctrl);
+ 
+  txh_done:
+ 	if (unlikely(res == TX_DROP)) {
+@@ -1814,6 +1812,9 @@ static int invoke_tx_handlers_late(struc
+ 		goto txh_done;
+ 	}
+ 
++	if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL))
++		CALL_TXH(ieee80211_tx_h_rate_ctrl);
++
+ 	CALL_TXH(ieee80211_tx_h_michael_mic_add);
+ 	CALL_TXH(ieee80211_tx_h_sequence);
+ 	CALL_TXH(ieee80211_tx_h_fragment);
+@@ -3384,15 +3385,21 @@ out:
+  * Can be called while the sta lock is held. Anything that can cause packets to
+  * be generated will cause deadlock!
+  */
+-static void ieee80211_xmit_fast_finish(struct ieee80211_sub_if_data *sdata,
+-				       struct sta_info *sta, u8 pn_offs,
+-				       struct ieee80211_key *key,
+-				       struct sk_buff *skb)
++static ieee80211_tx_result
++ieee80211_xmit_fast_finish(struct ieee80211_sub_if_data *sdata,
++			   struct sta_info *sta, u8 pn_offs,
++			   struct ieee80211_key *key,
++			   struct ieee80211_tx_data *tx)
+ {
++	struct sk_buff *skb = tx->skb;
+ 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
+ 	struct ieee80211_hdr *hdr = (void *)skb->data;
+ 	u8 tid = IEEE80211_NUM_TIDS;
+ 
++	if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL) &&
++	    ieee80211_tx_h_rate_ctrl(tx) != TX_CONTINUE)
++		return TX_DROP;
++
+ 	if (key)
+ 		info->control.hw_key = &key->conf;
+ 
+@@ -3441,6 +3448,8 @@ static void ieee80211_xmit_fast_finish(s
+ 			break;
+ 		}
+ 	}
++
++	return TX_CONTINUE;
+ }
+ 
+ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
+@@ -3544,24 +3553,17 @@ static bool ieee80211_xmit_fast(struct i
+ 	tx.sta = sta;
+ 	tx.key = fast_tx->key;
+ 
+-	if (!ieee80211_hw_check(&local->hw, HAS_RATE_CONTROL)) {
+-		tx.skb = skb;
+-		r = ieee80211_tx_h_rate_ctrl(&tx);
+-		skb = tx.skb;
+-		tx.skb = NULL;
+-
+-		if (r != TX_CONTINUE) {
+-			if (r != TX_QUEUED)
+-				kfree_skb(skb);
+-			return true;
+-		}
+-	}
+-
+ 	if (ieee80211_queue_skb(local, sdata, sta, skb))
+ 		return true;
+ 
+-	ieee80211_xmit_fast_finish(sdata, sta, fast_tx->pn_offs,
+-				   fast_tx->key, skb);
++	tx.skb = skb;
++	r = ieee80211_xmit_fast_finish(sdata, sta, fast_tx->pn_offs,
++				       fast_tx->key, &tx);
++	tx.skb = NULL;
++	if (r == TX_DROP) {
++		kfree_skb(skb);
++		return true;
++	}
+ 
+ 	if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
+ 		sdata = container_of(sdata->bss,
+@@ -3672,8 +3674,12 @@ begin:
+ 		    (tx.key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV))
+ 			pn_offs = ieee80211_hdrlen(hdr->frame_control);
+ 
+-		ieee80211_xmit_fast_finish(sta->sdata, sta, pn_offs,
+-					   tx.key, skb);
++		r = ieee80211_xmit_fast_finish(sta->sdata, sta, pn_offs,
++					       tx.key, &tx);
++		if (r != TX_CONTINUE) {
++			ieee80211_free_txskb(&local->hw, skb);
++			goto begin;
++		}
+ 	} else {
+ 		if (invoke_tx_handlers_late(&tx))
+ 			goto begin;
diff --git a/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch b/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch
index 787254b4df..d4b327c69c 100644
--- a/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch
+++ b/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch
@@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/net/mac80211/rc80211_minstrel_ht.c
 +++ b/net/mac80211/rc80211_minstrel_ht.c
-@@ -1498,7 +1498,7 @@ minstrel_ht_get_rate(void *priv, struct
+@@ -1466,7 +1466,7 @@ minstrel_ht_get_rate(void *priv, struct
  	    (info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO))
  		return;
  
diff --git a/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch b/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch
new file mode 100644
index 0000000000..56eafaf847
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch
@@ -0,0 +1,112 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Tue, 29 Jun 2021 13:25:09 +0200
+Subject: [PATCH] mac80211: fix starting aggregation sessions on mesh
+ interfaces
+
+The logic for starting aggregation sessions was recently moved from minstrel_ht
+to mac80211, into the subif tx handler just after the sta lookup.
+Unfortunately this didn't work for mesh interfaces, since the sta lookup is
+deferred until a much later point in time on those.
+Fix this by also calling the aggregation check right after the deferred sta
+lookup.
+
+Fixes: 08a46c642001 ("mac80211: move A-MPDU session check from minstrel_ht to mac80211")
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -1159,6 +1159,29 @@ static bool ieee80211_tx_prep_agg(struct
+ 	return queued;
+ }
+ 
++static void
++ieee80211_aggr_check(struct ieee80211_sub_if_data *sdata,
++		     struct sta_info *sta,
++		     struct sk_buff *skb)
++{
++	struct rate_control_ref *ref = sdata->local->rate_ctrl;
++	u16 tid;
++
++	if (!ref || !(ref->ops->capa & RATE_CTRL_CAPA_AMPDU_TRIGGER))
++		return;
++
++	if (!sta || !sta->sta.ht_cap.ht_supported ||
++	    !sta->sta.wme || skb_get_queue_mapping(skb) == IEEE80211_AC_VO ||
++	    skb->protocol == sdata->control_port_protocol)
++		return;
++
++	tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
++	if (likely(sta->ampdu_mlme.tid_tx[tid]))
++		return;
++
++	ieee80211_start_tx_ba_session(&sta->sta, tid, 0);
++}
++
+ /*
+  * initialises @tx
+  * pass %NULL for the station if unknown, a valid pointer if known
+@@ -1172,6 +1195,7 @@ ieee80211_tx_prepare(struct ieee80211_su
+ 	struct ieee80211_local *local = sdata->local;
+ 	struct ieee80211_hdr *hdr;
+ 	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
++	bool aggr_check = false;
+ 	int tid;
+ 
+ 	memset(tx, 0, sizeof(*tx));
+@@ -1202,8 +1226,10 @@ ieee80211_tx_prepare(struct ieee80211_su
+ 			   tx->sdata->control_port_protocol == tx->skb->protocol) {
+ 			tx->sta = sta_info_get_bss(sdata, hdr->addr1);
+ 		}
+-		if (!tx->sta && !is_multicast_ether_addr(hdr->addr1))
++		if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) {
+ 			tx->sta = sta_info_get(sdata, hdr->addr1);
++			aggr_check = true;
++		}
+ 	}
+ 
+ 	if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) &&
+@@ -1213,8 +1239,12 @@ ieee80211_tx_prepare(struct ieee80211_su
+ 		struct tid_ampdu_tx *tid_tx;
+ 
+ 		tid = ieee80211_get_tid(hdr);
+-
+ 		tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]);
++		if (!tid_tx && aggr_check) {
++			ieee80211_aggr_check(sdata, tx->sta, skb);
++			tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]);
++		}
++
+ 		if (tid_tx) {
+ 			bool queued;
+ 
+@@ -3949,29 +3979,6 @@ void ieee80211_txq_schedule_start(struct
+ }
+ EXPORT_SYMBOL(ieee80211_txq_schedule_start);
+ 
+-static void
+-ieee80211_aggr_check(struct ieee80211_sub_if_data *sdata,
+-		     struct sta_info *sta,
+-		     struct sk_buff *skb)
+-{
+-	struct rate_control_ref *ref = sdata->local->rate_ctrl;
+-	u16 tid;
+-
+-	if (!ref || !(ref->ops->capa & RATE_CTRL_CAPA_AMPDU_TRIGGER))
+-		return;
+-
+-	if (!sta || !sta->sta.ht_cap.ht_supported ||
+-	    !sta->sta.wme || skb_get_queue_mapping(skb) == IEEE80211_AC_VO ||
+-	    skb->protocol == sdata->control_port_protocol)
+-		return;
+-
+-	tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK;
+-	if (likely(sta->ampdu_mlme.tid_tx[tid]))
+-		return;
+-
+-	ieee80211_start_tx_ba_session(&sta->sta, tid, 0);
+-}
+-
+ void __ieee80211_subif_start_xmit(struct sk_buff *skb,
+ 				  struct net_device *dev,
+ 				  u32 info_flags,


From lede-commits at lists.infradead.org  Wed Jun 30 10:49:36 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 30 Jun 2021 13:49:36 -0400
Subject: [openwrt/openwrt] mac80211: backport fix for nl80211 control port
 tx (fixes FS#3857)
In-Reply-To: <162507537462.10732.4493156618298265258@git-01.infra.openwrt.org>
References: <162507537462.10732.4493156618298265258@git-01.infra.openwrt.org>
Message-ID: <mailman.4729.1625075382.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/ccbe535604e3e4ad6017e57865ed140ae4926be6

commit ccbe535604e3e4ad6017e57865ed140ae4926be6
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Jun 30 19:08:59 2021 +0200

    mac80211: backport fix for nl80211 control port tx (fixes FS#3857)
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
    (cherry-picked from commit de499573006ab4f32ded9fd66a62ec5e0c183e8a)
---
 ...-enable-QoS-support-for-nl80211-ctrl-port.patch | 116 +++++++++++++++++++++
 ...n-t-apply-flow-control-on-management-fram.patch |   4 +-
 ...0211-set-sk_pacing_shift-for-802.3-txpath.patch |   2 +-
 ...ve-A-MPDU-session-check-from-minstrel_ht-.patch |   6 +-
 ...all-ieee80211_tx_h_rate_ctrl-when-dequeue.patch |  12 +--
 ...dd-rate-control-support-for-encap-offload.patch |   2 +-
 ...x-starting-aggregation-sessions-on-mesh-i.patch |   8 +-
 7 files changed, 133 insertions(+), 17 deletions(-)

diff --git a/package/kernel/mac80211/patches/subsys/316-mac80211-enable-QoS-support-for-nl80211-ctrl-port.patch b/package/kernel/mac80211/patches/subsys/316-mac80211-enable-QoS-support-for-nl80211-ctrl-port.patch
new file mode 100644
index 0000000000..4be011ffec
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/316-mac80211-enable-QoS-support-for-nl80211-ctrl-port.patch
@@ -0,0 +1,116 @@
+From: Markus Theil <markus.theil at tu-ilmenau.de>
+Date: Sat, 6 Feb 2021 12:51:12 +0100
+Subject: [PATCH] mac80211: enable QoS support for nl80211 ctrl port
+
+This patch unifies sending control port frames
+over nl80211 and AF_PACKET sockets a little more.
+
+Before this patch, EAPOL frames got QoS prioritization
+only when using AF_PACKET sockets.
+
+__ieee80211_select_queue only selects a QoS-enabled queue
+for control port frames, when the control port protocol
+is set correctly on the skb. For the AF_PACKET path this
+works, but the nl80211 path used ETH_P_802_3.
+
+Another check for injected frames in wme.c then prevented
+the QoS TID to be copied in the frame.
+
+In order to fix this, get rid of the frame injection marking
+for nl80211 ctrl port and set the correct ethernet protocol.
+
+Please note:
+An erlier version of this path tried to prevent
+frame aggregation for control port frames in order to speed up
+the initial connection setup a little. This seemed to cause
+issues on my older Intel dvm-based hardware, and was therefore
+removed again. Future commits which try to reintroduce this
+have to check carefully how hw behaves with aggregated and
+non-aggregated traffic for the same TID.
+My NIC: Intel(R) Centrino(R) Ultimate-N 6300 AGN, REV=0x74
+
+Reported-by: kernel test robot <lkp at intel.com>
+Signed-off-by: Markus Theil <markus.theil at tu-ilmenau.de>
+Link: https://lore.kernel.org/r/20210206115112.567881-1-markus.theil at tu-ilmenau.de
+Signed-off-by: Johannes Berg <johannes.berg at intel.com>
+---
+
+--- a/net/mac80211/status.c
++++ b/net/mac80211/status.c
+@@ -628,16 +628,12 @@ static void ieee80211_report_ack_skb(str
+ 		u64 cookie = IEEE80211_SKB_CB(skb)->ack.cookie;
+ 		struct ieee80211_sub_if_data *sdata;
+ 		struct ieee80211_hdr *hdr = (void *)skb->data;
+-		__be16 ethertype = 0;
+-
+-		if (skb->len >= ETH_HLEN && skb->protocol == cpu_to_be16(ETH_P_802_3))
+-			skb_copy_bits(skb, 2 * ETH_ALEN, &ethertype, ETH_TLEN);
+ 
+ 		rcu_read_lock();
+ 		sdata = ieee80211_sdata_from_skb(local, skb);
+ 		if (sdata) {
+-			if (ethertype == sdata->control_port_protocol ||
+-			    ethertype == cpu_to_be16(ETH_P_PREAUTH))
++			if (skb->protocol == sdata->control_port_protocol ||
++			    skb->protocol == cpu_to_be16(ETH_P_PREAUTH))
+ 				cfg80211_control_port_tx_status(&sdata->wdev,
+ 								cookie,
+ 								skb->data,
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -1195,9 +1195,7 @@ ieee80211_tx_prepare(struct ieee80211_su
+ 			tx->sta = rcu_dereference(sdata->u.vlan.sta);
+ 			if (!tx->sta && sdata->wdev.use_4addr)
+ 				return TX_DROP;
+-		} else if (info->flags & (IEEE80211_TX_INTFL_NL80211_FRAME_TX |
+-					  IEEE80211_TX_CTL_INJECTED) ||
+-			   tx->sdata->control_port_protocol == tx->skb->protocol) {
++		} else if (tx->sdata->control_port_protocol == tx->skb->protocol) {
+ 			tx->sta = sta_info_get_bss(sdata, hdr->addr1);
+ 		}
+ 		if (!tx->sta && !is_multicast_ether_addr(hdr->addr1))
+@@ -5421,6 +5419,7 @@ int ieee80211_tx_control_port(struct wip
+ {
+ 	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ 	struct ieee80211_local *local = sdata->local;
++	struct sta_info *sta;
+ 	struct sk_buff *skb;
+ 	struct ethhdr *ehdr;
+ 	u32 ctrl_flags = 0;
+@@ -5443,8 +5442,7 @@ int ieee80211_tx_control_port(struct wip
+ 	if (cookie)
+ 		ctrl_flags |= IEEE80211_TX_CTL_REQ_TX_STATUS;
+ 
+-	flags |= IEEE80211_TX_INTFL_NL80211_FRAME_TX |
+-		 IEEE80211_TX_CTL_INJECTED;
++	flags |= IEEE80211_TX_INTFL_NL80211_FRAME_TX;
+ 
+ 	skb = dev_alloc_skb(local->hw.extra_tx_headroom +
+ 			    sizeof(struct ethhdr) + len);
+@@ -5461,10 +5459,25 @@ int ieee80211_tx_control_port(struct wip
+ 	ehdr->h_proto = proto;
+ 
+ 	skb->dev = dev;
+-	skb->protocol = htons(ETH_P_802_3);
++	skb->protocol = proto;
+ 	skb_reset_network_header(skb);
+ 	skb_reset_mac_header(skb);
+ 
++	/* update QoS header to prioritize control port frames if possible,
++	 * priorization also happens for control port frames send over
++	 * AF_PACKET
++	 */
++	rcu_read_lock();
++
++	if (ieee80211_lookup_ra_sta(sdata, skb, &sta) == 0 && !IS_ERR(sta)) {
++		u16 queue = __ieee80211_select_queue(sdata, sta, skb);
++
++		skb_set_queue_mapping(skb, queue);
++		skb_get_hash(skb);
++	}
++
++	rcu_read_unlock();
++
+ 	/* mutex lock is only needed for incrementing the cookie counter */
+ 	mutex_lock(&local->mtx);
+ 
diff --git a/package/kernel/mac80211/patches/subsys/371-mac80211-don-t-apply-flow-control-on-management-fram.patch b/package/kernel/mac80211/patches/subsys/371-mac80211-don-t-apply-flow-control-on-management-fram.patch
index b439a3814c..8d094a3632 100644
--- a/package/kernel/mac80211/patches/subsys/371-mac80211-don-t-apply-flow-control-on-management-fram.patch
+++ b/package/kernel/mac80211/patches/subsys/371-mac80211-don-t-apply-flow-control-on-management-fram.patch
@@ -28,7 +28,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
   *
   * Transmit and frame generation functions.
   */
-@@ -1403,8 +1403,17 @@ static void ieee80211_txq_enqueue(struct
+@@ -1401,8 +1401,17 @@ static void ieee80211_txq_enqueue(struct
  	ieee80211_set_skb_enqueue_time(skb);
  
  	spin_lock_bh(&fq->lock);
@@ -48,7 +48,7 @@ Signed-off-by: Johannes Berg <johannes.berg at intel.com>
  	spin_unlock_bh(&fq->lock);
  }
  
-@@ -3846,6 +3855,9 @@ bool ieee80211_txq_airtime_check(struct
+@@ -3844,6 +3853,9 @@ bool ieee80211_txq_airtime_check(struct
  	if (!txq->sta)
  		return true;
  
diff --git a/package/kernel/mac80211/patches/subsys/372-mac80211-set-sk_pacing_shift-for-802.3-txpath.patch b/package/kernel/mac80211/patches/subsys/372-mac80211-set-sk_pacing_shift-for-802.3-txpath.patch
index 4d8a91a413..5bc1469a3f 100644
--- a/package/kernel/mac80211/patches/subsys/372-mac80211-set-sk_pacing_shift-for-802.3-txpath.patch
+++ b/package/kernel/mac80211/patches/subsys/372-mac80211-set-sk_pacing_shift-for-802.3-txpath.patch
@@ -9,7 +9,7 @@ Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
 
 --- a/net/mac80211/tx.c
 +++ b/net/mac80211/tx.c
-@@ -4173,6 +4173,9 @@ static bool ieee80211_tx_8023(struct iee
+@@ -4171,6 +4171,9 @@ static bool ieee80211_tx_8023(struct iee
  	unsigned long flags;
  	int q = info->hw_queue;
  
diff --git a/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch b/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch
index 4e3242e6a9..031f8e1636 100644
--- a/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch
+++ b/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch
@@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	.rate_init = minstrel_ht_rate_init,
 --- a/net/mac80211/tx.c
 +++ b/net/mac80211/tx.c
-@@ -3933,6 +3933,29 @@ void ieee80211_txq_schedule_start(struct
+@@ -3931,6 +3931,29 @@ void ieee80211_txq_schedule_start(struct
  }
  EXPORT_SYMBOL(ieee80211_txq_schedule_start);
  
@@ -106,7 +106,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  void __ieee80211_subif_start_xmit(struct sk_buff *skb,
  				  struct net_device *dev,
  				  u32 info_flags,
-@@ -3963,6 +3986,8 @@ void __ieee80211_subif_start_xmit(struct
+@@ -3961,6 +3984,8 @@ void __ieee80211_subif_start_xmit(struct
  		skb_get_hash(skb);
  	}
  
@@ -115,7 +115,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (sta) {
  		struct ieee80211_fast_tx *fast_tx;
  
-@@ -4226,6 +4251,8 @@ static void ieee80211_8023_xmit(struct i
+@@ -4224,6 +4249,8 @@ static void ieee80211_8023_xmit(struct i
  
  	memset(info, 0, sizeof(*info));
  
diff --git a/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch b/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch
index 49b1212213..cf84fca68a 100644
--- a/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch
+++ b/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch
@@ -10,7 +10,7 @@ Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
 
 --- a/net/mac80211/tx.c
 +++ b/net/mac80211/tx.c
-@@ -1780,8 +1780,6 @@ static int invoke_tx_handlers_early(stru
+@@ -1778,8 +1778,6 @@ static int invoke_tx_handlers_early(stru
  	CALL_TXH(ieee80211_tx_h_ps_buf);
  	CALL_TXH(ieee80211_tx_h_check_control_port_protocol);
  	CALL_TXH(ieee80211_tx_h_select_key);
@@ -19,7 +19,7 @@ Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
  
   txh_done:
  	if (unlikely(res == TX_DROP)) {
-@@ -1814,6 +1812,9 @@ static int invoke_tx_handlers_late(struc
+@@ -1812,6 +1810,9 @@ static int invoke_tx_handlers_late(struc
  		goto txh_done;
  	}
  
@@ -29,7 +29,7 @@ Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
  	CALL_TXH(ieee80211_tx_h_michael_mic_add);
  	CALL_TXH(ieee80211_tx_h_sequence);
  	CALL_TXH(ieee80211_tx_h_fragment);
-@@ -3384,15 +3385,21 @@ out:
+@@ -3382,15 +3383,21 @@ out:
   * Can be called while the sta lock is held. Anything that can cause packets to
   * be generated will cause deadlock!
   */
@@ -55,7 +55,7 @@ Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
  	if (key)
  		info->control.hw_key = &key->conf;
  
-@@ -3441,6 +3448,8 @@ static void ieee80211_xmit_fast_finish(s
+@@ -3439,6 +3446,8 @@ static void ieee80211_xmit_fast_finish(s
  			break;
  		}
  	}
@@ -64,7 +64,7 @@ Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
  }
  
  static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
-@@ -3544,24 +3553,17 @@ static bool ieee80211_xmit_fast(struct i
+@@ -3542,24 +3551,17 @@ static bool ieee80211_xmit_fast(struct i
  	tx.sta = sta;
  	tx.key = fast_tx->key;
  
@@ -97,7 +97,7 @@ Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
  
  	if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
  		sdata = container_of(sdata->bss,
-@@ -3672,8 +3674,12 @@ begin:
+@@ -3670,8 +3672,12 @@ begin:
  		    (tx.key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV))
  			pn_offs = ieee80211_hdrlen(hdr->frame_control);
  
diff --git a/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch b/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch
index eefeaa4a8d..43a4a1334d 100644
--- a/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch
+++ b/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch
@@ -99,7 +99,7 @@ Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
  			tx->sta->tx_stats.last_rate = txrc.reported_rate;
  	} else if (tx->sta)
  		tx->sta->tx_stats.last_rate = txrc.reported_rate;
-@@ -3662,8 +3664,16 @@ begin:
+@@ -3660,8 +3662,16 @@ begin:
  	else
  		info->flags &= ~IEEE80211_TX_CTL_AMPDU;
  
diff --git a/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch b/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch
index 56eafaf847..2ad083f150 100644
--- a/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch
+++ b/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch
@@ -54,8 +54,8 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	int tid;
  
  	memset(tx, 0, sizeof(*tx));
-@@ -1202,8 +1226,10 @@ ieee80211_tx_prepare(struct ieee80211_su
- 			   tx->sdata->control_port_protocol == tx->skb->protocol) {
+@@ -1200,8 +1224,10 @@ ieee80211_tx_prepare(struct ieee80211_su
+ 		} else if (tx->sdata->control_port_protocol == tx->skb->protocol) {
  			tx->sta = sta_info_get_bss(sdata, hdr->addr1);
  		}
 -		if (!tx->sta && !is_multicast_ether_addr(hdr->addr1))
@@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	}
  
  	if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) &&
-@@ -1213,8 +1239,12 @@ ieee80211_tx_prepare(struct ieee80211_su
+@@ -1211,8 +1237,12 @@ ieee80211_tx_prepare(struct ieee80211_su
  		struct tid_ampdu_tx *tid_tx;
  
  		tid = ieee80211_get_tid(hdr);
@@ -80,7 +80,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		if (tid_tx) {
  			bool queued;
  
-@@ -3949,29 +3979,6 @@ void ieee80211_txq_schedule_start(struct
+@@ -3947,29 +3977,6 @@ void ieee80211_txq_schedule_start(struct
  }
  EXPORT_SYMBOL(ieee80211_txq_schedule_start);
  


From lede-commits at lists.infradead.org  Wed Jun 30 10:49:38 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 30 Jun 2021 13:49:38 -0400
Subject: [openwrt/openwrt] mac80211: always call wireless_set_data (FS#3784)
In-Reply-To: <162507537462.10732.4493156618298265258@git-01.infra.openwrt.org>
References: <162507537462.10732.4493156618298265258@git-01.infra.openwrt.org>
Message-ID: <mailman.4732.1625075387.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/9302e63d1a3589f764e61caf0b3ecdad524458ea

commit 9302e63d1a3589f764e61caf0b3ecdad524458ea
Author: Bob Cantor <coxede6557 at w3boats.com>
AuthorDate: Fri Jun 25 04:07:34 2021 +1000

    mac80211: always call wireless_set_data  (FS#3784)
    
    When wifi is turned off, drv_mac80211_teardown sometimes fails (silently)
    because the device to be torn down is not defined.
    
    This situation arises if drv_mac80211_setup was called twice when
    wifi was turned on.
    
    This commit ensures that the device to be torn down is always defined
    in drv_mac80211_teardown.
    
    Steps to reproduce:
    
    1) Use /sbin/wifi to turn on wifi.
       uci set wireless. at wifi-iface[0].disabled=0
       uci set wireless. at wifi-device[0].disabled=0
       uci commit
       wifi
    
    2) Use /sbin/wifi to turn off wifi.
       uci set wireless. at wifi-device[0].disabled=1
       uci commit
       wifi
    
    3) Observe that wifi is still up.
    
    branches affected: trunk, 21.02
    
    Signed-off-by: Bob Cantor <coxede6557 at w3boats.com>
    (cherry-picked from commit d515f6b6cde357bf480d32a7387f07ea40e85e52)
---
 package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index 43bd85cfdf..e3b26b287c 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -907,10 +907,8 @@ drv_mac80211_setup() {
 		return 1
 	}
 
-	[ -z "$(uci -q -P /var/state show wireless._${phy})" ] && {
-		uci -q -P /var/state set wireless._${phy}=phy
-		wireless_set_data phy="$phy"
-	}
+	wireless_set_data phy="$phy"
+	[ -z "$(uci -q -P /var/state show wireless._${phy})" ] && uci -q -P /var/state set wireless._${phy}=phy
 
 	OLDAPLIST=$(uci -q -P /var/state get wireless._${phy}.aplist)
 	OLDSPLIST=$(uci -q -P /var/state get wireless._${phy}.splist)


From lede-commits at lists.infradead.org  Wed Jun 30 12:39:57 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 30 Jun 2021 15:39:57 -0400
Subject: [openwrt/openwrt]  ath79: add support for Teltonika RUT230 v1
In-Reply-To: <162508199765.20812.11371202268750584354@git-01.infra.openwrt.org>
References: <162508199765.20812.11371202268750584354@git-01.infra.openwrt.org>
Message-ID: <mailman.4748.1625082002.1072.lede-commits@lists.infradead.org>

blocktrron pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/6cf1dfd7e1d6b5c6a94b87eb065408bb489574c0

commit 6cf1dfd7e1d6b5c6a94b87eb065408bb489574c0
Author: David Bauer <mail at david-bauer.net>
AuthorDate: Mon Jun 21 23:27:56 2021 +0200

    ath79: add support for Teltonika RUT230 v1
    
    This commit adds support for the Teltonika RUT230 v1, a Atheros AR9331
    based router with a Quectel UC20 UMTS modem.
    
    Hardware
    --------
    Atheros AR9331
    16 MB SPI-NOR XTX XT25F128B
    64M DDR2 memory
    Atheros AR9331 1T1R 802.11bgn Wireless
    Boootloader: pepe2k U-Boot mod
    
    Hardware-Revision
    -----------------
    There are two board revisions of the RUT230, a v0 and v1.
    
    A HW version is silkscreened on the top of the PCBs front side as well
    as shown in the Teltonika UI. However, this looks to be a different
    identifier, as the GPl dump shows this silkscreened / UI shown version
    are internally treated identically.
    
    Th following mapping has been obtained from the latest GPl dump.
    
    HW Ver   01 - 04 --> v0
    HW Ver > 05      --> v1
    
    My board was a HW Ver 09 and is treated as a v1.
    
    Installation
    ------------
    While attaching power, hold down the reset button and release it after
    the signal LEDs flashed 3 times.
    
    Attach your Computer with the devices LAN port and assign yourself the
    IPv4 address 192.168.1.10/24. Open a web browser, navigate to
    192.168.1.1. Upload the OpenWrt factory image.
    
    The device will install OpenWrt and automatically reboots afterwards.
    
    You can use the smae procedure with the stock firmware to return back to
    the vendor firmware.
    
    Signed-off-by: David Bauer <mail at david-bauer.net>
---
 .../linux/ath79/dts/ar9331_teltonika_rut230-v1.dts | 193 +++++++++++++++++++++
 .../ath79/generic/base-files/etc/board.d/01_leds   |   4 +
 target/linux/ath79/image/generic.mk                |  35 +++-
 3 files changed, 230 insertions(+), 2 deletions(-)

diff --git a/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts b/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts
new file mode 100644
index 0000000000..c394cf1cb8
--- /dev/null
+++ b/target/linux/ath79/dts/ar9331_teltonika_rut230-v1.dts
@@ -0,0 +1,193 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "ar9331.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	model = "Teltonika RUT230 v1";
+	compatible = "teltonika,rut230-v1", "qca,ar9331";
+
+	aliases {
+		label-mac-device = &wmac;
+		led-boot = &led_ss0;
+		led-failsafe = &led_ss0;
+		led-upgrade = &led_ss0;
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
+			debounce-interval = <60>;
+		};
+
+		input {
+			label = "input";
+			linux,code = <BTN_0>;
+			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+			debounce-interval = <60>;
+		};
+
+		sim-tray {
+			label = "sim-tray";
+			linux,code = <BTN_1>;
+			gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
+			debounce-interval = <60>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&switch_led_disable_pins>;
+
+		led_ss0: signal-strength-0 {
+			label = "green:signal-strength-0";
+			gpios = <&gpio 23 GPIO_ACTIVE_HIGH>;
+		};
+
+		signal-strength-1 {
+			label = "green:signal-strength-1";
+			gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
+		};
+
+		signal-strength-2 {
+			label = "green:signal-strength-2";
+			gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
+		};
+
+		signal-strength-3 {
+			label = "green:signal-strength-3";
+			gpios = <&gpio 26 GPIO_ACTIVE_HIGH>;
+		};
+
+		signal-strength-4 {
+			label = "green:signal-strength4";
+			gpios = <&gpio 27 GPIO_ACTIVE_HIGH>;
+		};
+
+		2g {
+			label = "green:2g";
+			gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
+		};
+
+		3g {
+			label = "green:3g";
+			gpios = <&gpio 24 GPIO_ACTIVE_HIGH>;
+		};
+
+		lan {
+			label = "green:lan";
+			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+			/* GPIO 13 - ACTIVE HIGH for hwrev 0 */
+		};
+
+		wan {
+			label = "green:wan";
+			gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+			/* GPIO 14 - ACTIVE HIGH for hwrev 0 */
+		};
+
+		/* 4G LED - GPIO21 ACTIVE_HIGH for RUT240 */
+	};
+
+	reg_usb_vbus: reg_usb_vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "usb_vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpio = <&gpio 19 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+	};
+};
+
+&eth0 {
+	status = "okay";
+
+	mtd-mac-address = <&config 0x0>;
+};
+
+&eth1 {
+	status = "okay";
+
+	mtd-mac-address = <&config 0x0>;
+	mtd-mac-address-increment = <1>;
+};
+
+&spi {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <30000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "u-boot";
+				reg = <0x0 0x20000>;
+				read-only;
+			};
+
+			config: partition at 20000 {
+				label = "config";
+				reg = <0x20000 0x10000>;
+				read-only;
+			};
+
+			art: partition at 30000 {
+				label = "art";
+				reg = <0x30000 0x10000>;
+				read-only;
+			};
+
+			partition at 40000 {
+				compatible = "tplink,firmware";
+				label = "firmware";
+				reg = <0x40000 0xf30000>;
+			};
+
+			partition at f70000 {
+				label = "event-log";
+				reg = <0xf70000 0x90000>;
+				read-only;
+			};
+		};
+	};
+};
+
+&usb {
+	dr_mode = "host";
+	vbus-supply = <&reg_usb_vbus>;
+	status = "okay";
+};
+
+&gpio {
+	modem-power {
+		gpio-hog;
+		output-low;
+		gpios = <18 GPIO_ACTIVE_HIGH>;
+		line-name = "modem-power";
+	};
+};
+
+&usb_phy {
+	status = "okay";
+};
+
+&wmac {
+	status = "okay";
+
+	mtd-cal-data = <&art 0x1000>;
+	mtd-mac-address = <&config 0x0>;
+	mtd-mac-address-increment = <2>;
+};
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
index d8e3d65967..c844c70e46 100644
--- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds
@@ -276,6 +276,10 @@ qihoo,c301)
 samsung,wam250)
 	ucidef_set_led_netdev "lan" "LAN" "white:lan" "eth0"
 	;;
+teltonika,rut230-v1)
+	ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
+	ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x04"
+	;;
 tplink,archer-a7-v5|\
 tplink,archer-c7-v4|\
 tplink,archer-c7-v5)
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 9d0be2b86b..ab875bd220 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -142,11 +142,20 @@ define Build/teltonika-fw-fake-checksum
 	# from begin of the firmware file) with 16 bytes stored just before
 	# 0xdeadc0de marker. Values are only compared, MD5 sum is not verified.
 	let \
-		offs="$$(stat -c%s $@) - 20"; \
+		offs="$$(stat -c%s $@) - $(1)"; \
 		dd if=$@ bs=1 count=16 skip=76 |\
 		dd of=$@ bs=1 count=16 seek=$$offs conv=notrunc
 endef
 
+define Build/teltonika-v1-header
+	$(STAGING_DIR_HOST)/bin/mktplinkfw \
+		-c -H $(TPLINK_HWID) -W $(TPLINK_HWREV) -L $(KERNEL_LOADADDR) \
+		-E $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
+		-m $(TPLINK_HEADER_VERSION) -N "$(VERSION_DIST)" -V "RUT2xx      " \
+		-k $@ -o $@.new $(1)
+	@mv $@.new $@
+endef
+
 define Build/wrgg-pad-rootfs
 	$(STAGING_DIR_HOST)/bin/padjffs2 $(IMAGE_ROOTFS) -c 64 >>$@
 endef
@@ -2182,6 +2191,28 @@ define Device/telco_t1
 endef
 TARGET_DEVICES += telco_t1
 
+define Device/teltonika_rut230-v1
+  SOC := ar9331
+  DEVICE_VENDOR := Teltonika
+  DEVICE_MODEL := RUT230
+  DEVICE_VARIANT := v1
+  DEVICE_PACKAGES := kmod-usb-chipidea2 kmod-usb-acm kmod-usb-net-qmi-wwan \
+	uqmi -uboot-envtools
+  IMAGE_SIZE := 15552k
+  TPLINK_HWID := 0x32200002
+  TPLINK_HWREV := 0x1
+  TPLINK_HEADER_VERSION := 1
+  KERNEL := kernel-bin | append-dtb | lzma | teltonika-v1-header
+  KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma
+  IMAGES += factory.bin
+  IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs |\
+	pad-rootfs | pad-extra 64 | teltonika-fw-fake-checksum 54 | check-size
+  IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) |\
+	append-rootfs | pad-rootfs | append-metadata |\
+	check-size
+endef
+TARGET_DEVICES += teltonika_rut230-v1
+
 define Device/teltonika_rut955
   SOC := ar9344
   DEVICE_VENDOR := Teltonika
@@ -2196,7 +2227,7 @@ define Device/teltonika_rut955
   KERNEL_INITRAMFS := kernel-bin | append-dtb | lzma | uImage lzma
   IMAGES += factory.bin
   IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | append-rootfs |\
-	pad-rootfs | teltonika-fw-fake-checksum | append-string master |\
+	pad-rootfs | teltonika-fw-fake-checksum 20 | append-string master |\
 	append-md5sum-bin | check-size
   IMAGE/sysupgrade.bin := append-kernel | pad-to $$$$(BLOCKSIZE) |\
 	append-rootfs | pad-rootfs | append-metadata |\


From lede-commits at lists.infradead.org  Wed Jun 30 13:01:05 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 30 Jun 2021 16:01:05 -0400
Subject: [openwrt/openwrt]  ubus: update to the latest version
In-Reply-To: <162508326561.5368.3836471287788513143@git-01.infra.openwrt.org>
References: <162508326561.5368.3836471287788513143@git-01.infra.openwrt.org>
Message-ID: <mailman.4749.1625083269.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/3c574750854488ff463b2069a5d23d9c44f2a3dc

commit 3c574750854488ff463b2069a5d23d9c44f2a3dc
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Jun 30 21:57:19 2021 +0200

    ubus: update to the latest version
    
    4fc532c8a55b ubusd: fix tx_queue linked list usage
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/system/ubus/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile
index 9b29bf0e01..678ebb1b9e 100644
--- a/package/system/ubus/Makefile
+++ b/package/system/ubus/Makefile
@@ -5,9 +5,9 @@ PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git
-PKG_SOURCE_DATE:=2021-06-03
-PKG_SOURCE_VERSION:=a8cf678230ed163ff7a07eb1e2c872f9d655460a
-PKG_MIRROR_HASH:=aee34cd1c1aa0f1a459dda0b2c6cbdb6b66e67147ebd1bcbb2a16a2ef923d008
+PKG_SOURCE_DATE:=2021-06-30
+PKG_SOURCE_VERSION:=4fc532c8a55ba8217ad67d7fd47c5eb9a8aba044
+PKG_MIRROR_HASH:=a5c8205f2e2b2f1f9ad687592e66a6e2bf8900dc54cfe3ceefe6c297d18971a8
 PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
 CMAKE_INSTALL:=1
 


From lede-commits at lists.infradead.org  Wed Jun 30 13:03:34 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 30 Jun 2021 16:03:34 -0400
Subject: [openwrt/openwrt]  ubus: update to the latest version
In-Reply-To: <162508341429.7810.7233805430572905134@git-01.infra.openwrt.org>
References: <162508341429.7810.7233805430572905134@git-01.infra.openwrt.org>
Message-ID: <mailman.4750.1625083418.1072.lede-commits@lists.infradead.org>

nbd pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/d666ebcaa327a1e03992a484d9601ea5f2e6b19a

commit d666ebcaa327a1e03992a484d9601ea5f2e6b19a
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Jun 30 21:57:19 2021 +0200

    ubus: update to the latest version
    
    4fc532c8a55b ubusd: fix tx_queue linked list usage
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/system/ubus/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile
index c9b42fe623..28e6206b12 100644
--- a/package/system/ubus/Makefile
+++ b/package/system/ubus/Makefile
@@ -5,9 +5,9 @@ PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git
-PKG_SOURCE_DATE:=2021-06-03
-PKG_SOURCE_VERSION:=a8cf678230ed163ff7a07eb1e2c872f9d655460a
-PKG_MIRROR_HASH:=aee34cd1c1aa0f1a459dda0b2c6cbdb6b66e67147ebd1bcbb2a16a2ef923d008
+PKG_SOURCE_DATE:=2021-06-30
+PKG_SOURCE_VERSION:=4fc532c8a55ba8217ad67d7fd47c5eb9a8aba044
+PKG_MIRROR_HASH:=a5c8205f2e2b2f1f9ad687592e66a6e2bf8900dc54cfe3ceefe6c297d18971a8
 PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
 CMAKE_INSTALL:=1
 


From lede-commits at lists.infradead.org  Wed Jun 30 14:24:20 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 30 Jun 2021 17:24:20 -0400
Subject: [openwrt/openwrt]  ltq-deu: Mark lantiq DEU broken
In-Reply-To: <162508825711.5607.3759935803609889341@git-01.infra.openwrt.org>
References: <162508825711.5607.3759935803609889341@git-01.infra.openwrt.org>
Message-ID: <mailman.4755.1625088261.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/964863bb23999a1fae99b883053cc4f3c5c42b40

commit 964863bb23999a1fae99b883053cc4f3c5c42b40
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Jun 27 00:52:50 2021 +0200

    ltq-deu: Mark lantiq DEU broken
    
    When the ltq_deu_vr9 kernel module is loaded, hostapd does not start any
    more. It fails with this error message:
    daemon.err hostapd: nl80211: kernel reports: key addition failed
    daemon.err hostapd: Interface initialization failed
    
    OpenWrt uses the standard Linux crypto API in the wifi drivers now
    and this probably makes the system offload more crypto operations to
    special hardware like the Lantiq DEU. There is probably a bug in the DEU
    and these operations fail and then hostapd does not start the interface.
    
    Do not include the Lantiq DEU by default any more.
    
    Fixes: FS#3901
    Fixes: 53b6783907f3 ("mac80211: remove patches stripping down crypto support")
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    Acked-by: Martin Blumenstingl <martin.blumenstingl at googlemail.com>
    Tested-by: Notupus <notpp46 at gmail.com>
---
 target/linux/lantiq/image/ar9.mk     | 15 ++++++---------
 target/linux/lantiq/image/danube.mk  |  1 -
 target/linux/lantiq/xrx200/target.mk |  1 -
 3 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/target/linux/lantiq/image/ar9.mk b/target/linux/lantiq/image/ar9.mk
index a973c90beb..ea3836ea9d 100644
--- a/target/linux/lantiq/image/ar9.mk
+++ b/target/linux/lantiq/image/ar9.mk
@@ -7,7 +7,7 @@ define Device/avm_fritz7312
 	kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
 	kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
 	ltq-adsl-app ppp-mod-pppoa \
-	kmod-ltq-deu-ar9 -swconfig
+	-swconfig
 endef
 TARGET_DEVICES += avm_fritz7312
 
@@ -22,7 +22,7 @@ define Device/avm_fritz7320
 	kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
 	kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
 	ltq-adsl-app ppp-mod-pppoa \
-	kmod-ltq-deu-ar9 kmod-usb-dwc2 -swconfig
+	kmod-usb-dwc2 -swconfig
   SUPPORTED_DEVICES += FRITZ7320
 endef
 TARGET_DEVICES += avm_fritz7320
@@ -38,7 +38,6 @@ define Device/bt_homehub-v3a
   DEVICE_PACKAGES := kmod-usb-dwc2 \
 	kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
 	kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \
-	kmod-ltq-deu-ar9 \
 	ltq-adsl-app ppp-mod-pppoa \
 	kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \
 	uboot-envtools
@@ -107,8 +106,7 @@ define Device/netgear_dgn3500
 	kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \
 	kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
 	kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \
-	ltq-adsl-app ppp-mod-pppoa \
-	kmod-ltq-deu-ar9
+	ltq-adsl-app ppp-mod-pppoa
   SUPPORTED_DEVICES += DGN3500
 endef
 TARGET_DEVICES += netgear_dgn3500
@@ -130,8 +128,7 @@ define Device/netgear_dgn3500b
 	kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \
 	kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
 	kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
-	ltq-adsl-app ppp-mod-pppoa \
-	kmod-ltq-deu-ar9
+	ltq-adsl-app ppp-mod-pppoa
   SUPPORTED_DEVICES += DGN3500B
 endef
 TARGET_DEVICES += netgear_dgn3500b
@@ -145,7 +142,7 @@ define Device/zte_h201l
 	kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
 	kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
 	ltq-adsl-app ppp-mod-pppoe \
-	kmod-ltq-deu-ar9 kmod-usb-dwc2 kmod-usb-ledtrig-usbport \
+	kmod-usb-dwc2 kmod-usb-ledtrig-usbport \
 	kmod-ltq-tapi kmod-ltq-vmmc
   SUPPORTED_DEVICES += H201L
 endef
@@ -161,7 +158,7 @@ define Device/zyxel_p-2601hn
 	kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
 	kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
 	ltq-adsl-app ppp-mod-pppoe \
-	kmod-ltq-deu-ar9 kmod-usb-dwc2
+	kmod-usb-dwc2
   SUPPORTED_DEVICES += P2601HNFX
 endef
 TARGET_DEVICES += zyxel_p-2601hn
diff --git a/target/linux/lantiq/image/danube.mk b/target/linux/lantiq/image/danube.mk
index 73ec27222a..28fa4ed800 100644
--- a/target/linux/lantiq/image/danube.mk
+++ b/target/linux/lantiq/image/danube.mk
@@ -192,7 +192,6 @@ define Device/bt_homehub-v2b
   DEVICE_PACKAGES := kmod-usb-dwc2 \
 	kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
 	kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
-	kmod-ltq-deu-danube \
 	ltq-adsl-app ppp-mod-pppoa \
 	kmod-ath9k kmod-owl-loader wpad-basic-wolfssl
   SUPPORTED_DEVICES += BTHOMEHUBV2B
diff --git a/target/linux/lantiq/xrx200/target.mk b/target/linux/lantiq/xrx200/target.mk
index c89f4bb83c..55299f632f 100644
--- a/target/linux/lantiq/xrx200/target.mk
+++ b/target/linux/lantiq/xrx200/target.mk
@@ -11,7 +11,6 @@ DEFAULT_PACKAGES+=kmod-leds-gpio \
 	kmod-ltq-vdsl-vr9 \
 	kmod-ltq-atm-vr9 \
 	kmod-ltq-ptm-vr9 \
-	kmod-ltq-deu-vr9 \
 	ltq-vdsl-app \
 	dsl-vrx200-firmware-xdsl-a \
 	dsl-vrx200-firmware-xdsl-b-patch \


From lede-commits at lists.infradead.org  Wed Jun 30 14:24:19 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 30 Jun 2021 17:24:19 -0400
Subject: [openwrt/openwrt]  ipq806x: fix dedicated cpufreq driver
In-Reply-To: <162508825711.5607.3759935803609889341@git-01.infra.openwrt.org>
References: <162508825711.5607.3759935803609889341@git-01.infra.openwrt.org>
Message-ID: <mailman.4756.1625088261.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/5e52f96714ee113b7703cb5a6c4cce1aeaec4373

commit 5e52f96714ee113b7703cb5a6c4cce1aeaec4373
Author: Ansuel Smith <ansuelsmth at gmail.com>
AuthorDate: Thu May 20 23:41:57 2021 +0200

    ipq806x: fix dedicated cpufreq driver
    
    2 small fix for the dedicated cpufreq driver:
    - Fix index wrongly used as the current cpu
    - Exit early if a bad freq is detected. In the current state the freq
    is applied anyway even with invalid state.
    
    Signed-off-by: Ansuel Smith <ansuelsmth at gmail.com>
---
 ...pufreq-add-Krait-dedicated-scaling-driver.patch | 30 ++++++++++++----------
 ...98-3-add-fab-scaling-support-with-cpufreq.patch |  6 ++---
 ...pufreq-add-Krait-dedicated-scaling-driver.patch | 30 ++++++++++++----------
 ...98-3-add-fab-scaling-support-with-cpufreq.patch |  6 ++---
 4 files changed, 38 insertions(+), 34 deletions(-)

diff --git a/target/linux/ipq806x/patches-5.10/098-1-cpufreq-add-Krait-dedicated-scaling-driver.patch b/target/linux/ipq806x/patches-5.10/098-1-cpufreq-add-Krait-dedicated-scaling-driver.patch
index 42913a994c..769686220b 100644
--- a/target/linux/ipq806x/patches-5.10/098-1-cpufreq-add-Krait-dedicated-scaling-driver.patch
+++ b/target/linux/ipq806x/patches-5.10/098-1-cpufreq-add-Krait-dedicated-scaling-driver.patch
@@ -75,7 +75,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth at gmail.com>
  ##################################################################################
 --- /dev/null
 +++ b/drivers/cpufreq/qcom-cpufreq-krait.c
-@@ -0,0 +1,601 @@
+@@ -0,0 +1,603 @@
 +// SPDX-License-Identifier: GPL-2.0
 +
 +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -115,9 +115,11 @@ Signed-off-by: Ansuel Smith <ansuelsmth at gmail.com>
 +	int cpu, ret;
 +
 +	if (l2_pdev) {
++		int policy_cpu = policy->cpu;
++
 +		/* find the max freq across all core */
 +		for_each_present_cpu(cpu)
-+			if (cpu != index)
++			if (cpu != policy_cpu)
 +				target_freq = max(
 +					target_freq,
 +					(unsigned long)cpufreq_quick_get(cpu));
@@ -132,6 +134,18 @@ Signed-off-by: Ansuel Smith <ansuelsmth at gmail.com>
 +		level = dev_pm_opp_get_level(opp);
 +		dev_pm_opp_put(opp);
 +
++		/*
++		 * Hardware constraint:
++		 * Krait CPU cannot operate at 384MHz with L2 at 1Ghz.
++		 * Assume index 0 with the idle freq and level > 0 as 
++		 * any L2 freq > 384MHz.
++		 * Skip CPU freq change in this corner case.
++		 */
++		if (unlikely(index == 0 && level != 0)) {
++			dev_err(priv->cpu_dev, "Krait CPU can't operate at idle freq with L2 at 1GHz");
++			return -EINVAL;
++		}
++
 +		opp = dev_pm_opp_find_level_exact(&l2_pdev->dev, level);
 +		if (IS_ERR(opp)) {
 +			dev_err(&l2_pdev->dev,
@@ -144,18 +158,6 @@ Signed-off-by: Ansuel Smith <ansuelsmth at gmail.com>
 +		ret = dev_pm_opp_set_rate(&l2_pdev->dev, target_freq);
 +		if (ret)
 +			return ret;
-+
-+		/*
-+		 * Hardware constraint:
-+		 * Krait CPU cannot operate at 384MHz with L2 at 1Ghz.
-+		 * Assume index 0 with the idle freq and level > 0 as 
-+		 * any L2 freq > 384MHz.
-+		 * Skip CPU freq change in this corner case.
-+		 */
-+		if (unlikely(index == 0 && level != 0)) {
-+			dev_err(priv->cpu_dev, "Krait CPU can't operate at idle freq with L2 at 1GHz");
-+			return -EINVAL;
-+		}
 +	}
 +
 +	ret = dev_pm_opp_set_rate(priv->cpu_dev, freq * 1000);
diff --git a/target/linux/ipq806x/patches-5.10/098-3-add-fab-scaling-support-with-cpufreq.patch b/target/linux/ipq806x/patches-5.10/098-3-add-fab-scaling-support-with-cpufreq.patch
index fe9143218f..8ce3f062cf 100644
--- a/target/linux/ipq806x/patches-5.10/098-3-add-fab-scaling-support-with-cpufreq.patch
+++ b/target/linux/ipq806x/patches-5.10/098-3-add-fab-scaling-support-with-cpufreq.patch
@@ -227,9 +227,9 @@
  
  #include "cpufreq-dt.h"
  
-@@ -54,6 +55,13 @@ static int set_target(struct cpufreq_pol
- 		level = dev_pm_opp_get_level(opp);
- 		dev_pm_opp_put(opp);
+@@ -68,6 +69,13 @@ static int set_target(struct cpufreq_pol
+ 			return -EINVAL;
+ 		}
  
 +		/*
 +		 * Scale fabrics with max freq across all cores
diff --git a/target/linux/ipq806x/patches-5.4/098-1-cpufreq-add-Krait-dedicated-scaling-driver.patch b/target/linux/ipq806x/patches-5.4/098-1-cpufreq-add-Krait-dedicated-scaling-driver.patch
index cfc4341ebc..d6711105da 100644
--- a/target/linux/ipq806x/patches-5.4/098-1-cpufreq-add-Krait-dedicated-scaling-driver.patch
+++ b/target/linux/ipq806x/patches-5.4/098-1-cpufreq-add-Krait-dedicated-scaling-driver.patch
@@ -75,7 +75,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth at gmail.com>
  ##################################################################################
 --- /dev/null
 +++ b/drivers/cpufreq/qcom-cpufreq-krait.c
-@@ -0,0 +1,601 @@
+@@ -0,0 +1,603 @@
 +// SPDX-License-Identifier: GPL-2.0
 +
 +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -115,9 +115,11 @@ Signed-off-by: Ansuel Smith <ansuelsmth at gmail.com>
 +	int cpu, ret;
 +
 +	if (l2_pdev) {
++		int policy_cpu = policy->cpu;
++
 +		/* find the max freq across all core */
 +		for_each_present_cpu(cpu)
-+			if (cpu != index)
++			if (cpu != policy_cpu)
 +				target_freq = max(
 +					target_freq,
 +					(unsigned long)cpufreq_quick_get(cpu));
@@ -132,6 +134,18 @@ Signed-off-by: Ansuel Smith <ansuelsmth at gmail.com>
 +		level = dev_pm_opp_get_level(opp);
 +		dev_pm_opp_put(opp);
 +
++		/*
++		 * Hardware constraint:
++		 * Krait CPU cannot operate at 384MHz with L2 at 1Ghz.
++		 * Assume index 0 with the idle freq and level > 0 as 
++		 * any L2 freq > 384MHz.
++		 * Skip CPU freq change in this corner case.
++		 */
++		if (unlikely(index == 0 && level != 0)) {
++			dev_err(priv->cpu_dev, "Krait CPU can't operate at idle freq with L2 at 1GHz");
++			return -EINVAL;
++		}
++
 +		opp = dev_pm_opp_find_level_exact(&l2_pdev->dev, level);
 +		if (IS_ERR(opp)) {
 +			dev_err(&l2_pdev->dev,
@@ -144,18 +158,6 @@ Signed-off-by: Ansuel Smith <ansuelsmth at gmail.com>
 +		ret = dev_pm_opp_set_rate(&l2_pdev->dev, target_freq);
 +		if (ret)
 +			return ret;
-+
-+		/*
-+		 * Hardware constraint:
-+		 * Krait CPU cannot operate at 384MHz with L2 at 1Ghz.
-+		 * Assume index 0 with the idle freq and level > 0 as 
-+		 * any L2 freq > 384MHz.
-+		 * Skip CPU freq change in this corner case.
-+		 */
-+		if (unlikely(index == 0 && level != 0)) {
-+			dev_err(priv->cpu_dev, "Krait CPU can't operate at idle freq with L2 at 1GHz");
-+			return -EINVAL;
-+		}
 +	}
 +
 +	ret = dev_pm_opp_set_rate(priv->cpu_dev, freq * 1000);
diff --git a/target/linux/ipq806x/patches-5.4/098-3-add-fab-scaling-support-with-cpufreq.patch b/target/linux/ipq806x/patches-5.4/098-3-add-fab-scaling-support-with-cpufreq.patch
index fe9143218f..8ce3f062cf 100644
--- a/target/linux/ipq806x/patches-5.4/098-3-add-fab-scaling-support-with-cpufreq.patch
+++ b/target/linux/ipq806x/patches-5.4/098-3-add-fab-scaling-support-with-cpufreq.patch
@@ -227,9 +227,9 @@
  
  #include "cpufreq-dt.h"
  
-@@ -54,6 +55,13 @@ static int set_target(struct cpufreq_pol
- 		level = dev_pm_opp_get_level(opp);
- 		dev_pm_opp_put(opp);
+@@ -68,6 +69,13 @@ static int set_target(struct cpufreq_pol
+ 			return -EINVAL;
+ 		}
  
 +		/*
 +		 * Scale fabrics with max freq across all cores


From lede-commits at lists.infradead.org  Wed Jun 30 14:24:17 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 30 Jun 2021 17:24:17 -0400
Subject: [openwrt/openwrt] ipq806x: fix missing changes in 5.4 for new
 cpufreq implementation
In-Reply-To: <162508825711.5607.3759935803609889341@git-01.infra.openwrt.org>
References: <162508825711.5607.3759935803609889341@git-01.infra.openwrt.org>
Message-ID: <mailman.4759.1625088266.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/aeee1bd2da724e89e9aa19e79627abd2ffd90fca

commit aeee1bd2da724e89e9aa19e79627abd2ffd90fca
Author: Ansuel Smith <ansuelsmth at gmail.com>
AuthorDate: Tue May 25 02:58:27 2021 +0200

    ipq806x: fix missing changes in 5.4 for new cpufreq implementation
    
    The new cpufreq dedicated driver changed the node structure
    on how the cache should be defined in the dts. The 5.4 dtsi addition
    patch has not been updated to follow the new implementation.
    Fix this to restore correct cache scaling and restore any performance
    regression.
    
    Signed-off-by: Ansuel Smith <ansuelsmth at gmail.com>
---
 .../patches-5.4/083-ipq8064-dtsi-additions.patch   | 80 +++++++++++++++-------
 .../ipq806x/patches-5.4/851-add-gsbi1-dts.patch    |  2 +-
 2 files changed, 57 insertions(+), 25 deletions(-)

diff --git a/target/linux/ipq806x/patches-5.4/083-ipq8064-dtsi-additions.patch b/target/linux/ipq806x/patches-5.4/083-ipq8064-dtsi-additions.patch
index cbb0231d43..ccfae25494 100644
--- a/target/linux/ipq806x/patches-5.4/083-ipq8064-dtsi-additions.patch
+++ b/target/linux/ipq806x/patches-5.4/083-ipq8064-dtsi-additions.patch
@@ -26,7 +26,7 @@
  		};
  
  		cpu1: cpu at 1 {
-@@ -38,11 +50,458 @@
+@@ -38,11 +50,476 @@
  			next-level-cache = <&L2>;
  			qcom,acc = <&acc1>;
  			qcom,saw = <&saw1>;
@@ -42,19 +42,9 @@
 +			cpu-idle-states = <&CPU_SPC>;
  		};
  
- 		L2: l2-cache {
- 			compatible = "cache";
- 			cache-level = <2>;
-+			qcom,saw = <&saw_l2>;
-+		};
-+
-+		qcom,l2 {
-+			qcom,l2-rates = <384000000 1000000000 1200000000>;
-+			qcom,l2-cpufreq = <384000000 600000000 1200000000>;
-+			qcom,l2-volt = <1100000 1100000 1150000>;
-+			qcom,l2-supply = <&smb208_s1a>;
-+		};
-+
+-		L2: l2-cache {
+-			compatible = "cache";
+-			cache-level = <2>;
 +		idle-states {
 +			CPU_SPC: spc {
 +				compatible = "qcom,idle-state-spc", "arm,idle-state";
@@ -66,6 +56,31 @@
 +		};
 +	};
 +
++	opp_table_l2: opp_table_l2 {
++		compatible = "operating-points-v2";
++
++		opp-384000000 {
++			opp-hz = /bits/ 64 <384000000>;
++			opp-microvolt = <1100000>;
++			clock-latency-ns = <100000>;
++			opp-level = <0>;
++		};
++
++		opp-1000000000 {
++			opp-hz = /bits/ 64 <1000000000>;
++			opp-microvolt = <1100000>;
++			clock-latency-ns = <100000>;
++			opp-level = <1>;
++		};
++
++		opp-1200000000 {
++			opp-hz = /bits/ 64 <1200000000>;
++			opp-microvolt = <1150000>;
++			clock-latency-ns = <100000>;
++			opp-level = <2>;
++ 		};
++ 	};
++ 
 +	opp_table0: opp_table0 {
 +		compatible = "operating-points-v2-kryo-cpu";
 +		nvmem-cells = <&speedbin_efuse>;
@@ -78,6 +93,7 @@
 +			opp-microvolt-speed0-pvs3-v0 = <800000>;
 +			opp-supported-hw = <0x1>;
 +			clock-latency-ns = <100000>;
++			opp-level = <0>;
 +		};
 +
 +		opp-600000000 {
@@ -88,6 +104,7 @@
 +			opp-microvolt-speed0-pvs3-v0 = <850000>;
 +			opp-supported-hw = <0x1>;
 +			clock-latency-ns = <100000>;
++			opp-level = <1>;
 +		};
 +
 +		opp-800000000 {
@@ -98,6 +115,7 @@
 +			opp-microvolt-speed0-pvs3-v0 = <900000>;
 +			opp-supported-hw = <0x1>;
 +			clock-latency-ns = <100000>;
++			opp-level = <1>;
 +		};
 +
 +		opp-1000000000 {
@@ -108,6 +126,7 @@
 +			opp-microvolt-speed0-pvs3-v0 = <950000>;
 +			opp-supported-hw = <0x1>;
 +			clock-latency-ns = <100000>;
++			opp-level = <1>;
 +		};
 +
 +		opp-1200000000 {
@@ -118,6 +137,7 @@
 +			opp-microvolt-speed0-pvs3-v0 = <1000000>;
 +			opp-supported-hw = <0x1>;
 +			clock-latency-ns = <100000>;
++			opp-level = <1>;
 +		};
 +
 +		opp-1400000000 {
@@ -128,6 +148,7 @@
 +			opp-microvolt-speed0-pvs3-v0 = <1050000>;
 +			opp-supported-hw = <0x1>;
 +			clock-latency-ns = <100000>;
++			opp-level = <2>;
 +		};
 +	};
 +
@@ -485,7 +506,7 @@
  		};
  	};
  
-@@ -93,6 +552,15 @@
+@@ -93,6 +570,15 @@
  		};
  	};
  
@@ -501,10 +522,21 @@
  	firmware {
  		scm {
  			compatible = "qcom,scm-ipq806x", "qcom,scm";
-@@ -120,6 +588,84 @@
+@@ -120,6 +606,95 @@
  			reg-names = "lpass-lpaif";
  		};
  
++		L2: l2-cache {
++			compatible = "qcom,krait-cache", "cache";
++			cache-level = <2>;
++			qcom,saw = <&saw_l2>;
++
++			clocks = <&kraitcc 4>;
++			clock-names = "l2";
++			l2-supply = <&smb208_s1a>;
++			operating-points-v2 = <&opp_table_l2>;
++		};
++
 +		qfprom: qfprom at 700000 {
 +			compatible = "qcom,qfprom", "syscon";
 +			reg = <0x700000 0x1000>;
@@ -586,7 +618,7 @@
  		qcom_pinmux: pinmux at 800000 {
  			compatible = "qcom,ipq8064-pinctrl";
  			reg = <0x800000 0x4000>;
-@@ -159,6 +705,15 @@
+@@ -159,6 +734,15 @@
  				};
  			};
  
@@ -602,7 +634,7 @@
  			spi_pins: spi_pins {
  				mux {
  					pins = "gpio18", "gpio19", "gpio21";
-@@ -168,6 +723,53 @@
+@@ -168,6 +752,53 @@
  				};
  			};
  
@@ -656,7 +688,7 @@
  			leds_pins: leds_pins {
  				mux {
  					pins = "gpio7", "gpio8", "gpio9",
-@@ -229,6 +831,17 @@
+@@ -229,6 +860,17 @@
  			clock-output-names = "acpu1_aux";
  		};
  
@@ -674,7 +706,7 @@
  		saw0: regulator at 2089000 {
  			compatible = "qcom,saw2", "qcom,apq8064-saw2-v1.1-cpu", "syscon";
  			reg = <0x02089000 0x1000>, <0x02009000 0x1000>;
-@@ -241,6 +854,17 @@
+@@ -241,6 +883,17 @@
  			regulator;
  		};
  
@@ -692,7 +724,7 @@
  		gsbi2: gsbi at 12480000 {
  			compatible = "qcom,gsbi-v1.0.0";
  			cell-index = <2>;
-@@ -436,6 +1060,15 @@
+@@ -436,6 +1089,15 @@
  			#power-domain-cells = <1>;
  		};
  
@@ -708,7 +740,7 @@
  		tcsr: syscon at 1a400000 {
  			compatible = "qcom,tcsr-ipq8064", "syscon";
  			reg = <0x1a400000 0x100>;
-@@ -448,6 +1081,95 @@
+@@ -448,6 +1110,95 @@
  			#reset-cells = <1>;
  		};
  
@@ -804,7 +836,7 @@
  		pcie0: pci at 1b500000 {
  			compatible = "qcom,pcie-ipq8064";
  			reg = <0x1b500000 0x1000
-@@ -601,6 +1323,167 @@
+@@ -601,6 +1352,167 @@
  			perst-gpio = <&qcom_pinmux 63 GPIO_ACTIVE_LOW>;
  		};
  
@@ -972,7 +1004,7 @@
  		vsdcc_fixed: vsdcc-regulator {
  			compatible = "regulator-fixed";
  			regulator-name = "SDCC Power";
-@@ -676,4 +1559,17 @@
+@@ -676,4 +1588,17 @@
  			};
  		};
  	};
diff --git a/target/linux/ipq806x/patches-5.4/851-add-gsbi1-dts.patch b/target/linux/ipq806x/patches-5.4/851-add-gsbi1-dts.patch
index f75f994904..a123189804 100644
--- a/target/linux/ipq806x/patches-5.4/851-add-gsbi1-dts.patch
+++ b/target/linux/ipq806x/patches-5.4/851-add-gsbi1-dts.patch
@@ -1,6 +1,6 @@
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -865,6 +865,41 @@
+@@ -894,6 +894,41 @@
  			reg = <0x12100000 0x10000>;
  		};
  


From lede-commits at lists.infradead.org  Wed Jun 30 14:24:18 2021
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 30 Jun 2021 17:24:18 -0400
Subject: [openwrt/openwrt] ipq806x: fix missing 1.4ghz cache freq for
 ipq8065 SoC
In-Reply-To: <162508825711.5607.3759935803609889341@git-01.infra.openwrt.org>
References: <162508825711.5607.3759935803609889341@git-01.infra.openwrt.org>
Message-ID: <mailman.4760.1625088268.1072.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/014aac7944ab9c6d5f33f57491acea5698d77f3b

commit 014aac7944ab9c6d5f33f57491acea5698d77f3b
Author: Ansuel Smith <ansuelsmth at gmail.com>
AuthorDate: Thu May 20 23:39:36 2021 +0200

    ipq806x: fix missing 1.4ghz cache freq for ipq8065 SoC
    
    With the new implementation of the dedicated cpufreq driver,
    the 1.4 Ghz was only dropped and not added to the ipq8065 SoC.
    Fix this to improve performance.
    
    Signed-off-by: Ansuel Smith <ansuelsmth at gmail.com>
---
 .../linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065.dtsi   | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065.dtsi b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065.dtsi
index 9c3a24f600..a0312686a0 100644
--- a/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065.dtsi
+++ b/target/linux/ipq806x/files/arch/arm/boot/dts/qcom-ipq8065.dtsi
@@ -77,6 +77,17 @@
 	qcom,mpll = <5>;
 };
 
+&opp_table_l2 {
+	/delete-node/opp-1200000000;
+
+	opp-1400000000 {
+		opp-hz = /bits/ 64 <1400000000>;
+		opp-microvolt = <1150000>;
+		clock-latency-ns = <100000>;
+		opp-level = <2>;
+	};
+};
+
 &opp_table0 {
 	/* 
 	 * On ipq8065 1.2 ghz freq is not present


