From lede-commits at lists.infradead.org  Thu Feb  2 02:17:13 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 02 Feb 2023 05:17:13 -0500
Subject: [openwrt/openwrt]  mt76: update to the latest version,
 import WED related mtk_eth_soc patches
In-Reply-To: <167533303359.816587.11341518060317560018@git-01.infra.openwrt.org>
References: <167533303359.816587.11341518060317560018@git-01.infra.openwrt.org>
Message-ID: <mailman.11426.1675333048.3064139.lede-commits@lists.infradead.org>

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

commit 521efb62ebb55dcc67dc618757aa2e3ccbdf3774
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Feb 2 11:08:09 2023 +0100

    mt76: update to the latest version, import WED related mtk_eth_soc patches
    
    6c256218e59e wifi: mt76: dma: use napi_build_skb
    679254c50f27 mt7915: add CONFIG_MT76_LEDS to cflags
    15b9dd6b1b6a wifi: mt76: mt7915: call mt7915_mcu_set_thermal_throttling() only after init_work
    8e5c21fe7c5c wifi: mt76: mt7915: rework mt7915_mcu_set_thermal_throttling
    87cb74fe42d9 wifi: mt76: mt7915: rework mt7915_thermal_temp_store()
    c6f24b83eba5 wifi: mt76: mt7915: add error message in mt7915_thermal_set_cur_throttle_state()
    99e96b89ee4d wifi: mt76: mt7915: add chip id condition in mt7915_check_eeprom()
    833cd420480f wifi: mt76: mt7921: fix channel switch fail in monitor mode
    f1f8bae6092d wifi: mt76: mt7921: add ack signal support
    f47087a6dd62 wifi: mt76: mt7996: fix chainmask calculation in mt7996_set_antenna()
    2f3b0acc1588 wifi: mt76: mt7996: update register for CFEND_RATE
    7e9540dcbd70 wifi: mt76: mt7996: do not hardcode vht beamform cap
    a37e427d0959 wifi: mt76: connac: fix POWER_CTRL command name typo
    98aa346042bd wifi: mt76: mt7915: remove BW160 and BW80+80 support
    94fed6a43541 wifi: mt76: mt7921: fix invalid remain_on_channel duration
    3c162384d80a wifi: mt76: introduce mt76_queue_is_wed_rx utility routine
    a409a9454587 wifi: mt76: mt7915: fix memory leak in mt7915_mcu_exit
    8b27ecd3a684 wifi: mt76: mt7996: fix memory leak in mt7996_mcu_exit
    683760461dd0 wifi: mt76: dma: free rx_head in mt76_dma_rx_cleanup
    0c750cf08f85 wifi: mt76: dma: fix memory leak running mt76_dma_tx_cleanup
    5de9ae29bea2 wifi: mt76: mt7915: avoid mcu_restart function pointer
    dad96dd3e62d wifi: mt76: mt7603: avoid mcu_restart function pointer
    19d36dd9c8ea wifi: mt76: mt7615: avoid mcu_restart function pointer
    6fe2c2383d3d wifi: mt76: mt7921: avoid mcu_restart function pointer
    9df89143bf71 wifi: mt76: mt7915: get rid of wed rx_buf_ring page_frag_cache
    8d51d11760cb wifi: mt76: fix switch default case in mt7996_reverse_frag0_hdr_trans
    0d8057dbd51c wifi: mt76: mt7921u: add support for Comfast CF-952AX
    ddbf4e933d54 wifi: mt76: mt7915: set sku initial value to zero
    06a8904e954e wifi: mt76: mt7915: wed: enable red per-band token drop
    724a337caef9 wifi: mt76: mt7915: fix WED TxS reporting
    747ca943a5bb wifi: mt76: add flexible polling wait-interval support
    133d7859977a wifi: mt76: mt7921: reduce polling time in pmctrl
    5fe319a0550e wifi: mt76: add memory barrier to SDIO queue kick
    822f060b9d19 wifi: mt76: mt7921: fix rx filter incorrect by drv/fw inconsistent
    c6794954a723 wifi: mt76: mt7915: fix memory leak in mt7915_mmio_wed_init_rx_buf
    9686cd7cc65c wifi: mt76: switch to page_pool allocator
    04da4eaa8235 wifi: mt76: enable page_pool stats
    1af4a911ebcb wifi: mt76: mt7915: release rxwi in mt7915_wed_release_rx_buf
    e8c10835cf06 wifi: mt76: fix compile error without CONFIG_PAGE_POOL_STATS
    0cf0ede7cc42 net: ethernet: mtk_wed: add reset to rx_ring_setup callback
    715b3ed9708a net: ethernet: mtk_wed: add reset to tx_ring_setup callback
    9107381d0ff3 wifi: mt76: mt7921: fix error code of return in mt7921_acpi_read
    36d2a5bf7802 wifi: mt76: mt7996: rely on mt76_connac2_mac_tx_rate_val
    c67f57d2cda2 wifi: mt76: dma: add reset to mt76_dma_wed_setup signature
    3dace36e2941 wifi: mt76: dma: reset wed queues in mt76_dma_rx_reset
    4b229d2da562 wifi: mt76: mt7915: add mt7915 wed reset callbacks
    f83958376085 wifi: mt76: mt7915: complete wed reset support
    321edbb414dc wifi: mt76: mt7996: rely on mt76_connac_txp_common structure
    bdb7dc38a6d1 wifi: mt76: mt7996: rely on mt76_connac_txp_skb_unmap
    8688756305c6 wifi: mt76: mt7996: rely on mt76_connac_tx_complete_skb
    fbf986dbd4c0 wifi: mt76: mt7996: rely on mt76_connac2_mac_decode_he_radiotap
    adc556cbce37 wifi: mt76: mt7996: avoid mcu_restart function pointer
    5eb4e2303be4 wifi: mt76: remove __mt76_mcu_restart macro
    e7a61c5f70f5 wifi: mt76: add EHT phy type
    b375845abc10 wifi: mt76: connac: add CMD_CBW_320MHZ
    68b17a243332 wifi: mt76: connac: add helpers for EHT capability
    02ec1f61b3a2 wifi: mt76: connac: add cmd id related to EHT support
    9209294cd81b wifi: mt76: increase wcid size to 1088
    5e85136c9b2f wifi: mt76: add EHT rate stats for ethtool
    a171f672fdeb wifi: mt76: mt7996: add variants support
    eda8fd62c105 wifi: mt76: mt7996: add helpers for wtbl and interface limit
    4a5a9f4cdc3b wifi: mt76: mt7996: rework capability init
    06b73c155680 wifi: mt76: mt7996: add EHT capability init
    ae71a1b8294f wifi: mt76: mt7996: add support for EHT rate report
    65bdfae2991d wifi: mt76: mt7996: enable EHT support in firmware
    b2360d59747c wifi: mt76: mt7996: add EHT beamforming support
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/kernel/mt76/Makefile                       |   9 +-
 ...hernet-mtk_wed-introduce-wed-mcu-support.patch} |   0
 ...thernet-mtk_wed-introduce-wed-wo-support.patch} |   0
 ...-mtk_wed-rename-tx_wdma-array-in-rx_wdma.patch} |   0
 ...net-mtk_wed-add-configure-wed-wo-support.patch} |   0
 ...net-ethernet-mtk_wed-add-rx-mib-counters.patch} |   0
 ...t-mtk_eth_soc-do-not-overwrite-mtu-config.patch |  98 +++++++
 ...t-mtk_eth_soc-remove-cpu_relax-in-mtk_pen.patch |  36 +++
 ...t-mtk_eth_soc-fix-RSTCTRL_PPE-0-1-definit.patch |  63 +++++
 ...t-mtk_wed-add-wcid-overwritten-support-fo.patch |  80 ++++++
 ...t-mtk_wed-return-status-value-in-mtk_wdma.patch |  85 ++++++
 ...t-mtk_wed-move-MTK_WDMA_RESET_IDX_TX-conf.patch |  52 ++++
 ...-net-ethernet-mtk_wed-update-mtk_wed_stop.patch |  98 +++++++
 ...rnet-mtk_wed-add-mtk_wed_rx_reset-routine.patch | 309 +++++++++++++++++++++
 ...t-mtk_wed-add-reset-to-tx_ring_setup-call.patch | 103 +++++++
 ...t-mtk_wed-fix-sleep-while-atomic-in-mtk_w.patch | 103 +++++++
 ...t-mtk_wed-get-rid-of-queue-lock-for-rx-qu.patch |  52 ++++
 ...t-mtk_wed-get-rid-of-queue-lock-for-tx-qu.patch |  75 +++++
 ...t-mtk_eth_soc-introduce-mtk_hw_reset-util.patch |  70 +++++
 ...t-mtk_eth_soc-introduce-mtk_hw_warm_reset.patch | 107 +++++++
 ...t-mtk_eth_soc-align-reset-procedure-to-ve.patch | 262 +++++++++++++++++
 ...t-mtk_eth_soc-add-dma-checks-to-mtk_hw_re.patch | 249 +++++++++++++++++
 ...t-mtk_wed-add-reset-reset_complete-callba.patch | 124 +++++++++
 ...t-mtk_wed-add-reset-to-rx_ring_setup-call.patch | 106 +++++++
 .../generic/hack-5.10/100-update-mtk_wed_h.patch   |  46 ++-
 ...ethernet-mtk_eth_soc-enable-threaded-NAPI.patch |   6 +-
 ...t-mediatek-ppe-add-support-for-flow-accou.patch |  26 +-
 ...t-mtk_eth_soc-increase-tx-ring-side-for-Q.patch |  14 +-
 ...t-mtk_eth_soc-avoid-port_mg-assignment-on.patch |   4 +-
 ...t-mtk_eth_soc-implement-multi-queue-suppo.patch |  84 +++---
 ...t-mediatek-ppe-assign-per-port-queues-for.patch |   2 +-
 ...t-mtk_eth_soc-compile-out-netsys-v2-code-.patch |   2 +-
 ...t-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch |  14 +-
 ...t-mtk_eth_soc-work-around-issue-with-send.patch |   8 +-
 ...t-mtk_eth_soc-drop-packets-to-WDMA-if-the.patch |   4 +-
 ...t-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch |  12 +-
 ...t-mtk_eth_soc-ppe-fix-L2-offloading-with-.patch |   4 +-
 ...t-mtk_eth_soc-implement-Clause-45-MDIO-ac.patch |   8 +-
 38 files changed, 2207 insertions(+), 108 deletions(-)

diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile
index 6e852bc03f..03c59cf0c1 100644
--- a/package/kernel/mt76/Makefile
+++ b/package/kernel/mt76/Makefile
@@ -8,9 +8,9 @@ PKG_LICENSE_FILES:=
 
 PKG_SOURCE_URL:=https://github.com/openwrt/mt76
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2022-12-22
-PKG_SOURCE_VERSION:=5b509e80384ab019ac11aa90c81ec0dbb5b0d7f2
-PKG_MIRROR_HASH:=6fc25df4d28becd010ff4971b23731c08b53e69381a9e4c868091899712f78a9
+PKG_SOURCE_DATE:=2022-02-02
+PKG_SOURCE_VERSION:=b2360d59747c6fed2b65bc1c3563c10593c83f3e
+PKG_MIRROR_HASH:=a89353a4e42c3b44c5a9a6a5f2248c5e985f91620b08cbee7b1cbd0dd53865d7
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 PKG_USE_NINJA:=0
@@ -40,7 +40,8 @@ define KernelPackage/mt76-default
   SUBMENU:=Wireless Drivers
   DEPENDS:= \
 	+kmod-mac80211 \
-	+ at DRIVER_11AC_SUPPORT
+	+ at DRIVER_11AC_SUPPORT \
+	+ at KERNEL_PAGE_POOL
 endef
 
 define KernelPackage/mt76
diff --git a/target/linux/generic/pending-5.15/733-01-net-ethernet-mtk_wed-introduce-wed-mcu-support.patch b/target/linux/generic/backport-5.15/729-01-v6.1-net-ethernet-mtk_wed-introduce-wed-mcu-support.patch
similarity index 100%
rename from target/linux/generic/pending-5.15/733-01-net-ethernet-mtk_wed-introduce-wed-mcu-support.patch
rename to target/linux/generic/backport-5.15/729-01-v6.1-net-ethernet-mtk_wed-introduce-wed-mcu-support.patch
diff --git a/target/linux/generic/pending-5.15/733-02-net-ethernet-mtk_wed-introduce-wed-wo-support.patch b/target/linux/generic/backport-5.15/729-02-v6.1-net-ethernet-mtk_wed-introduce-wed-wo-support.patch
similarity index 100%
rename from target/linux/generic/pending-5.15/733-02-net-ethernet-mtk_wed-introduce-wed-wo-support.patch
rename to target/linux/generic/backport-5.15/729-02-v6.1-net-ethernet-mtk_wed-introduce-wed-wo-support.patch
diff --git a/target/linux/generic/pending-5.15/733-03-net-ethernet-mtk_wed-rename-tx_wdma-array-in-rx_wdma.patch b/target/linux/generic/backport-5.15/729-03-v6.1-net-ethernet-mtk_wed-rename-tx_wdma-array-in-rx_wdma.patch
similarity index 100%
rename from target/linux/generic/pending-5.15/733-03-net-ethernet-mtk_wed-rename-tx_wdma-array-in-rx_wdma.patch
rename to target/linux/generic/backport-5.15/729-03-v6.1-net-ethernet-mtk_wed-rename-tx_wdma-array-in-rx_wdma.patch
diff --git a/target/linux/generic/pending-5.15/733-04-net-ethernet-mtk_wed-add-configure-wed-wo-support.patch b/target/linux/generic/backport-5.15/729-04-v6.1-net-ethernet-mtk_wed-add-configure-wed-wo-support.patch
similarity index 100%
rename from target/linux/generic/pending-5.15/733-04-net-ethernet-mtk_wed-add-configure-wed-wo-support.patch
rename to target/linux/generic/backport-5.15/729-04-v6.1-net-ethernet-mtk_wed-add-configure-wed-wo-support.patch
diff --git a/target/linux/generic/pending-5.15/733-05-net-ethernet-mtk_wed-add-rx-mib-counters.patch b/target/linux/generic/backport-5.15/729-05-v6.1-net-ethernet-mtk_wed-add-rx-mib-counters.patch
similarity index 100%
rename from target/linux/generic/pending-5.15/733-05-net-ethernet-mtk_wed-add-rx-mib-counters.patch
rename to target/linux/generic/backport-5.15/729-05-v6.1-net-ethernet-mtk_wed-add-rx-mib-counters.patch
diff --git a/target/linux/generic/backport-5.15/729-06-v6.1-net-ethernet-mtk_eth_soc-do-not-overwrite-mtu-config.patch b/target/linux/generic/backport-5.15/729-06-v6.1-net-ethernet-mtk_eth_soc-do-not-overwrite-mtu-config.patch
new file mode 100644
index 0000000000..f9e7caa27c
--- /dev/null
+++ b/target/linux/generic/backport-5.15/729-06-v6.1-net-ethernet-mtk_eth_soc-do-not-overwrite-mtu-config.patch
@@ -0,0 +1,98 @@
+From: Lorenzo Bianconi <lorenzo at kernel.org>
+Date: Thu, 17 Nov 2022 00:35:04 +0100
+Subject: [PATCH] net: ethernet: mtk_eth_soc: do not overwrite mtu
+ configuration running reset routine
+
+Restore user configured MTU running mtk_hw_init() during tx timeout routine
+since it will be overwritten after a hw reset.
+
+Reported-by: Felix Fietkau <nbd at nbd.name>
+Fixes: 9ea4d311509f ("net: ethernet: mediatek: add the whole ethernet reset into the reset process")
+Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
+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
+@@ -3175,6 +3175,30 @@ static void mtk_dim_tx(struct work_struc
+ 	dim->state = DIM_START_MEASURE;
+ }
+ 
++static void mtk_set_mcr_max_rx(struct mtk_mac *mac, u32 val)
++{
++	struct mtk_eth *eth = mac->hw;
++	u32 mcr_cur, mcr_new;
++
++	if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
++		return;
++
++	mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
++	mcr_new = mcr_cur & ~MAC_MCR_MAX_RX_MASK;
++
++	if (val <= 1518)
++		mcr_new |= MAC_MCR_MAX_RX(MAC_MCR_MAX_RX_1518);
++	else if (val <= 1536)
++		mcr_new |= MAC_MCR_MAX_RX(MAC_MCR_MAX_RX_1536);
++	else if (val <= 1552)
++		mcr_new |= MAC_MCR_MAX_RX(MAC_MCR_MAX_RX_1552);
++	else
++		mcr_new |= MAC_MCR_MAX_RX(MAC_MCR_MAX_RX_2048);
++
++	if (mcr_new != mcr_cur)
++		mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id));
++}
++
+ static int mtk_hw_init(struct mtk_eth *eth)
+ {
+ 	u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
+@@ -3249,8 +3273,16 @@ static int mtk_hw_init(struct mtk_eth *e
+ 	 * up with the more appropriate value when mtk_mac_config call is being
+ 	 * invoked.
+ 	 */
+-	for (i = 0; i < MTK_MAC_COUNT; i++)
++	for (i = 0; i < MTK_MAC_COUNT; i++) {
++		struct net_device *dev = eth->netdev[i];
++
+ 		mtk_w32(eth, MAC_MCR_FORCE_LINK_DOWN, MTK_MAC_MCR(i));
++		if (dev) {
++			struct mtk_mac *mac = netdev_priv(dev);
++
++			mtk_set_mcr_max_rx(mac, dev->mtu + MTK_RX_ETH_HLEN);
++		}
++	}
+ 
+ 	/* Indicates CDM to parse the MTK special tag from CPU
+ 	 * which also is working out for untag packets.
+@@ -3366,7 +3398,6 @@ static int mtk_change_mtu(struct net_dev
+ 	int length = new_mtu + MTK_RX_ETH_HLEN;
+ 	struct mtk_mac *mac = netdev_priv(dev);
+ 	struct mtk_eth *eth = mac->hw;
+-	u32 mcr_cur, mcr_new;
+ 
+ 	if (rcu_access_pointer(eth->prog) &&
+ 	    length > MTK_PP_MAX_BUF_SIZE) {
+@@ -3374,23 +3405,7 @@ static int mtk_change_mtu(struct net_dev
+ 		return -EINVAL;
+ 	}
+ 
+-	if (!MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628)) {
+-		mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
+-		mcr_new = mcr_cur & ~MAC_MCR_MAX_RX_MASK;
+-
+-		if (length <= 1518)
+-			mcr_new |= MAC_MCR_MAX_RX(MAC_MCR_MAX_RX_1518);
+-		else if (length <= 1536)
+-			mcr_new |= MAC_MCR_MAX_RX(MAC_MCR_MAX_RX_1536);
+-		else if (length <= 1552)
+-			mcr_new |= MAC_MCR_MAX_RX(MAC_MCR_MAX_RX_1552);
+-		else
+-			mcr_new |= MAC_MCR_MAX_RX(MAC_MCR_MAX_RX_2048);
+-
+-		if (mcr_new != mcr_cur)
+-			mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id));
+-	}
+-
++	mtk_set_mcr_max_rx(mac, length);
+ 	dev->mtu = new_mtu;
+ 
+ 	return 0;
diff --git a/target/linux/generic/backport-5.15/729-07-v6.1-net-ethernet-mtk_eth_soc-remove-cpu_relax-in-mtk_pen.patch b/target/linux/generic/backport-5.15/729-07-v6.1-net-ethernet-mtk_eth_soc-remove-cpu_relax-in-mtk_pen.patch
new file mode 100644
index 0000000000..e51dd7b97a
--- /dev/null
+++ b/target/linux/generic/backport-5.15/729-07-v6.1-net-ethernet-mtk_eth_soc-remove-cpu_relax-in-mtk_pen.patch
@@ -0,0 +1,36 @@
+From: Lorenzo Bianconi <lorenzo at kernel.org>
+Date: Thu, 17 Nov 2022 00:58:46 +0100
+Subject: [PATCH] net: ethernet: mtk_eth_soc: remove cpu_relax in
+ mtk_pending_work
+
+Get rid of cpu_relax in mtk_pending_work routine since MTK_RESETTING is
+set only in mtk_pending_work() and it runs holding rtnl lock
+
+Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
+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
+@@ -3436,11 +3436,8 @@ static void mtk_pending_work(struct work
+ 	rtnl_lock();
+ 
+ 	dev_dbg(eth->dev, "[%s][%d] reset\n", __func__, __LINE__);
++	set_bit(MTK_RESETTING, &eth->state);
+ 
+-	while (test_and_set_bit_lock(MTK_RESETTING, &eth->state))
+-		cpu_relax();
+-
+-	dev_dbg(eth->dev, "[%s][%d] mtk_stop starts\n", __func__, __LINE__);
+ 	/* stop all devices to make sure that dma is properly shut down */
+ 	for (i = 0; i < MTK_MAC_COUNT; i++) {
+ 		if (!eth->netdev[i])
+@@ -3474,7 +3471,7 @@ static void mtk_pending_work(struct work
+ 
+ 	dev_dbg(eth->dev, "[%s][%d] reset done\n", __func__, __LINE__);
+ 
+-	clear_bit_unlock(MTK_RESETTING, &eth->state);
++	clear_bit(MTK_RESETTING, &eth->state);
+ 
+ 	rtnl_unlock();
+ }
diff --git a/target/linux/generic/backport-5.15/729-08-v6.2-net-ethernet-mtk_eth_soc-fix-RSTCTRL_PPE-0-1-definit.patch b/target/linux/generic/backport-5.15/729-08-v6.2-net-ethernet-mtk_eth_soc-fix-RSTCTRL_PPE-0-1-definit.patch
new file mode 100644
index 0000000000..69df58eed1
--- /dev/null
+++ b/target/linux/generic/backport-5.15/729-08-v6.2-net-ethernet-mtk_eth_soc-fix-RSTCTRL_PPE-0-1-definit.patch
@@ -0,0 +1,63 @@
+From: Lorenzo Bianconi <lorenzo at kernel.org>
+Date: Thu, 17 Nov 2022 15:29:53 +0100
+Subject: [PATCH] net: ethernet: mtk_eth_soc: fix RSTCTRL_PPE{0,1} definitions
+
+Fix RSTCTRL_PPE0 and RSTCTRL_PPE1 register mask definitions for
+MTK_NETSYS_V2.
+Remove duplicated definitions.
+
+Fixes: 160d3a9b1929 ("net: ethernet: mtk_eth_soc: introduce MTK_NETSYS_V2 support")
+Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
+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
+@@ -3238,16 +3238,17 @@ static int mtk_hw_init(struct mtk_eth *e
+ 		return 0;
+ 	}
+ 
+-	val = RSTCTRL_FE | RSTCTRL_PPE;
+ 	if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
+ 		regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN, 0);
+-
+-		val |= RSTCTRL_ETH;
+-		if (MTK_HAS_CAPS(eth->soc->caps, MTK_RSTCTRL_PPE1))
+-			val |= RSTCTRL_PPE1;
++		val = RSTCTRL_PPE0_V2;
++	} else {
++		val = RSTCTRL_PPE0;
+ 	}
+ 
+-	ethsys_reset(eth, val);
++	if (MTK_HAS_CAPS(eth->soc->caps, MTK_RSTCTRL_PPE1))
++		val |= RSTCTRL_PPE1;
++
++	ethsys_reset(eth, RSTCTRL_ETH | RSTCTRL_FE | val);
+ 
+ 	if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
+ 		regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN,
+--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+@@ -444,18 +444,14 @@
+ /* ethernet reset control register */
+ #define ETHSYS_RSTCTRL			0x34
+ #define RSTCTRL_FE			BIT(6)
+-#define RSTCTRL_PPE			BIT(31)
+-#define RSTCTRL_PPE1			BIT(30)
++#define RSTCTRL_PPE0			BIT(31)
++#define RSTCTRL_PPE0_V2			BIT(30)
++#define RSTCTRL_PPE1			BIT(31)
+ #define RSTCTRL_ETH			BIT(23)
+ 
+ /* ethernet reset check idle register */
+ #define ETHSYS_FE_RST_CHK_IDLE_EN	0x28
+ 
+-/* ethernet reset control register */
+-#define ETHSYS_RSTCTRL		0x34
+-#define RSTCTRL_FE		BIT(6)
+-#define RSTCTRL_PPE		BIT(31)
+-
+ /* ethernet dma channel agent map */
+ #define ETHSYS_DMA_AG_MAP	0x408
+ #define ETHSYS_DMA_AG_MAP_PDMA	BIT(0)
diff --git a/target/linux/generic/backport-5.15/729-09-v6.2-net-ethernet-mtk_wed-add-wcid-overwritten-support-fo.patch b/target/linux/generic/backport-5.15/729-09-v6.2-net-ethernet-mtk_wed-add-wcid-overwritten-support-fo.patch
new file mode 100644
index 0000000000..d91d829911
--- /dev/null
+++ b/target/linux/generic/backport-5.15/729-09-v6.2-net-ethernet-mtk_wed-add-wcid-overwritten-support-fo.patch
@@ -0,0 +1,80 @@
+From: Sujuan Chen <sujuan.chen at mediatek.com>
+Date: Thu, 24 Nov 2022 11:18:14 +0800
+Subject: [PATCH] net: ethernet: mtk_wed: add wcid overwritten support for wed
+ v1
+
+All wed versions should enable the wcid overwritten feature,
+since the wcid size is controlled by the wlan driver.
+
+Tested-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Co-developed-by: Bo Jiao <bo.jiao at mediatek.com>
+Signed-off-by: Bo Jiao <bo.jiao at mediatek.com>
+Signed-off-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+
+--- a/drivers/net/ethernet/mediatek/mtk_wed.c
++++ b/drivers/net/ethernet/mediatek/mtk_wed.c
+@@ -526,9 +526,9 @@ mtk_wed_dma_disable(struct mtk_wed_devic
+ 			MTK_WED_WPDMA_RX_D_RX_DRV_EN);
+ 		wed_clr(dev, MTK_WED_WDMA_GLO_CFG,
+ 			MTK_WED_WDMA_GLO_CFG_TX_DDONE_CHK);
+-
+-		mtk_wed_set_512_support(dev, false);
+ 	}
++
++	mtk_wed_set_512_support(dev, false);
+ }
+ 
+ static void
+@@ -1297,9 +1297,10 @@ mtk_wed_start(struct mtk_wed_device *dev
+ 		if (mtk_wed_rro_cfg(dev))
+ 			return;
+ 
+-		mtk_wed_set_512_support(dev, dev->wlan.wcid_512);
+ 	}
+ 
++	mtk_wed_set_512_support(dev, dev->wlan.wcid_512);
++
+ 	mtk_wed_dma_enable(dev);
+ 	dev->running = true;
+ }
+@@ -1365,11 +1366,13 @@ mtk_wed_attach(struct mtk_wed_device *de
+ 	}
+ 
+ 	mtk_wed_hw_init_early(dev);
+-	if (hw->version == 1)
++	if (hw->version == 1) {
+ 		regmap_update_bits(hw->hifsys, HIFSYS_DMA_AG_MAP,
+ 				   BIT(hw->index), 0);
+-	else
++	} else {
++		dev->rev_id = wed_r32(dev, MTK_WED_REV_ID);
+ 		ret = mtk_wed_wo_init(hw);
++	}
+ out:
+ 	if (ret)
+ 		mtk_wed_detach(dev);
+--- a/drivers/net/ethernet/mediatek/mtk_wed_regs.h
++++ b/drivers/net/ethernet/mediatek/mtk_wed_regs.h
+@@ -20,6 +20,8 @@ struct mtk_wdma_desc {
+ 	__le32 info;
+ } __packed __aligned(4);
+ 
++#define MTK_WED_REV_ID					0x004
++
+ #define MTK_WED_RESET					0x008
+ #define MTK_WED_RESET_TX_BM				BIT(0)
+ #define MTK_WED_RESET_TX_FREE_AGENT			BIT(4)
+--- a/include/linux/soc/mediatek/mtk_wed.h
++++ b/include/linux/soc/mediatek/mtk_wed.h
+@@ -85,6 +85,9 @@ struct mtk_wed_device {
+ 	int irq;
+ 	u8 version;
+ 
++	/* used by wlan driver */
++	u32 rev_id;
++
+ 	struct mtk_wed_ring tx_ring[MTK_WED_TX_QUEUES];
+ 	struct mtk_wed_ring rx_ring[MTK_WED_RX_QUEUES];
+ 	struct mtk_wed_ring txfree_ring;
diff --git a/target/linux/generic/backport-5.15/729-10-v6.2-net-ethernet-mtk_wed-return-status-value-in-mtk_wdma.patch b/target/linux/generic/backport-5.15/729-10-v6.2-net-ethernet-mtk_wed-return-status-value-in-mtk_wdma.patch
new file mode 100644
index 0000000000..d97bb715e0
--- /dev/null
+++ b/target/linux/generic/backport-5.15/729-10-v6.2-net-ethernet-mtk_wed-return-status-value-in-mtk_wdma.patch
@@ -0,0 +1,85 @@
+From: Lorenzo Bianconi <lorenzo at kernel.org>
+Date: Thu, 24 Nov 2022 16:22:51 +0100
+Subject: [PATCH] net: ethernet: mtk_wed: return status value in
+ mtk_wdma_rx_reset
+
+Move MTK_WDMA_RESET_IDX configuration in mtk_wdma_rx_reset routine.
+Increase poll timeout to 10ms in order to be aligned with vendor sdk.
+This is a preliminary patch to add Wireless Ethernet Dispatcher reset
+support.
+
+Co-developed-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
+Signed-off-by: Paolo Abeni <pabeni at redhat.com>
+---
+
+--- a/drivers/net/ethernet/mediatek/mtk_wed.c
++++ b/drivers/net/ethernet/mediatek/mtk_wed.c
+@@ -101,17 +101,21 @@ mtk_wdma_read_reset(struct mtk_wed_devic
+ 	return wdma_r32(dev, MTK_WDMA_GLO_CFG);
+ }
+ 
+-static void
++static int
+ mtk_wdma_rx_reset(struct mtk_wed_device *dev)
+ {
+ 	u32 status, mask = MTK_WDMA_GLO_CFG_RX_DMA_BUSY;
+-	int i;
++	int i, ret;
+ 
+ 	wdma_clr(dev, MTK_WDMA_GLO_CFG, MTK_WDMA_GLO_CFG_RX_DMA_EN);
+-	if (readx_poll_timeout(mtk_wdma_read_reset, dev, status,
+-			       !(status & mask), 0, 1000))
++	ret = readx_poll_timeout(mtk_wdma_read_reset, dev, status,
++				 !(status & mask), 0, 10000);
++	if (ret)
+ 		dev_err(dev->hw->dev, "rx reset failed\n");
+ 
++	wdma_w32(dev, MTK_WDMA_RESET_IDX, MTK_WDMA_RESET_IDX_RX);
++	wdma_w32(dev, MTK_WDMA_RESET_IDX, 0);
++
+ 	for (i = 0; i < ARRAY_SIZE(dev->rx_wdma); i++) {
+ 		if (dev->rx_wdma[i].desc)
+ 			continue;
+@@ -119,6 +123,8 @@ mtk_wdma_rx_reset(struct mtk_wed_device
+ 		wdma_w32(dev,
+ 			 MTK_WDMA_RING_RX(i) + MTK_WED_RING_OFS_CPU_IDX, 0);
+ 	}
++
++	return ret;
+ }
+ 
+ static void
+@@ -565,9 +571,7 @@ mtk_wed_detach(struct mtk_wed_device *de
+ 
+ 	mtk_wed_stop(dev);
+ 
+-	wdma_w32(dev, MTK_WDMA_RESET_IDX, MTK_WDMA_RESET_IDX_RX);
+-	wdma_w32(dev, MTK_WDMA_RESET_IDX, 0);
+-
++	mtk_wdma_rx_reset(dev);
+ 	mtk_wed_reset(dev, MTK_WED_RESET_WED);
+ 	if (mtk_wed_get_rx_capa(dev)) {
+ 		wdma_clr(dev, MTK_WDMA_GLO_CFG, MTK_WDMA_GLO_CFG_TX_DMA_EN);
+@@ -582,7 +586,6 @@ mtk_wed_detach(struct mtk_wed_device *de
+ 		mtk_wed_wo_reset(dev);
+ 		mtk_wed_free_rx_rings(dev);
+ 		mtk_wed_wo_deinit(hw);
+-		mtk_wdma_rx_reset(dev);
+ 	}
+ 
+ 	if (dev->wlan.bus_type == MTK_WED_BUS_PCIE) {
+@@ -1006,11 +1009,7 @@ mtk_wed_reset_dma(struct mtk_wed_device
+ 		wed_w32(dev, MTK_WED_RESET_IDX, 0);
+ 	}
+ 
+-	wdma_w32(dev, MTK_WDMA_RESET_IDX, MTK_WDMA_RESET_IDX_RX);
+-	wdma_w32(dev, MTK_WDMA_RESET_IDX, 0);
+-
+-	if (mtk_wed_get_rx_capa(dev))
+-		mtk_wdma_rx_reset(dev);
++	mtk_wdma_rx_reset(dev);
+ 
+ 	if (busy) {
+ 		mtk_wed_reset(dev, MTK_WED_RESET_WDMA_INT_AGENT);
diff --git a/target/linux/generic/backport-5.15/729-11-v6.2-net-ethernet-mtk_wed-move-MTK_WDMA_RESET_IDX_TX-conf.patch b/target/linux/generic/backport-5.15/729-11-v6.2-net-ethernet-mtk_wed-move-MTK_WDMA_RESET_IDX_TX-conf.patch
new file mode 100644
index 0000000000..10c1732c96
--- /dev/null
+++ b/target/linux/generic/backport-5.15/729-11-v6.2-net-ethernet-mtk_wed-move-MTK_WDMA_RESET_IDX_TX-conf.patch
@@ -0,0 +1,52 @@
+From: Lorenzo Bianconi <lorenzo at kernel.org>
+Date: Thu, 24 Nov 2022 16:22:52 +0100
+Subject: [PATCH] net: ethernet: mtk_wed: move MTK_WDMA_RESET_IDX_TX
+ configuration in mtk_wdma_tx_reset
+
+Remove duplicated code. Increase poll timeout to 10ms in order to be
+aligned with vendor sdk.
+This is a preliminary patch to add Wireless Ethernet Dispatcher reset
+support.
+
+Co-developed-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
+Signed-off-by: Paolo Abeni <pabeni at redhat.com>
+---
+
+--- a/drivers/net/ethernet/mediatek/mtk_wed.c
++++ b/drivers/net/ethernet/mediatek/mtk_wed.c
+@@ -135,16 +135,15 @@ mtk_wdma_tx_reset(struct mtk_wed_device
+ 
+ 	wdma_clr(dev, MTK_WDMA_GLO_CFG, MTK_WDMA_GLO_CFG_TX_DMA_EN);
+ 	if (readx_poll_timeout(mtk_wdma_read_reset, dev, status,
+-			       !(status & mask), 0, 1000))
++			       !(status & mask), 0, 10000))
+ 		dev_err(dev->hw->dev, "tx reset failed\n");
+ 
+-	for (i = 0; i < ARRAY_SIZE(dev->tx_wdma); i++) {
+-		if (dev->tx_wdma[i].desc)
+-			continue;
++	wdma_w32(dev, MTK_WDMA_RESET_IDX, MTK_WDMA_RESET_IDX_TX);
++	wdma_w32(dev, MTK_WDMA_RESET_IDX, 0);
+ 
++	for (i = 0; i < ARRAY_SIZE(dev->tx_wdma); i++)
+ 		wdma_w32(dev,
+ 			 MTK_WDMA_RING_TX(i) + MTK_WED_RING_OFS_CPU_IDX, 0);
+-	}
+ }
+ 
+ static void
+@@ -573,12 +572,6 @@ mtk_wed_detach(struct mtk_wed_device *de
+ 
+ 	mtk_wdma_rx_reset(dev);
+ 	mtk_wed_reset(dev, MTK_WED_RESET_WED);
+-	if (mtk_wed_get_rx_capa(dev)) {
+-		wdma_clr(dev, MTK_WDMA_GLO_CFG, MTK_WDMA_GLO_CFG_TX_DMA_EN);
+-		wdma_w32(dev, MTK_WDMA_RESET_IDX, MTK_WDMA_RESET_IDX_TX);
+-		wdma_w32(dev, MTK_WDMA_RESET_IDX, 0);
+-	}
+-
+ 	mtk_wed_free_tx_buffer(dev);
+ 	mtk_wed_free_tx_rings(dev);
+ 
diff --git a/target/linux/generic/backport-5.15/729-12-v6.2-net-ethernet-mtk_wed-update-mtk_wed_stop.patch b/target/linux/generic/backport-5.15/729-12-v6.2-net-ethernet-mtk_wed-update-mtk_wed_stop.patch
new file mode 100644
index 0000000000..dfc0f8c3f3
--- /dev/null
+++ b/target/linux/generic/backport-5.15/729-12-v6.2-net-ethernet-mtk_wed-update-mtk_wed_stop.patch
@@ -0,0 +1,98 @@
+From: Lorenzo Bianconi <lorenzo at kernel.org>
+Date: Thu, 24 Nov 2022 16:22:53 +0100
+Subject: [PATCH] net: ethernet: mtk_wed: update mtk_wed_stop
+
+Update mtk_wed_stop routine and rename old mtk_wed_stop() to
+mtk_wed_deinit(). This is a preliminary patch to add Wireless Ethernet
+Dispatcher reset support.
+
+Co-developed-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
+Signed-off-by: Paolo Abeni <pabeni at redhat.com>
+---
+
+--- a/drivers/net/ethernet/mediatek/mtk_wed.c
++++ b/drivers/net/ethernet/mediatek/mtk_wed.c
+@@ -539,14 +539,8 @@ mtk_wed_dma_disable(struct mtk_wed_devic
+ static void
+ mtk_wed_stop(struct mtk_wed_device *dev)
+ {
+-	mtk_wed_dma_disable(dev);
+ 	mtk_wed_set_ext_int(dev, false);
+ 
+-	wed_clr(dev, MTK_WED_CTRL,
+-		MTK_WED_CTRL_WDMA_INT_AGENT_EN |
+-		MTK_WED_CTRL_WPDMA_INT_AGENT_EN |
+-		MTK_WED_CTRL_WED_TX_BM_EN |
+-		MTK_WED_CTRL_WED_TX_FREE_AGENT_EN);
+ 	wed_w32(dev, MTK_WED_WPDMA_INT_TRIGGER, 0);
+ 	wed_w32(dev, MTK_WED_WDMA_INT_TRIGGER, 0);
+ 	wdma_w32(dev, MTK_WDMA_INT_MASK, 0);
+@@ -558,7 +552,27 @@ mtk_wed_stop(struct mtk_wed_device *dev)
+ 
+ 	wed_w32(dev, MTK_WED_EXT_INT_MASK1, 0);
+ 	wed_w32(dev, MTK_WED_EXT_INT_MASK2, 0);
+-	wed_clr(dev, MTK_WED_CTRL, MTK_WED_CTRL_WED_RX_BM_EN);
++}
++
++static void
++mtk_wed_deinit(struct mtk_wed_device *dev)
++{
++	mtk_wed_stop(dev);
++	mtk_wed_dma_disable(dev);
++
++	wed_clr(dev, MTK_WED_CTRL,
++		MTK_WED_CTRL_WDMA_INT_AGENT_EN |
++		MTK_WED_CTRL_WPDMA_INT_AGENT_EN |
++		MTK_WED_CTRL_WED_TX_BM_EN |
++		MTK_WED_CTRL_WED_TX_FREE_AGENT_EN);
++
++	if (dev->hw->version == 1)
++		return;
++
++	wed_clr(dev, MTK_WED_CTRL,
++		MTK_WED_CTRL_RX_ROUTE_QM_EN |
++		MTK_WED_CTRL_WED_RX_BM_EN |
++		MTK_WED_CTRL_RX_RRO_QM_EN);
+ }
+ 
+ static void
+@@ -568,7 +582,7 @@ mtk_wed_detach(struct mtk_wed_device *de
+ 
+ 	mutex_lock(&hw_lock);
+ 
+-	mtk_wed_stop(dev);
++	mtk_wed_deinit(dev);
+ 
+ 	mtk_wdma_rx_reset(dev);
+ 	mtk_wed_reset(dev, MTK_WED_RESET_WED);
+@@ -677,7 +691,7 @@ mtk_wed_hw_init_early(struct mtk_wed_dev
+ {
+ 	u32 mask, set;
+ 
+-	mtk_wed_stop(dev);
++	mtk_wed_deinit(dev);
+ 	mtk_wed_reset(dev, MTK_WED_RESET_WED);
+ 	mtk_wed_set_wpdma(dev);
+ 
+--- a/include/linux/soc/mediatek/mtk_wed.h
++++ b/include/linux/soc/mediatek/mtk_wed.h
+@@ -234,6 +234,8 @@ mtk_wed_get_rx_capa(struct mtk_wed_devic
+ 	(_dev)->ops->ppe_check(_dev, _skb, _reason, _hash)
+ #define mtk_wed_device_update_msg(_dev, _id, _msg, _len) \
+ 	(_dev)->ops->msg_update(_dev, _id, _msg, _len)
++#define mtk_wed_device_stop(_dev) (_dev)->ops->stop(_dev)
++#define mtk_wed_device_dma_reset(_dev) (_dev)->ops->reset_dma(_dev)
+ #else
+ static inline bool mtk_wed_device_active(struct mtk_wed_device *dev)
+ {
+@@ -250,6 +252,8 @@ static inline bool mtk_wed_device_active
+ #define mtk_wed_device_rx_ring_setup(_dev, _ring, _regs) -ENODEV
+ #define mtk_wed_device_ppe_check(_dev, _skb, _reason, _hash)  do {} while (0)
+ #define mtk_wed_device_update_msg(_dev, _id, _msg, _len) -ENODEV
++#define mtk_wed_device_stop(_dev) do {} while (0)
++#define mtk_wed_device_dma_reset(_dev) do {} while (0)
+ #endif
+ 
+ #endif
diff --git a/target/linux/generic/backport-5.15/729-13-v6.2-net-ethernet-mtk_wed-add-mtk_wed_rx_reset-routine.patch b/target/linux/generic/backport-5.15/729-13-v6.2-net-ethernet-mtk_wed-add-mtk_wed_rx_reset-routine.patch
new file mode 100644
index 0000000000..2205fea513
--- /dev/null
+++ b/target/linux/generic/backport-5.15/729-13-v6.2-net-ethernet-mtk_wed-add-mtk_wed_rx_reset-routine.patch
@@ -0,0 +1,309 @@
+From: Lorenzo Bianconi <lorenzo at kernel.org>
+Date: Thu, 24 Nov 2022 16:22:54 +0100
+Subject: [PATCH] net: ethernet: mtk_wed: add mtk_wed_rx_reset routine
+
+Introduce mtk_wed_rx_reset routine in order to reset rx DMA for Wireless
+Ethernet Dispatcher available on MT7986 SoC.
+
+Co-developed-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
+Signed-off-by: Paolo Abeni <pabeni at redhat.com>
+---
+
+--- a/drivers/net/ethernet/mediatek/mtk_wed.c
++++ b/drivers/net/ethernet/mediatek/mtk_wed.c
+@@ -951,42 +951,130 @@ mtk_wed_ring_reset(struct mtk_wed_ring *
+ }
+ 
+ static u32
+-mtk_wed_check_busy(struct mtk_wed_device *dev)
++mtk_wed_check_busy(struct mtk_wed_device *dev, u32 reg, u32 mask)
+ {
+-	if (wed_r32(dev, MTK_WED_GLO_CFG) & MTK_WED_GLO_CFG_TX_DMA_BUSY)
+-		return true;
+-
+-	if (wed_r32(dev, MTK_WED_WPDMA_GLO_CFG) &
+-	    MTK_WED_WPDMA_GLO_CFG_TX_DRV_BUSY)
+-		return true;
+-
+-	if (wed_r32(dev, MTK_WED_CTRL) & MTK_WED_CTRL_WDMA_INT_AGENT_BUSY)
+-		return true;
+-
+-	if (wed_r32(dev, MTK_WED_WDMA_GLO_CFG) &
+-	    MTK_WED_WDMA_GLO_CFG_RX_DRV_BUSY)
+-		return true;
+-
+-	if (wdma_r32(dev, MTK_WDMA_GLO_CFG) &
+-	    MTK_WED_WDMA_GLO_CFG_RX_DRV_BUSY)
+-		return true;
+-
+-	if (wed_r32(dev, MTK_WED_CTRL) &
+-	    (MTK_WED_CTRL_WED_TX_BM_BUSY | MTK_WED_CTRL_WED_TX_FREE_AGENT_BUSY))
+-		return true;
+-
+-	return false;
++	return !!(wed_r32(dev, reg) & mask);
+ }
+ 
+ static int
+-mtk_wed_poll_busy(struct mtk_wed_device *dev)
++mtk_wed_poll_busy(struct mtk_wed_device *dev, u32 reg, u32 mask)
+ {
+ 	int sleep = 15000;
+ 	int timeout = 100 * sleep;
+ 	u32 val;
+ 
+ 	return read_poll_timeout(mtk_wed_check_busy, val, !val, sleep,
+-				 timeout, false, dev);
++				 timeout, false, dev, reg, mask);
++}
++
++static int
++mtk_wed_rx_reset(struct mtk_wed_device *dev)
++{
++	struct mtk_wed_wo *wo = dev->hw->wed_wo;
++	u8 val = MTK_WED_WO_STATE_SER_RESET;
++	int i, ret;
++
++	ret = mtk_wed_mcu_send_msg(wo, MTK_WED_MODULE_ID_WO,
++				   MTK_WED_WO_CMD_CHANGE_STATE, &val,
++				   sizeof(val), true);
++	if (ret)
++		return ret;
++
++	wed_clr(dev, MTK_WED_WPDMA_RX_D_GLO_CFG, MTK_WED_WPDMA_RX_D_RX_DRV_EN);
++	ret = mtk_wed_poll_busy(dev, MTK_WED_WPDMA_RX_D_GLO_CFG,
++				MTK_WED_WPDMA_RX_D_RX_DRV_BUSY);
++	if (ret) {
++		mtk_wed_reset(dev, MTK_WED_RESET_WPDMA_INT_AGENT);
++		mtk_wed_reset(dev, MTK_WED_RESET_WPDMA_RX_D_DRV);
++	} else {
++		wed_w32(dev, MTK_WED_WPDMA_RX_D_RST_IDX,
++			MTK_WED_WPDMA_RX_D_RST_CRX_IDX |
++			MTK_WED_WPDMA_RX_D_RST_DRV_IDX);
++
++		wed_set(dev, MTK_WED_WPDMA_RX_D_GLO_CFG,
++			MTK_WED_WPDMA_RX_D_RST_INIT_COMPLETE |
++			MTK_WED_WPDMA_RX_D_FSM_RETURN_IDLE);
++		wed_clr(dev, MTK_WED_WPDMA_RX_D_GLO_CFG,
++			MTK_WED_WPDMA_RX_D_RST_INIT_COMPLETE |
++			MTK_WED_WPDMA_RX_D_FSM_RETURN_IDLE);
++
++		wed_w32(dev, MTK_WED_WPDMA_RX_D_RST_IDX, 0);
++	}
++
++	/* reset rro qm */
++	wed_clr(dev, MTK_WED_CTRL, MTK_WED_CTRL_RX_RRO_QM_EN);
++	ret = mtk_wed_poll_busy(dev, MTK_WED_CTRL,
++				MTK_WED_CTRL_RX_RRO_QM_BUSY);
++	if (ret) {
++		mtk_wed_reset(dev, MTK_WED_RESET_RX_RRO_QM);
++	} else {
++		wed_set(dev, MTK_WED_RROQM_RST_IDX,
++			MTK_WED_RROQM_RST_IDX_MIOD |
++			MTK_WED_RROQM_RST_IDX_FDBK);
++		wed_w32(dev, MTK_WED_RROQM_RST_IDX, 0);
++	}
++
++	/* reset route qm */
++	wed_clr(dev, MTK_WED_CTRL, MTK_WED_CTRL_RX_ROUTE_QM_EN);
++	ret = mtk_wed_poll_busy(dev, MTK_WED_CTRL,
++				MTK_WED_CTRL_RX_ROUTE_QM_BUSY);
++	if (ret)
++		mtk_wed_reset(dev, MTK_WED_RESET_RX_ROUTE_QM);
++	else
++		wed_set(dev, MTK_WED_RTQM_GLO_CFG,
++			MTK_WED_RTQM_Q_RST);
++
++	/* reset tx wdma */
++	mtk_wdma_tx_reset(dev);
++
++	/* reset tx wdma drv */
++	wed_clr(dev, MTK_WED_WDMA_GLO_CFG, MTK_WED_WDMA_GLO_CFG_TX_DRV_EN);
++	mtk_wed_poll_busy(dev, MTK_WED_CTRL,
++			  MTK_WED_CTRL_WDMA_INT_AGENT_BUSY);
++	mtk_wed_reset(dev, MTK_WED_RESET_WDMA_TX_DRV);
++
++	/* reset wed rx dma */
++	ret = mtk_wed_poll_busy(dev, MTK_WED_GLO_CFG,
++				MTK_WED_GLO_CFG_RX_DMA_BUSY);
++	wed_clr(dev, MTK_WED_GLO_CFG, MTK_WED_GLO_CFG_RX_DMA_EN);
++	if (ret) {
++		mtk_wed_reset(dev, MTK_WED_RESET_WED_RX_DMA);
++	} else {
++		struct mtk_eth *eth = dev->hw->eth;
++
++		if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2))
++			wed_set(dev, MTK_WED_RESET_IDX,
++				MTK_WED_RESET_IDX_RX_V2);
++		else
++			wed_set(dev, MTK_WED_RESET_IDX, MTK_WED_RESET_IDX_RX);
++		wed_w32(dev, MTK_WED_RESET_IDX, 0);
++	}
++
++	/* reset rx bm */
++	wed_clr(dev, MTK_WED_CTRL, MTK_WED_CTRL_WED_RX_BM_EN);
++	mtk_wed_poll_busy(dev, MTK_WED_CTRL,
++			  MTK_WED_CTRL_WED_RX_BM_BUSY);
++	mtk_wed_reset(dev, MTK_WED_RESET_RX_BM);
++
++	/* wo change to enable state */
++	val = MTK_WED_WO_STATE_ENABLE;
++	ret = mtk_wed_mcu_send_msg(wo, MTK_WED_MODULE_ID_WO,
++				   MTK_WED_WO_CMD_CHANGE_STATE, &val,
++				   sizeof(val), true);
++	if (ret)
++		return ret;
++
++	/* wed_rx_ring_reset */
++	for (i = 0; i < ARRAY_SIZE(dev->rx_ring); i++) {
++		if (!dev->rx_ring[i].desc)
++			continue;
++
++		mtk_wed_ring_reset(&dev->rx_ring[i], MTK_WED_RX_RING_SIZE,
++				   false);
++	}
++	mtk_wed_free_rx_buffer(dev);
++
++	return 0;
+ }
+ 
+ static void
+@@ -1004,19 +1092,23 @@ mtk_wed_reset_dma(struct mtk_wed_device
+ 				   true);
+ 	}
+ 
+-	if (mtk_wed_poll_busy(dev))
+-		busy = mtk_wed_check_busy(dev);
+-
++	/* 1. reset WED tx DMA */
++	wed_clr(dev, MTK_WED_GLO_CFG, MTK_WED_GLO_CFG_TX_DMA_EN);
++	busy = mtk_wed_poll_busy(dev, MTK_WED_GLO_CFG,
++				 MTK_WED_GLO_CFG_TX_DMA_BUSY);
+ 	if (busy) {
+ 		mtk_wed_reset(dev, MTK_WED_RESET_WED_TX_DMA);
+ 	} else {
+-		wed_w32(dev, MTK_WED_RESET_IDX,
+-			MTK_WED_RESET_IDX_TX |
+-			MTK_WED_RESET_IDX_RX);
++		wed_w32(dev, MTK_WED_RESET_IDX, MTK_WED_RESET_IDX_TX);
+ 		wed_w32(dev, MTK_WED_RESET_IDX, 0);
+ 	}
+ 
+-	mtk_wdma_rx_reset(dev);
++	/* 2. reset WDMA rx DMA */
++	busy = !!mtk_wdma_rx_reset(dev);
++	wed_clr(dev, MTK_WED_WDMA_GLO_CFG, MTK_WED_WDMA_GLO_CFG_RX_DRV_EN);
++	if (!busy)
++		busy = mtk_wed_poll_busy(dev, MTK_WED_WDMA_GLO_CFG,
++					 MTK_WED_WDMA_GLO_CFG_RX_DRV_BUSY);
+ 
+ 	if (busy) {
+ 		mtk_wed_reset(dev, MTK_WED_RESET_WDMA_INT_AGENT);
+@@ -1033,6 +1125,9 @@ mtk_wed_reset_dma(struct mtk_wed_device
+ 			MTK_WED_WDMA_GLO_CFG_RST_INIT_COMPLETE);
+ 	}
+ 
++	/* 3. reset WED WPDMA tx */
++	wed_clr(dev, MTK_WED_CTRL, MTK_WED_CTRL_WED_TX_FREE_AGENT_EN);
++
+ 	for (i = 0; i < 100; i++) {
+ 		val = wed_r32(dev, MTK_WED_TX_BM_INTF);
+ 		if (FIELD_GET(MTK_WED_TX_BM_INTF_TKFIFO_FDEP, val) == 0x40)
+@@ -1040,8 +1135,19 @@ mtk_wed_reset_dma(struct mtk_wed_device
+ 	}
+ 
+ 	mtk_wed_reset(dev, MTK_WED_RESET_TX_FREE_AGENT);
++	wed_clr(dev, MTK_WED_CTRL, MTK_WED_CTRL_WED_TX_BM_EN);
+ 	mtk_wed_reset(dev, MTK_WED_RESET_TX_BM);
+ 
++	/* 4. reset WED WPDMA tx */
++	busy = mtk_wed_poll_busy(dev, MTK_WED_WPDMA_GLO_CFG,
++				 MTK_WED_WPDMA_GLO_CFG_TX_DRV_BUSY);
++	wed_clr(dev, MTK_WED_WPDMA_GLO_CFG,
++		MTK_WED_WPDMA_GLO_CFG_TX_DRV_EN |
++		MTK_WED_WPDMA_GLO_CFG_RX_DRV_EN);
++	if (!busy)
++		busy = mtk_wed_poll_busy(dev, MTK_WED_WPDMA_GLO_CFG,
++					 MTK_WED_WPDMA_GLO_CFG_RX_DRV_BUSY);
++
+ 	if (busy) {
+ 		mtk_wed_reset(dev, MTK_WED_RESET_WPDMA_INT_AGENT);
+ 		mtk_wed_reset(dev, MTK_WED_RESET_WPDMA_TX_DRV);
+@@ -1052,6 +1158,17 @@ mtk_wed_reset_dma(struct mtk_wed_device
+ 			MTK_WED_WPDMA_RESET_IDX_RX);
+ 		wed_w32(dev, MTK_WED_WPDMA_RESET_IDX, 0);
+ 	}
++
++	dev->init_done = false;
++	if (dev->hw->version == 1)
++		return;
++
++	if (!busy) {
++		wed_w32(dev, MTK_WED_RESET_IDX, MTK_WED_RESET_WPDMA_IDX_RX);
++		wed_w32(dev, MTK_WED_RESET_IDX, 0);
++	}
++
++	mtk_wed_rx_reset(dev);
+ }
+ 
+ static int
+@@ -1274,6 +1391,9 @@ mtk_wed_start(struct mtk_wed_device *dev
+ {
+ 	int i;
+ 
++	if (mtk_wed_get_rx_capa(dev) && mtk_wed_rx_buffer_alloc(dev))
++		return;
++
+ 	for (i = 0; i < ARRAY_SIZE(dev->rx_wdma); i++)
+ 		if (!dev->rx_wdma[i].desc)
+ 			mtk_wed_wdma_rx_ring_setup(dev, i, 16);
+@@ -1362,10 +1482,6 @@ mtk_wed_attach(struct mtk_wed_device *de
+ 		goto out;
+ 
+ 	if (mtk_wed_get_rx_capa(dev)) {
+-		ret = mtk_wed_rx_buffer_alloc(dev);
+-		if (ret)
+-			goto out;
+-
+ 		ret = mtk_wed_rro_alloc(dev);
+ 		if (ret)
+ 			goto out;
+--- a/drivers/net/ethernet/mediatek/mtk_wed_regs.h
++++ b/drivers/net/ethernet/mediatek/mtk_wed_regs.h
+@@ -24,11 +24,15 @@ struct mtk_wdma_desc {
+ 
+ #define MTK_WED_RESET					0x008
+ #define MTK_WED_RESET_TX_BM				BIT(0)
++#define MTK_WED_RESET_RX_BM				BIT(1)
+ #define MTK_WED_RESET_TX_FREE_AGENT			BIT(4)
+ #define MTK_WED_RESET_WPDMA_TX_DRV			BIT(8)
+ #define MTK_WED_RESET_WPDMA_RX_DRV			BIT(9)
++#define MTK_WED_RESET_WPDMA_RX_D_DRV			BIT(10)
+ #define MTK_WED_RESET_WPDMA_INT_AGENT			BIT(11)
+ #define MTK_WED_RESET_WED_TX_DMA			BIT(12)
++#define MTK_WED_RESET_WED_RX_DMA			BIT(13)
++#define MTK_WED_RESET_WDMA_TX_DRV			BIT(16)
+ #define MTK_WED_RESET_WDMA_RX_DRV			BIT(17)
+ #define MTK_WED_RESET_WDMA_INT_AGENT			BIT(19)
+ #define MTK_WED_RESET_RX_RRO_QM				BIT(20)
+@@ -158,6 +162,8 @@ struct mtk_wdma_desc {
+ #define MTK_WED_RESET_IDX				0x20c
+ #define MTK_WED_RESET_IDX_TX				GENMASK(3, 0)
+ #define MTK_WED_RESET_IDX_RX				GENMASK(17, 16)
++#define MTK_WED_RESET_IDX_RX_V2				GENMASK(7, 6)
++#define MTK_WED_RESET_WPDMA_IDX_RX			GENMASK(31, 30)
+ 
+ #define MTK_WED_TX_MIB(_n)				(0x2a0 + (_n) * 4)
+ #define MTK_WED_RX_MIB(_n)				(0x2e0 + (_n) * 4)
+@@ -267,6 +273,9 @@ struct mtk_wdma_desc {
+ 
+ #define MTK_WED_WPDMA_RX_D_GLO_CFG			0x75c
+ #define MTK_WED_WPDMA_RX_D_RX_DRV_EN			BIT(0)
++#define MTK_WED_WPDMA_RX_D_RX_DRV_BUSY			BIT(1)
++#define MTK_WED_WPDMA_RX_D_FSM_RETURN_IDLE		BIT(3)
++#define MTK_WED_WPDMA_RX_D_RST_INIT_COMPLETE		BIT(4)
+ #define MTK_WED_WPDMA_RX_D_INIT_PHASE_RXEN_SEL		GENMASK(11, 7)
+ #define MTK_WED_WPDMA_RX_D_RXD_READ_LEN			GENMASK(31, 24)
+ 
diff --git a/target/linux/generic/backport-5.15/729-14-v6.2-net-ethernet-mtk_wed-add-reset-to-tx_ring_setup-call.patch b/target/linux/generic/backport-5.15/729-14-v6.2-net-ethernet-mtk_wed-add-reset-to-tx_ring_setup-call.patch
new file mode 100644
index 0000000000..602483bcb8
--- /dev/null
+++ b/target/linux/generic/backport-5.15/729-14-v6.2-net-ethernet-mtk_wed-add-reset-to-tx_ring_setup-call.patch
@@ -0,0 +1,103 @@
+From: Lorenzo Bianconi <lorenzo at kernel.org>
+Date: Thu, 24 Nov 2022 16:22:55 +0100
+Subject: [PATCH] net: ethernet: mtk_wed: add reset to tx_ring_setup callback
+
+Introduce reset parameter to mtk_wed_tx_ring_setup signature.
+This is a preliminary patch to add Wireless Ethernet Dispatcher reset
+support.
+
+Co-developed-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
+Signed-off-by: Paolo Abeni <pabeni at redhat.com>
+---
+
+--- a/drivers/net/ethernet/mediatek/mtk_wed.c
++++ b/drivers/net/ethernet/mediatek/mtk_wed.c
+@@ -1188,7 +1188,8 @@ mtk_wed_ring_alloc(struct mtk_wed_device
+ }
+ 
+ static int
+-mtk_wed_wdma_rx_ring_setup(struct mtk_wed_device *dev, int idx, int size)
++mtk_wed_wdma_rx_ring_setup(struct mtk_wed_device *dev, int idx, int size,
++			   bool reset)
+ {
+ 	u32 desc_size = sizeof(struct mtk_wdma_desc) * dev->hw->version;
+ 	struct mtk_wed_ring *wdma;
+@@ -1197,8 +1198,8 @@ mtk_wed_wdma_rx_ring_setup(struct mtk_we
+ 		return -EINVAL;
+ 
+ 	wdma = &dev->rx_wdma[idx];
+-	if (mtk_wed_ring_alloc(dev, wdma, MTK_WED_WDMA_RING_SIZE, desc_size,
+-			       true))
++	if (!reset && mtk_wed_ring_alloc(dev, wdma, MTK_WED_WDMA_RING_SIZE,
++					 desc_size, true))
+ 		return -ENOMEM;
+ 
+ 	wdma_w32(dev, MTK_WDMA_RING_RX(idx) + MTK_WED_RING_OFS_BASE,
+@@ -1396,7 +1397,7 @@ mtk_wed_start(struct mtk_wed_device *dev
+ 
+ 	for (i = 0; i < ARRAY_SIZE(dev->rx_wdma); i++)
+ 		if (!dev->rx_wdma[i].desc)
+-			mtk_wed_wdma_rx_ring_setup(dev, i, 16);
++			mtk_wed_wdma_rx_ring_setup(dev, i, 16, false);
+ 
+ 	mtk_wed_hw_init(dev);
+ 	mtk_wed_configure_irq(dev, irq_mask);
+@@ -1505,7 +1506,8 @@ unlock:
+ }
+ 
+ static int
+-mtk_wed_tx_ring_setup(struct mtk_wed_device *dev, int idx, void __iomem *regs)
++mtk_wed_tx_ring_setup(struct mtk_wed_device *dev, int idx, void __iomem *regs,
++		      bool reset)
+ {
+ 	struct mtk_wed_ring *ring = &dev->tx_ring[idx];
+ 
+@@ -1524,11 +1526,12 @@ mtk_wed_tx_ring_setup(struct mtk_wed_dev
+ 	if (WARN_ON(idx >= ARRAY_SIZE(dev->tx_ring)))
+ 		return -EINVAL;
+ 
+-	if (mtk_wed_ring_alloc(dev, ring, MTK_WED_TX_RING_SIZE,
+-			       sizeof(*ring->desc), true))
++	if (!reset && mtk_wed_ring_alloc(dev, ring, MTK_WED_TX_RING_SIZE,
++					 sizeof(*ring->desc), true))
+ 		return -ENOMEM;
+ 
+-	if (mtk_wed_wdma_rx_ring_setup(dev, idx, MTK_WED_WDMA_RING_SIZE))
++	if (mtk_wed_wdma_rx_ring_setup(dev, idx, MTK_WED_WDMA_RING_SIZE,
++				       reset))
+ 		return -ENOMEM;
+ 
+ 	ring->reg_base = MTK_WED_RING_TX(idx);
+--- a/include/linux/soc/mediatek/mtk_wed.h
++++ b/include/linux/soc/mediatek/mtk_wed.h
+@@ -158,7 +158,7 @@ struct mtk_wed_device {
+ struct mtk_wed_ops {
+ 	int (*attach)(struct mtk_wed_device *dev);
+ 	int (*tx_ring_setup)(struct mtk_wed_device *dev, int ring,
+-			     void __iomem *regs);
++			     void __iomem *regs, bool reset);
+ 	int (*rx_ring_setup)(struct mtk_wed_device *dev, int ring,
+ 			     void __iomem *regs);
+ 	int (*txfree_ring_setup)(struct mtk_wed_device *dev,
+@@ -216,8 +216,8 @@ mtk_wed_get_rx_capa(struct mtk_wed_devic
+ #define mtk_wed_device_active(_dev) !!(_dev)->ops
+ #define mtk_wed_device_detach(_dev) (_dev)->ops->detach(_dev)
+ #define mtk_wed_device_start(_dev, _mask) (_dev)->ops->start(_dev, _mask)
+-#define mtk_wed_device_tx_ring_setup(_dev, _ring, _regs) \
+-	(_dev)->ops->tx_ring_setup(_dev, _ring, _regs)
++#define mtk_wed_device_tx_ring_setup(_dev, _ring, _regs, _reset) \
++	(_dev)->ops->tx_ring_setup(_dev, _ring, _regs, _reset)
+ #define mtk_wed_device_txfree_ring_setup(_dev, _regs) \
+ 	(_dev)->ops->txfree_ring_setup(_dev, _regs)
+ #define mtk_wed_device_reg_read(_dev, _reg) \
+@@ -243,7 +243,7 @@ static inline bool mtk_wed_device_active
+ }
+ #define mtk_wed_device_detach(_dev) do {} while (0)
+ #define mtk_wed_device_start(_dev, _mask) do {} while (0)
+-#define mtk_wed_device_tx_ring_setup(_dev, _ring, _regs) -ENODEV
++#define mtk_wed_device_tx_ring_setup(_dev, _ring, _regs, _reset) -ENODEV
+ #define mtk_wed_device_txfree_ring_setup(_dev, _ring, _regs) -ENODEV
+ #define mtk_wed_device_reg_read(_dev, _reg) 0
+ #define mtk_wed_device_reg_write(_dev, _reg, _val) do {} while (0)
diff --git a/target/linux/generic/backport-5.15/729-15-v6.2-net-ethernet-mtk_wed-fix-sleep-while-atomic-in-mtk_w.patch b/target/linux/generic/backport-5.15/729-15-v6.2-net-ethernet-mtk_wed-fix-sleep-while-atomic-in-mtk_w.patch
new file mode 100644
index 0000000000..f9b11326b1
--- /dev/null
+++ b/target/linux/generic/backport-5.15/729-15-v6.2-net-ethernet-mtk_wed-fix-sleep-while-atomic-in-mtk_w.patch
@@ -0,0 +1,103 @@
+From: Lorenzo Bianconi <lorenzo at kernel.org>
+Date: Thu, 1 Dec 2022 16:26:53 +0100
+Subject: [PATCH] net: ethernet: mtk_wed: fix sleep while atomic in
+ mtk_wed_wo_queue_refill
+
+In order to fix the following sleep while atomic bug always alloc pages
+with GFP_ATOMIC in mtk_wed_wo_queue_refill since page_frag_alloc runs in
+spin_lock critical section.
+
+[    9.049719] Hardware name: MediaTek MT7986a RFB (DT)
+[    9.054665] Call trace:
+[    9.057096]  dump_backtrace+0x0/0x154
+[    9.060751]  show_stack+0x14/0x1c
+[    9.064052]  dump_stack_lvl+0x64/0x7c
+[    9.067702]  dump_stack+0x14/0x2c
+[    9.071001]  ___might_sleep+0xec/0x120
+[    9.074736]  __might_sleep+0x4c/0x9c
+[    9.078296]  __alloc_pages+0x184/0x2e4
+[    9.082030]  page_frag_alloc_align+0x98/0x1ac
+[    9.086369]  mtk_wed_wo_queue_refill+0x134/0x234
+[    9.090974]  mtk_wed_wo_init+0x174/0x2c0
+[    9.094881]  mtk_wed_attach+0x7c8/0x7e0
+[    9.098701]  mt7915_mmio_wed_init+0x1f0/0x3a0 [mt7915e]
+[    9.103940]  mt7915_pci_probe+0xec/0x3bc [mt7915e]
+[    9.108727]  pci_device_probe+0xac/0x13c
+[    9.112638]  really_probe.part.0+0x98/0x2f4
+[    9.116807]  __driver_probe_device+0x94/0x13c
+[    9.121147]  driver_probe_device+0x40/0x114
+[    9.125314]  __driver_attach+0x7c/0x180
+[    9.129133]  bus_for_each_dev+0x5c/0x90
+[    9.132953]  driver_attach+0x20/0x2c
+[    9.136513]  bus_add_driver+0x104/0x1fc
+[    9.140333]  driver_register+0x74/0x120
+[    9.144153]  __pci_register_driver+0x40/0x50
+[    9.148407]  mt7915_init+0x5c/0x1000 [mt7915e]
+[    9.152848]  do_one_initcall+0x40/0x25c
+[    9.156669]  do_init_module+0x44/0x230
+[    9.160403]  load_module+0x1f30/0x2750
+[    9.164135]  __do_sys_init_module+0x150/0x200
+[    9.168475]  __arm64_sys_init_module+0x18/0x20
+[    9.172901]  invoke_syscall.constprop.0+0x4c/0xe0
+[    9.177589]  do_el0_svc+0x48/0xe0
+[    9.180889]  el0_svc+0x14/0x50
+[    9.183929]  el0t_64_sync_handler+0x9c/0x120
+[    9.188183]  el0t_64_sync+0x158/0x15c
+
+Fixes: 799684448e3e ("net: ethernet: mtk_wed: introduce wed wo support")
+Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
+Reviewed-by: Pavan Chebbi <pavan.chebbi at broadcom.com>
+Link: https://lore.kernel.org/r/67ca94bdd3d9eaeb86e52b3050fbca0bcf7bb02f.1669908312.git.lorenzo at kernel.org
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
+---
+
+--- a/drivers/net/ethernet/mediatek/mtk_wed_wo.c
++++ b/drivers/net/ethernet/mediatek/mtk_wed_wo.c
+@@ -133,17 +133,18 @@ mtk_wed_wo_dequeue(struct mtk_wed_wo *wo
+ 
+ static int
+ mtk_wed_wo_queue_refill(struct mtk_wed_wo *wo, struct mtk_wed_wo_queue *q,
+-			gfp_t gfp, bool rx)
++			bool rx)
+ {
+ 	enum dma_data_direction dir = rx ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
+ 	int n_buf = 0;
+ 
+ 	spin_lock_bh(&q->lock);
+ 	while (q->queued < q->n_desc) {
+-		void *buf = page_frag_alloc(&q->cache, q->buf_size, gfp);
+ 		struct mtk_wed_wo_queue_entry *entry;
+ 		dma_addr_t addr;
++		void *buf;
+ 
++		buf = page_frag_alloc(&q->cache, q->buf_size, GFP_ATOMIC);
+ 		if (!buf)
+ 			break;
+ 
+@@ -215,7 +216,7 @@ mtk_wed_wo_rx_run_queue(struct mtk_wed_w
+ 			mtk_wed_mcu_rx_unsolicited_event(wo, skb);
+ 	}
+ 
+-	if (mtk_wed_wo_queue_refill(wo, q, GFP_ATOMIC, true)) {
++	if (mtk_wed_wo_queue_refill(wo, q, true)) {
+ 		u32 index = (q->head - 1) % q->n_desc;
+ 
+ 		mtk_wed_wo_queue_kick(wo, q, index);
+@@ -432,7 +433,7 @@ mtk_wed_wo_hardware_init(struct mtk_wed_
+ 	if (ret)
+ 		goto error;
+ 
+-	mtk_wed_wo_queue_refill(wo, &wo->q_tx, GFP_KERNEL, false);
++	mtk_wed_wo_queue_refill(wo, &wo->q_tx, false);
+ 	mtk_wed_wo_queue_reset(wo, &wo->q_tx);
+ 
+ 	regs.desc_base = MTK_WED_WO_CCIF_DUMMY5;
+@@ -446,7 +447,7 @@ mtk_wed_wo_hardware_init(struct mtk_wed_
+ 	if (ret)
+ 		goto error;
+ 
+-	mtk_wed_wo_queue_refill(wo, &wo->q_rx, GFP_KERNEL, true);
++	mtk_wed_wo_queue_refill(wo, &wo->q_rx, true);
+ 	mtk_wed_wo_queue_reset(wo, &wo->q_rx);
+ 
+ 	/* rx queue irqmask */
diff --git a/target/linux/generic/backport-5.15/729-16-v6.3-net-ethernet-mtk_wed-get-rid-of-queue-lock-for-rx-qu.patch b/target/linux/generic/backport-5.15/729-16-v6.3-net-ethernet-mtk_wed-get-rid-of-queue-lock-for-rx-qu.patch
new file mode 100644
index 0000000000..fa6f56dbe7
--- /dev/null
+++ b/target/linux/generic/backport-5.15/729-16-v6.3-net-ethernet-mtk_wed-get-rid-of-queue-lock-for-rx-qu.patch
@@ -0,0 +1,52 @@
+From: Lorenzo Bianconi <lorenzo at kernel.org>
+Date: Tue, 10 Jan 2023 10:31:26 +0100
+Subject: [PATCH] net: ethernet: mtk_wed: get rid of queue lock for rx queue
+
+Queue spinlock is currently held in mtk_wed_wo_queue_rx_clean and
+mtk_wed_wo_queue_refill routines for MTK Wireless Ethernet Dispatcher
+MCU rx queue. mtk_wed_wo_queue_refill() is running during initialization
+and in rx tasklet while mtk_wed_wo_queue_rx_clean() is running in
+mtk_wed_wo_hw_deinit() during hw de-init phase after rx tasklet has been
+disabled. Since mtk_wed_wo_queue_rx_clean and mtk_wed_wo_queue_refill
+routines can't run concurrently get rid of spinlock for mcu rx queue.
+
+Reviewed-by: Alexander Duyck <alexanderduyck at fb.com>
+Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
+Link: https://lore.kernel.org/r/36ec3b729542ea60898471d890796f745479ba32.1673342990.git.lorenzo at kernel.org
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
+---
+
+--- a/drivers/net/ethernet/mediatek/mtk_wed_wo.c
++++ b/drivers/net/ethernet/mediatek/mtk_wed_wo.c
+@@ -138,7 +138,6 @@ mtk_wed_wo_queue_refill(struct mtk_wed_w
+ 	enum dma_data_direction dir = rx ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
+ 	int n_buf = 0;
+ 
+-	spin_lock_bh(&q->lock);
+ 	while (q->queued < q->n_desc) {
+ 		struct mtk_wed_wo_queue_entry *entry;
+ 		dma_addr_t addr;
+@@ -172,7 +171,6 @@ mtk_wed_wo_queue_refill(struct mtk_wed_w
+ 		q->queued++;
+ 		n_buf++;
+ 	}
+-	spin_unlock_bh(&q->lock);
+ 
+ 	return n_buf;
+ }
+@@ -316,7 +314,6 @@ mtk_wed_wo_queue_rx_clean(struct mtk_wed
+ {
+ 	struct page *page;
+ 
+-	spin_lock_bh(&q->lock);
+ 	for (;;) {
+ 		void *buf = mtk_wed_wo_dequeue(wo, q, NULL, true);
+ 
+@@ -325,7 +322,6 @@ mtk_wed_wo_queue_rx_clean(struct mtk_wed
+ 
+ 		skb_free_frag(buf);
+ 	}
+-	spin_unlock_bh(&q->lock);
+ 
+ 	if (!q->cache.va)
+ 		return;
diff --git a/target/linux/generic/backport-5.15/729-17-v6.3-net-ethernet-mtk_wed-get-rid-of-queue-lock-for-tx-qu.patch b/target/linux/generic/backport-5.15/729-17-v6.3-net-ethernet-mtk_wed-get-rid-of-queue-lock-for-tx-qu.patch
new file mode 100644
index 0000000000..9b1e4c3250
--- /dev/null
+++ b/target/linux/generic/backport-5.15/729-17-v6.3-net-ethernet-mtk_wed-get-rid-of-queue-lock-for-tx-qu.patch
@@ -0,0 +1,75 @@
+From: Lorenzo Bianconi <lorenzo at kernel.org>
+Date: Thu, 12 Jan 2023 10:21:29 +0100
+Subject: [PATCH] net: ethernet: mtk_wed: get rid of queue lock for tx queue
+
+Similar to MTK Wireless Ethernet Dispatcher (WED) MCU rx queue,
+we do not need to protect WED MCU tx queue with a spin lock since
+the tx queue is accessed in the two following routines:
+- mtk_wed_wo_queue_tx_skb():
+  it is run at initialization and during mt7915 normal operation.
+  Moreover MCU messages are serialized through MCU mutex.
+- mtk_wed_wo_queue_tx_clean():
+  it runs just at mt7915 driver module unload when no more messages
+  are sent to the MCU.
+
+Remove tx queue spinlock.
+
+Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
+Link: https://lore.kernel.org/r/7bd0337b2a13ab1a63673b7c03fd35206b3b284e.1673515140.git.lorenzo at kernel.org
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
+---
+
+--- a/drivers/net/ethernet/mediatek/mtk_wed_wo.c
++++ b/drivers/net/ethernet/mediatek/mtk_wed_wo.c
+@@ -258,7 +258,6 @@ mtk_wed_wo_queue_alloc(struct mtk_wed_wo
+ 		       int n_desc, int buf_size, int index,
+ 		       struct mtk_wed_wo_queue_regs *regs)
+ {
+-	spin_lock_init(&q->lock);
+ 	q->regs = *regs;
+ 	q->n_desc = n_desc;
+ 	q->buf_size = buf_size;
+@@ -290,7 +289,6 @@ mtk_wed_wo_queue_tx_clean(struct mtk_wed
+ 	struct page *page;
+ 	int i;
+ 
+-	spin_lock_bh(&q->lock);
+ 	for (i = 0; i < q->n_desc; i++) {
+ 		struct mtk_wed_wo_queue_entry *entry = &q->entry[i];
+ 
+@@ -299,7 +297,6 @@ mtk_wed_wo_queue_tx_clean(struct mtk_wed
+ 		skb_free_frag(entry->buf);
+ 		entry->buf = NULL;
+ 	}
+-	spin_unlock_bh(&q->lock);
+ 
+ 	if (!q->cache.va)
+ 		return;
+@@ -347,8 +344,6 @@ int mtk_wed_wo_queue_tx_skb(struct mtk_w
+ 	int ret = 0, index;
+ 	u32 ctrl;
+ 
+-	spin_lock_bh(&q->lock);
+-
+ 	q->tail = mtk_wed_mmio_r32(wo, q->regs.dma_idx);
+ 	index = (q->head + 1) % q->n_desc;
+ 	if (q->tail == index) {
+@@ -379,8 +374,6 @@ int mtk_wed_wo_queue_tx_skb(struct mtk_w
+ 	mtk_wed_wo_queue_kick(wo, q, q->head);
+ 	mtk_wed_wo_kickout(wo);
+ out:
+-	spin_unlock_bh(&q->lock);
+-
+ 	dev_kfree_skb(skb);
+ 
+ 	return ret;
+--- a/drivers/net/ethernet/mediatek/mtk_wed_wo.h
++++ b/drivers/net/ethernet/mediatek/mtk_wed_wo.h
+@@ -211,7 +211,6 @@ struct mtk_wed_wo_queue {
+ 	struct mtk_wed_wo_queue_regs regs;
+ 
+ 	struct page_frag_cache cache;
+-	spinlock_t lock;
+ 
+ 	struct mtk_wed_wo_queue_desc *desc;
+ 	dma_addr_t desc_dma;
diff --git a/target/linux/generic/backport-5.15/729-18-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_reset-util.patch b/target/linux/generic/backport-5.15/729-18-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_reset-util.patch
new file mode 100644
index 0000000000..f5e9dddd42
--- /dev/null
+++ b/target/linux/generic/backport-5.15/729-18-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_reset-util.patch
@@ -0,0 +1,70 @@
+From: Lorenzo Bianconi <lorenzo at kernel.org>
+Date: Sat, 14 Jan 2023 18:01:28 +0100
+Subject: [PATCH] net: ethernet: mtk_eth_soc: introduce mtk_hw_reset utility
+ routine
+
+This is a preliminary patch to add Wireless Ethernet Dispatcher reset
+support.
+
+Reviewed-by: Leon Romanovsky <leonro at nvidia.com>
+Tested-by: Daniel Golle <daniel at makrotopia.org>
+Co-developed-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
+Signed-off-by: Paolo Abeni <pabeni at redhat.com>
+---
+
+--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+@@ -3199,6 +3199,27 @@ static void mtk_set_mcr_max_rx(struct mt
+ 		mtk_w32(mac->hw, mcr_new, MTK_MAC_MCR(mac->id));
+ }
+ 
++static void mtk_hw_reset(struct mtk_eth *eth)
++{
++	u32 val;
++
++	if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
++		regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN, 0);
++		val = RSTCTRL_PPE0_V2;
++	} else {
++		val = RSTCTRL_PPE0;
++	}
++
++	if (MTK_HAS_CAPS(eth->soc->caps, MTK_RSTCTRL_PPE1))
++		val |= RSTCTRL_PPE1;
++
++	ethsys_reset(eth, RSTCTRL_ETH | RSTCTRL_FE | val);
++
++	if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2))
++		regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN,
++			     0x3ffffff);
++}
++
+ static int mtk_hw_init(struct mtk_eth *eth)
+ {
+ 	u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
+@@ -3238,22 +3259,9 @@ static int mtk_hw_init(struct mtk_eth *e
+ 		return 0;
+ 	}
+ 
+-	if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
+-		regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN, 0);
+-		val = RSTCTRL_PPE0_V2;
+-	} else {
+-		val = RSTCTRL_PPE0;
+-	}
+-
+-	if (MTK_HAS_CAPS(eth->soc->caps, MTK_RSTCTRL_PPE1))
+-		val |= RSTCTRL_PPE1;
+-
+-	ethsys_reset(eth, RSTCTRL_ETH | RSTCTRL_FE | val);
++	mtk_hw_reset(eth);
+ 
+ 	if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
+-		regmap_write(eth->ethsys, ETHSYS_FE_RST_CHK_IDLE_EN,
+-			     0x3ffffff);
+-
+ 		/* Set FE to PDMAv2 if necessary */
+ 		val = mtk_r32(eth, MTK_FE_GLO_MISC);
+ 		mtk_w32(eth,  val | BIT(4), MTK_FE_GLO_MISC);
diff --git a/target/linux/generic/backport-5.15/729-19-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_warm_reset.patch b/target/linux/generic/backport-5.15/729-19-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_warm_reset.patch
new file mode 100644
index 0000000000..f2c9a7e53d
--- /dev/null
+++ b/target/linux/generic/backport-5.15/729-19-v6.3-net-ethernet-mtk_eth_soc-introduce-mtk_hw_warm_reset.patch
@@ -0,0 +1,107 @@
+From: Lorenzo Bianconi <lorenzo at kernel.org>
+Date: Sat, 14 Jan 2023 18:01:29 +0100
+Subject: [PATCH] net: ethernet: mtk_eth_soc: introduce mtk_hw_warm_reset
+ support
+
+Introduce mtk_hw_warm_reset utility routine. This is a preliminary patch
+to align reset procedure to vendor sdk and avoid to power down the chip
+during hw reset.
+
+Reviewed-by: Leon Romanovsky <leonro at nvidia.com>
+Tested-by: Daniel Golle <daniel at makrotopia.org>
+Co-developed-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
+Signed-off-by: Paolo Abeni <pabeni at redhat.com>
+---
+
+--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+@@ -3220,7 +3220,54 @@ static void mtk_hw_reset(struct mtk_eth
+ 			     0x3ffffff);
+ }
+ 
+-static int mtk_hw_init(struct mtk_eth *eth)
++static u32 mtk_hw_reset_read(struct mtk_eth *eth)
++{
++	u32 val;
++
++	regmap_read(eth->ethsys, ETHSYS_RSTCTRL, &val);
++	return val;
++}
++
++static void mtk_hw_warm_reset(struct mtk_eth *eth)
++{
++	u32 rst_mask, val;
++
++	regmap_update_bits(eth->ethsys, ETHSYS_RSTCTRL, RSTCTRL_FE,
++			   RSTCTRL_FE);
++	if (readx_poll_timeout_atomic(mtk_hw_reset_read, eth, val,
++				      val & RSTCTRL_FE, 1, 1000)) {
++		dev_err(eth->dev, "warm reset failed\n");
++		mtk_hw_reset(eth);
++		return;
++	}
++
++	if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2))
++		rst_mask = RSTCTRL_ETH | RSTCTRL_PPE0_V2;
++	else
++		rst_mask = RSTCTRL_ETH | RSTCTRL_PPE0;
++
++	if (MTK_HAS_CAPS(eth->soc->caps, MTK_RSTCTRL_PPE1))
++		rst_mask |= RSTCTRL_PPE1;
++
++	regmap_update_bits(eth->ethsys, ETHSYS_RSTCTRL, rst_mask, rst_mask);
++
++	udelay(1);
++	val = mtk_hw_reset_read(eth);
++	if (!(val & rst_mask))
++		dev_err(eth->dev, "warm reset stage0 failed %08x (%08x)\n",
++			val, rst_mask);
++
++	rst_mask |= RSTCTRL_FE;
++	regmap_update_bits(eth->ethsys, ETHSYS_RSTCTRL, rst_mask, ~rst_mask);
++
++	udelay(1);
++	val = mtk_hw_reset_read(eth);
++	if (val & rst_mask)
++		dev_err(eth->dev, "warm reset stage1 failed %08x (%08x)\n",
++			val, rst_mask);
++}
++
++static int mtk_hw_init(struct mtk_eth *eth, bool reset)
+ {
+ 	u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
+ 		       ETHSYS_DMA_AG_MAP_PPE;
+@@ -3259,7 +3306,12 @@ static int mtk_hw_init(struct mtk_eth *e
+ 		return 0;
+ 	}
+ 
+-	mtk_hw_reset(eth);
++	msleep(100);
++
++	if (reset)
++		mtk_hw_warm_reset(eth);
++	else
++		mtk_hw_reset(eth);
+ 
+ 	if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
+ 		/* Set FE to PDMAv2 if necessary */
+@@ -3464,7 +3516,7 @@ static void mtk_pending_work(struct work
+ 	if (eth->dev->pins)
+ 		pinctrl_select_state(eth->dev->pins->p,
+ 				     eth->dev->pins->default_state);
+-	mtk_hw_init(eth);
++	mtk_hw_init(eth, true);
+ 
+ 	/* restart DMA and enable IRQs */
+ 	for (i = 0; i < MTK_MAC_COUNT; i++) {
+@@ -4056,7 +4108,7 @@ static int mtk_probe(struct platform_dev
+ 	eth->msg_enable = netif_msg_init(mtk_msg_level, MTK_DEFAULT_MSG_ENABLE);
+ 	INIT_WORK(&eth->pending_work, mtk_pending_work);
+ 
+-	err = mtk_hw_init(eth);
++	err = mtk_hw_init(eth, false);
+ 	if (err)
+ 		goto err_wed_exit;
+ 
diff --git a/target/linux/generic/backport-5.15/729-20-v6.3-net-ethernet-mtk_eth_soc-align-reset-procedure-to-ve.patch b/target/linux/generic/backport-5.15/729-20-v6.3-net-ethernet-mtk_eth_soc-align-reset-procedure-to-ve.patch
new file mode 100644
index 0000000000..02e34bb7cd
--- /dev/null
+++ b/target/linux/generic/backport-5.15/729-20-v6.3-net-ethernet-mtk_eth_soc-align-reset-procedure-to-ve.patch
@@ -0,0 +1,262 @@
+From: Lorenzo Bianconi <lorenzo at kernel.org>
+Date: Sat, 14 Jan 2023 18:01:30 +0100
+Subject: [PATCH] net: ethernet: mtk_eth_soc: align reset procedure to vendor
+ sdk
+
+Avoid to power-down the ethernet chip during hw reset and align reset
+procedure to vendor sdk.
+
+Reviewed-by: Leon Romanovsky <leonro at nvidia.com>
+Tested-by: Daniel Golle <daniel at makrotopia.org>
+Co-developed-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
+Signed-off-by: Paolo Abeni <pabeni at redhat.com>
+---
+
+--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+@@ -2785,14 +2785,29 @@ static void mtk_dma_free(struct mtk_eth
+ 	kfree(eth->scratch_head);
+ }
+ 
++static bool mtk_hw_reset_check(struct mtk_eth *eth)
++{
++	u32 val = mtk_r32(eth, MTK_INT_STATUS2);
++
++	return (val & MTK_FE_INT_FQ_EMPTY) || (val & MTK_FE_INT_RFIFO_UF) ||
++	       (val & MTK_FE_INT_RFIFO_OV) || (val & MTK_FE_INT_TSO_FAIL) ||
++	       (val & MTK_FE_INT_TSO_ALIGN) || (val & MTK_FE_INT_TSO_ILLEGAL);
++}
++
+ static void mtk_tx_timeout(struct net_device *dev, unsigned int txqueue)
+ {
+ 	struct mtk_mac *mac = netdev_priv(dev);
+ 	struct mtk_eth *eth = mac->hw;
+ 
++	if (test_bit(MTK_RESETTING, &eth->state))
++		return;
++
++	if (!mtk_hw_reset_check(eth))
++		return;
++
+ 	eth->netdev[mac->id]->stats.tx_errors++;
+-	netif_err(eth, tx_err, dev,
+-		  "transmit timed out\n");
++	netif_err(eth, tx_err, dev, "transmit timed out\n");
++
+ 	schedule_work(&eth->pending_work);
+ }
+ 
+@@ -3274,15 +3289,17 @@ static int mtk_hw_init(struct mtk_eth *e
+ 	const struct mtk_reg_map *reg_map = eth->soc->reg_map;
+ 	int i, val, ret;
+ 
+-	if (test_and_set_bit(MTK_HW_INIT, &eth->state))
++	if (!reset && test_and_set_bit(MTK_HW_INIT, &eth->state))
+ 		return 0;
+ 
+-	pm_runtime_enable(eth->dev);
+-	pm_runtime_get_sync(eth->dev);
++	if (!reset) {
++		pm_runtime_enable(eth->dev);
++		pm_runtime_get_sync(eth->dev);
+ 
+-	ret = mtk_clk_enable(eth);
+-	if (ret)
+-		goto err_disable_pm;
++		ret = mtk_clk_enable(eth);
++		if (ret)
++			goto err_disable_pm;
++	}
+ 
+ 	if (eth->ethsys)
+ 		regmap_update_bits(eth->ethsys, ETHSYS_DMA_AG_MAP, dma_mask,
+@@ -3408,8 +3425,10 @@ static int mtk_hw_init(struct mtk_eth *e
+ 	return 0;
+ 
+ err_disable_pm:
+-	pm_runtime_put_sync(eth->dev);
+-	pm_runtime_disable(eth->dev);
++	if (!reset) {
++		pm_runtime_put_sync(eth->dev);
++		pm_runtime_disable(eth->dev);
++	}
+ 
+ 	return ret;
+ }
+@@ -3488,30 +3507,53 @@ static int mtk_do_ioctl(struct net_devic
+ 	return -EOPNOTSUPP;
+ }
+ 
++static void mtk_prepare_for_reset(struct mtk_eth *eth)
++{
++	u32 val;
++	int i;
++
++	/* disabe FE P3 and P4 */
++	val = mtk_r32(eth, MTK_FE_GLO_CFG) | MTK_FE_LINK_DOWN_P3;
++	if (MTK_HAS_CAPS(eth->soc->caps, MTK_RSTCTRL_PPE1))
++		val |= MTK_FE_LINK_DOWN_P4;
++	mtk_w32(eth, val, MTK_FE_GLO_CFG);
++
++	/* adjust PPE configurations to prepare for reset */
++	for (i = 0; i < ARRAY_SIZE(eth->ppe); i++)
++		mtk_ppe_prepare_reset(eth->ppe[i]);
++
++	/* disable NETSYS interrupts */
++	mtk_w32(eth, 0, MTK_FE_INT_ENABLE);
++
++	/* force link down GMAC */
++	for (i = 0; i < 2; i++) {
++		val = mtk_r32(eth, MTK_MAC_MCR(i)) & ~MAC_MCR_FORCE_LINK;
++		mtk_w32(eth, val, MTK_MAC_MCR(i));
++	}
++}
++
+ static void mtk_pending_work(struct work_struct *work)
+ {
+ 	struct mtk_eth *eth = container_of(work, struct mtk_eth, pending_work);
+-	int err, i;
+ 	unsigned long restart = 0;
++	u32 val;
++	int i;
+ 
+ 	rtnl_lock();
+-
+-	dev_dbg(eth->dev, "[%s][%d] reset\n", __func__, __LINE__);
+ 	set_bit(MTK_RESETTING, &eth->state);
+ 
++	mtk_prepare_for_reset(eth);
++
+ 	/* stop all devices to make sure that dma is properly shut down */
+ 	for (i = 0; i < MTK_MAC_COUNT; i++) {
+-		if (!eth->netdev[i])
++		if (!eth->netdev[i] || !netif_running(eth->netdev[i]))
+ 			continue;
++
+ 		mtk_stop(eth->netdev[i]);
+ 		__set_bit(i, &restart);
+ 	}
+-	dev_dbg(eth->dev, "[%s][%d] mtk_stop ends\n", __func__, __LINE__);
+ 
+-	/* restart underlying hardware such as power, clock, pin mux
+-	 * and the connected phy
+-	 */
+-	mtk_hw_deinit(eth);
++	usleep_range(15000, 16000);
+ 
+ 	if (eth->dev->pins)
+ 		pinctrl_select_state(eth->dev->pins->p,
+@@ -3522,15 +3564,19 @@ static void mtk_pending_work(struct work
+ 	for (i = 0; i < MTK_MAC_COUNT; i++) {
+ 		if (!test_bit(i, &restart))
+ 			continue;
+-		err = mtk_open(eth->netdev[i]);
+-		if (err) {
++
++		if (mtk_open(eth->netdev[i])) {
+ 			netif_alert(eth, ifup, eth->netdev[i],
+-			      "Driver up/down cycle failed, closing device.\n");
++				    "Driver up/down cycle failed\n");
+ 			dev_close(eth->netdev[i]);
+ 		}
+ 	}
+ 
+-	dev_dbg(eth->dev, "[%s][%d] reset done\n", __func__, __LINE__);
++	/* enabe FE P3 and P4 */
++	val = mtk_r32(eth, MTK_FE_GLO_CFG) & ~MTK_FE_LINK_DOWN_P3;
++	if (MTK_HAS_CAPS(eth->soc->caps, MTK_RSTCTRL_PPE1))
++		val &= ~MTK_FE_LINK_DOWN_P4;
++	mtk_w32(eth, val, MTK_FE_GLO_CFG);
+ 
+ 	clear_bit(MTK_RESETTING, &eth->state);
+ 
+--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+@@ -72,12 +72,24 @@
+ #define	MTK_HW_LRO_REPLACE_DELTA	1000
+ #define	MTK_HW_LRO_SDL_REMAIN_ROOM	1522
+ 
++/* Frame Engine Global Configuration */
++#define MTK_FE_GLO_CFG		0x00
++#define MTK_FE_LINK_DOWN_P3	BIT(11)
++#define MTK_FE_LINK_DOWN_P4	BIT(12)
++
+ /* Frame Engine Global Reset Register */
+ #define MTK_RST_GL		0x04
+ #define RST_GL_PSE		BIT(0)
+ 
+ /* Frame Engine Interrupt Status Register */
+ #define MTK_INT_STATUS2		0x08
++#define MTK_FE_INT_ENABLE	0x0c
++#define MTK_FE_INT_FQ_EMPTY	BIT(8)
++#define MTK_FE_INT_TSO_FAIL	BIT(12)
++#define MTK_FE_INT_TSO_ILLEGAL	BIT(13)
++#define MTK_FE_INT_TSO_ALIGN	BIT(14)
++#define MTK_FE_INT_RFIFO_OV	BIT(18)
++#define MTK_FE_INT_RFIFO_UF	BIT(19)
+ #define MTK_GDM1_AF		BIT(28)
+ #define MTK_GDM2_AF		BIT(29)
+ 
+--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
++++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
+@@ -716,6 +716,33 @@ int mtk_foe_entry_idle_time(struct mtk_p
+ 	return __mtk_foe_entry_idle_time(ppe, entry->data.ib1);
+ }
+ 
++int mtk_ppe_prepare_reset(struct mtk_ppe *ppe)
++{
++	if (!ppe)
++		return -EINVAL;
++
++	/* disable KA */
++	ppe_clear(ppe, MTK_PPE_TB_CFG, MTK_PPE_TB_CFG_KEEPALIVE);
++	ppe_clear(ppe, MTK_PPE_BIND_LMT1, MTK_PPE_NTU_KEEPALIVE);
++	ppe_w32(ppe, MTK_PPE_KEEPALIVE, 0);
++	usleep_range(10000, 11000);
++
++	/* set KA timer to maximum */
++	ppe_set(ppe, MTK_PPE_BIND_LMT1, MTK_PPE_NTU_KEEPALIVE);
++	ppe_w32(ppe, MTK_PPE_KEEPALIVE, 0xffffffff);
++
++	/* set KA tick select */
++	ppe_set(ppe, MTK_PPE_TB_CFG, MTK_PPE_TB_TICK_SEL);
++	ppe_set(ppe, MTK_PPE_TB_CFG, MTK_PPE_TB_CFG_KEEPALIVE);
++	usleep_range(10000, 11000);
++
++	/* disable scan mode */
++	ppe_clear(ppe, MTK_PPE_TB_CFG, MTK_PPE_TB_CFG_SCAN_MODE);
++	usleep_range(10000, 11000);
++
++	return mtk_ppe_wait_busy(ppe);
++}
++
+ struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base,
+ 			     int version, int index)
+ {
+--- a/drivers/net/ethernet/mediatek/mtk_ppe.h
++++ b/drivers/net/ethernet/mediatek/mtk_ppe.h
+@@ -306,6 +306,7 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_
+ 			     int version, int index);
+ void mtk_ppe_start(struct mtk_ppe *ppe);
+ int mtk_ppe_stop(struct mtk_ppe *ppe);
++int mtk_ppe_prepare_reset(struct mtk_ppe *ppe);
+ 
+ void __mtk_ppe_check_skb(struct mtk_ppe *ppe, struct sk_buff *skb, u16 hash);
+ 
+--- a/drivers/net/ethernet/mediatek/mtk_ppe_regs.h
++++ b/drivers/net/ethernet/mediatek/mtk_ppe_regs.h
+@@ -58,6 +58,12 @@
+ #define MTK_PPE_TB_CFG_SCAN_MODE		GENMASK(17, 16)
+ #define MTK_PPE_TB_CFG_HASH_DEBUG		GENMASK(19, 18)
+ #define MTK_PPE_TB_CFG_INFO_SEL			BIT(20)
++#define MTK_PPE_TB_TICK_SEL			BIT(24)
++
++#define MTK_PPE_BIND_LMT1			0x230
++#define MTK_PPE_NTU_KEEPALIVE			GENMASK(23, 16)
++
++#define MTK_PPE_KEEPALIVE			0x234
+ 
+ enum {
+ 	MTK_PPE_SCAN_MODE_DISABLED,
diff --git a/target/linux/generic/backport-5.15/729-21-v6.3-net-ethernet-mtk_eth_soc-add-dma-checks-to-mtk_hw_re.patch b/target/linux/generic/backport-5.15/729-21-v6.3-net-ethernet-mtk_eth_soc-add-dma-checks-to-mtk_hw_re.patch
new file mode 100644
index 0000000000..240e7897c6
--- /dev/null
+++ b/target/linux/generic/backport-5.15/729-21-v6.3-net-ethernet-mtk_eth_soc-add-dma-checks-to-mtk_hw_re.patch
@@ -0,0 +1,249 @@
+From: Lorenzo Bianconi <lorenzo at kernel.org>
+Date: Sat, 14 Jan 2023 18:01:31 +0100
+Subject: [PATCH] net: ethernet: mtk_eth_soc: add dma checks to
+ mtk_hw_reset_check
+
+Introduce mtk_hw_check_dma_hang routine to monitor possible dma hangs.
+
+Reviewed-by: Leon Romanovsky <leonro at nvidia.com>
+Tested-by: Daniel Golle <daniel at makrotopia.org>
+Co-developed-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
+Signed-off-by: Paolo Abeni <pabeni at redhat.com>
+---
+
+--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+@@ -50,6 +50,7 @@ static const struct mtk_reg_map mtk_reg_
+ 		.delay_irq	= 0x0a0c,
+ 		.irq_status	= 0x0a20,
+ 		.irq_mask	= 0x0a28,
++		.adma_rx_dbg0	= 0x0a38,
+ 		.int_grp	= 0x0a50,
+ 	},
+ 	.qdma = {
+@@ -79,6 +80,8 @@ static const struct mtk_reg_map mtk_reg_
+ 		[0]		= 0x2800,
+ 		[1]		= 0x2c00,
+ 	},
++	.pse_iq_sta		= 0x0110,
++	.pse_oq_sta		= 0x0118,
+ };
+ 
+ static const struct mtk_reg_map mt7628_reg_map = {
+@@ -109,6 +112,7 @@ static const struct mtk_reg_map mt7986_r
+ 		.delay_irq	= 0x620c,
+ 		.irq_status	= 0x6220,
+ 		.irq_mask	= 0x6228,
++		.adma_rx_dbg0	= 0x6238,
+ 		.int_grp	= 0x6250,
+ 	},
+ 	.qdma = {
+@@ -138,6 +142,8 @@ static const struct mtk_reg_map mt7986_r
+ 		[0]		= 0x4800,
+ 		[1]		= 0x4c00,
+ 	},
++	.pse_iq_sta		= 0x0180,
++	.pse_oq_sta		= 0x01a0,
+ };
+ 
+ /* strings used by ethtool */
+@@ -3282,6 +3288,102 @@ static void mtk_hw_warm_reset(struct mtk
+ 			val, rst_mask);
+ }
+ 
++static bool mtk_hw_check_dma_hang(struct mtk_eth *eth)
++{
++	const struct mtk_reg_map *reg_map = eth->soc->reg_map;
++	bool gmac1_tx, gmac2_tx, gdm1_tx, gdm2_tx;
++	bool oq_hang, cdm1_busy, adma_busy;
++	bool wtx_busy, cdm_full, oq_free;
++	u32 wdidx, val, gdm1_fc, gdm2_fc;
++	bool qfsm_hang, qfwd_hang;
++	bool ret = false;
++
++	if (MTK_HAS_CAPS(eth->soc->caps, MTK_SOC_MT7628))
++		return false;
++
++	/* WDMA sanity checks */
++	wdidx = mtk_r32(eth, reg_map->wdma_base[0] + 0xc);
++
++	val = mtk_r32(eth, reg_map->wdma_base[0] + 0x204);
++	wtx_busy = FIELD_GET(MTK_TX_DMA_BUSY, val);
++
++	val = mtk_r32(eth, reg_map->wdma_base[0] + 0x230);
++	cdm_full = !FIELD_GET(MTK_CDM_TXFIFO_RDY, val);
++
++	oq_free  = (!(mtk_r32(eth, reg_map->pse_oq_sta) & GENMASK(24, 16)) &&
++		    !(mtk_r32(eth, reg_map->pse_oq_sta + 0x4) & GENMASK(8, 0)) &&
++		    !(mtk_r32(eth, reg_map->pse_oq_sta + 0x10) & GENMASK(24, 16)));
++
++	if (wdidx == eth->reset.wdidx && wtx_busy && cdm_full && oq_free) {
++		if (++eth->reset.wdma_hang_count > 2) {
++			eth->reset.wdma_hang_count = 0;
++			ret = true;
++		}
++		goto out;
++	}
++
++	/* QDMA sanity checks */
++	qfsm_hang = !!mtk_r32(eth, reg_map->qdma.qtx_cfg + 0x234);
++	qfwd_hang = !mtk_r32(eth, reg_map->qdma.qtx_cfg + 0x308);
++
++	gdm1_tx = FIELD_GET(GENMASK(31, 16), mtk_r32(eth, MTK_FE_GDM1_FSM)) > 0;
++	gdm2_tx = FIELD_GET(GENMASK(31, 16), mtk_r32(eth, MTK_FE_GDM2_FSM)) > 0;
++	gmac1_tx = FIELD_GET(GENMASK(31, 24), mtk_r32(eth, MTK_MAC_FSM(0))) != 1;
++	gmac2_tx = FIELD_GET(GENMASK(31, 24), mtk_r32(eth, MTK_MAC_FSM(1))) != 1;
++	gdm1_fc = mtk_r32(eth, reg_map->gdm1_cnt + 0x24);
++	gdm2_fc = mtk_r32(eth, reg_map->gdm1_cnt + 0x64);
++
++	if (qfsm_hang && qfwd_hang &&
++	    ((gdm1_tx && gmac1_tx && gdm1_fc < 1) ||
++	     (gdm2_tx && gmac2_tx && gdm2_fc < 1))) {
++		if (++eth->reset.qdma_hang_count > 2) {
++			eth->reset.qdma_hang_count = 0;
++			ret = true;
++		}
++		goto out;
++	}
++
++	/* ADMA sanity checks */
++	oq_hang = !!(mtk_r32(eth, reg_map->pse_oq_sta) & GENMASK(8, 0));
++	cdm1_busy = !!(mtk_r32(eth, MTK_FE_CDM1_FSM) & GENMASK(31, 16));
++	adma_busy = !(mtk_r32(eth, reg_map->pdma.adma_rx_dbg0) & GENMASK(4, 0)) &&
++		    !(mtk_r32(eth, reg_map->pdma.adma_rx_dbg0) & BIT(6));
++
++	if (oq_hang && cdm1_busy && adma_busy) {
++		if (++eth->reset.adma_hang_count > 2) {
++			eth->reset.adma_hang_count = 0;
++			ret = true;
++		}
++		goto out;
++	}
++
++	eth->reset.wdma_hang_count = 0;
++	eth->reset.qdma_hang_count = 0;
++	eth->reset.adma_hang_count = 0;
++out:
++	eth->reset.wdidx = wdidx;
++
++	return ret;
++}
++
++static void mtk_hw_reset_monitor_work(struct work_struct *work)
++{
++	struct delayed_work *del_work = to_delayed_work(work);
++	struct mtk_eth *eth = container_of(del_work, struct mtk_eth,
++					   reset.monitor_work);
++
++	if (test_bit(MTK_RESETTING, &eth->state))
++		goto out;
++
++	/* DMA stuck checks */
++	if (mtk_hw_check_dma_hang(eth))
++		schedule_work(&eth->pending_work);
++
++out:
++	schedule_delayed_work(&eth->reset.monitor_work,
++			      MTK_DMA_MONITOR_TIMEOUT);
++}
++
+ static int mtk_hw_init(struct mtk_eth *eth, bool reset)
+ {
+ 	u32 dma_mask = ETHSYS_DMA_AG_MAP_PDMA | ETHSYS_DMA_AG_MAP_QDMA |
+@@ -3614,6 +3716,7 @@ static int mtk_cleanup(struct mtk_eth *e
+ 	mtk_unreg_dev(eth);
+ 	mtk_free_dev(eth);
+ 	cancel_work_sync(&eth->pending_work);
++	cancel_delayed_work_sync(&eth->reset.monitor_work);
+ 
+ 	return 0;
+ }
+@@ -4041,6 +4144,7 @@ static int mtk_probe(struct platform_dev
+ 
+ 	eth->rx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
+ 	INIT_WORK(&eth->rx_dim.work, mtk_dim_rx);
++	INIT_DELAYED_WORK(&eth->reset.monitor_work, mtk_hw_reset_monitor_work);
+ 
+ 	eth->tx_dim.mode = DIM_CQ_PERIOD_MODE_START_FROM_EQE;
+ 	INIT_WORK(&eth->tx_dim.work, mtk_dim_tx);
+@@ -4245,6 +4349,8 @@ static int mtk_probe(struct platform_dev
+ 		       NAPI_POLL_WEIGHT);
+ 
+ 	platform_set_drvdata(pdev, eth);
++	schedule_delayed_work(&eth->reset.monitor_work,
++			      MTK_DMA_MONITOR_TIMEOUT);
+ 
+ 	return 0;
+ 
+--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+@@ -256,6 +256,8 @@
+ 
+ #define MTK_RX_DONE_INT_V2	BIT(14)
+ 
++#define MTK_CDM_TXFIFO_RDY	BIT(7)
++
+ /* QDMA Interrupt grouping registers */
+ #define MTK_RLS_DONE_INT	BIT(0)
+ 
+@@ -537,6 +539,17 @@
+ #define MT7628_SDM_RBCNT	(MT7628_SDM_OFFSET + 0x10c)
+ #define MT7628_SDM_CS_ERR	(MT7628_SDM_OFFSET + 0x110)
+ 
++#define MTK_FE_CDM1_FSM		0x220
++#define MTK_FE_CDM2_FSM		0x224
++#define MTK_FE_CDM3_FSM		0x238
++#define MTK_FE_CDM4_FSM		0x298
++#define MTK_FE_CDM5_FSM		0x318
++#define MTK_FE_CDM6_FSM		0x328
++#define MTK_FE_GDM1_FSM		0x228
++#define MTK_FE_GDM2_FSM		0x22C
++
++#define MTK_MAC_FSM(x)		(0x1010C + ((x) * 0x100))
++
+ struct mtk_rx_dma {
+ 	unsigned int rxd1;
+ 	unsigned int rxd2;
+@@ -933,6 +946,7 @@ struct mtk_reg_map {
+ 		u32	delay_irq;	/* delay interrupt */
+ 		u32	irq_status;	/* interrupt status */
+ 		u32	irq_mask;	/* interrupt mask */
++		u32	adma_rx_dbg0;
+ 		u32	int_grp;
+ 	} pdma;
+ 	struct {
+@@ -959,6 +973,8 @@ struct mtk_reg_map {
+ 	u32	gdma_to_ppe0;
+ 	u32	ppe_base;
+ 	u32	wdma_base[2];
++	u32	pse_iq_sta;
++	u32	pse_oq_sta;
+ };
+ 
+ /* struct mtk_eth_data -	This is the structure holding all differences
+@@ -1001,6 +1017,8 @@ struct mtk_soc_data {
+ 	} txrx;
+ };
+ 
++#define MTK_DMA_MONITOR_TIMEOUT		msecs_to_jiffies(1000)
++
+ /* currently no SoC has more than 2 macs */
+ #define MTK_MAX_DEVS			2
+ 
+@@ -1123,6 +1141,14 @@ struct mtk_eth {
+ 	struct rhashtable		flow_table;
+ 
+ 	struct bpf_prog			__rcu *prog;
++
++	struct {
++		struct delayed_work monitor_work;
++		u32 wdidx;
++		u8 wdma_hang_count;
++		u8 qdma_hang_count;
++		u8 adma_hang_count;
++	} reset;
+ };
+ 
+ /* struct mtk_mac -	the structure that holds the info about the MACs of the
diff --git a/target/linux/generic/backport-5.15/729-22-v6.3-net-ethernet-mtk_wed-add-reset-reset_complete-callba.patch b/target/linux/generic/backport-5.15/729-22-v6.3-net-ethernet-mtk_wed-add-reset-reset_complete-callba.patch
new file mode 100644
index 0000000000..9f67e97e6f
--- /dev/null
+++ b/target/linux/generic/backport-5.15/729-22-v6.3-net-ethernet-mtk_wed-add-reset-reset_complete-callba.patch
@@ -0,0 +1,124 @@
+From: Lorenzo Bianconi <lorenzo at kernel.org>
+Date: Sat, 14 Jan 2023 18:01:32 +0100
+Subject: [PATCH] net: ethernet: mtk_wed: add reset/reset_complete callbacks
+
+Introduce reset and reset_complete wlan callback to schedule WLAN driver
+reset when ethernet/wed driver is resetting.
+
+Tested-by: Daniel Golle <daniel at makrotopia.org>
+Co-developed-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
+Signed-off-by: Paolo Abeni <pabeni at redhat.com>
+---
+
+--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+@@ -3645,6 +3645,11 @@ static void mtk_pending_work(struct work
+ 	set_bit(MTK_RESETTING, &eth->state);
+ 
+ 	mtk_prepare_for_reset(eth);
++	mtk_wed_fe_reset();
++	/* Run again reset preliminary configuration in order to avoid any
++	 * possible race during FE reset since it can run releasing RTNL lock.
++	 */
++	mtk_prepare_for_reset(eth);
+ 
+ 	/* stop all devices to make sure that dma is properly shut down */
+ 	for (i = 0; i < MTK_MAC_COUNT; i++) {
+@@ -3682,6 +3687,8 @@ static void mtk_pending_work(struct work
+ 
+ 	clear_bit(MTK_RESETTING, &eth->state);
+ 
++	mtk_wed_fe_reset_complete();
++
+ 	rtnl_unlock();
+ }
+ 
+--- a/drivers/net/ethernet/mediatek/mtk_wed.c
++++ b/drivers/net/ethernet/mediatek/mtk_wed.c
+@@ -205,6 +205,48 @@ mtk_wed_wo_reset(struct mtk_wed_device *
+ 	iounmap(reg);
+ }
+ 
++void mtk_wed_fe_reset(void)
++{
++	int i;
++
++	mutex_lock(&hw_lock);
++
++	for (i = 0; i < ARRAY_SIZE(hw_list); i++) {
++		struct mtk_wed_hw *hw = hw_list[i];
++		struct mtk_wed_device *dev = hw->wed_dev;
++		int err;
++
++		if (!dev || !dev->wlan.reset)
++			continue;
++
++		/* reset callback blocks until WLAN reset is completed */
++		err = dev->wlan.reset(dev);
++		if (err)
++			dev_err(dev->dev, "wlan reset failed: %d\n", err);
++	}
++
++	mutex_unlock(&hw_lock);
++}
++
++void mtk_wed_fe_reset_complete(void)
++{
++	int i;
++
++	mutex_lock(&hw_lock);
++
++	for (i = 0; i < ARRAY_SIZE(hw_list); i++) {
++		struct mtk_wed_hw *hw = hw_list[i];
++		struct mtk_wed_device *dev = hw->wed_dev;
++
++		if (!dev || !dev->wlan.reset_complete)
++			continue;
++
++		dev->wlan.reset_complete(dev);
++	}
++
++	mutex_unlock(&hw_lock);
++}
++
+ static struct mtk_wed_hw *
+ mtk_wed_assign(struct mtk_wed_device *dev)
+ {
+--- a/drivers/net/ethernet/mediatek/mtk_wed.h
++++ b/drivers/net/ethernet/mediatek/mtk_wed.h
+@@ -128,6 +128,8 @@ void mtk_wed_add_hw(struct device_node *
+ void mtk_wed_exit(void);
+ int mtk_wed_flow_add(int index);
+ void mtk_wed_flow_remove(int index);
++void mtk_wed_fe_reset(void);
++void mtk_wed_fe_reset_complete(void);
+ #else
+ static inline void
+ mtk_wed_add_hw(struct device_node *np, struct mtk_eth *eth,
+@@ -147,6 +149,13 @@ static inline void mtk_wed_flow_remove(i
+ {
+ }
+ 
++static inline void mtk_wed_fe_reset(void)
++{
++}
++
++static inline void mtk_wed_fe_reset_complete(void)
++{
++}
+ #endif
+ 
+ #ifdef CONFIG_DEBUG_FS
+--- a/include/linux/soc/mediatek/mtk_wed.h
++++ b/include/linux/soc/mediatek/mtk_wed.h
+@@ -151,6 +151,8 @@ struct mtk_wed_device {
+ 		void (*release_rx_buf)(struct mtk_wed_device *wed);
+ 		void (*update_wo_rx_stats)(struct mtk_wed_device *wed,
+ 					   struct mtk_wed_wo_rx_stats *stats);
++		int (*reset)(struct mtk_wed_device *wed);
++		void (*reset_complete)(struct mtk_wed_device *wed);
+ 	} wlan;
+ #endif
+ };
diff --git a/target/linux/generic/backport-5.15/729-23-v6.3-net-ethernet-mtk_wed-add-reset-to-rx_ring_setup-call.patch b/target/linux/generic/backport-5.15/729-23-v6.3-net-ethernet-mtk_wed-add-reset-to-rx_ring_setup-call.patch
new file mode 100644
index 0000000000..cf81acf491
--- /dev/null
+++ b/target/linux/generic/backport-5.15/729-23-v6.3-net-ethernet-mtk_wed-add-reset-to-rx_ring_setup-call.patch
@@ -0,0 +1,106 @@
+From: Lorenzo Bianconi <lorenzo at kernel.org>
+Date: Mon, 5 Dec 2022 12:34:42 +0100
+Subject: [PATCH] net: ethernet: mtk_wed: add reset to rx_ring_setup callback
+
+This patch adds reset parameter to mtk_wed_rx_ring_setup signature
+in order to align rx_ring_setup callback to tx_ring_setup one introduced
+in 'commit 23dca7a90017 ("net: ethernet: mtk_wed: add reset to
+tx_ring_setup callback")'
+
+Co-developed-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Sujuan Chen <sujuan.chen at mediatek.com>
+Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>
+Reviewed-by: Leon Romanovsky <leonro at nvidia.com>
+Link: https://lore.kernel.org/r/29c6e7a5469e784406cf3e2920351d1207713d05.1670239984.git.lorenzo at kernel.org
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
+---
+
+--- a/drivers/net/ethernet/mediatek/mtk_wed.c
++++ b/drivers/net/ethernet/mediatek/mtk_wed.c
+@@ -1259,7 +1259,8 @@ mtk_wed_wdma_rx_ring_setup(struct mtk_we
+ }
+ 
+ static int
+-mtk_wed_wdma_tx_ring_setup(struct mtk_wed_device *dev, int idx, int size)
++mtk_wed_wdma_tx_ring_setup(struct mtk_wed_device *dev, int idx, int size,
++			   bool reset)
+ {
+ 	u32 desc_size = sizeof(struct mtk_wdma_desc) * dev->hw->version;
+ 	struct mtk_wed_ring *wdma;
+@@ -1268,8 +1269,8 @@ mtk_wed_wdma_tx_ring_setup(struct mtk_we
+ 		return -EINVAL;
+ 
+ 	wdma = &dev->tx_wdma[idx];
+-	if (mtk_wed_ring_alloc(dev, wdma, MTK_WED_WDMA_RING_SIZE, desc_size,
+-			       true))
++	if (!reset && mtk_wed_ring_alloc(dev, wdma, MTK_WED_WDMA_RING_SIZE,
++					 desc_size, true))
+ 		return -ENOMEM;
+ 
+ 	wdma_w32(dev, MTK_WDMA_RING_TX(idx) + MTK_WED_RING_OFS_BASE,
+@@ -1279,6 +1280,9 @@ mtk_wed_wdma_tx_ring_setup(struct mtk_we
+ 	wdma_w32(dev, MTK_WDMA_RING_TX(idx) + MTK_WED_RING_OFS_CPU_IDX, 0);
+ 	wdma_w32(dev, MTK_WDMA_RING_TX(idx) + MTK_WED_RING_OFS_DMA_IDX, 0);
+ 
++	if (reset)
++		mtk_wed_ring_reset(wdma, MTK_WED_WDMA_RING_SIZE, true);
++
+ 	if (!idx)  {
+ 		wed_w32(dev, MTK_WED_WDMA_RING_TX + MTK_WED_RING_OFS_BASE,
+ 			wdma->desc_phys);
+@@ -1618,18 +1622,20 @@ mtk_wed_txfree_ring_setup(struct mtk_wed
+ }
+ 
+ static int
+-mtk_wed_rx_ring_setup(struct mtk_wed_device *dev, int idx, void __iomem *regs)
++mtk_wed_rx_ring_setup(struct mtk_wed_device *dev, int idx, void __iomem *regs,
++		      bool reset)
+ {
+ 	struct mtk_wed_ring *ring = &dev->rx_ring[idx];
+ 
+ 	if (WARN_ON(idx >= ARRAY_SIZE(dev->rx_ring)))
+ 		return -EINVAL;
+ 
+-	if (mtk_wed_ring_alloc(dev, ring, MTK_WED_RX_RING_SIZE,
+-			       sizeof(*ring->desc), false))
++	if (!reset && mtk_wed_ring_alloc(dev, ring, MTK_WED_RX_RING_SIZE,
++					 sizeof(*ring->desc), false))
+ 		return -ENOMEM;
+ 
+-	if (mtk_wed_wdma_tx_ring_setup(dev, idx, MTK_WED_WDMA_RING_SIZE))
++	if (mtk_wed_wdma_tx_ring_setup(dev, idx, MTK_WED_WDMA_RING_SIZE,
++				       reset))
+ 		return -ENOMEM;
+ 
+ 	ring->reg_base = MTK_WED_RING_RX_DATA(idx);
+--- a/include/linux/soc/mediatek/mtk_wed.h
++++ b/include/linux/soc/mediatek/mtk_wed.h
+@@ -162,7 +162,7 @@ struct mtk_wed_ops {
+ 	int (*tx_ring_setup)(struct mtk_wed_device *dev, int ring,
+ 			     void __iomem *regs, bool reset);
+ 	int (*rx_ring_setup)(struct mtk_wed_device *dev, int ring,
+-			     void __iomem *regs);
++			     void __iomem *regs, bool reset);
+ 	int (*txfree_ring_setup)(struct mtk_wed_device *dev,
+ 				 void __iomem *regs);
+ 	int (*msg_update)(struct mtk_wed_device *dev, int cmd_id,
+@@ -230,8 +230,8 @@ mtk_wed_get_rx_capa(struct mtk_wed_devic
+ 	(_dev)->ops->irq_get(_dev, _mask)
+ #define mtk_wed_device_irq_set_mask(_dev, _mask) \
+ 	(_dev)->ops->irq_set_mask(_dev, _mask)
+-#define mtk_wed_device_rx_ring_setup(_dev, _ring, _regs) \
+-	(_dev)->ops->rx_ring_setup(_dev, _ring, _regs)
++#define mtk_wed_device_rx_ring_setup(_dev, _ring, _regs, _reset) \
++	(_dev)->ops->rx_ring_setup(_dev, _ring, _regs, _reset)
+ #define mtk_wed_device_ppe_check(_dev, _skb, _reason, _hash) \
+ 	(_dev)->ops->ppe_check(_dev, _skb, _reason, _hash)
+ #define mtk_wed_device_update_msg(_dev, _id, _msg, _len) \
+@@ -251,7 +251,7 @@ static inline bool mtk_wed_device_active
+ #define mtk_wed_device_reg_write(_dev, _reg, _val) do {} while (0)
+ #define mtk_wed_device_irq_get(_dev, _mask) 0
+ #define mtk_wed_device_irq_set_mask(_dev, _mask) do {} while (0)
+-#define mtk_wed_device_rx_ring_setup(_dev, _ring, _regs) -ENODEV
++#define mtk_wed_device_rx_ring_setup(_dev, _ring, _regs, _reset) -ENODEV
+ #define mtk_wed_device_ppe_check(_dev, _skb, _reason, _hash)  do {} while (0)
+ #define mtk_wed_device_update_msg(_dev, _id, _msg, _len) -ENODEV
+ #define mtk_wed_device_stop(_dev) do {} while (0)
diff --git a/target/linux/generic/hack-5.10/100-update-mtk_wed_h.patch b/target/linux/generic/hack-5.10/100-update-mtk_wed_h.patch
index fe49100e4f..151f2e8054 100644
--- a/target/linux/generic/hack-5.10/100-update-mtk_wed_h.patch
+++ b/target/linux/generic/hack-5.10/100-update-mtk_wed_h.patch
@@ -77,11 +77,14 @@
  struct mtk_wed_device {
  #ifdef CONFIG_NET_MEDIATEK_SOC_WED
  	const struct mtk_wed_ops *ops;
-@@ -28,30 +83,71 @@ struct mtk_wed_device {
+@@ -28,30 +83,76 @@ struct mtk_wed_device {
  	bool init_done, running;
  	int wdma_idx;
  	int irq;
 +	u8 version;
++
++	/* used by wlan driver */
++	u32 rev_id;
  
  	struct mtk_wed_ring tx_ring[MTK_WED_TX_QUEUES];
 +	struct mtk_wed_ring rx_ring[MTK_WED_RX_QUEUES];
@@ -148,15 +151,19 @@
 +		void (*release_rx_buf)(struct mtk_wed_device *wed);
 +		void (*update_wo_rx_stats)(struct mtk_wed_device *wed,
 +					   struct mtk_wed_wo_rx_stats *stats);
++		int (*reset)(struct mtk_wed_device *wed);
++		void (*reset_complete)(struct mtk_wed_device *wed);
  	} wlan;
  #endif
  };
-@@ -60,9 +156,15 @@ struct mtk_wed_ops {
+@@ -59,10 +160,16 @@ struct mtk_wed_device {
+ struct mtk_wed_ops {
  	int (*attach)(struct mtk_wed_device *dev);
  	int (*tx_ring_setup)(struct mtk_wed_device *dev, int ring,
- 			     void __iomem *regs);
+-			     void __iomem *regs);
++			     void __iomem *regs, bool reset);
 +	int (*rx_ring_setup)(struct mtk_wed_device *dev, int ring,
-+			     void __iomem *regs);
++			     void __iomem *regs, bool reset);
  	int (*txfree_ring_setup)(struct mtk_wed_device *dev,
  				 void __iomem *regs);
 +	int (*msg_update)(struct mtk_wed_device *dev, int cmd_id,
@@ -167,7 +174,7 @@
  
  	void (*stop)(struct mtk_wed_device *dev);
  	void (*start)(struct mtk_wed_device *dev, u32 irq_mask);
-@@ -97,6 +199,16 @@ mtk_wed_device_attach(struct mtk_wed_dev
+@@ -97,12 +204,22 @@ mtk_wed_device_attach(struct mtk_wed_dev
  	return ret;
  }
  
@@ -184,26 +191,45 @@
  #ifdef CONFIG_NET_MEDIATEK_SOC_WED
  #define mtk_wed_device_active(_dev) !!(_dev)->ops
  #define mtk_wed_device_detach(_dev) (_dev)->ops->detach(_dev)
-@@ -113,6 +225,12 @@ mtk_wed_device_attach(struct mtk_wed_dev
+ #define mtk_wed_device_start(_dev, _mask) (_dev)->ops->start(_dev, _mask)
+-#define mtk_wed_device_tx_ring_setup(_dev, _ring, _regs) \
+-	(_dev)->ops->tx_ring_setup(_dev, _ring, _regs)
++#define mtk_wed_device_tx_ring_setup(_dev, _ring, _regs, _reset) \
++	(_dev)->ops->tx_ring_setup(_dev, _ring, _regs, _reset)
+ #define mtk_wed_device_txfree_ring_setup(_dev, _regs) \
+ 	(_dev)->ops->txfree_ring_setup(_dev, _regs)
+ #define mtk_wed_device_reg_read(_dev, _reg) \
+@@ -113,6 +230,14 @@ mtk_wed_device_attach(struct mtk_wed_dev
  	(_dev)->ops->irq_get(_dev, _mask)
  #define mtk_wed_device_irq_set_mask(_dev, _mask) \
  	(_dev)->ops->irq_set_mask(_dev, _mask)
-+#define mtk_wed_device_rx_ring_setup(_dev, _ring, _regs) \
-+	(_dev)->ops->rx_ring_setup(_dev, _ring, _regs)
++#define mtk_wed_device_rx_ring_setup(_dev, _ring, _regs, _reset) \
++	(_dev)->ops->rx_ring_setup(_dev, _ring, _regs, _reset)
 +#define mtk_wed_device_ppe_check(_dev, _skb, _reason, _hash) \
 +	(_dev)->ops->ppe_check(_dev, _skb, _reason, _hash)
 +#define mtk_wed_device_update_msg(_dev, _id, _msg, _len) \
 +	(_dev)->ops->msg_update(_dev, _id, _msg, _len)
++#define mtk_wed_device_stop(_dev) (_dev)->ops->stop(_dev)
++#define mtk_wed_device_dma_reset(_dev) (_dev)->ops->reset_dma(_dev)
  #else
  static inline bool mtk_wed_device_active(struct mtk_wed_device *dev)
  {
-@@ -126,6 +244,9 @@ static inline bool mtk_wed_device_active
+@@ -120,12 +245,17 @@ static inline bool mtk_wed_device_active
+ }
+ #define mtk_wed_device_detach(_dev) do {} while (0)
+ #define mtk_wed_device_start(_dev, _mask) do {} while (0)
+-#define mtk_wed_device_tx_ring_setup(_dev, _ring, _regs) -ENODEV
++#define mtk_wed_device_tx_ring_setup(_dev, _ring, _regs, _reset) -ENODEV
+ #define mtk_wed_device_txfree_ring_setup(_dev, _ring, _regs) -ENODEV
+ #define mtk_wed_device_reg_read(_dev, _reg) 0
  #define mtk_wed_device_reg_write(_dev, _reg, _val) do {} while (0)
  #define mtk_wed_device_irq_get(_dev, _mask) 0
  #define mtk_wed_device_irq_set_mask(_dev, _mask) do {} while (0)
-+#define mtk_wed_device_rx_ring_setup(_dev, _ring, _regs) -ENODEV
++#define mtk_wed_device_rx_ring_setup(_dev, _ring, _regs, _reset) -ENODEV
 +#define mtk_wed_device_ppe_check(_dev, _skb, _reason, _hash)  do {} while (0)
 +#define mtk_wed_device_update_msg(_dev, _id, _msg, _len) -ENODEV
++#define mtk_wed_device_stop(_dev) do {} while (0)
++#define mtk_wed_device_dma_reset(_dev) do {} while (0)
  #endif
  
  #endif
diff --git a/target/linux/generic/pending-5.15/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch b/target/linux/generic/pending-5.15/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch
index 3be68a9e35..b046c3eb5f 100644
--- a/target/linux/generic/pending-5.15/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.patch
+++ b/target/linux/generic/pending-5.15/702-net-ethernet-mtk_eth_soc-enable-threaded-NAPI.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
-@@ -2802,8 +2802,8 @@ static irqreturn_t mtk_handle_irq_rx(int
+@@ -2823,8 +2823,8 @@ static irqreturn_t mtk_handle_irq_rx(int
  
  	eth->rx_events++;
  	if (likely(napi_schedule_prep(&eth->rx_napi))) {
@@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	}
  
  	return IRQ_HANDLED;
-@@ -2815,8 +2815,8 @@ static irqreturn_t mtk_handle_irq_tx(int
+@@ -2836,8 +2836,8 @@ static irqreturn_t mtk_handle_irq_tx(int
  
  	eth->tx_events++;
  	if (likely(napi_schedule_prep(&eth->tx_napi))) {
@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	}
  
  	return IRQ_HANDLED;
-@@ -4120,6 +4120,8 @@ static int mtk_probe(struct platform_dev
+@@ -4350,6 +4350,8 @@ static int mtk_probe(struct platform_dev
  	 * for NAPI to work
  	 */
  	init_dummy_netdev(&eth->dummy_dev);
diff --git a/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch b/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch
index c76a00eabd..26b88e4967 100644
--- a/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch
+++ b/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch
@@ -53,7 +53,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -4090,7 +4090,9 @@ static int mtk_probe(struct platform_dev
+@@ -4320,7 +4320,9 @@ static int mtk_probe(struct platform_dev
  			u32 ppe_addr = eth->soc->reg_map->ppe_base + i * 0x400;
  
  			eth->ppe[i] = mtk_ppe_init(eth, eth->base + ppe_addr,
@@ -64,7 +64,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
  			if (!eth->ppe[i]) {
  				err = -ENOMEM;
  				goto err_free_dev;
-@@ -4213,6 +4215,7 @@ static const struct mtk_soc_data mt7622_
+@@ -4445,6 +4447,7 @@ static const struct mtk_soc_data mt7622_
  	.required_pctl = false,
  	.offload_version = 2,
  	.hash_offset = 2,
@@ -72,7 +72,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
  	.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
  	.txrx = {
  		.txd_size = sizeof(struct mtk_tx_dma),
-@@ -4250,6 +4253,7 @@ static const struct mtk_soc_data mt7629_
+@@ -4482,6 +4485,7 @@ static const struct mtk_soc_data mt7629_
  	.hw_features = MTK_HW_FEATURES,
  	.required_clks = MT7629_CLKS_BITMAP,
  	.required_pctl = false,
@@ -80,7 +80,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
  	.txrx = {
  		.txd_size = sizeof(struct mtk_tx_dma),
  		.rxd_size = sizeof(struct mtk_rx_dma),
-@@ -4270,6 +4274,7 @@ static const struct mtk_soc_data mt7986_
+@@ -4502,6 +4506,7 @@ static const struct mtk_soc_data mt7986_
  	.offload_version = 2,
  	.hash_offset = 4,
  	.foe_entry_size = sizeof(struct mtk_foe_entry),
@@ -90,7 +90,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
  		.rxd_size = sizeof(struct mtk_rx_dma_v2),
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -983,6 +983,7 @@ struct mtk_soc_data {
+@@ -1007,6 +1007,7 @@ struct mtk_soc_data {
  	u8		hash_offset;
  	u16		foe_entry_size;
  	netdev_features_t hw_features;
@@ -171,8 +171,8 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
  	dma_wmb();
  
  	mtk_ppe_cache_clear(ppe);
-@@ -716,14 +766,42 @@ int mtk_foe_entry_idle_time(struct mtk_p
- 	return __mtk_foe_entry_idle_time(ppe, entry->data.ib1);
+@@ -743,14 +793,42 @@ int mtk_ppe_prepare_reset(struct mtk_ppe
+ 	return mtk_ppe_wait_busy(ppe);
  }
  
 +struct mtk_foe_accounting *mtk_foe_entry_get_mib(struct mtk_ppe *ppe, u32 index,
@@ -215,7 +215,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
  
  	ppe = devm_kzalloc(dev, sizeof(*ppe), GFP_KERNEL);
  	if (!ppe)
-@@ -738,6 +816,7 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_
+@@ -765,6 +843,7 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_
  	ppe->eth = eth;
  	ppe->dev = dev;
  	ppe->version = version;
@@ -223,7 +223,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
  
  	foe = dmam_alloc_coherent(ppe->dev,
  				  MTK_PPE_ENTRIES * soc->foe_entry_size,
-@@ -753,6 +832,25 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_
+@@ -780,6 +859,25 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_
  	if (!ppe->foe_flow)
  		return NULL;
  
@@ -249,7 +249,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
  	mtk_ppe_debugfs_init(ppe, index);
  
  	return ppe;
-@@ -867,6 +965,16 @@ void mtk_ppe_start(struct mtk_ppe *ppe)
+@@ -894,6 +992,16 @@ void mtk_ppe_start(struct mtk_ppe *ppe)
  		ppe_w32(ppe, MTK_PPE_DEFAULT_CPU_PORT1, 0xcb777);
  		ppe_w32(ppe, MTK_PPE_SBW_CTRL, 0x7f);
  	}
@@ -319,8 +319,8 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
 +			     int version, int index, bool accounting);
  void mtk_ppe_start(struct mtk_ppe *ppe);
  int mtk_ppe_stop(struct mtk_ppe *ppe);
- 
-@@ -354,5 +373,7 @@ int mtk_foe_entry_commit(struct mtk_ppe
+ int mtk_ppe_prepare_reset(struct mtk_ppe *ppe);
+@@ -355,5 +374,7 @@ int mtk_foe_entry_commit(struct mtk_ppe
  void mtk_foe_entry_clear(struct mtk_ppe *ppe, struct mtk_flow_entry *entry);
  int mtk_foe_entry_idle_time(struct mtk_ppe *ppe, struct mtk_flow_entry *entry);
  int mtk_ppe_debugfs_init(struct mtk_ppe *ppe, int index);
@@ -386,7 +386,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
  
 --- a/drivers/net/ethernet/mediatek/mtk_ppe_regs.h
 +++ b/drivers/net/ethernet/mediatek/mtk_ppe_regs.h
-@@ -143,6 +143,20 @@ enum {
+@@ -149,6 +149,20 @@ enum {
  
  #define MTK_PPE_MIB_TB_BASE			0x338
  
diff --git a/target/linux/generic/pending-5.15/732-02-net-ethernet-mtk_eth_soc-increase-tx-ring-side-for-Q.patch b/target/linux/generic/pending-5.15/732-02-net-ethernet-mtk_eth_soc-increase-tx-ring-side-for-Q.patch
index c6526a39a8..85c29e77de 100644
--- a/target/linux/generic/pending-5.15/732-02-net-ethernet-mtk_eth_soc-increase-tx-ring-side-for-Q.patch
+++ b/target/linux/generic/pending-5.15/732-02-net-ethernet-mtk_eth_soc-increase-tx-ring-side-for-Q.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
-@@ -894,7 +894,7 @@ static int mtk_init_fq_dma(struct mtk_et
+@@ -900,7 +900,7 @@ static int mtk_init_fq_dma(struct mtk_et
  {
  	const struct mtk_soc_data *soc = eth->soc;
  	dma_addr_t phy_ring_tail;
@@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	dma_addr_t dma_addr;
  	int i;
  
-@@ -2148,19 +2148,25 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -2154,19 +2154,25 @@ static int mtk_tx_alloc(struct mtk_eth *
  	struct mtk_tx_ring *ring = &eth->tx_ring;
  	int i, sz = soc->txrx.txd_size;
  	struct mtk_tx_dma_v2 *txd;
@@ -51,7 +51,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		u32 next_ptr = ring->phys + next * sz;
  
  		txd = ring->dma + i * sz;
-@@ -2180,22 +2186,22 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -2186,22 +2192,22 @@ static int mtk_tx_alloc(struct mtk_eth *
  	 * descriptors in ring->dma_pdma.
  	 */
  	if (!MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
@@ -79,7 +79,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
-@@ -2207,14 +2213,14 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -2213,14 +2219,14 @@ static int mtk_tx_alloc(struct mtk_eth *
  		mtk_w32(eth, ring->phys, soc->reg_map->qdma.ctx_ptr);
  		mtk_w32(eth, ring->phys, soc->reg_map->qdma.dtx_ptr);
  		mtk_w32(eth,
@@ -96,7 +96,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		mtk_w32(eth, 0, MT7628_TX_CTX_IDX0);
  		mtk_w32(eth, MT7628_PST_DTX_IDX0, soc->reg_map->pdma.rst_idx);
  	}
-@@ -2232,7 +2238,7 @@ static void mtk_tx_clean(struct mtk_eth
+@@ -2238,7 +2244,7 @@ static void mtk_tx_clean(struct mtk_eth
  	int i;
  
  	if (ring->buf) {
@@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  			mtk_tx_unmap(eth, &ring->buf[i], false);
  		kfree(ring->buf);
  		ring->buf = NULL;
-@@ -2240,14 +2246,14 @@ static void mtk_tx_clean(struct mtk_eth
+@@ -2246,14 +2252,14 @@ static void mtk_tx_clean(struct mtk_eth
  
  	if (ring->dma) {
  		dma_free_coherent(eth->dma_dev,
@@ -122,7 +122,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  				  ring->dma_pdma, ring->phys_pdma);
  		ring->dma_pdma = NULL;
  	}
-@@ -2767,7 +2773,7 @@ static void mtk_dma_free(struct mtk_eth
+@@ -2773,7 +2779,7 @@ static void mtk_dma_free(struct mtk_eth
  			netdev_reset_queue(eth->netdev[i]);
  	if (eth->scratch_ring) {
  		dma_free_coherent(eth->dma_dev,
diff --git a/target/linux/generic/pending-5.15/732-03-net-ethernet-mtk_eth_soc-avoid-port_mg-assignment-on.patch b/target/linux/generic/pending-5.15/732-03-net-ethernet-mtk_eth_soc-avoid-port_mg-assignment-on.patch
index 2e9594c872..8c425bc8c4 100644
--- a/target/linux/generic/pending-5.15/732-03-net-ethernet-mtk_eth_soc-avoid-port_mg-assignment-on.patch
+++ b/target/linux/generic/pending-5.15/732-03-net-ethernet-mtk_eth_soc-avoid-port_mg-assignment-on.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
-@@ -4199,7 +4199,7 @@ static const struct mtk_soc_data mt7621_
+@@ -4431,7 +4431,7 @@ static const struct mtk_soc_data mt7621_
  	.hw_features = MTK_HW_FEATURES,
  	.required_clks = MT7621_CLKS_BITMAP,
  	.required_pctl = false,
@@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	.hash_offset = 2,
  	.foe_entry_size = sizeof(struct mtk_foe_entry) - 16,
  	.txrx = {
-@@ -4239,7 +4239,7 @@ static const struct mtk_soc_data mt7623_
+@@ -4471,7 +4471,7 @@ static const struct mtk_soc_data mt7623_
  	.hw_features = MTK_HW_FEATURES,
  	.required_clks = MT7623_CLKS_BITMAP,
  	.required_pctl = true,
diff --git a/target/linux/generic/pending-5.15/732-04-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch b/target/linux/generic/pending-5.15/732-04-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch
index 0e817cd272..8a801f77e8 100644
--- a/target/linux/generic/pending-5.15/732-04-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch
+++ b/target/linux/generic/pending-5.15/732-04-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch
@@ -22,7 +22,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
-@@ -54,6 +54,7 @@ static const struct mtk_reg_map mtk_reg_
+@@ -55,6 +55,7 @@ static const struct mtk_reg_map mtk_reg_
  	},
  	.qdma = {
  		.qtx_cfg	= 0x1800,
@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		.rx_ptr		= 0x1900,
  		.rx_cnt_cfg	= 0x1904,
  		.qcrx_ptr	= 0x1908,
-@@ -61,6 +62,7 @@ static const struct mtk_reg_map mtk_reg_
+@@ -62,6 +63,7 @@ static const struct mtk_reg_map mtk_reg_
  		.rst_idx	= 0x1a08,
  		.delay_irq	= 0x1a0c,
  		.fc_th		= 0x1a10,
@@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		.int_grp	= 0x1a20,
  		.hred		= 0x1a44,
  		.ctx_ptr	= 0x1b00,
-@@ -113,6 +115,7 @@ static const struct mtk_reg_map mt7986_r
+@@ -117,6 +119,7 @@ static const struct mtk_reg_map mt7986_r
  	},
  	.qdma = {
  		.qtx_cfg	= 0x4400,
@@ -46,7 +46,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		.rx_ptr		= 0x4500,
  		.rx_cnt_cfg	= 0x4504,
  		.qcrx_ptr	= 0x4508,
-@@ -130,6 +133,7 @@ static const struct mtk_reg_map mt7986_r
+@@ -134,6 +137,7 @@ static const struct mtk_reg_map mt7986_r
  		.fq_tail	= 0x4724,
  		.fq_count	= 0x4728,
  		.fq_blen	= 0x472c,
@@ -54,7 +54,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	},
  	.gdm1_cnt		= 0x1c00,
  	.gdma_to_ppe0		= 0x3333,
-@@ -570,6 +574,75 @@ static void mtk_mac_link_down(struct phy
+@@ -576,6 +580,75 @@ static void mtk_mac_link_down(struct phy
  	mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id));
  }
  
@@ -130,7 +130,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static void mtk_mac_link_up(struct phylink_config *config,
  			    struct phy_device *phy,
  			    unsigned int mode, phy_interface_t interface,
-@@ -595,6 +668,8 @@ static void mtk_mac_link_up(struct phyli
+@@ -601,6 +674,8 @@ static void mtk_mac_link_up(struct phyli
  		break;
  	}
  
@@ -139,7 +139,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	/* Configure duplex */
  	if (duplex == DUPLEX_FULL)
  		mcr |= MAC_MCR_FORCE_DPX;
-@@ -1053,7 +1128,8 @@ static void mtk_tx_set_dma_desc_v1(struc
+@@ -1059,7 +1134,8 @@ static void mtk_tx_set_dma_desc_v1(struc
  
  	WRITE_ONCE(desc->txd1, info->addr);
  
@@ -149,7 +149,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (info->last)
  		data |= TX_DMA_LS0;
  	WRITE_ONCE(desc->txd3, data);
-@@ -1087,9 +1163,6 @@ static void mtk_tx_set_dma_desc_v2(struc
+@@ -1093,9 +1169,6 @@ static void mtk_tx_set_dma_desc_v2(struc
  		data |= TX_DMA_LS0;
  	WRITE_ONCE(desc->txd3, data);
  
@@ -159,7 +159,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	data = (mac->id + 1) << TX_DMA_FPORT_SHIFT_V2; /* forward port */
  	data |= TX_DMA_SWC_V2 | QID_BITS_V2(info->qid);
  	WRITE_ONCE(desc->txd4, data);
-@@ -1133,11 +1206,12 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1139,11 +1212,12 @@ static int mtk_tx_map(struct sk_buff *sk
  		.gso = gso,
  		.csum = skb->ip_summed == CHECKSUM_PARTIAL,
  		.vlan = skb_vlan_tag_present(skb),
@@ -173,7 +173,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	struct mtk_mac *mac = netdev_priv(dev);
  	struct mtk_eth *eth = mac->hw;
  	const struct mtk_soc_data *soc = eth->soc;
-@@ -1145,8 +1219,10 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1151,8 +1225,10 @@ static int mtk_tx_map(struct sk_buff *sk
  	struct mtk_tx_dma *itxd_pdma, *txd_pdma;
  	struct mtk_tx_buf *itx_buf, *tx_buf;
  	int i, n_desc = 1;
@@ -184,7 +184,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	itxd = ring->next_free;
  	itxd_pdma = qdma_to_pdma(ring, itxd);
  	if (itxd == ring->last_free)
-@@ -1195,7 +1271,7 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1201,7 +1277,7 @@ static int mtk_tx_map(struct sk_buff *sk
  			memset(&txd_info, 0, sizeof(struct mtk_tx_dma_desc_info));
  			txd_info.size = min_t(unsigned int, frag_size,
  					      soc->txrx.dma_max_len);
@@ -193,7 +193,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  			txd_info.last = i == skb_shinfo(skb)->nr_frags - 1 &&
  					!(frag_size - txd_info.size);
  			txd_info.addr = skb_frag_dma_map(eth->dma_dev, frag,
-@@ -1234,7 +1310,7 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1240,7 +1316,7 @@ static int mtk_tx_map(struct sk_buff *sk
  			txd_pdma->txd2 |= TX_DMA_LS1;
  	}
  
@@ -202,7 +202,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	skb_tx_timestamp(skb);
  
  	ring->next_free = mtk_qdma_phys_to_virt(ring, txd->txd2);
-@@ -1246,8 +1322,7 @@ static int mtk_tx_map(struct sk_buff *sk
+@@ -1252,8 +1328,7 @@ static int mtk_tx_map(struct sk_buff *sk
  	wmb();
  
  	if (MTK_HAS_CAPS(soc->caps, MTK_QDMA)) {
@@ -212,7 +212,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  			mtk_w32(eth, txd->txd2, soc->reg_map->qdma.ctx_ptr);
  	} else {
  		int next_idx;
-@@ -1316,7 +1391,7 @@ static void mtk_wake_queue(struct mtk_et
+@@ -1322,7 +1397,7 @@ static void mtk_wake_queue(struct mtk_et
  	for (i = 0; i < MTK_MAC_COUNT; i++) {
  		if (!eth->netdev[i])
  			continue;
@@ -221,7 +221,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	}
  }
  
-@@ -1340,7 +1415,7 @@ static netdev_tx_t mtk_start_xmit(struct
+@@ -1346,7 +1421,7 @@ static netdev_tx_t mtk_start_xmit(struct
  
  	tx_num = mtk_cal_txd_req(eth, skb);
  	if (unlikely(atomic_read(&ring->free_count) <= tx_num)) {
@@ -230,7 +230,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);
-@@ -1366,7 +1441,7 @@ static netdev_tx_t mtk_start_xmit(struct
+@@ -1372,7 +1447,7 @@ static netdev_tx_t mtk_start_xmit(struct
  		goto drop;
  
  	if (unlikely(atomic_read(&ring->free_count) <= ring->thresh))
@@ -239,7 +239,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	spin_unlock(&eth->page_lock);
  
-@@ -1533,10 +1608,12 @@ static int mtk_xdp_submit_frame(struct m
+@@ -1539,10 +1614,12 @@ static int mtk_xdp_submit_frame(struct m
  	struct skb_shared_info *sinfo = xdp_get_shared_info_from_frame(xdpf);
  	const struct mtk_soc_data *soc = eth->soc;
  	struct mtk_tx_ring *ring = &eth->tx_ring;
@@ -252,7 +252,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	};
  	int err, index = 0, n_desc = 1, nr_frags;
  	struct mtk_tx_dma *htxd, *txd, *txd_pdma;
-@@ -1587,6 +1664,7 @@ static int mtk_xdp_submit_frame(struct m
+@@ -1593,6 +1670,7 @@ static int mtk_xdp_submit_frame(struct m
  		memset(&txd_info, 0, sizeof(struct mtk_tx_dma_desc_info));
  		txd_info.size = skb_frag_size(&sinfo->frags[index]);
  		txd_info.last = index + 1 == nr_frags;
@@ -260,7 +260,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		data = skb_frag_address(&sinfo->frags[index]);
  
  		index++;
-@@ -1938,8 +2016,46 @@ rx_done:
+@@ -1944,8 +2022,46 @@ rx_done:
  	return done;
  }
  
@@ -308,7 +308,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  {
  	const struct mtk_reg_map *reg_map = eth->soc->reg_map;
  	struct mtk_tx_ring *ring = &eth->tx_ring;
-@@ -1969,12 +2085,9 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -1975,12 +2091,9 @@ static int mtk_poll_tx_qdma(struct mtk_e
  			break;
  
  		if (tx_buf->data != (void *)MTK_DMA_DUMMY_DESC) {
@@ -323,7 +323,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  			budget--;
  		}
  		mtk_tx_unmap(eth, tx_buf, true);
-@@ -1992,7 +2105,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
+@@ -1998,7 +2111,7 @@ static int mtk_poll_tx_qdma(struct mtk_e
  }
  
  static int mtk_poll_tx_pdma(struct mtk_eth *eth, int budget,
@@ -332,7 +332,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  {
  	struct mtk_tx_ring *ring = &eth->tx_ring;
  	struct mtk_tx_buf *tx_buf;
-@@ -2008,12 +2121,8 @@ static int mtk_poll_tx_pdma(struct mtk_e
+@@ -2014,12 +2127,8 @@ static int mtk_poll_tx_pdma(struct mtk_e
  			break;
  
  		if (tx_buf->data != (void *)MTK_DMA_DUMMY_DESC) {
@@ -347,7 +347,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  			budget--;
  		}
  		mtk_tx_unmap(eth, tx_buf, true);
-@@ -2034,26 +2143,15 @@ static int mtk_poll_tx(struct mtk_eth *e
+@@ -2040,26 +2149,15 @@ static int mtk_poll_tx(struct mtk_eth *e
  {
  	struct mtk_tx_ring *ring = &eth->tx_ring;
  	struct dim_sample dim_sample = {};
@@ -379,7 +379,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	dim_update_sample(eth->tx_events, eth->tx_packets, eth->tx_bytes,
  			  &dim_sample);
-@@ -2063,7 +2161,7 @@ static int mtk_poll_tx(struct mtk_eth *e
+@@ -2069,7 +2167,7 @@ static int mtk_poll_tx(struct mtk_eth *e
  	    (atomic_read(&ring->free_count) > ring->thresh))
  		mtk_wake_queue(eth);
  
@@ -388,7 +388,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  }
  
  static void mtk_handle_status_irq(struct mtk_eth *eth)
-@@ -2149,6 +2247,7 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -2155,6 +2253,7 @@ static int mtk_tx_alloc(struct mtk_eth *
  	int i, sz = soc->txrx.txd_size;
  	struct mtk_tx_dma_v2 *txd;
  	int ring_size;
@@ -396,7 +396,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	if (MTK_HAS_CAPS(soc->caps, MTK_QDMA))
  		ring_size = MTK_QDMA_RING_SIZE;
-@@ -2216,8 +2315,25 @@ static int mtk_tx_alloc(struct mtk_eth *
+@@ -2222,8 +2321,25 @@ static int mtk_tx_alloc(struct mtk_eth *
  			ring->phys + ((ring_size - 1) * sz),
  			soc->reg_map->qdma.crx_ptr);
  		mtk_w32(eth, ring->last_free_ptr, soc->reg_map->qdma.drx_ptr);
@@ -424,7 +424,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	} else {
  		mtk_w32(eth, ring->phys_pdma, MT7628_TX_BASE_PTR0);
  		mtk_w32(eth, ring_size, MT7628_TX_MAX_CNT0);
-@@ -2882,7 +2998,7 @@ static int mtk_start_dma(struct mtk_eth
+@@ -2903,7 +3019,7 @@ static int mtk_start_dma(struct mtk_eth
  		if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2))
  			val |= MTK_MUTLI_CNT | MTK_RESV_BUF |
  			       MTK_WCOMP_EN | MTK_DMAD_WR_WDONE |
@@ -433,7 +433,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		else
  			val |= MTK_RX_BT_32DWORDS;
  		mtk_w32(eth, val, reg_map->qdma.glo_cfg);
-@@ -2928,6 +3044,45 @@ static void mtk_gdm_config(struct mtk_et
+@@ -2949,6 +3065,45 @@ static void mtk_gdm_config(struct mtk_et
  	mtk_w32(eth, 0, MTK_RST_GL);
  }
  
@@ -479,7 +479,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static int mtk_open(struct net_device *dev)
  {
  	struct mtk_mac *mac = netdev_priv(dev);
-@@ -2972,7 +3127,8 @@ static int mtk_open(struct net_device *d
+@@ -2993,7 +3148,8 @@ static int mtk_open(struct net_device *d
  		refcount_inc(&eth->dma_refcnt);
  
  	phylink_start(mac->phylink);
@@ -489,7 +489,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	return 0;
  }
  
-@@ -3488,8 +3644,12 @@ static int mtk_unreg_dev(struct mtk_eth
+@@ -3716,8 +3872,12 @@ static int mtk_unreg_dev(struct mtk_eth
  	int i;
  
  	for (i = 0; i < MTK_MAC_COUNT; i++) {
@@ -502,7 +502,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		unregister_netdev(eth->netdev[i]);
  	}
  
-@@ -3705,6 +3865,23 @@ static int mtk_set_rxnfc(struct net_devi
+@@ -3934,6 +4094,23 @@ static int mtk_set_rxnfc(struct net_devi
  	return ret;
  }
  
@@ -526,7 +526,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,
-@@ -3740,6 +3917,7 @@ static const struct net_device_ops mtk_n
+@@ -3969,6 +4146,7 @@ static const struct net_device_ops mtk_n
  	.ndo_setup_tc		= mtk_eth_setup_tc,
  	.ndo_bpf		= mtk_xdp,
  	.ndo_xdp_xmit		= mtk_xdp_xmit,
@@ -534,7 +534,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  };
  
  static int mtk_add_mac(struct mtk_eth *eth, struct device_node *np)
-@@ -3749,6 +3927,7 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -3978,6 +4156,7 @@ static int mtk_add_mac(struct mtk_eth *e
  	struct phylink *phylink;
  	struct mtk_mac *mac;
  	int id, err;
@@ -542,7 +542,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	if (!_id) {
  		dev_err(eth->dev, "missing mac id\n");
-@@ -3766,7 +3945,10 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -3995,7 +4174,10 @@ static int mtk_add_mac(struct mtk_eth *e
  		return -EINVAL;
  	}
  
@@ -554,7 +554,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (!eth->netdev[id]) {
  		dev_err(eth->dev, "alloc_etherdev failed\n");
  		return -ENOMEM;
-@@ -3863,6 +4045,11 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -4092,6 +4274,11 @@ static int mtk_add_mac(struct mtk_eth *e
  	else
  		eth->netdev[id]->max_mtu = MTK_MAX_RX_LENGTH_2K - MTK_RX_ETH_HLEN;
  
@@ -576,7 +576,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #define MTK_QDMA_PAGE_SIZE	2048
  #define MTK_MAX_RX_LENGTH	1536
  #define MTK_MAX_RX_LENGTH_2K	2048
-@@ -203,8 +204,26 @@
+@@ -215,8 +216,26 @@
  #define MTK_RING_MAX_AGG_CNT_H		((MTK_HW_LRO_MAX_AGG_CNT >> 6) & 0x3)
  
  /* QDMA TX Queue Configuration Registers */
@@ -603,7 +603,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  /* QDMA Global Configuration Register */
  #define MTK_RX_2B_OFFSET	BIT(31)
  #define MTK_RX_BT_32DWORDS	(3 << 11)
-@@ -223,6 +242,7 @@
+@@ -235,6 +254,7 @@
  #define MTK_WCOMP_EN		BIT(24)
  #define MTK_RESV_BUF		(0x40 << 16)
  #define MTK_MUTLI_CNT		(0x4 << 12)
@@ -611,7 +611,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  /* QDMA Flow Control Register */
  #define FC_THRES_DROP_MODE	BIT(20)
-@@ -251,8 +271,6 @@
+@@ -265,8 +285,6 @@
  #define MTK_STAT_OFFSET		0x40
  
  /* QDMA TX NUM */
@@ -620,7 +620,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #define QID_BITS_V2(x)		(((x) & 0x3f) << 16)
  #define MTK_QDMA_GMAC2_QID	8
  
-@@ -282,6 +300,7 @@
+@@ -296,6 +314,7 @@
  #define TX_DMA_PLEN0(x)		(((x) & eth->soc->txrx.dma_max_len) << eth->soc->txrx.dma_len_offset)
  #define TX_DMA_PLEN1(x)		((x) & eth->soc->txrx.dma_max_len)
  #define TX_DMA_SWC		BIT(14)
@@ -628,7 +628,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  /* PDMA on MT7628 */
  #define TX_DMA_DONE		BIT(31)
-@@ -930,6 +949,7 @@ struct mtk_reg_map {
+@@ -952,6 +971,7 @@ struct mtk_reg_map {
  	} pdma;
  	struct {
  		u32	qtx_cfg;	/* tx queue configuration */
@@ -636,7 +636,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		u32	rx_ptr;		/* rx base pointer */
  		u32	rx_cnt_cfg;	/* rx max count configuration */
  		u32	qcrx_ptr;	/* rx cpu pointer */
-@@ -947,6 +967,7 @@ struct mtk_reg_map {
+@@ -969,6 +989,7 @@ struct mtk_reg_map {
  		u32	fq_tail;	/* fq tail pointer */
  		u32	fq_count;	/* fq free page count */
  		u32	fq_blen;	/* fq free page buffer length */
@@ -644,7 +644,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	} qdma;
  	u32	gdm1_cnt;
  	u32	gdma_to_ppe0;
-@@ -1139,6 +1160,7 @@ struct mtk_mac {
+@@ -1173,6 +1194,7 @@ struct mtk_mac {
  	__be32				hwlro_ip[MTK_MAX_LRO_IP_CNT];
  	int				hwlro_ip_cnt;
  	unsigned int			syscfg0;
diff --git a/target/linux/generic/pending-5.15/732-06-net-ethernet-mediatek-ppe-assign-per-port-queues-for.patch b/target/linux/generic/pending-5.15/732-06-net-ethernet-mediatek-ppe-assign-per-port-queues-for.patch
index 05161c3479..8a7cb9f91e 100644
--- a/target/linux/generic/pending-5.15/732-06-net-ethernet-mediatek-ppe-assign-per-port-queues-for.patch
+++ b/target/linux/generic/pending-5.15/732-06-net-ethernet-mediatek-ppe-assign-per-port-queues-for.patch
@@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #define MTK_FOE_IB2_DEST_PORT_V2	GENMASK(12, 9)
  #define MTK_FOE_IB2_MULTICAST_V2	BIT(13)
  #define MTK_FOE_IB2_WDMA_WINFO_V2	BIT(19)
-@@ -369,6 +371,8 @@ int mtk_foe_entry_set_pppoe(struct mtk_e
+@@ -370,6 +372,8 @@ int mtk_foe_entry_set_pppoe(struct mtk_e
  			    int sid);
  int mtk_foe_entry_set_wdma(struct mtk_eth *eth, struct mtk_foe_entry *entry,
  			   int wdma_idx, int txq, int bss, int wcid);
diff --git a/target/linux/generic/pending-5.15/732-07-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch b/target/linux/generic/pending-5.15/732-07-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch
index 8c711ba802..d7e7492aa2 100644
--- a/target/linux/generic/pending-5.15/732-07-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch
+++ b/target/linux/generic/pending-5.15/732-07-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -895,7 +895,13 @@ enum mkt_eth_capabilities {
+@@ -916,7 +916,13 @@ enum mkt_eth_capabilities {
  #define MTK_MUX_GMAC12_TO_GEPHY_SGMII   \
  	(MTK_ETH_MUX_GMAC12_TO_GEPHY_SGMII | MTK_MUX)
  
diff --git a/target/linux/generic/pending-5.15/732-09-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch b/target/linux/generic/pending-5.15/732-09-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch
index 933112c17a..a130358101 100644
--- a/target/linux/generic/pending-5.15/732-09-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch
+++ b/target/linux/generic/pending-5.15/732-09-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch
@@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  #include "mtk_eth_soc.h"
  #include "mtk_wed.h"
-@@ -1967,16 +1968,22 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1973,16 +1974,22 @@ static int mtk_poll_rx(struct napi_struc
  						htons(RX_DMA_VPID(trxd.rxd4)),
  						RX_DMA_VID(trxd.rxd4));
  			} else if (trxd.rxd2 & RX_DMA_VTAG) {
@@ -52,7 +52,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		}
  
  		skb_record_rx_queue(skb, 0);
-@@ -2793,15 +2800,30 @@ static netdev_features_t mtk_fix_feature
+@@ -2799,15 +2806,30 @@ static netdev_features_t mtk_fix_feature
  
  static int mtk_set_features(struct net_device *dev, netdev_features_t features)
  {
@@ -88,7 +88,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  }
  
  /* wait for DMA to finish whatever it is doing before we start using it again */
-@@ -3083,11 +3105,45 @@ found:
+@@ -3104,11 +3126,45 @@ found:
  	return NOTIFY_DONE;
  }
  
@@ -135,7 +135,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0);
  	if (err) {
-@@ -3419,6 +3475,10 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -3631,6 +3687,10 @@ static int mtk_hw_init(struct mtk_eth *e
  	 */
  	val = mtk_r32(eth, MTK_CDMQ_IG_CTRL);
  	mtk_w32(eth, val | MTK_CDMQ_STAG_EN, MTK_CDMQ_IG_CTRL);
@@ -146,7 +146,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	/* Enable RX VLan Offloading */
  	mtk_w32(eth, 1, MTK_CDMP_EG_CTRL);
-@@ -3636,6 +3696,12 @@ static int mtk_free_dev(struct mtk_eth *
+@@ -3864,6 +3924,12 @@ static int mtk_free_dev(struct mtk_eth *
  		free_netdev(eth->netdev[i]);
  	}
  
@@ -171,7 +171,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #define MTK_QDMA_NUM_QUEUES	16
  #define MTK_QDMA_PAGE_SIZE	2048
  #define MTK_MAX_RX_LENGTH	1536
-@@ -93,6 +96,9 @@
+@@ -105,6 +108,9 @@
  #define MTK_CDMQ_IG_CTRL	0x1400
  #define MTK_CDMQ_STAG_EN	BIT(0)
  
@@ -181,7 +181,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  /* CDMP Ingress Control Register */
  #define MTK_CDMP_IG_CTRL	0x400
  #define MTK_CDMP_STAG_EN	BIT(0)
-@@ -1140,6 +1146,8 @@ struct mtk_eth {
+@@ -1166,6 +1172,8 @@ struct mtk_eth {
  
  	int				ip_align;
  
diff --git a/target/linux/generic/pending-5.15/732-10-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch b/target/linux/generic/pending-5.15/732-10-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch
index f19128d809..777e6f0ed1 100644
--- a/target/linux/generic/pending-5.15/732-10-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch
+++ b/target/linux/generic/pending-5.15/732-10-net-ethernet-mtk_eth_soc-work-around-issue-with-send.patch
@@ -16,7 +16,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
-@@ -1396,12 +1396,28 @@ static void mtk_wake_queue(struct mtk_et
+@@ -1402,12 +1402,28 @@ static void mtk_wake_queue(struct mtk_et
  	}
  }
  
@@ -45,7 +45,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	bool gso = false;
  	int tx_num;
  
-@@ -1423,6 +1439,18 @@ static netdev_tx_t mtk_start_xmit(struct
+@@ -1429,6 +1445,18 @@ static netdev_tx_t mtk_start_xmit(struct
  		return NETDEV_TX_BUSY;
  	}
  
@@ -64,7 +64,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	/* TSO: fill MSS info in tcp checksum field */
  	if (skb_is_gso(skb)) {
  		if (skb_cow_head(skb, 0)) {
-@@ -1438,8 +1466,14 @@ static netdev_tx_t mtk_start_xmit(struct
+@@ -1444,8 +1472,14 @@ static netdev_tx_t mtk_start_xmit(struct
  		}
  	}
  
@@ -83,7 +83,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		netif_tx_stop_all_queues(dev);
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -246,7 +246,7 @@
+@@ -258,7 +258,7 @@
  #define MTK_CHK_DDONE_EN	BIT(28)
  #define MTK_DMAD_WR_WDONE	BIT(26)
  #define MTK_WCOMP_EN		BIT(24)
diff --git a/target/linux/generic/pending-5.15/732-12-net-ethernet-mtk_eth_soc-drop-packets-to-WDMA-if-the.patch b/target/linux/generic/pending-5.15/732-12-net-ethernet-mtk_eth_soc-drop-packets-to-WDMA-if-the.patch
index 416dfb6cf7..6c81d880f9 100644
--- a/target/linux/generic/pending-5.15/732-12-net-ethernet-mtk_eth_soc-drop-packets-to-WDMA-if-the.patch
+++ b/target/linux/generic/pending-5.15/732-12-net-ethernet-mtk_eth_soc-drop-packets-to-WDMA-if-the.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
-@@ -3533,9 +3533,12 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -3745,9 +3745,12 @@ static int mtk_hw_init(struct mtk_eth *e
  	mtk_w32(eth, 0x21021000, MTK_FE_INT_GRP);
  
  	if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
@@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -127,6 +127,7 @@
+@@ -139,6 +139,7 @@
  #define PSE_FQFC_CFG1		0x100
  #define PSE_FQFC_CFG2		0x104
  #define PSE_DROP_CFG		0x108
diff --git a/target/linux/generic/pending-5.15/732-14-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch b/target/linux/generic/pending-5.15/732-14-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch
index 0d575b84a0..128501f38c 100644
--- a/target/linux/generic/pending-5.15/732-14-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch
+++ b/target/linux/generic/pending-5.15/732-14-net-ethernet-mtk_eth_soc-drop-generic-vlan-rx-offloa.patch
@@ -17,7 +17,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
-@@ -1995,29 +1995,16 @@ static int mtk_poll_rx(struct napi_struc
+@@ -2001,29 +2001,16 @@ static int mtk_poll_rx(struct napi_struc
  		if (reason == MTK_PPE_CPU_REASON_HIT_UNBIND_RATE_REACHED)
  			mtk_ppe_check_skb(eth->ppe[0], skb, hash);
  
@@ -50,7 +50,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		}
  
  		skb_record_rx_queue(skb, 0);
-@@ -2834,29 +2821,11 @@ static netdev_features_t mtk_fix_feature
+@@ -2840,29 +2827,11 @@ static netdev_features_t mtk_fix_feature
  
  static int mtk_set_features(struct net_device *dev, netdev_features_t features)
  {
@@ -80,7 +80,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	return 0;
  }
  
-@@ -3155,30 +3124,6 @@ static int mtk_open(struct net_device *d
+@@ -3176,30 +3145,6 @@ static int mtk_open(struct net_device *d
  	struct mtk_eth *eth = mac->hw;
  	int i, err;
  
@@ -111,7 +111,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	err = phylink_of_phy_connect(mac->phylink, mac->of_node, 0);
  	if (err) {
  		netdev_err(dev, "%s: could not attach PHY: %d\n", __func__,
-@@ -3219,6 +3164,35 @@ static int mtk_open(struct net_device *d
+@@ -3240,6 +3185,35 @@ static int mtk_open(struct net_device *d
  	phylink_start(mac->phylink);
  	netif_tx_start_all_queues(dev);
  
@@ -147,7 +147,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	return 0;
  }
  
-@@ -3512,10 +3486,9 @@ static int mtk_hw_init(struct mtk_eth *e
+@@ -3724,10 +3698,9 @@ static int mtk_hw_init(struct mtk_eth *e
  	if (!MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
  		val = mtk_r32(eth, MTK_CDMP_IG_CTRL);
  		mtk_w32(eth, val | MTK_CDMP_STAG_EN, MTK_CDMP_IG_CTRL);
@@ -160,7 +160,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  	/* set interrupt delays based on current Net DIM sample */
  	mtk_dim_rx(&eth->rx_dim.work);
-@@ -4136,7 +4109,7 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -4365,7 +4338,7 @@ static int mtk_add_mac(struct mtk_eth *e
  		eth->netdev[id]->hw_features |= NETIF_F_LRO;
  
  	eth->netdev[id]->vlan_features = eth->soc->hw_features &
diff --git a/target/linux/generic/pending-5.15/734-net-ethernet-mtk_eth_soc-ppe-fix-L2-offloading-with-.patch b/target/linux/generic/pending-5.15/734-net-ethernet-mtk_eth_soc-ppe-fix-L2-offloading-with-.patch
index 39d6d0c879..7bd4df5fff 100644
--- a/target/linux/generic/pending-5.15/734-net-ethernet-mtk_eth_soc-ppe-fix-L2-offloading-with-.patch
+++ b/target/linux/generic/pending-5.15/734-net-ethernet-mtk_eth_soc-ppe-fix-L2-offloading-with-.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
-@@ -1992,9 +1992,6 @@ static int mtk_poll_rx(struct napi_struc
+@@ -1998,9 +1998,6 @@ static int mtk_poll_rx(struct napi_struc
  			skb_checksum_none_assert(skb);
  		skb->protocol = eth_type_trans(skb, netdev);
  
@@ -22,7 +22,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		/* When using VLAN untagging in combination with DSA, the
  		 * hardware treats the MTK special tag as a VLAN and untags it.
  		 */
-@@ -2007,6 +2004,9 @@ static int mtk_poll_rx(struct napi_struc
+@@ -2013,6 +2010,9 @@ static int mtk_poll_rx(struct napi_struc
  				skb_dst_set_noref(skb, &eth->dsa_meta[port]->dst);
  		}
  
diff --git a/target/linux/mediatek/patches-5.15/703-v5.17-net-ethernet-mtk_eth_soc-implement-Clause-45-MDIO-ac.patch b/target/linux/mediatek/patches-5.15/703-v5.17-net-ethernet-mtk_eth_soc-implement-Clause-45-MDIO-ac.patch
index 82cd4088c9..757750832c 100644
--- a/target/linux/mediatek/patches-5.15/703-v5.17-net-ethernet-mtk_eth_soc-implement-Clause-45-MDIO-ac.patch
+++ b/target/linux/mediatek/patches-5.15/703-v5.17-net-ethernet-mtk_eth_soc-implement-Clause-45-MDIO-ac.patch
@@ -20,7 +20,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
-@@ -224,13 +224,35 @@ static int _mtk_mdio_write(struct mtk_et
+@@ -230,13 +230,35 @@ static int _mtk_mdio_write(struct mtk_et
  	if (ret < 0)
  		return ret;
  
@@ -63,7 +63,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	ret = mtk_mdio_busy_wait(eth);
  	if (ret < 0)
-@@ -247,12 +269,33 @@ static int _mtk_mdio_read(struct mtk_eth
+@@ -253,12 +275,33 @@ static int _mtk_mdio_read(struct mtk_eth
  	if (ret < 0)
  		return ret;
  
@@ -103,7 +103,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	ret = mtk_mdio_busy_wait(eth);
  	if (ret < 0)
-@@ -720,6 +763,7 @@ static int mtk_mdio_init(struct mtk_eth
+@@ -726,6 +769,7 @@ static int mtk_mdio_init(struct mtk_eth
  	eth->mii_bus->name = "mdio";
  	eth->mii_bus->read = mtk_mdio_read;
  	eth->mii_bus->write = mtk_mdio_write;
@@ -113,7 +113,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -355,9 +355,12 @@
+@@ -369,9 +369,12 @@
  #define PHY_IAC_ADDR_MASK	GENMASK(24, 20)
  #define PHY_IAC_ADDR(x)		FIELD_PREP(PHY_IAC_ADDR_MASK, (x))
  #define PHY_IAC_CMD_MASK	GENMASK(19, 18)



From lede-commits at lists.infradead.org  Thu Feb  2 02:36:58 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 02 Feb 2023 05:36:58 -0500
Subject: [openwrt/openwrt]  mt76: fix typo in PKG_SOURCE_DATE
In-Reply-To: <167533421851.830372.17054179942766151112@git-01.infra.openwrt.org>
References: <167533421851.830372.17054179942766151112@git-01.infra.openwrt.org>
Message-ID: <mailman.11431.1675334222.3064139.lede-commits@lists.infradead.org>

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

commit ff4c872c7c225d46566607f176d5c8e35fcf3696
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Feb 2 11:36:46 2023 +0100

    mt76: fix typo in PKG_SOURCE_DATE
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/kernel/mt76/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile
index 03c59cf0c1..71476b084f 100644
--- a/package/kernel/mt76/Makefile
+++ b/package/kernel/mt76/Makefile
@@ -8,7 +8,7 @@ PKG_LICENSE_FILES:=
 
 PKG_SOURCE_URL:=https://github.com/openwrt/mt76
 PKG_SOURCE_PROTO:=git
-PKG_SOURCE_DATE:=2022-02-02
+PKG_SOURCE_DATE:=2023-02-02
 PKG_SOURCE_VERSION:=b2360d59747c6fed2b65bc1c3563c10593c83f3e
 PKG_MIRROR_HASH:=a89353a4e42c3b44c5a9a6a5f2248c5e985f91620b08cbee7b1cbd0dd53865d7
 



From lede-commits at lists.infradead.org  Thu Feb  2 02:37:58 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 02 Feb 2023 05:37:58 -0500
Subject: [openwrt/openwrt]  mt76: update PKG_SOURCE_HASH
In-Reply-To: <167533427827.831216.17171803447903714405@git-01.infra.openwrt.org>
References: <167533427827.831216.17171803447903714405@git-01.infra.openwrt.org>
Message-ID: <mailman.11434.1675334286.3064139.lede-commits@lists.infradead.org>

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

commit acd8e94d20eea746f8fd01d0603bf46ef1d494af
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Feb 2 11:37:36 2023 +0100

    mt76: update PKG_SOURCE_HASH
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/kernel/mt76/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/mt76/Makefile b/package/kernel/mt76/Makefile
index 71476b084f..933f3b28a4 100644
--- a/package/kernel/mt76/Makefile
+++ b/package/kernel/mt76/Makefile
@@ -10,7 +10,7 @@ PKG_SOURCE_URL:=https://github.com/openwrt/mt76
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_DATE:=2023-02-02
 PKG_SOURCE_VERSION:=b2360d59747c6fed2b65bc1c3563c10593c83f3e
-PKG_MIRROR_HASH:=a89353a4e42c3b44c5a9a6a5f2248c5e985f91620b08cbee7b1cbd0dd53865d7
+PKG_MIRROR_HASH:=f85f00fa8f549de348a115f92c4f0235e413ed924669aece390c7570882526dd
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 PKG_USE_NINJA:=0



From lede-commits at lists.infradead.org  Fri Feb  3 00:36:43 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 03:36:43 -0500
Subject: [openwrt/openwrt]  kernel: bump 5.15 to 5.15.91
In-Reply-To: <167541340303.1780408.9809814065654510791@git-01.infra.openwrt.org>
References: <167541340303.1780408.9809814065654510791@git-01.infra.openwrt.org>
Message-ID: <mailman.12008.1675413421.3064139.lede-commits@lists.infradead.org>

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

commit 59fe39f6fcf1407a53ec54cb54d1e27dfa0beca5
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Wed Feb 1 15:37:19 2023 -0500

    kernel: bump 5.15 to 5.15.91
    
    Manually rebased:
      pending-5.15/103-kbuild-export-SUBARCH.patch
    
    All other patches automatically rebased.
    
    Build system: x86_64
    Build-tested: bcm2711/RPi4B, filogic/xiaomi_redmi-router-ax6000-ubootmod
    Run-tested: bcm2711/RPi4B, filogic/xiaomi_redmi-router-ax6000-ubootmod
    
    Signed-off-by: John Audia <therealgraysky at proton.me>
---
 include/kernel-5.15                                |   4 +-
 ...dev-Completely-disable-the-spidev-warning.patch |   2 +-
 ...-device-quirks-for-Freeway-Airmouse-T3-an.patch |   4 +-
 ...i-spidev-Restore-loading-from-Device-Tree.patch |   2 +-
 ...1-Kbuild-use-Wdeclaration-after-statement.patch |   4 +-
 .../005-v5.17-02-Kbuild-move-to-std-gnu11.patch    |   2 +-
 ...build-use-std-gnu11-for-KBUILD_USERCFLAGS.patch |   4 +-
 ...5-mm-multigenerational-lru-mm_struct-list.patch |   2 +-
 ...t-stmicro-stmmac-move-queue-reset-to-dedi.patch |  16 +-
 ...t-stmicro-stmmac-first-disable-all-queues.patch |   4 +-
 ...t-stmicro-stmmac-move-dma-conf-to-dedicat.patch | 194 ++++++++++-----------
 ...t-stmicro-stmmac-generate-stmmac-dma-conf.patch | 114 ++++++------
 ...t-stmicro-stmmac-permit-MTU-change-with-i.patch |   4 +-
 .../pending-5.15/103-kbuild-export-SUBARCH.patch   |   6 +-
 ...Add-Silicon-Labs-EM3581-device-compatible.patch |   4 +-
 ...Add-Silicon-Labs-SI3210-device-compatible.patch |   4 +-
 .../613-netfilter_optional_tcp_window_check.patch  |   4 +-
 ...jecting-with-source-address-failed-policy.patch |   2 +-
 ...pufreq-qcom-nvmem-add-support-for-IPQ8074.patch |   2 +-
 ...support-hardware-assisted-indirect-access.patch |  22 +--
 20 files changed, 200 insertions(+), 200 deletions(-)

diff --git a/include/kernel-5.15 b/include/kernel-5.15
index ab1500f4b2..1d1c654c2c 100644
--- a/include/kernel-5.15
+++ b/include/kernel-5.15
@@ -1,2 +1,2 @@
-LINUX_VERSION-5.15 = .90
-LINUX_KERNEL_HASH-5.15.90 = e6fd430022686753af7516fe7544f96aab379509dc5b7829017bdcd92b393b42
+LINUX_VERSION-5.15 = .91
+LINUX_KERNEL_HASH-5.15.91 = a63c2bb1beb15f1aea9c63cf80559f5b7ab58afd2da2fa5e7670c515ebe1fe80
diff --git a/target/linux/bcm27xx/patches-5.15/950-0040-spi-spidev-Completely-disable-the-spidev-warning.patch b/target/linux/bcm27xx/patches-5.15/950-0040-spi-spidev-Completely-disable-the-spidev-warning.patch
index ff9a6b09a2..8fa7c55aa6 100644
--- a/target/linux/bcm27xx/patches-5.15/950-0040-spi-spidev-Completely-disable-the-spidev-warning.patch
+++ b/target/linux/bcm27xx/patches-5.15/950-0040-spi-spidev-Completely-disable-the-spidev-warning.patch
@@ -13,7 +13,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 
 --- a/drivers/spi/spidev.c
 +++ b/drivers/spi/spidev.c
-@@ -761,7 +761,7 @@ static int spidev_probe(struct spi_devic
+@@ -759,7 +759,7 @@ static int spidev_probe(struct spi_devic
  	 * compatible string, it is a Linux implementation thing
  	 * rather than a description of the hardware.
  	 */
diff --git a/target/linux/bcm27xx/patches-5.15/950-0163-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch b/target/linux/bcm27xx/patches-5.15/950-0163-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch
index 5ba0077445..3cd85fe657 100644
--- a/target/linux/bcm27xx/patches-5.15/950-0163-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch
+++ b/target/linux/bcm27xx/patches-5.15/950-0163-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
  
-@@ -1316,6 +1319,9 @@
+@@ -1315,6 +1318,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 },
-@@ -198,6 +199,7 @@ static const struct hid_device_id hid_qu
+@@ -197,6 +198,7 @@ static const struct hid_device_id hid_qu
  	{ 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 },
  	{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_GROUP_AUDIO), HID_QUIRK_NOGET },
diff --git a/target/linux/bcm27xx/patches-5.15/950-0578-spi-spidev-Restore-loading-from-Device-Tree.patch b/target/linux/bcm27xx/patches-5.15/950-0578-spi-spidev-Restore-loading-from-Device-Tree.patch
index 1fb800fee2..e3856fa117 100644
--- a/target/linux/bcm27xx/patches-5.15/950-0578-spi-spidev-Restore-loading-from-Device-Tree.patch
+++ b/target/linux/bcm27xx/patches-5.15/950-0578-spi-spidev-Restore-loading-from-Device-Tree.patch
@@ -15,7 +15,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.com>
 
 --- a/drivers/spi/spidev.c
 +++ b/drivers/spi/spidev.c
-@@ -680,6 +680,7 @@ static const struct file_operations spid
+@@ -678,6 +678,7 @@ static const struct file_operations spid
  static struct class *spidev_class;
  
  static const struct spi_device_id spidev_spi_ids[] = {
diff --git a/target/linux/generic/backport-5.15/005-v5.17-01-Kbuild-use-Wdeclaration-after-statement.patch b/target/linux/generic/backport-5.15/005-v5.17-01-Kbuild-use-Wdeclaration-after-statement.patch
index ff4c6d7041..092addcd5d 100644
--- a/target/linux/generic/backport-5.15/005-v5.17-01-Kbuild-use-Wdeclaration-after-statement.patch
+++ b/target/linux/generic/backport-5.15/005-v5.17-01-Kbuild-use-Wdeclaration-after-statement.patch
@@ -37,8 +37,8 @@ Signed-off-by: Masahiro Yamada <masahiroy at kernel.org>
 
 --- a/Makefile
 +++ b/Makefile
-@@ -432,7 +432,8 @@ HOSTCXX	= g++
- endif
+@@ -433,7 +433,8 @@ endif
+ HOSTPKG_CONFIG	= pkg-config
  
  export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \
 -			      -O2 -fomit-frame-pointer -std=gnu89
diff --git a/target/linux/generic/backport-5.15/005-v5.17-02-Kbuild-move-to-std-gnu11.patch b/target/linux/generic/backport-5.15/005-v5.17-02-Kbuild-move-to-std-gnu11.patch
index d22eefb773..3bcf480cb2 100644
--- a/target/linux/generic/backport-5.15/005-v5.17-02-Kbuild-move-to-std-gnu11.patch
+++ b/target/linux/generic/backport-5.15/005-v5.17-02-Kbuild-move-to-std-gnu11.patch
@@ -49,7 +49,7 @@ Signed-off-by: Masahiro Yamada <masahiroy at kernel.org>
 
 --- a/Makefile
 +++ b/Makefile
-@@ -516,7 +516,7 @@ KBUILD_CFLAGS   := -Wall -Wundef -Werror
+@@ -517,7 +517,7 @@ KBUILD_CFLAGS   := -Wall -Wundef -Werror
  		   -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
  		   -Werror=implicit-function-declaration -Werror=implicit-int \
  		   -Werror=return-type -Wno-format-security \
diff --git a/target/linux/generic/backport-5.15/005-v5.17-03-Kbuild-use-std-gnu11-for-KBUILD_USERCFLAGS.patch b/target/linux/generic/backport-5.15/005-v5.17-03-Kbuild-use-std-gnu11-for-KBUILD_USERCFLAGS.patch
index 198c9e671a..91121b7bac 100644
--- a/target/linux/generic/backport-5.15/005-v5.17-03-Kbuild-use-std-gnu11-for-KBUILD_USERCFLAGS.patch
+++ b/target/linux/generic/backport-5.15/005-v5.17-03-Kbuild-use-std-gnu11-for-KBUILD_USERCFLAGS.patch
@@ -32,8 +32,8 @@ Signed-off-by: Masahiro Yamada <masahiroy at kernel.org>
 
 --- a/Makefile
 +++ b/Makefile
-@@ -432,7 +432,7 @@ HOSTCXX	= g++
- endif
+@@ -433,7 +433,7 @@ endif
+ HOSTPKG_CONFIG	= pkg-config
  
  export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \
 -			      -O2 -fomit-frame-pointer -std=gnu89 \
diff --git a/target/linux/generic/backport-5.15/020-v6.1-05-mm-multigenerational-lru-mm_struct-list.patch b/target/linux/generic/backport-5.15/020-v6.1-05-mm-multigenerational-lru-mm_struct-list.patch
index 5b5cbe721e..833d3f97f4 100644
--- a/target/linux/generic/backport-5.15/020-v6.1-05-mm-multigenerational-lru-mm_struct-list.patch
+++ b/target/linux/generic/backport-5.15/020-v6.1-05-mm-multigenerational-lru-mm_struct-list.patch
@@ -287,7 +287,7 @@ Change-Id: I25d9eda8c6bdc7c3653b9f210a159d6c247c81e8
  	struct pglist_data *pgdat;
 --- a/kernel/exit.c
 +++ b/kernel/exit.c
-@@ -422,6 +422,7 @@ assign_new_owner:
+@@ -469,6 +469,7 @@ assign_new_owner:
  		goto retry;
  	}
  	WRITE_ONCE(mm->owner, c);
diff --git a/target/linux/generic/backport-5.15/775-v6.0-01-net-ethernet-stmicro-stmmac-move-queue-reset-to-dedi.patch b/target/linux/generic/backport-5.15/775-v6.0-01-net-ethernet-stmicro-stmmac-move-queue-reset-to-dedi.patch
index 521bad896a..92e08bb4e3 100644
--- a/target/linux/generic/backport-5.15/775-v6.0-01-net-ethernet-stmicro-stmmac-move-queue-reset-to-dedi.patch
+++ b/target/linux/generic/backport-5.15/775-v6.0-01-net-ethernet-stmicro-stmmac-move-queue-reset-to-dedi.patch
@@ -27,7 +27,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  static void stmmac_tx_timer_arm(struct stmmac_priv *priv, u32 queue);
  static void stmmac_flush_tx_descriptors(struct stmmac_priv *priv, int queue);
  
-@@ -1705,9 +1708,6 @@ static int __init_dma_rx_desc_rings(stru
+@@ -1710,9 +1713,6 @@ static int __init_dma_rx_desc_rings(stru
  			return -ENOMEM;
  	}
  
@@ -37,7 +37,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	/* Setup the chained descriptor addresses */
  	if (priv->mode == STMMAC_CHAIN_MODE) {
  		if (priv->extend_desc)
-@@ -1813,12 +1813,6 @@ static int __init_dma_tx_desc_rings(stru
+@@ -1818,12 +1818,6 @@ static int __init_dma_tx_desc_rings(stru
  		tx_q->tx_skbuff[i] = NULL;
  	}
  
@@ -50,7 +50,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	return 0;
  }
  
-@@ -2687,10 +2681,7 @@ static void stmmac_tx_err(struct stmmac_
+@@ -2692,10 +2686,7 @@ static void stmmac_tx_err(struct stmmac_
  	stmmac_stop_tx_dma(priv, chan);
  	dma_free_tx_skbufs(priv, chan);
  	stmmac_clear_tx_descriptors(priv, chan);
@@ -62,7 +62,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
  			    tx_q->dma_tx_phy, chan);
  	stmmac_start_tx_dma(priv, chan);
-@@ -3774,6 +3765,8 @@ static int stmmac_open(struct net_device
+@@ -3779,6 +3770,8 @@ static int stmmac_open(struct net_device
  		}
  	}
  
@@ -71,7 +71,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	ret = stmmac_hw_setup(dev, true);
  	if (ret < 0) {
  		netdev_err(priv->dev, "%s: Hw setup failed\n", __func__);
-@@ -6417,6 +6410,7 @@ void stmmac_enable_rx_queue(struct stmma
+@@ -6422,6 +6415,7 @@ void stmmac_enable_rx_queue(struct stmma
  		return;
  	}
  
@@ -79,7 +79,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	stmmac_clear_rx_descriptors(priv, queue);
  
  	stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
-@@ -6478,6 +6472,7 @@ void stmmac_enable_tx_queue(struct stmma
+@@ -6483,6 +6477,7 @@ void stmmac_enable_tx_queue(struct stmma
  		return;
  	}
  
@@ -87,7 +87,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	stmmac_clear_tx_descriptors(priv, queue);
  
  	stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
-@@ -7400,6 +7395,25 @@ int stmmac_suspend(struct device *dev)
+@@ -7405,6 +7400,25 @@ int stmmac_suspend(struct device *dev)
  }
  EXPORT_SYMBOL_GPL(stmmac_suspend);
  
@@ -113,7 +113,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  /**
   * stmmac_reset_queues_param - reset queue parameters
   * @priv: device pointer
-@@ -7410,22 +7424,11 @@ static void stmmac_reset_queues_param(st
+@@ -7415,22 +7429,11 @@ static void stmmac_reset_queues_param(st
  	u32 tx_cnt = priv->plat->tx_queues_to_use;
  	u32 queue;
  
diff --git a/target/linux/generic/backport-5.15/775-v6.0-02-net-ethernet-stmicro-stmmac-first-disable-all-queues.patch b/target/linux/generic/backport-5.15/775-v6.0-02-net-ethernet-stmicro-stmmac-first-disable-all-queues.patch
index ee3b92f06b..e3c15061b8 100644
--- a/target/linux/generic/backport-5.15/775-v6.0-02-net-ethernet-stmicro-stmmac-first-disable-all-queues.patch
+++ b/target/linux/generic/backport-5.15/775-v6.0-02-net-ethernet-stmicro-stmmac-first-disable-all-queues.patch
@@ -17,7 +17,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
 +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
-@@ -3826,8 +3826,6 @@ static int stmmac_release(struct net_dev
+@@ -3831,8 +3831,6 @@ static int stmmac_release(struct net_dev
  	struct stmmac_priv *priv = netdev_priv(dev);
  	u32 chan;
  
@@ -26,7 +26,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	if (device_may_wakeup(priv->device))
  		phylink_speed_down(priv->phylink, false);
  	/* Stop and disconnect the PHY */
-@@ -3839,6 +3837,8 @@ static int stmmac_release(struct net_dev
+@@ -3844,6 +3842,8 @@ static int stmmac_release(struct net_dev
  	for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
  		hrtimer_cancel(&priv->tx_queue[chan].txtimer);
  
diff --git a/target/linux/generic/backport-5.15/775-v6.0-03-net-ethernet-stmicro-stmmac-move-dma-conf-to-dedicat.patch b/target/linux/generic/backport-5.15/775-v6.0-03-net-ethernet-stmicro-stmmac-move-dma-conf-to-dedicat.patch
index e65d8b1960..3903eb0565 100644
--- a/target/linux/generic/backport-5.15/775-v6.0-03-net-ethernet-stmicro-stmmac-move-dma-conf-to-dedicat.patch
+++ b/target/linux/generic/backport-5.15/775-v6.0-03-net-ethernet-stmicro-stmmac-move-dma-conf-to-dedicat.patch
@@ -189,7 +189,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  		if (tx_q->dirty_tx != tx_q->cur_tx)
  			return -EBUSY; /* still unfinished work */
-@@ -1302,7 +1302,7 @@ static void stmmac_display_rx_rings(stru
+@@ -1307,7 +1307,7 @@ static void stmmac_display_rx_rings(stru
  
  	/* Display RX rings */
  	for (queue = 0; queue < rx_cnt; queue++) {
@@ -198,7 +198,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  		pr_info("\tRX Queue %u rings\n", queue);
  
-@@ -1315,7 +1315,7 @@ static void stmmac_display_rx_rings(stru
+@@ -1320,7 +1320,7 @@ static void stmmac_display_rx_rings(stru
  		}
  
  		/* Display RX ring */
@@ -207,7 +207,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  				    rx_q->dma_rx_phy, desc_size);
  	}
  }
-@@ -1329,7 +1329,7 @@ static void stmmac_display_tx_rings(stru
+@@ -1334,7 +1334,7 @@ static void stmmac_display_tx_rings(stru
  
  	/* Display TX rings */
  	for (queue = 0; queue < tx_cnt; queue++) {
@@ -216,7 +216,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  		pr_info("\tTX Queue %d rings\n", queue);
  
-@@ -1344,7 +1344,7 @@ static void stmmac_display_tx_rings(stru
+@@ -1349,7 +1349,7 @@ static void stmmac_display_tx_rings(stru
  			desc_size = sizeof(struct dma_desc);
  		}
  
@@ -225,7 +225,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  				    tx_q->dma_tx_phy, desc_size);
  	}
  }
-@@ -1385,21 +1385,21 @@ static int stmmac_set_bfsize(int mtu, in
+@@ -1390,21 +1390,21 @@ static int stmmac_set_bfsize(int mtu, in
   */
  static void stmmac_clear_rx_descriptors(struct stmmac_priv *priv, u32 queue)
  {
@@ -253,7 +253,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  }
  
  /**
-@@ -1411,12 +1411,12 @@ static void stmmac_clear_rx_descriptors(
+@@ -1416,12 +1416,12 @@ static void stmmac_clear_rx_descriptors(
   */
  static void stmmac_clear_tx_descriptors(struct stmmac_priv *priv, u32 queue)
  {
@@ -269,7 +269,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		struct dma_desc *p;
  
  		if (priv->extend_desc)
-@@ -1464,7 +1464,7 @@ static void stmmac_clear_descriptors(str
+@@ -1469,7 +1469,7 @@ static void stmmac_clear_descriptors(str
  static int stmmac_init_rx_buffers(struct stmmac_priv *priv, struct dma_desc *p,
  				  int i, gfp_t flags, u32 queue)
  {
@@ -278,7 +278,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
  
  	if (!buf->page) {
-@@ -1489,7 +1489,7 @@ static int stmmac_init_rx_buffers(struct
+@@ -1494,7 +1494,7 @@ static int stmmac_init_rx_buffers(struct
  	buf->addr = page_pool_get_dma_addr(buf->page) + buf->page_offset;
  
  	stmmac_set_desc_addr(priv, p, buf->addr);
@@ -287,7 +287,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		stmmac_init_desc3(priv, p);
  
  	return 0;
-@@ -1503,7 +1503,7 @@ static int stmmac_init_rx_buffers(struct
+@@ -1508,7 +1508,7 @@ static int stmmac_init_rx_buffers(struct
   */
  static void stmmac_free_rx_buffer(struct stmmac_priv *priv, u32 queue, int i)
  {
@@ -296,7 +296,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
  
  	if (buf->page)
-@@ -1523,7 +1523,7 @@ static void stmmac_free_rx_buffer(struct
+@@ -1528,7 +1528,7 @@ static void stmmac_free_rx_buffer(struct
   */
  static void stmmac_free_tx_buffer(struct stmmac_priv *priv, u32 queue, int i)
  {
@@ -305,7 +305,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	if (tx_q->tx_skbuff_dma[i].buf &&
  	    tx_q->tx_skbuff_dma[i].buf_type != STMMAC_TXBUF_T_XDP_TX) {
-@@ -1568,17 +1568,17 @@ static void dma_free_rx_skbufs(struct st
+@@ -1573,17 +1573,17 @@ static void dma_free_rx_skbufs(struct st
  {
  	int i;
  
@@ -326,7 +326,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		struct dma_desc *p;
  		int ret;
  
-@@ -1605,10 +1605,10 @@ static int stmmac_alloc_rx_buffers(struc
+@@ -1610,10 +1610,10 @@ static int stmmac_alloc_rx_buffers(struc
   */
  static void dma_free_rx_xskbufs(struct stmmac_priv *priv, u32 queue)
  {
@@ -339,7 +339,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
  
  		if (!buf->xdp)
-@@ -1621,10 +1621,10 @@ static void dma_free_rx_xskbufs(struct s
+@@ -1626,10 +1626,10 @@ static void dma_free_rx_xskbufs(struct s
  
  static int stmmac_alloc_rx_buffers_zc(struct stmmac_priv *priv, u32 queue)
  {
@@ -352,7 +352,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		struct stmmac_rx_buffer *buf;
  		dma_addr_t dma_addr;
  		struct dma_desc *p;
-@@ -1667,7 +1667,7 @@ static struct xsk_buff_pool *stmmac_get_
+@@ -1672,7 +1672,7 @@ static struct xsk_buff_pool *stmmac_get_
   */
  static int __init_dma_rx_desc_rings(struct stmmac_priv *priv, u32 queue, gfp_t flags)
  {
@@ -361,7 +361,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	int ret;
  
  	netif_dbg(priv, probe, priv->dev,
-@@ -1713,11 +1713,11 @@ static int __init_dma_rx_desc_rings(stru
+@@ -1718,11 +1718,11 @@ static int __init_dma_rx_desc_rings(stru
  		if (priv->extend_desc)
  			stmmac_mode_init(priv, rx_q->dma_erx,
  					 rx_q->dma_rx_phy,
@@ -375,7 +375,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	}
  
  	return 0;
-@@ -1744,7 +1744,7 @@ static int init_dma_rx_desc_rings(struct
+@@ -1749,7 +1749,7 @@ static int init_dma_rx_desc_rings(struct
  
  err_init_rx_buffers:
  	while (queue >= 0) {
@@ -384,7 +384,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  		if (rx_q->xsk_pool)
  			dma_free_rx_xskbufs(priv, queue);
-@@ -1773,7 +1773,7 @@ err_init_rx_buffers:
+@@ -1778,7 +1778,7 @@ err_init_rx_buffers:
   */
  static int __init_dma_tx_desc_rings(struct stmmac_priv *priv, u32 queue)
  {
@@ -393,7 +393,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	int i;
  
  	netif_dbg(priv, probe, priv->dev,
-@@ -1785,16 +1785,16 @@ static int __init_dma_tx_desc_rings(stru
+@@ -1790,16 +1790,16 @@ static int __init_dma_tx_desc_rings(stru
  		if (priv->extend_desc)
  			stmmac_mode_init(priv, tx_q->dma_etx,
  					 tx_q->dma_tx_phy,
@@ -413,7 +413,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		struct dma_desc *p;
  
  		if (priv->extend_desc)
-@@ -1864,12 +1864,12 @@ static int init_dma_desc_rings(struct ne
+@@ -1869,12 +1869,12 @@ static int init_dma_desc_rings(struct ne
   */
  static void dma_free_tx_skbufs(struct stmmac_priv *priv, u32 queue)
  {
@@ -428,7 +428,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		stmmac_free_tx_buffer(priv, queue, i);
  
  	if (tx_q->xsk_pool && tx_q->xsk_frames_done) {
-@@ -1899,7 +1899,7 @@ static void stmmac_free_tx_skbufs(struct
+@@ -1904,7 +1904,7 @@ static void stmmac_free_tx_skbufs(struct
   */
  static void __free_dma_rx_desc_resources(struct stmmac_priv *priv, u32 queue)
  {
@@ -437,7 +437,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	/* Release the DMA RX socket buffers */
  	if (rx_q->xsk_pool)
-@@ -1912,11 +1912,11 @@ static void __free_dma_rx_desc_resources
+@@ -1917,11 +1917,11 @@ static void __free_dma_rx_desc_resources
  
  	/* Free DMA regions of consistent memory previously allocated */
  	if (!priv->extend_desc)
@@ -451,7 +451,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  				  sizeof(struct dma_extended_desc),
  				  rx_q->dma_erx, rx_q->dma_rx_phy);
  
-@@ -1945,7 +1945,7 @@ static void free_dma_rx_desc_resources(s
+@@ -1950,7 +1950,7 @@ static void free_dma_rx_desc_resources(s
   */
  static void __free_dma_tx_desc_resources(struct stmmac_priv *priv, u32 queue)
  {
@@ -460,7 +460,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	size_t size;
  	void *addr;
  
-@@ -1963,7 +1963,7 @@ static void __free_dma_tx_desc_resources
+@@ -1968,7 +1968,7 @@ static void __free_dma_tx_desc_resources
  		addr = tx_q->dma_tx;
  	}
  
@@ -469,7 +469,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	dma_free_coherent(priv->device, size, addr, tx_q->dma_tx_phy);
  
-@@ -1992,7 +1992,7 @@ static void free_dma_tx_desc_resources(s
+@@ -1997,7 +1997,7 @@ static void free_dma_tx_desc_resources(s
   */
  static int __alloc_dma_rx_desc_resources(struct stmmac_priv *priv, u32 queue)
  {
@@ -478,7 +478,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	struct stmmac_channel *ch = &priv->channel[queue];
  	bool xdp_prog = stmmac_xdp_is_enabled(priv);
  	struct page_pool_params pp_params = { 0 };
-@@ -2004,8 +2004,8 @@ static int __alloc_dma_rx_desc_resources
+@@ -2009,8 +2009,8 @@ static int __alloc_dma_rx_desc_resources
  	rx_q->priv_data = priv;
  
  	pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV;
@@ -489,7 +489,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	pp_params.order = ilog2(num_pages);
  	pp_params.nid = dev_to_node(priv->device);
  	pp_params.dev = priv->device;
-@@ -2020,7 +2020,7 @@ static int __alloc_dma_rx_desc_resources
+@@ -2025,7 +2025,7 @@ static int __alloc_dma_rx_desc_resources
  		return ret;
  	}
  
@@ -498,7 +498,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  				 sizeof(*rx_q->buf_pool),
  				 GFP_KERNEL);
  	if (!rx_q->buf_pool)
-@@ -2028,7 +2028,7 @@ static int __alloc_dma_rx_desc_resources
+@@ -2033,7 +2033,7 @@ static int __alloc_dma_rx_desc_resources
  
  	if (priv->extend_desc) {
  		rx_q->dma_erx = dma_alloc_coherent(priv->device,
@@ -507,7 +507,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  						   sizeof(struct dma_extended_desc),
  						   &rx_q->dma_rx_phy,
  						   GFP_KERNEL);
-@@ -2037,7 +2037,7 @@ static int __alloc_dma_rx_desc_resources
+@@ -2042,7 +2042,7 @@ static int __alloc_dma_rx_desc_resources
  
  	} else {
  		rx_q->dma_rx = dma_alloc_coherent(priv->device,
@@ -516,7 +516,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  						  sizeof(struct dma_desc),
  						  &rx_q->dma_rx_phy,
  						  GFP_KERNEL);
-@@ -2094,20 +2094,20 @@ err_dma:
+@@ -2099,20 +2099,20 @@ err_dma:
   */
  static int __alloc_dma_tx_desc_resources(struct stmmac_priv *priv, u32 queue)
  {
@@ -540,7 +540,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  				  sizeof(struct sk_buff *),
  				  GFP_KERNEL);
  	if (!tx_q->tx_skbuff)
-@@ -2120,7 +2120,7 @@ static int __alloc_dma_tx_desc_resources
+@@ -2125,7 +2125,7 @@ static int __alloc_dma_tx_desc_resources
  	else
  		size = sizeof(struct dma_desc);
  
@@ -549,7 +549,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	addr = dma_alloc_coherent(priv->device, size,
  				  &tx_q->dma_tx_phy, GFP_KERNEL);
-@@ -2364,7 +2364,7 @@ static void stmmac_dma_operation_mode(st
+@@ -2369,7 +2369,7 @@ static void stmmac_dma_operation_mode(st
  
  	/* configure all channels */
  	for (chan = 0; chan < rx_channels_count; chan++) {
@@ -558,7 +558,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		u32 buf_size;
  
  		qmode = priv->plat->rx_queues_cfg[chan].mode_to_use;
-@@ -2379,7 +2379,7 @@ static void stmmac_dma_operation_mode(st
+@@ -2384,7 +2384,7 @@ static void stmmac_dma_operation_mode(st
  					      chan);
  		} else {
  			stmmac_set_dma_bfsize(priv, priv->ioaddr,
@@ -567,7 +567,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  					      chan);
  		}
  	}
-@@ -2395,7 +2395,7 @@ static void stmmac_dma_operation_mode(st
+@@ -2400,7 +2400,7 @@ static void stmmac_dma_operation_mode(st
  static bool stmmac_xdp_xmit_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
  {
  	struct netdev_queue *nq = netdev_get_tx_queue(priv->dev, queue);
@@ -576,7 +576,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	struct xsk_buff_pool *pool = tx_q->xsk_pool;
  	unsigned int entry = tx_q->cur_tx;
  	struct dma_desc *tx_desc = NULL;
-@@ -2470,7 +2470,7 @@ static bool stmmac_xdp_xmit_zc(struct st
+@@ -2475,7 +2475,7 @@ static bool stmmac_xdp_xmit_zc(struct st
  
  		stmmac_enable_dma_transmission(priv, priv->ioaddr);
  
@@ -585,7 +585,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		entry = tx_q->cur_tx;
  	}
  
-@@ -2496,7 +2496,7 @@ static bool stmmac_xdp_xmit_zc(struct st
+@@ -2501,7 +2501,7 @@ static bool stmmac_xdp_xmit_zc(struct st
   */
  static int stmmac_tx_clean(struct stmmac_priv *priv, int budget, u32 queue)
  {
@@ -594,7 +594,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	unsigned int bytes_compl = 0, pkts_compl = 0;
  	unsigned int entry, xmits = 0, count = 0;
  
-@@ -2509,7 +2509,7 @@ static int stmmac_tx_clean(struct stmmac
+@@ -2514,7 +2514,7 @@ static int stmmac_tx_clean(struct stmmac
  	entry = tx_q->dirty_tx;
  
  	/* Try to clean all TX complete frame in 1 shot */
@@ -603,7 +603,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		struct xdp_frame *xdpf;
  		struct sk_buff *skb;
  		struct dma_desc *p;
-@@ -2609,7 +2609,7 @@ static int stmmac_tx_clean(struct stmmac
+@@ -2614,7 +2614,7 @@ static int stmmac_tx_clean(struct stmmac
  
  		stmmac_release_tx_desc(priv, p, priv->mode);
  
@@ -612,7 +612,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	}
  	tx_q->dirty_tx = entry;
  
-@@ -2674,7 +2674,7 @@ static int stmmac_tx_clean(struct stmmac
+@@ -2679,7 +2679,7 @@ static int stmmac_tx_clean(struct stmmac
   */
  static void stmmac_tx_err(struct stmmac_priv *priv, u32 chan)
  {
@@ -621,7 +621,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, chan));
  
-@@ -2741,8 +2741,8 @@ static int stmmac_napi_check(struct stmm
+@@ -2746,8 +2746,8 @@ static int stmmac_napi_check(struct stmm
  {
  	int status = stmmac_dma_interrupt_status(priv, priv->ioaddr,
  						 &priv->xstats, chan, dir);
@@ -632,7 +632,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	struct stmmac_channel *ch = &priv->channel[chan];
  	struct napi_struct *rx_napi;
  	struct napi_struct *tx_napi;
-@@ -2918,7 +2918,7 @@ static int stmmac_init_dma_engine(struct
+@@ -2923,7 +2923,7 @@ static int stmmac_init_dma_engine(struct
  
  	/* DMA RX Channel Configuration */
  	for (chan = 0; chan < rx_channels_count; chan++) {
@@ -641,7 +641,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  		stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
  				    rx_q->dma_rx_phy, chan);
-@@ -2932,7 +2932,7 @@ static int stmmac_init_dma_engine(struct
+@@ -2937,7 +2937,7 @@ static int stmmac_init_dma_engine(struct
  
  	/* DMA TX Channel Configuration */
  	for (chan = 0; chan < tx_channels_count; chan++) {
@@ -650,7 +650,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  		stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
  				    tx_q->dma_tx_phy, chan);
-@@ -2947,7 +2947,7 @@ static int stmmac_init_dma_engine(struct
+@@ -2952,7 +2952,7 @@ static int stmmac_init_dma_engine(struct
  
  static void stmmac_tx_timer_arm(struct stmmac_priv *priv, u32 queue)
  {
@@ -659,7 +659,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	hrtimer_start(&tx_q->txtimer,
  		      STMMAC_COAL_TIMER(priv->tx_coal_timer[queue]),
-@@ -2997,7 +2997,7 @@ static void stmmac_init_coalesce(struct
+@@ -3002,7 +3002,7 @@ static void stmmac_init_coalesce(struct
  	u32 chan;
  
  	for (chan = 0; chan < tx_channel_count; chan++) {
@@ -668,7 +668,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  		priv->tx_coal_frames[chan] = STMMAC_TX_FRAMES;
  		priv->tx_coal_timer[chan] = STMMAC_COAL_TX_TIMER;
-@@ -3019,12 +3019,12 @@ static void stmmac_set_rings_length(stru
+@@ -3024,12 +3024,12 @@ static void stmmac_set_rings_length(stru
  	/* set TX ring length */
  	for (chan = 0; chan < tx_channels_count; chan++)
  		stmmac_set_tx_ring_len(priv, priv->ioaddr,
@@ -683,7 +683,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  }
  
  /**
-@@ -3359,7 +3359,7 @@ static int stmmac_hw_setup(struct net_de
+@@ -3364,7 +3364,7 @@ static int stmmac_hw_setup(struct net_de
  	/* Enable TSO */
  	if (priv->tso) {
  		for (chan = 0; chan < tx_cnt; chan++) {
@@ -692,7 +692,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  			/* TSO and TBS cannot co-exist */
  			if (tx_q->tbs & STMMAC_TBS_AVAIL)
-@@ -3381,7 +3381,7 @@ static int stmmac_hw_setup(struct net_de
+@@ -3386,7 +3386,7 @@ static int stmmac_hw_setup(struct net_de
  
  	/* TBS */
  	for (chan = 0; chan < tx_cnt; chan++) {
@@ -701,7 +701,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		int enable = tx_q->tbs & STMMAC_TBS_AVAIL;
  
  		stmmac_enable_tbs(priv, priv->ioaddr, enable, chan);
-@@ -3425,7 +3425,7 @@ static void stmmac_free_irq(struct net_d
+@@ -3430,7 +3430,7 @@ static void stmmac_free_irq(struct net_d
  		for (j = irq_idx - 1; j >= 0; j--) {
  			if (priv->tx_irq[j] > 0) {
  				irq_set_affinity_hint(priv->tx_irq[j], NULL);
@@ -710,7 +710,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  			}
  		}
  		irq_idx = priv->plat->rx_queues_to_use;
-@@ -3434,7 +3434,7 @@ static void stmmac_free_irq(struct net_d
+@@ -3439,7 +3439,7 @@ static void stmmac_free_irq(struct net_d
  		for (j = irq_idx - 1; j >= 0; j--) {
  			if (priv->rx_irq[j] > 0) {
  				irq_set_affinity_hint(priv->rx_irq[j], NULL);
@@ -719,7 +719,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  			}
  		}
  
-@@ -3567,7 +3567,7 @@ static int stmmac_request_irq_multi_msi(
+@@ -3572,7 +3572,7 @@ static int stmmac_request_irq_multi_msi(
  		sprintf(int_name, "%s:%s-%d", dev->name, "rx", i);
  		ret = request_irq(priv->rx_irq[i],
  				  stmmac_msi_intr_rx,
@@ -728,7 +728,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		if (unlikely(ret < 0)) {
  			netdev_err(priv->dev,
  				   "%s: alloc rx-%d  MSI %d (error: %d)\n",
-@@ -3590,7 +3590,7 @@ static int stmmac_request_irq_multi_msi(
+@@ -3595,7 +3595,7 @@ static int stmmac_request_irq_multi_msi(
  		sprintf(int_name, "%s:%s-%d", dev->name, "tx", i);
  		ret = request_irq(priv->tx_irq[i],
  				  stmmac_msi_intr_tx,
@@ -737,7 +737,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		if (unlikely(ret < 0)) {
  			netdev_err(priv->dev,
  				   "%s: alloc tx-%d  MSI %d (error: %d)\n",
-@@ -3721,21 +3721,21 @@ static int stmmac_open(struct net_device
+@@ -3726,21 +3726,21 @@ static int stmmac_open(struct net_device
  		bfsize = 0;
  
  	if (bfsize < BUF_SIZE_16KiB)
@@ -766,7 +766,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		int tbs_en = priv->plat->tx_queues_cfg[chan].tbs_en;
  
  		/* Setup per-TXQ tbs flag before TX descriptor alloc */
-@@ -3793,7 +3793,7 @@ irq_error:
+@@ -3798,7 +3798,7 @@ irq_error:
  	phylink_stop(priv->phylink);
  
  	for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
@@ -775,7 +775,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	stmmac_hw_teardown(dev);
  init_error:
-@@ -3835,7 +3835,7 @@ static int stmmac_release(struct net_dev
+@@ -3840,7 +3840,7 @@ static int stmmac_release(struct net_dev
  	stmmac_disable_all_queues(priv);
  
  	for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
@@ -784,7 +784,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	netif_tx_disable(dev);
  
-@@ -3899,7 +3899,7 @@ static bool stmmac_vlan_insert(struct st
+@@ -3904,7 +3904,7 @@ static bool stmmac_vlan_insert(struct st
  		return false;
  
  	stmmac_set_tx_owner(priv, p);
@@ -793,7 +793,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	return true;
  }
  
-@@ -3917,7 +3917,7 @@ static bool stmmac_vlan_insert(struct st
+@@ -3922,7 +3922,7 @@ static bool stmmac_vlan_insert(struct st
  static void stmmac_tso_allocator(struct stmmac_priv *priv, dma_addr_t des,
  				 int total_len, bool last_segment, u32 queue)
  {
@@ -802,7 +802,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	struct dma_desc *desc;
  	u32 buff_size;
  	int tmp_len;
-@@ -3928,7 +3928,7 @@ static void stmmac_tso_allocator(struct
+@@ -3933,7 +3933,7 @@ static void stmmac_tso_allocator(struct
  		dma_addr_t curr_addr;
  
  		tx_q->cur_tx = STMMAC_GET_ENTRY(tx_q->cur_tx,
@@ -811,7 +811,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		WARN_ON(tx_q->tx_skbuff[tx_q->cur_tx]);
  
  		if (tx_q->tbs & STMMAC_TBS_AVAIL)
-@@ -3956,7 +3956,7 @@ static void stmmac_tso_allocator(struct
+@@ -3961,7 +3961,7 @@ static void stmmac_tso_allocator(struct
  
  static void stmmac_flush_tx_descriptors(struct stmmac_priv *priv, int queue)
  {
@@ -820,7 +820,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	int desc_size;
  
  	if (likely(priv->extend_desc))
-@@ -4018,7 +4018,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -4023,7 +4023,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
  	dma_addr_t des;
  	int i;
  
@@ -829,7 +829,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	first_tx = tx_q->cur_tx;
  
  	/* Compute header lengths */
-@@ -4058,7 +4058,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -4063,7 +4063,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
  		stmmac_set_mss(priv, mss_desc, mss);
  		tx_q->mss = mss;
  		tx_q->cur_tx = STMMAC_GET_ENTRY(tx_q->cur_tx,
@@ -838,7 +838,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		WARN_ON(tx_q->tx_skbuff[tx_q->cur_tx]);
  	}
  
-@@ -4170,7 +4170,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
+@@ -4175,7 +4175,7 @@ static netdev_tx_t stmmac_tso_xmit(struc
  	 * ndo_start_xmit will fill this descriptor the next time it's
  	 * called and stmmac_tx_clean may clean up to this descriptor.
  	 */
@@ -847,7 +847,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	if (unlikely(stmmac_tx_avail(priv, queue) <= (MAX_SKB_FRAGS + 1))) {
  		netif_dbg(priv, hw, priv->dev, "%s: stop transmitted packets\n",
-@@ -4258,7 +4258,7 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -4263,7 +4263,7 @@ static netdev_tx_t stmmac_xmit(struct sk
  	int entry, first_tx;
  	dma_addr_t des;
  
@@ -856,7 +856,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	first_tx = tx_q->cur_tx;
  
  	if (priv->tx_path_in_lpi_mode && priv->eee_sw_timer_en)
-@@ -4321,7 +4321,7 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -4326,7 +4326,7 @@ static netdev_tx_t stmmac_xmit(struct sk
  		int len = skb_frag_size(frag);
  		bool last_segment = (i == (nfrags - 1));
  
@@ -865,7 +865,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		WARN_ON(tx_q->tx_skbuff[entry]);
  
  		if (likely(priv->extend_desc))
-@@ -4392,7 +4392,7 @@ static netdev_tx_t stmmac_xmit(struct sk
+@@ -4397,7 +4397,7 @@ static netdev_tx_t stmmac_xmit(struct sk
  	 * ndo_start_xmit will fill this descriptor the next time it's
  	 * called and stmmac_tx_clean may clean up to this descriptor.
  	 */
@@ -874,7 +874,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	tx_q->cur_tx = entry;
  
  	if (netif_msg_pktdata(priv)) {
-@@ -4507,7 +4507,7 @@ static void stmmac_rx_vlan(struct net_de
+@@ -4512,7 +4512,7 @@ static void stmmac_rx_vlan(struct net_de
   */
  static inline void stmmac_rx_refill(struct stmmac_priv *priv, u32 queue)
  {
@@ -883,7 +883,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	int dirty = stmmac_rx_dirty(priv, queue);
  	unsigned int entry = rx_q->dirty_rx;
  
-@@ -4557,7 +4557,7 @@ static inline void stmmac_rx_refill(stru
+@@ -4562,7 +4562,7 @@ static inline void stmmac_rx_refill(stru
  		dma_wmb();
  		stmmac_set_rx_owner(priv, p, use_rx_wd);
  
@@ -892,7 +892,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	}
  	rx_q->dirty_rx = entry;
  	rx_q->rx_tail_addr = rx_q->dma_rx_phy +
-@@ -4585,12 +4585,12 @@ static unsigned int stmmac_rx_buf1_len(s
+@@ -4590,12 +4590,12 @@ static unsigned int stmmac_rx_buf1_len(s
  
  	/* First descriptor, not last descriptor and not split header */
  	if (status & rx_not_ls)
@@ -907,7 +907,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  }
  
  static unsigned int stmmac_rx_buf2_len(struct stmmac_priv *priv,
-@@ -4606,7 +4606,7 @@ static unsigned int stmmac_rx_buf2_len(s
+@@ -4611,7 +4611,7 @@ static unsigned int stmmac_rx_buf2_len(s
  
  	/* Not last descriptor */
  	if (status & rx_not_ls)
@@ -916,7 +916,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	plen = stmmac_get_rx_frame_len(priv, p, coe);
  
-@@ -4617,7 +4617,7 @@ static unsigned int stmmac_rx_buf2_len(s
+@@ -4622,7 +4622,7 @@ static unsigned int stmmac_rx_buf2_len(s
  static int stmmac_xdp_xmit_xdpf(struct stmmac_priv *priv, int queue,
  				struct xdp_frame *xdpf, bool dma_map)
  {
@@ -925,7 +925,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	unsigned int entry = tx_q->cur_tx;
  	struct dma_desc *tx_desc;
  	dma_addr_t dma_addr;
-@@ -4680,7 +4680,7 @@ static int stmmac_xdp_xmit_xdpf(struct s
+@@ -4685,7 +4685,7 @@ static int stmmac_xdp_xmit_xdpf(struct s
  
  	stmmac_enable_dma_transmission(priv, priv->ioaddr);
  
@@ -934,7 +934,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	tx_q->cur_tx = entry;
  
  	return STMMAC_XDP_TX;
-@@ -4854,7 +4854,7 @@ static void stmmac_dispatch_skb_zc(struc
+@@ -4859,7 +4859,7 @@ static void stmmac_dispatch_skb_zc(struc
  
  static bool stmmac_rx_refill_zc(struct stmmac_priv *priv, u32 queue, u32 budget)
  {
@@ -943,7 +943,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	unsigned int entry = rx_q->dirty_rx;
  	struct dma_desc *rx_desc = NULL;
  	bool ret = true;
-@@ -4897,7 +4897,7 @@ static bool stmmac_rx_refill_zc(struct s
+@@ -4902,7 +4902,7 @@ static bool stmmac_rx_refill_zc(struct s
  		dma_wmb();
  		stmmac_set_rx_owner(priv, rx_desc, use_rx_wd);
  
@@ -952,7 +952,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	}
  
  	if (rx_desc) {
-@@ -4912,7 +4912,7 @@ static bool stmmac_rx_refill_zc(struct s
+@@ -4917,7 +4917,7 @@ static bool stmmac_rx_refill_zc(struct s
  
  static int stmmac_rx_zc(struct stmmac_priv *priv, int limit, u32 queue)
  {
@@ -961,7 +961,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	unsigned int count = 0, error = 0, len = 0;
  	int dirty = stmmac_rx_dirty(priv, queue);
  	unsigned int next_entry = rx_q->cur_rx;
-@@ -4934,7 +4934,7 @@ static int stmmac_rx_zc(struct stmmac_pr
+@@ -4939,7 +4939,7 @@ static int stmmac_rx_zc(struct stmmac_pr
  			desc_size = sizeof(struct dma_desc);
  		}
  
@@ -970,7 +970,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  				    rx_q->dma_rx_phy, desc_size);
  	}
  	while (count < limit) {
-@@ -4981,7 +4981,7 @@ read_again:
+@@ -4986,7 +4986,7 @@ read_again:
  
  		/* Prefetch the next RX descriptor */
  		rx_q->cur_rx = STMMAC_GET_ENTRY(rx_q->cur_rx,
@@ -979,7 +979,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		next_entry = rx_q->cur_rx;
  
  		if (priv->extend_desc)
-@@ -5102,7 +5102,7 @@ read_again:
+@@ -5107,7 +5107,7 @@ read_again:
   */
  static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue)
  {
@@ -988,7 +988,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	struct stmmac_channel *ch = &priv->channel[queue];
  	unsigned int count = 0, error = 0, len = 0;
  	int status = 0, coe = priv->hw->rx_csum;
-@@ -5115,7 +5115,7 @@ static int stmmac_rx(struct stmmac_priv
+@@ -5120,7 +5120,7 @@ static int stmmac_rx(struct stmmac_priv
  	int buf_sz;
  
  	dma_dir = page_pool_get_dma_dir(rx_q->page_pool);
@@ -997,7 +997,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	if (netif_msg_rx_status(priv)) {
  		void *rx_head;
-@@ -5129,7 +5129,7 @@ static int stmmac_rx(struct stmmac_priv
+@@ -5134,7 +5134,7 @@ static int stmmac_rx(struct stmmac_priv
  			desc_size = sizeof(struct dma_desc);
  		}
  
@@ -1006,7 +1006,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  				    rx_q->dma_rx_phy, desc_size);
  	}
  	while (count < limit) {
-@@ -5173,7 +5173,7 @@ read_again:
+@@ -5178,7 +5178,7 @@ read_again:
  			break;
  
  		rx_q->cur_rx = STMMAC_GET_ENTRY(rx_q->cur_rx,
@@ -1015,7 +1015,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		next_entry = rx_q->cur_rx;
  
  		if (priv->extend_desc)
-@@ -5307,7 +5307,7 @@ read_again:
+@@ -5312,7 +5312,7 @@ read_again:
  						buf1_len, dma_dir);
  			skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
  					buf->page, buf->page_offset, buf1_len,
@@ -1024,7 +1024,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  			/* Data payload appended into SKB */
  			page_pool_release_page(rx_q->page_pool, buf->page);
-@@ -5319,7 +5319,7 @@ read_again:
+@@ -5324,7 +5324,7 @@ read_again:
  						buf2_len, dma_dir);
  			skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
  					buf->sec_page, 0, buf2_len,
@@ -1033,7 +1033,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  			/* Data payload appended into SKB */
  			page_pool_release_page(rx_q->page_pool, buf->sec_page);
-@@ -5761,11 +5761,13 @@ static irqreturn_t stmmac_safety_interru
+@@ -5766,11 +5766,13 @@ static irqreturn_t stmmac_safety_interru
  static irqreturn_t stmmac_msi_intr_tx(int irq, void *data)
  {
  	struct stmmac_tx_queue *tx_q = (struct stmmac_tx_queue *)data;
@@ -1048,7 +1048,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	if (unlikely(!data)) {
  		netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__);
-@@ -5805,10 +5807,12 @@ static irqreturn_t stmmac_msi_intr_tx(in
+@@ -5810,10 +5812,12 @@ static irqreturn_t stmmac_msi_intr_tx(in
  static irqreturn_t stmmac_msi_intr_rx(int irq, void *data)
  {
  	struct stmmac_rx_queue *rx_q = (struct stmmac_rx_queue *)data;
@@ -1062,7 +1062,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	if (unlikely(!data)) {
  		netdev_err(priv->dev, "%s: invalid dev pointer\n", __func__);
-@@ -5839,10 +5843,10 @@ static void stmmac_poll_controller(struc
+@@ -5844,10 +5848,10 @@ static void stmmac_poll_controller(struc
  
  	if (priv->plat->multi_msi_en) {
  		for (i = 0; i < priv->plat->rx_queues_to_use; i++)
@@ -1075,7 +1075,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	} else {
  		disable_irq(dev->irq);
  		stmmac_interrupt(dev->irq, dev);
-@@ -6023,34 +6027,34 @@ static int stmmac_rings_status_show(stru
+@@ -6028,34 +6032,34 @@ static int stmmac_rings_status_show(stru
  		return 0;
  
  	for (queue = 0; queue < rx_count; queue++) {
@@ -1116,7 +1116,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		}
  	}
  
-@@ -6391,7 +6395,7 @@ void stmmac_disable_rx_queue(struct stmm
+@@ -6396,7 +6400,7 @@ void stmmac_disable_rx_queue(struct stmm
  
  void stmmac_enable_rx_queue(struct stmmac_priv *priv, u32 queue)
  {
@@ -1125,7 +1125,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	struct stmmac_channel *ch = &priv->channel[queue];
  	unsigned long flags;
  	u32 buf_size;
-@@ -6428,7 +6432,7 @@ void stmmac_enable_rx_queue(struct stmma
+@@ -6433,7 +6437,7 @@ void stmmac_enable_rx_queue(struct stmma
  				      rx_q->queue_index);
  	} else {
  		stmmac_set_dma_bfsize(priv, priv->ioaddr,
@@ -1134,7 +1134,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  				      rx_q->queue_index);
  	}
  
-@@ -6454,7 +6458,7 @@ void stmmac_disable_tx_queue(struct stmm
+@@ -6459,7 +6463,7 @@ void stmmac_disable_tx_queue(struct stmm
  
  void stmmac_enable_tx_queue(struct stmmac_priv *priv, u32 queue)
  {
@@ -1143,7 +1143,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	struct stmmac_channel *ch = &priv->channel[queue];
  	unsigned long flags;
  	int ret;
-@@ -6504,7 +6508,7 @@ void stmmac_xdp_release(struct net_devic
+@@ -6509,7 +6513,7 @@ void stmmac_xdp_release(struct net_devic
  	stmmac_disable_all_queues(priv);
  
  	for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
@@ -1152,7 +1152,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	/* Free the IRQ lines */
  	stmmac_free_irq(dev, REQ_IRQ_ERR_ALL, 0);
-@@ -6563,7 +6567,7 @@ int stmmac_xdp_open(struct net_device *d
+@@ -6568,7 +6572,7 @@ int stmmac_xdp_open(struct net_device *d
  
  	/* DMA RX Channel Configuration */
  	for (chan = 0; chan < rx_cnt; chan++) {
@@ -1161,7 +1161,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  		stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
  				    rx_q->dma_rx_phy, chan);
-@@ -6581,7 +6585,7 @@ int stmmac_xdp_open(struct net_device *d
+@@ -6586,7 +6590,7 @@ int stmmac_xdp_open(struct net_device *d
  					      rx_q->queue_index);
  		} else {
  			stmmac_set_dma_bfsize(priv, priv->ioaddr,
@@ -1170,7 +1170,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  					      rx_q->queue_index);
  		}
  
-@@ -6590,7 +6594,7 @@ int stmmac_xdp_open(struct net_device *d
+@@ -6595,7 +6599,7 @@ int stmmac_xdp_open(struct net_device *d
  
  	/* DMA TX Channel Configuration */
  	for (chan = 0; chan < tx_cnt; chan++) {
@@ -1179,7 +1179,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  		stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
  				    tx_q->dma_tx_phy, chan);
-@@ -6623,7 +6627,7 @@ int stmmac_xdp_open(struct net_device *d
+@@ -6628,7 +6632,7 @@ int stmmac_xdp_open(struct net_device *d
  
  irq_error:
  	for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
@@ -1188,7 +1188,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	stmmac_hw_teardown(dev);
  init_error:
-@@ -6650,8 +6654,8 @@ int stmmac_xsk_wakeup(struct net_device
+@@ -6655,8 +6659,8 @@ int stmmac_xsk_wakeup(struct net_device
  	    queue >= priv->plat->tx_queues_to_use)
  		return -EINVAL;
  
@@ -1199,7 +1199,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	ch = &priv->channel[queue];
  
  	if (!rx_q->xsk_pool && !tx_q->xsk_pool)
-@@ -6907,8 +6911,8 @@ int stmmac_reinit_ringparam(struct net_d
+@@ -6912,8 +6916,8 @@ int stmmac_reinit_ringparam(struct net_d
  	if (netif_running(dev))
  		stmmac_release(dev);
  
@@ -1210,7 +1210,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	if (netif_running(dev))
  		ret = stmmac_open(dev);
-@@ -7346,7 +7350,7 @@ int stmmac_suspend(struct device *dev)
+@@ -7351,7 +7355,7 @@ int stmmac_suspend(struct device *dev)
  	stmmac_disable_all_queues(priv);
  
  	for (chan = 0; chan < priv->plat->tx_queues_to_use; chan++)
@@ -1219,7 +1219,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	if (priv->eee_enabled) {
  		priv->tx_path_in_lpi_mode = false;
-@@ -7397,7 +7401,7 @@ EXPORT_SYMBOL_GPL(stmmac_suspend);
+@@ -7402,7 +7406,7 @@ EXPORT_SYMBOL_GPL(stmmac_suspend);
  
  static void stmmac_reset_rx_queue(struct stmmac_priv *priv, u32 queue)
  {
@@ -1228,7 +1228,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	rx_q->cur_rx = 0;
  	rx_q->dirty_rx = 0;
-@@ -7405,7 +7409,7 @@ static void stmmac_reset_rx_queue(struct
+@@ -7410,7 +7414,7 @@ static void stmmac_reset_rx_queue(struct
  
  static void stmmac_reset_tx_queue(struct stmmac_priv *priv, u32 queue)
  {
diff --git a/target/linux/generic/backport-5.15/775-v6.0-04-net-ethernet-stmicro-stmmac-generate-stmmac-dma-conf.patch b/target/linux/generic/backport-5.15/775-v6.0-04-net-ethernet-stmicro-stmmac-generate-stmmac-dma-conf.patch
index 80c22c34d0..3dc5297f65 100644
--- a/target/linux/generic/backport-5.15/775-v6.0-04-net-ethernet-stmicro-stmmac-generate-stmmac-dma-conf.patch
+++ b/target/linux/generic/backport-5.15/775-v6.0-04-net-ethernet-stmicro-stmmac-generate-stmmac-dma-conf.patch
@@ -17,7 +17,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
 +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
-@@ -1293,7 +1293,8 @@ static int stmmac_phy_setup(struct stmma
+@@ -1298,7 +1298,8 @@ static int stmmac_phy_setup(struct stmma
  	return 0;
  }
  
@@ -27,7 +27,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  {
  	u32 rx_cnt = priv->plat->rx_queues_to_use;
  	unsigned int desc_size;
-@@ -1302,7 +1303,7 @@ static void stmmac_display_rx_rings(stru
+@@ -1307,7 +1308,7 @@ static void stmmac_display_rx_rings(stru
  
  	/* Display RX rings */
  	for (queue = 0; queue < rx_cnt; queue++) {
@@ -36,7 +36,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  		pr_info("\tRX Queue %u rings\n", queue);
  
-@@ -1315,12 +1316,13 @@ static void stmmac_display_rx_rings(stru
+@@ -1320,12 +1321,13 @@ static void stmmac_display_rx_rings(stru
  		}
  
  		/* Display RX ring */
@@ -52,7 +52,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  {
  	u32 tx_cnt = priv->plat->tx_queues_to_use;
  	unsigned int desc_size;
-@@ -1329,7 +1331,7 @@ static void stmmac_display_tx_rings(stru
+@@ -1334,7 +1336,7 @@ static void stmmac_display_tx_rings(stru
  
  	/* Display TX rings */
  	for (queue = 0; queue < tx_cnt; queue++) {
@@ -61,7 +61,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  		pr_info("\tTX Queue %d rings\n", queue);
  
-@@ -1344,18 +1346,19 @@ static void stmmac_display_tx_rings(stru
+@@ -1349,18 +1351,19 @@ static void stmmac_display_tx_rings(stru
  			desc_size = sizeof(struct dma_desc);
  		}
  
@@ -85,7 +85,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  }
  
  static int stmmac_set_bfsize(int mtu, int bufsize)
-@@ -1379,44 +1382,50 @@ static int stmmac_set_bfsize(int mtu, in
+@@ -1384,44 +1387,50 @@ static int stmmac_set_bfsize(int mtu, in
  /**
   * stmmac_clear_rx_descriptors - clear RX descriptors
   * @priv: driver private structure
@@ -147,7 +147,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		struct dma_desc *p;
  
  		if (priv->extend_desc)
-@@ -1433,10 +1442,12 @@ static void stmmac_clear_tx_descriptors(
+@@ -1438,10 +1447,12 @@ static void stmmac_clear_tx_descriptors(
  /**
   * stmmac_clear_descriptors - clear descriptors
   * @priv: driver private structure
@@ -161,7 +161,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  {
  	u32 rx_queue_cnt = priv->plat->rx_queues_to_use;
  	u32 tx_queue_cnt = priv->plat->tx_queues_to_use;
-@@ -1444,16 +1455,17 @@ static void stmmac_clear_descriptors(str
+@@ -1449,16 +1460,17 @@ static void stmmac_clear_descriptors(str
  
  	/* Clear the RX descriptors */
  	for (queue = 0; queue < rx_queue_cnt; queue++)
@@ -181,7 +181,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
   * @p: descriptor pointer
   * @i: descriptor index
   * @flags: gfp flag
-@@ -1461,10 +1473,12 @@ static void stmmac_clear_descriptors(str
+@@ -1466,10 +1478,12 @@ static void stmmac_clear_descriptors(str
   * Description: this function is called to allocate a receive buffer, perform
   * the DMA mapping and init the descriptor.
   */
@@ -196,7 +196,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
  
  	if (!buf->page) {
-@@ -1489,7 +1503,7 @@ static int stmmac_init_rx_buffers(struct
+@@ -1494,7 +1508,7 @@ static int stmmac_init_rx_buffers(struct
  	buf->addr = page_pool_get_dma_addr(buf->page) + buf->page_offset;
  
  	stmmac_set_desc_addr(priv, p, buf->addr);
@@ -205,7 +205,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		stmmac_init_desc3(priv, p);
  
  	return 0;
-@@ -1498,12 +1512,13 @@ static int stmmac_init_rx_buffers(struct
+@@ -1503,12 +1517,13 @@ static int stmmac_init_rx_buffers(struct
  /**
   * stmmac_free_rx_buffer - free RX dma buffers
   * @priv: private structure
@@ -222,7 +222,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
  
  	if (buf->page)
-@@ -1518,12 +1533,15 @@ static void stmmac_free_rx_buffer(struct
+@@ -1523,12 +1538,15 @@ static void stmmac_free_rx_buffer(struct
  /**
   * stmmac_free_tx_buffer - free RX dma buffers
   * @priv: private structure
@@ -240,7 +240,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	if (tx_q->tx_skbuff_dma[i].buf &&
  	    tx_q->tx_skbuff_dma[i].buf_type != STMMAC_TXBUF_T_XDP_TX) {
-@@ -1562,23 +1580,28 @@ static void stmmac_free_tx_buffer(struct
+@@ -1567,23 +1585,28 @@ static void stmmac_free_tx_buffer(struct
  /**
   * dma_free_rx_skbufs - free RX dma buffers
   * @priv: private structure
@@ -276,7 +276,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		struct dma_desc *p;
  		int ret;
  
-@@ -1587,7 +1610,7 @@ static int stmmac_alloc_rx_buffers(struc
+@@ -1592,7 +1615,7 @@ static int stmmac_alloc_rx_buffers(struc
  		else
  			p = rx_q->dma_rx + i;
  
@@ -285,7 +285,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  					     queue);
  		if (ret)
  			return ret;
-@@ -1601,14 +1624,17 @@ static int stmmac_alloc_rx_buffers(struc
+@@ -1606,14 +1629,17 @@ static int stmmac_alloc_rx_buffers(struc
  /**
   * dma_free_rx_xskbufs - free RX dma buffers from XSK pool
   * @priv: private structure
@@ -306,7 +306,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		struct stmmac_rx_buffer *buf = &rx_q->buf_pool[i];
  
  		if (!buf->xdp)
-@@ -1619,12 +1645,14 @@ static void dma_free_rx_xskbufs(struct s
+@@ -1624,12 +1650,14 @@ static void dma_free_rx_xskbufs(struct s
  	}
  }
  
@@ -324,7 +324,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		struct stmmac_rx_buffer *buf;
  		dma_addr_t dma_addr;
  		struct dma_desc *p;
-@@ -1659,22 +1687,25 @@ static struct xsk_buff_pool *stmmac_get_
+@@ -1664,22 +1692,25 @@ static struct xsk_buff_pool *stmmac_get_
  /**
   * __init_dma_rx_desc_rings - init the RX descriptor ring (per queue)
   * @priv: driver private structure
@@ -353,7 +353,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	xdp_rxq_info_unreg_mem_model(&rx_q->xdp_rxq);
  
-@@ -1701,9 +1732,9 @@ static int __init_dma_rx_desc_rings(stru
+@@ -1706,9 +1737,9 @@ static int __init_dma_rx_desc_rings(stru
  		/* RX XDP ZC buffer pool may not be populated, e.g.
  		 * xdpsock TX-only.
  		 */
@@ -365,7 +365,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		if (ret < 0)
  			return -ENOMEM;
  	}
-@@ -1713,17 +1744,19 @@ static int __init_dma_rx_desc_rings(stru
+@@ -1718,17 +1749,19 @@ static int __init_dma_rx_desc_rings(stru
  		if (priv->extend_desc)
  			stmmac_mode_init(priv, rx_q->dma_erx,
  					 rx_q->dma_rx_phy,
@@ -388,7 +388,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  {
  	struct stmmac_priv *priv = netdev_priv(dev);
  	u32 rx_count = priv->plat->rx_queues_to_use;
-@@ -1735,7 +1768,7 @@ static int init_dma_rx_desc_rings(struct
+@@ -1740,7 +1773,7 @@ static int init_dma_rx_desc_rings(struct
  		  "SKB addresses:\nskb\t\tskb data\tdma data\n");
  
  	for (queue = 0; queue < rx_count; queue++) {
@@ -397,7 +397,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		if (ret)
  			goto err_init_rx_buffers;
  	}
-@@ -1744,12 +1777,12 @@ static int init_dma_rx_desc_rings(struct
+@@ -1749,12 +1782,12 @@ static int init_dma_rx_desc_rings(struct
  
  err_init_rx_buffers:
  	while (queue >= 0) {
@@ -413,7 +413,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  		rx_q->buf_alloc_num = 0;
  		rx_q->xsk_pool = NULL;
-@@ -1766,14 +1799,17 @@ err_init_rx_buffers:
+@@ -1771,14 +1804,17 @@ err_init_rx_buffers:
  /**
   * __init_dma_tx_desc_rings - init the TX descriptor ring (per queue)
   * @priv: driver private structure
@@ -434,7 +434,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	int i;
  
  	netif_dbg(priv, probe, priv->dev,
-@@ -1785,16 +1821,16 @@ static int __init_dma_tx_desc_rings(stru
+@@ -1790,16 +1826,16 @@ static int __init_dma_tx_desc_rings(stru
  		if (priv->extend_desc)
  			stmmac_mode_init(priv, tx_q->dma_etx,
  					 tx_q->dma_tx_phy,
@@ -454,7 +454,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		struct dma_desc *p;
  
  		if (priv->extend_desc)
-@@ -1816,7 +1852,8 @@ static int __init_dma_tx_desc_rings(stru
+@@ -1821,7 +1857,8 @@ static int __init_dma_tx_desc_rings(stru
  	return 0;
  }
  
@@ -464,7 +464,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  {
  	struct stmmac_priv *priv = netdev_priv(dev);
  	u32 tx_queue_cnt;
-@@ -1825,7 +1862,7 @@ static int init_dma_tx_desc_rings(struct
+@@ -1830,7 +1867,7 @@ static int init_dma_tx_desc_rings(struct
  	tx_queue_cnt = priv->plat->tx_queues_to_use;
  
  	for (queue = 0; queue < tx_queue_cnt; queue++)
@@ -473,7 +473,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	return 0;
  }
-@@ -1833,26 +1870,29 @@ static int init_dma_tx_desc_rings(struct
+@@ -1838,26 +1875,29 @@ static int init_dma_tx_desc_rings(struct
  /**
   * init_dma_desc_rings - init the RX/TX descriptor rings
   * @dev: net device structure
@@ -508,7 +508,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	return ret;
  }
-@@ -1860,17 +1900,20 @@ static int init_dma_desc_rings(struct ne
+@@ -1865,17 +1905,20 @@ static int init_dma_desc_rings(struct ne
  /**
   * dma_free_tx_skbufs - free TX dma buffers
   * @priv: private structure
@@ -533,7 +533,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	if (tx_q->xsk_pool && tx_q->xsk_frames_done) {
  		xsk_tx_completed(tx_q->xsk_pool, tx_q->xsk_frames_done);
-@@ -1889,34 +1932,37 @@ static void stmmac_free_tx_skbufs(struct
+@@ -1894,34 +1937,37 @@ static void stmmac_free_tx_skbufs(struct
  	u32 queue;
  
  	for (queue = 0; queue < tx_queue_cnt; queue++)
@@ -578,7 +578,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  				  sizeof(struct dma_extended_desc),
  				  rx_q->dma_erx, rx_q->dma_rx_phy);
  
-@@ -1928,29 +1974,33 @@ static void __free_dma_rx_desc_resources
+@@ -1933,29 +1979,33 @@ static void __free_dma_rx_desc_resources
  		page_pool_destroy(rx_q->page_pool);
  }
  
@@ -617,7 +617,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	if (priv->extend_desc) {
  		size = sizeof(struct dma_extended_desc);
-@@ -1963,7 +2013,7 @@ static void __free_dma_tx_desc_resources
+@@ -1968,7 +2018,7 @@ static void __free_dma_tx_desc_resources
  		addr = tx_q->dma_tx;
  	}
  
@@ -626,7 +626,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	dma_free_coherent(priv->device, size, addr, tx_q->dma_tx_phy);
  
-@@ -1971,28 +2021,32 @@ static void __free_dma_tx_desc_resources
+@@ -1976,28 +2026,32 @@ static void __free_dma_tx_desc_resources
  	kfree(tx_q->tx_skbuff);
  }
  
@@ -663,7 +663,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	struct stmmac_channel *ch = &priv->channel[queue];
  	bool xdp_prog = stmmac_xdp_is_enabled(priv);
  	struct page_pool_params pp_params = { 0 };
-@@ -2004,8 +2058,8 @@ static int __alloc_dma_rx_desc_resources
+@@ -2009,8 +2063,8 @@ static int __alloc_dma_rx_desc_resources
  	rx_q->priv_data = priv;
  
  	pp_params.flags = PP_FLAG_DMA_MAP | PP_FLAG_DMA_SYNC_DEV;
@@ -674,7 +674,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	pp_params.order = ilog2(num_pages);
  	pp_params.nid = dev_to_node(priv->device);
  	pp_params.dev = priv->device;
-@@ -2020,7 +2074,7 @@ static int __alloc_dma_rx_desc_resources
+@@ -2025,7 +2079,7 @@ static int __alloc_dma_rx_desc_resources
  		return ret;
  	}
  
@@ -683,7 +683,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  				 sizeof(*rx_q->buf_pool),
  				 GFP_KERNEL);
  	if (!rx_q->buf_pool)
-@@ -2028,7 +2082,7 @@ static int __alloc_dma_rx_desc_resources
+@@ -2033,7 +2087,7 @@ static int __alloc_dma_rx_desc_resources
  
  	if (priv->extend_desc) {
  		rx_q->dma_erx = dma_alloc_coherent(priv->device,
@@ -692,7 +692,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  						   sizeof(struct dma_extended_desc),
  						   &rx_q->dma_rx_phy,
  						   GFP_KERNEL);
-@@ -2037,7 +2091,7 @@ static int __alloc_dma_rx_desc_resources
+@@ -2042,7 +2096,7 @@ static int __alloc_dma_rx_desc_resources
  
  	} else {
  		rx_q->dma_rx = dma_alloc_coherent(priv->device,
@@ -701,7 +701,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  						  sizeof(struct dma_desc),
  						  &rx_q->dma_rx_phy,
  						  GFP_KERNEL);
-@@ -2062,7 +2116,8 @@ static int __alloc_dma_rx_desc_resources
+@@ -2067,7 +2121,8 @@ static int __alloc_dma_rx_desc_resources
  	return 0;
  }
  
@@ -711,7 +711,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  {
  	u32 rx_count = priv->plat->rx_queues_to_use;
  	u32 queue;
-@@ -2070,7 +2125,7 @@ static int alloc_dma_rx_desc_resources(s
+@@ -2075,7 +2130,7 @@ static int alloc_dma_rx_desc_resources(s
  
  	/* RX queues buffers and DMA */
  	for (queue = 0; queue < rx_count; queue++) {
@@ -720,7 +720,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		if (ret)
  			goto err_dma;
  	}
-@@ -2078,7 +2133,7 @@ static int alloc_dma_rx_desc_resources(s
+@@ -2083,7 +2138,7 @@ static int alloc_dma_rx_desc_resources(s
  	return 0;
  
  err_dma:
@@ -729,7 +729,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	return ret;
  }
-@@ -2086,28 +2141,31 @@ err_dma:
+@@ -2091,28 +2146,31 @@ err_dma:
  /**
   * __alloc_dma_tx_desc_resources - alloc TX resources (per queue).
   * @priv: private structure
@@ -765,7 +765,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  				  sizeof(struct sk_buff *),
  				  GFP_KERNEL);
  	if (!tx_q->tx_skbuff)
-@@ -2120,7 +2178,7 @@ static int __alloc_dma_tx_desc_resources
+@@ -2125,7 +2183,7 @@ static int __alloc_dma_tx_desc_resources
  	else
  		size = sizeof(struct dma_desc);
  
@@ -774,7 +774,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	addr = dma_alloc_coherent(priv->device, size,
  				  &tx_q->dma_tx_phy, GFP_KERNEL);
-@@ -2137,7 +2195,8 @@ static int __alloc_dma_tx_desc_resources
+@@ -2142,7 +2200,8 @@ static int __alloc_dma_tx_desc_resources
  	return 0;
  }
  
@@ -784,7 +784,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  {
  	u32 tx_count = priv->plat->tx_queues_to_use;
  	u32 queue;
-@@ -2145,7 +2204,7 @@ static int alloc_dma_tx_desc_resources(s
+@@ -2150,7 +2209,7 @@ static int alloc_dma_tx_desc_resources(s
  
  	/* TX queues buffers and DMA */
  	for (queue = 0; queue < tx_count; queue++) {
@@ -793,7 +793,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  		if (ret)
  			goto err_dma;
  	}
-@@ -2153,27 +2212,29 @@ static int alloc_dma_tx_desc_resources(s
+@@ -2158,27 +2217,29 @@ static int alloc_dma_tx_desc_resources(s
  	return 0;
  
  err_dma:
@@ -827,7 +827,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	return ret;
  }
-@@ -2181,16 +2242,18 @@ static int alloc_dma_desc_resources(stru
+@@ -2186,16 +2247,18 @@ static int alloc_dma_desc_resources(stru
  /**
   * free_dma_desc_resources - free dma desc resources
   * @priv: private structure
@@ -849,7 +849,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  }
  
  /**
-@@ -2679,8 +2742,8 @@ static void stmmac_tx_err(struct stmmac_
+@@ -2684,8 +2747,8 @@ static void stmmac_tx_err(struct stmmac_
  	netif_tx_stop_queue(netdev_get_tx_queue(priv->dev, chan));
  
  	stmmac_stop_tx_dma(priv, chan);
@@ -860,7 +860,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	stmmac_reset_tx_queue(priv, chan);
  	stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
  			    tx_q->dma_tx_phy, chan);
-@@ -3677,19 +3740,93 @@ static int stmmac_request_irq(struct net
+@@ -3682,19 +3745,93 @@ static int stmmac_request_irq(struct net
  }
  
  /**
@@ -957,7 +957,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	u32 chan;
  	int ret;
  
-@@ -3716,45 +3853,10 @@ static int stmmac_open(struct net_device
+@@ -3721,45 +3858,10 @@ static int stmmac_open(struct net_device
  	memset(&priv->xstats, 0, sizeof(struct stmmac_extra_stats));
  	priv->xstats.threshold = tc;
  
@@ -1005,7 +1005,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	if (priv->plat->serdes_powerup) {
  		ret = priv->plat->serdes_powerup(dev, priv->plat->bsp_priv);
-@@ -3797,14 +3899,28 @@ irq_error:
+@@ -3802,14 +3904,28 @@ irq_error:
  
  	stmmac_hw_teardown(dev);
  init_error:
@@ -1036,7 +1036,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  static void stmmac_fpe_stop_wq(struct stmmac_priv *priv)
  {
  	set_bit(__FPE_REMOVING, &priv->fpe_task_state);
-@@ -3851,7 +3967,7 @@ static int stmmac_release(struct net_dev
+@@ -3856,7 +3972,7 @@ static int stmmac_release(struct net_dev
  	stmmac_stop_all_dma(priv);
  
  	/* Release and free the Rx/Tx resources */
@@ -1045,7 +1045,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	/* Disable the MAC Rx/Tx */
  	stmmac_mac_set(priv, priv->ioaddr, false);
-@@ -6390,7 +6506,7 @@ void stmmac_disable_rx_queue(struct stmm
+@@ -6395,7 +6511,7 @@ void stmmac_disable_rx_queue(struct stmm
  	spin_unlock_irqrestore(&ch->lock, flags);
  
  	stmmac_stop_rx_dma(priv, queue);
@@ -1054,7 +1054,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  }
  
  void stmmac_enable_rx_queue(struct stmmac_priv *priv, u32 queue)
-@@ -6401,21 +6517,21 @@ void stmmac_enable_rx_queue(struct stmma
+@@ -6406,21 +6522,21 @@ void stmmac_enable_rx_queue(struct stmma
  	u32 buf_size;
  	int ret;
  
@@ -1080,7 +1080,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	stmmac_init_rx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
  			    rx_q->dma_rx_phy, rx_q->queue_index);
-@@ -6453,7 +6569,7 @@ void stmmac_disable_tx_queue(struct stmm
+@@ -6458,7 +6574,7 @@ void stmmac_disable_tx_queue(struct stmm
  	spin_unlock_irqrestore(&ch->lock, flags);
  
  	stmmac_stop_tx_dma(priv, queue);
@@ -1089,7 +1089,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  }
  
  void stmmac_enable_tx_queue(struct stmmac_priv *priv, u32 queue)
-@@ -6463,21 +6579,21 @@ void stmmac_enable_tx_queue(struct stmma
+@@ -6468,21 +6584,21 @@ void stmmac_enable_tx_queue(struct stmma
  	unsigned long flags;
  	int ret;
  
@@ -1115,7 +1115,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	stmmac_init_tx_chan(priv, priv->ioaddr, priv->plat->dma_cfg,
  			    tx_q->dma_tx_phy, tx_q->queue_index);
-@@ -6517,7 +6633,7 @@ void stmmac_xdp_release(struct net_devic
+@@ -6522,7 +6638,7 @@ void stmmac_xdp_release(struct net_devic
  	stmmac_stop_all_dma(priv);
  
  	/* Release and free the Rx/Tx resources */
@@ -1124,7 +1124,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	/* Disable the MAC Rx/Tx */
  	stmmac_mac_set(priv, priv->ioaddr, false);
-@@ -6542,14 +6658,14 @@ int stmmac_xdp_open(struct net_device *d
+@@ -6547,14 +6663,14 @@ int stmmac_xdp_open(struct net_device *d
  	u32 chan;
  	int ret;
  
@@ -1141,7 +1141,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	if (ret < 0) {
  		netdev_err(dev, "%s: DMA descriptors initialization failed\n",
  			   __func__);
-@@ -6631,7 +6747,7 @@ irq_error:
+@@ -6636,7 +6752,7 @@ irq_error:
  
  	stmmac_hw_teardown(dev);
  init_error:
@@ -1150,7 +1150,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  dma_desc_error:
  	return ret;
  }
-@@ -7492,7 +7608,7 @@ int stmmac_resume(struct device *dev)
+@@ -7497,7 +7613,7 @@ int stmmac_resume(struct device *dev)
  	stmmac_reset_queues_param(priv);
  
  	stmmac_free_tx_skbufs(priv);
diff --git a/target/linux/generic/backport-5.15/775-v6.0-05-net-ethernet-stmicro-stmmac-permit-MTU-change-with-i.patch b/target/linux/generic/backport-5.15/775-v6.0-05-net-ethernet-stmicro-stmmac-permit-MTU-change-with-i.patch
index d1d8c622fc..6ebb527726 100644
--- a/target/linux/generic/backport-5.15/775-v6.0-05-net-ethernet-stmicro-stmmac-permit-MTU-change-with-i.patch
+++ b/target/linux/generic/backport-5.15/775-v6.0-05-net-ethernet-stmicro-stmmac-permit-MTU-change-with-i.patch
@@ -19,7 +19,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
 +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
-@@ -5619,18 +5619,15 @@ static int stmmac_change_mtu(struct net_
+@@ -5624,18 +5624,15 @@ static int stmmac_change_mtu(struct net_
  {
  	struct stmmac_priv *priv = netdev_priv(dev);
  	int txfifosz = priv->plat->tx_fifo_size;
@@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	if (stmmac_xdp_is_enabled(priv) && new_mtu > ETH_DATA_LEN) {
  		netdev_dbg(priv->dev, "Jumbo frames not supported for XDP\n");
  		return -EINVAL;
-@@ -5642,8 +5639,29 @@ static int stmmac_change_mtu(struct net_
+@@ -5647,8 +5644,29 @@ static int stmmac_change_mtu(struct net_
  	if ((txfifosz < new_mtu) || (new_mtu > BUF_SIZE_16KiB))
  		return -EINVAL;
  
diff --git a/target/linux/generic/pending-5.15/103-kbuild-export-SUBARCH.patch b/target/linux/generic/pending-5.15/103-kbuild-export-SUBARCH.patch
index d378dabdda..2bedd94642 100644
--- a/target/linux/generic/pending-5.15/103-kbuild-export-SUBARCH.patch
+++ b/target/linux/generic/pending-5.15/103-kbuild-export-SUBARCH.patch
@@ -10,12 +10,12 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/Makefile
 +++ b/Makefile
-@@ -526,7 +526,7 @@ KBUILD_LDFLAGS_MODULE :=
+@@ -527,7 +527,7 @@ KBUILD_LDFLAGS_MODULE :=
  KBUILD_LDFLAGS :=
  CLANG_FLAGS :=
  
--export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC
-+export ARCH SRCARCH SUBARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC
+-export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC HOSTPKG_CONFIG
++export ARCH SRCARCH SUBARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC HOSTPKG_CONFIG
  export CPP AR NM STRIP OBJCOPY OBJDUMP READELF PAHOLE RESOLVE_BTFIDS LEX YACC AWK INSTALLKERNEL
  export PERL PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
  export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ ZSTD
diff --git a/target/linux/generic/pending-5.15/110-v6.3-0001-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch b/target/linux/generic/pending-5.15/110-v6.3-0001-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch
index f5e0c858b2..5216d6a706 100644
--- a/target/linux/generic/pending-5.15/110-v6.3-0001-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch
+++ b/target/linux/generic/pending-5.15/110-v6.3-0001-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch
@@ -14,7 +14,7 @@ Signed-off-by: Vincent Tremblay <vincent at vtremblay.dev>
 
 --- a/drivers/spi/spidev.c
 +++ b/drivers/spi/spidev.c
-@@ -693,6 +693,7 @@ static const struct spi_device_id spidev
+@@ -691,6 +691,7 @@ static const struct spi_device_id spidev
  	{ .name = "m53cpld" },
  	{ .name = "spi-petra" },
  	{ .name = "spi-authenta" },
@@ -22,7 +22,7 @@ Signed-off-by: Vincent Tremblay <vincent at vtremblay.dev>
  	{},
  };
  MODULE_DEVICE_TABLE(spi, spidev_spi_ids);
-@@ -707,6 +708,7 @@ static const struct of_device_id spidev_
+@@ -705,6 +706,7 @@ static const struct of_device_id spidev_
  	{ .compatible = "menlo,m53cpld" },
  	{ .compatible = "cisco,spi-petra" },
  	{ .compatible = "micron,spi-authenta" },
diff --git a/target/linux/generic/pending-5.15/110-v6.3-0002-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch b/target/linux/generic/pending-5.15/110-v6.3-0002-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch
index 575c893d50..ffbed0c622 100644
--- a/target/linux/generic/pending-5.15/110-v6.3-0002-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch
+++ b/target/linux/generic/pending-5.15/110-v6.3-0002-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch
@@ -14,7 +14,7 @@ Signed-off-by: Vincent Tremblay <vincent at vtremblay.dev>
 
 --- a/drivers/spi/spidev.c
 +++ b/drivers/spi/spidev.c
-@@ -694,6 +694,7 @@ static const struct spi_device_id spidev
+@@ -692,6 +692,7 @@ static const struct spi_device_id spidev
  	{ .name = "spi-petra" },
  	{ .name = "spi-authenta" },
  	{ .name = "em3581" },
@@ -22,7 +22,7 @@ Signed-off-by: Vincent Tremblay <vincent at vtremblay.dev>
  	{},
  };
  MODULE_DEVICE_TABLE(spi, spidev_spi_ids);
-@@ -709,6 +710,7 @@ static const struct of_device_id spidev_
+@@ -707,6 +708,7 @@ static const struct of_device_id spidev_
  	{ .compatible = "cisco,spi-petra" },
  	{ .compatible = "micron,spi-authenta" },
  	{ .compatible = "silabs,em3581" },
diff --git a/target/linux/generic/pending-5.15/613-netfilter_optional_tcp_window_check.patch b/target/linux/generic/pending-5.15/613-netfilter_optional_tcp_window_check.patch
index 93c52e8842..cb3b63cdb1 100644
--- a/target/linux/generic/pending-5.15/613-netfilter_optional_tcp_window_check.patch
+++ b/target/linux/generic/pending-5.15/613-netfilter_optional_tcp_window_check.patch
@@ -48,7 +48,7 @@ Signed-off-by: Christian 'Ansuel' Marangi <ansuelsmth at gmail.com>
  	NF_SYSCTL_CT_PROTO_TCP_IGNORE_INVALID_RST,
  	NF_SYSCTL_CT_PROTO_TCP_MAX_RETRANS,
  	NF_SYSCTL_CT_PROTO_TIMEOUT_UDP,
-@@ -849,6 +850,14 @@ static struct ctl_table nf_ct_sysctl_tab
+@@ -848,6 +849,14 @@ static struct ctl_table nf_ct_sysctl_tab
  		.extra1 	= SYSCTL_ZERO,
  		.extra2 	= SYSCTL_ONE,
  	},
@@ -63,7 +63,7 @@ Signed-off-by: Christian 'Ansuel' Marangi <ansuelsmth at gmail.com>
  	[NF_SYSCTL_CT_PROTO_TCP_IGNORE_INVALID_RST] = {
  		.procname	= "nf_conntrack_tcp_ignore_invalid_rst",
  		.maxlen		= sizeof(u8),
-@@ -1065,6 +1074,7 @@ static void nf_conntrack_standalone_init
+@@ -1058,6 +1067,7 @@ static void nf_conntrack_standalone_init
  
  	XASSIGN(LOOSE, &tn->tcp_loose);
  	XASSIGN(LIBERAL, &tn->tcp_be_liberal);
diff --git a/target/linux/generic/pending-5.15/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch b/target/linux/generic/pending-5.15/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
index bb30f372eb..a189970823 100644
--- a/target/linux/generic/pending-5.15/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
+++ b/target/linux/generic/pending-5.15/670-ipv6-allow-rejecting-with-source-address-failed-policy.patch
@@ -53,7 +53,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  
 --- a/net/ipv4/fib_semantics.c
 +++ b/net/ipv4/fib_semantics.c
-@@ -142,6 +142,10 @@ const struct fib_prop fib_props[RTN_MAX
+@@ -143,6 +143,10 @@ const struct fib_prop fib_props[RTN_MAX
  		.error	= -EINVAL,
  		.scope	= RT_SCOPE_NOWHERE,
  	},
diff --git a/target/linux/ipq807x/patches-5.15/0128-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch b/target/linux/ipq807x/patches-5.15/0128-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch
index 0a784f7393..49fd4e4cc0 100644
--- a/target/linux/ipq807x/patches-5.15/0128-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch
+++ b/target/linux/ipq807x/patches-5.15/0128-cpufreq-qcom-nvmem-add-support-for-IPQ8074.patch
@@ -21,7 +21,7 @@ Signed-off-by: Robert Marko <robimarko at gmail.com>
 
 --- a/drivers/cpufreq/cpufreq-dt-platdev.c
 +++ b/drivers/cpufreq/cpufreq-dt-platdev.c
-@@ -157,6 +157,7 @@ static const struct of_device_id blockli
+@@ -159,6 +159,7 @@ static const struct of_device_id blockli
  	{ .compatible = "ti,omap3", },
  
  	{ .compatible = "qcom,ipq8064", },
diff --git a/target/linux/realtek/patches-5.15/800-net-mdio-support-hardware-assisted-indirect-access.patch b/target/linux/realtek/patches-5.15/800-net-mdio-support-hardware-assisted-indirect-access.patch
index 4867488642..b31c5e78ac 100644
--- a/target/linux/realtek/patches-5.15/800-net-mdio-support-hardware-assisted-indirect-access.patch
+++ b/target/linux/realtek/patches-5.15/800-net-mdio-support-hardware-assisted-indirect-access.patch
@@ -32,7 +32,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
 
 --- a/drivers/net/phy/mdio_bus.c
 +++ b/drivers/net/phy/mdio_bus.c
-@@ -737,6 +737,32 @@ out:
+@@ -742,6 +742,32 @@ out:
  }
  
  /**
@@ -65,7 +65,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * __mdiobus_read - Unlocked version of the mdiobus_read function
   * @bus: the mii_bus struct
   * @addr: the phy address
-@@ -752,7 +778,10 @@ int __mdiobus_read(struct mii_bus *bus,
+@@ -757,7 +783,10 @@ int __mdiobus_read(struct mii_bus *bus,
  
  	lockdep_assert_held_once(&bus->mdio_lock);
  
@@ -77,7 +77,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  
  	trace_mdio_access(bus, 1, addr, regnum, retval, retval);
  	mdiobus_stats_acct(&bus->stats[addr], true, retval);
-@@ -762,6 +791,40 @@ int __mdiobus_read(struct mii_bus *bus,
+@@ -767,6 +796,40 @@ int __mdiobus_read(struct mii_bus *bus,
  EXPORT_SYMBOL(__mdiobus_read);
  
  /**
@@ -118,7 +118,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * __mdiobus_write - Unlocked version of the mdiobus_write function
   * @bus: the mii_bus struct
   * @addr: the phy address
-@@ -778,7 +841,10 @@ int __mdiobus_write(struct mii_bus *bus,
+@@ -783,7 +846,10 @@ int __mdiobus_write(struct mii_bus *bus,
  
  	lockdep_assert_held_once(&bus->mdio_lock);
  
@@ -130,7 +130,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  
  	trace_mdio_access(bus, 0, addr, regnum, val, err);
  	mdiobus_stats_acct(&bus->stats[addr], false, err);
-@@ -788,6 +854,39 @@ int __mdiobus_write(struct mii_bus *bus,
+@@ -793,6 +859,39 @@ int __mdiobus_write(struct mii_bus *bus,
  EXPORT_SYMBOL(__mdiobus_write);
  
  /**
@@ -170,7 +170,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * __mdiobus_modify_changed - Unlocked version of the mdiobus_modify function
   * @bus: the mii_bus struct
   * @addr: the phy address
-@@ -820,6 +919,43 @@ int __mdiobus_modify_changed(struct mii_
+@@ -825,6 +924,43 @@ int __mdiobus_modify_changed(struct mii_
  EXPORT_SYMBOL_GPL(__mdiobus_modify_changed);
  
  /**
@@ -214,7 +214,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * mdiobus_read_nested - Nested version of the mdiobus_read function
   * @bus: the mii_bus struct
   * @addr: the phy address
-@@ -845,6 +981,79 @@ int mdiobus_read_nested(struct mii_bus *
+@@ -850,6 +986,79 @@ int mdiobus_read_nested(struct mii_bus *
  EXPORT_SYMBOL(mdiobus_read_nested);
  
  /**
@@ -294,7 +294,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * mdiobus_read - Convenience function for reading a given MII mgmt register
   * @bus: the mii_bus struct
   * @addr: the phy address
-@@ -867,6 +1076,29 @@ int mdiobus_read(struct mii_bus *bus, in
+@@ -872,6 +1081,29 @@ int mdiobus_read(struct mii_bus *bus, in
  EXPORT_SYMBOL(mdiobus_read);
  
  /**
@@ -324,7 +324,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * mdiobus_write_nested - Nested version of the mdiobus_write function
   * @bus: the mii_bus struct
   * @addr: the phy address
-@@ -893,6 +1125,33 @@ int mdiobus_write_nested(struct mii_bus
+@@ -898,6 +1130,33 @@ int mdiobus_write_nested(struct mii_bus
  EXPORT_SYMBOL(mdiobus_write_nested);
  
  /**
@@ -358,7 +358,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * mdiobus_write - Convenience function for writing a given MII mgmt register
   * @bus: the mii_bus struct
   * @addr: the phy address
-@@ -916,6 +1175,30 @@ int mdiobus_write(struct mii_bus *bus, i
+@@ -921,6 +1180,30 @@ int mdiobus_write(struct mii_bus *bus, i
  EXPORT_SYMBOL(mdiobus_write);
  
  /**
@@ -389,7 +389,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * mdiobus_modify - Convenience function for modifying a given mdio device
   *	register
   * @bus: the mii_bus struct
-@@ -937,6 +1220,51 @@ int mdiobus_modify(struct mii_bus *bus,
+@@ -942,6 +1225,51 @@ int mdiobus_modify(struct mii_bus *bus,
  EXPORT_SYMBOL_GPL(mdiobus_modify);
  
  /**



From lede-commits at lists.infradead.org  Fri Feb  3 00:39:16 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 03:39:16 -0500
Subject: [openwrt/openwrt]  kernel: bump 5.10 to 5.10.166
In-Reply-To: <167541355635.1781924.17479189169986342222@git-01.infra.openwrt.org>
References: <167541355635.1781924.17479189169986342222@git-01.infra.openwrt.org>
Message-ID: <mailman.12013.1675413563.3064139.lede-commits@lists.infradead.org>

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

commit 50324b949b91cfb70ced3869b09b895e45a5ae37
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Wed Feb 1 15:44:56 2023 -0500

    kernel: bump 5.10 to 5.10.166
    
    All patches automatically rebased.
    
    Build system: x86_64
    Build-tested: ramips/tplink_archer-a6-v3
    Run-tested: ramips/tplink_archer-a6-v3
    
    Signed-off-by: John Audia <therealgraysky at proton.me>
---
 include/kernel-5.10                                |  4 ++--
 ...add-userio-bits-as-platform-configuration.patch | 22 +++++++++++-----------
 ...b-add-function-to-disable-all-macb-clocks.patch |  8 ++++----
 ...-macb-unprepare-clocks-in-case-of-failure.patch |  4 ++--
 ...acb-add-support-for-sama7g5-gem-interface.patch |  6 +++---
 ...cb-add-support-for-sama7g5-emac-interface.patch |  4 ++--
 ...d-default-usrio-config-to-default-gem-con.patch |  6 +++---
 ...onntrack-Introduce-tcp-offload-timeout-co.patch |  6 +++---
 ...onntrack-Introduce-udp-offload-timeout-co.patch |  4 ++--
 ...onntrack-remove-offload_pickup-sysctl-aga.patch | 10 +++++-----
 ...pass-the-dst-buffer-to-of_get_mac_address.patch |  6 +++---
 ...Add-Silicon-Labs-EM3581-device-compatible.patch |  2 +-
 ...Add-Silicon-Labs-SI3210-device-compatible.patch |  2 +-
 .../613-netfilter_optional_tcp_window_check.patch  |  4 ++--
 ...jecting-with-source-address-failed-policy.patch |  2 +-
 ...stmmac-explicitly-deassert-gmac-ahb-reset.patch |  4 ++--
 ...support-hardware-assisted-indirect-access.patch | 22 +++++++++++-----------
 17 files changed, 58 insertions(+), 58 deletions(-)

diff --git a/include/kernel-5.10 b/include/kernel-5.10
index 7a91cd12fa..0c14e6b582 100644
--- a/include/kernel-5.10
+++ b/include/kernel-5.10
@@ -1,2 +1,2 @@
-LINUX_VERSION-5.10 = .165
-LINUX_KERNEL_HASH-5.10.165 = 971defc48f19ed0a2a7ffd4b48234619cac28895c985c6d747f5b707ba47af0d
+LINUX_VERSION-5.10 = .166
+LINUX_KERNEL_HASH-5.10.166 = 0051a1780e5bda0efc68dafab7c728b8283d2b028fedb439418f478be7d3e1af
diff --git a/target/linux/at91/patches-5.10/115-net-macb-add-userio-bits-as-platform-configuration.patch b/target/linux/at91/patches-5.10/115-net-macb-add-userio-bits-as-platform-configuration.patch
index 79e7e62440..acace03c5e 100644
--- a/target/linux/at91/patches-5.10/115-net-macb-add-userio-bits-as-platform-configuration.patch
+++ b/target/linux/at91/patches-5.10/115-net-macb-add-userio-bits-as-platform-configuration.patch
@@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  #ifdef CONFIG_MACB_USE_HWSTAMP
 --- a/drivers/net/ethernet/cadence/macb_main.c
 +++ b/drivers/net/ethernet/cadence/macb_main.c
-@@ -3831,15 +3831,15 @@ static int macb_init(struct platform_dev
+@@ -3824,15 +3824,15 @@ static int macb_init(struct platform_dev
  	if (!(bp->caps & MACB_CAPS_USRIO_DISABLED)) {
  		val = 0;
  		if (phy_interface_mode_is_rgmii(bp->phy_interface))
@@ -69,7 +69,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  		macb_or_gem_writel(bp, USRIO, val);
  	}
-@@ -4357,6 +4357,13 @@ static int fu540_c000_init(struct platfo
+@@ -4350,6 +4350,13 @@ static int fu540_c000_init(struct platfo
  	return macb_init(pdev);
  }
  
@@ -83,7 +83,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static const struct macb_config fu540_c000_config = {
  	.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO |
  		MACB_CAPS_GEM_HAS_PTP,
-@@ -4364,12 +4371,14 @@ static const struct macb_config fu540_c0
+@@ -4357,12 +4364,14 @@ static const struct macb_config fu540_c0
  	.clk_init = fu540_c000_clk_init,
  	.init = fu540_c000_init,
  	.jumbo_max_len = 10240,
@@ -98,7 +98,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static const struct macb_config sama5d3macb_config = {
-@@ -4377,6 +4386,7 @@ static const struct macb_config sama5d3m
+@@ -4370,6 +4379,7 @@ static const struct macb_config sama5d3m
  	      | MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII,
  	.clk_init = macb_clk_init,
  	.init = macb_init,
@@ -106,7 +106,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static const struct macb_config pc302gem_config = {
-@@ -4384,6 +4394,7 @@ static const struct macb_config pc302gem
+@@ -4377,6 +4387,7 @@ static const struct macb_config pc302gem
  	.dma_burst_length = 16,
  	.clk_init = macb_clk_init,
  	.init = macb_init,
@@ -114,7 +114,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static const struct macb_config sama5d2_config = {
-@@ -4391,6 +4402,7 @@ static const struct macb_config sama5d2_
+@@ -4384,6 +4395,7 @@ static const struct macb_config sama5d2_
  	.dma_burst_length = 16,
  	.clk_init = macb_clk_init,
  	.init = macb_init,
@@ -122,7 +122,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static const struct macb_config sama5d3_config = {
-@@ -4400,6 +4412,7 @@ static const struct macb_config sama5d3_
+@@ -4393,6 +4405,7 @@ static const struct macb_config sama5d3_
  	.clk_init = macb_clk_init,
  	.init = macb_init,
  	.jumbo_max_len = 10240,
@@ -130,7 +130,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static const struct macb_config sama5d4_config = {
-@@ -4407,18 +4420,21 @@ static const struct macb_config sama5d4_
+@@ -4400,18 +4413,21 @@ static const struct macb_config sama5d4_
  	.dma_burst_length = 4,
  	.clk_init = macb_clk_init,
  	.init = macb_init,
@@ -152,7 +152,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static const struct macb_config zynqmp_config = {
-@@ -4429,6 +4445,7 @@ static const struct macb_config zynqmp_c
+@@ -4422,6 +4438,7 @@ static const struct macb_config zynqmp_c
  	.clk_init = macb_clk_init,
  	.init = macb_init,
  	.jumbo_max_len = 10240,
@@ -160,7 +160,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static const struct macb_config zynq_config = {
-@@ -4437,6 +4454,7 @@ static const struct macb_config zynq_con
+@@ -4430,6 +4447,7 @@ static const struct macb_config zynq_con
  	.dma_burst_length = 16,
  	.clk_init = macb_clk_init,
  	.init = macb_init,
@@ -168,7 +168,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static const struct of_device_id macb_dt_ids[] = {
-@@ -4557,6 +4575,8 @@ static int macb_probe(struct platform_de
+@@ -4550,6 +4568,8 @@ static int macb_probe(struct platform_de
  		bp->wol |= MACB_WOL_HAS_MAGIC_PACKET;
  	device_set_wakeup_capable(&pdev->dev, bp->wol & MACB_WOL_HAS_MAGIC_PACKET);
  
diff --git a/target/linux/at91/patches-5.10/117-net-macb-add-function-to-disable-all-macb-clocks.patch b/target/linux/at91/patches-5.10/117-net-macb-add-function-to-disable-all-macb-clocks.patch
index a474f2a405..6541d32dd2 100644
--- a/target/linux/at91/patches-5.10/117-net-macb-add-function-to-disable-all-macb-clocks.patch
+++ b/target/linux/at91/patches-5.10/117-net-macb-add-function-to-disable-all-macb-clocks.patch
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/cadence/macb_main.c
 +++ b/drivers/net/ethernet/cadence/macb_main.c
-@@ -3606,6 +3606,20 @@ static void macb_probe_queues(void __iom
+@@ -3599,6 +3599,20 @@ static void macb_probe_queues(void __iom
  	*num_queues = hweight32(*queue_mask);
  }
  
@@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static int macb_clk_init(struct platform_device *pdev, struct clk **pclk,
  			 struct clk **hclk, struct clk **tx_clk,
  			 struct clk **rx_clk, struct clk **tsu_clk)
-@@ -4668,11 +4682,7 @@ err_out_free_netdev:
+@@ -4661,11 +4675,7 @@ err_out_free_netdev:
  	free_netdev(dev);
  
  err_disable_clocks:
@@ -48,7 +48,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	pm_runtime_disable(&pdev->dev);
  	pm_runtime_set_suspended(&pdev->dev);
  	pm_runtime_dont_use_autosuspend(&pdev->dev);
-@@ -4697,11 +4707,8 @@ static int macb_remove(struct platform_d
+@@ -4690,11 +4700,8 @@ static int macb_remove(struct platform_d
  		pm_runtime_disable(&pdev->dev);
  		pm_runtime_dont_use_autosuspend(&pdev->dev);
  		if (!pm_runtime_suspended(&pdev->dev)) {
@@ -62,7 +62,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  			pm_runtime_set_suspended(&pdev->dev);
  		}
  		phylink_destroy(bp->phylink);
-@@ -4880,13 +4887,10 @@ static int __maybe_unused macb_runtime_s
+@@ -4873,13 +4880,10 @@ static int __maybe_unused macb_runtime_s
  	struct net_device *netdev = dev_get_drvdata(dev);
  	struct macb *bp = netdev_priv(netdev);
  
diff --git a/target/linux/at91/patches-5.10/118-net-macb-unprepare-clocks-in-case-of-failure.patch b/target/linux/at91/patches-5.10/118-net-macb-unprepare-clocks-in-case-of-failure.patch
index 7456cc6c52..3e5d42b24f 100644
--- a/target/linux/at91/patches-5.10/118-net-macb-unprepare-clocks-in-case-of-failure.patch
+++ b/target/linux/at91/patches-5.10/118-net-macb-unprepare-clocks-in-case-of-failure.patch
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/cadence/macb_main.c
 +++ b/drivers/net/ethernet/cadence/macb_main.c
-@@ -4338,8 +4338,10 @@ static int fu540_c000_clk_init(struct pl
+@@ -4331,8 +4331,10 @@ static int fu540_c000_clk_init(struct pl
  		return err;
  
  	mgmt = devm_kzalloc(&pdev->dev, sizeof(*mgmt), GFP_KERNEL);
@@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	init.name = "sifive-gemgxl-mgmt";
  	init.ops = &fu540_c000_ops;
-@@ -4350,16 +4352,26 @@ static int fu540_c000_clk_init(struct pl
+@@ -4343,16 +4345,26 @@ static int fu540_c000_clk_init(struct pl
  	mgmt->hw.init = &init;
  
  	*tx_clk = devm_clk_register(&pdev->dev, &mgmt->hw);
diff --git a/target/linux/at91/patches-5.10/119-net-macb-add-support-for-sama7g5-gem-interface.patch b/target/linux/at91/patches-5.10/119-net-macb-add-support-for-sama7g5-gem-interface.patch
index 64abd3d6c0..1bc648842c 100644
--- a/target/linux/at91/patches-5.10/119-net-macb-add-support-for-sama7g5-gem-interface.patch
+++ b/target/linux/at91/patches-5.10/119-net-macb-add-support-for-sama7g5-gem-interface.patch
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/cadence/macb_main.c
 +++ b/drivers/net/ethernet/cadence/macb_main.c
-@@ -4390,6 +4390,14 @@ static const struct macb_usrio_config ma
+@@ -4383,6 +4383,14 @@ static const struct macb_usrio_config ma
  	.refclk = MACB_BIT(CLKEN),
  };
  
@@ -29,7 +29,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static const struct macb_config fu540_c000_config = {
  	.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO |
  		MACB_CAPS_GEM_HAS_PTP,
-@@ -4483,6 +4491,14 @@ static const struct macb_config zynq_con
+@@ -4476,6 +4484,14 @@ static const struct macb_config zynq_con
  	.usrio = &macb_default_usrio,
  };
  
@@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static const struct of_device_id macb_dt_ids[] = {
  	{ .compatible = "cdns,at32ap7000-macb" },
  	{ .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config },
-@@ -4500,6 +4516,7 @@ static const struct of_device_id macb_dt
+@@ -4493,6 +4509,7 @@ static const struct of_device_id macb_dt
  	{ .compatible = "cdns,zynqmp-gem", .data = &zynqmp_config},
  	{ .compatible = "cdns,zynq-gem", .data = &zynq_config },
  	{ .compatible = "sifive,fu540-c000-gem", .data = &fu540_c000_config },
diff --git a/target/linux/at91/patches-5.10/120-net-macb-add-support-for-sama7g5-emac-interface.patch b/target/linux/at91/patches-5.10/120-net-macb-add-support-for-sama7g5-emac-interface.patch
index 50d31f736b..4d49908ec9 100644
--- a/target/linux/at91/patches-5.10/120-net-macb-add-support-for-sama7g5-emac-interface.patch
+++ b/target/linux/at91/patches-5.10/120-net-macb-add-support-for-sama7g5-emac-interface.patch
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/cadence/macb_main.c
 +++ b/drivers/net/ethernet/cadence/macb_main.c
-@@ -4499,6 +4499,14 @@ static const struct macb_config sama7g5_
+@@ -4492,6 +4492,14 @@ static const struct macb_config sama7g5_
  	.usrio = &sama7g5_usrio,
  };
  
@@ -29,7 +29,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static const struct of_device_id macb_dt_ids[] = {
  	{ .compatible = "cdns,at32ap7000-macb" },
  	{ .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config },
-@@ -4517,6 +4525,7 @@ static const struct of_device_id macb_dt
+@@ -4510,6 +4518,7 @@ static const struct of_device_id macb_dt
  	{ .compatible = "cdns,zynq-gem", .data = &zynq_config },
  	{ .compatible = "sifive,fu540-c000-gem", .data = &fu540_c000_config },
  	{ .compatible = "microchip,sama7g5-gem", .data = &sama7g5_gem_config },
diff --git a/target/linux/at91/patches-5.10/148-net-macb-Add-default-usrio-config-to-default-gem-con.patch b/target/linux/at91/patches-5.10/148-net-macb-Add-default-usrio-config-to-default-gem-con.patch
index 721ddaea00..130646a0b3 100644
--- a/target/linux/at91/patches-5.10/148-net-macb-Add-default-usrio-config-to-default-gem-con.patch
+++ b/target/linux/at91/patches-5.10/148-net-macb-Add-default-usrio-config-to-default-gem-con.patch
@@ -20,7 +20,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/cadence/macb_main.c
 +++ b/drivers/net/ethernet/cadence/macb_main.c
-@@ -3868,6 +3868,13 @@ static int macb_init(struct platform_dev
+@@ -3861,6 +3861,13 @@ static int macb_init(struct platform_dev
  	return 0;
  }
  
@@ -34,7 +34,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  #if defined(CONFIG_OF)
  /* 1518 rounded up */
  #define AT91ETHER_MAX_RBUFF_SZ	0x600
-@@ -4383,13 +4390,6 @@ static int fu540_c000_init(struct platfo
+@@ -4376,13 +4383,6 @@ static int fu540_c000_init(struct platfo
  	return macb_init(pdev);
  }
  
@@ -48,7 +48,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static const struct macb_usrio_config sama7g5_usrio = {
  	.mii = 0,
  	.rmii = 1,
-@@ -4538,6 +4538,7 @@ static const struct macb_config default_
+@@ -4531,6 +4531,7 @@ static const struct macb_config default_
  	.dma_burst_length = 16,
  	.clk_init = macb_clk_init,
  	.init = macb_init,
diff --git a/target/linux/generic/backport-5.10/610-v5.13-55-netfilter-conntrack-Introduce-tcp-offload-timeout-co.patch b/target/linux/generic/backport-5.10/610-v5.13-55-netfilter-conntrack-Introduce-tcp-offload-timeout-co.patch
index abc58d2a7c..0d30b0c593 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-55-netfilter-conntrack-Introduce-tcp-offload-timeout-co.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-55-netfilter-conntrack-Introduce-tcp-offload-timeout-co.patch
@@ -33,7 +33,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  enum udp_conntrack {
 --- a/net/netfilter/nf_conntrack_proto_tcp.c
 +++ b/net/netfilter/nf_conntrack_proto_tcp.c
-@@ -1447,6 +1447,11 @@ void nf_conntrack_tcp_init_net(struct ne
+@@ -1457,6 +1457,11 @@ void nf_conntrack_tcp_init_net(struct ne
  	tn->tcp_loose = nf_ct_tcp_loose;
  	tn->tcp_be_liberal = nf_ct_tcp_be_liberal;
  	tn->tcp_max_retrans = nf_ct_tcp_max_retrans;
@@ -58,7 +58,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  	NF_SYSCTL_CT_PROTO_TCP_LOOSE,
  	NF_SYSCTL_CT_PROTO_TCP_LIBERAL,
  	NF_SYSCTL_CT_PROTO_TCP_MAX_RETRANS,
-@@ -758,6 +762,20 @@ static struct ctl_table nf_ct_sysctl_tab
+@@ -757,6 +761,20 @@ static struct ctl_table nf_ct_sysctl_tab
  		.mode		= 0644,
  		.proc_handler	= proc_dointvec_jiffies,
  	},
@@ -79,7 +79,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  	[NF_SYSCTL_CT_PROTO_TCP_LOOSE] = {
  		.procname	= "nf_conntrack_tcp_loose",
  		.maxlen		= sizeof(int),
-@@ -967,6 +985,12 @@ static void nf_conntrack_standalone_init
+@@ -960,6 +978,12 @@ static void nf_conntrack_standalone_init
  	XASSIGN(LIBERAL, &tn->tcp_be_liberal);
  	XASSIGN(MAX_RETRANS, &tn->tcp_max_retrans);
  #undef XASSIGN
diff --git a/target/linux/generic/backport-5.10/610-v5.13-56-netfilter-conntrack-Introduce-udp-offload-timeout-co.patch b/target/linux/generic/backport-5.10/610-v5.13-56-netfilter-conntrack-Introduce-udp-offload-timeout-co.patch
index 416e20356d..93ff24a941 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-56-netfilter-conntrack-Introduce-udp-offload-timeout-co.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-56-netfilter-conntrack-Introduce-udp-offload-timeout-co.patch
@@ -58,7 +58,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  	NF_SYSCTL_CT_PROTO_TIMEOUT_ICMP,
  	NF_SYSCTL_CT_PROTO_TIMEOUT_ICMPV6,
  #ifdef CONFIG_NF_CT_PROTO_SCTP
-@@ -810,6 +814,20 @@ static struct ctl_table nf_ct_sysctl_tab
+@@ -809,6 +813,20 @@ static struct ctl_table nf_ct_sysctl_tab
  		.mode		= 0644,
  		.proc_handler	= proc_dointvec_jiffies,
  	},
@@ -79,7 +79,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  	[NF_SYSCTL_CT_PROTO_TIMEOUT_ICMP] = {
  		.procname	= "nf_conntrack_icmp_timeout",
  		.maxlen		= sizeof(unsigned int),
-@@ -1078,6 +1096,10 @@ static int nf_conntrack_standalone_init_
+@@ -1070,6 +1088,10 @@ static int nf_conntrack_standalone_init_
  	table[NF_SYSCTL_CT_PROTO_TIMEOUT_ICMPV6].data = &nf_icmpv6_pernet(net)->timeout;
  	table[NF_SYSCTL_CT_PROTO_TIMEOUT_UDP].data = &un->timeouts[UDP_CT_UNREPLIED];
  	table[NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_STREAM].data = &un->timeouts[UDP_CT_REPLIED];
diff --git a/target/linux/generic/backport-5.10/613-v5.15-02-netfilter-conntrack-remove-offload_pickup-sysctl-aga.patch b/target/linux/generic/backport-5.10/613-v5.15-02-netfilter-conntrack-remove-offload_pickup-sysctl-aga.patch
index 0ed23e9614..71266c8a70 100644
--- a/target/linux/generic/backport-5.10/613-v5.15-02-netfilter-conntrack-remove-offload_pickup-sysctl-aga.patch
+++ b/target/linux/generic/backport-5.10/613-v5.15-02-netfilter-conntrack-remove-offload_pickup-sysctl-aga.patch
@@ -73,7 +73,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  
 --- a/net/netfilter/nf_conntrack_proto_tcp.c
 +++ b/net/netfilter/nf_conntrack_proto_tcp.c
-@@ -1450,7 +1450,6 @@ void nf_conntrack_tcp_init_net(struct ne
+@@ -1460,7 +1460,6 @@ void nf_conntrack_tcp_init_net(struct ne
  
  #if IS_ENABLED(CONFIG_NF_FLOW_TABLE)
  	tn->offload_timeout = 30 * HZ;
@@ -109,7 +109,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  #endif
  	NF_SYSCTL_CT_PROTO_TIMEOUT_ICMP,
  	NF_SYSCTL_CT_PROTO_TIMEOUT_ICMPV6,
-@@ -773,12 +771,6 @@ static struct ctl_table nf_ct_sysctl_tab
+@@ -772,12 +770,6 @@ static struct ctl_table nf_ct_sysctl_tab
  		.mode		= 0644,
  		.proc_handler	= proc_dointvec_jiffies,
  	},
@@ -122,7 +122,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  #endif
  	[NF_SYSCTL_CT_PROTO_TCP_LOOSE] = {
  		.procname	= "nf_conntrack_tcp_loose",
-@@ -821,12 +813,6 @@ static struct ctl_table nf_ct_sysctl_tab
+@@ -820,12 +812,6 @@ static struct ctl_table nf_ct_sysctl_tab
  		.mode		= 0644,
  		.proc_handler	= proc_dointvec_jiffies,
  	},
@@ -135,7 +135,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  #endif
  	[NF_SYSCTL_CT_PROTO_TIMEOUT_ICMP] = {
  		.procname	= "nf_conntrack_icmp_timeout",
-@@ -1006,7 +992,6 @@ static void nf_conntrack_standalone_init
+@@ -999,7 +985,6 @@ static void nf_conntrack_standalone_init
  
  #if IS_ENABLED(CONFIG_NF_FLOW_TABLE)
  	table[NF_SYSCTL_CT_PROTO_TIMEOUT_TCP_OFFLOAD].data = &tn->offload_timeout;
@@ -143,7 +143,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  #endif
  
  }
-@@ -1098,7 +1083,6 @@ static int nf_conntrack_standalone_init_
+@@ -1090,7 +1075,6 @@ static int nf_conntrack_standalone_init_
  	table[NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_STREAM].data = &un->timeouts[UDP_CT_REPLIED];
  #if IS_ENABLED(CONFIG_NF_FLOW_TABLE)
  	table[NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_OFFLOAD].data = &un->offload_timeout;
diff --git a/target/linux/generic/backport-5.10/732-v5.13-0008-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch b/target/linux/generic/backport-5.10/732-v5.13-0008-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch
index ae46508aeb..787d2cdf72 100644
--- a/target/linux/generic/backport-5.10/732-v5.13-0008-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch
+++ b/target/linux/generic/backport-5.10/732-v5.13-0008-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch
@@ -423,7 +423,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	if (bgmac->irq < 0)
 --- a/drivers/net/ethernet/cadence/macb_main.c
 +++ b/drivers/net/ethernet/cadence/macb_main.c
-@@ -4487,7 +4487,6 @@ static int macb_probe(struct platform_de
+@@ -4480,7 +4480,6 @@ static int macb_probe(struct platform_de
  	struct net_device *dev;
  	struct resource *regs;
  	void __iomem *mem;
@@ -431,7 +431,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	struct macb *bp;
  	int err, val;
  
-@@ -4600,15 +4599,11 @@ static int macb_probe(struct platform_de
+@@ -4593,15 +4592,11 @@ static int macb_probe(struct platform_de
  	if (bp->caps & MACB_CAPS_NEEDS_RSTONUBR)
  		bp->rx_intr_mask |= MACB_BIT(RXUBR);
  
@@ -1360,7 +1360,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	int irq;
 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
 +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
-@@ -5008,7 +5008,7 @@ int stmmac_dvr_probe(struct device *devi
+@@ -5013,7 +5013,7 @@ int stmmac_dvr_probe(struct device *devi
  	priv->wol_irq = res->wol_irq;
  	priv->lpi_irq = res->lpi_irq;
  
diff --git a/target/linux/generic/pending-5.10/110-v6.3-0001-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch b/target/linux/generic/pending-5.10/110-v6.3-0001-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch
index 9e76821d45..6090bbb329 100644
--- a/target/linux/generic/pending-5.10/110-v6.3-0001-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch
+++ b/target/linux/generic/pending-5.10/110-v6.3-0001-spidev-Add-Silicon-Labs-EM3581-device-compatible.patch
@@ -11,7 +11,7 @@ Signed-off-by: Vincent Tremblay <vincent at vtremblay.dev>
 
 --- a/drivers/spi/spidev.c
 +++ b/drivers/spi/spidev.c
-@@ -693,6 +693,7 @@ static const struct of_device_id spidev_
+@@ -691,6 +691,7 @@ static const struct of_device_id spidev_
  	{ .compatible = "lwn,bk4" },
  	{ .compatible = "dh,dhcom-board" },
  	{ .compatible = "menlo,m53cpld" },
diff --git a/target/linux/generic/pending-5.10/110-v6.3-0002-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch b/target/linux/generic/pending-5.10/110-v6.3-0002-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch
index b2f0198042..19b7a0a4e5 100644
--- a/target/linux/generic/pending-5.10/110-v6.3-0002-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch
+++ b/target/linux/generic/pending-5.10/110-v6.3-0002-spidev-Add-Silicon-Labs-SI3210-device-compatible.patch
@@ -12,7 +12,7 @@ Signed-off-by: Vincent Tremblay <vincent at vtremblay.dev>
 
 --- a/drivers/spi/spidev.c
 +++ b/drivers/spi/spidev.c
-@@ -694,6 +694,7 @@ static const struct of_device_id spidev_
+@@ -692,6 +692,7 @@ static const struct of_device_id spidev_
  	{ .compatible = "dh,dhcom-board" },
  	{ .compatible = "menlo,m53cpld" },
  	{ .compatible = "silabs,em3581" },
diff --git a/target/linux/generic/pending-5.10/613-netfilter_optional_tcp_window_check.patch b/target/linux/generic/pending-5.10/613-netfilter_optional_tcp_window_check.patch
index 458b6761bc..79fd2762b3 100644
--- a/target/linux/generic/pending-5.10/613-netfilter_optional_tcp_window_check.patch
+++ b/target/linux/generic/pending-5.10/613-netfilter_optional_tcp_window_check.patch
@@ -49,7 +49,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static bool enable_hooks __read_mostly;
  MODULE_PARM_DESC(enable_hooks, "Always enable conntrack hooks");
  module_param(enable_hooks, bool, 0000);
-@@ -658,6 +661,7 @@ enum nf_ct_sysctl_index {
+@@ -657,6 +660,7 @@ enum nf_ct_sysctl_index {
  	NF_SYSCTL_CT_PROTO_TIMEOUT_GRE_STREAM,
  #endif
  
@@ -57,7 +57,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	__NF_SYSCTL_CT_LAST_SYSCTL,
  };
  
-@@ -1000,6 +1004,13 @@ static struct ctl_table nf_ct_sysctl_tab
+@@ -993,6 +997,13 @@ static struct ctl_table nf_ct_sysctl_tab
  		.proc_handler   = proc_dointvec_jiffies,
  	},
  #endif
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 f2ab205f26..eaab1edc6e 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
@@ -53,7 +53,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  
 --- a/net/ipv4/fib_semantics.c
 +++ b/net/ipv4/fib_semantics.c
-@@ -142,6 +142,10 @@ const struct fib_prop fib_props[RTN_MAX
+@@ -143,6 +143,10 @@ const struct fib_prop fib_props[RTN_MAX
  		.error	= -EINVAL,
  		.scope	= RT_SCOPE_NOWHERE,
  	},
diff --git a/target/linux/ipq806x/patches-5.10/108-v5.14-net-stmmac-explicitly-deassert-gmac-ahb-reset.patch b/target/linux/ipq806x/patches-5.10/108-v5.14-net-stmmac-explicitly-deassert-gmac-ahb-reset.patch
index 64efbd74c5..907fcf832b 100644
--- a/target/linux/ipq806x/patches-5.10/108-v5.14-net-stmmac-explicitly-deassert-gmac-ahb-reset.patch
+++ b/target/linux/ipq806x/patches-5.10/108-v5.14-net-stmmac-explicitly-deassert-gmac-ahb-reset.patch
@@ -29,7 +29,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
 +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
-@@ -5041,6 +5041,10 @@ int stmmac_dvr_probe(struct device *devi
+@@ -5046,6 +5046,10 @@ int stmmac_dvr_probe(struct device *devi
  			reset_control_reset(priv->plat->stmmac_rst);
  	}
  
@@ -40,7 +40,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	/* Init MAC and get the capabilities */
  	ret = stmmac_hw_init(priv);
  	if (ret)
-@@ -5255,6 +5259,7 @@ int stmmac_dvr_remove(struct device *dev
+@@ -5260,6 +5264,7 @@ int stmmac_dvr_remove(struct device *dev
  	phylink_destroy(priv->phylink);
  	if (priv->plat->stmmac_rst)
  		reset_control_assert(priv->plat->stmmac_rst);
diff --git a/target/linux/realtek/patches-5.10/800-net-mdio-support-hardware-assisted-indirect-access.patch b/target/linux/realtek/patches-5.10/800-net-mdio-support-hardware-assisted-indirect-access.patch
index eeb26fa199..aca017c03a 100644
--- a/target/linux/realtek/patches-5.10/800-net-mdio-support-hardware-assisted-indirect-access.patch
+++ b/target/linux/realtek/patches-5.10/800-net-mdio-support-hardware-assisted-indirect-access.patch
@@ -32,7 +32,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
 
 --- a/drivers/net/phy/mdio_bus.c
 +++ b/drivers/net/phy/mdio_bus.c
-@@ -734,6 +734,32 @@ out:
+@@ -739,6 +739,32 @@ out:
  }
  
  /**
@@ -65,7 +65,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * __mdiobus_read - Unlocked version of the mdiobus_read function
   * @bus: the mii_bus struct
   * @addr: the phy address
-@@ -749,7 +775,10 @@ int __mdiobus_read(struct mii_bus *bus,
+@@ -754,7 +780,10 @@ int __mdiobus_read(struct mii_bus *bus,
  
  	WARN_ON_ONCE(!mutex_is_locked(&bus->mdio_lock));
  
@@ -77,7 +77,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  
  	trace_mdio_access(bus, 1, addr, regnum, retval, retval);
  	mdiobus_stats_acct(&bus->stats[addr], true, retval);
-@@ -759,6 +788,40 @@ int __mdiobus_read(struct mii_bus *bus,
+@@ -764,6 +793,40 @@ int __mdiobus_read(struct mii_bus *bus,
  EXPORT_SYMBOL(__mdiobus_read);
  
  /**
@@ -118,7 +118,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * __mdiobus_write - Unlocked version of the mdiobus_write function
   * @bus: the mii_bus struct
   * @addr: the phy address
-@@ -775,7 +838,10 @@ int __mdiobus_write(struct mii_bus *bus,
+@@ -780,7 +843,10 @@ int __mdiobus_write(struct mii_bus *bus,
  
  	WARN_ON_ONCE(!mutex_is_locked(&bus->mdio_lock));
  
@@ -130,7 +130,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  
  	trace_mdio_access(bus, 0, addr, regnum, val, err);
  	mdiobus_stats_acct(&bus->stats[addr], false, err);
-@@ -785,6 +851,39 @@ int __mdiobus_write(struct mii_bus *bus,
+@@ -790,6 +856,39 @@ int __mdiobus_write(struct mii_bus *bus,
  EXPORT_SYMBOL(__mdiobus_write);
  
  /**
@@ -170,7 +170,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * __mdiobus_modify_changed - Unlocked version of the mdiobus_modify function
   * @bus: the mii_bus struct
   * @addr: the phy address
-@@ -817,6 +916,43 @@ int __mdiobus_modify_changed(struct mii_
+@@ -822,6 +921,43 @@ int __mdiobus_modify_changed(struct mii_
  EXPORT_SYMBOL_GPL(__mdiobus_modify_changed);
  
  /**
@@ -214,7 +214,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * mdiobus_read_nested - Nested version of the mdiobus_read function
   * @bus: the mii_bus struct
   * @addr: the phy address
-@@ -842,6 +978,79 @@ int mdiobus_read_nested(struct mii_bus *
+@@ -847,6 +983,79 @@ int mdiobus_read_nested(struct mii_bus *
  EXPORT_SYMBOL(mdiobus_read_nested);
  
  /**
@@ -294,7 +294,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * mdiobus_read - Convenience function for reading a given MII mgmt register
   * @bus: the mii_bus struct
   * @addr: the phy address
-@@ -864,6 +1073,29 @@ int mdiobus_read(struct mii_bus *bus, in
+@@ -869,6 +1078,29 @@ int mdiobus_read(struct mii_bus *bus, in
  EXPORT_SYMBOL(mdiobus_read);
  
  /**
@@ -324,7 +324,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * mdiobus_write_nested - Nested version of the mdiobus_write function
   * @bus: the mii_bus struct
   * @addr: the phy address
-@@ -890,6 +1122,33 @@ int mdiobus_write_nested(struct mii_bus
+@@ -895,6 +1127,33 @@ int mdiobus_write_nested(struct mii_bus
  EXPORT_SYMBOL(mdiobus_write_nested);
  
  /**
@@ -358,7 +358,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * mdiobus_write - Convenience function for writing a given MII mgmt register
   * @bus: the mii_bus struct
   * @addr: the phy address
-@@ -913,6 +1172,30 @@ int mdiobus_write(struct mii_bus *bus, i
+@@ -918,6 +1177,30 @@ int mdiobus_write(struct mii_bus *bus, i
  EXPORT_SYMBOL(mdiobus_write);
  
  /**
@@ -389,7 +389,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * mdiobus_modify - Convenience function for modifying a given mdio device
   *	register
   * @bus: the mii_bus struct
-@@ -934,6 +1217,51 @@ int mdiobus_modify(struct mii_bus *bus,
+@@ -939,6 +1222,51 @@ int mdiobus_modify(struct mii_bus *bus,
  EXPORT_SYMBOL_GPL(mdiobus_modify);
  
  /**



From lede-commits at lists.infradead.org  Fri Feb  3 02:31:57 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 05:31:57 -0500
Subject: [openwrt/openwrt]  mbedtls: x509 crt verify SAN iPAddress
In-Reply-To: <167542031754.1875178.9394523360922634447@git-01.infra.openwrt.org>
References: <167542031754.1875178.9394523360922634447@git-01.infra.openwrt.org>
Message-ID: <mailman.12079.1675420327.3064139.lede-commits@lists.infradead.org>

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

commit 2a691fc7f2bac365d147beb593be4331f11c5dca
Author: Glenn Strauss <gstrauss at gluelogic.com>
AuthorDate: Thu Oct 27 22:26:48 2022 -0400

    mbedtls: x509 crt verify SAN iPAddress
    
    backport from
    X509 crt verify SAN iPAddress
    https://github.com/Mbed-TLS/mbedtls/pull/6475
    
    addresses
    curl built with mbedtls fails on https://1.1.1.1/ (IP address in SubjectAltName)
    https://github.com/Mbed-TLS/mbedtls/issues/6473
    
    filed for
    mbedTLS: BADCERT_CN_MISMATCH on https://1.1.1.1 with curl+mbedtls
    https://github.com/openwrt/packages/issues/19677
    
    Signed-off-by: Glenn Strauss <gstrauss at gluelogic.com>
---
 package/libs/mbedtls/Makefile                      |   2 +-
 .../100-x509-crt-verify-SAN-iPAddress.patch        | 181 +++++++++++++++++++++
 2 files changed, 182 insertions(+), 1 deletion(-)

diff --git a/package/libs/mbedtls/Makefile b/package/libs/mbedtls/Makefile
index 2ae3fdbe2a..02d076d18f 100644
--- a/package/libs/mbedtls/Makefile
+++ b/package/libs/mbedtls/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=mbedtls
 PKG_VERSION:=2.28.2
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_USE_MIPS16:=0
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
diff --git a/package/libs/mbedtls/patches/100-x509-crt-verify-SAN-iPAddress.patch b/package/libs/mbedtls/patches/100-x509-crt-verify-SAN-iPAddress.patch
new file mode 100644
index 0000000000..357ec44649
--- /dev/null
+++ b/package/libs/mbedtls/patches/100-x509-crt-verify-SAN-iPAddress.patch
@@ -0,0 +1,181 @@
+From 272d48fe7a2ff00285d4ee166d3a9beca1d5122f Mon Sep 17 00:00:00 2001
+From: Glenn Strauss <gstrauss at gluelogic.com>
+Date: Sun, 23 Oct 2022 19:48:18 -0400
+Subject: [PATCH 1/4] x509 crt verify SAN iPAddress
+
+Signed-off-by: Glenn Strauss <gstrauss at gluelogic.com>
+---
+ include/mbedtls/x509_crt.h |   2 +-
+ library/x509_crt.c         | 115 +++++++++++++++++++++++++++++--------
+ 2 files changed, 93 insertions(+), 24 deletions(-)
+
+--- a/include/mbedtls/x509_crt.h
++++ b/include/mbedtls/x509_crt.h
+@@ -597,7 +597,7 @@ int mbedtls_x509_crt_verify_info( char *
+  * \param cn       The expected Common Name. This will be checked to be
+  *                 present in the certificate's subjectAltNames extension or,
+  *                 if this extension is absent, as a CN component in its
+- *                 Subject name. Currently only DNS names are supported. This
++ *                 Subject name. DNS names and IP addresses are supported. This
+  *                 may be \c NULL if the CN need not be verified.
+  * \param flags    The address at which to store the result of the verification.
+  *                 If the verification couldn't be completed, the flag value is
+--- a/library/x509_crt.c
++++ b/library/x509_crt.c
+@@ -2986,6 +2986,54 @@ find_parent:
+     }
+ }
+ 
++#ifdef _WIN32
++/* ??? */
++#elif defined(__sun)
++/* Solaris requires -lsocket -lnsl for inet_pton() */
++#elif defined(__has_include)
++#if __has_include(<sys/socket.h>)
++#include <sys/socket.h>
++#endif
++#if __has_include(<arpa/inet.h>)
++#include <arpa/inet.h>
++#endif
++#endif
++
++/* Use whether or not AF_INET6 is defined to indicate whether or not to use
++ * the platform inet_pton() or a local implementation (below).  The local
++ * implementation may be used even in cases where the platform provides
++ * inet_pton(), e.g. when there are different includes required and/or the
++ * platform implementation requires dependencies on additional libraries.
++ * Specifically, Windows requires custom includes and additional link
++ * dependencies, and Solaris requires additional link dependencies.
++ * Also, as a coarse heuristic, use the local implementation if the compiler
++ * does not support __has_include(), or if the definition of AF_INET6 is not
++ * provided by headers included (or not) via __has_include() above. */
++#ifndef AF_INET6
++
++#define x509_cn_inet_pton( cn, dst ) ( 0 )
++
++#else
++
++static int x509_inet_pton_ipv6( const char *src, void *dst )
++{
++    return( inet_pton( AF_INET6, src, dst ) == 1 ? 0 : -1 );
++}
++
++static int x509_inet_pton_ipv4( const char *src, void *dst )
++{
++    return( inet_pton( AF_INET, src, dst ) == 1 ? 0 : -1 );
++}
++
++#endif /* AF_INET6 */
++
++static size_t x509_cn_inet_pton( const char *cn, void *dst )
++{
++    return( strchr( cn, ':' ) == NULL
++            ? x509_inet_pton_ipv4( cn, dst ) == 0 ? 4 : 0
++            : x509_inet_pton_ipv6( cn, dst ) == 0 ? 16 : 0 );
++}
++
+ /*
+  * Check for CN match
+  */
+@@ -3008,23 +3056,51 @@ static int x509_crt_check_cn( const mbed
+     return( -1 );
+ }
+ 
++static int x509_crt_check_san_ip( const mbedtls_x509_sequence *san,
++                                  const char *cn, size_t cn_len )
++{
++    uint32_t ip[4];
++    cn_len = x509_cn_inet_pton( cn, ip );
++    if( cn_len == 0 )
++        return( -1 );
++
++    for( const mbedtls_x509_sequence *cur = san; cur != NULL; cur = cur->next )
++    {
++        const unsigned char san_type = (unsigned char) cur->buf.tag &
++                                       MBEDTLS_ASN1_TAG_VALUE_MASK;
++        if( san_type == MBEDTLS_X509_SAN_IP_ADDRESS &&
++            cur->buf.len == cn_len && memcmp( cur->buf.p, ip, cn_len ) == 0 )
++            return( 0 );
++    }
++
++    return( -1 );
++}
++
+ /*
+  * Check for SAN match, see RFC 5280 Section 4.2.1.6
+  */
+-static int x509_crt_check_san( const mbedtls_x509_buf *name,
++static int x509_crt_check_san( const mbedtls_x509_sequence *san,
+                                const char *cn, size_t cn_len )
+ {
+-    const unsigned char san_type = (unsigned char) name->tag &
+-                                   MBEDTLS_ASN1_TAG_VALUE_MASK;
+-
+-    /* dNSName */
+-    if( san_type == MBEDTLS_X509_SAN_DNS_NAME )
+-        return( x509_crt_check_cn( name, cn, cn_len ) );
+-
+-    /* (We may handle other types here later.) */
++    int san_ip = 0;
++    for( const mbedtls_x509_sequence *cur = san; cur != NULL; cur = cur->next )
++    {
++        switch( (unsigned char) cur->buf.tag & MBEDTLS_ASN1_TAG_VALUE_MASK )
++        {
++        case MBEDTLS_X509_SAN_DNS_NAME:                    /* dNSName */
++            if( x509_crt_check_cn( &cur->buf, cn, cn_len ) == 0 )
++                return( 0 );
++            break;
++        case MBEDTLS_X509_SAN_IP_ADDRESS:                  /* iPAddress */
++            san_ip = 1;
++            break;
++        /* (We may handle other types here later.) */
++        default: /* Unrecognized type */
++            break;
++        }
++    }
+ 
+-    /* Unrecognized type */
+-    return( -1 );
++    return( san_ip ? x509_crt_check_san_ip( san, cn, cn_len ) : -1 );
+ }
+ 
+ /*
+@@ -3035,19 +3111,12 @@ static void x509_crt_verify_name( const
+                                   uint32_t *flags )
+ {
+     const mbedtls_x509_name *name;
+-    const mbedtls_x509_sequence *cur;
+     size_t cn_len = strlen( cn );
+ 
+     if( crt->ext_types & MBEDTLS_X509_EXT_SUBJECT_ALT_NAME )
+     {
+-        for( cur = &crt->subject_alt_names; cur != NULL; cur = cur->next )
+-        {
+-            if( x509_crt_check_san( &cur->buf, cn, cn_len ) == 0 )
+-                break;
+-        }
+-
+-        if( cur == NULL )
+-            *flags |= MBEDTLS_X509_BADCERT_CN_MISMATCH;
++        if( x509_crt_check_san( &crt->subject_alt_names, cn, cn_len ) == 0 )
++            return;
+     }
+     else
+     {
+@@ -3056,13 +3125,13 @@ static void x509_crt_verify_name( const
+             if( MBEDTLS_OID_CMP( MBEDTLS_OID_AT_CN, &name->oid ) == 0 &&
+                 x509_crt_check_cn( &name->val, cn, cn_len ) == 0 )
+             {
+-                break;
++                return;
+             }
+         }
+ 
+-        if( name == NULL )
+-            *flags |= MBEDTLS_X509_BADCERT_CN_MISMATCH;
+     }
++
++    *flags |= MBEDTLS_X509_BADCERT_CN_MISMATCH;
+ }
+ 
+ /*



From lede-commits at lists.infradead.org  Fri Feb  3 02:36:10 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 05:36:10 -0500
Subject: [openwrt/openwrt]  mvebu/uDPU: simplify grep usage
In-Reply-To: <167542057044.1877273.7760094705223835519@git-01.infra.openwrt.org>
References: <167542057044.1877273.7760094705223835519@git-01.infra.openwrt.org>
Message-ID: <mailman.12084.1675420574.3064139.lede-commits@lists.infradead.org>

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

commit 7be11ee35ec5b95d9629ce316fbf1a91439b2f02
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sat Aug 20 13:50:40 2022 -0700

    mvebu/uDPU: simplify grep usage
    
    Instead of using the shell's evaluation, use grep's -q parameter.
    
    Found with shellcheck's SC2143.
    
    Also replaced a head call with grep's -m.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 .../linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh   | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh b/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh
index 0bb1dd12cc..1d65a5437b 100644
--- a/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh
+++ b/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh
@@ -18,10 +18,10 @@ udpu_check_emmc() {
 }
 
 udpu_part_prep() {
-	 if [ "$(grep $1 /proc/mounts)" ]; then
-		mounted_part="$(grep $1 /proc/mounts | awk '{print $2}' | head -1)"
+	 if grep -q "$1" /proc/mounts; then
+		mounted_part="$(grep -m 1 $1 /proc/mounts | awk '{print $2}')"
 		umount $mounted_part
-		[ "$(grep -wo $mounted_part /proc/mounts)" ] && umount -l $mounted_part
+		grep -woq "$mounted_part" /proc/mounts && umount -l "$mounted_part"
 	fi
 }
 
@@ -52,7 +52,7 @@ udpu_do_part_check() {
 }
 
 udpu_do_misc_prep() {
-	if [ ! "$(grep -wo /misc /proc/mounts)" ]; then
+	if ! grep -woq /misc /proc/mounts; then
 		mkdir -p /misc
 		mount ${emmc_dev}p4 /misc
 
@@ -97,13 +97,13 @@ udpu_do_initial_setup() {
 
 udpu_do_regular_upgrade() {
 	# Clean /boot partition - mfks.ext4 is not available in chroot
-	[ "$(grep -wo /boot /proc/mounts)" ] && umount /boot
+	grep -woq /boot /proc/mounts && umount /boot
 	mkdir -p /tmp/boot
 	mount ${emmc_dev}p1 /tmp/boot
 	rm -rf /tmp/boot/*
 
 	# Clean /root partition - mkfs.f2fs is not available in chroot
-	[ "$(grep -wo /dev/root /proc/mounts)" ] && umount /
+	grep -woq /dev/root /proc/mounts && umount /
 	mkdir -p /tmp/rootpart
 	mount ${emmc_dev}p3 /tmp/rootpart
 	rm -rf /tmp/rootpart/*
@@ -139,7 +139,7 @@ platform_do_upgrade_uDPU() {
 	for part in ${tmp_parts}; do
 		umount $part
 		# Force umount is necessary
-		[ "$(grep "${part}" /proc/mounts)" ] && umount -l $part
+		grep -q "${part}" /proc/mounts && umount -l "$part"
 	done
 
 	# Sysupgrade complains about /tmp and /dev, so we can detach them here



From lede-commits at lists.infradead.org  Fri Feb  3 02:36:12 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 05:36:12 -0500
Subject: [openwrt/openwrt]  mvebu/uDPU: remove $? usage
In-Reply-To: <167542057044.1877273.7760094705223835519@git-01.infra.openwrt.org>
References: <167542057044.1877273.7760094705223835519@git-01.infra.openwrt.org>
Message-ID: <mailman.12085.1675420574.3064139.lede-commits@lists.infradead.org>

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

commit cb6df29cbd45f11edc52e081c6a30af2dd69aad5
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sat Aug 20 14:02:58 2022 -0700

    mvebu/uDPU: remove $? usage
    
    shellcheck warns against it with SC2086. It also hides a bug that
    shellcheck marks with SC2015. Fixed those with explicit if/else.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 .../mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh | 30 +++++++++++++---------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh b/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh
index 437222e08a..92102e8d14 100644
--- a/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh
+++ b/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh
@@ -42,8 +42,11 @@ udpu_do_part_check() {
 		# Format the /misc part right away as we will need it for the firmware
 		printf "Formating /misc partition, this make take a while..\n"
 		udpu_part_prep ${emmc_dev}p4
-		mkfs.f2fs -q -l misc ${emmc_dev}p4
-		[ $? -eq 0 ] && printf "/misc partition formated successfully\n" || printf "/misc partition formatting failed\n"
+		if mkfs.f2fs -q -l misc ${emmc_dev}p4; then
+			printf "/misc partition formated successfully\n"
+		else
+			printf "/misc partition formatting failed\n"
+		fi
 
 		udpu_do_initial_setup
 	else
@@ -54,19 +57,17 @@ udpu_do_part_check() {
 udpu_do_misc_prep() {
 	if ! grep -woq /misc /proc/mounts; then
 		mkdir -p /misc
-		mount ${emmc_dev}p4 /misc
 
 		# If the mount fails, try to reformat partition
 		# Leaving possiblity for multiple iterations
-		if [ $? -ne 0 ]; then
+		if ! mount ${emmc_dev}p4 /misc; then
 			printf "Error while mounting /misc, trying to reformat..\n"
 
 			format_count=0
 			while [ "$format_count" -lt "1" ]; do
 				udpu_part_prep ${emmc_dev}p4
 				mkfs.f2fs -q -l misc ${emmc_dev}p4
-				mount ${emmc_dev}p4 /misc
-				if [ $? -ne 0 ]; then
+				if ! mount ${emmc_dev}p4 /misc; then
 					umount -l /misc
 					printf "Failed while mounting /misc\n"
 					format_count=$((format_count +1))
@@ -91,8 +92,7 @@ udpu_do_initial_setup() {
 	# Prepare /root partition
 	printf "Formating /root partition, this may take a while..\n"
 	udpu_part_prep ${emmc_dev}p3
-	mkfs.f2fs -q -l rootfs ${emmc_dev}p3
-	[ $? -eq 0 ] && printf "/root partition reformated\n"
+	mkfs.f2fs -q -l rootfs ${emmc_dev}p3 && printf "/root partition reformated\n"
 }
 
 udpu_do_regular_upgrade() {
@@ -122,13 +122,19 @@ platform_do_upgrade_uDPU() {
 	udpu_do_regular_upgrade
 
 	printf "Updating /boot partition\n"
-	tar xzf /misc/firmware/boot.tgz -C /tmp/boot
-	[ $? -eq 0 ] && printf "/boot partition updated successfully\n" || printf "/boot partition update failed\n"
+	if tar xzf /misc/firmware/boot.tgz -C /tmp/boot; then
+		printf "/boot partition updated successfully\n"
+	else
+		printf "/boot partition update failed\n"
+	fi
 	sync
 
 	printf "Updating /root partition\n"
-	tar xzf /misc/firmware/rootfs.tgz -C /tmp/rootpart
-	[ $? -eq 0 ] && printf "/root partition updated successfully\n" || printf "/root partition update failed\n"
+	if tar xzf /misc/firmware/rootfs.tgz -C /tmp/rootpart; then
+		printf "/root partition updated successfully\n"
+	else
+		printf "/root partition update failed\n"
+	fi
 	sync
 
 	# Saving configuration files over sysupgrade



From lede-commits at lists.infradead.org  Fri Feb  3 02:36:13 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 05:36:13 -0500
Subject: [openwrt/openwrt]  mvebu/uDPU: add quotes to unmount file
In-Reply-To: <167542057044.1877273.7760094705223835519@git-01.infra.openwrt.org>
References: <167542057044.1877273.7760094705223835519@git-01.infra.openwrt.org>
Message-ID: <mailman.12086.1675420575.3064139.lede-commits@lists.infradead.org>

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

commit 822c554d5755301337bce959554bf973b4292322
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sat Aug 20 14:10:21 2022 -0700

    mvebu/uDPU: add quotes to unmount file
    
    This is the last relevant shellcheck warning thrown.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh b/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh
index 92102e8d14..b01ad607ee 100644
--- a/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh
+++ b/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh
@@ -20,7 +20,7 @@ udpu_check_emmc() {
 udpu_part_prep() {
 	 if grep -q "$1" /proc/mounts; then
 		mounted_part="$(grep -m 1 $1 /proc/mounts | awk '{print $2}')"
-		umount $mounted_part
+		umount "$mounted_part"
 		grep -woq "$mounted_part" /proc/mounts && umount -l "$mounted_part"
 	fi
 }
@@ -143,7 +143,7 @@ platform_do_upgrade_uDPU() {
 	# Remove tmp mounts
 	tmp_parts=$(grep "${emmc_dev}" /proc/mounts | awk '{print $2}')
 	for part in ${tmp_parts}; do
-		umount $part
+		umount "$part"
 		# Force umount is necessary
 		grep -q "${part}" /proc/mounts && umount -l "$part"
 	done



From lede-commits at lists.infradead.org  Fri Feb  3 02:36:11 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 05:36:11 -0500
Subject: [openwrt/openwrt]  mvebu/uDPU: remove echo y
In-Reply-To: <167542057044.1877273.7760094705223835519@git-01.infra.openwrt.org>
References: <167542057044.1877273.7760094705223835519@git-01.infra.openwrt.org>
Message-ID: <mailman.12087.1675420579.3064139.lede-commits@lists.infradead.org>

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

commit 3b80b8e560a0d1414c2ed9f2a2e0e1cc3e0e0e87
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sat Aug 20 13:56:51 2022 -0700

    mvebu/uDPU: remove echo y
    
    It's a bit of a hack. mkfs.ext4 has an -F parameter that does the same
    thing.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh b/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh
index 1d65a5437b..437222e08a 100644
--- a/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh
+++ b/target/linux/mvebu/cortexa53/base-files/lib/upgrade/uDPU.sh
@@ -82,11 +82,11 @@ udpu_do_misc_prep() {
 udpu_do_initial_setup() {
 	# Prepare /recovery parition
 	udpu_part_prep ${emmc_dev}p2
-	mkfs.ext4 -q ${emmc_dev}p2 | echo y &> /dev/null
+	mkfs.ext4 -qF ${emmc_dev}p2 2>&1 /dev/null
 
 	# Prepare /boot partition
 	udpu_part_prep ${emmc_dev}p1
-	mkfs.ext4 -q ${emmc_dev}p1 | echo y &> /dev/null
+	mkfs.ext4 -qF ${emmc_dev}p1 2>&1 /dev/null
 
 	# Prepare /root partition
 	printf "Formating /root partition, this may take a while..\n"



From lede-commits at lists.infradead.org  Fri Feb  3 02:45:14 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 05:45:14 -0500
Subject: [openwrt/openwrt]  kernel: backport some mv88e6xxx devlink patches
In-Reply-To: <167542111472.1882338.11562519745125449846@git-01.infra.openwrt.org>
References: <167542111472.1882338.11562519745125449846@git-01.infra.openwrt.org>
Message-ID: <mailman.12090.1675421120.3064139.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/428d720c7f90715aa535b42f24cbe0293966ec15

commit 428d720c7f90715aa535b42f24cbe0293966ec15
Author: Etienne Champetier <champetier.etienne at gmail.com>
AuthorDate: Mon Jan 30 23:43:00 2023 +0200

    kernel: backport some mv88e6xxx devlink patches
    
    This should help debug mv88e6xxx issues
    
    Signed-off-by: Etienne Champetier <champetier.etienne at gmail.com>
---
 ...sa-mv88e6xxx-Export-VTU-as-devlink-region.patch | 191 +++++++++++++++++++++
 ...8e6xxx-Add-helper-to-get-a-chip-s-max_vid.patch | 153 +++++++++++++++++
 ...8e6xxx-Fix-off-by-one-in-VTU-devlink-regi.patch |  30 ++++
 3 files changed, 374 insertions(+)

diff --git a/target/linux/generic/backport-5.10/890-v5.11-net-dsa-mv88e6xxx-Export-VTU-as-devlink-region.patch b/target/linux/generic/backport-5.10/890-v5.11-net-dsa-mv88e6xxx-Export-VTU-as-devlink-region.patch
new file mode 100644
index 0000000000..a753be340d
--- /dev/null
+++ b/target/linux/generic/backport-5.10/890-v5.11-net-dsa-mv88e6xxx-Export-VTU-as-devlink-region.patch
@@ -0,0 +1,191 @@
+From ca4d632aef031c7946c42a6eb873d24ab6474f17 Mon Sep 17 00:00:00 2001
+From: Tobias Waldekranz <tobias at waldekranz.com>
+Date: Mon, 9 Nov 2020 09:29:27 +0100
+Subject: [PATCH] net: dsa: mv88e6xxx: Export VTU as devlink region
+
+Export the raw VTU data and related registers in a devlink region so
+that it can be inspected from userspace and compared to the current
+bridge configuration.
+
+Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
+Reviewed-by: Andrew Lunn <andrew at lunn.ch>
+Link: https://lore.kernel.org/r/20201109082927.8684-1-tobias at waldekranz.com
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
+---
+ drivers/net/dsa/mv88e6xxx/chip.h        |   1 +
+ drivers/net/dsa/mv88e6xxx/devlink.c     | 105 +++++++++++++++++++++++-
+ drivers/net/dsa/mv88e6xxx/global1.h     |   2 +
+ drivers/net/dsa/mv88e6xxx/global1_vtu.c |   4 +-
+ 4 files changed, 109 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/dsa/mv88e6xxx/chip.h
++++ b/drivers/net/dsa/mv88e6xxx/chip.h
+@@ -246,6 +246,7 @@ enum mv88e6xxx_region_id {
+ 	MV88E6XXX_REGION_GLOBAL1 = 0,
+ 	MV88E6XXX_REGION_GLOBAL2,
+ 	MV88E6XXX_REGION_ATU,
++	MV88E6XXX_REGION_VTU,
+ 
+ 	_MV88E6XXX_REGION_MAX,
+ };
+--- a/drivers/net/dsa/mv88e6xxx/devlink.c
++++ b/drivers/net/dsa/mv88e6xxx/devlink.c
+@@ -417,6 +417,92 @@ out:
+ 	return err;
+ }
+ 
++/**
++ * struct mv88e6xxx_devlink_vtu_entry - Devlink VTU entry
++ * @fid:   Global1/2:   FID and VLAN policy.
++ * @sid:   Global1/3:   SID, unknown filters and learning.
++ * @op:    Global1/5:   FID (old chipsets).
++ * @vid:   Global1/6:   VID, valid, and page.
++ * @data:  Global1/7-9: Membership data and priority override.
++ * @resvd: Reserved. Also happens to align the size to 16B.
++ *
++ * The VTU entry format varies between chipset generations, the
++ * descriptions above represent the superset of all possible
++ * information, not all fields are valid on all devices. Since this is
++ * a low-level debug interface, copy all data verbatim and defer
++ * parsing to the consumer.
++ */
++struct mv88e6xxx_devlink_vtu_entry {
++	u16 fid;
++	u16 sid;
++	u16 op;
++	u16 vid;
++	u16 data[3];
++	u16 resvd;
++};
++
++static int mv88e6xxx_region_vtu_snapshot(struct devlink *dl,
++					 const struct devlink_region_ops *ops,
++					 struct netlink_ext_ack *extack,
++					 u8 **data)
++{
++	struct mv88e6xxx_devlink_vtu_entry *table, *entry;
++	struct dsa_switch *ds = dsa_devlink_to_ds(dl);
++	struct mv88e6xxx_chip *chip = ds->priv;
++	struct mv88e6xxx_vtu_entry vlan;
++	int err;
++
++	table = kcalloc(chip->info->max_vid + 1,
++			sizeof(struct mv88e6xxx_devlink_vtu_entry),
++			GFP_KERNEL);
++	if (!table)
++		return -ENOMEM;
++
++	entry = table;
++	vlan.vid = chip->info->max_vid;
++	vlan.valid = false;
++
++	mv88e6xxx_reg_lock(chip);
++
++	do {
++		err = mv88e6xxx_g1_vtu_getnext(chip, &vlan);
++		if (err)
++			break;
++
++		if (!vlan.valid)
++			break;
++
++		err = err ? : mv88e6xxx_g1_read(chip, MV88E6352_G1_VTU_FID,
++						&entry->fid);
++		err = err ? : mv88e6xxx_g1_read(chip, MV88E6352_G1_VTU_SID,
++						&entry->sid);
++		err = err ? : mv88e6xxx_g1_read(chip, MV88E6XXX_G1_VTU_OP,
++						&entry->op);
++		err = err ? : mv88e6xxx_g1_read(chip, MV88E6XXX_G1_VTU_VID,
++						&entry->vid);
++		err = err ? : mv88e6xxx_g1_read(chip, MV88E6XXX_G1_VTU_DATA1,
++						&entry->data[0]);
++		err = err ? : mv88e6xxx_g1_read(chip, MV88E6XXX_G1_VTU_DATA2,
++						&entry->data[1]);
++		err = err ? : mv88e6xxx_g1_read(chip, MV88E6XXX_G1_VTU_DATA3,
++						&entry->data[2]);
++		if (err)
++			break;
++
++		entry++;
++	} while (vlan.vid < chip->info->max_vid);
++
++	mv88e6xxx_reg_unlock(chip);
++
++	if (err) {
++		kfree(table);
++		return err;
++	}
++
++	*data = (u8 *)table;
++	return 0;
++}
++
+ static int mv88e6xxx_region_port_snapshot(struct devlink_port *devlink_port,
+ 					  const struct devlink_port_region_ops *ops,
+ 					  struct netlink_ext_ack *extack,
+@@ -475,6 +561,12 @@ static struct devlink_region_ops mv88e6x
+ 	.destructor = kfree,
+ };
+ 
++static struct devlink_region_ops mv88e6xxx_region_vtu_ops = {
++	.name = "vtu",
++	.snapshot = mv88e6xxx_region_vtu_snapshot,
++	.destructor = kfree,
++};
++
+ static const struct devlink_port_region_ops mv88e6xxx_region_port_ops = {
+ 	.name = "port",
+ 	.snapshot = mv88e6xxx_region_port_snapshot,
+@@ -498,6 +590,10 @@ static struct mv88e6xxx_region mv88e6xxx
+ 		.ops = &mv88e6xxx_region_atu_ops
+ 	  /* calculated at runtime */
+ 	},
++	[MV88E6XXX_REGION_VTU] = {
++		.ops = &mv88e6xxx_region_vtu_ops
++	  /* calculated at runtime */
++	},
+ };
+ 
+ static void
+@@ -576,9 +672,16 @@ static int mv88e6xxx_setup_devlink_regio
+ 		ops = mv88e6xxx_regions[i].ops;
+ 		size = mv88e6xxx_regions[i].size;
+ 
+-		if (i == MV88E6XXX_REGION_ATU)
++		switch (i) {
++		case MV88E6XXX_REGION_ATU:
+ 			size = mv88e6xxx_num_databases(chip) *
+ 				sizeof(struct mv88e6xxx_devlink_atu_entry);
++			break;
++		case MV88E6XXX_REGION_VTU:
++			size = chip->info->max_vid *
++				sizeof(struct mv88e6xxx_devlink_vtu_entry);
++			break;
++		}
+ 
+ 		region = dsa_devlink_region_create(ds, ops, 1, size);
+ 		if (IS_ERR(region))
+--- a/drivers/net/dsa/mv88e6xxx/global1.h
++++ b/drivers/net/dsa/mv88e6xxx/global1.h
+@@ -330,6 +330,8 @@ void mv88e6xxx_g1_atu_prob_irq_free(stru
+ int mv88e6165_g1_atu_get_hash(struct mv88e6xxx_chip *chip, u8 *hash);
+ int mv88e6165_g1_atu_set_hash(struct mv88e6xxx_chip *chip, u8 hash);
+ 
++int mv88e6xxx_g1_vtu_getnext(struct mv88e6xxx_chip *chip,
++			     struct mv88e6xxx_vtu_entry *entry);
+ int mv88e6185_g1_vtu_getnext(struct mv88e6xxx_chip *chip,
+ 			     struct mv88e6xxx_vtu_entry *entry);
+ int mv88e6185_g1_vtu_loadpurge(struct mv88e6xxx_chip *chip,
+--- a/drivers/net/dsa/mv88e6xxx/global1_vtu.c
++++ b/drivers/net/dsa/mv88e6xxx/global1_vtu.c
+@@ -307,8 +307,8 @@ static int mv88e6xxx_g1_vtu_stu_get(stru
+ 	return 0;
+ }
+ 
+-static int mv88e6xxx_g1_vtu_getnext(struct mv88e6xxx_chip *chip,
+-				    struct mv88e6xxx_vtu_entry *entry)
++int mv88e6xxx_g1_vtu_getnext(struct mv88e6xxx_chip *chip,
++			     struct mv88e6xxx_vtu_entry *entry)
+ {
+ 	int err;
+ 
diff --git a/target/linux/generic/backport-5.10/891-v5.11-net-dsa-mv88e6xxx-Add-helper-to-get-a-chip-s-max_vid.patch b/target/linux/generic/backport-5.10/891-v5.11-net-dsa-mv88e6xxx-Add-helper-to-get-a-chip-s-max_vid.patch
new file mode 100644
index 0000000000..c24f9854ff
--- /dev/null
+++ b/target/linux/generic/backport-5.10/891-v5.11-net-dsa-mv88e6xxx-Add-helper-to-get-a-chip-s-max_vid.patch
@@ -0,0 +1,153 @@
+From e545f86573937142b8a90bd65d476b9f001088cf Mon Sep 17 00:00:00 2001
+From: Tobias Waldekranz <tobias at waldekranz.com>
+Date: Tue, 10 Nov 2020 19:57:20 +0100
+Subject: [PATCH] net: dsa: mv88e6xxx: Add helper to get a chip's max_vid
+
+Most of the other chip info constants have helpers to get at them; add
+one for max_vid to keep things consistent.
+
+Suggested-by: Andrew Lunn <andrew at lunn.ch>
+Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
+Reviewed-by: Andrew Lunn <andrew at lunn.ch>
+Link: https://lore.kernel.org/r/20201110185720.18228-1-tobias at waldekranz.com
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
+---
+ drivers/net/dsa/mv88e6xxx/chip.c    | 18 +++++++++---------
+ drivers/net/dsa/mv88e6xxx/chip.h    |  5 +++++
+ drivers/net/dsa/mv88e6xxx/devlink.c |  8 ++++----
+ 3 files changed, 18 insertions(+), 13 deletions(-)
+
+--- a/drivers/net/dsa/mv88e6xxx/chip.c
++++ b/drivers/net/dsa/mv88e6xxx/chip.c
+@@ -1455,7 +1455,7 @@ static void mv88e6xxx_port_fast_age(stru
+ 
+ static int mv88e6xxx_vtu_setup(struct mv88e6xxx_chip *chip)
+ {
+-	if (!chip->info->max_vid)
++	if (!mv88e6xxx_max_vid(chip))
+ 		return 0;
+ 
+ 	return mv88e6xxx_g1_vtu_flush(chip);
+@@ -1497,7 +1497,7 @@ int mv88e6xxx_fid_map(struct mv88e6xxx_c
+ 	}
+ 
+ 	/* Set every FID bit used by the VLAN entries */
+-	vlan.vid = chip->info->max_vid;
++	vlan.vid = mv88e6xxx_max_vid(chip);
+ 	vlan.valid = false;
+ 
+ 	do {
+@@ -1509,7 +1509,7 @@ int mv88e6xxx_fid_map(struct mv88e6xxx_c
+ 			break;
+ 
+ 		set_bit(vlan.fid, fid_bitmap);
+-	} while (vlan.vid < chip->info->max_vid);
++	} while (vlan.vid < mv88e6xxx_max_vid(chip));
+ 
+ 	return 0;
+ }
+@@ -1600,7 +1600,7 @@ static int mv88e6xxx_port_vlan_filtering
+ 	int err;
+ 
+ 	if (switchdev_trans_ph_prepare(trans))
+-		return chip->info->max_vid ? 0 : -EOPNOTSUPP;
++		return mv88e6xxx_max_vid(chip) ? 0 : -EOPNOTSUPP;
+ 
+ 	mv88e6xxx_reg_lock(chip);
+ 	err = mv88e6xxx_port_set_8021q_mode(chip, port, mode);
+@@ -1616,7 +1616,7 @@ mv88e6xxx_port_vlan_prepare(struct dsa_s
+ 	struct mv88e6xxx_chip *chip = ds->priv;
+ 	int err;
+ 
+-	if (!chip->info->max_vid)
++	if (!mv88e6xxx_max_vid(chip))
+ 		return -EOPNOTSUPP;
+ 
+ 	/* If the requested port doesn't belong to the same bridge as the VLAN
+@@ -1990,7 +1990,7 @@ static void mv88e6xxx_port_vlan_add(stru
+ 	u8 member;
+ 	u16 vid;
+ 
+-	if (!chip->info->max_vid)
++	if (!mv88e6xxx_max_vid(chip))
+ 		return;
+ 
+ 	if (dsa_is_dsa_port(ds, port) || dsa_is_cpu_port(ds, port))
+@@ -2068,7 +2068,7 @@ static int mv88e6xxx_port_vlan_del(struc
+ 	u16 pvid, vid;
+ 	int err = 0;
+ 
+-	if (!chip->info->max_vid)
++	if (!mv88e6xxx_max_vid(chip))
+ 		return -EOPNOTSUPP;
+ 
+ 	mv88e6xxx_reg_lock(chip);
+@@ -2174,7 +2174,7 @@ static int mv88e6xxx_port_db_dump(struct
+ 		return err;
+ 
+ 	/* Dump VLANs' Filtering Information Databases */
+-	vlan.vid = chip->info->max_vid;
++	vlan.vid = mv88e6xxx_max_vid(chip);
+ 	vlan.valid = false;
+ 
+ 	do {
+@@ -2189,7 +2189,7 @@ static int mv88e6xxx_port_db_dump(struct
+ 						 cb, data);
+ 		if (err)
+ 			return err;
+-	} while (vlan.vid < chip->info->max_vid);
++	} while (vlan.vid < mv88e6xxx_max_vid(chip));
+ 
+ 	return err;
+ }
+--- a/drivers/net/dsa/mv88e6xxx/chip.h
++++ b/drivers/net/dsa/mv88e6xxx/chip.h
+@@ -674,6 +674,11 @@ static inline unsigned int mv88e6xxx_num
+ 	return chip->info->num_ports;
+ }
+ 
++static inline unsigned int mv88e6xxx_max_vid(struct mv88e6xxx_chip *chip)
++{
++	return chip->info->max_vid;
++}
++
+ static inline u16 mv88e6xxx_port_mask(struct mv88e6xxx_chip *chip)
+ {
+ 	return GENMASK((s32)mv88e6xxx_num_ports(chip) - 1, 0);
+--- a/drivers/net/dsa/mv88e6xxx/devlink.c
++++ b/drivers/net/dsa/mv88e6xxx/devlink.c
+@@ -452,14 +452,14 @@ static int mv88e6xxx_region_vtu_snapshot
+ 	struct mv88e6xxx_vtu_entry vlan;
+ 	int err;
+ 
+-	table = kcalloc(chip->info->max_vid + 1,
++	table = kcalloc(mv88e6xxx_max_vid(chip) + 1,
+ 			sizeof(struct mv88e6xxx_devlink_vtu_entry),
+ 			GFP_KERNEL);
+ 	if (!table)
+ 		return -ENOMEM;
+ 
+ 	entry = table;
+-	vlan.vid = chip->info->max_vid;
++	vlan.vid = mv88e6xxx_max_vid(chip);
+ 	vlan.valid = false;
+ 
+ 	mv88e6xxx_reg_lock(chip);
+@@ -490,7 +490,7 @@ static int mv88e6xxx_region_vtu_snapshot
+ 			break;
+ 
+ 		entry++;
+-	} while (vlan.vid < chip->info->max_vid);
++	} while (vlan.vid < mv88e6xxx_max_vid(chip));
+ 
+ 	mv88e6xxx_reg_unlock(chip);
+ 
+@@ -678,7 +678,7 @@ static int mv88e6xxx_setup_devlink_regio
+ 				sizeof(struct mv88e6xxx_devlink_atu_entry);
+ 			break;
+ 		case MV88E6XXX_REGION_VTU:
+-			size = chip->info->max_vid *
++			size = mv88e6xxx_max_vid(chip) *
+ 				sizeof(struct mv88e6xxx_devlink_vtu_entry);
+ 			break;
+ 		}
diff --git a/target/linux/generic/backport-5.10/891-v5.13-net-dsa-mv88e6xxx-Fix-off-by-one-in-VTU-devlink-regi.patch b/target/linux/generic/backport-5.10/891-v5.13-net-dsa-mv88e6xxx-Fix-off-by-one-in-VTU-devlink-regi.patch
new file mode 100644
index 0000000000..5c9cbd8192
--- /dev/null
+++ b/target/linux/generic/backport-5.10/891-v5.13-net-dsa-mv88e6xxx-Fix-off-by-one-in-VTU-devlink-regi.patch
@@ -0,0 +1,30 @@
+From 281140a0a2ce4febf2c0ce5d29d0e7d961a826b1 Mon Sep 17 00:00:00 2001
+From: Tobias Waldekranz <tobias at waldekranz.com>
+Date: Wed, 21 Apr 2021 14:04:53 +0200
+Subject: [PATCH] net: dsa: mv88e6xxx: Fix off-by-one in VTU devlink region
+ size
+
+In the unlikely event of the VTU being loaded to the brim with 4k
+entries, the last one was placed in the buffer, but the size reported
+to devlink was off-by-one. Make sure that the final entry is available
+to the caller.
+
+Fixes: ca4d632aef03 ("net: dsa: mv88e6xxx: Export VTU as devlink region")
+Signed-off-by: Tobias Waldekranz <tobias at waldekranz.com>
+Reviewed-by: Andrew Lunn <andrew at lunn.ch>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/net/dsa/mv88e6xxx/devlink.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/dsa/mv88e6xxx/devlink.c
++++ b/drivers/net/dsa/mv88e6xxx/devlink.c
+@@ -678,7 +678,7 @@ static int mv88e6xxx_setup_devlink_regio
+ 				sizeof(struct mv88e6xxx_devlink_atu_entry);
+ 			break;
+ 		case MV88E6XXX_REGION_VTU:
+-			size = mv88e6xxx_max_vid(chip) *
++			size = (mv88e6xxx_max_vid(chip) + 1) *
+ 				sizeof(struct mv88e6xxx_devlink_vtu_entry);
+ 			break;
+ 		}



From lede-commits at lists.infradead.org  Fri Feb  3 02:50:46 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 05:50:46 -0500
Subject: [openwrt/openwrt]  ath79: add label-mac-device for GL-XE300
In-Reply-To: <167542144538.1887174.14285208610230549151@git-01.infra.openwrt.org>
References: <167542144538.1887174.14285208610230549151@git-01.infra.openwrt.org>
Message-ID: <mailman.12099.1675421449.3064139.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/2702ef94274b35c2d80a795484a1126b5f4628cf

commit 2702ef94274b35c2d80a795484a1126b5f4628cf
Author: Tom Herbers <mail at tomherbers.de>
AuthorDate: Tue Jan 24 14:14:58 2023 +0100

    ath79: add label-mac-device for GL-XE300
    
    This adds an label-mac-device alias which refrences the mac which is
    printed on the Label of the device.
    
    Signed-off-by: Tom Herbers <mail at tomherbers.de>
    (cherry picked from commit f83f5f8452edd3115aacf333b0038da89639a218)
---
 target/linux/ath79/dts/qca9531_glinet_gl-xe300.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/linux/ath79/dts/qca9531_glinet_gl-xe300.dts b/target/linux/ath79/dts/qca9531_glinet_gl-xe300.dts
index 9c2760398b..9212c0a754 100644
--- a/target/linux/ath79/dts/qca9531_glinet_gl-xe300.dts
+++ b/target/linux/ath79/dts/qca9531_glinet_gl-xe300.dts
@@ -9,6 +9,10 @@
 	compatible = "glinet,gl-xe300", "qca,qca9531";
 	model = "GL.iNet GL-XE300";
 
+	aliases {
+		label-mac-device = &eth0;
+	};
+
 	gpio-export {
 		compatible = "gpio-export";
 



From lede-commits at lists.infradead.org  Fri Feb  3 02:50:47 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 05:50:47 -0500
Subject: [openwrt/openwrt]  ath79: add LTE packages for GL-XE300
In-Reply-To: <167542144538.1887174.14285208610230549151@git-01.infra.openwrt.org>
References: <167542144538.1887174.14285208610230549151@git-01.infra.openwrt.org>
Message-ID: <mailman.12100.1675421454.3064139.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/2601873cc591578643d87c65ca67ca058cfa8867

commit 2601873cc591578643d87c65ca67ca058cfa8867
Author: Tom Herbers <mail at tomherbers.de>
AuthorDate: Sat Sep 10 16:45:42 2022 +0200

    ath79: add LTE packages for GL-XE300
    
    Add LTE packages required for operating the LTE modems shipped with
    the GL-XE300.
    
    Example configuration for an unauthenticated dual-stack APN:
    
    network.wwan0=interface
    network.wwan0.proto='qmi'
    network.wwan0.device='/dev/cdc-wdm0'
    network.wwan0.apn='internet'
    network.wwan0.auth='none'
    network.wwan0.delay='10'
    network.wwan0.pdptype='IPV4V6'
    
    Signed-off-by: Tom Herbers <mail at tomherbers.de>
    (cherry picked from commit 67f283be4430ebfb46be6c00fcc7c12a6adabce3)
---
 target/linux/ath79/image/nand.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk
index 1bf7227017..0f5b07225c 100644
--- a/target/linux/ath79/image/nand.mk
+++ b/target/linux/ath79/image/nand.mk
@@ -199,7 +199,8 @@ define Device/glinet_gl-xe300
   SOC := qca9531
   DEVICE_VENDOR := GL.iNet
   DEVICE_MODEL := GL-XE300
-  DEVICE_PACKAGES := kmod-usb2 block-mount kmod-usb-serial-ch341
+  DEVICE_PACKAGES := kmod-usb2 block-mount kmod-usb-serial-ch341 \
+	kmod-usb-net-qmi-wwan uqmi
   KERNEL_SIZE := 4096k
   IMAGE_SIZE := 131072k
   PAGESIZE := 2048



From lede-commits at lists.infradead.org  Fri Feb  3 02:50:45 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 05:50:45 -0500
Subject: [openwrt/openwrt]  ath79: add LTE led for GL.iNet GL-XE300
In-Reply-To: <167542144538.1887174.14285208610230549151@git-01.infra.openwrt.org>
References: <167542144538.1887174.14285208610230549151@git-01.infra.openwrt.org>
Message-ID: <mailman.12101.1675421457.3064139.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/0657576ce190b23646e22de1440bd0fe0c3c08c6

commit 0657576ce190b23646e22de1440bd0fe0c3c08c6
Author: Leo Soares <leo at hyper.ag>
AuthorDate: Sun Jul 31 15:28:47 2022 +0100

    ath79: add LTE led for GL.iNet GL-XE300
    
    This commit adds the LTE led for GL.iNet GL-XE300
    to the default leds config.
    
    Signed-off-by: Leo Soares <leo at hyper.ag>
    (cherry picked from commit 35a0f2b00c44a43ad087327f0cbdb1c9c5e60c49)
    Signed-off-by: Tom Herbers <mail at tomherbers.de>
---
 target/linux/ath79/nand/base-files/etc/board.d/01_leds | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ath79/nand/base-files/etc/board.d/01_leds b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
index e493298457..8b5df624a4 100644
--- a/target/linux/ath79/nand/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/nand/base-files/etc/board.d/01_leds
@@ -17,6 +17,7 @@ glinet,gl-ar300m-nor)
 glinet,gl-xe300)
 	ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
 	ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x10"
+	ucidef_set_led_netdev "3gnet" "LTE" "green:lte" "wwan0"
 	;;
 netgear,r6100)
 	ucidef_set_led_netdev "wan-green" "WAN (green)" "green:wan" "eth1"



From lede-commits at lists.infradead.org  Fri Feb  3 03:01:04 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 06:01:04 -0500
Subject: [openwrt/openwrt]  bcm47xx: Refresh kernel 5.15
In-Reply-To: <167542206316.1893755.17767618027085819239@git-01.infra.openwrt.org>
References: <167542206316.1893755.17767618027085819239@git-01.infra.openwrt.org>
Message-ID: <mailman.12104.1675422070.3064139.lede-commits@lists.infradead.org>

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

commit 18e6df83bb92dc095da237302de82ef6b4bc62bf
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Jan 22 20:04:35 2023 +0100

    bcm47xx: Refresh kernel 5.15
    
    This makes the patches and the kernel configuration apply on top of
    kernel 5.15.
    
    The following patch was removed because the old IDE subsystem was
    removed from upstream kernel:
    target/linux/bcm47xx/patches-5.15/610-pci_ide_fix.patch
    
    This was tested successfully on a ASUS WL-500g Premium V1.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/bcm47xx/Makefile                      |  1 +
 target/linux/bcm47xx/config-5.15                   | 71 ++++++----------------
 ...-brcmnand-Assign-soc-as-early-as-possible.patch |  4 +-
 ...mnand-Allow-SoC-to-provide-I-O-operations.patch |  6 +-
 ...d-brcmnand-Avoid-pdev-in-brcmnand_init_cs.patch |  6 +-
 ...ove-OF-operations-out-of-brcmnand_init_cs.patch |  6 +-
 ...brcmnand-Allow-working-without-interrupts.patch |  4 +-
 ...nand-Add-platform-data-structure-for-BCMA.patch |  6 +-
 ...brcmnand-Allow-platform-data-instantation.patch | 14 ++---
 ...d-BCMA-controller-uses-command-shift-of-0.patch |  2 +-
 ...-v5.18-mtd-rawnand-brcmnand-Add-BCMA-shim.patch |  4 +-
 .../linux/bcm47xx/patches-5.15/159-cpu_fixes.patch | 69 +++++++++------------
 .../bcm47xx/patches-5.15/160-kmap_coherent.patch   |  8 +--
 .../bcm47xx/patches-5.15/310-no_highpage.patch     |  2 +-
 .../bcm47xx/patches-5.15/610-pci_ide_fix.patch     | 41 -------------
 .../patches-5.15/791-tg3-no-pci-sleep.patch        |  2 +-
 .../bcm47xx/patches-5.15/831-old_gpio_wdt.patch    | 12 ++--
 ...PCI-writes-setting-CardBus-bridge-resourc.patch |  2 +-
 .../patches-5.15/976-ssb_increase_pci_delay.patch  |  6 +-
 .../bcm47xx/patches-5.15/999-wl_exports.patch      |  2 +-
 20 files changed, 91 insertions(+), 177 deletions(-)

diff --git a/target/linux/bcm47xx/Makefile b/target/linux/bcm47xx/Makefile
index 3a48201851..ca09aea981 100644
--- a/target/linux/bcm47xx/Makefile
+++ b/target/linux/bcm47xx/Makefile
@@ -11,6 +11,7 @@ FEATURES:=squashfs usb
 SUBTARGETS:=generic mips74k legacy
 
 KERNEL_PATCHVER:=5.10
+KERNEL_TESTING_PATCHVER:=5.15
 
 define Target/Description
 	Build firmware images for Broadcom based BCM47xx/53xx routers with MIPS CPU, *not* ARM.
diff --git a/target/linux/bcm47xx/config-5.15 b/target/linux/bcm47xx/config-5.15
index 31d6d1de39..0714c9a57c 100644
--- a/target/linux/bcm47xx/config-5.15
+++ b/target/linux/bcm47xx/config-5.15
@@ -1,18 +1,10 @@
 CONFIG_ADM6996_PHY=y
-CONFIG_ARCH_BINFMT_ELF_STATE=y
-CONFIG_ARCH_CLOCKSOURCE_DATA=y
-CONFIG_ARCH_DISCARD_MEMBLOCK=y
-CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
-CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y
+CONFIG_ARCH_32BIT_OFF_T=y
 CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_KEEP_MEMBLOCK=y
 CONFIG_ARCH_MMAP_RND_BITS_MAX=15
 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15
-CONFIG_ARCH_SUPPORTS_UPROBES=y
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_ARCH_USE_BUILTIN_BSWAP=y
-CONFIG_ARCH_USE_QUEUED_RWLOCKS=y
-CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y
-CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
 CONFIG_BCM47XX=y
 CONFIG_BCM47XX_BCMA=y
 CONFIG_BCM47XX_NVRAM=y
@@ -54,25 +46,23 @@ CONFIG_CPU_MIPSR1=y
 CONFIG_CPU_MIPSR2_IRQ_VI=y
 CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y
 CONFIG_CPU_R4K_CACHE_TLB=y
-CONFIG_CPU_R4K_FPU=y
 CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
 CONFIG_CPU_SUPPORTS_HIGHMEM=y
-CONFIG_CRYPTO_BLAKE2S=y
 CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
+CONFIG_CRYPTO_LIB_POLY1305_RSIZE=2
 CONFIG_CRYPTO_RNG2=y
-CONFIG_CRYPTO_WORKQUEUE=y
 CONFIG_CSRC_R4K=y
-CONFIG_DMA_DIRECT_OPS=y
 CONFIG_DMA_NONCOHERENT=y
-CONFIG_DMA_NONCOHERENT_CACHE_SYNC=y
-CONFIG_DMA_NONCOHERENT_MMAP=y
-CONFIG_DMA_NONCOHERENT_OPS=y
 # CONFIG_EARLY_PRINTK is not set
 CONFIG_FIXED_PHY=y
+CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_GENERIC_ATOMIC64=y
 CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_CMOS_UPDATE=y
 CONFIG_GENERIC_CPU_AUTOPROBE=y
+CONFIG_GENERIC_FIND_FIRST_BIT=y
+CONFIG_GENERIC_GETTIMEOFDAY=y
+CONFIG_GENERIC_IOMAP=y
 CONFIG_GENERIC_IRQ_CHIP=y
 CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
 CONFIG_GENERIC_IRQ_SHOW=y
@@ -86,45 +76,13 @@ CONFIG_GENERIC_SCHED_CLOCK=y
 CONFIG_GENERIC_SMP_IDLE_THREAD=y
 CONFIG_GENERIC_TIME_VSYSCALL=y
 CONFIG_GPIOLIB_IRQCHIP=y
+CONFIG_GPIO_CDEV=y
 CONFIG_GPIO_WDT=y
 CONFIG_HANDLE_DOMAIN_IRQ=y
 CONFIG_HARDWARE_WATCHPOINTS=y
 CONFIG_HAS_DMA=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT_MAP=y
-CONFIG_HAVE_ARCH_COMPILER_H=y
-CONFIG_HAVE_ARCH_JUMP_LABEL=y
-CONFIG_HAVE_ARCH_KGDB=y
-CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
-CONFIG_HAVE_ARCH_TRACEHOOK=y
-CONFIG_HAVE_CBPF_JIT=y
-CONFIG_HAVE_CONTEXT_TRACKING=y
-CONFIG_HAVE_COPY_THREAD_TLS=y
-CONFIG_HAVE_C_RECORDMCOUNT=y
-CONFIG_HAVE_DEBUG_KMEMLEAK=y
-CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
-CONFIG_HAVE_DMA_CONTIGUOUS=y
-CONFIG_HAVE_DYNAMIC_FTRACE=y
-CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
-CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
-CONFIG_HAVE_FUNCTION_TRACER=y
-CONFIG_HAVE_GENERIC_DMA_COHERENT=y
-CONFIG_HAVE_IDE=y
-CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
-CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
-CONFIG_HAVE_LATENCYTOP_SUPPORT=y
-CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y
-CONFIG_HAVE_MEMBLOCK=y
-CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
-CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
-CONFIG_HAVE_NET_DSA=y
-CONFIG_HAVE_OPROFILE=y
-CONFIG_HAVE_PERF_EVENTS=y
-CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
-CONFIG_HAVE_RSEQ=y
-CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
-CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
-CONFIG_HW_HAS_PCI=y
 CONFIG_HW_RANDOM=y
 CONFIG_HZ_PERIODIC=y
 CONFIG_INITRAMFS_SOURCE=""
@@ -136,6 +94,7 @@ CONFIG_LEDS_GPIO_REGISTER=y
 CONFIG_LOCK_DEBUGGING_SUPPORT=y
 CONFIG_MDIO_BUS=y
 CONFIG_MDIO_DEVICE=y
+CONFIG_MDIO_DEVRES=y
 CONFIG_MEMFD_CREATE=y
 CONFIG_MIGRATION=y
 CONFIG_MIPS=y
@@ -144,20 +103,23 @@ CONFIG_MIPS_ASID_SHIFT=0
 CONFIG_MIPS_CLOCK_VSYSCALL=y
 # CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set
 CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y
+CONFIG_MIPS_EBPF_JIT=y
 CONFIG_MIPS_L1_CACHE_SHIFT=5
+CONFIG_MIPS_LD_CAN_LINK_VDSO=y
 CONFIG_MODULES_USE_ELF_REL=y
 CONFIG_MTD_BCM47XXSFLASH=y
 CONFIG_MTD_BCM47XX_PARTS=y
-CONFIG_MTD_NAND_CORE=y
-CONFIG_MTD_RAW_NAND=y
 CONFIG_MTD_NAND_BCM47XXNFLASH=y
 CONFIG_MTD_NAND_BRCMNAND=y
 CONFIG_MTD_NAND_BRCMNAND_BCMA=y
+CONFIG_MTD_NAND_CORE=y
 CONFIG_MTD_NAND_ECC=y
 CONFIG_MTD_PARSER_TRX=y
 CONFIG_MTD_PHYSMAP=y
+CONFIG_MTD_RAW_NAND=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NEED_PER_CPU_KM=y
+CONFIG_NET_SELFTESTS=y
 CONFIG_NO_EXCEPT_FILL=y
 CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
 # CONFIG_OF is not set
@@ -168,8 +130,10 @@ CONFIG_PCI_DRIVERS_LEGACY=y
 CONFIG_PERF_USE_VMALLOC=y
 CONFIG_PGTABLE_LEVELS=2
 CONFIG_PHYLIB=y
+CONFIG_PTP_1588_CLOCK_OPTIONAL=y
 CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SERIAL_MCTRL_GPIO=y
 CONFIG_SRCU=y
 CONFIG_SSB=y
 CONFIG_SSB_B43_PCI_BRIDGE=y
@@ -190,10 +154,8 @@ CONFIG_SSB_SFLASH=y
 CONFIG_SSB_SPROM=y
 CONFIG_SWCONFIG=y
 CONFIG_SWCONFIG_B53=y
-# CONFIG_SWCONFIG_B53_MMAP_DRIVER is not set
 CONFIG_SWCONFIG_B53_PHY_DRIVER=y
 CONFIG_SWCONFIG_B53_PHY_FIXUP=y
-# CONFIG_SWCONFIG_B53_SRAB_DRIVER is not set
 CONFIG_SWPHY=y
 CONFIG_SYSCTL_EXCEPTION_TRACE=y
 CONFIG_SYS_HAS_CPU_BMIPS=y
@@ -207,6 +169,7 @@ CONFIG_SYS_SUPPORTS_HIGHMEM=y
 CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
 CONFIG_SYS_SUPPORTS_MIPS16=y
 CONFIG_SYS_SUPPORTS_ZBOOT=y
+CONFIG_TARGET_ISA_REV=1
 CONFIG_TICK_CPU_ACCOUNTING=y
 CONFIG_TINY_SRCU=y
 CONFIG_USB_SUPPORT=y
diff --git a/target/linux/bcm47xx/patches-5.15/100-v5.18-mtd-rawnand-brcmnand-Assign-soc-as-early-as-possible.patch b/target/linux/bcm47xx/patches-5.15/100-v5.18-mtd-rawnand-brcmnand-Assign-soc-as-early-as-possible.patch
index 8efda10809..a87d6acd0c 100644
--- a/target/linux/bcm47xx/patches-5.15/100-v5.18-mtd-rawnand-brcmnand-Assign-soc-as-early-as-possible.patch
+++ b/target/linux/bcm47xx/patches-5.15/100-v5.18-mtd-rawnand-brcmnand-Assign-soc-as-early-as-possible.patch
@@ -14,7 +14,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
 
 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
 +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
-@@ -2949,6 +2949,7 @@ int brcmnand_probe(struct platform_devic
+@@ -2998,6 +2998,7 @@ int brcmnand_probe(struct platform_devic
  
  	dev_set_drvdata(dev, ctrl);
  	ctrl->dev = dev;
@@ -22,7 +22,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
  
  	init_completion(&ctrl->done);
  	init_completion(&ctrl->dma_done);
-@@ -3089,8 +3090,6 @@ int brcmnand_probe(struct platform_devic
+@@ -3138,8 +3139,6 @@ int brcmnand_probe(struct platform_devic
  	 * interesting ways
  	 */
  	if (soc) {
diff --git a/target/linux/bcm47xx/patches-5.15/101-v5.18-mtd-rawnand-brcmnand-Allow-SoC-to-provide-I-O-operations.patch b/target/linux/bcm47xx/patches-5.15/101-v5.18-mtd-rawnand-brcmnand-Allow-SoC-to-provide-I-O-operations.patch
index 23f5df3015..8da2535865 100644
--- a/target/linux/bcm47xx/patches-5.15/101-v5.18-mtd-rawnand-brcmnand-Allow-SoC-to-provide-I-O-operations.patch
+++ b/target/linux/bcm47xx/patches-5.15/101-v5.18-mtd-rawnand-brcmnand-Allow-SoC-to-provide-I-O-operations.patch
@@ -37,7 +37,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
  struct brcmnand_controller {
  	struct device		*dev;
  	struct nand_controller	controller;
-@@ -589,15 +592,25 @@ enum {
+@@ -592,15 +595,25 @@ enum {
  	INTFC_CTLR_READY		= BIT(31),
  };
  
@@ -64,7 +64,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
  }
  
  static int brcmnand_revision_init(struct brcmnand_controller *ctrl)
-@@ -763,13 +776,18 @@ static inline void brcmnand_rmw_reg(stru
+@@ -766,13 +779,18 @@ static inline void brcmnand_rmw_reg(stru
  
  static inline u32 brcmnand_read_fc(struct brcmnand_controller *ctrl, int word)
  {
@@ -84,7 +84,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
  }
  
  static inline void edu_writel(struct brcmnand_controller *ctrl,
-@@ -2951,6 +2969,12 @@ int brcmnand_probe(struct platform_devic
+@@ -3000,6 +3018,12 @@ int brcmnand_probe(struct platform_devic
  	ctrl->dev = dev;
  	ctrl->soc = soc;
  
diff --git a/target/linux/bcm47xx/patches-5.15/102-v5.18-mtd-rawnand-brcmnand-Avoid-pdev-in-brcmnand_init_cs.patch b/target/linux/bcm47xx/patches-5.15/102-v5.18-mtd-rawnand-brcmnand-Avoid-pdev-in-brcmnand_init_cs.patch
index d9324c2595..d7eab183d6 100644
--- a/target/linux/bcm47xx/patches-5.15/102-v5.18-mtd-rawnand-brcmnand-Avoid-pdev-in-brcmnand_init_cs.patch
+++ b/target/linux/bcm47xx/patches-5.15/102-v5.18-mtd-rawnand-brcmnand-Avoid-pdev-in-brcmnand_init_cs.patch
@@ -16,7 +16,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
 
 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
 +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
-@@ -2722,7 +2722,7 @@ static const struct nand_controller_ops
+@@ -2771,7 +2771,7 @@ static const struct nand_controller_ops
  static int brcmnand_init_cs(struct brcmnand_host *host, struct device_node *dn)
  {
  	struct brcmnand_controller *ctrl = host->ctrl;
@@ -25,7 +25,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
  	struct mtd_info *mtd;
  	struct nand_chip *chip;
  	int ret;
-@@ -2730,7 +2730,7 @@ static int brcmnand_init_cs(struct brcmn
+@@ -2779,7 +2779,7 @@ static int brcmnand_init_cs(struct brcmn
  
  	ret = of_property_read_u32(dn, "reg", &host->cs);
  	if (ret) {
@@ -34,7 +34,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
  		return -ENXIO;
  	}
  
-@@ -2739,13 +2739,13 @@ static int brcmnand_init_cs(struct brcmn
+@@ -2788,13 +2788,13 @@ static int brcmnand_init_cs(struct brcmn
  
  	nand_set_flash_node(chip, dn);
  	nand_set_controller_data(chip, host);
diff --git a/target/linux/bcm47xx/patches-5.15/103-v5.18-mtd-rawnand-brcmnand-Move-OF-operations-out-of-brcmnand_init_cs.patch b/target/linux/bcm47xx/patches-5.15/103-v5.18-mtd-rawnand-brcmnand-Move-OF-operations-out-of-brcmnand_init_cs.patch
index 34fd1b47ea..e2fa72add1 100644
--- a/target/linux/bcm47xx/patches-5.15/103-v5.18-mtd-rawnand-brcmnand-Move-OF-operations-out-of-brcmnand_init_cs.patch
+++ b/target/linux/bcm47xx/patches-5.15/103-v5.18-mtd-rawnand-brcmnand-Move-OF-operations-out-of-brcmnand_init_cs.patch
@@ -17,7 +17,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
 
 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
 +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
-@@ -2719,7 +2719,7 @@ static const struct nand_controller_ops
+@@ -2768,7 +2768,7 @@ static const struct nand_controller_ops
  	.attach_chip = brcmnand_attach_chip,
  };
  
@@ -26,7 +26,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
  {
  	struct brcmnand_controller *ctrl = host->ctrl;
  	struct device *dev = ctrl->dev;
-@@ -2728,16 +2728,9 @@ static int brcmnand_init_cs(struct brcmn
+@@ -2777,16 +2777,9 @@ static int brcmnand_init_cs(struct brcmn
  	int ret;
  	u16 cfg_offs;
  
@@ -43,7 +43,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
  	nand_set_controller_data(chip, host);
  	mtd->name = devm_kasprintf(dev, GFP_KERNEL, "brcmnand.%d",
  				   host->cs);
-@@ -3144,7 +3137,16 @@ int brcmnand_probe(struct platform_devic
+@@ -3193,7 +3186,16 @@ int brcmnand_probe(struct platform_devic
  			host->pdev = pdev;
  			host->ctrl = ctrl;
  
diff --git a/target/linux/bcm47xx/patches-5.15/104-v5.18-mtd-rawnand-brcmnand-Allow-working-without-interrupts.patch b/target/linux/bcm47xx/patches-5.15/104-v5.18-mtd-rawnand-brcmnand-Allow-working-without-interrupts.patch
index 3a9d18fa21..bdf325d732 100644
--- a/target/linux/bcm47xx/patches-5.15/104-v5.18-mtd-rawnand-brcmnand-Allow-working-without-interrupts.patch
+++ b/target/linux/bcm47xx/patches-5.15/104-v5.18-mtd-rawnand-brcmnand-Allow-working-without-interrupts.patch
@@ -23,7 +23,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
  	unsigned int		dma_irq;
  	int			nand_version;
  
-@@ -1590,7 +1590,7 @@ static bool brcmstb_nand_wait_for_comple
+@@ -1610,7 +1610,7 @@ static bool brcmstb_nand_wait_for_comple
  	bool err = false;
  	int sts;
  
@@ -32,7 +32,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
  		/* switch to interrupt polling and PIO mode */
  		disable_ctrl_irqs(ctrl);
  		sts = bcmnand_ctrl_poll_status(ctrl, NAND_CTRL_RDY,
-@@ -3095,33 +3095,29 @@ int brcmnand_probe(struct platform_devic
+@@ -3144,33 +3144,29 @@ int brcmnand_probe(struct platform_devic
  	}
  
  	/* IRQ */
diff --git a/target/linux/bcm47xx/patches-5.15/105-v5.18-mtd-rawnand-brcmnand-Add-platform-data-structure-for-BCMA.patch b/target/linux/bcm47xx/patches-5.15/105-v5.18-mtd-rawnand-brcmnand-Add-platform-data-structure-for-BCMA.patch
index 973a3e95ee..ab53cfd6e9 100644
--- a/target/linux/bcm47xx/patches-5.15/105-v5.18-mtd-rawnand-brcmnand-Add-platform-data-structure-for-BCMA.patch
+++ b/target/linux/bcm47xx/patches-5.15/105-v5.18-mtd-rawnand-brcmnand-Add-platform-data-structure-for-BCMA.patch
@@ -20,14 +20,14 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
 
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -3712,6 +3712,7 @@ L:	linux-mtd at lists.infradead.org
+@@ -3900,6 +3900,7 @@ L:	linux-mtd at lists.infradead.org
  L:	bcm-kernel-feedback-list at broadcom.com
  S:	Maintained
  F:	drivers/mtd/nand/raw/brcmnand/
 +F:	include/linux/platform_data/brcmnand.h
  
- BROADCOM SYSTEMPORT ETHERNET DRIVER
- M:	Florian Fainelli <f.fainelli at gmail.com>
+ BROADCOM STB PCIE DRIVER
+ M:	Jim Quinlan <jim2101024 at gmail.com>
 --- a/drivers/bcma/driver_chipcommon_nflash.c
 +++ b/drivers/bcma/driver_chipcommon_nflash.c
 @@ -7,18 +7,28 @@
diff --git a/target/linux/bcm47xx/patches-5.15/106-v5.18-mtd-rawnand-brcmnand-Allow-platform-data-instantation.patch b/target/linux/bcm47xx/patches-5.15/106-v5.18-mtd-rawnand-brcmnand-Allow-platform-data-instantation.patch
index fb9ee07d04..31d686b955 100644
--- a/target/linux/bcm47xx/patches-5.15/106-v5.18-mtd-rawnand-brcmnand-Allow-platform-data-instantation.patch
+++ b/target/linux/bcm47xx/patches-5.15/106-v5.18-mtd-rawnand-brcmnand-Allow-platform-data-instantation.patch
@@ -23,7 +23,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
  #include <linux/err.h>
  #include <linux/completion.h>
  #include <linux/interrupt.h>
-@@ -2719,7 +2720,8 @@ static const struct nand_controller_ops
+@@ -2768,7 +2769,8 @@ static const struct nand_controller_ops
  	.attach_chip = brcmnand_attach_chip,
  };
  
@@ -33,7 +33,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
  {
  	struct brcmnand_controller *ctrl = host->ctrl;
  	struct device *dev = ctrl->dev;
-@@ -2772,7 +2774,7 @@ static int brcmnand_init_cs(struct brcmn
+@@ -2821,7 +2823,7 @@ static int brcmnand_init_cs(struct brcmn
  	if (ret)
  		return ret;
  
@@ -42,7 +42,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
  	if (ret)
  		nand_cleanup(chip);
  
-@@ -2941,17 +2943,15 @@ static int brcmnand_edu_setup(struct pla
+@@ -2990,17 +2992,15 @@ static int brcmnand_edu_setup(struct pla
  
  int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc)
  {
@@ -63,7 +63,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
  		return -ENODEV;
  
  	ctrl = devm_kzalloc(dev, sizeof(*ctrl), GFP_KERNEL);
-@@ -2978,7 +2978,7 @@ int brcmnand_probe(struct platform_devic
+@@ -3027,7 +3027,7 @@ int brcmnand_probe(struct platform_devic
  	/* NAND register range */
  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  	ctrl->nand_base = devm_ioremap_resource(dev, res);
@@ -72,7 +72,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
  		return PTR_ERR(ctrl->nand_base);
  
  	/* Enable clock before using NAND registers */
-@@ -3122,7 +3122,6 @@ int brcmnand_probe(struct platform_devic
+@@ -3171,7 +3171,6 @@ int brcmnand_probe(struct platform_devic
  
  	for_each_available_child_of_node(dn, child) {
  		if (of_device_is_compatible(child, "brcm,nandcs")) {
@@ -80,7 +80,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
  
  			host = devm_kzalloc(dev, sizeof(*host), GFP_KERNEL);
  			if (!host) {
-@@ -3142,7 +3141,7 @@ int brcmnand_probe(struct platform_devic
+@@ -3191,7 +3190,7 @@ int brcmnand_probe(struct platform_devic
  
  			nand_set_flash_node(&host->chip, child);
  
@@ -89,7 +89,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
  			if (ret) {
  				devm_kfree(dev, host);
  				continue; /* Try all chip-selects */
-@@ -3152,6 +3151,32 @@ int brcmnand_probe(struct platform_devic
+@@ -3201,6 +3200,32 @@ int brcmnand_probe(struct platform_devic
  		}
  	}
  
diff --git a/target/linux/bcm47xx/patches-5.15/107-v5.18-mtd-rawnand-brcmnand-BCMA-controller-uses-command-shift-of-0.patch b/target/linux/bcm47xx/patches-5.15/107-v5.18-mtd-rawnand-brcmnand-BCMA-controller-uses-command-shift-of-0.patch
index 39f34aab29..188d59b7d1 100644
--- a/target/linux/bcm47xx/patches-5.15/107-v5.18-mtd-rawnand-brcmnand-BCMA-controller-uses-command-shift-of-0.patch
+++ b/target/linux/bcm47xx/patches-5.15/107-v5.18-mtd-rawnand-brcmnand-BCMA-controller-uses-command-shift-of-0.patch
@@ -14,7 +14,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
 
 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
 +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
-@@ -913,6 +913,12 @@ static void brcmnand_wr_corr_thresh(stru
+@@ -916,6 +916,12 @@ static void brcmnand_wr_corr_thresh(stru
  
  static inline int brcmnand_cmd_shift(struct brcmnand_controller *ctrl)
  {
diff --git a/target/linux/bcm47xx/patches-5.15/108-v5.18-mtd-rawnand-brcmnand-Add-BCMA-shim.patch b/target/linux/bcm47xx/patches-5.15/108-v5.18-mtd-rawnand-brcmnand-Add-BCMA-shim.patch
index eabb4c2475..baa48ef5a0 100644
--- a/target/linux/bcm47xx/patches-5.15/108-v5.18-mtd-rawnand-brcmnand-Add-BCMA-shim.patch
+++ b/target/linux/bcm47xx/patches-5.15/108-v5.18-mtd-rawnand-brcmnand-Add-BCMA-shim.patch
@@ -22,7 +22,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
 
 --- a/drivers/mtd/nand/raw/Kconfig
 +++ b/drivers/mtd/nand/raw/Kconfig
-@@ -236,6 +236,19 @@ config MTD_NAND_BRCMNAND
+@@ -208,6 +208,19 @@ config MTD_NAND_BRCMNAND
  	  originally designed for Set-Top Box but is used on various BCM7xxx,
  	  BCM3xxx, BCM63xxx, iProc/Cygnus and more.
  
@@ -187,7 +187,7 @@ Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
 +MODULE_DESCRIPTION("NAND controller driver glue for BCMA chips");
 --- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
 +++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
-@@ -595,7 +595,11 @@ enum {
+@@ -598,7 +598,11 @@ enum {
  
  static inline bool brcmnand_non_mmio_ops(struct brcmnand_controller *ctrl)
  {
diff --git a/target/linux/bcm47xx/patches-5.15/159-cpu_fixes.patch b/target/linux/bcm47xx/patches-5.15/159-cpu_fixes.patch
index 0c9a9d6490..88f2b9c684 100644
--- a/target/linux/bcm47xx/patches-5.15/159-cpu_fixes.patch
+++ b/target/linux/bcm47xx/patches-5.15/159-cpu_fixes.patch
@@ -1,6 +1,6 @@
 --- a/arch/mips/include/asm/r4kcache.h
 +++ b/arch/mips/include/asm/r4kcache.h
-@@ -28,6 +28,38 @@
+@@ -27,6 +27,38 @@
  extern void (*r4k_blast_dcache)(void);
  extern void (*r4k_blast_icache)(void);
  
@@ -39,7 +39,7 @@
  /*
   * This macro return a properly sign-extended address suitable as base address
   * for indexed cache operations.  Two issues here:
-@@ -61,6 +93,7 @@ static inline void flush_icache_line_ind
+@@ -60,6 +92,7 @@ static inline void flush_icache_line_ind
  
  static inline void flush_dcache_line_indexed(unsigned long addr)
  {
@@ -47,7 +47,7 @@
  	cache_op(Index_Writeback_Inv_D, addr);
  }
  
-@@ -84,11 +117,13 @@ static inline void flush_icache_line(uns
+@@ -83,11 +116,13 @@ static inline void flush_icache_line(uns
  
  static inline void flush_dcache_line(unsigned long addr)
  {
@@ -61,23 +61,23 @@
  	cache_op(Hit_Invalidate_D, addr);
  }
  
-@@ -161,6 +196,7 @@ static inline int protected_flush_icache
- #ifdef CONFIG_EVA
- 		return protected_cachee_op(Hit_Invalidate_I, addr);
- #else
+@@ -160,6 +195,7 @@ static inline int protected_flush_icache
+ 		return protected_cache_op(Hit_Invalidate_I_Loongson2, addr);
+ 
+ 	default:
 +		BCM4710_DUMMY_RREG();
  		return protected_cache_op(Hit_Invalidate_I, addr);
- #endif
  	}
-@@ -174,6 +210,7 @@ static inline int protected_flush_icache
+ }
+@@ -172,6 +208,7 @@ static inline int protected_flush_icache
   */
  static inline int protected_writeback_dcache_line(unsigned long addr)
  {
 +	BCM4710_DUMMY_RREG();
- #ifdef CONFIG_EVA
- 	return protected_cachee_op(Hit_Writeback_Inv_D, addr);
- #else
-@@ -203,8 +240,51 @@ static inline void invalidate_tcache_pag
+ 	return protected_cache_op(Hit_Writeback_Inv_D, addr);
+ }
+ 
+@@ -193,8 +230,51 @@ static inline void invalidate_tcache_pag
  	unroll(times, _cache_op, insn, op, (addr) + (i++ * (lsize)));	\
  } while (0)
  
@@ -130,7 +130,7 @@
  static inline void extra##blast_##pfx##cache##lsize(void)		\
  {									\
  	unsigned long start = INDEX_BASE;				\
-@@ -214,6 +294,7 @@ static inline void extra##blast_##pfx##c
+@@ -204,6 +284,7 @@ static inline void extra##blast_##pfx##c
  			       current_cpu_data.desc.waybit;		\
  	unsigned long ws, addr;						\
  									\
@@ -138,7 +138,7 @@
  	for (ws = 0; ws < ws_end; ws += ws_inc)				\
  		for (addr = start; addr < end; addr += lsize * 32)	\
  			cache_unroll(32, kernel_cache, indexop,		\
-@@ -225,6 +306,7 @@ static inline void extra##blast_##pfx##c
+@@ -215,6 +296,7 @@ static inline void extra##blast_##pfx##c
  	unsigned long start = page;					\
  	unsigned long end = page + PAGE_SIZE;				\
  									\
@@ -146,7 +146,7 @@
  	do {								\
  		cache_unroll(32, kernel_cache, hitop, start, lsize);	\
  		start += lsize * 32;					\
-@@ -241,32 +323,33 @@ static inline void extra##blast_##pfx##c
+@@ -231,32 +313,33 @@ static inline void extra##blast_##pfx##c
  			       current_cpu_data.desc.waybit;		\
  	unsigned long ws, addr;						\
  									\
@@ -200,7 +200,7 @@
  
  #define __BUILD_BLAST_USER_CACHE(pfx, desc, indexop, hitop, lsize) \
  static inline void blast_##pfx##cache##lsize##_user_page(unsigned long page) \
-@@ -291,58 +374,29 @@ __BUILD_BLAST_USER_CACHE(d, dcache, Inde
+@@ -281,65 +364,36 @@ __BUILD_BLAST_USER_CACHE(d, dcache, Inde
  __BUILD_BLAST_USER_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64)
  
  /* build blast_xxx_range, protected_blast_xxx_range */
@@ -233,7 +233,8 @@
 -		addr += lsize_8;					\
 -		lines -= 8;						\
 -	}								\
--									\
++	unsigned long aend = (end - 1) & ~(lsize - 1);			\
+ 									\
 -	if (lines & 0x4) {						\
 -		prot##cache_op(hitop, addr);				\
 -		prot##cache_op(hitop, addr + lsize);			\
@@ -241,8 +242,7 @@
 -		prot##cache_op(hitop, addr + lsize_3);			\
 -		addr += lsize_4;					\
 -	}								\
-+	unsigned long aend = (end - 1) & ~(lsize - 1);			\
- 									\
+-									\
 -	if (lines & 0x2) {						\
 -		prot##cache_op(hitop, addr);				\
 -		prot##cache_op(hitop, addr + lsize);			\
@@ -260,20 +260,11 @@
  	}								\
  }
  
- #ifndef CONFIG_EVA
- 
 -__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_, )
 -__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_, )
+-__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_, )
 +__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_, , BCM4710_PROTECTED_FILL_TLB(addr); BCM4710_PROTECTED_FILL_TLB(aend);, BCM4710_DUMMY_RREG();)
 +__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_, , , )
- 
- #else
- 
-@@ -376,15 +430,15 @@ __BUILD_PROT_BLAST_CACHE_RANGE(d, dcache
- __BUILD_PROT_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I)
- 
- #endif
--__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_, )
 +__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_, , , )
  __BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I_Loongson2, \
 -	protected_, loongson2_)
@@ -350,7 +341,7 @@
 --- a/arch/mips/mm/c-r4k.c
 +++ b/arch/mips/mm/c-r4k.c
 @@ -38,6 +38,9 @@
- #include <asm/dma-coherence.h>
+ #include <asm/traps.h>
  #include <asm/mips-cps.h>
  
 +/* For enabling BCM4710 cache workarounds */
@@ -389,7 +380,7 @@
  	if (dc_lsize == 0)
  		r4k_blast_dcache = (void *)cache_noop;
  	else if (dc_lsize == 16)
-@@ -1818,6 +1830,17 @@ static void coherency_setup(void)
+@@ -1817,6 +1829,17 @@ static void coherency_setup(void)
  	 * silly idea of putting something else there ...
  	 */
  	switch (current_cpu_type()) {
@@ -407,7 +398,7 @@
  	case CPU_R4000PC:
  	case CPU_R4000SC:
  	case CPU_R4000MC:
-@@ -1864,6 +1887,15 @@ void r4k_cache_init(void)
+@@ -1863,6 +1886,15 @@ void r4k_cache_init(void)
  	extern void build_copy_page(void);
  	struct cpuinfo_mips *c = &current_cpu_data;
  
@@ -423,7 +414,7 @@
  	probe_pcache();
  	probe_vcache();
  	setup_scache();
-@@ -1940,7 +1972,15 @@ void r4k_cache_init(void)
+@@ -1935,7 +1967,15 @@ void r4k_cache_init(void)
  	 */
  	local_r4k___flush_cache_all(NULL);
  
@@ -441,7 +432,7 @@
  	/*
 --- a/arch/mips/mm/tlbex.c
 +++ b/arch/mips/mm/tlbex.c
-@@ -984,6 +984,9 @@ void build_get_pgde32(u32 **p, unsigned
+@@ -985,6 +985,9 @@ void build_get_pgde32(u32 **p, unsigned
  		uasm_i_srl(p, ptr, ptr, SMP_CPUID_PTRSHIFT);
  		uasm_i_addu(p, ptr, tmp, ptr);
  #else
@@ -451,7 +442,7 @@
  		UASM_i_LA_mostly(p, ptr, pgdc);
  #endif
  		uasm_i_mfc0(p, tmp, C0_BADVADDR); /* get faulting address */
-@@ -1345,6 +1348,9 @@ static void build_r4000_tlb_refill_handl
+@@ -1347,6 +1350,9 @@ static void build_r4000_tlb_refill_handl
  #ifdef CONFIG_64BIT
  		build_get_pmde64(&p, &l, &r, K0, K1); /* get pmd in K1 */
  #else
@@ -461,7 +452,7 @@
  		build_get_pgde32(&p, K0, K1); /* get pgd in K1 */
  #endif
  
-@@ -1356,6 +1362,9 @@ static void build_r4000_tlb_refill_handl
+@@ -1358,6 +1364,9 @@ static void build_r4000_tlb_refill_handl
  		build_update_entries(&p, K0, K1);
  		build_tlb_write_entry(&p, &l, &r, tlb_random);
  		uasm_l_leave(&l, p);
@@ -471,7 +462,7 @@
  		uasm_i_eret(&p); /* return from trap */
  	}
  #ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
-@@ -2056,6 +2065,9 @@ build_r4000_tlbchange_handler_head(u32 *
+@@ -2059,6 +2068,9 @@ build_r4000_tlbchange_handler_head(u32 *
  #ifdef CONFIG_64BIT
  	build_get_pmde64(p, l, r, wr.r1, wr.r2); /* get pmd in ptr */
  #else
@@ -481,7 +472,7 @@
  	build_get_pgde32(p, wr.r1, wr.r2); /* get pgd in ptr */
  #endif
  
-@@ -2102,6 +2114,9 @@ build_r4000_tlbchange_handler_tail(u32 *
+@@ -2105,6 +2117,9 @@ build_r4000_tlbchange_handler_tail(u32 *
  	build_tlb_write_entry(p, l, r, tlb_indexed);
  	uasm_l_leave(l, *p);
  	build_restore_work_registers(p);
diff --git a/target/linux/bcm47xx/patches-5.15/160-kmap_coherent.patch b/target/linux/bcm47xx/patches-5.15/160-kmap_coherent.patch
index caa3d9816b..b716f0cbc8 100644
--- a/target/linux/bcm47xx/patches-5.15/160-kmap_coherent.patch
+++ b/target/linux/bcm47xx/patches-5.15/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
-@@ -242,6 +242,9 @@
+@@ -240,6 +240,9 @@
  #ifndef cpu_has_pindexed_dcache
  #define cpu_has_pindexed_dcache	(cpu_data[0].dcache.flags & MIPS_CACHE_PINDEX)
  #endif
@@ -49,7 +49,7 @@ This fixes OpenWrt ticket #1485: https://dev.openwrt.org/ticket/1485
  			kunmap_atomic(vaddr);
 --- a/arch/mips/mm/init.c
 +++ b/arch/mips/mm/init.c
-@@ -173,7 +173,7 @@ void copy_user_highpage(struct page *to,
+@@ -172,7 +172,7 @@ void copy_user_highpage(struct page *to,
  	void *vfrom, *vto;
  
  	vto = kmap_atomic(to);
@@ -58,7 +58,7 @@ This fixes OpenWrt ticket #1485: https://dev.openwrt.org/ticket/1485
  	    page_mapcount(from) && !Page_dcache_dirty(from)) {
  		vfrom = kmap_coherent(from, vaddr);
  		copy_page(vto, vfrom);
-@@ -195,7 +195,7 @@ void copy_to_user_page(struct vm_area_st
+@@ -194,7 +194,7 @@ void copy_to_user_page(struct vm_area_st
  	struct page *page, unsigned long vaddr, void *dst, const void *src,
  	unsigned long len)
  {
@@ -67,7 +67,7 @@ This fixes OpenWrt ticket #1485: https://dev.openwrt.org/ticket/1485
  	    page_mapcount(page) && !Page_dcache_dirty(page)) {
  		void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
  		memcpy(vto, src, len);
-@@ -213,7 +213,7 @@ void copy_from_user_page(struct vm_area_
+@@ -212,7 +212,7 @@ void copy_from_user_page(struct vm_area_
  	struct page *page, unsigned long vaddr, void *dst, const void *src,
  	unsigned long len)
  {
diff --git a/target/linux/bcm47xx/patches-5.15/310-no_highpage.patch b/target/linux/bcm47xx/patches-5.15/310-no_highpage.patch
index b1dcdf9cb2..8f368e3e9e 100644
--- a/target/linux/bcm47xx/patches-5.15/310-no_highpage.patch
+++ b/target/linux/bcm47xx/patches-5.15/310-no_highpage.patch
@@ -41,7 +41,7 @@ For details see OpenWrt ticket #2035 https://dev.openwrt.org/ticket/2035
   * These are used to make use of C type-checking..
 --- a/arch/mips/mm/init.c
 +++ b/arch/mips/mm/init.c
-@@ -167,30 +167,6 @@ void kunmap_coherent(void)
+@@ -166,30 +166,6 @@ void kunmap_coherent(void)
  	preempt_enable();
  }
  
diff --git a/target/linux/bcm47xx/patches-5.15/610-pci_ide_fix.patch b/target/linux/bcm47xx/patches-5.15/610-pci_ide_fix.patch
deleted file mode 100644
index 520828e8e5..0000000000
--- a/target/linux/bcm47xx/patches-5.15/610-pci_ide_fix.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From: b.sander
-Subject: [PATCH] pci: IDE fix
-
-These are standard probing messages when using pdc202xx_old:
-pdc202xx_old 0000:00:01.0: IDE controller (0x105a:0x0d30 rev 0x02)
-PCI: Enabling device 0000:00:01.0 (0004 -> 0007)
-PCI: Fixing up device 0000:00:01.0
-0000:00:01.0: (U)DMA Burst Bit DISABLED Primary PCI Mode Secondary PCI Mode.
-0000:00:01.0: FORCING BURST BIT 0x00->0x01 ACTIVE
-pdc202xx_old 0000:00:01.0: 100% native mode on irq 6
-
-With the default MAX_HWIFS value after above we get:
-    ide2: BM-DMA at 0x0400-0x0407
-    ide3: BM-DMA at 0x0408-0x040f
-Probing IDE interface ide2...
-hde: CF500, CFA DISK drive
-
-As you can see it's ide2 + ide3 and hde.
-
-With this patch applied we get:
-    ide0: BM-DMA at 0x0400-0x0407
-    ide1: BM-DMA at 0x0408-0x040f
-Probing IDE interface ide0...
-hda: CF500, CFA DISK drive
-
-This fixes OpenWrt ticket #7061: https://dev.openwrt.org/ticket/7061
----
---- a/include/linux/ide.h
-+++ b/include/linux/ide.h
-@@ -236,7 +236,11 @@ static inline void ide_std_init_ports(st
- 	hw->io_ports.ctl_addr = ctl_addr;
- }
- 
-+#if defined CONFIG_BCM47XX
-+# define MAX_HWIFS	2
-+#else
- #define MAX_HWIFS	10
-+#endif
- 
- /*
-  * Now for the data we need to maintain per-drive:  ide_drive_t
diff --git a/target/linux/bcm47xx/patches-5.15/791-tg3-no-pci-sleep.patch b/target/linux/bcm47xx/patches-5.15/791-tg3-no-pci-sleep.patch
index 50edfc3b41..2c2f540695 100644
--- a/target/linux/bcm47xx/patches-5.15/791-tg3-no-pci-sleep.patch
+++ b/target/linux/bcm47xx/patches-5.15/791-tg3-no-pci-sleep.patch
@@ -5,7 +5,7 @@ when a switch driver is in use.
 
 --- a/drivers/net/ethernet/broadcom/tg3.c
 +++ b/drivers/net/ethernet/broadcom/tg3.c
-@@ -4273,7 +4273,8 @@ static int tg3_power_down_prepare(struct
+@@ -4267,7 +4267,8 @@ static int tg3_power_down_prepare(struct
  static void tg3_power_down(struct tg3 *tp)
  {
  	pci_wake_from_d3(tp->pdev, tg3_flag(tp, WOL_ENABLE));
diff --git a/target/linux/bcm47xx/patches-5.15/831-old_gpio_wdt.patch b/target/linux/bcm47xx/patches-5.15/831-old_gpio_wdt.patch
index f6fb7f1855..cb3bd0f263 100644
--- a/target/linux/bcm47xx/patches-5.15/831-old_gpio_wdt.patch
+++ b/target/linux/bcm47xx/patches-5.15/831-old_gpio_wdt.patch
@@ -4,7 +4,7 @@ Signed-off-by: Mathias Adam <m.adam--openwrt at adamis.de>
 
 --- a/drivers/watchdog/Kconfig
 +++ b/drivers/watchdog/Kconfig
-@@ -1698,6 +1698,15 @@ config WDT_MTX1
+@@ -1664,6 +1664,15 @@ config WDT_MTX1
  	  Hardware driver for the MTX-1 boards. This is a watchdog timer that
  	  will reboot the machine after a 100 seconds timer expired.
  
@@ -17,19 +17,19 @@ Signed-off-by: Mathias Adam <m.adam--openwrt at adamis.de>
 +	  100 second timer expired and no process has written to
 +	  /dev/watchdog during that time.
 +
- config PNX833X_WDT
- 	tristate "PNX833x Hardware Watchdog"
- 	depends on SOC_PNX8335
+ config SIBYTE_WDOG
+ 	tristate "Sibyte SoC hardware watchdog"
+ 	depends on CPU_SB1
 --- a/drivers/watchdog/Makefile
 +++ b/drivers/watchdog/Makefile
-@@ -161,6 +161,7 @@ obj-$(CONFIG_RC32434_WDT) += rc32434_wdt
+@@ -159,6 +159,7 @@ obj-$(CONFIG_RC32434_WDT) += rc32434_wdt
  obj-$(CONFIG_INDYDOG) += indydog.o
  obj-$(CONFIG_JZ4740_WDT) += jz4740_wdt.o
  obj-$(CONFIG_WDT_MTX1) += mtx-1_wdt.o
 +obj-$(CONFIG_GPIO_WDT) += old_gpio_wdt.o
- obj-$(CONFIG_PNX833X_WDT) += pnx833x_wdt.o
  obj-$(CONFIG_SIBYTE_WDOG) += sb_wdog.o
  obj-$(CONFIG_AR7_WDT) += ar7_wdt.o
+ obj-$(CONFIG_TXX9_WDT) += txx9wdt.o
 --- /dev/null
 +++ b/drivers/watchdog/old_gpio_wdt.c
 @@ -0,0 +1,301 @@
diff --git a/target/linux/bcm47xx/patches-5.15/900-ssb-reject-PCI-writes-setting-CardBus-bridge-resourc.patch b/target/linux/bcm47xx/patches-5.15/900-ssb-reject-PCI-writes-setting-CardBus-bridge-resourc.patch
index 6b7ee06e50..970e36eb68 100644
--- a/target/linux/bcm47xx/patches-5.15/900-ssb-reject-PCI-writes-setting-CardBus-bridge-resourc.patch
+++ b/target/linux/bcm47xx/patches-5.15/900-ssb-reject-PCI-writes-setting-CardBus-bridge-resourc.patch
@@ -17,7 +17,7 @@ Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
 
 --- a/drivers/ssb/driver_pcicore.c
 +++ b/drivers/ssb/driver_pcicore.c
-@@ -164,6 +164,10 @@ static int ssb_extpci_write_config(struc
+@@ -165,6 +165,10 @@ static int ssb_extpci_write_config(struc
  	WARN_ON(!pc->hostmode);
  	if (unlikely(len != 1 && len != 2 && len != 4))
  		goto out;
diff --git a/target/linux/bcm47xx/patches-5.15/976-ssb_increase_pci_delay.patch b/target/linux/bcm47xx/patches-5.15/976-ssb_increase_pci_delay.patch
index 99aa188374..201be1b187 100644
--- a/target/linux/bcm47xx/patches-5.15/976-ssb_increase_pci_delay.patch
+++ b/target/linux/bcm47xx/patches-5.15/976-ssb_increase_pci_delay.patch
@@ -1,9 +1,9 @@
 --- a/drivers/ssb/driver_pcicore.c
 +++ b/drivers/ssb/driver_pcicore.c
-@@ -390,7 +390,7 @@ static void ssb_pcicore_init_hostmode(st
- 	set_io_port_base(ssb_pcicore_controller.io_map_base);
+@@ -394,7 +394,7 @@ static void ssb_pcicore_init_hostmode(st
  	/* Give some time to the PCI controller to configure itself with the new
- 	 * values. Not waiting at this point causes crashes of the machine. */
+ 	 * values. Not waiting at this point causes crashes of the machine.
+ 	 */
 -	mdelay(10);
 +	mdelay(300);
  	register_pci_controller(&ssb_pcicore_controller);
diff --git a/target/linux/bcm47xx/patches-5.15/999-wl_exports.patch b/target/linux/bcm47xx/patches-5.15/999-wl_exports.patch
index 48c6a47871..b47913af70 100644
--- a/target/linux/bcm47xx/patches-5.15/999-wl_exports.patch
+++ b/target/linux/bcm47xx/patches-5.15/999-wl_exports.patch
@@ -12,7 +12,7 @@
  static int cfe_env;
 --- a/arch/mips/mm/cache.c
 +++ b/arch/mips/mm/cache.c
-@@ -61,6 +61,9 @@ void (*_dma_cache_wback_inv)(unsigned lo
+@@ -63,6 +63,9 @@ void (*_dma_cache_wback_inv)(unsigned lo
  void (*_dma_cache_wback)(unsigned long start, unsigned long size);
  void (*_dma_cache_inv)(unsigned long start, unsigned long size);
  



From lede-commits at lists.infradead.org  Fri Feb  3 03:01:03 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 06:01:03 -0500
Subject: [openwrt/openwrt]  bcm47xx: Copy kernel from 5.10 to 5.15
In-Reply-To: <167542206316.1893755.17767618027085819239@git-01.infra.openwrt.org>
References: <167542206316.1893755.17767618027085819239@git-01.infra.openwrt.org>
Message-ID: <mailman.12107.1675422071.3064139.lede-commits@lists.infradead.org>

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

commit 30c0ffecccbe6fe8e2289bed33027f9e2507039a
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Jan 22 19:08:04 2023 +0100

    bcm47xx: Copy kernel from 5.10 to 5.15
    
    Copy patches and configuration from kernel 5.10 to kernel 5.15 files. No
    changes were done.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/bcm47xx/config-5.15                   | 214 +++++++++
 ...-brcmnand-Assign-soc-as-early-as-possible.patch |  33 ++
 ...mnand-Allow-SoC-to-provide-I-O-operations.patch | 150 +++++++
 ...d-brcmnand-Avoid-pdev-in-brcmnand_init_cs.patch |  52 +++
 ...ove-OF-operations-out-of-brcmnand_init_cs.patch |  63 +++
 ...brcmnand-Allow-working-without-interrupts.patch |  91 ++++
 ...nand-Add-platform-data-structure-for-BCMA.patch | 115 +++++
 ...brcmnand-Allow-platform-data-instantation.patch | 124 ++++++
 ...d-BCMA-controller-uses-command-shift-of-0.patch |  29 ++
 ...-v5.18-mtd-rawnand-brcmnand-Add-BCMA-shim.patch | 201 +++++++++
 .../linux/bcm47xx/patches-5.15/159-cpu_fixes.patch | 493 +++++++++++++++++++++
 .../bcm47xx/patches-5.15/160-kmap_coherent.patch   |  78 ++++
 .../patches-5.15/209-b44-register-adm-switch.patch | 121 +++++
 .../bcm47xx/patches-5.15/210-b44_phy_fix.patch     |  54 +++
 .../280-activate_ssb_support_in_usb.patch          |  25 ++
 .../bcm47xx/patches-5.15/300-fork_cacheflush.patch |  21 +
 .../bcm47xx/patches-5.15/310-no_highpage.patch     |  74 ++++
 ...XX-Add-board-entry-for-Linksys-WRT320N-v1.patch |  89 ++++
 ...-BCM47XX-Add-support-for-Netgear-R6300-v1.patch |  60 +++
 ...XX-Add-support-for-Netgear-WN2500RP-v1-v2.patch |  63 +++
 ...M47XX-Add-support-for-Netgear-WNR3500L-v2.patch | 109 +++++
 ...7XX-Add-LEDs-and-buttons-for-Asus-RTN-10U.patch |  67 +++
 ...BCM47XX-Define-Linksys-WRT310N-V2-buttons.patch |  40 ++
 .../400-mtd-bcm47xxpart-get-nvram.patch            |  34 ++
 .../bcm47xx/patches-5.15/610-pci_ide_fix.patch     |  41 ++
 ...onnect-to-PHY-even-if-it-is-BGMAC_PHY_NOR.patch |  42 ++
 .../patches-5.15/791-tg3-no-pci-sleep.patch        |  17 +
 ...ble-of-serial-flashes-with-smaller-blocks.patch |  73 +++
 .../patches-5.15/820-wgt634u-nvram-fix.patch       | 296 +++++++++++++
 .../patches-5.15/830-huawei_e970_support.patch     | 101 +++++
 .../bcm47xx/patches-5.15/831-old_gpio_wdt.patch    | 360 +++++++++++++++
 ...PCI-writes-setting-CardBus-bridge-resourc.patch |  30 ++
 .../bcm47xx/patches-5.15/940-bcm47xx-yenta.patch   |  46 ++
 .../patches-5.15/976-ssb_increase_pci_delay.patch  |  11 +
 .../bcm47xx/patches-5.15/999-wl_exports.patch      |  24 +
 35 files changed, 3441 insertions(+)

diff --git a/target/linux/bcm47xx/config-5.15 b/target/linux/bcm47xx/config-5.15
new file mode 100644
index 0000000000..31d6d1de39
--- /dev/null
+++ b/target/linux/bcm47xx/config-5.15
@@ -0,0 +1,214 @@
+CONFIG_ADM6996_PHY=y
+CONFIG_ARCH_BINFMT_ELF_STATE=y
+CONFIG_ARCH_CLOCKSOURCE_DATA=y
+CONFIG_ARCH_DISCARD_MEMBLOCK=y
+CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
+CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_ARCH_MMAP_RND_BITS_MAX=15
+CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=15
+CONFIG_ARCH_SUPPORTS_UPROBES=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARCH_USE_BUILTIN_BSWAP=y
+CONFIG_ARCH_USE_QUEUED_RWLOCKS=y
+CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_BCM47XX=y
+CONFIG_BCM47XX_BCMA=y
+CONFIG_BCM47XX_NVRAM=y
+CONFIG_BCM47XX_SPROM=y
+CONFIG_BCM47XX_SSB=y
+CONFIG_BCM47XX_WDT=y
+CONFIG_BCMA=y
+CONFIG_BCMA_BLOCKIO=y
+CONFIG_BCMA_DEBUG=y
+CONFIG_BCMA_DRIVER_GMAC_CMN=y
+CONFIG_BCMA_DRIVER_GPIO=y
+CONFIG_BCMA_DRIVER_MIPS=y
+CONFIG_BCMA_DRIVER_PCI=y
+CONFIG_BCMA_DRIVER_PCI_HOSTMODE=y
+CONFIG_BCMA_HOST_PCI=y
+CONFIG_BCMA_HOST_PCI_POSSIBLE=y
+CONFIG_BCMA_HOST_SOC=y
+CONFIG_BCMA_NFLASH=y
+CONFIG_BCMA_PFLASH=y
+CONFIG_BCMA_SFLASH=y
+# CONFIG_BGMAC_BCMA is not set
+CONFIG_BLK_MQ_PCI=y
+CONFIG_CEVT_R4K=y
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_CMDLINE="noinitrd console=ttyS0,115200"
+CONFIG_CMDLINE_BOOL=y
+# CONFIG_CMDLINE_OVERRIDE is not set
+# CONFIG_COMMON_CLK is not set
+CONFIG_COMPAT_32BIT_TIME=y
+# CONFIG_CPU_BMIPS is not set
+CONFIG_CPU_GENERIC_DUMP_TLB=y
+CONFIG_CPU_HAS_PREFETCH=y
+CONFIG_CPU_HAS_SYNC=y
+CONFIG_CPU_LITTLE_ENDIAN=y
+CONFIG_CPU_MIPS32=y
+CONFIG_CPU_MIPS32_R1=y
+# CONFIG_CPU_MIPS32_R2 is not set
+CONFIG_CPU_MIPSR1=y
+CONFIG_CPU_MIPSR2_IRQ_VI=y
+CONFIG_CPU_NEEDS_NO_SMARTMIPS_OR_MICROMIPS=y
+CONFIG_CPU_R4K_CACHE_TLB=y
+CONFIG_CPU_R4K_FPU=y
+CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
+CONFIG_CPU_SUPPORTS_HIGHMEM=y
+CONFIG_CRYPTO_BLAKE2S=y
+CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_WORKQUEUE=y
+CONFIG_CSRC_R4K=y
+CONFIG_DMA_DIRECT_OPS=y
+CONFIG_DMA_NONCOHERENT=y
+CONFIG_DMA_NONCOHERENT_CACHE_SYNC=y
+CONFIG_DMA_NONCOHERENT_MMAP=y
+CONFIG_DMA_NONCOHERENT_OPS=y
+# CONFIG_EARLY_PRINTK is not set
+CONFIG_FIXED_PHY=y
+CONFIG_GENERIC_ATOMIC64=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+CONFIG_GENERIC_CMOS_UPDATE=y
+CONFIG_GENERIC_CPU_AUTOPROBE=y
+CONFIG_GENERIC_IRQ_CHIP=y
+CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_LIB_ASHLDI3=y
+CONFIG_GENERIC_LIB_ASHRDI3=y
+CONFIG_GENERIC_LIB_CMPDI2=y
+CONFIG_GENERIC_LIB_LSHRDI3=y
+CONFIG_GENERIC_LIB_UCMPDI2=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_SCHED_CLOCK=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GPIOLIB_IRQCHIP=y
+CONFIG_GPIO_WDT=y
+CONFIG_HANDLE_DOMAIN_IRQ=y
+CONFIG_HARDWARE_WATCHPOINTS=y
+CONFIG_HAS_DMA=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT_MAP=y
+CONFIG_HAVE_ARCH_COMPILER_H=y
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_HAVE_ARCH_KGDB=y
+CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+CONFIG_HAVE_CBPF_JIT=y
+CONFIG_HAVE_CONTEXT_TRACKING=y
+CONFIG_HAVE_COPY_THREAD_TLS=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_HAVE_DEBUG_KMEMLEAK=y
+CONFIG_HAVE_DEBUG_STACKOVERFLOW=y
+CONFIG_HAVE_DMA_CONTIGUOUS=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_HAVE_IDE=y
+CONFIG_HAVE_IRQ_EXIT_ON_IRQ_STACK=y
+CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
+CONFIG_HAVE_LATENCYTOP_SUPPORT=y
+CONFIG_HAVE_LD_DEAD_CODE_DATA_ELIMINATION=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_HAVE_MEMBLOCK_NODE_MAP=y
+CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
+CONFIG_HAVE_NET_DSA=y
+CONFIG_HAVE_OPROFILE=y
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
+CONFIG_HAVE_RSEQ=y
+CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
+CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
+CONFIG_HW_HAS_PCI=y
+CONFIG_HW_RANDOM=y
+CONFIG_HZ_PERIODIC=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_IRQ_DOMAIN=y
+CONFIG_IRQ_FORCED_THREADING=y
+CONFIG_IRQ_MIPS_CPU=y
+CONFIG_IRQ_WORK=y
+CONFIG_LEDS_GPIO_REGISTER=y
+CONFIG_LOCK_DEBUGGING_SUPPORT=y
+CONFIG_MDIO_BUS=y
+CONFIG_MDIO_DEVICE=y
+CONFIG_MEMFD_CREATE=y
+CONFIG_MIGRATION=y
+CONFIG_MIPS=y
+CONFIG_MIPS_ASID_BITS=8
+CONFIG_MIPS_ASID_SHIFT=0
+CONFIG_MIPS_CLOCK_VSYSCALL=y
+# CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set
+CONFIG_MIPS_CMDLINE_FROM_BOOTLOADER=y
+CONFIG_MIPS_L1_CACHE_SHIFT=5
+CONFIG_MODULES_USE_ELF_REL=y
+CONFIG_MTD_BCM47XXSFLASH=y
+CONFIG_MTD_BCM47XX_PARTS=y
+CONFIG_MTD_NAND_CORE=y
+CONFIG_MTD_RAW_NAND=y
+CONFIG_MTD_NAND_BCM47XXNFLASH=y
+CONFIG_MTD_NAND_BRCMNAND=y
+CONFIG_MTD_NAND_BRCMNAND_BCMA=y
+CONFIG_MTD_NAND_ECC=y
+CONFIG_MTD_PARSER_TRX=y
+CONFIG_MTD_PHYSMAP=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_NEED_PER_CPU_KM=y
+CONFIG_NO_EXCEPT_FILL=y
+CONFIG_NO_GENERIC_PCI_IOPORT_MAP=y
+# CONFIG_OF is not set
+CONFIG_PCI=y
+CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
+CONFIG_PCI_DOMAINS=y
+CONFIG_PCI_DRIVERS_LEGACY=y
+CONFIG_PERF_USE_VMALLOC=y
+CONFIG_PGTABLE_LEVELS=2
+CONFIG_PHYLIB=y
+CONFIG_SERIAL_8250_EXTENDED=y
+CONFIG_SERIAL_8250_SHARE_IRQ=y
+CONFIG_SRCU=y
+CONFIG_SSB=y
+CONFIG_SSB_B43_PCI_BRIDGE=y
+CONFIG_SSB_BLOCKIO=y
+CONFIG_SSB_DRIVER_EXTIF=y
+CONFIG_SSB_DRIVER_GIGE=y
+CONFIG_SSB_DRIVER_GPIO=y
+CONFIG_SSB_DRIVER_MIPS=y
+CONFIG_SSB_DRIVER_PCICORE=y
+CONFIG_SSB_DRIVER_PCICORE_POSSIBLE=y
+CONFIG_SSB_EMBEDDED=y
+CONFIG_SSB_HOST_SOC=y
+CONFIG_SSB_PCICORE_HOSTMODE=y
+CONFIG_SSB_PCIHOST=y
+CONFIG_SSB_PCIHOST_POSSIBLE=y
+CONFIG_SSB_SERIAL=y
+CONFIG_SSB_SFLASH=y
+CONFIG_SSB_SPROM=y
+CONFIG_SWCONFIG=y
+CONFIG_SWCONFIG_B53=y
+# CONFIG_SWCONFIG_B53_MMAP_DRIVER is not set
+CONFIG_SWCONFIG_B53_PHY_DRIVER=y
+CONFIG_SWCONFIG_B53_PHY_FIXUP=y
+# CONFIG_SWCONFIG_B53_SRAB_DRIVER is not set
+CONFIG_SWPHY=y
+CONFIG_SYSCTL_EXCEPTION_TRACE=y
+CONFIG_SYS_HAS_CPU_BMIPS=y
+CONFIG_SYS_HAS_CPU_BMIPS32_3300=y
+CONFIG_SYS_HAS_CPU_MIPS32_R1=y
+CONFIG_SYS_HAS_CPU_MIPS32_R2=y
+CONFIG_SYS_HAS_EARLY_PRINTK=y
+CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
+CONFIG_SYS_SUPPORTS_ARBIT_HZ=y
+CONFIG_SYS_SUPPORTS_HIGHMEM=y
+CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
+CONFIG_SYS_SUPPORTS_MIPS16=y
+CONFIG_SYS_SUPPORTS_ZBOOT=y
+CONFIG_TICK_CPU_ACCOUNTING=y
+CONFIG_TINY_SRCU=y
+CONFIG_USB_SUPPORT=y
+CONFIG_USE_GENERIC_EARLY_PRINTK_8250=y
+CONFIG_WATCHDOG_CORE=y
diff --git a/target/linux/bcm47xx/patches-5.15/100-v5.18-mtd-rawnand-brcmnand-Assign-soc-as-early-as-possible.patch b/target/linux/bcm47xx/patches-5.15/100-v5.18-mtd-rawnand-brcmnand-Assign-soc-as-early-as-possible.patch
new file mode 100644
index 0000000000..8efda10809
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/100-v5.18-mtd-rawnand-brcmnand-Assign-soc-as-early-as-possible.patch
@@ -0,0 +1,33 @@
+From: Florian Fainelli <f.fainelli at gmail.com>
+Subject: [PATCH v3 1/9] mtd: rawnand: brcmnand: Assign soc as early as possible
+Date: Fri, 07 Jan 2022 10:46:06 -0800
+Content-Type: text/plain; charset="utf-8"
+
+In order to key off the brcmnand_probe() code in subsequent changes
+depending upon ctrl->soc, assign that variable as early as possible,
+instead of much later when we have checked that it is non-NULL.
+
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ drivers/mtd/nand/raw/brcmnand/brcmnand.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
++++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+@@ -2949,6 +2949,7 @@ int brcmnand_probe(struct platform_devic
+ 
+ 	dev_set_drvdata(dev, ctrl);
+ 	ctrl->dev = dev;
++	ctrl->soc = soc;
+ 
+ 	init_completion(&ctrl->done);
+ 	init_completion(&ctrl->dma_done);
+@@ -3089,8 +3090,6 @@ int brcmnand_probe(struct platform_devic
+ 	 * interesting ways
+ 	 */
+ 	if (soc) {
+-		ctrl->soc = soc;
+-
+ 		ret = devm_request_irq(dev, ctrl->irq, brcmnand_irq, 0,
+ 				       DRV_NAME, ctrl);
+ 
diff --git a/target/linux/bcm47xx/patches-5.15/101-v5.18-mtd-rawnand-brcmnand-Allow-SoC-to-provide-I-O-operations.patch b/target/linux/bcm47xx/patches-5.15/101-v5.18-mtd-rawnand-brcmnand-Allow-SoC-to-provide-I-O-operations.patch
new file mode 100644
index 0000000000..23f5df3015
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/101-v5.18-mtd-rawnand-brcmnand-Allow-SoC-to-provide-I-O-operations.patch
@@ -0,0 +1,150 @@
+From: Florian Fainelli <f.fainelli at gmail.com>
+Subject: [PATCH v3 2/9] mtd: rawnand: brcmnand: Allow SoC to provide I/O operations
+Date: Fri, 07 Jan 2022 10:46:07 -0800
+Content-Type: text/plain; charset="utf-8"
+
+Allow a brcmnand_soc instance to provide a custom set of I/O operations
+which we will require when using this driver on a BCMA bus which is not
+directly memory mapped I/O. Update the nand_{read,write}_reg accordingly
+to use the SoC operations if provided.
+
+To minimize the penalty on other SoCs which do support standard MMIO
+accesses, we use a static key which is disabled by default and gets
+enabled if a soc implementation does provide I/O operations.
+
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ drivers/mtd/nand/raw/brcmnand/brcmnand.c | 28 +++++++++++++++++++++--
+ drivers/mtd/nand/raw/brcmnand/brcmnand.h | 29 ++++++++++++++++++++++++
+ 2 files changed, 55 insertions(+), 2 deletions(-)
+
+--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
++++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+@@ -25,6 +25,7 @@
+ #include <linux/of.h>
+ #include <linux/of_platform.h>
+ #include <linux/slab.h>
++#include <linux/static_key.h>
+ #include <linux/list.h>
+ #include <linux/log2.h>
+ 
+@@ -207,6 +208,8 @@ enum {
+ 
+ struct brcmnand_host;
+ 
++static DEFINE_STATIC_KEY_FALSE(brcmnand_soc_has_ops_key);
++
+ struct brcmnand_controller {
+ 	struct device		*dev;
+ 	struct nand_controller	controller;
+@@ -589,15 +592,25 @@ enum {
+ 	INTFC_CTLR_READY		= BIT(31),
+ };
+ 
++static inline bool brcmnand_non_mmio_ops(struct brcmnand_controller *ctrl)
++{
++	return static_branch_unlikely(&brcmnand_soc_has_ops_key);
++}
++
+ static inline u32 nand_readreg(struct brcmnand_controller *ctrl, u32 offs)
+ {
++	if (brcmnand_non_mmio_ops(ctrl))
++		return brcmnand_soc_read(ctrl->soc, offs);
+ 	return brcmnand_readl(ctrl->nand_base + offs);
+ }
+ 
+ static inline void nand_writereg(struct brcmnand_controller *ctrl, u32 offs,
+ 				 u32 val)
+ {
+-	brcmnand_writel(val, ctrl->nand_base + offs);
++	if (brcmnand_non_mmio_ops(ctrl))
++		brcmnand_soc_write(ctrl->soc, val, offs);
++	else
++		brcmnand_writel(val, ctrl->nand_base + offs);
+ }
+ 
+ static int brcmnand_revision_init(struct brcmnand_controller *ctrl)
+@@ -763,13 +776,18 @@ static inline void brcmnand_rmw_reg(stru
+ 
+ static inline u32 brcmnand_read_fc(struct brcmnand_controller *ctrl, int word)
+ {
++	if (brcmnand_non_mmio_ops(ctrl))
++		return brcmnand_soc_read(ctrl->soc, BRCMNAND_NON_MMIO_FC_ADDR);
+ 	return __raw_readl(ctrl->nand_fc + word * 4);
+ }
+ 
+ static inline void brcmnand_write_fc(struct brcmnand_controller *ctrl,
+ 				     int word, u32 val)
+ {
+-	__raw_writel(val, ctrl->nand_fc + word * 4);
++	if (brcmnand_non_mmio_ops(ctrl))
++		brcmnand_soc_write(ctrl->soc, val, BRCMNAND_NON_MMIO_FC_ADDR);
++	else
++		__raw_writel(val, ctrl->nand_fc + word * 4);
+ }
+ 
+ static inline void edu_writel(struct brcmnand_controller *ctrl,
+@@ -2951,6 +2969,12 @@ int brcmnand_probe(struct platform_devic
+ 	ctrl->dev = dev;
+ 	ctrl->soc = soc;
+ 
++	/* Enable the static key if the soc provides I/O operations indicating
++	 * that a non-memory mapped IO access path must be used
++	 */
++	if (brcmnand_soc_has_ops(ctrl->soc))
++		static_branch_enable(&brcmnand_soc_has_ops_key);
++
+ 	init_completion(&ctrl->done);
+ 	init_completion(&ctrl->dma_done);
+ 	init_completion(&ctrl->edu_done);
+--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.h
++++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.h
+@@ -11,12 +11,25 @@
+ 
+ struct platform_device;
+ struct dev_pm_ops;
++struct brcmnand_io_ops;
++
++/* Special register offset constant to intercept a non-MMIO access
++ * to the flash cache register space. This is intentionally large
++ * not to overlap with an existing offset.
++ */
++#define BRCMNAND_NON_MMIO_FC_ADDR	0xffffffff
+ 
+ struct brcmnand_soc {
+ 	bool (*ctlrdy_ack)(struct brcmnand_soc *soc);
+ 	void (*ctlrdy_set_enabled)(struct brcmnand_soc *soc, bool en);
+ 	void (*prepare_data_bus)(struct brcmnand_soc *soc, bool prepare,
+ 				 bool is_param);
++	const struct brcmnand_io_ops *ops;
++};
++
++struct brcmnand_io_ops {
++	u32 (*read_reg)(struct brcmnand_soc *soc, u32 offset);
++	void (*write_reg)(struct brcmnand_soc *soc, u32 val, u32 offset);
+ };
+ 
+ static inline void brcmnand_soc_data_bus_prepare(struct brcmnand_soc *soc,
+@@ -58,6 +71,22 @@ static inline void brcmnand_writel(u32 v
+ 		writel_relaxed(val, addr);
+ }
+ 
++static inline bool brcmnand_soc_has_ops(struct brcmnand_soc *soc)
++{
++	return soc && soc->ops && soc->ops->read_reg && soc->ops->write_reg;
++}
++
++static inline u32 brcmnand_soc_read(struct brcmnand_soc *soc, u32 offset)
++{
++	return soc->ops->read_reg(soc, offset);
++}
++
++static inline void brcmnand_soc_write(struct brcmnand_soc *soc, u32 val,
++				      u32 offset)
++{
++	soc->ops->write_reg(soc, val, offset);
++}
++
+ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc);
+ int brcmnand_remove(struct platform_device *pdev);
+ 
diff --git a/target/linux/bcm47xx/patches-5.15/102-v5.18-mtd-rawnand-brcmnand-Avoid-pdev-in-brcmnand_init_cs.patch b/target/linux/bcm47xx/patches-5.15/102-v5.18-mtd-rawnand-brcmnand-Avoid-pdev-in-brcmnand_init_cs.patch
new file mode 100644
index 0000000000..d9324c2595
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/102-v5.18-mtd-rawnand-brcmnand-Avoid-pdev-in-brcmnand_init_cs.patch
@@ -0,0 +1,52 @@
+From: Florian Fainelli <f.fainelli at gmail.com>
+Subject: [PATCH v3 3/9] mtd: rawnand: brcmnand: Avoid pdev in brcmnand_init_cs()
+Date: Fri, 07 Jan 2022 10:46:08 -0800
+Content-Type: text/plain; charset="utf-8"
+
+In preparation for encapsulating more of what the loop calling
+brcmnand_init_cs() does, avoid using platform_device when it is the
+device behind platform_device that we are using for printing errors.
+
+No functional changes introduced.
+
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ drivers/mtd/nand/raw/brcmnand/brcmnand.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
++++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+@@ -2722,7 +2722,7 @@ static const struct nand_controller_ops
+ static int brcmnand_init_cs(struct brcmnand_host *host, struct device_node *dn)
+ {
+ 	struct brcmnand_controller *ctrl = host->ctrl;
+-	struct platform_device *pdev = host->pdev;
++	struct device *dev = ctrl->dev;
+ 	struct mtd_info *mtd;
+ 	struct nand_chip *chip;
+ 	int ret;
+@@ -2730,7 +2730,7 @@ static int brcmnand_init_cs(struct brcmn
+ 
+ 	ret = of_property_read_u32(dn, "reg", &host->cs);
+ 	if (ret) {
+-		dev_err(&pdev->dev, "can't get chip-select\n");
++		dev_err(dev, "can't get chip-select\n");
+ 		return -ENXIO;
+ 	}
+ 
+@@ -2739,13 +2739,13 @@ static int brcmnand_init_cs(struct brcmn
+ 
+ 	nand_set_flash_node(chip, dn);
+ 	nand_set_controller_data(chip, host);
+-	mtd->name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "brcmnand.%d",
++	mtd->name = devm_kasprintf(dev, GFP_KERNEL, "brcmnand.%d",
+ 				   host->cs);
+ 	if (!mtd->name)
+ 		return -ENOMEM;
+ 
+ 	mtd->owner = THIS_MODULE;
+-	mtd->dev.parent = &pdev->dev;
++	mtd->dev.parent = dev;
+ 
+ 	chip->legacy.cmd_ctrl = brcmnand_cmd_ctrl;
+ 	chip->legacy.cmdfunc = brcmnand_cmdfunc;
diff --git a/target/linux/bcm47xx/patches-5.15/103-v5.18-mtd-rawnand-brcmnand-Move-OF-operations-out-of-brcmnand_init_cs.patch b/target/linux/bcm47xx/patches-5.15/103-v5.18-mtd-rawnand-brcmnand-Move-OF-operations-out-of-brcmnand_init_cs.patch
new file mode 100644
index 0000000000..34fd1b47ea
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/103-v5.18-mtd-rawnand-brcmnand-Move-OF-operations-out-of-brcmnand_init_cs.patch
@@ -0,0 +1,63 @@
+From: Florian Fainelli <f.fainelli at gmail.com>
+Subject: [PATCH v3 4/9] mtd: rawnand: brcmnand: Move OF operations out of brcmnand_init_cs()
+Date: Fri, 07 Jan 2022 10:46:09 -0800
+Content-Type: text/plain; charset="utf-8"
+
+In order to initialize a given chip select object for use by the
+brcmnand driver, move all of the Device Tree specific routines outside
+of brcmnand_init_cs() in order to make it usable in a platform data
+configuration which will be necessary for supporting BCMA chips.
+
+No functional changes introduced.
+
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ drivers/mtd/nand/raw/brcmnand/brcmnand.c | 20 +++++++++++---------
+ 1 file changed, 11 insertions(+), 9 deletions(-)
+
+--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
++++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+@@ -2719,7 +2719,7 @@ static const struct nand_controller_ops
+ 	.attach_chip = brcmnand_attach_chip,
+ };
+ 
+-static int brcmnand_init_cs(struct brcmnand_host *host, struct device_node *dn)
++static int brcmnand_init_cs(struct brcmnand_host *host)
+ {
+ 	struct brcmnand_controller *ctrl = host->ctrl;
+ 	struct device *dev = ctrl->dev;
+@@ -2728,16 +2728,9 @@ static int brcmnand_init_cs(struct brcmn
+ 	int ret;
+ 	u16 cfg_offs;
+ 
+-	ret = of_property_read_u32(dn, "reg", &host->cs);
+-	if (ret) {
+-		dev_err(dev, "can't get chip-select\n");
+-		return -ENXIO;
+-	}
+-
+ 	mtd = nand_to_mtd(&host->chip);
+ 	chip = &host->chip;
+ 
+-	nand_set_flash_node(chip, dn);
+ 	nand_set_controller_data(chip, host);
+ 	mtd->name = devm_kasprintf(dev, GFP_KERNEL, "brcmnand.%d",
+ 				   host->cs);
+@@ -3144,7 +3137,16 @@ int brcmnand_probe(struct platform_devic
+ 			host->pdev = pdev;
+ 			host->ctrl = ctrl;
+ 
+-			ret = brcmnand_init_cs(host, child);
++			ret = of_property_read_u32(child, "reg", &host->cs);
++			if (ret) {
++				dev_err(dev, "can't get chip-select\n");
++				devm_kfree(dev, host);
++				continue;
++			}
++
++			nand_set_flash_node(&host->chip, child);
++
++			ret = brcmnand_init_cs(host);
+ 			if (ret) {
+ 				devm_kfree(dev, host);
+ 				continue; /* Try all chip-selects */
diff --git a/target/linux/bcm47xx/patches-5.15/104-v5.18-mtd-rawnand-brcmnand-Allow-working-without-interrupts.patch b/target/linux/bcm47xx/patches-5.15/104-v5.18-mtd-rawnand-brcmnand-Allow-working-without-interrupts.patch
new file mode 100644
index 0000000000..3a9d18fa21
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/104-v5.18-mtd-rawnand-brcmnand-Allow-working-without-interrupts.patch
@@ -0,0 +1,91 @@
+From: Florian Fainelli <f.fainelli at gmail.com>
+Subject: [PATCH v3 5/9] mtd: rawnand: brcmnand: Allow working without interrupts
+Date: Fri, 07 Jan 2022 10:46:10 -0800
+Content-Type: text/plain; charset="utf-8"
+
+The BCMA devices include the brcmnand controller but they do not wire up
+any interrupt line, allow the main interrupt to be optional and update
+the completion path to also check for the lack of an interrupt line.
+
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ drivers/mtd/nand/raw/brcmnand/brcmnand.c | 52 +++++++++++-------------
+ 1 file changed, 24 insertions(+), 28 deletions(-)
+
+--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
++++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+@@ -216,7 +216,7 @@ struct brcmnand_controller {
+ 	void __iomem		*nand_base;
+ 	void __iomem		*nand_fc; /* flash cache */
+ 	void __iomem		*flash_dma_base;
+-	unsigned int		irq;
++	int			irq;
+ 	unsigned int		dma_irq;
+ 	int			nand_version;
+ 
+@@ -1590,7 +1590,7 @@ static bool brcmstb_nand_wait_for_comple
+ 	bool err = false;
+ 	int sts;
+ 
+-	if (mtd->oops_panic_write) {
++	if (mtd->oops_panic_write || ctrl->irq < 0) {
+ 		/* switch to interrupt polling and PIO mode */
+ 		disable_ctrl_irqs(ctrl);
+ 		sts = bcmnand_ctrl_poll_status(ctrl, NAND_CTRL_RDY,
+@@ -3095,33 +3095,29 @@ int brcmnand_probe(struct platform_devic
+ 	}
+ 
+ 	/* IRQ */
+-	ctrl->irq = platform_get_irq(pdev, 0);
+-	if ((int)ctrl->irq < 0) {
+-		dev_err(dev, "no IRQ defined\n");
+-		ret = -ENODEV;
+-		goto err;
+-	}
+-
+-	/*
+-	 * Some SoCs integrate this controller (e.g., its interrupt bits) in
+-	 * interesting ways
+-	 */
+-	if (soc) {
+-		ret = devm_request_irq(dev, ctrl->irq, brcmnand_irq, 0,
+-				       DRV_NAME, ctrl);
+-
+-		/* Enable interrupt */
+-		ctrl->soc->ctlrdy_ack(ctrl->soc);
+-		ctrl->soc->ctlrdy_set_enabled(ctrl->soc, true);
+-	} else {
+-		/* Use standard interrupt infrastructure */
+-		ret = devm_request_irq(dev, ctrl->irq, brcmnand_ctlrdy_irq, 0,
+-				       DRV_NAME, ctrl);
+-	}
+-	if (ret < 0) {
+-		dev_err(dev, "can't allocate IRQ %d: error %d\n",
+-			ctrl->irq, ret);
+-		goto err;
++	ctrl->irq = platform_get_irq_optional(pdev, 0);
++	if (ctrl->irq > 0) {
++		/*
++		 * Some SoCs integrate this controller (e.g., its interrupt bits) in
++		 * interesting ways
++		 */
++		if (soc) {
++			ret = devm_request_irq(dev, ctrl->irq, brcmnand_irq, 0,
++					       DRV_NAME, ctrl);
++
++			/* Enable interrupt */
++			ctrl->soc->ctlrdy_ack(ctrl->soc);
++			ctrl->soc->ctlrdy_set_enabled(ctrl->soc, true);
++		} else {
++			/* Use standard interrupt infrastructure */
++			ret = devm_request_irq(dev, ctrl->irq, brcmnand_ctlrdy_irq, 0,
++					       DRV_NAME, ctrl);
++		}
++		if (ret < 0) {
++			dev_err(dev, "can't allocate IRQ %d: error %d\n",
++				ctrl->irq, ret);
++			goto err;
++		}
+ 	}
+ 
+ 	for_each_available_child_of_node(dn, child) {
diff --git a/target/linux/bcm47xx/patches-5.15/105-v5.18-mtd-rawnand-brcmnand-Add-platform-data-structure-for-BCMA.patch b/target/linux/bcm47xx/patches-5.15/105-v5.18-mtd-rawnand-brcmnand-Add-platform-data-structure-for-BCMA.patch
new file mode 100644
index 0000000000..973a3e95ee
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/105-v5.18-mtd-rawnand-brcmnand-Add-platform-data-structure-for-BCMA.patch
@@ -0,0 +1,115 @@
+From: Florian Fainelli <f.fainelli at gmail.com>
+Subject: [PATCH v3 6/9] mtd: rawnand: brcmnand: Add platform data structure for BCMA
+Date: Fri, 07 Jan 2022 10:46:11 -0800
+Content-Type: text/plain; charset="utf-8"
+
+Update the BCMA's chipcommon nand flash driver to detect which
+chip-select is used and pass that information via platform data to the
+brcmnand driver. Make sure that the brcmnand platform data structure is
+always at the beginning of the platform data of the "nflash" device
+created by BCMA to allow brcmnand to safely de-reference it.
+
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ MAINTAINERS                                 |  1 +
+ drivers/bcma/driver_chipcommon_nflash.c     | 20 +++++++++++++++++++-
+ include/linux/bcma/bcma_driver_chipcommon.h |  5 +++++
+ include/linux/platform_data/brcmnand.h      | 12 ++++++++++++
+ 4 files changed, 37 insertions(+), 1 deletion(-)
+ create mode 100644 include/linux/platform_data/brcmnand.h
+
+--- a/MAINTAINERS
++++ b/MAINTAINERS
+@@ -3712,6 +3712,7 @@ L:	linux-mtd at lists.infradead.org
+ L:	bcm-kernel-feedback-list at broadcom.com
+ S:	Maintained
+ F:	drivers/mtd/nand/raw/brcmnand/
++F:	include/linux/platform_data/brcmnand.h
+ 
+ BROADCOM SYSTEMPORT ETHERNET DRIVER
+ M:	Florian Fainelli <f.fainelli at gmail.com>
+--- a/drivers/bcma/driver_chipcommon_nflash.c
++++ b/drivers/bcma/driver_chipcommon_nflash.c
+@@ -7,18 +7,28 @@
+ 
+ #include "bcma_private.h"
+ 
++#include <linux/bitops.h>
+ #include <linux/platform_device.h>
++#include <linux/platform_data/brcmnand.h>
+ #include <linux/bcma/bcma.h>
+ 
++/* Alternate NAND controller driver name in order to allow both bcm47xxnflash
++ * and bcma_brcmnand to be built into the same kernel image.
++ */
++static const char *bcma_nflash_alt_name = "bcma_brcmnand";
++
+ struct platform_device bcma_nflash_dev = {
+ 	.name		= "bcma_nflash",
+ 	.num_resources	= 0,
+ };
+ 
++static const char *probes[] = { "bcm47xxpart", NULL };
++
+ /* Initialize NAND flash access */
+ int bcma_nflash_init(struct bcma_drv_cc *cc)
+ {
+ 	struct bcma_bus *bus = cc->core->bus;
++	u32 reg;
+ 
+ 	if (bus->chipinfo.id != BCMA_CHIP_ID_BCM4706 &&
+ 	    cc->core->id.rev != 38) {
+@@ -33,8 +43,16 @@ int bcma_nflash_init(struct bcma_drv_cc
+ 
+ 	cc->nflash.present = true;
+ 	if (cc->core->id.rev == 38 &&
+-	    (cc->status & BCMA_CC_CHIPST_5357_NAND_BOOT))
++	    (cc->status & BCMA_CC_CHIPST_5357_NAND_BOOT)) {
+ 		cc->nflash.boot = true;
++		/* Determine the chip select that is being used */
++		reg = bcma_cc_read32(cc, BCMA_CC_NAND_CS_NAND_SELECT) & 0xff;
++		cc->nflash.brcmnand_info.chip_select = ffs(reg) - 1;
++		cc->nflash.brcmnand_info.part_probe_types = probes;
++		cc->nflash.brcmnand_info.ecc_stepsize = 512;
++		cc->nflash.brcmnand_info.ecc_strength = 1;
++		bcma_nflash_dev.name = bcma_nflash_alt_name;
++	}
+ 
+ 	/* Prepare platform device, but don't register it yet. It's too early,
+ 	 * malloc (required by device_private_init) is not available yet. */
+--- a/include/linux/bcma/bcma_driver_chipcommon.h
++++ b/include/linux/bcma/bcma_driver_chipcommon.h
+@@ -3,6 +3,7 @@
+ #define LINUX_BCMA_DRIVER_CC_H_
+ 
+ #include <linux/platform_device.h>
++#include <linux/platform_data/brcmnand.h>
+ #include <linux/gpio.h>
+ 
+ /** ChipCommon core registers. **/
+@@ -599,6 +600,10 @@ struct bcma_sflash {
+ 
+ #ifdef CONFIG_BCMA_NFLASH
+ struct bcma_nflash {
++	/* Must be the fist member for the brcmnand driver to
++	 * de-reference that structure.
++	 */
++	struct brcmnand_platform_data brcmnand_info;
+ 	bool present;
+ 	bool boot;		/* This is the flash the SoC boots from */
+ };
+--- /dev/null
++++ b/include/linux/platform_data/brcmnand.h
+@@ -0,0 +1,12 @@
++/* SPDX-License-Identifier: GPL-2.0-only */
++#ifndef BRCMNAND_PLAT_DATA_H
++#define BRCMNAND_PLAT_DATA_H
++
++struct brcmnand_platform_data {
++	int	chip_select;
++	const char * const *part_probe_types;
++	unsigned int ecc_stepsize;
++	unsigned int ecc_strength;
++};
++
++#endif /* BRCMNAND_PLAT_DATA_H */
diff --git a/target/linux/bcm47xx/patches-5.15/106-v5.18-mtd-rawnand-brcmnand-Allow-platform-data-instantation.patch b/target/linux/bcm47xx/patches-5.15/106-v5.18-mtd-rawnand-brcmnand-Allow-platform-data-instantation.patch
new file mode 100644
index 0000000000..fb9ee07d04
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/106-v5.18-mtd-rawnand-brcmnand-Allow-platform-data-instantation.patch
@@ -0,0 +1,124 @@
+From: Florian Fainelli <f.fainelli at gmail.com>
+Subject: [PATCH v3 7/9] mtd: rawnand: brcmnand: Allow platform data instantation
+Date: Fri, 07 Jan 2022 10:46:12 -0800
+Content-Type: text/plain; charset="utf-8"
+
+Make use of the recently refactored code in brcmnand_init_cs() and
+derive the chip-select from the platform data that is supplied. Update
+the various code paths to avoid relying on possibly non-existent
+resources, too.
+
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ drivers/mtd/nand/raw/brcmnand/brcmnand.c | 45 ++++++++++++++++++------
+ 1 file changed, 35 insertions(+), 10 deletions(-)
+
+--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
++++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+@@ -9,6 +9,7 @@
+ #include <linux/delay.h>
+ #include <linux/device.h>
+ #include <linux/platform_device.h>
++#include <linux/platform_data/brcmnand.h>
+ #include <linux/err.h>
+ #include <linux/completion.h>
+ #include <linux/interrupt.h>
+@@ -2719,7 +2720,8 @@ static const struct nand_controller_ops
+ 	.attach_chip = brcmnand_attach_chip,
+ };
+ 
+-static int brcmnand_init_cs(struct brcmnand_host *host)
++static int brcmnand_init_cs(struct brcmnand_host *host,
++			    const char * const *part_probe_types)
+ {
+ 	struct brcmnand_controller *ctrl = host->ctrl;
+ 	struct device *dev = ctrl->dev;
+@@ -2772,7 +2774,7 @@ static int brcmnand_init_cs(struct brcmn
+ 	if (ret)
+ 		return ret;
+ 
+-	ret = mtd_device_register(mtd, NULL, 0);
++	ret = mtd_device_parse_register(mtd, part_probe_types, NULL, NULL, 0);
+ 	if (ret)
+ 		nand_cleanup(chip);
+ 
+@@ -2941,17 +2943,15 @@ static int brcmnand_edu_setup(struct pla
+ 
+ int brcmnand_probe(struct platform_device *pdev, struct brcmnand_soc *soc)
+ {
++	struct brcmnand_platform_data *pd = dev_get_platdata(&pdev->dev);
+ 	struct device *dev = &pdev->dev;
+ 	struct device_node *dn = dev->of_node, *child;
+ 	struct brcmnand_controller *ctrl;
++	struct brcmnand_host *host;
+ 	struct resource *res;
+ 	int ret;
+ 
+-	/* We only support device-tree instantiation */
+-	if (!dn)
+-		return -ENODEV;
+-
+-	if (!of_match_node(brcmnand_of_match, dn))
++	if (dn && !of_match_node(brcmnand_of_match, dn))
+ 		return -ENODEV;
+ 
+ 	ctrl = devm_kzalloc(dev, sizeof(*ctrl), GFP_KERNEL);
+@@ -2978,7 +2978,7 @@ int brcmnand_probe(struct platform_devic
+ 	/* NAND register range */
+ 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ 	ctrl->nand_base = devm_ioremap_resource(dev, res);
+-	if (IS_ERR(ctrl->nand_base))
++	if (IS_ERR(ctrl->nand_base) && !brcmnand_soc_has_ops(soc))
+ 		return PTR_ERR(ctrl->nand_base);
+ 
+ 	/* Enable clock before using NAND registers */
+@@ -3122,7 +3122,6 @@ int brcmnand_probe(struct platform_devic
+ 
+ 	for_each_available_child_of_node(dn, child) {
+ 		if (of_device_is_compatible(child, "brcm,nandcs")) {
+-			struct brcmnand_host *host;
+ 
+ 			host = devm_kzalloc(dev, sizeof(*host), GFP_KERNEL);
+ 			if (!host) {
+@@ -3142,7 +3141,7 @@ int brcmnand_probe(struct platform_devic
+ 
+ 			nand_set_flash_node(&host->chip, child);
+ 
+-			ret = brcmnand_init_cs(host);
++			ret = brcmnand_init_cs(host, NULL);
+ 			if (ret) {
+ 				devm_kfree(dev, host);
+ 				continue; /* Try all chip-selects */
+@@ -3152,6 +3151,32 @@ int brcmnand_probe(struct platform_devic
+ 		}
+ 	}
+ 
++	if (!list_empty(&ctrl->host_list))
++		return 0;
++
++	if (!pd) {
++		ret = -ENODEV;
++		goto err;
++	}
++
++	/* If we got there we must have been probing via platform data */
++	host = devm_kzalloc(dev, sizeof(*host), GFP_KERNEL);
++	if (!host) {
++		ret = -ENOMEM;
++		goto err;
++	}
++	host->pdev = pdev;
++	host->ctrl = ctrl;
++	host->cs = pd->chip_select;
++	host->chip.ecc.size = pd->ecc_stepsize;
++	host->chip.ecc.strength = pd->ecc_strength;
++
++	ret = brcmnand_init_cs(host, pd->part_probe_types);
++	if (ret)
++		goto err;
++
++	list_add_tail(&host->node, &ctrl->host_list);
++
+ 	/* No chip-selects could initialize properly */
+ 	if (list_empty(&ctrl->host_list)) {
+ 		ret = -ENODEV;
diff --git a/target/linux/bcm47xx/patches-5.15/107-v5.18-mtd-rawnand-brcmnand-BCMA-controller-uses-command-shift-of-0.patch b/target/linux/bcm47xx/patches-5.15/107-v5.18-mtd-rawnand-brcmnand-BCMA-controller-uses-command-shift-of-0.patch
new file mode 100644
index 0000000000..39f34aab29
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/107-v5.18-mtd-rawnand-brcmnand-BCMA-controller-uses-command-shift-of-0.patch
@@ -0,0 +1,29 @@
+From: Florian Fainelli <f.fainelli at gmail.com>
+Subject: [PATCH v3 8/9] mtd: rawnand: brcmnand: BCMA controller uses command shift of 0
+Date: Fri, 07 Jan 2022 10:46:13 -0800
+Content-Type: text/plain; charset="utf-8"
+
+For some odd and unexplained reason the BCMA NAND controller, albeit
+revision 3.4 uses a command shift of 0 instead of 24 as it should be,
+quirk that.
+
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ drivers/mtd/nand/raw/brcmnand/brcmnand.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
++++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+@@ -913,6 +913,12 @@ static void brcmnand_wr_corr_thresh(stru
+ 
+ static inline int brcmnand_cmd_shift(struct brcmnand_controller *ctrl)
+ {
++	/* Kludge for the BCMA-based NAND controller which does not actually
++	 * shift the command
++	 */
++	if (ctrl->nand_version == 0x0304 && brcmnand_non_mmio_ops(ctrl))
++		return 0;
++
+ 	if (ctrl->nand_version < 0x0602)
+ 		return 24;
+ 	return 0;
diff --git a/target/linux/bcm47xx/patches-5.15/108-v5.18-mtd-rawnand-brcmnand-Add-BCMA-shim.patch b/target/linux/bcm47xx/patches-5.15/108-v5.18-mtd-rawnand-brcmnand-Add-BCMA-shim.patch
new file mode 100644
index 0000000000..eabb4c2475
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/108-v5.18-mtd-rawnand-brcmnand-Add-BCMA-shim.patch
@@ -0,0 +1,201 @@
+From: Florian Fainelli <f.fainelli at gmail.com>
+Subject: [PATCH v3 9/9] mtd: rawnand: brcmnand: Add BCMA shim
+Date: Fri, 07 Jan 2022 10:46:14 -0800
+Content-Type: text/plain; charset="utf-8"
+
+Add a BCMA shim to allow us to register the brcmnand driver using the
+BCMA bus which provides indirect memory mapped access to SoC registers.
+
+There are a number of registers that need to be byte swapped because
+they are natively big endian, coming directly from the NAND chip, and
+there is no bus interface unlike the iProc or STB platforms that
+performs the byte swapping for us.
+
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+---
+ drivers/mtd/nand/raw/Kconfig              |  13 +++
+ drivers/mtd/nand/raw/brcmnand/Makefile    |   2 +
+ drivers/mtd/nand/raw/brcmnand/bcma_nand.c | 132 ++++++++++++++++++++++
+ drivers/mtd/nand/raw/brcmnand/brcmnand.c  |   4 +
+ 4 files changed, 151 insertions(+)
+ create mode 100644 drivers/mtd/nand/raw/brcmnand/bcma_nand.c
+
+--- a/drivers/mtd/nand/raw/Kconfig
++++ b/drivers/mtd/nand/raw/Kconfig
+@@ -236,6 +236,19 @@ config MTD_NAND_BRCMNAND
+ 	  originally designed for Set-Top Box but is used on various BCM7xxx,
+ 	  BCM3xxx, BCM63xxx, iProc/Cygnus and more.
+ 
++if MTD_NAND_BRCMNAND
++
++config MTD_NAND_BRCMNAND_BCMA
++	tristate "Broadcom BCMA NAND controller"
++	depends on BCMA_NFLASH
++	depends on BCMA
++	help
++	  Enables the BRCMNAND controller over BCMA on BCM47186/BCM5358 SoCs.
++	  The glue driver will take care of performing the low-level I/O
++	  operations to interface the BRCMNAND controller over the BCMA bus.
++
++endif # MTD_NAND_BRCMNAND
++
+ config MTD_NAND_BCM47XXNFLASH
+ 	tristate "BCM4706 BCMA NAND controller"
+ 	depends on BCMA_NFLASH
+--- a/drivers/mtd/nand/raw/brcmnand/Makefile
++++ b/drivers/mtd/nand/raw/brcmnand/Makefile
+@@ -6,3 +6,5 @@ obj-$(CONFIG_MTD_NAND_BRCMNAND)		+= bcm6
+ obj-$(CONFIG_MTD_NAND_BRCMNAND)		+= bcm6368_nand.o
+ obj-$(CONFIG_MTD_NAND_BRCMNAND)		+= brcmstb_nand.o
+ obj-$(CONFIG_MTD_NAND_BRCMNAND)		+= brcmnand.o
++
++obj-$(CONFIG_MTD_NAND_BRCMNAND_BCMA)	+= bcma_nand.o
+--- /dev/null
++++ b/drivers/mtd/nand/raw/brcmnand/bcma_nand.c
+@@ -0,0 +1,132 @@
++// SPDX-License-Identifier: GPL-2.0-only
++/*
++ * Copyright ? 2021 Broadcom
++ */
++#include <linux/bcma/bcma.h>
++#include <linux/bcma/bcma_driver_chipcommon.h>
++#include <linux/device.h>
++#include <linux/module.h>
++#include <linux/platform_device.h>
++
++#include "brcmnand.h"
++
++struct brcmnand_bcma_soc {
++	struct brcmnand_soc soc;
++	struct bcma_drv_cc *cc;
++};
++
++static inline bool brcmnand_bcma_needs_swapping(u32 offset)
++{
++	switch (offset) {
++	case BCMA_CC_NAND_SPARE_RD0:
++	case BCMA_CC_NAND_SPARE_RD4:
++	case BCMA_CC_NAND_SPARE_RD8:
++	case BCMA_CC_NAND_SPARE_RD12:
++	case BCMA_CC_NAND_SPARE_WR0:
++	case BCMA_CC_NAND_SPARE_WR4:
++	case BCMA_CC_NAND_SPARE_WR8:
++	case BCMA_CC_NAND_SPARE_WR12:
++	case BCMA_CC_NAND_DEVID:
++	case BCMA_CC_NAND_DEVID_X:
++	case BCMA_CC_NAND_SPARE_RD16:
++	case BCMA_CC_NAND_SPARE_RD20:
++	case BCMA_CC_NAND_SPARE_RD24:
++	case BCMA_CC_NAND_SPARE_RD28:
++		return true;
++	}
++
++	return false;
++}
++
++static inline struct brcmnand_bcma_soc *to_bcma_soc(struct brcmnand_soc *soc)
++{
++	return container_of(soc, struct brcmnand_bcma_soc, soc);
++}
++
++static u32 brcmnand_bcma_read_reg(struct brcmnand_soc *soc, u32 offset)
++{
++	struct brcmnand_bcma_soc *sc = to_bcma_soc(soc);
++	u32 val;
++
++	/* Offset into the NAND block and deal with the flash cache separately */
++	if (offset == BRCMNAND_NON_MMIO_FC_ADDR)
++		offset = BCMA_CC_NAND_CACHE_DATA;
++	else
++		offset += BCMA_CC_NAND_REVISION;
++
++	val = bcma_cc_read32(sc->cc, offset);
++
++	/* Swap if necessary */
++	if (brcmnand_bcma_needs_swapping(offset))
++		val = be32_to_cpu(val);
++	return val;
++}
++
++static void brcmnand_bcma_write_reg(struct brcmnand_soc *soc, u32 val,
++				    u32 offset)
++{
++	struct brcmnand_bcma_soc *sc = to_bcma_soc(soc);
++
++	/* Offset into the NAND block */
++	if (offset == BRCMNAND_NON_MMIO_FC_ADDR)
++		offset = BCMA_CC_NAND_CACHE_DATA;
++	else
++		offset += BCMA_CC_NAND_REVISION;
++
++	/* Swap if necessary */
++	if (brcmnand_bcma_needs_swapping(offset))
++		val = cpu_to_be32(val);
++
++	bcma_cc_write32(sc->cc, offset, val);
++}
++
++static struct brcmnand_io_ops brcmnand_bcma_io_ops = {
++	.read_reg	= brcmnand_bcma_read_reg,
++	.write_reg	= brcmnand_bcma_write_reg,
++};
++
++static void brcmnand_bcma_prepare_data_bus(struct brcmnand_soc *soc, bool prepare,
++					   bool is_param)
++{
++	struct brcmnand_bcma_soc *sc = to_bcma_soc(soc);
++
++	/* Reset the cache address to ensure we are already accessing the
++	 * beginning of a sub-page.
++	 */
++	bcma_cc_write32(sc->cc, BCMA_CC_NAND_CACHE_ADDR, 0);
++}
++
++static int brcmnand_bcma_nand_probe(struct platform_device *pdev)
++{
++	struct bcma_nflash *nflash = dev_get_platdata(&pdev->dev);
++	struct brcmnand_bcma_soc *soc;
++
++	soc = devm_kzalloc(&pdev->dev, sizeof(*soc), GFP_KERNEL);
++	if (!soc)
++		return -ENOMEM;
++
++	soc->cc = container_of(nflash, struct bcma_drv_cc, nflash);
++	soc->soc.prepare_data_bus = brcmnand_bcma_prepare_data_bus;
++	soc->soc.ops = &brcmnand_bcma_io_ops;
++
++	if (soc->cc->core->bus->chipinfo.id == BCMA_CHIP_ID_BCM4706) {
++		dev_err(&pdev->dev, "Use bcm47xxnflash for 4706!\n");
++		return -ENODEV;
++	}
++
++	return brcmnand_probe(pdev, &soc->soc);
++}
++
++static struct platform_driver brcmnand_bcma_nand_driver = {
++	.probe			= brcmnand_bcma_nand_probe,
++	.remove			= brcmnand_remove,
++	.driver = {
++		.name		= "bcma_brcmnand",
++		.pm		= &brcmnand_pm_ops,
++	}
++};
++module_platform_driver(brcmnand_bcma_nand_driver);
++
++MODULE_LICENSE("GPL v2");
++MODULE_AUTHOR("Broadcom");
++MODULE_DESCRIPTION("NAND controller driver glue for BCMA chips");
+--- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c
++++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c
+@@ -595,7 +595,11 @@ enum {
+ 
+ static inline bool brcmnand_non_mmio_ops(struct brcmnand_controller *ctrl)
+ {
++#if IS_ENABLED(CONFIG_MTD_NAND_BRCMNAND_BCMA)
+ 	return static_branch_unlikely(&brcmnand_soc_has_ops_key);
++#else
++	return false;
++#endif
+ }
+ 
+ static inline u32 nand_readreg(struct brcmnand_controller *ctrl, u32 offs)
diff --git a/target/linux/bcm47xx/patches-5.15/159-cpu_fixes.patch b/target/linux/bcm47xx/patches-5.15/159-cpu_fixes.patch
new file mode 100644
index 0000000000..0c9a9d6490
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/159-cpu_fixes.patch
@@ -0,0 +1,493 @@
+--- a/arch/mips/include/asm/r4kcache.h
++++ b/arch/mips/include/asm/r4kcache.h
+@@ -28,6 +28,38 @@
+ extern void (*r4k_blast_dcache)(void);
+ extern void (*r4k_blast_icache)(void);
+ 
++#if defined(CONFIG_BCM47XX) && !defined(CONFIG_CPU_MIPS32_R2)
++#include <asm/paccess.h>
++#include <linux/ssb/ssb.h>
++#define BCM4710_DUMMY_RREG() bcm4710_dummy_rreg()
++
++static inline unsigned long bcm4710_dummy_rreg(void)
++{
++      return *(volatile unsigned long *)(KSEG1ADDR(SSB_ENUM_BASE));
++}
++
++#define BCM4710_FILL_TLB(addr) bcm4710_fill_tlb((void *)(addr))
++
++static inline unsigned long bcm4710_fill_tlb(void *addr)
++{
++      return *(unsigned long *)addr;
++}
++
++#define BCM4710_PROTECTED_FILL_TLB(addr) bcm4710_protected_fill_tlb((void *)(addr))
++
++static inline void bcm4710_protected_fill_tlb(void *addr)
++{
++      unsigned long x;
++      get_dbe(x, (unsigned long *)addr);;
++}
++
++#else
++#define BCM4710_DUMMY_RREG()
++
++#define BCM4710_FILL_TLB(addr)
++#define BCM4710_PROTECTED_FILL_TLB(addr)
++#endif
++
+ /*
+  * This macro return a properly sign-extended address suitable as base address
+  * for indexed cache operations.  Two issues here:
+@@ -61,6 +93,7 @@ static inline void flush_icache_line_ind
+ 
+ static inline void flush_dcache_line_indexed(unsigned long addr)
+ {
++	BCM4710_DUMMY_RREG();
+ 	cache_op(Index_Writeback_Inv_D, addr);
+ }
+ 
+@@ -84,11 +117,13 @@ static inline void flush_icache_line(uns
+ 
+ static inline void flush_dcache_line(unsigned long addr)
+ {
++	BCM4710_DUMMY_RREG();
+ 	cache_op(Hit_Writeback_Inv_D, addr);
+ }
+ 
+ static inline void invalidate_dcache_line(unsigned long addr)
+ {
++	BCM4710_DUMMY_RREG();
+ 	cache_op(Hit_Invalidate_D, addr);
+ }
+ 
+@@ -161,6 +196,7 @@ static inline int protected_flush_icache
+ #ifdef CONFIG_EVA
+ 		return protected_cachee_op(Hit_Invalidate_I, addr);
+ #else
++		BCM4710_DUMMY_RREG();
+ 		return protected_cache_op(Hit_Invalidate_I, addr);
+ #endif
+ 	}
+@@ -174,6 +210,7 @@ static inline int protected_flush_icache
+  */
+ static inline int protected_writeback_dcache_line(unsigned long addr)
+ {
++	BCM4710_DUMMY_RREG();
+ #ifdef CONFIG_EVA
+ 	return protected_cachee_op(Hit_Writeback_Inv_D, addr);
+ #else
+@@ -203,8 +240,51 @@ static inline void invalidate_tcache_pag
+ 	unroll(times, _cache_op, insn, op, (addr) + (i++ * (lsize)));	\
+ } while (0)
+ 
++static inline void blast_dcache(void)
++{
++	unsigned long start = KSEG0;
++	unsigned long dcache_size = current_cpu_data.dcache.waysize * current_cpu_data.dcache.ways;
++	unsigned long end = (start + dcache_size);
++
++	do {
++		BCM4710_DUMMY_RREG();
++		cache_op(Index_Writeback_Inv_D, start);
++		start += current_cpu_data.dcache.linesz;
++	} while(start < end);
++}
++
++static inline void blast_dcache_page(unsigned long page)
++{
++	unsigned long start = page;
++	unsigned long end = start + PAGE_SIZE;
++
++	BCM4710_FILL_TLB(start);
++	do {
++		BCM4710_DUMMY_RREG();
++		cache_op(Hit_Writeback_Inv_D, start);
++		start += current_cpu_data.dcache.linesz;
++	} while(start < end);
++}
++
++static inline void blast_dcache_page_indexed(unsigned long page)
++{
++	unsigned long start = page;
++	unsigned long end = start + PAGE_SIZE;
++	unsigned long ws_inc = 1UL << current_cpu_data.dcache.waybit;
++	unsigned long ws_end = current_cpu_data.dcache.ways <<
++	                       current_cpu_data.dcache.waybit;
++	unsigned long ws, addr;
++	for (ws = 0; ws < ws_end; ws += ws_inc) {
++		start = page + ws;
++		for (addr = start; addr < end; addr += current_cpu_data.dcache.linesz) {
++			BCM4710_DUMMY_RREG();
++			cache_op(Index_Writeback_Inv_D, addr);
++		}
++	}
++}
++
+ /* build blast_xxx, blast_xxx_page, blast_xxx_page_indexed */
+-#define __BUILD_BLAST_CACHE(pfx, desc, indexop, hitop, lsize, extra)	\
++#define __BUILD_BLAST_CACHE(pfx, desc, indexop, hitop, lsize, extra, war) \
+ static inline void extra##blast_##pfx##cache##lsize(void)		\
+ {									\
+ 	unsigned long start = INDEX_BASE;				\
+@@ -214,6 +294,7 @@ static inline void extra##blast_##pfx##c
+ 			       current_cpu_data.desc.waybit;		\
+ 	unsigned long ws, addr;						\
+ 									\
++	war								\
+ 	for (ws = 0; ws < ws_end; ws += ws_inc)				\
+ 		for (addr = start; addr < end; addr += lsize * 32)	\
+ 			cache_unroll(32, kernel_cache, indexop,		\
+@@ -225,6 +306,7 @@ static inline void extra##blast_##pfx##c
+ 	unsigned long start = page;					\
+ 	unsigned long end = page + PAGE_SIZE;				\
+ 									\
++	war								\
+ 	do {								\
+ 		cache_unroll(32, kernel_cache, hitop, start, lsize);	\
+ 		start += lsize * 32;					\
+@@ -241,32 +323,33 @@ static inline void extra##blast_##pfx##c
+ 			       current_cpu_data.desc.waybit;		\
+ 	unsigned long ws, addr;						\
+ 									\
++	war								\
+ 	for (ws = 0; ws < ws_end; ws += ws_inc)				\
+ 		for (addr = start; addr < end; addr += lsize * 32)	\
+ 			cache_unroll(32, kernel_cache, indexop,		\
+ 				     addr | ws, lsize);			\
+ }
+ 
+-__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16, )
+-__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 16, )
+-__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 16, )
+-__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32, )
+-__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32, )
+-__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I_Loongson2, 32, loongson2_)
+-__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32, )
+-__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 64, )
+-__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64, )
+-__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64, )
+-__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 128, )
+-__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 128, )
+-__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128, )
+-
+-__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 16, )
+-__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 32, )
+-__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 16, )
+-__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 32, )
+-__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 64, )
+-__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 128, )
++__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16, , )
++__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 16, , BCM4710_FILL_TLB(start);)
++__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 16, , )
++__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32, , )
++__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32, , BCM4710_FILL_TLB(start);)
++__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I_Loongson2, 32, loongson2_, BCM4710_FILL_TLB(start);)
++__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32, , )
++__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 64, , )
++__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64, , BCM4710_FILL_TLB(start);)
++__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64, , )
++__BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 128, , )
++__BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 128, , )
++__BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128, , )
++
++__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 16, , )
++__BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 32, , )
++__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 16, , )
++__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 32, , )
++__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 64, , )
++__BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 128, , )
+ 
+ #define __BUILD_BLAST_USER_CACHE(pfx, desc, indexop, hitop, lsize) \
+ static inline void blast_##pfx##cache##lsize##_user_page(unsigned long page) \
+@@ -291,58 +374,29 @@ __BUILD_BLAST_USER_CACHE(d, dcache, Inde
+ __BUILD_BLAST_USER_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64)
+ 
+ /* build blast_xxx_range, protected_blast_xxx_range */
+-#define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot, extra)	\
++#define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot, extra, war, war2)	\
+ static inline void prot##extra##blast_##pfx##cache##_range(unsigned long start, \
+ 						    unsigned long end)	\
+ {									\
+ 	unsigned long lsize = cpu_##desc##_line_size();			\
+-	unsigned long lsize_2 = lsize * 2;				\
+-	unsigned long lsize_3 = lsize * 3;				\
+-	unsigned long lsize_4 = lsize * 4;				\
+-	unsigned long lsize_5 = lsize * 5;				\
+-	unsigned long lsize_6 = lsize * 6;				\
+-	unsigned long lsize_7 = lsize * 7;				\
+-	unsigned long lsize_8 = lsize * 8;				\
+ 	unsigned long addr = start & ~(lsize - 1);			\
+-	unsigned long aend = (end + lsize - 1) & ~(lsize - 1);		\
+-	int lines = (aend - addr) / lsize;				\
+-									\
+-	while (lines >= 8) {						\
+-		prot##cache_op(hitop, addr);				\
+-		prot##cache_op(hitop, addr + lsize);			\
+-		prot##cache_op(hitop, addr + lsize_2);			\
+-		prot##cache_op(hitop, addr + lsize_3);			\
+-		prot##cache_op(hitop, addr + lsize_4);			\
+-		prot##cache_op(hitop, addr + lsize_5);			\
+-		prot##cache_op(hitop, addr + lsize_6);			\
+-		prot##cache_op(hitop, addr + lsize_7);			\
+-		addr += lsize_8;					\
+-		lines -= 8;						\
+-	}								\
+-									\
+-	if (lines & 0x4) {						\
+-		prot##cache_op(hitop, addr);				\
+-		prot##cache_op(hitop, addr + lsize);			\
+-		prot##cache_op(hitop, addr + lsize_2);			\
+-		prot##cache_op(hitop, addr + lsize_3);			\
+-		addr += lsize_4;					\
+-	}								\
++	unsigned long aend = (end - 1) & ~(lsize - 1);			\
+ 									\
+-	if (lines & 0x2) {						\
+-		prot##cache_op(hitop, addr);				\
+-		prot##cache_op(hitop, addr + lsize);			\
+-		addr += lsize_2;					\
+-	}								\
++	war								\
+ 									\
+-	if (lines & 0x1) {						\
++	while (1) {							\
++		war2							\
+ 		prot##cache_op(hitop, addr);				\
++		if (addr == aend)					\
++			break;						\
++		addr += lsize;						\
+ 	}								\
+ }
+ 
+ #ifndef CONFIG_EVA
+ 
+-__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_, )
+-__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_, )
++__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_, , BCM4710_PROTECTED_FILL_TLB(addr); BCM4710_PROTECTED_FILL_TLB(aend);, BCM4710_DUMMY_RREG();)
++__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_, , , )
+ 
+ #else
+ 
+@@ -376,15 +430,15 @@ __BUILD_PROT_BLAST_CACHE_RANGE(d, dcache
+ __BUILD_PROT_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I)
+ 
+ #endif
+-__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_, )
++__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_, , , )
+ __BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I_Loongson2, \
+-	protected_, loongson2_)
+-__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, , )
+-__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, , )
+-__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, , )
++	protected_, loongson2_, , )
++__BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, , , BCM4710_FILL_TLB(addr); BCM4710_FILL_TLB(aend);, BCM4710_DUMMY_RREG();)
++__BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, , , , )
++__BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, , , , )
+ /* blast_inv_dcache_range */
+-__BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, , )
+-__BUILD_BLAST_CACHE_RANGE(inv_s, scache, Hit_Invalidate_SD, , )
++__BUILD_BLAST_CACHE_RANGE(inv_d, dcache, Hit_Invalidate_D, , , , BCM4710_DUMMY_RREG();)
++__BUILD_BLAST_CACHE_RANGE(inv_s, scache, Hit_Invalidate_SD, , , , )
+ 
+ /* Currently, this is very specific to Loongson-3 */
+ #define __BUILD_BLAST_CACHE_NODE(pfx, desc, indexop, hitop, lsize)	\
+--- a/arch/mips/include/asm/stackframe.h
++++ b/arch/mips/include/asm/stackframe.h
+@@ -429,6 +429,10 @@
+ #else
+ 		.set	push
+ 		.set	arch=r4000
++#ifdef CONFIG_BCM47XX
++		nop
++		nop
++#endif
+ 		eret
+ 		.set	pop
+ #endif
+--- a/arch/mips/kernel/genex.S
++++ b/arch/mips/kernel/genex.S
+@@ -22,6 +22,19 @@
+ #include <asm/war.h>
+ #include <asm/thread_info.h>
+ 
++#ifdef CONFIG_BCM47XX
++# ifdef eret
++#  undef eret
++# endif
++# define eret 					\
++	.set push;				\
++	.set noreorder;				\
++	 nop; 					\
++	 nop;					\
++	 eret;					\
++	.set pop;
++#endif
++
+ 	__INIT
+ 
+ /*
+@@ -33,6 +46,9 @@
+ NESTED(except_vec3_generic, 0, sp)
+ 	.set	push
+ 	.set	noat
++#ifdef CONFIG_BCM47XX
++	nop
++#endif
+ 	mfc0	k1, CP0_CAUSE
+ 	andi	k1, k1, 0x7c
+ #ifdef CONFIG_64BIT
+@@ -53,6 +69,9 @@ NESTED(except_vec3_r4000, 0, sp)
+ 	.set	push
+ 	.set	arch=r4000
+ 	.set	noat
++#ifdef CONFIG_BCM47XX
++	nop
++#endif
+ 	mfc0	k1, CP0_CAUSE
+ 	li	k0, 31<<2
+ 	andi	k1, k1, 0x7c
+--- a/arch/mips/mm/c-r4k.c
++++ b/arch/mips/mm/c-r4k.c
+@@ -38,6 +38,9 @@
+ #include <asm/dma-coherence.h>
+ #include <asm/mips-cps.h>
+ 
++/* For enabling BCM4710 cache workarounds */
++static int bcm4710 = 0;
++
+ /*
+  * Bits describing what cache ops an SMP callback function may perform.
+  *
+@@ -190,6 +193,9 @@ static void r4k_blast_dcache_user_page_s
+ {
+ 	unsigned long  dc_lsize = cpu_dcache_line_size();
+ 
++	if (bcm4710)
++		r4k_blast_dcache_page = blast_dcache_page;
++	else
+ 	if (dc_lsize == 0)
+ 		r4k_blast_dcache_user_page = (void *)cache_noop;
+ 	else if (dc_lsize == 16)
+@@ -208,6 +214,9 @@ static void r4k_blast_dcache_page_indexe
+ {
+ 	unsigned long dc_lsize = cpu_dcache_line_size();
+ 
++	if (bcm4710)
++		r4k_blast_dcache_page_indexed = blast_dcache_page_indexed;
++	else
+ 	if (dc_lsize == 0)
+ 		r4k_blast_dcache_page_indexed = (void *)cache_noop;
+ 	else if (dc_lsize == 16)
+@@ -227,6 +236,9 @@ static void r4k_blast_dcache_setup(void)
+ {
+ 	unsigned long dc_lsize = cpu_dcache_line_size();
+ 
++	if (bcm4710)
++		r4k_blast_dcache = blast_dcache;
++	else
+ 	if (dc_lsize == 0)
+ 		r4k_blast_dcache = (void *)cache_noop;
+ 	else if (dc_lsize == 16)
+@@ -1818,6 +1830,17 @@ static void coherency_setup(void)
+ 	 * silly idea of putting something else there ...
+ 	 */
+ 	switch (current_cpu_type()) {
++	case CPU_BMIPS3300:
++		{
++			u32 cm;
++			cm = read_c0_diag();
++			/* Enable icache */
++			cm |= (1 << 31);
++			/* Enable dcache */
++			cm |= (1 << 30);
++			write_c0_diag(cm);
++		}
++		break;
+ 	case CPU_R4000PC:
+ 	case CPU_R4000SC:
+ 	case CPU_R4000MC:
+@@ -1864,6 +1887,15 @@ void r4k_cache_init(void)
+ 	extern void build_copy_page(void);
+ 	struct cpuinfo_mips *c = &current_cpu_data;
+ 
++	/* Check if special workarounds are required */
++#if defined(CONFIG_BCM47XX) && !defined(CONFIG_CPU_MIPS32_R2)
++	if (current_cpu_data.cputype == CPU_BMIPS32 && (current_cpu_data.processor_id & 0xff) == 0) {
++		printk("Enabling BCM4710A0 cache workarounds.\n");
++		bcm4710 = 1;
++	} else
++#endif
++		bcm4710 = 0;
++
+ 	probe_pcache();
+ 	probe_vcache();
+ 	setup_scache();
+@@ -1940,7 +1972,15 @@ void r4k_cache_init(void)
+ 	 */
+ 	local_r4k___flush_cache_all(NULL);
+ 
++#ifdef CONFIG_BCM47XX
++	{
++		static void (*_coherency_setup)(void);
++		_coherency_setup = (void (*)(void)) KSEG1ADDR(coherency_setup);
++		_coherency_setup();
++	}
++#else
+ 	coherency_setup();
++#endif
+ 	board_cache_error_setup = r4k_cache_error_setup;
+ 
+ 	/*
+--- a/arch/mips/mm/tlbex.c
++++ b/arch/mips/mm/tlbex.c
+@@ -984,6 +984,9 @@ void build_get_pgde32(u32 **p, unsigned
+ 		uasm_i_srl(p, ptr, ptr, SMP_CPUID_PTRSHIFT);
+ 		uasm_i_addu(p, ptr, tmp, ptr);
+ #else
++#ifdef CONFIG_BCM47XX
++		uasm_i_nop(p);
++#endif
+ 		UASM_i_LA_mostly(p, ptr, pgdc);
+ #endif
+ 		uasm_i_mfc0(p, tmp, C0_BADVADDR); /* get faulting address */
+@@ -1345,6 +1348,9 @@ static void build_r4000_tlb_refill_handl
+ #ifdef CONFIG_64BIT
+ 		build_get_pmde64(&p, &l, &r, K0, K1); /* get pmd in K1 */
+ #else
++# ifdef CONFIG_BCM47XX
++		uasm_i_nop(&p);
++# endif
+ 		build_get_pgde32(&p, K0, K1); /* get pgd in K1 */
+ #endif
+ 
+@@ -1356,6 +1362,9 @@ static void build_r4000_tlb_refill_handl
+ 		build_update_entries(&p, K0, K1);
+ 		build_tlb_write_entry(&p, &l, &r, tlb_random);
+ 		uasm_l_leave(&l, p);
++#ifdef CONFIG_BCM47XX
++		uasm_i_nop(&p);
++#endif
+ 		uasm_i_eret(&p); /* return from trap */
+ 	}
+ #ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
+@@ -2056,6 +2065,9 @@ build_r4000_tlbchange_handler_head(u32 *
+ #ifdef CONFIG_64BIT
+ 	build_get_pmde64(p, l, r, wr.r1, wr.r2); /* get pmd in ptr */
+ #else
++# ifdef CONFIG_BCM47XX
++	uasm_i_nop(p);
++# endif
+ 	build_get_pgde32(p, wr.r1, wr.r2); /* get pgd in ptr */
+ #endif
+ 
+@@ -2102,6 +2114,9 @@ build_r4000_tlbchange_handler_tail(u32 *
+ 	build_tlb_write_entry(p, l, r, tlb_indexed);
+ 	uasm_l_leave(l, *p);
+ 	build_restore_work_registers(p);
++#ifdef CONFIG_BCM47XX
++	uasm_i_nop(p);
++#endif
+ 	uasm_i_eret(p); /* return from trap */
+ 
+ #ifdef CONFIG_64BIT
diff --git a/target/linux/bcm47xx/patches-5.15/160-kmap_coherent.patch b/target/linux/bcm47xx/patches-5.15/160-kmap_coherent.patch
new file mode 100644
index 0000000000..caa3d9816b
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/160-kmap_coherent.patch
@@ -0,0 +1,78 @@
+From: Jeff Hansen <jhansen at cardaccess-inc.com>
+Subject: [PATCH] kmap_coherent
+
+On ASUS WL-500gP there are some "Data bus error"s when executing simple
+commands liks "ps" or "cat /proc/1/cmdline".
+
+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
+@@ -242,6 +242,9 @@
+ #ifndef cpu_has_pindexed_dcache
+ #define cpu_has_pindexed_dcache	(cpu_data[0].dcache.flags & MIPS_CACHE_PINDEX)
+ #endif
++#ifndef cpu_use_kmap_coherent
++#define cpu_use_kmap_coherent 1
++#endif
+ 
+ /*
+  * I-Cache snoops remote store.	 This only matters on SMP.  Some multiprocessors
+--- a/arch/mips/include/asm/mach-bcm47xx/cpu-feature-overrides.h
++++ b/arch/mips/include/asm/mach-bcm47xx/cpu-feature-overrides.h
+@@ -80,4 +80,6 @@
+ #define cpu_scache_line_size()		0
+ #define cpu_has_vz			0
+ 
++#define cpu_use_kmap_coherent		0
++
+ #endif /* __ASM_MACH_BCM47XX_CPU_FEATURE_OVERRIDES_H */
+--- a/arch/mips/mm/c-r4k.c
++++ b/arch/mips/mm/c-r4k.c
+@@ -699,7 +699,7 @@ static inline void local_r4k_flush_cache
+ 		map_coherent = (cpu_has_dc_aliases &&
+ 				page_mapcount(page) &&
+ 				!Page_dcache_dirty(page));
+-		if (map_coherent)
++		if (map_coherent && cpu_use_kmap_coherent)
+ 			vaddr = kmap_coherent(page, addr);
+ 		else
+ 			vaddr = kmap_atomic(page);
+@@ -721,7 +721,7 @@ static inline void local_r4k_flush_cache
+ 	}
+ 
+ 	if (vaddr) {
+-		if (map_coherent)
++		if (map_coherent && cpu_use_kmap_coherent)
+ 			kunmap_coherent();
+ 		else
+ 			kunmap_atomic(vaddr);
+--- a/arch/mips/mm/init.c
++++ b/arch/mips/mm/init.c
+@@ -173,7 +173,7 @@ void copy_user_highpage(struct page *to,
+ 	void *vfrom, *vto;
+ 
+ 	vto = kmap_atomic(to);
+-	if (cpu_has_dc_aliases &&
++	if (cpu_has_dc_aliases && cpu_use_kmap_coherent &&
+ 	    page_mapcount(from) && !Page_dcache_dirty(from)) {
+ 		vfrom = kmap_coherent(from, vaddr);
+ 		copy_page(vto, vfrom);
+@@ -195,7 +195,7 @@ void copy_to_user_page(struct vm_area_st
+ 	struct page *page, unsigned long vaddr, void *dst, const void *src,
+ 	unsigned long len)
+ {
+-	if (cpu_has_dc_aliases &&
++	if (cpu_has_dc_aliases && cpu_use_kmap_coherent &&
+ 	    page_mapcount(page) && !Page_dcache_dirty(page)) {
+ 		void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
+ 		memcpy(vto, src, len);
+@@ -213,7 +213,7 @@ void copy_from_user_page(struct vm_area_
+ 	struct page *page, unsigned long vaddr, void *dst, const void *src,
+ 	unsigned long len)
+ {
+-	if (cpu_has_dc_aliases &&
++	if (cpu_has_dc_aliases && cpu_use_kmap_coherent &&
+ 	    page_mapcount(page) && !Page_dcache_dirty(page)) {
+ 		void *vfrom = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
+ 		memcpy(dst, vfrom, len);
diff --git a/target/linux/bcm47xx/patches-5.15/209-b44-register-adm-switch.patch b/target/linux/bcm47xx/patches-5.15/209-b44-register-adm-switch.patch
new file mode 100644
index 0000000000..7728ec1094
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/209-b44-register-adm-switch.patch
@@ -0,0 +1,121 @@
+From b36f694256f41bc71571f467646d015dda128d14 Mon Sep 17 00:00:00 2001
+From: Hauke Mehrtens <hauke at hauke-m.de>
+Date: Sat, 9 Nov 2013 17:03:59 +0100
+Subject: [PATCH 210/210] b44: register adm switch
+
+---
+ drivers/net/ethernet/broadcom/b44.c |   57 +++++++++++++++++++++++++++++++++++
+ drivers/net/ethernet/broadcom/b44.h |    3 ++
+ 2 files changed, 60 insertions(+)
+
+--- a/drivers/net/ethernet/broadcom/b44.c
++++ b/drivers/net/ethernet/broadcom/b44.c
+@@ -31,6 +31,8 @@
+ #include <linux/ssb/ssb.h>
+ #include <linux/slab.h>
+ #include <linux/phy.h>
++#include <linux/platform_device.h>
++#include <linux/platform_data/adm6996-gpio.h>
+ 
+ #include <linux/uaccess.h>
+ #include <asm/io.h>
+@@ -2243,6 +2245,69 @@ static void b44_adjust_link(struct net_d
+ 	}
+ }
+ 
++#ifdef CONFIG_BCM47XX
++static int b44_register_adm_switch(struct b44 *bp)
++{
++	int gpio;
++	struct platform_device *pdev;
++	struct adm6996_gpio_platform_data adm_data = {0};
++	struct platform_device_info info = {0};
++
++	adm_data.model = ADM6996L;
++	gpio = bcm47xx_nvram_gpio_pin("adm_eecs");
++	if (gpio >= 0)
++		adm_data.eecs = gpio;
++	else
++		adm_data.eecs = 2;
++
++	gpio = bcm47xx_nvram_gpio_pin("adm_eesk");
++	if (gpio >= 0)
++		adm_data.eesk = gpio;
++	else
++		adm_data.eesk = 3;
++
++	gpio = bcm47xx_nvram_gpio_pin("adm_eedi");
++	if (gpio >= 0)
++		adm_data.eedi = gpio;
++	else
++		adm_data.eedi = 4;
++
++	/*
++	 * We ignore the "adm_rc" GPIO here. The driver does not use it,
++	 * and it conflicts with the Reset button GPIO on the Linksys WRT54GSv1.
++	 */
++
++	info.parent = bp->sdev->dev;
++	info.name = "adm6996_gpio";
++	info.id = -1;
++	info.data = &adm_data;
++	info.size_data = sizeof(adm_data);
++
++	if (!bp->adm_switch) {
++		pdev = platform_device_register_full(&info);
++		if (IS_ERR(pdev))
++			return PTR_ERR(pdev);
++
++		bp->adm_switch = pdev;
++	}
++	return 0;
++}
++static void b44_unregister_adm_switch(struct b44 *bp)
++{
++	if (bp->adm_switch)
++		platform_device_unregister(bp->adm_switch);
++}
++#else
++static int b44_register_adm_switch(struct b44 *bp)
++{
++	return 0;
++}
++static void b44_unregister_adm_switch(struct b44 *bp)
++{
++
++}
++#endif /* CONFIG_BCM47XX */
++
+ static int b44_register_phy_one(struct b44 *bp)
+ {
+ 	__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
+@@ -2279,6 +2344,9 @@ static int b44_register_phy_one(struct b
+ 	if (!mdiobus_is_registered_device(bp->mii_bus, bp->phy_addr) &&
+ 	    (sprom->boardflags_lo & (B44_BOARDFLAG_ROBO | B44_BOARDFLAG_ADM))) {
+ 
++		if (sprom->boardflags_lo & B44_BOARDFLAG_ADM)
++			b44_register_adm_switch(bp);
++
+ 		dev_info(sdev->dev,
+ 			 "could not find PHY at %i, use fixed one\n",
+ 			 bp->phy_addr);
+@@ -2473,6 +2541,7 @@ static void b44_remove_one(struct ssb_de
+ 	unregister_netdev(dev);
+ 	if (bp->flags & B44_FLAG_EXTERNAL_PHY)
+ 		b44_unregister_phy_one(bp);
++	b44_unregister_adm_switch(bp);
+ 	ssb_device_disable(sdev, 0);
+ 	ssb_bus_may_powerdown(sdev->bus);
+ 	netif_napi_del(&bp->napi);
+--- a/drivers/net/ethernet/broadcom/b44.h
++++ b/drivers/net/ethernet/broadcom/b44.h
+@@ -408,6 +408,9 @@ struct b44 {
+ 	struct mii_bus		*mii_bus;
+ 	int			old_link;
+ 	struct mii_if_info	mii_if;
++
++	/* platform device for associated switch */
++	struct platform_device *adm_switch;
+ };
+ 
+ #endif /* _B44_H */
diff --git a/target/linux/bcm47xx/patches-5.15/210-b44_phy_fix.patch b/target/linux/bcm47xx/patches-5.15/210-b44_phy_fix.patch
new file mode 100644
index 0000000000..bedebc415e
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/210-b44_phy_fix.patch
@@ -0,0 +1,54 @@
+--- a/drivers/net/ethernet/broadcom/b44.c
++++ b/drivers/net/ethernet/broadcom/b44.c
+@@ -429,10 +429,34 @@ static void b44_wap54g10_workaround(stru
+ error:
+ 	pr_warn("PHY: cannot reset MII transceiver isolate bit\n");
+ }
++
++static void b44_bcm47xx_workarounds(struct b44 *bp)
++{
++	char buf[20];
++	struct ssb_device *sdev = bp->sdev;
++
++	/* Toshiba WRC-1000, Siemens SE505 v1, Askey RT-210W, RT-220W */
++	if (sdev->bus->sprom.board_num == 100) {
++		bp->phy_addr = B44_PHY_ADDR_NO_LOCAL_PHY;
++	} else {
++		/* WL-HDD */
++		if (bcm47xx_nvram_getenv("hardware_version", buf, sizeof(buf)) >= 0 &&
++		    !strncmp(buf, "WL300-", strlen("WL300-"))) {
++			if (sdev->bus->sprom.et0phyaddr == 0 &&
++			    sdev->bus->sprom.et1phyaddr == 1)
++				bp->phy_addr = B44_PHY_ADDR_NO_LOCAL_PHY;
++		}
++	}
++	return;
++}
+ #else
+ static inline void b44_wap54g10_workaround(struct b44 *bp)
+ {
+ }
++
++static inline void b44_bcm47xx_workarounds(struct b44 *bp)
++{
++}
+ #endif
+ 
+ static int b44_setup_phy(struct b44 *bp)
+@@ -441,6 +465,7 @@ static int b44_setup_phy(struct b44 *bp)
+ 	int err;
+ 
+ 	b44_wap54g10_workaround(bp);
++	b44_bcm47xx_workarounds(bp);
+ 
+ 	if (bp->flags & B44_FLAG_EXTERNAL_PHY)
+ 		return 0;
+@@ -2173,6 +2198,8 @@ static int b44_get_invariants(struct b44
+ 	 * valid PHY address. */
+ 	bp->phy_addr &= 0x1F;
+ 
++	b44_bcm47xx_workarounds(bp);
++
+ 	memcpy(bp->dev->dev_addr, addr, ETH_ALEN);
+ 
+ 	if (!is_valid_ether_addr(&bp->dev->dev_addr[0])){
diff --git a/target/linux/bcm47xx/patches-5.15/280-activate_ssb_support_in_usb.patch b/target/linux/bcm47xx/patches-5.15/280-activate_ssb_support_in_usb.patch
new file mode 100644
index 0000000000..de8bb4297d
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/280-activate_ssb_support_in_usb.patch
@@ -0,0 +1,25 @@
+This prevents the options from being delete with make kernel_oldconfig.
+---
+ drivers/ssb/Kconfig |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/bcma/Kconfig
++++ b/drivers/bcma/Kconfig
+@@ -32,6 +32,7 @@ config BCMA_HOST_PCI
+ config BCMA_HOST_SOC
+ 	bool "Support for BCMA in a SoC"
+ 	depends on HAS_IOMEM
++	select USB_HCD_BCMA if USB_EHCI_HCD || USB_OHCI_HCD
+ 	help
+ 	  Host interface for a Broadcom AIX bus directly mapped into
+ 	  the memory. This only works with the Broadcom SoCs from the
+--- a/drivers/ssb/Kconfig
++++ b/drivers/ssb/Kconfig
+@@ -136,6 +136,7 @@ config SSB_SFLASH
+ config SSB_EMBEDDED
+ 	bool
+ 	depends on SSB_DRIVER_MIPS && SSB_PCICORE_HOSTMODE
++	select USB_HCD_SSB if USB_EHCI_HCD || USB_OHCI_HCD
+ 	default y
+ 
+ config SSB_DRIVER_EXTIF
diff --git a/target/linux/bcm47xx/patches-5.15/300-fork_cacheflush.patch b/target/linux/bcm47xx/patches-5.15/300-fork_cacheflush.patch
new file mode 100644
index 0000000000..daa2c1adf0
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/300-fork_cacheflush.patch
@@ -0,0 +1,21 @@
+From: Wolfram Joost <dbox2 at frokaschwei.de>
+Subject: [PATCH] fork_cacheflush
+
+On ASUS WL-500gP there are many unexpected "Segmentation fault"s that
+seem to be caused by a kernel. They can be avoided by:
+1) Disabling highpage
+2) Using flush_cache_mm in flush_cache_dup_mm
+
+For details see OpenWrt ticket #2035 https://dev.openwrt.org/ticket/2035
+---
+--- a/arch/mips/include/asm/cacheflush.h
++++ b/arch/mips/include/asm/cacheflush.h
+@@ -46,7 +46,7 @@
+ extern void (*flush_cache_all)(void);
+ extern void (*__flush_cache_all)(void);
+ extern void (*flush_cache_mm)(struct mm_struct *mm);
+-#define flush_cache_dup_mm(mm)	do { (void) (mm); } while (0)
++#define flush_cache_dup_mm(mm) flush_cache_mm(mm)
+ extern void (*flush_cache_range)(struct vm_area_struct *vma,
+ 	unsigned long start, unsigned long end);
+ extern void (*flush_cache_page)(struct vm_area_struct *vma, unsigned long page, unsigned long pfn);
diff --git a/target/linux/bcm47xx/patches-5.15/310-no_highpage.patch b/target/linux/bcm47xx/patches-5.15/310-no_highpage.patch
new file mode 100644
index 0000000000..b1dcdf9cb2
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/310-no_highpage.patch
@@ -0,0 +1,74 @@
+From: Jeff Hansen <jhansen at cardaccess-inc.com>
+Subject: [PATCH] no highpage
+
+On ASUS WL-500gP there are many unexpected "Segmentation fault"s that
+seem to be caused by a kernel. They can be avoided by:
+1) Disabling highpage
+2) Using flush_cache_mm in flush_cache_dup_mm
+
+For details see OpenWrt ticket #2035 https://dev.openwrt.org/ticket/2035
+---
+--- a/arch/mips/include/asm/page.h
++++ b/arch/mips/include/asm/page.h
+@@ -71,6 +71,7 @@ static inline unsigned int page_size_ftl
+ #endif /* CONFIG_MIPS_HUGE_TLB_SUPPORT */
+ 
+ #include <linux/pfn.h>
++#include <asm/cpu-features.h>
+ 
+ extern void build_clear_page(void);
+ extern void build_copy_page(void);
+@@ -110,11 +111,16 @@ static inline void clear_user_page(void
+ 		flush_data_cache_page((unsigned long)addr);
+ }
+ 
+-struct vm_area_struct;
+-extern void copy_user_highpage(struct page *to, struct page *from,
+-	unsigned long vaddr, struct vm_area_struct *vma);
++static inline void copy_user_page(void *vto, void *vfrom, unsigned long vaddr,
++	struct page *to)
++{
++	extern void (*flush_data_cache_page)(unsigned long addr);
+ 
+-#define __HAVE_ARCH_COPY_USER_HIGHPAGE
++	copy_page(vto, vfrom);
++	if (!cpu_has_ic_fills_f_dc ||
++	    pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK))
++		flush_data_cache_page((unsigned long)vto);
++}
+ 
+ /*
+  * These are used to make use of C type-checking..
+--- a/arch/mips/mm/init.c
++++ b/arch/mips/mm/init.c
+@@ -167,30 +167,6 @@ void kunmap_coherent(void)
+ 	preempt_enable();
+ }
+ 
+-void copy_user_highpage(struct page *to, struct page *from,
+-	unsigned long vaddr, struct vm_area_struct *vma)
+-{
+-	void *vfrom, *vto;
+-
+-	vto = kmap_atomic(to);
+-	if (cpu_has_dc_aliases && cpu_use_kmap_coherent &&
+-	    page_mapcount(from) && !Page_dcache_dirty(from)) {
+-		vfrom = kmap_coherent(from, vaddr);
+-		copy_page(vto, vfrom);
+-		kunmap_coherent();
+-	} else {
+-		vfrom = kmap_atomic(from);
+-		copy_page(vto, vfrom);
+-		kunmap_atomic(vfrom);
+-	}
+-	if ((!cpu_has_ic_fills_f_dc) ||
+-	    pages_do_alias((unsigned long)vto, vaddr & PAGE_MASK))
+-		flush_data_cache_page((unsigned long)vto);
+-	kunmap_atomic(vto);
+-	/* Make sure this page is cleared on other CPU's too before using it */
+-	smp_wmb();
+-}
+-
+ void copy_to_user_page(struct vm_area_struct *vma,
+ 	struct page *page, unsigned long vaddr, void *dst, const void *src,
+ 	unsigned long len)
diff --git a/target/linux/bcm47xx/patches-5.15/320-v5.17-MIPS-BCM47XX-Add-board-entry-for-Linksys-WRT320N-v1.patch b/target/linux/bcm47xx/patches-5.15/320-v5.17-MIPS-BCM47XX-Add-board-entry-for-Linksys-WRT320N-v1.patch
new file mode 100644
index 0000000000..f34336edd5
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/320-v5.17-MIPS-BCM47XX-Add-board-entry-for-Linksys-WRT320N-v1.patch
@@ -0,0 +1,89 @@
+From 3829e4f10a232964cc728c0479c8097922e5e073 Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli at gmail.com>
+Date: Thu, 6 Jan 2022 19:51:38 -0800
+Subject: [PATCH] MIPS: BCM47XX: Add board entry for Linksys WRT320N v1
+
+This router is based on a Broadcom BCM4717A1 chipset and supports
+802.11n Wi-Fi. Add a board entry for that router and register LEDs and
+buttons accordingly.
+
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
+---
+ arch/mips/bcm47xx/board.c                          |  1 +
+ arch/mips/bcm47xx/buttons.c                        |  9 +++++++++
+ arch/mips/bcm47xx/leds.c                           | 10 ++++++++++
+ arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h |  1 +
+ 4 files changed, 21 insertions(+)
+
+--- a/arch/mips/bcm47xx/board.c
++++ b/arch/mips/bcm47xx/board.c
+@@ -141,6 +141,7 @@ struct bcm47xx_board_type_list2 bcm47xx_
+ 	{{BCM47XX_BOARD_LINKSYS_WRT300NV11, "Linksys WRT300N V1.1"}, "WRT300N", "1.1"},
+ 	{{BCM47XX_BOARD_LINKSYS_WRT310NV1, "Linksys WRT310N V1"}, "WRT310N", "1.0"},
+ 	{{BCM47XX_BOARD_LINKSYS_WRT310NV2, "Linksys WRT310N V2"}, "WRT310N", "2.0"},
++	{{BCM47XX_BOARD_LINKSYS_WRT320N_V1, "Linksys WRT320N V1"}, "WRT320N", "1.0"},
+ 	{{BCM47XX_BOARD_LINKSYS_WRT54G3GV2, "Linksys WRT54G3GV2-VF"}, "WRT54G3GV2-VF", "1.0"},
+ 	{{BCM47XX_BOARD_LINKSYS_WRT610NV1, "Linksys WRT610N V1"}, "WRT610N", "1.0"},
+ 	{{BCM47XX_BOARD_LINKSYS_WRT610NV2, "Linksys WRT610N V2"}, "WRT610N", "2.0"},
+--- a/arch/mips/bcm47xx/buttons.c
++++ b/arch/mips/bcm47xx/buttons.c
+@@ -277,6 +277,12 @@ bcm47xx_buttons_linksys_wrt310nv1[] __in
+ };
+ 
+ static const struct gpio_keys_button
++bcm47xx_buttons_linksys_wrt320n_v1[] __initconst = {
++	BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON),
++	BCM47XX_GPIO_KEY(8, KEY_RESTART),
++};
++
++static const struct gpio_keys_button
+ bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
+ 	BCM47XX_GPIO_KEY(5, KEY_WIMAX),
+ 	BCM47XX_GPIO_KEY(6, KEY_RESTART),
+@@ -608,6 +614,9 @@ int __init bcm47xx_buttons_register(void
+ 	case BCM47XX_BOARD_LINKSYS_WRT310NV1:
+ 		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1);
+ 		break;
++	case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
++		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt320n_v1);
++		break;
+ 	case BCM47XX_BOARD_LINKSYS_WRT54G3GV2:
+ 		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54g3gv2);
+ 		break;
+--- a/arch/mips/bcm47xx/leds.c
++++ b/arch/mips/bcm47xx/leds.c
+@@ -314,6 +314,13 @@ bcm47xx_leds_linksys_wrt310nv1[] __initc
+ };
+ 
+ static const struct gpio_led
++bcm47xx_leds_linksys_wrt320n_v1[] __initconst = {
++	BCM47XX_GPIO_LED(1, "blue", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF),
++	BCM47XX_GPIO_LED(2, "blue", "power", 0, LEDS_GPIO_DEFSTATE_ON),
++	BCM47XX_GPIO_LED(4, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF),
++};
++
++static const struct gpio_led
+ bcm47xx_leds_linksys_wrt54g_generic[] __initconst = {
+ 	BCM47XX_GPIO_LED(0, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF),
+ 	BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON),
+@@ -689,6 +696,9 @@ void __init bcm47xx_leds_register(void)
+ 	case BCM47XX_BOARD_LINKSYS_WRT310NV1:
+ 		bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt310nv1);
+ 		break;
++	case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
++		bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt320n_v1);
++		break;
+ 	case BCM47XX_BOARD_LINKSYS_WRT54G3GV2:
+ 		bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt54g3gv2);
+ 		break;
+--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
++++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
+@@ -72,6 +72,7 @@ enum bcm47xx_board {
+ 	BCM47XX_BOARD_LINKSYS_WRT300NV11,
+ 	BCM47XX_BOARD_LINKSYS_WRT310NV1,
+ 	BCM47XX_BOARD_LINKSYS_WRT310NV2,
++	BCM47XX_BOARD_LINKSYS_WRT320N_V1,
+ 	BCM47XX_BOARD_LINKSYS_WRT54G3GV2,
+ 	BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0101,
+ 	BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0467,
diff --git a/target/linux/bcm47xx/patches-5.15/321-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-R6300-v1.patch b/target/linux/bcm47xx/patches-5.15/321-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-R6300-v1.patch
new file mode 100644
index 0000000000..6631e79048
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/321-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-R6300-v1.patch
@@ -0,0 +1,60 @@
+From 15e690af5cc3cd8f5d14ee2aa3a093f80196110e Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli at gmail.com>
+Date: Thu, 6 Jan 2022 19:51:40 -0800
+Subject: [PATCH] MIPS: BCM47XX: Add support for Netgear R6300 v1
+
+Add support for the Netgear R6300 v1 Wi-Fi router using a Broadcom
+BCM4706 chipset and supporting 802.11n and 802.11ac.
+
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
+---
+ arch/mips/bcm47xx/board.c                          | 1 +
+ arch/mips/bcm47xx/buttons.c                        | 8 ++++++++
+ arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h | 1 +
+ 3 files changed, 10 insertions(+)
+
+--- a/arch/mips/bcm47xx/board.c
++++ b/arch/mips/bcm47xx/board.c
+@@ -162,6 +162,7 @@ struct bcm47xx_board_type_list1 bcm47xx_
+ 	{{BCM47XX_BOARD_LUXUL_XWR_600_V1, "Luxul XWR-600 V1"}, "luxul_xwr600_v1"},
+ 	{{BCM47XX_BOARD_LUXUL_XWR_1750_V1, "Luxul XWR-1750 V1"}, "luxul_xwr1750_v1"},
+ 	{{BCM47XX_BOARD_NETGEAR_R6200_V1, "Netgear R6200 V1"}, "U12H192T00_NETGEAR"},
++	{{BCM47XX_BOARD_NETGEAR_R6300_V1, "Netgear R6300 V1"}, "U12H218T00_NETGEAR"},
+ 	{{BCM47XX_BOARD_NETGEAR_WGR614V8, "Netgear WGR614 V8"}, "U12H072T00_NETGEAR"},
+ 	{{BCM47XX_BOARD_NETGEAR_WGR614V9, "Netgear WGR614 V9"}, "U12H094T00_NETGEAR"},
+ 	{{BCM47XX_BOARD_NETGEAR_WGR614_V10, "Netgear WGR614 V10"}, "U12H139T01_NETGEAR"},
+--- a/arch/mips/bcm47xx/buttons.c
++++ b/arch/mips/bcm47xx/buttons.c
+@@ -398,6 +398,11 @@ bcm47xx_buttons_netgear_r6200_v1[] __ini
+ };
+ 
+ static const struct gpio_keys_button
++bcm47xx_buttons_netgear_r6300_v1[] __initconst = {
++	BCM47XX_GPIO_KEY(6, KEY_RESTART),
++};
++
++static const struct gpio_keys_button
+ bcm47xx_buttons_netgear_wndr3400v1[] __initconst = {
+ 	BCM47XX_GPIO_KEY(4, KEY_RESTART),
+ 	BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
+@@ -683,6 +688,9 @@ int __init bcm47xx_buttons_register(void
+ 	case BCM47XX_BOARD_NETGEAR_R6200_V1:
+ 		err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6200_v1);
+ 		break;
++	case BCM47XX_BOARD_NETGEAR_R6300_V1:
++		err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6300_v1);
++		break;
+ 	case BCM47XX_BOARD_NETGEAR_WNDR3400V1:
+ 		err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3400v1);
+ 		break;
+--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
++++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
+@@ -100,6 +100,7 @@ enum bcm47xx_board {
+ 	BCM47XX_BOARD_MOTOROLA_WR850GV2V3,
+ 
+ 	BCM47XX_BOARD_NETGEAR_R6200_V1,
++	BCM47XX_BOARD_NETGEAR_R6300_V1,
+ 	BCM47XX_BOARD_NETGEAR_WGR614V8,
+ 	BCM47XX_BOARD_NETGEAR_WGR614V9,
+ 	BCM47XX_BOARD_NETGEAR_WGR614_V10,
diff --git a/target/linux/bcm47xx/patches-5.15/322-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-WN2500RP-v1-v2.patch b/target/linux/bcm47xx/patches-5.15/322-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-WN2500RP-v1-v2.patch
new file mode 100644
index 0000000000..8f66aee192
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/322-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-WN2500RP-v1-v2.patch
@@ -0,0 +1,63 @@
+From 4da27b6d550427a0560a15df36de99cb17629216 Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli at gmail.com>
+Date: Thu, 6 Jan 2022 19:51:41 -0800
+Subject: [PATCH] MIPS: BCM47XX: Add support for Netgear WN2500RP v1 & v2
+
+Add support for the Netgear WN2500 RP v1 and v2 Wi-Fi range extenders
+based on the BCM5357 chipset and supporting 802.11n and 802.11ac.
+
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
+---
+ arch/mips/bcm47xx/board.c                          | 2 ++
+ arch/mips/bcm47xx/buttons.c                        | 9 +++++++++
+ arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h | 2 ++
+ 3 files changed, 13 insertions(+)
+
+--- a/arch/mips/bcm47xx/board.c
++++ b/arch/mips/bcm47xx/board.c
+@@ -166,6 +166,8 @@ struct bcm47xx_board_type_list1 bcm47xx_
+ 	{{BCM47XX_BOARD_NETGEAR_WGR614V8, "Netgear WGR614 V8"}, "U12H072T00_NETGEAR"},
+ 	{{BCM47XX_BOARD_NETGEAR_WGR614V9, "Netgear WGR614 V9"}, "U12H094T00_NETGEAR"},
+ 	{{BCM47XX_BOARD_NETGEAR_WGR614_V10, "Netgear WGR614 V10"}, "U12H139T01_NETGEAR"},
++	{{BCM47XX_BOARD_NETGEAR_WN2500RP_V1, "Netgear WN2500RP V1"}, "U12H197T00_NETGEAR"},
++	{{BCM47XX_BOARD_NETGEAR_WN2500RP_V2, "Netgear WN2500RP V2"}, "U12H294T00_NETGEAR"},
+ 	{{BCM47XX_BOARD_NETGEAR_WNDR3300, "Netgear WNDR3300"}, "U12H093T00_NETGEAR"},
+ 	{{BCM47XX_BOARD_NETGEAR_WNDR3400V1, "Netgear WNDR3400 V1"}, "U12H155T00_NETGEAR"},
+ 	{{BCM47XX_BOARD_NETGEAR_WNDR3400V2, "Netgear WNDR3400 V2"}, "U12H187T00_NETGEAR"},
+--- a/arch/mips/bcm47xx/buttons.c
++++ b/arch/mips/bcm47xx/buttons.c
+@@ -403,6 +403,12 @@ bcm47xx_buttons_netgear_r6300_v1[] __ini
+ };
+ 
+ static const struct gpio_keys_button
++bcm47xx_buttons_netgear_wn2500rp_v1[] __initconst = {
++	BCM47XX_GPIO_KEY(12, KEY_RESTART),
++	BCM47XX_GPIO_KEY(31, KEY_WPS_BUTTON),
++};
++
++static const struct gpio_keys_button
+ bcm47xx_buttons_netgear_wndr3400v1[] __initconst = {
+ 	BCM47XX_GPIO_KEY(4, KEY_RESTART),
+ 	BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
+@@ -691,6 +697,9 @@ int __init bcm47xx_buttons_register(void
+ 	case BCM47XX_BOARD_NETGEAR_R6300_V1:
+ 		err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6300_v1);
+ 		break;
++	case BCM47XX_BOARD_NETGEAR_WN2500RP_V1:
++		err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wn2500rp_v1);
++		break;
+ 	case BCM47XX_BOARD_NETGEAR_WNDR3400V1:
+ 		err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3400v1);
+ 		break;
+--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
++++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
+@@ -104,6 +104,8 @@ enum bcm47xx_board {
+ 	BCM47XX_BOARD_NETGEAR_WGR614V8,
+ 	BCM47XX_BOARD_NETGEAR_WGR614V9,
+ 	BCM47XX_BOARD_NETGEAR_WGR614_V10,
++	BCM47XX_BOARD_NETGEAR_WN2500RP_V1,
++	BCM47XX_BOARD_NETGEAR_WN2500RP_V2,
+ 	BCM47XX_BOARD_NETGEAR_WNDR3300,
+ 	BCM47XX_BOARD_NETGEAR_WNDR3400V1,
+ 	BCM47XX_BOARD_NETGEAR_WNDR3400V2,
diff --git a/target/linux/bcm47xx/patches-5.15/323-v6.0-MIPS-BCM47XX-Add-support-for-Netgear-WNR3500L-v2.patch b/target/linux/bcm47xx/patches-5.15/323-v6.0-MIPS-BCM47XX-Add-support-for-Netgear-WNR3500L-v2.patch
new file mode 100644
index 0000000000..272a74933b
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/323-v6.0-MIPS-BCM47XX-Add-support-for-Netgear-WNR3500L-v2.patch
@@ -0,0 +1,109 @@
+From c022e87162219d67d687df22c977d1c2fc95fb42 Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli at gmail.com>
+Date: Thu, 14 Jul 2022 14:13:01 -0700
+Subject: [PATCH] MIPS: BCM47XX: Add support for Netgear WNR3500L v2
+
+Add support for the Netgear WNR3500L v2 router based on the BCM47186
+chipset and supporting 802.11n Wi-Fi.
+
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
+---
+ arch/mips/bcm47xx/board.c                          |  2 ++
+ arch/mips/bcm47xx/buttons.c                        | 10 ++++++++++
+ arch/mips/bcm47xx/leds.c                           | 11 +++++++++++
+ arch/mips/bcm47xx/workarounds.c                    |  1 +
+ arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h |  1 +
+ 5 files changed, 25 insertions(+)
+
+--- a/arch/mips/bcm47xx/board.c
++++ b/arch/mips/bcm47xx/board.c
+@@ -181,6 +181,7 @@ struct bcm47xx_board_type_list1 bcm47xx_
+ 	{{BCM47XX_BOARD_NETGEAR_WNR1000_V3, "Netgear WNR1000 V3"}, "U12H139T50_NETGEAR"},
+ 	{{BCM47XX_BOARD_NETGEAR_WNR2000, "Netgear WNR2000"}, "U12H114T00_NETGEAR"},
+ 	{{BCM47XX_BOARD_NETGEAR_WNR3500L, "Netgear WNR3500L"}, "U12H136T99_NETGEAR"},
++	{{BCM47XX_BOARD_NETGEAR_WNR3500L_V2, "Netgear WNR3500L V2"}, "U12H172T00_NETGEAR"},
+ 	{{BCM47XX_BOARD_NETGEAR_WNR3500U, "Netgear WNR3500U"}, "U12H136T00_NETGEAR"},
+ 	{{BCM47XX_BOARD_NETGEAR_WNR3500V2, "Netgear WNR3500 V2"}, "U12H127T00_NETGEAR"},
+ 	{{BCM47XX_BOARD_NETGEAR_WNR3500V2VC, "Netgear WNR3500 V2vc"}, "U12H127T70_NETGEAR"},
+@@ -195,6 +196,7 @@ struct bcm47xx_board_type_list3 bcm47xx_
+ 	{{BCM47XX_BOARD_PHICOMM_M1, "Phicomm M1"}, "0x0590", "80", "0x1104"},
+ 	{{BCM47XX_BOARD_ZTE_H218N, "ZTE H218N"}, "0x053d", "1234", "0x1305"},
+ 	{{BCM47XX_BOARD_NETGEAR_WNR3500L, "Netgear WNR3500L"}, "0x04CF", "3500", "02"},
++	{{BCM47XX_BOARD_NETGEAR_WNR3500L_V2, "Netgear WNR3500L V2"}, "0x052b", "3500L", "02"},
+ 	{{BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0101, "Linksys WRT54G/GS/GL"}, "0x0101", "42", "0x10"},
+ 	{{BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0467, "Linksys WRT54G/GS/GL"}, "0x0467", "42", "0x10"},
+ 	{{BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0708, "Linksys WRT54G/GS/GL"}, "0x0708", "42", "0x10"},
+--- a/arch/mips/bcm47xx/buttons.c
++++ b/arch/mips/bcm47xx/buttons.c
+@@ -448,6 +448,13 @@ bcm47xx_buttons_netgear_wnr3500lv1[] __i
+ };
+ 
+ static const struct gpio_keys_button
++bcm47xx_buttons_netgear_wnr3500lv2[] __initconst = {
++	BCM47XX_GPIO_KEY(4, KEY_RESTART),
++	BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
++	BCM47XX_GPIO_KEY(8, KEY_RFKILL),
++};
++
++static const struct gpio_keys_button
+ bcm47xx_buttons_netgear_wnr834bv2[] __initconst = {
+ 	BCM47XX_GPIO_KEY(6, KEY_RESTART),
+ };
+@@ -718,6 +725,9 @@ int __init bcm47xx_buttons_register(void
+ 	case BCM47XX_BOARD_NETGEAR_WNR3500L:
+ 		err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr3500lv1);
+ 		break;
++	case BCM47XX_BOARD_NETGEAR_WNR3500L_V2:
++		err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr3500lv2);
++		break;
+ 	case BCM47XX_BOARD_NETGEAR_WNR834BV2:
+ 		err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr834bv2);
+ 		break;
+--- a/arch/mips/bcm47xx/leds.c
++++ b/arch/mips/bcm47xx/leds.c
+@@ -520,6 +520,14 @@ bcm47xx_leds_netgear_wnr3500lv1[] __init
+ };
+ 
+ static const struct gpio_led
++bcm47xx_leds_netgear_wnr3500lv2[] __initconst = {
++	BCM47XX_GPIO_LED(0, "blue", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
++	BCM47XX_GPIO_LED(1, "green", "wps", 0, LEDS_GPIO_DEFSTATE_OFF),
++	BCM47XX_GPIO_LED(3, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON),
++	BCM47XX_GPIO_LED(7, "amber", "power", 0, LEDS_GPIO_DEFSTATE_OFF),
++};
++
++static const struct gpio_led
+ bcm47xx_leds_netgear_wnr834bv2[] __initconst = {
+ 	BCM47XX_GPIO_LED(2, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON),
+ 	BCM47XX_GPIO_LED(3, "amber", "power", 0, LEDS_GPIO_DEFSTATE_OFF),
+@@ -780,6 +788,9 @@ void __init bcm47xx_leds_register(void)
+ 	case BCM47XX_BOARD_NETGEAR_WNR3500L:
+ 		bcm47xx_set_pdata(bcm47xx_leds_netgear_wnr3500lv1);
+ 		break;
++	case BCM47XX_BOARD_NETGEAR_WNR3500L_V2:
++		bcm47xx_set_pdata(bcm47xx_leds_netgear_wnr3500lv2);
++		break;
+ 	case BCM47XX_BOARD_NETGEAR_WNR834BV2:
+ 		bcm47xx_set_pdata(bcm47xx_leds_netgear_wnr834bv2);
+ 		break;
+--- a/arch/mips/bcm47xx/workarounds.c
++++ b/arch/mips/bcm47xx/workarounds.c
+@@ -22,6 +22,7 @@ void __init bcm47xx_workarounds(void)
+ 
+ 	switch (board) {
+ 	case BCM47XX_BOARD_NETGEAR_WNR3500L:
++	case BCM47XX_BOARD_NETGEAR_WNR3500L_V2:
+ 		bcm47xx_workarounds_enable_usb_power(12);
+ 		break;
+ 	case BCM47XX_BOARD_NETGEAR_WNDR3400V2:
+--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
++++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
+@@ -118,6 +118,7 @@ enum bcm47xx_board {
+ 	BCM47XX_BOARD_NETGEAR_WNR1000_V3,
+ 	BCM47XX_BOARD_NETGEAR_WNR2000,
+ 	BCM47XX_BOARD_NETGEAR_WNR3500L,
++	BCM47XX_BOARD_NETGEAR_WNR3500L_V2,
+ 	BCM47XX_BOARD_NETGEAR_WNR3500U,
+ 	BCM47XX_BOARD_NETGEAR_WNR3500V2,
+ 	BCM47XX_BOARD_NETGEAR_WNR3500V2VC,
diff --git a/target/linux/bcm47xx/patches-5.15/324-v5.17-MIPS-BCM47XX-Add-LEDs-and-buttons-for-Asus-RTN-10U.patch b/target/linux/bcm47xx/patches-5.15/324-v5.17-MIPS-BCM47XX-Add-LEDs-and-buttons-for-Asus-RTN-10U.patch
new file mode 100644
index 0000000000..23d50ad902
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/324-v5.17-MIPS-BCM47XX-Add-LEDs-and-buttons-for-Asus-RTN-10U.patch
@@ -0,0 +1,67 @@
+From aecf89f2f8e8a604c33085c230a1f04ea325de64 Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli at gmail.com>
+Date: Thu, 6 Jan 2022 19:51:39 -0800
+Subject: [PATCH] MIPS: BCM47XX: Add LEDs and buttons for Asus RTN-10U
+
+Add the definitions for the buttons and LEDs used on the Asus RTN-10U
+router.
+
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
+---
+ arch/mips/bcm47xx/buttons.c |  9 +++++++++
+ arch/mips/bcm47xx/leds.c    | 11 +++++++++++
+ 2 files changed, 20 insertions(+)
+
+--- a/arch/mips/bcm47xx/buttons.c
++++ b/arch/mips/bcm47xx/buttons.c
+@@ -27,6 +27,12 @@
+ /* Asus */
+ 
+ static const struct gpio_keys_button
++bcm47xx_buttons_asus_rtn10u[] __initconst = {
++	BCM47XX_GPIO_KEY(20, KEY_WPS_BUTTON),
++	BCM47XX_GPIO_KEY(21, KEY_RESTART),
++};
++
++static const struct gpio_keys_button
+ bcm47xx_buttons_asus_rtn12[] __initconst = {
+ 	BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
+ 	BCM47XX_GPIO_KEY(1, KEY_RESTART),
+@@ -502,6 +508,9 @@ int __init bcm47xx_buttons_register(void
+ 	int err;
+ 
+ 	switch (board) {
++	case BCM47XX_BOARD_ASUS_RTN10U:
++		err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn10u);
++		break;
+ 	case BCM47XX_BOARD_ASUS_RTN12:
+ 		err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn12);
+ 		break;
+--- a/arch/mips/bcm47xx/leds.c
++++ b/arch/mips/bcm47xx/leds.c
+@@ -30,6 +30,14 @@
+ /* Asus */
+ 
+ static const struct gpio_led
++bcm47xx_leds_asus_rtn10u[] __initconst = {
++	BCM47XX_GPIO_LED(5, "green", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
++	BCM47XX_GPIO_LED(6, "green", "power", 1, LEDS_GPIO_DEFSTATE_ON),
++	BCM47XX_GPIO_LED(7, "green", "wps", 0, LEDS_GPIO_DEFSTATE_OFF),
++	BCM47XX_GPIO_LED(8, "green", "usb", 0, LEDS_GPIO_DEFSTATE_OFF),
++};
++
++static const struct gpio_led
+ bcm47xx_leds_asus_rtn12[] __initconst = {
+ 	BCM47XX_GPIO_LED(2, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
+ 	BCM47XX_GPIO_LED(7, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
+@@ -571,6 +579,9 @@ void __init bcm47xx_leds_register(void)
+ 	enum bcm47xx_board board = bcm47xx_board_get();
+ 
+ 	switch (board) {
++	case BCM47XX_BOARD_ASUS_RTN10U:
++		bcm47xx_set_pdata(bcm47xx_leds_asus_rtn10u);
++		break;
+ 	case BCM47XX_BOARD_ASUS_RTN12:
+ 		bcm47xx_set_pdata(bcm47xx_leds_asus_rtn12);
+ 		break;
diff --git a/target/linux/bcm47xx/patches-5.15/325-v5.17-MIPS-BCM47XX-Define-Linksys-WRT310N-V2-buttons.patch b/target/linux/bcm47xx/patches-5.15/325-v5.17-MIPS-BCM47XX-Define-Linksys-WRT310N-V2-buttons.patch
new file mode 100644
index 0000000000..0c23e8aaf5
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/325-v5.17-MIPS-BCM47XX-Define-Linksys-WRT310N-V2-buttons.patch
@@ -0,0 +1,40 @@
+From eea175eedf3e2f71b9538d21e643e7a1be4923df Mon Sep 17 00:00:00 2001
+From: Florian Fainelli <f.fainelli at gmail.com>
+Date: Thu, 6 Jan 2022 19:51:37 -0800
+Subject: [PATCH] MIPS: BCM47XX: Define Linksys WRT310N V2 buttons
+
+Update the buttons registration code to register the two buttons (WPS,
+system rester) using the existing BCM47XX_BOARD_LINKSYS_WRT310NV2 board
+entry.
+
+Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
+---
+ arch/mips/bcm47xx/buttons.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/arch/mips/bcm47xx/buttons.c
++++ b/arch/mips/bcm47xx/buttons.c
+@@ -289,6 +289,12 @@ bcm47xx_buttons_linksys_wrt320n_v1[] __i
+ };
+ 
+ static const struct gpio_keys_button
++bcm47xx_buttons_linksys_wrt310n_v2[] __initconst = {
++	BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON),
++	BCM47XX_GPIO_KEY(6, KEY_RESTART),
++};
++
++static const struct gpio_keys_button
+ bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
+ 	BCM47XX_GPIO_KEY(5, KEY_WIMAX),
+ 	BCM47XX_GPIO_KEY(6, KEY_RESTART),
+@@ -644,6 +650,9 @@ int __init bcm47xx_buttons_register(void
+ 	case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
+ 		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt320n_v1);
+ 		break;
++	case BCM47XX_BOARD_LINKSYS_WRT310NV2:
++		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310n_v2);
++		break;
+ 	case BCM47XX_BOARD_LINKSYS_WRT54G3GV2:
+ 		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54g3gv2);
+ 		break;
diff --git a/target/linux/bcm47xx/patches-5.15/400-mtd-bcm47xxpart-get-nvram.patch b/target/linux/bcm47xx/patches-5.15/400-mtd-bcm47xxpart-get-nvram.patch
new file mode 100644
index 0000000000..17abe89d1d
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/400-mtd-bcm47xxpart-get-nvram.patch
@@ -0,0 +1,34 @@
+--- a/drivers/mtd/parsers/bcm47xxpart.c
++++ b/drivers/mtd/parsers/bcm47xxpart.c
+@@ -98,6 +98,7 @@ static int bcm47xxpart_parse(struct mtd_
+ 	int trx_num = 0; /* Number of found TRX partitions */
+ 	int possible_nvram_sizes[] = { 0x8000, 0xF000, 0x10000, };
+ 	int err;
++	bool found_nvram = false;
+ 
+ 	/*
+ 	 * Some really old flashes (like AT45DB*) had smaller erasesize-s, but
+@@ -279,12 +280,23 @@ static int bcm47xxpart_parse(struct mtd_
+ 		if (buf[0] == NVRAM_HEADER) {
+ 			bcm47xxpart_add_part(&parts[curr_part++], "nvram",
+ 					     master->size - blocksize, 0);
++			found_nvram = true;
+ 			break;
+ 		}
+ 	}
+ 
+ 	kfree(buf);
+ 
++	if (!found_nvram) {
++		pr_err("can not find a nvram partition reserve last block\n");
++		bcm47xxpart_add_part(&parts[curr_part++], "nvram_guess",
++				     master->size - blocksize * 2, MTD_WRITEABLE);
++		for (i = 0; i < curr_part; i++) {
++			if (parts[i].size + parts[i].offset == master->size)
++				parts[i].offset -= blocksize * 2;
++		}
++	}
++
+ 	/*
+ 	 * Assume that partitions end at the beginning of the one they are
+ 	 * followed by.
diff --git a/target/linux/bcm47xx/patches-5.15/610-pci_ide_fix.patch b/target/linux/bcm47xx/patches-5.15/610-pci_ide_fix.patch
new file mode 100644
index 0000000000..520828e8e5
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/610-pci_ide_fix.patch
@@ -0,0 +1,41 @@
+From: b.sander
+Subject: [PATCH] pci: IDE fix
+
+These are standard probing messages when using pdc202xx_old:
+pdc202xx_old 0000:00:01.0: IDE controller (0x105a:0x0d30 rev 0x02)
+PCI: Enabling device 0000:00:01.0 (0004 -> 0007)
+PCI: Fixing up device 0000:00:01.0
+0000:00:01.0: (U)DMA Burst Bit DISABLED Primary PCI Mode Secondary PCI Mode.
+0000:00:01.0: FORCING BURST BIT 0x00->0x01 ACTIVE
+pdc202xx_old 0000:00:01.0: 100% native mode on irq 6
+
+With the default MAX_HWIFS value after above we get:
+    ide2: BM-DMA at 0x0400-0x0407
+    ide3: BM-DMA at 0x0408-0x040f
+Probing IDE interface ide2...
+hde: CF500, CFA DISK drive
+
+As you can see it's ide2 + ide3 and hde.
+
+With this patch applied we get:
+    ide0: BM-DMA at 0x0400-0x0407
+    ide1: BM-DMA at 0x0408-0x040f
+Probing IDE interface ide0...
+hda: CF500, CFA DISK drive
+
+This fixes OpenWrt ticket #7061: https://dev.openwrt.org/ticket/7061
+---
+--- a/include/linux/ide.h
++++ b/include/linux/ide.h
+@@ -236,7 +236,11 @@ static inline void ide_std_init_ports(st
+ 	hw->io_ports.ctl_addr = ctl_addr;
+ }
+ 
++#if defined CONFIG_BCM47XX
++# define MAX_HWIFS	2
++#else
+ #define MAX_HWIFS	10
++#endif
+ 
+ /*
+  * Now for the data we need to maintain per-drive:  ide_drive_t
diff --git a/target/linux/bcm47xx/patches-5.15/700-net-bgmac-connect-to-PHY-even-if-it-is-BGMAC_PHY_NOR.patch b/target/linux/bcm47xx/patches-5.15/700-net-bgmac-connect-to-PHY-even-if-it-is-BGMAC_PHY_NOR.patch
new file mode 100644
index 0000000000..2fcfbb7438
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/700-net-bgmac-connect-to-PHY-even-if-it-is-BGMAC_PHY_NOR.patch
@@ -0,0 +1,42 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Sun, 7 Nov 2021 14:20:40 +0100
+Subject: [PATCH] net: bgmac: connect to PHY even if it is BGMAC_PHY_NOREGS
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Recent bgmac change was meant to just fix a race between "Generic PHY"
+and "bcm53xx" drivers after -EPROBE_DEFER. It modified bgmac to use
+phy_connect() only if there is a real PHY device connected.
+
+That change broke bgmac on bcm47xx. bcma_phy_connect() now registers a
+fixed PHY with the bgmac_phy_connect_direct(). That fails as another
+fixed PHY (also using address 0) is already registered - by bcm47xx arch
+code bcm47xx_register_bus_complete().
+
+This change brings origial behaviour. It connects Ethernet interface
+with pseudo-PHY (switch device) and adjusts Ethernet interface link to
+match connected switch.
+
+This fixes:
+[    2.548098] bgmac_bcma bcma0:1: Failed to register fixed PHY device
+[    2.554584] bgmac_bcma bcma0:1: Cannot connect to phy
+
+Fixes: b5375509184d ("net: bgmac: improve handling PHY")
+Link: https://lore.kernel.org/netdev/3639116e-9292-03ca-b9d9-d741118a4541 at gmail.com/T/#u
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+---
+ drivers/net/ethernet/broadcom/bgmac-bcma.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
++++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
+@@ -94,7 +94,7 @@ static int bcma_phy_connect(struct bgmac
+ 		return 0;
+ 
+ 	/* Connect to the PHY */
+-	if (bgmac->mii_bus && bgmac->phyaddr != BGMAC_PHY_NOREGS) {
++	if (bgmac->mii_bus) {
+ 		snprintf(bus_id, sizeof(bus_id), PHY_ID_FMT, bgmac->mii_bus->id,
+ 			 bgmac->phyaddr);
+ 		phy_dev = phy_connect(bgmac->net_dev, bus_id, bgmac_adjust_link,
diff --git a/target/linux/bcm47xx/patches-5.15/791-tg3-no-pci-sleep.patch b/target/linux/bcm47xx/patches-5.15/791-tg3-no-pci-sleep.patch
new file mode 100644
index 0000000000..50edfc3b41
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/791-tg3-no-pci-sleep.patch
@@ -0,0 +1,17 @@
+When the Ethernet controller is powered down and someone wants to 
+access the mdio bus like the witch driver (b53) the system crashed if 
+PCI_D3hot was set before. This patch deactivates this power sawing mode 
+when a switch driver is in use.
+
+--- a/drivers/net/ethernet/broadcom/tg3.c
++++ b/drivers/net/ethernet/broadcom/tg3.c
+@@ -4273,7 +4273,8 @@ static int tg3_power_down_prepare(struct
+ static void tg3_power_down(struct tg3 *tp)
+ {
+ 	pci_wake_from_d3(tp->pdev, tg3_flag(tp, WOL_ENABLE));
+-	pci_set_power_state(tp->pdev, PCI_D3hot);
++	if (!tg3_flag(tp, ROBOSWITCH))
++		pci_set_power_state(tp->pdev, PCI_D3hot);
+ }
+ 
+ static void tg3_aux_stat_to_speed_duplex(struct tg3 *tp, u32 val, u32 *speed, u8 *duplex)
diff --git a/target/linux/bcm47xx/patches-5.15/800-bcma-add-table-of-serial-flashes-with-smaller-blocks.patch b/target/linux/bcm47xx/patches-5.15/800-bcma-add-table-of-serial-flashes-with-smaller-blocks.patch
new file mode 100644
index 0000000000..318dc55810
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/800-bcma-add-table-of-serial-flashes-with-smaller-blocks.patch
@@ -0,0 +1,73 @@
+From 597715c61ae75a05ab3310a34ff3857a006f0f63 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5 at gmail.com>
+Date: Thu, 20 Nov 2014 21:32:42 +0100
+Subject: [PATCH] bcma: add table of serial flashes with smaller blocks
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
+---
+ drivers/bcma/driver_chipcommon_sflash.c | 29 +++++++++++++++++++++++++++++
+ 1 file changed, 29 insertions(+)
+
+--- a/drivers/bcma/driver_chipcommon_sflash.c
++++ b/drivers/bcma/driver_chipcommon_sflash.c
+@@ -9,6 +9,7 @@
+ 
+ #include <linux/platform_device.h>
+ #include <linux/bcma/bcma.h>
++#include <bcm47xx_board.h>
+ 
+ static struct resource bcma_sflash_resource = {
+ 	.name	= "bcma_sflash",
+@@ -42,6 +43,13 @@ static const struct bcma_sflash_tbl_e bc
+ 	{ NULL },
+ };
+ 
++/* Some devices use smaller blocks (and have more of them) */
++static const struct bcma_sflash_tbl_e bcma_sflash_st_shrink_tbl[] = {
++	{ "M25P16", 0x14, 0x1000, 512, },
++	{ "M25P32", 0x15, 0x1000, 1024, },
++	{ NULL },
++};
++
+ static const struct bcma_sflash_tbl_e bcma_sflash_sst_tbl[] = {
+ 	{ "SST25WF512", 1, 0x1000, 16, },
+ 	{ "SST25VF512", 0x48, 0x1000, 16, },
+@@ -85,6 +93,24 @@ static void bcma_sflash_cmd(struct bcma_
+ 	bcma_err(cc->core->bus, "SFLASH control command failed (timeout)!\n");
+ }
+ 
++const struct bcma_sflash_tbl_e *bcma_sflash_shrink_flash(u32 id)
++{
++	enum bcm47xx_board board = bcm47xx_board_get();
++	const struct bcma_sflash_tbl_e *e;
++
++	switch (board) {
++	case BCM47XX_BOARD_NETGEAR_WGR614_V10:
++	case BCM47XX_BOARD_NETGEAR_WNR1000_V3:
++		for (e = bcma_sflash_st_shrink_tbl; e->name; e++) {
++			if (e->id == id)
++				return e;
++		}
++		return NULL;
++	default:
++		return NULL;
++	}
++}
++
+ /* Initialize serial flash access */
+ int bcma_sflash_init(struct bcma_drv_cc *cc)
+ {
+@@ -115,6 +141,10 @@ int bcma_sflash_init(struct bcma_drv_cc
+ 		case 0x13:
+ 			return -ENOTSUPP;
+ 		default:
++			e = bcma_sflash_shrink_flash(id);
++			if (e)
++				break;
++
+ 			for (e = bcma_sflash_st_tbl; e->name; e++) {
+ 				if (e->id == id)
+ 					break;
diff --git a/target/linux/bcm47xx/patches-5.15/820-wgt634u-nvram-fix.patch b/target/linux/bcm47xx/patches-5.15/820-wgt634u-nvram-fix.patch
new file mode 100644
index 0000000000..bfcfae885f
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/820-wgt634u-nvram-fix.patch
@@ -0,0 +1,296 @@
+The Netgear wgt634u uses a different format for storing the 
+configuration. This patch is needed to read out the correct 
+configuration. The cfe_env.c file uses a different method way to read 
+out the configuration than the in kernel cfe config reader.
+
+--- a/drivers/firmware/broadcom/Makefile
++++ b/drivers/firmware/broadcom/Makefile
+@@ -1,4 +1,4 @@
+ # SPDX-License-Identifier: GPL-2.0-only
+-obj-$(CONFIG_BCM47XX_NVRAM)		+= bcm47xx_nvram.o
++obj-$(CONFIG_BCM47XX_NVRAM)		+= bcm47xx_nvram.o cfe_env.o
+ obj-$(CONFIG_BCM47XX_SPROM)		+= bcm47xx_sprom.o
+ obj-$(CONFIG_TEE_BNXT_FW)		+= tee_bnxt_fw.o
+--- /dev/null
++++ b/drivers/firmware/broadcom/cfe_env.c
+@@ -0,0 +1,228 @@
++/*
++ * CFE environment variable access
++ *
++ * Copyright 2001-2003, Broadcom Corporation
++ * Copyright 2006, Felix Fietkau <nbd at nbd.name>
++ * 
++ * This program is free software; you can redistribute  it and/or modify it
++ * under  the terms of  the GNU General  Public License as published by the
++ * Free Software Foundation;  either version 2 of the  License, or (at your
++ * option) any later version.
++ */
++
++#include <linux/init.h>
++#include <linux/module.h>
++#include <linux/kernel.h>
++#include <linux/string.h>
++#include <asm/io.h>
++#include <linux/uaccess.h>
++
++#define NVRAM_SIZE       (0x1ff0)
++static char _nvdata[NVRAM_SIZE];
++static char _valuestr[256];
++
++/*
++ * TLV types.  These codes are used in the "type-length-value"
++ * encoding of the items stored in the NVRAM device (flash or EEPROM)
++ *
++ * The layout of the flash/nvram is as follows:
++ *
++ * <type> <length> <data ...> <type> <length> <data ...> <type_end>
++ *
++ * The type code of "ENV_TLV_TYPE_END" marks the end of the list.
++ * The "length" field marks the length of the data section, not
++ * including the type and length fields.
++ *
++ * Environment variables are stored as follows:
++ *
++ * <type_env> <length> <flags> <name> = <value>
++ *
++ * If bit 0 (low bit) is set, the length is an 8-bit value.
++ * If bit 0 (low bit) is clear, the length is a 16-bit value
++ * 
++ * Bit 7 set indicates "user" TLVs.  In this case, bit 0 still
++ * indicates the size of the length field.  
++ *
++ * Flags are from the constants below:
++ *
++ */
++#define ENV_LENGTH_16BITS	0x00	/* for low bit */
++#define ENV_LENGTH_8BITS	0x01
++
++#define ENV_TYPE_USER		0x80
++
++#define ENV_CODE_SYS(n,l) (((n)<<1)|(l))
++#define ENV_CODE_USER(n,l) ((((n)<<1)|(l)) | ENV_TYPE_USER)
++
++/*
++ * The actual TLV types we support
++ */
++
++#define ENV_TLV_TYPE_END	0x00	
++#define ENV_TLV_TYPE_ENV	ENV_CODE_SYS(0,ENV_LENGTH_8BITS)
++
++/*
++ * Environment variable flags 
++ */
++
++#define ENV_FLG_NORMAL		0x00	/* normal read/write */
++#define ENV_FLG_BUILTIN		0x01	/* builtin - not stored in flash */
++#define ENV_FLG_READONLY	0x02	/* read-only - cannot be changed */
++
++#define ENV_FLG_MASK		0xFF	/* mask of attributes we keep */
++#define ENV_FLG_ADMIN		0x100	/* lets us internally override permissions */
++
++
++/*  *********************************************************************
++    *  _nvram_read(buffer,offset,length)
++    *  
++    *  Read data from the NVRAM device
++    *  
++    *  Input parameters: 
++    *  	   buffer - destination buffer
++    *  	   offset - offset of data to read
++    *  	   length - number of bytes to read
++    *  	   
++    *  Return value:
++    *  	   number of bytes read, or <0 if error occured
++    ********************************************************************* */
++static int
++_nvram_read(unsigned char *nv_buf, unsigned char *buffer, int offset, int length)
++{
++    int i;
++    if (offset > NVRAM_SIZE)
++	return -1; 
++
++    for ( i = 0; i < length; i++) {
++	buffer[i] = ((volatile unsigned char*)nv_buf)[offset + i];
++    }
++    return length;
++}
++
++
++static char*
++_strnchr(const char *dest,int c,size_t cnt)
++{
++	while (*dest && (cnt > 0)) {
++	if (*dest == c) return (char *) dest;
++	dest++;
++	cnt--;
++	}
++	return NULL;
++}
++
++
++
++/*
++ * Core support API: Externally visible.
++ */
++
++/*
++ * Get the value of an NVRAM variable
++ * @param	name	name of variable to get
++ * @return	value of variable or NULL if undefined
++ */
++
++char *cfe_env_get(unsigned char *nv_buf, const char *name)
++{
++    int size;
++    unsigned char *buffer;
++    unsigned char *ptr;
++    unsigned char *envval;
++    unsigned int reclen;
++    unsigned int rectype;
++    int offset;
++    int flg;
++    
++	if (!strcmp(name, "nvram_type"))
++		return "cfe";
++	
++    size = NVRAM_SIZE;
++    buffer = &_nvdata[0];
++
++    ptr = buffer;
++    offset = 0;
++
++    /* Read the record type and length */
++    if (_nvram_read(nv_buf, ptr,offset,1) != 1) {
++	goto error;
++    }
++    
++    while ((*ptr != ENV_TLV_TYPE_END)  && (size > 1)) {
++
++	/* Adjust pointer for TLV type */
++	rectype = *(ptr);
++	offset++;
++	size--;
++
++	/* 
++	 * Read the length.  It can be either 1 or 2 bytes
++	 * depending on the code 
++	 */
++	if (rectype & ENV_LENGTH_8BITS) {
++	    /* Read the record type and length - 8 bits */
++	    if (_nvram_read(nv_buf, ptr,offset,1) != 1) {
++		goto error;
++	    }
++	    reclen = *(ptr);
++	    size--;
++	    offset++;
++	}
++	else {
++	    /* Read the record type and length - 16 bits, MSB first */
++	    if (_nvram_read(nv_buf, ptr,offset,2) != 2) {
++		goto error;
++	    }
++	    reclen = (((unsigned int) *(ptr)) << 8) + (unsigned int) *(ptr+1);
++	    size -= 2;
++	    offset += 2;
++	}
++
++	if (reclen > size)
++	    break;	/* should not happen, bad NVRAM */
++
++	switch (rectype) {
++	    case ENV_TLV_TYPE_ENV:
++		/* Read the TLV data */
++		if (_nvram_read(nv_buf, ptr,offset,reclen) != reclen)
++		    goto error;
++		flg = *ptr++;
++		envval = (unsigned char *) _strnchr(ptr,'=',(reclen-1));
++		if (envval) {
++		    *envval++ = '\0';
++		    memcpy(_valuestr,envval,(reclen-1)-(envval-ptr));
++		    _valuestr[(reclen-1)-(envval-ptr)] = '\0';
++#if 0			
++		    printk(KERN_INFO "NVRAM:%s=%s\n", ptr, _valuestr);
++#endif
++		    if(!strcmp(ptr, name)){
++			return _valuestr;
++		    }
++		    if((strlen(ptr) > 1) && !strcmp(&ptr[1], name))
++			return _valuestr;
++		}
++		break;
++		
++	    default: 
++		/* Unknown TLV type, skip it. */
++		break;
++	    }
++
++	/*
++	 * Advance to next TLV 
++	 */
++		
++	size -= (int)reclen;
++	offset += reclen;
++
++	/* Read the next record type */
++	ptr = buffer;
++	if (_nvram_read(nv_buf, ptr,offset,1) != 1)
++	    goto error;
++	}
++
++error:
++    return NULL;
++
++}
++
+--- a/drivers/firmware/broadcom/bcm47xx_nvram.c
++++ b/drivers/firmware/broadcom/bcm47xx_nvram.c
+@@ -33,6 +33,8 @@ struct nvram_header {
+ static char nvram_buf[NVRAM_SPACE];
+ static size_t nvram_len;
+ static const u32 nvram_sizes[] = {0x6000, 0x8000, 0xF000, 0x10000};
++static int cfe_env;
++extern char *cfe_env_get(char *nv_buf, const char *name);
+ 
+ /**
+  * bcm47xx_nvram_is_valid - check for a valid NVRAM at specified memory
+@@ -80,6 +82,26 @@ static int bcm47xx_nvram_find_and_copy(v
+ 		return -EEXIST;
+ 	}
+ 
++	cfe_env = 0;
++
++	/* XXX: hack for supporting the CFE environment stuff on WGT634U */
++	if (res_size >= 8 * 1024 * 1024) {
++		u32 *src = (u32 *)(flash_start + 8 * 1024 * 1024 - 0x2000);
++		u32 *dst = (u32 *)nvram_buf;
++
++		if ((*src & 0xff00ff) == 0x000001) {
++			printk("early_nvram_init: WGT634U NVRAM found.\n");
++
++			for (i = 0; i < 0x1ff0; i++) {
++				if (*src == 0xFFFFFFFF)
++					break;
++				*dst++ = *src++;
++			}
++			cfe_env = 1;
++			return 0;
++		}
++	}
++
+ 	/* TODO: when nvram is on nand flash check for bad blocks first. */
+ 
+ 	/* Try every possible flash size and check for NVRAM at its end */
+@@ -172,6 +194,13 @@ int bcm47xx_nvram_getenv(const char *nam
+ 	if (!name)
+ 		return -EINVAL;
+ 
++	if (cfe_env) {
++		value = cfe_env_get(nvram_buf, name);
++		if (!value)
++			return -ENOENT;
++		return snprintf(val, val_len, "%s", value);
++	}
++
+ 	if (!nvram_len) {
+ 		err = nvram_init();
+ 		if (err)
diff --git a/target/linux/bcm47xx/patches-5.15/830-huawei_e970_support.patch b/target/linux/bcm47xx/patches-5.15/830-huawei_e970_support.patch
new file mode 100644
index 0000000000..1746fee592
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/830-huawei_e970_support.patch
@@ -0,0 +1,101 @@
+--- a/arch/mips/bcm47xx/setup.c
++++ b/arch/mips/bcm47xx/setup.c
+@@ -37,6 +37,7 @@
+ #include <linux/ssb/ssb.h>
+ #include <linux/ssb/ssb_embedded.h>
+ #include <linux/bcma/bcma_soc.h>
++#include <linux/old_gpio_wdt.h>
+ #include <asm/bootinfo.h>
+ #include <asm/idle.h>
+ #include <asm/prom.h>
+@@ -254,6 +255,33 @@ static struct fixed_phy_status bcm47xx_f
+ 	.duplex	= DUPLEX_FULL,
+ };
+ 
++static struct gpio_wdt_platform_data gpio_wdt_data;
++
++static struct platform_device gpio_wdt_device = {
++	.name			= "gpio-wdt",
++	.id			= 0,
++	.dev			= {
++		.platform_data	= &gpio_wdt_data,
++	},
++};
++
++static int __init bcm47xx_register_gpio_watchdog(void)
++{
++	enum bcm47xx_board board = bcm47xx_board_get();
++
++	switch (board) {
++	case BCM47XX_BOARD_HUAWEI_E970:
++		pr_info("bcm47xx: detected Huawei E970 or similar, starting early gpio_wdt timer\n");
++		gpio_wdt_data.gpio = 7;
++		gpio_wdt_data.interval = HZ;
++		gpio_wdt_data.first_interval = HZ / 5;
++		return platform_device_register(&gpio_wdt_device);
++	default:
++		/* Nothing to do */
++		return 0;
++	}
++}
++
+ static int __init bcm47xx_register_bus_complete(void)
+ {
+ 	switch (bcm47xx_bus_type) {
+@@ -275,6 +303,7 @@ static int __init bcm47xx_register_bus_c
+ 	bcm47xx_workarounds();
+ 
+ 	fixed_phy_add(PHY_POLL, 0, &bcm47xx_fixed_phy_status);
++	bcm47xx_register_gpio_watchdog();
+ 	return 0;
+ }
+ device_initcall(bcm47xx_register_bus_complete);
+--- a/arch/mips/configs/bcm47xx_defconfig
++++ b/arch/mips/configs/bcm47xx_defconfig
+@@ -63,6 +63,7 @@ CONFIG_HW_RANDOM=y
+ CONFIG_GPIO_SYSFS=y
+ CONFIG_WATCHDOG=y
+ CONFIG_BCM47XX_WDT=y
++CONFIG_GPIO_WDT=y
+ CONFIG_SSB_DRIVER_GIGE=y
+ CONFIG_BCMA_DRIVER_GMAC_CMN=y
+ CONFIG_USB=y
+--- a/drivers/ssb/embedded.c
++++ b/drivers/ssb/embedded.c
+@@ -34,11 +34,36 @@ int ssb_watchdog_timer_set(struct ssb_bu
+ }
+ EXPORT_SYMBOL(ssb_watchdog_timer_set);
+ 
++#ifdef CONFIG_BCM47XX
++#include <bcm47xx_board.h>
++
++static bool ssb_watchdog_supported(void)
++{
++	enum bcm47xx_board board = bcm47xx_board_get();
++
++	/* The Huawei E970 has a hardware watchdog using a GPIO */
++	switch (board) {
++	case BCM47XX_BOARD_HUAWEI_E970:
++		return false;
++	default:
++		return true;
++	}
++}
++#else
++static bool ssb_watchdog_supported(void)
++{
++	return true;
++}
++#endif
++
+ int ssb_watchdog_register(struct ssb_bus *bus)
+ {
+ 	struct bcm47xx_wdt wdt = {};
+ 	struct platform_device *pdev;
+ 
++	if (!ssb_watchdog_supported())
++		return 0;
++
+ 	if (ssb_chipco_available(&bus->chipco)) {
+ 		wdt.driver_data = &bus->chipco;
+ 		wdt.timer_set = ssb_chipco_watchdog_timer_set_wdt;
diff --git a/target/linux/bcm47xx/patches-5.15/831-old_gpio_wdt.patch b/target/linux/bcm47xx/patches-5.15/831-old_gpio_wdt.patch
new file mode 100644
index 0000000000..f6fb7f1855
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/831-old_gpio_wdt.patch
@@ -0,0 +1,360 @@
+This generic GPIO watchdog is used on Huawei E970 (bcm47xx)
+
+Signed-off-by: Mathias Adam <m.adam--openwrt at adamis.de>
+
+--- a/drivers/watchdog/Kconfig
++++ b/drivers/watchdog/Kconfig
+@@ -1698,6 +1698,15 @@ config WDT_MTX1
+ 	  Hardware driver for the MTX-1 boards. This is a watchdog timer that
+ 	  will reboot the machine after a 100 seconds timer expired.
+ 
++config GPIO_WDT
++	tristate "GPIO Hardware Watchdog"
++ 	help
++	  Hardware driver for GPIO-controlled watchdogs. GPIO pin and
++	  toggle interval settings are platform-specific. The driver
++	  will stop toggling the GPIO (i.e. machine reboots) after a
++	  100 second timer expired and no process has written to
++	  /dev/watchdog during that time.
++
+ config PNX833X_WDT
+ 	tristate "PNX833x Hardware Watchdog"
+ 	depends on SOC_PNX8335
+--- a/drivers/watchdog/Makefile
++++ b/drivers/watchdog/Makefile
+@@ -161,6 +161,7 @@ obj-$(CONFIG_RC32434_WDT) += rc32434_wdt
+ obj-$(CONFIG_INDYDOG) += indydog.o
+ obj-$(CONFIG_JZ4740_WDT) += jz4740_wdt.o
+ obj-$(CONFIG_WDT_MTX1) += mtx-1_wdt.o
++obj-$(CONFIG_GPIO_WDT) += old_gpio_wdt.o
+ obj-$(CONFIG_PNX833X_WDT) += pnx833x_wdt.o
+ obj-$(CONFIG_SIBYTE_WDOG) += sb_wdog.o
+ obj-$(CONFIG_AR7_WDT) += ar7_wdt.o
+--- /dev/null
++++ b/drivers/watchdog/old_gpio_wdt.c
+@@ -0,0 +1,301 @@
++/*
++ *      Driver for GPIO-controlled Hardware Watchdogs.
++ *
++ *      Copyright (C) 2013 Mathias Adam <m.adam--linux at adamis.de>
++ *
++ *      Replaces mtx1_wdt (driver for the MTX-1 Watchdog):
++ *
++ *      (C) Copyright 2005 4G Systems <info at 4g-systems.biz>,
++ *                              All Rights Reserved.
++ *                              http://www.4g-systems.biz
++ *
++ *      (C) Copyright 2007 OpenWrt.org, Florian Fainelli <florian at openwrt.org>
++ *
++ *      This program is free software; you can redistribute it and/or
++ *      modify it under the terms of the GNU General Public License
++ *      as published by the Free Software Foundation; either version
++ *      2 of the License, or (at your option) any later version.
++ *
++ *      Neither Michael Stickel nor 4G Systems admit liability nor provide
++ *      warranty for any of this software. This material is provided
++ *      "AS-IS" and at no charge.
++ *
++ *      (c) Copyright 2005    4G Systems <info at 4g-systems.biz>
++ *
++ *      Release 0.01.
++ *      Author: Michael Stickel  michael.stickel at 4g-systems.biz
++ *
++ *      Release 0.02.
++ *      Author: Florian Fainelli florian at openwrt.org
++ *              use the Linux watchdog/timer APIs
++ *
++ *      Release 0.03.
++ *      Author: Mathias Adam <m.adam--linux at adamis.de>
++ *              make it a generic gpio watchdog driver
++ *
++ *      The Watchdog is configured to reset the MTX-1
++ *      if it is not triggered for 100 seconds.
++ *      It should not be triggered more often than 1.6 seconds.
++ *
++ *      A timer triggers the watchdog every 5 seconds, until
++ *      it is opened for the first time. After the first open
++ *      it MUST be triggered every 2..95 seconds.
++ */
++
++#include <linux/module.h>
++#include <linux/moduleparam.h>
++#include <linux/types.h>
++#include <linux/errno.h>
++#include <linux/miscdevice.h>
++#include <linux/fs.h>
++#include <linux/init.h>
++#include <linux/ioport.h>
++#include <linux/timer.h>
++#include <linux/completion.h>
++#include <linux/jiffies.h>
++#include <linux/watchdog.h>
++#include <linux/platform_device.h>
++#include <linux/io.h>
++#include <linux/uaccess.h>
++#include <linux/gpio.h>
++#include <linux/old_gpio_wdt.h>
++
++static int ticks = 100 * HZ;
++
++static struct {
++	struct completion stop;
++	spinlock_t lock;
++	int running;
++	struct timer_list timer;
++	int queue;
++	int default_ticks;
++	unsigned long inuse;
++	unsigned gpio;
++	unsigned int gstate;
++	int interval;
++	int first_interval;
++} gpio_wdt_device;
++
++static void gpio_wdt_trigger(struct timer_list *unused)
++{
++	spin_lock(&gpio_wdt_device.lock);
++	if (gpio_wdt_device.running && ticks > 0)
++		ticks -= gpio_wdt_device.interval;
++
++	/* toggle wdt gpio */
++	gpio_wdt_device.gstate = !gpio_wdt_device.gstate;
++	gpio_set_value(gpio_wdt_device.gpio, gpio_wdt_device.gstate);
++
++	if (gpio_wdt_device.queue && ticks > 0)
++		mod_timer(&gpio_wdt_device.timer, jiffies + gpio_wdt_device.interval);
++	else
++		complete(&gpio_wdt_device.stop);
++	spin_unlock(&gpio_wdt_device.lock);
++}
++
++static void gpio_wdt_reset(void)
++{
++	ticks = gpio_wdt_device.default_ticks;
++}
++
++
++static void gpio_wdt_start(void)
++{
++	unsigned long flags;
++
++	spin_lock_irqsave(&gpio_wdt_device.lock, flags);
++	if (!gpio_wdt_device.queue) {
++		gpio_wdt_device.queue = 1;
++		gpio_wdt_device.gstate = 1;
++		gpio_set_value(gpio_wdt_device.gpio, 1);
++		mod_timer(&gpio_wdt_device.timer, jiffies + gpio_wdt_device.first_interval);
++	}
++	gpio_wdt_device.running++;
++	spin_unlock_irqrestore(&gpio_wdt_device.lock, flags);
++}
++
++static int gpio_wdt_stop(void)
++{
++	unsigned long flags;
++
++	spin_lock_irqsave(&gpio_wdt_device.lock, flags);
++	if (gpio_wdt_device.queue) {
++		gpio_wdt_device.queue = 0;
++		gpio_wdt_device.gstate = 0;
++		gpio_set_value(gpio_wdt_device.gpio, 0);
++	}
++	ticks = gpio_wdt_device.default_ticks;
++	spin_unlock_irqrestore(&gpio_wdt_device.lock, flags);
++	return 0;
++}
++
++/* Filesystem functions */
++
++static int gpio_wdt_open(struct inode *inode, struct file *file)
++{
++	if (test_and_set_bit(0, &gpio_wdt_device.inuse))
++		return -EBUSY;
++	return nonseekable_open(inode, file);
++}
++
++
++static int gpio_wdt_release(struct inode *inode, struct file *file)
++{
++	clear_bit(0, &gpio_wdt_device.inuse);
++	return 0;
++}
++
++static long gpio_wdt_ioctl(struct file *file, unsigned int cmd,
++							unsigned long arg)
++{
++	void __user *argp = (void __user *)arg;
++	int __user *p = (int __user *)argp;
++	unsigned int value;
++	static const struct watchdog_info ident = {
++		.options = WDIOF_CARDRESET,
++		.identity = "GPIO WDT",
++	};
++
++	switch (cmd) {
++	case WDIOC_GETSUPPORT:
++		if (copy_to_user(argp, &ident, sizeof(ident)))
++			return -EFAULT;
++		break;
++	case WDIOC_GETSTATUS:
++	case WDIOC_GETBOOTSTATUS:
++		put_user(0, p);
++		break;
++	case WDIOC_SETOPTIONS:
++		if (get_user(value, p))
++			return -EFAULT;
++		if (value & WDIOS_ENABLECARD)
++			gpio_wdt_start();
++		else if (value & WDIOS_DISABLECARD)
++			gpio_wdt_stop();
++		else
++			return -EINVAL;
++		return 0;
++	case WDIOC_KEEPALIVE:
++		gpio_wdt_reset();
++		break;
++	default:
++		return -ENOTTY;
++	}
++	return 0;
++}
++
++
++static ssize_t gpio_wdt_write(struct file *file, const char *buf,
++						size_t count, loff_t *ppos)
++{
++	if (!count)
++		return -EIO;
++	gpio_wdt_reset();
++	return count;
++}
++
++static const struct file_operations gpio_wdt_fops = {
++	.owner		= THIS_MODULE,
++	.llseek		= no_llseek,
++	.unlocked_ioctl	= gpio_wdt_ioctl,
++	.open		= gpio_wdt_open,
++	.write		= gpio_wdt_write,
++	.release	= gpio_wdt_release,
++};
++
++
++static struct miscdevice gpio_wdt_misc = {
++	.minor	= WATCHDOG_MINOR,
++	.name	= "watchdog",
++	.fops	= &gpio_wdt_fops,
++};
++
++
++static int gpio_wdt_probe(struct platform_device *pdev)
++{
++	int ret;
++	struct gpio_wdt_platform_data *gpio_wdt_data = pdev->dev.platform_data;
++
++	gpio_wdt_device.gpio = gpio_wdt_data->gpio;
++	gpio_wdt_device.interval = gpio_wdt_data->interval;
++	gpio_wdt_device.first_interval = gpio_wdt_data->first_interval;
++	if (gpio_wdt_device.first_interval <= 0) {
++		gpio_wdt_device.first_interval = gpio_wdt_device.interval;
++	}
++
++	ret = gpio_request(gpio_wdt_device.gpio, "gpio-wdt");
++	if (ret < 0) {
++		dev_err(&pdev->dev, "failed to request gpio");
++		return ret;
++	}
++
++	spin_lock_init(&gpio_wdt_device.lock);
++	init_completion(&gpio_wdt_device.stop);
++	gpio_wdt_device.queue = 0;
++	clear_bit(0, &gpio_wdt_device.inuse);
++	timer_setup(&gpio_wdt_device.timer, gpio_wdt_trigger, 0L);
++	gpio_wdt_device.default_ticks = ticks;
++
++	gpio_wdt_start();
++	dev_info(&pdev->dev, "GPIO Hardware Watchdog driver (gpio=%i interval=%i/%i)\n",
++		gpio_wdt_data->gpio, gpio_wdt_data->first_interval, gpio_wdt_data->interval);
++	return 0;
++}
++
++static int gpio_wdt_remove(struct platform_device *pdev)
++{
++	/* FIXME: do we need to lock this test ? */
++	if (gpio_wdt_device.queue) {
++		gpio_wdt_device.queue = 0;
++		wait_for_completion(&gpio_wdt_device.stop);
++	}
++
++	gpio_free(gpio_wdt_device.gpio);
++	misc_deregister(&gpio_wdt_misc);
++	return 0;
++}
++
++static struct platform_driver gpio_wdt_driver = {
++	.probe = gpio_wdt_probe,
++	.remove = gpio_wdt_remove,
++	.driver.name = "gpio-wdt",
++	.driver.owner = THIS_MODULE,
++};
++
++static int __init gpio_wdt_init(void)
++{
++	return platform_driver_register(&gpio_wdt_driver);
++}
++arch_initcall(gpio_wdt_init);
++
++/*
++ * We do wdt initialization in two steps: arch_initcall probes the wdt
++ * very early to start pinging the watchdog (misc devices are not yet
++ * available), and later module_init() just registers the misc device.
++ */
++static int gpio_wdt_init_late(void)
++{
++	int ret;
++
++	ret = misc_register(&gpio_wdt_misc);
++	if (ret < 0) {
++		pr_err("GPIO_WDT: failed to register misc device\n");
++		return ret;
++	}
++	return 0;
++}
++#ifndef MODULE
++module_init(gpio_wdt_init_late);
++#endif
++
++static void __exit gpio_wdt_exit(void)
++{
++	platform_driver_unregister(&gpio_wdt_driver);
++}
++module_exit(gpio_wdt_exit);
++
++MODULE_AUTHOR("Michael Stickel, Florian Fainelli, Mathias Adam");
++MODULE_DESCRIPTION("Driver for GPIO hardware watchdogs");
++MODULE_LICENSE("GPL");
++MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
++MODULE_ALIAS("platform:gpio-wdt");
+--- /dev/null
++++ b/include/linux/old_gpio_wdt.h
+@@ -0,0 +1,21 @@
++/*
++ *  Definitions for the GPIO watchdog driver
++ *
++ *  Copyright (C) 2013 Mathias Adam <m.adam--linux at adamis.de>
++ *
++ *  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.
++ *
++ */
++
++#ifndef _GPIO_WDT_H_
++#define _GPIO_WDT_H_
++
++struct gpio_wdt_platform_data {
++	int	gpio;		/* GPIO line number */
++	int	interval;	/* watchdog reset interval in system ticks */
++	int	first_interval;	/* first wd reset interval in system ticks */
++};
++
++#endif /* _GPIO_WDT_H_ */
diff --git a/target/linux/bcm47xx/patches-5.15/900-ssb-reject-PCI-writes-setting-CardBus-bridge-resourc.patch b/target/linux/bcm47xx/patches-5.15/900-ssb-reject-PCI-writes-setting-CardBus-bridge-resourc.patch
new file mode 100644
index 0000000000..6b7ee06e50
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/900-ssb-reject-PCI-writes-setting-CardBus-bridge-resourc.patch
@@ -0,0 +1,30 @@
+From 5c81397a0147ea59c778d1de14ef54e2268221f6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5 at gmail.com>
+Date: Wed, 8 Apr 2015 06:58:11 +0200
+Subject: [PATCH] ssb: reject PCI writes setting CardBus bridge resources
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+If SoC has a CardBus we can set resources of device at slot 1 only. It's
+impossigle to set bridge resources as it simply overwrites device 1
+configuration and usually results in Data bus error-s.
+
+Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
+---
+ drivers/ssb/driver_pcicore.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/ssb/driver_pcicore.c
++++ b/drivers/ssb/driver_pcicore.c
+@@ -164,6 +164,10 @@ static int ssb_extpci_write_config(struc
+ 	WARN_ON(!pc->hostmode);
+ 	if (unlikely(len != 1 && len != 2 && len != 4))
+ 		goto out;
++	/* CardBus SoCs allow configuring dev 1 resources only */
++	if (extpci_core->cardbusmode && dev != 1 &&
++	    off >= PCI_BASE_ADDRESS_0 && off <= PCI_BASE_ADDRESS_5)
++		goto out;
+ 	addr = get_cfgspace_addr(pc, bus, dev, func, off);
+ 	if (unlikely(!addr))
+ 		goto out;
diff --git a/target/linux/bcm47xx/patches-5.15/940-bcm47xx-yenta.patch b/target/linux/bcm47xx/patches-5.15/940-bcm47xx-yenta.patch
new file mode 100644
index 0000000000..8847b0c0c7
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/940-bcm47xx-yenta.patch
@@ -0,0 +1,46 @@
+--- a/drivers/pcmcia/yenta_socket.c
++++ b/drivers/pcmcia/yenta_socket.c
+@@ -932,6 +932,8 @@ static unsigned int yenta_probe_irq(stru
+ 	 * Probe for usable interrupts using the force
+ 	 * register to generate bogus card status events.
+ 	 */
++#ifndef CONFIG_BCM47XX
++	/* WRT54G3G does not like this */
+ 	cb_writel(socket, CB_SOCKET_EVENT, -1);
+ 	cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK);
+ 	reg = exca_readb(socket, I365_CSCINT);
+@@ -947,6 +949,7 @@ static unsigned int yenta_probe_irq(stru
+ 	}
+ 	cb_writel(socket, CB_SOCKET_MASK, 0);
+ 	exca_writeb(socket, I365_CSCINT, reg);
++#endif
+ 
+ 	mask = probe_irq_mask(val) & 0xffff;
+ 
+@@ -1031,6 +1034,10 @@ static void yenta_get_socket_capabilitie
+ 	else
+ 		socket->socket.irq_mask = 0;
+ 
++	/* irq mask probing is broken for the WRT54G3G */
++	if (socket->socket.irq_mask == 0)
++		socket->socket.irq_mask = 0x6f8;
++
+ 	dev_info(&socket->dev->dev, "ISA IRQ mask 0x%04x, PCI irq %d\n",
+ 		 socket->socket.irq_mask, socket->cb_irq);
+ }
+@@ -1262,6 +1269,15 @@ static int yenta_probe(struct pci_dev *d
+ 	dev_info(&dev->dev, "Socket status: %08x\n",
+ 		 cb_readl(socket, CB_SOCKET_STATE));
+ 
++	/* Generate an interrupt on card insert/remove */
++	config_writew(socket, CB_SOCKET_MASK, CB_CSTSMASK | CB_CDMASK);
++
++	/* Set up Multifunction Routing Status Register */
++	config_writew(socket, 0x8C, 0x1000 /* MFUNC3 to GPIO3 */ | 0x2 /* MFUNC0 to INTA */);
++
++	/* Switch interrupts to parallelized */
++	config_writeb(socket, 0x92, 0x64);
++
+ 	yenta_fixup_parent_bridge(dev->subordinate);
+ 
+ 	/* Register it with the pcmcia layer.. */
diff --git a/target/linux/bcm47xx/patches-5.15/976-ssb_increase_pci_delay.patch b/target/linux/bcm47xx/patches-5.15/976-ssb_increase_pci_delay.patch
new file mode 100644
index 0000000000..99aa188374
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/976-ssb_increase_pci_delay.patch
@@ -0,0 +1,11 @@
+--- a/drivers/ssb/driver_pcicore.c
++++ b/drivers/ssb/driver_pcicore.c
+@@ -390,7 +390,7 @@ static void ssb_pcicore_init_hostmode(st
+ 	set_io_port_base(ssb_pcicore_controller.io_map_base);
+ 	/* Give some time to the PCI controller to configure itself with the new
+ 	 * values. Not waiting at this point causes crashes of the machine. */
+-	mdelay(10);
++	mdelay(300);
+ 	register_pci_controller(&ssb_pcicore_controller);
+ }
+ 
diff --git a/target/linux/bcm47xx/patches-5.15/999-wl_exports.patch b/target/linux/bcm47xx/patches-5.15/999-wl_exports.patch
new file mode 100644
index 0000000000..48c6a47871
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/999-wl_exports.patch
@@ -0,0 +1,24 @@
+--- a/drivers/firmware/broadcom/bcm47xx_nvram.c
++++ b/drivers/firmware/broadcom/bcm47xx_nvram.c
+@@ -30,7 +30,8 @@ struct nvram_header {
+ 	u32 config_ncdl;	/* ncdl values for memc */
+ };
+ 
+-static char nvram_buf[NVRAM_SPACE];
++char nvram_buf[NVRAM_SPACE];
++EXPORT_SYMBOL(nvram_buf);
+ static size_t nvram_len;
+ static const u32 nvram_sizes[] = {0x6000, 0x8000, 0xF000, 0x10000};
+ static int cfe_env;
+--- a/arch/mips/mm/cache.c
++++ b/arch/mips/mm/cache.c
+@@ -61,6 +61,9 @@ void (*_dma_cache_wback_inv)(unsigned lo
+ void (*_dma_cache_wback)(unsigned long start, unsigned long size);
+ void (*_dma_cache_inv)(unsigned long start, unsigned long size);
+ 
++EXPORT_SYMBOL(_dma_cache_wback_inv);
++EXPORT_SYMBOL(_dma_cache_inv);
++
+ #endif /* CONFIG_DMA_NONCOHERENT */
+ 
+ /*



From lede-commits at lists.infradead.org  Fri Feb  3 03:15:23 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 06:15:23 -0500
Subject: [openwrt/openwrt]  firmware-utils: bump to git HEAD
In-Reply-To: <167542292305.1906257.11155378930181699238@git-01.infra.openwrt.org>
References: <167542292305.1906257.11155378930181699238@git-01.infra.openwrt.org>
Message-ID: <mailman.12114.1675422927.3064139.lede-commits@lists.infradead.org>

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

commit c97bcec15a6f524089ffe17ad2435d107867da35
Author: Mark Ceeha <hi at shiz.me>
AuthorDate: Sun Jan 8 03:29:07 2023 +0100

    firmware-utils: bump to git HEAD
    
    Adds support for building TP-Link Deco M4R v4 factory images
    
        e7233d229c2c tplink-safeloader: Add support for Deco M4R V4
    
    Signed-off-by: Mark Ceeha <hi at shiz.me>
---
 tools/firmware-utils/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/firmware-utils/Makefile b/tools/firmware-utils/Makefile
index 1c47a3109a..3b94af20a8 100644
--- a/tools/firmware-utils/Makefile
+++ b/tools/firmware-utils/Makefile
@@ -11,9 +11,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/firmware-utils.git
-PKG_SOURCE_DATE:=2022-12-15
-PKG_SOURCE_VERSION:=bd856eff48509fa4511169ee55f639ede8dd4ac6
-PKG_MIRROR_HASH:=4dc754b403b10f43dc2871f17ef7b223c85ad3b14c57899497f0b6bb304756d9
+PKG_SOURCE_DATE:=2023-01-29
+PKG_SOURCE_VERSION:=e7233d229c2c204563a8c70231b34ebb2a197400
+PKG_MIRROR_HASH:=06ef2351187c3c4ee164099c1f50f83dfb5f56ed2aec0db8e1db20efb2c157d5
 
 include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/cmake.mk



From lede-commits at lists.infradead.org  Fri Feb  3 03:15:24 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 06:15:24 -0500
Subject: [openwrt/openwrt]  ramips: add support for TP-Link Deco M4R v4
In-Reply-To: <167542292305.1906257.11155378930181699238@git-01.infra.openwrt.org>
References: <167542292305.1906257.11155378930181699238@git-01.infra.openwrt.org>
Message-ID: <mailman.12115.1675422927.3064139.lede-commits@lists.infradead.org>

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

commit d4c63c77866bf09668b541760b6c9f277b41ac87
Author: Mark Ceeha <hi at shiz.me>
AuthorDate: Sun Jan 29 16:01:40 2023 +0100

    ramips: add support for TP-Link Deco M4R v4
    
    This commit adds support for the V4 hardware revision of the Deco M4R.
    V4 is a complete overhaul of the hardware compared to V1 and V2,
    and is much more similar to the Archer C6 V3 and C6U V1.
    
    Specifications:
    
      SoC: MediaTek MT7621AT (2 cores at 880 MHz, 4 threads)
      RAM: Kingston D1216ECMDXGJD (256 MB)
      Wireless 2.4 GHz: MediaTek MT7603EN
      Wireless 5 GHz: MediaTek MT7613BEN
      Flash: 16 MB SPI NOR
    
    Installation:
    
    Flash the *-factory.bin image in the U-Boot recovery webserver.
    You can trigger this webserver by holding the reset button until the LED
    flashes yellow, or by hooking up to serial pads on the board (clearly
    labeled GND, RX and TX) and pressing `x` early in boot.
    
    Once the factory image has been flashed, you can use the regular upgrade
    procedure with sysupgrade images for subsequent flashes.
    
    Signed-off-by: Mark Ceeha <hi at shiz.me>
    Tested-by: Mark Ceeha <hi at shiz.me>
---
 .../linux/ramips/dts/mt7621_tplink_deco-m4r-v4.dts | 203 +++++++++++++++++++++
 target/linux/ramips/image/mt7621.mk                |  12 ++
 .../ramips/mt7621/base-files/etc/board.d/01_leds   |   3 +
 .../mt7621/base-files/etc/board.d/02_network       |   3 +
 4 files changed, 221 insertions(+)

diff --git a/target/linux/ramips/dts/mt7621_tplink_deco-m4r-v4.dts b/target/linux/ramips/dts/mt7621_tplink_deco-m4r-v4.dts
new file mode 100644
index 0000000000..3d17dbf599
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_tplink_deco-m4r-v4.dts
@@ -0,0 +1,203 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "tplink,deco-m4r-v4", "mediatek,mt7621-soc";
+	model = "TP-Link Deco M4R v4";
+
+	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 1 GPIO_ACTIVE_LOW>;
+			debounce-interval = <60>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+
+		led {
+			label = "led";
+			gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
+			debounce_interval = <60>;
+			linux,code = <KEY_BRIGHTNESS_TOGGLE>;
+		};
+
+		reset {
+			label = "reset";
+			gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
+			debounce-interval = <60>;
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		rssi {
+			label = "green:rssi";
+			gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
+		};
+
+		lan {
+			label = "green:lan";
+			gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
+		};
+
+		sys {
+			label = "green:sys";
+			gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
+		};
+
+		wifi2g {
+			label = "green:wifi2g";
+			gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy0tpt";
+		};
+
+		logo_red {
+			label = "red:logo";
+			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+			/* match usage in v1 and v2 */
+			linux,default-trigger = "phy0tpt";
+		};
+
+		logo_blue {
+			label = "blue:logo";
+			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+			/* match usage in v1 and v2 */
+			linux,default-trigger = "phy1tpt";
+
+		};
+
+		led_power: logo_green {
+			label = "green:logo";
+			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+			/* match usage in v1 and v2 */
+			default_state = "on";
+		};
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "i2c", "uart2", "uart3", "jtag", "wdt";
+		function = "gpio";
+	};
+};
+
+&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 0x010000>;
+				read-only;
+
+				compatible = "nvmem-cells";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				macaddr_config_8: macaddr at 8 {
+					reg = <0x8 0x6>;
+				};
+			};
+
+			partition at fb0000 {
+				label = "tplink";
+				reg = <0xfb0000 0x040000>;
+				read-only;
+			};
+
+			radio: partition at ff0000 {
+				label = "radio";
+				reg = <0xff0000 0x10000>;
+				read-only;
+			};
+		};
+	};
+};
+
+&ethernet {
+	pinctrl-names = "default";
+	pinctrl-0 = <&rgmii1_pins &mdio_pins>;
+};
+
+&gmac0 {
+	nvmem-cells = <&macaddr_config_8>;
+	nvmem-cell-names = "mac-address";
+	label = "dsa";
+};
+
+&switch0 {
+	ports {
+		port at 0 {
+			status = "okay";
+			label = "eth0";
+		};
+
+		port at 1 {
+			status = "okay";
+			label = "eth1";
+		};
+	};
+};
+
+&pcie {
+	status = "okay";
+};
+
+&pcie0 {
+	wifi at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&radio 0x0>;
+		ieee80211-freq-limit = <2400000 2500000>;
+	};
+};
+
+&pcie1 {
+	wifi at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&radio 0x8000>;
+		ieee80211-freq-limit = <5000000 6000000>;
+	};
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 3587fb613a..7f4f338039 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -2014,6 +2014,18 @@ define Device/tplink_archer-c6u-v1
 endef
 TARGET_DEVICES += tplink_archer-c6u-v1
 
+define Device/tplink_deco-m4r-v4
+  $(Device/dsa-migration)
+  $(Device/tplink-safeloader)
+  DEVICE_MODEL := Deco M4R
+  DEVICE_VARIANT := v4
+  DEVICE_PACKAGES := kmod-mt7603 kmod-mt7615e kmod-mt7663-firmware-ap
+  KERNEL := $(KERNEL_DTB) | uImage lzma
+  TPLINK_BOARD_ID := DECO-M4R-V4
+  IMAGE_SIZE := 15744k
+endef
+TARGET_DEVICES += tplink_deco-m4r-v4
+
 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 597d7302ac..66b5a3ddd0 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
@@ -154,6 +154,9 @@ tplink,archer-c6u-v1)
 	ucidef_set_led_netdev "lan" "LAN" "green:lan" "br-lan"
 	ucidef_set_led_netdev "wan" "WAN" "green:wan" "wan"
 	;;
+tplink,deco-m4r-v4)
+	ucidef_set_led_netdev "lan" "LAN" "green:lan" "br-lan"
+	;;
 tplink,ec330-g5u-v1)
 	ucidef_set_led_netdev "lan" "Ethernet" "blue:ethernet" "br-lan" "link tx rx"
 	ucidef_set_led_netdev "wan" "Internet" "blue:internet" "wan" "link tx rx"
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 67f58b10b2..3a864f6f04 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
@@ -105,6 +105,9 @@ ramips_setup_interfaces()
 	mikrotik,routerboard-760igs)
 		ucidef_set_interfaces_lan_wan "lan2 lan3 lan4 lan5" "wan sfp"
 		;;
+	tplink,deco-m4r-v4)
+		ucidef_set_interfaces_lan_wan "eth1" "eth0"
+		;;
 	tplink,eap235-wall-v1|\
 	tplink,eap615-wall-v1)
 		ucidef_set_interface_lan "lan0 lan1 lan2 lan3"



From lede-commits at lists.infradead.org  Fri Feb  3 03:20:27 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 06:20:27 -0500
Subject: [openwrt/openwrt]  wolfssl: fix build with make < 4.2
In-Reply-To: <167542322727.1912578.5500115043832894607@git-01.infra.openwrt.org>
References: <167542322727.1912578.5500115043832894607@git-01.infra.openwrt.org>
Message-ID: <mailman.12116.1675423232.3064139.lede-commits@lists.infradead.org>

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

commit fcde517d35c8591cbb578b1a7a49a0446b1ac646
Author: Chen Minqiang <ptpt52 at gmail.com>
AuthorDate: Wed Jan 25 07:55:12 2023 +0800

    wolfssl: fix build with make < 4.2
    
    Inline the preinst.arm-ce script. Support for including was added in
    make 4.2 and is not working with older make versions.
    
    Fixes: https://github.com/openwrt/openwrt/issues/11866
    Signed-off-by: Chen Minqiang <ptpt52 at gmail.com>
---
 package/libs/wolfssl/Makefile       | 31 ++++++++++++++++++++++++++++---
 package/libs/wolfssl/preinst.arm-ce | 25 -------------------------
 2 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile
index 1500a2cda7..6ad44a9acf 100644
--- a/package/libs/wolfssl/Makefile
+++ b/package/libs/wolfssl/Makefile
@@ -151,6 +151,33 @@ CONFIGURE_ARGS += \
 	--$(if $(CONFIG_WOLFSSL_HAS_ECC448),enable,disable)-curve448 \
 	--$(if $(CONFIG_WOLFSSL_HAS_OPENVPN),enable,disable)-openvpn
 
+define Package/libwolfsslcpu-crypto/preinst-aarch64
+#!/bin/sh
+exec >&2
+printf "[libwolfsslcpu-crypto] Checking for Arm v8-A Cryptographic Extension support: "
+if [ -n "$${IPKG_INSTROOT}" ]; then
+    printf "...[offline]... "
+    eval "$$(grep '^DISTRIB_TARGET=' "$${IPKG_INSTROOT}/etc/openwrt_release")"
+    echo "$${DISTRIB_TARGET}" | grep '^bcm27xx/.*' > /dev/null && {
+	echo "not supported"
+	echo "Error: Target $${DISTRIB_TARGET} does not support Arm Cryptographic Extension."
+	echo "Install the regular libwolfssl package instead of libwolfsslcpu-crypto."
+	exit 1
+    }
+else
+    grep -q '^Features.*\baes\b' /proc/cpuinfo || {
+	echo "not supported"
+	echo "Error: Arm v8-A Cryptographic Extension not supported."
+	echo "Install the regular libwolfssl package instead of libwolfsslcpu-crypto."
+	echo "Contents of /proc/cpuinfo:"
+	cat /proc/cpuinfo
+	exit 1
+    }
+fi
+echo OK
+exit 0
+endef
+
 ifeq ($(BUILD_VARIANT),regular)
 CONFIGURE_ARGS += \
 	--$(if $(CONFIG_WOLFSSL_HAS_AFALG),enable,disable)-afalg \
@@ -160,9 +187,7 @@ CONFIGURE_ARGS += \
 else ifdef CONFIG_aarch64
     CONFIGURE_ARGS += --enable-armasm
     TARGET_CFLAGS:=$(TARGET_CFLAGS:-mcpu%=-mcpu%+crypto)
-    WOLFSSL_NOASM_REGEX:=^bcm27xx/.*
-    Package/libwolfsslcpu-crypto/preinst=\
-	$(subst @@WOLFSSL_NOASM_REGEX@@,$(WOLFSSL_NOASM_REGEX),$(file <preinst.arm-ce))
+    Package/libwolfsslcpu-crypto/preinst=$(Package/libwolfsslcpu-crypto/preinst-aarch64)
 else ifdef CONFIG_TARGET_x86_64
 	CONFIGURE_ARGS += --enable-intelasm
 endif
diff --git a/package/libs/wolfssl/preinst.arm-ce b/package/libs/wolfssl/preinst.arm-ce
deleted file mode 100644
index d6e2996269..0000000000
--- a/package/libs/wolfssl/preinst.arm-ce
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/sh
-exec >&2
-printf "[libwolfsslcpu-crypto] Checking for Arm v8-A Cryptographic Extension support: "
-if [ -n "${IPKG_INSTROOT}" ]; then
-    printf "...[offline]... "
-    eval "$(grep '^DISTRIB_TARGET=' "${IPKG_INSTROOT}/etc/openwrt_release")"
-    ### @@WOLFSSL_NOASM_REGEX@@ is expanded from WOLFSSL_NOASM_REGEX in the Makefile
-    echo "${DISTRIB_TARGET}" | grep '@@WOLFSSL_NOASM_REGEX@@' > /dev/null && {
-	echo "not supported"
-	echo "Error: Target ${DISTRIB_TARGET} does not support Arm Cryptographic Extension."
-	echo "Install the regular libwolfssl package instead of libwolfsslcpu-crypto."
-	exit 1
-    }
-else
-    grep -q '^Features.*\baes\b' /proc/cpuinfo || {
-	echo "not supported"
-	echo "Error: Arm v8-A Cryptographic Extension not supported."
-	echo "Install the regular libwolfssl package instead of libwolfsslcpu-crypto."
-	echo "Contents of /proc/cpuinfo:"
-	cat /proc/cpuinfo
-	exit 1
-    }
-fi
-echo OK
-exit 0



From lede-commits at lists.infradead.org  Fri Feb  3 03:51:57 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 06:51:57 -0500
Subject: [openwrt/openwrt]  treewide: strip useless `default n` Kconfig lines
In-Reply-To: <167542511763.1934536.5117548275374126585@git-01.infra.openwrt.org>
References: <167542511763.1934536.5117548275374126585@git-01.infra.openwrt.org>
Message-ID: <mailman.12121.1675425125.3064139.lede-commits@lists.infradead.org>

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

commit 8bc72ea7be3976711dacc09f0fdab061d6e5152a
Author: Tony Butler <spudz76 at gmail.com>
AuthorDate: Sun Dec 25 15:11:48 2022 -0800

    treewide: strip useless `default n` Kconfig lines
    
    Kconfig docs say:
    > The default value deliberately defaults to 'n' in order to avoid
    > bloating the build.
    
    Apply this rule everywhere, to avoid more cloning of bad examples
    
    Signed-off-by: Tony Butler <spudz76 at gmail.com>
---
 config/Config-build.in                             |  9 ----
 config/Config-devel.in                             |  5 ---
 config/Config-images.in                            |  4 --
 config/Config-kernel.in                            | 49 ----------------------
 target/linux/at91/image/Config.in                  |  2 -
 .../drivers/net/ethernet/atheros/ag71xx/Kconfig    |  2 -
 .../generic/files/drivers/mtd/mtdsplit/Kconfig     |  1 -
 .../files/drivers/platform/mikrotik/Kconfig        |  1 -
 target/sdk/files/Config.in                         |  5 ---
 toolchain/Config.in                                |  2 -
 toolchain/gcc/Config.in                            |  5 ---
 11 files changed, 85 deletions(-)

diff --git a/config/Config-build.in b/config/Config-build.in
index c2303637cb..8c81ef654c 100644
--- a/config/Config-build.in
+++ b/config/Config-build.in
@@ -5,7 +5,6 @@
 
 config EXPERIMENTAL
 	bool "Enable experimental features by default"
-	default n
 	help
 	  Set this option to build with latest bleeding edge features
 	  which may or may not work as expected.
@@ -42,7 +41,6 @@ menu "Global build settings"
 
 	config BUILDBOT
 		bool "Set build defaults for automatic builds (e.g. via buildbot)"
-		default n
 		help
 		  This option changes several defaults to be more suitable for
 		  automatic builds. This includes the following changes:
@@ -75,10 +73,8 @@ menu "Global build settings"
 
 	config DISPLAY_SUPPORT
 		bool "Show packages that require graphics support (local or remote)"
-		default n
 
 	config BUILD_PATENTED
-		default n
 		bool "Compile with support for patented functionality"
 		help
 		  When this option is disabled, software which provides patented functionality
@@ -86,7 +82,6 @@ menu "Global build settings"
 		  functionality, this optional support will get disabled for this package.
 
 	config BUILD_NLS
-		default n
 		bool "Compile with full language support"
 		help
 		  When this option is enabled, packages are built with the full versions of
@@ -100,7 +95,6 @@ menu "Global build settings"
 	config CLEAN_IPKG
 		bool
 		prompt "Remove ipkg/opkg status data files in final images"
-		default n
 		help
 		  This removes all ipkg/opkg status data files from the target directory
 		  before building the root filesystem.
@@ -108,14 +102,12 @@ menu "Global build settings"
 	config IPK_FILES_CHECKSUMS
 		bool
 		prompt "Record files checksums in package metadata"
-		default n
 		help
 		  This makes file checksums part of package metadata. It increases size
 		  but provides you with pkg_check command to check for flash corruptions.
 
 	config INCLUDE_CONFIG
 		bool "Include build configuration in firmware" if DEVEL
-		default n
 		help
 		  If enabled, buildinfo files will be stored in /etc/build.* of firmware.
 
@@ -149,7 +141,6 @@ menu "Global build settings"
 	config DEBUG
 		bool
 		prompt "Compile packages with debugging info"
-		default n
 		help
 		  Adds -g3 to the CFLAGS.
 
diff --git a/config/Config-devel.in b/config/Config-devel.in
index e16e6ecaab..cbac91c09d 100644
--- a/config/Config-devel.in
+++ b/config/Config-devel.in
@@ -4,11 +4,9 @@
 
 menuconfig DEVEL
 	bool "Advanced configuration options (for developers)"
-	default n
 
 	config BROKEN
 		bool "Show broken platforms / packages / devices" if DEVEL
-		default n
 
 	config BINARY_FOLDER
 		string "Binary folder" if DEVEL
@@ -53,7 +51,6 @@ menuconfig DEVEL
 
 	config AUTOREMOVE
 		bool "Automatic removal of build directories" if DEVEL
-		default n
 		help
 		  Automatically delete build directories after make target completed.
 		  This allows you to symlink build_dir into a scratch location, e.g. a ramdisk,
@@ -61,7 +58,6 @@ menuconfig DEVEL
 
 	config BUILD_ALL_HOST_TOOLS
 		bool "Compile all host tools" if DEVEL
-		default n
 		help
 		  Compile all host host tools even if not needed. This is needed to prepare a
 		  universal precompiled host tools archive to use in another buildroot.
@@ -84,7 +80,6 @@ menuconfig DEVEL
 
 	config CCACHE
 		bool "Use ccache" if DEVEL
-		default n
 		help
 		  Compiler cache; see https://ccache.samba.org/
 
diff --git a/config/Config-images.in b/config/Config-images.in
index 6e43793ef5..0768c5a483 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -59,7 +59,6 @@ menu "Target Images"
 		config TARGET_INITRAMFS_FORCE
 			bool "Force"
 			depends on TARGET_ROOTFS_INITRAMFS
-			default n
 			help
 			  Ignore the initramfs passed by the bootloader.
 
@@ -128,7 +127,6 @@ menu "Target Images"
 		config TARGET_EXT4_JOURNAL
 			bool "Create a journaling filesystem"
 			depends on TARGET_ROOTFS_EXT4FS
-			default n
 			help
 			  Create an ext4 filesystem with a journal.
 
@@ -233,7 +231,6 @@ menu "Target Images"
 	config GRUB_FLOWCONTROL
 		bool "Use RTE/CTS on serial console"
 		depends on GRUB_SERIAL != ""
-		default n
 
 	config GRUB_BOOTOPTS
 		string "Extra kernel boot options"
@@ -312,7 +309,6 @@ menu "Target Images"
 
 	config TARGET_ROOTFS_PERSIST_VAR
 		bool "Make /var persistent"
-		default n
 		help
 		  Do not symlink /var to /tmp, so that its content will persist
 		  across reboots. When enabled, /var/run will still be linked
diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index 81b76179a5..500f72672d 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -47,12 +47,10 @@ config KERNEL_MIPS_FP_SUPPORT
 
 config KERNEL_ARM_PMU
 	bool
-	default n
 	depends on (arm || aarch64)
 
 config KERNEL_X86_VSYSCALL_EMULATION
 	bool "Enable vsyscall emulation"
-	default n
 	depends on x86_64
 	help
 	  This enables emulation of the legacy vsyscall page.  Disabling
@@ -70,12 +68,10 @@ config KERNEL_X86_VSYSCALL_EMULATION
 
 config KERNEL_PERF_EVENTS
 	bool "Compile the kernel with performance events and counters"
-	default n
 	select KERNEL_ARM_PMU if (arm || aarch64)
 
 config KERNEL_PROFILING
 	bool "Compile the kernel with profiling enabled"
-	default n
 	select KERNEL_PERF_EVENTS
 	help
 	  Enable the extended profiling support mechanisms used by profilers such
@@ -255,7 +251,6 @@ config KERNEL_KCOV_INSTRUMENT_ALL
 
 config KERNEL_TASKSTATS
 	bool "Compile the kernel with task resource/io statistics and accounting"
-	default n
 	help
 	  Enable the collection and publishing of task/io statistics and
 	  accounting.  Enable this option to enable i/o monitoring in system
@@ -283,37 +278,30 @@ config KERNEL_KALLSYMS
 config KERNEL_FTRACE
 	bool "Compile the kernel with tracing support"
 	depends on !TARGET_uml
-	default n
 
 config KERNEL_FTRACE_SYSCALLS
 	bool "Trace system calls"
 	depends on KERNEL_FTRACE
-	default n
 
 config KERNEL_ENABLE_DEFAULT_TRACERS
 	bool "Trace process context switches and events"
 	depends on KERNEL_FTRACE
-	default n
 
 config KERNEL_FUNCTION_TRACER
 	bool "Function tracer"
 	depends on KERNEL_FTRACE
-	default n
 
 config KERNEL_FUNCTION_GRAPH_TRACER
 	bool "Function graph tracer"
 	depends on KERNEL_FUNCTION_TRACER
-	default n
 
 config KERNEL_DYNAMIC_FTRACE
 	bool "Enable/disable function tracing dynamically"
 	depends on KERNEL_FUNCTION_TRACER
-	default n
 
 config KERNEL_FUNCTION_PROFILER
 	bool "Function profiler"
 	depends on KERNEL_FUNCTION_TRACER
-	default n
 
 config KERNEL_IRQSOFF_TRACER
 	bool "Interrupts-off Latency Tracer"
@@ -364,7 +352,6 @@ config KERNEL_HIST_TRIGGERS
 
 config KERNEL_DEBUG_KERNEL
 	bool
-	default n
 
 config KERNEL_DEBUG_INFO
 	bool "Compile the kernel with debug information"
@@ -376,7 +363,6 @@ config KERNEL_DEBUG_INFO
 config KERNEL_DEBUG_INFO_BTF
 
 	bool "Enable additional BTF type information"
-	default n
 	depends on !HOST_OS_MACOS
 	depends on KERNEL_DEBUG_INFO && !KERNEL_DEBUG_INFO_REDUCED
 	select DWARVES
@@ -403,12 +389,10 @@ config KERNEL_DEBUG_INFO_REDUCED
 
 config KERNEL_DEBUG_LL_UART_NONE
 	bool
-	default n
 	depends on arm
 
 config KERNEL_DEBUG_LL
 	bool
-	default n
 	depends on arm
 	select KERNEL_DEBUG_LL_UART_NONE
 	help
@@ -417,7 +401,6 @@ config KERNEL_DEBUG_LL
 config KERNEL_DEBUG_VIRTUAL
 	bool "Compile the kernel with VM translations debugging"
 	select KERNEL_DEBUG_KERNEL
-	default n
 	help
 	  Enable checks sanity checks to catch invalid uses of
 	  virt_to_phys()/phys_to_virt() against the non-linear address space.
@@ -425,7 +408,6 @@ config KERNEL_DEBUG_VIRTUAL
 config KERNEL_DYNAMIC_DEBUG
 	bool "Compile the kernel with dynamic printk"
 	select KERNEL_DEBUG_FS
-	default n
 	help
 	  Compiles debug level messages into the kernel, which would not
 	  otherwise be available at runtime. These messages can then be
@@ -437,7 +419,6 @@ config KERNEL_DYNAMIC_DEBUG
 config KERNEL_EARLY_PRINTK
 	bool "Compile the kernel with early printk"
 	default y if TARGET_bcm53xx
-	default n
 	depends on arm
 	select KERNEL_DEBUG_KERNEL
 	select KERNEL_DEBUG_LL if arm
@@ -448,7 +429,6 @@ config KERNEL_EARLY_PRINTK
 
 config KERNEL_KPROBES
 	bool "Compile the kernel with kprobes support"
-	default n
 	select KERNEL_FTRACE
 	select KERNEL_PERF_EVENTS
 	help
@@ -465,7 +445,6 @@ config KERNEL_KPROBE_EVENTS
 
 config KERNEL_BPF_EVENTS
 	bool "Compile the kernel with BPF event support"
-	default n
 	select KERNEL_KPROBES
 	help
 	  Allows to attach BPF programs to kprobe, uprobe and tracepoint events.
@@ -475,7 +454,6 @@ config KERNEL_BPF_EVENTS
 
 config KERNEL_BPF_KPROBE_OVERRIDE
 	bool
-	default n
 	depends on KERNEL_KPROBES
 
 config KERNEL_AIO
@@ -496,7 +474,6 @@ config KERNEL_FANOTIFY
 
 config KERNEL_BLK_DEV_BSG
 	bool "Compile the kernel with SCSI generic v4 support for any block device"
-	default n
 
 config KERNEL_TRANSPARENT_HUGEPAGE
 	bool
@@ -520,7 +497,6 @@ config KERNEL_HUGETLB_PAGE
 	bool "Compile the kernel with HugeTLB support"
 	select KERNEL_TRANSPARENT_HUGEPAGE
 	select KERNEL_HUGETLBFS
-	default n
 
 config KERNEL_MAGIC_SYSRQ
 	bool "Compile the kernel with SysRq support"
@@ -545,7 +521,6 @@ config KERNEL_ELF_CORE
 config KERNEL_PROVE_LOCKING
 	bool "Enable kernel lock checking"
 	select KERNEL_DEBUG_KERNEL
-	default n
 
 config KERNEL_SOFTLOCKUP_DETECTOR
 	bool "Compile the kernel with detect Soft Lockups"
@@ -647,11 +622,9 @@ config USE_RFKILL
 
 config USE_SPARSE
 	bool "Enable sparse check during kernel build"
-	default n
 
 config KERNEL_DEVTMPFS
 	bool "Compile the kernel with device tmpfs enabled"
-	default n
 	help
 	  devtmpfs is a simple, kernel-managed /dev filesystem. The kernel creates
 	  devices nodes for all registered devices to simplify boot, but leaves more
@@ -661,7 +634,6 @@ if KERNEL_DEVTMPFS
 
 	config KERNEL_DEVTMPFS_MOUNT
 		bool "Automatically mount devtmpfs after root filesystem is mounted"
-		default n
 
 endif
 
@@ -672,17 +644,14 @@ config KERNEL_KEYS
 config KERNEL_PERSISTENT_KEYRINGS
 	bool "Enable kernel persistent keyrings"
 	depends on KERNEL_KEYS
-	default n
 
 config KERNEL_KEYS_REQUEST_CACHE
 	bool "Enable temporary caching of the last request_key() result"
 	depends on KERNEL_KEYS
-	default n
 
 config KERNEL_BIG_KEYS
 	bool "Enable large payload keys on kernel keyrings"
 	depends on KERNEL_KEYS
-	default n
 
 #
 # CGROUP support symbols
@@ -696,7 +665,6 @@ if KERNEL_CGROUPS
 
 	config KERNEL_CGROUP_DEBUG
 		bool "Example debug cgroup subsystem"
-		default n
 		help
 		  This option enables a simple cgroup subsystem that
 		  exports useful debugging information about the cgroups
@@ -707,7 +675,6 @@ if KERNEL_CGROUPS
 
 	config KERNEL_CGROUP_FREEZER
 		bool "legacy Freezer cgroup subsystem"
-		default n
 		select KERNEL_FREEZER
 		help
 		  Provides a way to freeze and unfreeze all tasks in a
@@ -717,7 +684,6 @@ if KERNEL_CGROUPS
 
 	config KERNEL_CGROUP_DEVICE
 		bool "legacy Device controller for cgroups"
-		default n
 		help
 		  Provides a cgroup implementing whitelists for devices which
 		  a process in the cgroup can mknod or open.
@@ -725,7 +691,6 @@ if KERNEL_CGROUPS
 
 	config KERNEL_CGROUP_HUGETLB
 		bool "HugeTLB controller"
-		default n
 		select KERNEL_HUGETLB_PAGE
 
 	config KERNEL_CGROUP_PIDS
@@ -754,7 +719,6 @@ if KERNEL_CGROUPS
 
 	config KERNEL_PROC_PID_CPUSET
 		bool "Include legacy /proc/<pid>/cpuset file"
-		default n
 		depends on KERNEL_CPUSETS
 
 	config KERNEL_CGROUP_CPUACCT
@@ -820,7 +784,6 @@ if KERNEL_CGROUPS
 
 	config KERNEL_MEMCG_SWAP_ENABLED
 		bool "Memory Resource Controller Swap Extension enabled by default"
-		default n
 		depends on KERNEL_MEMCG_SWAP
 		help
 		  Memory Resource Controller Swap Extension comes with its price in
@@ -849,7 +812,6 @@ if KERNEL_CGROUPS
 	config KERNEL_CGROUP_PERF
 		bool "Enable perf_event per-cpu per-container group (cgroup) monitoring"
 		select KERNEL_PERF_EVENTS
-		default n
 		help
 		  This option extends the per-cpu mode to restrict monitoring to
 		  threads which belong to the cgroup specified and run on the
@@ -926,7 +888,6 @@ if KERNEL_CGROUPS
 
 	config KERNEL_DEBUG_BLK_CGROUP
 		bool "Enable Block IO controller debugging"
-		default n
 		depends on KERNEL_BLK_CGROUP
 		help
 		  Enable some debugging help. Currently it exports additional stat
@@ -934,15 +895,12 @@ if KERNEL_CGROUPS
 
 	config KERNEL_NET_CLS_CGROUP
 		bool "legacy Control Group Classifier"
-		default n
 
 	config KERNEL_CGROUP_NET_CLASSID
 		bool "legacy Network classid cgroup"
-		default n
 
 	config KERNEL_CGROUP_NET_PRIO
 		bool "legacy Network priority cgroup"
-		default n
 
 endif
 
@@ -1168,7 +1126,6 @@ endif
 menu "Filesystem ACL and attr support options"
 	config USE_FS_ACL_ATTR
 		bool "Use filesystem ACL and attr support by default"
-		default n
 		help
 		  Make using ACLs (e.g. POSIX ACL, NFSv4 ACL) the default
 		  for kernel and packages, except tmpfs, flash filesystems,
@@ -1193,17 +1150,14 @@ menu "Filesystem ACL and attr support options"
 	config KERNEL_F2FS_FS_POSIX_ACL
 		bool "Enable POSIX ACL for F2FS Filesystems"
 		select KERNEL_FS_POSIX_ACL
-		default n
 
 	config KERNEL_JFFS2_FS_POSIX_ACL
 		bool "Enable POSIX ACL for JFFS2 Filesystems"
 		select KERNEL_FS_POSIX_ACL
-		default n
 
 	config KERNEL_TMPFS_POSIX_ACL
 		bool "Enable POSIX ACL for TMPFS Filesystems"
 		select KERNEL_FS_POSIX_ACL
-		default n
 
 	config KERNEL_CIFS_ACL
 		bool "Enable CIFS ACLs"
@@ -1226,15 +1180,12 @@ menu "Filesystem ACL and attr support options"
 
 	config KERNEL_NFS_V3_ACL_SUPPORT
 		bool "Enable ACLs for NFSv3"
-		default n
 
 	config KERNEL_NFSD_V2_ACL_SUPPORT
 		bool "Enable ACLs for NFSDv2"
-		default n
 
 	config KERNEL_NFSD_V3_ACL_SUPPORT
 		bool "Enable ACLs for NFSDv3"
-		default n
 
 	config KERNEL_REISER_FS_POSIX_ACL
 		bool "Enable POSIX ACLs for ReiserFS"
diff --git a/target/linux/at91/image/Config.in b/target/linux/at91/image/Config.in
index 596accaa49..ae559edca1 100644
--- a/target/linux/at91/image/Config.in
+++ b/target/linux/at91/image/Config.in
@@ -1,10 +1,8 @@
 config AT91_DFBOOT
 	bool "Build dataflashboot loader"
 	depends on TARGET_at91
-	default n
 
 config FLEXIBITY_ROOT
 	bool "Build Flexibity RootFS (with embedded kernel)"
 	depends on TARGET_at91_flexibity
-	default n
 
diff --git a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/Kconfig b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/Kconfig
index 4df2d21e34..dfcedcf70e 100644
--- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/Kconfig
+++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/Kconfig
@@ -10,14 +10,12 @@ if AG71XX
 
 config AG71XX_DEBUG
 	bool "Atheros AR71xx built-in ethernet driver debugging"
-	default n
 	help
 	  Atheros AR71xx built-in ethernet driver debugging messages.
 
 config AG71XX_DEBUG_FS
 	bool "Atheros AR71xx built-in ethernet driver debugfs support"
 	depends on DEBUG_FS
-	default n
 	help
 	  Say Y, if you need access to various statistics provided by
 	  the ag71xx driver.
diff --git a/target/linux/generic/files/drivers/mtd/mtdsplit/Kconfig b/target/linux/generic/files/drivers/mtd/mtdsplit/Kconfig
index f929c6153e..f1864d8fdb 100644
--- a/target/linux/generic/files/drivers/mtd/mtdsplit/Kconfig
+++ b/target/linux/generic/files/drivers/mtd/mtdsplit/Kconfig
@@ -12,7 +12,6 @@ config MTD_SPLIT_SQUASHFS_ROOT
 	bool "Squashfs based root partition parser"
 	depends on MTD_SPLIT_SUPPORT
 	select MTD_SPLIT
-	default n
 	help
 	  This provides a parsing function which allows to detect the
 	  offset and size of the unused portion of a rootfs partition
diff --git a/target/linux/generic/files/drivers/platform/mikrotik/Kconfig b/target/linux/generic/files/drivers/platform/mikrotik/Kconfig
index 7499ba1e1c..1dc027815a 100644
--- a/target/linux/generic/files/drivers/platform/mikrotik/Kconfig
+++ b/target/linux/generic/files/drivers/platform/mikrotik/Kconfig
@@ -1,6 +1,5 @@
 menuconfig MIKROTIK
 	bool "Platform support for MikroTik RouterBoard virtual devices"
-	default n
 	help
 	  Say Y here to get to see options for the MikroTik RouterBoard platform.
 	  This option alone does not add any kernel code.
diff --git a/target/sdk/files/Config.in b/target/sdk/files/Config.in
index 12c0f6a624..7926e12426 100644
--- a/target/sdk/files/Config.in
+++ b/target/sdk/files/Config.in
@@ -23,7 +23,6 @@ menu "Global build settings"
 	config DEBUG
 		bool
 		prompt "Compile packages with debugging info"
-		default n
 		help
 		  Adds -g3 to the CFLAGS.
 
@@ -69,7 +68,6 @@ menu "Advanced configuration options (for developers)"
 
 	config BROKEN
 		bool "Show broken packages"
-		default n
 
 	config DOWNLOAD_FOLDER
 		string "Download folder"
@@ -101,19 +99,16 @@ menu "Advanced configuration options (for developers)"
 
 	config CCACHE
 		bool "Use ccache"
-		default n
 		help
 		  Compiler cache; see https://ccache.samba.org/
 
 	config BUILD_LOG
 		bool "Enable log files during build process"
-		default n
 		help
 		  If enabled, log files will be written to the ./log directory.
 
 	config SRC_TREE_OVERRIDE
 		bool "Enable package source tree override"
-		default n
 		help
 		  If enabled, you can force a package to use a git tree as source
 		  code instead of the normal tarball. Create a symlink 'git-src'
diff --git a/toolchain/Config.in b/toolchain/Config.in
index 6d3cc0a200..b0273acafd 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -197,7 +197,6 @@ menuconfig EXTRA_TARGET_ARCH
 	bool
 	prompt "Enable an extra toolchain target architecture" if TOOLCHAINOPTS
 	depends on !sparc
-	default n
 	help
 	  Some builds may require a 'biarch' toolchain. This option
 	  allows you to specify an additional target arch.
@@ -252,7 +251,6 @@ config DWARVES
 	bool
 	prompt "Build pahole" if TOOLCHAINOPTS
 	depends on !HOST_OS_MACOS
-	default n
 	help
 	  Enable if you want to build pahole and the dwarves tools.
 
diff --git a/toolchain/gcc/Config.in b/toolchain/gcc/Config.in
index af4d54c73e..d150c9cc4b 100644
--- a/toolchain/gcc/Config.in
+++ b/toolchain/gcc/Config.in
@@ -27,21 +27,18 @@ config EXTRA_GCC_CONFIG_OPTIONS
 config GCC_DEFAULT_PIE
 	bool
 	prompt "Build executable with PIE enabled by default" if TOOLCHAINOPTS
-	default n
 	help
 	    Use gcc configure option --enable-default-pie to turn on -fPIE and -pie by default.
 
 config GCC_DEFAULT_SSP
 	bool
 	prompt "Build executable with Stack-Smashing Protection enabled by default" if TOOLCHAINOPTS
-	default n
 	help
 	    Use gcc configure option --enable-default-ssp to turn on -fstack-protector-strong by default.
 
 config SJLJ_EXCEPTIONS
 	bool
 	prompt "Use setjump()/longjump() exceptions" if TOOLCHAINOPTS
-	default n
 	help
 	    Use old setjump()/longjump() exceptions instead of the newer
 	    frame unwinding exceptions handling routines.  Warning: increases
@@ -50,7 +47,6 @@ config SJLJ_EXCEPTIONS
 config INSTALL_GFORTRAN
 	bool
 	prompt "Build/install fortran compiler?" if TOOLCHAINOPTS
-	default n
 	help
 	    Build/install GNU fortran compiler ?
 
@@ -58,6 +54,5 @@ config INSTALL_GCCGO
 	bool
 	prompt "Build/install Go compiler?" if TOOLCHAINOPTS
 	depends on USE_GLIBC || BROKEN
-	default n
 	help
 	    Build/install GNU gccgo compiler ?



From lede-commits at lists.infradead.org  Fri Feb  3 04:55:36 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 07:55:36 -0500
Subject: [openwrt/openwrt]  octeontx: add sqaushfs and ramdisk to features
In-Reply-To: <167542893652.1989535.12019671252949382412@git-01.infra.openwrt.org>
References: <167542893652.1989535.12019671252949382412@git-01.infra.openwrt.org>
Message-ID: <mailman.12162.1675428946.3064139.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/212c3ffdfcb311272c33a720a10ff53429602806

commit 212c3ffdfcb311272c33a720a10ff53429602806
Author: Tim Harvey <tharvey at gateworks.com>
AuthorDate: Wed Dec 28 13:38:15 2022 -0800

    octeontx: add sqaushfs and ramdisk to features
    
    Add squashfs and ramdisk to features as these are commonly used images
    for the octeontx.
    
    Signed-off-by: Tim Harvey <tharvey at gateworks.com>
    (cherry picked from commit af5635e6ca12d3be275560a58ac6e2793e218fcd)
---
 target/linux/octeontx/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/octeontx/Makefile b/target/linux/octeontx/Makefile
index eb90529740..03ab287bd5 100644
--- a/target/linux/octeontx/Makefile
+++ b/target/linux/octeontx/Makefile
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 ARCH:=aarch64
 BOARD:=octeontx
 BOARDNAME:=Octeon-TX
-FEATURES:=targz pcie gpio rtc usb fpu
+FEATURES:=squashfs ramdisk targz pcie gpio rtc usb fpu
 
 KERNEL_PATCHVER:=5.10
 



From lede-commits at lists.infradead.org  Fri Feb  3 05:18:05 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 08:18:05 -0500
Subject: [openwrt/openwrt]  base-files: upgrade: Fix export_partdevice()
 quoting
In-Reply-To: <167543027987.2011629.4552183492246240169@git-01.infra.openwrt.org>
References: <167543027987.2011629.4552183492246240169@git-01.infra.openwrt.org>
Message-ID: <mailman.12171.1675430284.3064139.lede-commits@lists.infradead.org>

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

commit 3cd882744d8ee347e7b55f113a95f93cfe7175cd
Author: Brian Norris <computersforpeace at gmail.com>
AuthorDate: Tue Dec 20 22:21:46 2022 -0800

    base-files: upgrade: Fix export_partdevice() quoting
    
    $BOOTDEV_MAJOR may be empty for many of the uevents parsed in this
    function. This condition thus tends to fail benignly (we just skip to
    the next device), but it can really clutter the stage2 sysupgrade
    stderr, since it looks like the "=" operand doesn't have an appropriate
    left-hand argument.
    
    Signed-off-by: Brian Norris <computersforpeace at gmail.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 53b8865a57..af1182cb16 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -232,7 +232,7 @@ export_partdevice() {
 		while read line; do
 			export -n "$line"
 		done < "$uevent"
-		if [ $BOOTDEV_MAJOR = $MAJOR -a $(($BOOTDEV_MINOR + $offset)) = $MINOR -a -b "/dev/$DEVNAME" ]; then
+		if [ "$BOOTDEV_MAJOR" = "$MAJOR" -a $(($BOOTDEV_MINOR + $offset)) = "$MINOR" -a -b "/dev/$DEVNAME" ]; then
 			export "$var=$DEVNAME"
 			return 0
 		fi



From lede-commits at lists.infradead.org  Fri Feb  3 05:18:02 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 08:18:02 -0500
Subject: [openwrt/openwrt]  kernel: modules: add lkdtm module
In-Reply-To: <167543027987.2011629.4552183492246240169@git-01.infra.openwrt.org>
References: <167543027987.2011629.4552183492246240169@git-01.infra.openwrt.org>
Message-ID: <mailman.12172.1675430286.3064139.lede-commits@lists.infradead.org>

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

commit ecafdfa894e73d2fd69a1e41bd089653e03fdae5
Author: Brian Norris <computersforpeace at gmail.com>
AuthorDate: Fri Jan 27 12:53:32 2023 -0800

    kernel: modules: add lkdtm module
    
    Useful for debugging panic/error handling, crash logging, and more.
    
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 package/kernel/linux/modules/other.mk | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk
index c5f944ed31..2bd15dfe67 100644
--- a/package/kernel/linux/modules/other.mk
+++ b/package/kernel/linux/modules/other.mk
@@ -243,6 +243,22 @@ endef
 $(eval $(call KernelPackage,gpio-f7188x))
 
 
+define KernelPackage/lkdtm
+  SUBMENU:=$(OTHER_MENU)
+  TITLE:=Linux Kernel Dump Test Tool Module
+  KCONFIG:=CONFIG_LKDTM
+  FILES:=$(LINUX_DIR)/drivers/misc/lkdtm/lkdtm.ko
+  AUTOLOAD:=$(call AutoProbe,lkdtm)
+endef
+
+define KernelPackage/lkdtm/description
+ This module enables testing of the different dumping mechanisms by inducing
+ system failures at predefined crash points.
+endef
+
+$(eval $(call KernelPackage,lkdtm))
+
+
 define KernelPackage/pinctrl-mcp23s08
   SUBMENU:=$(OTHER_MENU)
   TITLE:=Microchip MCP23xxx I/O expander



From lede-commits at lists.infradead.org  Fri Feb  3 05:18:06 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 08:18:06 -0500
Subject: [openwrt/openwrt]  ramips: mt7621-dts: fix phy-mode of external phy
 on GB-PC2
In-Reply-To: <167543027987.2011629.4552183492246240169@git-01.infra.openwrt.org>
References: <167543027987.2011629.4552183492246240169@git-01.infra.openwrt.org>
Message-ID: <mailman.12173.1675430286.3064139.lede-commits@lists.infradead.org>

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

commit 5155200f97adaeaaac7b752b5a6a5e41cba3db6a
Author: Ar?n? ?NAL <arinc.unal at arinc9.com>
AuthorDate: Tue Nov 29 00:33:37 2022 +0300

    ramips: mt7621-dts: fix phy-mode of external phy on GB-PC2
    
    The phy-mode property must be defined on the MAC instead of the PHY. Define
    phy-mode under gmac1 which the external phy is connected to.
    
    Tested-by: Petr Louda <petr.louda at outlook.cz>
    Signed-off-by: Ar?n? ?NAL <arinc.unal at arinc9.com>
---
 target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts b/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts
index 6199511cff..c18f102502 100644
--- a/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts
+++ b/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts
@@ -118,6 +118,7 @@
 &gmac1 {
 	status = "okay";
 	label = "ethyellow";
+	phy-mode = "rgmii-rxid";
 	phy-handle = <&ethphy5>;
 
 	nvmem-cells = <&macaddr_factory_e000>;
@@ -127,7 +128,6 @@
 &mdio {
 	ethphy5: ethernet-phy at 5 {
 		reg = <5>;
-		phy-mode = "rgmii-rxid";
 	};
 };
 



From lede-commits at lists.infradead.org  Fri Feb  3 05:18:03 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 08:18:03 -0500
Subject: [openwrt/openwrt]  ramips: mt7621-dts: fix compatible string for
 mt7530 on TP-Link EAP615-Wall
In-Reply-To: <167543027987.2011629.4552183492246240169@git-01.infra.openwrt.org>
References: <167543027987.2011629.4552183492246240169@git-01.infra.openwrt.org>
Message-ID: <mailman.12174.1675430287.3064139.lede-commits@lists.infradead.org>

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

commit c6e412378ca93a6999a034af474474068aa720d8
Author: Ar?n? ?NAL <arinc.unal at arinc9.com>
AuthorDate: Thu Jan 26 22:17:40 2023 +0300

    ramips: mt7621-dts: fix compatible string for mt7530 on TP-Link EAP615-Wall
    
    The correct compatible string for the multi-chip module MT7530 switch in
    MT7621AT, MT7621DAT and MT7621ST SoCs is mediatek,mt7621. Remove the
    property on TP-Link EAP615-Wall which will default to the said string.
    
    Fixes: a1b8a4d7b3ff ("ramips: support TP-Link EAP615-Wall")
    Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
    Signed-off-by: Ar?n? ?NAL <arinc.unal at arinc9.com>
---
 target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts b/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts
index 594a9e7bb1..36809d48ff 100644
--- a/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts
+++ b/target/linux/ramips/dts/mt7621_tplink_eap615-wall-v1.dts
@@ -173,7 +173,6 @@
 };
 
 &switch0 {
-	compatible = "mediatek,mt7530";
 	ports {
 		port at 1 {
 			status = "okay";



From lede-commits at lists.infradead.org  Fri Feb  3 05:18:04 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 08:18:04 -0500
Subject: [openwrt/openwrt]  x86: add Barracuda Networks F12 interfaces
In-Reply-To: <167543027987.2011629.4552183492246240169@git-01.infra.openwrt.org>
References: <167543027987.2011629.4552183492246240169@git-01.infra.openwrt.org>
Message-ID: <mailman.12175.1675430287.3064139.lede-commits@lists.infradead.org>

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

commit d9a1eee764aa8a800e2094d614bbe8e1b248b8c3
Author: Tomasz Maciej Nowak <tmn505 at gmail.com>
AuthorDate: Mon Jan 23 14:44:15 2023 +0100

    x86: add Barracuda Networks F12 interfaces
    
    Match interface numbers with printed numbers on device enclosure and
    assign first port as WAN interface.
    
    Notes
    Serial console is available through RJ-45 port with Cisco pinout
    baud: 19200, parity: none, flow control: none
    The device is setup with UEFI. To enter setup hold DEL or ESC key on
    boot. Default UEFI Administrator password is: bcndk1
    For users using graphics IC it's advisable to disable display with:
    i915.disable_display=1
    appending to kernel command line inside bootloader, to save about
    0.5-0.6W energy on idle.
    For users not using graphics IC, disable it in UEFI, this will save about
    1.5W energy on idle.
    Pins marked CN19 are ATX power On/Off button.
    
    Signed-off-by: Tomasz Maciej Nowak <tmn505 at gmail.com>
---
 target/linux/x86/base-files/etc/board.d/02_network | 8 ++++++++
 1 file changed, 8 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 5befba0a62..094a45f914 100644
--- a/target/linux/x86/base-files/etc/board.d/02_network
+++ b/target/linux/x86/base-files/etc/board.d/02_network
@@ -8,6 +8,14 @@
 board_config_update
 
 case "$(board_name)" in
+barracuda-networks-inc-barracuda-ng-firewall-f12)
+	ucidef_set_network_device_path "eth1" "pci0000:00/0000:00:14.0/0000:01:00.0"
+	ucidef_set_network_device_path "eth2" "pci0000:00/0000:00:14.1/0000:02:00.0"
+	ucidef_set_network_device_path "eth3" "pci0000:00/0000:00:13.0/0000:03:00.0"
+	ucidef_set_network_device_path "eth4" "pci0000:00/0000:00:13.1/0000:04:00.0"
+	ucidef_set_network_device_path "eth5" "pci0000:00/0000:00:13.2/0000:05:00.0"
+	ucidef_set_interfaces_lan_wan "eth2 eth3 eth4 eth5" "eth1"
+	;;
 cisco-mx100-hw)
 	ucidef_set_network_device_path "mgmt" "pci0000:00/0000:00:01.2/0000:03:00.3"
 	ucidef_set_network_device_path "wan" "pci0000:00/0000:00:01.2/0000:03:00.2"



From lede-commits at lists.infradead.org  Fri Feb  3 05:18:01 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 08:18:01 -0500
Subject: [openwrt/openwrt]  ramips: use on-flash partition table for Sercomm
 BZV/CHJ
In-Reply-To: <167543027987.2011629.4552183492246240169@git-01.infra.openwrt.org>
References: <167543027987.2011629.4552183492246240169@git-01.infra.openwrt.org>
Message-ID: <mailman.12176.1675430290.3064139.lede-commits@lists.infradead.org>

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

commit c46584ab302f0dd9b472aef77c2af163f9719379
Author: Jan Hoffmann <jan at 3e8.eu>
AuthorDate: Sat Jan 28 00:01:18 2023 +0100

    ramips: use on-flash partition table for Sercomm BZV/CHJ
    
    These devices have a partition table stored in flash, which compensates
    for any pre-existing bad blocks by enlarging the respective partition.
    This means that the current static partition table is only correct for
    devices without any bad blocks.
    
    Typical results of this mismatch are degraded wireless performance and
    wrong MAC addresses, when the factory partition is shifted due to a bad
    block somewhere before it. If there is a bad block already before the
    ubi partition, then OpenWrt may not run at all because the kernel can't
    find the rootfs.
    
    Use the on-flash partition table to fix these issues. Replace the two
    reserved partitions by the full partition list, as the driver does not
    allow merging them.
    
    Signed-off-by: Jan Hoffmann <jan at 3e8.eu>
---
 .../ramips/dts/mt7621_netgear_sercomm_bzv.dtsi     | 169 ++++++++++++++++++++-
 .../ramips/dts/mt7621_netgear_sercomm_chj.dtsi     | 169 ++++++++++++++++++++-
 2 files changed, 330 insertions(+), 8 deletions(-)

diff --git a/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi b/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi
index 9fa4af8fd6..ab96b8fdd1 100644
--- a/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi
+++ b/target/linux/ramips/dts/mt7621_netgear_sercomm_bzv.dtsi
@@ -223,47 +223,208 @@
 	status = "okay";
 
 	partitions {
-		compatible = "fixed-partitions";
+		compatible = "sercomm,sc-partitions", "fixed-partitions";
 		#address-cells = <1>;
 		#size-cells = <1>;
 
 		partition at 0 {
 			label = "u-boot";
 			reg = <0x0 0x100000>;
+			sercomm,scpart-id = <0>;
 			read-only;
 		};
 
 		partition at 100000 {
 			label = "SC PART_MAP";
 			reg = <0x100000 0x100000>;
+			sercomm,scpart-id = <1>;
 			read-only;
 		};
 
 		partition at 200000 {
 			label = "kernel";
 			reg = <0x200000 0x400000>;
+			sercomm,scpart-id = <2>;
 		};
 
 		partition at 600000 {
 			label = "ubi";
 			reg = <0x600000 0x2800000>;
+			sercomm,scpart-id = <3>;
 		};
 
 		partition at 2e00000 {
-			label = "reserved0";
-			reg = <0x2e00000 0x1800000>;
+			label = "English UI";
+			reg = <0x2e00000 0x200000>;
+			sercomm,scpart-id = <4>;
+			read-only;
+		};
+
+		partition at 3000000 {
+			label = "ML1";
+			reg = <0x3000000 0x200000>;
+			sercomm,scpart-id = <5>;
+			read-only;
+		};
+
+		partition at 3200000 {
+			label = "ML2";
+			reg = <0x3200000 0x200000>;
+			sercomm,scpart-id = <6>;
+			read-only;
+		};
+
+		partition at 3400000 {
+			label = "ML3";
+			reg = <0x3400000 0x200000>;
+			sercomm,scpart-id = <7>;
+			read-only;
+		};
+
+		partition at 3600000 {
+			label = "ML4";
+			reg = <0x3600000 0x200000>;
+			sercomm,scpart-id = <8>;
+			read-only;
+		};
+
+		partition at 3800000 {
+			label = "ML5";
+			reg = <0x3800000 0x200000>;
+			sercomm,scpart-id = <9>;
+			read-only;
+		};
+
+		partition at 3a00000 {
+			label = "ML6";
+			reg = <0x3a00000 0x200000>;
+			sercomm,scpart-id = <10>;
+			read-only;
+		};
+
+		partition at 3c00000 {
+			label = "ML7";
+			reg = <0x3c00000 0x200000>;
+			sercomm,scpart-id = <11>;
+			read-only;
+		};
+
+		partition at 3e00000 {
+			label = "ML8";
+			reg = <0x3e00000 0x200000>;
+			sercomm,scpart-id = <12>;
+			read-only;
+		};
+
+		partition at 4000000 {
+			label = "ML9";
+			reg = <0x4000000 0x200000>;
+			sercomm,scpart-id = <13>;
+			read-only;
+		};
+
+		partition at 4200000 {
+			label = "ML10";
+			reg = <0x4200000 0x200000>;
+			sercomm,scpart-id = <14>;
+			read-only;
+		};
+
+		partition at 4400000 {
+			label = "ML11";
+			reg = <0x4400000 0x200000>;
+			sercomm,scpart-id = <15>;
 			read-only;
 		};
 
 		factory: partition at 4600000 {
 			label = "factory";
 			reg = <0x4600000 0x200000>;
+			sercomm,scpart-id = <16>;
 			read-only;
 		};
 
 		partition at 4800000 {
+			label = "SC Private Data";
+			reg = <0x4800000 0x200000>;
+			sercomm,scpart-id = <17>;
+			read-only;
+		};
+
+		partition at 4a00000 {
+			label = "POT";
+			reg = <0x4a00000 0x200000>;
+			sercomm,scpart-id = <18>;
+			read-only;
+		};
+
+		partition at 4c00000 {
+			label = "Traffic Meter";
+			reg = <0x4c00000 0x200000>;
+			sercomm,scpart-id = <19>;
+			read-only;
+		};
+
+		partition at 4e00000 {
+			label = "SC PID";
+			reg = <0x4e00000 0x200000>;
+			sercomm,scpart-id = <20>;
+			read-only;
+		};
+
+		partition at 5000000 {
+			label = "SC Nvram";
+			reg = <0x5000000 0x200000>;
+			sercomm,scpart-id = <21>;
+			read-only;
+		};
+
+		partition at 5200000 {
+			label = "Ralink Nvram";
+			reg = <0x5200000 0x200000>;
+			sercomm,scpart-id = <22>;
+			read-only;
+		};
+
+		partition at 5400000 {
+			label = "reserved0";
+			reg = <0x5400000 0x200000>;
+			sercomm,scpart-id = <23>;
+			read-only;
+		};
+
+		partition at 5600000 {
 			label = "reserved1";
-			reg = <0x4800000 0x3800000>;
+			reg = <0x5600000 0x200000>;
+			sercomm,scpart-id = <24>;
+			read-only;
+		};
+
+		partition at 5800000 {
+			label = "reserved2";
+			reg = <0x5800000 0x200000>;
+			sercomm,scpart-id = <25>;
+			read-only;
+		};
+
+		partition at 5a00000 {
+			label = "reserved3";
+			reg = <0x5a00000 0x200000>;
+			sercomm,scpart-id = <26>;
+			read-only;
+		};
+
+		partition at 5c00000 {
+			label = "reserved4";
+			reg = <0x5c00000 0x200000>;
+			sercomm,scpart-id = <27>;
+			read-only;
+		};
+
+		partition at 5e00000 {
+			label = "reserved5";
+			reg = <0x5e00000 0x2180000>;
+			sercomm,scpart-id = <28>;
 			read-only;
 		};
 	};
diff --git a/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi b/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi
index eaf12a891e..cd9582e541 100644
--- a/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi
+++ b/target/linux/ramips/dts/mt7621_netgear_sercomm_chj.dtsi
@@ -151,47 +151,208 @@
 	status = "okay";
 
 	partitions {
-		compatible = "fixed-partitions";
+		compatible = "sercomm,sc-partitions", "fixed-partitions";
 		#address-cells = <1>;
 		#size-cells = <1>;
 
 		partition at 0 {
 			label = "u-boot";
 			reg = <0x0 0x100000>;
+			sercomm,scpart-id = <0>;
 			read-only;
 		};
 
 		partition at 100000 {
 			label = "SC PART_MAP";
 			reg = <0x100000 0x100000>;
+			sercomm,scpart-id = <1>;
 			read-only;
 		};
 
 		partition at 200000 {
 			label = "kernel";
 			reg = <0x200000 0x400000>;
+			sercomm,scpart-id = <2>;
 		};
 
 		partition at 600000 {
 			label = "ubi";
 			reg = <0x600000 0x2800000>;
+			sercomm,scpart-id = <3>;
 		};
 
 		partition at 2e00000 {
-			label = "reserved0";
-			reg = <0x2e00000 0x1800000>;
+			label = "English UI";
+			reg = <0x2e00000 0x200000>;
+			sercomm,scpart-id = <4>;
+			read-only;
+		};
+
+		partition at 3000000 {
+			label = "ML1";
+			reg = <0x3000000 0x200000>;
+			sercomm,scpart-id = <5>;
+			read-only;
+		};
+
+		partition at 3200000 {
+			label = "ML2";
+			reg = <0x3200000 0x200000>;
+			sercomm,scpart-id = <6>;
+			read-only;
+		};
+
+		partition at 3400000 {
+			label = "ML3";
+			reg = <0x3400000 0x200000>;
+			sercomm,scpart-id = <7>;
+			read-only;
+		};
+
+		partition at 3600000 {
+			label = "ML4";
+			reg = <0x3600000 0x200000>;
+			sercomm,scpart-id = <8>;
+			read-only;
+		};
+
+		partition at 3800000 {
+			label = "ML5";
+			reg = <0x3800000 0x200000>;
+			sercomm,scpart-id = <9>;
+			read-only;
+		};
+
+		partition at 3a00000 {
+			label = "ML6";
+			reg = <0x3a00000 0x200000>;
+			sercomm,scpart-id = <10>;
+			read-only;
+		};
+
+		partition at 3c00000 {
+			label = "ML7";
+			reg = <0x3c00000 0x200000>;
+			sercomm,scpart-id = <11>;
+			read-only;
+		};
+
+		partition at 3e00000 {
+			label = "ML8";
+			reg = <0x3e00000 0x200000>;
+			sercomm,scpart-id = <12>;
+			read-only;
+		};
+
+		partition at 4000000 {
+			label = "ML9";
+			reg = <0x4000000 0x200000>;
+			sercomm,scpart-id = <13>;
+			read-only;
+		};
+
+		partition at 4200000 {
+			label = "ML10";
+			reg = <0x4200000 0x200000>;
+			sercomm,scpart-id = <14>;
+			read-only;
+		};
+
+		partition at 4400000 {
+			label = "ML11";
+			reg = <0x4400000 0x200000>;
+			sercomm,scpart-id = <15>;
 			read-only;
 		};
 
 		factory: partition at 4600000 {
 			label = "factory";
 			reg = <0x4600000 0x200000>;
+			sercomm,scpart-id = <16>;
 			read-only;
 		};
 
 		partition at 4800000 {
+			label = "SC Private Data";
+			reg = <0x4800000 0x200000>;
+			sercomm,scpart-id = <17>;
+			read-only;
+		};
+
+		partition at 4a00000 {
+			label = "POT";
+			reg = <0x4a00000 0x200000>;
+			sercomm,scpart-id = <18>;
+			read-only;
+		};
+
+		partition at 4c00000 {
+			label = "Traffic Meter";
+			reg = <0x4c00000 0x200000>;
+			sercomm,scpart-id = <19>;
+			read-only;
+		};
+
+		partition at 4e00000 {
+			label = "SC PID";
+			reg = <0x4e00000 0x200000>;
+			sercomm,scpart-id = <20>;
+			read-only;
+		};
+
+		partition at 5000000 {
+			label = "SC Nvram";
+			reg = <0x5000000 0x200000>;
+			sercomm,scpart-id = <21>;
+			read-only;
+		};
+
+		partition at 5200000 {
+			label = "Ralink Nvram";
+			reg = <0x5200000 0x200000>;
+			sercomm,scpart-id = <22>;
+			read-only;
+		};
+
+		partition at 5400000 {
+			label = "reserved0";
+			reg = <0x5400000 0x200000>;
+			sercomm,scpart-id = <23>;
+			read-only;
+		};
+
+		partition at 5600000 {
 			label = "reserved1";
-			reg = <0x4800000 0x3800000>;
+			reg = <0x5600000 0x200000>;
+			sercomm,scpart-id = <24>;
+			read-only;
+		};
+
+		partition at 5800000 {
+			label = "reserved2";
+			reg = <0x5800000 0x200000>;
+			sercomm,scpart-id = <25>;
+			read-only;
+		};
+
+		partition at 5a00000 {
+			label = "reserved3";
+			reg = <0x5a00000 0x200000>;
+			sercomm,scpart-id = <26>;
+			read-only;
+		};
+
+		partition at 5c00000 {
+			label = "reserved4";
+			reg = <0x5c00000 0x200000>;
+			sercomm,scpart-id = <27>;
+			read-only;
+		};
+
+		partition at 5e00000 {
+			label = "reserved5";
+			reg = <0x5e00000 0x2180000>;
+			sercomm,scpart-id = <28>;
 			read-only;
 		};
 	};



From lede-commits at lists.infradead.org  Fri Feb  3 05:18:00 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 08:18:00 -0500
Subject: [openwrt/openwrt]  ltq-*-app: extend ubus metrics/statistics
In-Reply-To: <167543027987.2011629.4552183492246240169@git-01.infra.openwrt.org>
References: <167543027987.2011629.4552183492246240169@git-01.infra.openwrt.org>
Message-ID: <mailman.12179.1675430290.3064139.lede-commits@lists.infradead.org>

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

commit b91d7d9d78ea12097de4c518c8cd2215ff286f7a
Author: Jan Hoffmann <jan at 3e8.eu>
AuthorDate: Sat Jan 28 20:45:24 2023 +0100

    ltq-*-app: extend ubus metrics/statistics
    
    Expose a few additional useful values via ubus:
    
    - Channel error counters (CRC, FEC)
    - Retransmission counters (MINEFTR, LEFTRS)
    - Impulse noise protection level
    - Rate adaptation mode
    - OLR statistics (Bitswap, SRA, SOS)
    - Pilot tones
    - Upstream/downstream band information
    
    Signed-off-by: Jan Hoffmann <jan at 3e8.eu>
---
 package/network/config/ltq-adsl-app/Makefile       |   2 +-
 package/network/config/ltq-vdsl-vr11-app/Makefile  |   2 +-
 .../config/ltq-vdsl-vr9-app/src/src/dsl_cpe_ubus.c | 163 ++++++++++++++++++++-
 3 files changed, 162 insertions(+), 5 deletions(-)

diff --git a/package/network/config/ltq-adsl-app/Makefile b/package/network/config/ltq-adsl-app/Makefile
index c4ddbf7089..472e3c0ed9 100644
--- a/package/network/config/ltq-adsl-app/Makefile
+++ b/package/network/config/ltq-adsl-app/Makefile
@@ -10,7 +10,7 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=dsl_cpe_control_danube
 PKG_VERSION:=3.24.4.4
-PKG_RELEASE:=10
+PKG_RELEASE:=11
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_BUILD_DIR:=$(BUILD_DIR)/dsl_cpe_control-$(PKG_VERSION)
 PKG_SOURCE_URL:=@OPENWRT
diff --git a/package/network/config/ltq-vdsl-vr11-app/Makefile b/package/network/config/ltq-vdsl-vr11-app/Makefile
index 8639795458..bcbf41e65a 100644
--- a/package/network/config/ltq-vdsl-vr11-app/Makefile
+++ b/package/network/config/ltq-vdsl-vr11-app/Makefile
@@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=ltq-vdsl-vr11-app
 PKG_VERSION:=4.23.1
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_BASE_NAME:=dsl_cpe_control
 
 UGW_VERSION=8.5.2.10
diff --git a/package/network/config/ltq-vdsl-vr9-app/src/src/dsl_cpe_ubus.c b/package/network/config/ltq-vdsl-vr9-app/src/src/dsl_cpe_ubus.c
index bf8a8b9c2c..77a1c67b6a 100644
--- a/package/network/config/ltq-vdsl-vr9-app/src/src/dsl_cpe_ubus.c
+++ b/package/network/config/ltq-vdsl-vr9-app/src/src/dsl_cpe_ubus.c
@@ -133,6 +133,17 @@ enum {
 	PSTATE_MAP_L3,
 };
 
+/* These values are exported via ubus and backwards compability
+ * needs to be kept!
+ */
+enum {
+	RAMODE_MAP_UNKNOWN = -1,
+	RAMODE_MAP_MANUAL,
+	RAMODE_MAP_AT_INIT,
+	RAMODE_MAP_DYNAMIC,
+	RAMODE_MAP_DYNAMIC_SOS,
+};
+
 static DSL_CPE_ThreadCtrl_t thread;
 static struct ubus_context *ctx;
 static struct blob_buf b;
@@ -171,6 +182,15 @@ static inline void m_array(const char *id, const uint8_t *value, size_t len) {
 	blobmsg_close_array(&b, c);
 }
 
+static inline void m_array_u16(const char *id, const uint16_t *value, size_t len) {
+	void *c = blobmsg_open_array(&b, id);
+
+	for (size_t i = 0; i < len; ++i)
+		blobmsg_add_u16(&b, "", value[i]);
+
+	blobmsg_close_array(&b, c);
+}
+
 static void m_vendor(const char *id, const uint8_t *value) {
 	// ITU-T T.35: U.S.
 	if (U16(value[0], value[1]) != 0xb500)
@@ -418,6 +438,31 @@ static void g997_line_inventory(int fd) {
 	m_array("serial", out.data.SerialNumber, DSL_G997_LI_MAXLEN_SERIAL);
 }
 
+static void pilot_tones_status(int fd) {
+#ifndef INCLUDE_DSL_CPE_API_DANUBE
+	IOCTL(DSL_PilotTonesStatus_t, DSL_FIO_PILOT_TONES_STATUS_GET);
+
+	m_array_u16("pilot_tones", out.data.nPilotTone, out.data.nNumData);
+#endif
+}
+
+static void band_border_status(int fd, DSL_AccessDir_t direction) {
+	IOCTL(DSL_BandBorderStatus_t, DSL_FIO_BAND_BORDER_STATUS_GET);
+
+	void *c, *c2;
+
+	c = blobmsg_open_array(&b, "limits");
+
+	for (size_t i = 0; i < out.data.nNumData; i++) {
+		c2 = blobmsg_open_table(&b, "");
+		blobmsg_add_u16(&b, "first", out.data.nBandLimits[i].nFirstToneIndex);
+		blobmsg_add_u16(&b, "last", out.data.nBandLimits[i].nLastToneIndex);
+		blobmsg_close_table(&b, c2);
+	}
+
+	blobmsg_close_array(&b, c);
+}
+
 static void g977_get_bit_allocation(int fd, DSL_AccessDir_t direction) {
 	IOCTL_DIR(DSL_G997_BitAllocationNsc_t, DSL_FIO_G997_BIT_ALLOCATION_NSC_GET, direction);
 
@@ -639,19 +684,46 @@ static void band_plan_status(int fd, profile_t *profile) {
 #endif
 }
 
-static void line_feature_config(int fd, DSL_AccessDir_t direction) {
+static void line_feature_config(int fd, DSL_AccessDir_t direction, bool *retx) {
 	IOCTL_DIR(DSL_LineFeature_t, DSL_FIO_LINE_FEATURE_STATUS_GET, direction)
 
 	m_bool("trellis", out.data.bTrellisEnable);
 	m_bool("bitswap", out.data.bBitswapEnable);
 	m_bool("retx", out.data.bReTxEnable);
 	m_bool("virtual_noise", out.data.bVirtualNoiseSupport);
+
+	*retx = out.data.bReTxEnable;
+}
+
+static void g997_rate_adaptation_status(int fd, DSL_AccessDir_t direction) {
+#ifndef INCLUDE_DSL_CPE_API_DANUBE
+	IOCTL_DIR(DSL_G997_RateAdaptationStatus_t, DSL_FIO_G997_RATE_ADAPTATION_STATUS_GET, direction);
+
+	int map = RAMODE_MAP_UNKNOWN;
+	const char *str;
+	switch (out.data.RA_MODE) {
+	STR_CASE_MAP(DSL_G997_RA_MODE_MANUAL, "Manual", RAMODE_MAP_MANUAL)
+	STR_CASE_MAP(DSL_G997_RA_MODE_AT_INIT, "At initialization", RAMODE_MAP_AT_INIT)
+	STR_CASE_MAP(DSL_G997_RA_MODE_DYNAMIC, "Dynamic", RAMODE_MAP_DYNAMIC)
+	STR_CASE_MAP(DSL_G997_RA_MODE_DYNAMIC_SOS, "Dynamic with SOS", RAMODE_MAP_DYNAMIC_SOS)
+	default:
+		str = NULL;
+		break;
+	};
+
+	if (str)
+		m_str("ra_mode", str);
+
+	if (map != PSTATE_MAP_UNKNOWN)
+		m_u32("ra_mode_num", map);
+#endif
 }
 
 static void g997_channel_status(int fd, DSL_AccessDir_t direction) {
 	IOCTL_DIR(DSL_G997_ChannelStatus_t, DSL_FIO_G997_CHANNEL_STATUS_GET, direction);
 
 	m_u32("interleave_delay", out.data.ActualInterleaveDelay * 10);
+	m_double("inp", (double)out.data.ActualImpulseNoiseProtection / 10);
 #ifndef INCLUDE_DSL_CPE_API_DANUBE
 	// prefer ACTNDR, see comments in drv_dsl_cpe_api_g997.h
 	m_u32("data_rate", out.data.ActualNetDataRate);
@@ -672,6 +744,41 @@ static void g997_line_status(int fd, DSL_AccessDir_t direction) {
 	m_u32("attndr", out.data.ATTNDR);
 }
 
+static void pm_retx_counters_showtime(int fd, DSL_XTUDir_t direction) {
+#ifdef INCLUDE_DSL_CPE_PM_RETX_COUNTERS
+	IOCTL_DIR(DSL_PM_ReTxCounters_t, DSL_FIO_PM_RETX_COUNTERS_SHOWTIME_GET, direction);
+
+	m_u32("mineftr", out.data.nEftrMin);
+#endif
+}
+
+#ifndef INCLUDE_DSL_CPE_API_DANUBE
+static void olr_statistics(int fd, DSL_AccessDir_t direction) {
+	IOCTL_DIR(DSL_OlrStatistics_t, DSL_FIO_OLR_STATISTICS_GET, direction)
+
+	void *c = blobmsg_open_table(&b, "bitswap");
+	m_u32("requested", out.data.nBitswapRequested + out.data.nBitswapRequested);
+	m_u32("executed", out.data.nBitswapExecuted);
+	m_u32("rejected", out.data.nBitswapRejected);
+	m_u32("timeout", out.data.nBitswapTimeout);
+	blobmsg_close_table(&b, c);
+
+	c = blobmsg_open_table(&b, "sra");
+	m_u32("requested", out.data.nSraRequested);
+	m_u32("executed", out.data.nSraExecuted);
+	m_u32("rejected", out.data.nSraRejected);
+	m_u32("timeout", out.data.nSraTimeout);
+	blobmsg_close_table(&b, c);
+
+	c = blobmsg_open_table(&b, "sos");
+	m_u32("requested", out.data.nSosRequested);
+	m_u32("executed", out.data.nSosExecuted);
+	m_u32("rejected", out.data.nSosRejected);
+	m_u32("timeout", out.data.nSosTimeout);
+	blobmsg_close_table(&b, c);
+}
+#endif
+
 static void pm_line_sec_counters_total(int fd, DSL_XTUDir_t direction) {
 	IOCTL_DIR(DSL_PM_LineSecCountersTotal_t, DSL_FIO_PM_LINE_SEC_COUNTERS_TOTAL_GET, direction)
 
@@ -685,6 +792,21 @@ static void pm_line_sec_counters_total(int fd, DSL_XTUDir_t direction) {
 #endif
 }
 
+static void pm_retx_counters_total(int fd, DSL_XTUDir_t direction) {
+#ifdef INCLUDE_DSL_CPE_PM_RETX_COUNTERS
+	IOCTL_DIR(DSL_PM_ReTxCountersTotal_t, DSL_FIO_PM_RETX_COUNTERS_TOTAL_GET, direction);
+
+	m_u32("leftrs", out.data.nLeftr);
+#endif
+}
+
+static void pm_channel_counters_total(int fd, DSL_XTUDir_t direction) {
+	IOCTL_DIR(DSL_PM_ChannelCountersTotal_t, DSL_FIO_PM_CHANNEL_COUNTERS_TOTAL_GET, direction);
+
+	m_u32("cv_c", out.data.nCodeViolations);
+	m_u32("fec_c", out.data.nFEC);
+}
+
 static void pm_data_path_counters_total(int fd, DSL_XTUDir_t direction) {
 	IOCTL_DIR(DSL_PM_DataPathCountersTotal_t, DSL_FIO_PM_DATA_PATH_COUNTERS_TOTAL_GET, direction);
 
@@ -810,6 +932,17 @@ static int line_statistics(struct ubus_context *ctx, struct ubus_object *obj,
 
 	blob_buf_init(&b, 0);
 
+	pilot_tones_status(fd);
+
+	c = blobmsg_open_table(&b, "bands");
+	c2 = blobmsg_open_table(&b, "downstream");
+	band_border_status(fd, DSL_DOWNSTREAM);
+	blobmsg_close_table(&b, c2);
+	c2 = blobmsg_open_table(&b, "upstream");
+	band_border_status(fd, DSL_UPSTREAM);
+	blobmsg_close_table(&b, c2);
+	blobmsg_close_table(&b, c);
+
 	c = blobmsg_open_table(&b, "bits");
 	c2 = blobmsg_open_table(&b, "downstream");
 	g977_get_bit_allocation(fd, DSL_DOWNSTREAM);
@@ -862,6 +995,7 @@ static int metrics(struct ubus_context *ctx, struct ubus_object *obj,
 	standard_t standard = STD_UNKNOWN;
 	profile_t profile = PROFILE_UNKNOWN;
 	vector_t vector = VECTOR_UNKNOWN;
+	bool retx_up = false, retx_down = false;
 
 #ifndef INCLUDE_DSL_CPE_API_DANUBE
 	fd = open(DSL_CPE_DEVICE_NAME "/0", O_RDWR, 0644);
@@ -908,9 +1042,12 @@ static int metrics(struct ubus_context *ctx, struct ubus_object *obj,
 	default:
 		break;
 	};
-	line_feature_config(fd, DSL_UPSTREAM);
+	line_feature_config(fd, DSL_UPSTREAM, &retx_up);
+	g997_rate_adaptation_status(fd, DSL_UPSTREAM);
 	g997_channel_status(fd, DSL_UPSTREAM);
 	g997_line_status(fd, DSL_UPSTREAM);
+	if (retx_up)
+		pm_retx_counters_showtime(fd, DSL_FAR_END);
 	blobmsg_close_table(&b, c);
 
 	c = blobmsg_open_table(&b, "downstream");
@@ -925,20 +1062,40 @@ static int metrics(struct ubus_context *ctx, struct ubus_object *obj,
 	default:
 		break;
 	};
-	line_feature_config(fd, DSL_DOWNSTREAM);
+	line_feature_config(fd, DSL_DOWNSTREAM, &retx_down);
+	g997_rate_adaptation_status(fd, DSL_DOWNSTREAM);
 	g997_channel_status(fd, DSL_DOWNSTREAM);
 	g997_line_status(fd, DSL_DOWNSTREAM);
+	if (retx_down)
+		pm_retx_counters_showtime(fd, DSL_NEAR_END);
+	blobmsg_close_table(&b, c);
+
+#ifndef INCLUDE_DSL_CPE_API_DANUBE
+	c = blobmsg_open_table(&b, "olr");
+	c2 = blobmsg_open_table(&b, "downstream");
+	olr_statistics(fd, DSL_DOWNSTREAM);
+	blobmsg_close_table(&b, c2);
+	c2 = blobmsg_open_table(&b, "upstream");
+	olr_statistics(fd, DSL_UPSTREAM);
+	blobmsg_close_table(&b, c2);
 	blobmsg_close_table(&b, c);
+#endif
 
 	c = blobmsg_open_table(&b, "errors");
 	c2 = blobmsg_open_table(&b, "near");
 	pm_line_sec_counters_total(fd, DSL_NEAR_END);
+	if (retx_down)
+		pm_retx_counters_total(fd, DSL_NEAR_END);
+	pm_channel_counters_total(fd, DSL_NEAR_END);
 	pm_data_path_counters_total(fd, DSL_NEAR_END);
 	retx_statistics(fd, DSL_NEAR_END);
 	blobmsg_close_table(&b, c2);
 
 	c2 = blobmsg_open_table(&b, "far");
 	pm_line_sec_counters_total(fd, DSL_FAR_END);
+	if (retx_up)
+		pm_retx_counters_total(fd, DSL_FAR_END);
+	pm_channel_counters_total(fd, DSL_FAR_END);
 	pm_data_path_counters_total(fd, DSL_FAR_END);
 	retx_statistics(fd, DSL_FAR_END);
 	blobmsg_close_table(&b, c2);



From lede-commits at lists.infradead.org  Fri Feb  3 05:17:59 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 08:17:59 -0500
Subject: [openwrt/openwrt]  ltq-vdsl-vr9: fix upstream MINEFTR
In-Reply-To: <167543027987.2011629.4552183492246240169@git-01.infra.openwrt.org>
References: <167543027987.2011629.4552183492246240169@git-01.infra.openwrt.org>
Message-ID: <mailman.12180.1675430291.3064139.lede-commits@lists.infradead.org>

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

commit 723963543a270a5de845ef0ddd07c51c0a8b2cbb
Author: Jan Hoffmann <jan at 3e8.eu>
AuthorDate: Sat Jan 28 20:29:22 2023 +0100

    ltq-vdsl-vr9: fix upstream MINEFTR
    
    The upstream value read from the device seems to already be in bits per
    second, so there is no need to multiply by 1000 again (which for typical
    values causes an overflow of the 32-bit unsigned integer).
    
    Signed-off-by: Jan Hoffmann <jan at 3e8.eu>
---
 package/kernel/lantiq/ltq-vdsl-vr9/Makefile        |  2 +-
 .../ltq-vdsl-vr9/patches/210-fix-us-eftrmin.patch  | 22 ++++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/package/kernel/lantiq/ltq-vdsl-vr9/Makefile b/package/kernel/lantiq/ltq-vdsl-vr9/Makefile
index da924e861e..ebcb935a73 100644
--- a/package/kernel/lantiq/ltq-vdsl-vr9/Makefile
+++ b/package/kernel/lantiq/ltq-vdsl-vr9/Makefile
@@ -9,7 +9,7 @@ include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=ltq-vdsl-vr9
 PKG_VERSION:=4.17.18.6
-PKG_RELEASE:=7
+PKG_RELEASE:=8
 
 PKG_BASE_NAME:=drv_dsl_cpe_api
 PKG_SOURCE:=$(PKG_BASE_NAME)_vrx-$(PKG_VERSION).tar.gz
diff --git a/package/kernel/lantiq/ltq-vdsl-vr9/patches/210-fix-us-eftrmin.patch b/package/kernel/lantiq/ltq-vdsl-vr9/patches/210-fix-us-eftrmin.patch
new file mode 100644
index 0000000000..51651f476a
--- /dev/null
+++ b/package/kernel/lantiq/ltq-vdsl-vr9/patches/210-fix-us-eftrmin.patch
@@ -0,0 +1,22 @@
+--- a/src/pm/drv_dsl_cpe_api_pm_vrx.c
++++ b/src/pm/drv_dsl_cpe_api_pm_vrx.c
+@@ -1435,9 +1435,16 @@ DSL_Error_t DSL_DRV_PM_DEV_ReTxCountersG
+       /* ignore zero value*/
+       if (nEftrMin)
+       {
+-         /* Fw Format:  kBit/s */
+-         /* API format: bit/s */
+-         pCounters->nEftrMin = nEftrMin*1000;
++         if (nDirection == DSL_NEAR_END)
++         {
++            /* Fw Format:  kBit/s */
++            /* API format: bit/s */
++            pCounters->nEftrMin = nEftrMin*1000;
++         }
++         else
++         {
++            pCounters->nEftrMin = nEftrMin;
++         }
+       }
+    }
+    else



From lede-commits at lists.infradead.org  Fri Feb  3 05:20:52 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 08:20:52 -0500
Subject: [openwrt/openwrt]  ramips: mt7621-dts: fix phy-mode of external phy
 on GB-PC2
In-Reply-To: <167543045281.2013581.11000414361644541496@git-01.infra.openwrt.org>
References: <167543045281.2013581.11000414361644541496@git-01.infra.openwrt.org>
Message-ID: <mailman.12181.1675430457.3064139.lede-commits@lists.infradead.org>

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

commit 3fd3d99e3aafaf7ba7a72b32682ae3a60cf56cd8
Author: Ar?n? ?NAL <arinc.unal at arinc9.com>
AuthorDate: Tue Nov 29 00:33:37 2022 +0300

    ramips: mt7621-dts: fix phy-mode of external phy on GB-PC2
    
    The phy-mode property must be defined on the MAC instead of the PHY. Define
    phy-mode under gmac1 which the external phy is connected to.
    
    Tested-by: Petr Louda <petr.louda at outlook.cz>
    Signed-off-by: Ar?n? ?NAL <arinc.unal at arinc9.com>
    (cherry picked from commit 5155200f97adaeaaac7b752b5a6a5e41cba3db6a)
---
 target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts b/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts
index 6199511cff..c18f102502 100644
--- a/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts
+++ b/target/linux/ramips/dts/mt7621_gnubee_gb-pc2.dts
@@ -118,6 +118,7 @@
 &gmac1 {
 	status = "okay";
 	label = "ethyellow";
+	phy-mode = "rgmii-rxid";
 	phy-handle = <&ethphy5>;
 
 	nvmem-cells = <&macaddr_factory_e000>;
@@ -127,7 +128,6 @@
 &mdio {
 	ethphy5: ethernet-phy at 5 {
 		reg = <5>;
-		phy-mode = "rgmii-rxid";
 	};
 };
 



From lede-commits at lists.infradead.org  Fri Feb  3 12:23:31 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 15:23:31 -0500
Subject: [openwrt/openwrt]  scripts: qemustart: support CONFIG_BINARY_FOLDER
In-Reply-To: <167545581105.2410940.16924233517480289345@git-01.infra.openwrt.org>
References: <167545581105.2410940.16924233517480289345@git-01.infra.openwrt.org>
Message-ID: <mailman.12444.1675455816.3064139.lede-commits@lists.infradead.org>

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

commit f56d5932d24f9d2d339088011ffaa5c3e8340e0f
Author: Andre Heider <a.heider at gmail.com>
AuthorDate: Sun Nov 13 07:06:27 2022 +0100

    scripts: qemustart: support CONFIG_BINARY_FOLDER
    
    If CONFIG_BINARY_FOLDER is set in .config, use that instead of "bin" as
    the bindir.
    
    That allows to set that config and easily run e.g.
    `./scripts/qemustart armvirt 32`.
    
    Signed-off-by: Andre Heider <a.heider at gmail.com>
---
 scripts/qemustart | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/scripts/qemustart b/scripts/qemustart
index f0ddefb839..764b0e65af 100755
--- a/scripts/qemustart
+++ b/scripts/qemustart
@@ -158,7 +158,8 @@ parse_args() {
 		return 1
 	}
 	[ -n "$o_subtarget" ] || o_subtarget="generic"
-	o_bindir="bin/targets/$o_target/$o_subtarget"
+	eval "$(grep ^CONFIG_BINARY_FOLDER= .config 2>/dev/null)"
+	o_bindir="${CONFIG_BINARY_FOLDER:-bin}/targets/$o_target/$o_subtarget"
 }
 
 start_qemu_armvirt() {



From lede-commits at lists.infradead.org  Fri Feb  3 12:23:33 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 15:23:33 -0500
Subject: [openwrt/openwrt]  scripts: size_compare: print a grand total
In-Reply-To: <167545581105.2410940.16924233517480289345@git-01.infra.openwrt.org>
References: <167545581105.2410940.16924233517480289345@git-01.infra.openwrt.org>
Message-ID: <mailman.12445.1675455820.3064139.lede-commits@lists.infradead.org>

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

commit 19988b66d07f44be757c4a0e41be899dbf8c72dd
Author: Andre Heider <a.heider at gmail.com>
AuthorDate: Tue Jan 31 15:58:08 2023 +0100

    scripts: size_compare: print a grand total
    
    Usefull to check the impact of treewide changes:
    Change  Local   Remote  Package
    +281    6191    5910    ubus
    -547    56166   56713   procd
    -13294  91544   104838  ubi-utils
    ~~~~~~~ total change    -13560
    
    Signed-off-by: Andre Heider <a.heider at gmail.com>
---
 scripts/size_compare.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/size_compare.sh b/scripts/size_compare.sh
index 617004e72b..8417d25ff2 100755
--- a/scripts/size_compare.sh
+++ b/scripts/size_compare.sh
@@ -75,6 +75,7 @@ package_size () {
 }
 
 compare_sizes () {
+	TOTAL_DIFF="0"
 	for PACKAGE in $PACKAGES; do
 		if [ "$PACKAGE" = "libc" ]; then
 			continue
@@ -92,7 +93,8 @@ compare_sizes () {
 			SIZE_LOCAL=$(tar tzvf "$PACKAGE_FILE" ./data.tar.gz | awk '{ print $3 }')
 		fi
 		SIZE_UPSTREAM=$(package_size "$TMP_INDEX" "$PACKAGE")
-		SIZE_DIFF="$((SIZE_LOCAL-SIZE_UPSTREAM))"
+		SIZE_DIFF="$((SIZE_LOCAL - SIZE_UPSTREAM))"
+		TOTAL_DIFF="$((TOTAL_DIFF + SIZE_DIFF))"
 		if [ "$SIZE_DIFF" -gt 0 ]; then
 			SIZE_DIFF="+$SIZE_DIFF"
 		fi
@@ -102,6 +104,7 @@ compare_sizes () {
 			echo "$PACKAGE is missing upstream"
 		fi
 	done
+	echo "~~~~~~~	total change	${TOTAL_DIFF}"
 }
 
 if [ "$1" = "-h" ]; then



From lede-commits at lists.infradead.org  Fri Feb  3 12:23:32 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 15:23:32 -0500
Subject: [openwrt/openwrt]  scripts: size_compare: fix support for
 CONFIG_BINARY_FOLDER
In-Reply-To: <167545581105.2410940.16924233517480289345@git-01.infra.openwrt.org>
References: <167545581105.2410940.16924233517480289345@git-01.infra.openwrt.org>
Message-ID: <mailman.12446.1675455821.3064139.lede-commits@lists.infradead.org>

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

commit 21242451c265f3b2fb47e710a5fabc74dc59efce
Author: Andre Heider <a.heider at gmail.com>
AuthorDate: Mon Jan 30 18:37:39 2023 +0100

    scripts: size_compare: fix support for CONFIG_BINARY_FOLDER
    
    There is no CONFIG_BINARY_DIR, it's CONFIG_BINARY_FOLDER.
    
    While at it, don't parse the shell compatible .config, eval it.
    
    Signed-off-by: Andre Heider <a.heider at gmail.com>
---
 scripts/size_compare.sh | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/scripts/size_compare.sh b/scripts/size_compare.sh
index a5cc3337c7..617004e72b 100755
--- a/scripts/size_compare.sh
+++ b/scripts/size_compare.sh
@@ -21,17 +21,20 @@
 ###   -p --package-size 	Check IPK package size and not installed size
 ###   -h --help 		This message
 
-CONFIG_TARGET=$(sed -n 's/^CONFIG_TARGET_BOARD="\(.*\)"$/\1/p' .config)
-CONFIG_SUBTARGET=$(sed -n 's/^CONFIG_TARGET_SUBTARGET="\(.*\)"$/\1/p' .config)
-CONFIG_ARCH=$(sed -n 's/^CONFIG_TARGET_ARCH_PACKAGES="\(.*\)"$/\1/p' .config)
+eval "$(grep \
+	-e ^CONFIG_TARGET_BOARD= \
+	-e ^CONFIG_TARGET_SUBTARGET= \
+	-e ^CONFIG_TARGET_ARCH_PACKAGES= \
+	-e ^CONFIG_BINARY_FOLDER= \
+	.config 2>/dev/null \
+)"
 CONFIG_PACKAGES=$(sed -n 's/^CONFIG_PACKAGE_\(.*\)=y$/\1/p' .config | tr '\n' ' ')
-CONFIG_BIN_DIR=$(sed -n 's/^CONFIG_BINARY_DIR="\(.*\)"$/\1/p' .config)
 
-TARGET=${TARGET:-$CONFIG_TARGET}
-SUBTARGET=${SUBTARGET:-$CONFIG_SUBTARGET}
-ARCH=${ARCH:-$CONFIG_ARCH}
+TARGET=${TARGET:-$CONFIG_TARGET_BOARD}
+SUBTARGET=${SUBTARGET:-$CONFIG_TARGET_SUBTARGET}
+ARCH=${ARCH:-$CONFIG_TARGET_ARCH_PACKAGES}
 PACKAGES=${PACKAGES:-$CONFIG_PACKAGES}
-BIN_DIR=${CONFIG_BIN_DIR:-./bin}
+BIN_DIR=${CONFIG_BINARY_FOLDER:-./bin}
 BASE_URL="${BASE_URL:-https://downloads.openwrt.org/snapshots}"
 CHECK_INSTALLED="${CHECK_INSTALLED:-y}"
 



From lede-commits at lists.infradead.org  Fri Feb  3 17:35:17 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 20:35:17 -0500
Subject: [openwrt/openwrt]  treewide: replace libustream-wolfssl with -mbedtls
In-Reply-To: <167547451662.2637469.9247091507890264720@git-01.infra.openwrt.org>
References: <167547451662.2637469.9247091507890264720@git-01.infra.openwrt.org>
Message-ID: <mailman.12487.1675474523.3064139.lede-commits@lists.infradead.org>

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

commit 4bcc3fd3d222bfe545beb3906da9de860fcb83bd
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Wed Jan 25 13:02:12 2023 -0800

    treewide: replace libustream-wolfssl with -mbedtls
    
    Previous commit does the same for wpad-basic. Also matches
    DEFAULT_VARIANT in ustream-ssl Makefile.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 include/target.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/target.mk b/include/target.mk
index a62b1eb052..992f955344 100644
--- a/include/target.mk
+++ b/include/target.mk
@@ -17,7 +17,7 @@ DEFAULT_PACKAGES:=\
 	fstools \
 	libc \
 	libgcc \
-	libustream-wolfssl \
+	libustream-mbedtls \
 	logd \
 	mtd \
 	netifd \



From lede-commits at lists.infradead.org  Fri Feb  3 17:35:18 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 20:35:18 -0500
Subject: [openwrt/openwrt]  ipq807x: remove libwolfsslcpu-crypto dependency
In-Reply-To: <167547451662.2637469.9247091507890264720@git-01.infra.openwrt.org>
References: <167547451662.2637469.9247091507890264720@git-01.infra.openwrt.org>
Message-ID: <mailman.12488.1675474524.3064139.lede-commits@lists.infradead.org>

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

commit 059263dd6e9bed5cb0f817a9fe0bd287db921200
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Fri Feb 3 15:51:50 2023 -0800

    ipq807x: remove libwolfsslcpu-crypto dependency
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 target/linux/ipq807x/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ipq807x/Makefile b/target/linux/ipq807x/Makefile
index e432369ce9..f753cb3f50 100644
--- a/target/linux/ipq807x/Makefile
+++ b/target/linux/ipq807x/Makefile
@@ -14,7 +14,7 @@ include $(INCLUDE_DIR)/target.mk
 DEFAULT_PACKAGES += \
 	kmod-usb3 kmod-usb-dwc3 kmod-usb-dwc3-qcom \
 	kmod-leds-gpio kmod-gpio-button-hotplug \
-	libwolfsslcpu-crypto kmod-qca-nss-dp \
+	kmod-qca-nss-dp \
 	ath11k-firmware-ipq8074 kmod-ath11k-ahb \
 	wpad-basic-mbedtls uboot-envtools
 



From lede-commits at lists.infradead.org  Fri Feb  3 17:35:16 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 03 Feb 2023 20:35:16 -0500
Subject: [openwrt/openwrt]  treewide: replace wpad-basic-wolfssl default
In-Reply-To: <167547451662.2637469.9247091507890264720@git-01.infra.openwrt.org>
References: <167547451662.2637469.9247091507890264720@git-01.infra.openwrt.org>
Message-ID: <mailman.12489.1675474527.3064139.lede-commits@lists.infradead.org>

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

commit 2630e5063df0240eb0d05cd6e953b2bd412e3215
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Tue Dec 27 20:44:11 2022 -0800

    treewide: replace wpad-basic-wolfssl default
    
    The newly merged mbedtls backend is smaller and has fewer ABI related
    issues than the wolfSSL one.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 target/linux/apm821xx/image/sata.mk                |  2 +-
 target/linux/apm821xx/nand/target.mk               |  2 +-
 target/linux/apm821xx/sata/profiles/00-default.mk  |  2 +-
 .../linux/archs38/generic/profiles/00-default.mk   |  2 +-
 target/linux/ath25/Makefile                        |  2 +-
 target/linux/ath79/generic/target.mk               |  2 +-
 target/linux/ath79/image/generic-ubnt.mk           |  2 +-
 target/linux/ath79/image/generic.mk                | 10 ++---
 target/linux/ath79/mikrotik/target.mk              |  2 +-
 target/linux/ath79/nand/target.mk                  |  2 +-
 target/linux/ath79/tiny/target.mk                  |  2 +-
 target/linux/bcm27xx/image/Makefile                |  8 ++--
 .../bcm47xx/generic/profiles/101-Broadcom-wl.mk    |  2 +-
 .../bcm47xx/generic/profiles/105-Broadcom-none.mk  |  2 +-
 .../generic/profiles/201-Broadcom-b44-wl.mk        |  2 +-
 .../generic/profiles/205-Broadcom-b44-none.mk      |  2 +-
 .../generic/profiles/211-Broadcom-tg3-wl.mk        |  2 +-
 .../generic/profiles/215-Broadcom-tg3-none.mk      |  2 +-
 .../generic/profiles/221-Broadcom-bgmac-wl.mk      |  2 +-
 .../generic/profiles/225-Broadcom-bgmac-none.mk    |  2 +-
 .../linux/bcm47xx/generic/profiles/PS-1208MFG.mk   |  2 +-
 target/linux/bcm47xx/generic/target.mk             |  2 +-
 .../bcm47xx/legacy/profiles/101-Broadcom-wl.mk     |  2 +-
 target/linux/bcm47xx/legacy/target.mk              |  2 +-
 .../bcm47xx/mips74k/profiles/102-Broadcom-wl.mk    |  2 +-
 .../bcm47xx/mips74k/profiles/103-Broadcom-none.mk  |  2 +-
 target/linux/bcm47xx/mips74k/target.mk             |  2 +-
 target/linux/bcm53xx/image/Makefile                |  2 +-
 target/linux/bcm63xx/image/Makefile                | 10 ++---
 target/linux/bcm63xx/profiles/default.mk           |  2 +-
 target/linux/bmips/image/Makefile                  |  4 +-
 target/linux/ipq40xx/Makefile                      |  2 +-
 target/linux/ipq806x/Makefile                      |  2 +-
 target/linux/ipq807x/Makefile                      |  2 +-
 target/linux/kirkwood/image/Makefile               |  6 +--
 target/linux/lantiq/image/ar9.mk                   | 18 ++++-----
 target/linux/lantiq/image/danube.mk                | 24 ++++++------
 target/linux/lantiq/image/tp-link.mk               |  8 ++--
 target/linux/lantiq/image/vr9.mk                   | 34 ++++++++---------
 target/linux/lantiq/image/xway_legacy.mk           | 10 ++---
 target/linux/malta/Makefile                        |  2 +-
 target/linux/mediatek/filogic/target.mk            |  2 +-
 target/linux/mediatek/mt7622/target.mk             |  2 +-
 target/linux/mpc85xx/Makefile                      |  2 +-
 target/linux/mvebu/image/cortexa9.mk               |  4 +-
 target/linux/omap/profiles/00-default.mk           |  2 +-
 target/linux/oxnas/image/ox820.mk                  |  2 +-
 target/linux/ramips/image/mt7620.mk                |  2 +-
 target/linux/ramips/image/mt7621.mk                | 44 +++++++++++-----------
 target/linux/ramips/mt7620/target.mk               |  2 +-
 target/linux/ramips/mt7621/target.mk               |  2 +-
 target/linux/ramips/mt76x8/target.mk               |  2 +-
 target/linux/ramips/rt288x/target.mk               |  2 +-
 target/linux/ramips/rt305x/target.mk               |  2 +-
 target/linux/ramips/rt3883/target.mk               |  2 +-
 target/linux/sunxi/image/cortexa7.mk               | 14 +++----
 target/linux/sunxi/profiles/00-default.mk          |  2 +-
 target/linux/tegra/image/Makefile                  |  2 +-
 target/linux/uml/Makefile                          |  2 +-
 59 files changed, 143 insertions(+), 143 deletions(-)

diff --git a/target/linux/apm821xx/image/sata.mk b/target/linux/apm821xx/image/sata.mk
index 40bd2807c9..89af488e09 100644
--- a/target/linux/apm821xx/image/sata.mk
+++ b/target/linux/apm821xx/image/sata.mk
@@ -8,7 +8,7 @@ define Device/wd_mybooklive
   DEVICE_MODEL := My Book Live
   DEVICE_ALT0_VENDOR := Western Digital
   DEVICE_ALT0_MODEL := My Book Live Duo
-  DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-basic-wolfssl
+  DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-basic-mbedtls
   SUPPORTED_DEVICES += mbl wd,mybooklive-duo
   BLOCKSIZE := 1k
   DTB_SIZE := 16384
diff --git a/target/linux/apm821xx/nand/target.mk b/target/linux/apm821xx/nand/target.mk
index 208ea10b91..0cba949fa0 100644
--- a/target/linux/apm821xx/nand/target.mk
+++ b/target/linux/apm821xx/nand/target.mk
@@ -1,7 +1,7 @@
 BOARDNAME:=Devices with NAND flash (Routers)
 FEATURES += nand pcie
 
-DEFAULT_PACKAGES += kmod-ath9k swconfig wpad-basic-wolfssl
+DEFAULT_PACKAGES += kmod-ath9k swconfig wpad-basic-mbedtls
 
 define Target/Description
 	Build firmware images for APM821XX boards with NAND flash.
diff --git a/target/linux/apm821xx/sata/profiles/00-default.mk b/target/linux/apm821xx/sata/profiles/00-default.mk
index a203821533..082068fe36 100644
--- a/target/linux/apm821xx/sata/profiles/00-default.mk
+++ b/target/linux/apm821xx/sata/profiles/00-default.mk
@@ -5,7 +5,7 @@
 define Profile/Default
   NAME:=Default Profile
   PRIORITY:=1
-  PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-basic-wolfssl
+  PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-usb-storage kmod-fs-vfat wpad-basic-mbedtls
 endef
 
 define Profile/Default/Description
diff --git a/target/linux/archs38/generic/profiles/00-default.mk b/target/linux/archs38/generic/profiles/00-default.mk
index 38da896fa6..ae3292e5b9 100644
--- a/target/linux/archs38/generic/profiles/00-default.mk
+++ b/target/linux/archs38/generic/profiles/00-default.mk
@@ -4,7 +4,7 @@
 
 define Profile/Default
 	NAME:=Default Profile (all drivers)
-	PACKAGES:= kmod-usb2 kmod-ath9k-htc wpad-basic-wolfssl
+	PACKAGES:= kmod-usb2 kmod-ath9k-htc wpad-basic-mbedtls
 endef
 
 define Profile/Default/Description
diff --git a/target/linux/ath25/Makefile b/target/linux/ath25/Makefile
index debb0a324b..76dd346628 100644
--- a/target/linux/ath25/Makefile
+++ b/target/linux/ath25/Makefile
@@ -19,6 +19,6 @@ endef
 
 include $(INCLUDE_DIR)/target.mk
 
-DEFAULT_PACKAGES += wpad-basic-wolfssl kmod-ath5k swconfig kmod-gpio-button-hotplug
+DEFAULT_PACKAGES += wpad-basic-mbedtls kmod-ath5k swconfig kmod-gpio-button-hotplug
 
 $(eval $(call BuildTarget))
diff --git a/target/linux/ath79/generic/target.mk b/target/linux/ath79/generic/target.mk
index 4e53c89260..27c3365a29 100644
--- a/target/linux/ath79/generic/target.mk
+++ b/target/linux/ath79/generic/target.mk
@@ -1,6 +1,6 @@
 BOARDNAME:=Generic
 
-DEFAULT_PACKAGES += wpad-basic-wolfssl
+DEFAULT_PACKAGES += wpad-basic-mbedtls
 
 define Target/Description
 	Build firmware images for generic Atheros AR71xx/AR913x/AR934x based boards.
diff --git a/target/linux/ath79/image/generic-ubnt.mk b/target/linux/ath79/image/generic-ubnt.mk
index 8eeaa8de3e..0f70649d03 100644
--- a/target/linux/ath79/image/generic-ubnt.mk
+++ b/target/linux/ath79/image/generic-ubnt.mk
@@ -168,7 +168,7 @@ endef
 TARGET_DEVICES += ubnt_rocket-5ac-lite
 
 define Device/ubnt_routerstation_common
-  DEVICE_PACKAGES := -kmod-ath9k -wpad-basic-wolfssl -uboot-envtools kmod-usb-ohci \
+  DEVICE_PACKAGES := -kmod-ath9k -wpad-basic-mbedtls -uboot-envtools kmod-usb-ohci \
 	kmod-usb2 fconfig
   DEVICE_VENDOR := Ubiquiti
   SOC := ar7161
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 0837d37a30..d12fa7226e 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -1477,7 +1477,7 @@ define Device/hak5_lan-turtle
   TPLINK_HWID := 0x5348334c
   IMAGES := sysupgrade.bin
   DEVICE_PACKAGES := kmod-usb-chipidea2 -iwinfo -kmod-ath9k -swconfig \
-	-uboot-envtools -wpad-basic-wolfssl
+	-uboot-envtools -wpad-basic-mbedtls
   SUPPORTED_DEVICES += lan-turtle
 endef
 TARGET_DEVICES += hak5_lan-turtle
@@ -1490,7 +1490,7 @@ define Device/hak5_packet-squirrel
   TPLINK_HWID := 0x5351524c
   IMAGES := sysupgrade.bin
   DEVICE_PACKAGES := kmod-usb-chipidea2 -iwinfo -kmod-ath9k -swconfig \
-	-uboot-envtools -wpad-basic-wolfssl
+	-uboot-envtools -wpad-basic-mbedtls
   SUPPORTED_DEVICES += packet-squirrel
 endef
 TARGET_DEVICES += hak5_packet-squirrel
@@ -1525,7 +1525,7 @@ define Device/iodata_etg3-r
   DEVICE_VENDOR := I-O DATA
   DEVICE_MODEL := ETG3-R
   IMAGE_SIZE := 7680k
-  DEVICE_PACKAGES := -iwinfo -kmod-ath9k -wpad-basic-wolfssl
+  DEVICE_PACKAGES := -iwinfo -kmod-ath9k -wpad-basic-mbedtls
 endef
 TARGET_DEVICES += iodata_etg3-r
 
@@ -1585,7 +1585,7 @@ define Device/jjplus_ja76pf2
   SOC := ar7161
   DEVICE_VENDOR := jjPlus
   DEVICE_MODEL := JA76PF2
-  DEVICE_PACKAGES += -kmod-ath9k -swconfig -wpad-basic-wolfssl -uboot-envtools fconfig kmod-hwmon-lm75
+  DEVICE_PACKAGES += -kmod-ath9k -swconfig -wpad-basic-mbedtls -uboot-envtools fconfig kmod-hwmon-lm75
   LOADER_TYPE := bin
   LOADER_FLASH_OFFS := 0x60000
   COMPILE := loader-$(1).bin
@@ -2652,7 +2652,7 @@ define Device/teltonika_rut300
   DEVICE_VENDOR := Teltonika
   DEVICE_MODEL := RUT300
   SUPPORTED_TELTONIKA_DEVICES := teltonika,rut30x
-  DEVICE_PACKAGES := -kmod-ath9k -uboot-envtools -wpad-basic-wolfssl kmod-usb2
+  DEVICE_PACKAGES := -kmod-ath9k -uboot-envtools -wpad-basic-mbedtls kmod-usb2
   IMAGE_SIZE := 15552k
   IMAGES += factory.bin
   IMAGE/factory.bin = append-kernel | pad-to $$$$(BLOCKSIZE) | \
diff --git a/target/linux/ath79/mikrotik/target.mk b/target/linux/ath79/mikrotik/target.mk
index f5df904487..bfc8cceac6 100644
--- a/target/linux/ath79/mikrotik/target.mk
+++ b/target/linux/ath79/mikrotik/target.mk
@@ -3,7 +3,7 @@ FEATURES += minor nand
 KERNELNAME := vmlinux vmlinuz
 IMAGES_DIR := ../../..
 
-DEFAULT_PACKAGES += wpad-basic-wolfssl
+DEFAULT_PACKAGES += wpad-basic-mbedtls
 
 define Target/Description
 	Build firmware images for MikroTik devices based on Qualcomm Atheros
diff --git a/target/linux/ath79/nand/target.mk b/target/linux/ath79/nand/target.mk
index 7ea9b57f45..e0900abfe4 100644
--- a/target/linux/ath79/nand/target.mk
+++ b/target/linux/ath79/nand/target.mk
@@ -2,7 +2,7 @@ BOARDNAME := Generic devices with NAND flash
 
 FEATURES += nand
 
-DEFAULT_PACKAGES += wpad-basic-wolfssl
+DEFAULT_PACKAGES += wpad-basic-mbedtls
 
 define Target/Description
 	Firmware for boards using Qualcomm Atheros, MIPS-based SoCs
diff --git a/target/linux/ath79/tiny/target.mk b/target/linux/ath79/tiny/target.mk
index 28e02f7a67..fef82fdd7f 100644
--- a/target/linux/ath79/tiny/target.mk
+++ b/target/linux/ath79/tiny/target.mk
@@ -1,7 +1,7 @@
 BOARDNAME:=Devices with small flash
 FEATURES += low_mem small_flash
 
-DEFAULT_PACKAGES += wpad-basic-wolfssl
+DEFAULT_PACKAGES += wpad-basic-mbedtls
 
 define Target/Description
 	Build firmware images for Atheros AR71xx/AR913x/AR934x based boards with small flash
diff --git a/target/linux/bcm27xx/image/Makefile b/target/linux/bcm27xx/image/Makefile
index 999361e8cd..ad79ac7d0c 100644
--- a/target/linux/bcm27xx/image/Makefile
+++ b/target/linux/bcm27xx/image/Makefile
@@ -77,7 +77,7 @@ define Device/rpi
   DEVICE_PACKAGES := \
 	cypress-firmware-43430-sdio \
 	brcmfmac-nvram-43430-sdio \
-	kmod-brcmfmac wpad-basic-wolfssl
+	kmod-brcmfmac wpad-basic-mbedtls
 endef
 ifeq ($(SUBTARGET),bcm2708)
   TARGET_DEVICES += rpi
@@ -110,7 +110,7 @@ define Device/rpi-2
 	brcmfmac-nvram-43430-sdio \
 	cypress-firmware-43455-sdio \
 	brcmfmac-nvram-43455-sdio \
-	kmod-brcmfmac wpad-basic-wolfssl
+	kmod-brcmfmac wpad-basic-mbedtls
   IMAGE/sysupgrade.img.gz := boot-common | boot-2708 | boot-2711 | sdcard-img | gzip | append-metadata
   IMAGE/factory.img.gz := boot-common | boot-2708 | boot-2711 | sdcard-img | gzip
 endef
@@ -141,7 +141,7 @@ define Device/rpi-3
 	brcmfmac-nvram-43430-sdio \
 	cypress-firmware-43455-sdio \
 	brcmfmac-nvram-43455-sdio \
-	kmod-brcmfmac wpad-basic-wolfssl
+	kmod-brcmfmac wpad-basic-mbedtls
 endef
 ifeq ($(SUBTARGET),bcm2710)
   TARGET_DEVICES += rpi-3
@@ -162,7 +162,7 @@ define Device/rpi-4
   DEVICE_PACKAGES := \
 	cypress-firmware-43455-sdio \
 	brcmfmac-nvram-43455-sdio \
-	kmod-brcmfmac wpad-basic-wolfssl \
+	kmod-brcmfmac wpad-basic-mbedtls \
 	kmod-usb-net-lan78xx \
 	kmod-r8169
   IMAGE/sysupgrade.img.gz := boot-common | boot-2711 | sdcard-img | gzip | append-metadata
diff --git a/target/linux/bcm47xx/generic/profiles/101-Broadcom-wl.mk b/target/linux/bcm47xx/generic/profiles/101-Broadcom-wl.mk
index 498bc7bfda..5bd3cd5031 100644
--- a/target/linux/bcm47xx/generic/profiles/101-Broadcom-wl.mk
+++ b/target/linux/bcm47xx/generic/profiles/101-Broadcom-wl.mk
@@ -4,7 +4,7 @@
 
 define Profile/Broadcom-wl
   NAME:=Broadcom SoC, all Ethernet, BCM43xx WiFi (wl, proprietary)
-  PACKAGES:=-wpad-basic-wolfssl kmod-b44 kmod-tg3 kmod-bgmac kmod-brcm-wl wlc nas
+  PACKAGES:=-wpad-basic-mbedtls kmod-b44 kmod-tg3 kmod-bgmac kmod-brcm-wl wlc nas
 endef
 
 define Profile/Broadcom-wl/Description
diff --git a/target/linux/bcm47xx/generic/profiles/105-Broadcom-none.mk b/target/linux/bcm47xx/generic/profiles/105-Broadcom-none.mk
index 0b883825d0..b90ee8c329 100644
--- a/target/linux/bcm47xx/generic/profiles/105-Broadcom-none.mk
+++ b/target/linux/bcm47xx/generic/profiles/105-Broadcom-none.mk
@@ -4,7 +4,7 @@
 
 define Profile/Broadcom-none
   NAME:=Broadcom SoC, all Ethernet, No WiFi
-  PACKAGES:=-wpad-basic-wolfssl kmod-b44 kmod-tg3 kmod-bgmac
+  PACKAGES:=-wpad-basic-mbedtls kmod-b44 kmod-tg3 kmod-bgmac
 endef
 
 define Profile/Broadcom-none/Description
diff --git a/target/linux/bcm47xx/generic/profiles/201-Broadcom-b44-wl.mk b/target/linux/bcm47xx/generic/profiles/201-Broadcom-b44-wl.mk
index 5d55398dfc..8ae8e15ee5 100644
--- a/target/linux/bcm47xx/generic/profiles/201-Broadcom-b44-wl.mk
+++ b/target/linux/bcm47xx/generic/profiles/201-Broadcom-b44-wl.mk
@@ -4,7 +4,7 @@
 
 define Profile/Broadcom-b44-wl
   NAME:=Broadcom SoC, b44 Ethernet, BCM43xx WiFi (wl, proprietary)
-  PACKAGES:=-wpad-basic-wolfssl kmod-b44 kmod-brcm-wl wlc nas
+  PACKAGES:=-wpad-basic-mbedtls kmod-b44 kmod-brcm-wl wlc nas
 endef
 
 define Profile/Broadcom-b44-wl/Description
diff --git a/target/linux/bcm47xx/generic/profiles/205-Broadcom-b44-none.mk b/target/linux/bcm47xx/generic/profiles/205-Broadcom-b44-none.mk
index 79a223a316..6ae1767510 100644
--- a/target/linux/bcm47xx/generic/profiles/205-Broadcom-b44-none.mk
+++ b/target/linux/bcm47xx/generic/profiles/205-Broadcom-b44-none.mk
@@ -4,7 +4,7 @@
 
 define Profile/Broadcom-b44-none
   NAME:=Broadcom SoC, b44 Ethernet, No WiFi
-  PACKAGES:=-wpad-basic-wolfssl kmod-b44
+  PACKAGES:=-wpad-basic-mbedtls kmod-b44
 endef
 
 define Profile/Broadcom-b44-none/Description
diff --git a/target/linux/bcm47xx/generic/profiles/211-Broadcom-tg3-wl.mk b/target/linux/bcm47xx/generic/profiles/211-Broadcom-tg3-wl.mk
index f594027662..605c295d5e 100644
--- a/target/linux/bcm47xx/generic/profiles/211-Broadcom-tg3-wl.mk
+++ b/target/linux/bcm47xx/generic/profiles/211-Broadcom-tg3-wl.mk
@@ -4,7 +4,7 @@
 
 define Profile/Broadcom-tg3-wl
   NAME:=Broadcom SoC, tg3 Ethernet, BCM43xx WiFi (wl, proprietary)
-  PACKAGES:=-wpad-basic-wolfssl kmod-brcm-wl wlc nas kmod-tg3
+  PACKAGES:=-wpad-basic-mbedtls kmod-brcm-wl wlc nas kmod-tg3
 endef
 
 define Profile/Broadcom-tg3-wl/Description
diff --git a/target/linux/bcm47xx/generic/profiles/215-Broadcom-tg3-none.mk b/target/linux/bcm47xx/generic/profiles/215-Broadcom-tg3-none.mk
index a75e49cb05..3b66edd4b8 100644
--- a/target/linux/bcm47xx/generic/profiles/215-Broadcom-tg3-none.mk
+++ b/target/linux/bcm47xx/generic/profiles/215-Broadcom-tg3-none.mk
@@ -4,7 +4,7 @@
 
 define Profile/Broadcom-tg3-none
   NAME:=Broadcom SoC, tg3 Ethernet, no WiFi
-  PACKAGES:=-wpad-basic-wolfssl kmod-tg3
+  PACKAGES:=-wpad-basic-mbedtls kmod-tg3
 endef
 
 define Profile/Broadcom-tg3-none/Description
diff --git a/target/linux/bcm47xx/generic/profiles/221-Broadcom-bgmac-wl.mk b/target/linux/bcm47xx/generic/profiles/221-Broadcom-bgmac-wl.mk
index b426b99d37..264fed8a81 100644
--- a/target/linux/bcm47xx/generic/profiles/221-Broadcom-bgmac-wl.mk
+++ b/target/linux/bcm47xx/generic/profiles/221-Broadcom-bgmac-wl.mk
@@ -4,7 +4,7 @@
 
 define Profile/Broadcom-bgmac-wl
   NAME:=Broadcom SoC, bgmac Ethernet, BCM43xx WiFi (wl, proprietary)
-  PACKAGES:=-wpad-basic-wolfssl kmod-bgmac kmod-brcm-wl wlc nas
+  PACKAGES:=-wpad-basic-mbedtls kmod-bgmac kmod-brcm-wl wlc nas
 endef
 
 define Profile/Broadcom-bgmac-wl/Description
diff --git a/target/linux/bcm47xx/generic/profiles/225-Broadcom-bgmac-none.mk b/target/linux/bcm47xx/generic/profiles/225-Broadcom-bgmac-none.mk
index 8ce675543e..67cb64e641 100644
--- a/target/linux/bcm47xx/generic/profiles/225-Broadcom-bgmac-none.mk
+++ b/target/linux/bcm47xx/generic/profiles/225-Broadcom-bgmac-none.mk
@@ -4,7 +4,7 @@
 
 define Profile/Broadcom-bgmac-none
   NAME:=Broadcom SoC, bgmac Ethernet, No WiFi
-  PACKAGES:=-wpad-basic-wolfssl kmod-bgmac
+  PACKAGES:=-wpad-basic-mbedtls kmod-bgmac
 endef
 
 define Profile/Broadcom-bgmac-none/Description
diff --git a/target/linux/bcm47xx/generic/profiles/PS-1208MFG.mk b/target/linux/bcm47xx/generic/profiles/PS-1208MFG.mk
index 88b417840a..cc0136a838 100644
--- a/target/linux/bcm47xx/generic/profiles/PS-1208MFG.mk
+++ b/target/linux/bcm47xx/generic/profiles/PS-1208MFG.mk
@@ -4,7 +4,7 @@
 
 define Profile/Ps1208mfg
   NAME:=Edimax PS-1208MFG
-  PACKAGES:=-firewall -dropbear -dnsmasq -mtd -ppp -wpad-basic-wolfssl kmod-b44 block-mount kmod-usb-storage kmod-usb2 kmod-usb-ohci -iptables -swconfig kmod-fs-ext4
+  PACKAGES:=-firewall -dropbear -dnsmasq -mtd -ppp -wpad-basic-mbedtls kmod-b44 block-mount kmod-usb-storage kmod-usb2 kmod-usb-ohci -iptables -swconfig kmod-fs-ext4
 endef
 
 define Profile/Ps1208mfg/Description
diff --git a/target/linux/bcm47xx/generic/target.mk b/target/linux/bcm47xx/generic/target.mk
index 70397de398..3edeef2a51 100644
--- a/target/linux/bcm47xx/generic/target.mk
+++ b/target/linux/bcm47xx/generic/target.mk
@@ -1,7 +1,7 @@
 BOARDNAME:=Generic
 FEATURES+=pcmcia
 
-DEFAULT_PACKAGES += wpad-basic-wolfssl
+DEFAULT_PACKAGES += wpad-basic-mbedtls
 
 define Target/Description
 	Build generic firmware for all Broadcom BCM47xx and BCM53xx MIPS
diff --git a/target/linux/bcm47xx/legacy/profiles/101-Broadcom-wl.mk b/target/linux/bcm47xx/legacy/profiles/101-Broadcom-wl.mk
index a4c58f6334..0d98981520 100644
--- a/target/linux/bcm47xx/legacy/profiles/101-Broadcom-wl.mk
+++ b/target/linux/bcm47xx/legacy/profiles/101-Broadcom-wl.mk
@@ -4,7 +4,7 @@
 
 define Profile/Broadcom-wl
   NAME:=Broadcom SoC, all Ethernet, BCM43xx WiFi (wl, proprietary)
-  PACKAGES:=-wpad-basic-wolfssl kmod-brcm-wl-mini wlc nas
+  PACKAGES:=-wpad-basic-mbedtls kmod-brcm-wl-mini wlc nas
 endef
 
 define Profile/Broadcom-wl/Description
diff --git a/target/linux/bcm47xx/legacy/target.mk b/target/linux/bcm47xx/legacy/target.mk
index e3586a8add..ac89d798ad 100644
--- a/target/linux/bcm47xx/legacy/target.mk
+++ b/target/linux/bcm47xx/legacy/target.mk
@@ -1,7 +1,7 @@
 FEATURES += low_mem pcmcia small_flash
 BOARDNAME:=Legacy (BMIPS3300)
 
-DEFAULT_PACKAGES += wpad-basic-wolfssl
+DEFAULT_PACKAGES += wpad-basic-mbedtls
 
 define Target/Description
 	Build firmware for Broadcom BCM47xx and BCM53xx devices with
diff --git a/target/linux/bcm47xx/mips74k/profiles/102-Broadcom-wl.mk b/target/linux/bcm47xx/mips74k/profiles/102-Broadcom-wl.mk
index 66a44dc0fb..0b0e706770 100644
--- a/target/linux/bcm47xx/mips74k/profiles/102-Broadcom-wl.mk
+++ b/target/linux/bcm47xx/mips74k/profiles/102-Broadcom-wl.mk
@@ -4,7 +4,7 @@
 
 define Profile/Broadcom-mips74k-wl
   NAME:=Broadcom SoC, BCM43xx WiFi (proprietary wl)
-  PACKAGES:=-wpad-basic-wolfssl kmod-brcm-wl wlc nas
+  PACKAGES:=-wpad-basic-mbedtls kmod-brcm-wl wlc nas
 endef
 
 define Profile/Broadcom-mips74k-wl/Description
diff --git a/target/linux/bcm47xx/mips74k/profiles/103-Broadcom-none.mk b/target/linux/bcm47xx/mips74k/profiles/103-Broadcom-none.mk
index d5e3f57fcd..d225e2fc70 100644
--- a/target/linux/bcm47xx/mips74k/profiles/103-Broadcom-none.mk
+++ b/target/linux/bcm47xx/mips74k/profiles/103-Broadcom-none.mk
@@ -4,7 +4,7 @@
 
 define Profile/Broadcom-mips74k-none
   NAME:=Broadcom SoC, No WiFi
-  PACKAGES:=-wpad-basic-wolfssl
+  PACKAGES:=-wpad-basic-mbedtls
 endef
 
 define Profile/Broadcom-mips74k-none/Description
diff --git a/target/linux/bcm47xx/mips74k/target.mk b/target/linux/bcm47xx/mips74k/target.mk
index ee20982e54..e982b15b0c 100644
--- a/target/linux/bcm47xx/mips74k/target.mk
+++ b/target/linux/bcm47xx/mips74k/target.mk
@@ -1,7 +1,7 @@
 BOARDNAME:=MIPS 74K
 CPU_TYPE:=74kc
 
-DEFAULT_PACKAGES += wpad-basic-wolfssl
+DEFAULT_PACKAGES += wpad-basic-mbedtls
 
 define Target/Description
 	Build firmware for Broadcom BCM47xx and BCM53xx devices with
diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile
index ed0b755364..ed2e9c6821 100644
--- a/target/linux/bcm53xx/image/Makefile
+++ b/target/linux/bcm53xx/image/Makefile
@@ -111,7 +111,7 @@ DEVICE_VARS += SIGNATURE
 DEVICE_VARS += NETGEAR_BOARD_ID NETGEAR_REGION TPLINK_BOARD
 DEVICE_VARS += LUXUL_BOARD
 
-IEEE8021X := wpad-basic-wolfssl
+IEEE8021X := wpad-basic-mbedtls
 B43 := $(IEEE8021X) kmod-b43
 BRCMFMAC_43602A1 := $(IEEE8021X) kmod-brcmfmac brcmfmac-firmware-43602a1-pcie
 BRCMFMAC_4366B1 := $(IEEE8021X) kmod-brcmfmac brcmfmac-firmware-4366b1-pcie
diff --git a/target/linux/bcm63xx/image/Makefile b/target/linux/bcm63xx/image/Makefile
index f35358173c..9137971fa5 100644
--- a/target/linux/bcm63xx/image/Makefile
+++ b/target/linux/bcm63xx/image/Makefile
@@ -305,12 +305,12 @@ define Device/Default
 endef
 DEVICE_VARS += CHIP_ID DEVICE_LOADADDR
 
-ATH5K_PACKAGES := kmod-ath5k wpad-basic-wolfssl
-ATH9K_PACKAGES := kmod-ath9k wpad-basic-wolfssl
-B43_PACKAGES := kmod-b43 wpad-basic-wolfssl
+ATH5K_PACKAGES := kmod-ath5k wpad-basic-mbedtls
+ATH9K_PACKAGES := kmod-ath9k wpad-basic-mbedtls
+B43_PACKAGES := kmod-b43 wpad-basic-mbedtls
 BRCMWL_PACKAGES := kmod-brcm-wl nas wlc
-RT28_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl
-RT61_PACKAGES := kmod-rt61-pci wpad-basic-wolfssl
+RT28_PACKAGES := kmod-rt2800-pci wpad-basic-mbedtls
+RT61_PACKAGES := kmod-rt61-pci wpad-basic-mbedtls
 USB1_PACKAGES := kmod-usb-ohci kmod-usb-ledtrig-usbport
 USB2_PACKAGES := kmod-usb2 kmod-usb-ohci kmod-usb-ledtrig-usbport
 
diff --git a/target/linux/bcm63xx/profiles/default.mk b/target/linux/bcm63xx/profiles/default.mk
index 3e8b07d35f..65f2111087 100644
--- a/target/linux/bcm63xx/profiles/default.mk
+++ b/target/linux/bcm63xx/profiles/default.mk
@@ -4,7 +4,7 @@
 
 define Profile/Default
   NAME:=Default Profile
-  PACKAGES:=kmod-b43 wpad-basic-wolfssl
+  PACKAGES:=kmod-b43 wpad-basic-mbedtls
   PRIORITY:=1
 endef
 
diff --git a/target/linux/bmips/image/Makefile b/target/linux/bmips/image/Makefile
index 89cd04b0ec..86ab68d244 100644
--- a/target/linux/bmips/image/Makefile
+++ b/target/linux/bmips/image/Makefile
@@ -249,8 +249,8 @@ define Device/Default
   DEVICE_LOADADDR :=
 endef
 
-ATH9K_PACKAGES := kmod-ath9k wpad-basic-wolfssl
-B43_PACKAGES := kmod-b43 wpad-basic-wolfssl
+ATH9K_PACKAGES := kmod-ath9k wpad-basic-mbedtls
+B43_PACKAGES := kmod-b43 wpad-basic-mbedtls
 USB1_PACKAGES := kmod-usb-ohci kmod-ledtrig-usbdev
 USB2_PACKAGES := $(USB1_PACKAGES) kmod-usb2
 
diff --git a/target/linux/ipq40xx/Makefile b/target/linux/ipq40xx/Makefile
index 1da72664ad..53b2f909ae 100644
--- a/target/linux/ipq40xx/Makefile
+++ b/target/linux/ipq40xx/Makefile
@@ -16,7 +16,7 @@ include $(INCLUDE_DIR)/target.mk
 DEFAULT_PACKAGES += \
 	kmod-usb-dwc3-qcom \
 	kmod-leds-gpio kmod-gpio-button-hotplug \
-	kmod-ath10k-ct wpad-basic-wolfssl \
+	kmod-ath10k-ct wpad-basic-mbedtls \
 	kmod-usb3 kmod-usb-dwc3 ath10k-firmware-qca4019-ct \
 	uboot-envtools
 
diff --git a/target/linux/ipq806x/Makefile b/target/linux/ipq806x/Makefile
index 5c89d413c0..057446f755 100644
--- a/target/linux/ipq806x/Makefile
+++ b/target/linux/ipq806x/Makefile
@@ -20,7 +20,7 @@ DEFAULT_PACKAGES += \
 	kmod-ata-ahci kmod-ata-ahci-platform \
 	kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \
 	kmod-phy-qcom-ipq806x-usb kmod-usb3 kmod-usb-dwc3-qcom \
-	kmod-ath10k-ct wpad-basic-wolfssl \
+	kmod-ath10k-ct wpad-basic-mbedtls \
 	uboot-envtools
 
 $(eval $(call BuildTarget))
diff --git a/target/linux/ipq807x/Makefile b/target/linux/ipq807x/Makefile
index 539d930ce3..e432369ce9 100644
--- a/target/linux/ipq807x/Makefile
+++ b/target/linux/ipq807x/Makefile
@@ -16,6 +16,6 @@ DEFAULT_PACKAGES += \
 	kmod-leds-gpio kmod-gpio-button-hotplug \
 	libwolfsslcpu-crypto kmod-qca-nss-dp \
 	ath11k-firmware-ipq8074 kmod-ath11k-ahb \
-	wpad-basic-wolfssl uboot-envtools
+	wpad-basic-mbedtls uboot-envtools
 
 $(eval $(call BuildTarget))
diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile
index 60e8654ad3..ea76e21970 100644
--- a/target/linux/kirkwood/image/Makefile
+++ b/target/linux/kirkwood/image/Makefile
@@ -93,7 +93,7 @@ define Device/checkpoint_l-50
   DEVICE_VENDOR := Check Point
   DEVICE_MODEL := L-50
   DEVICE_PACKAGES := kmod-ath9k kmod-gpio-button-hotplug kmod-mvsdio \
-	kmod-rtc-s35390a kmod-usb-ledtrig-usbport wpad-basic-wolfssl
+	kmod-rtc-s35390a kmod-usb-ledtrig-usbport wpad-basic-mbedtls
   IMAGES := sysupgrade.bin
 endef
 TARGET_DEVICES += checkpoint_l-50
@@ -145,7 +145,7 @@ define Device/endian_4i-edge-200
   DEVICE_MODEL := 4i Edge 200
   DEVICE_ALT0_VENDOR := Endian
   DEVICE_ALT0_MODEL := UTM Mini Firewall
-  DEVICE_PACKAGES := kmod-ath9k kmod-mvsdio wpad-basic-wolfssl
+  DEVICE_PACKAGES := kmod-ath9k kmod-mvsdio wpad-basic-mbedtls
   KERNEL_SIZE := 4096k
   IMAGES := sysupgrade.bin
 endef
@@ -201,7 +201,7 @@ TARGET_DEVICES += iptime_nas1
 
 define Device/linksys
   DEVICE_VENDOR := Linksys
-  DEVICE_PACKAGES := kmod-mwl8k wpad-basic-wolfssl kmod-gpio-button-hotplug
+  DEVICE_PACKAGES := kmod-mwl8k wpad-basic-mbedtls kmod-gpio-button-hotplug
   KERNEL_IN_UBI :=
   UBINIZE_OPTS := -E 5
   IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
diff --git a/target/linux/lantiq/image/ar9.mk b/target/linux/lantiq/image/ar9.mk
index 434dacb121..25e4b1fe65 100644
--- a/target/linux/lantiq/image/ar9.mk
+++ b/target/linux/lantiq/image/ar9.mk
@@ -4,7 +4,7 @@ define Device/avm_fritz7312
   SOC := ar9
   IMAGE_SIZE := 15744k
   LOADER_FLASH_OFFS := 0x31000
-  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \
+  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls \
 	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 \
@@ -20,7 +20,7 @@ define Device/avm_fritz7320
   SOC := ar9
   IMAGE_SIZE := 15744k
   LOADER_FLASH_OFFS := 0x31000
-  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \
+  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls \
 	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 \
@@ -42,7 +42,7 @@ define Device/bt_homehub-v3a
 	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 \
+	kmod-ath9k kmod-owl-loader wpad-basic-mbedtls \
 	uboot-envtools
   SUPPORTED_DEVICES += BTHOMEHUBV3A
   DEFAULT := n
@@ -60,7 +60,7 @@ define Device/buffalo_wbmr-hp-g300h-a
 	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-ath9k kmod-owl-loader wpad-basic-wolfssl
+	kmod-ath9k kmod-owl-loader wpad-basic-mbedtls
   SUPPORTED_DEVICES := WBMR buffalo,wbmr-hp-g300h
 endef
 TARGET_DEVICES += buffalo_wbmr-hp-g300h-a
@@ -76,7 +76,7 @@ define Device/buffalo_wbmr-hp-g300h-b
 	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-ath9k kmod-owl-loader wpad-basic-wolfssl
+	kmod-ath9k kmod-owl-loader wpad-basic-mbedtls
   SUPPORTED_DEVICES := WBMR buffalo,wbmr-hp-g300h
 endef
 TARGET_DEVICES += buffalo_wbmr-hp-g300h-b
@@ -106,7 +106,7 @@ define Device/netgear_dgn3500
 	dgn3500-sercom-footer $(DGN3500_KERNEL_OFFSET_HEX) "WW" | pad-rootfs | \
 	check-size 16320k | pad-to 16384k
   DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \
-	kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \
+	kmod-ath9k kmod-owl-loader wpad-basic-mbedtls \
 	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
@@ -128,7 +128,7 @@ define Device/netgear_dgn3500b
 	dgn3500-sercom-footer $(DGN3500_KERNEL_OFFSET_HEX) "DE" | pad-rootfs | \
 	check-size 16320k | pad-to 16384k
   DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \
-	kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \
+	kmod-ath9k kmod-owl-loader wpad-basic-mbedtls \
 	kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
 	kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
 	kmod-ltq-deu-ar9 ltq-adsl-app ppp-mod-pppoa
@@ -141,7 +141,7 @@ define Device/zte_h201l
   DEVICE_MODEL := H201L
   IMAGE_SIZE := 7808k
   SOC := ar9
-  DEVICE_PACKAGES := kmod-ath9k-htc wpad-basic-wolfssl \
+  DEVICE_PACKAGES := kmod-ath9k-htc wpad-basic-mbedtls \
 	kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
 	kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
 	kmod-ltq-deu-ar9 ltq-adsl-app ppp-mod-pppoe \
@@ -157,7 +157,7 @@ define Device/zyxel_p-2601hn
   DEVICE_VARIANT := F1/F3
   IMAGE_SIZE := 15616k
   SOC := ar9
-  DEVICE_PACKAGES := kmod-rt2800-usb wpad-basic-wolfssl \
+  DEVICE_PACKAGES := kmod-rt2800-usb wpad-basic-mbedtls \
 	kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \
 	kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \
 	kmod-ltq-deu-ar9 ltq-adsl-app ppp-mod-pppoe \
diff --git a/target/linux/lantiq/image/danube.mk b/target/linux/lantiq/image/danube.mk
index 9cafd2b258..a54cb3117d 100644
--- a/target/linux/lantiq/image/danube.mk
+++ b/target/linux/lantiq/image/danube.mk
@@ -10,7 +10,7 @@ define Device/arcadyan_arv4510pw
 	kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
 	ltq-adsl-app ppp-mod-pppoa \
 	kmod-ltq-tapi kmod-ltq-vmmc \
-	kmod-rt2800-pci kmod-ath5k wpad-basic-wolfssl
+	kmod-rt2800-pci kmod-ath5k wpad-basic-mbedtls
   SUPPORTED_DEVICES += ARV4510PW
 endef
 TARGET_DEVICES += arcadyan_arv4510pw
@@ -43,7 +43,7 @@ define Device/arcadyan_arv7506pw11
   DEVICE_PACKAGES := kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
 	kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
 	ltq-adsl-app ppp-mod-pppoa \
-	kmod-rt2800-pci wpad-basic-wolfssl
+	kmod-rt2800-pci wpad-basic-mbedtls
   SUPPORTED_DEVICES += ARV7506PW11
 endef
 TARGET_DEVICES += arcadyan_arv7506pw11
@@ -60,7 +60,7 @@ define Device/arcadyan_arv7510pw22
 	kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
 	ltq-adsl-app ppp-mod-pppoa \
 	kmod-ltq-tapi kmod-ltq-vmmc \
-	kmod-rt2800-pci wpad-basic-wolfssl \
+	kmod-rt2800-pci wpad-basic-mbedtls \
 	kmod-usb-uhci kmod-usb2 kmod-usb2-pci
   SUPPORTED_DEVICES += ARV7510PW22
 endef
@@ -77,7 +77,7 @@ define Device/arcadyan_arv7518pw
 	kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
 	kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
 	ltq-adsl-app ppp-mod-pppoa \
-	kmod-ath9k kmod-owl-loader wpad-basic-wolfssl
+	kmod-ath9k kmod-owl-loader wpad-basic-mbedtls
   SUPPORTED_DEVICES += ARV7518PW
 endef
 TARGET_DEVICES += arcadyan_arv7518pw
@@ -93,7 +93,7 @@ define Device/arcadyan_arv7519pw
 	kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
 	kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
 	ltq-adsl-app ppp-mod-pppoa \
-	kmod-rt2800-pci wpad-basic-wolfssl
+	kmod-rt2800-pci wpad-basic-mbedtls
   SUPPORTED_DEVICES += ARV7519PW
 endef
 TARGET_DEVICES += arcadyan_arv7519pw
@@ -106,7 +106,7 @@ define Device/arcadyan_arv7525pw
   DEVICE_ALT0_VARIANT := Typ A
   IMAGE_SIZE := 3776k
   SOC := danube
-  DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl \
+  DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-mbedtls \
 	kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
 	kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
 	ltq-adsl-app ppp-mod-pppoa -swconfig
@@ -127,7 +127,7 @@ define Device/arcadyan_arv752dpw
 	kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
 	ltq-adsl-app ppp-mod-pppoa \
 	kmod-ltq-tapi kmod-ltq-vmmc \
-	kmod-rt2800-pci wpad-basic-wolfssl
+	kmod-rt2800-pci wpad-basic-mbedtls
   SUPPORTED_DEVICES += ARV752DPW
 endef
 TARGET_DEVICES += arcadyan_arv752dpw
@@ -144,7 +144,7 @@ define Device/arcadyan_arv752dpw22
 	kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
 	ltq-adsl-app ppp-mod-pppoa \
 	kmod-ltq-tapi kmod-ltq-vmmc \
-	kmod-rt2800-pci wpad-basic-wolfssl
+	kmod-rt2800-pci wpad-basic-mbedtls
   SUPPORTED_DEVICES += ARV752DPW22
 endef
 TARGET_DEVICES += arcadyan_arv752dpw22
@@ -160,7 +160,7 @@ define Device/arcadyan_arv8539pw22
 	kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
 	kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
 	ltq-adsl-app ppp-mod-pppoa \
-	kmod-ath9k kmod-owl-loader wpad-basic-wolfssl
+	kmod-ath9k kmod-owl-loader wpad-basic-mbedtls
   SUPPORTED_DEVICES += ARV8539PW22
 endef
 TARGET_DEVICES += arcadyan_arv8539pw22
@@ -176,7 +176,7 @@ define Device/audiocodes_mp-252
 	kmod-usb-ledtrig-usbport kmod-usb-dwc2 \
 	kmod-rt2800-pci \
 	ltq-adsl-app ppp-mod-pppoa \
-	wpad-basic-wolfssl
+	wpad-basic-mbedtls
   SUPPORTED_DEVICES += ACMP252
 endef
 TARGET_DEVICES += audiocodes_mp-252
@@ -193,7 +193,7 @@ define Device/bt_homehub-v2b
 	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
+	kmod-ath9k kmod-owl-loader wpad-basic-mbedtls
   SUPPORTED_DEVICES += BTHOMEHUBV2B
   DEFAULT := n
 endef
@@ -217,7 +217,7 @@ define Device/siemens_gigaset-sx76x
 	kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
 	kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
 	ltq-adsl-app ppp-mod-pppoe \
-	kmod-ath5k wpad-basic-wolfssl
+	kmod-ath5k wpad-basic-mbedtls
   SUPPORTED_DEVICES += GIGASX76X
 endef
 TARGET_DEVICES += siemens_gigaset-sx76x
diff --git a/target/linux/lantiq/image/tp-link.mk b/target/linux/lantiq/image/tp-link.mk
index 756105b94c..751f61589d 100644
--- a/target/linux/lantiq/image/tp-link.mk
+++ b/target/linux/lantiq/image/tp-link.mk
@@ -26,7 +26,7 @@ define Device/tplink_tdw8970
   TPLINK_HWID := 0x89700001
   TPLINK_HWREV := 1
   IMAGE_SIZE := 7680k
-  DEVICE_PACKAGES:= kmod-ath9k wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport
+  DEVICE_PACKAGES:= kmod-ath9k wpad-basic-mbedtls kmod-usb-dwc2 kmod-usb-ledtrig-usbport
   SUPPORTED_DEVICES += TDW8970
 endef
 TARGET_DEVICES += tplink_tdw8970
@@ -40,7 +40,7 @@ define Device/tplink_tdw8980
   TPLINK_HWID := 0x89800001
   TPLINK_HWREV := 14
   IMAGE_SIZE := 7680k
-  DEVICE_PACKAGES:= kmod-ath9k kmod-owl-loader wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport
+  DEVICE_PACKAGES:= kmod-ath9k kmod-owl-loader wpad-basic-mbedtls kmod-usb-dwc2 kmod-usb-ledtrig-usbport
   SUPPORTED_DEVICES += TDW8980
 endef
 TARGET_DEVICES += tplink_tdw8980
@@ -54,7 +54,7 @@ define Device/tplink_vr200
   TPLINK_HWID := 0x63e64801
   TPLINK_HWREV := 0x53
   IMAGE_SIZE := 15808k
-  DEVICE_PACKAGES:= kmod-mt76x0e wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport
+  DEVICE_PACKAGES:= kmod-mt76x0e wpad-basic-mbedtls kmod-usb-dwc2 kmod-usb-ledtrig-usbport
   SUPPORTED_DEVICES += VR200
 endef
 TARGET_DEVICES += tplink_vr200
@@ -68,7 +68,7 @@ define Device/tplink_vr200v
   TPLINK_HWID := 0x73b70801
   TPLINK_HWREV := 0x2f
   IMAGE_SIZE := 15808k
-  DEVICE_PACKAGES:= kmod-mt76x0e wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-ltq-tapi kmod-ltq-vmmc
+  DEVICE_PACKAGES:= kmod-mt76x0e wpad-basic-mbedtls kmod-usb-dwc2 kmod-usb-ledtrig-usbport kmod-ltq-tapi kmod-ltq-vmmc
   SUPPORTED_DEVICES += VR200v
 endef
 TARGET_DEVICES += tplink_vr200v
diff --git a/target/linux/lantiq/image/vr9.mk b/target/linux/lantiq/image/vr9.mk
index deea399667..804088032f 100644
--- a/target/linux/lantiq/image/vr9.mk
+++ b/target/linux/lantiq/image/vr9.mk
@@ -54,7 +54,7 @@ define Device/arcadyan_vgv7510kw22-brn
   SIGNATURE := BRNDA6431
   MAGIC := 0x12345678
   CRC32_POLY := 0x04c11db7
-  DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc
+  DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-mbedtls kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc
   SUPPORTED_DEVICES += VGV7510KW22BRN
 endef
 TARGET_DEVICES += arcadyan_vgv7510kw22-brn
@@ -68,7 +68,7 @@ define Device/arcadyan_vgv7510kw22-nor
   DEVICE_ALT0_MODEL := Box 6431
   DEVICE_ALT0_VARIANT := NOR
   IMAGE_SIZE := 15232k
-  DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc
+  DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-mbedtls kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc
   SUPPORTED_DEVICES += VGV7510KW22NOR
 endef
 TARGET_DEVICES += arcadyan_vgv7510kw22-nor
@@ -86,7 +86,7 @@ define Device/arcadyan_vgv7519-brn
   SIGNATURE := 5D00008000
   MAGIC := 0x12345678
   CRC32_POLY := 0x2083b8ed
-  DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc
+  DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-mbedtls kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc
   SUPPORTED_DEVICES += VGV7519BRN
 endef
 TARGET_DEVICES += arcadyan_vgv7519-brn
@@ -100,7 +100,7 @@ define Device/arcadyan_vgv7519-nor
   DEVICE_ALT0_MODEL := Experiabox 8
   DEVICE_ALT0_VARIANT := NOR
   IMAGE_SIZE := 15360k
-  DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc
+  DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-mbedtls kmod-usb-dwc2 kmod-ltq-tapi kmod-ltq-vmmc
   SUPPORTED_DEVICES += VGV7519NOR
 endef
 TARGET_DEVICES += arcadyan_vgv7519-nor
@@ -116,7 +116,7 @@ define Device/avm_fritz3370
   IMAGES += eva-kernel.bin eva-filesystem.bin
   IMAGE/eva-kernel.bin := append-kernel
   IMAGE/eva-filesystem.bin := append-ubi
-  DEVICE_PACKAGES := kmod-ath9k wpad-basic-wolfssl kmod-usb-dwc2 fritz-tffs
+  DEVICE_PACKAGES := kmod-ath9k wpad-basic-mbedtls kmod-usb-dwc2 fritz-tffs
 endef
 
 define Device/avm_fritz3370-rev2-hynix
@@ -142,7 +142,7 @@ define Device/avm_fritz3390
   DEVICE_MODEL := FRITZ!Box 3390
   KERNEL_SIZE := 4096k
   IMAGE_SIZE := 49152k
-  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \
+  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls \
 	kmod-usb-dwc2 fritz-tffs
 endef
 TARGET_DEVICES += avm_fritz3390
@@ -152,7 +152,7 @@ define Device/avm_fritz7360sl
   $(Device/AVM)
   DEVICE_MODEL := FRITZ!Box 7360 SL
   IMAGE_SIZE := 15744k
-  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl kmod-usb-dwc2
+  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls kmod-usb-dwc2
   SUPPORTED_DEVICES += FRITZ7360SL
 endef
 TARGET_DEVICES += avm_fritz7360sl
@@ -163,7 +163,7 @@ define Device/avm_fritz7360-v2
   DEVICE_MODEL := FRITZ!Box 7360
   DEVICE_VARIANT := v2
   IMAGE_SIZE := 32128k
-  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl kmod-usb-dwc2
+  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls kmod-usb-dwc2
 endef
 TARGET_DEVICES += avm_fritz7360-v2
 
@@ -174,7 +174,7 @@ define Device/avm_fritz7362sl
   DEVICE_MODEL := FRITZ!Box 7362 SL
   KERNEL_SIZE := 4096k
   IMAGE_SIZE := 49152k
-  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl kmod-usb-dwc2 fritz-tffs
+  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls kmod-usb-dwc2 fritz-tffs
 endef
 TARGET_DEVICES += avm_fritz7362sl
 
@@ -186,7 +186,7 @@ define Device/avm_fritz7412
   BOARD_NAME := FRITZ7412
   KERNEL_SIZE := 4096k
   IMAGE_SIZE := 49152k
-  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl fritz-tffs-nand fritz-caldata
+  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls fritz-tffs-nand fritz-caldata
 endef
 TARGET_DEVICES += avm_fritz7412
 
@@ -197,7 +197,7 @@ define Device/avm_fritz7430
   DEVICE_MODEL := FRITZ!Box 7430
   KERNEL_SIZE := 4096k
   IMAGE_SIZE := 49152k
-  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader kmod-usb-dwc2 wpad-basic-wolfssl \
+  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader kmod-usb-dwc2 wpad-basic-mbedtls \
 	fritz-tffs-nand fritz-caldata
 endef
 TARGET_DEVICES += avm_fritz7430
@@ -210,7 +210,7 @@ define Device/bt_homehub-v5a
   DEVICE_VARIANT := Type A
   BOARD_NAME := BTHOMEHUBV5A
   DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader \
-	kmod-ath10k-ct ath10k-firmware-qca988x-ct wpad-basic-wolfssl kmod-usb-dwc2
+	kmod-ath10k-ct ath10k-firmware-qca988x-ct wpad-basic-mbedtls kmod-usb-dwc2
   SUPPORTED_DEVICES += BTHOMEHUBV5A
 endef
 TARGET_DEVICES += bt_homehub-v5a
@@ -220,7 +220,7 @@ define Device/buffalo_wbmr-300hpd
   DEVICE_VENDOR := Buffalo
   DEVICE_MODEL := WBMR-300HPD
   IMAGE_SIZE := 15616k
-  DEVICE_PACKAGES := kmod-mt7603 wpad-basic-wolfssl kmod-usb-dwc2
+  DEVICE_PACKAGES := kmod-mt7603 wpad-basic-mbedtls kmod-usb-dwc2
   SUPPORTED_DEVICES += WBMR300
 endef
 TARGET_DEVICES += buffalo_wbmr-300hpd
@@ -232,7 +232,7 @@ define Device/lantiq_easy80920-nand
   DEVICE_MODEL := VR9 EASY80920
   DEVICE_VARIANT := NAND
   IMAGE_SIZE := 64512k
-  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport
+  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls kmod-usb-dwc2 kmod-usb-ledtrig-usbport
 endef
 TARGET_DEVICES += lantiq_easy80920-nand
 
@@ -242,7 +242,7 @@ define Device/lantiq_easy80920-nor
   DEVICE_MODEL := VR9 EASY80920
   DEVICE_VARIANT := NOR
   IMAGE_SIZE := 7936k
-  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport
+  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls kmod-usb-dwc2 kmod-usb-ledtrig-usbport
 endef
 TARGET_DEVICES += lantiq_easy80920-nor
 
@@ -269,7 +269,7 @@ define Device/zyxel_p-2812hnu-f1
   DEVICE_MODEL := P-2812HNU
   DEVICE_VARIANT := F1
   BOARD_NAME := P2812HNUF1
-  DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl kmod-usb-dwc2 kmod-usb-ledtrig-usbport
+  DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-mbedtls kmod-usb-dwc2 kmod-usb-ledtrig-usbport
   KERNEL_SIZE := 3072k
   SUPPORTED_DEVICES += P2812HNUF1
 endef
@@ -282,7 +282,7 @@ define Device/zyxel_p-2812hnu-f3
   DEVICE_MODEL := P-2812HNU
   DEVICE_VARIANT := F3
   BOARD_NAME := P2812HNUF3
-  DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-wolfssl kmod-usb-dwc2
+  DEVICE_PACKAGES := kmod-rt2800-pci wpad-basic-mbedtls kmod-usb-dwc2
   KERNEL_SIZE := 2048k
   SUPPORTED_DEVICES += P2812HNUF3
   DEFAULT := n
diff --git a/target/linux/lantiq/image/xway_legacy.mk b/target/linux/lantiq/image/xway_legacy.mk
index a0bf7a85ac..47b52277f6 100644
--- a/target/linux/lantiq/image/xway_legacy.mk
+++ b/target/linux/lantiq/image/xway_legacy.mk
@@ -6,7 +6,7 @@ define Device/arcadyan_arv4518pwr01
 	kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
 	kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
 	ltq-adsl-app ppp-mod-pppoa \
-	kmod-ath5k wpad-basic-wolfssl
+	kmod-ath5k wpad-basic-mbedtls
   SUPPORTED_DEVICES += ARV4518PWR01
   DEFAULT := n
 endef
@@ -20,7 +20,7 @@ define Device/arcadyan_arv4518pwr01a
 	kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
 	kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \
 	ltq-adsl-app ppp-mod-pppoa \
-	kmod-ath5k wpad-basic-wolfssl
+	kmod-ath5k wpad-basic-mbedtls
   SUPPORTED_DEVICES += ARV4518PWR01A
   DEFAULT := n
 endef
@@ -38,7 +38,7 @@ define Device/arcadyan_arv4520pw
 	kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
 	kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
 	ltq-adsl-app ppp-mod-pppoa \
-	kmod-rt61-pci wpad-basic-wolfssl
+	kmod-rt61-pci wpad-basic-mbedtls
   SUPPORTED_DEVICES += ARV4520PW
   DEFAULT := n
 endef
@@ -51,7 +51,7 @@ define Device/arcadyan_arv4525pw
   DEVICE_ALT0_MODEL := Speedport W502V
   DEVICE_ALT0_VARIANT := Typ A
   IMAGE_SIZE := 3776k
-  DEVICE_PACKAGES := kmod-ath5k wpad-basic-wolfssl \
+  DEVICE_PACKAGES := kmod-ath5k wpad-basic-mbedtls \
 	kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
 	kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
 	ltq-adsl-app ppp-mod-pppoa -swconfig
@@ -67,7 +67,7 @@ define Device/arcadyan_arv452cqw
   DEVICE_ALT0_MODEL := Easybox 801
   IMAGE_SIZE := 3776k
   DEVICE_PACKAGES := kmod-usb-dwc2 kmod-usb-ledtrig-usbport \
-	kmod-ath5k wpad-basic-wolfssl \
+	kmod-ath5k wpad-basic-mbedtls \
 	kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \
 	kmod-ltq-adsl-danube-fw-b kmod-ltq-atm-danube \
 	ltq-adsl-app ppp-mod-pppoa
diff --git a/target/linux/malta/Makefile b/target/linux/malta/Makefile
index fb24708991..2ca43fa2e8 100644
--- a/target/linux/malta/Makefile
+++ b/target/linux/malta/Makefile
@@ -14,6 +14,6 @@ KERNEL_PATCHVER:=5.15
 
 include $(INCLUDE_DIR)/target.mk
 
-DEFAULT_PACKAGES += wpad-basic-wolfssl kmod-mac80211-hwsim kmod-pcnet32 mkf2fs e2fsprogs
+DEFAULT_PACKAGES += wpad-basic-mbedtls kmod-mac80211-hwsim kmod-pcnet32 mkf2fs e2fsprogs
 
 $(eval $(call BuildTarget))
diff --git a/target/linux/mediatek/filogic/target.mk b/target/linux/mediatek/filogic/target.mk
index 0c5bf4844e..a255566cc9 100644
--- a/target/linux/mediatek/filogic/target.mk
+++ b/target/linux/mediatek/filogic/target.mk
@@ -2,7 +2,7 @@ ARCH:=aarch64
 SUBTARGET:=filogic
 BOARDNAME:=Filogic 830 (MT7986)
 CPU_TYPE:=cortex-a53
-DEFAULT_PACKAGES += kmod-crypto-hw-safexcel kmod-mt7915e kmod-mt7986-firmware wpad-basic-wolfssl uboot-envtools
+DEFAULT_PACKAGES += kmod-crypto-hw-safexcel kmod-mt7915e kmod-mt7986-firmware wpad-basic-mbedtls uboot-envtools
 KERNELNAME:=Image dtbs
 
 define Target/Description
diff --git a/target/linux/mediatek/mt7622/target.mk b/target/linux/mediatek/mt7622/target.mk
index 7c9d57b6a1..7742672a51 100644
--- a/target/linux/mediatek/mt7622/target.mk
+++ b/target/linux/mediatek/mt7622/target.mk
@@ -2,7 +2,7 @@ ARCH:=aarch64
 SUBTARGET:=mt7622
 BOARDNAME:=MT7622
 CPU_TYPE:=cortex-a53
-DEFAULT_PACKAGES += kmod-mt7622-firmware wpad-basic-wolfssl uboot-envtools
+DEFAULT_PACKAGES += kmod-mt7622-firmware wpad-basic-mbedtls uboot-envtools
 KERNELNAME:=Image dtbs
 
 define Target/Description
diff --git a/target/linux/mpc85xx/Makefile b/target/linux/mpc85xx/Makefile
index 552b981104..31d0d45f4f 100644
--- a/target/linux/mpc85xx/Makefile
+++ b/target/linux/mpc85xx/Makefile
@@ -20,7 +20,7 @@ include $(INCLUDE_DIR)/target.mk
 
 DEFAULT_PACKAGES += \
 	kmod-input-core kmod-input-gpio-keys kmod-button-hotplug \
-	kmod-leds-gpio swconfig kmod-ath9k wpad-basic-wolfssl kmod-usb2 \
+	kmod-leds-gpio swconfig kmod-ath9k wpad-basic-mbedtls kmod-usb2 \
 	uboot-envtools
 
 $(eval $(call BuildTarget))
diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk
index 4b8884383a..aed1d47646 100644
--- a/target/linux/mvebu/image/cortexa9.mk
+++ b/target/linux/mvebu/image/cortexa9.mk
@@ -58,7 +58,7 @@ define Device/cznic_turris-omnia
   KERNEL_INITRAMFS := kernel-bin | gzip | fit gzip $$(KDIR)/image-$$(DEVICE_DTS).dtb
   DEVICE_PACKAGES :=  \
     mkf2fs e2fsprogs kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 \
-    wpad-basic-wolfssl kmod-ath9k kmod-ath10k-ct ath10k-firmware-qca988x-ct \
+    wpad-basic-mbedtls kmod-ath9k kmod-ath10k-ct ath10k-firmware-qca988x-ct \
     partx-utils kmod-i2c-mux-pca954x kmod-leds-turris-omnia
   IMAGES := $$(DEVICE_IMG_PREFIX)-sysupgrade.img.gz omnia-medkit-$$(DEVICE_IMG_PREFIX)-initramfs.tar.gz
   IMAGE/$$(DEVICE_IMG_PREFIX)-sysupgrade.img.gz := boot-scr | boot-img | sdcard-img | gzip | append-metadata
@@ -109,7 +109,7 @@ TARGET_DEVICES += kobol_helios4
 define Device/linksys
   $(Device/NAND-128K)
   DEVICE_VENDOR := Linksys
-  DEVICE_PACKAGES := kmod-mwlwifi wpad-basic-wolfssl
+  DEVICE_PACKAGES := kmod-mwlwifi wpad-basic-mbedtls
   IMAGES += factory.img
   IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | \
 	append-ubi | pad-to $$$$(PAGESIZE)
diff --git a/target/linux/omap/profiles/00-default.mk b/target/linux/omap/profiles/00-default.mk
index 73338d8652..172fbc26b3 100644
--- a/target/linux/omap/profiles/00-default.mk
+++ b/target/linux/omap/profiles/00-default.mk
@@ -8,7 +8,7 @@ define Profile/Default
 	kmod-usb-net-asix kmod-usb-net-asix-ax88179 kmod-usb-net-hso \
 	kmod-usb-net-kaweth kmod-usb-net-pegasus kmod-usb-net-mcs7830 \
 	kmod-usb-net-smsc95xx kmod-usb-net-dm9601-ether \
-	wpad-basic-wolfssl
+	wpad-basic-mbedtls
   PRIORITY := 1
 endef
 
diff --git a/target/linux/oxnas/image/ox820.mk b/target/linux/oxnas/image/ox820.mk
index 8dea842503..deb49b14c4 100644
--- a/target/linux/oxnas/image/ox820.mk
+++ b/target/linux/oxnas/image/ox820.mk
@@ -50,7 +50,7 @@ define Device/cloudengines_pogoplugpro
   DEVICE_MODEL := PogoPlug Pro (with mPCIe)
   SUPPORTED_DEVICES += pogoplug-pro
   DEVICE_PACKAGES := kmod-usb2-oxnas kmod-usb-ledtrig-usbport \
-	kmod-ata-oxnas-sata kmod-rt2800-pci wpad-basic-wolfssl
+	kmod-ata-oxnas-sata kmod-rt2800-pci wpad-basic-mbedtls
 endef
 TARGET_DEVICES += cloudengines_pogoplugpro
 
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index 445d3dec34..e723fe93e0 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -54,7 +54,7 @@ define Device/alfa-network_tube-e4g
   DEVICE_VENDOR := ALFA Network
   DEVICE_MODEL := Tube-E4G
   DEVICE_PACKAGES := kmod-usb2 kmod-usb-ohci uboot-envtools uqmi -iwinfo \
-	-kmod-rt2800-soc -wpad-basic-wolfssl
+	-kmod-rt2800-soc -wpad-basic-mbedtls
   SUPPORTED_DEVICES += tube-e4g
 endef
 TARGET_DEVICES += alfa-network_tube-e4g
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 7f4f338039..8c8c6dee8e 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -155,7 +155,7 @@ define Device/alfa-network_quad-e4g
   DEVICE_VENDOR := ALFA Network
   DEVICE_MODEL := Quad-E4G
   DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 uboot-envtools \
-	-wpad-basic-wolfssl
+	-wpad-basic-mbedtls
   SUPPORTED_DEVICES += quad-e4g
 endef
 TARGET_DEVICES += alfa-network_quad-e4g
@@ -217,7 +217,7 @@ define Device/asiarf_ap7621-001
   IMAGE_SIZE := 16000k
   DEVICE_VENDOR := AsiaRF
   DEVICE_MODEL := AP7621-001
-  DEVICE_PACKAGES := kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 -wpad-basic-wolfssl
+  DEVICE_PACKAGES := kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 -wpad-basic-mbedtls
 endef
 TARGET_DEVICES += asiarf_ap7621-001
 
@@ -226,7 +226,7 @@ define Device/asiarf_ap7621-nv1
   IMAGE_SIZE := 16000k
   DEVICE_VENDOR := AsiaRF
   DEVICE_MODEL := AP7621-NV1
-  DEVICE_PACKAGES := kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 -wpad-basic-wolfssl
+  DEVICE_PACKAGES := kmod-sdhci-mt7620 kmod-mt76x2 kmod-usb3 -wpad-basic-mbedtls
 endef
 TARGET_DEVICES += asiarf_ap7621-nv1
 
@@ -680,7 +680,7 @@ define Device/dual-q_h721
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := Dual-Q
   DEVICE_MODEL := H721
-  DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 -wpad-basic-wolfssl
+  DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 -wpad-basic-mbedtls
 endef
 TARGET_DEVICES += dual-q_h721
 
@@ -923,7 +923,7 @@ define Device/gnubee_gb-pc1
   $(Device/uimage-lzma-loader)
   DEVICE_VENDOR := GnuBee
   DEVICE_MODEL := Personal Cloud One
-  DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 -wpad-basic-wolfssl
+  DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 -wpad-basic-mbedtls
   IMAGE_SIZE := 32448k
 endef
 TARGET_DEVICES += gnubee_gb-pc1
@@ -933,7 +933,7 @@ define Device/gnubee_gb-pc2
   $(Device/uimage-lzma-loader)
   DEVICE_VENDOR := GnuBee
   DEVICE_MODEL := Personal Cloud Two
-  DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 -wpad-basic-wolfssl
+  DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 kmod-sdhci-mt7620 -wpad-basic-mbedtls
   IMAGE_SIZE := 32448k
 endef
 TARGET_DEVICES += gnubee_gb-pc2
@@ -1246,7 +1246,7 @@ define Device/iptime_t5004
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
   DEVICE_VENDOR := ipTIME
   DEVICE_MODEL := T5004
-  DEVICE_PACKAGES := -wpad-basic-wolfssl
+  DEVICE_PACKAGES := -wpad-basic-mbedtls
 endef
 TARGET_DEVICES += iptime_t5004
 
@@ -1431,7 +1431,7 @@ define Device/mediatek_ap-mt7621a-v60
   IMAGE_SIZE := 7872k
   DEVICE_VENDOR := Mediatek
   DEVICE_MODEL := AP-MT7621A-V60 EVB
-  DEVICE_PACKAGES := kmod-usb3 kmod-sdhci-mt7620 kmod-sound-mt7620 -wpad-basic-wolfssl
+  DEVICE_PACKAGES := kmod-usb3 kmod-sdhci-mt7620 kmod-sound-mt7620 -wpad-basic-mbedtls
 endef
 TARGET_DEVICES += mediatek_ap-mt7621a-v60
 
@@ -1441,7 +1441,7 @@ define Device/mediatek_mt7621-eval-board
   IMAGE_SIZE := 15104k
   DEVICE_VENDOR := MediaTek
   DEVICE_MODEL := MT7621 EVB
-  DEVICE_PACKAGES := -wpad-basic-wolfssl
+  DEVICE_PACKAGES := -wpad-basic-mbedtls
   SUPPORTED_DEVICES += mt7621
 endef
 TARGET_DEVICES += mediatek_mt7621-eval-board
@@ -1469,7 +1469,7 @@ TARGET_DEVICES += mikrotik_ltap-2hnd
 define Device/mikrotik_routerboard-750gr3
   $(Device/MikroTik)
   DEVICE_MODEL := RouterBOARD 750Gr3
-  DEVICE_PACKAGES += -wpad-basic-wolfssl
+  DEVICE_PACKAGES += -wpad-basic-mbedtls
   SUPPORTED_DEVICES += mikrotik,rb750gr3
 endef
 TARGET_DEVICES += mikrotik_routerboard-750gr3
@@ -1477,14 +1477,14 @@ TARGET_DEVICES += mikrotik_routerboard-750gr3
 define Device/mikrotik_routerboard-760igs
   $(Device/MikroTik)
   DEVICE_MODEL := RouterBOARD 760iGS
-  DEVICE_PACKAGES += kmod-sfp -wpad-basic-wolfssl
+  DEVICE_PACKAGES += kmod-sfp -wpad-basic-mbedtls
 endef
 TARGET_DEVICES += mikrotik_routerboard-760igs
 
 define Device/mikrotik_routerboard-m11g
   $(Device/MikroTik)
   DEVICE_MODEL := RouterBOARD M11G
-  DEVICE_PACKAGES := -wpad-basic-wolfssl
+  DEVICE_PACKAGES := -wpad-basic-mbedtls
   SUPPORTED_DEVICES += mikrotik,rbm11g
 endef
 TARGET_DEVICES += mikrotik_routerboard-m11g
@@ -1492,7 +1492,7 @@ TARGET_DEVICES += mikrotik_routerboard-m11g
 define Device/mikrotik_routerboard-m33g
   $(Device/MikroTik)
   DEVICE_MODEL := RouterBOARD M33G
-  DEVICE_PACKAGES := -wpad-basic-wolfssl
+  DEVICE_PACKAGES := -wpad-basic-mbedtls
   SUPPORTED_DEVICES += mikrotik,rbm33g
 endef
 TARGET_DEVICES += mikrotik_routerboard-m33g
@@ -1805,7 +1805,7 @@ define Device/planex_vr500
   IMAGE_SIZE := 65216k
   DEVICE_VENDOR := Planex
   DEVICE_MODEL := VR500
-  DEVICE_PACKAGES := kmod-usb3 -wpad-basic-wolfssl
+  DEVICE_PACKAGES := kmod-usb3 -wpad-basic-mbedtls
   SUPPORTED_DEVICES += vr500
 endef
 TARGET_DEVICES += planex_vr500
@@ -1949,7 +1949,7 @@ define Device/thunder_timecloud
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := Thunder
   DEVICE_MODEL := Timecloud
-  DEVICE_PACKAGES := kmod-usb3 -wpad-basic-wolfssl
+  DEVICE_PACKAGES := kmod-usb3 -wpad-basic-mbedtls
   SUPPORTED_DEVICES += timecloud
 endef
 TARGET_DEVICES += thunder_timecloud
@@ -2082,7 +2082,7 @@ define Device/tplink_er605-v2
   DEVICE_VENDOR := TP-Link
   DEVICE_MODEL := ER605
   DEVICE_VARIANT := v2
-  DEVICE_PACKAGES := -wpad-basic-wolfssl kmod-usb3
+  DEVICE_PACKAGES := -wpad-basic-mbedtls kmod-usb3
   BLOCKSIZE := 128k
   PAGESIZE := 2048
   KERNEL_SIZE := 4096k
@@ -2176,7 +2176,7 @@ define Device/ubnt_edgerouter_common
   KERNEL_INITRAMFS := $$(KERNEL) | \
 	ubnt-erx-factory-image $(KDIR)/tmp/$$(KERNEL_INITRAMFS_PREFIX)-factory.tar
   IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
-  DEVICE_PACKAGES += -wpad-basic-wolfssl
+  DEVICE_PACKAGES += -wpad-basic-mbedtls
 endef
 
 define Device/ubnt_edgerouter-x
@@ -2258,7 +2258,7 @@ define Device/unielec_u7621-06-16m
   DEVICE_VENDOR := UniElec
   DEVICE_MODEL := U7621-06
   DEVICE_VARIANT := 16M
-  DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 -wpad-basic-wolfssl
+  DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 -wpad-basic-mbedtls
   SUPPORTED_DEVICES += u7621-06-256M-16M unielec,u7621-06-256m-16m
 endef
 TARGET_DEVICES += unielec_u7621-06-16m
@@ -2270,7 +2270,7 @@ define Device/unielec_u7621-06-32m
   DEVICE_VENDOR := UniElec
   DEVICE_MODEL := U7621-06
   DEVICE_VARIANT := 32M
-  DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 -wpad-basic-wolfssl
+  DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 -wpad-basic-mbedtls
   SUPPORTED_DEVICES += unielec,u7621-06-32m
 endef
 TARGET_DEVICES += unielec_u7621-06-32m
@@ -2282,7 +2282,7 @@ define Device/unielec_u7621-06-64m
   DEVICE_VENDOR := UniElec
   DEVICE_MODEL := U7621-06
   DEVICE_VARIANT := 64M
-  DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 -wpad-basic-wolfssl
+  DEVICE_PACKAGES := kmod-ata-ahci kmod-sdhci-mt7620 kmod-usb3 -wpad-basic-mbedtls
   SUPPORTED_DEVICES += unielec,u7621-06-512m-64m
 endef
 TARGET_DEVICES += unielec_u7621-06-64m
@@ -2505,7 +2505,7 @@ define Device/xiaoyu_xy-c5
   IMAGE_SIZE := 32448k
   DEVICE_VENDOR := XiaoYu
   DEVICE_MODEL := XY-C5
-  DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 -wpad-basic-wolfssl
+  DEVICE_PACKAGES := kmod-ata-ahci kmod-usb3 -wpad-basic-mbedtls
 endef
 TARGET_DEVICES += xiaoyu_xy-c5
 
@@ -2515,7 +2515,7 @@ define Device/xzwifi_creativebox-v1
   DEVICE_VENDOR := CreativeBox
   DEVICE_MODEL := v1
   DEVICE_PACKAGES := kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \
-	kmod-usb3 -wpad-basic-wolfssl
+	kmod-usb3 -wpad-basic-mbedtls
 endef
 TARGET_DEVICES += xzwifi_creativebox-v1
 
diff --git a/target/linux/ramips/mt7620/target.mk b/target/linux/ramips/mt7620/target.mk
index 5fc61e49cf..34488f95af 100644
--- a/target/linux/ramips/mt7620/target.mk
+++ b/target/linux/ramips/mt7620/target.mk
@@ -7,7 +7,7 @@ BOARDNAME:=MT7620 based boards
 FEATURES+=usb ramdisk
 CPU_TYPE:=24kc
 
-DEFAULT_PACKAGES += kmod-rt2800-soc wpad-basic-wolfssl swconfig
+DEFAULT_PACKAGES += kmod-rt2800-soc wpad-basic-mbedtls swconfig
 
 define Target/Description
 	Build firmware images for Ralink MT7620 based boards.
diff --git a/target/linux/ramips/mt7621/target.mk b/target/linux/ramips/mt7621/target.mk
index d1f987b2e0..cfb798e358 100644
--- a/target/linux/ramips/mt7621/target.mk
+++ b/target/linux/ramips/mt7621/target.mk
@@ -10,7 +10,7 @@ KERNELNAME:=vmlinux vmlinuz
 # make Kernel/CopyImage use $LINUX_DIR/vmlinuz
 IMAGES_DIR:=../../..
 
-DEFAULT_PACKAGES += wpad-basic-wolfssl
+DEFAULT_PACKAGES += wpad-basic-mbedtls
 
 define Target/Description
 	Build firmware images for Ralink MT7621 based boards.
diff --git a/target/linux/ramips/mt76x8/target.mk b/target/linux/ramips/mt76x8/target.mk
index f939e4ca4c..862736cb2f 100644
--- a/target/linux/ramips/mt76x8/target.mk
+++ b/target/linux/ramips/mt76x8/target.mk
@@ -7,7 +7,7 @@ BOARDNAME:=MT76x8 based boards
 FEATURES+=usb ramdisk
 CPU_TYPE:=24kc
 
-DEFAULT_PACKAGES += kmod-mt7603 wpad-basic-wolfssl swconfig
+DEFAULT_PACKAGES += kmod-mt7603 wpad-basic-mbedtls swconfig
 
 define Target/Description
 	Build firmware images for Ralink MT76x8 based boards.
diff --git a/target/linux/ramips/rt288x/target.mk b/target/linux/ramips/rt288x/target.mk
index 814ac97e89..87e10ff2fd 100644
--- a/target/linux/ramips/rt288x/target.mk
+++ b/target/linux/ramips/rt288x/target.mk
@@ -7,7 +7,7 @@ BOARDNAME:=RT288x based boards
 FEATURES+=small_flash
 CPU_TYPE:=24kc
 
-DEFAULT_PACKAGES += kmod-rt2800-soc wpad-basic-wolfssl swconfig
+DEFAULT_PACKAGES += kmod-rt2800-soc wpad-basic-mbedtls swconfig
 
 define Target/Description
 	Build firmware images for Ralink RT288x based boards.
diff --git a/target/linux/ramips/rt305x/target.mk b/target/linux/ramips/rt305x/target.mk
index 27ad670ca4..759ad2d456 100644
--- a/target/linux/ramips/rt305x/target.mk
+++ b/target/linux/ramips/rt305x/target.mk
@@ -7,7 +7,7 @@ BOARDNAME:=RT3x5x/RT5350 based boards
 FEATURES+=usb ramdisk small_flash
 CPU_TYPE:=24kc
 
-DEFAULT_PACKAGES += kmod-rt2800-soc wpad-basic-wolfssl swconfig
+DEFAULT_PACKAGES += kmod-rt2800-soc wpad-basic-mbedtls swconfig
 
 define Target/Description
 	Build firmware images for Ralink RT3x5x/RT5350 based boards.
diff --git a/target/linux/ramips/rt3883/target.mk b/target/linux/ramips/rt3883/target.mk
index ff878a0a59..c1039625f1 100644
--- a/target/linux/ramips/rt3883/target.mk
+++ b/target/linux/ramips/rt3883/target.mk
@@ -7,7 +7,7 @@ BOARDNAME:=RT3662/RT3883 based boards
 FEATURES+=usb pci small_flash
 CPU_TYPE:=74kc
 
-DEFAULT_PACKAGES += kmod-rt2800-pci kmod-rt2800-soc wpad-basic-wolfssl swconfig
+DEFAULT_PACKAGES += kmod-rt2800-pci kmod-rt2800-soc wpad-basic-mbedtls swconfig
 
 define Target/Description
 	Build firmware images for Ralink RT3662/RT3883 based boards.
diff --git a/target/linux/sunxi/image/cortexa7.mk b/target/linux/sunxi/image/cortexa7.mk
index 74cdc6e996..5b9f27cef8 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-leds-gpio kmod-brcmfmac \
-	cypress-firmware-43430-sdio wpad-basic-wolfssl
+	cypress-firmware-43430-sdio wpad-basic-mbedtls
   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-leds-gpio kmod-brcmfmac \
-	brcmfmac-firmware-43430a0-sdio wpad-basic-wolfssl
+	brcmfmac-firmware-43430a0-sdio wpad-basic-mbedtls
   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-usb-net-rtl8152 kmod-leds-gpio \
-	kmod-brcmfmac cypress-firmware-43430-sdio wpad-basic-wolfssl
+	kmod-brcmfmac cypress-firmware-43430-sdio wpad-basic-mbedtls
   SOC := sun8i-h3
 endef
 TARGET_DEVICES += friendlyarm_nanopi-r1
@@ -66,7 +66,7 @@ define Device/lamobo_lamobo-r1
   DEVICE_MODEL := Lamobo R1
   DEVICE_ALT0_VENDOR := Bananapi
   DEVICE_ALT0_MODEL := BPi-R1
-  DEVICE_PACKAGES := kmod-ata-sunxi kmod-rtl8192cu wpad-basic-wolfssl
+  DEVICE_PACKAGES := kmod-ata-sunxi kmod-rtl8192cu wpad-basic-mbedtls
   DEVICE_COMPAT_VERSION := 1.1
   DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA
   SOC := sun7i-a20
@@ -85,7 +85,7 @@ define Device/sinovoip_bananapi-m2-berry
   DEVICE_VENDOR := Sinovoip
   DEVICE_MODEL := Banana Pi M2 Berry
   DEVICE_PACKAGES:=kmod-ata-sunxi kmod-brcmfmac \
-	cypress-firmware-43430-sdio wpad-basic-wolfssl
+	cypress-firmware-43430-sdio wpad-basic-mbedtls
   SUPPORTED_DEVICES:=lemaker,bananapi-m2-berry
   SOC := sun8i-v40
 endef
@@ -95,7 +95,7 @@ define Device/sinovoip_bananapi-m2-ultra
   DEVICE_VENDOR := Sinovoip
   DEVICE_MODEL := Banana Pi M2 Ultra
   DEVICE_PACKAGES:=kmod-ata-sunxi kmod-brcmfmac \
-	brcmfmac-firmware-43430a0-sdio wpad-basic-wolfssl
+	brcmfmac-firmware-43430a0-sdio wpad-basic-mbedtls
   SUPPORTED_DEVICES:=lemaker,bananapi-m2-ultra
   SOC := sun8i-r40
 endef
@@ -171,7 +171,7 @@ define Device/sinovoip_bananapi-m2-plus
   DEVICE_VENDOR := Sinovoip
   DEVICE_MODEL := Banana Pi M2+
   DEVICE_PACKAGES:=kmod-leds-gpio kmod-brcmfmac \
-	brcmfmac-firmware-43430a0-sdio wpad-basic-wolfssl
+	brcmfmac-firmware-43430a0-sdio wpad-basic-mbedtls
   SOC := sun8i-h3
 endef
 TARGET_DEVICES += sinovoip_bananapi-m2-plus
diff --git a/target/linux/sunxi/profiles/00-default.mk b/target/linux/sunxi/profiles/00-default.mk
index 0541087a48..0e3192adaf 100644
--- a/target/linux/sunxi/profiles/00-default.mk
+++ b/target/linux/sunxi/profiles/00-default.mk
@@ -13,7 +13,7 @@ define Profile/Default
 	kmod-sun4i-emac \
 	rtl8188eu-firmware \
 	swconfig \
-	wpad-basic-wolfssl
+	wpad-basic-mbedtls
   PRIORITY := 1
 endef
 
diff --git a/target/linux/tegra/image/Makefile b/target/linux/tegra/image/Makefile
index 58c2fe74f8..82394f4ab6 100644
--- a/target/linux/tegra/image/Makefile
+++ b/target/linux/tegra/image/Makefile
@@ -43,7 +43,7 @@ define Device/compulab_trimslice
   DEVICE_MODEL := TrimSlice
   DEVICE_DTS := tegra20-trimslice
   DEVICE_PACKAGES := kmod-r8169 kmod-rt2800-usb kmod-rtc-em3027 \
-	kmod-usb-storage wpad-basic-wolfssl
+	kmod-usb-storage wpad-basic-mbedtls
   UBOOT := trimslice-mmc
 endef
 TARGET_DEVICES += compulab_trimslice
diff --git a/target/linux/uml/Makefile b/target/linux/uml/Makefile
index 9f6b9644f8..2b314aa4bb 100644
--- a/target/linux/uml/Makefile
+++ b/target/linux/uml/Makefile
@@ -17,7 +17,7 @@ KERNEL_PATCHVER:=5.15
 
 include $(INCLUDE_DIR)/target.mk
 
-DEFAULT_PACKAGES += wpad-basic-wolfssl kmod-mac80211-hwsim mkf2fs e2fsprogs
+DEFAULT_PACKAGES += wpad-basic-mbedtls kmod-mac80211-hwsim mkf2fs e2fsprogs
 
   endif
 endif



From lede-commits at lists.infradead.org  Sat Feb  4 11:10:48 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 04 Feb 2023 14:10:48 -0500
Subject: [openwrt/openwrt]  fstools: bump to latest Git HEAD
In-Reply-To: <167553784823.3311865.8071353164230156101@git-01.infra.openwrt.org>
References: <167553784823.3311865.8071353164230156101@git-01.infra.openwrt.org>
Message-ID: <mailman.12562.1675537866.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/3ef655375a5edac9c4967394a213d10b631464a7

commit 3ef655375a5edac9c4967394a213d10b631464a7
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Sat Feb 4 20:04:58 2023 +0100

    fstools: bump to latest Git HEAD
    
    14d535e partname: Correct fstools_partname_fallback_scan comparison
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 package/system/fstools/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile
index 8a17f16945..e61cd7a022 100644
--- a/package/system/fstools/Makefile
+++ b/package/system/fstools/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git
-PKG_MIRROR_HASH:=edda9151c73c1adfe369f5e315347344727a540ad57d3e2b41b9f57f9d4313fe
-PKG_SOURCE_DATE:=2023-01-22
-PKG_SOURCE_VERSION:=1ea5855e980cd88766dd9f615e78e7dd6edfbb74
+PKG_MIRROR_HASH:=d2fc78b66c4e6ac5f51c77f92bd0d2322db78905a9dfea582fc7d975ea68ffe4
+PKG_SOURCE_DATE:=2023-02-04
+PKG_SOURCE_VERSION:=14d535e4485dc030deecbba9ab493c379df5c237
 CMAKE_INSTALL:=1
 
 PKG_LICENSE:=GPL-2.0



From lede-commits at lists.infradead.org  Sat Feb  4 11:23:17 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 04 Feb 2023 14:23:17 -0500
Subject: [openwrt/openwrt]  ipq806x: onhub: Enable
 fstools_partname_fallback_scan
In-Reply-To: <167553859773.3322280.16259576335048657703@git-01.infra.openwrt.org>
References: <167553859773.3322280.16259576335048657703@git-01.infra.openwrt.org>
Message-ID: <mailman.12563.1675538602.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/b5193291bdde00e91c58e59029d5c68b0bc605db

commit b5193291bdde00e91c58e59029d5c68b0bc605db
Author: Brian Norris <computersforpeace at gmail.com>
AuthorDate: Tue Jan 24 22:42:07 2023 -0800

    ipq806x: onhub: Enable fstools_partname_fallback_scan
    
    When fstools is unable to parse our root=<...> arg correctly, it can
    fall back to scanning all block devices for a 'rootfs_data' partition.
    This fallback was deemed wrong (or at least, a breaking/incompatible
    change) for some targets, so we're forced to opt back into it with
    fstools_partname_fallback_scan=1.
    
    Without this, OnHub devices will use a rootfs-appended loop device for
    rootfs_data instead of the intended 3rd partition.
    
    While I'm at it, just move all the boot args into the 'cros-vboot'
    build rule, instead of using the custom bootargs-append. All cros-vboot
    subtargets here are using the same rootwait (to support both eMMC and
    USB boot) and root/partition args.
    
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
    [ drop unrelated comments in commit description ]
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 .../ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-asus-onhub.dts  | 4 ----
 .../files-5.15/arch/arm/boot/dts/qcom-ipq8064-tplink-onhub.dts        | 4 ----
 target/linux/ipq806x/image/chromium.mk                                | 4 +++-
 3 files changed, 3 insertions(+), 9 deletions(-)

diff --git a/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-asus-onhub.dts b/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-asus-onhub.dts
index 5b60ddb04b..442bcf19a6 100644
--- a/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-asus-onhub.dts
+++ b/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-asus-onhub.dts
@@ -11,10 +11,6 @@
 / {
 	model = "ASUS OnHub";
 	compatible = "asus,onhub", "google,arkham", "qcom,ipq8064";
-
-	chosen {
-		bootargs-append = " rootwait";
-	};
 };
 
 &qcom_pinmux {
diff --git a/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-tplink-onhub.dts b/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-tplink-onhub.dts
index 6dd39f0d95..6adc6be4ae 100644
--- a/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-tplink-onhub.dts
+++ b/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-tplink-onhub.dts
@@ -11,10 +11,6 @@
 / {
 	model = "TP-Link OnHub";
 	compatible = "tplink,onhub", "google,whirlwind-sp5", "qcom,ipq8064";
-
-	chosen {
-		bootargs-append = " rootwait";
-	};
 };
 
 &qcom_pinmux {
diff --git a/target/linux/ipq806x/image/chromium.mk b/target/linux/ipq806x/image/chromium.mk
index 16af6b95ba..f908472419 100644
--- a/target/linux/ipq806x/image/chromium.mk
+++ b/target/linux/ipq806x/image/chromium.mk
@@ -20,7 +20,9 @@ endef
 # (PARTNROFF=1) partition as their rootfs.
 define Build/cros-vboot
 	$(STAGING_DIR_HOST)/bin/cros-vbutil \
-		-k $@ -c "root=PARTUUID=%U/PARTNROFF=1" -o $@.new
+		-k $@ \
+		-c "root=PARTUUID=%U/PARTNROFF=1 rootwait fstools_partname_fallback_scan=1" \
+		-o $@.new
 	@mv $@.new $@
 endef
 



From lede-commits at lists.infradead.org  Sun Feb  5 13:34:34 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 05 Feb 2023 16:34:34 -0500
Subject: [openwrt/openwrt]  tools/coreutils: update to 9.1
In-Reply-To: <167563287467.103914.17983696680201513247@git-01.infra.openwrt.org>
References: <167563287467.103914.17983696680201513247@git-01.infra.openwrt.org>
Message-ID: <mailman.12606.1675632888.3064139.lede-commits@lists.infradead.org>

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

commit c5608227ef8b705c18fb5323409bc69bd9ca192e
Author: John Audia <graysky at archlinux.us>
AuthorDate: Sat Feb 26 08:29:02 2022 -0500

    tools/coreutils: update to 9.1
    
    In addition to version update, this commit applies a fixup to allow building
    on MacOS involving renaming: [gt_TYPE_WINT_T] --> [gt_TYPE_WINT_T_GNUTLS]
    suggested by zhanhb.
    
    Build system: x86_64
    Build-tested: bcm2711/RPi4B
    
    Signed-off-by: John Audia <graysky at archlinux.us>
---
 tools/coreutils/Makefile             |  5 +-
 tools/coreutils/patches/001-m4.patch | 95 ++++++++++++++++++++++++++++++++++++
 2 files changed, 98 insertions(+), 2 deletions(-)

diff --git a/tools/coreutils/Makefile b/tools/coreutils/Makefile
index c64210c5a7..2b7b40cddc 100644
--- a/tools/coreutils/Makefile
+++ b/tools/coreutils/Makefile
@@ -8,13 +8,14 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=coreutils
 PKG_CPE_ID:=cpe:/a:gnu:coreutils
-PKG_VERSION:=8.32
+PKG_VERSION:=9.1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@GNU/coreutils
-PKG_HASH:=4458d8de7849df44ccab15e16b1548b285224dbba5f08fac070c1c0e0bcc4cfa
+PKG_HASH:=61a1f410d78ba7e7f37a5a4f50e6d1320aca33375484a3255eddf17a38580423
 
 HOST_BUILD_PARALLEL := 1
+PKG_FIXUP:=autoreconf
 
 BUILD_PROGRAMS = date readlink touch ln chown ginstall
 
diff --git a/tools/coreutils/patches/001-m4.patch b/tools/coreutils/patches/001-m4.patch
new file mode 100644
index 0000000000..f3d7018332
--- /dev/null
+++ b/tools/coreutils/patches/001-m4.patch
@@ -0,0 +1,95 @@
+--- a/m4/gnulib-comp.m4
++++ b/m4/gnulib-comp.m4
+@@ -2671,7 +2671,7 @@ changequote([, ])dnl
+   fi
+   gl_SYS_SOCKET_MODULE_INDICATOR([socket])
+   AC_REQUIRE([gt_TYPE_WCHAR_T])
+-  AC_REQUIRE([gt_TYPE_WINT_T])
++  AC_REQUIRE([gt_TYPE_WINT_T_GNUTLS])
+   gl_FUNC_STRERROR_R
+   AS_IF([test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1], [
+     AC_LIBOBJ([strerror_r])
+--- a/m4/stdint.m4
++++ b/m4/stdint.m4
+@@ -15,7 +15,7 @@ AC_DEFUN_ONCE([gl_STDINT_H],
+   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+ 
+   AC_REQUIRE([gl_LIMITS_H])
+-  AC_REQUIRE([gt_TYPE_WINT_T])
++  AC_REQUIRE([gt_TYPE_WINT_T_GNUTLS])
+ 
+   dnl For backward compatibility. Some packages may still be testing these
+   dnl macros.
+--- a/m4/vasnprintf.m4
++++ b/m4/vasnprintf.m4
+@@ -33,7 +33,7 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF],
+ AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
+ [
+   AC_REQUIRE([gt_TYPE_WCHAR_T])
+-  AC_REQUIRE([gt_TYPE_WINT_T])
++  AC_REQUIRE([gt_TYPE_WINT_T_GNUTLS])
+ ])
+ 
+ # Prerequisites of lib/printf-parse.h, lib/printf-parse.c.
+@@ -41,7 +41,7 @@ AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
+ [
+   AC_REQUIRE([gl_FEATURES_H])
+   AC_REQUIRE([gt_TYPE_WCHAR_T])
+-  AC_REQUIRE([gt_TYPE_WINT_T])
++  AC_REQUIRE([gt_TYPE_WINT_T_GNUTLS])
+   AC_REQUIRE([AC_TYPE_SIZE_T])
+   AC_CHECK_TYPE([ptrdiff_t], ,
+     [AC_DEFINE([ptrdiff_t], [long],
+@@ -55,7 +55,7 @@ AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
+ [
+   AC_REQUIRE([AC_FUNC_ALLOCA])
+   AC_REQUIRE([gt_TYPE_WCHAR_T])
+-  AC_REQUIRE([gt_TYPE_WINT_T])
++  AC_REQUIRE([gt_TYPE_WINT_T_GNUTLS])
+   AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
+   dnl Use the _snprintf function only if it is declared (because on NetBSD it
+   dnl is defined as a weak alias of snprintf; we prefer to use the latter).
+--- a/m4/wchar_h.m4
++++ b/m4/wchar_h.m4
+@@ -27,7 +27,7 @@ AC_DEFUN_ONCE([gl_WCHAR_H],
+ 
+   AC_REQUIRE([gl_FEATURES_H])
+ 
+-  AC_REQUIRE([gt_TYPE_WINT_T])
++  AC_REQUIRE([gt_TYPE_WINT_T_GNUTLS])
+   if test $gt_cv_c_wint_t = yes; then
+     HAVE_WINT_T=1
+   else
+--- a/m4/wctype_h.m4
++++ b/m4/wctype_h.m4
+@@ -22,7 +22,7 @@ AC_DEFUN_ONCE([gl_WCTYPE_H],
+   fi
+   AC_SUBST([HAVE_ISWCNTRL])
+ 
+-  AC_REQUIRE([gt_TYPE_WINT_T])
++  AC_REQUIRE([gt_TYPE_WINT_T_GNUTLS])
+   if test $gt_cv_c_wint_t = yes; then
+     HAVE_WINT_T=1
+   else
+--- a/m4/wcwidth.m4
++++ b/m4/wcwidth.m4
+@@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_WCWIDTH],
+   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+ 
+   AC_REQUIRE([gt_TYPE_WCHAR_T])
+-  AC_REQUIRE([gt_TYPE_WINT_T])
++  AC_REQUIRE([gt_TYPE_WINT_T_GNUTLS])
+ 
+   AC_CHECK_HEADERS_ONCE([wchar.h])
+   AC_CHECK_FUNCS_ONCE([wcwidth])
+--- a/m4/wint_t.m4
++++ b/m4/wint_t.m4
+@@ -9,7 +9,7 @@ dnl Test whether <wchar.h> has the 'wint
+ dnl <wchar.h> or <wctype.h> would, if present, override 'wint_t'.
+ dnl Prerequisite: AC_PROG_CC
+ 
+-AC_DEFUN([gt_TYPE_WINT_T],
++AC_DEFUN([gt_TYPE_WINT_T_GNUTLS],
+ [
+   AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
+     [AC_COMPILE_IFELSE(



From lede-commits at lists.infradead.org  Sun Feb  5 13:41:20 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 05 Feb 2023 16:41:20 -0500
Subject: [openwrt/openwrt]  tools/pkgconf: update to 1.9.4
In-Reply-To: <167563328055.110502.3303495054837485765@git-01.infra.openwrt.org>
References: <167563328055.110502.3303495054837485765@git-01.infra.openwrt.org>
Message-ID: <mailman.12607.1675633284.3064139.lede-commits@lists.infradead.org>

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

commit 57ad2ea110dc3899e87af6c60acf60375c9efa5f
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Sun Feb 5 14:06:35 2023 +0100

    tools/pkgconf: update to 1.9.4
    
    Release information:
    https://github.com/pkgconf/pkgconf/blob/master/NEWS
    
    Fixes CVE-2023-24056.
    
    Further, this commit corrects the "-Dtests" flag and changes it from
    "false" to "disabled".
    
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 tools/pkgconf/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/pkgconf/Makefile b/tools/pkgconf/Makefile
index b5f241b7dc..fded7e0fd6 100644
--- a/tools/pkgconf/Makefile
+++ b/tools/pkgconf/Makefile
@@ -7,11 +7,11 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=pkgconf
-PKG_VERSION:=1.9.3
+PKG_VERSION:=1.9.4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://distfiles.dereferenced.org/pkgconf
-PKG_HASH:=5fb355b487d54fb6d341e4f18d4e2f7e813a6622cf03a9e87affa6a40565699d
+PKG_HASH:=daccf1bbe5a30d149b556c7d2ffffeafd76d7b514e249271abdd501533c1d8ae
 
 include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/meson.mk
@@ -22,7 +22,7 @@ HOSTCC := $(HOSTCC_NOCACHE)
 
 MESON_HOST_ARGS += \
 	-Ddefault_library=static \
-	-Dtests=false
+	-Dtests=disabled
 
 define Host/Install
 	$(call Host/Install/Meson)



From lede-commits at lists.infradead.org  Sun Feb  5 13:41:21 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 05 Feb 2023 16:41:21 -0500
Subject: [openwrt/openwrt]  tools/pkgconf: add PKG_CPE_ID
In-Reply-To: <167563328055.110502.3303495054837485765@git-01.infra.openwrt.org>
References: <167563328055.110502.3303495054837485765@git-01.infra.openwrt.org>
Message-ID: <mailman.12608.1675633285.3064139.lede-commits@lists.infradead.org>

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

commit 6bc675c0bed969303f94bb59310081d92bf2e74a
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Sun Feb 5 14:59:03 2023 +0100

    tools/pkgconf: add PKG_CPE_ID
    
    Add PKG_CPE_ID to track vulnerabilities.
    
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 tools/pkgconf/Makefile | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/pkgconf/Makefile b/tools/pkgconf/Makefile
index fded7e0fd6..c6e11edaf2 100644
--- a/tools/pkgconf/Makefile
+++ b/tools/pkgconf/Makefile
@@ -13,6 +13,8 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=https://distfiles.dereferenced.org/pkgconf
 PKG_HASH:=daccf1bbe5a30d149b556c7d2ffffeafd76d7b514e249271abdd501533c1d8ae
 
+PKG_CPE_ID:=cpe:/a:pkgconf:pkgconf
+
 include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/meson.mk
 



From lede-commits at lists.infradead.org  Mon Feb  6 04:27:14 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 06 Feb 2023 07:27:14 -0500
Subject: [openwrt/openwrt]  ipq40xx: fix assignment of lan port numbers for
 Cell C RTL30VW
In-Reply-To: <167568643491.665919.6515680381802976388@git-01.infra.openwrt.org>
References: <167568643491.665919.6515680381802976388@git-01.infra.openwrt.org>
Message-ID: <mailman.12739.1675686448.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/cefc543b029a7af72420a5c514245287cd3df933

commit cefc543b029a7af72420a5c514245287cd3df933
Author: Cezary Jackiewicz <cezary at eko.one.pl>
AuthorDate: Sun Feb 5 07:24:05 2023 +0100

    ipq40xx: fix assignment of lan port numbers for Cell C RTL30VW
    
    After switching to DSA, the LAN ports in Cell C RTL30VW have swapped numbers. Assigning the right numbers.
    
    Signed-off-by: Cezary Jackiewicz <cezary at eko.one.pl>
---
 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rtl30vw.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rtl30vw.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rtl30vw.dts
index 3205b7d564..6fce4ae87b 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rtl30vw.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rtl30vw.dts
@@ -383,11 +383,11 @@
 &swport3 {
 	status = "okay";
 
-	label = "lan2";
+	label = "lan1";
 };
 
 &swport4 {
 	status = "okay";
 
-	label = "lan1";
+	label = "lan2";
 };



From lede-commits at lists.infradead.org  Mon Feb  6 12:37:46 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 06 Feb 2023 15:37:46 -0500
Subject: [openwrt/openwrt]  iwinfo: bump to latest git HEAD
In-Reply-To: <167571586637.1098048.3766238864947711964@git-01.infra.openwrt.org>
References: <167571586637.1098048.3766238864947711964@git-01.infra.openwrt.org>
Message-ID: <mailman.12876.1675715876.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/f28a604df4659a572dc3b147b65365fef6dc90d9

commit f28a604df4659a572dc3b147b65365fef6dc90d9
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Mon Feb 6 21:33:26 2023 +0100

    iwinfo: bump to latest git HEAD
    
    c7eb8eb nl80211: restore iterating over all devices in nl80211_phy2ifname()
    
    Fixes: #11902
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 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 bf258ef455..4f597ca0b8 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:=2023-01-23
-PKG_SOURCE_VERSION:=1e4e709d6f26cc38411ca189bab04f857b444ef3
-PKG_MIRROR_HASH:=851ca5c724f01260770ac7f4c98bc4f32b03fde635d06c797896ff2c4658c753
+PKG_SOURCE_DATE:=2023-02-06
+PKG_SOURCE_VERSION:=c7eb8ebe33de2ff2d08064258edb047e5ac09f29
+PKG_MIRROR_HASH:=f1124cf305710b0f04e2ea6dd42ba96ba4a3367da4d4afb4c19d5af9905b1cc2
 PKG_MAINTAINER:=Jo-Philipp Wich <jo at mein.io>
 PKG_LICENSE:=GPL-2.0
 



From lede-commits at lists.infradead.org  Tue Feb  7 07:01:39 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 07 Feb 2023 10:01:39 -0500
Subject: [openwrt/openwrt]  ipq807x: refresh kernel config
In-Reply-To: <167578209924.1838457.15013339368385342283@git-01.infra.openwrt.org>
References: <167578209924.1838457.15013339368385342283@git-01.infra.openwrt.org>
Message-ID: <mailman.13231.1675782113.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/bd9844a6fdf48529b05bc843c29fdba3cb748d5e

commit bd9844a6fdf48529b05bc843c29fdba3cb748d5e
Author: Robert Marko <robimarko at gmail.com>
AuthorDate: Thu Feb 2 10:34:52 2023 +0100

    ipq807x: refresh kernel config
    
    Refresh the ipq807x kernel config to keep it up to date and in sync with
    the generic one.
    
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/ipq807x/config-5.15 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/target/linux/ipq807x/config-5.15 b/target/linux/ipq807x/config-5.15
index 5dbc62dd66..9fb604ace2 100644
--- a/target/linux/ipq807x/config-5.15
+++ b/target/linux/ipq807x/config-5.15
@@ -55,6 +55,7 @@ CONFIG_BLK_MQ_PCI=y
 CONFIG_BLK_MQ_VIRTIO=y
 CONFIG_BLK_PM=y
 CONFIG_CAVIUM_TX2_ERRATUM_219=y
+CONFIG_CC_HAVE_SHADOW_CALL_STACK=y
 CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
 CONFIG_CLONE_BACKWARDS=y
 CONFIG_COMMON_CLK=y
@@ -257,8 +258,8 @@ CONFIG_NVIDIA_CARMEL_CNP_ERRATUM=y
 CONFIG_NVMEM=y
 CONFIG_NVMEM_QCOM_QFPROM=y
 # CONFIG_NVMEM_SPMI_SDAM is not set
-CONFIG_NVMEM_U_BOOT_ENV=y
 CONFIG_NVMEM_SYSFS=y
+CONFIG_NVMEM_U_BOOT_ENV=y
 CONFIG_OF=y
 CONFIG_OF_ADDRESS=y
 CONFIG_OF_EARLY_FLATTREE=y
@@ -268,6 +269,7 @@ CONFIG_OF_IRQ=y
 CONFIG_OF_KOBJ=y
 CONFIG_OF_MDIO=y
 CONFIG_PADATA=y
+# CONFIG_PAGE_POOL is not set
 CONFIG_PARTITION_PERCPU=y
 CONFIG_PCI=y
 CONFIG_PCIEAER=y



From lede-commits at lists.infradead.org  Tue Feb  7 07:27:28 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 07 Feb 2023 10:27:28 -0500
Subject: [openwrt/openwrt]  ipq806x: add missing enclosing reserved-memory
 block on C2600/AD7200
In-Reply-To: <167578364832.1863804.7081304847983446029@git-01.infra.openwrt.org>
References: <167578364832.1863804.7081304847983446029@git-01.infra.openwrt.org>
Message-ID: <mailman.13242.1675783652.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/047fb7c76d1827e22bef96031192159e738208fb

commit 047fb7c76d1827e22bef96031192159e738208fb
Author: Filip Matijevi? <filip.matijevic.pz at gmail.com>
AuthorDate: Sun Feb 5 09:34:41 2023 +0100

    ipq806x: add missing enclosing reserved-memory block on C2600/AD7200
    
    Most of the time when booting kernel prints a warning from
    mm/page_alloc.c when pstore/ramoops is being initialized and ramoops is
    not functional.
    
    Fix this by moving ramopps node into reserved-memory block as described
    in kernel documentation.
    
    Fixes: 2964e5024c ("ipq806x: kernel ramoops storage for C2600/AD7200")
    Signed-off-by: Filip Matijevi? <filip.matijevic.pz at gmail.com>
---
 .../arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi   | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi b/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi
index 576393015a..7b352edb9b 100644
--- a/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi
+++ b/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi
@@ -10,14 +10,16 @@
 		device_type = "memory";
 	};
 
-	ramoops at 42100000 {
-		compatible = "ramoops";
-		reg = <0x42100000 0x40000>;
-		record-size = <0x4000>;
-		console-size = <0x4000>;
-		ftrace-size = <0x4000>;
-		pmsg-size = <0x4000>;
-	};
+	reserved-memory {
+                ramoops at 42100000 {
+                        compatible = "ramoops";
+                        reg = <0x42100000 0x40000>;
+                        record-size = <0x4000>;
+                        console-size = <0x4000>;
+                        ftrace-size = <0x4000>;
+                        pmsg-size = <0x4000>;
+                };
+        };
 
 	aliases {
 		mdio-gpio0 = &mdio0;



From lede-commits at lists.infradead.org  Tue Feb  7 09:30:16 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 07 Feb 2023 12:30:16 -0500
Subject: [openwrt/openwrt]  bcm47xx: revert bgmac back to the old limited max
 frame size
In-Reply-To: <167579101629.1953174.5080020108425032112@git-01.infra.openwrt.org>
References: <167579101629.1953174.5080020108425032112@git-01.infra.openwrt.org>
Message-ID: <mailman.13255.1675791023.3064139.lede-commits@lists.infradead.org>

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

commit 4970dd027bced78f8a72aa2baed22c962d3b587b
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Tue Feb 7 18:09:40 2023 +0100

    bcm47xx: revert bgmac back to the old limited max frame size
    
    Bumping max frame size has significantly affected network performance
    and memory usage. It was done by upstream commit that first appeared in
    the 5.7 release.
    
    Allocating 512 (BGMAC_RX_RING_SLOTS) buffers, 10 k each, is clearly a
    bad idea on 32 MiB devices. This commit fixes support for Linksys E1000
    V2.1 which gives up after allocating ~346 such buffers running 5.15
    kernel.
    
    Ref: 230c9da963aa ("bcm53xx: revert bgmac back to the old limited max frame size")
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 ...onnect-to-PHY-even-if-it-is-BGMAC_PHY_NOR.patch | 33 ++++++++++++++++++++++
 ...onnect-to-PHY-even-if-it-is-BGMAC_PHY_NOR.patch | 33 ++++++++++++++++++++++
 2 files changed, 66 insertions(+)

diff --git a/target/linux/bcm47xx/patches-5.10/701-net-bgmac-connect-to-PHY-even-if-it-is-BGMAC_PHY_NOR.patch b/target/linux/bcm47xx/patches-5.10/701-net-bgmac-connect-to-PHY-even-if-it-is-BGMAC_PHY_NOR.patch
new file mode 100644
index 0000000000..2c2eb07b82
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.10/701-net-bgmac-connect-to-PHY-even-if-it-is-BGMAC_PHY_NOR.patch
@@ -0,0 +1,33 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Fri, 10 Jun 2022 13:10:47 +0200
+Subject: [PATCH] bgmac: reduce max frame size to support just MTU 1500
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+bgmac allocates new replacement buffer before handling each received
+frame. Allocating & DMA-preparing 9724 B each time consumes a lot of CPU
+time. Ideally bgmac should just respect currently set MTU but it isn't
+the case right now. For now just revert back to the old limited frame
+size.
+
+This change bumps NAT masquarade speed by ~95%.
+
+Ref: 8c7da63978f1 ("bgmac: configure MTU and add support for frames beyond 8192 byte size")
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+---
+ drivers/net/ethernet/broadcom/bgmac.h | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/net/ethernet/broadcom/bgmac.h
++++ b/drivers/net/ethernet/broadcom/bgmac.h
+@@ -366,8 +366,7 @@
+ #define BGMAC_RX_FRAME_OFFSET			30		/* There are 2 unused bytes between header and real data */
+ #define BGMAC_RX_BUF_OFFSET			(NET_SKB_PAD + NET_IP_ALIGN - \
+ 						 BGMAC_RX_FRAME_OFFSET)
+-/* Jumbo frame size with FCS */
+-#define BGMAC_RX_MAX_FRAME_SIZE			9724
++#define BGMAC_RX_MAX_FRAME_SIZE			1536
+ #define BGMAC_RX_BUF_SIZE			(BGMAC_RX_FRAME_OFFSET + BGMAC_RX_MAX_FRAME_SIZE)
+ #define BGMAC_RX_ALLOC_SIZE			(SKB_DATA_ALIGN(BGMAC_RX_BUF_SIZE + BGMAC_RX_BUF_OFFSET) + \
+ 						 SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
diff --git a/target/linux/bcm47xx/patches-5.15/701-net-bgmac-connect-to-PHY-even-if-it-is-BGMAC_PHY_NOR.patch b/target/linux/bcm47xx/patches-5.15/701-net-bgmac-connect-to-PHY-even-if-it-is-BGMAC_PHY_NOR.patch
new file mode 100644
index 0000000000..3a2f4b06ed
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/701-net-bgmac-connect-to-PHY-even-if-it-is-BGMAC_PHY_NOR.patch
@@ -0,0 +1,33 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Fri, 10 Jun 2022 13:10:47 +0200
+Subject: [PATCH] bgmac: reduce max frame size to support just MTU 1500
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+bgmac allocates new replacement buffer before handling each received
+frame. Allocating & DMA-preparing 9724 B each time consumes a lot of CPU
+time. Ideally bgmac should just respect currently set MTU but it isn't
+the case right now. For now just revert back to the old limited frame
+size.
+
+This change bumps NAT masquarade speed by ~95%.
+
+Ref: 8c7da63978f1 ("bgmac: configure MTU and add support for frames beyond 8192 byte size")
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+---
+ drivers/net/ethernet/broadcom/bgmac.h | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/net/ethernet/broadcom/bgmac.h
++++ b/drivers/net/ethernet/broadcom/bgmac.h
+@@ -328,8 +328,7 @@
+ #define BGMAC_RX_FRAME_OFFSET			30		/* There are 2 unused bytes between header and real data */
+ #define BGMAC_RX_BUF_OFFSET			(NET_SKB_PAD + NET_IP_ALIGN - \
+ 						 BGMAC_RX_FRAME_OFFSET)
+-/* Jumbo frame size with FCS */
+-#define BGMAC_RX_MAX_FRAME_SIZE			9724
++#define BGMAC_RX_MAX_FRAME_SIZE			1536
+ #define BGMAC_RX_BUF_SIZE			(BGMAC_RX_FRAME_OFFSET + BGMAC_RX_MAX_FRAME_SIZE)
+ #define BGMAC_RX_ALLOC_SIZE			(SKB_DATA_ALIGN(BGMAC_RX_BUF_SIZE + BGMAC_RX_BUF_OFFSET) + \
+ 						 SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))



From lede-commits at lists.infradead.org  Tue Feb  7 12:09:34 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 07 Feb 2023 15:09:34 -0500
Subject: [openwrt/openwrt]  base-files: ipcalc.sh: don't include own address
 in range
In-Reply-To: <167580057358.2071844.7959447365719530149@git-01.infra.openwrt.org>
References: <167580057358.2071844.7959447365719530149@git-01.infra.openwrt.org>
Message-ID: <mailman.13291.1675800580.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/4fe106afd1870cfeb6a45d40f1dbb69e890f1756

commit 4fe106afd1870cfeb6a45d40f1dbb69e890f1756
Author: Leon M. George <leon at georgemail.eu>
AuthorDate: Thu May 5 23:47:47 2022 +0200

    base-files: ipcalc.sh: don't include own address in range
    
    Make sure our own address doesn't lie in the calculated range.
    
    Signed-off-by: Leon M. George <leon at georgemail.eu>
---
 package/base-files/files/bin/ipcalc.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/package/base-files/files/bin/ipcalc.sh b/package/base-files/files/bin/ipcalc.sh
index 9b2c4d2afc..66d37952de 100755
--- a/package/base-files/files/bin/ipcalc.sh
+++ b/package/base-files/files/bin/ipcalc.sh
@@ -61,10 +61,17 @@ BEGIN {
 	start=or(network,and(ip2int(ARGV[3]),compl32(netmask)))
 	limit=network+1
 	if (start<limit) start=limit
+	if (start==ipaddr) start=ipaddr+1
 
 	end=start+ARGV[4]
 	limit=or(network,compl32(netmask))-1
 	if (end>limit) end=limit
+	if (end==ipaddr) end=ipaddr-1
+
+	if (ipaddr > start && ipaddr < end) {
+		print "ipaddr inside range" > "/dev/stderr"
+		exit(1)
+	}
 
 	print "START="int2ip(start)
 	print "END="int2ip(end)



From lede-commits at lists.infradead.org  Tue Feb  7 12:09:36 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 07 Feb 2023 15:09:36 -0500
Subject: [openwrt/openwrt]  base-files: ipcalc.sh: use shebang to invoke awk
In-Reply-To: <167580057358.2071844.7959447365719530149@git-01.infra.openwrt.org>
References: <167580057358.2071844.7959447365719530149@git-01.infra.openwrt.org>
Message-ID: <mailman.13292.1675800580.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/6ce9f42b9819b93717d7425ca4135afec6ea43af

commit 6ce9f42b9819b93717d7425ca4135afec6ea43af
Author: Leon M. George <leon at georgemail.eu>
AuthorDate: Fri May 6 00:03:54 2022 +0200

    base-files: ipcalc.sh: use shebang to invoke awk
    
    There's hardly an shell logic in ipcalc.sh and a $* that would garble
    parameter positions.
    Move the awk invokation to the shebang.
    
    A rename from "ipcalc.sh" to "ipcalc" is desirable but could prove tricky
    with packages in other repositories depending on the filename.
    
    Signed-off-by: Leon M. George <leon at georgemail.eu>
---
 package/base-files/files/bin/ipcalc.sh | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/package/base-files/files/bin/ipcalc.sh b/package/base-files/files/bin/ipcalc.sh
index b21b6e28dc..e818e67803 100755
--- a/package/base-files/files/bin/ipcalc.sh
+++ b/package/base-files/files/bin/ipcalc.sh
@@ -1,6 +1,5 @@
-#!/bin/sh
+#!/usr/bin/awk -f
 
-awk -f - $* <<EOF
 function bitcount(c) {
 	c=and(rshift(c, 1),0x55555555)+and(c,0x55555555)
 	c=and(rshift(c, 2),0x33333333)+and(c,0x33333333)
@@ -82,4 +81,3 @@ BEGIN {
 	print "START="int2ip(start)
 	print "END="int2ip(end)
 }
-EOF



From lede-commits at lists.infradead.org  Tue Feb  7 12:09:35 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 07 Feb 2023 15:09:35 -0500
Subject: [openwrt/openwrt]  base-files: ipcalc.sh: fail when network is too
 small
In-Reply-To: <167580057358.2071844.7959447365719530149@git-01.infra.openwrt.org>
References: <167580057358.2071844.7959447365719530149@git-01.infra.openwrt.org>
Message-ID: <mailman.13293.1675800582.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/a40a96e54b0d047d14d99bb715ee2dd94458acb6

commit a40a96e54b0d047d14d99bb715ee2dd94458acb6
Author: Leon M. George <leon at georgemail.eu>
AuthorDate: Fri May 6 00:02:52 2022 +0200

    base-files: ipcalc.sh: fail when network is too small
    
    It's possible to move range boundaries in a way that the start address
    lies behind the end address.
    Detect this condition and exit with an error message.
    
    Signed-off-by: Leon M. George <leon at georgemail.eu>
---
 package/base-files/files/bin/ipcalc.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/package/base-files/files/bin/ipcalc.sh b/package/base-files/files/bin/ipcalc.sh
index 66d37952de..b21b6e28dc 100755
--- a/package/base-files/files/bin/ipcalc.sh
+++ b/package/base-files/files/bin/ipcalc.sh
@@ -44,13 +44,14 @@ BEGIN {
 	}
 
 	network=and(ipaddr,netmask)
+	prefix=32-bitcount(compl32(netmask))
 	broadcast=or(network,compl32(netmask))
 
 	print "IP="int2ip(ipaddr)
 	print "NETMASK="int2ip(netmask)
 	print "BROADCAST="int2ip(broadcast)
 	print "NETWORK="int2ip(network)
-	print "PREFIX="32-bitcount(compl32(netmask))
+	print "PREFIX="prefix
 
 	# range calculations:
 	# ipcalc <ip> <netmask> <start> <num>
@@ -68,6 +69,11 @@ BEGIN {
 	if (end>limit) end=limit
 	if (end==ipaddr) end=ipaddr-1
 
+	if (start>end) {
+		print "network ("int2ip(network)"/"prefix") too small" > "/dev/stderr"
+		exit(1)
+	}
+
 	if (ipaddr > start && ipaddr < end) {
 		print "ipaddr inside range" > "/dev/stderr"
 		exit(1)



From lede-commits at lists.infradead.org  Tue Feb  7 12:09:39 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 07 Feb 2023 15:09:39 -0500
Subject: [openwrt/openwrt]  base-files: ipcalc.sh: fix awk regex syntax
In-Reply-To: <167580057358.2071844.7959447365719530149@git-01.infra.openwrt.org>
References: <167580057358.2071844.7959447365719530149@git-01.infra.openwrt.org>
Message-ID: <mailman.13294.1675800582.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/67d2a7ef9ed7f70a962264167527b383ad637303

commit 67d2a7ef9ed7f70a962264167527b383ad637303
Author: Leon M. George <leon at georgemail.eu>
AuthorDate: Fri Oct 14 14:09:34 2022 +0200

    base-files: ipcalc.sh: fix awk regex syntax
    
    It worked fine before but gawk warns about it.
    
    Signed-off-by: Leon M. George <leon at georgemail.eu>
---
 package/base-files/files/bin/ipcalc.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/base-files/files/bin/ipcalc.sh b/package/base-files/files/bin/ipcalc.sh
index 99269fff06..56854b4104 100755
--- a/package/base-files/files/bin/ipcalc.sh
+++ b/package/base-files/files/bin/ipcalc.sh
@@ -11,7 +11,7 @@ function bitcount(c) {
 
 function ip2int(ip) {
 	ret=0
-	n=split(ip,a,"\.")
+	n=split(ip,a,"\\.")
 	for (x=1;x<=n;x++)
 		ret=or(lshift(ret,8),a[x])
 	return ret



From lede-commits at lists.infradead.org  Tue Feb  7 12:09:38 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 07 Feb 2023 15:09:38 -0500
Subject: [openwrt/openwrt]  base-files: ipcalc.sh: trim for statement
In-Reply-To: <167580057358.2071844.7959447365719530149@git-01.infra.openwrt.org>
References: <167580057358.2071844.7959447365719530149@git-01.infra.openwrt.org>
Message-ID: <mailman.13295.1675800583.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/2903924b576c19ab64490917ec46cb3bee790ad2

commit 2903924b576c19ab64490917ec46cb3bee790ad2
Author: Leon M. George <leon at georgemail.eu>
AuthorDate: Fri Oct 14 14:08:19 2022 +0200

    base-files: ipcalc.sh: trim for statement
    
    For gawk compatibility.
    
    Signed-off-by: Leon M. George <leon at georgemail.eu>
---
 package/base-files/files/bin/ipcalc.sh | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/package/base-files/files/bin/ipcalc.sh b/package/base-files/files/bin/ipcalc.sh
index e818e67803..99269fff06 100755
--- a/package/base-files/files/bin/ipcalc.sh
+++ b/package/base-files/files/bin/ipcalc.sh
@@ -10,14 +10,20 @@ function bitcount(c) {
 }
 
 function ip2int(ip) {
-	for (ret=0,n=split(ip,a,"\."),x=1;x<=n;x++) ret=or(lshift(ret,8),a[x])
+	ret=0
+	n=split(ip,a,"\.")
+	for (x=1;x<=n;x++)
+		ret=or(lshift(ret,8),a[x])
 	return ret
 }
 
 function int2ip(ip,ret,x) {
 	ret=and(ip,255)
 	ip=rshift(ip,8)
-	for(;x<3;ret=and(ip,255)"."ret,ip=rshift(ip,8),x++);
+	for(;x<3;x++) {
+		ret=and(ip,255)"."ret
+		ip=rshift(ip,8)
+	}
 	return ret
 }
 



From lede-commits at lists.infradead.org  Tue Feb  7 12:09:37 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 07 Feb 2023 15:09:37 -0500
Subject: [openwrt/openwrt]  dnsmasq: refuse to add empty DHCP range
In-Reply-To: <167580057358.2071844.7959447365719530149@git-01.infra.openwrt.org>
References: <167580057358.2071844.7959447365719530149@git-01.infra.openwrt.org>
Message-ID: <mailman.13296.1675800583.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/e4bd3de1be8e3d49f9663a300e8b821ecca4be11

commit e4bd3de1be8e3d49f9663a300e8b821ecca4be11
Author: Leon M. George <leon at georgemail.eu>
AuthorDate: Sun May 8 23:29:06 2022 +0200

    dnsmasq: refuse to add empty DHCP range
    
    Use ipcalc's return value to react to invalid range specifications.
    By simply ignoring the range instead of aborting with an error code,
    dnsmasq should still start when there's an error (best effort).
    Aborting the config generation or working with invalid range specs leaves
    dnsmasq crash-looping which is the right thing to do concerning that
    particular interface but it also hinders DHCP service on other interfaces
    and DNS on the router itself.
    
    Signed-off-by: Leon M. George <leon at georgemail.eu>
---
 package/network/services/dnsmasq/files/dnsmasq.init | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index d3928c2399..21e330ec28 100755
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -584,21 +584,20 @@ dhcp_add() {
 		limit=$((limit-1))
 	fi
 
-	eval "$(ipcalc.sh "${subnet%%/*}" $netmask $start $limit)"
+	# make sure the DHCP range is not empty
+	if [ "$dhcpv4" != "disabled" ] && eval "$(ipcalc.sh "${subnet%%/*}" "$netmask" "$start" "$limit")" ; then
+		[ "$dynamicdhcp" = "0" ] && END="static"
+
+		xappend "--dhcp-range=$tags$nettag$START,$END,$NETMASK,$leasetime${options:+ $options}"
+	fi
 
 	if [ "$dynamicdhcp" = "0" ] ; then
-		END="static"
 		dhcp6range="::,static"
 	else
 		dhcp6range="::1000,::ffff"
 	fi
 
 
-	if [ "$dhcpv4" != "disabled" ] ; then
-		xappend "--dhcp-range=$tags$nettag$START,$END,$NETMASK,$leasetime${options:+ $options}"
-	fi
-
-
 	if [ $DNSMASQ_DHCP_VER -eq 6 ] && [ "$ra" = "server" ] ; then
 		# Note: dnsmasq cannot just be a DHCPv6 server (all-in-1)
 		# and let some other machine(s) send RA pointing to it.



From lede-commits at lists.infradead.org  Tue Feb  7 12:09:33 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 07 Feb 2023 15:09:33 -0500
Subject: [openwrt/openwrt]  base-files: ipcalc.sh: check for params before
 calculating start/end
In-Reply-To: <167580057358.2071844.7959447365719530149@git-01.infra.openwrt.org>
References: <167580057358.2071844.7959447365719530149@git-01.infra.openwrt.org>
Message-ID: <mailman.13297.1675800583.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/00a20335ba2bac4cc33048464ba4bab070309db7

commit 00a20335ba2bac4cc33048464ba4bab070309db7
Author: Leon M. George <leon at georgemail.eu>
AuthorDate: Thu May 5 23:19:53 2022 +0200

    base-files: ipcalc.sh: check for params before calculating start/end
    
    With this patch, ipcalc only calculates range boundaries if the
    corresponding parameters are supplied.
    
    Signed-off-by: Leon M. George <leon at georgemail.eu>
---
 package/base-files/files/bin/ipcalc.sh | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/package/base-files/files/bin/ipcalc.sh b/package/base-files/files/bin/ipcalc.sh
index 5d5eac3ea8..9b2c4d2afc 100755
--- a/package/base-files/files/bin/ipcalc.sh
+++ b/package/base-files/files/bin/ipcalc.sh
@@ -46,14 +46,6 @@ BEGIN {
 	network=and(ipaddr,netmask)
 	broadcast=or(network,compl32(netmask))
 
-	start=or(network,and(ip2int(ARGV[3]),compl32(netmask)))
-	limit=network+1
-	if (start<limit) start=limit
-
-	end=start+ARGV[4]
-	limit=or(network,compl32(netmask))-1
-	if (end>limit) end=limit
-
 	print "IP="int2ip(ipaddr)
 	print "NETMASK="int2ip(netmask)
 	print "BROADCAST="int2ip(broadcast)
@@ -63,9 +55,18 @@ BEGIN {
 	# range calculations:
 	# ipcalc <ip> <netmask> <start> <num>
 
-	if (ARGC > 3) {
-		print "START="int2ip(start)
-		print "END="int2ip(end)
-	}
+	if (ARGC <= 3)
+		exit(0)
+
+	start=or(network,and(ip2int(ARGV[3]),compl32(netmask)))
+	limit=network+1
+	if (start<limit) start=limit
+
+	end=start+ARGV[4]
+	limit=or(network,compl32(netmask))-1
+	if (end>limit) end=limit
+
+	print "START="int2ip(start)
+	print "END="int2ip(end)
 }
 EOF



From lede-commits at lists.infradead.org  Tue Feb  7 12:25:55 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 07 Feb 2023 15:25:55 -0500
Subject: [openwrt/openwrt]  mpc85xx: p2020: kernel: refresh configuration
In-Reply-To: <167580155499.2086732.5731032127198855116@git-01.infra.openwrt.org>
References: <167580155499.2086732.5731032127198855116@git-01.infra.openwrt.org>
Message-ID: <mailman.13300.1675801560.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/acd5aa0bb0e9a042a2090472f03dd6b7b6b3461a

commit acd5aa0bb0e9a042a2090472f03dd6b7b6b3461a
Author: ?imon Bo?ek <simon.borek at nic.cz>
AuthorDate: Tue Apr 19 13:11:43 2022 +0200

    mpc85xx: p2020: kernel: refresh configuration
    
    'make kernel_oldconfig CONFIG_TARGET=subtarget'
    applied to current master
    
    Signed-off-by: ?imon Bo?ek <simon.borek at nic.cz>
---
 target/linux/mpc85xx/p2020/config-default | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/target/linux/mpc85xx/p2020/config-default b/target/linux/mpc85xx/p2020/config-default
index 1d9ef14276..d3fcce5e93 100644
--- a/target/linux/mpc85xx/p2020/config-default
+++ b/target/linux/mpc85xx/p2020/config-default
@@ -1,30 +1,40 @@
-CONFIG_ARCH_HAS_TICK_BROADCAST=y
 CONFIG_CPU_RMAP=y
+CONFIG_DEFAULT_UIMAGE=y
+CONFIG_FSL_ULI1575=y
 CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
 CONFIG_GENERIC_IRQ_MIGRATION=y
+CONFIG_GENERIC_MSI_IRQ=y
+CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
 CONFIG_GENERIC_TBSYNC=y
-CONFIG_HAVE_RCU_TABLE_FREE=y
+CONFIG_IRQ_DOMAIN_HIERARCHY=y
 CONFIG_LOCK_SPIN_ON_OWNER=y
+CONFIG_MDIO_DEVRES=y
 CONFIG_MPC85xx_RDB=y
 CONFIG_MTD_CFI=y
-CONFIG_MTD_NAND_BCH=y
-CONFIG_MTD_NAND_ECC_BCH=y
 CONFIG_MTD_NAND_FSL_ELBC=y
 CONFIG_MTD_PHYSMAP=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
 CONFIG_MTD_SPLIT_FIT_FW=y
 CONFIG_MUTEX_SPIN_ON_OWNER=y
+CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NET_FLOW_LIMIT=y
 CONFIG_NR_CPUS=2
 CONFIG_PADATA=y
 CONFIG_PCI_MSI=y
+CONFIG_PCI_MSI_ARCH_FALLBACKS=y
+CONFIG_PCI_MSI_IRQ_DOMAIN=y
+CONFIG_PPC_I8259=y
 CONFIG_PPC_MSI_BITMAP=y
-# CONFIG_PPC_QUEUED_SPINLOCKS is not set
+CONFIG_REGMAP=y
+CONFIG_REGMAP_I2C=y
 CONFIG_RFS_ACCEL=y
 CONFIG_RPS=y
 CONFIG_RTC_DRV_DS1307=y
 CONFIG_RWSEM_SPIN_ON_OWNER=y
 CONFIG_SMP=y
+CONFIG_SWIOTLB=y
+CONFIG_TARGET_CPU="8540"
+CONFIG_TARGET_CPU_BOOL=y
 CONFIG_TREE_RCU=y
 CONFIG_TREE_SRCU=y
 CONFIG_XPS=y



From lede-commits at lists.infradead.org  Tue Feb  7 12:25:56 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 07 Feb 2023 15:25:56 -0500
Subject: [openwrt/openwrt]  mpc85xx: p2020: kernel: enable CONFIG_BLK_DEV_NVME
In-Reply-To: <167580155499.2086732.5731032127198855116@git-01.infra.openwrt.org>
References: <167580155499.2086732.5731032127198855116@git-01.infra.openwrt.org>
Message-ID: <mailman.13303.1675801564.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/628870146df4cc327852b1c5cf351d5bde26b61f

commit 628870146df4cc327852b1c5cf351d5bde26b61f
Author: ?imon Bo?ek <simon.borek at nic.cz>
AuthorDate: Tue Apr 19 13:18:42 2022 +0200

    mpc85xx: p2020: kernel: enable CONFIG_BLK_DEV_NVME
    
    Enables use of NVMe storage devices with appropriate adapter in miniPCIe slots (including for boot)
    in Turris 1.x routers and possibly NXP P2020RDB boards
    (these are the only currently supported p2020 devices according to docs[^1]).
    
    Proper detection, mountability and readability was proved to be working
    on Turris 1.1, OpenWrt 21.02 with similar configuration.
    
    Increases gzip compressed kernel size by approximately 37 KiB (from 3 703 KiB to 3 740 KiB).
    
    Should boot from those devices be possible the driver needs to be built in.
    Inclusion as a module would prevent this functionality.
    
    CONFIG_BLK_DEV_NVME=y
    Includes NVMe driver in the kernel.[^2]
    
    CONFIG_NVME_CORE=y
    Selected by CONFIG_BLK_DEV_NVME.[^3] Not necessarily needed to be enabled explicitly,
    but included to match the form of similar functionality implementations
    for mvebu, x86_64 and rockchip_armv8 targets.
    
    CONFIG_NVME_MULTIPATH disabled explicitly to prevent using more space than necessary.
    
    [^1]: https://openwrt.org/docs/techref/targets/mpc85xx
    [^2]: https://cateee.net/lkddb/web-lkddb/BLK_DEV_NVME.html
    [^3]: https://cateee.net/lkddb/web-lkddb/NVME_CORE.html
    
    Signed-off-by: ?imon Bo?ek <simon.borek at nic.cz>
---
 target/linux/mpc85xx/p2020/config-default | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/target/linux/mpc85xx/p2020/config-default b/target/linux/mpc85xx/p2020/config-default
index d3fcce5e93..e293008d8b 100644
--- a/target/linux/mpc85xx/p2020/config-default
+++ b/target/linux/mpc85xx/p2020/config-default
@@ -1,3 +1,4 @@
+CONFIG_BLK_DEV_NVME=y
 CONFIG_CPU_RMAP=y
 CONFIG_DEFAULT_UIMAGE=y
 CONFIG_FSL_ULI1575=y
@@ -19,6 +20,8 @@ CONFIG_MUTEX_SPIN_ON_OWNER=y
 CONFIG_NEED_DMA_MAP_STATE=y
 CONFIG_NET_FLOW_LIMIT=y
 CONFIG_NR_CPUS=2
+CONFIG_NVME_CORE=y
+# CONFIG_NVME_MULTIPATH is not set
 CONFIG_PADATA=y
 CONFIG_PCI_MSI=y
 CONFIG_PCI_MSI_ARCH_FALLBACKS=y



From lede-commits at lists.infradead.org  Tue Feb  7 14:57:12 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 07 Feb 2023 17:57:12 -0500
Subject: [openwrt/openwrt]  kernel: bump 5.10 to 5.10.166
In-Reply-To: <167581063200.2176625.1821382346984309056@git-01.infra.openwrt.org>
References: <167581063200.2176625.1821382346984309056@git-01.infra.openwrt.org>
Message-ID: <mailman.13335.1675810642.3064139.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/71cbc9511119b929d0315602a0b8a3d5b6608e14

commit 71cbc9511119b929d0315602a0b8a3d5b6608e14
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Wed Feb 1 15:44:56 2023 -0500

    kernel: bump 5.10 to 5.10.166
    
    All patches automatically rebased.
    
    Build system: x86_64
    Build-tested: ramips/tplink_archer-a6-v3
    Run-tested: ramips/tplink_archer-a6-v3
    
    Signed-off-by: John Audia <therealgraysky at proton.me>
    (cherry picked from commit 50324b949b91cfb70ced3869b09b895e45a5ae37)
---
 include/kernel-5.10                                |  4 ++--
 ...add-userio-bits-as-platform-configuration.patch | 22 +++++++++++-----------
 ...b-add-function-to-disable-all-macb-clocks.patch |  8 ++++----
 ...-macb-unprepare-clocks-in-case-of-failure.patch |  4 ++--
 ...acb-add-support-for-sama7g5-gem-interface.patch |  6 +++---
 ...cb-add-support-for-sama7g5-emac-interface.patch |  4 ++--
 ...d-default-usrio-config-to-default-gem-con.patch |  6 +++---
 ...dev-Completely-disable-the-spidev-warning.patch |  2 +-
 ...ent-xhci_fixup_endpoint-for-interval-adju.patch |  4 ++--
 ...-device-quirks-for-Freeway-Airmouse-T3-an.patch |  4 ++--
 ...50-0537-clk-Introduce-a-clock-request-API.patch |  2 +-
 ...onntrack-Introduce-tcp-offload-timeout-co.patch |  6 +++---
 ...onntrack-Introduce-udp-offload-timeout-co.patch |  4 ++--
 ...onntrack-remove-offload_pickup-sysctl-aga.patch | 10 +++++-----
 ...pass-the-dst-buffer-to-of_get_mac_address.patch |  6 +++---
 .../130-add-linux-spidev-compatible-si3210.patch   |  2 +-
 .../613-netfilter_optional_tcp_window_check.patch  |  4 ++--
 ...jecting-with-source-address-failed-policy.patch |  2 +-
 ...stmmac-explicitly-deassert-gmac-ahb-reset.patch |  4 ++--
 ...support-hardware-assisted-indirect-access.patch | 22 +++++++++++-----------
 20 files changed, 63 insertions(+), 63 deletions(-)

diff --git a/include/kernel-5.10 b/include/kernel-5.10
index 7a91cd12fa..0c14e6b582 100644
--- a/include/kernel-5.10
+++ b/include/kernel-5.10
@@ -1,2 +1,2 @@
-LINUX_VERSION-5.10 = .165
-LINUX_KERNEL_HASH-5.10.165 = 971defc48f19ed0a2a7ffd4b48234619cac28895c985c6d747f5b707ba47af0d
+LINUX_VERSION-5.10 = .166
+LINUX_KERNEL_HASH-5.10.166 = 0051a1780e5bda0efc68dafab7c728b8283d2b028fedb439418f478be7d3e1af
diff --git a/target/linux/at91/patches-5.10/115-net-macb-add-userio-bits-as-platform-configuration.patch b/target/linux/at91/patches-5.10/115-net-macb-add-userio-bits-as-platform-configuration.patch
index 79e7e62440..acace03c5e 100644
--- a/target/linux/at91/patches-5.10/115-net-macb-add-userio-bits-as-platform-configuration.patch
+++ b/target/linux/at91/patches-5.10/115-net-macb-add-userio-bits-as-platform-configuration.patch
@@ -49,7 +49,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  #ifdef CONFIG_MACB_USE_HWSTAMP
 --- a/drivers/net/ethernet/cadence/macb_main.c
 +++ b/drivers/net/ethernet/cadence/macb_main.c
-@@ -3831,15 +3831,15 @@ static int macb_init(struct platform_dev
+@@ -3824,15 +3824,15 @@ static int macb_init(struct platform_dev
  	if (!(bp->caps & MACB_CAPS_USRIO_DISABLED)) {
  		val = 0;
  		if (phy_interface_mode_is_rgmii(bp->phy_interface))
@@ -69,7 +69,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  		macb_or_gem_writel(bp, USRIO, val);
  	}
-@@ -4357,6 +4357,13 @@ static int fu540_c000_init(struct platfo
+@@ -4350,6 +4350,13 @@ static int fu540_c000_init(struct platfo
  	return macb_init(pdev);
  }
  
@@ -83,7 +83,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static const struct macb_config fu540_c000_config = {
  	.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO |
  		MACB_CAPS_GEM_HAS_PTP,
-@@ -4364,12 +4371,14 @@ static const struct macb_config fu540_c0
+@@ -4357,12 +4364,14 @@ static const struct macb_config fu540_c0
  	.clk_init = fu540_c000_clk_init,
  	.init = fu540_c000_init,
  	.jumbo_max_len = 10240,
@@ -98,7 +98,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static const struct macb_config sama5d3macb_config = {
-@@ -4377,6 +4386,7 @@ static const struct macb_config sama5d3m
+@@ -4370,6 +4379,7 @@ static const struct macb_config sama5d3m
  	      | MACB_CAPS_USRIO_HAS_CLKEN | MACB_CAPS_USRIO_DEFAULT_IS_MII_GMII,
  	.clk_init = macb_clk_init,
  	.init = macb_init,
@@ -106,7 +106,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static const struct macb_config pc302gem_config = {
-@@ -4384,6 +4394,7 @@ static const struct macb_config pc302gem
+@@ -4377,6 +4387,7 @@ static const struct macb_config pc302gem
  	.dma_burst_length = 16,
  	.clk_init = macb_clk_init,
  	.init = macb_init,
@@ -114,7 +114,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static const struct macb_config sama5d2_config = {
-@@ -4391,6 +4402,7 @@ static const struct macb_config sama5d2_
+@@ -4384,6 +4395,7 @@ static const struct macb_config sama5d2_
  	.dma_burst_length = 16,
  	.clk_init = macb_clk_init,
  	.init = macb_init,
@@ -122,7 +122,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static const struct macb_config sama5d3_config = {
-@@ -4400,6 +4412,7 @@ static const struct macb_config sama5d3_
+@@ -4393,6 +4405,7 @@ static const struct macb_config sama5d3_
  	.clk_init = macb_clk_init,
  	.init = macb_init,
  	.jumbo_max_len = 10240,
@@ -130,7 +130,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static const struct macb_config sama5d4_config = {
-@@ -4407,18 +4420,21 @@ static const struct macb_config sama5d4_
+@@ -4400,18 +4413,21 @@ static const struct macb_config sama5d4_
  	.dma_burst_length = 4,
  	.clk_init = macb_clk_init,
  	.init = macb_init,
@@ -152,7 +152,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static const struct macb_config zynqmp_config = {
-@@ -4429,6 +4445,7 @@ static const struct macb_config zynqmp_c
+@@ -4422,6 +4438,7 @@ static const struct macb_config zynqmp_c
  	.clk_init = macb_clk_init,
  	.init = macb_init,
  	.jumbo_max_len = 10240,
@@ -160,7 +160,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static const struct macb_config zynq_config = {
-@@ -4437,6 +4454,7 @@ static const struct macb_config zynq_con
+@@ -4430,6 +4447,7 @@ static const struct macb_config zynq_con
  	.dma_burst_length = 16,
  	.clk_init = macb_clk_init,
  	.init = macb_init,
@@ -168,7 +168,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  };
  
  static const struct of_device_id macb_dt_ids[] = {
-@@ -4557,6 +4575,8 @@ static int macb_probe(struct platform_de
+@@ -4550,6 +4568,8 @@ static int macb_probe(struct platform_de
  		bp->wol |= MACB_WOL_HAS_MAGIC_PACKET;
  	device_set_wakeup_capable(&pdev->dev, bp->wol & MACB_WOL_HAS_MAGIC_PACKET);
  
diff --git a/target/linux/at91/patches-5.10/117-net-macb-add-function-to-disable-all-macb-clocks.patch b/target/linux/at91/patches-5.10/117-net-macb-add-function-to-disable-all-macb-clocks.patch
index a474f2a405..6541d32dd2 100644
--- a/target/linux/at91/patches-5.10/117-net-macb-add-function-to-disable-all-macb-clocks.patch
+++ b/target/linux/at91/patches-5.10/117-net-macb-add-function-to-disable-all-macb-clocks.patch
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/cadence/macb_main.c
 +++ b/drivers/net/ethernet/cadence/macb_main.c
-@@ -3606,6 +3606,20 @@ static void macb_probe_queues(void __iom
+@@ -3599,6 +3599,20 @@ static void macb_probe_queues(void __iom
  	*num_queues = hweight32(*queue_mask);
  }
  
@@ -35,7 +35,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static int macb_clk_init(struct platform_device *pdev, struct clk **pclk,
  			 struct clk **hclk, struct clk **tx_clk,
  			 struct clk **rx_clk, struct clk **tsu_clk)
-@@ -4668,11 +4682,7 @@ err_out_free_netdev:
+@@ -4661,11 +4675,7 @@ err_out_free_netdev:
  	free_netdev(dev);
  
  err_disable_clocks:
@@ -48,7 +48,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	pm_runtime_disable(&pdev->dev);
  	pm_runtime_set_suspended(&pdev->dev);
  	pm_runtime_dont_use_autosuspend(&pdev->dev);
-@@ -4697,11 +4707,8 @@ static int macb_remove(struct platform_d
+@@ -4690,11 +4700,8 @@ static int macb_remove(struct platform_d
  		pm_runtime_disable(&pdev->dev);
  		pm_runtime_dont_use_autosuspend(&pdev->dev);
  		if (!pm_runtime_suspended(&pdev->dev)) {
@@ -62,7 +62,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  			pm_runtime_set_suspended(&pdev->dev);
  		}
  		phylink_destroy(bp->phylink);
-@@ -4880,13 +4887,10 @@ static int __maybe_unused macb_runtime_s
+@@ -4873,13 +4880,10 @@ static int __maybe_unused macb_runtime_s
  	struct net_device *netdev = dev_get_drvdata(dev);
  	struct macb *bp = netdev_priv(netdev);
  
diff --git a/target/linux/at91/patches-5.10/118-net-macb-unprepare-clocks-in-case-of-failure.patch b/target/linux/at91/patches-5.10/118-net-macb-unprepare-clocks-in-case-of-failure.patch
index 7456cc6c52..3e5d42b24f 100644
--- a/target/linux/at91/patches-5.10/118-net-macb-unprepare-clocks-in-case-of-failure.patch
+++ b/target/linux/at91/patches-5.10/118-net-macb-unprepare-clocks-in-case-of-failure.patch
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/cadence/macb_main.c
 +++ b/drivers/net/ethernet/cadence/macb_main.c
-@@ -4338,8 +4338,10 @@ static int fu540_c000_clk_init(struct pl
+@@ -4331,8 +4331,10 @@ static int fu540_c000_clk_init(struct pl
  		return err;
  
  	mgmt = devm_kzalloc(&pdev->dev, sizeof(*mgmt), GFP_KERNEL);
@@ -27,7 +27,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  
  	init.name = "sifive-gemgxl-mgmt";
  	init.ops = &fu540_c000_ops;
-@@ -4350,16 +4352,26 @@ static int fu540_c000_clk_init(struct pl
+@@ -4343,16 +4345,26 @@ static int fu540_c000_clk_init(struct pl
  	mgmt->hw.init = &init;
  
  	*tx_clk = devm_clk_register(&pdev->dev, &mgmt->hw);
diff --git a/target/linux/at91/patches-5.10/119-net-macb-add-support-for-sama7g5-gem-interface.patch b/target/linux/at91/patches-5.10/119-net-macb-add-support-for-sama7g5-gem-interface.patch
index 64abd3d6c0..1bc648842c 100644
--- a/target/linux/at91/patches-5.10/119-net-macb-add-support-for-sama7g5-gem-interface.patch
+++ b/target/linux/at91/patches-5.10/119-net-macb-add-support-for-sama7g5-gem-interface.patch
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/cadence/macb_main.c
 +++ b/drivers/net/ethernet/cadence/macb_main.c
-@@ -4390,6 +4390,14 @@ static const struct macb_usrio_config ma
+@@ -4383,6 +4383,14 @@ static const struct macb_usrio_config ma
  	.refclk = MACB_BIT(CLKEN),
  };
  
@@ -29,7 +29,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static const struct macb_config fu540_c000_config = {
  	.caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_JUMBO |
  		MACB_CAPS_GEM_HAS_PTP,
-@@ -4483,6 +4491,14 @@ static const struct macb_config zynq_con
+@@ -4476,6 +4484,14 @@ static const struct macb_config zynq_con
  	.usrio = &macb_default_usrio,
  };
  
@@ -44,7 +44,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static const struct of_device_id macb_dt_ids[] = {
  	{ .compatible = "cdns,at32ap7000-macb" },
  	{ .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config },
-@@ -4500,6 +4516,7 @@ static const struct of_device_id macb_dt
+@@ -4493,6 +4509,7 @@ static const struct of_device_id macb_dt
  	{ .compatible = "cdns,zynqmp-gem", .data = &zynqmp_config},
  	{ .compatible = "cdns,zynq-gem", .data = &zynq_config },
  	{ .compatible = "sifive,fu540-c000-gem", .data = &fu540_c000_config },
diff --git a/target/linux/at91/patches-5.10/120-net-macb-add-support-for-sama7g5-emac-interface.patch b/target/linux/at91/patches-5.10/120-net-macb-add-support-for-sama7g5-emac-interface.patch
index 50d31f736b..4d49908ec9 100644
--- a/target/linux/at91/patches-5.10/120-net-macb-add-support-for-sama7g5-emac-interface.patch
+++ b/target/linux/at91/patches-5.10/120-net-macb-add-support-for-sama7g5-emac-interface.patch
@@ -14,7 +14,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/cadence/macb_main.c
 +++ b/drivers/net/ethernet/cadence/macb_main.c
-@@ -4499,6 +4499,14 @@ static const struct macb_config sama7g5_
+@@ -4492,6 +4492,14 @@ static const struct macb_config sama7g5_
  	.usrio = &sama7g5_usrio,
  };
  
@@ -29,7 +29,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static const struct of_device_id macb_dt_ids[] = {
  	{ .compatible = "cdns,at32ap7000-macb" },
  	{ .compatible = "cdns,at91sam9260-macb", .data = &at91sam9260_config },
-@@ -4517,6 +4525,7 @@ static const struct of_device_id macb_dt
+@@ -4510,6 +4518,7 @@ static const struct of_device_id macb_dt
  	{ .compatible = "cdns,zynq-gem", .data = &zynq_config },
  	{ .compatible = "sifive,fu540-c000-gem", .data = &fu540_c000_config },
  	{ .compatible = "microchip,sama7g5-gem", .data = &sama7g5_gem_config },
diff --git a/target/linux/at91/patches-5.10/148-net-macb-Add-default-usrio-config-to-default-gem-con.patch b/target/linux/at91/patches-5.10/148-net-macb-Add-default-usrio-config-to-default-gem-con.patch
index 721ddaea00..130646a0b3 100644
--- a/target/linux/at91/patches-5.10/148-net-macb-Add-default-usrio-config-to-default-gem-con.patch
+++ b/target/linux/at91/patches-5.10/148-net-macb-Add-default-usrio-config-to-default-gem-con.patch
@@ -20,7 +20,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/cadence/macb_main.c
 +++ b/drivers/net/ethernet/cadence/macb_main.c
-@@ -3868,6 +3868,13 @@ static int macb_init(struct platform_dev
+@@ -3861,6 +3861,13 @@ static int macb_init(struct platform_dev
  	return 0;
  }
  
@@ -34,7 +34,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  #if defined(CONFIG_OF)
  /* 1518 rounded up */
  #define AT91ETHER_MAX_RBUFF_SZ	0x600
-@@ -4383,13 +4390,6 @@ static int fu540_c000_init(struct platfo
+@@ -4376,13 +4383,6 @@ static int fu540_c000_init(struct platfo
  	return macb_init(pdev);
  }
  
@@ -48,7 +48,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  static const struct macb_usrio_config sama7g5_usrio = {
  	.mii = 0,
  	.rmii = 1,
-@@ -4538,6 +4538,7 @@ static const struct macb_config default_
+@@ -4531,6 +4531,7 @@ static const struct macb_config default_
  	.dma_burst_length = 16,
  	.clk_init = macb_clk_init,
  	.init = macb_init,
diff --git a/target/linux/bcm27xx/patches-5.10/950-0013-spi-spidev-Completely-disable-the-spidev-warning.patch b/target/linux/bcm27xx/patches-5.10/950-0013-spi-spidev-Completely-disable-the-spidev-warning.patch
index bc772dbecc..d464bf35dc 100644
--- a/target/linux/bcm27xx/patches-5.10/950-0013-spi-spidev-Completely-disable-the-spidev-warning.patch
+++ b/target/linux/bcm27xx/patches-5.10/950-0013-spi-spidev-Completely-disable-the-spidev-warning.patch
@@ -13,7 +13,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 
 --- a/drivers/spi/spidev.c
 +++ b/drivers/spi/spidev.c
-@@ -744,7 +744,7 @@ static int spidev_probe(struct spi_devic
+@@ -742,7 +742,7 @@ static int spidev_probe(struct spi_devic
  	 * compatible string, it is a Linux implementation thing
  	 * rather than a description of the hardware.
  	 */
diff --git a/target/linux/bcm27xx/patches-5.10/950-0139-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch b/target/linux/bcm27xx/patches-5.10/950-0139-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch
index ccb78c8abd..307b27dcdd 100644
--- a/target/linux/bcm27xx/patches-5.10/950-0139-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch
+++ b/target/linux/bcm27xx/patches-5.10/950-0139-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch
@@ -15,7 +15,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.org>
 
 --- a/drivers/usb/host/xhci.c
 +++ b/drivers/usb/host/xhci.c
-@@ -1492,6 +1492,103 @@ command_cleanup:
+@@ -1494,6 +1494,103 @@ command_cleanup:
  }
  
  /*
@@ -119,7 +119,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.org>
   * non-error returns are a promise to giveback() the urb later
   * we drop ownership so next owner (or urb unlink) can get it
   */
-@@ -5412,6 +5509,7 @@ static const struct hc_driver xhci_hc_dr
+@@ -5414,6 +5511,7 @@ static const struct hc_driver xhci_hc_dr
  	.endpoint_reset =	xhci_endpoint_reset,
  	.check_bandwidth =	xhci_check_bandwidth,
  	.reset_bandwidth =	xhci_reset_bandwidth,
diff --git a/target/linux/bcm27xx/patches-5.10/950-0151-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch b/target/linux/bcm27xx/patches-5.10/950-0151-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch
index 1de19d4436..089c05864a 100644
--- a/target/linux/bcm27xx/patches-5.10/950-0151-hid-usb-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch
+++ b/target/linux/bcm27xx/patches-5.10/950-0151-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
  
-@@ -1281,6 +1284,9 @@
+@@ -1280,6 +1283,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 },
-@@ -198,6 +199,7 @@ static const struct hid_device_id hid_qu
+@@ -197,6 +198,7 @@ static const struct hid_device_id hid_qu
  	{ 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 },
  	{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_GROUP_AUDIO), HID_QUIRK_NOGET },
diff --git a/target/linux/bcm27xx/patches-5.10/950-0537-clk-Introduce-a-clock-request-API.patch b/target/linux/bcm27xx/patches-5.10/950-0537-clk-Introduce-a-clock-request-API.patch
index 08704ebc00..c4d44a8a7c 100644
--- a/target/linux/bcm27xx/patches-5.10/950-0537-clk-Introduce-a-clock-request-API.patch
+++ b/target/linux/bcm27xx/patches-5.10/950-0537-clk-Introduce-a-clock-request-API.patch
@@ -272,7 +272,7 @@ Signed-off-by: Maxime Ripard <maxime at cerno.tech>
  struct device_node;
  struct of_phandle_args;
  
-@@ -743,6 +744,9 @@ int clk_save_context(void);
+@@ -828,6 +829,9 @@ int clk_save_context(void);
   */
  void clk_restore_context(void);
  
diff --git a/target/linux/generic/backport-5.10/610-v5.13-55-netfilter-conntrack-Introduce-tcp-offload-timeout-co.patch b/target/linux/generic/backport-5.10/610-v5.13-55-netfilter-conntrack-Introduce-tcp-offload-timeout-co.patch
index abc58d2a7c..0d30b0c593 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-55-netfilter-conntrack-Introduce-tcp-offload-timeout-co.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-55-netfilter-conntrack-Introduce-tcp-offload-timeout-co.patch
@@ -33,7 +33,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  enum udp_conntrack {
 --- a/net/netfilter/nf_conntrack_proto_tcp.c
 +++ b/net/netfilter/nf_conntrack_proto_tcp.c
-@@ -1447,6 +1447,11 @@ void nf_conntrack_tcp_init_net(struct ne
+@@ -1457,6 +1457,11 @@ void nf_conntrack_tcp_init_net(struct ne
  	tn->tcp_loose = nf_ct_tcp_loose;
  	tn->tcp_be_liberal = nf_ct_tcp_be_liberal;
  	tn->tcp_max_retrans = nf_ct_tcp_max_retrans;
@@ -58,7 +58,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  	NF_SYSCTL_CT_PROTO_TCP_LOOSE,
  	NF_SYSCTL_CT_PROTO_TCP_LIBERAL,
  	NF_SYSCTL_CT_PROTO_TCP_MAX_RETRANS,
-@@ -758,6 +762,20 @@ static struct ctl_table nf_ct_sysctl_tab
+@@ -757,6 +761,20 @@ static struct ctl_table nf_ct_sysctl_tab
  		.mode		= 0644,
  		.proc_handler	= proc_dointvec_jiffies,
  	},
@@ -79,7 +79,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  	[NF_SYSCTL_CT_PROTO_TCP_LOOSE] = {
  		.procname	= "nf_conntrack_tcp_loose",
  		.maxlen		= sizeof(int),
-@@ -967,6 +985,12 @@ static void nf_conntrack_standalone_init
+@@ -960,6 +978,12 @@ static void nf_conntrack_standalone_init
  	XASSIGN(LIBERAL, &tn->tcp_be_liberal);
  	XASSIGN(MAX_RETRANS, &tn->tcp_max_retrans);
  #undef XASSIGN
diff --git a/target/linux/generic/backport-5.10/610-v5.13-56-netfilter-conntrack-Introduce-udp-offload-timeout-co.patch b/target/linux/generic/backport-5.10/610-v5.13-56-netfilter-conntrack-Introduce-udp-offload-timeout-co.patch
index 416e20356d..93ff24a941 100644
--- a/target/linux/generic/backport-5.10/610-v5.13-56-netfilter-conntrack-Introduce-udp-offload-timeout-co.patch
+++ b/target/linux/generic/backport-5.10/610-v5.13-56-netfilter-conntrack-Introduce-udp-offload-timeout-co.patch
@@ -58,7 +58,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  	NF_SYSCTL_CT_PROTO_TIMEOUT_ICMP,
  	NF_SYSCTL_CT_PROTO_TIMEOUT_ICMPV6,
  #ifdef CONFIG_NF_CT_PROTO_SCTP
-@@ -810,6 +814,20 @@ static struct ctl_table nf_ct_sysctl_tab
+@@ -809,6 +813,20 @@ static struct ctl_table nf_ct_sysctl_tab
  		.mode		= 0644,
  		.proc_handler	= proc_dointvec_jiffies,
  	},
@@ -79,7 +79,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  	[NF_SYSCTL_CT_PROTO_TIMEOUT_ICMP] = {
  		.procname	= "nf_conntrack_icmp_timeout",
  		.maxlen		= sizeof(unsigned int),
-@@ -1078,6 +1096,10 @@ static int nf_conntrack_standalone_init_
+@@ -1070,6 +1088,10 @@ static int nf_conntrack_standalone_init_
  	table[NF_SYSCTL_CT_PROTO_TIMEOUT_ICMPV6].data = &nf_icmpv6_pernet(net)->timeout;
  	table[NF_SYSCTL_CT_PROTO_TIMEOUT_UDP].data = &un->timeouts[UDP_CT_UNREPLIED];
  	table[NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_STREAM].data = &un->timeouts[UDP_CT_REPLIED];
diff --git a/target/linux/generic/backport-5.10/613-v5.15-02-netfilter-conntrack-remove-offload_pickup-sysctl-aga.patch b/target/linux/generic/backport-5.10/613-v5.15-02-netfilter-conntrack-remove-offload_pickup-sysctl-aga.patch
index 0ed23e9614..71266c8a70 100644
--- a/target/linux/generic/backport-5.10/613-v5.15-02-netfilter-conntrack-remove-offload_pickup-sysctl-aga.patch
+++ b/target/linux/generic/backport-5.10/613-v5.15-02-netfilter-conntrack-remove-offload_pickup-sysctl-aga.patch
@@ -73,7 +73,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  
 --- a/net/netfilter/nf_conntrack_proto_tcp.c
 +++ b/net/netfilter/nf_conntrack_proto_tcp.c
-@@ -1450,7 +1450,6 @@ void nf_conntrack_tcp_init_net(struct ne
+@@ -1460,7 +1460,6 @@ void nf_conntrack_tcp_init_net(struct ne
  
  #if IS_ENABLED(CONFIG_NF_FLOW_TABLE)
  	tn->offload_timeout = 30 * HZ;
@@ -109,7 +109,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  #endif
  	NF_SYSCTL_CT_PROTO_TIMEOUT_ICMP,
  	NF_SYSCTL_CT_PROTO_TIMEOUT_ICMPV6,
-@@ -773,12 +771,6 @@ static struct ctl_table nf_ct_sysctl_tab
+@@ -772,12 +770,6 @@ static struct ctl_table nf_ct_sysctl_tab
  		.mode		= 0644,
  		.proc_handler	= proc_dointvec_jiffies,
  	},
@@ -122,7 +122,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  #endif
  	[NF_SYSCTL_CT_PROTO_TCP_LOOSE] = {
  		.procname	= "nf_conntrack_tcp_loose",
-@@ -821,12 +813,6 @@ static struct ctl_table nf_ct_sysctl_tab
+@@ -820,12 +812,6 @@ static struct ctl_table nf_ct_sysctl_tab
  		.mode		= 0644,
  		.proc_handler	= proc_dointvec_jiffies,
  	},
@@ -135,7 +135,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  #endif
  	[NF_SYSCTL_CT_PROTO_TIMEOUT_ICMP] = {
  		.procname	= "nf_conntrack_icmp_timeout",
-@@ -1006,7 +992,6 @@ static void nf_conntrack_standalone_init
+@@ -999,7 +985,6 @@ static void nf_conntrack_standalone_init
  
  #if IS_ENABLED(CONFIG_NF_FLOW_TABLE)
  	table[NF_SYSCTL_CT_PROTO_TIMEOUT_TCP_OFFLOAD].data = &tn->offload_timeout;
@@ -143,7 +143,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo at netfilter.org>
  #endif
  
  }
-@@ -1098,7 +1083,6 @@ static int nf_conntrack_standalone_init_
+@@ -1090,7 +1075,6 @@ static int nf_conntrack_standalone_init_
  	table[NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_STREAM].data = &un->timeouts[UDP_CT_REPLIED];
  #if IS_ENABLED(CONFIG_NF_FLOW_TABLE)
  	table[NF_SYSCTL_CT_PROTO_TIMEOUT_UDP_OFFLOAD].data = &un->offload_timeout;
diff --git a/target/linux/generic/backport-5.10/732-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch b/target/linux/generic/backport-5.10/732-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch
index 928e1ca0dc..9df87df947 100644
--- a/target/linux/generic/backport-5.10/732-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch
+++ b/target/linux/generic/backport-5.10/732-net-next-1-of-net-pass-the-dst-buffer-to-of_get_mac_address.patch
@@ -423,7 +423,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	if (bgmac->irq < 0)
 --- a/drivers/net/ethernet/cadence/macb_main.c
 +++ b/drivers/net/ethernet/cadence/macb_main.c
-@@ -4487,7 +4487,6 @@ static int macb_probe(struct platform_de
+@@ -4480,7 +4480,6 @@ static int macb_probe(struct platform_de
  	struct net_device *dev;
  	struct resource *regs;
  	void __iomem *mem;
@@ -431,7 +431,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	struct macb *bp;
  	int err, val;
  
-@@ -4600,15 +4599,11 @@ static int macb_probe(struct platform_de
+@@ -4593,15 +4592,11 @@ static int macb_probe(struct platform_de
  	if (bp->caps & MACB_CAPS_NEEDS_RSTONUBR)
  		bp->rx_intr_mask |= MACB_BIT(RXUBR);
  
@@ -1360,7 +1360,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	int irq;
 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
 +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
-@@ -5008,7 +5008,7 @@ int stmmac_dvr_probe(struct device *devi
+@@ -5013,7 +5013,7 @@ int stmmac_dvr_probe(struct device *devi
  	priv->wol_irq = res->wol_irq;
  	priv->lpi_irq = res->lpi_irq;
  
diff --git a/target/linux/generic/pending-5.10/130-add-linux-spidev-compatible-si3210.patch b/target/linux/generic/pending-5.10/130-add-linux-spidev-compatible-si3210.patch
index 5f1567cb22..e14a2886df 100644
--- a/target/linux/generic/pending-5.10/130-add-linux-spidev-compatible-si3210.patch
+++ b/target/linux/generic/pending-5.10/130-add-linux-spidev-compatible-si3210.patch
@@ -8,7 +8,7 @@ Signed-off-by: Giuseppe Lippolis <giu.lippolis at gmail.com>
 
 --- a/drivers/spi/spidev.c
 +++ b/drivers/spi/spidev.c
-@@ -693,6 +693,7 @@ static const struct of_device_id spidev_
+@@ -691,6 +691,7 @@ static const struct of_device_id spidev_
  	{ .compatible = "lwn,bk4" },
  	{ .compatible = "dh,dhcom-board" },
  	{ .compatible = "menlo,m53cpld" },
diff --git a/target/linux/generic/pending-5.10/613-netfilter_optional_tcp_window_check.patch b/target/linux/generic/pending-5.10/613-netfilter_optional_tcp_window_check.patch
index 458b6761bc..79fd2762b3 100644
--- a/target/linux/generic/pending-5.10/613-netfilter_optional_tcp_window_check.patch
+++ b/target/linux/generic/pending-5.10/613-netfilter_optional_tcp_window_check.patch
@@ -49,7 +49,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static bool enable_hooks __read_mostly;
  MODULE_PARM_DESC(enable_hooks, "Always enable conntrack hooks");
  module_param(enable_hooks, bool, 0000);
-@@ -658,6 +661,7 @@ enum nf_ct_sysctl_index {
+@@ -657,6 +660,7 @@ enum nf_ct_sysctl_index {
  	NF_SYSCTL_CT_PROTO_TIMEOUT_GRE_STREAM,
  #endif
  
@@ -57,7 +57,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	__NF_SYSCTL_CT_LAST_SYSCTL,
  };
  
-@@ -1000,6 +1004,13 @@ static struct ctl_table nf_ct_sysctl_tab
+@@ -993,6 +997,13 @@ static struct ctl_table nf_ct_sysctl_tab
  		.proc_handler   = proc_dointvec_jiffies,
  	},
  #endif
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 f2ab205f26..eaab1edc6e 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
@@ -53,7 +53,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  
 --- a/net/ipv4/fib_semantics.c
 +++ b/net/ipv4/fib_semantics.c
-@@ -142,6 +142,10 @@ const struct fib_prop fib_props[RTN_MAX
+@@ -143,6 +143,10 @@ const struct fib_prop fib_props[RTN_MAX
  		.error	= -EINVAL,
  		.scope	= RT_SCOPE_NOWHERE,
  	},
diff --git a/target/linux/ipq806x/patches-5.10/108-v5.14-net-stmmac-explicitly-deassert-gmac-ahb-reset.patch b/target/linux/ipq806x/patches-5.10/108-v5.14-net-stmmac-explicitly-deassert-gmac-ahb-reset.patch
index 64efbd74c5..907fcf832b 100644
--- a/target/linux/ipq806x/patches-5.10/108-v5.14-net-stmmac-explicitly-deassert-gmac-ahb-reset.patch
+++ b/target/linux/ipq806x/patches-5.10/108-v5.14-net-stmmac-explicitly-deassert-gmac-ahb-reset.patch
@@ -29,7 +29,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
 +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
-@@ -5041,6 +5041,10 @@ int stmmac_dvr_probe(struct device *devi
+@@ -5046,6 +5046,10 @@ int stmmac_dvr_probe(struct device *devi
  			reset_control_reset(priv->plat->stmmac_rst);
  	}
  
@@ -40,7 +40,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	/* Init MAC and get the capabilities */
  	ret = stmmac_hw_init(priv);
  	if (ret)
-@@ -5255,6 +5259,7 @@ int stmmac_dvr_remove(struct device *dev
+@@ -5260,6 +5264,7 @@ int stmmac_dvr_remove(struct device *dev
  	phylink_destroy(priv->phylink);
  	if (priv->plat->stmmac_rst)
  		reset_control_assert(priv->plat->stmmac_rst);
diff --git a/target/linux/realtek/patches-5.10/800-net-mdio-support-hardware-assisted-indirect-access.patch b/target/linux/realtek/patches-5.10/800-net-mdio-support-hardware-assisted-indirect-access.patch
index eeb26fa199..aca017c03a 100644
--- a/target/linux/realtek/patches-5.10/800-net-mdio-support-hardware-assisted-indirect-access.patch
+++ b/target/linux/realtek/patches-5.10/800-net-mdio-support-hardware-assisted-indirect-access.patch
@@ -32,7 +32,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
 
 --- a/drivers/net/phy/mdio_bus.c
 +++ b/drivers/net/phy/mdio_bus.c
-@@ -734,6 +734,32 @@ out:
+@@ -739,6 +739,32 @@ out:
  }
  
  /**
@@ -65,7 +65,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * __mdiobus_read - Unlocked version of the mdiobus_read function
   * @bus: the mii_bus struct
   * @addr: the phy address
-@@ -749,7 +775,10 @@ int __mdiobus_read(struct mii_bus *bus,
+@@ -754,7 +780,10 @@ int __mdiobus_read(struct mii_bus *bus,
  
  	WARN_ON_ONCE(!mutex_is_locked(&bus->mdio_lock));
  
@@ -77,7 +77,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  
  	trace_mdio_access(bus, 1, addr, regnum, retval, retval);
  	mdiobus_stats_acct(&bus->stats[addr], true, retval);
-@@ -759,6 +788,40 @@ int __mdiobus_read(struct mii_bus *bus,
+@@ -764,6 +793,40 @@ int __mdiobus_read(struct mii_bus *bus,
  EXPORT_SYMBOL(__mdiobus_read);
  
  /**
@@ -118,7 +118,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * __mdiobus_write - Unlocked version of the mdiobus_write function
   * @bus: the mii_bus struct
   * @addr: the phy address
-@@ -775,7 +838,10 @@ int __mdiobus_write(struct mii_bus *bus,
+@@ -780,7 +843,10 @@ int __mdiobus_write(struct mii_bus *bus,
  
  	WARN_ON_ONCE(!mutex_is_locked(&bus->mdio_lock));
  
@@ -130,7 +130,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  
  	trace_mdio_access(bus, 0, addr, regnum, val, err);
  	mdiobus_stats_acct(&bus->stats[addr], false, err);
-@@ -785,6 +851,39 @@ int __mdiobus_write(struct mii_bus *bus,
+@@ -790,6 +856,39 @@ int __mdiobus_write(struct mii_bus *bus,
  EXPORT_SYMBOL(__mdiobus_write);
  
  /**
@@ -170,7 +170,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * __mdiobus_modify_changed - Unlocked version of the mdiobus_modify function
   * @bus: the mii_bus struct
   * @addr: the phy address
-@@ -817,6 +916,43 @@ int __mdiobus_modify_changed(struct mii_
+@@ -822,6 +921,43 @@ int __mdiobus_modify_changed(struct mii_
  EXPORT_SYMBOL_GPL(__mdiobus_modify_changed);
  
  /**
@@ -214,7 +214,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * mdiobus_read_nested - Nested version of the mdiobus_read function
   * @bus: the mii_bus struct
   * @addr: the phy address
-@@ -842,6 +978,79 @@ int mdiobus_read_nested(struct mii_bus *
+@@ -847,6 +983,79 @@ int mdiobus_read_nested(struct mii_bus *
  EXPORT_SYMBOL(mdiobus_read_nested);
  
  /**
@@ -294,7 +294,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * mdiobus_read - Convenience function for reading a given MII mgmt register
   * @bus: the mii_bus struct
   * @addr: the phy address
-@@ -864,6 +1073,29 @@ int mdiobus_read(struct mii_bus *bus, in
+@@ -869,6 +1078,29 @@ int mdiobus_read(struct mii_bus *bus, in
  EXPORT_SYMBOL(mdiobus_read);
  
  /**
@@ -324,7 +324,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * mdiobus_write_nested - Nested version of the mdiobus_write function
   * @bus: the mii_bus struct
   * @addr: the phy address
-@@ -890,6 +1122,33 @@ int mdiobus_write_nested(struct mii_bus
+@@ -895,6 +1127,33 @@ int mdiobus_write_nested(struct mii_bus
  EXPORT_SYMBOL(mdiobus_write_nested);
  
  /**
@@ -358,7 +358,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * mdiobus_write - Convenience function for writing a given MII mgmt register
   * @bus: the mii_bus struct
   * @addr: the phy address
-@@ -913,6 +1172,30 @@ int mdiobus_write(struct mii_bus *bus, i
+@@ -918,6 +1177,30 @@ int mdiobus_write(struct mii_bus *bus, i
  EXPORT_SYMBOL(mdiobus_write);
  
  /**
@@ -389,7 +389,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
   * mdiobus_modify - Convenience function for modifying a given mdio device
   *	register
   * @bus: the mii_bus struct
-@@ -934,6 +1217,51 @@ int mdiobus_modify(struct mii_bus *bus,
+@@ -939,6 +1222,51 @@ int mdiobus_modify(struct mii_bus *bus,
  EXPORT_SYMBOL_GPL(mdiobus_modify);
  
  /**



From lede-commits at lists.infradead.org  Tue Feb  7 15:14:31 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 07 Feb 2023 18:14:31 -0500
Subject: [openwrt/openwrt]  tools/e2fsprogs: update to 1.46.6
In-Reply-To: <167581167163.2189150.7832723384494058892@git-01.infra.openwrt.org>
References: <167581167163.2189150.7832723384494058892@git-01.infra.openwrt.org>
Message-ID: <mailman.13340.1675811681.3064139.lede-commits@lists.infradead.org>

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

commit 38350650cbc43c0386977c9ca532b71ece15c80b
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Sun Feb 5 21:14:19 2023 +0100

    tools/e2fsprogs: update to 1.46.6
    
    Release information:
    https://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.46.6
    
    Remove upstreamed patch:
    - 004-CVE-2022-1304-libext2fs-add-sanity-check-to-extent-manipulation.patch
    
    Refresh patch:
    - 003-no-crond.patch
    
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 tools/e2fsprogs/Makefile                           |  6 +--
 tools/e2fsprogs/patches/003-no-crond.patch         |  8 ++--
 ...s-add-sanity-check-to-extent-manipulation.patch | 50 ----------------------
 3 files changed, 7 insertions(+), 57 deletions(-)

diff --git a/tools/e2fsprogs/Makefile b/tools/e2fsprogs/Makefile
index a8bd745afb..1c72611df7 100644
--- a/tools/e2fsprogs/Makefile
+++ b/tools/e2fsprogs/Makefile
@@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=e2fsprogs
 PKG_CPE_ID:=cpe:/a:e2fsprogs_project:e2fsprogs
-PKG_VERSION:=1.46.5
-PKG_HASH:=2f16c9176704cf645dc69d5b15ff704ae722d665df38b2ed3cfc249757d8d81e
-PKG_RELEASE:=2
+PKG_VERSION:=1.46.6
+PKG_HASH:=a77517f19ff5e4e97ede63536566865dd5d48654e13fc145f5f2249ef7c4f4fc
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/
diff --git a/tools/e2fsprogs/patches/003-no-crond.patch b/tools/e2fsprogs/patches/003-no-crond.patch
index a7ea52b1ac..67ddd4ab0c 100644
--- a/tools/e2fsprogs/patches/003-no-crond.patch
+++ b/tools/e2fsprogs/patches/003-no-crond.patch
@@ -1,11 +1,11 @@
 --- a/configure
 +++ b/configure
-@@ -12538,7 +12538,7 @@ $as_echo_n "checking for system crontab
+@@ -15259,7 +15259,7 @@ then :
  
- 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${crond_dir}" >&5
- $as_echo "${crond_dir}" >&6; }
+ 		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${crond_dir}" >&5
+ printf "%s\n" "${crond_dir}" >&6; }
 -		have_crond="yes"
 +		have_crond="no"; with_crond_dir=""
  
- else
+ else $as_nop
  
diff --git a/tools/e2fsprogs/patches/004-CVE-2022-1304-libext2fs-add-sanity-check-to-extent-manipulation.patch b/tools/e2fsprogs/patches/004-CVE-2022-1304-libext2fs-add-sanity-check-to-extent-manipulation.patch
deleted file mode 100644
index e5a76161f2..0000000000
--- a/tools/e2fsprogs/patches/004-CVE-2022-1304-libext2fs-add-sanity-check-to-extent-manipulation.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From ab51d587bb9b229b1fade1afd02e1574c1ba5c76 Mon Sep 17 00:00:00 2001
-From: Lukas Czerner <lczerner at redhat.com>
-Date: Thu, 21 Apr 2022 19:31:48 +0200
-Subject: libext2fs: add sanity check to extent manipulation
-
-It is possible to have a corrupted extent tree in such a way that a leaf
-node contains zero extents in it. Currently if that happens and we try
-to traverse the tree we can end up accessing wrong data, or possibly
-even uninitialized memory. Make sure we don't do that.
-
-Additionally make sure that we have a sane number of bytes passed to
-memmove() in ext2fs_extent_delete().
-
-Note that e2fsck is currently unable to spot and fix such corruption in
-pass1.
-
-Signed-off-by: Lukas Czerner <lczerner at redhat.com>
-Reported-by: Nils Bars <nils_bars at t-online.de>
-Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2068113
-Addresses: CVE-2022-1304
-Addresses-Debian-Bug: #1010263
-Signed-off-by: Theodore Ts'o <tytso at mit.edu>
----
- lib/ext2fs/extent.c | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
---- a/lib/ext2fs/extent.c
-+++ b/lib/ext2fs/extent.c
-@@ -495,6 +495,10 @@ retry:
- 			ext2fs_le16_to_cpu(eh->eh_entries);
- 		newpath->max_entries = ext2fs_le16_to_cpu(eh->eh_max);
- 
-+		/* Make sure there is at least one extent present */
-+		if (newpath->left <= 0)
-+			return EXT2_ET_EXTENT_NO_DOWN;
-+
- 		if (path->left > 0) {
- 			ix++;
- 			newpath->end_blk = ext2fs_le32_to_cpu(ix->ei_block);
-@@ -1630,6 +1634,10 @@ errcode_t ext2fs_extent_delete(ext2_exte
- 
- 	cp = path->curr;
- 
-+	/* Sanity check before memmove() */
-+	if (path->left < 0)
-+		return EXT2_ET_EXTENT_LEAF_BAD;
-+
- 	if (path->left) {
- 		memmove(cp, cp + sizeof(struct ext3_extent_idx),
- 			path->left * sizeof(struct ext3_extent_idx));



From lede-commits at lists.infradead.org  Tue Feb  7 15:15:20 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 07 Feb 2023 18:15:20 -0500
Subject: [openwrt/openwrt]  e2fsprogs: update to 1.46.6
In-Reply-To: <167581172033.2189782.16914973320982214069@git-01.infra.openwrt.org>
References: <167581172033.2189782.16914973320982214069@git-01.infra.openwrt.org>
Message-ID: <mailman.13341.1675811724.3064139.lede-commits@lists.infradead.org>

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

commit b6bc924b198a7a3b7f558430eec4f7f49bac4ea1
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Sun Feb 5 21:28:40 2023 +0100

    e2fsprogs: update to 1.46.6
    
    Release information:
    https://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.46.6
    
    Remove upstreamed patch:
    - 004-CVE-2022-1304-libext2fs-add-sanity-check-to-extent-manipulation.patch
    
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 package/utils/e2fsprogs/Makefile                   |  6 +--
 ...s-add-sanity-check-to-extent-manipulation.patch | 50 ----------------------
 2 files changed, 3 insertions(+), 53 deletions(-)

diff --git a/package/utils/e2fsprogs/Makefile b/package/utils/e2fsprogs/Makefile
index 94f22a53cc..82817d95ce 100644
--- a/package/utils/e2fsprogs/Makefile
+++ b/package/utils/e2fsprogs/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=e2fsprogs
-PKG_VERSION:=1.46.5
-PKG_RELEASE:=2
+PKG_VERSION:=1.46.6
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/
-PKG_HASH:=2f16c9176704cf645dc69d5b15ff704ae722d665df38b2ed3cfc249757d8d81e
+PKG_HASH:=a77517f19ff5e4e97ede63536566865dd5d48654e13fc145f5f2249ef7c4f4fc
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=NOTICE
diff --git a/package/utils/e2fsprogs/patches/004-CVE-2022-1304-libext2fs-add-sanity-check-to-extent-manipulation.patch b/package/utils/e2fsprogs/patches/004-CVE-2022-1304-libext2fs-add-sanity-check-to-extent-manipulation.patch
deleted file mode 100644
index e5a76161f2..0000000000
--- a/package/utils/e2fsprogs/patches/004-CVE-2022-1304-libext2fs-add-sanity-check-to-extent-manipulation.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From ab51d587bb9b229b1fade1afd02e1574c1ba5c76 Mon Sep 17 00:00:00 2001
-From: Lukas Czerner <lczerner at redhat.com>
-Date: Thu, 21 Apr 2022 19:31:48 +0200
-Subject: libext2fs: add sanity check to extent manipulation
-
-It is possible to have a corrupted extent tree in such a way that a leaf
-node contains zero extents in it. Currently if that happens and we try
-to traverse the tree we can end up accessing wrong data, or possibly
-even uninitialized memory. Make sure we don't do that.
-
-Additionally make sure that we have a sane number of bytes passed to
-memmove() in ext2fs_extent_delete().
-
-Note that e2fsck is currently unable to spot and fix such corruption in
-pass1.
-
-Signed-off-by: Lukas Czerner <lczerner at redhat.com>
-Reported-by: Nils Bars <nils_bars at t-online.de>
-Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2068113
-Addresses: CVE-2022-1304
-Addresses-Debian-Bug: #1010263
-Signed-off-by: Theodore Ts'o <tytso at mit.edu>
----
- lib/ext2fs/extent.c | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
---- a/lib/ext2fs/extent.c
-+++ b/lib/ext2fs/extent.c
-@@ -495,6 +495,10 @@ retry:
- 			ext2fs_le16_to_cpu(eh->eh_entries);
- 		newpath->max_entries = ext2fs_le16_to_cpu(eh->eh_max);
- 
-+		/* Make sure there is at least one extent present */
-+		if (newpath->left <= 0)
-+			return EXT2_ET_EXTENT_NO_DOWN;
-+
- 		if (path->left > 0) {
- 			ix++;
- 			newpath->end_blk = ext2fs_le32_to_cpu(ix->ei_block);
-@@ -1630,6 +1634,10 @@ errcode_t ext2fs_extent_delete(ext2_exte
- 
- 	cp = path->curr;
- 
-+	/* Sanity check before memmove() */
-+	if (path->left < 0)
-+		return EXT2_ET_EXTENT_LEAF_BAD;
-+
- 	if (path->left) {
- 		memmove(cp, cp + sizeof(struct ext3_extent_idx),
- 			path->left * sizeof(struct ext3_extent_idx));



From lede-commits at lists.infradead.org  Tue Feb  7 15:20:57 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 07 Feb 2023 18:20:57 -0500
Subject: [openwrt/openwrt]  lantiq: ar9/vr9: add fritz-tffs package
In-Reply-To: <167581205789.2192578.12520337165404772840@git-01.infra.openwrt.org>
References: <167581205789.2192578.12520337165404772840@git-01.infra.openwrt.org>
Message-ID: <mailman.13342.1675812064.3064139.lede-commits@lists.infradead.org>

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

commit d53ec2943a7a0615a0beb89d8392ffb30569538b
Author: Felix Baumann <felix.bau at gmx.de>
AuthorDate: Sun Jan 29 20:25:52 2023 +0100

    lantiq: ar9/vr9: add fritz-tffs package
    
    Add fritz-tffs package to AVM devices
    Reorder some devices packages for consistency
    
    Signed-off-by: Felix Baumann <felix.bau at gmx.de>
---
 target/linux/lantiq/image/ar9.mk |  4 ++--
 target/linux/lantiq/image/vr9.mk | 16 ++++++++++------
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/target/linux/lantiq/image/ar9.mk b/target/linux/lantiq/image/ar9.mk
index 25e4b1fe65..4d9a008f6f 100644
--- a/target/linux/lantiq/image/ar9.mk
+++ b/target/linux/lantiq/image/ar9.mk
@@ -8,7 +8,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
+	kmod-ltq-deu-ar9 fritz-tffs -swconfig
 endef
 TARGET_DEVICES += avm_fritz7312
 
@@ -24,7 +24,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-ltq-deu-ar9 kmod-usb-dwc2 fritz-tffs -swconfig
   SUPPORTED_DEVICES += FRITZ7320
 endef
 TARGET_DEVICES += avm_fritz7320
diff --git a/target/linux/lantiq/image/vr9.mk b/target/linux/lantiq/image/vr9.mk
index 804088032f..f3149bf2c0 100644
--- a/target/linux/lantiq/image/vr9.mk
+++ b/target/linux/lantiq/image/vr9.mk
@@ -152,7 +152,8 @@ define Device/avm_fritz7360sl
   $(Device/AVM)
   DEVICE_MODEL := FRITZ!Box 7360 SL
   IMAGE_SIZE := 15744k
-  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls kmod-usb-dwc2
+  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls \
+	kmod-usb-dwc2 fritz-tffs
   SUPPORTED_DEVICES += FRITZ7360SL
 endef
 TARGET_DEVICES += avm_fritz7360sl
@@ -163,7 +164,8 @@ define Device/avm_fritz7360-v2
   DEVICE_MODEL := FRITZ!Box 7360
   DEVICE_VARIANT := v2
   IMAGE_SIZE := 32128k
-  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls kmod-usb-dwc2
+  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls \
+	kmod-usb-dwc2 fritz-tffs
 endef
 TARGET_DEVICES += avm_fritz7360-v2
 
@@ -174,7 +176,8 @@ define Device/avm_fritz7362sl
   DEVICE_MODEL := FRITZ!Box 7362 SL
   KERNEL_SIZE := 4096k
   IMAGE_SIZE := 49152k
-  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls kmod-usb-dwc2 fritz-tffs
+  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls \
+	kmod-usb-dwc2 fritz-tffs
 endef
 TARGET_DEVICES += avm_fritz7362sl
 
@@ -186,7 +189,8 @@ define Device/avm_fritz7412
   BOARD_NAME := FRITZ7412
   KERNEL_SIZE := 4096k
   IMAGE_SIZE := 49152k
-  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls fritz-tffs-nand fritz-caldata
+  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls \
+	fritz-tffs-nand fritz-caldata
 endef
 TARGET_DEVICES += avm_fritz7412
 
@@ -197,8 +201,8 @@ define Device/avm_fritz7430
   DEVICE_MODEL := FRITZ!Box 7430
   KERNEL_SIZE := 4096k
   IMAGE_SIZE := 49152k
-  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader kmod-usb-dwc2 wpad-basic-mbedtls \
-	fritz-tffs-nand fritz-caldata
+  DEVICE_PACKAGES := kmod-ath9k kmod-owl-loader wpad-basic-mbedtls \
+	kmod-usb-dwc2 fritz-tffs-nand fritz-caldata
 endef
 TARGET_DEVICES += avm_fritz7430
 



From lede-commits at lists.infradead.org  Tue Feb  7 15:22:36 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 07 Feb 2023 18:22:36 -0500
Subject: [openwrt/openwrt]  kernel: bump 5.15 to 5.15.92
In-Reply-To: <167581215605.2193698.2923738276914050089@git-01.infra.openwrt.org>
References: <167581215605.2193698.2923738276914050089@git-01.infra.openwrt.org>
Message-ID: <mailman.13343.1675812159.3064139.lede-commits@lists.infradead.org>

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

commit 64cf31f6ff5b35bc1bc6e4c87779a3a6c60b7103
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Mon Feb 6 06:40:12 2023 -0500

    kernel: bump 5.15 to 5.15.92
    
    All other patches automatically rebased.
    
    Build system: x86_64
    Build-tested: bcm2711/RPi4B, filogic/xiaomi_redmi-router-ax6000-ubootmod
    Run-tested: bcm2711/RPi4B, filogic/xiaomi_redmi-router-ax6000-ubootmod
    
    Signed-off-by: John Audia <therealgraysky at proton.me>
---
 include/kernel-5.15                                                   | 4 ++--
 .../750-skb-Do-mix-page-pool-and-page-referenced-frags-in-GR.patch    | 2 +-
 .../patches-5.15/700-net-ethernet-mediatek-support-net-labels.patch   | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/kernel-5.15 b/include/kernel-5.15
index 1d1c654c2c..b691f102a4 100644
--- a/include/kernel-5.15
+++ b/include/kernel-5.15
@@ -1,2 +1,2 @@
-LINUX_VERSION-5.15 = .91
-LINUX_KERNEL_HASH-5.15.91 = a63c2bb1beb15f1aea9c63cf80559f5b7ab58afd2da2fa5e7670c515ebe1fe80
+LINUX_VERSION-5.15 = .92
+LINUX_KERNEL_HASH-5.15.92 = 9f420451db99a31a4aade9a46487b39318340d228f5c87c6dc56d83477e6ef91
diff --git a/target/linux/generic/pending-5.15/750-skb-Do-mix-page-pool-and-page-referenced-frags-in-GR.patch b/target/linux/generic/pending-5.15/750-skb-Do-mix-page-pool-and-page-referenced-frags-in-GR.patch
index 60c7721df0..6f28e19a48 100644
--- a/target/linux/generic/pending-5.15/750-skb-Do-mix-page-pool-and-page-referenced-frags-in-GR.patch
+++ b/target/linux/generic/pending-5.15/750-skb-Do-mix-page-pool-and-page-referenced-frags-in-GR.patch
@@ -17,7 +17,7 @@ Signed-off-by: Alexander Duyck <alexanderduyck at fb.com>
 
 --- a/net/core/skbuff.c
 +++ b/net/core/skbuff.c
-@@ -4348,6 +4348,15 @@ int skb_gro_receive(struct sk_buff *p, s
+@@ -4347,6 +4347,15 @@ int skb_gro_receive(struct sk_buff *p, s
  	if (unlikely(p->len + len >= 65536 || NAPI_GRO_CB(skb)->flush))
  		return -E2BIG;
  
diff --git a/target/linux/ramips/patches-5.15/700-net-ethernet-mediatek-support-net-labels.patch b/target/linux/ramips/patches-5.15/700-net-ethernet-mediatek-support-net-labels.patch
index e1335c8ebc..29aba20e97 100644
--- a/target/linux/ramips/patches-5.15/700-net-ethernet-mediatek-support-net-labels.patch
+++ b/target/linux/ramips/patches-5.15/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
-@@ -3998,6 +3998,7 @@ static const struct net_device_ops mtk_n
+@@ -4227,6 +4227,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;
-@@ -4126,6 +4127,9 @@ static int mtk_add_mac(struct mtk_eth *e
+@@ -4355,6 +4356,9 @@ static int mtk_add_mac(struct mtk_eth *e
  		register_netdevice_notifier(&mac->device_notifier);
  	}
  



From lede-commits at lists.infradead.org  Tue Feb  7 15:23:35 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 07 Feb 2023 18:23:35 -0500
Subject: [openwrt/openwrt]  kernel: bump 5.10 to 5.10.167
In-Reply-To: <167581221544.2194174.3295623072761757443@git-01.infra.openwrt.org>
References: <167581221544.2194174.3295623072761757443@git-01.infra.openwrt.org>
Message-ID: <mailman.13344.1675812219.3064139.lede-commits@lists.infradead.org>

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

commit 712681458a65736d3fc625bb9c481c31b23c1f97
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Mon Feb 6 06:28:36 2023 -0500

    kernel: bump 5.10 to 5.10.167
    
    All patches automatically rebased.
    
    Build system: x86_64
    Build-tested: ramips/tplink_archer-a6-v3
    Run-tested: ramips/tplink_archer-a6-v3
    
    Signed-off-by: John Audia <therealgraysky at proton.me>
---
 include/kernel-5.10                                                   | 4 ++--
 .../generic/backport-5.10/630-v5.15-page_pool_frag_support.patch      | 2 +-
 .../750-skb-Do-mix-page-pool-and-page-referenced-frags-in-GR.patch    | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/kernel-5.10 b/include/kernel-5.10
index 0c14e6b582..0198540361 100644
--- a/include/kernel-5.10
+++ b/include/kernel-5.10
@@ -1,2 +1,2 @@
-LINUX_VERSION-5.10 = .166
-LINUX_KERNEL_HASH-5.10.166 = 0051a1780e5bda0efc68dafab7c728b8283d2b028fedb439418f478be7d3e1af
+LINUX_VERSION-5.10 = .167
+LINUX_KERNEL_HASH-5.10.167 = d807f97812e566410cd13b3170009e0d7552748d4f22d608ffd4dbd7f85bf9c6
diff --git a/target/linux/generic/backport-5.10/630-v5.15-page_pool_frag_support.patch b/target/linux/generic/backport-5.10/630-v5.15-page_pool_frag_support.patch
index dbcdac8590..340a02afa7 100644
--- a/target/linux/generic/backport-5.10/630-v5.15-page_pool_frag_support.patch
+++ b/target/linux/generic/backport-5.10/630-v5.15-page_pool_frag_support.patch
@@ -646,7 +646,7 @@
  	}
  
  	/* Reposition in the original skb */
-@@ -5189,6 +5210,20 @@ bool skb_try_coalesce(struct sk_buff *to
+@@ -5188,6 +5209,20 @@ bool skb_try_coalesce(struct sk_buff *to
  	if (skb_cloned(to))
  		return false;
  
diff --git a/target/linux/generic/pending-5.10/750-skb-Do-mix-page-pool-and-page-referenced-frags-in-GR.patch b/target/linux/generic/pending-5.10/750-skb-Do-mix-page-pool-and-page-referenced-frags-in-GR.patch
index 5a145abed3..c464b8e7ff 100644
--- a/target/linux/generic/pending-5.10/750-skb-Do-mix-page-pool-and-page-referenced-frags-in-GR.patch
+++ b/target/linux/generic/pending-5.10/750-skb-Do-mix-page-pool-and-page-referenced-frags-in-GR.patch
@@ -17,7 +17,7 @@ Signed-off-by: Alexander Duyck <alexanderduyck at fb.com>
 
 --- a/net/core/skbuff.c
 +++ b/net/core/skbuff.c
-@@ -4166,6 +4166,15 @@ int skb_gro_receive(struct sk_buff *p, s
+@@ -4165,6 +4165,15 @@ int skb_gro_receive(struct sk_buff *p, s
  	if (unlikely(p->len + len >= 65536 || NAPI_GRO_CB(skb)->flush))
  		return -E2BIG;
  



From lede-commits at lists.infradead.org  Tue Feb  7 15:35:17 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 07 Feb 2023 18:35:17 -0500
Subject: [openwrt/openwrt]  mac80211: Update to version 5.15.92-1
In-Reply-To: <167581291748.2200077.1823921522520115422@git-01.infra.openwrt.org>
References: <167581291748.2200077.1823921522520115422@git-01.infra.openwrt.org>
Message-ID: <mailman.13345.1675812921.3064139.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/863288b49d3d1466f22bcf6098e4635a5be98626

commit 863288b49d3d1466f22bcf6098e4635a5be98626
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Jan 29 18:55:38 2023 +0100

    mac80211: Update to version 5.15.92-1
    
    This update mac80211 to version 5.15.92-1. This includes multiple
    bugfixes. Some of these bugfixes are fixing security relevant bugs.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/mac80211/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 830e5052b8..f7165fff2c 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.15.81-1
+PKG_VERSION:=5.15.92-1
 PKG_RELEASE:=1
-PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.15.81/
-PKG_HASH:=5227d3c35ccebacfaee6b8180b3a87b9910f3c94ee768ebc5c0fef3c86b6146d
+PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.15.92/
+PKG_HASH:=d518e3614a0a8b635e7b7febf2a3ee1645a95d953fd353920ceee22f159f26f1
 
 PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)



From lede-commits at lists.infradead.org  Tue Feb  7 17:49:44 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 07 Feb 2023 20:49:44 -0500
Subject: [openwrt/openwrt]  ipq4019: fix dts white-space
In-Reply-To: <167582098401.2267287.7482400906679731235@git-01.infra.openwrt.org>
References: <167582098401.2267287.7482400906679731235@git-01.infra.openwrt.org>
Message-ID: <mailman.13360.1675820991.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/1c31ca5da9aaa043069bcdb209248a8c26bf690a

commit 1c31ca5da9aaa043069bcdb209248a8c26bf690a
Author: Felix Baumann <felix.bau at gmx.de>
AuthorDate: Wed Feb 8 02:25:00 2023 +0100

    ipq4019: fix dts white-space
    
    Replace blanks with tabs
    Remove whitespace from otherwise empty lines
    
    Signed-off-by: Felix Baumann <felix.bau at gmx.de>
---
 .../arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts    |   8 +-
 .../arch/arm/boot/dts/qcom-ipq4018-gl-a1300.dts    |  12 +-
 .../arch/arm/boot/dts/qcom-ipq4018-sxtsq-5-ac.dts  |  12 +-
 .../arm/boot/dts/qcom-ipq4019-hap-ac3-lte6-kit.dts |  12 +-
 .../arch/arm/boot/dts/qcom-ipq4019-whw03v2.dts     | 808 ++++++++++-----------
 .../arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi     |  14 +-
 .../arch/arm/boot/dts/qcom-ipq4029-ap-303h.dts     |   2 +-
 .../arch/arm/boot/dts/qcom-ipq4029-ws-ap3915i.dts  |   8 +-
 8 files changed, 438 insertions(+), 438 deletions(-)

diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts
index 724047c469..493905d56d 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-dap-2610.dts
@@ -182,17 +182,17 @@
 };
 
 &gmac {
-       status = "okay";
+	status = "okay";
 };
 
 &switch {
-       status = "okay";
+	status = "okay";
 };
 
 &swport5 {
-       status = "okay";
+	status = "okay";
 
-       label = "lan";
+	label = "lan";
 };
 
 &tlmm {
diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-a1300.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-a1300.dts
index a742138cdf..ad3d1ac120 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-a1300.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-gl-a1300.dts
@@ -196,9 +196,9 @@
 			};
 
 			partition at 180000 {
-                                label = "log";
-                                reg = <0x00180000 0x00020000>;
-                        };
+				label = "log";
+				reg = <0x00180000 0x00020000>;
+			};
 		};
 	};
 
@@ -262,9 +262,9 @@
 };
 
 &blsp1_i2c3 {
-        status = "okay";
-        pinctrl-0 = <&i2c_0_pins>;
-        pinctrl-names = "default";
+	status = "okay";
+	pinctrl-0 = <&i2c_0_pins>;
+	pinctrl-names = "default";
 };
 
 &usb2 {
diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-sxtsq-5-ac.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-sxtsq-5-ac.dts
index 07fa80742e..de3fa96922 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-sxtsq-5-ac.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-sxtsq-5-ac.dts
@@ -222,18 +222,18 @@
 };
 
 &gmac {
-       status = "okay";
+	status = "okay";
 };
 
 &switch {
-       status = "okay";
+	status = "okay";
 
-       /delete-property/ psgmii-ethphy;
+	/delete-property/ psgmii-ethphy;
 };
 
 &swport5 {
-       status = "okay";
+	status = "okay";
 
-       label = "lan";
-       phy-mode = "rgmii";
+	label = "lan";
+	phy-mode = "rgmii";
 };
diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-hap-ac3-lte6-kit.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-hap-ac3-lte6-kit.dts
index f6a42cfedb..6459fc3b92 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-hap-ac3-lte6-kit.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-hap-ac3-lte6-kit.dts
@@ -158,12 +158,12 @@
 		line-name = "enable USB power";
 	};
 
-        enable-mpcie-power {
-                gpio-hog;
-                gpios = <51 GPIO_ACTIVE_HIGH>;
-                output-high;
-                line-name = "enable mPCI-E power";
-        };
+	enable-mpcie-power {
+		gpio-hog;
+		gpios = <51 GPIO_ACTIVE_HIGH>;
+		output-high;
+		line-name = "enable mPCI-E power";
+	};
 
 };
 
diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-whw03v2.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-whw03v2.dts
index e1e8cf2588..1f0572b879 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-whw03v2.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-whw03v2.dts
@@ -7,513 +7,513 @@
 #include <dt-bindings/leds/common.h>
 
 / {
-    model = "Linksys WHW03 V2 (Velop)";
-    compatible = "linksys,whw03v2", "qcom,ipq4019";
-
-    aliases {
-        led-boot = &led_blue;
-        led-failsafe = &led_red;
-        led-running = &led_green;
-        led-upgrade = &led_red;
-    };
-
-    // The arguments rootfstype and ro are needed
-    // to override the default bootargs
-    chosen {
-        bootargs-append = " root=/dev/ubiblock0_0 rootfstype=squashfs ro";
-        stdout-path = &blsp1_uart1;
-    };
-
-    soc {
-        ess-tcsr at 1953000 {
-            compatible = "qcom,tcsr";
-            reg = <0x1953000 0x1000>;
-            qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
-        };
-
-
-        tcsr at 1949000 {
-            compatible = "qcom,tcsr";
-            reg = <0x1949000 0x100>;
-            qcom,wifi_glb_cfg = <TCSR_WIFI_GLB_CFG>;
-        };
-
-        tcsr at 194b000 {
-            compatible = "qcom,tcsr";
-            reg = <0x194b000 0x100>;
-            qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>;
-        };
-
-        tcsr at 1957000 {
-            compatible = "qcom,tcsr";
-            reg = <0x1957000 0x100>;
-            qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>;
-        };
-    };
-
-
-    keys {
-        compatible = "gpio-keys";
-
-        reset {
-            label = "reset";
-            gpios = <&tlmm 18 GPIO_ACTIVE_LOW>;
-            linux,code = <KEY_RESTART>;
-        };
-    };
+	model = "Linksys WHW03 V2 (Velop)";
+	compatible = "linksys,whw03v2", "qcom,ipq4019";
+
+	aliases {
+		led-boot = &led_blue;
+		led-failsafe = &led_red;
+		led-running = &led_green;
+		led-upgrade = &led_red;
+	};
+
+	// The arguments rootfstype and ro are needed
+	// to override the default bootargs
+	chosen {
+		bootargs-append = " root=/dev/ubiblock0_0 rootfstype=squashfs ro";
+		stdout-path = &blsp1_uart1;
+	};
+
+	soc {
+		ess-tcsr at 1953000 {
+			compatible = "qcom,tcsr";
+			reg = <0x1953000 0x1000>;
+			qcom,ess-interface-select = <TCSR_ESS_PSGMII>;
+		};
+
+
+		tcsr at 1949000 {
+			compatible = "qcom,tcsr";
+			reg = <0x1949000 0x100>;
+			qcom,wifi_glb_cfg = <TCSR_WIFI_GLB_CFG>;
+		};
+
+		tcsr at 194b000 {
+			compatible = "qcom,tcsr";
+			reg = <0x194b000 0x100>;
+			qcom,usb-hsphy-mode-select = <TCSR_USB_HSPHY_HOST_MODE>;
+		};
+
+		tcsr at 1957000 {
+			compatible = "qcom,tcsr";
+			reg = <0x1957000 0x100>;
+			qcom,wifi_noc_memtype_m0_m2 = <TCSR_WIFI_NOC_MEMTYPE_M0_M2>;
+		};
+	};
+
+
+	keys {
+		compatible = "gpio-keys";
+
+		reset {
+			label = "reset";
+			gpios = <&tlmm 18 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+	};
 };
 
 
 &tlmm {
-    mdio_pins: mdio-pinmux {
-        mux-1 {
-            pins = "gpio6";
-            function = "mdio";  
-            bias-pull-up;
-        };
-
-        mux-2 {
-            pins = "gpio7";
-            function = "mdc";
-            bias-pull-up;
-        };
-    };
-
-    i2c_0_pins: i2c-0-pinmux {
-        mux {
-            function = "blsp_i2c0";
-            pins = "gpio20", "gpio21";
-            bias-disable;
-        };
-    };
-
-    serial_0_pins: serial0-pinmux {
-        mux {
-            pins = "gpio16", "gpio17";
-            function = "blsp_uart0";
-            bias-disable;
-        };
-    };
-
-    serial_1_pins: serial1-pinmux {
-        mux {
-            pins = "gpio8", "gpio9", "gpio10", "gpio11";
-            function = "blsp_uart1";
-            bias-disable;
-        };
-    };
-
-    spi_0_pins: spi-0-pinmux {
-        mux {
-            function = "blsp_spi0";
-            pins = "gpio13", "gpio14", "gpio15";
-            drive-strength = <12>;
-            bias-disable;
-        };
-
-        mux-cs {
-            pins = "gpio12";
-            drive-strength = <2>;
-            bias-disable;
-            output-high;
-        };
-    };
-    
-    spi_1_pins: spi-1-pinmux {
-        mux-1 {
-            function = "blsp_spi1";
-            pins = "gpio44", "gpio46","gpio47";
-            bias-disable;
-        };
-
-        mux-2 {
-            pins = "gpio31", "gpio45", "gpio49";
-            function = "gpio";
-            bias-pull-up;
-            output-high;
-        };
-
-        host-interrupt {
-            pins = "gpio42";
-            function = "gpio";
-            input;
-        };
-    };
-
-    wifi_0_pins: wifi0-pinmux {
-        btcoexist {
-            bias-pull-up;
-            drive-strength = <6>;
-            function = "gpio";
-            output-high;
-            pins = "gpio52";
-        };
-    };
-
-    zigbee-0 {
-        gpio-hog;
-        gpios = <29 GPIO_ACTIVE_HIGH>;
-        bias-disable;
-        output-low;
-    };
-
-    zigbee-1 {
-        gpio-hog;
-        gpios = <50 GPIO_ACTIVE_HIGH>;
-        bias-disable;
-        input;
-    };
-
-    bluetooth-enable {
-        gpio-hog;
-        gpios = <32 GPIO_ACTIVE_HIGH>;
-        output-high;
-    };
+	mdio_pins: mdio-pinmux {
+		mux-1 {
+			pins = "gpio6";
+			function = "mdio";
+			bias-pull-up;
+		};
+
+		mux-2 {
+			pins = "gpio7";
+			function = "mdc";
+			bias-pull-up;
+		};
+	};
+
+	i2c_0_pins: i2c-0-pinmux {
+		mux {
+			function = "blsp_i2c0";
+			pins = "gpio20", "gpio21";
+			bias-disable;
+		};
+	};
+
+	serial_0_pins: serial0-pinmux {
+		mux {
+			pins = "gpio16", "gpio17";
+			function = "blsp_uart0";
+			bias-disable;
+		};
+	};
+
+	serial_1_pins: serial1-pinmux {
+		mux {
+			pins = "gpio8", "gpio9", "gpio10", "gpio11";
+			function = "blsp_uart1";
+			bias-disable;
+		};
+	};
+
+	spi_0_pins: spi-0-pinmux {
+		mux {
+			function = "blsp_spi0";
+			pins = "gpio13", "gpio14", "gpio15";
+			drive-strength = <12>;
+			bias-disable;
+		};
+
+		mux-cs {
+			pins = "gpio12";
+			drive-strength = <2>;
+			bias-disable;
+			output-high;
+		};
+	};
+
+	spi_1_pins: spi-1-pinmux {
+		mux-1 {
+			function = "blsp_spi1";
+			pins = "gpio44", "gpio46","gpio47";
+			bias-disable;
+		};
+
+		mux-2 {
+			pins = "gpio31", "gpio45", "gpio49";
+			function = "gpio";
+			bias-pull-up;
+			output-high;
+		};
+
+		host-interrupt {
+			pins = "gpio42";
+			function = "gpio";
+			input;
+		};
+	};
+
+	wifi_0_pins: wifi0-pinmux {
+		btcoexist {
+			bias-pull-up;
+			drive-strength = <6>;
+			function = "gpio";
+			output-high;
+			pins = "gpio52";
+		};
+	};
+
+	zigbee-0 {
+		gpio-hog;
+		gpios = <29 GPIO_ACTIVE_HIGH>;
+		bias-disable;
+		output-low;
+	};
+
+	zigbee-1 {
+		gpio-hog;
+		gpios = <50 GPIO_ACTIVE_HIGH>;
+		bias-disable;
+		input;
+	};
+
+	bluetooth-enable {
+		gpio-hog;
+		gpios = <32 GPIO_ACTIVE_HIGH>;
+		output-high;
+	};
 };
 
 &mdio {
-    status = "okay";
-    pinctrl-0 = <&mdio_pins>;
-    pinctrl-names = "default";
-    phy-reset-gpios = <&tlmm 19 GPIO_ACTIVE_LOW>;
+	status = "okay";
+	pinctrl-0 = <&mdio_pins>;
+	pinctrl-names = "default";
+	phy-reset-gpios = <&tlmm 19 GPIO_ACTIVE_LOW>;
 };
 
 &ethphy0 {
-    status = "disabled";
+	status = "disabled";
 };
 
 &ethphy1 {
-    status = "disabled";
+	status = "disabled";
 };
 
 &ethphy2 {
-    status = "disabled";
+	status = "disabled";
 };
 
 &ethphy3 {
-    reg = <0x1b>;
+	reg = <0x1b>;
 };
 
 &ethphy4 {
-    reg = <0x1c>;
+	reg = <0x1c>;
 };
 
 &psgmiiphy {
-    reg = <0x1d>;
+	reg = <0x1d>;
 };
 
 &watchdog {
-    status = "okay";
+	status = "okay";
 };
 
 &prng {
-    status = "okay";
+	status = "okay";
 };
 
 &blsp_dma {
-    status = "okay";
+	status = "okay";
 };
 
 &cryptobam {
-    num-channels = <4>;
-    qcom,num-ees = <2>;
+	num-channels = <4>;
+	qcom,num-ees = <2>;
 
-    status = "okay";
+	status = "okay";
 };
 
 &crypto {
-    status = "okay";
+	status = "okay";
 };
 
 &blsp1_uart1 {
-    status = "okay";
-    pinctrl-0 = <&serial_0_pins>;
-    pinctrl-names = "default";
+	status = "okay";
+	pinctrl-0 = <&serial_0_pins>;
+	pinctrl-names = "default";
 };
 
 &blsp1_uart2 {
-    status = "okay";
-    pinctrl-0 = <&serial_1_pins>;
-    pinctrl-names = "default";
+	status = "okay";
+	pinctrl-0 = <&serial_1_pins>;
+	pinctrl-names = "default";
 
-    bluetooth {
-        compatible = "csr,8811";
+	bluetooth {
+		compatible = "csr,8811";
 
-        enable-gpios = <&tlmm 32 GPIO_ACTIVE_HIGH>;
-    };
+		enable-gpios = <&tlmm 32 GPIO_ACTIVE_HIGH>;
+	};
 };
 
 &blsp1_spi2 {
-    pinctrl-0 = <&spi_1_pins>;
-    pinctrl-names = "default";
-    status = "okay";
+	pinctrl-0 = <&spi_1_pins>;
+	pinctrl-names = "default";
+	status = "okay";
 
-    cs-gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>;
+	cs-gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>;
 
-    zigbee at 0 {
-        #address-cells = <1>;
-        #size-cells = <0>;
+	zigbee at 0 {
+		#address-cells = <1>;
+		#size-cells = <0>;
 
-        compatible = "silabs,em3581";
-        reg = <0>;
-        spi-max-frequency = <12000000>;
-    };
+		compatible = "silabs,em3581";
+		reg = <0>;
+		spi-max-frequency = <12000000>;
+	};
 };
 
 &blsp1_i2c3 {
-    pinctrl-0 = <&i2c_0_pins>;
-    pinctrl-names = "default";         
-    
-    status = "okay";
-
-    // RGB LEDs
-    pca9633: led-controller {
-        compatible = "nxp,pca9633";                
-        nxp,hw-blink;
-        reg = <0x62>;
-        #address-cells = <1>;
-        #size-cells = <0>;
-
-        led_red: red at 0 {
-            label = "red";
-            color = <LED_COLOR_ID_RED>;
-            function = LED_FUNCTION_INDICATOR;
-            linux,default-trigger = "none";
-            reg = <0>;
-        };
-
-        led_green: green at 1 {
-            label = "green";
-            color = <LED_COLOR_ID_GREEN>;
-            function = LED_FUNCTION_INDICATOR;
-            linux,default-trigger = "none";
-            reg = <1>;
-        };
-
-        led_blue: blue at 2 {
-            label = "blue";
-            color = <LED_COLOR_ID_BLUE>;
-            function = LED_FUNCTION_INDICATOR;
-            linux,default-trigger = "default-on";
-            reg = <2>;
-        };
-    };
+	pinctrl-0 = <&i2c_0_pins>;
+	pinctrl-names = "default";
+
+	status = "okay";
+
+	// RGB LEDs
+	pca9633: led-controller {
+		compatible = "nxp,pca9633";
+		nxp,hw-blink;
+		reg = <0x62>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		led_red: red at 0 {
+			label = "red";
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_INDICATOR;
+			linux,default-trigger = "none";
+			reg = <0>;
+		};
+
+		led_green: green at 1 {
+			label = "green";
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_INDICATOR;
+			linux,default-trigger = "none";
+			reg = <1>;
+		};
+
+		led_blue: blue at 2 {
+			label = "blue";
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_INDICATOR;
+			linux,default-trigger = "default-on";
+			reg = <2>;
+		};
+	};
 };
 
 &usb3_ss_phy {
-    status = "okay";
+	status = "okay";
 };
 
 &usb3_hs_phy {
-    status = "okay";
+	status = "okay";
 };
 
 &usb2_hs_phy {
-    status = "okay";
+	status = "okay";
 };
 
 &nand {
-    status = "okay";
-
-    nand at 0 {
-        partitions {
-            compatible = "fixed-partitions";
-            #address-cells = <1>;
-            #size-cells = <1>;
-
-            partition at 0 {
-                label = "SBL1";
-                reg = <0x0 0x100000>;
-                read-only;
-            };
-
-            partition at 100000 {
-                label = "MIBIB";
-                reg = <0x100000 0x100000>;
-                read-only;
-            };
-
-            partition at 200000 {
-                label = "QSEE";
-                reg = <0x200000 0x100000>;
-                read-only;
-            };
-
-            partition at 300000 {
-                label = "CDT";
-                reg = <0x300000 0x80000>;
-                read-only;
-            };
-
-            partition at 380000 {
-                label = "APPSBL";
-                reg = <0x380000 0x200000>;
-                read-only;
-            };
-
-            partition at 580000 {
-                label = "ART";
-                reg = <0x580000 0x80000>;
-                compatible = "nvmem-cells";
-                #address-cells = <1>;
-                #size-cells = <1>;
-                read-only;
-
-                precal_art_1000: precal at 1000 {
-                    reg = <0x1000 0x2f20>;
-                };
-
-                precal_art_5000: precal at 5000 {
-                    reg = <0x5000 0x2f20>;
-                };
-
-                precal_art_9000: precal at 9000 {
-                    reg = <0x9000 0x2f20>;
-                };
-
-                macaddr_gmac0: macaddr at 0 {
-                    reg = <0x0 0x6>;
-                };
-
-                macaddr_gmac1: macaddr at 6 {
-                    reg = <0x6 0x6>;
-                };
-            };
-
-            partition at 600000 {
-                label = "u_env";
-                reg = <0x600000 0x80000>;
-            };
-
-            partition at 680000 {
-                label = "s_env";
-                reg = <0x680000 0x40000>;
-            };
-
-            partition at 6c0000 {
-                label = "devinfo";
-                reg = <0x6c0000 0x40000>;
-                read-only;
-            };
-
-            partition at 700000 {
-                label = "kernel";
-                reg = <0x700000 0xa100000>;
-            };
-
-            partition at d00000 {
-                label = "rootfs";
-                reg = <0xd00000 0x9b00000>;
-            };
-
-            partition at a800000 {
-                label = "alt_kernel";
-                reg = <0xa800000 0xa100000>;
-            };
-
-            partition at ae00000 {
-                label = "alt_rootfs";
-                reg = <0xae00000 0x9b00000>;
-            };
-
-            partition at 14900000 {
-                label = "sysdiag";
-                reg = <0x14900000 0x200000>;
-                read-only;
-            };
-
-            partition at 14b00000 {
-                label = "syscfg";
-                reg = <0x14b00000 0xb500000>;
-                read-only;
-            };
-        };
-    };
+	status = "okay";
+
+	nand at 0 {
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "SBL1";
+				reg = <0x0 0x100000>;
+				read-only;
+			};
+
+			partition at 100000 {
+				label = "MIBIB";
+				reg = <0x100000 0x100000>;
+				read-only;
+			};
+
+			partition at 200000 {
+				label = "QSEE";
+				reg = <0x200000 0x100000>;
+				read-only;
+			};
+
+			partition at 300000 {
+				label = "CDT";
+				reg = <0x300000 0x80000>;
+				read-only;
+			};
+
+			partition at 380000 {
+				label = "APPSBL";
+				reg = <0x380000 0x200000>;
+				read-only;
+			};
+
+			partition at 580000 {
+				label = "ART";
+				reg = <0x580000 0x80000>;
+				compatible = "nvmem-cells";
+				#address-cells = <1>;
+				#size-cells = <1>;
+				read-only;
+
+				precal_art_1000: precal at 1000 {
+					reg = <0x1000 0x2f20>;
+				};
+
+				precal_art_5000: precal at 5000 {
+					reg = <0x5000 0x2f20>;
+				};
+
+				precal_art_9000: precal at 9000 {
+					reg = <0x9000 0x2f20>;
+				};
+
+				macaddr_gmac0: macaddr at 0 {
+					reg = <0x0 0x6>;
+				};
+
+				macaddr_gmac1: macaddr at 6 {
+					reg = <0x6 0x6>;
+				};
+			};
+
+			partition at 600000 {
+				label = "u_env";
+				reg = <0x600000 0x80000>;
+			};
+
+			partition at 680000 {
+				label = "s_env";
+				reg = <0x680000 0x40000>;
+			};
+
+			partition at 6c0000 {
+				label = "devinfo";
+				reg = <0x6c0000 0x40000>;
+				read-only;
+			};
+
+			partition at 700000 {
+				label = "kernel";
+				reg = <0x700000 0xa100000>;
+			};
+
+			partition at d00000 {
+				label = "rootfs";
+				reg = <0xd00000 0x9b00000>;
+			};
+
+			partition at a800000 {
+				label = "alt_kernel";
+				reg = <0xa800000 0xa100000>;
+			};
+
+			partition at ae00000 {
+				label = "alt_rootfs";
+				reg = <0xae00000 0x9b00000>;
+			};
+
+			partition at 14900000 {
+				label = "sysdiag";
+				reg = <0x14900000 0x200000>;
+				read-only;
+			};
+
+			partition at 14b00000 {
+				label = "syscfg";
+				reg = <0x14b00000 0xb500000>;
+				read-only;
+			};
+		};
+	};
 };
 
 &pcie0 {
-    status = "okay";
-
-    perst-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
-    wake-gpios = <&tlmm 40 GPIO_ACTIVE_LOW>;
-    clkreq-gpios = <&tlmm 39 GPIO_ACTIVE_LOW>;
-
-    bridge at 0,0 {
-        reg = <0x00000000 0 0 0 0>;
-        #address-cells = <3>;
-        #size-cells = <2>;
-        ranges;
-
-        wifi2: wifi at 1,0 {
-            compatible = "qcom,ath10k";
-            reg = <0x00010000 0 0 0 0>;
-        };
-    };
+	status = "okay";
+
+	perst-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
+	wake-gpios = <&tlmm 40 GPIO_ACTIVE_LOW>;
+	clkreq-gpios = <&tlmm 39 GPIO_ACTIVE_LOW>;
+
+	bridge at 0,0 {
+		reg = <0x00000000 0 0 0 0>;
+		#address-cells = <3>;
+		#size-cells = <2>;
+		ranges;
+
+		wifi2: wifi at 1,0 {
+			compatible = "qcom,ath10k";
+			reg = <0x00010000 0 0 0 0>;
+		};
+	};
 };
 
 &qpic_bam {
-    status = "okay";
+	status = "okay";
 };
 
 &gmac {
-    status = "okay";
+	status = "okay";
 };
 
 &switch {
-    status = "okay";
+	status = "okay";
 };
 
 &swport4 {
-    status = "okay";
-    label = "lan";
+	status = "okay";
+	label = "lan";
 
-    nvmem-cell-names = "mac-address";
-    nvmem-cells = <&macaddr_gmac1>;
+	nvmem-cell-names = "mac-address";
+	nvmem-cells = <&macaddr_gmac1>;
 };
 
 &swport5 {
-    status = "okay";
-    label = "wan";
+	status = "okay";
+	label = "wan";
 
-    nvmem-cell-names = "mac-address";
-    nvmem-cells = <&macaddr_gmac0>;
+	nvmem-cell-names = "mac-address";
+	nvmem-cells = <&macaddr_gmac0>;
 };
 
 &wifi0 {
-    pinctrl-0 = <&wifi_0_pins>;
-    pinctrl-names = "default";
+	pinctrl-0 = <&wifi_0_pins>;
+	pinctrl-names = "default";
 
-    status = "okay";
+	status = "okay";
 
-    qcom,coexist-support = <1>;
-    qcom,coexist-gpio-pin = <0x34>;
+	qcom,coexist-support = <1>;
+	qcom,coexist-gpio-pin = <0x34>;
 
-    ieee80211-freq-limit = <2401000 2473000>;
-    qcom,ath10k-calibration-variant = "linksys-whw03v2";
+	ieee80211-freq-limit = <2401000 2473000>;
+	qcom,ath10k-calibration-variant = "linksys-whw03v2";
 
-    nvmem-cell-names = "pre-calibration", "mac-address";
-    nvmem-cells = <&precal_art_1000>, <&macaddr_gmac0>;
-    mac-address-increment = <1>;
+	nvmem-cell-names = "pre-calibration", "mac-address";
+	nvmem-cells = <&precal_art_1000>, <&macaddr_gmac0>;
+	mac-address-increment = <1>;
 };
 
 &wifi1 {
-    status = "okay";
-    
-    ieee80211-freq-limit = <5170000 5250000>;
-    qcom,ath10k-calibration-variant = "linksys-whw03v2";
-    
-    nvmem-cell-names = "pre-calibration", "mac-address";
-    nvmem-cells = <&precal_art_5000>, <&macaddr_gmac0>;
-    mac-address-increment = <2>;
+	status = "okay";
+
+	ieee80211-freq-limit = <5170000 5250000>;
+	qcom,ath10k-calibration-variant = "linksys-whw03v2";
+
+	nvmem-cell-names = "pre-calibration", "mac-address";
+	nvmem-cells = <&precal_art_5000>, <&macaddr_gmac0>;
+	mac-address-increment = <2>;
 };
 
 &wifi2 {
-    status = "okay";
+	status = "okay";
 
-    ieee80211-freq-limit = <5735000 5835000>;
-    qcom,ath10k-calibration-variant = "linksys-whw03v2";
+	ieee80211-freq-limit = <5735000 5835000>;
+	qcom,ath10k-calibration-variant = "linksys-whw03v2";
 
-    nvmem-cell-names = "pre-calibration", "mac-address";
-    nvmem-cells = <&precal_art_9000>, <&macaddr_gmac0>;
-    mac-address-increment = <3>;
+	nvmem-cell-names = "pre-calibration", "mac-address";
+	nvmem-cells = <&precal_art_9000>, <&macaddr_gmac0>;
+	mac-address-increment = <3>;
 };
diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi
index 51a37290a0..db9ca1e725 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi
@@ -288,29 +288,29 @@
 };
 
 &gmac {
-      status = "okay";
+	status = "okay";
 };
 
 &switch {
-      status = "okay";
+	status = "okay";
 };
 
 &swport1 {
-      status = "okay";
+	status = "okay";
 };
 
 &swport2 {
-      status = "okay";
+	status = "okay";
 };
 
 &swport3 {
-      status = "okay";
+	status = "okay";
 };
 
 &swport4 {
-      status = "okay";
+	status = "okay";
 };
 
 &swport5 {
-      status = "okay";
+	status = "okay";
 };
diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303h.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303h.dts
index 86f4514317..23abb3537c 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303h.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ap-303h.dts
@@ -92,7 +92,7 @@
 				/* No driver */
 				compatible = "isl,isl28022";
 				reg = <0x40>;
-		    };
+			};
 		};
 	};
 
diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ws-ap3915i.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ws-ap3915i.dts
index 08874bcf4f..8794d839a8 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ws-ap3915i.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4029-ws-ap3915i.dts
@@ -125,17 +125,17 @@
 };
 
 &gmac {
-       status = "okay";
+	status = "okay";
 };
 
 &switch {
-       status = "okay";
+	status = "okay";
 };
 
 &swport5 {
-       status = "okay";
+	status = "okay";
 
-       label = "lan";
+	label = "lan";
 };
 
 &tlmm {



From lede-commits at lists.infradead.org  Wed Feb  8 00:17:29 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 08 Feb 2023 03:17:29 -0500
Subject: [openwrt/openwrt]  at91: sama7: fix racy SD card image generation
In-Reply-To: <167584424898.2504944.2573831283769783162@git-01.infra.openwrt.org>
References: <167584424898.2504944.2573831283769783162@git-01.infra.openwrt.org>
Message-ID: <mailman.13414.1675844264.3064139.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/52564e65d592cc691f7e93eeaa839785b5363e22

commit 52564e65d592cc691f7e93eeaa839785b5363e22
Author: Petr ?tetiar <ynezz at true.cz>
AuthorDate: Tue Jan 3 12:44:51 2023 +0100

    at91: sama7: fix racy SD card image generation
    
    We've few low spec (make -j3) build workers attached to the 22.03
    buildbot instance which from time to time exhibit following build
    failure during image generation:
    
     + dd bs=512 if=root.ext4 of=openwrt-22.03-snapshot-r20028-43d71ad93e-at91-sama7-microchip_sama7g5-ek-ext4-sdcard.img.gz.img seek=135168 conv=notrunc
     dd: failed to open 'root.ext4': No such file or directory
    
    Thats likely due to the fact, that on buildbots we've
    `TARGET_PER_DEVICE_ROOTFS=y` which produces differently named filesystem
    image in the SD card image target dependency chain:
    
     make_ext4fs -L rootfs ... root.ext4+pkg=68b329da
    
    and that hardcoded root.ext4 becomes available from other target in the
    later stages. So lets fix this issue by using IMAGE_ROOTFS Make variable
    which should contain proper path to the root filesystem image.
    
    Signed-off-by: Petr ?tetiar <ynezz at true.cz>
    (cherry picked from commit 5c3679e39b615ff29c9315f810e8e15775cc2d01)
---
 target/linux/at91/image/sama7.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/at91/image/sama7.mk b/target/linux/at91/image/sama7.mk
index bf1704dfb3..8d6f67d80e 100644
--- a/target/linux/at91/image/sama7.mk
+++ b/target/linux/at91/image/sama7.mk
@@ -35,7 +35,7 @@ define Build/at91-sdcard
   ./gen_at91_sdcard_img.sh \
 	$@.img \
 	$@.boot \
-	$(KDIR)/root.ext4 \
+	$(IMAGE_ROOTFS) \
 	$(AT91_SD_BOOT_PARTSIZE) \
 	$(CONFIG_TARGET_ROOTFS_PARTSIZE)
 



From lede-commits at lists.infradead.org  Wed Feb  8 00:17:30 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 08 Feb 2023 03:17:30 -0500
Subject: [openwrt/openwrt]  at91: sam9x,sama5: fix racy SD card image
 generation
In-Reply-To: <167584424898.2504944.2573831283769783162@git-01.infra.openwrt.org>
References: <167584424898.2504944.2573831283769783162@git-01.infra.openwrt.org>
Message-ID: <mailman.13417.1675844264.3064139.lede-commits@lists.infradead.org>

ynezz pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/7370479224dde700537a73a81706bde6db820d8a

commit 7370479224dde700537a73a81706bde6db820d8a
Author: Petr ?tetiar <ynezz at true.cz>
AuthorDate: Tue Jan 3 12:44:51 2023 +0100

    at91: sam9x,sama5: fix racy SD card image generation
    
    We've few low spec (make -j3) build workers attached to the 22.03
    buildbot instance which from time to time exhibit following build
    failure during image generation (shortened for brewity):
    
     + dd bs=512 if=root.ext4 of=openwrt-22.03...sdcard.img.gz.img
     dd: failed to open 'root.ext4': No such file or directory
    
    Thats happening likely due to the fact, that on buildbots we've
    `TARGET_PER_DEVICE_ROOTFS=y` which produces differently named filesystem
    image in the SD card image target dependency chain:
    
     make_ext4fs -L rootfs ... root.ext4+pkg=68b329da
    
    and that hardcoded `root.ext4` image filename becomes available from
    other Make targets in the later stages. So lets fix this issue by using
    IMAGE_ROOTFS Make variable which should contain proper path to the root
    filesystem image.
    
    Fixing remaining subtargets ommited in commit 5c3679e39b61 ("at91:
    sama7: fix racy SD card image generation").
    
    Fixes: 5c3679e39b61 ("at91: sama7: fix racy SD card image generation")
    Signed-off-by: Petr ?tetiar <ynezz at true.cz>
    (cherry picked from commit 3b669bc3f32f7594f38187a284a65ca2c35a0121)
---
 target/linux/at91/image/sam9x.mk | 2 +-
 target/linux/at91/image/sama5.mk | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/at91/image/sam9x.mk b/target/linux/at91/image/sam9x.mk
index b6c5e33ac4..3f57f4c8c8 100644
--- a/target/linux/at91/image/sam9x.mk
+++ b/target/linux/at91/image/sam9x.mk
@@ -35,7 +35,7 @@ define Build/at91-sdcard
   ./gen_at91_sdcard_img.sh \
 	$@.img \
 	$@.boot \
-	$(KDIR)/root.ext4 \
+	$(IMAGE_ROOTFS) \
 	$(AT91_SD_BOOT_PARTSIZE) \
 	$(CONFIG_TARGET_ROOTFS_PARTSIZE)
 
diff --git a/target/linux/at91/image/sama5.mk b/target/linux/at91/image/sama5.mk
index 39db3e1cd0..7f4dd3316a 100644
--- a/target/linux/at91/image/sama5.mk
+++ b/target/linux/at91/image/sama5.mk
@@ -39,7 +39,7 @@ define Build/at91-sdcard
   ./gen_at91_sdcard_img.sh \
 	$@.img \
 	$@.boot \
-	$(KDIR)/root.ext4 \
+	$(IMAGE_ROOTFS) \
 	$(AT91_SD_BOOT_PARTSIZE) \
 	$(CONFIG_TARGET_ROOTFS_PARTSIZE)
 



From lede-commits at lists.infradead.org  Wed Feb  8 07:29:16 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 08 Feb 2023 10:29:16 -0500
Subject: [openwrt/openwrt]  kernel: set default values for ARM low level
 debugging symbols
In-Reply-To: <167587015615.2885301.2496465578829964847@git-01.infra.openwrt.org>
References: <167587015615.2885301.2496465578829964847@git-01.infra.openwrt.org>
Message-ID: <mailman.13601.1675870164.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/721206a1b14fc5eba7ba8e20d979b26baf934e0d

commit 721206a1b14fc5eba7ba8e20d979b26baf934e0d
Author: Robert Marko <robimarko at gmail.com>
AuthorDate: Wed Feb 8 12:30:42 2023 +0100

    kernel: set default values for ARM low level debugging symbols
    
    Set default values for KERNEL_DEBUG_LL and KERNEL_DEBUG_LL_UART_NONE again
    as both of these symbols are non visible if KERNEL_EARLY_PRINTK is not
    selected and KConfig wont write their value to .config.
    
    This usually is the intended behaviour, but in OpenWrt we are relying on
    the KConfig to set these and disable the debug console settings that
    multiple targets like mvebu have set in their kernel config.
    This was the behaviour before removing all of the "default n" settings
    as KConfig by default considers symbols disabled but they are not visible
    anymore and thus their value is not set in .config and build system then
    later does not override the values from target kernel config.
    
    So, to restore the behaviour to the previous one lets a default value for
    KERNEL_DEBUG_LL and KERNEL_DEBUG_LL_UART_NONE.
    
    Fixes: 8bc72ea7be39 ("treewide: strip useless default n Kconfig lines")
    Tested-by: Georgi Valkov <gvalkov at gmail.com>
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 config/Config-kernel.in | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/config/Config-kernel.in b/config/Config-kernel.in
index 500f72672d..258163984e 100644
--- a/config/Config-kernel.in
+++ b/config/Config-kernel.in
@@ -387,12 +387,18 @@ config KERNEL_DEBUG_INFO_REDUCED
 	  DEBUG_INFO build and compile times are reduced too.
 	  Only works with newer gcc versions.
 
+# KERNEL_DEBUG_LL symbols must have the default value set as otherwise
+# KConfig wont evaluate them unless KERNEL_EARLY_PRINTK is selected
+# which means that buildroot wont override the DEBUG_LL symbols in target
+# kernel configurations and lead to devices that dont have working console
 config KERNEL_DEBUG_LL_UART_NONE
 	bool
+	default n
 	depends on arm
 
 config KERNEL_DEBUG_LL
 	bool
+	default n
 	depends on arm
 	select KERNEL_DEBUG_LL_UART_NONE
 	help



From lede-commits at lists.infradead.org  Wed Feb  8 07:45:08 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 08 Feb 2023 10:45:08 -0500
Subject: [openwrt/openwrt]  mpc85xx: Drop pci aliases to avoid domain changes
In-Reply-To: <167587110848.2896531.81574198997393458@git-01.infra.openwrt.org>
References: <167587110848.2896531.81574198997393458@git-01.infra.openwrt.org>
Message-ID: <mailman.13604.1675871114.3064139.lede-commits@lists.infradead.org>

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

commit 0d4a0250df17a9f7b0fff720fa3224b45d5b0841
Author: Martin Kennedy <hurricos at gmail.com>
AuthorDate: Mon Aug 29 20:47:24 2022 -0400

    mpc85xx: Drop pci aliases to avoid domain changes
    
    As of upstream Linux commit 0fe1e96fef0a ("powerpc/pci: Prefer PCI
    domain assignment via DT 'linux,pci-domain' and alias"), the PCIe
    domain address is no longer numbered by the lowest 16 bits of the PCI
    register address after a fallthrough. Instead of the fallthrough, the
    enumeration process accepts the alias ID (as determined by
    `of_alias_scan()`). This causes e.g.:
    
    9000:00:00.0 PCI bridge: Freescale Semiconductor Inc P1020E (rev 11)
    9000:01:00.0 Network controller: Qualcomm Atheros AR958x 802.11abgn ...
    
    to become
    
    0000:00:00.0 PCI bridge: Freescale Semiconductor Inc P1020E (rev 11)
    0000:01:00.0 Network controller: Qualcomm Atheros AR958x 802.11abgn ...
    
    ... which then causes the sysfs path of the netdev to change,
    invalidating the `wifi_device.path`s enumerated in
    `/etc/config/wireless`.
    
    One other solution might be to migrate the uci configuration, as was
    done for mvebu in commit 0bd5aa89fcf2 ("mvebu: Migrate uci config to
    new PCIe path"). However, there are concerns that the sysfs path will
    change once again once some upstream patches[^2][^3] are merged and
    backported (and `CONFIG_PPC_PCI_BUS_NUM_DOMAIN_DEPENDENT` is enabled).
    
    Instead, remove the aliases and allow the fallthrough to continue for
    now. We will provide a migration in a later release.
    
    This was first reported as a Github issue[^1].
    
    [^1]: https://github.com/openwrt/openwrt/issues/10530
    [^2]: https://lore.kernel.org/linuxppc-dev/20220706104308.5390-1-pali at kernel.org/t/#u
    [^3]: https://lore.kernel.org/linuxppc-dev/20220706101043.4867-1-pali at kernel.org/
    
    Fixes: #10530
    Tested-by: Martin Kennedy <hurricos at gmail.com>
    [Tested on the Aerohive HiveAP 330 and Extreme Networks WS-AP3825i]
    Signed-off-by: Martin Kennedy <hurricos at gmail.com>
    (cherry picked from commit 7f4b4c29f3489697dca7495216460d0ed5023e02)
    Signed-off-by: Fabian Bl?se <fabian at blaese.de>
---
 .../mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts     | 13 +++++++++++++
 target/linux/mpc85xx/files/arch/powerpc/boot/dts/panda.dts | 14 ++++++++++++++
 .../mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts   | 14 ++++++++++++++
 .../mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts  | 13 +++++++++++++
 .../mpc85xx/files/arch/powerpc/boot/dts/ws-ap3710i.dts     | 13 +++++++++++++
 5 files changed, 67 insertions(+)

diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts
index 3ca132d0c0..5d08cc7e8d 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/hiveap-330.dts
@@ -234,3 +234,16 @@
 	};
 };
 /include/ "fsl/p1020si-post.dtsi"
+
+/*
+ * For the OpenWrt 22.03 release, since Linux 5.10.138 now uses
+ * aliases to determine PCI domain numbers, drop aliases so as not to
+ * change the sysfs path of our wireless netdevs.
+ */
+
+/ {
+	aliases {
+		/delete-property/ pci0;
+		/delete-property/ pci1;
+	};
+};
diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/panda.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/panda.dts
index f0fafa1b57..7e988f128c 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/panda.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/panda.dts
@@ -262,3 +262,17 @@
 	};
 };
 /include/ "fsl/p1020si-post.dtsi"
+
+/*
+ * For the OpenWrt 22.03 release, since Linux 5.10.138 now uses
+ * aliases to determine PCI domain numbers, drop aliases so as not to
+ * change the sysfs path of our wireless netdevs.
+ */
+
+/ {
+	aliases {
+		/delete-property/ pci0;
+		/delete-property/ pci1;
+	};
+};
+
diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts
index 40b8014a53..3b78a21920 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/red-15w-rev1.dts
@@ -212,3 +212,17 @@
 };
 
 /include/ "fsl/p1010si-post.dtsi"
+
+/*
+ * For the OpenWrt 22.03 release, since Linux 5.10.138 now uses
+ * aliases to determine PCI domain numbers, drop aliases so as not to
+ * change the sysfs path of our wireless netdevs.
+ */
+
+/ {
+	aliases {
+		/delete-property/ pci0;
+		/delete-property/ pci1;
+	};
+};
+
diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
index 29b49a9357..d79a034e9d 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
@@ -290,3 +290,16 @@
 		/delete-node/ crypto at 30000; /* Pulled in by p1010si-post */
 	};
 };
+
+/*
+ * For the OpenWrt 22.03 release, since Linux 5.10.138 now uses
+ * aliases to determine PCI domain numbers, drop aliases so as not to
+ * change the sysfs path of our wireless netdevs.
+ */
+
+/ {
+	aliases {
+		/delete-property/ pci0;
+		/delete-property/ pci1;
+	};
+};
diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3710i.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3710i.dts
index ebaac417eb..5b464869c4 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3710i.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/ws-ap3710i.dts
@@ -170,3 +170,16 @@
 
 };
 /include/ "fsl/p1020si-post.dtsi"
+
+/*
+ * For the OpenWrt 22.03 release, since Linux 5.10.138 now uses
+ * aliases to determine PCI domain numbers, drop aliases so as not to
+ * change the sysfs path of our wireless netdevs.
+ */
+
+/ {
+	aliases {
+		/delete-property/ pci0;
+		/delete-property/ pci1;
+	};
+};



From lede-commits at lists.infradead.org  Wed Feb  8 17:56:01 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 08 Feb 2023 20:56:01 -0500
Subject: [openwrt/openwrt]  toolchain/gcc: use explicit configure args
In-Reply-To: <167590776089.3285795.4066818851179472238@git-01.infra.openwrt.org>
References: <167590776089.3285795.4066818851179472238@git-01.infra.openwrt.org>
Message-ID: <mailman.13749.1675907770.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/4b8b89da506d1272ccbf944b1ece6c8ddaeff2ed

commit 4b8b89da506d1272ccbf944b1ece6c8ddaeff2ed
Author: Andre Heider <a.heider at gmail.com>
AuthorDate: Tue Jan 31 12:04:00 2023 +0100

    toolchain/gcc: use explicit configure args
    
    Spell out what we want to enable or disable. This prevents host libs to leak in,
    so everyone get the same feature set.
    
    Signed-off-by: Andre Heider <a.heider at gmail.com>
---
 toolchain/gcc/common.mk      | 2 ++
 toolchain/gcc/final/Makefile | 1 +
 2 files changed, 3 insertions(+)

diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk
index 7eae855eea..5f314c7fc0 100644
--- a/toolchain/gcc/common.mk
+++ b/toolchain/gcc/common.mk
@@ -106,6 +106,8 @@ GCC_CONFIGURE:= \
 			--with-abi=$(call qstrip,$(CONFIG_MIPS64_ABI))) \
 		$(if $(CONFIG_arc),--with-cpu=$(CONFIG_CPU_TYPE)) \
 		$(if $(CONFIG_powerpc64), $(if $(CONFIG_USE_MUSL),--with-abi=elfv2)) \
+		--with-system-zlib=$(STAGING_DIR_HOST) \
+		--without-zstd \
 		--with-gmp=$(STAGING_DIR_HOST) \
 		--with-mpfr=$(STAGING_DIR_HOST) \
 		--with-mpc=$(STAGING_DIR_HOST) \
diff --git a/toolchain/gcc/final/Makefile b/toolchain/gcc/final/Makefile
index 049ddf61f0..78a5576bff 100644
--- a/toolchain/gcc/final/Makefile
+++ b/toolchain/gcc/final/Makefile
@@ -8,6 +8,7 @@ GCC_CONFIGURE += \
 	--enable-shared \
 	--enable-threads \
 	--with-slibdir=$(TOOLCHAIN_DIR)/lib \
+	--enable-plugins \
 	--enable-lto \
 	--with-libelf=$(STAGING_DIR_HOST)
 



From lede-commits at lists.infradead.org  Wed Feb  8 17:56:03 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 08 Feb 2023 20:56:03 -0500
Subject: [openwrt/openwrt]  tools/zstd: build libraries as static
In-Reply-To: <167590776089.3285795.4066818851179472238@git-01.infra.openwrt.org>
References: <167590776089.3285795.4066818851179472238@git-01.infra.openwrt.org>
Message-ID: <mailman.13750.1675907770.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/e704a2b57bd9f593e0133a44bd7b35986152d864

commit e704a2b57bd9f593e0133a44bd7b35986152d864
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Sat Sep 24 18:42:59 2022 -0700

    tools/zstd: build libraries as static
    
    Enables to get rid of rpath hack for all users.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 tools/zstd/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/zstd/Makefile b/tools/zstd/Makefile
index 93f6745976..65381e7cb4 100644
--- a/tools/zstd/Makefile
+++ b/tools/zstd/Makefile
@@ -17,9 +17,9 @@ include $(INCLUDE_DIR)/meson.mk
 MESON_HOST_BUILD_DIR:=$(HOST_BUILD_DIR)/build/meson/openwrt-build
 
 HOSTCC:= $(HOSTCC_NOCACHE)
-HOST_LDFLAGS += -Wl,-rpath,$(STAGING_DIR_HOST)/lib
 
 MESON_HOST_ARGS += \
+	-Ddefault_library=static \
 	-Dlegacy_level=7 \
 	-Ddebug_level=0 \
 	-Dbacktrace=false \



From lede-commits at lists.infradead.org  Wed Feb  8 17:56:00 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 08 Feb 2023 20:56:00 -0500
Subject: [openwrt/openwrt]  toolchain/binutils: use explicit configure args
In-Reply-To: <167590776089.3285795.4066818851179472238@git-01.infra.openwrt.org>
References: <167590776089.3285795.4066818851179472238@git-01.infra.openwrt.org>
Message-ID: <mailman.13751.1675907772.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/dd39f760b75070dfc6589fa9e63e3a1525bd7e2c

commit dd39f760b75070dfc6589fa9e63e3a1525bd7e2c
Author: Andre Heider <a.heider at gmail.com>
AuthorDate: Tue Jan 31 11:27:00 2023 +0100

    toolchain/binutils: use explicit configure args
    
    Spell out what we want to enable or disable. This prevents host libs to leak in,
    so everyone get the same feature set.
    
    Signed-off-by: Andre Heider <a.heider at gmail.com>
---
 toolchain/binutils/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile
index cf65e83e6f..a0e112f8f6 100644
--- a/toolchain/binutils/Makefile
+++ b/toolchain/binutils/Makefile
@@ -43,8 +43,12 @@ HOST_CONFIGURE_ARGS = \
 	--host=$(GNU_HOST_NAME) \
 	--target=$(REAL_GNU_TARGET_NAME) \
 	--with-sysroot=$(TOOLCHAIN_DIR) \
+	--with-system-zlib \
+	--without-zstd \
 	--enable-deterministic-archives \
 	--enable-plugins \
+	--enable-lto \
+	--disable-gprofng \
 	--disable-multilib \
 	--disable-werror \
 	--disable-nls \



From lede-commits at lists.infradead.org  Wed Feb  8 17:56:04 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 08 Feb 2023 20:56:04 -0500
Subject: [openwrt/openwrt]  tools/cmake: remove rpath ldflag
In-Reply-To: <167590776089.3285795.4066818851179472238@git-01.infra.openwrt.org>
References: <167590776089.3285795.4066818851179472238@git-01.infra.openwrt.org>
Message-ID: <mailman.13752.1675907772.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/786c4099b4f65f6f323096db6480c28a79676a16

commit 786c4099b4f65f6f323096db6480c28a79676a16
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Fri Sep 30 13:18:00 2022 -0700

    tools/cmake: remove rpath ldflag
    
    no longer needed because of tools/zstd
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 tools/cmake/Makefile | 2 --
 1 file changed, 2 deletions(-)

diff --git a/tools/cmake/Makefile b/tools/cmake/Makefile
index ed2580fe4c..3a81b9a29f 100644
--- a/tools/cmake/Makefile
+++ b/tools/cmake/Makefile
@@ -38,8 +38,6 @@ HOST_CONFIGURE_ARGS := \
 	--system-zstd \
 	--generator=Ninja
 
-HOST_LDFLAGS += -Wl,-rpath,$(STAGING_DIR_HOST)/lib
-
 define Host/Compile/Default
 	+$(NINJA) -C $(HOST_BUILD_DIR) $(1)
 endef



From lede-commits at lists.infradead.org  Wed Feb  8 17:56:02 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 08 Feb 2023 20:56:02 -0500
Subject: [openwrt/openwrt]  toolchain/gcc: clean up CFLAGS
In-Reply-To: <167590776089.3285795.4066818851179472238@git-01.infra.openwrt.org>
References: <167590776089.3285795.4066818851179472238@git-01.infra.openwrt.org>
Message-ID: <mailman.13753.1675907772.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/ad564cb0197865bb6caecd6a0ea628249c08afb2

commit ad564cb0197865bb6caecd6a0ea628249c08afb2
Author: Andre Heider <a.heider at gmail.com>
AuthorDate: Tue Jan 31 09:30:18 2023 +0100

    toolchain/gcc: clean up CFLAGS
    
    Instead of having two different ways to pass flags to the gcc build
    process, add them as configure args, which is a reliable way to let
    gcc pass them around to its various pieces.
    
    Also add CXXFLAGS, since gcc started to use c++ for itself recently
    (~10 years ago now).
    
    Signed-off-by: Andre Heider <a.heider at gmail.com>
---
 toolchain/gcc/common.mk | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk
index 5f314c7fc0..e885141538 100644
--- a/toolchain/gcc/common.mk
+++ b/toolchain/gcc/common.mk
@@ -79,10 +79,6 @@ endif
 
 GCC_CONFIGURE:= \
 	SHELL="$(BASH)" \
-	$(if $(shell gcc --version 2>&1 | grep -E "Apple.(LLVM|clang)"), \
-		CFLAGS="-O2 -fbracket-depth=512 -pipe" \
-		CXXFLAGS="-O2 -fbracket-depth=512 -pipe" \
-	) \
 	$(HOST_SOURCE_DIR)/configure \
 		--with-bugurl=$(BUGURL) \
 		--with-pkgversion="$(PKGVERSION)" \
@@ -166,13 +162,21 @@ ifeq ($(CONFIG_TARGET_x86)$(CONFIG_USE_GLIBC)$(CONFIG_INSTALL_GCCGO),yyy)
   TARGET_CFLAGS+=-fno-split-stack
 endif
 
+CFLAGS:=$(HOST_CFLAGS) -pipe
+ifneq ($(shell gcc --version 2>&1 | grep -E "Apple.(LLVM|clang)"),)
+  CFLAGS+= -fbracket-depth=512
+endif
+
+GCC_CONFIGURE+= \
+	CFLAGS="$(CFLAGS)" \
+	CXXFLAGS="$(CFLAGS)" \
+	CFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \
+	CXXFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \
+	GOCFLAGS_FOR_TARGET="$(TARGET_CFLAGS)"
+
 GCC_MAKE:= \
 	export SHELL="$(BASH)"; \
-	$(MAKE) \
-		CFLAGS="$(HOST_CFLAGS)" \
-		CFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \
-		CXXFLAGS_FOR_TARGET="$(TARGET_CFLAGS)" \
-		GOCFLAGS_FOR_TARGET="$(TARGET_CFLAGS)"
+	$(MAKE)
 
 define Host/SetToolchainInfo
 	$(SED) 's,TARGET_CROSS=.*,TARGET_CROSS=$(REAL_GNU_TARGET_NAME)-,' $(TOOLCHAIN_DIR)/info.mk



From lede-commits at lists.infradead.org  Wed Feb  8 18:04:20 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 08 Feb 2023 21:04:20 -0500
Subject: [openwrt/openwrt]  ipq806x: fix dts whitespace
In-Reply-To: <167590825745.3295702.17175919165330945797@git-01.infra.openwrt.org>
References: <167590825745.3295702.17175919165330945797@git-01.infra.openwrt.org>
Message-ID: <mailman.13754.1675908262.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/505cf10e8392cc58056014e983bc2fd91ed236c1

commit 505cf10e8392cc58056014e983bc2fd91ed236c1
Author: Felix Baumann <felix.bau at gmx.de>
AuthorDate: Wed Feb 8 03:21:47 2023 +0100

    ipq806x: fix dts whitespace
    
    Replace blanks with tabs
    
    Signed-off-by: Felix Baumann <felix.bau at gmx.de>
---
 .../arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi   | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi b/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi
index 7b352edb9b..3494b2bde2 100644
--- a/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi
+++ b/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-ad7200-c2600.dtsi
@@ -11,15 +11,15 @@
 	};
 
 	reserved-memory {
-                ramoops at 42100000 {
-                        compatible = "ramoops";
-                        reg = <0x42100000 0x40000>;
-                        record-size = <0x4000>;
-                        console-size = <0x4000>;
-                        ftrace-size = <0x4000>;
-                        pmsg-size = <0x4000>;
-                };
-        };
+		ramoops at 42100000 {
+			compatible = "ramoops";
+			reg = <0x42100000 0x40000>;
+			record-size = <0x4000>;
+			console-size = <0x4000>;
+			ftrace-size = <0x4000>;
+			pmsg-size = <0x4000>;
+		};
+	};
 
 	aliases {
 		mdio-gpio0 = &mdio0;



From lede-commits at lists.infradead.org  Wed Feb  8 18:04:17 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 08 Feb 2023 21:04:17 -0500
Subject: [openwrt/openwrt]  ipq40xx: fix dts whitespace
In-Reply-To: <167590825745.3295702.17175919165330945797@git-01.infra.openwrt.org>
References: <167590825745.3295702.17175919165330945797@git-01.infra.openwrt.org>
Message-ID: <mailman.13755.1675908262.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/7fd28f2e3a640b88439af1a555c0fd24674ae7cb

commit 7fd28f2e3a640b88439af1a555c0fd24674ae7cb
Author: Felix Baumann <felix.bau at gmx.de>
AuthorDate: Wed Feb 8 03:45:59 2023 +0100

    ipq40xx: fix dts whitespace
    
    Remove whitespace from otherwise empty lines
    
    Signed-off-by: Felix Baumann <felix.bau at gmx.de>
---
 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts  | 2 +-
 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dtsi | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts
index c1832ee49f..75b5fd39a9 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-mf18a.dts
@@ -54,7 +54,7 @@
 			gpios = <&tlmm 23 GPIO_ACTIVE_HIGH>;
 			linux,default-trigger = "phy0tpt";
 		};
-		
+
 		led-3 {
 			label = "red:wlan";
 			gpios = <&tlmm 26 GPIO_ACTIVE_HIGH>;
diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dtsi
index 742bd5b570..3de6a10433 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dtsi
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-x1pro.dtsi
@@ -15,7 +15,7 @@
 		serial0 = &blsp1_uart1;
 		serial1 = &blsp1_uart2;
 	};
-	
+
 	soc {
 
 		rng at 22000 {



From lede-commits at lists.infradead.org  Wed Feb  8 18:04:22 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 08 Feb 2023 21:04:22 -0500
Subject: [openwrt/openwrt]  kirkwood: fix dts whitespace
In-Reply-To: <167590825745.3295702.17175919165330945797@git-01.infra.openwrt.org>
References: <167590825745.3295702.17175919165330945797@git-01.infra.openwrt.org>
Message-ID: <mailman.13756.1675908265.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/fc4bf73d391880adeb47ab5b2f1d8b812c0cbabf

commit fc4bf73d391880adeb47ab5b2f1d8b812c0cbabf
Author: Felix Baumann <felix.bau at gmx.de>
AuthorDate: Wed Feb 8 03:23:18 2023 +0100

    kirkwood: fix dts whitespace
    
    Replace blanks with tabs
    
    Signed-off-by: Felix Baumann <felix.bau at gmx.de>
---
 target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-nsa310s.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-nsa310s.dts b/target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-nsa310s.dts
index a2a718077e..a72276ed72 100644
--- a/target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-nsa310s.dts
+++ b/target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-nsa310s.dts
@@ -258,7 +258,7 @@
 };
 
 &pciec {
-        status = "okay";
+	status = "okay";
 };
 
 &pcie0 {



From lede-commits at lists.infradead.org  Wed Feb  8 18:04:21 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 08 Feb 2023 21:04:21 -0500
Subject: [openwrt/openwrt]  ipq807x: fix dts whitespace
In-Reply-To: <167590825745.3295702.17175919165330945797@git-01.infra.openwrt.org>
References: <167590825745.3295702.17175919165330945797@git-01.infra.openwrt.org>
Message-ID: <mailman.13757.1675908265.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/abdb9f327ed802d946bfd96c5e9da6739765698e

commit abdb9f327ed802d946bfd96c5e9da6739765698e
Author: Felix Baumann <felix.bau at gmx.de>
AuthorDate: Wed Feb 8 03:22:50 2023 +0100

    ipq807x: fix dts whitespace
    
    Replace blanks with tabs
    
    Signed-off-by: Felix Baumann <felix.bau at gmx.de>
---
 target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8072-301w.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8072-301w.dts b/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8072-301w.dts
index d3e788a36c..5521a480b8 100644
--- a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8072-301w.dts
+++ b/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8072-301w.dts
@@ -199,7 +199,7 @@
 		function = "gpio";
 		drive-strength = <8>;
 		bias-pull-down;
-    };
+	};
 };
 
 &blsp1_uart5 {



From lede-commits at lists.infradead.org  Wed Feb  8 18:04:19 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 08 Feb 2023 21:04:19 -0500
Subject: [openwrt/openwrt]  bcm63xx: fix dts whitespace
In-Reply-To: <167590825745.3295702.17175919165330945797@git-01.infra.openwrt.org>
References: <167590825745.3295702.17175919165330945797@git-01.infra.openwrt.org>
Message-ID: <mailman.13760.1675908265.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/836b994132eeb11e09b70515ca8da562b25fad2b

commit 836b994132eeb11e09b70515ca8da562b25fad2b
Author: Felix Baumann <felix.bau at gmx.de>
AuthorDate: Wed Feb 8 03:47:53 2023 +0100

    bcm63xx: fix dts whitespace
    
    Remove whitespace from otherwise empty lines
    
    Signed-off-by: Felix Baumann <felix.bau at gmx.de>
---
 target/linux/bcm63xx/dts/bcm63167-sercomm-h500-s-vfes.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/bcm63xx/dts/bcm63167-sercomm-h500-s-vfes.dts b/target/linux/bcm63xx/dts/bcm63167-sercomm-h500-s-vfes.dts
index bd69ccd316..5349a54356 100644
--- a/target/linux/bcm63xx/dts/bcm63167-sercomm-h500-s-vfes.dts
+++ b/target/linux/bcm63xx/dts/bcm63167-sercomm-h500-s-vfes.dts
@@ -4,7 +4,7 @@
  *
  * Copyright (C) 2020 Daniel Gonz?lez Cabanelas <dgcbueu at gmail.com>
  */
- 
+
 #include "bcm63167-sercomm-h500-s.dtsi"
 
 / {



From lede-commits at lists.infradead.org  Wed Feb  8 18:04:24 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 08 Feb 2023 21:04:24 -0500
Subject: [openwrt/openwrt]  ramips: fix dts whitespace
In-Reply-To: <167590825745.3295702.17175919165330945797@git-01.infra.openwrt.org>
References: <167590825745.3295702.17175919165330945797@git-01.infra.openwrt.org>
Message-ID: <mailman.13761.1675908265.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/d87482a8db908e899bc101242896089cc8b12036

commit d87482a8db908e899bc101242896089cc8b12036
Author: Felix Baumann <felix.bau at gmx.de>
AuthorDate: Wed Feb 8 03:24:21 2023 +0100

    ramips: fix dts whitespace
    
    Replace blanks with tabs
    Remove whitespace from otherwise empty lines
    
    Signed-off-by: Felix Baumann <felix.bau at gmx.de>
---
 target/linux/ramips/dts/mt7621_asus_rp-ac56.dts      | 14 +++++++-------
 target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts |  2 +-
 target/linux/ramips/dts/mt7621_keenetic_kn-3010.dts  |  2 +-
 target/linux/ramips/dts/mt7621_linksys_ea6350-v4.dts |  2 +-
 target/linux/ramips/dts/mt7621_oraybox_x3a.dts       |  2 +-
 target/linux/ramips/dts/mt7621_zyxel_nwa50ax.dts     |  8 ++++----
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/target/linux/ramips/dts/mt7621_asus_rp-ac56.dts b/target/linux/ramips/dts/mt7621_asus_rp-ac56.dts
index 5ae0ca6e82..50047999be 100644
--- a/target/linux/ramips/dts/mt7621_asus_rp-ac56.dts
+++ b/target/linux/ramips/dts/mt7621_asus_rp-ac56.dts
@@ -106,7 +106,7 @@
 };
 
 &gpio {
-       status = "okay";
+	status = "okay";
 };
 
 &spi0 {
@@ -208,12 +208,12 @@
 };
 
 &switch0 {
-        ports {
-                port at 0 {
-                        status = "okay";
-                        label = "lan";
-                };
-        };
+	ports {
+		port at 0 {
+			status = "okay";
+			label = "lan";
+		};
+	};
 };
 
 &xhci {
diff --git a/target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts b/target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts
index 675a3aa631..943143ad63 100644
--- a/target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts
+++ b/target/linux/ramips/dts/mt7621_dlink_dir-3060-a1.dts
@@ -55,7 +55,7 @@
 			label = "white:net";
 			gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
 		};
-		
+
 		usb2_white {
 			label = "white:usb2";
 			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
diff --git a/target/linux/ramips/dts/mt7621_keenetic_kn-3010.dts b/target/linux/ramips/dts/mt7621_keenetic_kn-3010.dts
index 5a771f139c..69080df682 100644
--- a/target/linux/ramips/dts/mt7621_keenetic_kn-3010.dts
+++ b/target/linux/ramips/dts/mt7621_keenetic_kn-3010.dts
@@ -65,7 +65,7 @@
 			label = "wps";
 			gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
 			linux,code = <KEY_WPS_BUTTON>;
-                };
+		};
 	};
 
 	virtual_flash {
diff --git a/target/linux/ramips/dts/mt7621_linksys_ea6350-v4.dts b/target/linux/ramips/dts/mt7621_linksys_ea6350-v4.dts
index 654c9aa70f..71e8dcedbf 100644
--- a/target/linux/ramips/dts/mt7621_linksys_ea6350-v4.dts
+++ b/target/linux/ramips/dts/mt7621_linksys_ea6350-v4.dts
@@ -8,7 +8,7 @@
 };
 
 &gmac1 {
-        phy-handle = <&ethphy4>;
+	phy-handle = <&ethphy4>;
 };
 
 &mdio {
diff --git a/target/linux/ramips/dts/mt7621_oraybox_x3a.dts b/target/linux/ramips/dts/mt7621_oraybox_x3a.dts
index fd7a8e6eca..fe26e5af6f 100644
--- a/target/linux/ramips/dts/mt7621_oraybox_x3a.dts
+++ b/target/linux/ramips/dts/mt7621_oraybox_x3a.dts
@@ -145,7 +145,7 @@
 };
 
 &switch0 {
-	ports {		
+	ports {
 		port at 2 {
 			status = "okay";
 			label = "lan2";
diff --git a/target/linux/ramips/dts/mt7621_zyxel_nwa50ax.dts b/target/linux/ramips/dts/mt7621_zyxel_nwa50ax.dts
index 62ba49e797..2cdaa40a1c 100644
--- a/target/linux/ramips/dts/mt7621_zyxel_nwa50ax.dts
+++ b/target/linux/ramips/dts/mt7621_zyxel_nwa50ax.dts
@@ -49,8 +49,8 @@
 };
 
 &state_default {
-        gpio {
-                groups = "uart3", "rgmii2";
-                function = "gpio";
-        };
+	gpio {
+		groups = "uart3", "rgmii2";
+		function = "gpio";
+	};
 };



From lede-commits at lists.infradead.org  Wed Feb  8 18:04:18 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 08 Feb 2023 21:04:18 -0500
Subject: [openwrt/openwrt]  ath79: fix dts whitespace
In-Reply-To: <167590825745.3295702.17175919165330945797@git-01.infra.openwrt.org>
References: <167590825745.3295702.17175919165330945797@git-01.infra.openwrt.org>
Message-ID: <mailman.13762.1675908265.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/d0c64ae6953c08b2a0b9ecc5d0a24d884ccc8ad5

commit d0c64ae6953c08b2a0b9ecc5d0a24d884ccc8ad5
Author: Felix Baumann <felix.bau at gmx.de>
AuthorDate: Wed Feb 8 03:18:44 2023 +0100

    ath79: fix dts whitespace
    
    Replace blanks with tabs
    Remove whitespace from otherwise empty lines
    
    Signed-off-by: Felix Baumann <felix.bau at gmx.de>
---
 target/linux/ath79/dts/ar7161_trendnet_tew-673gru.dts    |  2 +-
 .../dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts     | 10 +++++-----
 target/linux/ath79/dts/ar9344_tplink_tl-wr841hp-v2.dts   | 16 ++++++++--------
 target/linux/ath79/dts/ar9344_wd_mynet-n600.dts          | 16 ++++++++--------
 target/linux/ath79/dts/qca9558_ubnt_nanobeam-ac-xc.dts   |  2 +-
 target/linux/ath79/dts/qca9563_tplink_deco-m4r-v1.dts    | 14 +++++++-------
 6 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/target/linux/ath79/dts/ar7161_trendnet_tew-673gru.dts b/target/linux/ath79/dts/ar7161_trendnet_tew-673gru.dts
index b6d66a08a5..a770ca04a8 100644
--- a/target/linux/ath79/dts/ar7161_trendnet_tew-673gru.dts
+++ b/target/linux/ath79/dts/ar7161_trendnet_tew-673gru.dts
@@ -58,7 +58,7 @@
 			};
 		};
 	};
-	
+
 	virtual_flash {
 		compatible = "mtd-concat";
 		devices = <&fwconcat0 &fwconcat1>;
diff --git a/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts b/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts
index 28a88db5df..cda96494e7 100644
--- a/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts
+++ b/target/linux/ath79/dts/ar9342_mikrotik_routerboard-912uag-2hpnd.dts
@@ -10,11 +10,11 @@
 	model = "MikroTik RouterBOARD 912UAG-2HPnD";
 
 	aliases {
-                led-boot = &led_power;
-                led-failsafe = &led_power;
-                led-running = &led_power;
-                led-upgrade = &led_power;
-        };
+		led-boot = &led_power;
+		led-failsafe = &led_power;
+		led-running = &led_power;
+		led-upgrade = &led_power;
+	};
 
 	gpio_key: gpio_key {
 		compatible = "mikrotik,gpio-rb91x-key";
diff --git a/target/linux/ath79/dts/ar9344_tplink_tl-wr841hp-v2.dts b/target/linux/ath79/dts/ar9344_tplink_tl-wr841hp-v2.dts
index 360443565b..49526fb6d2 100644
--- a/target/linux/ath79/dts/ar9344_tplink_tl-wr841hp-v2.dts
+++ b/target/linux/ath79/dts/ar9344_tplink_tl-wr841hp-v2.dts
@@ -16,7 +16,7 @@
 		led-upgrade = &led_system;
 		label-mac-device = &wmac;
 	};
-	
+
 	keys {
 		compatible = "gpio-keys";
 
@@ -26,7 +26,7 @@
 			debounce-interval = <60>;
 		};
 	};
-	
+
 	leds {
 		compatible = "gpio-leds";
 
@@ -54,12 +54,12 @@
 			label = "green:lan4";
 			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
 		};
-		
+
 		wps {
 			label = "green:wps";
 			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
 		};
-		
+
 		wlan {
 			label = "green:wlan";
 			gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
@@ -130,16 +130,16 @@
 
 &wmac {
 	status = "okay";
-	
+
 	mtd-cal-data = <&art 0x1000>;
-	
+
 	nvmem-cells = <&macaddr_uboot_1fc00>;
 	nvmem-cell-names = "mac-address";
 };
 
 &eth0 {
 	status = "okay";
-	
+
 	phy-handle = <&swphy0>;
 
 	nvmem-cells = <&macaddr_uboot_1fc00>;
@@ -152,7 +152,7 @@
 
 	nvmem-cells = <&macaddr_uboot_1fc00>;
 	nvmem-cell-names = "mac-address";
-	
+
 	gmac-config {
 		device = <&gmac>;
 		switch-phy-swap = <1>;
diff --git a/target/linux/ath79/dts/ar9344_wd_mynet-n600.dts b/target/linux/ath79/dts/ar9344_wd_mynet-n600.dts
index 81788fb348..3c0e9c56a1 100644
--- a/target/linux/ath79/dts/ar9344_wd_mynet-n600.dts
+++ b/target/linux/ath79/dts/ar9344_wd_mynet-n600.dts
@@ -18,27 +18,27 @@
 		compatible = "gpio-leds";
 
 		led-0 {
-                        color = <LED_COLOR_ID_BLUE>;
-                        function = LED_FUNCTION_WLAN;
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_WLAN;
 			gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
 		};
 
 		led_power: led-1 {
 			label = "blue:power";
-                        color = <LED_COLOR_ID_BLUE>;
-                        function = LED_FUNCTION_POWER;
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_POWER;
 			gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
 		};
 
 		led-2 {
-                        color = <LED_COLOR_ID_BLUE>;
-                        function = LED_FUNCTION_WAN;
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_WAN;
 			gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
 		};
 
 		led-3 {
-                        color = <LED_COLOR_ID_BLUE>;
-                        function = LED_FUNCTION_WPS;
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_WPS;
 			gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
 		};
 	};
diff --git a/target/linux/ath79/dts/qca9558_ubnt_nanobeam-ac-xc.dts b/target/linux/ath79/dts/qca9558_ubnt_nanobeam-ac-xc.dts
index dce88ac218..91675ff615 100644
--- a/target/linux/ath79/dts/qca9558_ubnt_nanobeam-ac-xc.dts
+++ b/target/linux/ath79/dts/qca9558_ubnt_nanobeam-ac-xc.dts
@@ -5,7 +5,7 @@
  * Copyright (C) 2022 Daniel Gonz?lez Cabanelas <dgcbueu at gmail.com>
  * based on device tree from qca9558_ubnt_powerbeam-5ac-500.dts
  */
- 
+
 #include "qca955x_ubnt_xc.dtsi"
 
 / {
diff --git a/target/linux/ath79/dts/qca9563_tplink_deco-m4r-v1.dts b/target/linux/ath79/dts/qca9563_tplink_deco-m4r-v1.dts
index 4b2d80aa82..8cd9004bd3 100644
--- a/target/linux/ath79/dts/qca9563_tplink_deco-m4r-v1.dts
+++ b/target/linux/ath79/dts/qca9563_tplink_deco-m4r-v1.dts
@@ -24,7 +24,7 @@
 			gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
 			linux,default-trigger = "phy1tpt";
 		};
-		
+
 		led_power: power {
 			label = "green:power";
 			gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
@@ -41,7 +41,7 @@
 
 	keys {
 		compatible = "gpio-keys";
-		
+
 		reset {
 			label = "Reset button";
 			linux,code = <KEY_RESTART>;
@@ -83,19 +83,19 @@
 			compatible = "fixed-partitions";
 			#address-cells = <1>;
 			#size-cells = <1>;
-			
+
 			uboot: partition at 0 {
 				label = "u-boot";
 				reg = <0x000000 0x080000>;
 				read-only;
 			};
-			
+
 			partition at 80000 {
 				compatible = "denx,uimage";
 				label = "firmware";
 				reg = <0x080000 0xe00000>;
 			};
-			
+
 			partition at e80000 {
 				label = "product-info";
 				reg = <0xe80000 0x05000>;
@@ -107,7 +107,7 @@
 				reg = <0xe85000 0x16b000>;
 				read-only;
 			};
-			
+
 			art: partition at ff0000 {
 				label = "art";
 				reg = <0xff0000 0x010000>;
@@ -122,7 +122,7 @@
 
 	phy-mode = "sgmii";
 	phy-handle = <&phy0>;
-	
+
 	nvmem-cells = <&macaddr_config_8>;
 	nvmem-cell-names = "mac-address";
 };



From lede-commits at lists.infradead.org  Wed Feb  8 18:04:25 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 08 Feb 2023 21:04:25 -0500
Subject: [openwrt/openwrt]  realtek: fix dts whitespace
In-Reply-To: <167590825745.3295702.17175919165330945797@git-01.infra.openwrt.org>
References: <167590825745.3295702.17175919165330945797@git-01.infra.openwrt.org>
Message-ID: <mailman.13763.1675908265.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/e8096de9a2d64f9728ad040cfc55fc55ab6dc793

commit e8096de9a2d64f9728ad040cfc55fc55ab6dc793
Author: Felix Baumann <felix.bau at gmx.de>
AuthorDate: Wed Feb 8 03:48:20 2023 +0100

    realtek: fix dts whitespace
    
    Remove whitespace from otherwise empty lines
    
    Signed-off-by: Felix Baumann <felix.bau at gmx.de>
---
 target/linux/realtek/dts-5.10/rtl8393_zyxel_gs1900-48.dts | 4 ++--
 target/linux/realtek/dts-5.10/rtl931x.dtsi                | 6 +++---
 target/linux/realtek/dts-5.15/rtl8393_zyxel_gs1900-48.dts | 4 ++--
 target/linux/realtek/dts-5.15/rtl931x.dtsi                | 4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/target/linux/realtek/dts-5.10/rtl8393_zyxel_gs1900-48.dts b/target/linux/realtek/dts-5.10/rtl8393_zyxel_gs1900-48.dts
index 48cfae6703..c7ddd8313a 100644
--- a/target/linux/realtek/dts-5.10/rtl8393_zyxel_gs1900-48.dts
+++ b/target/linux/realtek/dts-5.10/rtl8393_zyxel_gs1900-48.dts
@@ -14,7 +14,7 @@
 		led-failsafe = &led_sys;
 		led-running = &led_sys;
 		led-upgrade = &led_sys;
-	};	
+	};
 
 	memory at 0 {
 		device_type = "memory";
@@ -149,7 +149,7 @@
 		regmap = <&ethernet0>;
 		#address-cells = <1>;
 		#size-cells = <0>;
-		
+
 		/* External phy RTL8218B #1 */
 		EXTERNAL_PHY(0)
 		EXTERNAL_PHY(1)
diff --git a/target/linux/realtek/dts-5.10/rtl931x.dtsi b/target/linux/realtek/dts-5.10/rtl931x.dtsi
index a5166141e6..fd932c8be1 100644
--- a/target/linux/realtek/dts-5.10/rtl931x.dtsi
+++ b/target/linux/realtek/dts-5.10/rtl931x.dtsi
@@ -5,7 +5,7 @@
 / {
 	#address-cells = <1>;
 	#size-cells = <1>;
-	
+
 	compatible = "realtek,rtl838x-soc";
 
 	cpus {
@@ -28,7 +28,7 @@
 		device_type = "memory";
 		reg = <0x0 0x10000000>;
 	};
-	
+
 	chosen {
 		bootargs = "console=ttyS0,115200";
 	};
@@ -75,7 +75,7 @@
 			clocks = <&cpuclock>;
 		};
 	};
-	
+
 	soc: soc {
 		compatible = "simple-bus";
 		#address-cells = <1>;
diff --git a/target/linux/realtek/dts-5.15/rtl8393_zyxel_gs1900-48.dts b/target/linux/realtek/dts-5.15/rtl8393_zyxel_gs1900-48.dts
index 48cfae6703..c7ddd8313a 100644
--- a/target/linux/realtek/dts-5.15/rtl8393_zyxel_gs1900-48.dts
+++ b/target/linux/realtek/dts-5.15/rtl8393_zyxel_gs1900-48.dts
@@ -14,7 +14,7 @@
 		led-failsafe = &led_sys;
 		led-running = &led_sys;
 		led-upgrade = &led_sys;
-	};	
+	};
 
 	memory at 0 {
 		device_type = "memory";
@@ -149,7 +149,7 @@
 		regmap = <&ethernet0>;
 		#address-cells = <1>;
 		#size-cells = <0>;
-		
+
 		/* External phy RTL8218B #1 */
 		EXTERNAL_PHY(0)
 		EXTERNAL_PHY(1)
diff --git a/target/linux/realtek/dts-5.15/rtl931x.dtsi b/target/linux/realtek/dts-5.15/rtl931x.dtsi
index e7e7840a22..61599e89b5 100644
--- a/target/linux/realtek/dts-5.15/rtl931x.dtsi
+++ b/target/linux/realtek/dts-5.15/rtl931x.dtsi
@@ -5,7 +5,7 @@
 / {
 	#address-cells = <1>;
 	#size-cells = <1>;
-	
+
 	compatible = "realtek,rtl838x-soc";
 
 	cpus {
@@ -81,7 +81,7 @@
 			clocks = <&cpuclock>;
 		};
 	};
-	
+
 	soc: soc {
 		compatible = "simple-bus";
 		#address-cells = <1>;



From lede-commits at lists.infradead.org  Wed Feb  8 18:04:23 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 08 Feb 2023 21:04:23 -0500
Subject: [openwrt/openwrt]  mediatek: fix dts whitespace
In-Reply-To: <167590825745.3295702.17175919165330945797@git-01.infra.openwrt.org>
References: <167590825745.3295702.17175919165330945797@git-01.infra.openwrt.org>
Message-ID: <mailman.13764.1675908265.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/d88e2aa79425884619e28deade98db46f336c11d

commit d88e2aa79425884619e28deade98db46f336c11d
Author: Felix Baumann <felix.bau at gmx.de>
AuthorDate: Wed Feb 8 03:23:40 2023 +0100

    mediatek: fix dts whitespace
    
    Replace blanks with tabs
    
    Signed-off-by: Felix Baumann <felix.bau at gmx.de>
---
 .../files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-rfb-spim-nor.dts    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-rfb-spim-nor.dts b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-rfb-spim-nor.dts
index 8d94069dcf..6342981304 100644
--- a/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-rfb-spim-nor.dts
+++ b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-rfb-spim-nor.dts
@@ -3,7 +3,7 @@
 #include "mt7986a-rfb.dtsi"
 
 / {
-        compatible = "mediatek,mt7986a-rfb-snor";
+	compatible = "mediatek,mt7986a-rfb-snor";
 };
 
 &spi0 {



From lede-commits at lists.infradead.org  Wed Feb  8 18:17:10 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 08 Feb 2023 21:17:10 -0500
Subject: [openwrt/openwrt]  kernel: kmod-fs-ntfs3: fix typo
In-Reply-To: <167590903070.3304994.3525723264408468304@git-01.infra.openwrt.org>
References: <167590903070.3304994.3525723264408468304@git-01.infra.openwrt.org>
Message-ID: <mailman.13767.1675909035.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/1a145ccb0a4fbdd5bafc21e5c320b41a41d96ce4

commit 1a145ccb0a4fbdd5bafc21e5c320b41a41d96ce4
Author: Xu Yiming <xuyiming.open at outlook.com>
AuthorDate: Sun Feb 5 03:17:48 2023 +0800

    kernel: kmod-fs-ntfs3: fix typo
    
    Fix typo that mistaken the description of ntfs3 for fuse.
    
    Signed-off-by: Xu Yiming <xuyiming.open at outlook.com>
---
 package/kernel/linux/modules/fs.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/linux/modules/fs.mk b/package/kernel/linux/modules/fs.mk
index ac2131e04a..19fa9fcfc0 100644
--- a/package/kernel/linux/modules/fs.mk
+++ b/package/kernel/linux/modules/fs.mk
@@ -535,7 +535,7 @@ define KernelPackage/fs-ntfs3
   AUTOLOAD:=$(call AutoLoad,80,ntfs3)
 endef
 
-define KernelPackage/fuse/description
+define KernelPackage/fs-ntfs3/description
  Kernel module for fully functional NTFS filesystem support. It allows
  reading as well as writing.
 



From lede-commits at lists.infradead.org  Thu Feb  9 16:27:44 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 09 Feb 2023 19:27:44 -0500
Subject: [openwrt/openwrt]  bpf: check llvm version only when used
In-Reply-To: <167598886449.78387.1466920806399035644@git-01.infra.openwrt.org>
References: <167598886449.78387.1466920806399035644@git-01.infra.openwrt.org>
Message-ID: <mailman.14153.1675988881.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/98b8507e83c69d5e66e442eca95fc076114a736a

commit 98b8507e83c69d5e66e442eca95fc076114a736a
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Wed Oct 26 23:05:31 2022 +0200

    bpf: check llvm version only when used
    
    unetd always includes $(INCLUDE_DIR)/bpf.mk. This file always checks if
    the LLVM version is supported in CLANG_VER_VALID. unetd only needs bpf
    when UNETD_VXLAN_SUPPORT is set. It fails when UNETD_VXLAN_SUPPORT is
    not set and llvm is not installed.
    
    Fix it by only checking the LLVM version when a LLVM toolchain is
    available.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
    (cherry picked from commit c58177b5dcb3461efef0adefe570dd8a8d966ec4)
---
 include/bpf.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/bpf.mk b/include/bpf.mk
index 7d0cfbd76d..e43fcad50c 100644
--- a/include/bpf.mk
+++ b/include/bpf.mk
@@ -63,6 +63,7 @@ BPF_CFLAGS := \
 	-Wno-unused-label \
 	-O2 -emit-llvm -Xclang -disable-llvm-passes
 
+ifneq ($(CONFIG_HAS_BPF_TOOLCHAIN),)
 ifeq ($(DUMP),)
   CLANG_VER:=$(shell $(CLANG) -dM -E - < /dev/null | grep __clang_major__ | cut -d' ' -f3)
   CLANG_VER_VALID:=$(shell [ "$(CLANG_VER)" -ge "$(CLANG_MIN_VER)" ] && echo 1 )
@@ -70,6 +71,7 @@ ifeq ($(DUMP),)
     $(error ERROR: LLVM/clang version too old. Minimum required: $(CLANG_MIN_VER), found: $(CLANG_VER))
   endif
 endif
+endif
 
 define CompileBPF
 	$(CLANG) -g -target $(BPF_ARCH)-linux-gnu $(BPF_CFLAGS) $(2) \



From lede-commits at lists.infradead.org  Thu Feb  9 16:27:45 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 09 Feb 2023 19:27:45 -0500
Subject: [openwrt/openwrt]  bpf: ignore missing LLVM bins on package for non
 compile steps
In-Reply-To: <167598886449.78387.1466920806399035644@git-01.infra.openwrt.org>
References: <167598886449.78387.1466920806399035644@git-01.infra.openwrt.org>
Message-ID: <mailman.14154.1675988881.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/f7541aecdc0658051f492016733a64a1de4904bd

commit f7541aecdc0658051f492016733a64a1de4904bd
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Wed Jan 18 12:22:12 2023 +0100

    bpf: ignore missing LLVM bins on package for non compile steps
    
    To download a package the LLVM bins are not strictly needed.
    Currently with an example run of make package/bridger/download V=s, the
    build fail with
    
    make[2]: Entering directory '/home/ansuel/openwrt-ansuel/openwrt/package/network/services/bridger'
    bash: line 1: /home/ansuel/openwrt-ansuel/openwrt/staging_dir/host/llvm-bpf/bin/clang: No such file or directory
    bash: line 1: [: : integer expression expected
    /home/ansuel/openwrt-ansuel/openwrt/include/bpf.mk:71: *** ERROR: LLVM/clang version too old. Minimum required: 12, found: .  Stop.
    make[2]: Leaving directory '/home/ansuel/openwrt-ansuel/openwrt/package/network/services/bridger'
    time: package/network/services/bridger/download#0.04#0.00#0.06
        ERROR: package/network/services/bridger failed to build.
    
    This is wrong since it may be needed to download the required packages
    first and then compile them later.
    
    Fix this by ignoring the LLVM bin check on non compile steps.
    
    Tested-by: Robert Marko <robimarko at gmail.com>
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
    (cherry picked from commit 116c73fd71c75e38c4d707dc5a74e6993874098f)
---
 include/bpf.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/bpf.mk b/include/bpf.mk
index e43fcad50c..ec3f04e1e9 100644
--- a/include/bpf.mk
+++ b/include/bpf.mk
@@ -64,7 +64,7 @@ BPF_CFLAGS := \
 	-O2 -emit-llvm -Xclang -disable-llvm-passes
 
 ifneq ($(CONFIG_HAS_BPF_TOOLCHAIN),)
-ifeq ($(DUMP),)
+ifeq ($(DUMP)$(filter download refresh,$(MAKECMDGOALS)),)
   CLANG_VER:=$(shell $(CLANG) -dM -E - < /dev/null | grep __clang_major__ | cut -d' ' -f3)
   CLANG_VER_VALID:=$(shell [ "$(CLANG_VER)" -ge "$(CLANG_MIN_VER)" ] && echo 1 )
   ifeq ($(CLANG_VER_VALID),)



From lede-commits at lists.infradead.org  Sat Feb 11 05:43:36 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 11 Feb 2023 08:43:36 -0500
Subject: [openwrt/openwrt]  mediatek: mt7622: fix rootfs/ubi detection for
 Xiaomi AX6S
In-Reply-To: <167612301655.1556249.7091367530220303853@git-01.infra.openwrt.org>
References: <167612301655.1556249.7091367530220303853@git-01.infra.openwrt.org>
Message-ID: <mailman.14847.1676123027.3064139.lede-commits@lists.infradead.org>

981213 pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/b174de2c5ffee79b222f98a62c02aa1b6378ba62

commit b174de2c5ffee79b222f98a62c02aa1b6378ba62
Author: Oleg S <remittor at gmail.com>
AuthorDate: Mon Oct 17 10:41:51 2022 +0300

    mediatek: mt7622: fix rootfs/ubi detection for Xiaomi AX6S
    
    By specifying the flag "denx,fit" for partition "kernel", the kernel
    try to find rootfs in the same partition during boot. Reality is that
    the placement of rootfs is precisely determined by the name of another
    partition -"ubi".
    It was also found that on some device (for example devices with NAND
    chips), the "Denx search engine" manages to find roots at the end of
    partition "kernel", but such partition doesn't exist and is empty
    there.
    
    Fix this by removing the "denx,fit" flag from partition "kernel". With
    this change the original behavior of searchif rootfs in partition "ubi"
    is restored.
    
    Signed-off-by: Oleg S <remittor at gmail.com>
---
 target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts b/target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts
index 73ee41bb2d..9661d0c7fb 100644
--- a/target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts
+++ b/target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts
@@ -295,7 +295,6 @@
 			 */
 			partition at 2c0000 {
 				label = "kernel";
-				compatible = "denx,fit";
 				reg = <0x2c0000 0x400000>;
 			};
 



From lede-commits at lists.infradead.org  Sat Feb 11 14:58:04 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 11 Feb 2023 17:58:04 -0500
Subject: [openwrt/openwrt]  kernel: bump 5.15 to 5.15.93
In-Reply-To: <167615628432.1891457.6022982833779596129@git-01.infra.openwrt.org>
References: <167615628432.1891457.6022982833779596129@git-01.infra.openwrt.org>
Message-ID: <mailman.14917.1676156292.3064139.lede-commits@lists.infradead.org>

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

commit 3c0676911b4622631180782ba54d7ce157dad2cc
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Thu Feb 9 07:45:03 2023 -0500

    kernel: bump 5.15 to 5.15.93
    
    All patches automatically rebased.
    
    Build system: x86_64
    Build-tested: bcm2711/RPi4B, filogic/xiaomi_redmi-router-ax6000-ubootmod
    Run-tested: bcm2711/RPi4B, filogic/xiaomi_redmi-router-ax6000-ubootmod
    
    Signed-off-by: John Audia <therealgraysky at proton.me>
---
 include/kernel-5.15                                |  4 ++--
 ...drm-vc4-hdmi-Raise-the-maximum-clock-rate.patch |  2 +-
 ...i-Add-a-spinlock-to-protect-register-acce.patch |  6 ++---
 ...i-Use-a-mutex-to-prevent-concurrent-frame.patch |  2 +-
 ...rm-vc4-hdmi-Introduce-a-scdc_enabled-flag.patch |  2 +-
 ...-all-the-HDMI-registers-into-the-debugfs-.patch |  4 ++--
 ...drm-vc4-Don-t-try-disabling-SCDC-on-Pi0-3.patch |  2 +-
 ...ure-vc4_hdmi-doesn-t-use-2711-HPD-registe.patch |  4 ++--
 ...0590-drm-vc4-Move-HDMI-reset-to-pm_resume.patch |  8 +++----
 ...rm-vc4-Fix-build-without-DRM_VC4_HDMI_CEC.patch |  2 +-
 ...4-hdmi-Rework-hdmi_enable_4kp60-detection.patch |  2 +-
 ....1-04-mm-multigenerational-lru-groundwork.patch |  4 ++--
 ...-core-rework-nvmem-cell-instance-creation.patch | 28 +++++++++++-----------
 ...e-add-nvmem-cell-post-processing-callback.patch |  6 ++---
 ...-core-Remove-unused-devm_nvmem_unregister.patch |  6 ++---
 ...2-nvmem-core-Use-devm_add_action_or_reset.patch |  4 ++--
 ...Check-input-parameter-for-NULL-in-nvmem_u.patch |  2 +-
 ...-core-add-error-handling-for-dev_set_name.patch |  2 +-
 ...mp-pcie-make-pipe-clock-rate-configurable.patch |  2 +-
 ...p-pcie-add-IPQ8074-PCIe-Gen3-QMP-PHY-supp.patch |  4 ++--
 20 files changed, 48 insertions(+), 48 deletions(-)

diff --git a/include/kernel-5.15 b/include/kernel-5.15
index b691f102a4..f3967b5d29 100644
--- a/include/kernel-5.15
+++ b/include/kernel-5.15
@@ -1,2 +1,2 @@
-LINUX_VERSION-5.15 = .92
-LINUX_KERNEL_HASH-5.15.92 = 9f420451db99a31a4aade9a46487b39318340d228f5c87c6dc56d83477e6ef91
+LINUX_VERSION-5.15 = .93
+LINUX_KERNEL_HASH-5.15.93 = e7ed24f2690bf0e11158ccfa8ddc5c0e8a4816d83c4055d205218853da9c5dad
diff --git a/target/linux/bcm27xx/patches-5.15/950-0005-drm-vc4-hdmi-Raise-the-maximum-clock-rate.patch b/target/linux/bcm27xx/patches-5.15/950-0005-drm-vc4-hdmi-Raise-the-maximum-clock-rate.patch
index 054cc1a583..21d3148af7 100644
--- a/target/linux/bcm27xx/patches-5.15/950-0005-drm-vc4-hdmi-Raise-the-maximum-clock-rate.patch
+++ b/target/linux/bcm27xx/patches-5.15/950-0005-drm-vc4-hdmi-Raise-the-maximum-clock-rate.patch
@@ -20,7 +20,7 @@ Link: https://lore.kernel.org/r/20211025152903.1088803-9-maxime at cerno.tech
 
 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
-@@ -2385,7 +2385,7 @@ static const struct vc4_hdmi_variant bcm
+@@ -2386,7 +2386,7 @@ static const struct vc4_hdmi_variant bcm
  	.encoder_type		= VC4_ENCODER_TYPE_HDMI0,
  	.debugfs_name		= "hdmi0_regs",
  	.card_name		= "vc4-hdmi-0",
diff --git a/target/linux/bcm27xx/patches-5.15/950-0007-drm-vc4-hdmi-Add-a-spinlock-to-protect-register-acce.patch b/target/linux/bcm27xx/patches-5.15/950-0007-drm-vc4-hdmi-Add-a-spinlock-to-protect-register-acce.patch
index 87d4ee481c..fc802e56aa 100644
--- a/target/linux/bcm27xx/patches-5.15/950-0007-drm-vc4-hdmi-Add-a-spinlock-to-protect-register-acce.patch
+++ b/target/linux/bcm27xx/patches-5.15/950-0007-drm-vc4-hdmi-Add-a-spinlock-to-protect-register-acce.patch
@@ -736,7 +736,7 @@ Signed-off-by: Maxime Ripard <maxime at cerno.tech>
  	u32 value;
  	int ret;
  
-@@ -1885,10 +2062,12 @@ static int vc4_hdmi_cec_init(struct vc4_
+@@ -1886,10 +2063,12 @@ static int vc4_hdmi_cec_init(struct vc4_
  	cec_fill_conn_info_from_drm(&conn_info, &vc4_hdmi->connector);
  	cec_s_conn_info(vc4_hdmi->cec_adap, &conn_info);
  
@@ -749,7 +749,7 @@ Signed-off-by: Maxime Ripard <maxime at cerno.tech>
  
  	vc4_hdmi_cec_update_clk_div(vc4_hdmi);
  
-@@ -1907,7 +2086,9 @@ static int vc4_hdmi_cec_init(struct vc4_
+@@ -1908,7 +2087,9 @@ static int vc4_hdmi_cec_init(struct vc4_
  		if (ret)
  			goto err_remove_cec_rx_handler;
  	} else {
@@ -759,7 +759,7 @@ Signed-off-by: Maxime Ripard <maxime at cerno.tech>
  
  		ret = request_threaded_irq(platform_get_irq(pdev, 0),
  					   vc4_cec_irq_handler,
-@@ -2177,6 +2358,7 @@ static int vc4_hdmi_bind(struct device *
+@@ -2178,6 +2359,7 @@ static int vc4_hdmi_bind(struct device *
  	vc4_hdmi = devm_kzalloc(dev, sizeof(*vc4_hdmi), GFP_KERNEL);
  	if (!vc4_hdmi)
  		return -ENOMEM;
diff --git a/target/linux/bcm27xx/patches-5.15/950-0008-drm-vc4-hdmi-Use-a-mutex-to-prevent-concurrent-frame.patch b/target/linux/bcm27xx/patches-5.15/950-0008-drm-vc4-hdmi-Use-a-mutex-to-prevent-concurrent-frame.patch
index ee9b5747b4..2ca86efaa5 100644
--- a/target/linux/bcm27xx/patches-5.15/950-0008-drm-vc4-hdmi-Use-a-mutex-to-prevent-concurrent-frame.patch
+++ b/target/linux/bcm27xx/patches-5.15/950-0008-drm-vc4-hdmi-Use-a-mutex-to-prevent-concurrent-frame.patch
@@ -411,7 +411,7 @@ Signed-off-by: Maxime Ripard <maxime at cerno.tech>
  	if (msg->len > 16) {
  		drm_err(dev, "Attempting to transmit too much data (%d)\n", msg->len);
  		return -ENOMEM;
-@@ -2358,6 +2463,7 @@ static int vc4_hdmi_bind(struct device *
+@@ -2359,6 +2464,7 @@ static int vc4_hdmi_bind(struct device *
  	vc4_hdmi = devm_kzalloc(dev, sizeof(*vc4_hdmi), GFP_KERNEL);
  	if (!vc4_hdmi)
  		return -ENOMEM;
diff --git a/target/linux/bcm27xx/patches-5.15/950-0012-drm-vc4-hdmi-Introduce-a-scdc_enabled-flag.patch b/target/linux/bcm27xx/patches-5.15/950-0012-drm-vc4-hdmi-Introduce-a-scdc_enabled-flag.patch
index eed72c6570..b11ea05705 100644
--- a/target/linux/bcm27xx/patches-5.15/950-0012-drm-vc4-hdmi-Introduce-a-scdc_enabled-flag.patch
+++ b/target/linux/bcm27xx/patches-5.15/950-0012-drm-vc4-hdmi-Introduce-a-scdc_enabled-flag.patch
@@ -69,7 +69,7 @@ Signed-off-by: Maxime Ripard <maxime at cerno.tech>
  
  	if (delayed_work_pending(&vc4_hdmi->scrambling_work))
  		cancel_delayed_work_sync(&vc4_hdmi->scrambling_work);
-@@ -2521,6 +2515,14 @@ static int vc4_hdmi_bind(struct device *
+@@ -2522,6 +2516,14 @@ static int vc4_hdmi_bind(struct device *
  	vc4_hdmi->pdev = pdev;
  	vc4_hdmi->variant = variant;
  
diff --git a/target/linux/bcm27xx/patches-5.15/950-0427-drm-vc4-Add-all-the-HDMI-registers-into-the-debugfs-.patch b/target/linux/bcm27xx/patches-5.15/950-0427-drm-vc4-Add-all-the-HDMI-registers-into-the-debugfs-.patch
index d7f4c40034..f25a725476 100644
--- a/target/linux/bcm27xx/patches-5.15/950-0427-drm-vc4-Add-all-the-HDMI-registers-into-the-debugfs-.patch
+++ b/target/linux/bcm27xx/patches-5.15/950-0427-drm-vc4-Add-all-the-HDMI-registers-into-the-debugfs-.patch
@@ -29,7 +29,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson at raspberrypi.com>
  
  	return 0;
  }
-@@ -2368,6 +2374,7 @@ static int vc5_hdmi_init_resources(struc
+@@ -2369,6 +2375,7 @@ static int vc5_hdmi_init_resources(struc
  	struct platform_device *pdev = vc4_hdmi->pdev;
  	struct device *dev = &pdev->dev;
  	struct resource *res;
@@ -37,7 +37,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson at raspberrypi.com>
  
  	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hdmi");
  	if (!res)
-@@ -2464,6 +2471,38 @@ static int vc5_hdmi_init_resources(struc
+@@ -2465,6 +2472,38 @@ static int vc5_hdmi_init_resources(struc
  		return PTR_ERR(vc4_hdmi->reset);
  	}
  
diff --git a/target/linux/bcm27xx/patches-5.15/950-0572-drm-vc4-Don-t-try-disabling-SCDC-on-Pi0-3.patch b/target/linux/bcm27xx/patches-5.15/950-0572-drm-vc4-Don-t-try-disabling-SCDC-on-Pi0-3.patch
index e52dcd9f8b..6b7acd8e4a 100644
--- a/target/linux/bcm27xx/patches-5.15/950-0572-drm-vc4-Don-t-try-disabling-SCDC-on-Pi0-3.patch
+++ b/target/linux/bcm27xx/patches-5.15/950-0572-drm-vc4-Don-t-try-disabling-SCDC-on-Pi0-3.patch
@@ -20,7 +20,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson at raspberrypi.com>
 
 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
-@@ -2556,7 +2556,8 @@ static int vc4_hdmi_bind(struct device *
+@@ -2557,7 +2557,8 @@ static int vc4_hdmi_bind(struct device *
  	 * vc4_hdmi_disable_scrambling() will thus run at boot, make
  	 * sure it's disabled, and avoid any inconsistency.
  	 */
diff --git a/target/linux/bcm27xx/patches-5.15/950-0580-drm-vc4-Ensure-vc4_hdmi-doesn-t-use-2711-HPD-registe.patch b/target/linux/bcm27xx/patches-5.15/950-0580-drm-vc4-Ensure-vc4_hdmi-doesn-t-use-2711-HPD-registe.patch
index 0327929bd6..73f7ea871a 100644
--- a/target/linux/bcm27xx/patches-5.15/950-0580-drm-vc4-Ensure-vc4_hdmi-doesn-t-use-2711-HPD-registe.patch
+++ b/target/linux/bcm27xx/patches-5.15/950-0580-drm-vc4-Ensure-vc4_hdmi-doesn-t-use-2711-HPD-registe.patch
@@ -55,7 +55,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson at raspberrypi.com>
  /* HDMI audio codec callbacks */
  static void vc4_hdmi_audio_set_mai_clock(struct vc4_hdmi *vc4_hdmi,
  					 unsigned int samplerate)
-@@ -2776,6 +2782,7 @@ static const struct vc4_hdmi_variant bcm
+@@ -2777,6 +2783,7 @@ static const struct vc4_hdmi_variant bcm
  	.phy_rng_disable	= vc5_hdmi_phy_rng_disable,
  	.channel_map		= vc5_hdmi_channel_map,
  	.supports_hdr		= true,
@@ -63,7 +63,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson at raspberrypi.com>
  };
  
  static const struct vc4_hdmi_variant bcm2711_hdmi1_variant = {
-@@ -2804,6 +2811,7 @@ static const struct vc4_hdmi_variant bcm
+@@ -2805,6 +2812,7 @@ static const struct vc4_hdmi_variant bcm
  	.phy_rng_disable	= vc5_hdmi_phy_rng_disable,
  	.channel_map		= vc5_hdmi_channel_map,
  	.supports_hdr		= true,
diff --git a/target/linux/bcm27xx/patches-5.15/950-0590-drm-vc4-Move-HDMI-reset-to-pm_resume.patch b/target/linux/bcm27xx/patches-5.15/950-0590-drm-vc4-Move-HDMI-reset-to-pm_resume.patch
index bec81e3f16..25dd5b5427 100644
--- a/target/linux/bcm27xx/patches-5.15/950-0590-drm-vc4-Move-HDMI-reset-to-pm_resume.patch
+++ b/target/linux/bcm27xx/patches-5.15/950-0590-drm-vc4-Move-HDMI-reset-to-pm_resume.patch
@@ -30,7 +30,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson at raspberrypi.com>
  	int ret;
  
  	if (!of_find_property(dev->of_node, "interrupts", NULL)) {
-@@ -2212,15 +2211,6 @@ static int vc4_hdmi_cec_init(struct vc4_
+@@ -2213,15 +2212,6 @@ static int vc4_hdmi_cec_init(struct vc4_
  	cec_fill_conn_info_from_drm(&conn_info, &vc4_hdmi->connector);
  	cec_s_conn_info(vc4_hdmi->cec_adap, &conn_info);
  
@@ -46,7 +46,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson at raspberrypi.com>
  	if (vc4_hdmi->variant->external_irq_controller) {
  		ret = request_threaded_irq(platform_get_irq_byname(pdev, "cec-rx"),
  					   vc4_cec_irq_handler_rx_bare,
-@@ -2283,6 +2273,29 @@ static void vc4_hdmi_cec_exit(struct vc4
+@@ -2284,6 +2274,29 @@ static void vc4_hdmi_cec_exit(struct vc4
  
  	cec_unregister_adapter(vc4_hdmi->cec_adap);
  }
@@ -76,7 +76,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson at raspberrypi.com>
  #else
  static int vc4_hdmi_cec_init(struct vc4_hdmi *vc4_hdmi)
  {
-@@ -2291,6 +2304,10 @@ static int vc4_hdmi_cec_init(struct vc4_
+@@ -2292,6 +2305,10 @@ static int vc4_hdmi_cec_init(struct vc4_
  
  static void vc4_hdmi_cec_exit(struct vc4_hdmi *vc4_hdmi) {};
  
@@ -87,7 +87,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson at raspberrypi.com>
  #endif
  
  static int vc4_hdmi_build_regset(struct vc4_hdmi *vc4_hdmi,
-@@ -2525,6 +2542,15 @@ static int vc4_hdmi_runtime_resume(struc
+@@ -2526,6 +2543,15 @@ static int vc4_hdmi_runtime_resume(struc
  	if (ret)
  		return ret;
  
diff --git a/target/linux/bcm27xx/patches-5.15/950-0607-drm-vc4-Fix-build-without-DRM_VC4_HDMI_CEC.patch b/target/linux/bcm27xx/patches-5.15/950-0607-drm-vc4-Fix-build-without-DRM_VC4_HDMI_CEC.patch
index f3bfc46498..ac2e8e9839 100644
--- a/target/linux/bcm27xx/patches-5.15/950-0607-drm-vc4-Fix-build-without-DRM_VC4_HDMI_CEC.patch
+++ b/target/linux/bcm27xx/patches-5.15/950-0607-drm-vc4-Fix-build-without-DRM_VC4_HDMI_CEC.patch
@@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.com>
 
 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
-@@ -2279,7 +2279,7 @@ static int vc4_hdmi_cec_init(struct vc4_
+@@ -2280,7 +2280,7 @@ static int vc4_hdmi_cec_init(struct vc4_
  
  static void vc4_hdmi_cec_exit(struct vc4_hdmi *vc4_hdmi) {};
  
diff --git a/target/linux/bcm27xx/patches-5.15/950-0868-drm-vc4-hdmi-Rework-hdmi_enable_4kp60-detection.patch b/target/linux/bcm27xx/patches-5.15/950-0868-drm-vc4-hdmi-Rework-hdmi_enable_4kp60-detection.patch
index 513484f737..8776f648fa 100644
--- a/target/linux/bcm27xx/patches-5.15/950-0868-drm-vc4-hdmi-Rework-hdmi_enable_4kp60-detection.patch
+++ b/target/linux/bcm27xx/patches-5.15/950-0868-drm-vc4-hdmi-Rework-hdmi_enable_4kp60-detection.patch
@@ -79,7 +79,7 @@ Signed-off-by: Maxime Ripard <maxime at cerno.tech>
  		return MODE_CLOCK_HIGH;
  
  	if (info->max_tmds_clock && clock > (info->max_tmds_clock * 1000))
-@@ -3156,14 +3158,6 @@ static int vc4_hdmi_bind(struct device *
+@@ -3157,14 +3159,6 @@ static int vc4_hdmi_bind(struct device *
  	vc4_hdmi->disable_wifi_frequencies =
  		of_property_read_bool(dev->of_node, "wifi-2.4ghz-coexistence");
  
diff --git a/target/linux/generic/backport-5.15/020-v6.1-04-mm-multigenerational-lru-groundwork.patch b/target/linux/generic/backport-5.15/020-v6.1-04-mm-multigenerational-lru-groundwork.patch
index e057b29c47..61d0ea4ef4 100644
--- a/target/linux/generic/backport-5.15/020-v6.1-04-mm-multigenerational-lru-groundwork.patch
+++ b/target/linux/generic/backport-5.15/020-v6.1-04-mm-multigenerational-lru-groundwork.patch
@@ -694,7 +694,7 @@ Change-Id: I71de7cd15b8dfa6f9fdd838023474693c4fee0a7
  		local_lock(&lru_pvecs.lock);
 --- a/mm/swapfile.c
 +++ b/mm/swapfile.c
-@@ -2688,6 +2688,7 @@ SYSCALL_DEFINE1(swapoff, const char __us
+@@ -2689,6 +2689,7 @@ SYSCALL_DEFINE1(swapoff, const char __us
  	err = 0;
  	atomic_inc(&proc_poll_event);
  	wake_up_interruptible(&proc_poll_wait);
@@ -702,7 +702,7 @@ Change-Id: I71de7cd15b8dfa6f9fdd838023474693c4fee0a7
  
  out_dput:
  	filp_close(victim, NULL);
-@@ -3349,6 +3350,7 @@ SYSCALL_DEFINE2(swapon, const char __use
+@@ -3350,6 +3351,7 @@ SYSCALL_DEFINE2(swapon, const char __use
  	mutex_unlock(&swapon_mutex);
  	atomic_inc(&proc_poll_event);
  	wake_up_interruptible(&proc_poll_wait);
diff --git a/target/linux/generic/backport-5.15/802-v5.16-0001-nvmem-core-rework-nvmem-cell-instance-creation.patch b/target/linux/generic/backport-5.15/802-v5.16-0001-nvmem-core-rework-nvmem-cell-instance-creation.patch
index d90c28cb4b..71d9f109a7 100644
--- a/target/linux/generic/backport-5.15/802-v5.16-0001-nvmem-core-rework-nvmem-cell-instance-creation.patch
+++ b/target/linux/generic/backport-5.15/802-v5.16-0001-nvmem-core-rework-nvmem-cell-instance-creation.patch
@@ -206,7 +206,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  	}
  
  	return 0;
-@@ -1141,9 +1143,33 @@ struct nvmem_device *devm_nvmem_device_g
+@@ -1139,9 +1141,33 @@ struct nvmem_device *devm_nvmem_device_g
  }
  EXPORT_SYMBOL_GPL(devm_nvmem_device_get);
  
@@ -240,7 +240,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  	struct nvmem_cell *cell = ERR_PTR(-ENOENT);
  	struct nvmem_cell_lookup *lookup;
  	struct nvmem_device *nvmem;
-@@ -1168,11 +1194,15 @@ nvmem_cell_get_from_lookup(struct device
+@@ -1166,11 +1192,15 @@ nvmem_cell_get_from_lookup(struct device
  				break;
  			}
  
@@ -259,7 +259,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  			}
  			break;
  		}
-@@ -1183,10 +1213,10 @@ nvmem_cell_get_from_lookup(struct device
+@@ -1181,10 +1211,10 @@ nvmem_cell_get_from_lookup(struct device
  }
  
  #if IS_ENABLED(CONFIG_OF)
@@ -273,7 +273,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  
  	mutex_lock(&nvmem_mutex);
  	list_for_each_entry(iter, &nvmem->cells, node) {
-@@ -1216,6 +1246,7 @@ struct nvmem_cell *of_nvmem_cell_get(str
+@@ -1214,6 +1244,7 @@ struct nvmem_cell *of_nvmem_cell_get(str
  {
  	struct device_node *cell_np, *nvmem_np;
  	struct nvmem_device *nvmem;
@@ -281,7 +281,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  	struct nvmem_cell *cell;
  	int index = 0;
  
-@@ -1236,12 +1267,16 @@ struct nvmem_cell *of_nvmem_cell_get(str
+@@ -1234,12 +1265,16 @@ struct nvmem_cell *of_nvmem_cell_get(str
  	if (IS_ERR(nvmem))
  		return ERR_CAST(nvmem);
  
@@ -300,7 +300,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  	return cell;
  }
  EXPORT_SYMBOL_GPL(of_nvmem_cell_get);
-@@ -1347,13 +1382,17 @@ EXPORT_SYMBOL(devm_nvmem_cell_put);
+@@ -1345,13 +1380,17 @@ EXPORT_SYMBOL(devm_nvmem_cell_put);
   */
  void nvmem_cell_put(struct nvmem_cell *cell)
  {
@@ -320,7 +320,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  {
  	u8 *p, *b;
  	int i, extra, bit_offset = cell->bit_offset;
-@@ -1387,8 +1426,8 @@ static void nvmem_shift_read_buffer_in_p
+@@ -1385,8 +1424,8 @@ static void nvmem_shift_read_buffer_in_p
  }
  
  static int __nvmem_cell_read(struct nvmem_device *nvmem,
@@ -331,7 +331,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  {
  	int rc;
  
-@@ -1419,18 +1458,18 @@ static int __nvmem_cell_read(struct nvme
+@@ -1417,18 +1456,18 @@ static int __nvmem_cell_read(struct nvme
   */
  void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)
  {
@@ -353,7 +353,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  	if (rc) {
  		kfree(buf);
  		return ERR_PTR(rc);
-@@ -1440,7 +1479,7 @@ void *nvmem_cell_read(struct nvmem_cell
+@@ -1438,7 +1477,7 @@ void *nvmem_cell_read(struct nvmem_cell
  }
  EXPORT_SYMBOL_GPL(nvmem_cell_read);
  
@@ -362,7 +362,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  					     u8 *_buf, int len)
  {
  	struct nvmem_device *nvmem = cell->nvmem;
-@@ -1493,16 +1532,7 @@ err:
+@@ -1491,16 +1530,7 @@ err:
  	return ERR_PTR(rc);
  }
  
@@ -380,7 +380,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  {
  	struct nvmem_device *nvmem = cell->nvmem;
  	int rc;
-@@ -1528,6 +1558,21 @@ int nvmem_cell_write(struct nvmem_cell *
+@@ -1526,6 +1556,21 @@ int nvmem_cell_write(struct nvmem_cell *
  
  	return len;
  }
@@ -402,7 +402,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  EXPORT_SYMBOL_GPL(nvmem_cell_write);
  
  static int nvmem_cell_read_common(struct device *dev, const char *cell_id,
-@@ -1630,7 +1675,7 @@ static const void *nvmem_cell_read_varia
+@@ -1628,7 +1673,7 @@ static const void *nvmem_cell_read_varia
  	if (IS_ERR(cell))
  		return cell;
  
@@ -411,7 +411,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  	buf = nvmem_cell_read(cell, len);
  	nvmem_cell_put(cell);
  	if (IS_ERR(buf))
-@@ -1726,18 +1771,18 @@ EXPORT_SYMBOL_GPL(nvmem_cell_read_variab
+@@ -1724,18 +1769,18 @@ EXPORT_SYMBOL_GPL(nvmem_cell_read_variab
  ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem,
  			   struct nvmem_cell_info *info, void *buf)
  {
@@ -433,7 +433,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  	if (rc)
  		return rc;
  
-@@ -1757,17 +1802,17 @@ EXPORT_SYMBOL_GPL(nvmem_device_cell_read
+@@ -1755,17 +1800,17 @@ EXPORT_SYMBOL_GPL(nvmem_device_cell_read
  int nvmem_device_cell_write(struct nvmem_device *nvmem,
  			    struct nvmem_cell_info *info, void *buf)
  {
diff --git a/target/linux/generic/backport-5.15/802-v5.16-0002-nvmem-core-add-nvmem-cell-post-processing-callback.patch b/target/linux/generic/backport-5.15/802-v5.16-0002-nvmem-core-add-nvmem-cell-post-processing-callback.patch
index 93a540c2b1..420d2a5d7e 100644
--- a/target/linux/generic/backport-5.15/802-v5.16-0002-nvmem-core-add-nvmem-cell-post-processing-callback.patch
+++ b/target/linux/generic/backport-5.15/802-v5.16-0002-nvmem-core-add-nvmem-cell-post-processing-callback.patch
@@ -30,7 +30,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  	struct gpio_desc	*wp_gpio;
  	void *priv;
  };
-@@ -798,6 +799,7 @@ struct nvmem_device *nvmem_register(cons
+@@ -797,6 +798,7 @@ struct nvmem_device *nvmem_register(cons
  	nvmem->type = config->type;
  	nvmem->reg_read = config->reg_read;
  	nvmem->reg_write = config->reg_write;
@@ -38,7 +38,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  	nvmem->keepout = config->keepout;
  	nvmem->nkeepout = config->nkeepout;
  	if (config->of_node)
-@@ -1440,6 +1442,13 @@ static int __nvmem_cell_read(struct nvme
+@@ -1438,6 +1440,13 @@ static int __nvmem_cell_read(struct nvme
  	if (cell->bit_offset || cell->nbits)
  		nvmem_shift_read_buffer_in_place(cell, buf);
  
@@ -72,7 +72,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
   * @size:	Device size.
   * @word_size:	Minimum read/write access granularity.
   * @stride:	Minimum read/write access stride.
-@@ -94,6 +98,7 @@ struct nvmem_config {
+@@ -92,6 +96,7 @@ struct nvmem_config {
  	bool			no_of_node;
  	nvmem_reg_read_t	reg_read;
  	nvmem_reg_write_t	reg_write;
diff --git a/target/linux/generic/backport-5.15/804-v5.18-0001-nvmem-core-Remove-unused-devm_nvmem_unregister.patch b/target/linux/generic/backport-5.15/804-v5.18-0001-nvmem-core-Remove-unused-devm_nvmem_unregister.patch
index efa380288a..c049e2a1ae 100644
--- a/target/linux/generic/backport-5.15/804-v5.18-0001-nvmem-core-Remove-unused-devm_nvmem_unregister.patch
+++ b/target/linux/generic/backport-5.15/804-v5.18-0001-nvmem-core-Remove-unused-devm_nvmem_unregister.patch
@@ -17,7 +17,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
 
 --- a/drivers/nvmem/core.c
 +++ b/drivers/nvmem/core.c
-@@ -942,28 +942,6 @@ struct nvmem_device *devm_nvmem_register
+@@ -940,28 +940,6 @@ struct nvmem_device *devm_nvmem_register
  }
  EXPORT_SYMBOL_GPL(devm_nvmem_register);
  
@@ -48,7 +48,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  {
 --- a/include/linux/nvmem-provider.h
 +++ b/include/linux/nvmem-provider.h
-@@ -135,8 +135,6 @@ void nvmem_unregister(struct nvmem_devic
+@@ -133,8 +133,6 @@ void nvmem_unregister(struct nvmem_devic
  struct nvmem_device *devm_nvmem_register(struct device *dev,
  					 const struct nvmem_config *cfg);
  
@@ -57,7 +57,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  void nvmem_add_cell_table(struct nvmem_cell_table *table);
  void nvmem_del_cell_table(struct nvmem_cell_table *table);
  
-@@ -155,12 +153,6 @@ devm_nvmem_register(struct device *dev,
+@@ -153,12 +151,6 @@ devm_nvmem_register(struct device *dev,
  	return nvmem_register(c);
  }
  
diff --git a/target/linux/generic/backport-5.15/804-v5.18-0002-nvmem-core-Use-devm_add_action_or_reset.patch b/target/linux/generic/backport-5.15/804-v5.18-0002-nvmem-core-Use-devm_add_action_or_reset.patch
index 28e8ba465d..c714fa1a16 100644
--- a/target/linux/generic/backport-5.15/804-v5.18-0002-nvmem-core-Use-devm_add_action_or_reset.patch
+++ b/target/linux/generic/backport-5.15/804-v5.18-0002-nvmem-core-Use-devm_add_action_or_reset.patch
@@ -16,7 +16,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
 
 --- a/drivers/nvmem/core.c
 +++ b/drivers/nvmem/core.c
-@@ -904,9 +904,9 @@ void nvmem_unregister(struct nvmem_devic
+@@ -902,9 +902,9 @@ void nvmem_unregister(struct nvmem_devic
  }
  EXPORT_SYMBOL_GPL(nvmem_unregister);
  
@@ -28,7 +28,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  }
  
  /**
-@@ -923,20 +923,16 @@ static void devm_nvmem_release(struct de
+@@ -921,20 +921,16 @@ static void devm_nvmem_release(struct de
  struct nvmem_device *devm_nvmem_register(struct device *dev,
  					 const struct nvmem_config *config)
  {
diff --git a/target/linux/generic/backport-5.15/804-v5.18-0003-nvmem-core-Check-input-parameter-for-NULL-in-nvmem_u.patch b/target/linux/generic/backport-5.15/804-v5.18-0003-nvmem-core-Check-input-parameter-for-NULL-in-nvmem_u.patch
index d793309426..dc96a9b88c 100644
--- a/target/linux/generic/backport-5.15/804-v5.18-0003-nvmem-core-Check-input-parameter-for-NULL-in-nvmem_u.patch
+++ b/target/linux/generic/backport-5.15/804-v5.18-0003-nvmem-core-Check-input-parameter-for-NULL-in-nvmem_u.patch
@@ -18,7 +18,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
 
 --- a/drivers/nvmem/core.c
 +++ b/drivers/nvmem/core.c
-@@ -900,7 +900,8 @@ static void nvmem_device_release(struct
+@@ -898,7 +898,8 @@ static void nvmem_device_release(struct
   */
  void nvmem_unregister(struct nvmem_device *nvmem)
  {
diff --git a/target/linux/generic/backport-5.15/807-v6.1-0003-nvmem-core-add-error-handling-for-dev_set_name.patch b/target/linux/generic/backport-5.15/807-v6.1-0003-nvmem-core-add-error-handling-for-dev_set_name.patch
index 34a28fa6fe..e2089e7b05 100644
--- a/target/linux/generic/backport-5.15/807-v6.1-0003-nvmem-core-add-error-handling-for-dev_set_name.patch
+++ b/target/linux/generic/backport-5.15/807-v6.1-0003-nvmem-core-add-error-handling-for-dev_set_name.patch
@@ -17,7 +17,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
 
 --- a/drivers/nvmem/core.c
 +++ b/drivers/nvmem/core.c
-@@ -810,18 +810,24 @@ struct nvmem_device *nvmem_register(cons
+@@ -809,18 +809,24 @@ struct nvmem_device *nvmem_register(cons
  
  	switch (config->id) {
  	case NVMEM_DEVID_NONE:
diff --git a/target/linux/ipq807x/patches-5.15/0072-v6.0-phy-qcom-qmp-pcie-make-pipe-clock-rate-configurable.patch b/target/linux/ipq807x/patches-5.15/0072-v6.0-phy-qcom-qmp-pcie-make-pipe-clock-rate-configurable.patch
index fddc82ed35..667c0cf7c7 100644
--- a/target/linux/ipq807x/patches-5.15/0072-v6.0-phy-qcom-qmp-pcie-make-pipe-clock-rate-configurable.patch
+++ b/target/linux/ipq807x/patches-5.15/0072-v6.0-phy-qcom-qmp-pcie-make-pipe-clock-rate-configurable.patch
@@ -27,7 +27,7 @@ Signed-off-by: Vinod Koul <vkoul at kernel.org>
  	/* true, if PCS block has no separate SW_RESET register */
  	bool no_pcs_sw_reset;
  };
-@@ -5138,8 +5141,15 @@ static int phy_pipe_clk_register(struct
+@@ -5139,8 +5142,15 @@ static int phy_pipe_clk_register(struct
  
  	init.ops = &clk_fixed_rate_ops;
  
diff --git a/target/linux/ipq807x/patches-5.15/0073-v6.0-phy-qcom-qmp-pcie-add-IPQ8074-PCIe-Gen3-QMP-PHY-supp.patch b/target/linux/ipq807x/patches-5.15/0073-v6.0-phy-qcom-qmp-pcie-add-IPQ8074-PCIe-Gen3-QMP-PHY-supp.patch
index c915619360..72aeef974e 100644
--- a/target/linux/ipq807x/patches-5.15/0073-v6.0-phy-qcom-qmp-pcie-add-IPQ8074-PCIe-Gen3-QMP-PHY-supp.patch
+++ b/target/linux/ipq807x/patches-5.15/0073-v6.0-phy-qcom-qmp-pcie-add-IPQ8074-PCIe-Gen3-QMP-PHY-supp.patch
@@ -151,7 +151,7 @@ Signed-off-by: Vinod Koul <vkoul at kernel.org>
  static const struct qmp_phy_init_tbl sdm845_qmp_pcie_serdes_tbl[] = {
  	QMP_PHY_INIT_CFG(QSERDES_V3_COM_BIAS_EN_CLKBUFLR_EN, 0x14),
  	QMP_PHY_INIT_CFG(QSERDES_V3_COM_CLK_SELECT, 0x30),
-@@ -3167,6 +3294,36 @@ static const struct qmp_phy_cfg ipq8074_
+@@ -3168,6 +3295,36 @@ static const struct qmp_phy_cfg ipq8074_
  	.pwrdn_delay_max	= 1005,		/* us */
  };
  
@@ -188,7 +188,7 @@ Signed-off-by: Vinod Koul <vkoul at kernel.org>
  static const struct qmp_phy_cfg ipq6018_pciephy_cfg = {
  	.type			= PHY_TYPE_PCIE,
  	.nlanes			= 1,
-@@ -5543,6 +5700,9 @@ static const struct of_device_id qcom_qm
+@@ -5571,6 +5728,9 @@ static const struct of_device_id qcom_qm
  		.compatible = "qcom,ipq8074-qmp-pcie-phy",
  		.data = &ipq8074_pciephy_cfg,
  	}, {



From lede-commits at lists.infradead.org  Sat Feb 11 15:39:51 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 11 Feb 2023 18:39:51 -0500
Subject: [openwrt/openwrt]  openssl: bump to 1.1.1t
In-Reply-To: <167615879138.1909958.9365020652947538447@git-01.infra.openwrt.org>
References: <167615879138.1909958.9365020652947538447@git-01.infra.openwrt.org>
Message-ID: <mailman.14918.1676158797.3064139.lede-commits@lists.infradead.org>

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

commit 4ae86b3358a149a17411657b12103ccebfbdb11b
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Tue Feb 7 14:56:52 2023 -0500

    openssl: bump to 1.1.1t
    
    Removed upstreamed patch: 010-padlock.patch
    
    Changes between 1.1.1s and 1.1.1t [7 Feb 2023]
    
      *) Fixed X.400 address type confusion in X.509 GeneralName.
    
         There is a type confusion vulnerability relating to X.400 address processing
         inside an X.509 GeneralName. X.400 addresses were parsed as an ASN1_STRING
         but subsequently interpreted by GENERAL_NAME_cmp as an ASN1_TYPE. This
         vulnerability may allow an attacker who can provide a certificate chain and
         CRL (neither of which need have a valid signature) to pass arbitrary
         pointers to a memcmp call, creating a possible read primitive, subject to
         some constraints. Refer to the advisory for more information. Thanks to
         David Benjamin for discovering this issue. (CVE-2023-0286)
    
         This issue has been fixed by changing the public header file definition of
         GENERAL_NAME so that x400Address reflects the implementation. It was not
         possible for any existing application to successfully use the existing
         definition; however, if any application references the x400Address field
         (e.g. in dead code), note that the type of this field has changed. There is
         no ABI change.
         [Hugo Landau]
    
      *) Fixed Use-after-free following BIO_new_NDEF.
    
         The public API function BIO_new_NDEF is a helper function used for
         streaming ASN.1 data via a BIO. It is primarily used internally to OpenSSL
         to support the SMIME, CMS and PKCS7 streaming capabilities, but may also
         be called directly by end user applications.
    
         The function receives a BIO from the caller, prepends a new BIO_f_asn1
         filter BIO onto the front of it to form a BIO chain, and then returns
         the new head of the BIO chain to the caller. Under certain conditions,
         for example if a CMS recipient public key is invalid, the new filter BIO
         is freed and the function returns a NULL result indicating a failure.
         However, in this case, the BIO chain is not properly cleaned up and the
         BIO passed by the caller still retains internal pointers to the previously
         freed filter BIO. If the caller then goes on to call BIO_pop() on the BIO
         then a use-after-free will occur. This will most likely result in a crash.
         (CVE-2023-0215)
         [Viktor Dukhovni, Matt Caswell]
    
      *) Fixed Double free after calling PEM_read_bio_ex.
    
         The function PEM_read_bio_ex() reads a PEM file from a BIO and parses and
         decodes the "name" (e.g. "CERTIFICATE"), any header data and the payload
         data. If the function succeeds then the "name_out", "header" and "data"
         arguments are populated with pointers to buffers containing the relevant
         decoded data. The caller is responsible for freeing those buffers. It is
         possible to construct a PEM file that results in 0 bytes of payload data.
         In this case PEM_read_bio_ex() will return a failure code but will populate
         the header argument with a pointer to a buffer that has already been freed.
         If the caller also frees this buffer then a double free will occur. This
         will most likely lead to a crash.
    
         The functions PEM_read_bio() and PEM_read() are simple wrappers around
         PEM_read_bio_ex() and therefore these functions are also directly affected.
    
         These functions are also called indirectly by a number of other OpenSSL
         functions including PEM_X509_INFO_read_bio_ex() and
         SSL_CTX_use_serverinfo_file() which are also vulnerable. Some OpenSSL
         internal uses of these functions are not vulnerable because the caller does
         not free the header argument if PEM_read_bio_ex() returns a failure code.
         (CVE-2022-4450)
         [Kurt Roeckx, Matt Caswell]
    
      *) Fixed Timing Oracle in RSA Decryption.
    
         A timing based side channel exists in the OpenSSL RSA Decryption
         implementation which could be sufficient to recover a plaintext across
         a network in a Bleichenbacher style attack. To achieve a successful
         decryption an attacker would have to be able to send a very large number
         of trial messages for decryption. The vulnerability affects all RSA padding
         modes: PKCS#1 v1.5, RSA-OEAP and RSASVE.
         (CVE-2022-4304)
         [Dmitry Belyavsky, Hubert Kario]
    
    Signed-off-by: John Audia <therealgraysky at proton.me>
---
 package/libs/openssl/Makefile                  |  6 +--
 package/libs/openssl/patches/010-padlock.patch | 52 --------------------------
 2 files changed, 3 insertions(+), 55 deletions(-)

diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index d9b082979b..4883ef82ea 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -9,9 +9,9 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssl
 PKG_BASE:=1.1.1
-PKG_BUGFIX:=s
+PKG_BUGFIX:=t
 PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX)
-PKG_RELEASE:=$(AUTORELEASE)
+PKG_RELEASE:=1
 PKG_USE_MIPS16:=0
 
 PKG_BUILD_PARALLEL:=1
@@ -25,7 +25,7 @@ PKG_SOURCE_URL:= \
 	ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/ \
 	ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/old/$(PKG_BASE)/
 
-PKG_HASH:=c5ac01e760ee6ff0dab61d6b2bbd30146724d063eb322180c6f18a6f74e4b6aa
+PKG_HASH:=8dee9b24bdb1dcbf0c3d1e9b02fb8f6bf22165e807f45adeb7c9677536859d3b
 
 PKG_LICENSE:=OpenSSL
 PKG_LICENSE_FILES:=LICENSE
diff --git a/package/libs/openssl/patches/010-padlock.patch b/package/libs/openssl/patches/010-padlock.patch
deleted file mode 100644
index e859295cd6..0000000000
--- a/package/libs/openssl/patches/010-padlock.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From 2bcf8e69bd92e33d84c48e7d108d3d46b22f8a6d Mon Sep 17 00:00:00 2001
-From: ValdikSS <iam at valdikss.org.ru>
-Date: Wed, 18 Jan 2023 20:14:48 +0300
-Subject: [PATCH] Padlock: fix byte swapping assembly for AES-192 and 256
-
-Byte swapping code incorrectly uses the number of AES rounds to swap expanded
-AES key, while swapping only a single dword in a loop, resulting in swapped
-key and partially swapped expanded keys, breaking AES encryption and
-decryption on VIA Padlock hardware.
-
-This commit correctly sets the number of swapping loops to be done.
-
-Fixes #20073
-
-CLA: trivial
-
-Reviewed-by: Hugo Landau <hlandau at openssl.org>
-Reviewed-by: Tomas Mraz <tomas at openssl.org>
-(Merged from https://github.com/openssl/openssl/pull/20077)
-
-(cherry picked from commit 7331e7ef79fe4499d81cc92249e9c97e9ff9291a)
----
- engines/asm/e_padlock-x86.pl    | 2 ++
- engines/asm/e_padlock-x86_64.pl | 2 ++
- 2 files changed, 4 insertions(+)
-
-diff --git a/engines/asm/e_padlock-x86.pl b/engines/asm/e_padlock-x86.pl
-index 5b097ce3ef9b..07f7000fd38a 100644
---- a/engines/asm/e_padlock-x86.pl
-+++ b/engines/asm/e_padlock-x86.pl
-@@ -116,6 +116,8 @@
- &function_begin_B("padlock_key_bswap");
- 	&mov	("edx",&wparam(0));
- 	&mov	("ecx",&DWP(240,"edx"));
-+	&inc	("ecx");
-+	&shl	("ecx",2);
- &set_label("bswap_loop");
- 	&mov	("eax",&DWP(0,"edx"));
- 	&bswap	("eax");
-diff --git a/engines/asm/e_padlock-x86_64.pl b/engines/asm/e_padlock-x86_64.pl
-index 09b0aaa48dfe..dfd2ae656375 100644
---- a/engines/asm/e_padlock-x86_64.pl
-+++ b/engines/asm/e_padlock-x86_64.pl
-@@ -92,6 +92,8 @@
- .align	16
- padlock_key_bswap:
- 	mov	240($arg1),%edx
-+	inc	%edx
-+	shl	\$2,%edx
- .Lbswap_loop:
- 	mov	($arg1),%eax
- 	bswap	%eax



From lede-commits at lists.infradead.org  Sat Feb 11 16:03:10 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 11 Feb 2023 19:03:10 -0500
Subject: [openwrt/openwrt]  Revert "tools/fakeroot: update to 1.30.1"
In-Reply-To: <167616019017.1922380.9284056900143838877@git-01.infra.openwrt.org>
References: <167616019017.1922380.9284056900143838877@git-01.infra.openwrt.org>
Message-ID: <mailman.14921.1676160196.3064139.lede-commits@lists.infradead.org>

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

commit eeba2a67caa2b9b92ffb9d756089408643971a2e
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Thu Jan 19 23:34:05 2023 -0500

    Revert "tools/fakeroot: update to 1.30.1"
    
    This reverts commit 52167feff8ae3fbd02be22dfe6021e7e9c79c599.
    
    Fakeroot 1.30.1 broke building on certain hosts (32-bit archs).
    
    As of 2023-01-10, this was apparently fixed in source code,
    however, the version is still 1.30.1 (patch release),
    so the old binaries are removed from the repository and replaced,
    but the source provided by the repository remains the same.
    
    Furthermore, there are some complicated issues blocking
    the "testing" release from being bumped to a 1.30.x version.
    
    Considering all of this, it would likely be better for this package
    to follow the "testing" release instead of the "unstable" release,
    which is still 1.29-1, so revert to that.
    
    Link: https://bugs.debian.org/1023286
    Link: https://tracker.debian.org/news/1407613/accepted-fakeroot-1301-11-source-into-unstable/
    Link: https://qa.debian.org/excuses.php?package=fakeroot
    Link: https://bugs.debian.org/1027803
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 tools/fakeroot/Makefile                | 4 ++--
 tools/fakeroot/patches/600-macOS.patch | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/fakeroot/Makefile b/tools/fakeroot/Makefile
index 66ccbcb50d..efd9227d1a 100644
--- a/tools/fakeroot/Makefile
+++ b/tools/fakeroot/Makefile
@@ -5,12 +5,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=fakeroot
-PKG_VERSION:=1.30.1
+PKG_VERSION:=1.29
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
 PKG_SOURCE_URL:=@DEBIAN/pool/main/f/fakeroot
-PKG_HASH:=32ebb1f421aca0db7141c32a8c104eb95d2b45c393058b9435fbf903dd2b6a75
+PKG_HASH:=8fbbafb780c9173e3ace4a04afbc1d900f337f3216883939f5c7db3431be7c20
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_LICENSE_FILES:=COPYING
 PKG_FIXUP:=autoreconf
diff --git a/tools/fakeroot/patches/600-macOS.patch b/tools/fakeroot/patches/600-macOS.patch
index 5cfcc81284..730367f07c 100644
--- a/tools/fakeroot/patches/600-macOS.patch
+++ b/tools/fakeroot/patches/600-macOS.patch
@@ -24,7 +24,7 @@
  #include <spawn.h>
 --- a/wrapfunc.inp
 +++ b/wrapfunc.inp
-@@ -50,9 +50,11 @@ getattrlist$UNIX2003;int;(const char *pa
+@@ -48,9 +48,11 @@ getattrlist$UNIX2003;int;(const char *pa
  #endif
  #endif
  #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5
@@ -36,7 +36,7 @@
  posix_spawn;int;(pid_t * __restrict pid, const char * __restrict path, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t * __restrict attrp, char *const argv[ __restrict], char *const envp[ __restrict]);(pid, path, file_actions, attrp, argv, envp)
  posix_spawnp;int;(pid_t * __restrict pid, const char * __restrict path, const posix_spawn_file_actions_t *file_actions, const posix_spawnattr_t * __restrict attrp, char *const argv[ __restrict], char *const envp[ __restrict]);(pid, path, file_actions, attrp, argv, envp)
  #endif
-@@ -231,7 +233,7 @@ facl;int;(int fd, int cmd, int cnt, void
+@@ -229,7 +231,7 @@ facl;int;(int fd, int cmd, int cnt, void
  #ifdef HAVE_FTS_READ
  fts_read;FTSENT *;(FTS *ftsp);(ftsp)
  #ifdef __APPLE__
@@ -45,7 +45,7 @@
  fts_read$INODE64;FTSENT *;(FTS *ftsp);(ftsp)
  #endif
  #endif /* ifdef __APPLE__ */
-@@ -239,7 +241,7 @@ fts_read$INODE64;FTSENT *;(FTS *ftsp);(f
+@@ -237,7 +239,7 @@ fts_read$INODE64;FTSENT *;(FTS *ftsp);(f
  #ifdef HAVE_FTS_CHILDREN
  fts_children;FTSENT *;(FTS *ftsp, int options);(ftsp, options)
  #ifdef __APPLE__



From lede-commits at lists.infradead.org  Sun Feb 12 05:56:33 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 12 Feb 2023 08:56:33 -0500
Subject: [openwrt/openwrt]  toolchain: wrapper.sh: fix TOOLCHAIN_SYSROOT path
In-Reply-To: <167621019380.2488278.14126652756830093110@git-01.infra.openwrt.org>
References: <167621019380.2488278.14126652756830093110@git-01.infra.openwrt.org>
Message-ID: <mailman.14954.1676210200.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/9a49e257d638b2bb84e050e26942f496c14fa6f5

commit 9a49e257d638b2bb84e050e26942f496c14fa6f5
Author: Eneas U de Queiroz <cotequeiroz at gmail.com>
AuthorDate: Fri Feb 10 12:02:06 2023 -0300

    toolchain: wrapper.sh: fix TOOLCHAIN_SYSROOT path
    
    62c1740676 changed the location of the script from $(TOOLCHAIN_DIR)/usr
    to $(TOOLCHAIN_DIR), but the TOOLCHAIN_SYSROOT used in wrapper.sh was
    still expecting to find the script under usr/bin.
    
    Fixes: 62c1740676 toolchain: fix the sysroot mess by getting...
    Signed-off-by: Eneas U de Queiroz <cotequeiroz at gmail.com>
---
 target/toolchain/files/wrapper.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/toolchain/files/wrapper.sh b/target/toolchain/files/wrapper.sh
index 6a0cdfff6c..0b06343f09 100755
--- a/target/toolchain/files/wrapper.sh
+++ b/target/toolchain/files/wrapper.sh
@@ -46,7 +46,7 @@ TOOLCHAIN_BIN_DIR="$REALNAME_DIR/"
 export PATH="$TOOLCHAIN_BIN_DIR":$PATH
 export GCC_HONOUR_COPTS
 
-TOOLCHAIN_SYSROOT="$TOOLCHAIN_BIN_DIR/../.."
+TOOLCHAIN_SYSROOT="$TOOLCHAIN_BIN_DIR/.."
 if [ ! -d "$TOOLCHAIN_SYSROOT" ]; then
 	echo "Error: Unable to determine sysroot (looking for $TOOLCHAIN_SYSROOT)!" >&2
 	exit 1



From lede-commits at lists.infradead.org  Sun Feb 12 05:56:34 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 12 Feb 2023 08:56:34 -0500
Subject: [openwrt/openwrt]  toolchain: wrapper.sh: use --rpath-link
In-Reply-To: <167621019380.2488278.14126652756830093110@git-01.infra.openwrt.org>
References: <167621019380.2488278.14126652756830093110@git-01.infra.openwrt.org>
Message-ID: <mailman.14955.1676210201.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/ed81acdcc2057be8eb0ec5d6d021f3df27999876

commit ed81acdcc2057be8eb0ec5d6d021f3df27999876
Author: Eneas U de Queiroz <cotequeiroz at gmail.com>
AuthorDate: Fri Feb 10 12:02:06 2023 -0300

    toolchain: wrapper.sh: use --rpath-link
    
    Use --rpath-link option instead of --rpath.  The former is used only at
    link-time, while the latter is searched at run-time as well.
    
    Signed-off-by: Eneas U de Queiroz <cotequeiroz at gmail.com>
---
 target/toolchain/files/wrapper.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/toolchain/files/wrapper.sh b/target/toolchain/files/wrapper.sh
index 0b06343f09..4b3f8f911a 100755
--- a/target/toolchain/files/wrapper.sh
+++ b/target/toolchain/files/wrapper.sh
@@ -57,8 +57,8 @@ fi
 
 case $TOOLCHAIN_PLATFORM in
 	gnu|glibc|uclibc|musl)
-		GCC_SYSROOT_FLAGS="--sysroot=$TOOLCHAIN_SYSROOT -Wl,-rpath=$TOOLCHAIN_SYSROOT/lib:$TOOLCHAIN_SYSROOT/usr/lib"
-		LD_SYSROOT_FLAGS="-rpath=$TOOLCHAIN_SYSROOT/lib:$TOOLCHAIN_SYSROOT/usr/lib"
+		GCC_SYSROOT_FLAGS="--sysroot=$TOOLCHAIN_SYSROOT -Wl,-rpath-link=$TOOLCHAIN_SYSROOT/lib:$TOOLCHAIN_SYSROOT/usr/lib"
+		LD_SYSROOT_FLAGS="-rpath-link=$TOOLCHAIN_SYSROOT/lib:$TOOLCHAIN_SYSROOT/usr/lib"
 		;;
 	*)
 		GCC_SYSROOT_FLAGS=""



From lede-commits at lists.infradead.org  Sun Feb 12 07:46:13 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 12 Feb 2023 10:46:13 -0500
Subject: [openwrt/openwrt]  tools/e2fsprogs: update to 1.47.0
In-Reply-To: <167621677328.2556824.7398656779724283143@git-01.infra.openwrt.org>
References: <167621677328.2556824.7398656779724283143@git-01.infra.openwrt.org>
Message-ID: <mailman.14967.1676216783.3064139.lede-commits@lists.infradead.org>

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

commit 11591752ac54436ca083647c4989eb82a886ba7d
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Sat Feb 11 15:22:41 2023 +0100

    tools/e2fsprogs: update to 1.47.0
    
    Release notes:
    https://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.47.0
    
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 tools/e2fsprogs/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/e2fsprogs/Makefile b/tools/e2fsprogs/Makefile
index 1c72611df7..0aa85af3f1 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.46.6
-PKG_HASH:=a77517f19ff5e4e97ede63536566865dd5d48654e13fc145f5f2249ef7c4f4fc
+PKG_VERSION:=1.47.0
+PKG_HASH:=144af53f2bbd921cef6f8bea88bb9faddca865da3fbc657cc9b4d2001097d5db
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz



From lede-commits at lists.infradead.org  Sun Feb 12 09:20:46 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 12 Feb 2023 12:20:46 -0500
Subject: [openwrt/openwrt]  ath79: add eth0 mac and initvals for Engenius
 EPG5000
In-Reply-To: <167622244167.2619552.1429469741531199163@git-01.infra.openwrt.org>
References: <167622244167.2619552.1429469741531199163@git-01.infra.openwrt.org>
Message-ID: <mailman.14985.1676222450.3064139.lede-commits@lists.infradead.org>

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

commit 5e973dd61f15a1d21dd1614780775114b28ed0b5
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Tue Jan 31 13:58:38 2023 -0500

    ath79: add eth0 mac and initvals for Engenius EPG5000
    
    Although VLANs are used, the "eth0" device by itself
    does not have a valid MAC, so fix that with preinit script.
    
    More initvals added by editing the driver to print switch registers,
    after the bootloader sets them but before openwrt changes them.
    
    The register bits needed for the QCA8337 switch
    can be read from interrupted boot (tftpboot, bootm)
    by adding print lines in the switch driver ar8327.c
    before 'qca,ar8327-initvals' is parsed from DTS and written
    for example:
    
      pr_info("0x04 %08x\n", ar8xxx_read(priv, AR8327_REG_PAD0_MODE));
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 target/linux/ath79/dts/qca9558_engenius_epg5000.dts              | 9 ++++++++-
 .../linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh | 1 +
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/target/linux/ath79/dts/qca9558_engenius_epg5000.dts b/target/linux/ath79/dts/qca9558_engenius_epg5000.dts
index ee0b36d6de..36aba0714e 100644
--- a/target/linux/ath79/dts/qca9558_engenius_epg5000.dts
+++ b/target/linux/ath79/dts/qca9558_engenius_epg5000.dts
@@ -47,8 +47,15 @@
 };
 
 &phy0 {
+	qca,mib-poll-interval = <500>;
+
 	qca,ar8327-initvals = <
-		0x04 0x87600000 /* PORT0 PAD MODE CTRL */
+		0x04 0x87680000 /* PORT0 PAD MODE CTRL */
+		0x10 0x40000000 /* POWER_ON_STRAP */
+		0x50 0xcf35cf35 /* LED_CTRL0 */
+		0x54 0xcf35cf35 /* LED_CTRL1 */
+		0x58 0xcf35cf35 /* LED_CTRL2 */
+		0x5c 0x03ffff00 /* LED_CTRL3 */
 		0x7c 0x0000007e /* PORT0_STATUS */
 	>;
 };
diff --git a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh
index def4417fbc..5fa23e8eb6 100644
--- a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh
+++ b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh
@@ -12,6 +12,7 @@ preinit_set_mac_address() {
 		ip link set dev eth0 address $(mtd_get_mac_ascii bdcfg "lanmac")
 		ip link set dev eth1 address $(mtd_get_mac_ascii bdcfg "wanmac")
 		;;
+	engenius,epg5000|\
 	engenius,esr1200|\
 	engenius,esr1750|\
 	engenius,esr900)



From lede-commits at lists.infradead.org  Sun Feb 12 09:20:41 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 12 Feb 2023 12:20:41 -0500
Subject: [openwrt/openwrt]  ath79: split Engenius EPG5000 DTS to common DTSI
In-Reply-To: <167622244167.2619552.1429469741531199163@git-01.infra.openwrt.org>
References: <167622244167.2619552.1429469741531199163@git-01.infra.openwrt.org>
Message-ID: <mailman.14986.1676222450.3064139.lede-commits@lists.infradead.org>

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

commit 2742705fa531cdccadafe2a9088bb3b33e568f97
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Sat Jan 21 13:45:26 2023 -0500

    ath79: split Engenius EPG5000 DTS to common DTSI
    
    Split the DTS to be used with similar boards made by Senao,
    dual-band routers with Atheros / Qualcomm ethernet switch.
    
    Set initvals for the switch in each device's DTS.
    Set some common calibration nvmem-cells in DTSI.
    
    While at it, fix MTD partition node names.
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 .../linux/ath79/dts/qca9558_engenius_epg5000.dts   | 114 ++-------------------
 ..._epg5000.dts => qca955x_senao_router-dual.dtsi} |  80 +++------------
 2 files changed, 23 insertions(+), 171 deletions(-)

diff --git a/target/linux/ath79/dts/qca9558_engenius_epg5000.dts b/target/linux/ath79/dts/qca9558_engenius_epg5000.dts
index 35716152ad..37ad32f330 100644
--- a/target/linux/ath79/dts/qca9558_engenius_epg5000.dts
+++ b/target/linux/ath79/dts/qca9558_engenius_epg5000.dts
@@ -1,9 +1,6 @@
 // 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>
+#include "qca955x_senao_router-dual.dtsi"
 
 / {
 	model = "EnGenius EPG5000";
@@ -47,110 +44,13 @@
 			gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
 		};
 	};
-
-	keys {
-		compatible = "gpio-keys";
-
-		reset {
-			label = "reset";
-			linux,code = <KEY_RESTART>;
-			gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
-			debounce-interval = <60>;
-		};
-
-		wps {
-			label = "wps";
-			linux,code = <KEY_WPS_BUTTON>;
-			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
-			debounce-interval = <60>;
-		};
-	};
-};
-
-&eth0 {
-	status = "okay";
-
-	phy-handle = <&phy0>;
-	pll-data = <0xa6000000 0x00000101 0x00001616>;
-};
-
-&mdio0 {
-	status = "okay";
-
-	phy0: ethernet-phy at 0 {
-		reg = <0>;
-
-		qca,ar8327-initvals = <
-			0x04 0x87600000 /* PORT0 PAD MODE CTRL */
-			0x7c 0x0000007e /* PORT0_STATUS */
-			>;
-	};
-};
-
-&pcie0 {
-	status = "okay";
-
-	wifi at 0,0 {
-		compatible = "pci168c,003c";
-		reg = <0x0000 0 0 0 0>;
-	};
 };
 
-&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 0x030000>;
-				read-only;
-			};
-
-			partition at 30000 {
-				label = "u-boot-env";
-				reg = <0x030000 0x010000>;
-			};
-
-			partition at 40000 {
-				compatible = "denx,uimage";
-				label = "firmware";
-				reg = <0x040000 0xe50000>;
-			};
-
-			partition at 790000 {
-				label = "manufacture";
-				reg = <0xe90000 0x100000>;
-				read-only;
-			};
-
-			partition at ed0000 {
-				label = "backup";
-				reg = <0xf90000 0x010000>;
-				read-only;
-			};
-
-			partition at fe0000 {
-				label = "storage";
-				reg = <0xfa0000 0x050000>;
-				read-only;
-			};
-
-			partition at ff0000 {
-				label = "art";
-				reg = <0xff0000 0x010000>;
-				read-only;
-			};
-		};
-	};
+&phy0 {
+	qca,ar8327-initvals = <
+		0x04 0x87600000 /* PORT0 PAD MODE CTRL */
+		0x7c 0x0000007e /* PORT0_STATUS */
+	>;
 };
 
 &usb_phy1 {
@@ -162,7 +62,5 @@
 };
 
 &wmac {
-	status = "okay";
-
 	qca,no-eeprom;
 };
diff --git a/target/linux/ath79/dts/qca9558_engenius_epg5000.dts b/target/linux/ath79/dts/qca955x_senao_router-dual.dtsi
similarity index 58%
copy from target/linux/ath79/dts/qca9558_engenius_epg5000.dts
copy to target/linux/ath79/dts/qca955x_senao_router-dual.dtsi
index 35716152ad..20bea91e8d 100644
--- a/target/linux/ath79/dts/qca9558_engenius_epg5000.dts
+++ b/target/linux/ath79/dts/qca955x_senao_router-dual.dtsi
@@ -6,48 +6,6 @@
 #include <dt-bindings/input/input.h>
 
 / {
-	model = "EnGenius EPG5000";
-	compatible = "engenius,epg5000", "qca,qca9558";
-
-	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 = "amber:power";
-			gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
-			default-state = "on";
-		};
-
-		wlan2g {
-			label = "blue:wlan2g";
-			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
-			linux,default-trigger = "phy1tpt";
-		};
-
-		wlan5g {
-			label = "blue:wlan5g";
-			gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
-			linux,default-trigger = "phy0tpt";
-		};
-
-		wps_amber {
-			label = "amber:wps";
-			gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
-		};
-
-		wps_blue {
-			label = "blue:wps";
-			gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
-		};
-	};
-
 	keys {
 		compatible = "gpio-keys";
 
@@ -79,19 +37,14 @@
 
 	phy0: ethernet-phy at 0 {
 		reg = <0>;
-
-		qca,ar8327-initvals = <
-			0x04 0x87600000 /* PORT0 PAD MODE CTRL */
-			0x7c 0x0000007e /* PORT0_STATUS */
-			>;
 	};
 };
 
 &pcie0 {
 	status = "okay";
 
-	wifi at 0,0 {
-		compatible = "pci168c,003c";
+	ath10k_0: wifi at 0,0,0 {
+		compatible = "qcom,ath10k";
 		reg = <0x0000 0 0 0 0>;
 	};
 };
@@ -118,6 +71,7 @@
 			partition at 30000 {
 				label = "u-boot-env";
 				reg = <0x030000 0x010000>;
+				read-only;
 			};
 
 			partition at 40000 {
@@ -126,43 +80,43 @@
 				reg = <0x040000 0xe50000>;
 			};
 
-			partition at 790000 {
+			partition at e90000 {
 				label = "manufacture";
 				reg = <0xe90000 0x100000>;
 				read-only;
 			};
 
-			partition at ed0000 {
+			partition at f90000 {
 				label = "backup";
 				reg = <0xf90000 0x010000>;
 				read-only;
 			};
 
-			partition at fe0000 {
+			partition at fa0000 {
 				label = "storage";
 				reg = <0xfa0000 0x050000>;
 				read-only;
 			};
 
-			partition at ff0000 {
+			art: partition at ff0000 {
 				label = "art";
 				reg = <0xff0000 0x010000>;
 				read-only;
+
+				compatible = "nvmem-cells";
+
+				calibration_art_1000: calibration at 1000 {
+					reg = <0x1000 0x440>;
+				};
+
+				calibration_art_5000: calibration at 5000 {
+					reg = <0x5000 0x844>;
+				};
 			};
 		};
 	};
 };
 
-&usb_phy1 {
-	status = "okay";
-};
-
-&usb1 {
-	status = "okay";
-};
-
 &wmac {
 	status = "okay";
-
-	qca,no-eeprom;
 };



From lede-commits at lists.infradead.org  Sun Feb 12 09:20:47 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 12 Feb 2023 12:20:47 -0500
Subject: [openwrt/openwrt]  ath79: bump SPI frequency of Senao qca955x routers
In-Reply-To: <167622244167.2619552.1429469741531199163@git-01.infra.openwrt.org>
References: <167622244167.2619552.1429469741531199163@git-01.infra.openwrt.org>
Message-ID: <mailman.14987.1676222452.3064139.lede-commits@lists.infradead.org>

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

commit 51982560a924bd9fe799d69d34013668bb2f694d
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Sat Jan 21 14:13:54 2023 -0500

    ath79: bump SPI frequency of Senao qca955x routers
    
    All boards using this DTSI are expected to have
    the same 16 MB MX25L12845EMI-10G flash chip,
    or a larger one which can also use 40 MHz frequency.
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 target/linux/ath79/dts/qca955x_senao_router-dual.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ath79/dts/qca955x_senao_router-dual.dtsi b/target/linux/ath79/dts/qca955x_senao_router-dual.dtsi
index 20bea91e8d..e1b76bcbd1 100644
--- a/target/linux/ath79/dts/qca955x_senao_router-dual.dtsi
+++ b/target/linux/ath79/dts/qca955x_senao_router-dual.dtsi
@@ -55,7 +55,7 @@
 	flash at 0 {
 		compatible = "jedec,spi-nor";
 		reg = <0>;
-		spi-max-frequency = <25000000>;
+		spi-max-frequency = <40000000>;
 
 		partitions {
 			compatible = "fixed-partitions";



From lede-commits at lists.infradead.org  Sun Feb 12 09:20:45 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 12 Feb 2023 12:20:45 -0500
Subject: [openwrt/openwrt]  ath79: convert Engenius EPG5000 radios to
 nvmem-cells
In-Reply-To: <167622244167.2619552.1429469741531199163@git-01.infra.openwrt.org>
References: <167622244167.2619552.1429469741531199163@git-01.infra.openwrt.org>
Message-ID: <mailman.14990.1676222452.3064139.lede-commits@lists.infradead.org>

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

commit f545caf00194d31f8896c729213e13859547f994
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Tue Jan 31 12:54:14 2023 -0500

    ath79: convert Engenius EPG5000 radios to nvmem-cells
    
    Use nvmem kernel subsystem to pull radio calibration data
    with the devicetree instead of userspace scripts.
    
    Existing blocks for caldata_extract are reordered alphabetically.
    
    MAC address is set using the hotplug script.
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 target/linux/ath79/dts/qca9558_engenius_epg5000.dts     |  8 +++++++-
 .../base-files/etc/hotplug.d/firmware/10-ath9k-eeprom   | 17 ++++++++---------
 .../base-files/etc/hotplug.d/firmware/11-ath10k-caldata | 15 +++++++--------
 .../base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac  |  1 +
 4 files changed, 23 insertions(+), 18 deletions(-)

diff --git a/target/linux/ath79/dts/qca9558_engenius_epg5000.dts b/target/linux/ath79/dts/qca9558_engenius_epg5000.dts
index 37ad32f330..ee0b36d6de 100644
--- a/target/linux/ath79/dts/qca9558_engenius_epg5000.dts
+++ b/target/linux/ath79/dts/qca9558_engenius_epg5000.dts
@@ -62,5 +62,11 @@
 };
 
 &wmac {
-	qca,no-eeprom;
+	nvmem-cells = <&calibration_art_1000>;
+	nvmem-cell-names = "calibration";
+};
+
+&ath10k_0 {
+	nvmem-cells = <&calibration_art_5000>;
+	nvmem-cell-names = "calibration";
 };
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
index 14c8eb7d64..9827508c04 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
@@ -43,7 +43,14 @@ case "$FIRMWARE" in
 		caldata_extract "art" 0x1000 0x440
 		ath9k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env athaddr) 1)
 		;;
-	engenius,epg5000|\
+	enterasys,ws-ap3705i)
+		caldata_extract "calibrate" 0x1000 0x440
+		ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR1)
+		;;
+	extreme-networks,ws-ap3805i)
+		caldata_extract "art" 0x1000 0x440
+		ath9k_patch_mac $(mtd_get_mac_ascii cfg1 RADIOADDR1)
+		;;
 	iodata,wn-ac1167dgr|\
 	iodata,wn-ac1600dgr|\
 	iodata,wn-ac1600dgr2|\
@@ -53,14 +60,6 @@ case "$FIRMWARE" in
 		caldata_extract "art" 0x1000 0x440
 		ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env ethaddr)
 		;;
-	enterasys,ws-ap3705i)
-		caldata_extract "calibrate" 0x1000 0x440
-		ath9k_patch_mac $(mtd_get_mac_ascii u-boot-env0 RADIOADDR1)
-		;;
-	extreme-networks,ws-ap3805i)
-		caldata_extract "art" 0x1000 0x440
-		ath9k_patch_mac $(mtd_get_mac_ascii cfg1 RADIOADDR1)
-		;;
 	nec,wg800hp)
 		caldata_extract "art" 0x1000 0x440
 		ath9k_patch_mac $(mtd_get_mac_text board_data 0x680)
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 b0b91f1c8a..4db311fde0 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
@@ -77,14 +77,6 @@ case "$FIRMWARE" in
 		caldata_extract "art" 0x5000 0x844
 		ath10k_patch_mac $(mtd_get_mac_ascii u-boot-env athaddr)
 		;;
-	engenius,epg5000|\
-	iodata,wn-ac1167dgr|\
-	iodata,wn-ac1600dgr2|\
-	sitecom,wlr-7100|\
-	zyxel,nbg6616)
-		caldata_extract "art" 0x5000 0x844
-		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)
@@ -97,6 +89,13 @@ case "$FIRMWARE" in
 		caldata_extract "art" 0x5000 0x844
 		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary art 0x0) 1)
 		;;
+	iodata,wn-ac1167dgr|\
+	iodata,wn-ac1600dgr2|\
+	sitecom,wlr-7100|\
+	zyxel,nbg6616)
+		caldata_extract "art" 0x5000 0x844
+		ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) 1)
+		;;
 	nec,wg800hp)
 		caldata_extract "art" 0x5000 0x844
 		ath10k_patch_mac $(mtd_get_mac_text board_data 0x880)
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index f4df2c4edb..5d74208a5d 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -35,6 +35,7 @@ case "$board" in
 		[ "$PHYNBR" -eq 1 ] && \
 			mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress
 		;;
+	engenius,epg5000|\
 	engenius,esr1200|\
 	engenius,esr1750|\
 	engenius,esr900)



From lede-commits at lists.infradead.org  Sun Feb 12 09:20:44 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 12 Feb 2023 12:20:44 -0500
Subject: [openwrt/openwrt]  ath79: add support for Senao Engenius ESR1200
In-Reply-To: <167622244167.2619552.1429469741531199163@git-01.infra.openwrt.org>
References: <167622244167.2619552.1429469741531199163@git-01.infra.openwrt.org>
Message-ID: <mailman.14991.1676222452.3064139.lede-commits@lists.infradead.org>

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

commit f9c28222c830fbd6abff7251c5760226be999181
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Wed Jan 25 11:24:00 2023 -0500

    ath79: add support for Senao Engenius ESR1200
    
    FCC ID: A8J-ESR900
    
    Engenius ESR1200 is an indoor wireless router with
    a gigabit ethernet switch, dual-band wireless,
    internal antenna plates, and a USB 2.0 port
    
    **Specification:**
    
      - QCA9557 SOC         2.4 GHz, 2x2
      - QCA9882 WLAN        PCIe mini card, 5 GHz, 2x2
      - QCA8337N SW         4 ports LAN, 1 port WAN
      - 40 MHz clock
      - 16 MB FLASH         MX25L12845EMI-10G
      - 2x 64 MB RAM
      - UART at J1          populated, RX grounded
      - 6 internal antenna plates (omni-directional)
      - 5 LEDs, 1 button (power, 2G, 5G, WAN, WPS) (reset)
    
    **MAC addresses:**
    
      Base MAC address labeled as "MAC ADDRESS"
      MAC "wanaddr" is not similar to "ethaddr"
    
      eth0 *:c8 MAC u-boot-env ethaddr
      phy0 *:c8 MAC u-boot-env ethaddr
      phy1 *:c9 --- u-boot-env ethaddr +1
      WAN  *:66:44  u-boot-env wanaddr
    
    **Serial Access:**
    
      RX on the board for UART is shorted to ground by resistor R176
      therefore it must be removed to use the console
      but it is not necessary to remove to view boot log
    
      optionally, R175 can be replaced with a solder bridge short
    
      the resistors R175 and R176 are next to the UART RX pin
    
    **Installation:**
    
      Method 1: Firmware upgrade page
    
        OEM webpage at 192.168.0.1
        username and password "admin"
        Navigate to Settings (gear icon) --> Tools --> Firmware
        select the factory.bin image
        confirm and wait 3 minutes
    
      Method 2: TFTP recovery
    
        Follow TFTP instructions using initramfs.bin
        use sysupgrade.bin to flash using openwrt web interface
    
    **Return to OEM:**
    
      MTD partitions should be backed up before flashing
      using TFTP to boot openwrt without overwriting flash
    
      Alternatively, it is possible to edit OEM firmware images
      to flash MTD partitions in openwrt to restore OEM firmware
      by removing the OEM header and writing the rest to "firmware"
    
    **TFTP recovery:**
    
      Requires serial console, reset button does nothing at boot
    
      rename initramfs.bin to 'uImageESR1200'
      make available on TFTP server at 192.168.99.8
      power board, interrupt boot by pressing '4' rapidly
      execute tftpboot and bootm
    
    **Note on ETH switch registers**
    
      Registers must be written to the ethernet switch
      in order to set up the switch's MAC interface.
      U-boot can write the registers on it's own
      which is needed, for example, in a TFTP transfer.
    
      The register bits from OEM for the QCA8337 switch
      can be read from interrupted boot (tftpboot, bootm)
      by adding print lines in the switch driver ar8327.c
      before 'qca,ar8327-initvals' is parsed from DTS and written.
      for example:
    
        pr_info("0x04 %08x\n", ar8xxx_read(priv, AR8327_REG_PAD0_MODE));
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 .../linux/ath79/dts/qca9557_engenius_esr1200.dts   | 79 ++++++++++++++++++++++
 .../generic/base-files/etc/board.d/02_network      |  2 +
 .../etc/hotplug.d/ieee80211/10_fix_wifi_mac        |  1 +
 .../base-files/lib/preinit/10_fix_eth_mac.sh       |  1 +
 target/linux/ath79/image/generic.mk                | 14 ++++
 5 files changed, 97 insertions(+)

diff --git a/target/linux/ath79/dts/qca9557_engenius_esr1200.dts b/target/linux/ath79/dts/qca9557_engenius_esr1200.dts
new file mode 100644
index 0000000000..a70dc4739d
--- /dev/null
+++ b/target/linux/ath79/dts/qca9557_engenius_esr1200.dts
@@ -0,0 +1,79 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qca955x_senao_router-dual.dtsi"
+
+/ {
+	compatible = "engenius,esr1200", "qca,qca9557";
+	model = "EnGenius ESR1200";
+
+	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 = "amber:power";
+			gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
+			default-state = "on";
+		};
+
+		wlan2g {
+			label = "blue:wlan2g";
+			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy1tpt";
+		};
+
+		wlan5g {
+			label = "blue:wlan5g";
+			gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy0tpt";
+		};
+
+		wps_amber {
+			label = "amber:wps";
+			gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
+		};
+
+		wps_blue {
+			label = "blue:wps";
+			gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&phy0 {
+	qca,mib-poll-interval = <500>;
+
+	qca,ar8327-initvals = <
+		0x04 0x87680000 /* PORT0 PAD MODE CTRL */
+		0x10 0x40000000 /* POWER_ON_STRAP */
+		0x50 0xcf35cf35 /* LED_CTRL0 */
+		0x54 0xcf35cf35 /* LED_CTRL1 */
+		0x58 0xcf35cf35 /* LED_CTRL2 */
+		0x5c 0x03ffff00 /* LED_CTRL3 */
+		0x7c 0x0000007e /* PORT0_STATUS */
+	>;
+};
+
+&usb_phy1 {
+	status = "okay";
+};
+
+&usb1 {
+	status = "okay";
+};
+
+&wmac {
+	nvmem-cells = <&calibration_art_1000>;
+	nvmem-cell-names = "calibration";
+};
+
+&ath10k_0 {
+	nvmem-cells = <&calibration_art_5000>;
+	nvmem-cell-names = "calibration";
+};
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
index fbdd8c493e..b20a3c13f8 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
@@ -287,6 +287,7 @@ ath79_setup_interfaces()
 	dlink,dir-842-c3|\
 	dlink,dir-859-a1|\
 	engenius,epg5000|\
+	engenius,esr1200|\
 	engenius,esr1750|\
 	engenius,esr900|\
 	sitecom,wlr-7100|\
@@ -668,6 +669,7 @@ ath79_setup_macs()
 		label_mac=$lan_mac
 		;;
 	engenius,epg5000|\
+	engenius,esr1200|\
 	engenius,esr1750|\
 	engenius,esr900)
 		lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index 1290c8b5fd..f4df2c4edb 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -35,6 +35,7 @@ case "$board" in
 		[ "$PHYNBR" -eq 1 ] && \
 			mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress
 		;;
+	engenius,esr1200|\
 	engenius,esr1750|\
 	engenius,esr900)
 		macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" "$PHYNBR" > /sys${DEVPATH}/macaddress
diff --git a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh
index b98b047c93..def4417fbc 100644
--- a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh
+++ b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh
@@ -12,6 +12,7 @@ preinit_set_mac_address() {
 		ip link set dev eth0 address $(mtd_get_mac_ascii bdcfg "lanmac")
 		ip link set dev eth1 address $(mtd_get_mac_ascii bdcfg "wanmac")
 		;;
+	engenius,esr1200|\
 	engenius,esr1750|\
 	engenius,esr900)
 		ip link set dev eth0 address $(mtd_get_mac_ascii u-boot-env ethaddr)
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 6212fc602e..be7481a384 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -1299,6 +1299,20 @@ define Device/engenius_epg5000
 endef
 TARGET_DEVICES += engenius_epg5000
 
+define Device/engenius_esr1200
+  SOC := qca9557
+  DEVICE_VENDOR := EnGenius
+  DEVICE_MODEL := ESR1200
+  DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct kmod-usb2
+  IMAGE_SIZE := 14656k
+  IMAGES += factory.dlf
+  IMAGE/factory.dlf := append-kernel | pad-to $$$$(BLOCKSIZE) | \
+	append-rootfs | pad-rootfs | check-size | \
+	senao-header -r 0x101 -p 0x61 -t 2
+  SUPPORTED_DEVICES += esr1200 esr1750 engenius,esr1750
+endef
+TARGET_DEVICES += engenius_esr1200
+
 define Device/engenius_esr1750
   SOC := qca9558
   DEVICE_VENDOR := EnGenius



From lede-commits at lists.infradead.org  Sun Feb 12 09:20:43 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 12 Feb 2023 12:20:43 -0500
Subject: [openwrt/openwrt]  ath79: add support for Senao Engenius ESR1750
In-Reply-To: <167622244167.2619552.1429469741531199163@git-01.infra.openwrt.org>
References: <167622244167.2619552.1429469741531199163@git-01.infra.openwrt.org>
Message-ID: <mailman.14992.1676222452.3064139.lede-commits@lists.infradead.org>

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

commit 96c2119dbaf3cc137d963c00035386934b7ed6e8
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Sun Jan 22 03:21:53 2023 -0500

    ath79: add support for Senao Engenius ESR1750
    
    FCC ID: A8J-ESR1750
    
    Engenius ESR1750 is an indoor wireless router with
    a gigabit ethernet switch, dual-band wireless,
    internal antenna plates, and a USB 2.0 port
    
    **Specification:**
    
      - QCA9558 SOC         2.4 GHz, 3x3
      - QCA9880 WLAN        PCIe mini card, 5 GHz, 3x3
      - QCA8337N SW         4 ports LAN, 1 port WAN
      - 40 MHz clock
      - 16 MB FLASH         MX25L12845EMI-10G
      - 2x 64 MB RAM
      - UART at J1          populated, RX grounded
      - 6 internal antenna plates (omni-directional)
      - 5 LEDs, 1 button (power, 2G, 5G, WAN, WPS) (reset)
    
    **MAC addresses:**
    
      Base MAC address labeled as "MAC ADDRESS"
      MAC "wanaddr" is similar to "ethaddr"
    
      eth0 *:58 MAC u-boot-env ethaddr
      phy0 *:58 MAC u-boot-env ethaddr
      phy1 *:59 --- u-boot-env ethaddr +1
      WAN  *:10:58  u-boot-env wanaddr
    
    **Serial Access:**
    
      RX on the board for UART is shorted to ground by resistor R176
      therefore it must be removed to use the console
      but it is not necessary to remove to view boot log
    
      optionally, R175 can be replaced with a solder bridge short
    
      the resistors R175 and R176 are next to the UART RX pin
    
    **Installation:**
    
      Method 1: Firmware upgrade page
    
        NOTE: ESR1750 might require the factory.bin
          for ESR1200 instead, OEM provides 1 image for both.
    
        OEM webpage at 192.168.0.1
        username and password "admin"
        Navigate to Settings (gear icon) --> Tools --> Firmware
        select the factory.bin image
        confirm and wait 3 minutes
    
      Method 2: TFTP recovery
    
        Follow TFTP instructions using initramfs.bin
        use sysupgrade.bin to flash using openwrt web interface
    
    **Return to OEM:**
    
      MTD partitions should be backed up before flashing
      using TFTP to boot openwrt without overwriting flash
    
      Alternatively, it is possible to edit OEM firmware images
      to flash MTD partitions in openwrt to restore OEM firmware
      by removing the OEM header and writing the rest to "firmware"
    
    **TFTP recovery:**
    
      Requires serial console, reset button does nothing at boot
    
      rename initramfs.bin to 'uImageESR1200'
      make available on TFTP server at 192.168.99.8
      power board, interrupt boot by pressing '4' rapidly
      execute tftpboot and bootm
    
    **Note on ETH switch registers**
    
      Registers must be written to the ethernet switch
      in order to set up the switch's MAC interface.
      U-boot can write the registers on it's own
      which is needed, for example, in a TFTP transfer.
    
      The register bits from OEM for the QCA8337 switch
      can be read from interrupted boot (tftpboot, bootm)
      by adding print lines in the switch driver ar8327.c
      before 'qca,ar8327-initvals' is parsed from DTS and written.
      for example:
    
        pr_info("0x04 %08x\n", ar8xxx_read(priv, AR8327_REG_PAD0_MODE));
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 .../linux/ath79/dts/qca9558_engenius_esr1750.dts   | 79 ++++++++++++++++++++++
 .../generic/base-files/etc/board.d/02_network      |  2 +
 .../etc/hotplug.d/ieee80211/10_fix_wifi_mac        |  1 +
 .../base-files/lib/preinit/10_fix_eth_mac.sh       |  1 +
 target/linux/ath79/image/generic.mk                | 14 ++++
 5 files changed, 97 insertions(+)

diff --git a/target/linux/ath79/dts/qca9558_engenius_esr1750.dts b/target/linux/ath79/dts/qca9558_engenius_esr1750.dts
new file mode 100644
index 0000000000..4cfdfc1f28
--- /dev/null
+++ b/target/linux/ath79/dts/qca9558_engenius_esr1750.dts
@@ -0,0 +1,79 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qca955x_senao_router-dual.dtsi"
+
+/ {
+	compatible = "engenius,esr1750", "qca,qca9558";
+	model = "EnGenius ESR1750";
+
+	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 = "amber:power";
+			gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
+			default-state = "on";
+		};
+
+		wlan2g {
+			label = "blue:wlan2g";
+			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy1tpt";
+		};
+
+		wlan5g {
+			label = "blue:wlan5g";
+			gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy0tpt";
+		};
+
+		wps_amber {
+			label = "amber:wps";
+			gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
+		};
+
+		wps_blue {
+			label = "blue:wps";
+			gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&phy0 {
+	qca,mib-poll-interval = <500>;
+
+	qca,ar8327-initvals = <
+		0x04 0x87680000 /* PORT0 PAD MODE CTRL */
+		0x10 0x40000000 /* POWER_ON_STRAP */
+		0x50 0xcf35cf35 /* LED_CTRL0 */
+		0x54 0xcf35cf35 /* LED_CTRL1 */
+		0x58 0xcf35cf35 /* LED_CTRL2 */
+		0x5c 0x03ffff00 /* LED_CTRL3 */
+		0x7c 0x0000007e /* PORT0_STATUS */
+	>;
+};
+
+&usb_phy1 {
+	status = "okay";
+};
+
+&usb1 {
+	status = "okay";
+};
+
+&wmac {
+	nvmem-cells = <&calibration_art_1000>;
+	nvmem-cell-names = "calibration";
+};
+
+&ath10k_0 {
+	nvmem-cells = <&calibration_art_5000>;
+	nvmem-cell-names = "calibration";
+};
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
index 14baee3ae7..fbdd8c493e 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
@@ -287,6 +287,7 @@ ath79_setup_interfaces()
 	dlink,dir-842-c3|\
 	dlink,dir-859-a1|\
 	engenius,epg5000|\
+	engenius,esr1750|\
 	engenius,esr900|\
 	sitecom,wlr-7100|\
 	tplink,archer-c2-v3|\
@@ -667,6 +668,7 @@ ath79_setup_macs()
 		label_mac=$lan_mac
 		;;
 	engenius,epg5000|\
+	engenius,esr1750|\
 	engenius,esr900)
 		lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
 		wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index 42fa44c30e..1290c8b5fd 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -35,6 +35,7 @@ case "$board" in
 		[ "$PHYNBR" -eq 1 ] && \
 			mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress
 		;;
+	engenius,esr1750|\
 	engenius,esr900)
 		macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" "$PHYNBR" > /sys${DEVPATH}/macaddress
 		;;
diff --git a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh
index 50855f543f..b98b047c93 100644
--- a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh
+++ b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh
@@ -12,6 +12,7 @@ preinit_set_mac_address() {
 		ip link set dev eth0 address $(mtd_get_mac_ascii bdcfg "lanmac")
 		ip link set dev eth1 address $(mtd_get_mac_ascii bdcfg "wanmac")
 		;;
+	engenius,esr1750|\
 	engenius,esr900)
 		ip link set dev eth0 address $(mtd_get_mac_ascii u-boot-env ethaddr)
 		;;
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index 47a8b0fe79..6212fc602e 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -1299,6 +1299,20 @@ define Device/engenius_epg5000
 endef
 TARGET_DEVICES += engenius_epg5000
 
+define Device/engenius_esr1750
+  SOC := qca9558
+  DEVICE_VENDOR := EnGenius
+  DEVICE_MODEL := ESR1750
+  DEVICE_PACKAGES := ath10k-firmware-qca988x-ct kmod-ath10k-ct kmod-usb2
+  IMAGE_SIZE := 14656k
+  IMAGES += factory.dlf
+  IMAGE/factory.dlf := append-kernel | pad-to $$$$(BLOCKSIZE) | \
+	append-rootfs | pad-rootfs | check-size | \
+	senao-header -r 0x101 -p 0x62 -t 2
+  SUPPORTED_DEVICES += esr1750 esr1200 engenius,esr1200
+endef
+TARGET_DEVICES += engenius_esr1750
+
 define Device/engenius_esr900
   SOC := qca9558
   DEVICE_VENDOR := EnGenius



From lede-commits at lists.infradead.org  Sun Feb 12 09:20:42 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 12 Feb 2023 12:20:42 -0500
Subject: [openwrt/openwrt]  ath79: add support for Senao Engenius ESR900
In-Reply-To: <167622244167.2619552.1429469741531199163@git-01.infra.openwrt.org>
References: <167622244167.2619552.1429469741531199163@git-01.infra.openwrt.org>
Message-ID: <mailman.14993.1676222452.3064139.lede-commits@lists.infradead.org>

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

commit 2f99f7e2d07dd14ed56a2853703b8888464933bf
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Mon Jan 30 13:51:36 2023 -0500

    ath79: add support for Senao Engenius ESR900
    
    FCC ID: A8J-ESR900
    
    Engenius ESR900 is an indoor wireless router with
    a gigabit ethernet switch, dual-band wireless,
    internal antenna plates, and a USB 2.0 port
    
    **Specification:**
    
      - QCA9558 SOC         2.4 GHz, 3x3
      - AR9580 WLAN         PCIe on board, 5 GHz, 3x3
      - AR8327N SW          4 ports LAN, 1 port WAN
      - 40 MHz clock
      - 16 MB FLASH         MX25L12845EMI-10G
      - 2x 64 MB RAM
      - UART at J1          populated, RX grounded
      - 6 internal antenna plates (omni-directional)
      - 5 LEDs, 1 button (power, 2G, 5G, WAN, WPS) (reset)
    
    **MAC addresses:**
    
      Base MAC address labeled as "MAC ADDRESS"
      MAC "wanaddr" is not similar to "ethaddr"
    
      eth0 *:06 MAC u-boot-env ethaddr
      phy0 *:06 MAC u-boot-env ethaddr
      phy1 *:07 --- u-boot-env ethaddr +1
      WAN  *:6E:81  u-boot-env wanaddr
    
    **Serial Access:**
    
      RX on the board for UART is shorted to ground by resistor R176
      therefore it must be removed to use the console
      but it is not necessary to remove to view boot log
    
      optionally, R175 can be replaced with a solder bridge short
    
      the resistors R175 and R176 are next to the UART RX pin
    
    **Installation:**
    
      Method 1: Firmware upgrade page
    
        OEM webpage at 192.168.0.1
        username and password "admin"
        Navigate to Settings (gear icon) --> Tools --> Firmware
        select the factory.bin image
        confirm and wait 3 minutes
    
      Method 2: TFTP recovery
    
        Follow TFTP instructions using initramfs.bin
        use sysupgrade.bin to flash using openwrt web interface
    
    **Return to OEM:**
    
      MTD partitions should be backed up before flashing
      using TFTP to boot openwrt without overwriting flash
    
      Alternatively, it is possible to edit OEM firmware images
      to flash MTD partitions in openwrt to restore OEM firmware
      by removing the OEM header and writing the rest to "firmware"
    
    **TFTP recovery:**
    
      Requires serial console, reset button does nothing at boot
    
      rename initramfs.bin to 'uImageESR900'
      make available on TFTP server at 192.168.99.8
      power board, interrupt boot by pressing '4' rapidly
      execute tftpboot and bootm
    
    **Note on ETH switch registers**
    
      Registers must be written to the ethernet switch
      in order to set up the switch's MAC interface.
      U-boot can write the registers on it's own
      which is needed, for example, in a TFTP transfer.
    
      The register bits from OEM for the AR8327 switch
      can be read from interrupted boot (tftpboot, bootm)
      by adding print lines in the switch driver ar8327.c
      before 'qca,ar8327-initvals' is parsed from DTS and written.
      for example:
    
        pr_info("0x04 %08x\n", ar8xxx_read(priv, AR8327_REG_PAD0_MODE));
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 target/linux/ath79/dts/qca9558_engenius_esr900.dts | 85 ++++++++++++++++++++++
 .../generic/base-files/etc/board.d/02_network      |  4 +-
 .../etc/hotplug.d/ieee80211/10_fix_wifi_mac        |  3 +
 .../base-files/lib/preinit/10_fix_eth_mac.sh       |  3 +
 target/linux/ath79/image/generic.mk                | 14 ++++
 5 files changed, 108 insertions(+), 1 deletion(-)

diff --git a/target/linux/ath79/dts/qca9558_engenius_esr900.dts b/target/linux/ath79/dts/qca9558_engenius_esr900.dts
new file mode 100644
index 0000000000..269f743223
--- /dev/null
+++ b/target/linux/ath79/dts/qca9558_engenius_esr900.dts
@@ -0,0 +1,85 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qca955x_senao_router-dual.dtsi"
+
+/ {
+	compatible = "engenius,esr900", "qca,qca9558";
+	model = "EnGenius ESR900";
+
+	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 = "amber:power";
+			gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
+			default-state = "on";
+		};
+
+		wlan2g {
+			label = "blue:wlan2g";
+			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy1tpt";
+		};
+
+		wlan5g {
+			label = "blue:wlan5g";
+			gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy0tpt";
+		};
+
+		wps_amber {
+			label = "amber:wps";
+			gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
+		};
+
+		wps_blue {
+			label = "blue:wps";
+			gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&phy0 {
+	qca,mib-poll-interval = <500>;
+
+	qca,ar8327-initvals = <
+		0x04 0x07680000 /* PORT0 PAD MODE CTRL */
+		0x10 0x40000000 /* POWER_ON_STRAP */
+		0x50 0xcf35cf35 /* LED_CTRL0 */
+		0x54 0xcf35cf35 /* LED_CTRL1 */
+		0x58 0xcf35cf35 /* LED_CTRL2 */
+		0x5c 0x03ffff00 /* LED_CTRL3 */
+		0x7c 0x0000007e /* PORT0_STATUS */
+	>;
+};
+
+&usb_phy1 {
+	status = "okay";
+};
+
+&usb1 {
+	status = "okay";
+};
+
+&wmac {
+	nvmem-cells = <&calibration_art_1000>;
+	nvmem-cell-names = "calibration";
+};
+
+&pcie0 {
+	status = "okay";
+
+	wifi at 0,0,0 {
+		compatible = "pci168c,0033";
+		reg = <0x0000 0 0 0 0>;
+		nvmem-cells = <&calibration_art_5000>;
+		nvmem-cell-names = "calibration";
+	};
+};
diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network
index 3330cd2b0a..14baee3ae7 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
@@ -287,6 +287,7 @@ ath79_setup_interfaces()
 	dlink,dir-842-c3|\
 	dlink,dir-859-a1|\
 	engenius,epg5000|\
+	engenius,esr900|\
 	sitecom,wlr-7100|\
 	tplink,archer-c2-v3|\
 	tplink,tl-wr1043nd-v4|\
@@ -665,7 +666,8 @@ ath79_setup_macs()
 		lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
 		label_mac=$lan_mac
 		;;
-	engenius,epg5000)
+	engenius,epg5000|\
+	engenius,esr900)
 		lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
 		wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
 		;;
diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
index 74345843f5..42fa44c30e 100644
--- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
+++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac
@@ -35,6 +35,9 @@ case "$board" in
 		[ "$PHYNBR" -eq 1 ] && \
 			mtd_get_mac_ascii bdcfg "wlanmac" > /sys${DEVPATH}/macaddress
 		;;
+	engenius,esr900)
+		macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" "$PHYNBR" > /sys${DEVPATH}/macaddress
+		;;
 	fortinet,fap-221-b)
 		macaddr_add "$(mtd_get_mac_text u-boot 0x3ff80 12)" $((PHYNBR*7+1)) > /sys${DEVPATH}/macaddress
 		;;
diff --git a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh
index bf40efe72b..50855f543f 100644
--- a/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh
+++ b/target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh
@@ -12,6 +12,9 @@ preinit_set_mac_address() {
 		ip link set dev eth0 address $(mtd_get_mac_ascii bdcfg "lanmac")
 		ip link set dev eth1 address $(mtd_get_mac_ascii bdcfg "wanmac")
 		;;
+	engenius,esr900)
+		ip link set dev eth0 address $(mtd_get_mac_ascii u-boot-env ethaddr)
+		;;
 	enterasys,ws-ap3705i)
 		ip link set dev eth0 address $(mtd_get_mac_ascii u-boot-env0 ethaddr)
 		;;
diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk
index d12fa7226e..47a8b0fe79 100644
--- a/target/linux/ath79/image/generic.mk
+++ b/target/linux/ath79/image/generic.mk
@@ -1299,6 +1299,20 @@ define Device/engenius_epg5000
 endef
 TARGET_DEVICES += engenius_epg5000
 
+define Device/engenius_esr900
+  SOC := qca9558
+  DEVICE_VENDOR := EnGenius
+  DEVICE_MODEL := ESR900
+  DEVICE_PACKAGES := kmod-usb2
+  IMAGE_SIZE := 14656k
+  IMAGES += factory.dlf
+  IMAGE/factory.dlf := append-kernel | pad-to $$$$(BLOCKSIZE) | \
+	append-rootfs | pad-rootfs | check-size | \
+	senao-header -r 0x101 -p 0x4e -t 2
+  SUPPORTED_DEVICES += esr900
+endef
+TARGET_DEVICES += engenius_esr900
+
 define Device/engenius_ews511ap
   SOC := qca9531
   DEVICE_VENDOR := EnGenius



From lede-commits at lists.infradead.org  Sun Feb 12 09:28:45 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 12 Feb 2023 12:28:45 -0500
Subject: [openwrt/openwrt]  ramips: add support for ASUS RT-AX54
In-Reply-To: <167622292586.2623690.10353023168444676190@git-01.infra.openwrt.org>
References: <167622292586.2623690.10353023168444676190@git-01.infra.openwrt.org>
Message-ID: <mailman.14996.1676222931.3064139.lede-commits@lists.infradead.org>

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

commit 92276eef704af0d74d067676de7e8b9966de91ca
Author: Karl Chan <exkc at exkc.moe>
AuthorDate: Sun Jan 29 13:37:28 2023 +0800

    ramips: add support for ASUS RT-AX54
    
    Specifications:
    - Device: ASUS RT-AX54 (AX1800S/HP,AX54HP)
    - SoC: MT7621AT
    - Flash: 128MB
    - RAM: 256MB
    - Switch: 1 WAN, 4 LAN (10/100/1000 Mbps)
    - WiFi: MT7905 2x2 2.4G + MT7975 2x2 5G
    - LEDs: 1x POWER (blue, configurable)
            1x LAN (blue, configurable)
            1x WAN (blue, configurable)
            1x 2.4G (blue, not configurable)
            1x 5G (blue, not configurable)
    
    Flash by U-Boot TFTP method:
    - Configure your PC with IP 192.168.1.2
    - Set up TFTP server and put the factory.bin image on your PC
    - Connect serial port(rate:115200) and turn on AP, then interrupt "U-Boot Boot Menu" by hitting any key
       Select "2. Upgrade firmware"
       Press enter when show "Run firmware after upgrading? (Y/n):"
       Select 0 for TFTP method
       Input U-Boot's IP address: 192.168.1.1
       Input TFTP server's IP address: 192.168.1.2
       Input IP netmask: 255.255.255.0
       Input file name: openwrt-ramips-mt7621-asus_rt-ax1800hp-squashfs-factory.bin
    - Restart AP aftre see the log "Firmware upgrade completed!"
    
    Signed-off-by: Karl Chan <exkc at exkc.moe>
---
 package/boot/uboot-envtools/files/ramips           |   1 +
 target/linux/ramips/dts/mt7621_asus_rt-ax54.dts    | 186 +++++++++++++++++++++
 target/linux/ramips/image/mt7621.mk                |  25 +++
 .../ramips/mt7621/base-files/etc/board.d/01_leds   |   4 +
 .../mt7621/base-files/lib/upgrade/platform.sh      |   1 +
 5 files changed, 217 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips
index 461d907137..812bd18116 100644
--- a/package/boot/uboot-envtools/files/ramips
+++ b/package/boot/uboot-envtools/files/ramips
@@ -53,6 +53,7 @@ zte,mf283plus)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
 	;;
 asus,rt-ax53u|\
+asus,rt-ax54|\
 belkin,rt1800|\
 h3c,tx1800-plus|\
 h3c,tx1801-plus|\
diff --git a/target/linux/ramips/dts/mt7621_asus_rt-ax54.dts b/target/linux/ramips/dts/mt7621_asus_rt-ax54.dts
new file mode 100644
index 0000000000..3191692e4e
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_asus_rt-ax54.dts
@@ -0,0 +1,186 @@
+// 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 <dt-bindings/leds/common.h>
+
+/ {
+	compatible = "asus,rt-ax54", "mediatek,mt7621-soc";
+	model = "ASUS RT-AX54";
+
+	aliases {
+		led-boot = &led_power;
+		led-failsafe = &led_power;
+		led-running = &led_power;
+		led-upgrade = &led_power;
+		label-mac-device = &gmac0;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+		bootargs-override = "console=ttyS0,115200";
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_power: power {
+			label = "blue:power";
+			color = <LED_COLOR_ID_BLUE>;
+			function = LED_FUNCTION_POWER;
+			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+		};
+
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		key-restart {
+			label = "reset";
+			gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+
+		key-wps {
+			label = "wps";
+			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+	};
+};
+
+&nand {
+	status = "okay";
+
+	mediatek,nmbm;
+	mediatek,bmt-max-ratio = <1>;
+	mediatek,bmt-max-reserved-blocks = <64>;
+	mediatek,bmt-remap-range = <0x000000 0x7e0000>;
+
+	partitions {
+		compatible = "fixed-partitions";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition at 0 {
+			label = "u-boot";
+			reg = <0x0 0x80000>;
+			read-only;
+		};
+
+		/*
+		 * u-boot gets split here while keeping u-boot read-only,
+		 * which allows safe usage of fw_setenv
+		 */
+		partition at 80000 {
+			label = "u-boot-env";
+			reg = <0x80000 0x60000>;
+		};
+
+		partition at e0000 {
+			label = "nvram";
+			reg = <0xe0000 0x100000>;
+			read-only;
+		};
+
+		factory: partition at 1e0000 {
+			label = "factory";
+			reg = <0x1e0000 0x100000>;
+			read-only;
+
+			compatible = "nvmem-cells";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			macaddr_factory_4: macaddr at 4 {
+				reg = <0x4 0x6>;
+			};
+		};
+
+		factory2: partition at 2e0000 {
+			label = "factory2";
+			reg = <0x2e0000 0x100000>;
+			read-only;
+		};
+
+		partition at 3e0000 {
+			label = "kernel";
+			reg = <0x3e0000 0x400000>;
+		};
+
+		partition at 7e0000 {
+			label = "ubi";
+			reg = <0x7e0000 0x7020000>;
+		};
+
+		/* Last 8M are reserved for NMBM management (bad blocks) */
+	};
+};
+
+&pcie {
+	status = "okay";
+};
+
+&pcie1 {
+	wifi at 0,0 {
+		compatible = "mediatek,mt76";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x0000>;
+		mediatek,disable-radar-background;
+	};
+};
+
+&gmac0 {
+	nvmem-cells = <&macaddr_factory_4>;
+	nvmem-cell-names = "mac-address";
+};
+
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_4>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy4: ethernet-phy at 4 {
+		reg = <4>;
+	};
+};
+
+&switch0 {
+	ports {
+		port at 0 {
+			status = "okay";
+			label = "lan4";
+		};
+
+		port at 1 {
+			status = "okay";
+			label = "lan3";
+		};
+
+		port at 2 {
+			status = "okay";
+			label = "lan2";
+		};
+
+		port at 3 {
+			status = "okay";
+			label = "lan1";
+		};
+	};
+};
+
+&state_default {
+	gpio {
+		groups = "i2c", "uart2", "uart3", "jtag", "wdt";
+		function = "gpio";
+	};
+};
+
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 8c8c6dee8e..e212ceabf3 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -338,6 +338,31 @@ define Device/asus_rt-ax53u
 endef
 TARGET_DEVICES += asus_rt-ax53u
 
+define Device/asus_rt-ax54
+  $(Device/dsa-migration)
+  DEVICE_VENDOR := ASUS
+  DEVICE_MODEL := RT-AX54
+  DEVICE_ALT0_VENDOR := ASUS
+  DEVICE_ALT0_MODEL := RT-AX54
+  DEVICE_ALT1_VENDOR := ASUS
+  DEVICE_ALT1_MODEL := RT-AX54HP
+  DEVICE_ALT2_VENDOR := ASUS
+  DEVICE_ALT2_MODEL := RT-AX1800HP
+  DEVICE_ALT3_VENDOR := ASUS
+  DEVICE_ALT3_MODEL := RT-AX1800S
+  IMAGE_SIZE := 51200k
+  UBINIZE_OPTS := -E 5
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  KERNEL_SIZE := 4096k
+  IMAGES += factory.bin
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+  IMAGE/factory.bin := append-kernel | pad-to $$(KERNEL_SIZE) | append-ubi | \
+	check-size
+  DEVICE_PACKAGES := kmod-mt7915-firmware uboot-envtools 
+endef
+TARGET_DEVICES += asus_rt-ax54
+
 define Device/beeline_smartbox-flash
   $(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 66b5a3ddd0..211f1476ca 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
@@ -24,6 +24,10 @@ asus,rt-ax53u)
 	ucidef_set_led_wlan "wlan2g" "WiFi 2.4GHz" "mt76-phy0" "phy0tpt"
 	ucidef_set_led_wlan "wlan5g" "WiFi 5GHz" "mt76-phy1" "phy1tpt"
 	;;
+asus,rt-ax54)
+	ucidef_set_led_wlan "wlan2g" "WiFi 2.4GHz" "mt76-phy0" "phy0tpt"
+	ucidef_set_led_wlan "wlan5g" "WiFi 5GHz" "mt76-phy1" "phy1tpt"
+	;;
 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"
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 07c6b80d7b..bfdbd6a09d 100755
--- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
@@ -56,6 +56,7 @@ platform_do_upgrade() {
 	asus,rt-ac65p|\
 	asus,rt-ac85p|\
 	asus,rt-ax53u|\
+	asus,rt-ax54|\
 	beeline,smartbox-flash|\
 	beeline,smartbox-giga|\
 	beeline,smartbox-turbo|\



From lede-commits at lists.infradead.org  Sun Feb 12 15:47:27 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 12 Feb 2023 18:47:27 -0500
Subject: [openwrt/openwrt]  toolchain: glibc: Update to glibc 2.37
In-Reply-To: <167624564758.2848743.2951155649683108086@git-01.infra.openwrt.org>
References: <167624564758.2848743.2951155649683108086@git-01.infra.openwrt.org>
Message-ID: <mailman.15047.1676245656.3064139.lede-commits@lists.infradead.org>

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

commit 2e32b47cf8925bcf1e82e087162d4ddb1cfddd41
Author: Linhui Liu <liulinhui36 at gmail.com>
AuthorDate: Fri Feb 3 17:47:10 2023 +0800

    toolchain: glibc: Update to glibc 2.37
    
    This updates to glibc to version 2.37.
    
    Signed-off-by: Linhui Liu <liulinhui36 at gmail.com>
    [Update to current git commit]
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 toolchain/glibc/common.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/toolchain/glibc/common.mk b/toolchain/glibc/common.mk
index d1c440c6c7..ac396531c9 100644
--- a/toolchain/glibc/common.mk
+++ b/toolchain/glibc/common.mk
@@ -7,13 +7,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=glibc
-PKG_VERSION:=2.36
+PKG_VERSION:=2.37
 PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_VERSION:=3aae843e9e9e6a2502e98ff44d2671b20a023f8e
-PKG_MIRROR_HASH:=29bdd6ca699f297de500ea457741d0706d57a69836fa7d45e6cc2cc20484cad4
+PKG_SOURCE_VERSION:=d8e1a7590d375159fb5aac07ad8111ab4699e994
+PKG_MIRROR_HASH:=4ea04f4b5cdd5567e11defe6f8947c168382fc0a22abe121bb43f4bb83615237
 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 Feb 12 15:48:54 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 12 Feb 2023 18:48:54 -0500
Subject: [openwrt/openwrt]  e2fsprogs: update to 1.47.0
In-Reply-To: <167624573463.2849386.11297096744553863426@git-01.infra.openwrt.org>
References: <167624573463.2849386.11297096744553863426@git-01.infra.openwrt.org>
Message-ID: <mailman.15048.1676245749.3064139.lede-commits@lists.infradead.org>

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

commit 9639ef2a5b20a912916c8b9b0dd8a37cd8f6beb5
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Sun Feb 12 11:03:05 2023 +0100

    e2fsprogs: update to 1.47.0
    
    Release notes:
    https://e2fsprogs.sourceforge.net/e2fsprogs-release.html#1.47.0
    
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 package/utils/e2fsprogs/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/utils/e2fsprogs/Makefile b/package/utils/e2fsprogs/Makefile
index 82817d95ce..e6c5cfe75c 100644
--- a/package/utils/e2fsprogs/Makefile
+++ b/package/utils/e2fsprogs/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=e2fsprogs
-PKG_VERSION:=1.46.6
+PKG_VERSION:=1.47.0
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/kernel/people/tytso/e2fsprogs/v$(PKG_VERSION)/
-PKG_HASH:=a77517f19ff5e4e97ede63536566865dd5d48654e13fc145f5f2249ef7c4f4fc
+PKG_HASH:=144af53f2bbd921cef6f8bea88bb9faddca865da3fbc657cc9b4d2001097d5db
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=NOTICE



From lede-commits at lists.infradead.org  Mon Feb 13 03:05:36 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 13 Feb 2023 06:05:36 -0500
Subject: [openwrt/openwrt]  kernel: add missing optimization for page pool
In-Reply-To: <167628633527.3315129.1596465010639909065@git-01.infra.openwrt.org>
References: <167628633527.3315129.1596465010639909065@git-01.infra.openwrt.org>
Message-ID: <mailman.15191.1676286346.3064139.lede-commits@lists.infradead.org>

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

commit 1352e5da8dd722be9fdb3c8f5d616a553d529831
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Mon Feb 13 11:46:44 2023 +0100

    kernel: add missing optimization for page pool
    
    Improves performance in combination with threaded NAPI
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...v6.3-net-page_pool-use-in_softirq-instead.patch | 56 ++++++++++++++++++++++
 ...v6.3-net-page_pool-use-in_softirq-instead.patch | 56 ++++++++++++++++++++++
 2 files changed, 112 insertions(+)

diff --git a/target/linux/generic/backport-5.10/631-v6.3-net-page_pool-use-in_softirq-instead.patch b/target/linux/generic/backport-5.10/631-v6.3-net-page_pool-use-in_softirq-instead.patch
new file mode 100644
index 0000000000..e0d5b2451b
--- /dev/null
+++ b/target/linux/generic/backport-5.10/631-v6.3-net-page_pool-use-in_softirq-instead.patch
@@ -0,0 +1,56 @@
+From: Qingfang DENG <qingfang.deng at siflower.com.cn>
+Date: Fri, 3 Feb 2023 09:16:11 +0800
+Subject: [PATCH] net: page_pool: use in_softirq() instead
+
+We use BH context only for synchronization, so we don't care if it's
+actually serving softirq or not.
+
+As a side node, in case of threaded NAPI, in_serving_softirq() will
+return false because it's in process context with BH off, making
+page_pool_recycle_in_cache() unreachable.
+
+Signed-off-by: Qingfang DENG <qingfang.deng at siflower.com.cn>
+---
+
+--- a/include/net/page_pool.h
++++ b/include/net/page_pool.h
+@@ -295,7 +295,7 @@ static inline void page_pool_nid_changed
+ static inline void page_pool_ring_lock(struct page_pool *pool)
+ 	__acquires(&pool->ring.producer_lock)
+ {
+-	if (in_serving_softirq())
++	if (in_softirq())
+ 		spin_lock(&pool->ring.producer_lock);
+ 	else
+ 		spin_lock_bh(&pool->ring.producer_lock);
+@@ -304,7 +304,7 @@ static inline void page_pool_ring_lock(s
+ static inline void page_pool_ring_unlock(struct page_pool *pool)
+ 	__releases(&pool->ring.producer_lock)
+ {
+-	if (in_serving_softirq())
++	if (in_softirq())
+ 		spin_unlock(&pool->ring.producer_lock);
+ 	else
+ 		spin_unlock_bh(&pool->ring.producer_lock);
+--- a/net/core/page_pool.c
++++ b/net/core/page_pool.c
+@@ -338,8 +338,8 @@ static void page_pool_return_page(struct
+ static bool page_pool_recycle_in_ring(struct page_pool *pool, struct page *page)
+ {
+ 	int ret;
+-	/* BH protection not needed if current is serving softirq */
+-	if (in_serving_softirq())
++	/* BH protection not needed if current is softirq */
++	if (in_softirq())
+ 		ret = ptr_ring_produce(&pool->ring, page);
+ 	else
+ 		ret = ptr_ring_produce_bh(&pool->ring, page);
+@@ -397,7 +397,7 @@ __page_pool_put_page(struct page_pool *p
+ 			page_pool_dma_sync_for_device(pool, page,
+ 						      dma_sync_size);
+ 
+-		if (allow_direct && in_serving_softirq() &&
++		if (allow_direct && in_softirq() &&
+ 		    page_pool_recycle_in_cache(page, pool))
+ 			return NULL;
+ 
diff --git a/target/linux/generic/backport-5.15/610-v6.3-net-page_pool-use-in_softirq-instead.patch b/target/linux/generic/backport-5.15/610-v6.3-net-page_pool-use-in_softirq-instead.patch
new file mode 100644
index 0000000000..71e1140595
--- /dev/null
+++ b/target/linux/generic/backport-5.15/610-v6.3-net-page_pool-use-in_softirq-instead.patch
@@ -0,0 +1,56 @@
+From: Qingfang DENG <qingfang.deng at siflower.com.cn>
+Date: Fri, 3 Feb 2023 09:16:11 +0800
+Subject: [PATCH] net: page_pool: use in_softirq() instead
+
+We use BH context only for synchronization, so we don't care if it's
+actually serving softirq or not.
+
+As a side node, in case of threaded NAPI, in_serving_softirq() will
+return false because it's in process context with BH off, making
+page_pool_recycle_in_cache() unreachable.
+
+Signed-off-by: Qingfang DENG <qingfang.deng at siflower.com.cn>
+---
+
+--- a/include/net/page_pool.h
++++ b/include/net/page_pool.h
+@@ -357,7 +357,7 @@ static inline void page_pool_nid_changed
+ static inline void page_pool_ring_lock(struct page_pool *pool)
+ 	__acquires(&pool->ring.producer_lock)
+ {
+-	if (in_serving_softirq())
++	if (in_softirq())
+ 		spin_lock(&pool->ring.producer_lock);
+ 	else
+ 		spin_lock_bh(&pool->ring.producer_lock);
+@@ -366,7 +366,7 @@ static inline void page_pool_ring_lock(s
+ static inline void page_pool_ring_unlock(struct page_pool *pool)
+ 	__releases(&pool->ring.producer_lock)
+ {
+-	if (in_serving_softirq())
++	if (in_softirq())
+ 		spin_unlock(&pool->ring.producer_lock);
+ 	else
+ 		spin_unlock_bh(&pool->ring.producer_lock);
+--- a/net/core/page_pool.c
++++ b/net/core/page_pool.c
+@@ -512,8 +512,8 @@ static void page_pool_return_page(struct
+ static bool page_pool_recycle_in_ring(struct page_pool *pool, struct page *page)
+ {
+ 	int ret;
+-	/* BH protection not needed if current is serving softirq */
+-	if (in_serving_softirq())
++	/* BH protection not needed if current is softirq */
++	if (in_softirq())
+ 		ret = ptr_ring_produce(&pool->ring, page);
+ 	else
+ 		ret = ptr_ring_produce_bh(&pool->ring, page);
+@@ -576,7 +576,7 @@ __page_pool_put_page(struct page_pool *p
+ 			page_pool_dma_sync_for_device(pool, page,
+ 						      dma_sync_size);
+ 
+-		if (allow_direct && in_serving_softirq() &&
++		if (allow_direct && in_softirq() &&
+ 		    page_pool_recycle_in_cache(page, pool))
+ 			return NULL;
+ 



From lede-commits at lists.infradead.org  Mon Feb 13 03:05:35 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 13 Feb 2023 06:05:35 -0500
Subject: [openwrt/openwrt]  mac80211: add fixes for receiving A-MSDU packets
 on mesh interfaces
In-Reply-To: <167628633527.3315129.1596465010639909065@git-01.infra.openwrt.org>
References: <167628633527.3315129.1596465010639909065@git-01.infra.openwrt.org>
Message-ID: <mailman.15192.1676286348.3064139.lede-commits@lists.infradead.org>

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

commit ec33a6ca2cd16e92d2a544f38704405c043c822d
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sat Dec 10 14:55:33 2022 +0100

    mac80211: add fixes for receiving A-MSDU packets on mesh interfaces
    
    The standard defines the A-MSDU header length field differently for mesh
    compared to other modes. Deal with this accordingly and work around broken
    implementations (e.g. ath10k, ath11k).
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...11-fix-and-simplify-unencrypted-drop-chec.patch |  87 +++
 ...11-move-A-MSDU-check-in-ieee80211_data_to.patch |  25 +
 ...11-factor-out-bridge-tunnel-RFC1042-heade.patch |  76 +++
 ...11-remove-mesh-forwarding-congestion-chec.patch |  54 ++
 ...11-fix-receiving-A-MSDU-frames-on-mesh-in.patch | 753 +++++++++++++++++++++
 ...11-add-a-workaround-for-receiving-non-sta.patch | 145 ++++
 .../500-mac80211_configure_antenna_gain.patch      |   2 +-
 ...80211-mask-nested-A-MSDU-support-for-mesh.patch |  33 -
 8 files changed, 1141 insertions(+), 34 deletions(-)

diff --git a/package/kernel/mac80211/patches/subsys/311-wifi-mac80211-fix-and-simplify-unencrypted-drop-chec.patch b/package/kernel/mac80211/patches/subsys/311-wifi-mac80211-fix-and-simplify-unencrypted-drop-chec.patch
new file mode 100644
index 0000000000..804b02eb30
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/311-wifi-mac80211-fix-and-simplify-unencrypted-drop-chec.patch
@@ -0,0 +1,87 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Thu, 1 Dec 2022 14:57:30 +0100
+Subject: [PATCH] wifi: mac80211: fix and simplify unencrypted drop check for
+ mesh
+
+ieee80211_drop_unencrypted is called from ieee80211_rx_h_mesh_fwding and
+ieee80211_frame_allowed.
+
+Since ieee80211_rx_h_mesh_fwding can forward packets for other mesh nodes
+and is called earlier, it needs to check the decryptions status and if the
+packet is using the control protocol on its own, instead of deferring to
+the later call from ieee80211_frame_allowed.
+
+Because of that, ieee80211_drop_unencrypted has a mesh specific check
+that skips over the mesh header in order to check the payload protocol.
+This code is invalid when called from ieee80211_frame_allowed, since that
+happens after the 802.11->802.3 conversion.
+
+Fix this by moving the mesh specific check directly into
+ieee80211_rx_h_mesh_fwding.
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+Link: https://lore.kernel.org/r/20221201135730.19723-1-nbd at nbd.name
+Signed-off-by: Johannes Berg <johannes.berg at intel.com>
+---
+
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -2403,7 +2403,6 @@ static int ieee80211_802_1x_port_control
+ 
+ static int ieee80211_drop_unencrypted(struct ieee80211_rx_data *rx, __le16 fc)
+ {
+-	struct ieee80211_hdr *hdr = (void *)rx->skb->data;
+ 	struct sk_buff *skb = rx->skb;
+ 	struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
+ 
+@@ -2414,31 +2413,6 @@ static int ieee80211_drop_unencrypted(st
+ 	if (status->flag & RX_FLAG_DECRYPTED)
+ 		return 0;
+ 
+-	/* check mesh EAPOL frames first */
+-	if (unlikely(rx->sta && ieee80211_vif_is_mesh(&rx->sdata->vif) &&
+-		     ieee80211_is_data(fc))) {
+-		struct ieee80211s_hdr *mesh_hdr;
+-		u16 hdr_len = ieee80211_hdrlen(fc);
+-		u16 ethertype_offset;
+-		__be16 ethertype;
+-
+-		if (!ether_addr_equal(hdr->addr1, rx->sdata->vif.addr))
+-			goto drop_check;
+-
+-		/* make sure fixed part of mesh header is there, also checks skb len */
+-		if (!pskb_may_pull(rx->skb, hdr_len + 6))
+-			goto drop_check;
+-
+-		mesh_hdr = (struct ieee80211s_hdr *)(skb->data + hdr_len);
+-		ethertype_offset = hdr_len + ieee80211_get_mesh_hdrlen(mesh_hdr) +
+-				   sizeof(rfc1042_header);
+-
+-		if (skb_copy_bits(rx->skb, ethertype_offset, &ethertype, 2) == 0 &&
+-		    ethertype == rx->sdata->control_port_protocol)
+-			return 0;
+-	}
+-
+-drop_check:
+ 	/* Drop unencrypted frames if key is set. */
+ 	if (unlikely(!ieee80211_has_protected(fc) &&
+ 		     !ieee80211_is_any_nullfunc(fc) &&
+@@ -2892,8 +2866,16 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
+ 	hdr = (struct ieee80211_hdr *) skb->data;
+ 	mesh_hdr = (struct ieee80211s_hdr *) (skb->data + hdrlen);
+ 
+-	if (ieee80211_drop_unencrypted(rx, hdr->frame_control))
+-		return RX_DROP_MONITOR;
++	if (ieee80211_drop_unencrypted(rx, hdr->frame_control)) {
++		int offset = hdrlen + ieee80211_get_mesh_hdrlen(mesh_hdr) +
++			     sizeof(rfc1042_header);
++		__be16 ethertype;
++
++		if (!ether_addr_equal(hdr->addr1, rx->sdata->vif.addr) ||
++		    skb_copy_bits(rx->skb, offset, &ethertype, 2) != 0 ||
++		    ethertype != rx->sdata->control_port_protocol)
++			return RX_DROP_MONITOR;
++	}
+ 
+ 	/* frame is in RMC, don't forward */
+ 	if (ieee80211_is_data(hdr->frame_control) &&
diff --git a/package/kernel/mac80211/patches/subsys/312-wifi-cfg80211-move-A-MSDU-check-in-ieee80211_data_to.patch b/package/kernel/mac80211/patches/subsys/312-wifi-cfg80211-move-A-MSDU-check-in-ieee80211_data_to.patch
new file mode 100644
index 0000000000..f668905cca
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/312-wifi-cfg80211-move-A-MSDU-check-in-ieee80211_data_to.patch
@@ -0,0 +1,25 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Fri, 2 Dec 2022 13:53:11 +0100
+Subject: [PATCH] wifi: cfg80211: move A-MSDU check in
+ ieee80211_data_to_8023_exthdr
+
+When parsing the outer A-MSDU header, don't check for inner bridge tunnel
+or RFC1042 headers. This is handled by ieee80211_amsdu_to_8023s already.
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/net/wireless/util.c
++++ b/net/wireless/util.c
+@@ -631,8 +631,9 @@ int ieee80211_data_to_8023_exthdr(struct
+ 		break;
+ 	}
+ 
+-	if (likely(skb_copy_bits(skb, hdrlen, &payload, sizeof(payload)) == 0 &&
+-	           ((!is_amsdu && ether_addr_equal(payload.hdr, rfc1042_header) &&
++	if (likely(!is_amsdu &&
++		   skb_copy_bits(skb, hdrlen, &payload, sizeof(payload)) == 0 &&
++	           ((ether_addr_equal(payload.hdr, rfc1042_header) &&
+ 		     payload.proto != htons(ETH_P_AARP) &&
+ 		     payload.proto != htons(ETH_P_IPX)) ||
+ 		    ether_addr_equal(payload.hdr, bridge_tunnel_header)))) {
diff --git a/package/kernel/mac80211/patches/subsys/313-wifi-cfg80211-factor-out-bridge-tunnel-RFC1042-heade.patch b/package/kernel/mac80211/patches/subsys/313-wifi-cfg80211-factor-out-bridge-tunnel-RFC1042-heade.patch
new file mode 100644
index 0000000000..8641057869
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/313-wifi-cfg80211-factor-out-bridge-tunnel-RFC1042-heade.patch
@@ -0,0 +1,76 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Fri, 2 Dec 2022 13:54:15 +0100
+Subject: [PATCH] wifi: cfg80211: factor out bridge tunnel / RFC1042 header
+ check
+
+The same check is done in multiple places, unify it.
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/net/wireless/util.c
++++ b/net/wireless/util.c
+@@ -542,6 +542,21 @@ unsigned int ieee80211_get_mesh_hdrlen(s
+ }
+ EXPORT_SYMBOL(ieee80211_get_mesh_hdrlen);
+ 
++static bool ieee80211_get_8023_tunnel_proto(const void *hdr, __be16 *proto)
++{
++	const __be16 *hdr_proto = hdr + ETH_ALEN;
++
++	if (!(ether_addr_equal(hdr, rfc1042_header) &&
++	      *hdr_proto != htons(ETH_P_AARP) &&
++	      *hdr_proto != htons(ETH_P_IPX)) &&
++	    !ether_addr_equal(hdr, bridge_tunnel_header))
++		return false;
++
++	*proto = *hdr_proto;
++
++	return true;
++}
++
+ int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr,
+ 				  const u8 *addr, enum nl80211_iftype iftype,
+ 				  u8 data_offset, bool is_amsdu)
+@@ -633,14 +648,9 @@ int ieee80211_data_to_8023_exthdr(struct
+ 
+ 	if (likely(!is_amsdu &&
+ 		   skb_copy_bits(skb, hdrlen, &payload, sizeof(payload)) == 0 &&
+-	           ((ether_addr_equal(payload.hdr, rfc1042_header) &&
+-		     payload.proto != htons(ETH_P_AARP) &&
+-		     payload.proto != htons(ETH_P_IPX)) ||
+-		    ether_addr_equal(payload.hdr, bridge_tunnel_header)))) {
+-		/* remove RFC1042 or Bridge-Tunnel encapsulation and
+-		 * replace EtherType */
++		   ieee80211_get_8023_tunnel_proto(&payload, &tmp.h_proto))) {
++		/* remove RFC1042 or Bridge-Tunnel encapsulation */
+ 		hdrlen += ETH_ALEN + 2;
+-		tmp.h_proto = payload.proto;
+ 		skb_postpull_rcsum(skb, &payload, ETH_ALEN + 2);
+ 	} else {
+ 		tmp.h_proto = htons(skb->len - hdrlen);
+@@ -756,8 +766,6 @@ void ieee80211_amsdu_to_8023s(struct sk_
+ {
+ 	unsigned int hlen = ALIGN(extra_headroom, 4);
+ 	struct sk_buff *frame = NULL;
+-	u16 ethertype;
+-	u8 *payload;
+ 	int offset = 0, remaining;
+ 	struct ethhdr eth;
+ 	bool reuse_frag = skb->head_frag && !skb_has_frag_list(skb);
+@@ -811,14 +819,8 @@ void ieee80211_amsdu_to_8023s(struct sk_
+ 		frame->dev = skb->dev;
+ 		frame->priority = skb->priority;
+ 
+-		payload = frame->data;
+-		ethertype = (payload[6] << 8) | payload[7];
+-		if (likely((ether_addr_equal(payload, rfc1042_header) &&
+-			    ethertype != ETH_P_AARP && ethertype != ETH_P_IPX) ||
+-			   ether_addr_equal(payload, bridge_tunnel_header))) {
+-			eth.h_proto = htons(ethertype);
++		if (likely(ieee80211_get_8023_tunnel_proto(frame->data, &eth.h_proto)))
+ 			skb_pull(frame, ETH_ALEN + 2);
+-		}
+ 
+ 		memcpy(skb_push(frame, sizeof(eth)), &eth, sizeof(eth));
+ 		__skb_queue_tail(list, frame);
diff --git a/package/kernel/mac80211/patches/subsys/314-wifi-mac80211-remove-mesh-forwarding-congestion-chec.patch b/package/kernel/mac80211/patches/subsys/314-wifi-mac80211-remove-mesh-forwarding-congestion-chec.patch
new file mode 100644
index 0000000000..515176f0de
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/314-wifi-mac80211-remove-mesh-forwarding-congestion-chec.patch
@@ -0,0 +1,54 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Fri, 2 Dec 2022 17:01:46 +0100
+Subject: [PATCH] wifi: mac80211: remove mesh forwarding congestion check
+
+Now that all drivers use iTXQ, it does not make sense to check to drop
+tx forwarding packets when the driver has stopped the queues.
+fq_codel will take care of dropping packets when the queues fill up
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/net/mac80211/debugfs_netdev.c
++++ b/net/mac80211/debugfs_netdev.c
+@@ -603,8 +603,6 @@ IEEE80211_IF_FILE(fwded_mcast, u.mesh.ms
+ IEEE80211_IF_FILE(fwded_unicast, u.mesh.mshstats.fwded_unicast, DEC);
+ IEEE80211_IF_FILE(fwded_frames, u.mesh.mshstats.fwded_frames, DEC);
+ IEEE80211_IF_FILE(dropped_frames_ttl, u.mesh.mshstats.dropped_frames_ttl, DEC);
+-IEEE80211_IF_FILE(dropped_frames_congestion,
+-		  u.mesh.mshstats.dropped_frames_congestion, DEC);
+ IEEE80211_IF_FILE(dropped_frames_no_route,
+ 		  u.mesh.mshstats.dropped_frames_no_route, DEC);
+ 
+@@ -740,7 +738,6 @@ static void add_mesh_stats(struct ieee80
+ 	MESHSTATS_ADD(fwded_frames);
+ 	MESHSTATS_ADD(dropped_frames_ttl);
+ 	MESHSTATS_ADD(dropped_frames_no_route);
+-	MESHSTATS_ADD(dropped_frames_congestion);
+ #undef MESHSTATS_ADD
+ }
+ 
+--- a/net/mac80211/ieee80211_i.h
++++ b/net/mac80211/ieee80211_i.h
+@@ -329,7 +329,6 @@ struct mesh_stats {
+ 	__u32 fwded_frames;		/* Mesh total forwarded frames */
+ 	__u32 dropped_frames_ttl;	/* Not transmitted since mesh_ttl == 0*/
+ 	__u32 dropped_frames_no_route;	/* Not transmitted, no route found */
+-	__u32 dropped_frames_congestion;/* Not forwarded due to congestion */
+ };
+ 
+ #define PREQ_Q_F_START		0x1
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -2926,11 +2926,6 @@ ieee80211_rx_h_mesh_fwding(struct ieee80
+ 		return RX_CONTINUE;
+ 
+ 	ac = ieee802_1d_to_ac[skb->priority];
+-	q = sdata->vif.hw_queue[ac];
+-	if (ieee80211_queue_stopped(&local->hw, q)) {
+-		IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_congestion);
+-		return RX_DROP_MONITOR;
+-	}
+ 	skb_set_queue_mapping(skb, ac);
+ 
+ 	if (!--mesh_hdr->ttl) {
diff --git a/package/kernel/mac80211/patches/subsys/315-wifi-mac80211-fix-receiving-A-MSDU-frames-on-mesh-in.patch b/package/kernel/mac80211/patches/subsys/315-wifi-mac80211-fix-receiving-A-MSDU-frames-on-mesh-in.patch
new file mode 100644
index 0000000000..6aec9bc85f
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/315-wifi-mac80211-fix-receiving-A-MSDU-frames-on-mesh-in.patch
@@ -0,0 +1,753 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Tue, 6 Dec 2022 11:15:02 +0100
+Subject: [PATCH] wifi: mac80211: fix receiving A-MSDU frames on mesh
+ interfaces
+
+The current mac80211 mesh A-MSDU receive path fails to parse A-MSDU packets
+on mesh interfaces, because it assumes that the Mesh Control field is always
+directly after the 802.11 header.
+802.11-2020 9.3.2.2.2 Figure 9-70 shows that the Mesh Control field is
+actually part of the A-MSDU subframe header.
+This makes more sense, since it allows packets for multiple different
+destinations to be included in the same A-MSDU, as long as RA and TID are
+still the same.
+Another issue is the fact that the A-MSDU subframe length field was apparently
+accidentally defined as little-endian in the standard.
+
+In order to fix this, the mesh forwarding path needs happen at a different
+point in the receive path.
+
+ieee80211_data_to_8023_exthdr is changed to ignore the mesh control field
+and leave it in after the ethernet header. This also affects the source/dest
+MAC address fields, which now in the case of mesh point to the mesh SA/DA.
+
+ieee80211_amsdu_to_8023s is changed to deal with the endian difference and
+to add the Mesh Control length to the subframe length, since it's not covered
+by the MSDU length field.
+
+With these changes, the mac80211 will get the same packet structure for
+converted regular data packets and unpacked A-MSDU subframes.
+
+The mesh forwarding checks are now only performed after the A-MSDU decap.
+For locally received packets, the Mesh Control header is stripped away.
+For forwarded packets, a new 802.11 header gets added.
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c
++++ b/drivers/net/wireless/marvell/mwifiex/11n_rxreorder.c
+@@ -33,7 +33,7 @@ static int mwifiex_11n_dispatch_amsdu_pk
+ 		skb_trim(skb, le16_to_cpu(local_rx_pd->rx_pkt_length));
+ 
+ 		ieee80211_amsdu_to_8023s(skb, &list, priv->curr_addr,
+-					 priv->wdev.iftype, 0, NULL, NULL);
++					 priv->wdev.iftype, 0, NULL, NULL, false);
+ 
+ 		while (!skb_queue_empty(&list)) {
+ 			struct rx_packet_hdr *rx_hdr;
+--- a/include/net/cfg80211.h
++++ b/include/net/cfg80211.h
+@@ -6208,11 +6208,36 @@ static inline int ieee80211_data_to_8023
+  * @extra_headroom: The hardware extra headroom for SKBs in the @list.
+  * @check_da: DA to check in the inner ethernet header, or NULL
+  * @check_sa: SA to check in the inner ethernet header, or NULL
++ * @mesh_control: A-MSDU subframe header includes the mesh control field
+  */
+ void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,
+ 			      const u8 *addr, enum nl80211_iftype iftype,
+ 			      const unsigned int extra_headroom,
+-			      const u8 *check_da, const u8 *check_sa);
++			      const u8 *check_da, const u8 *check_sa,
++			      bool mesh_control);
++
++/**
++ * ieee80211_get_8023_tunnel_proto - get RFC1042 or bridge tunnel encap protocol
++ *
++ * Check for RFC1042 or bridge tunnel header and fetch the encapsulated
++ * protocol.
++ *
++ * @hdr: pointer to the MSDU payload
++ * @proto: destination pointer to store the protocol
++ * Return: true if encapsulation was found
++ */
++bool ieee80211_get_8023_tunnel_proto(const void *hdr, __be16 *proto);
++
++/**
++ * ieee80211_strip_8023_mesh_hdr - strip mesh header from converted 802.3 frames
++ *
++ * Strip the mesh header, which was left in by ieee80211_data_to_8023 as part
++ * of the MSDU data. Also move any source/destination addresses from the mesh
++ * header to the ethernet header (if present).
++ *
++ * @skb: The 802.3 frame with embedded mesh header
++ */
++int ieee80211_strip_8023_mesh_hdr(struct sk_buff *skb);
+ 
+ /**
+  * cfg80211_classify8021d - determine the 802.1p/1d tag for a data frame
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -2720,6 +2720,174 @@ ieee80211_deliver_skb(struct ieee80211_r
+ 	}
+ }
+ 
++static ieee80211_rx_result
++ieee80211_rx_mesh_data(struct ieee80211_sub_if_data *sdata, struct sta_info *sta,
++		       struct sk_buff *skb)
++{
++#ifdef CPTCFG_MAC80211_MESH
++	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
++	struct ieee80211_local *local = sdata->local;
++	uint16_t fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_DATA;
++	struct ieee80211_hdr hdr = {
++		.frame_control = cpu_to_le16(fc)
++	};
++	struct ieee80211_hdr *fwd_hdr;
++	struct ieee80211s_hdr *mesh_hdr;
++	struct ieee80211_tx_info *info;
++	struct sk_buff *fwd_skb;
++	struct ethhdr *eth;
++	bool multicast;
++	int tailroom = 0;
++	int hdrlen, mesh_hdrlen;
++	u8 *qos;
++
++	if (!ieee80211_vif_is_mesh(&sdata->vif))
++		return RX_CONTINUE;
++
++	if (!pskb_may_pull(skb, sizeof(*eth) + 6))
++		return RX_DROP_MONITOR;
++
++	mesh_hdr = (struct ieee80211s_hdr *)(skb->data + sizeof(*eth));
++	mesh_hdrlen = ieee80211_get_mesh_hdrlen(mesh_hdr);
++
++	if (!pskb_may_pull(skb, sizeof(*eth) + mesh_hdrlen))
++		return RX_DROP_MONITOR;
++
++	eth = (struct ethhdr *)skb->data;
++	multicast = is_multicast_ether_addr(eth->h_dest);
++
++	mesh_hdr = (struct ieee80211s_hdr *)(eth + 1);
++	if (!mesh_hdr->ttl)
++		return RX_DROP_MONITOR;
++
++	/* frame is in RMC, don't forward */
++	if (is_multicast_ether_addr(eth->h_dest) &&
++	    mesh_rmc_check(sdata, eth->h_source, mesh_hdr))
++		return RX_DROP_MONITOR;
++
++	/* Frame has reached destination.  Don't forward */
++	if (ether_addr_equal(sdata->vif.addr, eth->h_dest))
++		goto rx_accept;
++
++	if (!ifmsh->mshcfg.dot11MeshForwarding) {
++		if (is_multicast_ether_addr(eth->h_dest))
++			goto rx_accept;
++
++		return RX_DROP_MONITOR;
++	}
++
++	/* forward packet */
++	if (sdata->crypto_tx_tailroom_needed_cnt)
++		tailroom = IEEE80211_ENCRYPT_TAILROOM;
++
++	if (!--mesh_hdr->ttl) {
++		if (multicast)
++			goto rx_accept;
++
++		IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_ttl);
++		return RX_DROP_MONITOR;
++	}
++
++	if (mesh_hdr->flags & MESH_FLAGS_AE) {
++		struct mesh_path *mppath;
++		char *proxied_addr;
++
++		if (multicast)
++			proxied_addr = mesh_hdr->eaddr1;
++		else if ((mesh_hdr->flags & MESH_FLAGS_AE) == MESH_FLAGS_AE_A5_A6)
++			/* has_a4 already checked in ieee80211_rx_mesh_check */
++			proxied_addr = mesh_hdr->eaddr2;
++		else
++			return RX_DROP_MONITOR;
++
++		rcu_read_lock();
++		mppath = mpp_path_lookup(sdata, proxied_addr);
++		if (!mppath) {
++			mpp_path_add(sdata, proxied_addr, eth->h_source);
++		} else {
++			spin_lock_bh(&mppath->state_lock);
++			if (!ether_addr_equal(mppath->mpp, eth->h_source))
++				memcpy(mppath->mpp, eth->h_source, ETH_ALEN);
++			mppath->exp_time = jiffies;
++			spin_unlock_bh(&mppath->state_lock);
++		}
++		rcu_read_unlock();
++	}
++
++	skb_set_queue_mapping(skb, ieee802_1d_to_ac[skb->priority]);
++
++	ieee80211_fill_mesh_addresses(&hdr, &hdr.frame_control,
++				      eth->h_dest, eth->h_source);
++	hdrlen = ieee80211_hdrlen(hdr.frame_control);
++	if (multicast) {
++		int extra_head = sizeof(struct ieee80211_hdr) - sizeof(*eth);
++
++		fwd_skb = skb_copy_expand(skb, local->tx_headroom + extra_head +
++					       IEEE80211_ENCRYPT_HEADROOM,
++					  tailroom, GFP_ATOMIC);
++		if (!fwd_skb)
++			goto rx_accept;
++	} else {
++		fwd_skb = skb;
++		skb = NULL;
++
++		if (skb_cow_head(fwd_skb, hdrlen - sizeof(struct ethhdr)))
++			return RX_DROP_UNUSABLE;
++	}
++
++	fwd_hdr = skb_push(fwd_skb, hdrlen - sizeof(struct ethhdr));
++	memcpy(fwd_hdr, &hdr, hdrlen - 2);
++	qos = ieee80211_get_qos_ctl(fwd_hdr);
++	qos[0] = qos[1] = 0;
++
++	skb_reset_mac_header(fwd_skb);
++	hdrlen += mesh_hdrlen;
++	if (ieee80211_get_8023_tunnel_proto(fwd_skb->data + hdrlen,
++					    &fwd_skb->protocol))
++		hdrlen += ETH_ALEN;
++	else
++		fwd_skb->protocol = htons(fwd_skb->len - hdrlen);
++	skb_set_network_header(fwd_skb, hdrlen);
++
++	info = IEEE80211_SKB_CB(fwd_skb);
++	memset(info, 0, sizeof(*info));
++	info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
++	info->control.vif = &sdata->vif;
++	info->control.jiffies = jiffies;
++	if (multicast) {
++		IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_mcast);
++		memcpy(fwd_hdr->addr2, sdata->vif.addr, ETH_ALEN);
++		/* update power mode indication when forwarding */
++		ieee80211_mps_set_frame_flags(sdata, NULL, fwd_hdr);
++	} else if (!mesh_nexthop_lookup(sdata, fwd_skb)) {
++		/* mesh power mode flags updated in mesh_nexthop_lookup */
++		IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_unicast);
++	} else {
++		/* unable to resolve next hop */
++		if (sta)
++			mesh_path_error_tx(sdata, ifmsh->mshcfg.element_ttl,
++					   hdr.addr3, 0,
++					   WLAN_REASON_MESH_PATH_NOFORWARD,
++					   sta->sta.addr);
++		IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_no_route);
++		kfree_skb(fwd_skb);
++		goto rx_accept;
++	}
++
++	IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_frames);
++	fwd_skb->dev = sdata->dev;
++	ieee80211_add_pending_skb(local, fwd_skb);
++
++rx_accept:
++	if (!skb)
++		return RX_QUEUED;
++
++	ieee80211_strip_8023_mesh_hdr(skb);
++#endif
++
++	return RX_CONTINUE;
++}
++
+ static ieee80211_rx_result debug_noinline
+ __ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx, u8 data_offset)
+ {
+@@ -2728,8 +2896,10 @@ __ieee80211_rx_h_amsdu(struct ieee80211_
+ 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
+ 	__le16 fc = hdr->frame_control;
+ 	struct sk_buff_head frame_list;
++	static ieee80211_rx_result res;
+ 	struct ethhdr ethhdr;
+ 	const u8 *check_da = ethhdr.h_dest, *check_sa = ethhdr.h_source;
++	bool mesh = false;
+ 
+ 	if (unlikely(ieee80211_has_a4(hdr->frame_control))) {
+ 		check_da = NULL;
+@@ -2746,6 +2916,8 @@ __ieee80211_rx_h_amsdu(struct ieee80211_
+ 			break;
+ 		case NL80211_IFTYPE_MESH_POINT:
+ 			check_sa = NULL;
++			check_da = NULL;
++			mesh = true;
+ 			break;
+ 		default:
+ 			break;
+@@ -2763,17 +2935,29 @@ __ieee80211_rx_h_amsdu(struct ieee80211_
+ 	ieee80211_amsdu_to_8023s(skb, &frame_list, dev->dev_addr,
+ 				 rx->sdata->vif.type,
+ 				 rx->local->hw.extra_tx_headroom,
+-				 check_da, check_sa);
++				 check_da, check_sa, mesh);
+ 
+ 	while (!skb_queue_empty(&frame_list)) {
+ 		rx->skb = __skb_dequeue(&frame_list);
+ 
+-		if (!ieee80211_frame_allowed(rx, fc)) {
+-			dev_kfree_skb(rx->skb);
++		res = ieee80211_rx_mesh_data(rx->sdata, rx->sta, rx->skb);
++		switch (res) {
++		case RX_QUEUED:
+ 			continue;
++		case RX_CONTINUE:
++			break;
++		default:
++			goto free;
+ 		}
+ 
++		if (!ieee80211_frame_allowed(rx, fc))
++			goto free;
++
+ 		ieee80211_deliver_skb(rx);
++		continue;
++
++free:
++		dev_kfree_skb(rx->skb);
+ 	}
+ 
+ 	return RX_QUEUED;
+@@ -2806,6 +2990,8 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx
+ 			if (!rx->sdata->u.mgd.use_4addr)
+ 				return RX_DROP_UNUSABLE;
+ 			break;
++		case NL80211_IFTYPE_MESH_POINT:
++			break;
+ 		default:
+ 			return RX_DROP_UNUSABLE;
+ 		}
+@@ -2834,155 +3020,6 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx
+ 	return __ieee80211_rx_h_amsdu(rx, 0);
+ }
+ 
+-#ifdef CPTCFG_MAC80211_MESH
+-static ieee80211_rx_result
+-ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
+-{
+-	struct ieee80211_hdr *fwd_hdr, *hdr;
+-	struct ieee80211_tx_info *info;
+-	struct ieee80211s_hdr *mesh_hdr;
+-	struct sk_buff *skb = rx->skb, *fwd_skb;
+-	struct ieee80211_local *local = rx->local;
+-	struct ieee80211_sub_if_data *sdata = rx->sdata;
+-	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
+-	u16 ac, q, hdrlen;
+-	int tailroom = 0;
+-
+-	hdr = (struct ieee80211_hdr *) skb->data;
+-	hdrlen = ieee80211_hdrlen(hdr->frame_control);
+-
+-	/* make sure fixed part of mesh header is there, also checks skb len */
+-	if (!pskb_may_pull(rx->skb, hdrlen + 6))
+-		return RX_DROP_MONITOR;
+-
+-	mesh_hdr = (struct ieee80211s_hdr *) (skb->data + hdrlen);
+-
+-	/* make sure full mesh header is there, also checks skb len */
+-	if (!pskb_may_pull(rx->skb,
+-			   hdrlen + ieee80211_get_mesh_hdrlen(mesh_hdr)))
+-		return RX_DROP_MONITOR;
+-
+-	/* reload pointers */
+-	hdr = (struct ieee80211_hdr *) skb->data;
+-	mesh_hdr = (struct ieee80211s_hdr *) (skb->data + hdrlen);
+-
+-	if (ieee80211_drop_unencrypted(rx, hdr->frame_control)) {
+-		int offset = hdrlen + ieee80211_get_mesh_hdrlen(mesh_hdr) +
+-			     sizeof(rfc1042_header);
+-		__be16 ethertype;
+-
+-		if (!ether_addr_equal(hdr->addr1, rx->sdata->vif.addr) ||
+-		    skb_copy_bits(rx->skb, offset, &ethertype, 2) != 0 ||
+-		    ethertype != rx->sdata->control_port_protocol)
+-			return RX_DROP_MONITOR;
+-	}
+-
+-	/* frame is in RMC, don't forward */
+-	if (ieee80211_is_data(hdr->frame_control) &&
+-	    is_multicast_ether_addr(hdr->addr1) &&
+-	    mesh_rmc_check(rx->sdata, hdr->addr3, mesh_hdr))
+-		return RX_DROP_MONITOR;
+-
+-	if (!ieee80211_is_data(hdr->frame_control))
+-		return RX_CONTINUE;
+-
+-	if (!mesh_hdr->ttl)
+-		return RX_DROP_MONITOR;
+-
+-	if (mesh_hdr->flags & MESH_FLAGS_AE) {
+-		struct mesh_path *mppath;
+-		char *proxied_addr;
+-		char *mpp_addr;
+-
+-		if (is_multicast_ether_addr(hdr->addr1)) {
+-			mpp_addr = hdr->addr3;
+-			proxied_addr = mesh_hdr->eaddr1;
+-		} else if ((mesh_hdr->flags & MESH_FLAGS_AE) ==
+-			    MESH_FLAGS_AE_A5_A6) {
+-			/* has_a4 already checked in ieee80211_rx_mesh_check */
+-			mpp_addr = hdr->addr4;
+-			proxied_addr = mesh_hdr->eaddr2;
+-		} else {
+-			return RX_DROP_MONITOR;
+-		}
+-
+-		rcu_read_lock();
+-		mppath = mpp_path_lookup(sdata, proxied_addr);
+-		if (!mppath) {
+-			mpp_path_add(sdata, proxied_addr, mpp_addr);
+-		} else {
+-			spin_lock_bh(&mppath->state_lock);
+-			if (!ether_addr_equal(mppath->mpp, mpp_addr))
+-				memcpy(mppath->mpp, mpp_addr, ETH_ALEN);
+-			mppath->exp_time = jiffies;
+-			spin_unlock_bh(&mppath->state_lock);
+-		}
+-		rcu_read_unlock();
+-	}
+-
+-	/* Frame has reached destination.  Don't forward */
+-	if (!is_multicast_ether_addr(hdr->addr1) &&
+-	    ether_addr_equal(sdata->vif.addr, hdr->addr3))
+-		return RX_CONTINUE;
+-
+-	ac = ieee802_1d_to_ac[skb->priority];
+-	skb_set_queue_mapping(skb, ac);
+-
+-	if (!--mesh_hdr->ttl) {
+-		if (!is_multicast_ether_addr(hdr->addr1))
+-			IEEE80211_IFSTA_MESH_CTR_INC(ifmsh,
+-						     dropped_frames_ttl);
+-		goto out;
+-	}
+-
+-	if (!ifmsh->mshcfg.dot11MeshForwarding)
+-		goto out;
+-
+-	if (sdata->crypto_tx_tailroom_needed_cnt)
+-		tailroom = IEEE80211_ENCRYPT_TAILROOM;
+-
+-	fwd_skb = skb_copy_expand(skb, local->tx_headroom +
+-				       IEEE80211_ENCRYPT_HEADROOM,
+-				  tailroom, GFP_ATOMIC);
+-	if (!fwd_skb)
+-		goto out;
+-
+-	fwd_skb->dev = sdata->dev;
+-	fwd_hdr =  (struct ieee80211_hdr *) fwd_skb->data;
+-	fwd_hdr->frame_control &= ~cpu_to_le16(IEEE80211_FCTL_RETRY);
+-	info = IEEE80211_SKB_CB(fwd_skb);
+-	memset(info, 0, sizeof(*info));
+-	info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
+-	info->control.vif = &rx->sdata->vif;
+-	info->control.jiffies = jiffies;
+-	if (is_multicast_ether_addr(fwd_hdr->addr1)) {
+-		IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_mcast);
+-		memcpy(fwd_hdr->addr2, sdata->vif.addr, ETH_ALEN);
+-		/* update power mode indication when forwarding */
+-		ieee80211_mps_set_frame_flags(sdata, NULL, fwd_hdr);
+-	} else if (!mesh_nexthop_lookup(sdata, fwd_skb)) {
+-		/* mesh power mode flags updated in mesh_nexthop_lookup */
+-		IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_unicast);
+-	} else {
+-		/* unable to resolve next hop */
+-		mesh_path_error_tx(sdata, ifmsh->mshcfg.element_ttl,
+-				   fwd_hdr->addr3, 0,
+-				   WLAN_REASON_MESH_PATH_NOFORWARD,
+-				   fwd_hdr->addr2);
+-		IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_no_route);
+-		kfree_skb(fwd_skb);
+-		return RX_DROP_MONITOR;
+-	}
+-
+-	IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_frames);
+-	ieee80211_add_pending_skb(local, fwd_skb);
+- out:
+-	if (is_multicast_ether_addr(hdr->addr1))
+-		return RX_CONTINUE;
+-	return RX_DROP_MONITOR;
+-}
+-#endif
+-
+ static ieee80211_rx_result debug_noinline
+ ieee80211_rx_h_data(struct ieee80211_rx_data *rx)
+ {
+@@ -2991,6 +3028,7 @@ ieee80211_rx_h_data(struct ieee80211_rx_
+ 	struct net_device *dev = sdata->dev;
+ 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data;
+ 	__le16 fc = hdr->frame_control;
++	static ieee80211_rx_result res;
+ 	bool port_control;
+ 	int err;
+ 
+@@ -3017,6 +3055,10 @@ ieee80211_rx_h_data(struct ieee80211_rx_
+ 	if (unlikely(err))
+ 		return RX_DROP_UNUSABLE;
+ 
++	res = ieee80211_rx_mesh_data(rx->sdata, rx->sta, rx->skb);
++	if (res != RX_CONTINUE)
++		return res;
++
+ 	if (!ieee80211_frame_allowed(rx, fc))
+ 		return RX_DROP_MONITOR;
+ 
+@@ -3987,10 +4029,6 @@ static void ieee80211_rx_handlers(struct
+ 		CALL_RXH(ieee80211_rx_h_defragment);
+ 		CALL_RXH(ieee80211_rx_h_michael_mic_verify);
+ 		/* must be after MMIC verify so header is counted in MPDU mic */
+-#ifdef CPTCFG_MAC80211_MESH
+-		if (ieee80211_vif_is_mesh(&rx->sdata->vif))
+-			CALL_RXH(ieee80211_rx_h_mesh_fwding);
+-#endif
+ 		CALL_RXH(ieee80211_rx_h_amsdu);
+ 		CALL_RXH(ieee80211_rx_h_data);
+ 
+--- a/net/wireless/util.c
++++ b/net/wireless/util.c
+@@ -542,7 +542,7 @@ unsigned int ieee80211_get_mesh_hdrlen(s
+ }
+ EXPORT_SYMBOL(ieee80211_get_mesh_hdrlen);
+ 
+-static bool ieee80211_get_8023_tunnel_proto(const void *hdr, __be16 *proto)
++bool ieee80211_get_8023_tunnel_proto(const void *hdr, __be16 *proto)
+ {
+ 	const __be16 *hdr_proto = hdr + ETH_ALEN;
+ 
+@@ -556,6 +556,49 @@ static bool ieee80211_get_8023_tunnel_pr
+ 
+ 	return true;
+ }
++EXPORT_SYMBOL(ieee80211_get_8023_tunnel_proto);
++
++int ieee80211_strip_8023_mesh_hdr(struct sk_buff *skb)
++{
++	const void *mesh_addr;
++	struct {
++		struct ethhdr eth;
++		u8 flags;
++	} payload;
++	int hdrlen;
++	int ret;
++
++	ret = skb_copy_bits(skb, 0, &payload, sizeof(payload));
++	if (ret)
++		return ret;
++
++	hdrlen = sizeof(payload.eth) + __ieee80211_get_mesh_hdrlen(payload.flags);
++
++	if (likely(pskb_may_pull(skb, hdrlen + 8) &&
++		   ieee80211_get_8023_tunnel_proto(skb->data + hdrlen,
++						   &payload.eth.h_proto)))
++		hdrlen += ETH_ALEN + 2;
++	else if (!pskb_may_pull(skb, hdrlen))
++		return -EINVAL;
++
++	mesh_addr = skb->data + sizeof(payload.eth) + ETH_ALEN;
++	switch (payload.flags & MESH_FLAGS_AE) {
++	case MESH_FLAGS_AE_A4:
++		memcpy(&payload.eth.h_source, mesh_addr, ETH_ALEN);
++		break;
++	case MESH_FLAGS_AE_A5_A6:
++		memcpy(&payload.eth.h_dest, mesh_addr, 2 * ETH_ALEN);
++		break;
++	default:
++		break;
++	}
++
++	pskb_pull(skb, hdrlen - sizeof(payload.eth));
++	memcpy(skb->data, &payload.eth, sizeof(payload.eth));
++
++	return 0;
++}
++EXPORT_SYMBOL(ieee80211_strip_8023_mesh_hdr);
+ 
+ int ieee80211_data_to_8023_exthdr(struct sk_buff *skb, struct ethhdr *ehdr,
+ 				  const u8 *addr, enum nl80211_iftype iftype,
+@@ -568,7 +611,6 @@ int ieee80211_data_to_8023_exthdr(struct
+ 	} payload;
+ 	struct ethhdr tmp;
+ 	u16 hdrlen;
+-	u8 mesh_flags = 0;
+ 
+ 	if (unlikely(!ieee80211_is_data_present(hdr->frame_control)))
+ 		return -1;
+@@ -589,12 +631,6 @@ int ieee80211_data_to_8023_exthdr(struct
+ 	memcpy(tmp.h_dest, ieee80211_get_DA(hdr), ETH_ALEN);
+ 	memcpy(tmp.h_source, ieee80211_get_SA(hdr), ETH_ALEN);
+ 
+-	if (iftype == NL80211_IFTYPE_MESH_POINT &&
+-	    skb_copy_bits(skb, hdrlen, &mesh_flags, 1) < 0)
+-		return -1;
+-
+-	mesh_flags &= MESH_FLAGS_AE;
+-
+ 	switch (hdr->frame_control &
+ 		cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) {
+ 	case cpu_to_le16(IEEE80211_FCTL_TODS):
+@@ -608,17 +644,6 @@ int ieee80211_data_to_8023_exthdr(struct
+ 			     iftype != NL80211_IFTYPE_AP_VLAN &&
+ 			     iftype != NL80211_IFTYPE_STATION))
+ 			return -1;
+-		if (iftype == NL80211_IFTYPE_MESH_POINT) {
+-			if (mesh_flags == MESH_FLAGS_AE_A4)
+-				return -1;
+-			if (mesh_flags == MESH_FLAGS_AE_A5_A6 &&
+-			    skb_copy_bits(skb, hdrlen +
+-					  offsetof(struct ieee80211s_hdr, eaddr1),
+-					  tmp.h_dest, 2 * ETH_ALEN) < 0)
+-				return -1;
+-
+-			hdrlen += __ieee80211_get_mesh_hdrlen(mesh_flags);
+-		}
+ 		break;
+ 	case cpu_to_le16(IEEE80211_FCTL_FROMDS):
+ 		if ((iftype != NL80211_IFTYPE_STATION &&
+@@ -627,16 +652,6 @@ int ieee80211_data_to_8023_exthdr(struct
+ 		    (is_multicast_ether_addr(tmp.h_dest) &&
+ 		     ether_addr_equal(tmp.h_source, addr)))
+ 			return -1;
+-		if (iftype == NL80211_IFTYPE_MESH_POINT) {
+-			if (mesh_flags == MESH_FLAGS_AE_A5_A6)
+-				return -1;
+-			if (mesh_flags == MESH_FLAGS_AE_A4 &&
+-			    skb_copy_bits(skb, hdrlen +
+-					  offsetof(struct ieee80211s_hdr, eaddr1),
+-					  tmp.h_source, ETH_ALEN) < 0)
+-				return -1;
+-			hdrlen += __ieee80211_get_mesh_hdrlen(mesh_flags);
+-		}
+ 		break;
+ 	case cpu_to_le16(0):
+ 		if (iftype != NL80211_IFTYPE_ADHOC &&
+@@ -646,7 +661,7 @@ int ieee80211_data_to_8023_exthdr(struct
+ 		break;
+ 	}
+ 
+-	if (likely(!is_amsdu &&
++	if (likely(!is_amsdu && iftype != NL80211_IFTYPE_MESH_POINT &&
+ 		   skb_copy_bits(skb, hdrlen, &payload, sizeof(payload)) == 0 &&
+ 		   ieee80211_get_8023_tunnel_proto(&payload, &tmp.h_proto))) {
+ 		/* remove RFC1042 or Bridge-Tunnel encapsulation */
+@@ -722,7 +737,8 @@ __ieee80211_amsdu_copy_frag(struct sk_bu
+ 
+ static struct sk_buff *
+ __ieee80211_amsdu_copy(struct sk_buff *skb, unsigned int hlen,
+-		       int offset, int len, bool reuse_frag)
++		       int offset, int len, bool reuse_frag,
++		       int min_len)
+ {
+ 	struct sk_buff *frame;
+ 	int cur_len = len;
+@@ -736,7 +752,7 @@ __ieee80211_amsdu_copy(struct sk_buff *s
+ 	 * in the stack later.
+ 	 */
+ 	if (reuse_frag)
+-		cur_len = min_t(int, len, 32);
++		cur_len = min_t(int, len, min_len);
+ 
+ 	/*
+ 	 * Allocate and reserve two bytes more for payload
+@@ -746,6 +762,7 @@ __ieee80211_amsdu_copy(struct sk_buff *s
+ 	if (!frame)
+ 		return NULL;
+ 
++	frame->priority = skb->priority;
+ 	skb_reserve(frame, hlen + sizeof(struct ethhdr) + 2);
+ 	skb_copy_bits(skb, offset, skb_put(frame, cur_len), cur_len);
+ 
+@@ -762,23 +779,37 @@ __ieee80211_amsdu_copy(struct sk_buff *s
+ void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,
+ 			      const u8 *addr, enum nl80211_iftype iftype,
+ 			      const unsigned int extra_headroom,
+-			      const u8 *check_da, const u8 *check_sa)
++			      const u8 *check_da, const u8 *check_sa,
++			      bool mesh_control)
+ {
+ 	unsigned int hlen = ALIGN(extra_headroom, 4);
+ 	struct sk_buff *frame = NULL;
+ 	int offset = 0, remaining;
+-	struct ethhdr eth;
++	struct {
++		struct ethhdr eth;
++		uint8_t flags;
++	} hdr;
+ 	bool reuse_frag = skb->head_frag && !skb_has_frag_list(skb);
+ 	bool reuse_skb = false;
+ 	bool last = false;
++	int copy_len = sizeof(hdr.eth);
++
++	if (iftype == NL80211_IFTYPE_MESH_POINT)
++		copy_len = sizeof(hdr);
+ 
+ 	while (!last) {
+ 		unsigned int subframe_len;
+-		int len;
++		int len, mesh_len = 0;
+ 		u8 padding;
+ 
+-		skb_copy_bits(skb, offset, &eth, sizeof(eth));
+-		len = ntohs(eth.h_proto);
++		skb_copy_bits(skb, offset, &hdr, copy_len);
++		if (iftype == NL80211_IFTYPE_MESH_POINT)
++			mesh_len = __ieee80211_get_mesh_hdrlen(hdr.flags);
++		if (mesh_control)
++			len = le16_to_cpu(*(__le16 *)&hdr.eth.h_proto) + mesh_len;
++		else
++			len = ntohs(hdr.eth.h_proto);
++
+ 		subframe_len = sizeof(struct ethhdr) + len;
+ 		padding = (4 - subframe_len) & 0x3;
+ 
+@@ -787,16 +818,16 @@ void ieee80211_amsdu_to_8023s(struct sk_
+ 		if (subframe_len > remaining)
+ 			goto purge;
+ 		/* mitigate A-MSDU aggregation injection attacks */
+-		if (ether_addr_equal(eth.h_dest, rfc1042_header))
++		if (ether_addr_equal(hdr.eth.h_dest, rfc1042_header))
+ 			goto purge;
+ 
+ 		offset += sizeof(struct ethhdr);
+ 		last = remaining <= subframe_len + padding;
+ 
+ 		/* FIXME: should we really accept multicast DA? */
+-		if ((check_da && !is_multicast_ether_addr(eth.h_dest) &&
+-		     !ether_addr_equal(check_da, eth.h_dest)) ||
+-		    (check_sa && !ether_addr_equal(check_sa, eth.h_source))) {
++		if ((check_da && !is_multicast_ether_addr(hdr.eth.h_dest) &&
++		     !ether_addr_equal(check_da, hdr.eth.h_dest)) ||
++		    (check_sa && !ether_addr_equal(check_sa, hdr.eth.h_source))) {
+ 			offset += len + padding;
+ 			continue;
+ 		}
+@@ -808,7 +839,7 @@ void ieee80211_amsdu_to_8023s(struct sk_
+ 			reuse_skb = true;
+ 		} else {
+ 			frame = __ieee80211_amsdu_copy(skb, hlen, offset, len,
+-						       reuse_frag);
++						       reuse_frag, 32 + mesh_len);
+ 			if (!frame)
+ 				goto purge;
+ 
+@@ -819,10 +850,11 @@ void ieee80211_amsdu_to_8023s(struct sk_
+ 		frame->dev = skb->dev;
+ 		frame->priority = skb->priority;
+ 
+-		if (likely(ieee80211_get_8023_tunnel_proto(frame->data, &eth.h_proto)))
++		if (likely(iftype != NL80211_IFTYPE_MESH_POINT &&
++			   ieee80211_get_8023_tunnel_proto(frame->data, &hdr.eth.h_proto)))
+ 			skb_pull(frame, ETH_ALEN + 2);
+ 
+-		memcpy(skb_push(frame, sizeof(eth)), &eth, sizeof(eth));
++		memcpy(skb_push(frame, sizeof(hdr.eth)), &hdr.eth, sizeof(hdr.eth));
+ 		__skb_queue_tail(list, frame);
+ 	}
+ 
diff --git a/package/kernel/mac80211/patches/subsys/316-wifi-mac80211-add-a-workaround-for-receiving-non-sta.patch b/package/kernel/mac80211/patches/subsys/316-wifi-mac80211-add-a-workaround-for-receiving-non-sta.patch
new file mode 100644
index 0000000000..6dc98ae16a
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/316-wifi-mac80211-add-a-workaround-for-receiving-non-sta.patch
@@ -0,0 +1,145 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Fri, 9 Dec 2022 21:15:04 +0100
+Subject: [PATCH] wifi: mac80211: add a workaround for receiving
+ non-standard mesh A-MSDU
+
+At least ath10k and ath11k supported hardware (maybe more) does not implement
+mesh A-MSDU aggregation in a standard compliant way.
+802.11-2020 9.3.2.2.2 declares that the Mesh Control field is part of the
+A-MSDU header. As such, its length must not be included in the subframe
+length field.
+Hardware affected by this bug treats the mesh control field as part of the
+MSDU data and sets the length accordingly.
+In order to avoid packet loss, keep track of which stations are affected
+by this and take it into account when converting A-MSDU to 802.3 + mesh control
+packets.
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/include/net/cfg80211.h
++++ b/include/net/cfg80211.h
+@@ -6194,6 +6194,19 @@ static inline int ieee80211_data_to_8023
+ }
+ 
+ /**
++ * ieee80211_is_valid_amsdu - check if subframe lengths of an A-MSDU are valid
++ *
++ * This is used to detect non-standard A-MSDU frames, e.g. the ones generated
++ * by ath10k and ath11k, where the subframe length includes the length of the
++ * mesh control field.
++ *
++ * @skb: The input A-MSDU frame without any headers.
++ * @mesh_hdr: use standard compliant mesh A-MSDU subframe header
++ * Returns: true if subframe header lengths are valid for the @mesh_hdr mode
++ */
++bool ieee80211_is_valid_amsdu(struct sk_buff *skb, bool mesh_hdr);
++
++/**
+  * ieee80211_amsdu_to_8023s - decode an IEEE 802.11n A-MSDU frame
+  *
+  * Decode an IEEE 802.11 A-MSDU and convert it to a list of 802.3 frames.
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -2899,7 +2899,6 @@ __ieee80211_rx_h_amsdu(struct ieee80211_
+ 	static ieee80211_rx_result res;
+ 	struct ethhdr ethhdr;
+ 	const u8 *check_da = ethhdr.h_dest, *check_sa = ethhdr.h_source;
+-	bool mesh = false;
+ 
+ 	if (unlikely(ieee80211_has_a4(hdr->frame_control))) {
+ 		check_da = NULL;
+@@ -2917,7 +2916,6 @@ __ieee80211_rx_h_amsdu(struct ieee80211_
+ 		case NL80211_IFTYPE_MESH_POINT:
+ 			check_sa = NULL;
+ 			check_da = NULL;
+-			mesh = true;
+ 			break;
+ 		default:
+ 			break;
+@@ -2932,10 +2930,21 @@ __ieee80211_rx_h_amsdu(struct ieee80211_
+ 					  data_offset, true))
+ 		return RX_DROP_UNUSABLE;
+ 
++	if (rx->sta && rx->sta->amsdu_mesh_control < 0) {
++		bool valid_std = ieee80211_is_valid_amsdu(skb, true);
++		bool valid_nonstd = ieee80211_is_valid_amsdu(skb, false);
++
++		if (valid_std && !valid_nonstd)
++			rx->sta->amsdu_mesh_control = 1;
++		else if (valid_nonstd && !valid_std)
++			rx->sta->amsdu_mesh_control = 0;
++	}
++
+ 	ieee80211_amsdu_to_8023s(skb, &frame_list, dev->dev_addr,
+ 				 rx->sdata->vif.type,
+ 				 rx->local->hw.extra_tx_headroom,
+-				 check_da, check_sa, mesh);
++				 check_da, check_sa,
++				 rx->sta->amsdu_mesh_control);
+ 
+ 	while (!skb_queue_empty(&frame_list)) {
+ 		rx->skb = __skb_dequeue(&frame_list);
+--- a/net/mac80211/sta_info.c
++++ b/net/mac80211/sta_info.c
+@@ -591,6 +591,9 @@ __sta_info_alloc(struct ieee80211_sub_if
+ 
+ 	sta->sta_state = IEEE80211_STA_NONE;
+ 
++	if (sdata->vif.type == NL80211_IFTYPE_MESH_POINT)
++		sta->amsdu_mesh_control = -1;
++
+ 	/* Mark TID as unreserved */
+ 	sta->reserved_tid = IEEE80211_TID_UNRESERVED;
+ 
+--- a/net/mac80211/sta_info.h
++++ b/net/mac80211/sta_info.h
+@@ -702,6 +702,7 @@ struct sta_info {
+ 	struct codel_params cparams;
+ 
+ 	u8 reserved_tid;
++	s8 amsdu_mesh_control;
+ 
+ 	struct cfg80211_chan_def tdls_chandef;
+ 
+--- a/net/wireless/util.c
++++ b/net/wireless/util.c
+@@ -776,6 +776,38 @@ __ieee80211_amsdu_copy(struct sk_buff *s
+ 	return frame;
+ }
+ 
++bool ieee80211_is_valid_amsdu(struct sk_buff *skb, bool mesh_hdr)
++{
++	int offset = 0, remaining, subframe_len, padding;
++
++	for (offset = 0; offset < skb->len; offset += subframe_len + padding) {
++		struct {
++		    __be16 len;
++		    u8 mesh_flags;
++		} hdr;
++		u16 len;
++
++		if (skb_copy_bits(skb, offset + 2 * ETH_ALEN, &hdr, sizeof(hdr)) < 0)
++			return false;
++
++		if (mesh_hdr)
++			len = le16_to_cpu(*(__le16 *)&hdr.len) +
++			      __ieee80211_get_mesh_hdrlen(hdr.mesh_flags);
++		else
++			len = ntohs(hdr.len);
++
++		subframe_len = sizeof(struct ethhdr) + len;
++		padding = (4 - subframe_len) & 0x3;
++		remaining = skb->len - offset;
++
++		if (subframe_len > remaining)
++			return false;
++	}
++
++	return true;
++}
++EXPORT_SYMBOL(ieee80211_is_valid_amsdu);
++
+ void ieee80211_amsdu_to_8023s(struct sk_buff *skb, struct sk_buff_head *list,
+ 			      const u8 *addr, enum nl80211_iftype iftype,
+ 			      const unsigned int extra_headroom,
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 13b374aae7..70d4e89c90 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
@@ -87,7 +87,7 @@
  	CFG80211_TESTMODE_DUMP(ieee80211_testmode_dump)
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -1521,6 +1521,7 @@ struct ieee80211_local {
+@@ -1520,6 +1520,7 @@ struct ieee80211_local {
  	int dynamic_ps_forced_timeout;
  
  	int user_power_level; /* in dBm, for all interfaces */
diff --git a/package/kernel/mac80211/patches/subsys/800-mac80211-mask-nested-A-MSDU-support-for-mesh.patch b/package/kernel/mac80211/patches/subsys/800-mac80211-mask-nested-A-MSDU-support-for-mesh.patch
deleted file mode 100644
index 56cc523022..0000000000
--- a/package/kernel/mac80211/patches/subsys/800-mac80211-mask-nested-A-MSDU-support-for-mesh.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 313d8c18385f10957402b475f9b0c209ceab6c5a Mon Sep 17 00:00:00 2001
-From: David Bauer <mail at david-bauer.net>
-Date: Fri, 8 Oct 2021 00:25:19 +0200
-Subject: [PATCH] mac80211: mask nested A-MSDU support for mesh
-
-mac80211 incorrectly processes A-MSDUs contained in A-MPDU frames. This
-results in dropped packets and severely impacted throughput.
-
-As a workaround, don't indicate support for A-MSDUs contained in
-A-MPDUs. This improves throughput over mesh links by factor 10.
-
-Ref: https://github.com/openwrt/mt76/issues/450
-
-Signed-off-by: David Bauer <mail at david-bauer.net>
----
- net/mac80211/agg-rx.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
---- a/net/mac80211/agg-rx.c
-+++ b/net/mac80211/agg-rx.c
-@@ -254,7 +254,11 @@ static void ieee80211_send_addba_resp(st
- 	mgmt->u.action.u.addba_resp.action_code = WLAN_ACTION_ADDBA_RESP;
- 	mgmt->u.action.u.addba_resp.dialog_token = dialog_token;
- 
--	capab = u16_encode_bits(amsdu, IEEE80211_ADDBA_PARAM_AMSDU_MASK);
-+	capab = 0;
-+#ifdef CPTCFG_MAC80211_MESH
-+	if (!sta->mesh)
-+#endif
-+		capab = u16_encode_bits(amsdu, IEEE80211_ADDBA_PARAM_AMSDU_MASK);
- 	capab |= u16_encode_bits(policy, IEEE80211_ADDBA_PARAM_POLICY_MASK);
- 	capab |= u16_encode_bits(tid, IEEE80211_ADDBA_PARAM_TID_MASK);
- 	capab |= u16_encode_bits(buf_size, IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK);



From lede-commits at lists.infradead.org  Mon Feb 13 03:14:24 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 13 Feb 2023 06:14:24 -0500
Subject: [openwrt/openwrt]  realtek: fix memory leak in netevent handler
In-Reply-To: <167628686402.3321915.8411099424730051037@git-01.infra.openwrt.org>
References: <167628686402.3321915.8411099424730051037@git-01.infra.openwrt.org>
Message-ID: <mailman.15199.1676286870.3064139.lede-commits@lists.infradead.org>

svanheule pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/65b2bcbf5f0037f24e3772b2c96de03230fdaaf7

commit 65b2bcbf5f0037f24e3772b2c96de03230fdaaf7
Author: Jan Hoffmann <jan at 3e8.eu>
AuthorDate: Wed Feb 8 22:53:32 2023 +0100

    realtek: fix memory leak in netevent handler
    
    The net_event_work struct is allocated, but only freed in a single case.
    Move the allocation to the branch where it is actually needed, and free
    it after the work has been done.
    
    Fixes: 03e1d93e0779 ("realtek: add driver support for routing offload")
    Signed-off-by: Jan Hoffmann <jan at 3e8.eu>
---
 .../realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c | 17 +++++++++--------
 .../realtek/files-5.15/drivers/net/dsa/rtl83xx/common.c | 17 +++++++++--------
 2 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c
index 15e6ed0926..d2d6772300 100644
--- a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c
+++ b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/common.c
@@ -1286,6 +1286,8 @@ static void rtl83xx_net_event_work_do(struct work_struct *work)
 	struct rtl838x_switch_priv *priv = net_work->priv;
 
 	rtl83xx_l3_nexthop_update(priv, net_work->gw_addr, net_work->mac);
+
+	kfree(net_work);
 }
 
 static int rtl83xx_netevent_event(struct notifier_block *this,
@@ -1299,13 +1301,6 @@ static int rtl83xx_netevent_event(struct notifier_block *this,
 
 	priv = container_of(this, struct rtl838x_switch_priv, ne_nb);
 
-	net_work = kzalloc(sizeof(*net_work), GFP_ATOMIC);
-	if (!net_work)
-		return NOTIFY_BAD;
-
-	INIT_WORK(&net_work->work, rtl83xx_net_event_work_do);
-	net_work->priv = priv;
-
 	switch (event) {
 	case NETEVENT_NEIGH_UPDATE:
 		if (n->tbl != &arp_tbl)
@@ -1314,10 +1309,16 @@ static int rtl83xx_netevent_event(struct notifier_block *this,
 		port = rtl83xx_port_dev_lower_find(dev, priv);
 		if (port < 0 || !(n->nud_state & NUD_VALID)) {
 			pr_debug("%s: Neigbour invalid, not updating\n", __func__);
-			kfree(net_work);
 			return NOTIFY_DONE;
 		}
 
+		net_work = kzalloc(sizeof(*net_work), GFP_ATOMIC);
+		if (!net_work)
+			return NOTIFY_BAD;
+
+		INIT_WORK(&net_work->work, rtl83xx_net_event_work_do);
+		net_work->priv = priv;
+
 		net_work->mac = ether_addr_to_u64(n->ha);
 		net_work->gw_addr = *(__be32 *) n->primary_key;
 
diff --git a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/common.c b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/common.c
index 1fa92ae220..3216d7eb83 100644
--- a/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/common.c
+++ b/target/linux/realtek/files-5.15/drivers/net/dsa/rtl83xx/common.c
@@ -1282,6 +1282,8 @@ static void rtl83xx_net_event_work_do(struct work_struct *work)
 	struct rtl838x_switch_priv *priv = net_work->priv;
 
 	rtl83xx_l3_nexthop_update(priv, net_work->gw_addr, net_work->mac);
+
+	kfree(net_work);
 }
 
 static int rtl83xx_netevent_event(struct notifier_block *this,
@@ -1295,13 +1297,6 @@ static int rtl83xx_netevent_event(struct notifier_block *this,
 
 	priv = container_of(this, struct rtl838x_switch_priv, ne_nb);
 
-	net_work = kzalloc(sizeof(*net_work), GFP_ATOMIC);
-	if (!net_work)
-		return NOTIFY_BAD;
-
-	INIT_WORK(&net_work->work, rtl83xx_net_event_work_do);
-	net_work->priv = priv;
-
 	switch (event) {
 	case NETEVENT_NEIGH_UPDATE:
 		if (n->tbl != &arp_tbl)
@@ -1310,10 +1305,16 @@ static int rtl83xx_netevent_event(struct notifier_block *this,
 		port = rtl83xx_port_dev_lower_find(dev, priv);
 		if (port < 0 || !(n->nud_state & NUD_VALID)) {
 			pr_debug("%s: Neigbour invalid, not updating\n", __func__);
-			kfree(net_work);
 			return NOTIFY_DONE;
 		}
 
+		net_work = kzalloc(sizeof(*net_work), GFP_ATOMIC);
+		if (!net_work)
+			return NOTIFY_BAD;
+
+		INIT_WORK(&net_work->work, rtl83xx_net_event_work_do);
+		net_work->priv = priv;
+
 		net_work->mac = ether_addr_to_u64(n->ha);
 		net_work->gw_addr = *(__be32 *) n->primary_key;
 



From lede-commits at lists.infradead.org  Mon Feb 13 03:22:35 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 13 Feb 2023 06:22:35 -0500
Subject: [openwrt/openwrt]  uboot-envtools: add support for APRESIA
 ApresiaLightGS120GT-SS
In-Reply-To: <167628735525.3328073.8020036337915985140@git-01.infra.openwrt.org>
References: <167628735525.3328073.8020036337915985140@git-01.infra.openwrt.org>
Message-ID: <mailman.15202.1676287360.3064139.lede-commits@lists.infradead.org>

svanheule pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/54c5f33b3099256eaac31cad0e407ca87623e3a4

commit 54c5f33b3099256eaac31cad0e407ca87623e3a4
Author: INAGAKI Hiroshi <musashino.open at gmail.com>
AuthorDate: Sun Oct 9 17:43:13 2022 +0900

    uboot-envtools: add support for APRESIA ApresiaLightGS120GT-SS
    
    This patch adds support for APRESIA ApresiaLightGS120GT-SS to
    uboot-envtools.
    
    Signed-off-by: INAGAKI Hiroshi <musashino.open at gmail.com>
---
 package/boot/uboot-envtools/files/realtek | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/package/boot/uboot-envtools/files/realtek b/package/boot/uboot-envtools/files/realtek
index f191503876..cd2446432d 100644
--- a/package/boot/uboot-envtools/files/realtek
+++ b/package/boot/uboot-envtools/files/realtek
@@ -8,6 +8,14 @@ touch /etc/config/ubootenv
 board=$(board_name)
 
 case "$board" in
+apresia,aplgs120gtss)
+	idx="$(find_mtd_index u-boot-env)"
+	[ -n "$idx" ] && \
+		ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x10000"
+	idx2="$(find_mtd_index u-boot-env2)"
+	[ -n "$idx2" ] && \
+		ubootenv_add_uci_sys_config "/dev/mtd$idx2" "0x0" "0x40000" "0x10000"
+	;;
 d-link,dgs-1210-10mp|\
 d-link,dgs-1210-10p|\
 d-link,dgs-1210-16|\



From lede-commits at lists.infradead.org  Mon Feb 13 03:22:36 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 13 Feb 2023 06:22:36 -0500
Subject: [openwrt/openwrt]  realtek: rename cameo specific names in "Build/*"
 definitions
In-Reply-To: <167628735525.3328073.8020036337915985140@git-01.infra.openwrt.org>
References: <167628735525.3328073.8020036337915985140@git-01.infra.openwrt.org>
Message-ID: <mailman.15203.1676287361.3064139.lede-commits@lists.infradead.org>

svanheule pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/d76f0f407b20661008173ac2c54d725509d67e5b

commit d76f0f407b20661008173ac2c54d725509d67e5b
Author: INAGAKI Hiroshi <musashino.open at gmail.com>
AuthorDate: Sat Oct 8 01:07:17 2022 +0900

    realtek: rename cameo specific names in "Build/*" definitions
    
    This patch renames some Cameo specific definitions for image generation.
    The same format is also used on APRESIA ApresiaLightGS series devices, not
    D-Link specific.
    
    Signed-off-by: INAGAKI Hiroshi <musashino.open at gmail.com>
---
 target/linux/realtek/image/Makefile  | 14 +++++++-------
 target/linux/realtek/image/common.mk |  6 +++---
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/target/linux/realtek/image/Makefile b/target/linux/realtek/image/Makefile
index a2afb39d40..f50821d24a 100644
--- a/target/linux/realtek/image/Makefile
+++ b/target/linux/realtek/image/Makefile
@@ -9,8 +9,8 @@ DEVICE_VARS += \
         CAMEO_BOARD_VERSION \
         CAMEO_CUSTOMER_SIGNATURE \
         CAMEO_KERNEL_PART \
+        CAMEO_KERNEL_PART_SIZE \
         CAMEO_ROOTFS_PART \
-        DLINK_KERNEL_PART_SIZE \
         H3C_DEVICE_ID \
         H3C_PRODUCT_ID \
         ZYXEL_VERS
@@ -23,18 +23,18 @@ define Build/zyxel-vers
        done ) >> $@
 endef
 
-define Build/dlink-cameo
-	$(SCRIPT_DIR)/cameo-tag.py $@ $(DLINK_KERNEL_PART_SIZE)
+define Build/cameo-tag
+	$(SCRIPT_DIR)/cameo-tag.py $@ $(CAMEO_KERNEL_PART_SIZE)
 endef
 
-define Build/dlink-version
+define Build/cameo-version
 	echo -n "OpenWrt" >> $@
 	dd if=/dev/zero bs=25 count=1 >> $@
 endef
 
-define Build/dlink-headers
-        dd if=$@ bs=$(DLINK_KERNEL_PART_SIZE) count=1 of=$@.kernel_part; \
-        dd if=$@ bs=$(DLINK_KERNEL_PART_SIZE) skip=1 of=$@.rootfs_part; \
+define Build/cameo-headers
+        dd if=$@ bs=$(CAMEO_KERNEL_PART_SIZE) count=1 of=$@.kernel_part; \
+        dd if=$@ bs=$(CAMEO_KERNEL_PART_SIZE) skip=1 of=$@.rootfs_part; \
         $(SCRIPT_DIR)/cameo-imghdr.py $@.kernel_part $@.kernel_part.hex \
                 "$(DEVICE_MODEL)" os $(CAMEO_KERNEL_PART) \
                 $(CAMEO_CUSTOMER_SIGNATURE) \
diff --git a/target/linux/realtek/image/common.mk b/target/linux/realtek/image/common.mk
index 214683f8e9..1a1d6356a7 100644
--- a/target/linux/realtek/image/common.mk
+++ b/target/linux/realtek/image/common.mk
@@ -9,7 +9,7 @@ define Device/d-link_dgs-1210
 	append-dtb | \
 	libdeflate-gzip | \
 	uImage gzip | \
-	dlink-cameo
+	cameo-tag
   CAMEO_KERNEL_PART := 2
   CAMEO_ROOTFS_PART := 3
   CAMEO_CUSTOMER_SIGNATURE := 2
@@ -22,8 +22,8 @@ define Device/d-link_dgs-1210
 	pad-rootfs | \
 	pad-to 16 | \
 	check-size | \
-	dlink-version | \
-	dlink-headers
+	cameo-version | \
+	cameo-headers
 endef
 
 define Device/hpe_1920



From lede-commits at lists.infradead.org  Mon Feb 13 03:22:38 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 13 Feb 2023 06:22:38 -0500
Subject: [openwrt/openwrt]  realtek: add support for APRESIA
 ApresiaLightGS120GT-SS
In-Reply-To: <167628735525.3328073.8020036337915985140@git-01.infra.openwrt.org>
References: <167628735525.3328073.8020036337915985140@git-01.infra.openwrt.org>
Message-ID: <mailman.15204.1676287364.3064139.lede-commits@lists.infradead.org>

svanheule pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/5163bb5e545eaac30dc5b5a6d75686b26f70667c

commit 5163bb5e545eaac30dc5b5a6d75686b26f70667c
Author: INAGAKI Hiroshi <musashino.open at gmail.com>
AuthorDate: Mon Sep 20 22:28:51 2021 +0900

    realtek: add support for APRESIA ApresiaLightGS120GT-SS
    
    APRESIA ApresiaLightGS120GT-SS (APLGS120GTSS) is a 16 + 4 ports gigabit
    switch, based on RTL8382M.
    
    Specifications:
    
    - SoC          : Realtek RTL8382M
    - RAM          : DDR3 256 MiB (Nanya NT5CC256M8JQ-EK)
    - Flash        : SPI-NOR 32 MiB (Macronix MX25L25635FMI-10G)
    - Ethernet     : 10/100/1000 Mbps x16 + 4
      - port  1-8  : RTL8218B
      - port  9-16 : RTL8382M, TP (SoC, RTL8218B)
      - port 17-20 : RTL8214FC, TP/SFP (Combo)
    - LEDs/Keys    : 3x/1x
    - UART         : through-hole on PCB
      - J6: 3.3V, TX, RX, GND from tri-angle marking side
      - 115200n8
    - Power        : 100-120/200-240 VAC, 50/60 Hz
                     Max. 16 W, Avg 14 W (100 VAC)
      - Plug       : IEC 60320-C13
    
    Flash instruction using factory image:
    
    1. Boot ApresiaLightGS120GT-SS normally
    2. Login to WebUI and open firmware page ("???????")
    3. If the device is booted from image1, set active image for next
       booting ("????????") to image2("????2"), press apply
       ("??") button and reboot the device to make booting from image2
    4. On the WebUI, set active image to image1
    5. Select the OpenWrt factory image and press update button ("??")
    6. Open reboot page ("???") and press reboot button ("?????")
    
    Notes:
    
    - "ApresiaLightGS120GT-SS" is a model name and "APLGS120GTSS" is a model
      number
    
    - this device has 3x GPIO-controlled LEDs on PCB, but 1x LED
      ("green:unused") has no hole on the case
    
    Signed-off-by: INAGAKI Hiroshi <musashino.open at gmail.com>
---
 .../dts-5.10/rtl8382_apresia_aplgs120gtss.dts      | 270 +++++++++++++++++++++
 .../dts-5.15/rtl8382_apresia_aplgs120gtss.dts      | 270 +++++++++++++++++++++
 target/linux/realtek/image/rtl838x.mk              |  16 ++
 3 files changed, 556 insertions(+)

diff --git a/target/linux/realtek/dts-5.10/rtl8382_apresia_aplgs120gtss.dts b/target/linux/realtek/dts-5.10/rtl8382_apresia_aplgs120gtss.dts
new file mode 100644
index 0000000000..15120265c9
--- /dev/null
+++ b/target/linux/realtek/dts-5.10/rtl8382_apresia_aplgs120gtss.dts
@@ -0,0 +1,270 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "rtl838x.dtsi"
+
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	compatible = "apresia,aplgs120gtss", "realtek,rtl8382-soc";
+	model = "APRESIA ApresiaLightGS120GT-SS";
+
+	aliases {
+		led-boot = &led_power;
+		led-failsafe = &led_power;
+		led-running = &led_power;
+		led-upgrade = &led_power;
+	};
+
+	memory at 0 {
+		device_type = "memory";
+		reg = <0x0 0x10000000>;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_power: led-0 {
+			label = "green:pwr";
+			gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_POWER;
+		};
+
+		led-1 {
+			label = "red:loop";
+			gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_FAULT;
+		};
+
+		/* LED chip is soldered, but no hole on the case */
+		led-2 {
+			label = "green:unused";
+			gpios = <&gpio1 36 GPIO_ACTIVE_LOW>;
+			color = <LED_COLOR_ID_GREEN>;
+		};
+	};
+
+	keys {
+		compatible = "gpio-keys-polled";
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio1 33 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	gpio-restart {
+		compatible = "gpio-restart";
+		gpios = <&gpio1 34 GPIO_ACTIVE_LOW>;
+		open-source;
+	};
+
+	gpio1: rtl8231-gpio {
+		compatible = "realtek,rtl8231-gpio";
+		#gpio-cells = <2>;
+		gpio-controller;
+		indirect-access-bus-id = <0>;
+	};
+
+	i2c0: i2c-gpio-0 {
+		compatible = "i2c-gpio";
+		sda-gpios = <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		scl-gpios = <&gpio1 2 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		i2c-gpio,delay-us = <2>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
+
+	i2c1: i2c-gpio-1 {
+		compatible = "i2c-gpio";
+		sda-gpios = <&gpio1 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		scl-gpios = <&gpio1 7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		i2c-gpio,delay-us = <2>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
+
+	i2c2: i2c-gpio-2 {
+		compatible = "i2c-gpio";
+		sda-gpios = <&gpio1 11 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		scl-gpios = <&gpio1 12 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		i2c-gpio,delay-us = <2>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
+
+	i2c3: i2c-gpio-3 {
+		compatible = "i2c-gpio";
+		sda-gpios = <&gpio1 22 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		scl-gpios = <&gpio1 23 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		i2c-gpio,delay-us = <2>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
+
+	/* 4x TX-Disable lines are provided by RTL8214FC */
+	sfp0: sfp-p17 {
+		compatible = "sff,sfp";
+		i2c-bus = <&i2c1>;
+		los-gpio = <&gpio1 9 GPIO_ACTIVE_HIGH>;
+		mod-def0-gpio = <&gpio1 8 GPIO_ACTIVE_LOW>;
+	};
+
+	sfp1: sfp-p18 {
+		compatible = "sff,sfp";
+		i2c-bus = <&i2c0>;
+		los-gpio = <&gpio1 4 GPIO_ACTIVE_HIGH>;
+		mod-def0-gpio = <&gpio1 3 GPIO_ACTIVE_LOW>;
+	};
+
+	sfp2: sfp-p19 {
+		compatible = "sff,sfp";
+		i2c-bus = <&i2c3>;
+		los-gpio = <&gpio1 25 GPIO_ACTIVE_HIGH>;
+		mod-def0-gpio = <&gpio1 24 GPIO_ACTIVE_LOW>;
+	};
+
+	sfp3: sfp-p20 {
+		compatible = "sff,sfp";
+		i2c-bus = <&i2c2>;
+		los-gpio = <&gpio1 14 GPIO_ACTIVE_HIGH>;
+		mod-def0-gpio = <&gpio1 13 GPIO_ACTIVE_LOW>;
+	};
+};
+
+&gpio0 {
+	rtl8231_reset {
+		gpio-hog;
+		gpios = <1 GPIO_ACTIVE_HIGH>;
+		output-high;
+		line-name = "rtl8231-reset";
+	};
+};
+
+&spi0 {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <10000000>;
+
+		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 0x40000>;
+			};
+
+			partition at c0000 {
+				label = "u-boot-env2";
+				reg = <0xc0000 0x40000>;
+			};
+
+			partition at 100000 {
+				compatible = "openwrt,uimage", "denx,uimage";
+				label = "firmware";
+				reg = <0x100000 0xe80000>;
+				openwrt,ih-magic = <0x12345000>;
+			};
+
+			partition at f80000 {
+				label = "firmware2";
+				reg = <0xf80000 0xe80000>;
+			};
+
+			partition at 1e00000 {
+				label = "jffs2";
+				reg = <0x1e00000 0x200000>;
+				read-only;
+			};
+		};
+	};
+};
+
+&ethernet0 {
+	mdio-bus {
+		compatible = "realtek,rtl838x-mdio";
+		regmap = <&ethernet0>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		EXTERNAL_PHY(0)
+		EXTERNAL_PHY(1)
+		EXTERNAL_PHY(2)
+		EXTERNAL_PHY(3)
+		EXTERNAL_PHY(4)
+		EXTERNAL_PHY(5)
+		EXTERNAL_PHY(6)
+		EXTERNAL_PHY(7)
+
+		INTERNAL_PHY(8)
+		INTERNAL_PHY(9)
+		INTERNAL_PHY(10)
+		INTERNAL_PHY(11)
+		INTERNAL_PHY(12)
+		INTERNAL_PHY(13)
+		INTERNAL_PHY(14)
+		INTERNAL_PHY(15)
+
+		EXTERNAL_SFP_PHY_FULL(24, 0)
+		EXTERNAL_SFP_PHY_FULL(25, 1)
+		EXTERNAL_SFP_PHY_FULL(26, 2)
+		EXTERNAL_SFP_PHY_FULL(27, 3)
+	};
+};
+
+&switch0 {
+	ports {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		SWITCH_PORT(0, 1, qsgmii)
+		SWITCH_PORT(1, 2, qsgmii)
+		SWITCH_PORT(2, 3, qsgmii)
+		SWITCH_PORT(3, 4, qsgmii)
+		SWITCH_PORT(4, 5, qsgmii)
+		SWITCH_PORT(5, 6, qsgmii)
+		SWITCH_PORT(6, 7, qsgmii)
+		SWITCH_PORT(7, 8, qsgmii)
+
+		SWITCH_PORT(8, 9, internal)
+		SWITCH_PORT(9, 10, internal)
+		SWITCH_PORT(10, 11, internal)
+		SWITCH_PORT(11, 12, internal)
+		SWITCH_PORT(12, 13, internal)
+		SWITCH_PORT(13, 14, internal)
+		SWITCH_PORT(14, 15, internal)
+		SWITCH_PORT(15, 16, internal)
+
+		SWITCH_PORT(24, 17, qsgmii)
+		SWITCH_PORT(25, 18, qsgmii)
+		SWITCH_PORT(26, 19, qsgmii)
+		SWITCH_PORT(27, 20, qsgmii)
+
+		port at 28 {
+			ethernet = <&ethernet0>;
+			reg = <28>;
+			phy-mode = "internal";
+
+			fixed-link {
+				speed = <1000>;
+				full-duplex;
+			};
+		};
+	};
+};
diff --git a/target/linux/realtek/dts-5.15/rtl8382_apresia_aplgs120gtss.dts b/target/linux/realtek/dts-5.15/rtl8382_apresia_aplgs120gtss.dts
new file mode 100644
index 0000000000..15120265c9
--- /dev/null
+++ b/target/linux/realtek/dts-5.15/rtl8382_apresia_aplgs120gtss.dts
@@ -0,0 +1,270 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "rtl838x.dtsi"
+
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
+
+/ {
+	compatible = "apresia,aplgs120gtss", "realtek,rtl8382-soc";
+	model = "APRESIA ApresiaLightGS120GT-SS";
+
+	aliases {
+		led-boot = &led_power;
+		led-failsafe = &led_power;
+		led-running = &led_power;
+		led-upgrade = &led_power;
+	};
+
+	memory at 0 {
+		device_type = "memory";
+		reg = <0x0 0x10000000>;
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_power: led-0 {
+			label = "green:pwr";
+			gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_POWER;
+		};
+
+		led-1 {
+			label = "red:loop";
+			gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_FAULT;
+		};
+
+		/* LED chip is soldered, but no hole on the case */
+		led-2 {
+			label = "green:unused";
+			gpios = <&gpio1 36 GPIO_ACTIVE_LOW>;
+			color = <LED_COLOR_ID_GREEN>;
+		};
+	};
+
+	keys {
+		compatible = "gpio-keys-polled";
+		poll-interval = <20>;
+
+		reset {
+			label = "reset";
+			gpios = <&gpio1 33 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	gpio-restart {
+		compatible = "gpio-restart";
+		gpios = <&gpio1 34 GPIO_ACTIVE_LOW>;
+		open-source;
+	};
+
+	gpio1: rtl8231-gpio {
+		compatible = "realtek,rtl8231-gpio";
+		#gpio-cells = <2>;
+		gpio-controller;
+		indirect-access-bus-id = <0>;
+	};
+
+	i2c0: i2c-gpio-0 {
+		compatible = "i2c-gpio";
+		sda-gpios = <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		scl-gpios = <&gpio1 2 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		i2c-gpio,delay-us = <2>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
+
+	i2c1: i2c-gpio-1 {
+		compatible = "i2c-gpio";
+		sda-gpios = <&gpio1 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		scl-gpios = <&gpio1 7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		i2c-gpio,delay-us = <2>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
+
+	i2c2: i2c-gpio-2 {
+		compatible = "i2c-gpio";
+		sda-gpios = <&gpio1 11 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		scl-gpios = <&gpio1 12 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		i2c-gpio,delay-us = <2>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
+
+	i2c3: i2c-gpio-3 {
+		compatible = "i2c-gpio";
+		sda-gpios = <&gpio1 22 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		scl-gpios = <&gpio1 23 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
+		i2c-gpio,delay-us = <2>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+	};
+
+	/* 4x TX-Disable lines are provided by RTL8214FC */
+	sfp0: sfp-p17 {
+		compatible = "sff,sfp";
+		i2c-bus = <&i2c1>;
+		los-gpio = <&gpio1 9 GPIO_ACTIVE_HIGH>;
+		mod-def0-gpio = <&gpio1 8 GPIO_ACTIVE_LOW>;
+	};
+
+	sfp1: sfp-p18 {
+		compatible = "sff,sfp";
+		i2c-bus = <&i2c0>;
+		los-gpio = <&gpio1 4 GPIO_ACTIVE_HIGH>;
+		mod-def0-gpio = <&gpio1 3 GPIO_ACTIVE_LOW>;
+	};
+
+	sfp2: sfp-p19 {
+		compatible = "sff,sfp";
+		i2c-bus = <&i2c3>;
+		los-gpio = <&gpio1 25 GPIO_ACTIVE_HIGH>;
+		mod-def0-gpio = <&gpio1 24 GPIO_ACTIVE_LOW>;
+	};
+
+	sfp3: sfp-p20 {
+		compatible = "sff,sfp";
+		i2c-bus = <&i2c2>;
+		los-gpio = <&gpio1 14 GPIO_ACTIVE_HIGH>;
+		mod-def0-gpio = <&gpio1 13 GPIO_ACTIVE_LOW>;
+	};
+};
+
+&gpio0 {
+	rtl8231_reset {
+		gpio-hog;
+		gpios = <1 GPIO_ACTIVE_HIGH>;
+		output-high;
+		line-name = "rtl8231-reset";
+	};
+};
+
+&spi0 {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <10000000>;
+
+		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 0x40000>;
+			};
+
+			partition at c0000 {
+				label = "u-boot-env2";
+				reg = <0xc0000 0x40000>;
+			};
+
+			partition at 100000 {
+				compatible = "openwrt,uimage", "denx,uimage";
+				label = "firmware";
+				reg = <0x100000 0xe80000>;
+				openwrt,ih-magic = <0x12345000>;
+			};
+
+			partition at f80000 {
+				label = "firmware2";
+				reg = <0xf80000 0xe80000>;
+			};
+
+			partition at 1e00000 {
+				label = "jffs2";
+				reg = <0x1e00000 0x200000>;
+				read-only;
+			};
+		};
+	};
+};
+
+&ethernet0 {
+	mdio-bus {
+		compatible = "realtek,rtl838x-mdio";
+		regmap = <&ethernet0>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		EXTERNAL_PHY(0)
+		EXTERNAL_PHY(1)
+		EXTERNAL_PHY(2)
+		EXTERNAL_PHY(3)
+		EXTERNAL_PHY(4)
+		EXTERNAL_PHY(5)
+		EXTERNAL_PHY(6)
+		EXTERNAL_PHY(7)
+
+		INTERNAL_PHY(8)
+		INTERNAL_PHY(9)
+		INTERNAL_PHY(10)
+		INTERNAL_PHY(11)
+		INTERNAL_PHY(12)
+		INTERNAL_PHY(13)
+		INTERNAL_PHY(14)
+		INTERNAL_PHY(15)
+
+		EXTERNAL_SFP_PHY_FULL(24, 0)
+		EXTERNAL_SFP_PHY_FULL(25, 1)
+		EXTERNAL_SFP_PHY_FULL(26, 2)
+		EXTERNAL_SFP_PHY_FULL(27, 3)
+	};
+};
+
+&switch0 {
+	ports {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		SWITCH_PORT(0, 1, qsgmii)
+		SWITCH_PORT(1, 2, qsgmii)
+		SWITCH_PORT(2, 3, qsgmii)
+		SWITCH_PORT(3, 4, qsgmii)
+		SWITCH_PORT(4, 5, qsgmii)
+		SWITCH_PORT(5, 6, qsgmii)
+		SWITCH_PORT(6, 7, qsgmii)
+		SWITCH_PORT(7, 8, qsgmii)
+
+		SWITCH_PORT(8, 9, internal)
+		SWITCH_PORT(9, 10, internal)
+		SWITCH_PORT(10, 11, internal)
+		SWITCH_PORT(11, 12, internal)
+		SWITCH_PORT(12, 13, internal)
+		SWITCH_PORT(13, 14, internal)
+		SWITCH_PORT(14, 15, internal)
+		SWITCH_PORT(15, 16, internal)
+
+		SWITCH_PORT(24, 17, qsgmii)
+		SWITCH_PORT(25, 18, qsgmii)
+		SWITCH_PORT(26, 19, qsgmii)
+		SWITCH_PORT(27, 20, qsgmii)
+
+		port at 28 {
+			ethernet = <&ethernet0>;
+			reg = <28>;
+			phy-mode = "internal";
+
+			fixed-link {
+				speed = <1000>;
+				full-duplex;
+			};
+		};
+	};
+};
diff --git a/target/linux/realtek/image/rtl838x.mk b/target/linux/realtek/image/rtl838x.mk
index b2e0cc91be..192b88fe54 100644
--- a/target/linux/realtek/image/rtl838x.mk
+++ b/target/linux/realtek/image/rtl838x.mk
@@ -12,6 +12,22 @@ define Device/allnet_all-sg8208m
 endef
 TARGET_DEVICES += allnet_all-sg8208m
 
+define Device/apresia_aplgs120gtss
+  $(Device/cameo-fw)
+  SOC := rtl8382
+  IMAGE_SIZE := 14848k
+  DEVICE_VENDOR := APRESIA
+  DEVICE_MODEL := ApresiaLightGS120GT-SS
+  UIMAGE_MAGIC := 0x12345000
+  CAMEO_KERNEL_PART_SIZE := 1572864
+  CAMEO_KERNEL_PART := 3
+  CAMEO_ROOTFS_PART := 4
+  CAMEO_CUSTOMER_SIGNATURE := 2
+  CAMEO_BOARD_MODEL := APLGS120GTSS
+  CAMEO_BOARD_VERSION := 4
+endef
+TARGET_DEVICES += apresia_aplgs120gtss
+
 define Device/d-link_dgs-1210-10mp-f
   $(Device/d-link_dgs-1210)
   SOC := rtl8380



From lede-commits at lists.infradead.org  Mon Feb 13 03:22:37 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 13 Feb 2023 06:22:37 -0500
Subject: [openwrt/openwrt]  realtek: add common definition of cameo based
 firmware
In-Reply-To: <167628735525.3328073.8020036337915985140@git-01.infra.openwrt.org>
References: <167628735525.3328073.8020036337915985140@git-01.infra.openwrt.org>
Message-ID: <mailman.15207.1676287368.3064139.lede-commits@lists.infradead.org>

svanheule pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/5b33916c0a73631871cd34dde8643a209cae2fbb

commit 5b33916c0a73631871cd34dde8643a209cae2fbb
Author: INAGAKI Hiroshi <musashino.open at gmail.com>
AuthorDate: Sat Oct 8 21:46:51 2022 +0900

    realtek: add common definition of cameo based firmware
    
    The cameo-related recipes can also be used for APRESIA ApresiaLightGS
    series devices. So create common definition for the devices manufactured
    by Cameo.
    And also, the model name of ApresiaLightGS120GT-SS is too long for cameo
    header (max: 20 bytes), so use additional variable "CAMEO_BOARD_MODEL"
    in Build/cameo-headers instead of DEVICE_MODEL to use the custom name.
    (default of CAMEO_BOARD_MODEL: DEVICE_MODEL)
    
    Signed-off-by: INAGAKI Hiroshi <musashino.open at gmail.com>
---
 target/linux/realtek/image/Makefile  |  5 +++--
 target/linux/realtek/image/common.mk | 21 +++++++++++++--------
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/target/linux/realtek/image/Makefile b/target/linux/realtek/image/Makefile
index f50821d24a..bb704ac863 100644
--- a/target/linux/realtek/image/Makefile
+++ b/target/linux/realtek/image/Makefile
@@ -6,6 +6,7 @@ include $(INCLUDE_DIR)/image.mk
 KERNEL_LOADADDR = 0x80100000
 
 DEVICE_VARS += \
+        CAMEO_BOARD_MODEL \
         CAMEO_BOARD_VERSION \
         CAMEO_CUSTOMER_SIGNATURE \
         CAMEO_KERNEL_PART \
@@ -36,12 +37,12 @@ define Build/cameo-headers
         dd if=$@ bs=$(CAMEO_KERNEL_PART_SIZE) count=1 of=$@.kernel_part; \
         dd if=$@ bs=$(CAMEO_KERNEL_PART_SIZE) skip=1 of=$@.rootfs_part; \
         $(SCRIPT_DIR)/cameo-imghdr.py $@.kernel_part $@.kernel_part.hex \
-                "$(DEVICE_MODEL)" os $(CAMEO_KERNEL_PART) \
+                "$(CAMEO_BOARD_MODEL)" os $(CAMEO_KERNEL_PART) \
                 $(CAMEO_CUSTOMER_SIGNATURE) \
                 $(CAMEO_BOARD_VERSION) \
                 $(KERNEL_LOADADDR); \
         $(SCRIPT_DIR)/cameo-imghdr.py $@.rootfs_part $@.rootfs_part.hex \
-                "$(DEVICE_MODEL)" squashfs $(CAMEO_ROOTFS_PART) \
+                "$(CAMEO_BOARD_MODEL)" squashfs $(CAMEO_ROOTFS_PART) \
                 $(CAMEO_CUSTOMER_SIGNATURE) \
                 $(CAMEO_BOARD_VERSION); \
         cat $@.kernel_part.hex $@.rootfs_part.hex > $@
diff --git a/target/linux/realtek/image/common.mk b/target/linux/realtek/image/common.mk
index 1a1d6356a7..37370f1999 100644
--- a/target/linux/realtek/image/common.mk
+++ b/target/linux/realtek/image/common.mk
@@ -1,19 +1,13 @@
 # SPDX-License-Identifier: GPL-2.0-only
 
-define Device/d-link_dgs-1210
-  IMAGE_SIZE := 13824k
-  DEVICE_VENDOR := D-Link
-  DLINK_KERNEL_PART_SIZE := 1572864
+define Device/cameo-fw
+  CAMEO_BOARD_MODEL = $$(DEVICE_MODEL)
   KERNEL := \
 	kernel-bin | \
 	append-dtb | \
 	libdeflate-gzip | \
 	uImage gzip | \
 	cameo-tag
-  CAMEO_KERNEL_PART := 2
-  CAMEO_ROOTFS_PART := 3
-  CAMEO_CUSTOMER_SIGNATURE := 2
-  CAMEO_BOARD_VERSION := 32
   IMAGES += factory_image1.bin
   IMAGE/factory_image1.bin := \
 	append-kernel | \
@@ -26,6 +20,17 @@ define Device/d-link_dgs-1210
 	cameo-headers
 endef
 
+define Device/d-link_dgs-1210
+  $(Device/cameo-fw)
+  IMAGE_SIZE := 13824k
+  DEVICE_VENDOR := D-Link
+  CAMEO_KERNEL_PART_SIZE := 1572864
+  CAMEO_KERNEL_PART := 2
+  CAMEO_ROOTFS_PART := 3
+  CAMEO_CUSTOMER_SIGNATURE := 2
+  CAMEO_BOARD_VERSION := 32
+endef
+
 define Device/hpe_1920
   DEVICE_VENDOR := HPE
   IMAGE_SIZE := 29632k



From lede-commits at lists.infradead.org  Mon Feb 13 06:31:23 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 13 Feb 2023 09:31:23 -0500
Subject: [openwrt/openwrt]  ipq807x: merge duplicate network configurations in
 02_network
In-Reply-To: <167629868282.3480903.15595456578330836524@git-01.infra.openwrt.org>
References: <167629868282.3480903.15595456578330836524@git-01.infra.openwrt.org>
Message-ID: <mailman.15262.1676298693.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/d256c0bfd715d7b6bc687e9734e802eec475e477

commit d256c0bfd715d7b6bc687e9734e802eec475e477
Author: INAGAKI Hiroshi <musashino.open at gmail.com>
AuthorDate: Sun Jan 22 16:35:04 2023 +0900

    ipq807x: merge duplicate network configurations in 02_network
    
    Merge network configurations in 02_network of Dynalink DL-WRX36 and
    Xiaomi AX9000.
    
    Reviewed-by: Robert Marko <robimarko at gmail.com>
    Signed-off-by: INAGAKI Hiroshi <musashino.open at gmail.com>
---
 target/linux/ipq807x/base-files/etc/board.d/02_network | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/target/linux/ipq807x/base-files/etc/board.d/02_network b/target/linux/ipq807x/base-files/etc/board.d/02_network
index de237e8541..a8d9d5d6cf 100644
--- a/target/linux/ipq807x/base-files/etc/board.d/02_network
+++ b/target/linux/ipq807x/base-files/etc/board.d/02_network
@@ -11,7 +11,8 @@ ipq807x_setup_interfaces()
 	local board="$1"
 
 	case "$board" in
-	dynalink,dl-wrx36)
+	dynalink,dl-wrx36|\
+	xiaomi,ax9000)
 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
 		;;
 	edgecore,eap102)
@@ -27,9 +28,6 @@ ipq807x_setup_interfaces()
 	xiaomi,ax3600)
 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
 		;;
-	xiaomi,ax9000)
-		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
-		;;
 	zyxel,nbg7815)
 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 10g" "wan"
 		;;



From lede-commits at lists.infradead.org  Mon Feb 13 06:31:22 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 13 Feb 2023 09:31:22 -0500
Subject: [openwrt/openwrt]  ipq807x: enable regulator-fixed driver
In-Reply-To: <167629868282.3480903.15595456578330836524@git-01.infra.openwrt.org>
References: <167629868282.3480903.15595456578330836524@git-01.infra.openwrt.org>
Message-ID: <mailman.15263.1676298693.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/f5d962f9b3683669a79a57d1ee6a2dc4bcfb7f18

commit f5d962f9b3683669a79a57d1ee6a2dc4bcfb7f18
Author: INAGAKI Hiroshi <musashino.open at gmail.com>
AuthorDate: Mon Jan 23 13:00:21 2023 +0900

    ipq807x: enable regulator-fixed driver
    
    Enable regulator-fixed to define the regulator of USB vbus on Buffalo
    WXR-5950AX12.
    
    Reviewed-by: Robert Marko <robimarko at gmail.com>
    Signed-off-by: INAGAKI Hiroshi <musashino.open at gmail.com>
---
 target/linux/ipq807x/config-5.15 | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/ipq807x/config-5.15 b/target/linux/ipq807x/config-5.15
index 9fb604ace2..923cd935f3 100644
--- a/target/linux/ipq807x/config-5.15
+++ b/target/linux/ipq807x/config-5.15
@@ -398,6 +398,7 @@ CONFIG_REGULATOR=y
 CONFIG_REGULATOR_CPR3=y
 # CONFIG_REGULATOR_CPR3_NPU is not set
 CONFIG_REGULATOR_CPR4_APSS=y
+CONFIG_REGULATOR_FIXED_VOLTAGE=y
 # CONFIG_REGULATOR_QCOM_LABIBB is not set
 CONFIG_REGULATOR_QCOM_SPMI=y
 # CONFIG_REGULATOR_QCOM_USB_VBUS is not set



From lede-commits at lists.infradead.org  Mon Feb 13 06:31:24 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 13 Feb 2023 09:31:24 -0500
Subject: [openwrt/openwrt]  ipq807x: add support for Buffalo WXR-5950AX12
In-Reply-To: <167629868282.3480903.15595456578330836524@git-01.infra.openwrt.org>
References: <167629868282.3480903.15595456578330836524@git-01.infra.openwrt.org>
Message-ID: <mailman.15264.1676298701.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/f490295bf213c5e181d16cbe53c163c1c9983e45

commit f490295bf213c5e181d16cbe53c163c1c9983e45
Author: INAGAKI Hiroshi <musashino.open at gmail.com>
AuthorDate: Mon Jan 23 13:01:13 2023 +0900

    ipq807x: add support for Buffalo WXR-5950AX12
    
    Buffalo WXR-5950AX12 is a 2.4/5 GHz band 11ax (Wi-Fi 6) router, based on
    IPQ8074A.
    
    Specification:
    
    - SoC         : Qualcomm IPQ8074A
    - RAM         : DDR3 1024 MiB (2x Nanya NT5CC256M16ER-EK)
    - Flash       : RAW NAND 256 MiB (Winbond W29N02GZBIBA)
    - WLAN        : 2.4/5 GHz (IPQ8074A)
    - Ethernet    : 5 ports
      - WAN       : 100/1000/2500/10000 Mbps x1 (AQR113C)
      - LAN       : 100/1000/2500/10000 Mbps x1 (AQR113C),
                    10/100/1000 Mbps x3 (QCA8075)
    - LED/Keys    : 8x/5x
    - UART        : pin header on PCB (J7)
      - assignment: 3.3V, GND, TX, RX from disc marking
      - settings  : 115200n8
    - Power       : 12 VDC, 4 A
    
    Flash instruction using initramfs image:
    
    1. Prepare TFTP server with IP address 192.168.11.10
    2. Rename OpenWrt initramfs image to "WXR-5950AX12-initramfs.uImage and
       place it to TFTP directory
    3. Hold AOSS (WPS) button and power on WXR-5950AX12
    4. WXR-5950AX12 downloads initramfs image from TFTP server and boots
       with it automatically
    5. Upload sysupgrade image to WXR-5950AX12 and perform sysupgrade
    6. Wait ~120 seconds to complete flashing
    
    Partition layout:
    
    0x000000000000-0x000000100000 : "0:sbl1"
    0x000000100000-0x000000200000 : "0:mibib"
    0x000000200000-0x000000280000 : "0:bootconfig"
    0x000000280000-0x000000300000 : "0:bootconfig1"
    0x000000300000-0x000000600000 : "0:qsee"
    0x000000600000-0x000000900000 : "0:qsee_1"
    0x000000900000-0x000000980000 : "0:devcfg"
    0x000000980000-0x000000a00000 : "0:devcfg_1"
    0x000000a00000-0x000000a80000 : "0:apdp"
    0x000000a80000-0x000000b00000 : "0:apdp_1"
    0x000000b00000-0x000000b80000 : "0:rpm"
    0x000000b80000-0x000000c00000 : "0:rpm_1"
    0x000000c00000-0x000000c80000 : "0:cdt"
    0x000000c80000-0x000000d00000 : "0:cdt_1"
    0x000000d00000-0x000000d80000 : "0:appsblenv"
    0x000000d80000-0x000000e80000 : "0:appsbl"
    0x000000e80000-0x000000f80000 : "0:appsbl_1"
    0x000000f80000-0x000001000000 : "0:art"
    0x000001000000-0x000001080000 : "0:art_1"
    0x000001080000-0x000001100000 : "0:orgdata"
    0x000001100000-0x000001180000 : "0:orgdata_1"
    0x000001180000-0x000005180000 : "rootfs"
    0x000005180000-0x000009180000 : "rootfs_recover"
    0x000009180000-0x000010000000 : "user_property"
    
    Notes:
    
    - WXR-5950AX12 has 2x OS images on NAND flash. The 1st image is for
      normal operation and the 2nd one is for recoverying or firmware
      upgrading on stock.
    
    - Stock U-Boot checks MD5 hashes in "fw_hash" volume in each "root*"
      partition when booting. This is just a comparation of hash strings.
    
      Behaviors:
    
      - both "fw_hash" volumes exist, hashes are rootfs == rootfs_recover
        ---> boot from rootfs
    
      - both "fw_hash" volumes exist, hashes are rootfs != rootfs_recover
        ---> boot from rootfs_recover
    
        Note: this behavior is used for firmware upgrading on stock
    
      - "fw_hash" volume in rootfs is missing
        ---> boot from rootfs_recover
    
      - "fw_hash" volume in rootfs_recover is missing
        ---> boot from rootfs
    
      - "fw_hash" volumes in both root* partition are missing
        ---> boot from rootfs_recover
    
    Reverting to stock firmware:
    
    1. Decrypt official image by buffalo-enc and remove header
    
       example of decryption:
    
       $ buffalo-enc -i wxr_5950ax12_jp_305 -o wxr_5950ax12_jp_305.dec \
                     -d -k olaffuB -O 0xc8
    
       example of removing header (v3.05):
    
       - before
    
       $ hexdump -n 64 -v -C wxr_5950ax12_jp_305.dec
       00000000  57 58 52 2d 35 39 35 30  41 58 31 32 5f 33 2e 30  |WXR-5950AX12_3.0|
       00000010  35 5f 31 2e 30 31 5f 4a  50 5f 6a 70 5f 71 63 61  |5_1.01_JP_jp_qca|
       00000020  0a 66 69 6c 65 6c 65 6e  3d 34 35 33 35 30 39 31  |.filelen=4535091|
       00000030  32 0a 55 42 49 23 01 00  00 00 00 00 00 00 00 00  |2.UBI#..........|
       00000040
    
       - after
    
       $ hexdump -n 64 -v -C wxr_5950ax12_jp_305.ubi
       00000000  55 42 49 23 01 00 00 00  00 00 00 00 00 00 00 00  |UBI#............|
       00000010  00 00 08 00 00 00 10 00  78 cf c4 91 00 00 00 00  |........x.......|
       00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
       00000030  00 00 00 00 00 00 00 00  00 00 00 00 3d 2a 64 fd  |............=*d.|
       00000040
    
    2. Boot WXR-5950AX12 with OpenWrt initramfs image
    
    3. Upload modified stock image to WXR-5950AX12
    
    4. Find partitions "rootfs" and "rootfs_recover"
    
       example:
    
       root at OpenWrt:/# cat /proc/mtd
       dev:    size   erasesize  name
       ...
       mtd22: 04000000 00020000 "rootfs"
       mtd23: 04000000 00020000 "rootfs_recover"
       ...
    
       in this case, "rootfs" is mtd22 and "rootfs_recover" is mtd23
    
    5. Format "rootfs"/"rootfs_recover" partition with the uploaded image
    
       example:
    
       ubiformat /dev/mtd22 -f /tmp/wxr_5950ax12_jp_305.ubi
       ubiformat /dev/mtd23 -f /tmp/wxr_5950ax12_jp_305.ubi
    
    6. Remove "rootfs"/"rootfs_data" volume from user_property partition
    
       example:
    
       . /lib/upgrade/nand.sh
       UBI=$(nand_attach_ubi user_property)
       ubirmvol /dev/$UBI -N rootfs
       ubirmvol /dev/$UBI -N rootfs_data
    
    7. Reboot
    
    MAC addresses:
    
    LAN    : 50:C4:DD:xx:xx:28 (0:APPSBLENV, ethaddr (text))
    WAN    : 50:C4:DD:xx:xx:28 (0:APPSBLENV, ethaddr (text))
    2.4 GHz: 50:C4:DD:xx:xx:30 (0:APPSBLENV, wlan0addr (text))
    5 GHz  : 50:C4:DD:xx:xx:38 (0:APPSBLENV, wlan1addr (text))
    
    Reviewed-by: Robert Marko <robimarko at gmail.com>
    Signed-off-by: INAGAKI Hiroshi <musashino.open at gmail.com>
---
 package/firmware/ipq-wifi/Makefile                 |   2 +
 .../ipq-wifi/board-buffalo_wxr-5950ax12.ipq8074    | Bin 0 -> 131184 bytes
 .../ipq807x/base-files/etc/board.d/02_network      |   1 +
 .../etc/hotplug.d/firmware/11-ath11k-caldata       |   1 +
 .../ipq807x/base-files/lib/upgrade/buffalo.sh      |  55 +++
 .../ipq807x/base-files/lib/upgrade/platform.sh     |   8 +
 .../arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts   | 376 +++++++++++++++++++++
 target/linux/ipq807x/image/generic.mk              |  13 +
 8 files changed, 456 insertions(+)

diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
index 861eec13dc..8e7fc4da39 100644
--- a/package/firmware/ipq-wifi/Makefile
+++ b/package/firmware/ipq-wifi/Makefile
@@ -26,6 +26,7 @@ endef
 
 ALLWIFIBOARDS:= \
 	aruba_ap-365 \
+	buffalo_wxr-5950ax12 \
 	devolo_magic-2-wifi-next \
 	dynalink_dl-wrx36 \
 	edgecore_eap102 \
@@ -125,6 +126,7 @@ endef
 # Add $(eval $(call generate-ipq-wifi-package,<devicename>,<display name>))
 
 $(eval $(call generate-ipq-wifi-package,aruba_ap-365,Aruba AP-365))
+$(eval $(call generate-ipq-wifi-package,buffalo_wxr-5950ax12,Buffalo WXR-5950AX12))
 $(eval $(call generate-ipq-wifi-package,devolo_magic-2-wifi-next,devolo Magic 2 WiFi next))
 $(eval $(call generate-ipq-wifi-package,dynalink_dl-wrx36,Dynalink DL-WRX36))
 $(eval $(call generate-ipq-wifi-package,edgecore_eap102,Edgecore EAP102))
diff --git a/package/firmware/ipq-wifi/board-buffalo_wxr-5950ax12.ipq8074 b/package/firmware/ipq-wifi/board-buffalo_wxr-5950ax12.ipq8074
new file mode 100644
index 0000000000..57badaa535
Binary files /dev/null and b/package/firmware/ipq-wifi/board-buffalo_wxr-5950ax12.ipq8074 differ
diff --git a/target/linux/ipq807x/base-files/etc/board.d/02_network b/target/linux/ipq807x/base-files/etc/board.d/02_network
index a8d9d5d6cf..43c67a0f31 100644
--- a/target/linux/ipq807x/base-files/etc/board.d/02_network
+++ b/target/linux/ipq807x/base-files/etc/board.d/02_network
@@ -11,6 +11,7 @@ ipq807x_setup_interfaces()
 	local board="$1"
 
 	case "$board" in
+	buffalo,wxr-5950ax12|\
 	dynalink,dl-wrx36|\
 	xiaomi,ax9000)
 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
diff --git a/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
index 304d3a71b8..eec286e269 100644
--- a/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
+++ b/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
@@ -9,6 +9,7 @@ board=$(board_name)
 case "$FIRMWARE" in
 "ath11k/IPQ8074/hw2.0/cal-ahb-c000000.wifi.bin")
 	case "$board" in
+	buffalo,wxr-5950ax12|\
 	edgecore,eap102|\
 	edimax,cax1800|\
 	dynalink,dl-wrx36|\
diff --git a/target/linux/ipq807x/base-files/lib/upgrade/buffalo.sh b/target/linux/ipq807x/base-files/lib/upgrade/buffalo.sh
new file mode 100644
index 0000000000..d0ed258890
--- /dev/null
+++ b/target/linux/ipq807x/base-files/lib/upgrade/buffalo.sh
@@ -0,0 +1,55 @@
+. /lib/functions.sh
+
+# Prepare UBI devices for OpenWrt installation
+# - rootfs (mtd22)
+#   - remove "ubi_rootfs" volume (rootfs on stock)
+#   - remove "fw_hash" volume (firmware hash)
+# - user_property (mtd24)
+#   - remove "user_property_ubi" volume (user configuration)
+#   - remove "extra_property" volume (gzipped syslog)
+buffalo_upgrade_prepare() {
+	local ubi_rootdev ubi_propdev
+
+	if ! ubi_rootdev="$(nand_attach_ubi rootfs)" || \
+	   ! ubi_propdev="$(nand_attach_ubi user_property)"; then
+		echo "failed to attach UBI volume \"rootfs\" or \"user_property\", rebooting..."
+		reboot -f
+	fi
+
+	ubirmvol /dev/$ubi_rootdev -N ubi_rootfs &> /dev/null || true
+	ubirmvol /dev/$ubi_rootdev -N fw_hash &> /dev/null || true
+
+	ubirmvol /dev/$ubi_propdev -N user_property_ubi &> /dev/null || true
+	ubirmvol /dev/$ubi_propdev -N extra_property &> /dev/null || true
+}
+
+# Re-create small dummy ubi_rootfs volume and update
+# fw_hash volume to pass the checking by U-Boot
+# - rootfs (mtd22)
+#   - re-create "ubi_rootfs" volume
+#   - re-create and update "fw_hash" volume
+# - rootfs_recover (mtd23)
+#   - update "fw_hash" volume
+buffalo_upgrade_optvol() {
+	local ubi_rootdev ubi_rcvrdev
+	local hashvol_root hashvol_rcvr
+
+	if ! ubi_rootdev="$(nand_attach_ubi rootfs)" || \
+	   ! ubi_rcvrdev="$(nand_attach_ubi rootfs_recover)"; then
+		echo "failed to attach UBI volume \"rootfs\" or \"rootfs_recover\", rebooting..."
+		reboot -f
+	fi
+
+	ubimkvol /dev/$ubi_rootdev -N ubi_rootfs -S 1
+	ubimkvol /dev/$ubi_rootdev -N fw_hash -S 1 -t static
+
+	if ! hashvol_root="$(nand_find_volume $ubi_rootdev fw_hash)" || \
+	   ! hashvol_rcvr="$(nand_find_volume $ubi_rcvrdev fw_hash)"; then
+		echo "\"fw_hash\" volume in \"rootfs\" or \"rootfs_recover\" not found, rebooting..."
+		reboot -f
+	fi
+
+	echo -n "00000000000000000000000000000000" > /tmp/dummyhash.txt
+	ubiupdatevol /dev/$hashvol_root /tmp/dummyhash.txt
+	ubiupdatevol /dev/$hashvol_rcvr /tmp/dummyhash.txt
+}
diff --git a/target/linux/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/ipq807x/base-files/lib/upgrade/platform.sh
index 4a6a91b5f5..683015898a 100644
--- a/target/linux/ipq807x/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ipq807x/base-files/lib/upgrade/platform.sh
@@ -43,6 +43,14 @@ platform_pre_upgrade() {
 
 platform_do_upgrade() {
 	case "$(board_name)" in
+	buffalo,wxr-5950ax12)
+		CI_KERN_UBIPART="rootfs"
+		CI_ROOT_UBIPART="user_property"
+		buffalo_upgrade_prepare
+		nand_do_flash_file "$1" || nand_do_upgrade_failed
+		nand_do_restore_config || nand_do_upgrade_failed
+		buffalo_upgrade_optvol
+		;;
 	dynalink,dl-wrx36)
 		nand_do_upgrade "$1"
 		;;
diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts b/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts
new file mode 100644
index 0000000000..d9b083c4d0
--- /dev/null
+++ b/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-wxr-5950ax12.dts
@@ -0,0 +1,376 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+
+#include "ipq8074.dtsi"
+#include "ipq8074-hk-cpu.dtsi"
+#include "ipq8074-ess.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	model = "Buffalo WXR-5950AX12";
+	compatible = "buffalo,wxr-5950ax12", "qcom,ipq8074";
+
+	aliases {
+		serial0 = &blsp1_uart5;
+		led-boot = &led_power_white;
+		led-failsafe = &led_power_red;
+		led-running = &led_power_white;
+		led-upgrade = &led_power_white;
+		label-mac-device = &dp5_syn;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs-append = " ubi.mtd=user_property root=/dev/ubiblock1_0";
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led-0 {
+			label = "white:router";
+			gpios = <&tlmm 21 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_WHITE>;
+		};
+
+		led-1 {
+			label = "red:router";
+			gpios = <&tlmm 22 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_RED>;
+		};
+
+		led_power_red: led-2 {
+			label = "red:power";
+			gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_POWER;
+		};
+
+		led_power_white: led-3 {
+			label = "white:power";
+			gpios = <&tlmm 34 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_WHITE>;
+			function = LED_FUNCTION_POWER;
+		};
+
+		led-4 {
+			label = "white:internet";
+			gpios = <&tlmm 43 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_WHITE>;
+		};
+
+		led-5 {
+			label = "red:internet";
+			gpios = <&tlmm 44 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_RED>;
+		};
+
+		led-6 {
+			label = "red:wireless";
+			gpios = <&tlmm 55 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_WLAN;
+		};
+
+		led-7 {
+			label = "white:wireless";
+			gpios = <&tlmm 56 GPIO_ACTIVE_HIGH>;
+			color = <LED_COLOR_ID_WHITE>;
+			function = LED_FUNCTION_WLAN;
+		};
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		/*
+		 * mode: 3x position switch
+		 *
+		 * - ROUTER
+		 * - AP
+		 * - WB (Wireless Bridge)
+		 */
+		ap {
+			label = "mode-ap";
+			gpios = <&tlmm 29 GPIO_ACTIVE_LOW>;
+			linux,code = <BTN_0>;
+		};
+
+		bridge {
+			label = "mode-wb";
+			gpios = <&tlmm 30 GPIO_ACTIVE_LOW>;
+			linux,code = <BTN_1>;
+		};
+
+		/*
+		 * op: 2x position switch
+		 *
+		 * - AUTO
+		 * - MANUAL (select Router/AP/WB manually)
+		 */
+		manual {
+			label = "op-manual";
+			gpios = <&tlmm 52 GPIO_ACTIVE_LOW>;
+			linux,code = <BTN_2>;
+		};
+
+		wps {
+			label = "wps";
+			gpios = <&tlmm 51 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+
+		reset {
+			label = "reset";
+			gpios = <&tlmm 54 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	reg_usb_vbus: regulator-5v-vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "vbus";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		gpio = <&tlmm 64 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		regulator-always-on;
+	};
+};
+
+&tlmm {
+	mdio_pins: mdio-pins {
+		mdc {
+			pins = "gpio68";
+			function = "mdc";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+
+		mdio {
+			pins = "gpio69";
+			function = "mdio";
+			drive-strength = <8>;
+			bias-pull-up;
+		};
+	};
+};
+
+&blsp1_uart5 {
+	status = "okay";
+};
+
+&prng {
+	status = "okay";
+};
+
+&cryptobam {
+	status = "okay";
+};
+
+&crypto {
+	status = "okay";
+};
+
+&qpic_bam {
+	status = "okay";
+};
+
+&qpic_nand {
+	status = "okay";
+
+	nand at 0 {
+		reg = <0>;
+		nand-ecc-strength = <4>;
+		nand-ecc-step-size = <512>;
+		nand-bus-width = <8>;
+
+		partitions {
+			compatible = "qcom,smem-part";
+
+			partition-0-appsblenv {
+				compatible = "fixed-partitions";
+				label = "0:appsblenv";
+				read-only;
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				partition at 0 {
+					compatible = "u-boot,env";
+					label = "env-data";
+					reg = <0x0 0x40000>;
+
+					macaddr_appsblenv_ethaddr: ethaddr {
+					};
+				};
+			};
+		};
+	};
+};
+
+&mdio {
+	status = "okay";
+	pinctrl-0 = <&mdio_pins>;
+	pinctrl-names = "default";
+	/*
+	 * RESET pins of phy chips
+	 *
+	 * WXR-5950AX12 has 2x RESET pins for QCA8075 and AQR113C.
+	 * The pin of QCA8075 is for the chip and not phys in the chip, the
+	 * pin of AQR113C is for 2x chips. So both pins are not appropriate
+	 * to declare them as reset-gpios in phy nodes.
+	 * Multiple entries in reset-gpios of mdio may not be supported, but
+	 * leave the following as-is to show that the those reset pin exists.
+	 */
+	reset-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>, /* QCA8075 RESET */
+		      <&tlmm 63 GPIO_ACTIVE_LOW>; /* AQR113C RESET (2x) */
+
+	aqr113c_1: ethernet-phy at 0 {
+		compatible = "ethernet-phy-ieee802.3-c45";
+		reg = <0x0>;
+	};
+
+	aqr113c_2: ethernet-phy at 8 {
+		compatible = "ethernet-phy-ieee802.3-c45";
+		reg = <0x8>;
+	};
+
+	qca8075_1: ethernet-phy at 18 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <0x18>;
+	};
+
+	qca8075_2: ethernet-phy at 19 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <0x19>;
+	};
+
+	qca8075_3: ethernet-phy at 1a {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <0x1a>;
+	};
+
+	qca8075_4: ethernet-phy at 1b {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <0x1b>;
+	};
+
+	qca8075_5: ethernet-phy at 1c {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <0x1c>;
+	};
+};
+
+&switch {
+	status = "okay";
+
+	switch_cpu_bmp = <0x1>;
+	switch_lan_bmp = <0x3e>;
+	switch_wan_bmp = <0x40>;
+	switch_mac_mode = <0xb>;
+	switch_mac_mode1 = <0xd>;
+	switch_mac_mode2 = <0xd>;
+	bm_tick_mode = <0>;
+	tm_tick_mode = <0>;
+
+	qcom,port_phyinfo {
+		port at 0 {
+			port_id = <1>;
+			phy_address = <0x18>;
+		};
+
+		port at 1 {
+			port_id = <2>;
+			phy_address = <0x19>;
+		};
+
+		port at 2 {
+			port_id = <3>;
+			phy_address = <0x1a>;
+		};
+
+		port at 3 {
+			port_id = <4>;
+			phy_address = <0x1b>;
+		};
+
+		port at 4 {
+			port_id = <5>;
+			ethernet-phy-ieee802.3-c45;
+			phy_address = <0x0>;
+		};
+
+		port at 5 {
+			port_id = <6>;
+			ethernet-phy-ieee802.3-c45;
+			phy_address = <0x8>;
+		};
+	};
+};
+
+&edma {
+	status = "okay";
+};
+
+&dp2 {
+	status = "okay";
+	phy-handle = <&qca8075_2>;
+	label = "lan4";
+	nvmem-cells = <&macaddr_appsblenv_ethaddr>;
+	nvmem-cell-names = "mac-address-ascii";
+};
+
+&dp3 {
+	status = "okay";
+	phy-handle = <&qca8075_3>;
+	label = "lan3";
+	nvmem-cells = <&macaddr_appsblenv_ethaddr>;
+	nvmem-cell-names = "mac-address-ascii";
+};
+
+&dp4 {
+	status = "okay";
+	phy-handle = <&qca8075_4>;
+	label = "lan2";
+	nvmem-cells = <&macaddr_appsblenv_ethaddr>;
+	nvmem-cell-names = "mac-address-ascii";
+};
+
+&dp5_syn {
+	status = "okay";
+	phy-handle = <&aqr113c_1>;
+	label = "wan";
+	nvmem-cells = <&macaddr_appsblenv_ethaddr>;
+	nvmem-cell-names = "mac-address-ascii";
+};
+
+&dp6_syn {
+	status = "okay";
+	phy-handle = <&aqr113c_2>;
+	label = "lan1";
+	nvmem-cells = <&macaddr_appsblenv_ethaddr>;
+	nvmem-cell-names = "mac-address-ascii";
+};
+
+&ssphy_0 {
+	status = "okay";
+};
+
+&qusb_phy_0 {
+	status = "okay";
+};
+
+&usb_0 {
+	status = "okay";
+
+	vbus-supply = <&reg_usb_vbus>;
+};
+
+&wifi {
+	status = "okay";
+
+	qcom,ath11k-calibration-variant = "Buffalo-WXR-5950AX12";
+};
diff --git a/target/linux/ipq807x/image/generic.mk b/target/linux/ipq807x/image/generic.mk
index 3145e1b53f..38770a5f24 100644
--- a/target/linux/ipq807x/image/generic.mk
+++ b/target/linux/ipq807x/image/generic.mk
@@ -17,6 +17,19 @@ define Device/UbiFit
 	IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
 endef
 
+define Device/buffalo_wxr-5950ax12
+	$(call Device/FitImage)
+	$(call Device/UbiFit)
+	DEVICE_VENDOR := Buffalo
+	DEVICE_MODEL := WXR-5950AX12
+	BLOCKSIZE := 128k
+	PAGESIZE := 2048
+	DEVICE_DTS_CONFIG := config at hk01
+	SOC := ipq8074
+	DEVICE_PACKAGES := ipq-wifi-buffalo_wxr-5950ax12
+endef
+TARGET_DEVICES += buffalo_wxr-5950ax12
+
 define Device/dynalink_dl-wrx36
 	$(call Device/FitImage)
 	$(call Device/UbiFit)



From lede-commits at lists.infradead.org  Tue Feb 14 01:01:05 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 14 Feb 2023 04:01:05 -0500
Subject: [openwrt/openwrt]  ucode: update to the latest version
In-Reply-To: <167636526523.153974.4107291696861765622@git-01.infra.openwrt.org>
References: <167636526523.153974.4107291696861765622@git-01.infra.openwrt.org>
Message-ID: <mailman.15579.1676365275.3064139.lede-commits@lists.infradead.org>

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

commit ac4fae233878ad37f02879e4b9b5a87b77db8ac2
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri Feb 3 14:25:02 2023 +0100

    ucode: update to the latest version
    
    08c709c58187 rtnl: add support for registering an uloop based listener
    599a7fb59380 Merge pull request #140 from nbd168/rtnl
    c4125c516e0a nl80211: fix NL80211_ATTR_SURVEY_INFO
    c43bb9d8fe8d Merge pull request #141 from dhewg/master
    c1342d934b2d nl80211: add missing ucv_get() calls
    9022b270683a rtnl: add missing ucv_get() calls
    837cffec5a5c Merge pull request #142 from nbd168/ref-fixes
    65b1f181e642 rtnl: add missing uc_vm_registry_set call
    ab2f3f70257d Merge pull request #143 from nbd168/rtnl-fix
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/utils/ucode/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/utils/ucode/Makefile b/package/utils/ucode/Makefile
index 893daf99c7..f0e4f9f110 100644
--- a/package/utils/ucode/Makefile
+++ b/package/utils/ucode/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=https://github.com/jow-/ucode.git
-PKG_SOURCE_DATE:=2023-01-23
-PKG_SOURCE_VERSION:=941d14837faf248eb2fa88dd0d5cfddeed044a15
-PKG_MIRROR_HASH:=19e8654bcb8a13a0a276a240a1da0f2815b0dd0d4f8bb8622e8de1040d5408a5
+PKG_SOURCE_DATE:=2023-02-13
+PKG_SOURCE_VERSION:=ab2f3f70257d381e075b4ec58366578af861c2b0
+PKG_MIRROR_HASH:=ac7c88a3bd65249253740942dbc9e4d8bc6d5a5e93e48c384d31c94dc7a891f9
 PKG_MAINTAINER:=Jo-Philipp Wich <jo at mein.io>
 PKG_LICENSE:=ISC
 
@@ -118,7 +118,7 @@ endef
 define Package/ucode-mod-rtnl
   $(Package/ucode/default)
   TITLE+= (rtnl module)
-  DEPENDS:=ucode +libnl-tiny
+  DEPENDS:=ucode +libnl-tiny +libubox
 endef
 
 define Package/ucode-mod-rtnl/description



From lede-commits at lists.infradead.org  Tue Feb 14 19:29:18 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 14 Feb 2023 22:29:18 -0500
Subject: [openwrt/openwrt]  fstools: update to git HEAD
In-Reply-To: <167643175855.867860.6122258641937246117@git-01.infra.openwrt.org>
References: <167643175855.867860.6122258641937246117@git-01.infra.openwrt.org>
Message-ID: <mailman.16033.1676431767.3064139.lede-commits@lists.infradead.org>

dangole pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/62e583ddb9c1f8a5d760ff0612433c5e262fe481

commit 62e583ddb9c1f8a5d760ff0612433c5e262fe481
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Wed Feb 15 03:26:34 2023 +0000

    fstools: update to git HEAD
    
     12155d3 libfstools: use class interface to iterate over ubi devices
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 package/system/fstools/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile
index e61cd7a022..b08fe541bd 100644
--- a/package/system/fstools/Makefile
+++ b/package/system/fstools/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git
-PKG_MIRROR_HASH:=d2fc78b66c4e6ac5f51c77f92bd0d2322db78905a9dfea582fc7d975ea68ffe4
-PKG_SOURCE_DATE:=2023-02-04
-PKG_SOURCE_VERSION:=14d535e4485dc030deecbba9ab493c379df5c237
+PKG_MIRROR_HASH:=dbb3d721eb606606c2fc0875067449e5c882d22affaa8dc70367daff7c198152
+PKG_SOURCE_DATE:=2023-02-15
+PKG_SOURCE_VERSION:=12155d3881b9bdd44b8682970638dbfd9f55e2cb
 CMAKE_INSTALL:=1
 
 PKG_LICENSE:=GPL-2.0



From lede-commits at lists.infradead.org  Tue Feb 14 19:29:20 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 14 Feb 2023 22:29:20 -0500
Subject: [openwrt/openwrt]  mediatek: mtk_thermal: replace with upstream patch
In-Reply-To: <167643175855.867860.6122258641937246117@git-01.infra.openwrt.org>
References: <167643175855.867860.6122258641937246117@git-01.infra.openwrt.org>
Message-ID: <mailman.16034.1676431769.3064139.lede-commits@lists.infradead.org>

dangole pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/80196f4e3c1902325466980b5b4085040b469317

commit 80196f4e3c1902325466980b5b4085040b469317
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Wed Jan 18 03:14:29 2023 +0000

    mediatek: mtk_thermal: replace with upstream patch
    
    Replace local patch adding thermal support for MT7986 with version
    accepted upstream.
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 ...vers-mtk-use-function-pointer-for-raw_to_.patch | 56 ++++++++++++
 ...diatek-add-support-for-MT7986-and-MT7981.patch} | 99 +++++++++++++---------
 2 files changed, 114 insertions(+), 41 deletions(-)

diff --git a/target/linux/mediatek/patches-5.15/805-v6.2-thermal-drivers-mtk-use-function-pointer-for-raw_to_.patch b/target/linux/mediatek/patches-5.15/805-v6.2-thermal-drivers-mtk-use-function-pointer-for-raw_to_.patch
new file mode 100644
index 0000000000..c58ae96403
--- /dev/null
+++ b/target/linux/mediatek/patches-5.15/805-v6.2-thermal-drivers-mtk-use-function-pointer-for-raw_to_.patch
@@ -0,0 +1,56 @@
+From 69c17529e8418da3eec703dde31e1b01e5b0f7e8 Mon Sep 17 00:00:00 2001
+From: Daniel Golle <daniel at makrotopia.org>
+Date: Wed, 18 Jan 2023 02:48:41 +0000
+Subject: [PATCH 1/2] thermal/drivers/mtk: use function pointer for
+ raw_to_mcelsius
+
+Instead of having if-else logic selecting either raw_to_mcelsius_v1 or
+raw_to_mcelsius_v2 in mtk_thermal_bank_temperature introduce a function
+pointer raw_to_mcelsius to struct mtk_thermal which is initialized in the
+probe function.
+
+Signed-off-by: Daniel Golle <daniel at makrotopia.org>
+---
+ drivers/thermal/mtk_thermal.c | 17 ++++++++++-------
+ 1 file changed, 10 insertions(+), 7 deletions(-)
+
+--- a/drivers/thermal/mtk_thermal.c
++++ b/drivers/thermal/mtk_thermal.c
+@@ -292,6 +292,8 @@ struct mtk_thermal {
+ 
+ 	const struct mtk_thermal_data *conf;
+ 	struct mtk_thermal_bank banks[MAX_NUM_ZONES];
++
++	int (*raw_to_mcelsius)(struct mtk_thermal *mt, int sensno, s32 raw);
+ };
+ 
+ /* MT8183 thermal sensor data */
+@@ -656,13 +658,9 @@ static int mtk_thermal_bank_temperature(
+ 	for (i = 0; i < conf->bank_data[bank->id].num_sensors; i++) {
+ 		raw = readl(mt->thermal_base + conf->msr[i]);
+ 
+-		if (mt->conf->version == MTK_THERMAL_V1) {
+-			temp = raw_to_mcelsius_v1(
+-				mt, conf->bank_data[bank->id].sensors[i], raw);
+-		} else {
+-			temp = raw_to_mcelsius_v2(
+-				mt, conf->bank_data[bank->id].sensors[i], raw);
+-		}
++		temp = mt->raw_to_mcelsius(
++			mt, conf->bank_data[bank->id].sensors[i], raw);
++
+ 
+ 		/*
+ 		 * The first read of a sensor often contains very high bogus
+@@ -1075,6 +1073,11 @@ static int mtk_thermal_probe(struct plat
+ 		mtk_thermal_release_periodic_ts(mt, auxadc_base);
+ 	}
+ 
++	if (mt->conf->version == MTK_THERMAL_V1)
++		mt->raw_to_mcelsius = raw_to_mcelsius_v1;
++	else
++		mt->raw_to_mcelsius = raw_to_mcelsius_v2;
++
+ 	for (ctrl_id = 0; ctrl_id < mt->conf->num_controller ; ctrl_id++)
+ 		for (i = 0; i < mt->conf->num_banks; i++)
+ 			mtk_thermal_init_bank(mt, i, apmixed_phys_base,
diff --git a/target/linux/mediatek/patches-5.15/805-thermal-drivers-mediatek-add-support-for-MT7986-and-.patch b/target/linux/mediatek/patches-5.15/806-v6.2-thermal-mediatek-add-support-for-MT7986-and-MT7981.patch
similarity index 71%
rename from target/linux/mediatek/patches-5.15/805-thermal-drivers-mediatek-add-support-for-MT7986-and-.patch
rename to target/linux/mediatek/patches-5.15/806-v6.2-thermal-mediatek-add-support-for-MT7986-and-MT7981.patch
index 7ec962a7c3..65311d5718 100644
--- a/target/linux/mediatek/patches-5.15/805-thermal-drivers-mediatek-add-support-for-MT7986-and-.patch
+++ b/target/linux/mediatek/patches-5.15/806-v6.2-thermal-mediatek-add-support-for-MT7986-and-MT7981.patch
@@ -1,27 +1,30 @@
-From cd47d86ab09f1f3ec5c86441d4fe95e0cf597c06 Mon Sep 17 00:00:00 2001
+From aa957c759b1182aee00cc35178667f849f941b42 Mon Sep 17 00:00:00 2001
 From: Daniel Golle <daniel at makrotopia.org>
-Date: Tue, 13 Sep 2022 00:56:24 +0100
-Subject: [PATCH] thermal/drivers/mediatek: add support for MT7986 and MT7981
+Date: Wed, 30 Nov 2022 13:19:39 +0000
+Subject: [PATCH 2/2] thermal: mediatek: add support for MT7986 and MT7981
 
 Add support for V3 generation thermal found in MT7986 and MT7981 SoCs.
+Brings code to assign values from efuse as well as new function to
+convert raw temperature to millidegree celsius, as found in MediaTek's
+SDK sources (but cleaned up and de-duplicated)
 
+[1]: https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/baf36c7eef477aae1f8f2653b6c29e2caf48475b
 Signed-off-by: Daniel Golle <daniel at makrotopia.org>
 ---
- drivers/thermal/mtk_thermal.c | 202 +++++++++++++++++++++++++++++++++-
- 1 file changed, 198 insertions(+), 4 deletions(-)
+ drivers/thermal/mtk_thermal.c | 137 ++++++++++++++++++++++++++++++++--
+ 1 file changed, 132 insertions(+), 5 deletions(-)
 
 --- a/drivers/thermal/mtk_thermal.c
 +++ b/drivers/thermal/mtk_thermal.c
-@@ -150,6 +150,21 @@
+@@ -150,6 +150,20 @@
  #define CALIB_BUF1_VALID_V2(x)		(((x) >> 4) & 0x1)
  #define CALIB_BUF1_O_SLOPE_SIGN_V2(x)	(((x) >> 3) & 0x1)
  
 +/*
 + * Layout of the fuses providing the calibration data
-+ * These macros could be used for MT7981 and MT7986.
++ * These macros can be used for MT7981 and MT7986.
 + */
 +#define CALIB_BUF0_ADC_GE_V3(x)		(((x) >> 0) & 0x3ff)
-+#define CALIB_BUF0_ADC_OE_V3(x)		(((x) >> 10) & 0x3ff)
 +#define CALIB_BUF0_DEGC_CALI_V3(x)	(((x) >> 20) & 0x3f)
 +#define CALIB_BUF0_O_SLOPE_V3(x)	(((x) >> 26) & 0x3f)
 +#define CALIB_BUF1_VTS_TS1_V3(x)	(((x) >> 0) & 0x1ff)
@@ -34,7 +37,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  enum {
  	VTS1,
  	VTS2,
-@@ -163,6 +178,7 @@ enum {
+@@ -163,6 +177,7 @@ enum {
  enum mtk_thermal_version {
  	MTK_THERMAL_V1 = 1,
  	MTK_THERMAL_V2,
@@ -42,7 +45,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  };
  
  /* MT2701 thermal sensors */
-@@ -245,6 +261,27 @@ enum mtk_thermal_version {
+@@ -245,6 +260,27 @@ enum mtk_thermal_version {
  /* The calibration coefficient of sensor  */
  #define MT8183_CALIBRATION	153
  
@@ -59,7 +62,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
 +#define MT7986_NUM_SENSORS_PER_ZONE	1
 +
 +/* MT7986 thermal sensors */
-+#define MT7986_TS1	0
++#define MT7986_TS1			0
 +
 +/* The number of controller in the MT7986 */
 +#define MT7986_NUM_CONTROLLER		1
@@ -70,14 +73,14 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  struct mtk_thermal;
  
  struct thermal_bank_cfg {
-@@ -386,6 +423,14 @@ static const int mt7622_mux_values[MT762
+@@ -388,6 +424,14 @@ static const int mt7622_mux_values[MT762
  static const int mt7622_vts_index[MT7622_NUM_SENSORS] = { VTS1 };
  static const int mt7622_tc_offset[MT7622_NUM_CONTROLLER] = { 0x0, };
  
 +/* MT7986 thermal sensor data */
 +static const int mt7986_bank_data[MT7986_NUM_SENSORS] = { MT7986_TS1, };
 +static const int mt7986_msr[MT7986_NUM_SENSORS_PER_ZONE] = { TEMP_MSR0, };
-+static const int mt7986_adcpnp[MT7986_NUM_SENSORS_PER_ZONE] = {	TEMP_ADCPNP0, };
++static const int mt7986_adcpnp[MT7986_NUM_SENSORS_PER_ZONE] = { TEMP_ADCPNP0, };
 +static const int mt7986_mux_values[MT7986_NUM_SENSORS] = { 0, };
 +static const int mt7986_vts_index[MT7986_NUM_SENSORS] = { VTS1 };
 +static const int mt7986_tc_offset[MT7986_NUM_CONTROLLER] = { 0x0, };
@@ -85,7 +88,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  /*
   * The MT8173 thermal controller has four banks. Each bank can read up to
   * four temperature sensors simultaneously. The MT8173 has a total of 5
-@@ -549,6 +594,30 @@ static const struct mtk_thermal_data mt8
+@@ -551,6 +595,30 @@ static const struct mtk_thermal_data mt8
  	.version = MTK_THERMAL_V1,
  };
  
@@ -116,7 +119,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  /**
   * raw_to_mcelsius - convert a raw ADC value to mcelsius
   * @mt:	The thermal controller
-@@ -603,6 +672,22 @@ static int raw_to_mcelsius_v2(struct mtk
+@@ -605,6 +673,22 @@ static int raw_to_mcelsius_v2(struct mtk
  	return (format_2 - tmp) * 100;
  }
  
@@ -131,7 +134,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
 +	tmp = 100000 * 15 / 16 * 10000;
 +	tmp /= 4096 - 512 + mt->adc_ge;
 +	tmp /= 1490;
-+	tmp *= raw - mt->vts[sensno] - 2900 - mt->adc_oe + 512;
++	tmp *= raw - mt->vts[sensno] - 2900;
 +
 +	return mt->degc_cali * 500 - tmp;
 +}
@@ -139,21 +142,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  /**
   * mtk_thermal_get_bank - get bank
   * @bank:	The bank
-@@ -659,9 +744,12 @@ static int mtk_thermal_bank_temperature(
- 		if (mt->conf->version == MTK_THERMAL_V1) {
- 			temp = raw_to_mcelsius_v1(
- 				mt, conf->bank_data[bank->id].sensors[i], raw);
--		} else {
-+		} else if (mt->conf->version == MTK_THERMAL_V2) {
- 			temp = raw_to_mcelsius_v2(
- 				mt, conf->bank_data[bank->id].sensors[i], raw);
-+		} else {
-+			temp = raw_to_mcelsius_v3(
-+				mt, conf->bank_data[bank->id].sensors[i], raw);
- 		}
- 
- 		/*
-@@ -887,6 +975,26 @@ static int mtk_thermal_extract_efuse_v2(
+@@ -885,6 +969,25 @@ static int mtk_thermal_extract_efuse_v2(
  	return 0;
  }
  
@@ -162,7 +151,6 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
 +	if (!CALIB_BUF1_VALID_V3(buf[1]))
 +		return -EINVAL;
 +
-+	mt->adc_oe = CALIB_BUF0_ADC_OE_V3(buf[0]);
 +	mt->adc_ge = CALIB_BUF0_ADC_GE_V3(buf[0]);
 +	mt->degc_cali = CALIB_BUF0_DEGC_CALI_V3(buf[0]);
 +	mt->o_slope = CALIB_BUF0_O_SLOPE_V3(buf[0]);
@@ -180,7 +168,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  static int mtk_thermal_get_calibration_data(struct device *dev,
  					    struct mtk_thermal *mt)
  {
-@@ -897,6 +1005,7 @@ static int mtk_thermal_get_calibration_d
+@@ -895,6 +998,7 @@ static int mtk_thermal_get_calibration_d
  
  	/* Start with default values */
  	mt->adc_ge = 512;
@@ -188,19 +176,30 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  	for (i = 0; i < mt->conf->num_sensors; i++)
  		mt->vts[i] = 260;
  	mt->degc_cali = 40;
-@@ -924,8 +1033,10 @@ static int mtk_thermal_get_calibration_d
+@@ -920,10 +1024,20 @@ static int mtk_thermal_get_calibration_d
+ 		goto out;
+ 	}
  
- 	if (mt->conf->version == MTK_THERMAL_V1)
+-	if (mt->conf->version == MTK_THERMAL_V1)
++	switch (mt->conf->version) {
++	case MTK_THERMAL_V1:
  		ret = mtk_thermal_extract_efuse_v1(mt, buf);
 -	else
-+	else if (mt->conf->version == MTK_THERMAL_V2)
++		break;
++	case MTK_THERMAL_V2:
  		ret = mtk_thermal_extract_efuse_v2(mt, buf);
-+	else
++		break;
++	case MTK_THERMAL_V3:
 +		ret = mtk_thermal_extract_efuse_v3(mt, buf);
++		break;
++	default:
++		ret = -EINVAL;
++		break;
++	}
  
  	if (ret) {
  		dev_info(dev, "Device not calibrated, using default calibration values\n");
-@@ -956,6 +1067,10 @@ static const struct of_device_id mtk_the
+@@ -954,6 +1068,10 @@ static const struct of_device_id mtk_the
  		.data = (void *)&mt7622_thermal_data,
  	},
  	{
@@ -211,13 +210,31 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  		.compatible = "mediatek,mt8183-thermal",
  		.data = (void *)&mt8183_thermal_data,
  	}, {
-@@ -1070,7 +1185,8 @@ static int mtk_thermal_probe(struct plat
+@@ -1068,15 +1186,24 @@ static int mtk_thermal_probe(struct plat
  		goto err_disable_clk_auxadc;
  	}
  
 -	if (mt->conf->version == MTK_THERMAL_V2) {
-+	if (mt->conf->version == MTK_THERMAL_V2 ||
-+	    mt->conf->version == MTK_THERMAL_V3) {
++	if (mt->conf->version != MTK_THERMAL_V1) {
  		mtk_thermal_turn_on_buffer(apmixed_base);
  		mtk_thermal_release_periodic_ts(mt, auxadc_base);
  	}
+ 
+-	if (mt->conf->version == MTK_THERMAL_V1)
++	switch (mt->conf->version) {
++	case MTK_THERMAL_V1:
+ 		mt->raw_to_mcelsius = raw_to_mcelsius_v1;
+-	else
++		break;
++	case MTK_THERMAL_V2:
+ 		mt->raw_to_mcelsius = raw_to_mcelsius_v2;
++		break;
++	case MTK_THERMAL_V3:
++		mt->raw_to_mcelsius = raw_to_mcelsius_v3;
++		break;
++	default:
++		break;
++	}
+ 
+ 	for (ctrl_id = 0; ctrl_id < mt->conf->num_controller ; ctrl_id++)
+ 		for (i = 0; i < mt->conf->num_banks; i++)



From lede-commits at lists.infradead.org  Tue Feb 14 19:29:19 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 14 Feb 2023 22:29:19 -0500
Subject: [openwrt/openwrt]  treewide: replace /sys/devices/virtual/ubi by
 /sys/class/ubi
In-Reply-To: <167643175855.867860.6122258641937246117@git-01.infra.openwrt.org>
References: <167643175855.867860.6122258641937246117@git-01.infra.openwrt.org>
Message-ID: <mailman.16035.1676431770.3064139.lede-commits@lists.infradead.org>

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

commit e8625c89efbbbe12a5934c10fc3478fd2f70fb21
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Wed Feb 15 03:06:05 2023 +0000

    treewide: replace /sys/devices/virtual/ubi by /sys/class/ubi
    
    Starting from Linux Kernel version 6.3 UBI devices will no longer be
    considered virtual, but rather have an MTD device parent. Hence they
    will no longer be listed under /sys/devices/virtual/ubi which is
    used in multiple places in OpenWrt. Prepare for future kernels by
    using /sys/class/ubi instead of /sys/devuces/virtual/ubi.
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 package/base-files/files/lib/upgrade/nand.sh                  | 9 ++++-----
 target/linux/bcm4908/base-files/lib/preinit/75_rootfs_prepare | 2 +-
 target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh        | 2 +-
 target/linux/ipq806x/base-files/lib/upgrade/linksys.sh        | 2 +-
 target/linux/kirkwood/base-files/lib/upgrade/linksys.sh       | 2 +-
 target/linux/mvebu/cortexa9/base-files/lib/upgrade/linksys.sh | 2 +-
 6 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/package/base-files/files/lib/upgrade/nand.sh b/package/base-files/files/lib/upgrade/nand.sh
index e7ac34f5d0..907945b349 100644
--- a/package/base-files/files/lib/upgrade/nand.sh
+++ b/package/base-files/files/lib/upgrade/nand.sh
@@ -28,7 +28,7 @@ ubi_mknod() {
 
 nand_find_volume() {
 	local ubidevdir ubivoldir
-	ubidevdir="/sys/devices/virtual/ubi/$1"
+	ubidevdir="/sys/class/ubi/"
 	[ ! -d "$ubidevdir" ] && return 1
 	for ubivoldir in $ubidevdir/${1}_*; do
 		[ ! -d "$ubivoldir" ] && continue
@@ -41,13 +41,12 @@ nand_find_volume() {
 }
 
 nand_find_ubi() {
-	local ubidevdir ubidev mtdnum
+	local ubidevdir ubidev mtdnum cmtdnum
 	mtdnum="$( find_mtd_index $1 )"
 	[ ! "$mtdnum" ] && return 1
-	for ubidevdir in /sys/devices/virtual/ubi/ubi*; do
-		[ ! -d "$ubidevdir" ] && continue
+	for ubidevdir in /sys/class/ubi/ubi*; do
+		[ ! -e "$ubidevdir/mtd_num" ] && continue
 		cmtdnum="$( cat $ubidevdir/mtd_num )"
-		[ ! "$mtdnum" ] && continue
 		if [ "$mtdnum" = "$cmtdnum" ]; then
 			ubidev=$( basename $ubidevdir )
 			ubi_mknod "$ubidevdir"
diff --git a/target/linux/bcm4908/base-files/lib/preinit/75_rootfs_prepare b/target/linux/bcm4908/base-files/lib/preinit/75_rootfs_prepare
index 09c12cd31d..829dd6adf1 100644
--- a/target/linux/bcm4908/base-files/lib/preinit/75_rootfs_prepare
+++ b/target/linux/bcm4908/base-files/lib/preinit/75_rootfs_prepare
@@ -23,7 +23,7 @@ rootfs_prepare() {
 	ubinfo /dev/ubi0 -N metadata1 > /dev/null 2>&1 || return
 
 	# Find UBI volume device (e.g. ubi0_123)
-	local ubivol="$(grep rootfs_data /sys/devices/virtual/ubi/ubi*/ubi*/name | sed -n 's/.*\(ubi\d*_\d*\).*/\1/p')"
+	local ubivol="$(grep rootfs_data /sys/class/ubi/ubi*/name | sed -n 's/.*\(ubi\d*_\d*\).*/\1/p')"
 	if [ -n "$ubivol" ]; then
 		bcm4908_verify_rootfs_data $ubivol
 	else
diff --git a/target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh b/target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh
index 5d25c20ad7..c0d45d640d 100644
--- a/target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh
+++ b/target/linux/ipq40xx/base-files/lib/upgrade/linksys.sh
@@ -3,7 +3,7 @@ linksys_get_target_firmware() {
 
 	cur_boot_part="$(/usr/sbin/fw_printenv -n boot_part)"
 	if [ -z "${cur_boot_part}" ]; then
-		mtd_ubi0=$(cat /sys/devices/virtual/ubi/ubi0/mtd_num)
+		mtd_ubi0=$(cat /sys/class/ubi/ubi0/mtd_num)
 		case "$(grep -E "^mtd${mtd_ubi0}:" /proc/mtd | cut -d '"' -f 2)" in
 		kernel|rootfs)
 			cur_boot_part=1
diff --git a/target/linux/ipq806x/base-files/lib/upgrade/linksys.sh b/target/linux/ipq806x/base-files/lib/upgrade/linksys.sh
index 1feffc7aa2..5f883637da 100644
--- a/target/linux/ipq806x/base-files/lib/upgrade/linksys.sh
+++ b/target/linux/ipq806x/base-files/lib/upgrade/linksys.sh
@@ -8,7 +8,7 @@ linksys_get_target_firmware() {
 
 	cur_boot_part=$(/usr/sbin/fw_printenv -n boot_part)
 	if [ -z "${cur_boot_part}" ] ; then
-		mtd_ubi0=$(cat /sys/devices/virtual/ubi/ubi0/mtd_num)
+		mtd_ubi0=$(cat /sys/class/ubi/ubi0/mtd_num)
 		case $(grep -E ^mtd${mtd_ubi0}: /proc/mtd | cut -d '"' -f 2) in
 		kernel1|rootfs1)
 			cur_boot_part=1
diff --git a/target/linux/kirkwood/base-files/lib/upgrade/linksys.sh b/target/linux/kirkwood/base-files/lib/upgrade/linksys.sh
index 7e20276fe5..9067f00e1a 100644
--- a/target/linux/kirkwood/base-files/lib/upgrade/linksys.sh
+++ b/target/linux/kirkwood/base-files/lib/upgrade/linksys.sh
@@ -8,7 +8,7 @@ linksys_get_target_firmware() {
 
 	cur_boot_part=$(/usr/sbin/fw_printenv -n boot_part)
 	if [ -z "${cur_boot_part}" ] ; then
-		mtd_ubi0=$(cat /sys/devices/virtual/ubi/ubi0/mtd_num)
+		mtd_ubi0=$(cat /sys/class/ubi/ubi0/mtd_num)
 		case $(grep -E ^mtd${mtd_ubi0}: /proc/mtd | cut -d '"' -f 2) in
 		kernel|rootfs)
 			cur_boot_part=1
diff --git a/target/linux/mvebu/cortexa9/base-files/lib/upgrade/linksys.sh b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/linksys.sh
index 826bf8c9b5..1a23a9bbc2 100644
--- a/target/linux/mvebu/cortexa9/base-files/lib/upgrade/linksys.sh
+++ b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/linksys.sh
@@ -8,7 +8,7 @@ linksys_get_target_firmware() {
 
 	cur_boot_part=$(/usr/sbin/fw_printenv -n boot_part)
 	if [ -z "${cur_boot_part}" ] ; then
-		mtd_ubi0=$(cat /sys/devices/virtual/ubi/ubi0/mtd_num)
+		mtd_ubi0=$(cat /sys/class/ubi/ubi0/mtd_num)
 		case $(grep -E ^mtd${mtd_ubi0}: /proc/mtd | cut -d '"' -f 2) in
 		kernel1|rootfs1)
 			cur_boot_part=1



From lede-commits at lists.infradead.org  Tue Feb 14 19:29:21 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 14 Feb 2023 22:29:21 -0500
Subject: [openwrt/openwrt]  kernel: import accepted MediaTek Ethernet patches
In-Reply-To: <167643175855.867860.6122258641937246117@git-01.infra.openwrt.org>
References: <167643175855.867860.6122258641937246117@git-01.infra.openwrt.org>
Message-ID: <mailman.16036.1676431771.3064139.lede-commits@lists.infradead.org>

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

commit f584fb2f7e6e4c2663c802d5c9367894d9d65f69
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Tue Feb 14 23:25:19 2023 +0000

    kernel: import accepted MediaTek Ethernet patches
    
    Import some accepted and pending upstream patches for mtk_eth_soc,
    replacing some semantically equivalent local patches and fixing issues
    when operating the PCS in 1G SGMII mode.
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 ...t-mtk_eth_soc-Avoid-truncating-allocation.patch |  60 ++++++++++
 ...k-sgmii-ensure-the-SGMII-PHY-is-powered-d.patch | 126 +++++++++++++++++++++
 ...t-mediatek-sgmii-fix-duplex-configuration.patch |  60 ++++++++++
 ...gmii-enable-PCS-polling-to-allow-SFP-work.patch |  33 ++++++
 .../724-net-mtk_sgmii-implement-mtk_pcs_ops.patch  |   2 +-
 ...t-mtk_sgmii-fix-powering-up-the-SGMII-phy.patch |  39 -------
 ...ii-ensure-the-SGMII-PHY-is-powered-down-o.patch |  65 -----------
 ...ii-mtk_pcs_setup_mode_an-don-t-rely-on-re.patch |   2 +-
 ...ii-set-the-speed-according-to-the-phy-int.patch |  22 ++--
 .../729-net-mtk_eth_soc-improve-comment.patch      |   4 +-
 ...gmii-enable-PCS-polling-to-allow-SFP-work.patch |  23 ----
 ...t-mediatek-ppe-add-support-for-flow-accou.patch |  16 +--
 ...t-mtk_eth_soc-implement-multi-queue-suppo.patch |   6 +-
 ...t-mediatek-ppe-assign-per-port-queues-for.patch |   2 +-
 ...t-mtk_eth_soc-compile-out-netsys-v2-code-.patch |   2 +-
 ...t-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch |   2 +-
 ...-net-ethernet-mtk_eth_soc-reset-PCS-state.patch |  44 +++++++
 ...t-mtk_eth_soc-fix-RX-data-corruption-issu.patch |  46 ++++++++
 ...t-mtk_eth_soc-ppe-fix-L2-offloading-with-.patch |   2 +-
 19 files changed, 396 insertions(+), 160 deletions(-)

diff --git a/target/linux/generic/backport-5.15/733-v6.2-01-net-ethernet-mtk_eth_soc-Avoid-truncating-allocation.patch b/target/linux/generic/backport-5.15/733-v6.2-01-net-ethernet-mtk_eth_soc-Avoid-truncating-allocation.patch
new file mode 100644
index 0000000000..2165a824ec
--- /dev/null
+++ b/target/linux/generic/backport-5.15/733-v6.2-01-net-ethernet-mtk_eth_soc-Avoid-truncating-allocation.patch
@@ -0,0 +1,60 @@
+From f3eceaed9edd7c0e0d9fb057613131f92973626f Mon Sep 17 00:00:00 2001
+From: Kees Cook <keescook at chromium.org>
+Date: Fri, 27 Jan 2023 14:38:54 -0800
+Subject: [PATCH] net: ethernet: mtk_eth_soc: Avoid truncating allocation
+
+There doesn't appear to be a reason to truncate the allocation used for
+flow_info, so do a full allocation and remove the unused empty struct.
+GCC does not like having a reference to an object that has been
+partially allocated, as bounds checking may become impossible when
+such an object is passed to other code. Seen with GCC 13:
+
+../drivers/net/ethernet/mediatek/mtk_ppe.c: In function 'mtk_foe_entry_commit_subflow':
+../drivers/net/ethernet/mediatek/mtk_ppe.c:623:18: warning: array subscript 'struct mtk_flow_entry[0]' is partly outside array bounds of 'unsigned char[48]' [-Warray-bounds=]
+  623 |         flow_info->l2_data.base_flow = entry;
+      |                  ^~
+
+Cc: Felix Fietkau <nbd at nbd.name>
+Cc: John Crispin <john at phrozen.org>
+Cc: Sean Wang <sean.wang at mediatek.com>
+Cc: Mark Lee <Mark-MC.Lee at mediatek.com>
+Cc: Lorenzo Bianconi <lorenzo at kernel.org>
+Cc: "David S. Miller" <davem at davemloft.net>
+Cc: Eric Dumazet <edumazet at google.com>
+Cc: Jakub Kicinski <kuba at kernel.org>
+Cc: Paolo Abeni <pabeni at redhat.com>
+Cc: Matthias Brugger <matthias.bgg at gmail.com>
+Cc: netdev at vger.kernel.org
+Cc: linux-arm-kernel at lists.infradead.org
+Cc: linux-mediatek at lists.infradead.org
+Signed-off-by: Kees Cook <keescook at chromium.org>
+Reviewed-by: Simon Horman <simon.horman at corigine.com>
+Link: https://lore.kernel.org/r/20230127223853.never.014-kees at kernel.org
+Signed-off-by: Paolo Abeni <pabeni at redhat.com>
+---
+ drivers/net/ethernet/mediatek/mtk_ppe.c | 3 +--
+ drivers/net/ethernet/mediatek/mtk_ppe.h | 1 -
+ 2 files changed, 1 insertion(+), 3 deletions(-)
+
+--- a/drivers/net/ethernet/mediatek/mtk_ppe.c
++++ b/drivers/net/ethernet/mediatek/mtk_ppe.c
+@@ -601,8 +601,7 @@ mtk_foe_entry_commit_subflow(struct mtk_
+ 	u32 ib1_mask = mtk_get_ib1_pkt_type_mask(ppe->eth) | MTK_FOE_IB1_UDP;
+ 	int type;
+ 
+-	flow_info = kzalloc(offsetof(struct mtk_flow_entry, l2_data.end),
+-			    GFP_ATOMIC);
++	flow_info = kzalloc(sizeof(*flow_info), GFP_ATOMIC);
+ 	if (!flow_info)
+ 		return;
+ 
+--- a/drivers/net/ethernet/mediatek/mtk_ppe.h
++++ b/drivers/net/ethernet/mediatek/mtk_ppe.h
+@@ -277,7 +277,6 @@ struct mtk_flow_entry {
+ 		struct {
+ 			struct mtk_flow_entry *base_flow;
+ 			struct hlist_node list;
+-			struct {} end;
+ 		} l2_data;
+ 	};
+ 	struct rhash_head node;
diff --git a/target/linux/generic/backport-5.15/733-v6.2-02-net-mediatek-sgmii-ensure-the-SGMII-PHY-is-powered-d.patch b/target/linux/generic/backport-5.15/733-v6.2-02-net-mediatek-sgmii-ensure-the-SGMII-PHY-is-powered-d.patch
new file mode 100644
index 0000000000..b79afccd4c
--- /dev/null
+++ b/target/linux/generic/backport-5.15/733-v6.2-02-net-mediatek-sgmii-ensure-the-SGMII-PHY-is-powered-d.patch
@@ -0,0 +1,126 @@
+From 7ff82416de8295c61423ef6fd75f052d3837d2f7 Mon Sep 17 00:00:00 2001
+From: Alexander Couzens <lynxis at fe80.eu>
+Date: Wed, 1 Feb 2023 19:23:29 +0100
+Subject: [PATCH] net: mediatek: sgmii: ensure the SGMII PHY is powered down on
+ configuration
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The code expect the PHY to be in power down which is only true after reset.
+Allow changes of the SGMII parameters more than once.
+
+Only power down when reconfiguring to avoid bouncing the link when there's
+no reason to - based on code from Russell King.
+
+There are cases when the SGMII_PHYA_PWD register contains 0x9 which
+prevents SGMII from working. The SGMII still shows link but no traffic
+can flow. Writing 0x0 to the PHYA_PWD register fix the issue. 0x0 was
+taken from a good working state of the SGMII interface.
+
+Fixes: 42c03844e93d ("net-next: mediatek: add support for MediaTek MT7622 SoC")
+Suggested-by: Russell King (Oracle) <linux at armlinux.org.uk>
+Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
+[ bmork: rebased and squashed into one patch ]
+Reviewed-by: Russell King (Oracle) <rmk+kernel at armlinux.org.uk>
+Signed-off-by: Bj?rn Mork <bjorn at mork.no>
+Acked-by: Daniel Golle <daniel at makrotopia.org>
+Tested-by: Daniel Golle <daniel at makrotopia.org>
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
+---
+ drivers/net/ethernet/mediatek/mtk_eth_soc.h |  2 ++
+ drivers/net/ethernet/mediatek/mtk_sgmii.c   | 39 +++++++++++++++------
+ 2 files changed, 30 insertions(+), 11 deletions(-)
+
+--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+@@ -1027,11 +1027,13 @@ struct mtk_soc_data {
+  * @regmap:            The register map pointing at the range used to setup
+  *                     SGMII modes
+  * @ana_rgc3:          The offset refers to register ANA_RGC3 related to regmap
++ * @interface:         Currently configured interface mode
+  * @pcs:               Phylink PCS structure
+  */
+ struct mtk_pcs {
+ 	struct regmap	*regmap;
+ 	u32             ana_rgc3;
++	phy_interface_t	interface;
+ 	struct phylink_pcs pcs;
+ };
+ 
+--- a/drivers/net/ethernet/mediatek/mtk_sgmii.c
++++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c
+@@ -24,6 +24,10 @@ static int mtk_pcs_setup_mode_an(struct
+ {
+ 	unsigned int val;
+ 
++	regmap_read(mpcs->regmap, mpcs->ana_rgc3, &val);
++	val &= ~RG_PHY_SPEED_MASK;
++	regmap_write(mpcs->regmap, mpcs->ana_rgc3, val);
++
+ 	/* Setup the link timer and QPHY power up inside SGMIISYS */
+ 	regmap_write(mpcs->regmap, SGMSYS_PCS_LINK_TIMER,
+ 		     SGMII_LINK_TIMER_DEFAULT);
+@@ -36,9 +40,6 @@ static int mtk_pcs_setup_mode_an(struct
+ 	val |= SGMII_AN_RESTART;
+ 	regmap_write(mpcs->regmap, SGMSYS_PCS_CONTROL_1, val);
+ 
+-	regmap_read(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, &val);
+-	val &= ~SGMII_PHYA_PWD;
+-	regmap_write(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, val);
+ 
+ 	return 0;
+ 
+@@ -69,11 +70,6 @@ static int mtk_pcs_setup_mode_force(stru
+ 	val |= SGMII_SPEED_1000;
+ 	regmap_write(mpcs->regmap, SGMSYS_SGMII_MODE, val);
+ 
+-	/* Release PHYA power down state */
+-	regmap_read(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, &val);
+-	val &= ~SGMII_PHYA_PWD;
+-	regmap_write(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, val);
+-
+ 	return 0;
+ }
+ 
+@@ -85,12 +81,32 @@ static int mtk_pcs_config(struct phylink
+ 	struct mtk_pcs *mpcs = pcs_to_mtk_pcs(pcs);
+ 	int err = 0;
+ 
++	if (mpcs->interface != interface) {
++		/* PHYA power down */
++		regmap_update_bits(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL,
++				   SGMII_PHYA_PWD, SGMII_PHYA_PWD);
++
++		mpcs->interface = interface;
++	}
++
+ 	/* Setup SGMIISYS with the determined property */
+ 	if (interface != PHY_INTERFACE_MODE_SGMII)
+ 		err = mtk_pcs_setup_mode_force(mpcs, interface);
+ 	else if (phylink_autoneg_inband(mode))
+ 		err = mtk_pcs_setup_mode_an(mpcs);
+ 
++	/* Release PHYA power down state
++	 * Only removing bit SGMII_PHYA_PWD isn't enough.
++	 * There are cases when the SGMII_PHYA_PWD register contains 0x9 which
++	 * prevents SGMII from working. The SGMII still shows link but no traffic
++	 * can flow. Writing 0x0 to the PHYA_PWD register fix the issue. 0x0 was
++	 * taken from a good working state of the SGMII interface.
++	 * Unknown how much the QPHY needs but it is racy without a sleep.
++	 * Tested on mt7622 & mt7986.
++	 */
++	usleep_range(50, 100);
++	regmap_write(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, 0);
++
+ 	return err;
+ }
+ 
+@@ -145,6 +161,7 @@ int mtk_sgmii_init(struct mtk_sgmii *ss,
+ 			return PTR_ERR(ss->pcs[i].regmap);
+ 
+ 		ss->pcs[i].pcs.ops = &mtk_pcs_ops;
++		ss->pcs[i].interface = PHY_INTERFACE_MODE_NA;
+ 	}
+ 
+ 	return 0;
diff --git a/target/linux/generic/backport-5.15/733-v6.2-03-net-mediatek-sgmii-fix-duplex-configuration.patch b/target/linux/generic/backport-5.15/733-v6.2-03-net-mediatek-sgmii-fix-duplex-configuration.patch
new file mode 100644
index 0000000000..007cbb5138
--- /dev/null
+++ b/target/linux/generic/backport-5.15/733-v6.2-03-net-mediatek-sgmii-fix-duplex-configuration.patch
@@ -0,0 +1,60 @@
+From 9d32637122de88f1ef614c29703f0e050cad342e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Bj=C3=B8rn=20Mork?= <bjorn at mork.no>
+Date: Wed, 1 Feb 2023 19:23:30 +0100
+Subject: [PATCH] net: mediatek: sgmii: fix duplex configuration
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The logic of the duplex bit is inverted.  Setting it means half
+duplex, not full duplex.
+
+Fix and rename macro to avoid confusion.
+
+Fixes: 7e538372694b ("net: ethernet: mediatek: Re-add support SGMII")
+Reviewed-by: Russell King (Oracle) <rmk+kernel at armlinux.org.uk>
+Signed-off-by: Bj?rn Mork <bjorn at mork.no>
+Acked-by: Daniel Golle <daniel at makrotopia.org>
+Tested-by: Daniel Golle <daniel at makrotopia.org>
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
+---
+ drivers/net/ethernet/mediatek/mtk_eth_soc.h | 2 +-
+ drivers/net/ethernet/mediatek/mtk_sgmii.c   | 6 +++---
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+@@ -496,7 +496,7 @@
+ #define SGMII_SPEED_10			FIELD_PREP(SGMII_SPEED_MASK, 0)
+ #define SGMII_SPEED_100			FIELD_PREP(SGMII_SPEED_MASK, 1)
+ #define SGMII_SPEED_1000		FIELD_PREP(SGMII_SPEED_MASK, 2)
+-#define SGMII_DUPLEX_FULL		BIT(4)
++#define SGMII_DUPLEX_HALF		BIT(4)
+ #define SGMII_IF_MODE_BIT5		BIT(5)
+ #define SGMII_REMOTE_FAULT_DIS		BIT(8)
+ #define SGMII_CODE_SYNC_SET_VAL		BIT(9)
+--- a/drivers/net/ethernet/mediatek/mtk_sgmii.c
++++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c
+@@ -66,7 +66,7 @@ static int mtk_pcs_setup_mode_force(stru
+ 
+ 	/* Set the speed etc but leave the duplex unchanged */
+ 	regmap_read(mpcs->regmap, SGMSYS_SGMII_MODE, &val);
+-	val &= SGMII_DUPLEX_FULL | ~SGMII_IF_MODE_MASK;
++	val &= SGMII_DUPLEX_HALF | ~SGMII_IF_MODE_MASK;
+ 	val |= SGMII_SPEED_1000;
+ 	regmap_write(mpcs->regmap, SGMSYS_SGMII_MODE, val);
+ 
+@@ -131,9 +131,10 @@ static void mtk_pcs_link_up(struct phyli
+ 
+ 	/* SGMII force duplex setting */
+ 	regmap_read(mpcs->regmap, SGMSYS_SGMII_MODE, &val);
+-	val &= ~SGMII_DUPLEX_FULL;
+-	if (duplex == DUPLEX_FULL)
+-		val |= SGMII_DUPLEX_FULL;
++
++	val &= ~SGMII_DUPLEX_HALF;
++	if (duplex != DUPLEX_FULL)
++		val |= SGMII_DUPLEX_HALF;
+ 
+ 	regmap_write(mpcs->regmap, SGMSYS_SGMII_MODE, val);
+ }
diff --git a/target/linux/generic/backport-5.15/733-v6.2-04-mtk_sgmii-enable-PCS-polling-to-allow-SFP-work.patch b/target/linux/generic/backport-5.15/733-v6.2-04-mtk_sgmii-enable-PCS-polling-to-allow-SFP-work.patch
new file mode 100644
index 0000000000..ace8aa075b
--- /dev/null
+++ b/target/linux/generic/backport-5.15/733-v6.2-04-mtk_sgmii-enable-PCS-polling-to-allow-SFP-work.patch
@@ -0,0 +1,33 @@
+From 3337a6e04ddf2923a1bdcf3d31b3b52412bf82dd Mon Sep 17 00:00:00 2001
+From: Alexander Couzens <lynxis at fe80.eu>
+Date: Wed, 1 Feb 2023 19:23:31 +0100
+Subject: [PATCH] mtk_sgmii: enable PCS polling to allow SFP work
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Currently there is no IRQ handling (even the SGMII supports it).
+Enable polling to support SFP ports.
+
+Fixes: 14a44ab0330d ("net: mtk_eth_soc: partially convert to phylink_pcs")
+Reviewed-by: Russell King (Oracle) <rmk+kernel at armlinux.org.uk>
+Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
+[ bmork: changed "1" => "true" ]
+Signed-off-by: Bj?rn Mork <bjorn at mork.no>
+Acked-by: Daniel Golle <daniel at makrotopia.org>
+Tested-by: Daniel Golle <daniel at makrotopia.org>
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
+---
+ drivers/net/ethernet/mediatek/mtk_sgmii.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/ethernet/mediatek/mtk_sgmii.c
++++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c
+@@ -162,6 +162,7 @@ int mtk_sgmii_init(struct mtk_sgmii *ss,
+ 			return PTR_ERR(ss->pcs[i].regmap);
+ 
+ 		ss->pcs[i].pcs.ops = &mtk_pcs_ops;
++		ss->pcs[i].pcs.poll = true;
+ 		ss->pcs[i].interface = PHY_INTERFACE_MODE_NA;
+ 	}
+ 
diff --git a/target/linux/generic/pending-5.15/724-net-mtk_sgmii-implement-mtk_pcs_ops.patch b/target/linux/generic/pending-5.15/724-net-mtk_sgmii-implement-mtk_pcs_ops.patch
index cd97706658..274c3a5cc2 100644
--- a/target/linux/generic/pending-5.15/724-net-mtk_sgmii-implement-mtk_pcs_ops.patch
+++ b/target/linux/generic/pending-5.15/724-net-mtk_sgmii-implement-mtk_pcs_ops.patch
@@ -15,7 +15,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_sgmii.c
 +++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c
-@@ -122,10 +122,28 @@ static void mtk_pcs_link_up(struct phyli
+@@ -143,10 +143,28 @@ static void mtk_pcs_link_up(struct phyli
  	regmap_write(mpcs->regmap, SGMSYS_SGMII_MODE, val);
  }
  
diff --git a/target/linux/generic/pending-5.15/725-net-mtk_sgmii-fix-powering-up-the-SGMII-phy.patch b/target/linux/generic/pending-5.15/725-net-mtk_sgmii-fix-powering-up-the-SGMII-phy.patch
deleted file mode 100644
index 0fa357d48f..0000000000
--- a/target/linux/generic/pending-5.15/725-net-mtk_sgmii-fix-powering-up-the-SGMII-phy.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 7f75f43fe2159123baa101fcc8c6faa0b0a4c598 Mon Sep 17 00:00:00 2001
-From: Alexander Couzens <lynxis at fe80.eu>
-Date: Sat, 13 Aug 2022 14:48:51 +0200
-Subject: [PATCH 05/10] net: mtk_sgmii: fix powering up the SGMII phy
-
-There are certain race condition when the SGMII_PHYA_PWD register still
-contains 0x9 which prevents the SGMII from working properly.
-
-The SGMII still shows link but no traffic can flow.
-
-Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
----
- drivers/net/ethernet/mediatek/mtk_sgmii.c | 8 ++------
- 1 file changed, 2 insertions(+), 6 deletions(-)
-
---- a/drivers/net/ethernet/mediatek/mtk_sgmii.c
-+++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c
-@@ -36,9 +36,7 @@ static int mtk_pcs_setup_mode_an(struct
- 	val |= SGMII_AN_RESTART;
- 	regmap_write(mpcs->regmap, SGMSYS_PCS_CONTROL_1, val);
- 
--	regmap_read(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, &val);
--	val &= ~SGMII_PHYA_PWD;
--	regmap_write(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, val);
-+	regmap_write(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, 0);
- 
- 	return 0;
- 
-@@ -70,9 +68,7 @@ static int mtk_pcs_setup_mode_force(stru
- 	regmap_write(mpcs->regmap, SGMSYS_SGMII_MODE, val);
- 
- 	/* Release PHYA power down state */
--	regmap_read(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, &val);
--	val &= ~SGMII_PHYA_PWD;
--	regmap_write(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, val);
-+	regmap_write(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, 0);
- 
- 	return 0;
- }
diff --git a/target/linux/generic/pending-5.15/726-net-mtk_sgmii-ensure-the-SGMII-PHY-is-powered-down-o.patch b/target/linux/generic/pending-5.15/726-net-mtk_sgmii-ensure-the-SGMII-PHY-is-powered-down-o.patch
deleted file mode 100644
index 329b41cf03..0000000000
--- a/target/linux/generic/pending-5.15/726-net-mtk_sgmii-ensure-the-SGMII-PHY-is-powered-down-o.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From 9daea9b71d060d93d7394ac465b2e5ee0b7e7bca Mon Sep 17 00:00:00 2001
-From: Alexander Couzens <lynxis at fe80.eu>
-Date: Mon, 15 Aug 2022 16:02:01 +0200
-Subject: [PATCH 06/10] net: mtk_sgmii: ensure the SGMII PHY is powered down on
- configuration
-
-The code expect the PHY to be in power down (which is only true after reset).
-Allow the changes of SGMII parameters more than once.
----
- drivers/net/ethernet/mediatek/mtk_sgmii.c | 16 +++++++++++++++-
- 1 file changed, 15 insertions(+), 1 deletion(-)
-
---- a/drivers/net/ethernet/mediatek/mtk_sgmii.c
-+++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c
-@@ -7,6 +7,7 @@
-  *
-  */
- 
-+#include <linux/delay.h>
- #include <linux/mfd/syscon.h>
- #include <linux/of.h>
- #include <linux/phylink.h>
-@@ -24,6 +25,9 @@ static int mtk_pcs_setup_mode_an(struct
- {
- 	unsigned int val;
- 
-+	/* PHYA power down */
-+	regmap_write(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, SGMII_PHYA_PWD);
-+
- 	/* Setup the link timer and QPHY power up inside SGMIISYS */
- 	regmap_write(mpcs->regmap, SGMSYS_PCS_LINK_TIMER,
- 		     SGMII_LINK_TIMER_DEFAULT);
-@@ -36,6 +40,10 @@ static int mtk_pcs_setup_mode_an(struct
- 	val |= SGMII_AN_RESTART;
- 	regmap_write(mpcs->regmap, SGMSYS_PCS_CONTROL_1, val);
- 
-+	/* Release PHYA power down state
-+	 * unknown how much the QPHY needs but it is racy without a sleep
-+	 */
-+	usleep_range(50, 100);
- 	regmap_write(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, 0);
- 
- 	return 0;
-@@ -50,6 +58,9 @@ static int mtk_pcs_setup_mode_force(stru
- {
- 	unsigned int val;
- 
-+	/* PHYA power down */
-+	regmap_write(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, SGMII_PHYA_PWD);
-+
- 	regmap_read(mpcs->regmap, mpcs->ana_rgc3, &val);
- 	val &= ~RG_PHY_SPEED_MASK;
- 	if (interface == PHY_INTERFACE_MODE_2500BASEX)
-@@ -67,7 +78,10 @@ static int mtk_pcs_setup_mode_force(stru
- 	val |= SGMII_SPEED_1000;
- 	regmap_write(mpcs->regmap, SGMSYS_SGMII_MODE, val);
- 
--	/* Release PHYA power down state */
-+	/* Release PHYA power down state
-+	 * unknown how much the QPHY needs but it is racy without a sleep
-+	 */
-+	usleep_range(50, 100);
- 	regmap_write(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, 0);
- 
- 	return 0;
diff --git a/target/linux/generic/pending-5.15/727-net-mtk_sgmii-mtk_pcs_setup_mode_an-don-t-rely-on-re.patch b/target/linux/generic/pending-5.15/727-net-mtk_sgmii-mtk_pcs_setup_mode_an-don-t-rely-on-re.patch
index 5bc187cfc8..fd68ce22f6 100644
--- a/target/linux/generic/pending-5.15/727-net-mtk_sgmii-mtk_pcs_setup_mode_an-don-t-rely-on-re.patch
+++ b/target/linux/generic/pending-5.15/727-net-mtk_sgmii-mtk_pcs_setup_mode_an-don-t-rely-on-re.patch
@@ -28,4 +28,4 @@ Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
 +	val |= SGMII_AN_RESTART | SGMII_AN_ENABLE;
  	regmap_write(mpcs->regmap, SGMSYS_PCS_CONTROL_1, val);
  
- 	/* Release PHYA power down state
+ 
diff --git a/target/linux/generic/pending-5.15/728-net-mtk_sgmii-set-the-speed-according-to-the-phy-int.patch b/target/linux/generic/pending-5.15/728-net-mtk_sgmii-set-the-speed-according-to-the-phy-int.patch
index 0b17f77eef..f58499c7c2 100644
--- a/target/linux/generic/pending-5.15/728-net-mtk_sgmii-set-the-speed-according-to-the-phy-int.patch
+++ b/target/linux/generic/pending-5.15/728-net-mtk_sgmii-set-the-speed-according-to-the-phy-int.patch
@@ -14,7 +14,7 @@ Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
 
 --- a/drivers/net/ethernet/mediatek/mtk_sgmii.c
 +++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c
-@@ -21,13 +21,20 @@ static struct mtk_pcs *pcs_to_mtk_pcs(st
+@@ -20,12 +20,14 @@ static struct mtk_pcs *pcs_to_mtk_pcs(st
  }
  
  /* For SGMII interface mode */
@@ -23,25 +23,19 @@ Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
  {
  	unsigned int val;
  
- 	/* PHYA power down */
- 	regmap_write(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL, SGMII_PHYA_PWD);
- 
-+	/* Set SGMII phy speed */
-+	regmap_read(mpcs->regmap, mpcs->ana_rgc3, &val);
-+	val &= ~RG_PHY_SPEED_MASK;
+ 	regmap_read(mpcs->regmap, mpcs->ana_rgc3, &val);
+ 	val &= ~RG_PHY_SPEED_MASK;
 +	if (interface == PHY_INTERFACE_MODE_2500BASEX)
 +		val |= RG_PHY_SPEED_3_125G;
-+	regmap_write(mpcs->regmap, mpcs->ana_rgc3, val);
-+
+ 	regmap_write(mpcs->regmap, mpcs->ana_rgc3, val);
+ 
  	/* Setup the link timer and QPHY power up inside SGMIISYS */
- 	regmap_write(mpcs->regmap, SGMSYS_PCS_LINK_TIMER,
- 		     SGMII_LINK_TIMER_DEFAULT);
-@@ -100,7 +107,7 @@ static int mtk_pcs_config(struct phylink
+@@ -98,7 +100,7 @@ static int mtk_pcs_config(struct phylink
  	if (interface != PHY_INTERFACE_MODE_SGMII)
  		err = mtk_pcs_setup_mode_force(mpcs, interface);
  	else if (phylink_autoneg_inband(mode))
 -		err = mtk_pcs_setup_mode_an(mpcs);
 +		err = mtk_pcs_setup_mode_an(mpcs, interface);
  
- 	return err;
- }
+ 	/* Release PHYA power down state
+ 	 * Only removing bit SGMII_PHYA_PWD isn't enough.
diff --git a/target/linux/generic/pending-5.15/729-net-mtk_eth_soc-improve-comment.patch b/target/linux/generic/pending-5.15/729-net-mtk_eth_soc-improve-comment.patch
index 80144850ec..cd64c6147a 100644
--- a/target/linux/generic/pending-5.15/729-net-mtk_eth_soc-improve-comment.patch
+++ b/target/linux/generic/pending-5.15/729-net-mtk_eth_soc-improve-comment.patch
@@ -10,7 +10,7 @@ Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
 
 --- a/drivers/net/ethernet/mediatek/mtk_sgmii.c
 +++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c
-@@ -80,7 +80,8 @@ static int mtk_pcs_setup_mode_force(stru
+@@ -67,7 +67,8 @@ static int mtk_pcs_setup_mode_force(stru
  	val &= ~SGMII_AN_ENABLE;
  	regmap_write(mpcs->regmap, SGMSYS_PCS_CONTROL_1, val);
  
@@ -18,5 +18,5 @@ Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
 +	/* Set the speed etc but leave the duplex unchanged.
 +	 * The SGMII mode for 2.5gbit is the same as for 1gbit, expect the speed in ANA_RGC3 */
  	regmap_read(mpcs->regmap, SGMSYS_SGMII_MODE, &val);
- 	val &= SGMII_DUPLEX_FULL | ~SGMII_IF_MODE_MASK;
+ 	val &= SGMII_DUPLEX_HALF | ~SGMII_IF_MODE_MASK;
  	val |= SGMII_SPEED_1000;
diff --git a/target/linux/generic/pending-5.15/730-mtk_sgmii-enable-PCS-polling-to-allow-SFP-work.patch b/target/linux/generic/pending-5.15/730-mtk_sgmii-enable-PCS-polling-to-allow-SFP-work.patch
deleted file mode 100644
index d185aed7bd..0000000000
--- a/target/linux/generic/pending-5.15/730-mtk_sgmii-enable-PCS-polling-to-allow-SFP-work.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From 95dcd0f223d7cab6e25bc19088016e5eb4ca1804 Mon Sep 17 00:00:00 2001
-From: Alexander Couzens <lynxis at fe80.eu>
-Date: Tue, 16 Aug 2022 00:22:11 +0200
-Subject: [PATCH 10/10] mtk_sgmii: enable PCS polling to allow SFP work
-
-Currently there is no IRQ handling (even the SGMII supports it).
-Enable polling to support SFP ports.
-
-Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
----
- drivers/net/ethernet/mediatek/mtk_sgmii.c | 1 +
- 1 file changed, 1 insertion(+)
-
---- a/drivers/net/ethernet/mediatek/mtk_sgmii.c
-+++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c
-@@ -182,6 +182,7 @@ int mtk_sgmii_init(struct mtk_sgmii *ss,
- 			return PTR_ERR(ss->pcs[i].regmap);
- 
- 		ss->pcs[i].pcs.ops = &mtk_pcs_ops;
-+		ss->pcs[i].pcs.poll = 1;
- 	}
- 
- 	return 0;
diff --git a/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch b/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch
index 26b88e4967..f31307f8dd 100644
--- a/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch
+++ b/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch
@@ -90,7 +90,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
  		.rxd_size = sizeof(struct mtk_rx_dma_v2),
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -1007,6 +1007,7 @@ struct mtk_soc_data {
+@@ -1012,6 +1012,7 @@ struct mtk_soc_data {
  	u8		hash_offset;
  	u16		foe_entry_size;
  	netdev_features_t hw_features;
@@ -171,7 +171,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
  	dma_wmb();
  
  	mtk_ppe_cache_clear(ppe);
-@@ -743,14 +793,42 @@ int mtk_ppe_prepare_reset(struct mtk_ppe
+@@ -742,14 +792,42 @@ int mtk_ppe_prepare_reset(struct mtk_ppe
  	return mtk_ppe_wait_busy(ppe);
  }
  
@@ -215,7 +215,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
  
  	ppe = devm_kzalloc(dev, sizeof(*ppe), GFP_KERNEL);
  	if (!ppe)
-@@ -765,6 +843,7 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_
+@@ -764,6 +842,7 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_
  	ppe->eth = eth;
  	ppe->dev = dev;
  	ppe->version = version;
@@ -223,7 +223,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
  
  	foe = dmam_alloc_coherent(ppe->dev,
  				  MTK_PPE_ENTRIES * soc->foe_entry_size,
-@@ -780,6 +859,25 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_
+@@ -779,6 +858,25 @@ struct mtk_ppe *mtk_ppe_init(struct mtk_
  	if (!ppe->foe_flow)
  		return NULL;
  
@@ -249,7 +249,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
  	mtk_ppe_debugfs_init(ppe, index);
  
  	return ppe;
-@@ -894,6 +992,16 @@ void mtk_ppe_start(struct mtk_ppe *ppe)
+@@ -893,6 +991,16 @@ void mtk_ppe_start(struct mtk_ppe *ppe)
  		ppe_w32(ppe, MTK_PPE_DEFAULT_CPU_PORT1, 0xcb777);
  		ppe_w32(ppe, MTK_PPE_SBW_CTRL, 0x7f);
  	}
@@ -276,7 +276,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
  #define MTK_FOE_IB2_WDMA_DEVIDX		BIT(16)
  #define MTK_FOE_IB2_WDMA_WINFO		BIT(17)
  
-@@ -284,16 +285,34 @@ struct mtk_flow_entry {
+@@ -283,16 +284,34 @@ struct mtk_flow_entry {
  	unsigned long cookie;
  };
  
@@ -311,7 +311,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
  	u16 foe_check_time[MTK_PPE_ENTRIES];
  	struct hlist_head *foe_flow;
  
-@@ -303,7 +322,7 @@ struct mtk_ppe {
+@@ -302,7 +321,7 @@ struct mtk_ppe {
  };
  
  struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base,
@@ -320,7 +320,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
  void mtk_ppe_start(struct mtk_ppe *ppe);
  int mtk_ppe_stop(struct mtk_ppe *ppe);
  int mtk_ppe_prepare_reset(struct mtk_ppe *ppe);
-@@ -355,5 +374,7 @@ int mtk_foe_entry_commit(struct mtk_ppe
+@@ -354,5 +373,7 @@ int mtk_foe_entry_commit(struct mtk_ppe
  void mtk_foe_entry_clear(struct mtk_ppe *ppe, struct mtk_flow_entry *entry);
  int mtk_foe_entry_idle_time(struct mtk_ppe *ppe, struct mtk_flow_entry *entry);
  int mtk_ppe_debugfs_init(struct mtk_ppe *ppe, int index);
diff --git a/target/linux/generic/pending-5.15/732-04-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch b/target/linux/generic/pending-5.15/732-04-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch
index 8a801f77e8..f0b7ecd592 100644
--- a/target/linux/generic/pending-5.15/732-04-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch
+++ b/target/linux/generic/pending-5.15/732-04-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch
@@ -628,7 +628,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  /* PDMA on MT7628 */
  #define TX_DMA_DONE		BIT(31)
-@@ -952,6 +971,7 @@ struct mtk_reg_map {
+@@ -957,6 +976,7 @@ struct mtk_reg_map {
  	} pdma;
  	struct {
  		u32	qtx_cfg;	/* tx queue configuration */
@@ -636,7 +636,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		u32	rx_ptr;		/* rx base pointer */
  		u32	rx_cnt_cfg;	/* rx max count configuration */
  		u32	qcrx_ptr;	/* rx cpu pointer */
-@@ -969,6 +989,7 @@ struct mtk_reg_map {
+@@ -974,6 +994,7 @@ struct mtk_reg_map {
  		u32	fq_tail;	/* fq tail pointer */
  		u32	fq_count;	/* fq free page count */
  		u32	fq_blen;	/* fq free page buffer length */
@@ -644,7 +644,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	} qdma;
  	u32	gdm1_cnt;
  	u32	gdma_to_ppe0;
-@@ -1173,6 +1194,7 @@ struct mtk_mac {
+@@ -1180,6 +1201,7 @@ struct mtk_mac {
  	__be32				hwlro_ip[MTK_MAX_LRO_IP_CNT];
  	int				hwlro_ip_cnt;
  	unsigned int			syscfg0;
diff --git a/target/linux/generic/pending-5.15/732-06-net-ethernet-mediatek-ppe-assign-per-port-queues-for.patch b/target/linux/generic/pending-5.15/732-06-net-ethernet-mediatek-ppe-assign-per-port-queues-for.patch
index 8a7cb9f91e..05161c3479 100644
--- a/target/linux/generic/pending-5.15/732-06-net-ethernet-mediatek-ppe-assign-per-port-queues-for.patch
+++ b/target/linux/generic/pending-5.15/732-06-net-ethernet-mediatek-ppe-assign-per-port-queues-for.patch
@@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #define MTK_FOE_IB2_DEST_PORT_V2	GENMASK(12, 9)
  #define MTK_FOE_IB2_MULTICAST_V2	BIT(13)
  #define MTK_FOE_IB2_WDMA_WINFO_V2	BIT(19)
-@@ -370,6 +372,8 @@ int mtk_foe_entry_set_pppoe(struct mtk_e
+@@ -369,6 +371,8 @@ int mtk_foe_entry_set_pppoe(struct mtk_e
  			    int sid);
  int mtk_foe_entry_set_wdma(struct mtk_eth *eth, struct mtk_foe_entry *entry,
  			   int wdma_idx, int txq, int bss, int wcid);
diff --git a/target/linux/generic/pending-5.15/732-07-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch b/target/linux/generic/pending-5.15/732-07-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch
index d7e7492aa2..31a8ca3ea8 100644
--- a/target/linux/generic/pending-5.15/732-07-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch
+++ b/target/linux/generic/pending-5.15/732-07-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -916,7 +916,13 @@ enum mkt_eth_capabilities {
+@@ -921,7 +921,13 @@ enum mkt_eth_capabilities {
  #define MTK_MUX_GMAC12_TO_GEPHY_SGMII   \
  	(MTK_ETH_MUX_GMAC12_TO_GEPHY_SGMII | MTK_MUX)
  
diff --git a/target/linux/generic/pending-5.15/732-09-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch b/target/linux/generic/pending-5.15/732-09-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch
index a130358101..12ff8ab0b1 100644
--- a/target/linux/generic/pending-5.15/732-09-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch
+++ b/target/linux/generic/pending-5.15/732-09-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch
@@ -181,7 +181,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  /* CDMP Ingress Control Register */
  #define MTK_CDMP_IG_CTRL	0x400
  #define MTK_CDMP_STAG_EN	BIT(0)
-@@ -1166,6 +1172,8 @@ struct mtk_eth {
+@@ -1173,6 +1179,8 @@ struct mtk_eth {
  
  	int				ip_align;
  
diff --git a/target/linux/generic/pending-5.15/733-01-net-ethernet-mtk_eth_soc-reset-PCS-state.patch b/target/linux/generic/pending-5.15/733-01-net-ethernet-mtk_eth_soc-reset-PCS-state.patch
new file mode 100644
index 0000000000..2209f94c72
--- /dev/null
+++ b/target/linux/generic/pending-5.15/733-01-net-ethernet-mtk_eth_soc-reset-PCS-state.patch
@@ -0,0 +1,44 @@
+From b66105968b8c37c26a75b9da9281cbc1c8f73594 Mon Sep 17 00:00:00 2001
+From: Daniel Golle <daniel at makrotopia.org>
+Date: Sun, 22 Jan 2023 23:58:36 +0000
+Subject: [PATCH] net: ethernet: mtk_eth_soc: reset PCS state
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Reset PCS state when changing interface mode.
+
+Reviewed-by: Russell King (Oracle) <rmk+kernel at armlinux.org.uk>
+Tested-by: Bj?rn Mork <bjorn at mork.no>
+Signed-off-by: Daniel Golle <daniel at makrotopia.org>
+---
+ drivers/net/ethernet/mediatek/mtk_eth_soc.h | 4 ++++
+ drivers/net/ethernet/mediatek/mtk_sgmii.c   | 4 ++++
+ 2 files changed, 8 insertions(+)
+
+--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+@@ -504,6 +504,10 @@
+ #define SGMII_SEND_AN_ERROR_EN		BIT(11)
+ #define SGMII_IF_MODE_MASK		GENMASK(5, 1)
+ 
++/* Register to reset SGMII design */
++#define SGMII_RESERVED_0	0x34
++#define SGMII_SW_RESET		BIT(0)
++
+ /* Register to set SGMII speed, ANA RG_ Control Signals III*/
+ #define SGMSYS_ANA_RG_CS3	0x2028
+ #define RG_PHY_SPEED_MASK	(BIT(2) | BIT(3))
+--- a/drivers/net/ethernet/mediatek/mtk_sgmii.c
++++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c
+@@ -86,6 +86,10 @@ static int mtk_pcs_config(struct phylink
+ 		regmap_update_bits(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL,
+ 				   SGMII_PHYA_PWD, SGMII_PHYA_PWD);
+ 
++		/* Reset SGMII PCS state */
++		regmap_update_bits(mpcs->regmap, SGMII_RESERVED_0,
++				   SGMII_SW_RESET, SGMII_SW_RESET);
++
+ 		mpcs->interface = interface;
+ 	}
+ 
diff --git a/target/linux/generic/pending-5.15/733-02-net-ethernet-mtk_eth_soc-fix-RX-data-corruption-issu.patch b/target/linux/generic/pending-5.15/733-02-net-ethernet-mtk_eth_soc-fix-RX-data-corruption-issu.patch
new file mode 100644
index 0000000000..0a26805a5e
--- /dev/null
+++ b/target/linux/generic/pending-5.15/733-02-net-ethernet-mtk_eth_soc-fix-RX-data-corruption-issu.patch
@@ -0,0 +1,46 @@
+From e0eb504b1c9f973427a33d7ffef29ddecdb464b9 Mon Sep 17 00:00:00 2001
+From: Daniel Golle <daniel at makrotopia.org>
+Date: Mon, 23 Jan 2023 00:56:02 +0000
+Subject: [PATCH] net: ethernet: mtk_eth_soc: fix RX data corruption issue
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Also set bit 12 when setting up MAC MCR, as MediaTek SDK did the same
+change stating:
+"If without this patch, kernel might receive invalid packets that are
+corrupted by GMAC."[1]
+This fixes issues with <= 1G speed where we could previously observe
+about 30% packet loss while the bad packet counter was increasing.
+Unfortunately the meaning of bit 12 is not documented anywhere in SDK
+code or datasheets.
+
+[1]: https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/d8a2975939a12686c4a95c40db21efdc3f821f63
+Tested-by: Bj?rn Mork <bjorn at mork.no>
+Signed-off-by: Daniel Golle <daniel at makrotopia.org>
+---
+ drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +-
+ drivers/net/ethernet/mediatek/mtk_eth_soc.h | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+@@ -523,7 +523,7 @@ static int mtk_mac_finish(struct phylink
+ 	/* Setup gmac */
+ 	mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
+ 	mcr_new = mcr_cur;
+-	mcr_new |= MAC_MCR_IPG_CFG | MAC_MCR_FORCE_MODE |
++	mcr_new |= MAC_MCR_IPG_CFG | MAC_MCR_BIT_12 | MAC_MCR_FORCE_MODE |
+ 		   MAC_MCR_BACKOFF_EN | MAC_MCR_BACKPR_EN | MAC_MCR_FORCE_LINK;
+ 
+ 	/* Only update control register when needed! */
+--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
++++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
+@@ -367,6 +367,7 @@
+ #define MAC_MCR_FORCE_MODE	BIT(15)
+ #define MAC_MCR_TX_EN		BIT(14)
+ #define MAC_MCR_RX_EN		BIT(13)
++#define MAC_MCR_BIT_12		BIT(12)
+ #define MAC_MCR_BACKOFF_EN	BIT(9)
+ #define MAC_MCR_BACKPR_EN	BIT(8)
+ #define MAC_MCR_FORCE_RX_FC	BIT(5)
diff --git a/target/linux/generic/pending-5.15/734-net-ethernet-mtk_eth_soc-ppe-fix-L2-offloading-with-.patch b/target/linux/generic/pending-5.15/734-net-ethernet-mtk_eth_soc-ppe-fix-L2-offloading-with-.patch
index 7bd4df5fff..94bb6a6a8f 100644
--- a/target/linux/generic/pending-5.15/734-net-ethernet-mtk_eth_soc-ppe-fix-L2-offloading-with-.patch
+++ b/target/linux/generic/pending-5.15/734-net-ethernet-mtk_eth_soc-ppe-fix-L2-offloading-with-.patch
@@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  #include <net/dsa.h>
  #include "mtk_eth_soc.h"
  #include "mtk_ppe.h"
-@@ -756,7 +757,9 @@ void __mtk_ppe_check_skb(struct mtk_ppe
+@@ -755,7 +756,9 @@ void __mtk_ppe_check_skb(struct mtk_ppe
  		    skb->dev->dsa_ptr->tag_ops->proto != DSA_TAG_PROTO_MTK)
  			goto out;
  



From lede-commits at lists.infradead.org  Wed Feb 15 05:28:27 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 15 Feb 2023 08:28:27 -0500
Subject: [openwrt/openwrt]  netifd: refactor packet steering init
In-Reply-To: <167646770769.1315238.3166120399742322079@git-01.infra.openwrt.org>
References: <167646770769.1315238.3166120399742322079@git-01.infra.openwrt.org>
Message-ID: <mailman.16166.1676467716.3064139.lede-commits@lists.infradead.org>

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

commit 601257e388d7abb5ada1c1ac93e2cd2259ea3dd1
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Mon Feb 13 09:23:39 2023 +0100

    netifd: refactor packet steering init
    
    1. Move setup code to independent script file
    2. Add init.d script to allow automatic updates
    3. Support platform specific /usr/libexec/platform/packet-steering.sh
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 package/network/config/netifd/Makefile                 |  2 +-
 .../config/netifd/files/etc/init.d/packet_steering     | 18 ++++++++++++++++++
 .../libexec/network/packet-steering.sh}                |  7 +++++--
 3 files changed, 24 insertions(+), 3 deletions(-)

diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile
index 500daaa152..f40a990b42 100644
--- a/package/network/config/netifd/Makefile
+++ b/package/network/config/netifd/Makefile
@@ -1,7 +1,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=netifd
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git
diff --git a/package/network/config/netifd/files/etc/init.d/packet_steering b/package/network/config/netifd/files/etc/init.d/packet_steering
new file mode 100755
index 0000000000..9d8f791e23
--- /dev/null
+++ b/package/network/config/netifd/files/etc/init.d/packet_steering
@@ -0,0 +1,18 @@
+#!/bin/sh /etc/rc.common
+
+START=25
+USE_PROCD=1
+
+start_service() {
+	reload_service
+}
+
+service_triggers() {
+	procd_add_reload_trigger "network"
+	procd_add_reload_trigger "firewall"
+	procd_add_raw_trigger "interface.*" 1000 /etc/init.d/packet_steering reload
+}
+
+reload_service() {
+	/usr/libexec/network/packet-steering.sh
+}
diff --git a/package/network/config/netifd/files/etc/hotplug.d/net/20-smp-packet-steering b/package/network/config/netifd/files/usr/libexec/network/packet-steering.sh
old mode 100644
new mode 100755
similarity index 92%
rename from package/network/config/netifd/files/etc/hotplug.d/net/20-smp-packet-steering
rename to package/network/config/netifd/files/usr/libexec/network/packet-steering.sh
index 8a86bf75f6..799c080805
--- a/package/network/config/netifd/files/etc/hotplug.d/net/20-smp-packet-steering
+++ b/package/network/config/netifd/files/usr/libexec/network/packet-steering.sh
@@ -1,6 +1,4 @@
 #!/bin/sh
-[ "$ACTION" = add ] || exit
-
 NPROCS="$(grep -c "^processor.*:" /proc/cpuinfo)"
 [ "$NPROCS" -gt 1 ] || exit
 
@@ -40,6 +38,11 @@ packet_steering="$(uci get "network. at globals[0].packet_steering")"
 exec 512>/var/lock/smp_tune.lock
 flock 512 || exit 1
 
+[ -e "/usr/libexec/platform/packet-steering.sh" ] && {
+	/usr/libexec/platform/packet-steering.sh
+	exit 0
+}
+
 for dev in /sys/class/net/*; do
 	[ -d "$dev" ] || continue
 



From lede-commits at lists.infradead.org  Wed Feb 15 05:28:28 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 15 Feb 2023 08:28:28 -0500
Subject: [openwrt/openwrt]  bcm53xx: refactor packet steering init
In-Reply-To: <167646770769.1315238.3166120399742322079@git-01.infra.openwrt.org>
References: <167646770769.1315238.3166120399742322079@git-01.infra.openwrt.org>
Message-ID: <mailman.16167.1676467720.3064139.lede-commits@lists.infradead.org>

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

commit 6e555ac3ad260fe35f17e770277cf02d211a25d5
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Mon Feb 13 10:32:45 2023 +0100

    bcm53xx: refactor packet steering init
    
    Replace a standalone init.d script with a platform implementation as
    supported by netifd. This avoids a race between netifd and target
    specific setups.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 .../bcm53xx/base-files/etc/init.d/fastnetwork      | 44 ----------------------
 .../usr/libexec/platform/packet-steering.sh        | 25 ++++++++++++
 2 files changed, 25 insertions(+), 44 deletions(-)

diff --git a/target/linux/bcm53xx/base-files/etc/init.d/fastnetwork b/target/linux/bcm53xx/base-files/etc/init.d/fastnetwork
deleted file mode 100755
index 1999d13707..0000000000
--- a/target/linux/bcm53xx/base-files/etc/init.d/fastnetwork
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/sh /etc/rc.common
-
-START=25
-USE_PROCD=1
-
-start_service() {
-	reload_service
-}
-
-service_triggers() {
-	procd_add_reload_trigger "network"
-	procd_add_reload_trigger "firewall"
-	procd_add_reload_interface_trigger "lan"
-}
-
-reload_service() {
-	local packet_steering="$(uci -q get network. at globals[0].packet_steering)"
-	local num_cpus="$(grep -c "^processor.*:" /proc/cpuinfo)"
-	local flow_offloading="$(uci -q get firewall. at defaults[0].flow_offloading)"
-	local flow_offloading_hw="$(uci -q get firewall. at defaults[0].flow_offloading_hw)"
-
-	# Any steering on 1 CPU (BCM47081) worsens network performance
-	[ "$num_cpus" != 2 ] && return
-
-	[ "$packet_steering" != 1 ] && {
-		echo 0 > /sys/class/net/br-lan/queues/rx-0/rps_cpus
-		echo 0 > /sys/class/net/eth0/queues/rx-0/rps_cpus
-		return
-	}
-
-	if [ ${flow_offloading_hw:-0} -gt 0 ]; then
-		# HW offloading
-		echo 0 > /sys/class/net/br-lan/queues/rx-0/rps_cpus
-		echo 0 > /sys/class/net/eth0/queues/rx-0/rps_cpus
-	elif [ ${flow_offloading:-0} -gt 0 ]; then
-		# SW offloading
-		# br-lan setup doesn't seem to matter for offloading case
-		echo 2 > /sys/class/net/eth0/queues/rx-0/rps_cpus
-	else
-		# Default
-		echo 2 > /sys/class/net/br-lan/queues/rx-0/rps_cpus
-		echo 0 > /sys/class/net/eth0/queues/rx-0/rps_cpus
-	fi
-}
diff --git a/target/linux/bcm53xx/base-files/usr/libexec/platform/packet-steering.sh b/target/linux/bcm53xx/base-files/usr/libexec/platform/packet-steering.sh
new file mode 100755
index 0000000000..dacd1adc7e
--- /dev/null
+++ b/target/linux/bcm53xx/base-files/usr/libexec/platform/packet-steering.sh
@@ -0,0 +1,25 @@
+#!/bin/sh /etc/rc.common
+
+packet_steering="$(uci -q get network. at globals[0].packet_steering)"
+flow_offloading="$(uci -q get firewall. at defaults[0].flow_offloading)"
+flow_offloading_hw="$(uci -q get firewall. at defaults[0].flow_offloading_hw)"
+
+[ "$packet_steering" != 1 ] && {
+	echo 0 > /sys/class/net/br-lan/queues/rx-0/rps_cpus
+	echo 0 > /sys/class/net/eth0/queues/rx-0/rps_cpus
+	exit 0
+}
+
+if [ ${flow_offloading_hw:-0} -gt 0 ]; then
+	# HW offloading
+	echo 0 > /sys/class/net/br-lan/queues/rx-0/rps_cpus
+	echo 0 > /sys/class/net/eth0/queues/rx-0/rps_cpus
+elif [ ${flow_offloading:-0} -gt 0 ]; then
+	# SW offloading
+	# br-lan setup doesn't seem to matter for offloading case
+	echo 2 > /sys/class/net/eth0/queues/rx-0/rps_cpus
+else
+	# Default
+	echo 2 > /sys/class/net/br-lan/queues/rx-0/rps_cpus
+	echo 0 > /sys/class/net/eth0/queues/rx-0/rps_cpus
+fi



From lede-commits at lists.infradead.org  Wed Feb 15 05:28:29 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 15 Feb 2023 08:28:29 -0500
Subject: [openwrt/openwrt]  iptables: iptables-mod-conntrack-extra: don't
 select kmod-ipt-raw
In-Reply-To: <167646770769.1315238.3166120399742322079@git-01.infra.openwrt.org>
References: <167646770769.1315238.3166120399742322079@git-01.infra.openwrt.org>
Message-ID: <mailman.16168.1676467720.3064139.lede-commits@lists.infradead.org>

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

commit 3c66ac7e22a385eefe84c0e1deef26a12bcf9fc6
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Thu Feb 9 13:29:37 2023 +0100

    iptables: iptables-mod-conntrack-extra: don't select kmod-ipt-raw
    
    Package kmod-ipt-raw enables CONFIG_IP_NF_RAW and packages
    iptable_raw.ko
    
    According to kernel's net/netfilter/Kconfig there are only 3 kernel
    symbols that depend on the IP_NF_RAW:
    1. NETFILTER_XT_TARGET_CT (xt_CT.ko)
    2. NETFILTER_XT_TARGET_NOTRACK (unused symbol?!)
    3. NETFILTER_XT_TARGET_TRACE (xt_TRACE.ko)
    
    Now: iptables-mod-conntrack-extra selects kmod-ipt-conntrack-extra which
    provides: xt_helper.ko nf_conncount.ko xt_connlimit.ko xt_connmark.ko
    xt_recent.ko and xt_connbytes.ko (none of them seems to require
    iptable_raw.ko).
    
    It seems there is no explicit reason for iptables-mod-conntrack-extra to
    require kmod-ipt-raw (iptables_raw.ko).
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 package/network/utils/iptables/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/network/utils/iptables/Makefile b/package/network/utils/iptables/Makefile
index dc57bb55d0..e96cfa0b16 100644
--- a/package/network/utils/iptables/Makefile
+++ b/package/network/utils/iptables/Makefile
@@ -150,7 +150,7 @@ Extra iptables nftables nft binaries.
 endef
 
 define Package/iptables-mod-conntrack-extra
-$(call Package/iptables/Module, +kmod-ipt-conntrack-extra +kmod-ipt-raw)
+$(call Package/iptables/Module, +kmod-ipt-conntrack-extra)
   TITLE:=Extra connection tracking extensions
 endef
 



From lede-commits at lists.infradead.org  Wed Feb 15 10:44:30 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 15 Feb 2023 13:44:30 -0500
Subject: [openwrt/openwrt]  bcm53xx: fix shebang in packet_steering.sh
In-Reply-To: <167648667022.1575313.2660289142473451198@git-01.infra.openwrt.org>
References: <167648667022.1575313.2660289142473451198@git-01.infra.openwrt.org>
Message-ID: <mailman.16247.1676486677.3064139.lede-commits@lists.infradead.org>

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

commit 56a93f98738acd029c88e50de07911101746e565
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Wed Feb 15 19:04:34 2023 +0100

    bcm53xx: fix shebang in packet_steering.sh
    
    Fixes: 6e555ac3ad26 ("bcm53xx: refactor packet steering init")
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 target/linux/bcm53xx/base-files/usr/libexec/platform/packet-steering.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/bcm53xx/base-files/usr/libexec/platform/packet-steering.sh b/target/linux/bcm53xx/base-files/usr/libexec/platform/packet-steering.sh
index dacd1adc7e..939a356d23 100755
--- a/target/linux/bcm53xx/base-files/usr/libexec/platform/packet-steering.sh
+++ b/target/linux/bcm53xx/base-files/usr/libexec/platform/packet-steering.sh
@@ -1,4 +1,4 @@
-#!/bin/sh /etc/rc.common
+#!/bin/sh
 
 packet_steering="$(uci -q get network. at globals[0].packet_steering)"
 flow_offloading="$(uci -q get firewall. at defaults[0].flow_offloading)"



From lede-commits at lists.infradead.org  Wed Feb 15 10:44:31 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 15 Feb 2023 13:44:31 -0500
Subject: [openwrt/openwrt]  bcm4908: refactor packet steering init
In-Reply-To: <167648667022.1575313.2660289142473451198@git-01.infra.openwrt.org>
References: <167648667022.1575313.2660289142473451198@git-01.infra.openwrt.org>
Message-ID: <mailman.16248.1676486677.3064139.lede-commits@lists.infradead.org>

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

commit f06bd5bdb8e131a566d0f0068835296112f69915
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Wed Feb 15 19:40:38 2023 +0100

    bcm4908: refactor packet steering init
    
    Replace a standalone init.d script with a platform implementation as
    supported by netifd. This avoids a race between netifd and target
    specific setups.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 .../bcm4908/base-files/etc/init.d/fastnetwork      | 46 ----------------------
 .../usr/libexec/platform/packet-steering.sh        | 29 ++++++++++++++
 2 files changed, 29 insertions(+), 46 deletions(-)

diff --git a/target/linux/bcm4908/base-files/etc/init.d/fastnetwork b/target/linux/bcm4908/base-files/etc/init.d/fastnetwork
deleted file mode 100755
index 88f6075990..0000000000
--- a/target/linux/bcm4908/base-files/etc/init.d/fastnetwork
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/sh /etc/rc.common
-
-START=25
-USE_PROCD=1
-
-start_service() {
-	reload_service
-}
-
-service_triggers() {
-	procd_add_reload_trigger "network"
-	procd_add_reload_trigger "firewall"
-	procd_add_reload_interface_trigger "lan"
-}
-
-reload_service() {
-	local packet_steering="$(uci -q get network. at globals[0].packet_steering)"
-	local num_cpus="$(grep -c "^processor.*:" /proc/cpuinfo)"
-	local flow_offloading="$(uci -q get firewall. at defaults[0].flow_offloading)"
-	local flow_offloading_hw="$(uci -q get firewall. at defaults[0].flow_offloading_hw)"
-	local rps_eth0=0
-	local rps_br_lan=0
-
-	[ "$num_cpus" -le 1 ] && return
-
-	[ "$packet_steering" = 1 ] && {
-		if [ ${flow_offloading_hw:-0} -gt 0 ]; then
-			# HW offloading
-			# Not implemented
-			:
-		elif [ ${flow_offloading:-0} -gt 0 ]; then
-			# SW offloading
-			# BCM4908 always reaches ~940 Mb/s
-			:
-		else
-			# Default
-			case "$num_cpus" in
-				2) rps_eth0=2; rps_br_lan=2;;
-				4) rps_eth0=e; rps_br_lan=e;;
-			esac
-		fi
-	}
-
-	echo $rps_eth0 > /sys/class/net/eth0/queues/rx-0/rps_cpus
-	echo $rps_br_lan > /sys/class/net/br-lan/queues/rx-0/rps_cpus
-}
diff --git a/target/linux/bcm4908/base-files/usr/libexec/platform/packet-steering.sh b/target/linux/bcm4908/base-files/usr/libexec/platform/packet-steering.sh
new file mode 100755
index 0000000000..825bca311f
--- /dev/null
+++ b/target/linux/bcm4908/base-files/usr/libexec/platform/packet-steering.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+packet_steering="$(uci -q get network. at globals[0].packet_steering)"
+num_cpus="$(grep -c "^processor.*:" /proc/cpuinfo)"
+flow_offloading="$(uci -q get firewall. at defaults[0].flow_offloading)"
+flow_offloading_hw="$(uci -q get firewall. at defaults[0].flow_offloading_hw)"
+rps_eth0=0
+rps_br_lan=0
+
+[ "$packet_steering" = 1 ] && {
+	if [ ${flow_offloading_hw:-0} -gt 0 ]; then
+		# HW offloading
+		# Not implemented
+		:
+	elif [ ${flow_offloading:-0} -gt 0 ]; then
+		# SW offloading
+		# BCM4908 always reaches ~940 Mb/s
+		:
+	else
+		# Default
+		case "$num_cpus" in
+			2) rps_eth0=2; rps_br_lan=2;;
+			4) rps_eth0=e; rps_br_lan=e;;
+		esac
+	fi
+}
+
+echo $rps_eth0 > /sys/class/net/eth0/queues/rx-0/rps_cpus
+echo $rps_br_lan > /sys/class/net/br-lan/queues/rx-0/rps_cpus



From lede-commits at lists.infradead.org  Wed Feb 15 14:43:08 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 15 Feb 2023 17:43:08 -0500
Subject: [openwrt/openwrt]  ipq807x: move AQR driver from built-in to kmod
In-Reply-To: <167650098719.1753762.4914201056708992239@git-01.infra.openwrt.org>
References: <167650098719.1753762.4914201056708992239@git-01.infra.openwrt.org>
Message-ID: <mailman.16312.1676500993.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/8c3bcc1989ac5fb596da86bfd82af6f8aafca1ab

commit 8c3bcc1989ac5fb596da86bfd82af6f8aafca1ab
Author: Robert Marko <robimarko at gmail.com>
AuthorDate: Wed Feb 15 17:05:30 2023 +0100

    ipq807x: move AQR driver from built-in to kmod
    
    ipq807x does not compile-in hwmon core, and this is leading to the hwmon
    code in AQR driver not being compiled due to IS_REACHABLE(CONFIG_HWMON)
    evaluating to false as hwmon is being built as a module.
    
    So, lets not compile-in Aquantia PHY driver so it can be included as kmod
    instead to have functioning hwmon.
    
    This allows using the thermal sensors in AQR-s as thermal zones for
    cooling devices like fans.
    
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 target/linux/ipq807x/Makefile    | 2 +-
 target/linux/ipq807x/config-5.15 | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/target/linux/ipq807x/Makefile b/target/linux/ipq807x/Makefile
index f753cb3f50..fdabf575d3 100644
--- a/target/linux/ipq807x/Makefile
+++ b/target/linux/ipq807x/Makefile
@@ -14,7 +14,7 @@ include $(INCLUDE_DIR)/target.mk
 DEFAULT_PACKAGES += \
 	kmod-usb3 kmod-usb-dwc3 kmod-usb-dwc3-qcom \
 	kmod-leds-gpio kmod-gpio-button-hotplug \
-	kmod-qca-nss-dp \
+	kmod-phy-aquantia kmod-qca-nss-dp \
 	ath11k-firmware-ipq8074 kmod-ath11k-ahb \
 	wpad-basic-mbedtls uboot-envtools
 
diff --git a/target/linux/ipq807x/config-5.15 b/target/linux/ipq807x/config-5.15
index 923cd935f3..6ab29ebbe6 100644
--- a/target/linux/ipq807x/config-5.15
+++ b/target/linux/ipq807x/config-5.15
@@ -1,7 +1,6 @@
 CONFIG_64BIT=y
 # CONFIG_APQ_GCC_8084 is not set
 # CONFIG_APQ_MMCC_8084 is not set
-CONFIG_AQUANTIA_PHY=y
 CONFIG_ARCH_DMA_ADDR_T_64BIT=y
 CONFIG_ARCH_HIBERNATION_POSSIBLE=y
 CONFIG_ARCH_KEEP_MEMBLOCK=y



From lede-commits at lists.infradead.org  Wed Feb 15 14:43:07 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 15 Feb 2023 17:43:07 -0500
Subject: [openwrt/openwrt]  kernel: modules: package Aquantia PHY driver
In-Reply-To: <167650098719.1753762.4914201056708992239@git-01.infra.openwrt.org>
References: <167650098719.1753762.4914201056708992239@git-01.infra.openwrt.org>
Message-ID: <mailman.16313.1676500993.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/061e863baef89776ede9478384458c434ccbf434

commit 061e863baef89776ede9478384458c434ccbf434
Author: Robert Marko <robimarko at gmail.com>
AuthorDate: Wed Feb 15 16:58:41 2023 +0100

    kernel: modules: package Aquantia PHY driver
    
    Package the Aquantia AQR PHY driver as kmod.
    
    This enables using the Aquantia driver with hwmon support on targets where
    hwmon is not compiled-in.
    
    Currently, in case when AQR driver is compiled-in but hwmon core is not
    hwmon code in AQR driver will not get compiled because of macro
    IS_REACHABLE(CONFIG_HWMON) evaluating to false.
    
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 package/kernel/linux/modules/netdevices.mk | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/package/kernel/linux/modules/netdevices.mk b/package/kernel/linux/modules/netdevices.mk
index 518d83f9a2..248aaf06f7 100644
--- a/package/kernel/linux/modules/netdevices.mk
+++ b/package/kernel/linux/modules/netdevices.mk
@@ -340,6 +340,22 @@ endef
 $(eval $(call KernelPackage,phy-smsc))
 
 
+define KernelPackage/phy-aquantia
+  SUBMENU:=$(NETWORK_DEVICES_MENU)
+  TITLE:=Aquantia Ethernet PHYs
+  DEPENDS:=+kmod-libphy +kmod-hwmon-core
+  KCONFIG:=CONFIG_AQUANTIA_PHY
+  FILES:=$(LINUX_DIR)/drivers/net/phy/aquantia.ko
+  AUTOLOAD:=$(call AutoLoad,18,aquantia,1)
+endef
+
+define KernelPackage/phy-aquantia/description
+  Kernel modules for Aquantia Ethernet PHYs
+endef
+
+$(eval $(call KernelPackage,phy-aquantia))
+
+
 define KernelPackage/swconfig
   SUBMENU:=$(NETWORK_DEVICES_MENU)
   TITLE:=switch configuration API



From lede-commits at lists.infradead.org  Fri Feb 17 06:32:30 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 17 Feb 2023 09:32:30 -0500
Subject: [openwrt/openwrt]  build: add option to use preinit IP as LAN IP
In-Reply-To: <167664435035.3453004.17429603076209130257@git-01.infra.openwrt.org>
References: <167664435035.3453004.17429603076209130257@git-01.infra.openwrt.org>
Message-ID: <mailman.16922.1676644363.3064139.lede-commits@lists.infradead.org>

stintel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/baf76634f38d7415c3d8a5034f40b75e3612b967

commit baf76634f38d7415c3d8a5034f40b75e3612b967
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Wed Dec 7 19:04:12 2022 +0200

    build: add option to use preinit IP as LAN IP
    
    We currently have build options to customize the IP address used in the
    preinit phase of the boot process, but not to set the default LAN IP.
    
    Introduce a boolean build option that, when enabled, results in the IP
    address configured for the preinit phase, to be also used as the default
    LAN IP address.
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 package/base-files/Makefile        | 13 +++++++++++++
 package/base-files/image-config.in |  7 +++++++
 2 files changed, 20 insertions(+)

diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 914f0598ff..8732f82fb9 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -89,6 +89,19 @@ define ImageConfigOptions
 	echo 'pi_preinit_net_messages="$(CONFIG_TARGET_PREINIT_SHOW_NETMSG)"' >>$(1)/lib/preinit/00_preinit.conf
 	echo 'pi_preinit_no_failsafe_netmsg="$(CONFIG_TARGET_PREINIT_SUPPRESS_FAILSAFE_NETMSG)"' >>$(1)/lib/preinit/00_preinit.conf
 	echo 'pi_preinit_no_failsafe="$(CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE)"' >>$(1)/lib/preinit/00_preinit.conf
+ifeq ($(CONFIG_TARGET_DEFAULT_LAN_IP_FROM_PREINIT),y)
+	mkdir -p $(1)/etc/board.d
+	echo '. /lib/functions/uci-defaults.sh' >$(1)/etc/board.d/99-lan-ip
+	echo 'logger -t 99-lan-ip "setting custom default LAN IP"' >>$(1)/etc/board.d/99-lan-ip
+	echo 'board_config_update' >>$(1)/etc/board.d/99-lan-ip
+	echo 'json_select network' >>$(1)/etc/board.d/99-lan-ip
+	echo 'json_select lan' >>$(1)/etc/board.d/99-lan-ip
+	echo 'json_add_string ipaddr $(if $(CONFIG_TARGET_PREINIT_IP),$(CONFIG_TARGET_PREINIT_IP),"192.168.1.1")' >>$(1)/etc/board.d/99-lan-ip
+	echo 'json_add_string netmask $(if $(CONFIG_TARGET_PREINIT_NETMASK),$(CONFIG_TARGET_PREINIT_NETMASK),"255.255.255.0")' >>$(1)/etc/board.d/99-lan-ip
+	echo 'json_select ..' >>$(1)/etc/board.d/99-lan-ip
+	echo 'json_select ..' >>$(1)/etc/board.d/99-lan-ip
+	echo 'board_config_flush' >>$(1)/etc/board.d/99-lan-ip
+endif
 endef
 
 define Build/Prepare
diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in
index ac406bc456..2de2130b84 100644
--- a/package/base-files/image-config.in
+++ b/package/base-files/image-config.in
@@ -5,6 +5,13 @@
 # See /LICENSE for more information.
 #
 
+config TARGET_DEFAULT_LAN_IP_FROM_PREINIT
+	bool "Use preinit IP configuration as default LAN IP" if IMAGEOPT
+	default n
+	help
+		Enabling this will set the default LAN IP address and netmask
+		to the preinit values set in the image config.
+
 menuconfig PREINITOPT
 	bool "Preinit configuration options" if IMAGEOPT
 	default n



From lede-commits at lists.infradead.org  Fri Feb 17 06:32:33 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 17 Feb 2023 09:32:33 -0500
Subject: [openwrt/openwrt]  ramips: Switch default kernel to 5.15
In-Reply-To: <167664435035.3453004.17429603076209130257@git-01.infra.openwrt.org>
References: <167664435035.3453004.17429603076209130257@git-01.infra.openwrt.org>
Message-ID: <mailman.16923.1676644363.3064139.lede-commits@lists.infradead.org>

stintel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/77d061167cf8a7edb3ea7cbc9926f25c8ac8fe1e

commit 77d061167cf8a7edb3ea7cbc9926f25c8ac8fe1e
Author: Rodrigo B. de Sousa Martins <rodrigo.sousa.577 at gmail.com>
AuthorDate: Tue Nov 15 16:05:16 2022 -0300

    ramips: Switch default kernel to 5.15
    
    I tested kernel 5.15 on my device for several times without any problems.
    In my tests, 5.15 kernel has performance improvements such MGLRU.
    Finally, initial kernel 6.1 support is imminent. All ramips subtargets have
    5.15 as testing kernel. So, it's time to change.
    
    Tested on my Archer C6 v3.2 (mt7621)
    
    Signed-off-by: Rodrigo B. de Sousa Martins <rodrigo.sousa.577 at gmail.com>
    [reformat commit subject and message]
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 target/linux/ramips/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/target/linux/ramips/Makefile b/target/linux/ramips/Makefile
index 7d34dfe676..77b82d5334 100644
--- a/target/linux/ramips/Makefile
+++ b/target/linux/ramips/Makefile
@@ -10,8 +10,7 @@ BOARDNAME:=MediaTek Ralink MIPS
 SUBTARGETS:=mt7620 mt7621 mt76x8 rt288x rt305x rt3883
 FEATURES:=squashfs gpio
 
-KERNEL_PATCHVER:=5.10
-KERNEL_TESTING_PATCHVER:=5.15
+KERNEL_PATCHVER:=5.15
 
 define Target/Description
 	Build firmware images for Ralink RT288x/RT3xxx based boards.



From lede-commits at lists.infradead.org  Fri Feb 17 06:32:32 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 17 Feb 2023 09:32:32 -0500
Subject: [openwrt/openwrt]  ramips: fix wrong pcie port number for Arcadyan
 devices
In-Reply-To: <167664435035.3453004.17429603076209130257@git-01.infra.openwrt.org>
References: <167664435035.3453004.17429603076209130257@git-01.infra.openwrt.org>
Message-ID: <mailman.16924.1676644366.3064139.lede-commits@lists.infradead.org>

stintel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/51e5f220968aefe55f153df1f34808f57f00f5d7

commit 51e5f220968aefe55f153df1f34808f57f00f5d7
Author: Mikhail Zhilkin <csharper2005 at gmail.com>
AuthorDate: Sat Nov 19 11:11:26 2022 +0000

    ramips: fix wrong pcie port number for Arcadyan devices
    
    Wrong pcie port number for WLAN causes missing 5g WLAN interface with 5.15
    kernel. This changes port from pcie0 to pcie1 in dtsi.
    
    [1.166330] mt7621-pci 1e140000.pcie: pcie0 no card, disable it (RST & CLK)
    [1.180073] mt7621-pci 1e140000.pcie: pcie2 no card, disable it (RST & CLK)
    [1.193889] mt7621-pci 1e140000.pcie: PCIE1 enabled
    
    Signed-off-by: Mikhail Zhilkin <csharper2005 at gmail.com>
---
 target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi b/target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi
index 8c4be8440d..b924d71190 100644
--- a/target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi
+++ b/target/linux/ramips/dts/mt7621_arcadyan_wg4xx223.dtsi
@@ -158,7 +158,7 @@
 	status = "okay";
 };
 
-&pcie0 {
+&pcie1 {
 	wifi at 0,0 {
 		compatible = "mediatek,mt76";
 		reg = <0x0000 0 0 0 0>;



From lede-commits at lists.infradead.org  Fri Feb 17 06:32:31 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 17 Feb 2023 09:32:31 -0500
Subject: [openwrt/openwrt]  odhcpd: bump to git HEAD
In-Reply-To: <167664435035.3453004.17429603076209130257@git-01.infra.openwrt.org>
References: <167664435035.3453004.17429603076209130257@git-01.infra.openwrt.org>
Message-ID: <mailman.16925.1676644366.3064139.lede-commits@lists.infradead.org>

stintel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/65c9b5ffb02ba233e0857c1c035512d88ea3d3d2

commit 65c9b5ffb02ba233e0857c1c035512d88ea3d3d2
Author: Stijn Tintel <stijn at linux-ipv6.be>
AuthorDate: Fri Feb 17 16:30:03 2023 +0200

    odhcpd: bump to git HEAD
    
      dfab0fa dhcpv4: detect noarp interfaces
      5a17751 router: improve RA logging
      edc5e17 router: always check ra_default
    
    Signed-off-by: Stijn Tintel <stijn at linux-ipv6.be>
---
 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 8f4799a373..37280effbe 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:=2022-10-31
-PKG_SOURCE_VERSION:=a92c0a73d018cd6453dcf253d9617f97311becab
-PKG_MIRROR_HASH:=0752d500b4aa65290c46be89ac5c30a0d536f6695c04ee79201cbada0880ed9c
+PKG_SOURCE_DATE:=2023-02-17
+PKG_SOURCE_VERSION:=edc5e1738682e764e64bcbffde1e0a1cc9feac21
+PKG_MIRROR_HASH:=4d8f630770bcf4594c8fc0a2ee34bc40ce8618cc46e76ae5c3629da2fea9e90b
 
 PKG_MAINTAINER:=Hans Dedecker <dedeckeh at gmail.com>
 PKG_LICENSE:=GPL-2.0



From lede-commits at lists.infradead.org  Fri Feb 17 09:12:52 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 17 Feb 2023 12:12:52 -0500
Subject: [openwrt/openwrt]  Revert "ipq806x: disable ea8500 image by default"
In-Reply-To: <167665397066.3591465.12211492835729962351@git-01.infra.openwrt.org>
References: <167665397066.3591465.12211492835729962351@git-01.infra.openwrt.org>
Message-ID: <mailman.16994.1676653986.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/e12ff74ba1af8947a1a656177456685bc1622f1b

commit e12ff74ba1af8947a1a656177456685bc1622f1b
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Fri Feb 17 04:16:40 2023 +0100

    Revert "ipq806x: disable ea8500 image by default"
    
    This reverts commit 5384c9337f2323727081e32369a86b62e72c47d8.
    
    Device is now fixed and works correctly with kernel 5.15.
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 target/linux/ipq806x/image/generic.mk | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/linux/ipq806x/image/generic.mk b/target/linux/ipq806x/image/generic.mk
index 936febc762..44e0df1b3f 100644
--- a/target/linux/ipq806x/image/generic.mk
+++ b/target/linux/ipq806x/image/generic.mk
@@ -185,7 +185,6 @@ define Device/linksys_ea8500
 	IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \
 		append-ubi
 	DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
-	DEFAULT := n
 endef
 TARGET_DEVICES += linksys_ea8500
 



From lede-commits at lists.infradead.org  Fri Feb 17 09:12:53 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 17 Feb 2023 12:12:53 -0500
Subject: [openwrt/openwrt]  Revert "ipq806x: disable ea8500 image by default"
In-Reply-To: <167665397066.3591465.12211492835729962351@git-01.infra.openwrt.org>
References: <167665397066.3591465.12211492835729962351@git-01.infra.openwrt.org>
Message-ID: <mailman.16995.1676653986.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/86ecf7bd39bf3003ac8b681e7ddf949baa52d8fd

commit 86ecf7bd39bf3003ac8b681e7ddf949baa52d8fd
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Fri Feb 17 04:17:13 2023 +0100

    Revert "ipq806x: disable ea8500 image by default"
    
    This reverts commit c4a9a67de8ec85a12a004a34a740bd89ca8895e9.
    
    Device is now fixed and works correctly with kernel 5.15.
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 target/linux/ipq806x/image/generic.mk | 1 -
 1 file changed, 1 deletion(-)

diff --git a/target/linux/ipq806x/image/generic.mk b/target/linux/ipq806x/image/generic.mk
index 44e0df1b3f..91739bc858 100644
--- a/target/linux/ipq806x/image/generic.mk
+++ b/target/linux/ipq806x/image/generic.mk
@@ -163,7 +163,6 @@ define Device/linksys_ea7500-v1
 	IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \
 		append-ubi | pad-to $$$$(PAGESIZE)
 	DEVICE_PACKAGES := ath10k-firmware-qca99x0-ct
-	DEFAULT := n
 endef
 TARGET_DEVICES += linksys_ea7500-v1
 



From lede-commits at lists.infradead.org  Fri Feb 17 09:12:50 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 17 Feb 2023 12:12:50 -0500
Subject: [openwrt/openwrt]  ipq806x: fix Linksys EAX500 family devices dead
 Ethernet switch
In-Reply-To: <167665397066.3591465.12211492835729962351@git-01.infra.openwrt.org>
References: <167665397066.3591465.12211492835729962351@git-01.infra.openwrt.org>
Message-ID: <mailman.16996.1676653987.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/9a24040d20356482b4a481bbd62b287a9eb338f2

commit 9a24040d20356482b4a481bbd62b287a9eb338f2
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Fri Feb 17 03:43:29 2023 +0100

    ipq806x: fix Linksys EAX500 family devices dead Ethernet switch
    
    With 5.15 kernel version Linksys EAX500 family devices suffered from a
    big regression where the Ethernet switch became silent and started to
    malfunction.
    
    It was discovered later that the cause was not really the kernel upgrade
    itself but a hackish implementation of the hw implementation of these
    special routers.
    
    In the original Linksys source code, GPIO 63 was handled in a special way
    and was reset on reboot.
    
    Normally GPIO 63 is used for pcie2 reset but in every device we support,
    pcie2 is actually never used as nothing is attached to it.
    
    Linksys rerouted GPIO 63 to the switch reset pin and deviates from
    common hw implementation.
    
    Till now it was used an hack to handle this case... It was set pcie3 as
    working (while actually nothing was connected), set it to output low
    (for assert-deassert from the pcie init code) and be done with it.
    The result was that the GPIO was reset for enough time in early boot and
    everything worked correctly.
    This hack implementation was born to fail from the very start and in
    kernel 5.15 finally problem arised.
    
    In 5.15 pcie code changed and now the GPIO reset pin is not asserted as
    probe won't fail if nothing is connected to the line (the old behaviour)
    This result in the switch hold the reset pin and the Ethernet switch
    dead.
    
    On top of that with 5.15 code got optimized and simply attaching the
    GPIO reset to the mdio wasn't enough as the switch require at least 10ms
    to be correctly reset.
    
    So implement finally a correct solution where:
    - pcie2 is correctly disabled (nothing attached, unused)
    - drop the wrong output-low for pcie2 reset pin
    - define GPIO 63 as switch reset
    - Add the reset-gpios to the mdio0 node
    - Set the reset-post-delay-us to 12ms to correctly give time the switch
      to reset
    
    Fixes: #10983
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 .../arch/arm/boot/dts/qcom-ipq8064-eax500.dtsi       | 20 ++++++++++++++++----
 .../arch/arm/boot/dts/qcom-ipq8064-eax500.dtsi       | 20 ++++++++++++++++----
 .../patches-5.10/082-ipq8064-dtsi-tweaks.patch       |  8 --------
 3 files changed, 32 insertions(+), 16 deletions(-)

diff --git a/target/linux/ipq806x/files-5.10/arch/arm/boot/dts/qcom-ipq8064-eax500.dtsi b/target/linux/ipq806x/files-5.10/arch/arm/boot/dts/qcom-ipq8064-eax500.dtsi
index e74d2dcdbd..e5282efaab 100644
--- a/target/linux/ipq806x/files-5.10/arch/arm/boot/dts/qcom-ipq8064-eax500.dtsi
+++ b/target/linux/ipq806x/files-5.10/arch/arm/boot/dts/qcom-ipq8064-eax500.dtsi
@@ -12,6 +12,18 @@
 	};
 };
 
+&qcom_pinmux {
+	/* eax500 routers reuse the pcie2 reset pin for switch reset pin */
+	switch_reset: switch_reset_pins {
+		mux {
+			pins = "gpio63";
+			function = "gpio";
+			drive-strength = <12>;
+			bias-pull-up;
+		};
+	};
+};
+
 &usb3_0 {
 	status = "okay";
 };
@@ -30,10 +42,6 @@
 	status = "okay";
 };
 
-&pcie2 {
-	status = "okay";
-};
-
 &nand {
 	status = "okay";
 
@@ -160,6 +168,10 @@
 	pinctrl-0 = <&mdio0_pins>;
 	pinctrl-names = "default";
 
+	/* Switch from documentation require at least 10ms for reset */
+	reset-gpios = <&qcom_pinmux 63 GPIO_ACTIVE_HIGH>;
+	reset-post-delay-us = <12000>;
+
 	phy0: ethernet-phy at 0 {
 		reg = <0>;
 		qca,ar8327-initvals = <
diff --git a/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-eax500.dtsi b/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-eax500.dtsi
index adf5192ac8..910bd86bc5 100644
--- a/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-eax500.dtsi
+++ b/target/linux/ipq806x/files-5.15/arch/arm/boot/dts/qcom-ipq8064-eax500.dtsi
@@ -12,6 +12,18 @@
 	};
 };
 
+&qcom_pinmux {
+	/* eax500 routers reuse the pcie2 reset pin for switch reset pin */
+	switch_reset: switch_reset_pins {
+		mux {
+			pins = "gpio63";
+			function = "gpio";
+			drive-strength = <12>;
+			bias-pull-up;
+		};
+	};
+};
+
 &hs_phy_0 {
 	status = "okay";
 };
@@ -46,10 +58,6 @@
 	status = "okay";
 };
 
-&pcie2 {
-	status = "okay";
-};
-
 &nand {
 	status = "okay";
 
@@ -173,6 +181,10 @@
 	pinctrl-0 = <&mdio0_pins>;
 	pinctrl-names = "default";
 
+	/* Switch from documentation require at least 10ms for reset */
+	reset-gpios = <&qcom_pinmux 63 GPIO_ACTIVE_HIGH>;
+	reset-post-delay-us = <12000>;
+
 	phy0: ethernet-phy at 0 {
 		reg = <0>;
 		qca,ar8327-initvals = <
diff --git a/target/linux/ipq806x/patches-5.10/082-ipq8064-dtsi-tweaks.patch b/target/linux/ipq806x/patches-5.10/082-ipq8064-dtsi-tweaks.patch
index d6a4593749..301963f4f9 100644
--- a/target/linux/ipq806x/patches-5.10/082-ipq8064-dtsi-tweaks.patch
+++ b/target/linux/ipq806x/patches-5.10/082-ipq8064-dtsi-tweaks.patch
@@ -35,14 +35,6 @@
  			#interrupt-cells = <2>;
  			interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
  
-@@ -155,6 +156,7 @@
- 					function = "pcie3_rst";
- 					drive-strength = <12>;
- 					bias-disable;
-+					output-low;
- 				};
- 			};
- 
 @@ -190,6 +192,7 @@
  		intc: interrupt-controller at 2000000 {
  			compatible = "qcom,msm-qgic2";



From lede-commits at lists.infradead.org  Fri Feb 17 09:12:51 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 17 Feb 2023 12:12:51 -0500
Subject: [openwrt/openwrt]  ipq806x: 5.10: refresh patches
In-Reply-To: <167665397066.3591465.12211492835729962351@git-01.infra.openwrt.org>
References: <167665397066.3591465.12211492835729962351@git-01.infra.openwrt.org>
Message-ID: <mailman.16999.1676653987.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/2ddf479cc7b9d7c66dbd6aed493d77bf74ea3944

commit 2ddf479cc7b9d7c66dbd6aed493d77bf74ea3944
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Fri Feb 17 04:25:59 2023 +0100

    ipq806x: 5.10: refresh patches
    
    Refresh patches for kernel 5.10
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 .../patches-5.10/082-ipq8064-dtsi-tweaks.patch     | 26 +++++++++++-----------
 .../patches-5.10/083-ipq8064-dtsi-additions.patch  | 18 +++++++--------
 ...03-ARM-dts-qcom-reduce-pci-IO-size-to-64K.patch |  6 ++---
 ...rm-dts-qcom-add-ahb-reset-to-ipq806x-gmac.patch |  8 +++----
 4 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/target/linux/ipq806x/patches-5.10/082-ipq8064-dtsi-tweaks.patch b/target/linux/ipq806x/patches-5.10/082-ipq8064-dtsi-tweaks.patch
index 301963f4f9..1046af15d4 100644
--- a/target/linux/ipq806x/patches-5.10/082-ipq8064-dtsi-tweaks.patch
+++ b/target/linux/ipq806x/patches-5.10/082-ipq8064-dtsi-tweaks.patch
@@ -35,7 +35,7 @@
  			#interrupt-cells = <2>;
  			interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
  
-@@ -190,6 +192,7 @@
+@@ -190,6 +191,7 @@
  		intc: interrupt-controller at 2000000 {
  			compatible = "qcom,msm-qgic2";
  			interrupt-controller;
@@ -43,7 +43,7 @@
  			#interrupt-cells = <3>;
  			reg = <0x02000000 0x1000>,
  			      <0x02002000 0x1000>;
-@@ -219,21 +222,23 @@
+@@ -219,21 +221,23 @@
  		acc0: clock-controller at 2088000 {
  			compatible = "qcom,kpss-acc-v1";
  			reg = <0x02088000 0x1000>, <0x02008000 0x1000>;
@@ -69,7 +69,7 @@
  			reg = <0x02099000 0x1000>, <0x02009000 0x1000>;
  			regulator;
  		};
-@@ -251,7 +256,7 @@
+@@ -251,7 +255,7 @@
  
  			syscon-tcsr = <&tcsr>;
  
@@ -78,7 +78,7 @@
  				compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
  				reg = <0x12490000 0x1000>,
  				      <0x12480000 0x1000>;
-@@ -261,7 +266,7 @@
+@@ -261,7 +265,7 @@
  				status = "disabled";
  			};
  
@@ -87,7 +87,7 @@
  				compatible = "qcom,i2c-qup-v1.1.1";
  				reg = <0x124a0000 0x1000>;
  				interrupts = <GIC_SPI 196 IRQ_TYPE_LEVEL_HIGH>;
-@@ -326,7 +331,7 @@
+@@ -326,7 +330,7 @@
  
  			syscon-tcsr = <&tcsr>;
  
@@ -96,7 +96,7 @@
  				compatible = "qcom,msm-uartdm-v1.3", "qcom,msm-uartdm";
  				reg = <0x1a240000 0x1000>,
  				      <0x1a200000 0x1000>;
-@@ -397,7 +402,7 @@
+@@ -397,7 +401,7 @@
  			status = "disabled";
  		};
  
@@ -105,7 +105,7 @@
  			compatible = "qcom,ipq806x-ahci", "generic-ahci";
  			reg = <0x29000000 0x180>;
  
-@@ -430,13 +435,35 @@
+@@ -430,13 +434,35 @@
  			reg = <0x00700000 0x1000>;
  			#address-cells = <1>;
  			#size-cells = <1>;
@@ -142,7 +142,7 @@
  		};
  
  		tcsr: syscon at 1a400000 {
-@@ -622,7 +649,7 @@
+@@ -622,7 +648,7 @@
  
  		gmac0: ethernet at 37000000 {
  			device_type = "network";
@@ -151,7 +151,7 @@
  			reg = <0x37000000 0x200000>;
  			interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH>;
  			interrupt-names = "macirq";
-@@ -645,7 +672,7 @@
+@@ -645,7 +671,7 @@
  
  		gmac1: ethernet at 37200000 {
  			device_type = "network";
@@ -160,7 +160,7 @@
  			reg = <0x37200000 0x200000>;
  			interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>;
  			interrupt-names = "macirq";
-@@ -668,7 +695,7 @@
+@@ -668,7 +694,7 @@
  
  		gmac2: ethernet at 37400000 {
  			device_type = "network";
@@ -169,7 +169,7 @@
  			reg = <0x37400000 0x200000>;
  			interrupts = <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>;
  			interrupt-names = "macirq";
-@@ -691,7 +718,7 @@
+@@ -691,7 +717,7 @@
  
  		gmac3: ethernet at 37600000 {
  			device_type = "network";
@@ -178,7 +178,7 @@
  			reg = <0x37600000 0x200000>;
  			interrupts = <GIC_SPI 229 IRQ_TYPE_LEVEL_HIGH>;
  			interrupt-names = "macirq";
-@@ -740,13 +767,13 @@
+@@ -740,13 +766,13 @@
  			qcom,ee = <0>;
  		};
  
@@ -195,7 +195,7 @@
  				status          = "disabled";
  				compatible      = "arm,pl18x", "arm,primecell";
  				arm,primecell-periphid = <0x00051180>;
-@@ -760,13 +787,12 @@
+@@ -760,13 +786,12 @@
  				non-removable;
  				cap-sd-highspeed;
  				cap-mmc-highspeed;
diff --git a/target/linux/ipq806x/patches-5.10/083-ipq8064-dtsi-additions.patch b/target/linux/ipq806x/patches-5.10/083-ipq8064-dtsi-additions.patch
index a1a97ae941..82d91e1242 100644
--- a/target/linux/ipq806x/patches-5.10/083-ipq8064-dtsi-additions.patch
+++ b/target/linux/ipq806x/patches-5.10/083-ipq8064-dtsi-additions.patch
@@ -475,7 +475,7 @@
  		qcom_pinmux: pinmux at 800000 {
  			compatible = "qcom,ipq8064-pinctrl";
  			reg = <0x800000 0x4000>;
-@@ -160,6 +589,15 @@
+@@ -159,6 +588,15 @@
  				};
  			};
  
@@ -491,7 +491,7 @@
  			spi_pins: spi_pins {
  				mux {
  					pins = "gpio18", "gpio19", "gpio21";
-@@ -169,6 +607,53 @@
+@@ -168,6 +606,53 @@
  				};
  			};
  
@@ -545,7 +545,7 @@
  			leds_pins: leds_pins {
  				mux {
  					pins = "gpio7", "gpio8", "gpio9",
-@@ -231,6 +716,17 @@
+@@ -230,6 +715,17 @@
  			clock-output-names = "acpu1_aux";
  		};
  
@@ -563,7 +563,7 @@
  		saw0: regulator at 2089000 {
  			compatible = "qcom,saw2", "qcom,apq8064-saw2-v1.1-cpu", "syscon";
  			reg = <0x02089000 0x1000>, <0x02009000 0x1000>;
-@@ -243,6 +739,52 @@
+@@ -242,6 +738,52 @@
  			regulator;
  		};
  
@@ -616,7 +616,7 @@
  		gsbi2: gsbi at 12480000 {
  			compatible = "qcom,gsbi-v1.0.0";
  			cell-index = <2>;
-@@ -368,6 +910,33 @@
+@@ -367,6 +909,33 @@
  			};
  		};
  
@@ -650,7 +650,7 @@
  		gsbi7: gsbi at 16600000 {
  			status = "disabled";
  			compatible = "qcom,gsbi-v1.0.0";
-@@ -389,6 +958,19 @@
+@@ -388,6 +957,19 @@
  				clock-names = "core", "iface";
  				status = "disabled";
  			};
@@ -670,7 +670,7 @@
  		};
  
  		sata_phy: sata-phy at 1b400000 {
-@@ -478,6 +1060,95 @@
+@@ -477,6 +1059,95 @@
  			#reset-cells = <1>;
  		};
  
@@ -766,7 +766,7 @@
  		pcie0: pci at 1b500000 {
  			compatible = "qcom,pcie-ipq8064";
  			reg = <0x1b500000 0x1000
-@@ -739,6 +1410,59 @@
+@@ -738,6 +1409,59 @@
  			status = "disabled";
  		};
  
@@ -826,7 +826,7 @@
  		vsdcc_fixed: vsdcc-regulator {
  			compatible = "regulator-fixed";
  			regulator-name = "SDCC Power";
-@@ -814,4 +1538,17 @@
+@@ -813,4 +1537,17 @@
  			};
  		};
  	};
diff --git a/target/linux/ipq806x/patches-5.10/103-ARM-dts-qcom-reduce-pci-IO-size-to-64K.patch b/target/linux/ipq806x/patches-5.10/103-ARM-dts-qcom-reduce-pci-IO-size-to-64K.patch
index 75b53234ab..2a6d4007fa 100644
--- a/target/linux/ipq806x/patches-5.10/103-ARM-dts-qcom-reduce-pci-IO-size-to-64K.patch
+++ b/target/linux/ipq806x/patches-5.10/103-ARM-dts-qcom-reduce-pci-IO-size-to-64K.patch
@@ -17,7 +17,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth at gmail.com>
 
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -1163,7 +1163,7 @@
+@@ -1162,7 +1162,7 @@
  			#address-cells = <3>;
  			#size-cells = <2>;
  
@@ -26,7 +26,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth at gmail.com>
  				  0x82000000 0 0x08000000 0x08000000 0 0x07e00000>; /* non-prefetchable memory */
  
  			interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
-@@ -1214,7 +1214,7 @@
+@@ -1213,7 +1213,7 @@
  			#address-cells = <3>;
  			#size-cells = <2>;
  
@@ -35,7 +35,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth at gmail.com>
  				  0x82000000 0 0x2e000000 0x2e000000 0 0x03e00000>; /* non-prefetchable memory */
  
  			interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>;
-@@ -1265,7 +1265,7 @@
+@@ -1264,7 +1264,7 @@
  			#address-cells = <3>;
  			#size-cells = <2>;
  
diff --git a/target/linux/ipq806x/patches-5.10/109-v5.15-arm-dts-qcom-add-ahb-reset-to-ipq806x-gmac.patch b/target/linux/ipq806x/patches-5.10/109-v5.15-arm-dts-qcom-add-ahb-reset-to-ipq806x-gmac.patch
index 4a047ed6eb..d94d898233 100644
--- a/target/linux/ipq806x/patches-5.10/109-v5.15-arm-dts-qcom-add-ahb-reset-to-ipq806x-gmac.patch
+++ b/target/linux/ipq806x/patches-5.10/109-v5.15-arm-dts-qcom-add-ahb-reset-to-ipq806x-gmac.patch
@@ -14,7 +14,7 @@ Signed-off-by: Bjorn Andersson <bjorn.andersson at linaro.org>
 
 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
-@@ -1335,8 +1335,9 @@
+@@ -1334,8 +1334,9 @@
  			clocks = <&gcc GMAC_CORE1_CLK>;
  			clock-names = "stmmaceth";
  
@@ -26,7 +26,7 @@ Signed-off-by: Bjorn Andersson <bjorn.andersson at linaro.org>
  
  			status = "disabled";
  		};
-@@ -1358,8 +1359,9 @@
+@@ -1357,8 +1358,9 @@
  			clocks = <&gcc GMAC_CORE2_CLK>;
  			clock-names = "stmmaceth";
  
@@ -38,7 +38,7 @@ Signed-off-by: Bjorn Andersson <bjorn.andersson at linaro.org>
  
  			status = "disabled";
  		};
-@@ -1381,8 +1383,9 @@
+@@ -1380,8 +1382,9 @@
  			clocks = <&gcc GMAC_CORE3_CLK>;
  			clock-names = "stmmaceth";
  
@@ -50,7 +50,7 @@ Signed-off-by: Bjorn Andersson <bjorn.andersson at linaro.org>
  
  			status = "disabled";
  		};
-@@ -1404,8 +1407,9 @@
+@@ -1403,8 +1406,9 @@
  			clocks = <&gcc GMAC_CORE4_CLK>;
  			clock-names = "stmmaceth";
  



From lede-commits at lists.infradead.org  Fri Feb 17 09:31:47 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 17 Feb 2023 12:31:47 -0500
Subject: [openwrt/openwrt]  kernel: 5.15: refresh patches
In-Reply-To: <167665510775.3609291.14531646600862399307@git-01.infra.openwrt.org>
References: <167665510775.3609291.14531646600862399307@git-01.infra.openwrt.org>
Message-ID: <mailman.17018.1676655114.3064139.lede-commits@lists.infradead.org>

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

commit c0683ec4586d03c9a30efb3c7497fc30db33fc60
Author: Paul Spooren <mail at aparcar.org>
AuthorDate: Fri Feb 17 18:30:00 2023 +0100

    kernel: 5.15: refresh patches
    
    This commit fixes the following commit
    
        f584fb2f7e kernel: import accepted MediaTek Ethernet patches
    
    Unrefreshed patches caused the CI to fail.
    
    Signed-off-by: Paul Spooren <mail at aparcar.org>
---
 .../pending-5.15/724-net-mtk_sgmii-implement-mtk_pcs_ops.patch      | 2 +-
 .../728-net-mtk_sgmii-set-the-speed-according-to-the-phy-int.patch  | 2 +-
 .../731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch  | 2 +-
 ...32-04-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch | 6 +++---
 ...32-07-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch | 2 +-
 ...32-09-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch | 2 +-
 .../733-01-net-ethernet-mtk_eth_soc-reset-PCS-state.patch           | 4 ++--
 ...33-02-net-ethernet-mtk_eth_soc-fix-RX-data-corruption-issu.patch | 4 ++--
 8 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/target/linux/generic/pending-5.15/724-net-mtk_sgmii-implement-mtk_pcs_ops.patch b/target/linux/generic/pending-5.15/724-net-mtk_sgmii-implement-mtk_pcs_ops.patch
index 274c3a5cc2..9a6b228a27 100644
--- a/target/linux/generic/pending-5.15/724-net-mtk_sgmii-implement-mtk_pcs_ops.patch
+++ b/target/linux/generic/pending-5.15/724-net-mtk_sgmii-implement-mtk_pcs_ops.patch
@@ -15,7 +15,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_sgmii.c
 +++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c
-@@ -143,10 +143,28 @@ static void mtk_pcs_link_up(struct phyli
+@@ -139,10 +139,28 @@ static void mtk_pcs_link_up(struct phyli
  	regmap_write(mpcs->regmap, SGMSYS_SGMII_MODE, val);
  }
  
diff --git a/target/linux/generic/pending-5.15/728-net-mtk_sgmii-set-the-speed-according-to-the-phy-int.patch b/target/linux/generic/pending-5.15/728-net-mtk_sgmii-set-the-speed-according-to-the-phy-int.patch
index f58499c7c2..1649a64551 100644
--- a/target/linux/generic/pending-5.15/728-net-mtk_sgmii-set-the-speed-according-to-the-phy-int.patch
+++ b/target/linux/generic/pending-5.15/728-net-mtk_sgmii-set-the-speed-according-to-the-phy-int.patch
@@ -30,7 +30,7 @@ Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
  	regmap_write(mpcs->regmap, mpcs->ana_rgc3, val);
  
  	/* Setup the link timer and QPHY power up inside SGMIISYS */
-@@ -98,7 +100,7 @@ static int mtk_pcs_config(struct phylink
+@@ -94,7 +96,7 @@ static int mtk_pcs_config(struct phylink
  	if (interface != PHY_INTERFACE_MODE_SGMII)
  		err = mtk_pcs_setup_mode_force(mpcs, interface);
  	else if (phylink_autoneg_inband(mode))
diff --git a/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch b/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch
index f31307f8dd..c7b5a989c2 100644
--- a/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch
+++ b/target/linux/generic/pending-5.15/731-net-ethernet-mediatek-ppe-add-support-for-flow-accou.patch
@@ -90,7 +90,7 @@ v2: fix wrong variable name in return value check spotted by Denis Kirjanov
  		.rxd_size = sizeof(struct mtk_rx_dma_v2),
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -1012,6 +1012,7 @@ struct mtk_soc_data {
+@@ -1007,6 +1007,7 @@ struct mtk_soc_data {
  	u8		hash_offset;
  	u16		foe_entry_size;
  	netdev_features_t hw_features;
diff --git a/target/linux/generic/pending-5.15/732-04-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch b/target/linux/generic/pending-5.15/732-04-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch
index f0b7ecd592..cfe03781a2 100644
--- a/target/linux/generic/pending-5.15/732-04-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch
+++ b/target/linux/generic/pending-5.15/732-04-net-ethernet-mtk_eth_soc-implement-multi-queue-suppo.patch
@@ -628,7 +628,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  
  /* PDMA on MT7628 */
  #define TX_DMA_DONE		BIT(31)
-@@ -957,6 +976,7 @@ struct mtk_reg_map {
+@@ -952,6 +971,7 @@ struct mtk_reg_map {
  	} pdma;
  	struct {
  		u32	qtx_cfg;	/* tx queue configuration */
@@ -636,7 +636,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		u32	rx_ptr;		/* rx base pointer */
  		u32	rx_cnt_cfg;	/* rx max count configuration */
  		u32	qcrx_ptr;	/* rx cpu pointer */
-@@ -974,6 +994,7 @@ struct mtk_reg_map {
+@@ -969,6 +989,7 @@ struct mtk_reg_map {
  		u32	fq_tail;	/* fq tail pointer */
  		u32	fq_count;	/* fq free page count */
  		u32	fq_blen;	/* fq free page buffer length */
@@ -644,7 +644,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	} qdma;
  	u32	gdm1_cnt;
  	u32	gdma_to_ppe0;
-@@ -1180,6 +1201,7 @@ struct mtk_mac {
+@@ -1175,6 +1196,7 @@ struct mtk_mac {
  	__be32				hwlro_ip[MTK_MAX_LRO_IP_CNT];
  	int				hwlro_ip_cnt;
  	unsigned int			syscfg0;
diff --git a/target/linux/generic/pending-5.15/732-07-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch b/target/linux/generic/pending-5.15/732-07-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch
index 31a8ca3ea8..d7e7492aa2 100644
--- a/target/linux/generic/pending-5.15/732-07-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch
+++ b/target/linux/generic/pending-5.15/732-07-net-ethernet-mtk_eth_soc-compile-out-netsys-v2-code-.patch
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -921,7 +921,13 @@ enum mkt_eth_capabilities {
+@@ -916,7 +916,13 @@ enum mkt_eth_capabilities {
  #define MTK_MUX_GMAC12_TO_GEPHY_SGMII   \
  	(MTK_ETH_MUX_GMAC12_TO_GEPHY_SGMII | MTK_MUX)
  
diff --git a/target/linux/generic/pending-5.15/732-09-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch b/target/linux/generic/pending-5.15/732-09-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch
index 12ff8ab0b1..d9d6f5c356 100644
--- a/target/linux/generic/pending-5.15/732-09-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch
+++ b/target/linux/generic/pending-5.15/732-09-net-ethernet-mtk_eth_soc-fix-VLAN-rx-hardware-accele.patch
@@ -181,7 +181,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  /* CDMP Ingress Control Register */
  #define MTK_CDMP_IG_CTRL	0x400
  #define MTK_CDMP_STAG_EN	BIT(0)
-@@ -1173,6 +1179,8 @@ struct mtk_eth {
+@@ -1168,6 +1174,8 @@ struct mtk_eth {
  
  	int				ip_align;
  
diff --git a/target/linux/generic/pending-5.15/733-01-net-ethernet-mtk_eth_soc-reset-PCS-state.patch b/target/linux/generic/pending-5.15/733-01-net-ethernet-mtk_eth_soc-reset-PCS-state.patch
index 2209f94c72..67c0974417 100644
--- a/target/linux/generic/pending-5.15/733-01-net-ethernet-mtk_eth_soc-reset-PCS-state.patch
+++ b/target/linux/generic/pending-5.15/733-01-net-ethernet-mtk_eth_soc-reset-PCS-state.patch
@@ -18,7 +18,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -504,6 +504,10 @@
+@@ -529,6 +529,10 @@
  #define SGMII_SEND_AN_ERROR_EN		BIT(11)
  #define SGMII_IF_MODE_MASK		GENMASK(5, 1)
  
@@ -31,7 +31,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  #define RG_PHY_SPEED_MASK	(BIT(2) | BIT(3))
 --- a/drivers/net/ethernet/mediatek/mtk_sgmii.c
 +++ b/drivers/net/ethernet/mediatek/mtk_sgmii.c
-@@ -86,6 +86,10 @@ static int mtk_pcs_config(struct phylink
+@@ -90,6 +90,10 @@ static int mtk_pcs_config(struct phylink
  		regmap_update_bits(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL,
  				   SGMII_PHYA_PWD, SGMII_PHYA_PWD);
  
diff --git a/target/linux/generic/pending-5.15/733-02-net-ethernet-mtk_eth_soc-fix-RX-data-corruption-issu.patch b/target/linux/generic/pending-5.15/733-02-net-ethernet-mtk_eth_soc-fix-RX-data-corruption-issu.patch
index 0a26805a5e..2d95c402dc 100644
--- a/target/linux/generic/pending-5.15/733-02-net-ethernet-mtk_eth_soc-fix-RX-data-corruption-issu.patch
+++ b/target/linux/generic/pending-5.15/733-02-net-ethernet-mtk_eth_soc-fix-RX-data-corruption-issu.patch
@@ -25,7 +25,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
 
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
-@@ -523,7 +523,7 @@ static int mtk_mac_finish(struct phylink
+@@ -528,7 +528,7 @@ static int mtk_mac_finish(struct phylink
  	/* Setup gmac */
  	mcr_cur = mtk_r32(mac->hw, MTK_MAC_MCR(mac->id));
  	mcr_new = mcr_cur;
@@ -36,7 +36,7 @@ Signed-off-by: Daniel Golle <daniel at makrotopia.org>
  	/* Only update control register when needed! */
 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h
 +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h
-@@ -367,6 +367,7 @@
+@@ -392,6 +392,7 @@
  #define MAC_MCR_FORCE_MODE	BIT(15)
  #define MAC_MCR_TX_EN		BIT(14)
  #define MAC_MCR_RX_EN		BIT(13)



From lede-commits at lists.infradead.org  Sat Feb 18 03:59:24 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 06:59:24 -0500
Subject: [openwrt/openwrt]  ramips: backport mt7621 PCIs initialization delay
 patch
In-Reply-To: <167672156448.104803.7234133768448516886@git-01.infra.openwrt.org>
References: <167672156448.104803.7234133768448516886@git-01.infra.openwrt.org>
Message-ID: <mailman.17080.1676721573.3064139.lede-commits@lists.infradead.org>

stintel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/748f7f1b9c0ccb09840e954fbc405a3eb5187634

commit 748f7f1b9c0ccb09840e954fbc405a3eb5187634
Author: Shiji Yang <yangshiji66 at qq.com>
AuthorDate: Thu Feb 9 22:00:59 2023 +0800

    ramips: backport mt7621 PCIs initialization delay patch
    
    The sender domain has a DMARC Reject/Quarantine policy which disallows
    sending mailing list messages using the original "From" header.
    
    To mitigate this problem, the original message has been wrapped
    automatically by the mailing list software.
    Some devices like ZBT WE1326 and ZBT WF3526-P and some Netgear models need
    to delay phy port initialization after calling the mt7621_pcie_init_port()
    driver function to get into reliable boots for both warm and hard resets.
    
    Signed-off-by: Shiji Yang <yangshiji66 at qq.com>
---
 ...PCI-mt7621-Delay-phy-ports-initialization.patch | 52 ++++++++++++++++++++++
 ...PCI-mt7621-Delay-phy-ports-initialization.patch | 52 ++++++++++++++++++++++
 2 files changed, 104 insertions(+)

diff --git a/target/linux/ramips/patches-5.10/108-PCI-mt7621-Delay-phy-ports-initialization.patch b/target/linux/ramips/patches-5.10/108-PCI-mt7621-Delay-phy-ports-initialization.patch
new file mode 100644
index 0000000000..ef03b00444
--- /dev/null
+++ b/target/linux/ramips/patches-5.10/108-PCI-mt7621-Delay-phy-ports-initialization.patch
@@ -0,0 +1,52 @@
+From 0cb2a8f3456ff1cc51d571e287a48e8fddc98ec2 Mon Sep 17 00:00:00 2001
+From: Sergio Paracuellos <sergio.paracuellos at gmail.com>
+Date: Sat, 31 Dec 2022 08:40:41 +0100
+Subject: PCI: mt7621: Delay phy ports initialization
+
+Some devices like ZBT WE1326 and ZBT WF3526-P and some Netgear models need
+to delay phy port initialization after calling the mt7621_pcie_init_port()
+driver function to get into reliable boots for both warm and hard resets.
+
+The delay required to detect the ports seems to be in the range [75-100]
+milliseconds.
+
+If the ports are not detected the controller is not functional.
+
+There is no datasheet or something similar to really understand why this
+extra delay is needed only for these devices and it is not for most of
+the boards that are built on mt7621 SoC.
+
+This issue has been reported by openWRT community and the complete
+discussion is in [0]. The 100 milliseconds delay has been tested in all
+devices to validate it.
+
+Add the extra 100 milliseconds delay to fix the issue.
+
+[0]: https://github.com/openwrt/openwrt/pull/11220
+
+Link: https://lore.kernel.org/r/20221231074041.264738-1-sergio.paracuellos at gmail.com
+Fixes: 2bdd5238e756 ("PCI: mt7621: Add MediaTek MT7621 PCIe host controller driver")
+Signed-off-by: Sergio Paracuellos <sergio.paracuellos at gmail.com>
+Signed-off-by: Lorenzo Pieralisi <lpieralisi at kernel.org>
+---
+ drivers/staging/mt7621-pci/pci-mt7621.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/staging/mt7621-pci/pci-mt7621.c
++++ b/drivers/staging/mt7621-pci/pci-mt7621.c
+@@ -86,6 +86,7 @@
+ #define MEMORY_BASE			0x0
+ #define PERST_MODE_MASK			GENMASK(11, 10)
+ #define PERST_MODE_GPIO			BIT(10)
++#define INIT_PORTS_DELAY_MS		100
+ #define PERST_DELAY_MS			100
+ 
+ /**
+@@ -521,6 +522,7 @@ static void mt7621_pcie_init_ports(struc
+ 		}
+ 	}
+ 
++	msleep(INIT_PORTS_DELAY_MS);
+ 	mt7621_pcie_reset_ep_deassert(pcie);
+ 
+ 	tmp = NULL;
diff --git a/target/linux/ramips/patches-5.15/108-PCI-mt7621-Delay-phy-ports-initialization.patch b/target/linux/ramips/patches-5.15/108-PCI-mt7621-Delay-phy-ports-initialization.patch
new file mode 100644
index 0000000000..de1d4cfc12
--- /dev/null
+++ b/target/linux/ramips/patches-5.15/108-PCI-mt7621-Delay-phy-ports-initialization.patch
@@ -0,0 +1,52 @@
+From 0cb2a8f3456ff1cc51d571e287a48e8fddc98ec2 Mon Sep 17 00:00:00 2001
+From: Sergio Paracuellos <sergio.paracuellos at gmail.com>
+Date: Sat, 31 Dec 2022 08:40:41 +0100
+Subject: PCI: mt7621: Delay phy ports initialization
+
+Some devices like ZBT WE1326 and ZBT WF3526-P and some Netgear models need
+to delay phy port initialization after calling the mt7621_pcie_init_port()
+driver function to get into reliable boots for both warm and hard resets.
+
+The delay required to detect the ports seems to be in the range [75-100]
+milliseconds.
+
+If the ports are not detected the controller is not functional.
+
+There is no datasheet or something similar to really understand why this
+extra delay is needed only for these devices and it is not for most of
+the boards that are built on mt7621 SoC.
+
+This issue has been reported by openWRT community and the complete
+discussion is in [0]. The 100 milliseconds delay has been tested in all
+devices to validate it.
+
+Add the extra 100 milliseconds delay to fix the issue.
+
+[0]: https://github.com/openwrt/openwrt/pull/11220
+
+Link: https://lore.kernel.org/r/20221231074041.264738-1-sergio.paracuellos at gmail.com
+Fixes: 2bdd5238e756 ("PCI: mt7621: Add MediaTek MT7621 PCIe host controller driver")
+Signed-off-by: Sergio Paracuellos <sergio.paracuellos at gmail.com>
+Signed-off-by: Lorenzo Pieralisi <lpieralisi at kernel.org>
+---
+ drivers/pci/controller/pcie-mt7621.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/pci/controller/pcie-mt7621.c
++++ b/drivers/pci/controller/pcie-mt7621.c
+@@ -58,6 +58,7 @@
+ #define PCIE_PORT_LINKUP		BIT(0)
+ #define PCIE_PORT_CNT			3
+ 
++#define INIT_PORTS_DELAY_MS		100
+ #define PERST_DELAY_MS			100
+ 
+ /**
+@@ -374,6 +375,7 @@ static int mt7621_pcie_init_ports(struct
+ 		}
+ 	}
+ 
++	msleep(INIT_PORTS_DELAY_MS);
+ 	mt7621_pcie_reset_ep_deassert(pcie);
+ 
+ 	tmp = NULL;



From lede-commits at lists.infradead.org  Sat Feb 18 06:07:56 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 09:07:56 -0500
Subject: [openwrt/openwrt]  kernel: bump 5.15 to 5.15.94
In-Reply-To: <167672927604.179416.13878189061033679241@git-01.infra.openwrt.org>
References: <167672927604.179416.13878189061033679241@git-01.infra.openwrt.org>
Message-ID: <mailman.17087.1676729285.3064139.lede-commits@lists.infradead.org>

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

commit 4536c76b558ca50645177a1e34bc24adda87d733
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Wed Feb 15 13:15:38 2023 -0500

    kernel: bump 5.15 to 5.15.94
    
    Patches automatically rebased.
    
    Build system: x86_64
    Build-tested: bcm2711/RPi4B, filogic/xiaomi_redmi-router-ax6000-ubootmod
    Run-tested: bcm2711/RPi4B, filogic/xiaomi_redmi-router-ax6000-ubootmod
    
    Signed-off-by: John Audia <therealgraysky at proton.me>
---
 include/kernel-5.15                                |  4 +--
 .../patches-5.15/910-unaligned_access_hacks.patch  |  4 +--
 ....1-04-mm-multigenerational-lru-groundwork.patch |  2 +-
 ...530-iterate-using-dsa_switch_for_each_use.patch |  2 +-
 ...530-populate-supported_interfaces-and-mac.patch | 16 ++++++------
 ...19-net-dsa-mt7530-remove-interface-checks.patch | 16 ++++++------
 ...530-drop-use-of-phylink_helper_basex_spee.patch |  2 +-
 ...530-only-indicate-linkmodes-that-can-be-s.patch |  6 ++---
 ...t7530-switch-to-use-phylink_get_linkmodes.patch | 12 ++++-----
 ...a-mt7530-partially-convert-to-phylink_pcs.patch | 30 +++++++++++-----------
 ...530-move-autoneg-handling-to-PCS-validati.patch |  6 ++---
 ...9-v5.19-net-dsa-mt7530-mark-as-non-legacy.patch |  2 +-
 ...-dsa-mt753x-fix-pcs-conversion-regression.patch |  4 +--
 ...dsa-mt7530-rework-mt7530_hw_vlan_-add-del.patch |  6 ++---
 ...6.0-net-dsa-mt7530-rework-mt753-01-_setup.patch |  8 +++---
 ...530-get-cpu-port-via-dp-cpu_dp-instead-of.patch |  8 +++---
 ...t7530-add-support-for-in-band-link-status.patch | 12 ++++-----
 ...c_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch |  2 +-
 ...ensure-all-MACs-are-powered-down-before-r.patch |  2 +-
 ...4-drivers-net-phy-eee-support-for-rtl838x.patch |  6 ++---
 20 files changed, 75 insertions(+), 75 deletions(-)

diff --git a/include/kernel-5.15 b/include/kernel-5.15
index f3967b5d29..5240155cee 100644
--- a/include/kernel-5.15
+++ b/include/kernel-5.15
@@ -1,2 +1,2 @@
-LINUX_VERSION-5.15 = .93
-LINUX_KERNEL_HASH-5.15.93 = e7ed24f2690bf0e11158ccfa8ddc5c0e8a4816d83c4055d205218853da9c5dad
+LINUX_VERSION-5.15 = .94
+LINUX_KERNEL_HASH-5.15.94 = da9270dbe64ddf1db13c70470957ff6796eb996d867bb4aed7d14a70e1c65a72
diff --git a/target/linux/ath79/patches-5.15/910-unaligned_access_hacks.patch b/target/linux/ath79/patches-5.15/910-unaligned_access_hacks.patch
index 3e707ef8ca..4fd06552e0 100644
--- a/target/linux/ath79/patches-5.15/910-unaligned_access_hacks.patch
+++ b/target/linux/ath79/patches-5.15/910-unaligned_access_hacks.patch
@@ -162,7 +162,7 @@ SVN-Revision: 35130
  
 --- a/include/uapi/linux/ip.h
 +++ b/include/uapi/linux/ip.h
-@@ -105,7 +105,7 @@ struct iphdr {
+@@ -106,7 +106,7 @@ struct iphdr {
  		__be32	daddr;
  	);
  	/*The options start here. */
@@ -173,7 +173,7 @@ SVN-Revision: 35130
  struct ip_auth_hdr {
 --- a/include/uapi/linux/ipv6.h
 +++ b/include/uapi/linux/ipv6.h
-@@ -134,7 +134,7 @@ struct ipv6hdr {
+@@ -135,7 +135,7 @@ struct ipv6hdr {
  		struct	in6_addr	saddr;
  		struct	in6_addr	daddr;
  	);
diff --git a/target/linux/generic/backport-5.15/020-v6.1-04-mm-multigenerational-lru-groundwork.patch b/target/linux/generic/backport-5.15/020-v6.1-04-mm-multigenerational-lru-groundwork.patch
index 61d0ea4ef4..5f2bada00a 100644
--- a/target/linux/generic/backport-5.15/020-v6.1-04-mm-multigenerational-lru-groundwork.patch
+++ b/target/linux/generic/backport-5.15/020-v6.1-04-mm-multigenerational-lru-groundwork.patch
@@ -652,7 +652,7 @@ Change-Id: I71de7cd15b8dfa6f9fdd838023474693c4fee0a7
  		"Section %d Node %d Zone %d Lastcpupid %d Kasantag %d\n",
 --- a/mm/page_alloc.c
 +++ b/mm/page_alloc.c
-@@ -7456,6 +7456,7 @@ static void __meminit pgdat_init_interna
+@@ -7459,6 +7459,7 @@ static void __meminit pgdat_init_interna
  
  	pgdat_page_ext_init(pgdat);
  	lruvec_init(&pgdat->__lruvec);
diff --git a/target/linux/generic/backport-5.15/705-01-v5.17-net-dsa-mt7530-iterate-using-dsa_switch_for_each_use.patch b/target/linux/generic/backport-5.15/705-01-v5.17-net-dsa-mt7530-iterate-using-dsa_switch_for_each_use.patch
index e3f01ada6d..a3fbf00629 100644
--- a/target/linux/generic/backport-5.15/705-01-v5.17-net-dsa-mt7530-iterate-using-dsa_switch_for_each_use.patch
+++ b/target/linux/generic/backport-5.15/705-01-v5.17-net-dsa-mt7530-iterate-using-dsa_switch_for_each_use.patch
@@ -65,7 +65,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	}
  
  	/* Add the all other ports to this port matrix. */
-@@ -1304,24 +1308,28 @@ static void
+@@ -1316,24 +1320,28 @@ static void
  mt7530_port_bridge_leave(struct dsa_switch *ds, int port,
  			 struct net_device *bridge)
  {
diff --git a/target/linux/generic/backport-5.15/705-02-v5.19-net-dsa-mt7530-populate-supported_interfaces-and-mac.patch b/target/linux/generic/backport-5.15/705-02-v5.19-net-dsa-mt7530-populate-supported_interfaces-and-mac.patch
index 94b8cb053d..6599f25c0f 100644
--- a/target/linux/generic/backport-5.15/705-02-v5.19-net-dsa-mt7530-populate-supported_interfaces-and-mac.patch
+++ b/target/linux/generic/backport-5.15/705-02-v5.19-net-dsa-mt7530-populate-supported_interfaces-and-mac.patch
@@ -23,7 +23,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2390,6 +2390,32 @@ mt7531_setup(struct dsa_switch *ds)
+@@ -2402,6 +2402,32 @@ mt7531_setup(struct dsa_switch *ds)
  	return 0;
  }
  
@@ -56,7 +56,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  static bool
  mt7530_phy_mode_supported(struct dsa_switch *ds, int port,
  			  const struct phylink_link_state *state)
-@@ -2426,6 +2452,37 @@ static bool mt7531_is_rgmii_port(struct
+@@ -2438,6 +2464,37 @@ static bool mt7531_is_rgmii_port(struct
  	return (port == 5) && (priv->p5_intf_sel != P5_INTF_SEL_GMAC5_SGMII);
  }
  
@@ -94,7 +94,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  static bool
  mt7531_phy_mode_supported(struct dsa_switch *ds, int port,
  			  const struct phylink_link_state *state)
-@@ -2902,6 +2959,18 @@ mt7531_cpu_port_config(struct dsa_switch
+@@ -2914,6 +2971,18 @@ mt7531_cpu_port_config(struct dsa_switch
  	return 0;
  }
  
@@ -113,7 +113,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  static void
  mt7530_mac_port_validate(struct dsa_switch *ds, int port,
  			 unsigned long *supported)
-@@ -3137,6 +3206,7 @@ static const struct dsa_switch_ops mt753
+@@ -3149,6 +3218,7 @@ static const struct dsa_switch_ops mt753
  	.port_vlan_del		= mt7530_port_vlan_del,
  	.port_mirror_add	= mt753x_port_mirror_add,
  	.port_mirror_del	= mt753x_port_mirror_del,
@@ -121,7 +121,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  	.phylink_validate	= mt753x_phylink_validate,
  	.phylink_mac_link_state	= mt753x_phylink_mac_link_state,
  	.phylink_mac_config	= mt753x_phylink_mac_config,
-@@ -3154,6 +3224,7 @@ static const struct mt753x_info mt753x_t
+@@ -3166,6 +3236,7 @@ static const struct mt753x_info mt753x_t
  		.phy_read = mt7530_phy_read,
  		.phy_write = mt7530_phy_write,
  		.pad_setup = mt7530_pad_clk_setup,
@@ -129,7 +129,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  		.phy_mode_supported = mt7530_phy_mode_supported,
  		.mac_port_validate = mt7530_mac_port_validate,
  		.mac_port_get_state = mt7530_phylink_mac_link_state,
-@@ -3165,6 +3236,7 @@ static const struct mt753x_info mt753x_t
+@@ -3177,6 +3248,7 @@ static const struct mt753x_info mt753x_t
  		.phy_read = mt7530_phy_read,
  		.phy_write = mt7530_phy_write,
  		.pad_setup = mt7530_pad_clk_setup,
@@ -137,7 +137,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  		.phy_mode_supported = mt7530_phy_mode_supported,
  		.mac_port_validate = mt7530_mac_port_validate,
  		.mac_port_get_state = mt7530_phylink_mac_link_state,
-@@ -3177,6 +3249,7 @@ static const struct mt753x_info mt753x_t
+@@ -3189,6 +3261,7 @@ static const struct mt753x_info mt753x_t
  		.phy_write = mt7531_ind_phy_write,
  		.pad_setup = mt7531_pad_setup,
  		.cpu_port_config = mt7531_cpu_port_config,
@@ -145,7 +145,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  		.phy_mode_supported = mt7531_phy_mode_supported,
  		.mac_port_validate = mt7531_mac_port_validate,
  		.mac_port_get_state = mt7531_phylink_mac_link_state,
-@@ -3239,6 +3312,7 @@ mt7530_probe(struct mdio_device *mdiodev
+@@ -3251,6 +3324,7 @@ mt7530_probe(struct mdio_device *mdiodev
  	 */
  	if (!priv->info->sw_setup || !priv->info->pad_setup ||
  	    !priv->info->phy_read || !priv->info->phy_write ||
diff --git a/target/linux/generic/backport-5.15/705-03-v5.19-net-dsa-mt7530-remove-interface-checks.patch b/target/linux/generic/backport-5.15/705-03-v5.19-net-dsa-mt7530-remove-interface-checks.patch
index 322dc6f6ef..325152603a 100644
--- a/target/linux/generic/backport-5.15/705-03-v5.19-net-dsa-mt7530-remove-interface-checks.patch
+++ b/target/linux/generic/backport-5.15/705-03-v5.19-net-dsa-mt7530-remove-interface-checks.patch
@@ -21,7 +21,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2416,37 +2416,6 @@ static void mt7530_mac_port_get_caps(str
+@@ -2428,37 +2428,6 @@ static void mt7530_mac_port_get_caps(str
  	}
  }
  
@@ -59,7 +59,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  static bool mt7531_is_rgmii_port(struct mt7530_priv *priv, u32 port)
  {
  	return (port == 5) && (priv->p5_intf_sel != P5_INTF_SEL_GMAC5_SGMII);
-@@ -2483,44 +2452,6 @@ static void mt7531_mac_port_get_caps(str
+@@ -2495,44 +2464,6 @@ static void mt7531_mac_port_get_caps(str
  	}
  }
  
@@ -104,7 +104,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  static int
  mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state)
  {
-@@ -2775,9 +2706,6 @@ mt753x_phylink_mac_config(struct dsa_swi
+@@ -2787,9 +2718,6 @@ mt753x_phylink_mac_config(struct dsa_swi
  	struct mt7530_priv *priv = ds->priv;
  	u32 mcr_cur, mcr_new;
  
@@ -114,7 +114,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  	switch (port) {
  	case 0 ... 4: /* Internal phy */
  		if (state->interface != PHY_INTERFACE_MODE_GMII)
-@@ -2993,12 +2921,6 @@ mt753x_phylink_validate(struct dsa_switc
+@@ -3005,12 +2933,6 @@ mt753x_phylink_validate(struct dsa_switc
  	__ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
  	struct mt7530_priv *priv = ds->priv;
  
@@ -127,7 +127,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  	phylink_set_port_modes(mask);
  
  	if (state->interface != PHY_INTERFACE_MODE_TRGMII &&
-@@ -3225,7 +3147,6 @@ static const struct mt753x_info mt753x_t
+@@ -3237,7 +3159,6 @@ static const struct mt753x_info mt753x_t
  		.phy_write = mt7530_phy_write,
  		.pad_setup = mt7530_pad_clk_setup,
  		.mac_port_get_caps = mt7530_mac_port_get_caps,
@@ -135,7 +135,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  		.mac_port_validate = mt7530_mac_port_validate,
  		.mac_port_get_state = mt7530_phylink_mac_link_state,
  		.mac_port_config = mt7530_mac_config,
-@@ -3237,7 +3158,6 @@ static const struct mt753x_info mt753x_t
+@@ -3249,7 +3170,6 @@ static const struct mt753x_info mt753x_t
  		.phy_write = mt7530_phy_write,
  		.pad_setup = mt7530_pad_clk_setup,
  		.mac_port_get_caps = mt7530_mac_port_get_caps,
@@ -143,7 +143,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  		.mac_port_validate = mt7530_mac_port_validate,
  		.mac_port_get_state = mt7530_phylink_mac_link_state,
  		.mac_port_config = mt7530_mac_config,
-@@ -3250,7 +3170,6 @@ static const struct mt753x_info mt753x_t
+@@ -3262,7 +3182,6 @@ static const struct mt753x_info mt753x_t
  		.pad_setup = mt7531_pad_setup,
  		.cpu_port_config = mt7531_cpu_port_config,
  		.mac_port_get_caps = mt7531_mac_port_get_caps,
@@ -151,7 +151,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  		.mac_port_validate = mt7531_mac_port_validate,
  		.mac_port_get_state = mt7531_phylink_mac_link_state,
  		.mac_port_config = mt7531_mac_config,
-@@ -3313,7 +3232,6 @@ mt7530_probe(struct mdio_device *mdiodev
+@@ -3325,7 +3244,6 @@ mt7530_probe(struct mdio_device *mdiodev
  	if (!priv->info->sw_setup || !priv->info->pad_setup ||
  	    !priv->info->phy_read || !priv->info->phy_write ||
  	    !priv->info->mac_port_get_caps ||
diff --git a/target/linux/generic/backport-5.15/705-04-v5.19-net-dsa-mt7530-drop-use-of-phylink_helper_basex_spee.patch b/target/linux/generic/backport-5.15/705-04-v5.19-net-dsa-mt7530-drop-use-of-phylink_helper_basex_spee.patch
index 36b3aab33b..76d89d0c54 100644
--- a/target/linux/generic/backport-5.15/705-04-v5.19-net-dsa-mt7530-drop-use-of-phylink_helper_basex_spee.patch
+++ b/target/linux/generic/backport-5.15/705-04-v5.19-net-dsa-mt7530-drop-use-of-phylink_helper_basex_spee.patch
@@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2945,11 +2945,6 @@ mt753x_phylink_validate(struct dsa_switc
+@@ -2957,11 +2957,6 @@ mt753x_phylink_validate(struct dsa_switc
  
  	linkmode_and(supported, supported, mask);
  	linkmode_and(state->advertising, state->advertising, mask);
diff --git a/target/linux/generic/backport-5.15/705-05-v5.19-net-dsa-mt7530-only-indicate-linkmodes-that-can-be-s.patch b/target/linux/generic/backport-5.15/705-05-v5.19-net-dsa-mt7530-only-indicate-linkmodes-that-can-be-s.patch
index 831f509341..6ee017ea72 100644
--- a/target/linux/generic/backport-5.15/705-05-v5.19-net-dsa-mt7530-only-indicate-linkmodes-that-can-be-s.patch
+++ b/target/linux/generic/backport-5.15/705-05-v5.19-net-dsa-mt7530-only-indicate-linkmodes-that-can-be-s.patch
@@ -23,7 +23,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2523,12 +2523,13 @@ static int mt7531_rgmii_setup(struct mt7
+@@ -2535,12 +2535,13 @@ static int mt7531_rgmii_setup(struct mt7
  }
  
  static void mt7531_sgmii_validate(struct mt7530_priv *priv, int port,
@@ -38,7 +38,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  		phylink_set(supported, 2500baseX_Full);
  		phylink_set(supported, 2500baseT_Full);
  	}
-@@ -2901,16 +2902,18 @@ static void mt753x_phylink_get_caps(stru
+@@ -2913,16 +2914,18 @@ static void mt753x_phylink_get_caps(stru
  
  static void
  mt7530_mac_port_validate(struct dsa_switch *ds, int port,
@@ -58,7 +58,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  }
  
  static void
-@@ -2933,12 +2936,13 @@ mt753x_phylink_validate(struct dsa_switc
+@@ -2945,12 +2948,13 @@ mt753x_phylink_validate(struct dsa_switc
  	}
  
  	/* This switch only supports 1G full-duplex. */
diff --git a/target/linux/generic/backport-5.15/705-06-v5.19-net-dsa-mt7530-switch-to-use-phylink_get_linkmodes.patch b/target/linux/generic/backport-5.15/705-06-v5.19-net-dsa-mt7530-switch-to-use-phylink_get_linkmodes.patch
index 9f54f2789b..670ac080cf 100644
--- a/target/linux/generic/backport-5.15/705-06-v5.19-net-dsa-mt7530-switch-to-use-phylink_get_linkmodes.patch
+++ b/target/linux/generic/backport-5.15/705-06-v5.19-net-dsa-mt7530-switch-to-use-phylink_get_linkmodes.patch
@@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2522,19 +2522,6 @@ static int mt7531_rgmii_setup(struct mt7
+@@ -2534,19 +2534,6 @@ static int mt7531_rgmii_setup(struct mt7
  	return 0;
  }
  
@@ -40,7 +40,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  static void
  mt7531_sgmii_link_up_force(struct dsa_switch *ds, int port,
  			   unsigned int mode, phy_interface_t interface,
-@@ -2901,51 +2888,21 @@ static void mt753x_phylink_get_caps(stru
+@@ -2913,51 +2900,21 @@ static void mt753x_phylink_get_caps(stru
  }
  
  static void
@@ -97,7 +97,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  
  	linkmode_and(supported, supported, mask);
  	linkmode_and(state->advertising, state->advertising, mask);
-@@ -3146,7 +3103,6 @@ static const struct mt753x_info mt753x_t
+@@ -3158,7 +3115,6 @@ static const struct mt753x_info mt753x_t
  		.phy_write = mt7530_phy_write,
  		.pad_setup = mt7530_pad_clk_setup,
  		.mac_port_get_caps = mt7530_mac_port_get_caps,
@@ -105,7 +105,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  		.mac_port_get_state = mt7530_phylink_mac_link_state,
  		.mac_port_config = mt7530_mac_config,
  	},
-@@ -3157,7 +3113,6 @@ static const struct mt753x_info mt753x_t
+@@ -3169,7 +3125,6 @@ static const struct mt753x_info mt753x_t
  		.phy_write = mt7530_phy_write,
  		.pad_setup = mt7530_pad_clk_setup,
  		.mac_port_get_caps = mt7530_mac_port_get_caps,
@@ -113,7 +113,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  		.mac_port_get_state = mt7530_phylink_mac_link_state,
  		.mac_port_config = mt7530_mac_config,
  	},
-@@ -3169,7 +3124,6 @@ static const struct mt753x_info mt753x_t
+@@ -3181,7 +3136,6 @@ static const struct mt753x_info mt753x_t
  		.pad_setup = mt7531_pad_setup,
  		.cpu_port_config = mt7531_cpu_port_config,
  		.mac_port_get_caps = mt7531_mac_port_get_caps,
@@ -121,7 +121,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  		.mac_port_get_state = mt7531_phylink_mac_link_state,
  		.mac_port_config = mt7531_mac_config,
  		.mac_pcs_an_restart = mt7531_sgmii_restart_an,
-@@ -3231,7 +3185,6 @@ mt7530_probe(struct mdio_device *mdiodev
+@@ -3243,7 +3197,6 @@ mt7530_probe(struct mdio_device *mdiodev
  	if (!priv->info->sw_setup || !priv->info->pad_setup ||
  	    !priv->info->phy_read || !priv->info->phy_write ||
  	    !priv->info->mac_port_get_caps ||
diff --git a/target/linux/generic/backport-5.15/705-07-v5.19-net-dsa-mt7530-partially-convert-to-phylink_pcs.patch b/target/linux/generic/backport-5.15/705-07-v5.19-net-dsa-mt7530-partially-convert-to-phylink_pcs.patch
index c07e627c77..638127f56c 100644
--- a/target/linux/generic/backport-5.15/705-07-v5.19-net-dsa-mt7530-partially-convert-to-phylink_pcs.patch
+++ b/target/linux/generic/backport-5.15/705-07-v5.19-net-dsa-mt7530-partially-convert-to-phylink_pcs.patch
@@ -33,7 +33,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  /* String, offset, and register size in bytes if different from 4 bytes */
  static const struct mt7530_mib_desc mt7530_mib[] = {
  	MIB_DESC(1, 0x00, "TxDrop"),
-@@ -2522,12 +2527,11 @@ static int mt7531_rgmii_setup(struct mt7
+@@ -2534,12 +2539,11 @@ static int mt7531_rgmii_setup(struct mt7
  	return 0;
  }
  
@@ -50,7 +50,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  	unsigned int val;
  
  	/* For adjusting speed and duplex of SGMII force mode. */
-@@ -2553,6 +2557,9 @@ mt7531_sgmii_link_up_force(struct dsa_sw
+@@ -2565,6 +2569,9 @@ mt7531_sgmii_link_up_force(struct dsa_sw
  
  	/* MT7531 SGMII 1G force mode can only work in full duplex mode,
  	 * no matter MT7531_SGMII_FORCE_HALF_DUPLEX is set or not.
@@ -60,7 +60,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  	 */
  	if ((speed == SPEED_10 || speed == SPEED_100) &&
  	    duplex != DUPLEX_FULL)
-@@ -2628,9 +2635,10 @@ static int mt7531_sgmii_setup_mode_an(st
+@@ -2640,9 +2647,10 @@ static int mt7531_sgmii_setup_mode_an(st
  	return 0;
  }
  
@@ -73,7 +73,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  	u32 val;
  
  	/* Only restart AN when AN is enabled */
-@@ -2687,6 +2695,24 @@ mt753x_mac_config(struct dsa_switch *ds,
+@@ -2699,6 +2707,24 @@ mt753x_mac_config(struct dsa_switch *ds,
  	return priv->info->mac_port_config(ds, port, mode, state->interface);
  }
  
@@ -98,7 +98,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  static void
  mt753x_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
  			  const struct phylink_link_state *state)
-@@ -2748,17 +2774,6 @@ unsupported:
+@@ -2760,17 +2786,6 @@ unsupported:
  		mt7530_write(priv, MT7530_PMCR_P(port), mcr_new);
  }
  
@@ -116,7 +116,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  static void mt753x_phylink_mac_link_down(struct dsa_switch *ds, int port,
  					 unsigned int mode,
  					 phy_interface_t interface)
-@@ -2768,16 +2783,13 @@ static void mt753x_phylink_mac_link_down
+@@ -2780,16 +2795,13 @@ static void mt753x_phylink_mac_link_down
  	mt7530_clear(priv, MT7530_PMCR_P(port), PMCR_LINK_SETTINGS_MASK);
  }
  
@@ -139,7 +139,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  }
  
  static void mt753x_phylink_mac_link_up(struct dsa_switch *ds, int port,
-@@ -2790,8 +2802,6 @@ static void mt753x_phylink_mac_link_up(s
+@@ -2802,8 +2814,6 @@ static void mt753x_phylink_mac_link_up(s
  	struct mt7530_priv *priv = ds->priv;
  	u32 mcr;
  
@@ -148,7 +148,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  	mcr = PMCR_RX_EN | PMCR_TX_EN | PMCR_FORCE_LNK;
  
  	/* MT753x MAC works in 1G full duplex mode for all up-clocked
-@@ -2869,6 +2879,8 @@ mt7531_cpu_port_config(struct dsa_switch
+@@ -2881,6 +2891,8 @@ mt7531_cpu_port_config(struct dsa_switch
  		return ret;
  	mt7530_write(priv, MT7530_PMCR_P(port),
  		     PMCR_CPU_PORT_SETTING(priv->id));
@@ -157,7 +157,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  	mt753x_phylink_mac_link_up(ds, port, MLO_AN_FIXED, interface, NULL,
  				   speed, DUPLEX_FULL, true, true);
  
-@@ -2908,16 +2920,13 @@ mt753x_phylink_validate(struct dsa_switc
+@@ -2920,16 +2932,13 @@ mt753x_phylink_validate(struct dsa_switc
  	linkmode_and(state->advertising, state->advertising, mask);
  }
  
@@ -178,7 +178,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  	pmsr = mt7530_read(priv, MT7530_PMSR_P(port));
  
  	state->link = (pmsr & PMSR_LINK);
-@@ -2944,8 +2953,6 @@ mt7530_phylink_mac_link_state(struct dsa
+@@ -2956,8 +2965,6 @@ mt7530_phylink_mac_link_state(struct dsa
  		state->pause |= MLO_PAUSE_RX;
  	if (pmsr & PMSR_TX_FC)
  		state->pause |= MLO_PAUSE_TX;
@@ -187,7 +187,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  }
  
  static int
-@@ -2987,32 +2994,49 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
+@@ -2999,32 +3006,49 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
  	return 0;
  }
  
@@ -249,7 +249,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  
  	if (ret)
  		return ret;
-@@ -3025,6 +3049,13 @@ mt753x_setup(struct dsa_switch *ds)
+@@ -3037,6 +3061,13 @@ mt753x_setup(struct dsa_switch *ds)
  	if (ret && priv->irq)
  		mt7530_free_irq_common(priv);
  
@@ -263,7 +263,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  	return ret;
  }
  
-@@ -3086,9 +3117,8 @@ static const struct dsa_switch_ops mt753
+@@ -3098,9 +3129,8 @@ static const struct dsa_switch_ops mt753
  	.port_mirror_del	= mt753x_port_mirror_del,
  	.phylink_get_caps	= mt753x_phylink_get_caps,
  	.phylink_validate	= mt753x_phylink_validate,
@@ -274,7 +274,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  	.phylink_mac_link_down	= mt753x_phylink_mac_link_down,
  	.phylink_mac_link_up	= mt753x_phylink_mac_link_up,
  	.get_mac_eee		= mt753x_get_mac_eee,
-@@ -3098,36 +3128,34 @@ static const struct dsa_switch_ops mt753
+@@ -3110,36 +3140,34 @@ static const struct dsa_switch_ops mt753
  static const struct mt753x_info mt753x_table[] = {
  	[ID_MT7621] = {
  		.id = ID_MT7621,
@@ -314,7 +314,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  	},
  };
  
-@@ -3185,7 +3213,7 @@ mt7530_probe(struct mdio_device *mdiodev
+@@ -3197,7 +3225,7 @@ mt7530_probe(struct mdio_device *mdiodev
  	if (!priv->info->sw_setup || !priv->info->pad_setup ||
  	    !priv->info->phy_read || !priv->info->phy_write ||
  	    !priv->info->mac_port_get_caps ||
diff --git a/target/linux/generic/backport-5.15/705-08-v5.19-net-dsa-mt7530-move-autoneg-handling-to-PCS-validati.patch b/target/linux/generic/backport-5.15/705-08-v5.19-net-dsa-mt7530-move-autoneg-handling-to-PCS-validati.patch
index 2d57bc7a03..19d3258af5 100644
--- a/target/linux/generic/backport-5.15/705-08-v5.19-net-dsa-mt7530-move-autoneg-handling-to-PCS-validati.patch
+++ b/target/linux/generic/backport-5.15/705-08-v5.19-net-dsa-mt7530-move-autoneg-handling-to-PCS-validati.patch
@@ -20,7 +20,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2899,25 +2899,16 @@ static void mt753x_phylink_get_caps(stru
+@@ -2911,25 +2911,16 @@ static void mt753x_phylink_get_caps(stru
  	priv->info->mac_port_get_caps(ds, port, config);
  }
  
@@ -55,7 +55,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  }
  
  static void mt7530_pcs_get_state(struct phylink_pcs *pcs,
-@@ -3019,12 +3010,14 @@ static void mt7530_pcs_an_restart(struct
+@@ -3031,12 +3022,14 @@ static void mt7530_pcs_an_restart(struct
  }
  
  static const struct phylink_pcs_ops mt7530_pcs_ops = {
@@ -70,7 +70,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
  	.pcs_get_state = mt7531_pcs_get_state,
  	.pcs_config = mt753x_pcs_config,
  	.pcs_an_restart = mt7531_pcs_an_restart,
-@@ -3116,7 +3109,6 @@ static const struct dsa_switch_ops mt753
+@@ -3128,7 +3121,6 @@ static const struct dsa_switch_ops mt753
  	.port_mirror_add	= mt753x_port_mirror_add,
  	.port_mirror_del	= mt753x_port_mirror_del,
  	.phylink_get_caps	= mt753x_phylink_get_caps,
diff --git a/target/linux/generic/backport-5.15/705-09-v5.19-net-dsa-mt7530-mark-as-non-legacy.patch b/target/linux/generic/backport-5.15/705-09-v5.19-net-dsa-mt7530-mark-as-non-legacy.patch
index bddc984a1f..7d5e4ae6ce 100644
--- a/target/linux/generic/backport-5.15/705-09-v5.19-net-dsa-mt7530-mark-as-non-legacy.patch
+++ b/target/linux/generic/backport-5.15/705-09-v5.19-net-dsa-mt7530-mark-as-non-legacy.patch
@@ -19,7 +19,7 @@ Signed-off-by: Paolo Abeni <pabeni at redhat.com>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2896,6 +2896,12 @@ static void mt753x_phylink_get_caps(stru
+@@ -2908,6 +2908,12 @@ static void mt753x_phylink_get_caps(stru
  	config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
  				   MAC_10 | MAC_100 | MAC_1000FD;
  
diff --git a/target/linux/generic/backport-5.15/705-10-v5.19-net-dsa-mt753x-fix-pcs-conversion-regression.patch b/target/linux/generic/backport-5.15/705-10-v5.19-net-dsa-mt753x-fix-pcs-conversion-regression.patch
index dcf946120e..7066a87d71 100644
--- a/target/linux/generic/backport-5.15/705-10-v5.19-net-dsa-mt753x-fix-pcs-conversion-regression.patch
+++ b/target/linux/generic/backport-5.15/705-10-v5.19-net-dsa-mt753x-fix-pcs-conversion-regression.patch
@@ -81,7 +81,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -3034,9 +3034,16 @@ static int
+@@ -3046,9 +3046,16 @@ static int
  mt753x_setup(struct dsa_switch *ds)
  {
  	struct mt7530_priv *priv = ds->priv;
@@ -100,7 +100,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	if (ret)
  		return ret;
  
-@@ -3048,13 +3055,6 @@ mt753x_setup(struct dsa_switch *ds)
+@@ -3060,13 +3067,6 @@ mt753x_setup(struct dsa_switch *ds)
  	if (ret && priv->irq)
  		mt7530_free_irq_common(priv);
  
diff --git a/target/linux/generic/backport-5.15/705-11-v6.0-net-dsa-mt7530-rework-mt7530_hw_vlan_-add-del.patch b/target/linux/generic/backport-5.15/705-11-v6.0-net-dsa-mt7530-rework-mt7530_hw_vlan_-add-del.patch
index 5fd109329c..2476cd361a 100644
--- a/target/linux/generic/backport-5.15/705-11-v6.0-net-dsa-mt7530-rework-mt7530_hw_vlan_-add-del.patch
+++ b/target/linux/generic/backport-5.15/705-11-v6.0-net-dsa-mt7530-rework-mt7530_hw_vlan_-add-del.patch
@@ -26,7 +26,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -1525,11 +1525,11 @@ static void
+@@ -1537,11 +1537,11 @@ static void
  mt7530_hw_vlan_add(struct mt7530_priv *priv,
  		   struct mt7530_hw_vlan_entry *entry)
  {
@@ -40,7 +40,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	/* Validate the entry with independent learning, create egress tag per
  	 * VLAN and joining the port as one of the port members.
-@@ -1540,22 +1540,20 @@ mt7530_hw_vlan_add(struct mt7530_priv *p
+@@ -1552,22 +1552,20 @@ mt7530_hw_vlan_add(struct mt7530_priv *p
  
  	/* Decide whether adding tag or not for those outgoing packets from the
  	 * port inside the VLAN.
@@ -72,7 +72,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  }
  
  static void
-@@ -1574,11 +1572,7 @@ mt7530_hw_vlan_del(struct mt7530_priv *p
+@@ -1586,11 +1584,7 @@ mt7530_hw_vlan_del(struct mt7530_priv *p
  		return;
  	}
  
diff --git a/target/linux/generic/backport-5.15/705-12-v6.0-net-dsa-mt7530-rework-mt753-01-_setup.patch b/target/linux/generic/backport-5.15/705-12-v6.0-net-dsa-mt7530-rework-mt753-01-_setup.patch
index 165d1d035f..6928c5960a 100644
--- a/target/linux/generic/backport-5.15/705-12-v6.0-net-dsa-mt7530-rework-mt753-01-_setup.patch
+++ b/target/linux/generic/backport-5.15/705-12-v6.0-net-dsa-mt7530-rework-mt753-01-_setup.patch
@@ -16,7 +16,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2090,11 +2090,12 @@ static int
+@@ -2102,11 +2102,12 @@ static int
  mt7530_setup(struct dsa_switch *ds)
  {
  	struct mt7530_priv *priv = ds->priv;
@@ -30,7 +30,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	u32 id, val;
  	int ret, i;
  
-@@ -2102,7 +2103,19 @@ mt7530_setup(struct dsa_switch *ds)
+@@ -2114,7 +2115,19 @@ mt7530_setup(struct dsa_switch *ds)
  	 * controller also is the container for two GMACs nodes representing
  	 * as two netdev instances.
  	 */
@@ -51,7 +51,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	ds->assisted_learning_on_cpu_port = true;
  	ds->mtu_enforcement_ingress = true;
  
-@@ -2264,6 +2277,7 @@ mt7531_setup(struct dsa_switch *ds)
+@@ -2276,6 +2289,7 @@ mt7531_setup(struct dsa_switch *ds)
  {
  	struct mt7530_priv *priv = ds->priv;
  	struct mt7530_dummy_poll p;
@@ -59,7 +59,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	u32 val, id;
  	int ret, i;
  
-@@ -2338,8 +2352,11 @@ mt7531_setup(struct dsa_switch *ds)
+@@ -2350,8 +2364,11 @@ mt7531_setup(struct dsa_switch *ds)
  				 CORE_PLL_GROUP4, val);
  
  	/* BPDU to CPU port */
diff --git a/target/linux/generic/backport-5.15/705-13-v6.0-net-dsa-mt7530-get-cpu-port-via-dp-cpu_dp-instead-of.patch b/target/linux/generic/backport-5.15/705-13-v6.0-net-dsa-mt7530-get-cpu-port-via-dp-cpu_dp-instead-of.patch
index 5af91a0f7f..828c2b5274 100644
--- a/target/linux/generic/backport-5.15/705-13-v6.0-net-dsa-mt7530-get-cpu-port-via-dp-cpu_dp-instead-of.patch
+++ b/target/linux/generic/backport-5.15/705-13-v6.0-net-dsa-mt7530-get-cpu-port-via-dp-cpu_dp-instead-of.patch
@@ -67,7 +67,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  			     | PVC_EG_TAG(MT7530_VLAN_EG_CONSISTENT));
  	}
  }
-@@ -1314,6 +1323,7 @@ mt7530_port_bridge_leave(struct dsa_swit
+@@ -1326,6 +1335,7 @@ mt7530_port_bridge_leave(struct dsa_swit
  			 struct net_device *bridge)
  {
  	struct dsa_port *dp = dsa_to_port(ds, port), *other_dp;
@@ -75,7 +75,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	struct mt7530_priv *priv = ds->priv;
  
  	mutex_lock(&priv->reg_mutex);
-@@ -1342,8 +1352,8 @@ mt7530_port_bridge_leave(struct dsa_swit
+@@ -1354,8 +1364,8 @@ mt7530_port_bridge_leave(struct dsa_swit
  	 */
  	if (priv->ports[port].enable)
  		mt7530_rmw(priv, MT7530_PCR_P(port), PCR_MATRIX_MASK,
@@ -86,7 +86,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  
  	/* When a port is removed from the bridge, the port would be set up
  	 * back to the default as is at initial boot which is a VLAN-unaware
-@@ -1506,6 +1516,9 @@ static int
+@@ -1518,6 +1528,9 @@ static int
  mt7530_port_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering,
  			   struct netlink_ext_ack *extack)
  {
@@ -96,7 +96,7 @@ Signed-off-by: Jakub Kicinski <kuba at kernel.org>
  	if (vlan_filtering) {
  		/* The port is being kept as VLAN-unaware port when bridge is
  		 * set up with vlan_filtering not being set, Otherwise, the
-@@ -1513,7 +1526,7 @@ mt7530_port_vlan_filtering(struct dsa_sw
+@@ -1525,7 +1538,7 @@ mt7530_port_vlan_filtering(struct dsa_sw
  		 * for becoming a VLAN-aware port.
  		 */
  		mt7530_port_set_vlan_aware(ds, port);
diff --git a/target/linux/generic/backport-5.15/782-v6.1-net-dsa-mt7530-add-support-for-in-band-link-status.patch b/target/linux/generic/backport-5.15/782-v6.1-net-dsa-mt7530-add-support-for-in-band-link-status.patch
index 7bb6530266..988dfa317d 100644
--- a/target/linux/generic/backport-5.15/782-v6.1-net-dsa-mt7530-add-support-for-in-band-link-status.patch
+++ b/target/linux/generic/backport-5.15/782-v6.1-net-dsa-mt7530-add-support-for-in-band-link-status.patch
@@ -19,7 +19,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2699,9 +2699,6 @@ mt7531_mac_config(struct dsa_switch *ds,
+@@ -2711,9 +2711,6 @@ mt7531_mac_config(struct dsa_switch *ds,
  	case PHY_INTERFACE_MODE_NA:
  	case PHY_INTERFACE_MODE_1000BASEX:
  	case PHY_INTERFACE_MODE_2500BASEX:
@@ -29,7 +29,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  		return mt7531_sgmii_setup_mode_force(priv, port, interface);
  	default:
  		return -EINVAL;
-@@ -2777,13 +2774,6 @@ unsupported:
+@@ -2789,13 +2786,6 @@ unsupported:
  		return;
  	}
  
@@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	mcr_cur = mt7530_read(priv, MT7530_PMCR_P(port));
  	mcr_new = mcr_cur;
  	mcr_new &= ~PMCR_LINK_SETTINGS_MASK;
-@@ -2920,6 +2910,9 @@ static void mt753x_phylink_get_caps(stru
+@@ -2932,6 +2922,9 @@ static void mt753x_phylink_get_caps(stru
  	config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
  				   MAC_10 | MAC_100 | MAC_1000FD;
  
@@ -53,7 +53,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	/* This driver does not make use of the speed, duplex, pause or the
  	 * advertisement in its mac_config, so it is safe to mark this driver
  	 * as non-legacy.
-@@ -2985,6 +2978,7 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
+@@ -2997,6 +2990,7 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
  
  	status = mt7530_read(priv, MT7531_PCS_CONTROL_1(port));
  	state->link = !!(status & MT7531_SGMII_LINK_STATUS);
@@ -61,7 +61,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  	if (state->interface == PHY_INTERFACE_MODE_SGMII &&
  	    (status & MT7531_SGMII_AN_ENABLE)) {
  		val = mt7530_read(priv, MT7531_PCS_SPEED_ABILITY(port));
-@@ -3015,16 +3009,44 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
+@@ -3027,16 +3021,44 @@ mt7531_sgmii_pcs_get_state_an(struct mt7
  	return 0;
  }
  
@@ -109,7 +109,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
  }
  
  static int mt753x_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
-@@ -3065,6 +3087,8 @@ mt753x_setup(struct dsa_switch *ds)
+@@ -3077,6 +3099,8 @@ mt753x_setup(struct dsa_switch *ds)
  		priv->pcs[i].pcs.ops = priv->info->pcs_ops;
  		priv->pcs[i].priv = priv;
  		priv->pcs[i].port = i;
diff --git a/target/linux/generic/pending-5.15/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-5.15/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch
index 1ba95d3ffa..4865659c04 100644
--- a/target/linux/generic/pending-5.15/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch
+++ b/target/linux/generic/pending-5.15/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch
@@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf <dev-NTEO at vplace.de>
 
 --- a/mm/page_alloc.c
 +++ b/mm/page_alloc.c
-@@ -7602,7 +7602,7 @@ static void __init alloc_node_mem_map(st
+@@ -7605,7 +7605,7 @@ static void __init alloc_node_mem_map(st
  	if (pgdat == NODE_DATA(0)) {
  		mem_map = NODE_DATA(0)->node_mem_map;
  		if (page_to_pfn(mem_map) != pgdat->node_start_pfn)
diff --git a/target/linux/generic/pending-5.15/723-net-mt7531-ensure-all-MACs-are-powered-down-before-r.patch b/target/linux/generic/pending-5.15/723-net-mt7531-ensure-all-MACs-are-powered-down-before-r.patch
index cc12d72110..12a3044d05 100644
--- a/target/linux/generic/pending-5.15/723-net-mt7531-ensure-all-MACs-are-powered-down-before-r.patch
+++ b/target/linux/generic/pending-5.15/723-net-mt7531-ensure-all-MACs-are-powered-down-before-r.patch
@@ -15,7 +15,7 @@ Signed-off-by: Alexander Couzens <lynxis at fe80.eu>
 
 --- a/drivers/net/dsa/mt7530.c
 +++ b/drivers/net/dsa/mt7530.c
-@@ -2324,6 +2324,10 @@ mt7531_setup(struct dsa_switch *ds)
+@@ -2336,6 +2336,10 @@ mt7531_setup(struct dsa_switch *ds)
  		return -ENODEV;
  	}
  
diff --git a/target/linux/realtek/patches-5.15/704-drivers-net-phy-eee-support-for-rtl838x.patch b/target/linux/realtek/patches-5.15/704-drivers-net-phy-eee-support-for-rtl838x.patch
index d886ba224c..1cea91e0d1 100644
--- a/target/linux/realtek/patches-5.15/704-drivers-net-phy-eee-support-for-rtl838x.patch
+++ b/target/linux/realtek/patches-5.15/704-drivers-net-phy-eee-support-for-rtl838x.patch
@@ -21,7 +21,7 @@ Submitted-by: John Crispin <john at phrozen.org>
 
 --- a/drivers/net/phy/phylink.c
 +++ b/drivers/net/phy/phylink.c
-@@ -1944,6 +1944,11 @@ int phylink_ethtool_ksettings_set(struct
+@@ -1943,6 +1943,11 @@ int phylink_ethtool_ksettings_set(struct
  		 *   the presence of a PHY, this should not be changed as that
  		 *   should be determined from the media side advertisement.
  		 */
@@ -33,7 +33,7 @@ Submitted-by: John Crispin <john at phrozen.org>
  		return phy_ethtool_ksettings_set(pl->phydev, kset);
  	}
  
-@@ -2247,8 +2252,11 @@ int phylink_ethtool_get_eee(struct phyli
+@@ -2246,8 +2251,11 @@ int phylink_ethtool_get_eee(struct phyli
  
  	ASSERT_RTNL();
  
@@ -46,7 +46,7 @@ Submitted-by: John Crispin <john at phrozen.org>
  
  	return ret;
  }
-@@ -2265,8 +2273,11 @@ int phylink_ethtool_set_eee(struct phyli
+@@ -2264,8 +2272,11 @@ int phylink_ethtool_set_eee(struct phyli
  
  	ASSERT_RTNL();
  



From lede-commits at lists.infradead.org  Sat Feb 18 06:49:48 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 09:49:48 -0500
Subject: [openwrt/openwrt]  mediatek: add support for Netgear WAX206
In-Reply-To: <167673178798.206616.14861265741870952062@git-01.infra.openwrt.org>
References: <167673178798.206616.14861265741870952062@git-01.infra.openwrt.org>
Message-ID: <mailman.17095.1676731796.3064139.lede-commits@lists.infradead.org>

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

commit f6d2a23cbca61611663efb531c97efeded26e0cd
Author: Marcel Ziswiler <marcel at ziswiler.com>
AuthorDate: Thu Sep 29 22:40:31 2022 +0200

    mediatek: add support for Netgear WAX206
    
    Specifications:
    * SoC: MediaTek MT7622BV
    * RAM: DDR3 512 MiB (Nanya NT5CC256M16ER-EK)
    * Flash: SPI-NAND 256 MiB (Toshiba TC58CVG1S3HRAIJ)
    * Wi-Fi 2.4/5 GHz 4T4R:
      * 2.4 GHz: MediaTek MT7622BV
      * 5 GHz: MediaTek MT7915AN/MT7975AN
    * Ethernet: 4x 10/100/1000 Mbps LAN,
                1x 10/100/1000/2500 Mbps WAN (Realtek RTL8221B PHY)
    * Switch: MediaTek MT7531AE
    * LEDs/Keys: 8/1 (Power, Internet, LAN1, LAN2, LAN3, LAN4,
                 Wifin and Wifia dual-colour LEDs + Reset pin)
    * UART: Marked J19 on board VCC GND TX RX, beginning from "1". 3.3v,
            115200n8
    * Power: 12 VDC, 2.5 A
    
    Installation:
    * Flash the factory image through the stock web interface, or TFTP to
      the bootloader. NMRP can be used to TFTP without opening the case.
    * U-Boot allows booting an initramfs image via TFTP as follows:
      setenv ipaddr 192.168.1.1
      setenv serverip 192.168.1.100
      tftpboot openwrt-mediatek-mt7622-netgear_wax206-initramfs-recovery.itb
      bootm
    
    Known Limitations:
    * The 2.5G WAN port labeled 'wan' only works for speeds up to 1G at the
      moment. If connected to a multi-gig port the speed has to be manually
      set to 1G/full either for the switch port or in OpenWrt. For example
      add the following to /etc/rc.local to set it on boot:
      /usr/sbin/ethtool -s wan speed 1000 duplex full
    
    Revert to stock firmware:
    * Flash the stock firmware to the bootloader using TFTP/NMRP.
    
    References to WAX206 GPL source:
    https://www.downloads.netgear.com/files/GPL/WAX206_V1.0.4.0_Source.rar
    
    * openwrt/target/linux/mediatek/dts/mt7622-netgear-wax206.dts
      DTS file for this device.
    * openwrt/target/linux/mediatek/image/mt7622.mk
      Image creation code for this device
    
    Signed-off-by: Marcel Ziswiler <marcel at ziswiler.com>
    [fix WAN port (1G only), adjust partition layout, adjust image creation]
    Signed-off-by: Thomas Kupper <thomas.kupper at gmail.com>
---
 .../linux/mediatek/dts/mt7622-netgear-wax206.dts   | 559 +++++++++++++++++++++
 target/linux/mediatek/image/mt7622.mk              |  27 +
 .../mediatek/mt7622/base-files/etc/board.d/01_leds |   3 +-
 .../mt7622/base-files/etc/board.d/02_network       |   1 +
 .../mt7622/base-files/lib/upgrade/platform.sh      |   2 +
 5 files changed, 591 insertions(+), 1 deletion(-)

diff --git a/target/linux/mediatek/dts/mt7622-netgear-wax206.dts b/target/linux/mediatek/dts/mt7622-netgear-wax206.dts
new file mode 100644
index 0000000000..181abb915c
--- /dev/null
+++ b/target/linux/mediatek/dts/mt7622-netgear-wax206.dts
@@ -0,0 +1,559 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/* Copyright (c) 2022, Marcel Ziswiler <marcel at ziswiler.com> */
+
+/dts-v1/;
+#include "mt7622.dtsi"
+#include "mt6380.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	model = "Netgear WAX206";
+	compatible = "netgear,wax206", "mediatek,mt7622";
+
+	aliases {
+		ethernet0 = &gmac0;
+		led-boot = &led_power_r;
+		led-failsafe = &led_power_r;
+		led-running = &led_power_g;
+		led-upgrade = &led_power_g;
+		serial0 = &uart0;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n8 swiotlb=512";
+	};
+
+	cpus {
+		cpu at 0 {
+			proc-supply = <&mt6380_vcpu_reg>;
+			sram-supply = <&mt6380_vm_reg>;
+		};
+
+		cpu at 1 {
+			proc-supply = <&mt6380_vcpu_reg>;
+			sram-supply = <&mt6380_vm_reg>;
+		};
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		reset {
+			gpios = <&pio 0 GPIO_ACTIVE_LOW>;
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+		};
+
+		wps {
+			gpios = <&pio 102 GPIO_ACTIVE_LOW>;
+			label = "wps";
+			linux,code = <KEY_WPS_BUTTON>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		led_power_r: power_red {
+			default-state = "on";
+			gpios = <&pio 3 GPIO_ACTIVE_LOW>;
+			label = "power:red";
+		};
+
+		led_power_g: power_green {
+			default-state = "off";
+			gpios = <&pio 4 GPIO_ACTIVE_LOW>;
+			label = "power:green";
+		};
+
+		inet_green {
+			default-state = "off";
+			gpios = <&pio 20 GPIO_ACTIVE_HIGH>;
+			label = "inet:green";
+		};
+
+		inet_blue {
+			default-state = "off";
+			gpios = <&pio 17 GPIO_ACTIVE_LOW>;
+			label = "inet:blue";
+		};
+
+		wifin_green {
+			default-state = "off";
+			gpios = <&pio 85 GPIO_ACTIVE_LOW>;
+			label = "wifin:green";
+		};
+
+		wifin_blue {
+			default-state = "off";
+			gpios = <&pio 86 GPIO_ACTIVE_LOW>;
+			label = "wifin:blue";
+		};
+
+		wifia_green {
+			default-state = "off";
+			gpios = <&pio 2 GPIO_ACTIVE_HIGH>;
+			label = "wifia:green";
+		};
+
+		wifia_blue {
+			default-state = "off";
+			gpios = <&pio 1 GPIO_ACTIVE_LOW>;
+			label = "wifia:blue";
+		};
+	};
+
+	memory {
+		reg = <0 0x40000000 0 0x40000000>;
+	};
+};
+
+&bch {
+	status = "okay";
+};
+
+&btif {
+	status = "okay";
+};
+
+&cir {
+	pinctrl-names = "default";
+	pinctrl-0 = <&irrx_pins>;
+	status = "okay";
+};
+
+&eth {
+	pinctrl-names = "default";
+	pinctrl-0 = <&eth_pins>;
+	status = "okay";
+
+	gmac0: mac at 0 {
+		compatible = "mediatek,eth-mac";
+		nvmem-cells = <&macaddr_factory_7fff4>;
+		nvmem-cell-names = "mac-address";
+		phy-mode = "2500base-x";
+		reg = <0>;
+
+		fixed-link {
+			full-duplex;
+			pause;
+			speed = <2500>;
+		};
+	};
+
+	mdio-bus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		switch at 0 {
+			compatible = "mediatek,mt7531";
+			#interrupt-cells = <1>;
+			interrupt-controller;
+			interrupt-parent = <&pio>;
+			interrupts = <53 IRQ_TYPE_LEVEL_HIGH>;
+			reg = <0>;
+			reset-gpios = <&pio 54 GPIO_ACTIVE_HIGH>;
+
+			ports {
+				#address-cells = <1>;
+				#size-cells = <0>;
+
+				port at 1 {
+					label = "lan1";
+					reg = <1>;
+				};
+
+				port at 2 {
+					label = "lan2";
+					reg = <2>;
+				};
+
+				port at 3 {
+					label = "lan3";
+					reg = <3>;
+				};
+
+				port at 4 {
+					label = "lan4";
+					reg = <4>;
+				};
+
+				wan: port at 5 {
+					label = "wan";
+					nvmem-cells = <&macaddr_factory_7fffa>;
+					nvmem-cell-names = "mac-address";
+					phy-handle = <&rtl8221b_phy>;
+					phy-mode = "sgmii";
+					reg = <5>;
+				};
+
+				port at 6 {
+					ethernet = <&gmac0>;
+					label = "cpu";
+					phy-mode = "2500base-x";
+					reg = <6>;
+
+					fixed-link {
+						full-duplex;
+						pause;
+						speed = <2500>;
+					};
+				};
+			};
+		};
+
+		rtl8221b_phy: ethernet-phy at 7 {
+			compatible = "ethernet-phy-id001c.c849";
+			reg = <7>;
+			reset-gpios = <&pio 101 GPIO_ACTIVE_LOW>;
+			interrupts = <52 IRQ_TYPE_LEVEL_HIGH>;
+			reset-assert-us = <100000>;
+			reset-deassert-us = <100000>;
+		};
+	};
+};
+
+&pcie0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pcie0_pins>;
+	status = "okay";
+};
+
+&pcie1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pcie1_pins>;
+	status = "okay";
+};
+
+&pio {
+	eth_pins: eth-pins {
+		mux {
+			function = "eth";
+			groups = "mdc_mdio", "rgmii_via_gmac2";
+		};
+	};
+
+	irrx_pins: irrx-pins {
+		mux {
+			function = "ir";
+			groups =  "ir_1_rx";
+		};
+	};
+
+	irtx_pins: irtx-pins {
+		mux {
+			function = "ir";
+			groups =  "ir_1_tx";
+		};
+	};
+
+	pcie0_pins: pcie0-pins {
+		mux {
+			function = "pcie";
+			groups = "pcie0_pad_perst",
+				 "pcie0_1_waken",
+				 "pcie0_1_clkreq";
+		};
+	};
+
+	pcie1_pins: pcie1-pins {
+		mux {
+			function = "pcie";
+			groups = "pcie1_pad_perst",
+				 "pcie1_0_waken",
+				 "pcie1_0_clkreq";
+		};
+	};
+
+	pmic_bus_pins: pmic-bus-pins {
+		mux {
+			function = "pmic";
+			groups = "pmic_bus";
+		};
+	};
+
+	pwm7_pins: pwm1-2-pins {
+		mux {
+			function = "pwm";
+			groups = "pwm_ch7_2";
+		};
+	};
+
+	wled_pins: wled-pins {
+		mux {
+			function = "led";
+			groups = "wled";
+		};
+	};
+
+	/* Serial NAND is shared pin with SPI-NOR */
+	serial_nand_pins: serial-nand-pins {
+		mux {
+			function = "flash";
+			groups = "snfi";
+		};
+	};
+
+	spic0_pins: spic0-pins {
+		mux {
+			function = "spi";
+			groups = "spic0_0";
+		};
+	};
+
+	spic1_pins: spic1-pins {
+		mux {
+			function = "spi";
+			groups = "spic1_0";
+		};
+	};
+
+	uart0_pins: uart0-pins {
+		mux {
+			function = "uart";
+			groups = "uart0_0_tx_rx";
+		};
+	};
+
+	uart2_pins: uart2-pins {
+		mux {
+			function = "uart";
+			groups = "uart2_1_tx_rx";
+		};
+	};
+
+	watchdog_pins: watchdog-pins {
+		mux {
+			function = "watchdog";
+			groups = "watchdog";
+		};
+	};
+};
+
+&pwm {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pwm7_pins>;
+	status = "okay";
+};
+
+&pwrap {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pmic_bus_pins>;
+	status = "okay";
+};
+
+&rtc {
+	status = "disabled";
+};
+
+&sata {
+	status = "disabled";
+};
+
+&sata_phy {
+	status = "disabled";
+};
+
+&slot0 {
+	wmac1: mt7915 at 0,0 {
+		reg = <0x0000 0 0 0 0>;
+		ieee80211-freq-limit = <5000000 6000000>;
+	};
+};
+
+&snfi {
+	pinctrl-names = "default";
+	pinctrl-0 = <&serial_nand_pins>;
+	status = "okay";
+
+	snand: flash at 0 {
+		compatible = "spi-nand";
+		mediatek,bmt-table-size = <0x1000>;
+		mediatek,bmt-v2;
+		nand-ecc-engine = <&snfi>;
+		reg = <0>;
+		spi-rx-bus-width = <4>;
+		spi-tx-bus-width = <4>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "Preloader";
+				reg = <0x00000 0x0080000>;
+				read-only;
+			};
+
+			partition at 80000 {
+				label = "ATF";
+				reg = <0x80000 0x0040000>;
+				read-only;
+			};
+
+			partition at c0000 {
+				label = "Bootloader";
+				reg = <0xc0000 0x0080000>;
+				read-only;
+			};
+
+			partition at 140000 {
+				label = "Config";
+				reg = <0x140000 0x0080000>;
+			};
+
+			factory: partition at 1c0000 {
+				compatible = "nvmem-cells";
+				label = "Factory";
+				reg = <0x1c0000 0x0100000>;
+				#address-cells = <1>;
+				#size-cells = <1>;
+				read-only;
+
+				macaddr_factory_7fff4: macaddr at 7fff4 {
+					reg = <0x7fff4 0x6>;
+				};
+
+				macaddr_factory_7fffa: macaddr at 7fffa {
+					reg = <0x7fffa 0x6>;
+				};
+			};
+
+			partition at 2c0000 {
+				label = "firmware";
+				reg = <0x2c0000 0x2600000>;
+
+				compatible = "fixed-partitions";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				partition at 0 {
+					label = "kernel";
+					reg = <0x0 0x600000>;
+				};
+
+				partition at 600000 {
+					label = "ubi";
+					reg = <0x600000 0x2000000>;
+				};
+			};
+
+			partition at 28c0000 {
+				label = "firmware_backup";
+				reg = <0x28c0000 0x2600000>;
+				read-only;
+			};
+
+			partition at 4ec0000 {
+				label = "CFG";
+				reg = <0x4ec0000 0x800000>;
+				read-only;
+			};
+
+			partition at 56c0000 {
+				label = "RAE";
+				reg = <0x56c0000 0x400000>;
+				read-only;
+			};
+
+			partition at 5ac0000 {
+				label = "POT";
+				reg = <0x5ac0000 0x100000>;
+				read-only;
+			};
+
+			partition at 5bc0000 {
+				label = "Language";
+				reg = <0x5bc0000 0x400000>;
+				read-only;
+			};
+
+			partition at 5fc0000 {
+				label = "Traffic";
+				reg = <0x5fc0000 0x200000>;
+				read-only;
+			};
+
+			partition at 61c0000 {
+				label = "Cert";
+				reg = <0x61c0000 0x100000>;
+				read-only;
+			};
+
+			partition at 62c0000 {
+				label = "NTGRcryptK";
+				reg = <0x62c0000 0x100000>;
+				read-only;
+			};
+
+			partition at 63c0000 {
+				label = "NTGRcryptD";
+				reg = <0x63c0000 0x500000>;
+				read-only;
+			};
+
+			partition at 68c0000 {
+				label = "LOG";
+				reg = <0x68c0000 0x100000>;
+				read-only;
+			};
+
+			partition at 69c0000 {
+				label = "User_data";
+				reg = <0x69c0000 0x640000>;
+				read-only;
+			};
+
+		};
+	};
+};
+
+&spi0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spic0_pins>;
+	status = "okay";
+};
+
+&spi1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spic1_pins>;
+	status = "okay";
+};
+
+&ssusb {
+	status = "disabled";
+};
+
+&u3phy {
+	status = "disabled";
+};
+
+&uart0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart0_pins>;
+	status = "okay";
+};
+
+&uart2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart2_pins>;
+	status = "okay";
+};
+
+&watchdog {
+	pinctrl-names = "default";
+	pinctrl-0 = <&watchdog_pins>;
+	status = "okay";
+};
+
+&wmac {
+	mediatek,mtd-eeprom = <&factory 0x0000>;
+	status = "okay";
+};
+
+&wmac1 {
+	mediatek,mtd-eeprom = <&factory 0x05000>;
+};
diff --git a/target/linux/mediatek/image/mt7622.mk b/target/linux/mediatek/image/mt7622.mk
index 097ddd6bfd..ee71cf8764 100644
--- a/target/linux/mediatek/image/mt7622.mk
+++ b/target/linux/mediatek/image/mt7622.mk
@@ -228,6 +228,33 @@ define Device/mediatek_mt7622-rfb1-ubi
 endef
 TARGET_DEVICES += mediatek_mt7622-rfb1-ubi
 
+define Device/netgear_wax206
+  $(Device/dsa-migration)
+  DEVICE_VENDOR := NETGEAR
+  DEVICE_MODEL := WAX206
+  DEVICE_DTS := mt7622-netgear-wax206
+  DEVICE_DTS_DIR := ../dts
+  NETGEAR_ENC_MODEL := WAX206
+  NETGEAR_ENC_REGION := US
+  DEVICE_PACKAGES := kmod-mt7915-firmware
+  UBINIZE_OPTS := -E 5
+  BLOCKSIZE := 128k
+  PAGESIZE := 2048
+  KERNEL_SIZE := 6144k
+  IMAGE_SIZE := 32768k
+  KERNEL := kernel-bin | lzma | fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb | \
+	append-squashfs4-fakeroot
+# recovery can also be used with stock firmware web-ui, hence the padding...
+  KERNEL_INITRAMFS := kernel-bin | lzma | \
+	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 128k
+  KERNEL_INITRAMFS_SUFFIX := -recovery.itb
+  IMAGES += factory.img
+  IMAGE/factory.img := append-kernel | pad-to $$(KERNEL_SIZE) | \
+	append-ubi | check-size | netgear-encrypted-factory
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+endef
+TARGET_DEVICES += netgear_wax206
+
 define Device/ruijie_rg-ew3200gx-pro
   DEVICE_VENDOR := Ruijie
   DEVICE_MODEL := RG-EW3200GX PRO
diff --git a/target/linux/mediatek/mt7622/base-files/etc/board.d/01_leds b/target/linux/mediatek/mt7622/base-files/etc/board.d/01_leds
index 5c32918d35..7cb54186fd 100644
--- a/target/linux/mediatek/mt7622/base-files/etc/board.d/01_leds
+++ b/target/linux/mediatek/mt7622/base-files/etc/board.d/01_leds
@@ -7,7 +7,8 @@ board_config_update
 
 case $board in
 linksys,e8450|\
-linksys,e8450-ubi)
+linksys,e8450-ubi|\
+netgear,wax206)
 	ucidef_set_led_netdev "wan" "WAN" "inet:blue" "wan"
 	;;
 xiaomi,redmi-router-ax6s)
diff --git a/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network b/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network
index 5312bf5c56..38db921f5c 100644
--- a/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network
+++ b/target/linux/mediatek/mt7622/base-files/etc/board.d/02_network
@@ -14,6 +14,7 @@ mediatek_setup_interfaces()
 	linksys,e8450-ubi|\
 	mediatek,mt7622-rfb1|\
 	mediatek,mt7622-rfb1-ubi|\
+	netgear,wax206|\
 	reyee,ax3200-e5|\
 	ruijie,rg-ew3200gx-pro)
 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" wan
diff --git a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh
index e3c66a3b01..b37b7b1c6e 100755
--- a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh
@@ -35,6 +35,7 @@ platform_do_upgrade() {
 		;;
 	elecom,wrc-x3200gst3|\
 	mediatek,mt7622-rfb1-ubi|\
+	netgear,wax206|\
 	totolink,a8000ru|\
 	xiaomi,redmi-router-ax6s)
 		nand_do_upgrade "$1"
@@ -71,6 +72,7 @@ platform_check_image() {
 		;;
 	elecom,wrc-x3200gst3|\
 	mediatek,mt7622-rfb1-ubi|\
+	netgear,wax206|\
 	totolink,a8000ru|\
 	xiaomi,redmi-router-ax6s)
 		nand_do_platform_check "$board" "$1"



From lede-commits at lists.infradead.org  Sat Feb 18 06:59:19 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 09:59:19 -0500
Subject: [openwrt/openwrt]  sunxi: fix wifi connection for Banana Pi M2 Berry
In-Reply-To: <167673235905.211111.1182320612303935298@git-01.infra.openwrt.org>
References: <167673235905.211111.1182320612303935298@git-01.infra.openwrt.org>
Message-ID: <mailman.17096.1676732363.3064139.lede-commits@lists.infradead.org>

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

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

    sunxi: fix wifi connection for Banana Pi M2 Berry
    
    fixes the problem that the banana pi m2 berry cannot connect to wifi and cannot be used as an access point
    
    Signed-off-by: Josef Schlehofer <pepe.schlehofer at gmail.com>
    (cherry picked from commit ff2bb16730f629d54bde8ba85c75d8614741e3fd)
    Signed-off-by: LizenzFass78851 <82592556+LizenzFass78851 at users.noreply.github.com>
---
 target/linux/sunxi/image/cortexa7.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/sunxi/image/cortexa7.mk b/target/linux/sunxi/image/cortexa7.mk
index f90fae9acf..59f11bc83c 100644
--- a/target/linux/sunxi/image/cortexa7.mk
+++ b/target/linux/sunxi/image/cortexa7.mk
@@ -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  Sat Feb 18 07:04:00 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 10:04:00 -0500
Subject: [openwrt/openwrt]  ramips: fix the name of ASUS AX54 because it has
 dupilcated twice
In-Reply-To: <167673264084.213784.6780091272227389134@git-01.infra.openwrt.org>
References: <167673264084.213784.6780091272227389134@git-01.infra.openwrt.org>
Message-ID: <mailman.17097.1676732644.3064139.lede-commits@lists.infradead.org>

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

commit 8ef81b4a19a38e9f545dc8e50fff7cc114b48e1a
Author: Karl Chan <exkc at exkc.moe>
AuthorDate: Thu Feb 16 18:36:25 2023 +0800

    ramips: fix the name of ASUS AX54 because it has dupilcated twice
    
    The name of ASUS AX54 has dupilcated in the DEVICE_ALT0_VENDOR/DEVICE_ALT0_MODEL
    
    Signed-off-by: Karl Chan <exkc at exkc.moe>
---
 target/linux/ramips/image/mt7621.mk | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index e212ceabf3..d53f9a27aa 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -343,13 +343,11 @@ define Device/asus_rt-ax54
   DEVICE_VENDOR := ASUS
   DEVICE_MODEL := RT-AX54
   DEVICE_ALT0_VENDOR := ASUS
-  DEVICE_ALT0_MODEL := RT-AX54
+  DEVICE_ALT0_MODEL := RT-AX54HP
   DEVICE_ALT1_VENDOR := ASUS
-  DEVICE_ALT1_MODEL := RT-AX54HP
+  DEVICE_ALT1_MODEL := RT-AX1800HP
   DEVICE_ALT2_VENDOR := ASUS
-  DEVICE_ALT2_MODEL := RT-AX1800HP
-  DEVICE_ALT3_VENDOR := ASUS
-  DEVICE_ALT3_MODEL := RT-AX1800S
+  DEVICE_ALT2_MODEL := RT-AX1800S
   IMAGE_SIZE := 51200k
   UBINIZE_OPTS := -E 5
   BLOCKSIZE := 128k



From lede-commits at lists.infradead.org  Sat Feb 18 07:17:30 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 10:17:30 -0500
Subject: [openwrt/openwrt]  openssl: bump to 1.1.1t
In-Reply-To: <167673345087.225833.14713578353247092874@git-01.infra.openwrt.org>
References: <167673345087.225833.14713578353247092874@git-01.infra.openwrt.org>
Message-ID: <mailman.17098.1676733456.3064139.lede-commits@lists.infradead.org>

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

commit dbbf5c2a1d98b870ec9971657f7cb4b6c5bf7033
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Tue Feb 7 14:56:52 2023 -0500

    openssl: bump to 1.1.1t
    
    Changes between 1.1.1s and 1.1.1t [7 Feb 2023]
    
      *) Fixed X.400 address type confusion in X.509 GeneralName.
    
         There is a type confusion vulnerability relating to X.400 address processing
         inside an X.509 GeneralName. X.400 addresses were parsed as an ASN1_STRING
         but subsequently interpreted by GENERAL_NAME_cmp as an ASN1_TYPE. This
         vulnerability may allow an attacker who can provide a certificate chain and
         CRL (neither of which need have a valid signature) to pass arbitrary
         pointers to a memcmp call, creating a possible read primitive, subject to
         some constraints. Refer to the advisory for more information. Thanks to
         David Benjamin for discovering this issue. (CVE-2023-0286)
    
         This issue has been fixed by changing the public header file definition of
         GENERAL_NAME so that x400Address reflects the implementation. It was not
         possible for any existing application to successfully use the existing
         definition; however, if any application references the x400Address field
         (e.g. in dead code), note that the type of this field has changed. There is
         no ABI change.
         [Hugo Landau]
    
      *) Fixed Use-after-free following BIO_new_NDEF.
    
         The public API function BIO_new_NDEF is a helper function used for
         streaming ASN.1 data via a BIO. It is primarily used internally to OpenSSL
         to support the SMIME, CMS and PKCS7 streaming capabilities, but may also
         be called directly by end user applications.
    
         The function receives a BIO from the caller, prepends a new BIO_f_asn1
         filter BIO onto the front of it to form a BIO chain, and then returns
         the new head of the BIO chain to the caller. Under certain conditions,
         for example if a CMS recipient public key is invalid, the new filter BIO
         is freed and the function returns a NULL result indicating a failure.
         However, in this case, the BIO chain is not properly cleaned up and the
         BIO passed by the caller still retains internal pointers to the previously
         freed filter BIO. If the caller then goes on to call BIO_pop() on the BIO
         then a use-after-free will occur. This will most likely result in a crash.
         (CVE-2023-0215)
         [Viktor Dukhovni, Matt Caswell]
    
      *) Fixed Double free after calling PEM_read_bio_ex.
    
         The function PEM_read_bio_ex() reads a PEM file from a BIO and parses and
         decodes the "name" (e.g. "CERTIFICATE"), any header data and the payload
         data. If the function succeeds then the "name_out", "header" and "data"
         arguments are populated with pointers to buffers containing the relevant
         decoded data. The caller is responsible for freeing those buffers. It is
         possible to construct a PEM file that results in 0 bytes of payload data.
         In this case PEM_read_bio_ex() will return a failure code but will populate
         the header argument with a pointer to a buffer that has already been freed.
         If the caller also frees this buffer then a double free will occur. This
         will most likely lead to a crash.
    
         The functions PEM_read_bio() and PEM_read() are simple wrappers around
         PEM_read_bio_ex() and therefore these functions are also directly affected.
    
         These functions are also called indirectly by a number of other OpenSSL
         functions including PEM_X509_INFO_read_bio_ex() and
         SSL_CTX_use_serverinfo_file() which are also vulnerable. Some OpenSSL
         internal uses of these functions are not vulnerable because the caller does
         not free the header argument if PEM_read_bio_ex() returns a failure code.
         (CVE-2022-4450)
         [Kurt Roeckx, Matt Caswell]
    
      *) Fixed Timing Oracle in RSA Decryption.
    
         A timing based side channel exists in the OpenSSL RSA Decryption
         implementation which could be sufficient to recover a plaintext across
         a network in a Bleichenbacher style attack. To achieve a successful
         decryption an attacker would have to be able to send a very large number
         of trial messages for decryption. The vulnerability affects all RSA padding
         modes: PKCS#1 v1.5, RSA-OEAP and RSASVE.
         (CVE-2022-4304)
         [Dmitry Belyavsky, Hubert Kario]
    
    Signed-off-by: John Audia <therealgraysky at proton.me>
    (cherry picked from commit 4ae86b3358a149a17411657b12103ccebfbdb11b)
    
    The original commit removed the upstreamed patch 010-padlock.patch, but
    it's not on OpenWrt 21.02, so it doesn't have to be removed.
    
    Signed-off-by: Michal Vasilek <michal.vasilek at nic.cz>
---
 package/libs/openssl/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index 04b00e2bf5..aa3dbb7877 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssl
 PKG_BASE:=1.1.1
-PKG_BUGFIX:=s
+PKG_BUGFIX:=t
 PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX)
 PKG_RELEASE:=1
 PKG_USE_MIPS16:=0
@@ -26,7 +26,7 @@ PKG_SOURCE_URL:= \
 	ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/ \
 	ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/old/$(PKG_BASE)/
 
-PKG_HASH:=c5ac01e760ee6ff0dab61d6b2bbd30146724d063eb322180c6f18a6f74e4b6aa
+PKG_HASH:=8dee9b24bdb1dcbf0c3d1e9b02fb8f6bf22165e807f45adeb7c9677536859d3b
 
 PKG_LICENSE:=OpenSSL
 PKG_LICENSE_FILES:=LICENSE



From lede-commits at lists.infradead.org  Sat Feb 18 07:22:25 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 10:22:25 -0500
Subject: [openwrt/openwrt]  openssl: bump to 1.1.1t
In-Reply-To: <167673374511.227729.11876903638400510189@git-01.infra.openwrt.org>
References: <167673374511.227729.11876903638400510189@git-01.infra.openwrt.org>
Message-ID: <mailman.17101.1676733749.3064139.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/3167f7c9fac9576b9d39672e3b786ea1ba0cbc87

commit 3167f7c9fac9576b9d39672e3b786ea1ba0cbc87
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Tue Feb 7 14:56:52 2023 -0500

    openssl: bump to 1.1.1t
    
    Changes between 1.1.1s and 1.1.1t [7 Feb 2023]
    
      *) Fixed X.400 address type confusion in X.509 GeneralName.
    
         There is a type confusion vulnerability relating to X.400 address processing
         inside an X.509 GeneralName. X.400 addresses were parsed as an ASN1_STRING
         but subsequently interpreted by GENERAL_NAME_cmp as an ASN1_TYPE. This
         vulnerability may allow an attacker who can provide a certificate chain and
         CRL (neither of which need have a valid signature) to pass arbitrary
         pointers to a memcmp call, creating a possible read primitive, subject to
         some constraints. Refer to the advisory for more information. Thanks to
         David Benjamin for discovering this issue. (CVE-2023-0286)
    
         This issue has been fixed by changing the public header file definition of
         GENERAL_NAME so that x400Address reflects the implementation. It was not
         possible for any existing application to successfully use the existing
         definition; however, if any application references the x400Address field
         (e.g. in dead code), note that the type of this field has changed. There is
         no ABI change.
         [Hugo Landau]
    
      *) Fixed Use-after-free following BIO_new_NDEF.
    
         The public API function BIO_new_NDEF is a helper function used for
         streaming ASN.1 data via a BIO. It is primarily used internally to OpenSSL
         to support the SMIME, CMS and PKCS7 streaming capabilities, but may also
         be called directly by end user applications.
    
         The function receives a BIO from the caller, prepends a new BIO_f_asn1
         filter BIO onto the front of it to form a BIO chain, and then returns
         the new head of the BIO chain to the caller. Under certain conditions,
         for example if a CMS recipient public key is invalid, the new filter BIO
         is freed and the function returns a NULL result indicating a failure.
         However, in this case, the BIO chain is not properly cleaned up and the
         BIO passed by the caller still retains internal pointers to the previously
         freed filter BIO. If the caller then goes on to call BIO_pop() on the BIO
         then a use-after-free will occur. This will most likely result in a crash.
         (CVE-2023-0215)
         [Viktor Dukhovni, Matt Caswell]
    
      *) Fixed Double free after calling PEM_read_bio_ex.
    
         The function PEM_read_bio_ex() reads a PEM file from a BIO and parses and
         decodes the "name" (e.g. "CERTIFICATE"), any header data and the payload
         data. If the function succeeds then the "name_out", "header" and "data"
         arguments are populated with pointers to buffers containing the relevant
         decoded data. The caller is responsible for freeing those buffers. It is
         possible to construct a PEM file that results in 0 bytes of payload data.
         In this case PEM_read_bio_ex() will return a failure code but will populate
         the header argument with a pointer to a buffer that has already been freed.
         If the caller also frees this buffer then a double free will occur. This
         will most likely lead to a crash.
    
         The functions PEM_read_bio() and PEM_read() are simple wrappers around
         PEM_read_bio_ex() and therefore these functions are also directly affected.
    
         These functions are also called indirectly by a number of other OpenSSL
         functions including PEM_X509_INFO_read_bio_ex() and
         SSL_CTX_use_serverinfo_file() which are also vulnerable. Some OpenSSL
         internal uses of these functions are not vulnerable because the caller does
         not free the header argument if PEM_read_bio_ex() returns a failure code.
         (CVE-2022-4450)
         [Kurt Roeckx, Matt Caswell]
    
      *) Fixed Timing Oracle in RSA Decryption.
    
         A timing based side channel exists in the OpenSSL RSA Decryption
         implementation which could be sufficient to recover a plaintext across
         a network in a Bleichenbacher style attack. To achieve a successful
         decryption an attacker would have to be able to send a very large number
         of trial messages for decryption. The vulnerability affects all RSA padding
         modes: PKCS#1 v1.5, RSA-OEAP and RSASVE.
         (CVE-2022-4304)
         [Dmitry Belyavsky, Hubert Kario]
    
    Signed-off-by: John Audia <therealgraysky at proton.me>
    (cherry picked from commit 4ae86b3358a149a17411657b12103ccebfbdb11b)
    
    The original commit removed the upstreamed patch 010-padlock.patch, but
    it's not on OpenWrt 22.03, so it doesn't have to be removed.
    
    Signed-off-by: Michal Vasilek <michal.vasilek at nic.cz>
---
 package/libs/openssl/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index 0f6d3236dc..f27e86b3a1 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssl
 PKG_BASE:=1.1.1
-PKG_BUGFIX:=s
+PKG_BUGFIX:=t
 PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX)
 PKG_RELEASE:=1
 PKG_USE_MIPS16:=0
@@ -25,7 +25,7 @@ PKG_SOURCE_URL:= \
 	ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/ \
 	ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/old/$(PKG_BASE)/
 
-PKG_HASH:=c5ac01e760ee6ff0dab61d6b2bbd30146724d063eb322180c6f18a6f74e4b6aa
+PKG_HASH:=8dee9b24bdb1dcbf0c3d1e9b02fb8f6bf22165e807f45adeb7c9677536859d3b
 
 PKG_LICENSE:=OpenSSL
 PKG_LICENSE_FILES:=LICENSE



From lede-commits at lists.infradead.org  Sat Feb 18 07:25:08 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 10:25:08 -0500
Subject: [openwrt/openwrt]  ipq807x: Add bluetooth driver to zyxel nbg7815
In-Reply-To: <167673390838.229870.5901251959218746481@git-01.infra.openwrt.org>
References: <167673390838.229870.5901251959218746481@git-01.infra.openwrt.org>
Message-ID: <mailman.17102.1676733912.3064139.lede-commits@lists.infradead.org>

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

commit 71a22ef17563fd2e55f68c0b93be4a4ec1b00a48
Author: Karol Przybylski <karol.przybylski at esm-technology.pl>
AuthorDate: Tue Feb 14 23:32:56 2023 +0100

    ipq807x: Add bluetooth driver to zyxel nbg7815
    
    Zyxel NBG7815 supports bluetooth with blsp1_uart3.
    Configuration are already added to dts file, device needs only module to working bluetooth properly.
    Tested at below posts:
    https://forum.openwrt.org/t/openwrt-support-for-armor-g5-nbg7815/98598/259?u=itork
    
    Reviewed-by: Robert Marko <robimarko at gmail.com>
    Signed-off-by: Karol Przybylski <karol.przybylski at esm-technology.pl>
---
 target/linux/ipq807x/image/generic.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/target/linux/ipq807x/image/generic.mk b/target/linux/ipq807x/image/generic.mk
index 38770a5f24..88d16cc7b2 100644
--- a/target/linux/ipq807x/image/generic.mk
+++ b/target/linux/ipq807x/image/generic.mk
@@ -141,6 +141,7 @@ define Device/zyxel_nbg7815
 	IMAGES += factory.bin sysupgrade.bin
 	IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k
 	IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | sysupgrade-tar rootfs=$$$$@ | append-metadata
-	DEVICE_PACKAGES := ipq-wifi-zyxel_nbg7815 kmod-ath11k-pci e2fsprogs kmod-fs-ext4 losetup kmod-hwmon-tmp103
+	DEVICE_PACKAGES := ipq-wifi-zyxel_nbg7815 kmod-ath11k-pci e2fsprogs kmod-fs-ext4 losetup \
+	kmod-hwmon-tmp103 kmod-bluetooth
 endef
 TARGET_DEVICES += zyxel_nbg7815



From lede-commits at lists.infradead.org  Sat Feb 18 07:28:47 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 10:28:47 -0500
Subject: [openwrt/openwrt]  wireless-regdb: update to 2023.02.13
In-Reply-To: <167673412705.232813.15743960676355164773@git-01.infra.openwrt.org>
References: <167673412705.232813.15743960676355164773@git-01.infra.openwrt.org>
Message-ID: <mailman.17103.1676734131.3064139.lede-commits@lists.infradead.org>

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

commit 1173edf23b3440137d60162d1ef9f48ffa13e3e2
Author: Yuu Toriyama <PascalCoffeeLake at gmail.com>
AuthorDate: Tue Feb 14 14:44:11 2023 +0900

    wireless-regdb: update to 2023.02.13
    
    Changes:
      7f7a9f7 wireless-regdb: update regulatory database based on preceding changes
      660a1ae wireless-regdb: Update regulatory info for Russia (RU) on 5GHz
      fe05cc9 wireless-regdb: Update regulatory rules for Japan (JP) on 6GHz
      d8584dc wireless-regdb: Update regulatory rules for Japan (JP) on 5GHz
      c04fd9b wireless-regdb: update regulatory rules for Switzerland (CH)
      f29772a wireless-regdb: Update regulatory rules for Brazil (BR)
    
    Signed-off-by: Yuu Toriyama <PascalCoffeeLake at gmail.com>
---
 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 73ea40133f..9b4a5c105f 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:=2022.08.12
+PKG_VERSION:=2023.02.13
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/software/network/wireless-regdb/
-PKG_HASH:=59c8f7d17966db71b27f90e735ee8f5b42ca3527694a8c5e6e9b56bd379c3b84
+PKG_HASH:=fe81e8a8694dc4753a45087a1c4c7e1b48dee5a59f5f796ce374ea550f0b2e73
 
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 



From lede-commits at lists.infradead.org  Sat Feb 18 07:57:17 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 10:57:17 -0500
Subject: [openwrt/openwrt]  ramips: add label MAC address for EPG600 and
 ESR600
In-Reply-To: <167673583512.253895.10954044838065662086@git-01.infra.openwrt.org>
References: <167673583512.253895.10954044838065662086@git-01.infra.openwrt.org>
Message-ID: <mailman.17110.1676735839.3064139.lede-commits@lists.infradead.org>

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

commit 6f6d24a00ad43d82a52580d2610a1fd90cedd60a
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Tue Apr 27 17:41:31 2021 -0400

    ramips: add label MAC address for EPG600 and ESR600
    
    set label mac for the current ESR600 and new EPG600
    using the board.d scripts
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 target/linux/ramips/mt7620/base-files/etc/board.d/02_network | 1 +
 1 file changed, 1 insertion(+)

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 a55a8ed356..992d8a9c40 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
@@ -337,6 +337,7 @@ ramips_setup_macs()
 	engenius,esr600)
 		lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
 		wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)
+		label_mac=$wan_mac
 		;;
 	glinet,gl-mt300a|\
 	glinet,gl-mt300n|\



From lede-commits at lists.infradead.org  Sat Feb 18 07:57:15 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 10:57:15 -0500
Subject: [openwrt/openwrt]  ramips: mt7620: split gsw hw_init to mac_init,
 ephy_init
In-Reply-To: <167673583512.253895.10954044838065662086@git-01.infra.openwrt.org>
References: <167673583512.253895.10954044838065662086@git-01.infra.openwrt.org>
Message-ID: <mailman.17111.1676735839.3064139.lede-commits@lists.infradead.org>

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

commit 6b07d0c077e8bf98ca7e49864774b864e581205a
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Wed Mar 16 23:02:42 2022 -0400

    ramips: mt7620: split gsw hw_init to mac_init, ephy_init
    
    in order for the option ephy-disable to work
    without also needing ephy-base option,
    we have to skip all the lines that write to mdio addresses that
    assume those addresses do not have an external switch.
    
    Otherwise, ephy ports will be disabled in hardware,
    but register writes still happen as if they are enabled.
    
    Split the functions so that other things are done first,
    and ephy port setup can be skipped with a simple "return".
    
    Tested on Engenius EPG600 (MT7620A ver:2 eco:3)
    with QCA8337 external switch
    
    Ref: cc6fd6fbb505 ("ramips: mt7620: add ephy-disable option to switch driver")
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 .../files/drivers/net/ethernet/ralink/gsw_mt7620.c | 40 +++++++++++++---------
 1 file changed, 24 insertions(+), 16 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 7c91e5840b..615544cb17 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,26 +61,20 @@ static irqreturn_t gsw_interrupt_mt7620(int irq, void *_priv)
 	return IRQ_HANDLED;
 }
 
-static void mt7620_hw_init(struct mt7620_gsw *gsw)
+static void mt7620_ephy_init(struct mt7620_gsw *gsw)
 {
 	u32 i;
 	u32 val;
 	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);
-
-	mtk_switch_w32(gsw, mtk_switch_r32(gsw, GSW_REG_CKGCR) & ~(0x3 << 4), GSW_REG_CKGCR);
-
-	/* 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_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");
+
+		return;
 	} else if (gsw->ephy_base) {
 		mtk_switch_w32(gsw, mtk_switch_r32(gsw, GSW_REG_GPC1) |
 			(gsw->ephy_base << 16),
@@ -158,12 +152,6 @@ static void mt7620_hw_init(struct mt7620_gsw *gsw)
 	_mt7620_mii_write(gsw, gsw->ephy_base + 2, 16, 0x1515);
 	_mt7620_mii_write(gsw, gsw->ephy_base + 3, 16, 0x0f0f);
 
-	/* CPU Port6 Force Link 1G, FC ON */
-	mtk_switch_w32(gsw, 0x5e33b, GSW_REG_PORT_PMCR(6));
-
-	/* Set Port 6 as CPU Port */
-	mtk_switch_w32(gsw, 0x7f7f7fe0, 0x0010);
-
 	/* setup port 4 */
 	if (gsw->port4_ephy) {
 		val = rt_sysc_r32(SYSC_REG_CFG1);
@@ -177,6 +165,24 @@ static void mt7620_hw_init(struct mt7620_gsw *gsw)
 	}
 }
 
+static void mt7620_mac_init(struct mt7620_gsw *gsw)
+{
+	/* Internal ethernet requires PCIe RC mode */
+	rt_sysc_w32(rt_sysc_r32(SYSC_REG_CFG1) | PCIE_RC_MODE, SYSC_REG_CFG1);
+
+	/* Keep Global Clocks on Idle traffic */
+	mtk_switch_w32(gsw, mtk_switch_r32(gsw, GSW_REG_CKGCR) & ~(0x3 << 4), GSW_REG_CKGCR);
+
+	/* Set Port 6 to Force Link 1G, Flow Control ON */
+	mtk_switch_w32(gsw, 0x5e33b, GSW_REG_PORT_PMCR(6));
+
+	/* Set Port 6 as CPU Port */
+	mtk_switch_w32(gsw, 0x7f7f7fe0, 0x0010);
+
+	/* Enable MIB stats */
+	mtk_switch_w32(gsw, mtk_switch_r32(gsw, GSW_REG_MIB_CNT_EN) | (1 << 1), GSW_REG_MIB_CNT_EN);
+}
+
 static const struct of_device_id mediatek_gsw_match[] = {
 	{ .compatible = "mediatek,mt7620-gsw" },
 	{},
@@ -222,7 +228,9 @@ int mtk_gsw_init(struct fe_priv *priv)
 	else
 		gsw->ephy_base = 0;
 
-	mt7620_hw_init(gsw);
+	mt7620_mac_init(gsw);
+
+	mt7620_ephy_init(gsw);
 
 	if (gsw->irq) {
 		request_irq(gsw->irq, gsw_interrupt_mt7620, 0,



From lede-commits at lists.infradead.org  Sat Feb 18 07:57:16 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 10:57:16 -0500
Subject: [openwrt/openwrt]  ramips: add support for Senao Engenius EPG600
In-Reply-To: <167673583512.253895.10954044838065662086@git-01.infra.openwrt.org>
References: <167673583512.253895.10954044838065662086@git-01.infra.openwrt.org>
Message-ID: <mailman.17112.1676735841.3064139.lede-commits@lists.infradead.org>

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

commit 4ef86c620f03b3b8b3220d11f77948e7a10469d8
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Mon Apr 19 15:45:32 2021 -0400

    ramips: add support for Senao Engenius EPG600
    
    FCC ID: A8J-EPG600
    
    Engenius EPG600 is an indoor wireless router with
    1 Gb ethernet switch, dual-band wireless,
    internal antenna plates, USB, and phone lines (not supported)
    
    this board is a Senao device:
    the hardware is equivalent to EnGenius ESR600 (except for phone lines)
    the software is Senao SDK which is based on openwrt and uboot
    which uses the legacy Senao header with Vendor / Product IDs
    to verify the firmware upgrade image.
    
    **Specification:**
    
      - MT7620 SOC          MIPS 24kec, 2.4 GHz WMAC, 2x2
      - RT5592N WLAN        PCI chip, 5 GHz, 2x2
      - QCA8337N Gb SW      RGMII GbE, SW P0 -- SOC P5, 5 LEDs
      - 40 MHz clock
      - 16 MB FLASH         MX25L12845EMI-10G
      - 64 MB RAM           NT5TU32M16
      - UART console        J2, populated
      - USB 2.0 port        direct to SOC
      - 6 GPIO LEDs         power, 2G, 5G, wps2g, wps5g, line
      - 3 buttons           reset, wps, "reg" (registeration)
      - 4 antennas          internal omni-directional plates
    
    NOT YET SUPPORTED: VoIP
    
      - Si3050-FT + Si3019-FT       Voice DAA, SPI control, PCM data
      - Phone Ports "TEL", "LINE"   RJ11, 4P2C (2 pins)
    
    **MAC addresses:**
    
      MAC address labeled as MAC ADDRESS
      MACs present in both wifi cal data and uboot environment
    
      eth0.1/phy1   ----    *:82    rf 0x4
      phy0          ----    *:83    factory 0x4
      eth0.2        MAC     *:b8    "wanaddr"
    
    **Installation:**
    
      Method 1: Firmware upgrade page:
    
        (if you cannot access the APs webpage)
        factory reset with the reset button
        connect ethernet to a computer
        OEM webpage at 192.168.0.1
        username and password 'admin'
    
        Navigate to gear icon, "Device Management", "Tools"
        select the factory.dlf image
        Upload and verify checksum
    
      Method 2: Serial to upload initramfs:
    
        Follow directions for TFTP recovery
        upload and boot initramfs and do a sysupgrade
    
    **TFTP recovery:**
    
      Requires UART serial console, reset button does nothing
    
      rename initramfs-kernel.bin to 'uImageEPG600'
      make available on TFTP server at 192.168.99.8
      power board, interrupt boot with "4"
      execute `tftpboot` and `bootm` (with the load address)
    
    **Return to OEM:**
    
      Images from OEM are provided, but not compatible
      with openwrt sysupgrade. So it must be modified.
    
      Alternatively, back up all mtd partitions before flashing
    
    **Note on switch registers:**
    
      The necessary registers needed for the QCA8337 switch
      can be read from interrupted boot (tftpboot, bootm)
      by using the following lines in the switch driver ar8327.c
      in the function 'ar8327_hw_config_of'
      where 'qca,ar8327-initvals' is parsed from DTS
      before the new register values are written:
    
        pr_info("0x04 %08x\n", ar8xxx_read(priv, AR8327_REG_PAD0_MODE));
        pr_info("0x08 %08x\n", ar8xxx_read(priv, AR8327_REG_PAD5_MODE));
        pr_info("0x0c %08x\n", ar8xxx_read(priv, AR8327_REG_PAD6_MODE));
        pr_info("0x10 %08x\n", ar8xxx_read(priv, AR8327_REG_POWER_ON_STRAP));
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 package/boot/uboot-envtools/files/ramips           |   1 +
 .../linux/ramips/dts/mt7620a_engenius_epg600.dts   | 228 +++++++++++++++++++++
 target/linux/ramips/image/mt7620.mk                |  15 ++
 .../mt7620/base-files/etc/board.d/02_network       |   2 +
 4 files changed, 246 insertions(+)

diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips
index 812bd18116..350330779c 100644
--- a/package/boot/uboot-envtools/files/ramips
+++ b/package/boot/uboot-envtools/files/ramips
@@ -17,6 +17,7 @@ alfa-network,awusfree1|\
 alfa-network,quad-e4g|\
 alfa-network,r36m-e4g|\
 alfa-network,tube-e4g|\
+engenius,epg600|\
 engenius,esr600h|\
 sitecom,wlr-4100-v1-002)
 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000"
diff --git a/target/linux/ramips/dts/mt7620a_engenius_epg600.dts b/target/linux/ramips/dts/mt7620a_engenius_epg600.dts
new file mode 100644
index 0000000000..311103f3e8
--- /dev/null
+++ b/target/linux/ramips/dts/mt7620a_engenius_epg600.dts
@@ -0,0 +1,228 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7620a.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "engenius,epg600", "ralink,mt7620a-soc";
+	model = "EnGenius EPG600";
+
+	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 {
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
+			debounce-interval = <60>;
+		};
+
+		wps {
+			linux,code = <KEY_WPS_BUTTON>;
+			gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
+			debounce-interval = <60>;
+		};
+
+		reg {
+			linux,code = <BTN_0>;
+			gpios = <&gpio2 7 GPIO_ACTIVE_LOW>;
+			debounce-interval = <60>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_power: power {
+			label = "amber:power";
+			gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
+			default-state = "on";
+		};
+
+		wlan2g {
+			label = "blue:wlan2g";
+			gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy1tpt";
+		};
+
+		wlan5g {
+			label = "blue:wlan5g";
+			gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
+		};
+
+		wps2g {
+			label = "blue:wps2g";
+			gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
+		};
+
+		wps5g {
+			label = "amber:wps5g";
+			gpios = <&gpio2 6 GPIO_ACTIVE_LOW>;
+		};
+
+		line {
+			label = "blue:line";
+			gpios = <&gpio2 14 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&gpio1 {
+	status = "okay";
+};
+
+&gpio2 {
+	status = "okay";
+};
+
+&gpio3 {
+	status = "okay";
+};
+
+&spi0 {
+	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 0x30000>;
+				read-only;
+			};
+
+			partition at 30000 {
+				label = "u-boot-env";
+				reg = <0x30000 0x10000>;
+			};
+
+			factory: partition at 40000 {
+				label = "factory";
+				reg = <0x40000 0x10000>;
+				read-only;
+			};
+
+			rf: partition at 50000 {
+				label = "rf";
+				reg = <0x50000 0x10000>;
+				read-only;
+			};
+
+			partition at 60000 {
+				label = "firmware";
+				reg = <0x60000 0xf40000>;
+				compatible = "denx,uimage";
+			};
+
+			partition at fa0000 {
+				label = "backup";
+				reg = <0xfa0000 0x10000>;
+				read-only;
+			};
+
+			partition at fb0000 {
+				label = "storage";
+				reg = <0xfb0000 0x50000>;
+				read-only;
+			};
+		};
+	};
+};
+
+&ethernet {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mdio_pins &rgmii1_pins &rgmii2_pins>;
+
+	nvmem-cells = <&macaddr_rf_4>;
+	nvmem-cell-names = "mac-address";
+
+	port at 5 {
+		status = "okay";
+
+		phy-mode = "rgmii-txid";
+
+		mediatek,fixed-link = <1000 1 1 1>;
+	};
+
+	mdio-bus {
+		status = "okay";
+
+		ethernet-phy at 0 {
+			reg = <0>;
+			phy-mode = "rgmii";
+
+			qca,ar8327-initvals = <
+				0x04 0x07600000 /* PORT0 PAD MODE CTRL */
+				0x08 0x01000000 /* PORT5 PAD MODE CTRL */
+				0x0c 0x07600000 /* PORT6 PAD MODE CTRL */
+				0x10 0x40000000 /* POWER-ON STRAPPING  */
+				0x7c 0x0000007e /* PORT0_STATUS */
+				0x94 0x0000007e /* PORT6_STATUS */
+			>;
+		};
+	};
+};
+
+&gsw {
+	mediatek,ephy-disable;
+};
+
+&pcie {
+	status = "okay";
+};
+
+&pcie0 {
+	wifi at 0,1,0 {
+		compatible = "pci1814,3091";
+		reg = <0x0 1 0 0 0>;
+		ralink,mtd-eeprom = <&factory 0x0>;
+	};
+};
+
+&wmac {
+	ralink,mtd-eeprom = <&rf 0x0>;
+};
+
+&ehci {
+	status = "okay";
+};
+
+&ohci {
+	status = "okay";
+};
+
+&state_default {
+	default {
+		groups = "ephy", "wled", "spi refclk", "i2c", "uartf", "nd_sd";
+		function = "gpio";
+	};
+};
+
+&rf {
+	compatible = "nvmem-cells";
+	#address-cells = <1>;
+	#size-cells = <1>;
+
+	macaddr_rf_4: macaddr at 4 {
+		reg = <0x4 0x6>;
+	};
+};
diff --git a/target/linux/ramips/image/mt7620.mk b/target/linux/ramips/image/mt7620.mk
index e723fe93e0..6e528a930b 100644
--- a/target/linux/ramips/image/mt7620.mk
+++ b/target/linux/ramips/image/mt7620.mk
@@ -446,6 +446,21 @@ define Device/elecom_wrh-300cr
 endef
 TARGET_DEVICES += elecom_wrh-300cr
 
+define Device/engenius_epg600
+  $(Device/uimage-lzma-loader)
+  SOC := mt7620a
+  BLOCKSIZE := 4k
+  IMAGE_SIZE := 15616k
+  IMAGES += factory.dlf
+  IMAGE/factory.dlf := $$(sysupgrade_bin) | check-size | \
+	senao-header -r 0x101 -p 0x6a -t 2
+  DEVICE_VENDOR := EnGenius
+  DEVICE_MODEL := EPG600
+  DEVICE_PACKAGES += kmod-rt2800-pci kmod-usb-storage \
+	kmod-usb-ohci kmod-usb2 uboot-envtools
+endef
+TARGET_DEVICES += engenius_epg600
+
 define Device/engenius_esr600
   SOC := mt7620a
   BLOCKSIZE := 64k
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 424e370996..a55a8ed356 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
@@ -149,6 +149,7 @@ ramips_setup_interfaces()
 		ucidef_add_switch "switch1" \
 			"1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "6 at eth0"
 		;;
+	engenius,epg600|\
 	engenius,esr600|\
 	lava,lr-25g001|\
 	sitecom,wlr-4100-v1-002)
@@ -332,6 +333,7 @@ ramips_setup_macs()
 	edimax,br-6478ac-v2)
 		wan_mac=$(macaddr_add "$(mtd_get_mac_binary factory 0x4)" 2)
 		;;
+	engenius,epg600|\
 	engenius,esr600)
 		lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
 		wan_mac=$(mtd_get_mac_ascii u-boot-env wanaddr)



From lede-commits at lists.infradead.org  Sat Feb 18 08:13:24 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 11:13:24 -0500
Subject: [openwrt/openwrt]  netfilter: add kmod-nf-conntrack
In-Reply-To: <167673680487.266566.6976202878499558219@git-01.infra.openwrt.org>
References: <167673680487.266566.6976202878499558219@git-01.infra.openwrt.org>
Message-ID: <mailman.17121.1676736814.3064139.lede-commits@lists.infradead.org>

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

commit 144fa4d4e7c00df370924751f58781689cd333e7
Author: Aviana Cruz <gwencroft at proton.me>
AuthorDate: Thu Feb 2 21:39:41 2023 +0800

    netfilter: add kmod-nf-conntrack
    
    There have been some demands for the `ct count` expression,
    like https://forum.openwrt.org/t/22-03-2-unable-to-use-ct-count-nft-rules/146680.
    
    This adds the required kernel modules for the expression to work.
    
    Signed-off-by: Aviana Cruz <gwencroft at proton.me>
---
 include/netfilter.mk                      |  7 ++++++-
 package/kernel/linux/modules/netfilter.mk | 23 +++++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/include/netfilter.mk b/include/netfilter.mk
index a9c5133ae4..81488fe5c8 100644
--- a/include/netfilter.mk
+++ b/include/netfilter.mk
@@ -73,7 +73,6 @@ $(eval $(call nf_add,IPT_CONNTRACK,CONFIG_NETFILTER_XT_MATCH_CONNTRACK, $(P_XT)x
 
 $(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_MATCH_CONNBYTES, $(P_XT)xt_connbytes))
 $(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_MATCH_CONNLIMIT, $(P_XT)xt_connlimit))
-$(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_CONNCOUNT, $(P_XT)nf_conncount))
 $(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_CONNMARK, $(P_XT)xt_connmark))
 $(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_MATCH_HELPER, $(P_XT)xt_helper))
 $(eval $(call nf_add,IPT_CONNTRACK_EXTRA,CONFIG_NETFILTER_XT_MATCH_RECENT, $(P_XT)xt_recent))
@@ -278,6 +277,10 @@ $(eval $(call nf_add,NFNETLINK_LOG,CONFIG_NETFILTER_NETLINK_LOG, $(P_XT)nfnetlin
 
 $(eval $(call nf_add,NFNETLINK_QUEUE,CONFIG_NETFILTER_NETLINK_QUEUE, $(P_XT)nfnetlink_queue))
 
+# conncount
+
+$(eval $(if $(NF_KMOD),$(call nf_add,NF_CONNCOUNT,CONFIG_NETFILTER_CONNCOUNT, $(P_XT)nf_conncount),))
+
 #
 # ebtables
 #
@@ -352,6 +355,8 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NFT_COMPAT,CONFIG_NFT_COMPAT, $(P_XT)nft_co
 
 $(eval $(if $(NF_KMOD),$(call nf_add,NFT_XFRM,CONFIG_NFT_XFRM, $(P_XT)nft_xfrm),))
 
+$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CONNLIMIT,CONFIG_NFT_CONNLIMIT, $(P_XT)nft_connlimit),))
+
 # userland only
 IPT_BUILTIN += $(NF_IPT-y) $(NF_IPT-m)
 IPT_BUILTIN += $(IPT_CORE-y) $(IPT_CORE-m)
diff --git a/package/kernel/linux/modules/netfilter.mk b/package/kernel/linux/modules/netfilter.mk
index e6e2c9b637..1772545f25 100644
--- a/package/kernel/linux/modules/netfilter.mk
+++ b/package/kernel/linux/modules/netfilter.mk
@@ -39,6 +39,17 @@ endef
 
 $(eval $(call KernelPackage,nf-reject6))
 
+define KernelPackage/nf-conncount
+  SUBMENU:=$(NF_MENU)
+  TITLE:=Netfilter conncount support
+  KCONFIG:=$(KCONFIG_NF_CONNCOUNT)
+  HIDDEN:=1
+  DEPENDS:=+kmod-nf-conntrack
+  FILES:=$(foreach mod,$(NF_CONNCOUNT-m),$(LINUX_DIR)/net/$(mod).ko)
+  AUTOLOAD:=$(call AutoProbe,$(notdir $(NF_CONNCOUNT-m)))
+endef
+
+$(eval $(call KernelPackage,nf-conncount))
 
 define KernelPackage/nf-ipt
   SUBMENU:=$(NF_MENU)
@@ -234,6 +245,7 @@ $(eval $(call KernelPackage,ipt-conntrack))
 
 define KernelPackage/ipt-conntrack-extra
   TITLE:=Extra connection tracking modules
+  DEPENDS:=+kmod-nf-conncount
   KCONFIG:=$(KCONFIG_IPT_CONNTRACK_EXTRA)
   FILES:=$(foreach mod,$(IPT_CONNTRACK_EXTRA-m),$(LINUX_DIR)/net/$(mod).ko)
   AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_CONNTRACK_EXTRA-m)))
@@ -1254,3 +1266,14 @@ define KernelPackage/nft-xfrm
 endef
 
 $(eval $(call KernelPackage,nft-xfrm))
+
+define KernelPackage/nft-connlimit
+  SUBMENU:=$(NF_MENU)
+  TITLE:=Netfilter nf_tables connlimit support
+  DEPENDS:=+kmod-nft-core +kmod-nf-conncount
+  FILES:=$(foreach mod,$(NFT_CONNLIMIT-m),$(LINUX_DIR)/net/$(mod).ko)
+  AUTOLOAD:=$(call AutoProbe,$(notdir $(NFT_CONNLIMIT-m)))
+  KCONFIG:=$(KCONFIG_NFT_CONNLIMIT)
+endef
+
+$(eval $(call KernelPackage,nft-connlimit))



From lede-commits at lists.infradead.org  Sat Feb 18 08:38:27 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 11:38:27 -0500
Subject: [openwrt/openwrt]  tools/zstd: update to 1.5.4
In-Reply-To: <167673830731.290706.9640643750610507110@git-01.infra.openwrt.org>
References: <167673830731.290706.9640643750610507110@git-01.infra.openwrt.org>
Message-ID: <mailman.17129.1676738312.3064139.lede-commits@lists.infradead.org>

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

commit 80d61c41d5b8833e19b594fa48f7d9ec5970b35b
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Thu Feb 9 18:13:14 2023 -0800

    tools/zstd: update to 1.5.4
    
    Mostly performance improvements, as usual.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
---
 tools/zstd/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/zstd/Makefile b/tools/zstd/Makefile
index 65381e7cb4..ea0f823e11 100644
--- a/tools/zstd/Makefile
+++ b/tools/zstd/Makefile
@@ -1,11 +1,11 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zstd
-PKG_VERSION:=1.5.2
+PKG_VERSION:=1.5.4
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://github.com/facebook/zstd/releases/download/v$(PKG_VERSION)
-PKG_HASH:=7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0
+PKG_HASH:=0f470992aedad543126d06efab344dc5f3e171893810455787d38347343a4424
 
 PKG_LICENSE:=BSD-3-Clause
 PKG_LICENSE_FILES:=LICENSE
@@ -22,7 +22,7 @@ MESON_HOST_ARGS += \
 	-Ddefault_library=static \
 	-Dlegacy_level=7 \
 	-Ddebug_level=0 \
-	-Dbacktrace=false \
+	-Dbacktrace=disabled \
 	-Dstatic_runtime=false \
 	-Dbin_programs=true \
 	-Dbin_tests=false \



From lede-commits at lists.infradead.org  Sat Feb 18 08:42:47 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 11:42:47 -0500
Subject: [openwrt/openwrt]  kernel: bump 5.10 to 5.10.168
In-Reply-To: <167673856714.294582.11347043753578637826@git-01.infra.openwrt.org>
References: <167673856714.294582.11347043753578637826@git-01.infra.openwrt.org>
Message-ID: <mailman.17130.1676738572.3064139.lede-commits@lists.infradead.org>

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

commit 461072fc7b3d8fa77347a884fe5d36c81f660da8
Author: John Audia <therealgraysky at proton.me>
AuthorDate: Wed Feb 15 14:05:27 2023 -0500

    kernel: bump 5.10 to 5.10.168
    
    Manually rebased:
      backport-5.10/804-v5.14-0001-nvmem-core-allow-specifying-of_node.patch
    
    Removed upstreamed:
      generic-backport/807-v5.17-0003-nvmem-core-Fix-a-conflict-between-MTD-and-NVMEM-on-w.patch[1]
    
    All other patches automatically rebased.
    
    1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.168&id=34ec4c7831c416ac56619477f1701986634a7efc
    
    Build system: x86_64
    Build-tested: ramips/tplink_archer-a6-v3
    Run-tested: ramips/tplink_archer-a6-v3
    
    Signed-off-by: John Audia <therealgraysky at proton.me>
---
 include/kernel-5.10                                |  4 +-
 .../patches-5.10/910-unaligned_access_hacks.patch  |  4 +-
 ...vmem-core-Add-support-for-keepout-regions.patch |  6 +-
 ...-0001-nvmem-core-allow-specifying-of_node.patch |  6 +-
 ...fix-error-handling-while-validating-keepo.patch |  2 +-
 ...e-add-nvmem-cell-post-processing-callback.patch |  4 +-
 ...Fix-a-conflict-between-MTD-and-NVMEM-on-w.patch | 68 ----------------------
 ...-nvmem-core-Fix-memleak-in-nvmem_register.patch |  2 +-
 ...-core-add-error-handling-for-dev_set_name.patch |  2 +-
 ...c_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch |  2 +-
 10 files changed, 16 insertions(+), 84 deletions(-)

diff --git a/include/kernel-5.10 b/include/kernel-5.10
index 0198540361..e0bdccaf43 100644
--- a/include/kernel-5.10
+++ b/include/kernel-5.10
@@ -1,2 +1,2 @@
-LINUX_VERSION-5.10 = .167
-LINUX_KERNEL_HASH-5.10.167 = d807f97812e566410cd13b3170009e0d7552748d4f22d608ffd4dbd7f85bf9c6
+LINUX_VERSION-5.10 = .168
+LINUX_KERNEL_HASH-5.10.168 = b67d2596ba8d30510f743f31899c94c43eaf006a254ff44d7fc6ea26e7ab359c
diff --git a/target/linux/ath79/patches-5.10/910-unaligned_access_hacks.patch b/target/linux/ath79/patches-5.10/910-unaligned_access_hacks.patch
index 1891a6425e..0de433914d 100644
--- a/target/linux/ath79/patches-5.10/910-unaligned_access_hacks.patch
+++ b/target/linux/ath79/patches-5.10/910-unaligned_access_hacks.patch
@@ -162,7 +162,7 @@ SVN-Revision: 35130
  
 --- a/include/uapi/linux/ip.h
 +++ b/include/uapi/linux/ip.h
-@@ -105,7 +105,7 @@ struct iphdr {
+@@ -106,7 +106,7 @@ struct iphdr {
  		__be32	daddr;
  	);
  	/*The options start here. */
@@ -173,7 +173,7 @@ SVN-Revision: 35130
  struct ip_auth_hdr {
 --- a/include/uapi/linux/ipv6.h
 +++ b/include/uapi/linux/ipv6.h
-@@ -134,7 +134,7 @@ struct ipv6hdr {
+@@ -135,7 +135,7 @@ struct ipv6hdr {
  		struct	in6_addr	saddr;
  		struct	in6_addr	daddr;
  	);
diff --git a/target/linux/generic/backport-5.10/801-v5.11-0001-nvmem-core-Add-support-for-keepout-regions.patch b/target/linux/generic/backport-5.10/801-v5.11-0001-nvmem-core-Add-support-for-keepout-regions.patch
index 6fe5032f33..23879d40af 100644
--- a/target/linux/generic/backport-5.10/801-v5.11-0001-nvmem-core-Add-support-for-keepout-regions.patch
+++ b/target/linux/generic/backport-5.10/801-v5.11-0001-nvmem-core-Add-support-for-keepout-regions.patch
@@ -203,7 +203,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  static int nvmem_add_cells_from_of(struct nvmem_device *nvmem)
  {
  	struct device_node *parent, *child;
-@@ -655,6 +792,8 @@ struct nvmem_device *nvmem_register(cons
+@@ -656,6 +793,8 @@ struct nvmem_device *nvmem_register(cons
  	nvmem->type = config->type;
  	nvmem->reg_read = config->reg_read;
  	nvmem->reg_write = config->reg_write;
@@ -212,7 +212,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  	if (!config->no_of_node)
  		nvmem->dev.of_node = config->dev->of_node;
  
-@@ -679,6 +818,12 @@ struct nvmem_device *nvmem_register(cons
+@@ -680,6 +819,12 @@ struct nvmem_device *nvmem_register(cons
  	nvmem->dev.groups = nvmem_dev_groups;
  #endif
  
@@ -256,7 +256,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
   * @type:	Type of the nvmem storage
   * @read_only:	Device is read-only.
   * @root_only:	Device is accessibly to root only.
-@@ -66,6 +81,8 @@ struct nvmem_config {
+@@ -67,6 +82,8 @@ struct nvmem_config {
  	struct gpio_desc	*wp_gpio;
  	const struct nvmem_cell_info	*cells;
  	int			ncells;
diff --git a/target/linux/generic/backport-5.10/804-v5.14-0001-nvmem-core-allow-specifying-of_node.patch b/target/linux/generic/backport-5.10/804-v5.14-0001-nvmem-core-allow-specifying-of_node.patch
index 8c5a55e364..5889e61910 100644
--- a/target/linux/generic/backport-5.10/804-v5.14-0001-nvmem-core-allow-specifying-of_node.patch
+++ b/target/linux/generic/backport-5.10/804-v5.14-0001-nvmem-core-allow-specifying-of_node.patch
@@ -49,7 +49,7 @@ Link: https://lore.kernel.org/linux-mtd/20210424110608.15748-2-michael at walle.cc
 
 --- a/drivers/nvmem/core.c
 +++ b/drivers/nvmem/core.c
-@@ -794,7 +794,9 @@ struct nvmem_device *nvmem_register(cons
+@@ -795,7 +795,9 @@ struct nvmem_device *nvmem_register(cons
  	nvmem->reg_write = config->reg_write;
  	nvmem->keepout = config->keepout;
  	nvmem->nkeepout = config->nkeepout;
@@ -70,11 +70,11 @@ Link: https://lore.kernel.org/linux-mtd/20210424110608.15748-2-michael at walle.cc
   * @no_of_node:	Device should not use the parent's of_node even if it's !NULL.
   * @reg_read:	Callback to read data.
   * @reg_write:	Callback to write data.
-@@ -86,6 +87,7 @@ struct nvmem_config {
+@@ -87,6 +88,7 @@ struct nvmem_config {
  	enum nvmem_type		type;
  	bool			read_only;
  	bool			root_only;
 +	struct device_node	*of_node;
+ 	bool			ignore_wp;
  	bool			no_of_node;
  	nvmem_reg_read_t	reg_read;
- 	nvmem_reg_write_t	reg_write;
diff --git a/target/linux/generic/backport-5.10/805-v5.15-0003-nvmem-core-fix-error-handling-while-validating-keepo.patch b/target/linux/generic/backport-5.10/805-v5.15-0003-nvmem-core-fix-error-handling-while-validating-keepo.patch
index 59c9281cdb..e5342e79d3 100644
--- a/target/linux/generic/backport-5.10/805-v5.15-0003-nvmem-core-fix-error-handling-while-validating-keepo.patch
+++ b/target/linux/generic/backport-5.10/805-v5.15-0003-nvmem-core-fix-error-handling-while-validating-keepo.patch
@@ -20,7 +20,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
 
 --- a/drivers/nvmem/core.c
 +++ b/drivers/nvmem/core.c
-@@ -826,8 +826,11 @@ struct nvmem_device *nvmem_register(cons
+@@ -827,8 +827,11 @@ struct nvmem_device *nvmem_register(cons
  
  	if (nvmem->nkeepout) {
  		rval = nvmem_validate_keepouts(nvmem);
diff --git a/target/linux/generic/backport-5.10/806-v5.16-0002-nvmem-core-add-nvmem-cell-post-processing-callback.patch b/target/linux/generic/backport-5.10/806-v5.16-0002-nvmem-core-add-nvmem-cell-post-processing-callback.patch
index 787fea3037..a5d4ace4e5 100644
--- a/target/linux/generic/backport-5.10/806-v5.16-0002-nvmem-core-add-nvmem-cell-post-processing-callback.patch
+++ b/target/linux/generic/backport-5.10/806-v5.16-0002-nvmem-core-add-nvmem-cell-post-processing-callback.patch
@@ -30,7 +30,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  	struct gpio_desc	*wp_gpio;
  	void *priv;
  };
-@@ -798,6 +799,7 @@ struct nvmem_device *nvmem_register(cons
+@@ -799,6 +800,7 @@ struct nvmem_device *nvmem_register(cons
  	nvmem->type = config->type;
  	nvmem->reg_read = config->reg_read;
  	nvmem->reg_write = config->reg_write;
@@ -72,7 +72,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
   * @size:	Device size.
   * @word_size:	Minimum read/write access granularity.
   * @stride:	Minimum read/write access stride.
-@@ -92,6 +96,7 @@ struct nvmem_config {
+@@ -94,6 +98,7 @@ struct nvmem_config {
  	bool			no_of_node;
  	nvmem_reg_read_t	reg_read;
  	nvmem_reg_write_t	reg_write;
diff --git a/target/linux/generic/backport-5.10/807-v5.17-0003-nvmem-core-Fix-a-conflict-between-MTD-and-NVMEM-on-w.patch b/target/linux/generic/backport-5.10/807-v5.17-0003-nvmem-core-Fix-a-conflict-between-MTD-and-NVMEM-on-w.patch
deleted file mode 100644
index a9ef3e27e0..0000000000
--- a/target/linux/generic/backport-5.10/807-v5.17-0003-nvmem-core-Fix-a-conflict-between-MTD-and-NVMEM-on-w.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From f6c052afe6f802d87c74153b7a57c43b2e9faf07 Mon Sep 17 00:00:00 2001
-From: Christophe Kerello <christophe.kerello at foss.st.com>
-Date: Sun, 20 Feb 2022 15:14:31 +0000
-Subject: [PATCH] nvmem: core: Fix a conflict between MTD and NVMEM on wp-gpios
- property
-
-Wp-gpios property can be used on NVMEM nodes and the same property can
-be also used on MTD NAND nodes. In case of the wp-gpios property is
-defined at NAND level node, the GPIO management is done at NAND driver
-level. Write protect is disabled when the driver is probed or resumed
-and is enabled when the driver is released or suspended.
-
-When no partitions are defined in the NAND DT node, then the NAND DT node
-will be passed to NVMEM framework. If wp-gpios property is defined in
-this node, the GPIO resource is taken twice and the NAND controller
-driver fails to probe.
-
-It would be possible to set config->wp_gpio at MTD level before calling
-nvmem_register function but NVMEM framework will toggle this GPIO on
-each write when this GPIO should only be controlled at NAND level driver
-to ensure that the Write Protect has not been enabled.
-
-A way to fix this conflict is to add a new boolean flag in nvmem_config
-named ignore_wp. In case ignore_wp is set, the GPIO resource will
-be managed by the provider.
-
-Fixes: 2a127da461a9 ("nvmem: add support for the write-protect pin")
-Cc: stable at vger.kernel.org
-Signed-off-by: Christophe Kerello <christophe.kerello at foss.st.com>
-Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
-Link: https://lore.kernel.org/r/20220220151432.16605-2-srinivas.kandagatla at linaro.org
-Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
----
- drivers/nvmem/core.c           | 2 +-
- include/linux/nvmem-provider.h | 4 +++-
- 2 files changed, 4 insertions(+), 2 deletions(-)
-
---- a/drivers/nvmem/core.c
-+++ b/drivers/nvmem/core.c
-@@ -771,7 +771,7 @@ struct nvmem_device *nvmem_register(cons
- 
- 	if (config->wp_gpio)
- 		nvmem->wp_gpio = config->wp_gpio;
--	else
-+	else if (!config->ignore_wp)
- 		nvmem->wp_gpio = gpiod_get_optional(config->dev, "wp",
- 						    GPIOD_OUT_HIGH);
- 	if (IS_ERR(nvmem->wp_gpio)) {
---- a/include/linux/nvmem-provider.h
-+++ b/include/linux/nvmem-provider.h
-@@ -70,7 +70,8 @@ struct nvmem_keepout {
-  * @word_size:	Minimum read/write access granularity.
-  * @stride:	Minimum read/write access stride.
-  * @priv:	User context passed to read/write callbacks.
-- * @wp-gpio:   Write protect pin
-+ * @wp-gpio:	Write protect pin
-+ * @ignore_wp:  Write Protect pin is managed by the provider.
-  *
-  * Note: A default "nvmem<id>" name will be assigned to the device if
-  * no name is specified in its configuration. In such case "<id>" is
-@@ -92,6 +93,7 @@ struct nvmem_config {
- 	enum nvmem_type		type;
- 	bool			read_only;
- 	bool			root_only;
-+	bool			ignore_wp;
- 	struct device_node	*of_node;
- 	bool			no_of_node;
- 	nvmem_reg_read_t	reg_read;
diff --git a/target/linux/generic/backport-5.10/811-v6.1-0001-nvmem-core-Fix-memleak-in-nvmem_register.patch b/target/linux/generic/backport-5.10/811-v6.1-0001-nvmem-core-Fix-memleak-in-nvmem_register.patch
index 4d7ad9bba7..698e737973 100644
--- a/target/linux/generic/backport-5.10/811-v6.1-0001-nvmem-core-Fix-memleak-in-nvmem_register.patch
+++ b/target/linux/generic/backport-5.10/811-v6.1-0001-nvmem-core-Fix-memleak-in-nvmem_register.patch
@@ -22,7 +22,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
 
 --- a/drivers/nvmem/core.c
 +++ b/drivers/nvmem/core.c
-@@ -829,21 +829,18 @@ struct nvmem_device *nvmem_register(cons
+@@ -830,21 +830,18 @@ struct nvmem_device *nvmem_register(cons
  	nvmem->dev.groups = nvmem_dev_groups;
  #endif
  
diff --git a/target/linux/generic/backport-5.10/811-v6.1-0003-nvmem-core-add-error-handling-for-dev_set_name.patch b/target/linux/generic/backport-5.10/811-v6.1-0003-nvmem-core-add-error-handling-for-dev_set_name.patch
index 34a28fa6fe..322a1f6b55 100644
--- a/target/linux/generic/backport-5.10/811-v6.1-0003-nvmem-core-add-error-handling-for-dev_set_name.patch
+++ b/target/linux/generic/backport-5.10/811-v6.1-0003-nvmem-core-add-error-handling-for-dev_set_name.patch
@@ -17,7 +17,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
 
 --- a/drivers/nvmem/core.c
 +++ b/drivers/nvmem/core.c
-@@ -810,18 +810,24 @@ struct nvmem_device *nvmem_register(cons
+@@ -811,18 +811,24 @@ struct nvmem_device *nvmem_register(cons
  
  	switch (config->id) {
  	case NVMEM_DEVID_NONE:
diff --git a/target/linux/generic/pending-5.10/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch b/target/linux/generic/pending-5.10/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch
index e00382149a..1adfd22e87 100644
--- a/target/linux/generic/pending-5.10/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch
+++ b/target/linux/generic/pending-5.10/120-Fix-alloc_node_mem_map-with-ARCH_PFN_OFFSET-calcu.patch
@@ -71,7 +71,7 @@ Signed-off-by: Tobias Wolf <dev-NTEO at vplace.de>
 
 --- a/mm/page_alloc.c
 +++ b/mm/page_alloc.c
-@@ -7104,7 +7104,7 @@ static void __ref alloc_node_mem_map(str
+@@ -7107,7 +7107,7 @@ static void __ref alloc_node_mem_map(str
  	if (pgdat == NODE_DATA(0)) {
  		mem_map = NODE_DATA(0)->node_mem_map;
  		if (page_to_pfn(mem_map) != pgdat->node_start_pfn)



From lede-commits at lists.infradead.org  Sat Feb 18 10:19:00 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 13:19:00 -0500
Subject: [openwrt/openwrt]  kernel: bump 5.4 to 5.4.231
In-Reply-To: <167674434041.347768.16541542404895736382@git-01.infra.openwrt.org>
References: <167674434041.347768.16541542404895736382@git-01.infra.openwrt.org>
Message-ID: <mailman.17150.1676744351.3064139.lede-commits@lists.infradead.org>

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

commit 23ad680a3450d1e17447c6b77cff57ded0f6fdbf
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Mon Feb 13 00:56:17 2023 +0100

    kernel: bump 5.4 to 5.4.231
    
    Compile-tested: x86/64
    Run-tested: x86/64
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 include/kernel-5.4                                     |  4 ++--
 ...-spidev-Completely-disable-the-spidev-warning.patch |  2 +-
 ...plement-xhci_fixup_endpoint-for-interval-adju.patch |  4 ++--
 ...-Add-device-quirks-for-Freeway-Airmouse-T3-an.patch |  4 ++--
 ...t-bindings-media-i2c-Add-IMX219-CMOS-sensor-b.patch |  2 +-
 ...4-media-i2c-Add-driver-for-Sony-IMX477-sensor.patch |  2 +-
 ...t-bindings-media-i2c-Add-IMX290-CMOS-sensor-b.patch |  2 +-
 ...uard-0072-net-WireGuard-secure-network-tunnel.patch |  2 +-
 .../130-add-linux-spidev-compatible-si3210.patch       |  2 +-
 .../613-netfilter_optional_tcp_window_check.patch      |  4 ++--
 .../666-Add-support-for-MAP-E-FMRs-mesh-mode.patch     | 18 +++++++++---------
 ...w-rejecting-with-source-address-failed-policy.patch |  2 +-
 ...t-mdio-i2c-add-support-for-Clause-45-accesses.patch |  4 ++--
 ...-imx6qdl-gw560x-add-lsm9ds1-iio-imu-magn-supp.patch |  4 ++--
 ...pufreq-nvmem-Add-support-for-krait-based-socs.patch |  2 +-
 ...a-ocelot-add-tagger-for-Ocelot-Felix-switches.patch |  2 +-
 ...dsa-ocelot-add-driver-for-Felix-switch-family.patch |  2 +-
 ...80-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch |  2 +-
 ...794-1-usb-host-xhci-add-.bus_suspend-override.patch |  2 +-
 19 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/include/kernel-5.4 b/include/kernel-5.4
index 16ca2ab2a6..a1a8ed05d6 100644
--- a/include/kernel-5.4
+++ b/include/kernel-5.4
@@ -1,2 +1,2 @@
-LINUX_VERSION-5.4 = .230
-LINUX_KERNEL_HASH-5.4.230 = a74fd32ccc1025b72f3ba7183208761f7c6190fb96e8f484f6d543a5a183e62f
+LINUX_VERSION-5.4 = .231
+LINUX_KERNEL_HASH-5.4.231 = 8dd0ea7f1db4c1e89d485255798e3c3dfb9be63c0f2af369912a1a37b75f36a8
diff --git a/target/linux/bcm27xx/patches-5.4/950-0011-spi-spidev-Completely-disable-the-spidev-warning.patch b/target/linux/bcm27xx/patches-5.4/950-0011-spi-spidev-Completely-disable-the-spidev-warning.patch
index 4df6ae386b..94bb608355 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0011-spi-spidev-Completely-disable-the-spidev-warning.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0011-spi-spidev-Completely-disable-the-spidev-warning.patch
@@ -13,7 +13,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 
 --- a/drivers/spi/spidev.c
 +++ b/drivers/spi/spidev.c
-@@ -745,7 +745,7 @@ static int spidev_probe(struct spi_devic
+@@ -743,7 +743,7 @@ static int spidev_probe(struct spi_devic
  	 * compatible string, it is a Linux implementation thing
  	 * rather than a description of the hardware.
  	 */
diff --git a/target/linux/bcm27xx/patches-5.4/950-0219-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch b/target/linux/bcm27xx/patches-5.4/950-0219-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch
index 921c1d74d4..39ce3f939b 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0219-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0219-xhci-implement-xhci_fixup_endpoint-for-interval-adju.patch
@@ -15,7 +15,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.org>
 
 --- a/drivers/usb/host/xhci.c
 +++ b/drivers/usb/host/xhci.c
-@@ -1486,6 +1486,103 @@ command_cleanup:
+@@ -1487,6 +1487,103 @@ command_cleanup:
  }
  
  /*
@@ -119,7 +119,7 @@ Signed-off-by: Jonathan Bell <jonathan at raspberrypi.org>
   * non-error returns are a promise to giveback() the urb later
   * we drop ownership so next owner (or urb unlink) can get it
   */
-@@ -5401,6 +5498,7 @@ static const struct hc_driver xhci_hc_dr
+@@ -5402,6 +5499,7 @@ static const struct hc_driver xhci_hc_dr
  	.endpoint_reset =	xhci_endpoint_reset,
  	.check_bandwidth =	xhci_check_bandwidth,
  	.reset_bandwidth =	xhci_reset_bandwidth,
diff --git a/target/linux/bcm27xx/patches-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 deaaaf661c..2f8d628d1e 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
  
-@@ -1271,6 +1274,9 @@
+@@ -1270,6 +1273,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 },
-@@ -197,6 +198,7 @@ static const struct hid_device_id hid_qu
+@@ -196,6 +197,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-0451-media-dt-bindings-media-i2c-Add-IMX219-CMOS-sensor-b.patch b/target/linux/bcm27xx/patches-5.4/950-0451-media-dt-bindings-media-i2c-Add-IMX219-CMOS-sensor-b.patch
index bc69d5868e..09ea71185c 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0451-media-dt-bindings-media-i2c-Add-IMX219-CMOS-sensor-b.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0451-media-dt-bindings-media-i2c-Add-IMX219-CMOS-sensor-b.patch
@@ -139,7 +139,7 @@ Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung at kernel.org>
 +...
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -15144,6 +15144,14 @@ S:	Maintained
+@@ -15145,6 +15145,14 @@ S:	Maintained
  F:	drivers/media/i2c/imx214.c
  F:	Documentation/devicetree/bindings/media/i2c/sony,imx214.txt
  
diff --git a/target/linux/bcm27xx/patches-5.4/950-0714-media-i2c-Add-driver-for-Sony-IMX477-sensor.patch b/target/linux/bcm27xx/patches-5.4/950-0714-media-i2c-Add-driver-for-Sony-IMX477-sensor.patch
index cd2ef3838c..e90c9656f2 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0714-media-i2c-Add-driver-for-Sony-IMX477-sensor.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0714-media-i2c-Add-driver-for-Sony-IMX477-sensor.patch
@@ -25,7 +25,7 @@ Signed-off-by: Naushir Patuck <naush at raspberrypi.com>
 
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -15197,6 +15197,14 @@ T:	git git://linuxtv.org/media_tree.git
+@@ -15198,6 +15198,14 @@ T:	git git://linuxtv.org/media_tree.git
  S:	Maintained
  F:	drivers/media/i2c/imx355.c
  
diff --git a/target/linux/bcm27xx/patches-5.4/950-0815-media-dt-bindings-media-i2c-Add-IMX290-CMOS-sensor-b.patch b/target/linux/bcm27xx/patches-5.4/950-0815-media-dt-bindings-media-i2c-Add-IMX290-CMOS-sensor-b.patch
index ae6ec005d5..6852dbf275 100644
--- a/target/linux/bcm27xx/patches-5.4/950-0815-media-dt-bindings-media-i2c-Add-IMX290-CMOS-sensor-b.patch
+++ b/target/linux/bcm27xx/patches-5.4/950-0815-media-dt-bindings-media-i2c-Add-IMX290-CMOS-sensor-b.patch
@@ -81,7 +81,7 @@ Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung at kernel.org>
 +		};
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -15201,6 +15201,14 @@ S:	Maintained
+@@ -15202,6 +15202,14 @@ S:	Maintained
  F:	drivers/media/i2c/imx274.c
  F:	Documentation/devicetree/bindings/media/i2c/imx274.txt
  
diff --git a/target/linux/generic/backport-5.4/080-wireguard-0072-net-WireGuard-secure-network-tunnel.patch b/target/linux/generic/backport-5.4/080-wireguard-0072-net-WireGuard-secure-network-tunnel.patch
index a29da1e7b2..ec6d0e5092 100644
--- a/target/linux/generic/backport-5.4/080-wireguard-0072-net-WireGuard-secure-network-tunnel.patch
+++ b/target/linux/generic/backport-5.4/080-wireguard-0072-net-WireGuard-secure-network-tunnel.patch
@@ -192,7 +192,7 @@ Signed-off-by: Jason A. Donenfeld <Jason at zx2c4.com>
 
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -17585,6 +17585,14 @@ L:	linux-gpio at vger.kernel.org
+@@ -17586,6 +17586,14 @@ L:	linux-gpio at vger.kernel.org
  S:	Maintained
  F:	drivers/gpio/gpio-ws16c48.c
  
diff --git a/target/linux/generic/pending-5.4/130-add-linux-spidev-compatible-si3210.patch b/target/linux/generic/pending-5.4/130-add-linux-spidev-compatible-si3210.patch
index 321cbe2fa2..911c05f929 100644
--- a/target/linux/generic/pending-5.4/130-add-linux-spidev-compatible-si3210.patch
+++ b/target/linux/generic/pending-5.4/130-add-linux-spidev-compatible-si3210.patch
@@ -8,7 +8,7 @@ Signed-off-by: Giuseppe Lippolis <giu.lippolis at gmail.com>
 
 --- a/drivers/spi/spidev.c
 +++ b/drivers/spi/spidev.c
-@@ -689,6 +689,7 @@ static const struct of_device_id spidev_
+@@ -687,6 +687,7 @@ static const struct of_device_id spidev_
  	{ .compatible = "lwn,bk4" },
  	{ .compatible = "dh,dhcom-board" },
  	{ .compatible = "menlo,m53cpld" },
diff --git a/target/linux/generic/pending-5.4/613-netfilter_optional_tcp_window_check.patch b/target/linux/generic/pending-5.4/613-netfilter_optional_tcp_window_check.patch
index deed70efee..f6a3a82eca 100644
--- a/target/linux/generic/pending-5.4/613-netfilter_optional_tcp_window_check.patch
+++ b/target/linux/generic/pending-5.4/613-netfilter_optional_tcp_window_check.patch
@@ -49,7 +49,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static bool enable_hooks __read_mostly;
  MODULE_PARM_DESC(enable_hooks, "Always enable conntrack hooks");
  module_param(enable_hooks, bool, 0000);
-@@ -650,6 +653,7 @@ enum nf_ct_sysctl_index {
+@@ -649,6 +652,7 @@ enum nf_ct_sysctl_index {
  	NF_SYSCTL_CT_PROTO_TIMEOUT_GRE_STREAM,
  #endif
  
@@ -57,7 +57,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	__NF_SYSCTL_CT_LAST_SYSCTL,
  };
  
-@@ -976,6 +980,13 @@ static struct ctl_table nf_ct_sysctl_tab
+@@ -969,6 +973,13 @@ static struct ctl_table nf_ct_sysctl_tab
  		.proc_handler   = proc_dointvec_jiffies,
  	},
  #endif
diff --git a/target/linux/generic/pending-5.4/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch b/target/linux/generic/pending-5.4/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
index 39f7af29d9..0830f2aefb 100644
--- a/target/linux/generic/pending-5.4/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
+++ b/target/linux/generic/pending-5.4/666-Add-support-for-MAP-E-FMRs-mesh-mode.patch
@@ -328,7 +328,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6))
  		return -1;
  
-@@ -1504,6 +1658,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
+@@ -1506,6 +1660,14 @@ ip6_tnl_change(struct ip6_tnl *t, const
  	t->parms.link = p->link;
  	t->parms.proto = p->proto;
  	t->parms.fwmark = p->fwmark;
@@ -343,7 +343,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	dst_cache_reset(&t->dst_cache);
  	ip6_tnl_link_config(t);
  	return 0;
-@@ -1542,6 +1704,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
+@@ -1544,6 +1706,7 @@ ip6_tnl_parm_from_user(struct __ip6_tnl_
  	p->flowinfo = u->flowinfo;
  	p->link = u->link;
  	p->proto = u->proto;
@@ -351,7 +351,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	memcpy(p->name, u->name, sizeof(u->name));
  }
  
-@@ -1926,6 +2089,15 @@ static int ip6_tnl_validate(struct nlatt
+@@ -1928,6 +2091,15 @@ static int ip6_tnl_validate(struct nlatt
  	return 0;
  }
  
@@ -367,7 +367,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  static void ip6_tnl_netlink_parms(struct nlattr *data[],
  				  struct __ip6_tnl_parm *parms)
  {
-@@ -1963,6 +2135,46 @@ static void ip6_tnl_netlink_parms(struct
+@@ -1965,6 +2137,46 @@ static void ip6_tnl_netlink_parms(struct
  
  	if (data[IFLA_IPTUN_FWMARK])
  		parms->fwmark = nla_get_u32(data[IFLA_IPTUN_FWMARK]);
@@ -414,7 +414,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  }
  
  static bool ip6_tnl_netlink_encap_parms(struct nlattr *data[],
-@@ -2078,6 +2290,12 @@ static void ip6_tnl_dellink(struct net_d
+@@ -2080,6 +2292,12 @@ static void ip6_tnl_dellink(struct net_d
  
  static size_t ip6_tnl_get_size(const struct net_device *dev)
  {
@@ -427,7 +427,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  	return
  		/* IFLA_IPTUN_LINK */
  		nla_total_size(4) +
-@@ -2107,6 +2325,24 @@ static size_t ip6_tnl_get_size(const str
+@@ -2109,6 +2327,24 @@ static size_t ip6_tnl_get_size(const str
  		nla_total_size(0) +
  		/* IFLA_IPTUN_FWMARK */
  		nla_total_size(4) +
@@ -452,7 +452,7 @@ Signed-off-by: Steven Barth <cyrus at openwrt.org>
  		0;
  }
  
-@@ -2114,6 +2350,9 @@ static int ip6_tnl_fill_info(struct sk_b
+@@ -2116,6 +2352,9 @@ static int ip6_tnl_fill_info(struct sk_b
  {
  	struct ip6_tnl *tunnel = netdev_priv(dev);
  	struct __ip6_tnl_parm *parm = &tunnel->parms;
@@ -462,7 +462,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) ||
-@@ -2123,9 +2362,27 @@ static int ip6_tnl_fill_info(struct sk_b
+@@ -2125,9 +2364,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) ||
@@ -491,7 +491,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) ||
-@@ -2165,6 +2422,7 @@ static const struct nla_policy ip6_tnl_p
+@@ -2167,6 +2424,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/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 10e58b4907..f46dc94c5a 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
@@ -53,7 +53,7 @@ Signed-off-by: Jonas Gorski <jogo at openwrt.org>
  
 --- a/net/ipv4/fib_semantics.c
 +++ b/net/ipv4/fib_semantics.c
-@@ -142,6 +142,10 @@ const struct fib_prop fib_props[RTN_MAX
+@@ -143,6 +143,10 @@ const struct fib_prop fib_props[RTN_MAX
  		.error	= -EINVAL,
  		.scope	= RT_SCOPE_NOWHERE,
  	},
diff --git a/target/linux/generic/pending-5.4/745-net-mdio-i2c-add-support-for-Clause-45-accesses.patch b/target/linux/generic/pending-5.4/745-net-mdio-i2c-add-support-for-Clause-45-accesses.patch
index 761a94b3d4..3b33f63fd0 100644
--- a/target/linux/generic/pending-5.4/745-net-mdio-i2c-add-support-for-Clause-45-accesses.patch
+++ b/target/linux/generic/pending-5.4/745-net-mdio-i2c-add-support-for-Clause-45-accesses.patch
@@ -15,7 +15,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
 
 --- a/drivers/net/phy/mdio-i2c.c
 +++ b/drivers/net/phy/mdio-i2c.c
-@@ -33,17 +33,24 @@ static int i2c_mii_read(struct mii_bus *
+@@ -32,17 +32,24 @@ static int i2c_mii_read(struct mii_bus *
  {
  	struct i2c_adapter *i2c = bus->priv;
  	struct i2c_msg msgs[2];
@@ -43,7 +43,7 @@ Signed-off-by: Russell King <rmk+kernel at armlinux.org.uk>
  	msgs[1].addr = bus_addr;
  	msgs[1].flags = I2C_M_RD;
  	msgs[1].len = sizeof(data);
-@@ -61,18 +68,23 @@ static int i2c_mii_write(struct mii_bus
+@@ -60,18 +67,23 @@ static int i2c_mii_write(struct mii_bus
  	struct i2c_adapter *i2c = bus->priv;
  	struct i2c_msg msg;
  	int ret;
diff --git a/target/linux/imx6/patches-5.4/007-v5.8-ARM-dts-imx6qdl-gw560x-add-lsm9ds1-iio-imu-magn-supp.patch b/target/linux/imx6/patches-5.4/007-v5.8-ARM-dts-imx6qdl-gw560x-add-lsm9ds1-iio-imu-magn-supp.patch
index 537b6f4d67..e0cea1bb59 100644
--- a/target/linux/imx6/patches-5.4/007-v5.8-ARM-dts-imx6qdl-gw560x-add-lsm9ds1-iio-imu-magn-supp.patch
+++ b/target/linux/imx6/patches-5.4/007-v5.8-ARM-dts-imx6qdl-gw560x-add-lsm9ds1-iio-imu-magn-supp.patch
@@ -48,7 +48,7 @@ Signed-off-by: Shawn Guo <shawnguo at kernel.org>
  };
  
  &i2c3 {
-@@ -609,6 +628,12 @@
+@@ -608,6 +627,12 @@
  		>;
  	};
  
@@ -61,7 +61,7 @@ Signed-off-by: Shawn Guo <shawnguo at kernel.org>
  	pinctrl_keypad: keypadgrp {
  		fsl,pins = <
  			MX6QDL_PAD_DISP0_DAT17__GPIO5_IO11	0x0001b0b0 /* KEYPAD_IRQ# */
-@@ -616,6 +641,12 @@
+@@ -615,6 +640,12 @@
  		>;
  	};
  
diff --git a/target/linux/ipq806x/patches-5.4/092-1-v5.7-qcom-cpufreq-nvmem-Add-support-for-krait-based-socs.patch b/target/linux/ipq806x/patches-5.4/092-1-v5.7-qcom-cpufreq-nvmem-Add-support-for-krait-based-socs.patch
index bdf0f8f2b9..06b18b3852 100644
--- a/target/linux/ipq806x/patches-5.4/092-1-v5.7-qcom-cpufreq-nvmem-Add-support-for-krait-based-socs.patch
+++ b/target/linux/ipq806x/patches-5.4/092-1-v5.7-qcom-cpufreq-nvmem-Add-support-for-krait-based-socs.patch
@@ -46,7 +46,7 @@ Signed-off-by: Viresh Kumar <viresh.kumar at linaro.org>
  	select PM_OPP
 --- a/drivers/cpufreq/cpufreq-dt-platdev.c
 +++ b/drivers/cpufreq/cpufreq-dt-platdev.c
-@@ -140,6 +140,11 @@ static const struct of_device_id blackli
+@@ -141,6 +141,11 @@ static const struct of_device_id blackli
  	{ .compatible = "ti,am43", },
  	{ .compatible = "ti,dra7", },
  
diff --git a/target/linux/layerscape/patches-5.4/701-net-0262-net-dsa-ocelot-add-tagger-for-Ocelot-Felix-switches.patch b/target/linux/layerscape/patches-5.4/701-net-0262-net-dsa-ocelot-add-tagger-for-Ocelot-Felix-switches.patch
index 5304bbca0a..a6bc7d846e 100644
--- a/target/linux/layerscape/patches-5.4/701-net-0262-net-dsa-ocelot-add-tagger-for-Ocelot-Felix-switches.patch
+++ b/target/linux/layerscape/patches-5.4/701-net-0262-net-dsa-ocelot-add-tagger-for-Ocelot-Felix-switches.patch
@@ -39,7 +39,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -17356,6 +17356,13 @@ S:	Maintained
+@@ -17357,6 +17357,13 @@ S:	Maintained
  F:	drivers/input/serio/userio.c
  F:	include/uapi/linux/userio.h
  
diff --git a/target/linux/layerscape/patches-5.4/701-net-0263-net-dsa-ocelot-add-driver-for-Felix-switch-family.patch b/target/linux/layerscape/patches-5.4/701-net-0263-net-dsa-ocelot-add-driver-for-Felix-switch-family.patch
index 5dc50c5ee6..b0831675a7 100644
--- a/target/linux/layerscape/patches-5.4/701-net-0263-net-dsa-ocelot-add-driver-for-Felix-switch-family.patch
+++ b/target/linux/layerscape/patches-5.4/701-net-0263-net-dsa-ocelot-add-driver-for-Felix-switch-family.patch
@@ -57,7 +57,7 @@ Signed-off-by: David S. Miller <davem at davemloft.net>
 
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -17361,6 +17361,7 @@ M:	Vladimir Oltean <vladimir.oltean at nxp.
+@@ -17362,6 +17362,7 @@ M:	Vladimir Oltean <vladimir.oltean at nxp.
  M:	Claudiu Manoil <claudiu.manoil at nxp.com>
  L:	netdev at vger.kernel.org
  S:	Maintained
diff --git a/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch b/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch
index 70e96ca0cb..5730adcd64 100644
--- a/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch
+++ b/target/linux/layerscape/patches-5.4/820-usb-0015-MLK-17380-4-usb-host-xhci-add-EH-SINGLE_STEP_SET_FEA.patch
@@ -174,7 +174,7 @@ Signed-off-by: Peter Chen <peter.chen at nxp.com>
   * bursts that are required to move all packets in this TD.  Only SuperSpeed
 --- a/drivers/usb/host/xhci.c
 +++ b/drivers/usb/host/xhci.c
-@@ -5429,6 +5429,7 @@ static const struct hc_driver xhci_hc_dr
+@@ -5430,6 +5430,7 @@ static const struct hc_driver xhci_hc_dr
  	.disable_usb3_lpm_timeout =	xhci_disable_usb3_lpm_timeout,
  	.find_raw_port_number =	xhci_find_raw_port_number,
  	.clear_tt_buffer_complete = xhci_clear_tt_buffer_complete,
diff --git a/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch b/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch
index 12113dc831..7d82cd64ee 100644
--- a/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch
+++ b/target/linux/layerscape/patches-5.4/820-usb-0018-MLK-18794-1-usb-host-xhci-add-.bus_suspend-override.patch
@@ -24,7 +24,7 @@ Signed-off-by: Peter Chen <peter.chen at nxp.com>
 
 --- a/drivers/usb/host/xhci.c
 +++ b/drivers/usb/host/xhci.c
-@@ -5452,6 +5452,8 @@ void xhci_init_driver(struct hc_driver *
+@@ -5453,6 +5453,8 @@ void xhci_init_driver(struct hc_driver *
  			drv->reset_bandwidth = over->reset_bandwidth;
  		if (over->update_hub_device)
  			drv->update_hub_device = over->update_hub_device;



From lede-commits at lists.infradead.org  Sat Feb 18 11:03:18 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 14:03:18 -0500
Subject: [openwrt/openwrt]  ipq806x: chromium: Enable kmod-ramoops by default
In-Reply-To: <167674699432.381641.14776898892947381649@git-01.infra.openwrt.org>
References: <167674699432.381641.14776898892947381649@git-01.infra.openwrt.org>
Message-ID: <mailman.17153.1676747009.3064139.lede-commits@lists.infradead.org>

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

commit a79abd813da1976ef3ff2093973b7dae7a90882c
Author: Brian Norris <computersforpeace at gmail.com>
AuthorDate: Sat Feb 4 16:35:34 2023 -0800

    ipq806x: chromium: Enable kmod-ramoops by default
    
    Chromium devices (like OnHub) have ramoops memory reserved by the
    bootloader. Let's enable the ramoops kernel module by default, so we get
    better crash logging.
    
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 target/linux/ipq806x/image/chromium.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/target/linux/ipq806x/image/chromium.mk b/target/linux/ipq806x/image/chromium.mk
index f908472419..ba98929976 100644
--- a/target/linux/ipq806x/image/chromium.mk
+++ b/target/linux/ipq806x/image/chromium.mk
@@ -35,10 +35,14 @@ define Device/OnhubImage
 	IMAGES := factory.bin sysupgrade.bin
 	IMAGE/factory.bin := cros-gpt | append-kernel-part | append-rootfs
 	IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+	# Note: Chromium/Depthcharge-based bootloaders insert a reserved-memory
+	# ramoops node into the Device Tree automatically, so we can use
+	# kmod-ramoops.
 	DEVICE_PACKAGES := ath10k-firmware-qca988x-ct e2fsprogs kmod-fs-ext4 losetup \
 			   partx-utils mkf2fs kmod-fs-f2fs \
 			   ucode kmod-google-firmware kmod-tpm-i2c-infineon \
-			   kmod-sound-soc-ipq8064-storm kmod-usb-storage
+			   kmod-sound-soc-ipq8064-storm kmod-usb-storage \
+			   kmod-ramoops
 endef
 
 define Device/asus_onhub



From lede-commits at lists.infradead.org  Sat Feb 18 11:03:16 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 14:03:16 -0500
Subject: [openwrt/openwrt]  ramips: add support for Huasifei WS1208V2
In-Reply-To: <167674699432.381641.14776898892947381649@git-01.infra.openwrt.org>
References: <167674699432.381641.14776898892947381649@git-01.infra.openwrt.org>
Message-ID: <mailman.17154.1676747009.3064139.lede-commits@lists.infradead.org>

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

commit efbb623debef3c63eebc9b849f6ca57130efa5f4
Author: Ar?n? ?NAL <arinc.unal at arinc9.com>
AuthorDate: Sat Feb 4 10:52:29 2023 +0300

    ramips: add support for Huasifei WS1208V2
    
    The Huasifei WS1208V2 is an AC1200 router featuring 5 Ethernet ports with a
    Quectel RM520N-GL cellular modem which supports QMI and MBIM modes.
    
    Specifications:
    - MT7621AT, 256 MiB RAM, 16 MiB SPI Flash
    - MT7603EN 2.4 GHz & MT7612EN 5 GHz WLAN
    - Quectel RM520N-GL Cellular Modem
    - 2 WLAN & 4 Cellular Antennas
    - 5 Gigabit Ethernet Ports
    - 1 USB 2.0 port
    - 1 PCI-E Slot
    - 1 M.2 slot
    - 1 SIM card slot
    - 1 SD card slot
    
    Installation:
    - Install sysupgrade image via ROOter OS.
    
    TFTP Recovery:
    - Connect to serial console.
    - Boot initramfs image by choosing option 1 when U-Boot prompts.
    - Install sysupgrade image via OpenWrt.
    
    Link: https://www.huasifei.com/a/Products/5G%20CPE/240.html
    Signed-off-by: Ar?n? ?NAL <arinc.unal at arinc9.com>
---
 .../linux/ramips/dts/mt7621_huasifei_ws1208v2.dts  | 185 +++++++++++++++++++++
 target/linux/ramips/image/mt7621.mk                |  12 ++
 .../ramips/mt7621/base-files/etc/board.d/01_leds   |   3 +
 3 files changed, 200 insertions(+)

diff --git a/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts b/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts
new file mode 100644
index 0000000000..fe77f65207
--- /dev/null
+++ b/target/linux/ramips/dts/mt7621_huasifei_ws1208v2.dts
@@ -0,0 +1,185 @@
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+	compatible = "huasifei,ws1208v2", "mediatek,mt7621-soc";
+	model = "Huasifei WS1208V2";
+
+	aliases {
+		led-boot = &led_status;
+		led-failsafe = &led_status;
+		led-running = &led_status;
+		led-upgrade = &led_status;
+		label-mac-device = &gmac0;
+	};
+
+	chosen {
+		bootargs = "console=ttyS0,115200";
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		button-reset {
+			label = "Reset";
+			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
+			linux,code = <KEY_RESTART>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_status: led-status {
+			label = "green:status";
+			gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+		};
+
+		led-cellular {
+			label = "green:cellular";
+			gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
+		};
+
+		led-wlan5g {
+			label = "green:wlan5g";
+			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy1tpt";
+		};
+
+		led-wlan2g {
+			label = "green:wlan2g";
+			gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy0tpt";
+		};
+
+		led-usb {
+			label = "green:usb";
+			gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
+			trigger-sources = <&xhci_ehci_port1>;
+			linux,default-trigger = "usbport";
+		};
+	};
+};
+
+&sdhci {
+	status = "okay";
+};
+
+&spi0 {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <10000000>;
+
+		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;
+
+				compatible = "nvmem-cells";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				macaddr_factory_e000: macaddr at e000 {
+					reg = <0xe000 0x6>;
+				};
+			};
+
+			partition at 50000 {
+				compatible = "denx,uimage";
+				reg = <0x50000 0xfb0000>;
+				label = "firmware";
+			};
+		};
+	};
+};
+
+&pcie {
+	status = "okay";
+};
+
+&pcie0 {
+	wifi at 0,0 {
+		compatible = "pci14c3,7603";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x0000>;
+	};
+};
+
+&pcie1 {
+	wifi at 0,0 {
+		compatible = "pci14c3,7662";
+		reg = <0x0000 0 0 0 0>;
+		mediatek,mtd-eeprom = <&factory 0x8000>;
+		ieee80211-freq-limit = <5000000 6000000>;
+
+		led {
+			led-sources = <2>;
+		};
+	};
+};
+
+&gmac0 {
+	nvmem-cells = <&macaddr_factory_e000>;
+	nvmem-cell-names = "mac-address";
+};
+
+&gmac1 {
+	status = "okay";
+	label = "wan";
+	phy-handle = <&ethphy4>;
+
+	nvmem-cells = <&macaddr_factory_e000>;
+	nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+	ethphy4: ethernet-phy at 4 {
+		reg = <4>;
+	};
+};
+
+&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";
+		};
+	};
+};
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index d53f9a27aa..d295f2f8c7 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -1068,6 +1068,18 @@ define Device/humax_e10
 endef
 TARGET_DEVICES += humax_e10
 
+define Device/huasifei_ws1208v2
+  $(Device/dsa-migration)
+  $(Device/uimage-lzma-loader)
+  IMAGE_SIZE := 16064k
+  DEVICE_VENDOR := Huasifei
+  DEVICE_MODEL := WS1208V2
+  DEVICE_PACKAGES := kmod-ata-ahci kmod-mt7603 kmod-mt76x2 kmod-sdhci-mt7620 \
+	kmod-usb3 kmod-usb-net-cdc-mbim kmod-usb-net-qmi-wwan \
+	kmod-usb-serial-option
+endef
+TARGET_DEVICES += huasifei_ws1208v2
+
 define Device/iodata_wn-ax1167gr
   $(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 211f1476ca..f54905cf5c 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
@@ -93,6 +93,9 @@ dlink,dir-882-r1)
 gnubee,gb-pc2)
 	ucidef_set_led_netdev "ethyellow" "ethyellow" "orange:ethyellow" "ethyellow" "link tx rx"
 	;;
+huasifei,ws1208v2)
+	ucidef_set_led_netdev "wwan0" "wwan0" "green:cellular" "wwan0" "link tx rx"
+	;;
 keenetic,kn-3010)
 	ucidef_set_led_netdev "internet" "internet" "green:internet" "wan"
 	;;



From lede-commits at lists.infradead.org  Sat Feb 18 11:03:20 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 14:03:20 -0500
Subject: [openwrt/openwrt]  wireguard-tools: remove unnecessary .mk includes
In-Reply-To: <167674699432.381641.14776898892947381649@git-01.infra.openwrt.org>
References: <167674699432.381641.14776898892947381649@git-01.infra.openwrt.org>
Message-ID: <mailman.17155.1676747011.3064139.lede-commits@lists.infradead.org>

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

commit 78dc8e2b13df439db92f233fe61d75959ffb57a6
Author: Andre Heider <a.heider at gmail.com>
AuthorDate: Thu Feb 16 12:50:56 2023 +0100

    wireguard-tools: remove unnecessary .mk includes
    
    Including kernel.mk moves the package build folder in the linux one, which
    is confusing since this isn't building any kernel modules.
    
    package-defaults.mk is already included my package.mk.
    
    Signed-off-by: Andre Heider <a.heider at gmail.com>
---
 package/network/utils/wireguard-tools/Makefile | 2 --
 1 file changed, 2 deletions(-)

diff --git a/package/network/utils/wireguard-tools/Makefile b/package/network/utils/wireguard-tools/Makefile
index 8218171fcd..5d52dd37e8 100644
--- a/package/network/utils/wireguard-tools/Makefile
+++ b/package/network/utils/wireguard-tools/Makefile
@@ -7,7 +7,6 @@
 # See /LICENSE for more information.
 
 include $(TOPDIR)/rules.mk
-include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=wireguard-tools
 
@@ -24,7 +23,6 @@ PKG_LICENSE_FILES:=COPYING
 PKG_BUILD_PARALLEL:=1
 
 include $(INCLUDE_DIR)/package.mk
-include $(INCLUDE_DIR)/package-defaults.mk
 
 MAKE_PATH:=src
 MAKE_VARS += PLATFORM=linux



From lede-commits at lists.infradead.org  Sat Feb 18 11:03:19 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 14:03:19 -0500
Subject: [openwrt/openwrt]  ipq40xx: chromium: Enable kmod-ramoops by default
In-Reply-To: <167674699432.381641.14776898892947381649@git-01.infra.openwrt.org>
References: <167674699432.381641.14776898892947381649@git-01.infra.openwrt.org>
Message-ID: <mailman.17156.1676747011.3064139.lede-commits@lists.infradead.org>

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

commit 46ea81ba9918020cb4a9e81536f9b50c48ed9a5c
Author: Brian Norris <computersforpeace at gmail.com>
AuthorDate: Sat Feb 4 16:35:35 2023 -0800

    ipq40xx: chromium: Enable kmod-ramoops by default
    
    Chromium devices (like Google WiFi) have ramoops memory reserved by the
    bootloader. Let's enable the ramoops kernel module by default, so we get
    better crash logging.
    
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 target/linux/ipq40xx/image/chromium.mk | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/target/linux/ipq40xx/image/chromium.mk b/target/linux/ipq40xx/image/chromium.mk
index 2abd2df02a..f6ac69ecf1 100644
--- a/target/linux/ipq40xx/image/chromium.mk
+++ b/target/linux/ipq40xx/image/chromium.mk
@@ -30,7 +30,11 @@ define Device/google_wifi
 	KERNEL_NAME := zImage
 	IMAGES += factory.bin
 	IMAGE/factory.bin := cros-gpt | append-kernel-part | append-rootfs
+	# Note: Chromium/Depthcharge-based bootloaders insert a reserved-memory
+	# ramoops node into the Device Tree automatically, so we can use
+	# kmod-ramoops.
 	DEVICE_PACKAGES := partx-utils mkf2fs e2fsprogs \
-			   kmod-fs-ext4 kmod-fs-f2fs kmod-google-firmware
+			   kmod-fs-ext4 kmod-fs-f2fs kmod-google-firmware \
+			   kmod-ramoops
 endef
 TARGET_DEVICES += google_wifi



From lede-commits at lists.infradead.org  Sat Feb 18 11:03:14 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 14:03:14 -0500
Subject: [openwrt/openwrt]  kernel: can: fix MCP251x CAN controller module
 autoload
In-Reply-To: <167674699432.381641.14776898892947381649@git-01.infra.openwrt.org>
References: <167674699432.381641.14776898892947381649@git-01.infra.openwrt.org>
Message-ID: <mailman.17157.1676747011.3064139.lede-commits@lists.infradead.org>

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

commit 29d02d8ce584fa7e420204e04dde1e17e14e009c
Author: Tim Harvey <tharvey at gateworks.com>
AuthorDate: Fri Feb 17 16:53:18 2023 -0800

    kernel: can: fix MCP251x CAN controller module autoload
    
    Fix autoload module name for can-mcp251x kmod.
    
    Signed-off-by: Tim Harvey <tharvey at gateworks.com>
---
 package/kernel/linux/modules/can.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/linux/modules/can.mk b/package/kernel/linux/modules/can.mk
index 9cdebb9091..4ff85d1c01 100644
--- a/package/kernel/linux/modules/can.mk
+++ b/package/kernel/linux/modules/can.mk
@@ -152,7 +152,7 @@ define KernelPackage/can-mcp251x
 	CONFIG_SPI=y \
 	CONFIG_CAN_MCP251X
   FILES:=$(LINUX_DIR)/drivers/net/can/spi/mcp251x.ko
-  AUTOLOAD:=$(call AutoProbe,can-mcp251x)
+  AUTOLOAD:=$(call AutoProbe,mcp251x)
   $(call AddDepends/can)
 endef
 



From lede-commits at lists.infradead.org  Sat Feb 18 11:03:17 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 14:03:17 -0500
Subject: [openwrt/openwrt]  kernel: kmod-ramoops: Include pstore console
 support
In-Reply-To: <167674699432.381641.14776898892947381649@git-01.infra.openwrt.org>
References: <167674699432.381641.14776898892947381649@git-01.infra.openwrt.org>
Message-ID: <mailman.17158.1676747011.3064139.lede-commits@lists.infradead.org>

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

commit a3adbec37061e56e7161f28140272cdd86b1dc38
Author: Brian Norris <computersforpeace at gmail.com>
AuthorDate: Sat Feb 4 16:35:33 2023 -0800

    kernel: kmod-ramoops: Include pstore console support
    
    Pstore ramoops support is useful even when there isn't an explicit
    panic/crash. We can log all kernel messages via a "console", and then
    retrieve them in the event of some non-kernel-panic reset (e.g.,
    watchdog).
    
    Since the buffer memory is already reserved, there isn't much overhead
    to doing this.
    
    The new console files will show up as:
    
      /sys/fs/pstore/console-ramoops-N
    
    Cc: Hannu Nyman <hannu.nyman at iki.fi>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 package/kernel/linux/modules/other.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/kernel/linux/modules/other.mk b/package/kernel/linux/modules/other.mk
index 2bd15dfe67..1369a4ad54 100644
--- a/package/kernel/linux/modules/other.mk
+++ b/package/kernel/linux/modules/other.mk
@@ -834,7 +834,8 @@ define KernelPackage/ramoops
   SUBMENU:=$(OTHER_MENU)
   TITLE:=Ramoops (pstore-ram)
   DEFAULT:=m if ALL_KMODS
-  KCONFIG:=CONFIG_PSTORE_RAM
+  KCONFIG:=CONFIG_PSTORE_RAM \
+	CONFIG_PSTORE_CONSOLE=y
   DEPENDS:=+kmod-pstore +kmod-reed-solomon
   FILES:= $(LINUX_DIR)/fs/pstore/ramoops.ko
   AUTOLOAD:=$(call AutoLoad,30,ramoops,1)



From lede-commits at lists.infradead.org  Sat Feb 18 11:03:15 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 14:03:15 -0500
Subject: [openwrt/openwrt]  elfutils: fix build with GCC 11
In-Reply-To: <167674699432.381641.14776898892947381649@git-01.infra.openwrt.org>
References: <167674699432.381641.14776898892947381649@git-01.infra.openwrt.org>
Message-ID: <mailman.17159.1676747011.3064139.lede-commits@lists.infradead.org>

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

commit 0859c7129f40fa40c0170a1d436b06aa543d8d26
Author: Andre Heider <a.heider at gmail.com>
AuthorDate: Tue Feb 7 20:23:06 2023 +0100

    elfutils: fix build with GCC 11
    
    GCC 11 doesn't know about -Wno-error=use-after-free and aborts
    compilation.
    
    Fixes: 2748c45d "elfutils: Ignore wrong use-after-free error"
    Signed-off-by: Andre Heider <a.heider at gmail.com>
---
 package/libs/elfutils/Makefile | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile
index 1e41e296b3..717403c124 100644
--- a/package/libs/elfutils/Makefile
+++ b/package/libs/elfutils/Makefile
@@ -81,7 +81,15 @@ HOST_CONFIGURE_VARS += \
 CONFIGURE_VARS += \
 	ac_cv_search__obstack_free=yes
 
-TARGET_CFLAGS += -D_GNU_SOURCE -Wno-unused-result -Wno-format-nonliteral -Wno-error=use-after-free
+TARGET_CFLAGS += \
+	-D_GNU_SOURCE \
+	-Wno-unused-result \
+	-Wno-format-nonliteral
+
+ifneq ($(CONFIG_GCC_USE_VERSION_11),y)
+TARGET_CFLAGS += \
+	-Wno-error=use-after-free
+endif
 
 define Build/InstallDev
 	$(INSTALL_DIR) $(1)/usr/include



From lede-commits at lists.infradead.org  Sat Feb 18 12:14:53 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 18 Feb 2023 15:14:53 -0500
Subject: [openwrt/openwrt]  tools/squashfs: rename to squashfs3-lzma
In-Reply-To: <167675129339.424986.13295909761239829238@git-01.infra.openwrt.org>
References: <167675129339.424986.13295909761239829238@git-01.infra.openwrt.org>
Message-ID: <mailman.17162.1676751308.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/01262c921c7cbafc9a32b912e42c58982f47725c

commit 01262c921c7cbafc9a32b912e42c58982f47725c
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Mon Feb 6 23:07:24 2023 +0100

    tools/squashfs: rename to squashfs3-lzma
    
    The name of squashfs is confusing since in reality it's a really old
    version using an old lzma library. This tools is used for old ath79
    netgear target and to produde a fake squasfs3 image needed for some
    specific bootloader from some OEM (AVM for example)
    
    Rename squashfs tool to squasfs3-lzma to better describe it.
    Rename the installed bin from mksquashfs-lzma to mksquashfs3-lzma.
    Use tar transform to migrate the root directory in tar to the new
    naming.
    Drop redundant PKG_CAT variable not needed anymore.
    Also update any user of this tool.
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 include/image-commands.mk                           |  2 +-
 target/linux/ath79/image/common-netgear.mk          |  2 +-
 tools/Makefile                                      |  4 ++--
 tools/{squashfs => squashfs3-lzma}/Makefile         | 21 +++++++++++++--------
 .../patches/100-lzma.patch                          |  0
 .../patches/110-no_nonstatic_inline.patch           |  0
 .../patches/120-add-fixed-timestamp-support.patch   |  0
 .../patches/130-include_sysmacros.patch             |  0
 .../patches/140-gcc-10-fix.patch                    |  0
 9 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/include/image-commands.mk b/include/image-commands.mk
index 70055cc576..47d9d1ab88 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -106,7 +106,7 @@ endef
 define Build/append-squashfs-fakeroot-be
 	rm -rf $@.fakefs $@.fakesquashfs
 	mkdir $@.fakefs
-	$(STAGING_DIR_HOST)/bin/mksquashfs-lzma \
+	$(STAGING_DIR_HOST)/bin/mksquashfs3-lzma \
 		$@.fakefs $@.fakesquashfs \
 		-noappend -root-owned -be -nopad -b 65536 \
 		$(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
diff --git a/target/linux/ath79/image/common-netgear.mk b/target/linux/ath79/image/common-netgear.mk
index 5a61caf1f6..c3b20cf1dc 100644
--- a/target/linux/ath79/image/common-netgear.mk
+++ b/target/linux/ath79/image/common-netgear.mk
@@ -12,7 +12,7 @@ define Build/netgear-squashfs
 	rm -rf $@.fs $@.squashfs
 	mkdir -p $@.fs/image
 	cp $@ $@.fs/image/uImage
-	$(STAGING_DIR_HOST)/bin/mksquashfs-lzma  \
+	$(STAGING_DIR_HOST)/bin/mksquashfs3-lzma  \
 		$@.fs $@.squashfs -be \
 		-noappend -root-owned -b 65536 \
 		$(if $(SOURCE_DATE_EPOCH),-fixed-time $(SOURCE_DATE_EPOCH))
diff --git a/tools/Makefile b/tools/Makefile
index 7b3a8eb142..aa80ee4ba6 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -71,7 +71,7 @@ tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_LZ4_TOOLS),y) += lz4
 tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_LZO_TOOLS),y) += lzop
 tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(BUILD_TOOLCHAIN),y) += gmp mpc mpfr
 tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_apm821xx)$(CONFIG_TARGET_gemini),y) += genext2fs
-tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_ath79),y) += lzma-old squashfs
+tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_ath79),y) += lzma-old squashfs3-lzma
 tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_mxs),y) += elftosb sdimage
 tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_realtek),y) += 7z
 tools-$(if $(CONFIG_BUILD_ALL_HOST_TOOLS)$(CONFIG_TARGET_tegra),y) += cbootimage cbootimage-configs
@@ -116,7 +116,7 @@ $(curdir)/patchelf/compile := $(curdir)/libtool/compile
 $(curdir)/pkgconf/compile := $(curdir)/meson/compile
 $(curdir)/quilt/compile := $(curdir)/autoconf/compile $(curdir)/findutils/compile
 $(curdir)/sdcc/compile := $(curdir)/bison/compile
-$(curdir)/squashfs/compile := $(curdir)/lzma-old/compile
+$(curdir)/squashfs3-lzma/compile := $(curdir)/lzma-old/compile
 $(curdir)/squashfskit4/compile := $(curdir)/xz/compile $(curdir)/zlib/compile
 $(curdir)/zstd/compile := $(curdir)/meson/compile
 
diff --git a/tools/squashfs/Makefile b/tools/squashfs3-lzma/Makefile
similarity index 60%
rename from tools/squashfs/Makefile
rename to tools/squashfs3-lzma/Makefile
index 385cf69d9d..b02018629e 100644
--- a/tools/squashfs/Makefile
+++ b/tools/squashfs3-lzma/Makefile
@@ -6,16 +6,21 @@
 #
 include $(TOPDIR)/rules.mk
 
-PKG_NAME:=squashfs
+PKG_NAME:=squashfs3-lzma
 PKG_CPE_ID:=cpe:/a:phillip_lougher:squashfs
 PKG_VERSION:=3.0
 
-PKG_SOURCE:=$(PKG_NAME)$(PKG_VERSION).tar.gz
+PKG_SOURCE:=squashfs$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/squashfs
 PKG_HASH:=39dbda43cf118536deb746c7730b468702d514a19f4cfab73b710e32908ddf20
-PKG_CAT:=zcat
 
-HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)$(PKG_VERSION)
+# Tar directory is squashfs3.0 that conflict with any pattern
+# currently using for host tools. (PKG_NAME-PKG_VERSION)
+# Also this got renamed to a more correct name
+# from squashfs to squashfs3-lzma.
+# Use tar transform to rename the root directory to this new
+# name.
+TAR_OPTIONS+=--transform=s/^squashfs/$(PKG_NAME)-/
 
 include $(INCLUDE_DIR)/host-build.mk
 
@@ -29,13 +34,13 @@ define Host/Compile
 endef
 
 define Host/Install
-	$(INSTALL_BIN) $(HOST_BUILD_DIR)/squashfs-tools/mksquashfs-lzma $(STAGING_DIR_HOST)/bin/
-	$(INSTALL_BIN) $(HOST_BUILD_DIR)/squashfs-tools/unsquashfs-lzma $(STAGING_DIR_HOST)/bin/
+	$(INSTALL_BIN) $(HOST_BUILD_DIR)/squashfs-tools/mksquashfs-lzma $(STAGING_DIR_HOST)/bin/mksquashfs3-lzma
+	$(INSTALL_BIN) $(HOST_BUILD_DIR)/squashfs-tools/unsquashfs-lzma $(STAGING_DIR_HOST)/bin/unsquashfs3-lzma
 endef
 
 define Host/Clean
-	rm -f $(STAGING_DIR_HOST)/bin/mksquashfs-lzma
-	rm -f $(STAGING_DIR_HOST)/bin/unsquashfs-lzma
+	rm -f $(STAGING_DIR_HOST)/bin/mksquashfs3-lzma
+	rm -f $(STAGING_DIR_HOST)/bin/unsquashfs3-lzma
 endef
 
 $(eval $(call HostBuild))
diff --git a/tools/squashfs/patches/100-lzma.patch b/tools/squashfs3-lzma/patches/100-lzma.patch
similarity index 100%
rename from tools/squashfs/patches/100-lzma.patch
rename to tools/squashfs3-lzma/patches/100-lzma.patch
diff --git a/tools/squashfs/patches/110-no_nonstatic_inline.patch b/tools/squashfs3-lzma/patches/110-no_nonstatic_inline.patch
similarity index 100%
rename from tools/squashfs/patches/110-no_nonstatic_inline.patch
rename to tools/squashfs3-lzma/patches/110-no_nonstatic_inline.patch
diff --git a/tools/squashfs/patches/120-add-fixed-timestamp-support.patch b/tools/squashfs3-lzma/patches/120-add-fixed-timestamp-support.patch
similarity index 100%
rename from tools/squashfs/patches/120-add-fixed-timestamp-support.patch
rename to tools/squashfs3-lzma/patches/120-add-fixed-timestamp-support.patch
diff --git a/tools/squashfs/patches/130-include_sysmacros.patch b/tools/squashfs3-lzma/patches/130-include_sysmacros.patch
similarity index 100%
rename from tools/squashfs/patches/130-include_sysmacros.patch
rename to tools/squashfs3-lzma/patches/130-include_sysmacros.patch
diff --git a/tools/squashfs/patches/140-gcc-10-fix.patch b/tools/squashfs3-lzma/patches/140-gcc-10-fix.patch
similarity index 100%
rename from tools/squashfs/patches/140-gcc-10-fix.patch
rename to tools/squashfs3-lzma/patches/140-gcc-10-fix.patch



From lede-commits at lists.infradead.org  Sun Feb 19 05:05:12 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 19 Feb 2023 08:05:12 -0500
Subject: [openwrt/openwrt]  mac80211: Update to version 5.10.168-1
In-Reply-To: <167681191209.1122411.15193624725780192082@git-01.infra.openwrt.org>
References: <167681191209.1122411.15193624725780192082@git-01.infra.openwrt.org>
Message-ID: <mailman.17282.1676811918.3064139.lede-commits@lists.infradead.org>

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

commit 8d995b3bd7aa1b13e7874515a8454349d240556d
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sun Jan 29 19:05:52 2023 +0100

    mac80211: Update to version 5.10.168-1
    
    This update mac80211 to version 5.10.168-1. This includes multiple
    bugfixes. Some of these bugfixes are fixing security relevant bugs.
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/mac80211/Makefile                           |  6 +++---
 ...mfmac-workaround-bug-with-some-inconsistent-BSSes.patch |  2 +-
 .../brcm/862-brcmfmac-Disable-power-management.patch       |  2 +-
 package/kernel/mac80211/patches/brcm/998-survey.patch      |  8 ++++----
 .../mac80211/patches/subsys/397-disable-mbssid.patch       | 14 +++++++-------
 5 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index e2505924cf..c70e71db5b 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.157-1
+PKG_VERSION:=5.10.168-1
 PKG_RELEASE:=1
-PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.10.157/
-PKG_HASH:=1ce937c49f2b39be00768fba83e214aad6612d469c92ccd06dc17b14e6cf3a64
+PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.10.168/
+PKG_HASH:=ba43215e99b367febaad507c94423b156c7af9a415d978fbc630e9e8d6641d73
 
 PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
diff --git a/package/kernel/mac80211/patches/brcm/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch b/package/kernel/mac80211/patches/brcm/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch
index 7b4cb250f9..e832f175f8 100644
--- a/package/kernel/mac80211/patches/brcm/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch
+++ b/package/kernel/mac80211/patches/brcm/861-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch
@@ -10,7 +10,7 @@ Signed-off-by: Rafa? Mi?ecki <zajec5 at gmail.com>
 
 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -715,8 +715,36 @@ static struct wireless_dev *brcmf_cfg802
+@@ -718,8 +718,36 @@ static struct wireless_dev *brcmf_cfg802
  	struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy);
  	struct brcmf_pub *drvr = cfg->pub;
  	struct wireless_dev *wdev;
diff --git a/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch b/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch
index 774656f1fd..d6e2c409f9 100644
--- a/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch
+++ b/package/kernel/mac80211/patches/brcm/862-brcmfmac-Disable-power-management.patch
@@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell <phil at raspberrypi.org>
 
 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -2961,6 +2961,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip
+@@ -2964,6 +2964,10 @@ brcmf_cfg80211_set_power_mgmt(struct wip
  	 * preference in cfg struct to apply this to
  	 * FW later while initializing the dongle
  	 */
diff --git a/package/kernel/mac80211/patches/brcm/998-survey.patch b/package/kernel/mac80211/patches/brcm/998-survey.patch
index beaf1ac872..79a4578c21 100644
--- a/package/kernel/mac80211/patches/brcm/998-survey.patch
+++ b/package/kernel/mac80211/patches/brcm/998-survey.patch
@@ -1,6 +1,6 @@
 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
 +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
-@@ -2913,6 +2913,63 @@ done:
+@@ -2916,6 +2916,63 @@ done:
  }
  
  static int
@@ -64,7 +64,7 @@
  brcmf_cfg80211_dump_station(struct wiphy *wiphy, struct net_device *ndev,
  			    int idx, u8 *mac, struct station_info *sinfo)
  {
-@@ -3008,6 +3065,7 @@ static s32 brcmf_inform_single_bss(struc
+@@ -3011,6 +3068,7 @@ static s32 brcmf_inform_single_bss(struc
  	struct brcmu_chan ch;
  	u16 channel;
  	u32 freq;
@@ -72,7 +72,7 @@
  	u16 notify_capability;
  	u16 notify_interval;
  	u8 *notify_ie;
-@@ -3032,6 +3090,17 @@ static s32 brcmf_inform_single_bss(struc
+@@ -3035,6 +3093,17 @@ static s32 brcmf_inform_single_bss(struc
  		band = NL80211_BAND_5GHZ;
  
  	freq = ieee80211_channel_to_frequency(channel, band);
@@ -90,7 +90,7 @@
  	bss_data.chan = ieee80211_get_channel(wiphy, freq);
  	bss_data.scan_width = NL80211_BSS_CHAN_WIDTH_20;
  	bss_data.boottime_ns = ktime_to_ns(ktime_get_boottime());
-@@ -5518,6 +5587,7 @@ static struct cfg80211_ops brcmf_cfg8021
+@@ -5521,6 +5590,7 @@ static struct cfg80211_ops brcmf_cfg8021
  	.leave_ibss = brcmf_cfg80211_leave_ibss,
  	.get_station = brcmf_cfg80211_get_station,
  	.dump_station = brcmf_cfg80211_dump_station,
diff --git a/package/kernel/mac80211/patches/subsys/397-disable-mbssid.patch b/package/kernel/mac80211/patches/subsys/397-disable-mbssid.patch
index 1582be891b..a8f151574e 100644
--- a/package/kernel/mac80211/patches/subsys/397-disable-mbssid.patch
+++ b/package/kernel/mac80211/patches/subsys/397-disable-mbssid.patch
@@ -10,7 +10,7 @@
  			continue;
 --- a/net/wireless/scan.c
 +++ b/net/wireless/scan.c
-@@ -2012,6 +2012,7 @@ static const struct element
+@@ -2013,6 +2013,7 @@ static const struct element
  	const struct element *next_mbssid;
  	const struct element *next_sub;
  
@@ -18,7 +18,7 @@
  	next_mbssid = cfg80211_find_elem(WLAN_EID_MULTIPLE_BSSID,
  					 mbssid_end,
  					 ielen - (mbssid_end - ie));
-@@ -2093,6 +2094,7 @@ static void cfg80211_parse_mbssid_data(s
+@@ -2094,6 +2095,7 @@ static void cfg80211_parse_mbssid_data(s
  	u16 capability;
  	struct cfg80211_bss *bss;
  
@@ -26,7 +26,7 @@
  	if (!non_tx_data)
  		return;
  	if (!cfg80211_find_ie(WLAN_EID_MULTIPLE_BSSID, ie, ielen))
-@@ -2253,6 +2255,7 @@ cfg80211_update_notlisted_nontrans(struc
+@@ -2254,6 +2256,7 @@ cfg80211_update_notlisted_nontrans(struc
  	const struct cfg80211_bss_ies *old;
  	size_t cpy_len;
  
@@ -34,11 +34,11 @@
  	lockdep_assert_held(&wiphy_to_rdev(wiphy)->bss_lock);
  
  	ie = mgmt->u.probe_resp.variable;
-@@ -2470,6 +2473,7 @@ cfg80211_inform_bss_frame_data(struct wi
- 
+@@ -2472,6 +2475,7 @@ cfg80211_inform_bss_frame_data(struct wi
  	res = cfg80211_inform_single_bss_frame_data(wiphy, data, mgmt,
  						    len, gfp);
+ 
 +	return res;
- 	if (!res || !wiphy->support_mbssid ||
- 	    !cfg80211_find_ie(WLAN_EID_MULTIPLE_BSSID, ie, ielen))
+ 	/* don't do any further MBSSID handling for S1G */
+ 	if (ieee80211_is_s1g_beacon(mgmt->frame_control))
  		return res;



From lede-commits at lists.infradead.org  Sun Feb 19 05:31:43 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 19 Feb 2023 08:31:43 -0500
Subject: [openwrt/openwrt]  base-files: sysfixtime: Fix time on the fake RTC
In-Reply-To: <167681350334.1140867.14726045726928519668@git-01.infra.openwrt.org>
References: <167681350334.1140867.14726045726928519668@git-01.infra.openwrt.org>
Message-ID: <mailman.17285.1676813511.3064139.lede-commits@lists.infradead.org>

981213 pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/fa08d900d4ec3bf0c2440b336a75f2b9bda29845

commit fa08d900d4ec3bf0c2440b336a75f2b9bda29845
Author: Yuan Tao <ty at wevs.org>
AuthorDate: Mon Sep 14 17:19:49 2020 +0800

    base-files: sysfixtime: Fix time on the fake RTC
    
    On some devices the chip has RTC but no battery save time.
    This leads back to getting the wrong time
    and skipping the check of the last file modification date.
    
    This commit ensures that the file time is checked even
    if the RTC exists.
    which would ordinarily return an approbiate
    system time used for e.g. certificate generation.
    
    Tested-on: NanoPi R2S
    
    Signed-off-by: Yuan Tao <ty at wevs.org>
---
 package/base-files/files/etc/init.d/sysfixtime | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/package/base-files/files/etc/init.d/sysfixtime b/package/base-files/files/etc/init.d/sysfixtime
index aab5b153d0..93f792266a 100755
--- a/package/base-files/files/etc/init.d/sysfixtime
+++ b/package/base-files/files/etc/init.d/sysfixtime
@@ -8,23 +8,33 @@ RTC_DEV=/dev/rtc0
 HWCLOCK=/sbin/hwclock
 
 boot() {
-	start && exit 0
-
-	local maxtime="$(maxtime)"
+	hwclock_load
+	local maxtime="$(find_max_time)"
 	local curtime="$(date +%s)"
-	[ $curtime -lt $maxtime ] && date -s @$maxtime
+	if [ $curtime -lt $maxtime ]; then
+		date -s @$maxtime
+		hwclock_save
+	fi
 }
 
 start() {
-	[ -e "$RTC_DEV" ] && [ -e "$HWCLOCK" ] && $HWCLOCK -s -u -f $RTC_DEV
+	hwclock_load
 }
 
 stop() {
+	hwclock_save
+}
+
+hwclock_load() {
+	[ -e "$RTC_DEV" ] && [ -e "$HWCLOCK" ] && $HWCLOCK -s -u -f $RTC_DEV
+}
+
+hwclock_save(){
 	[ -e "$RTC_DEV" ] && [ -e "$HWCLOCK" ] && $HWCLOCK -w -u -f $RTC_DEV && \
 		logger -t sysfixtime "saved '$(date)' to $RTC_DEV"
 }
 
-maxtime() {
+find_max_time() {
 	local file newest
 
 	for file in $( find /etc -type f ) ; do



From lede-commits at lists.infradead.org  Sun Feb 19 09:38:38 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 19 Feb 2023 12:38:38 -0500
Subject: [openwrt/openwrt]  ramips: add alternative device name for Wiflyer
 WF3526-P
In-Reply-To: <167682831787.1330960.18063390608436960411@git-01.infra.openwrt.org>
References: <167682831787.1330960.18063390608436960411@git-01.infra.openwrt.org>
Message-ID: <mailman.17358.1676828325.3064139.lede-commits@lists.infradead.org>

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

commit 68004f194217b7aaeef5d3163d2fb68f359ba6ad
Author: Shiji Yang <yangshiji66 at qq.com>
AuthorDate: Sun Feb 19 09:06:32 2023 +0800

    ramips: add alternative device name for Wiflyer WF3526-P
    
    Wiflyer WF3526-P and Zbtlink ZBT-WE1326 have the same circuit design.
    Installing the misunderstading firmware of ZBT-WE3526 will cause Wi-Fi
    not work due to allocate the wrong pcie port. Add alternative name to
    help users easily build or download the correct firmware.
    
    Signed-off-by: Shiji Yang <yangshiji66 at qq.com>
---
 target/linux/ramips/image/mt7621.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index d295f2f8c7..28f6fef681 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -2611,6 +2611,8 @@ define Device/zbtlink_zbt-we1326
   IMAGE_SIZE := 16064k
   DEVICE_VENDOR := Zbtlink
   DEVICE_MODEL := ZBT-WE1326
+  DEVICE_ALT0_VENDOR := Wiflyer
+  DEVICE_ALT0_MODEL := WF3526-P
   DEVICE_PACKAGES := kmod-mt7603 kmod-mt76x2 kmod-usb3 kmod-sdhci-mt7620
   SUPPORTED_DEVICES += zbt-we1326
 endef



From lede-commits at lists.infradead.org  Sun Feb 19 09:38:37 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 19 Feb 2023 12:38:37 -0500
Subject: [openwrt/openwrt]  ramips: correct the PCIe port number for Zbtlink
 ZBT-WE1326
In-Reply-To: <167682831787.1330960.18063390608436960411@git-01.infra.openwrt.org>
References: <167682831787.1330960.18063390608436960411@git-01.infra.openwrt.org>
Message-ID: <mailman.17359.1676828325.3064139.lede-commits@lists.infradead.org>

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

commit c77913be5be5f11a0f20dba1b45b96470099e8a8
Author: Shiji Yang <yangshiji66 at qq.com>
AuthorDate: Sun Feb 19 09:06:32 2023 +0800

    ramips: correct the PCIe port number for Zbtlink ZBT-WE1326
    
    MT7621 gets a new PCIe driver in the 5.15+ kernel. Allocating wrong PCIe
    port will cause the PCIe NIC to not work properly. This commit fixes
    the wrong port numbers on Zbtlink ZBT-WE1326.
    
    According to the bootlog, MT7612E (5 GHz) is connected to pcie1, and
    MT7603E (2 GHz) is connected to pcie2:
    [4.197658] mt7621-pci 1e140000.pcie: pcie0 no card, disable it (RST & CLK)
    [4.204609] mt7621-pci 1e140000.pcie: PCIE1 enabled
    [4.209476] mt7621-pci 1e140000.pcie: PCIE2 enabled
    ...
    [4.307988] pci 0000:01:00.0: [14c3:7662] type 00 class 0x028000
    [4.367206] pci 0000:02:00.0: [14c3:7603] type 00 class 0x028000
    
    Signed-off-by: Shiji Yang <yangshiji66 at qq.com>
---
 target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts
index 4e30dfb6c9..99b9652b7a 100644
--- a/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts
+++ b/target/linux/ramips/dts/mt7621_zbtlink_zbt-we1326.dts
@@ -121,7 +121,7 @@
 	status = "okay";
 };
 
-&pcie0 {
+&pcie1 {
 	wifi at 0,0 {
 		compatible = "mediatek,mt76";
 		reg = <0x0000 0 0 0 0>;
@@ -135,7 +135,7 @@
 	};
 };
 
-&pcie1 {
+&pcie2 {
 	wifi1: wifi at 0,0 {
 		compatible = "mediatek,mt76";
 		reg = <0x0000 0 0 0 0>;



From lede-commits at lists.infradead.org  Sun Feb 19 10:44:03 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 19 Feb 2023 13:44:03 -0500
Subject: [openwrt/openwrt]  hostapd: add quotes in assignments
In-Reply-To: <167683224337.1373282.6731801753448214373@git-01.infra.openwrt.org>
References: <167683224337.1373282.6731801753448214373@git-01.infra.openwrt.org>
Message-ID: <mailman.17371.1676832258.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/3c10c42ddd4741615b896e1d429ac7d6e91a980f

commit 3c10c42ddd4741615b896e1d429ac7d6e91a980f
Author: Leon M. Busch-George <leon at georgemail.eu>
AuthorDate: Wed Nov 23 18:22:36 2022 +0100

    hostapd: add quotes in assignments
    
    It's generally advised to use quotes for variable assignments in bash.
    
    Signed-off-by: Leon M. Busch-George <leon at georgemail.eu>
---
 package/network/services/hostapd/files/hostapd.sh | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index b165995d9f..70ad187a81 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -24,12 +24,12 @@ hostapd_append_wep_key() {
 		[1234])
 			for idx in 1 2 3 4; do
 				local zidx
-				zidx=$(($idx - 1))
+				zidx="$(($idx - 1))"
 				json_get_var ckey "key${idx}"
 				[ -n "$ckey" ] && \
 					append $var "wep_key${zidx}=$(prepare_key_wep "$ckey")" "$N$T"
 			done
-			wep_keyidx=$((key - 1))
+			wep_keyidx="$((key - 1))"
 		;;
 		*)
 			append $var "wep_key0=$(prepare_key_wep "$key")" "$N$T"
@@ -787,7 +787,7 @@ hostapd_set_bss_options() {
 		;;
 	esac
 
-	local auth_algs=$((($auth_mode_shared << 1) | $auth_mode_open))
+	local auth_algs="$((($auth_mode_shared << 1) | $auth_mode_open))"
 	append bss_conf "auth_algs=${auth_algs:-1}" "$N"
 	append bss_conf "wpa=$wpa" "$N"
 	[ -n "$wpa_pairwise" ] && append bss_conf "wpa_pairwise=$wpa_pairwise" "$N"
@@ -1156,7 +1156,7 @@ hostapd_set_bss_options() {
 		append bss_conf "$val" "$N"
 	done
 
-	bss_md5sum=$(echo $bss_conf | md5sum | cut -d" " -f1)
+	bss_md5sum="$(echo $bss_conf | md5sum | cut -d" " -f1)"
 	append bss_conf "config_id=$bss_md5sum" "$N"
 
 	append "$var" "$bss_conf" "$N"
@@ -1178,7 +1178,7 @@ hostapd_set_log_options() {
 	set_default log_iapp   1
 	set_default log_mlme   1
 
-	local log_mask=$(( \
+	local log_mask="$(( \
 		($log_80211  << 0) | \
 		($log_8021x  << 1) | \
 		($log_radius << 2) | \
@@ -1186,7 +1186,7 @@ hostapd_set_log_options() {
 		($log_driver << 4) | \
 		($log_iapp   << 5) | \
 		($log_mlme   << 6)   \
-	))
+	))"
 
 	append "$var" "logger_syslog=$log_mask" "$N"
 	append "$var" "logger_syslog_level=$log_level" "$N"



From lede-commits at lists.infradead.org  Sun Feb 19 10:44:04 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 19 Feb 2023 13:44:04 -0500
Subject: [openwrt/openwrt]  hostapd: always use sae_password for mesh/SAE auth
In-Reply-To: <167683224337.1373282.6731801753448214373@git-01.infra.openwrt.org>
References: <167683224337.1373282.6731801753448214373@git-01.infra.openwrt.org>
Message-ID: <mailman.17372.1676832261.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/ae751535de0cb46978bfcbacab882dd1082e59e3

commit ae751535de0cb46978bfcbacab882dd1082e59e3
Author: Leon M. Busch-George <leon at georgemail.eu>
AuthorDate: Wed Nov 23 17:40:08 2022 +0100

    hostapd: always use sae_password for mesh/SAE auth
    
    This patch fixes a corner case when using passwords that are exactly 64
    characters in length with mesh mode or passwords longer than 63 characters
    with SAE because 'psk' is used instead of 'sae_password'.
    SAE is obligatory for 802.11s (mesh point).
    
    The 'psk' option for hostapd is suited for WPA2 and enforces length
    restrictions on passwords. Values of 64 characters are treated as PMKs.
    With SAE, PMKs are always generated during the handshake and there are no
    length restrictions.
    The 'sae_password' option is more suited for SAE and should be used
    instead.
    
    Before this patch, the 'sae_password' option is only used with mesh mode
    passwords that are not 64 characters long.
    As a consequence:
    - mesh passwords can't be 64 characters in length
    - SAE only works with passwords with lengths >8 and <=63 (due to psk
      limitation).
    
    Fix this by always using 'sae_password' with SAE/mesh and applying the PMK
    differentiation only when PSK is used.
    
    Fixes: #11324
    Signed-off-by: Leon M. Busch-George <leon at georgemail.eu>
    [ improve commit description ]
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 package/network/services/hostapd/files/hostapd.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
index 70ad187a81..8c233a4e60 100644
--- a/package/network/services/hostapd/files/hostapd.sh
+++ b/package/network/services/hostapd/files/hostapd.sh
@@ -1372,11 +1372,11 @@ wpa_supplicant_add_network() {
 
 			key_mgmt="$wpa_key_mgmt"
 
-			if [ ${#key} -eq 64 ]; then
-				passphrase="psk=${key}"
+			if [ "$_w_mode" = "mesh" ] || [ "$auth_type" = "sae" ]; then
+				passphrase="sae_password=\"${key}\""
 			else
-				if [ "$_w_mode" = "mesh" ]; then
-					passphrase="sae_password=\"${key}\""
+				if [ ${#key} -eq 64 ]; then
+					passphrase="psk=${key}"
 				else
 					passphrase="psk=\"${key}\""
 				fi



From lede-commits at lists.infradead.org  Sun Feb 19 10:45:34 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 19 Feb 2023 13:45:34 -0500
Subject: [openwrt/openwrt]  toolchain/musl: remove libgcc_initial hack
In-Reply-To: <167683232807.1374587.2831536192442822309@git-01.infra.openwrt.org>
References: <167683232807.1374587.2831536192442822309@git-01.infra.openwrt.org>
Message-ID: <mailman.17373.1676832332.3064139.lede-commits@lists.infradead.org>

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

commit 4d384d28e44138c7619c0ab68b95cac21eeafbbf
Author: Andre Heider <a.heider at gmail.com>
AuthorDate: Thu Feb 9 11:06:31 2023 +0100

    toolchain/musl: remove libgcc_initial hack
    
    This reverts r15599 [0].
    
    This was added to fix an uclibc rebuild issue, but since uclibc
    isn't supported anymore [Fixes:] this can be removed.
    
    [0] https://git.openwrt.org/?p=openwrt/svn-archive/archive.git;a=commitdiff;h=016a052efeee6bc2da3f501a8c66b5aea20350b4
    
    Fixes: 63fb1752 "toolchain: remove uClibc-ng"
    Signed-off-by: Andre Heider <a.heider at gmail.com>
---
 toolchain/gcc/initial/Makefile | 4 ----
 toolchain/musl/Makefile        | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/toolchain/gcc/initial/Makefile b/toolchain/gcc/initial/Makefile
index 68a7ccd3c7..102fc070ae 100644
--- a/toolchain/gcc/initial/Makefile
+++ b/toolchain/gcc/initial/Makefile
@@ -23,10 +23,6 @@ define Host/Install
 		install-gcc \
 		install-target-libgcc
 
-	( cd $(TOOLCHAIN_DIR)/initial/lib/gcc/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) ; \
-		cp libgcc.a libgcc_initial.a; \
-	)
-
 	$(call FixupLibdir,$(TOOLCHAIN_DIR)/initial)
 	$$(call file_copy,$(TOOLCHAIN_DIR)/initial/.,$(TOOLCHAIN_DIR)/)
 endef
diff --git a/toolchain/musl/Makefile b/toolchain/musl/Makefile
index 2b9312bcbf..d441e37684 100644
--- a/toolchain/musl/Makefile
+++ b/toolchain/musl/Makefile
@@ -9,7 +9,7 @@ HOST_BUILD_PARALLEL:=1
 
 MUSL_MAKEOPTS = -C $(HOST_BUILD_DIR) \
 	DESTDIR="$(TOOLCHAIN_DIR)/" \
-	LIBCC="$(subst libgcc.a,libgcc_initial.a,$(shell $(TARGET_CC) -print-libgcc-file-name))"
+	LIBCC="$(shell $(TARGET_CC) -print-libgcc-file-name)"
 
 define Host/SetToolchainInfo
 	$(SED) 's,^\(LIBC_TYPE\)=.*,\1=$(PKG_NAME),' $(TOOLCHAIN_DIR)/info.mk



From lede-commits at lists.infradead.org  Sun Feb 19 10:45:31 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 19 Feb 2023 13:45:31 -0500
Subject: [openwrt/openwrt]  toolchain/binutils: get rid of outdated linaro
 version string hack
In-Reply-To: <167683232807.1374587.2831536192442822309@git-01.infra.openwrt.org>
References: <167683232807.1374587.2831536192442822309@git-01.infra.openwrt.org>
Message-ID: <mailman.17374.1676832332.3064139.lede-commits@lists.infradead.org>

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

commit fb0d0c0f7903d2230d1d8c5072082879b7377818
Author: Andre Heider <a.heider at gmail.com>
AuthorDate: Wed Feb 8 20:20:27 2023 +0100

    toolchain/binutils: get rid of outdated linaro version string hack
    
    This reverts commit 9d1b619cb1a7dd18cd12cab0d9f93452b10e2e11.
    
    No Linaro binutils are supported anymore, the leftover removal commit
    missed one line.
    
    Fixes: b648e1c0 "binutils: remove 2.25.1 support and leftovers of older versions"
    Signed-off-by: Andre Heider <a.heider at gmail.com>
---
 toolchain/binutils/Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile
index ef3123aeb6..636b8c4b11 100644
--- a/toolchain/binutils/Makefile
+++ b/toolchain/binutils/Makefile
@@ -84,7 +84,6 @@ define Host/Prepare
 	$(call Host/Prepare/Default)
 	ln -snf $(notdir $(HOST_BUILD_DIR)) $(BUILD_DIR_TOOLCHAIN)/$(PKG_NAME)
 	$(CP) $(SCRIPT_DIR)/config.{guess,sub} $(HOST_BUILD_DIR)/
-	$(SED) 's, " Linaro.*,,' $(HOST_BUILD_DIR)/bfd/version.h
 endef
 
 define Host/Compile



From lede-commits at lists.infradead.org  Sun Feb 19 10:45:32 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 19 Feb 2023 13:45:32 -0500
Subject: [openwrt/openwrt]  toolchain/gcc: remove glibc libgcc_eh hack
In-Reply-To: <167683232807.1374587.2831536192442822309@git-01.infra.openwrt.org>
References: <167683232807.1374587.2831536192442822309@git-01.infra.openwrt.org>
Message-ID: <mailman.17375.1676832334.3064139.lede-commits@lists.infradead.org>

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

commit eb093c517421465d8636fab5eb4fb890d0858a47
Author: Andre Heider <a.heider at gmail.com>
AuthorDate: Thu Feb 9 10:09:08 2023 +0100

    toolchain/gcc: remove glibc libgcc_eh hack
    
    A modern glibc only links against libgcc_eh for its tests or when building it
    static, which doesn't happen here.
    
    Reverts a hunk of: a3edea1b "add support for alternative C libraries..."
    
    Signed-off-by: Andre Heider <a.heider at gmail.com>
---
 toolchain/gcc/initial/Makefile | 2 --
 1 file changed, 2 deletions(-)

diff --git a/toolchain/gcc/initial/Makefile b/toolchain/gcc/initial/Makefile
index c71b17dd87..68a7ccd3c7 100644
--- a/toolchain/gcc/initial/Makefile
+++ b/toolchain/gcc/initial/Makefile
@@ -23,9 +23,7 @@ define Host/Install
 		install-gcc \
 		install-target-libgcc
 
-	# XXX: glibc insists on linking against libgcc_eh
 	( cd $(TOOLCHAIN_DIR)/initial/lib/gcc/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION) ; \
-		[ -e libgcc_eh.a ] || ln -sf libgcc.a libgcc_eh.a ; \
 		cp libgcc.a libgcc_initial.a; \
 	)
 



From lede-commits at lists.infradead.org  Sun Feb 19 10:45:29 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 19 Feb 2023 13:45:29 -0500
Subject: [openwrt/openwrt]  toolchain/binutils: get rid of ARC leftovers
In-Reply-To: <167683232807.1374587.2831536192442822309@git-01.infra.openwrt.org>
References: <167683232807.1374587.2831536192442822309@git-01.infra.openwrt.org>
Message-ID: <mailman.17376.1676832334.3064139.lede-commits@lists.infradead.org>

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

commit 1f1d1ff918748eacf32b1b6073094bb4f3e9e669
Author: Andre Heider <a.heider at gmail.com>
AuthorDate: Wed Feb 8 18:04:25 2023 +0100

    toolchain/binutils: get rid of ARC leftovers
    
    In [0] support for ARC specific binutils were added, which was later removed
    again [Fixes:].
    
    Upstream binutils never had an extlib.
    
    [0] 8b5d644b "toolchain: add support of ARC architecture"
    
    Fixes: 8568dcd9 "toolchain: Remove binutils 2.29 for ARC targets"
    Signed-off-by: Andre Heider <a.heider at gmail.com>
---
 toolchain/binutils/Makefile | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile
index af670f5646..0b7558e358 100644
--- a/toolchain/binutils/Makefile
+++ b/toolchain/binutils/Makefile
@@ -102,12 +102,6 @@ define Host/Install
 	$(call FixupLibdir,$(TOOLCHAIN_DIR)/initial)
 	$(RM) $(TOOLCHAIN_DIR)/initial/lib/libiberty.a
 	$(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(HOST_BUILD_PREFIX)/bin/readelf
-	# ARC gcc requires extlib.
-	# If extlib is not available in "initial" folder
-	# initial gcc will fail to build libc.
-	if [ -d $(TOOLCHAIN_DIR)/extlib ]; then \
-		$(CP) -r $(TOOLCHAIN_DIR)/extlib $(TOOLCHAIN_DIR)/initial/; \
-	fi
 endef
 
 define Host/Clean



From lede-commits at lists.infradead.org  Sun Feb 19 10:45:35 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 19 Feb 2023 13:45:35 -0500
Subject: [openwrt/openwrt]  toolchain: remove installing twice in the
 "initial" subdir
In-Reply-To: <167683232807.1374587.2831536192442822309@git-01.infra.openwrt.org>
References: <167683232807.1374587.2831536192442822309@git-01.infra.openwrt.org>
Message-ID: <mailman.17377.1676832334.3064139.lede-commits@lists.infradead.org>

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

commit 7ae4716243dda59bcff21ba0ee704322b2db10f4
Author: Andre Heider <a.heider at gmail.com>
AuthorDate: Tue Feb 7 21:33:33 2023 +0100

    toolchain: remove installing twice in the "initial" subdir
    
    This was apparently introduced to recreate the toolchain (wipe
    staging_dir/toolchain*, but keep build_dir/toolchain*, followed by a
    `make toolchain/compile`).
    
    But it leaves leftovers and causes re-links to happen at src_install phase,
    because of the changed paths, possibly adding yet another source of issues.
    
    With the prior commits removing various hacks related to the "initial"
    folder we can remove installing it twice altogether.
    
    The recreated toolchain is exactly the same as before.
    
    Signed-off-by: Andre Heider <a.heider at gmail.com>
---
 target/sdk/Makefile            | 1 -
 toolchain/binutils/Makefile    | 7 +------
 toolchain/gcc/initial/Makefile | 4 +---
 3 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/target/sdk/Makefile b/target/sdk/Makefile
index 89cc898e9d..d9f67dae9e 100644
--- a/target/sdk/Makefile
+++ b/target/sdk/Makefile
@@ -29,7 +29,6 @@ EXCLUDE_DIRS:= \
 	*/man \
 	*/info \
 	*/root-* \
-	initial \
 	*.install.clean \
 	*.install.flags \
 	*.install \
diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile
index 636b8c4b11..42778d8d69 100644
--- a/toolchain/binutils/Makefile
+++ b/toolchain/binutils/Makefile
@@ -91,14 +91,9 @@ define Host/Compile
 endef
 
 define Host/Install
-	mkdir -p $(TOOLCHAIN_DIR)/initial
 	$(MAKE) -C $(HOST_BUILD_DIR) \
-		prefix=$(TOOLCHAIN_DIR)/initial \
 		install
-	$(MAKE) -C $(HOST_BUILD_DIR) \
-		prefix=$(TOOLCHAIN_DIR) \
-		install
-	$(call FixupLibdir,$(TOOLCHAIN_DIR)/initial)
+	$(call FixupLibdir,$(TOOLCHAIN_DIR))
 	$(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(HOST_BUILD_PREFIX)/bin/readelf
 endef
 
diff --git a/toolchain/gcc/initial/Makefile b/toolchain/gcc/initial/Makefile
index 102fc070ae..7cb4a73dbc 100644
--- a/toolchain/gcc/initial/Makefile
+++ b/toolchain/gcc/initial/Makefile
@@ -19,12 +19,10 @@ endef
 
 define Host/Install
 	+$(GCC_MAKE) $(HOST_JOBS) -C $(GCC_BUILD_DIR) \
-		prefix="$(TOOLCHAIN_DIR)/initial" \
 		install-gcc \
 		install-target-libgcc
 
-	$(call FixupLibdir,$(TOOLCHAIN_DIR)/initial)
-	$$(call file_copy,$(TOOLCHAIN_DIR)/initial/.,$(TOOLCHAIN_DIR)/)
+	$(call FixupLibdir,$(TOOLCHAIN_DIR))
 endef
 
 $(eval $(call HostBuild))



From lede-commits at lists.infradead.org  Sun Feb 19 10:45:28 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 19 Feb 2023 13:45:28 -0500
Subject: [openwrt/openwrt]  toolchain/binutils: fill in missing
 GRAPHITE_CONFIGURE
In-Reply-To: <167683232807.1374587.2831536192442822309@git-01.infra.openwrt.org>
References: <167683232807.1374587.2831536192442822309@git-01.infra.openwrt.org>
Message-ID: <mailman.17378.1676832334.3064139.lede-commits@lists.infradead.org>

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

commit cd8366ad20e0596bf9a477453effb6dc9fe48b20
Author: Andre Heider <a.heider at gmail.com>
AuthorDate: Tue Jan 31 11:07:42 2023 +0100

    toolchain/binutils: fill in missing GRAPHITE_CONFIGURE
    
    This var is used further down, but it's empty.
    Fix that with the very same values gcc uses.
    
    Signed-off-by: Andre Heider <a.heider at gmail.com>
---
 toolchain/binutils/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile
index a0e112f8f6..af670f5646 100644
--- a/toolchain/binutils/Makefile
+++ b/toolchain/binutils/Makefile
@@ -37,6 +37,12 @@ PATCH_DIR:=./patches/$(PKG_VERSION)
 
 include $(INCLUDE_DIR)/toolchain-build.mk
 
+ifdef CONFIG_GCC_USE_GRAPHITE
+  GRAPHITE_CONFIGURE:= --with-isl=$(STAGING_DIR_HOST)
+else
+  GRAPHITE_CONFIGURE:= --without-isl --without-cloog
+endif
+
 HOST_CONFIGURE_ARGS = \
 	--prefix=$(TOOLCHAIN_DIR) \
 	--build=$(GNU_HOST_NAME) \



From lede-commits at lists.infradead.org  Sun Feb 19 10:45:33 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 19 Feb 2023 13:45:33 -0500
Subject: [openwrt/openwrt]  toolchain/glibc: fixup the libm.so linker script
 too
In-Reply-To: <167683232807.1374587.2831536192442822309@git-01.infra.openwrt.org>
References: <167683232807.1374587.2831536192442822309@git-01.infra.openwrt.org>
Message-ID: <mailman.17381.1676832334.3064139.lede-commits@lists.infradead.org>

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

commit 81fd360a6331ccaaf85440f9d5e1c9ed66e25f6b
Author: Andre Heider <a.heider at gmail.com>
AuthorDate: Mon Jan 30 10:55:53 2023 +0100

    toolchain/glibc: fixup the libm.so linker script too
    
    Add it to the existing list to fix it up.
    
    Found by mold:
    toolchain-x86_64_gcc-12.2.0_glibc/lib/libm.so:4: GROUP ( /lib/libm.so.6  AS_NEEDED ( /lib/libmvec.so.1 ) )
                                                             ^ library not found: /lib/libm.so.6
    
    Signed-off-by: Andre Heider <a.heider at gmail.com>
---
 toolchain/glibc/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toolchain/glibc/Makefile b/toolchain/glibc/Makefile
index 24526ceec2..bfb5598274 100644
--- a/toolchain/glibc/Makefile
+++ b/toolchain/glibc/Makefile
@@ -20,7 +20,7 @@ define Host/Install
 		install
 	( cd $(TOOLCHAIN_DIR) ; \
 		for d in lib usr/lib ; do \
-		  for f in libc.so libpthread.so libgcc_s.so ; do \
+		  for f in libc.so libm.so libpthread.so libgcc_s.so ; do \
 		    if [ -f $$$$d/$$$$f -a ! -L $$$$d/$$$$f ] ; then \
 		      $(SED) 's,/usr/lib/,,g;s,/lib/,,g' $$$$d/$$$$f ; \
 		    fi \



From lede-commits at lists.infradead.org  Sun Feb 19 10:45:30 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 19 Feb 2023 13:45:30 -0500
Subject: [openwrt/openwrt]  toolchain/binutils: get rid of outdated libiberty
 hack
In-Reply-To: <167683232807.1374587.2831536192442822309@git-01.infra.openwrt.org>
References: <167683232807.1374587.2831536192442822309@git-01.infra.openwrt.org>
Message-ID: <mailman.17382.1676832336.3064139.lede-commits@lists.infradead.org>

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

commit f090e6495d3a3ad989799b8e1522def09220cb19
Author: Andre Heider <a.heider at gmail.com>
AuthorDate: Wed Feb 8 18:58:05 2023 +0100

    toolchain/binutils: get rid of outdated libiberty hack
    
    This reverts commit 68fcb15f90edd92ef36990c5696b9e79df07a6ec.
    
    binutils syncs libiberty from gcc, which defaults to not installing itself
    since [0], see also [1].
    
    That change is apparently part of binutils 2.24, and the oldest supported
    version here is 2.37, hence we can remove this hack.
    
    [0] https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=48d7db63ff581b026e057badf39f1f23fdf47928
    [1] https://gcc.gnu.org/onlinedocs/libiberty/Using.html
    
    Signed-off-by: Andre Heider <a.heider at gmail.com>
---
 toolchain/binutils/Makefile | 1 -
 1 file changed, 1 deletion(-)

diff --git a/toolchain/binutils/Makefile b/toolchain/binutils/Makefile
index 0b7558e358..ef3123aeb6 100644
--- a/toolchain/binutils/Makefile
+++ b/toolchain/binutils/Makefile
@@ -100,7 +100,6 @@ define Host/Install
 		prefix=$(TOOLCHAIN_DIR) \
 		install
 	$(call FixupLibdir,$(TOOLCHAIN_DIR)/initial)
-	$(RM) $(TOOLCHAIN_DIR)/initial/lib/libiberty.a
 	$(CP) $(TOOLCHAIN_DIR)/bin/$(REAL_GNU_TARGET_NAME)-readelf $(HOST_BUILD_PREFIX)/bin/readelf
 endef
 



From lede-commits at lists.infradead.org  Mon Feb 20 04:00:18 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 20 Feb 2023 07:00:18 -0500
Subject: [openwrt/openwrt]  mac80211: fix mesh issues and improve performance
In-Reply-To: <167689441812.2183951.2262942716822078712@git-01.infra.openwrt.org>
References: <167689441812.2183951.2262942716822078712@git-01.infra.openwrt.org>
Message-ID: <mailman.17536.1676894425.3064139.lede-commits@lists.infradead.org>

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

commit 57db2280a2155c39f545ac712766a849cf45f62c
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Feb 15 19:40:02 2023 +0100

    mac80211: fix mesh issues and improve performance
    
    fix forwarding received mesh a-msdu packets
    add fast xmit support for mesh to improve performance
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...-wifi-mac80211-fix-qos-on-mesh-interfaces.patch |  35 +
 ...11-fix-race-in-mesh-sequence-number-assig.patch |  37 +
 .../319-wifi-mac80211-mesh-fast-xmit-support.patch | 764 +++++++++++++++++++++
 ...11-use-mesh-header-cache-to-speed-up-mesh.patch |  70 ++
 .../subsys/321-mac80211-fix-mesh-forwarding.patch  |  32 +
 .../500-mac80211_configure_antenna_gain.patch      |   2 +-
 6 files changed, 939 insertions(+), 1 deletion(-)

diff --git a/package/kernel/mac80211/patches/subsys/317-wifi-mac80211-fix-qos-on-mesh-interfaces.patch b/package/kernel/mac80211/patches/subsys/317-wifi-mac80211-fix-qos-on-mesh-interfaces.patch
new file mode 100644
index 0000000000..c60a88d2a6
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/317-wifi-mac80211-fix-qos-on-mesh-interfaces.patch
@@ -0,0 +1,35 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Wed, 15 Feb 2023 15:11:54 +0100
+Subject: [PATCH] wifi: mac80211: fix qos on mesh interfaces
+
+When ieee80211_select_queue is called for mesh, the sta pointer is usually
+NULL, since the nexthop is looked up much later in the tx path.
+Explicitly check for unicast address in that case in order to make qos work
+again.
+
+Fixes: 50e2ab392919 ("wifi: mac80211: fix queue selection for mesh/OCB interfaces")
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/net/mac80211/wme.c
++++ b/net/mac80211/wme.c
+@@ -147,6 +147,7 @@ u16 ieee80211_select_queue_80211(struct
+ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
+ 			   struct sta_info *sta, struct sk_buff *skb)
+ {
++	const struct ethhdr *eth = (void *)skb->data;
+ 	struct mac80211_qos_map *qos_map;
+ 	bool qos;
+ 
+@@ -154,8 +155,9 @@ u16 ieee80211_select_queue(struct ieee80
+ 	skb_get_hash(skb);
+ 
+ 	/* all mesh/ocb stations are required to support WME */
+-	if (sta && (sdata->vif.type == NL80211_IFTYPE_MESH_POINT ||
+-		    sdata->vif.type == NL80211_IFTYPE_OCB))
++	if ((sdata->vif.type == NL80211_IFTYPE_MESH_POINT &&
++	    !is_multicast_ether_addr(eth->h_dest)) ||
++	    (sdata->vif.type == NL80211_IFTYPE_OCB && sta))
+ 		qos = true;
+ 	else if (sta)
+ 		qos = sta->sta.wme;
diff --git a/package/kernel/mac80211/patches/subsys/318-wifi-mac80211-fix-race-in-mesh-sequence-number-assig.patch b/package/kernel/mac80211/patches/subsys/318-wifi-mac80211-fix-race-in-mesh-sequence-number-assig.patch
new file mode 100644
index 0000000000..05e368cd2e
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/318-wifi-mac80211-fix-race-in-mesh-sequence-number-assig.patch
@@ -0,0 +1,37 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Wed, 15 Feb 2023 15:21:37 +0100
+Subject: [PATCH] wifi: mac80211: fix race in mesh sequence number
+ assignment
+
+Since the sequence number is shared across different tx queues, it needs
+to be atomic in order to avoid accidental duplicate assignment
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/net/mac80211/ieee80211_i.h
++++ b/net/mac80211/ieee80211_i.h
+@@ -695,7 +695,7 @@ struct ieee80211_if_mesh {
+ 	struct mesh_stats mshstats;
+ 	struct mesh_config mshcfg;
+ 	atomic_t estab_plinks;
+-	u32 mesh_seqnum;
++	atomic_t mesh_seqnum;
+ 	bool accepting_plinks;
+ 	int num_gates;
+ 	struct beacon_data __rcu *beacon;
+--- a/net/mac80211/mesh.c
++++ b/net/mac80211/mesh.c
+@@ -752,10 +752,8 @@ unsigned int ieee80211_new_mesh_header(s
+ 
+ 	meshhdr->ttl = sdata->u.mesh.mshcfg.dot11MeshTTL;
+ 
+-	/* FIXME: racy -- TX on multiple queues can be concurrent */
+-	put_unaligned(cpu_to_le32(sdata->u.mesh.mesh_seqnum), &meshhdr->seqnum);
+-	sdata->u.mesh.mesh_seqnum++;
+-
++	put_unaligned_le32(atomic_inc_return(&sdata->u.mesh.mesh_seqnum),
++			   &meshhdr->seqnum);
+ 	if (addr4or5 && !addr6) {
+ 		meshhdr->flags |= MESH_FLAGS_AE_A4;
+ 		memcpy(meshhdr->eaddr1, addr4or5, ETH_ALEN);
diff --git a/package/kernel/mac80211/patches/subsys/319-wifi-mac80211-mesh-fast-xmit-support.patch b/package/kernel/mac80211/patches/subsys/319-wifi-mac80211-mesh-fast-xmit-support.patch
new file mode 100644
index 0000000000..4bd3d4c092
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/319-wifi-mac80211-mesh-fast-xmit-support.patch
@@ -0,0 +1,764 @@
+From: Sriram R <quic_srirrama at quicinc.com>
+Date: Thu, 18 Aug 2022 12:35:42 +0530
+Subject: [PATCH] wifi: mac80211: mesh fast xmit support
+
+Currently fast xmit is supported in AP, STA and other device types where
+the destination doesn't change for the lifetime of its association by
+caching the static parts of the header that can be reused directly for
+every Tx such as addresses and updates only mutable header fields such as
+PN.
+This technique is not directly applicable for a Mesh device type due
+to the dynamic nature of the topology and protocol. The header is built
+based on the destination mesh device which is proxying a certain external
+device and based on the Mesh destination the next hop changes.
+And the RA/A1 which is the next hop for reaching the destination can
+vary during runtime as per the best route based on airtime.  To accommodate
+these changes and to come up with a solution to avoid overhead during header
+generation, the headers comprising the MAC, Mesh and LLC part are cached
+whenever data for a certain external destination is sent.
+This cached header is reused every time a data is sent to that external
+destination.
+
+To ensure the changes in network are reflected in these cached headers,
+flush affected cached entries on path changes, as well as other conditions
+that currently trigger a fast xmit check in other modes (key changes etc.)
+
+In order to keep the cache small, use a short timeout for expiring cache
+entries.
+
+Co-developed-by: Felix Fietkau <nbd at nbd.name>
+Signed-off-by: Sriram R <quic_srirrama at quicinc.com>
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/net/mac80211/ieee80211_i.h
++++ b/net/mac80211/ieee80211_i.h
+@@ -37,6 +37,7 @@
+ extern const struct cfg80211_ops mac80211_config_ops;
+ 
+ struct ieee80211_local;
++struct mhdr_cache_entry;
+ 
+ /* Maximum number of broadcast/multicast frames to buffer when some of the
+  * associated stations are using power saving. */
+@@ -655,6 +656,20 @@ struct mesh_table {
+ 	atomic_t entries;		/* Up to MAX_MESH_NEIGHBOURS */
+ };
+ 
++/**
++ * struct mesh_hdr_cache - mesh fast xmit header cache
++ *
++ * @rhead: hash table containing struct mhdr_cache_entry, using skb DA as key
++ * @walk_head: linked list containing all mhdr_cache_entry objects
++ * @walk_lock: lock protecting walk_head and rhead
++ * @enabled: indicates if header cache is initialized
++ */
++struct mesh_hdr_cache {
++	struct rhashtable rhead;
++	struct hlist_head walk_head;
++	spinlock_t walk_lock;
++};
++
+ struct ieee80211_if_mesh {
+ 	struct timer_list housekeeping_timer;
+ 	struct timer_list mesh_path_timer;
+@@ -733,6 +748,7 @@ struct ieee80211_if_mesh {
+ 	struct mesh_table mpp_paths; /* Store paths for MPP&MAP */
+ 	int mesh_paths_generation;
+ 	int mpp_paths_generation;
++	struct mesh_hdr_cache hdr_cache;
+ };
+ 
+ #ifdef CPTCFG_MAC80211_MESH
+@@ -1998,6 +2014,9 @@ int ieee80211_tx_control_port(struct wip
+ 			      int link_id, u64 *cookie);
+ int ieee80211_probe_mesh_link(struct wiphy *wiphy, struct net_device *dev,
+ 			      const u8 *buf, size_t len);
++void __ieee80211_mesh_xmit_fast(struct ieee80211_sub_if_data *sdata,
++				struct mhdr_cache_entry *entry,
++				struct sk_buff *skb);
+ 
+ /* HT */
+ void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
+--- a/net/mac80211/mesh.c
++++ b/net/mac80211/mesh.c
+@@ -780,6 +780,8 @@ static void ieee80211_mesh_housekeeping(
+ 	changed = mesh_accept_plinks_update(sdata);
+ 	ieee80211_mbss_info_change_notify(sdata, changed);
+ 
++	mesh_hdr_cache_gc(sdata);
++
+ 	mod_timer(&ifmsh->housekeeping_timer,
+ 		  round_jiffies(jiffies +
+ 				IEEE80211_MESH_HOUSEKEEPING_INTERVAL));
+--- a/net/mac80211/mesh.h
++++ b/net/mac80211/mesh.h
+@@ -122,11 +122,49 @@ struct mesh_path {
+ 	u8 rann_snd_addr[ETH_ALEN];
+ 	u32 rann_metric;
+ 	unsigned long last_preq_to_root;
++	unsigned long fast_xmit_check;
+ 	bool is_root;
+ 	bool is_gate;
+ 	u32 path_change_count;
+ };
+ 
++#define MESH_HEADER_CACHE_MAX_SIZE		512
++#define MESH_HEADER_CACHE_THRESHOLD_SIZE	384
++#define MESH_HEADER_CACHE_TIMEOUT		8000 /* msecs */
++#define MESH_HEADER_MAX_LEN			68   /* mac+mesh+rfc1042 hdr */
++
++/**
++ * struct mhdr_cache_entry - Cached Mesh header entry
++ * @addr_key: The Ethernet DA which is the key for this entry
++ * @hdr: The cached header
++ * @machdr_len: Total length of the mac header
++ * @hdrlen: Length of this header entry
++ * @key: Key corresponding to the nexthop stored in the header
++ * @pn_offs: Offset to PN which is updated for every xmit
++ * @band:  band used for tx
++ * @walk_list: list containing all the cached header entries
++ * @rhash: rhashtable pointer
++ * @mpath: The Mesh path corresponding to the Mesh DA
++ * @mppath: The MPP entry corresponding to this DA
++ * @timestamp: Last used time of this entry
++ * @rcu: rcu to free this entry
++ * @path_change_count: Stored path change value corresponding to the mpath
++ */
++struct mhdr_cache_entry {
++	u8 addr_key[ETH_ALEN] __aligned(2);
++	u8 hdr[MESH_HEADER_MAX_LEN];
++	u16 machdr_len;
++	u16 hdrlen;
++	u8 pn_offs;
++	u8 band;
++	struct ieee80211_key __rcu *key;
++	struct hlist_node walk_list;
++	struct rhash_head rhash;
++	struct mesh_path *mpath, *mppath;
++	unsigned long timestamp;
++	struct rcu_head rcu;
++};
++
+ /* Recent multicast cache */
+ /* RMC_BUCKETS must be a power of 2, maximum 256 */
+ #define RMC_BUCKETS		256
+@@ -298,6 +336,15 @@ void mesh_path_discard_frame(struct ieee
+ void mesh_path_tx_root_frame(struct ieee80211_sub_if_data *sdata);
+ 
+ bool mesh_action_is_path_sel(struct ieee80211_mgmt *mgmt);
++struct mhdr_cache_entry *
++mesh_get_cached_hdr(struct ieee80211_sub_if_data *sdata, const u8 *addr);
++void mesh_cache_hdr(struct ieee80211_sub_if_data *sdata,
++		    struct sk_buff *skb, struct mesh_path *mpath);
++void mesh_hdr_cache_gc(struct ieee80211_sub_if_data *sdata);
++void mesh_hdr_cache_flush(struct ieee80211_sub_if_data *sdata, const u8 *addr,
++			  bool is_mpp);
++void mesh_refresh_path(struct ieee80211_sub_if_data *sdata,
++		       struct mesh_path *mpath, const u8 *addr);
+ 
+ #ifdef CPTCFG_MAC80211_MESH
+ static inline
+--- a/net/mac80211/mesh_hwmp.c
++++ b/net/mac80211/mesh_hwmp.c
+@@ -491,8 +491,11 @@ static u32 hwmp_route_info_get(struct ie
+ 		}
+ 
+ 		if (fresh_info) {
+-			if (rcu_access_pointer(mpath->next_hop) != sta)
++			if (rcu_access_pointer(mpath->next_hop) != sta) {
+ 				mpath->path_change_count++;
++				mesh_hdr_cache_flush(mpath->sdata, mpath->dst,
++						     false);
++			}
+ 			mesh_path_assign_nexthop(mpath, sta);
+ 			mpath->flags |= MESH_PATH_SN_VALID;
+ 			mpath->metric = new_metric;
+@@ -539,8 +542,11 @@ static u32 hwmp_route_info_get(struct ie
+ 		}
+ 
+ 		if (fresh_info) {
+-			if (rcu_access_pointer(mpath->next_hop) != sta)
++			if (rcu_access_pointer(mpath->next_hop) != sta) {
+ 				mpath->path_change_count++;
++				mesh_hdr_cache_flush(mpath->sdata, mpath->dst,
++						     false);
++			}
+ 			mesh_path_assign_nexthop(mpath, sta);
+ 			mpath->metric = last_hop_metric;
+ 			mpath->exp_time = time_after(mpath->exp_time, exp_time)
+@@ -977,7 +983,7 @@ free:
+  * Locking: the function must be called from within a rcu read lock block.
+  *
+  */
+-static void mesh_queue_preq(struct mesh_path *mpath, u8 flags)
++void mesh_queue_preq(struct mesh_path *mpath, u8 flags)
+ {
+ 	struct ieee80211_sub_if_data *sdata = mpath->sdata;
+ 	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
+@@ -1215,6 +1221,20 @@ static int mesh_nexthop_lookup_nolearn(s
+ 	return 0;
+ }
+ 
++void mesh_refresh_path(struct ieee80211_sub_if_data *sdata,
++		       struct mesh_path *mpath, const u8 *addr)
++{
++	if (mpath->flags & (MESH_PATH_REQ_QUEUED | MESH_PATH_FIXED |
++			    MESH_PATH_RESOLVING))
++		return;
++
++	if (time_after(jiffies,
++		       mpath->exp_time -
++		       msecs_to_jiffies(sdata->u.mesh.mshcfg.path_refresh_time)) &&
++	    (!addr || ether_addr_equal(sdata->vif.addr, addr)))
++		mesh_queue_preq(mpath, PREQ_Q_F_START | PREQ_Q_F_REFRESH);
++}
++
+ /**
+  * mesh_nexthop_lookup - put the appropriate next hop on a mesh frame. Calling
+  * this function is considered "using" the associated mpath, so preempt a path
+@@ -1242,19 +1262,18 @@ int mesh_nexthop_lookup(struct ieee80211
+ 	if (!mpath || !(mpath->flags & MESH_PATH_ACTIVE))
+ 		return -ENOENT;
+ 
+-	if (time_after(jiffies,
+-		       mpath->exp_time -
+-		       msecs_to_jiffies(sdata->u.mesh.mshcfg.path_refresh_time)) &&
+-	    ether_addr_equal(sdata->vif.addr, hdr->addr4) &&
+-	    !(mpath->flags & MESH_PATH_RESOLVING) &&
+-	    !(mpath->flags & MESH_PATH_FIXED))
+-		mesh_queue_preq(mpath, PREQ_Q_F_START | PREQ_Q_F_REFRESH);
++	mesh_refresh_path(sdata, mpath, hdr->addr4);
+ 
+ 	next_hop = rcu_dereference(mpath->next_hop);
+ 	if (next_hop) {
+ 		memcpy(hdr->addr1, next_hop->sta.addr, ETH_ALEN);
+ 		memcpy(hdr->addr2, sdata->vif.addr, ETH_ALEN);
+ 		ieee80211_mps_set_frame_flags(sdata, next_hop, hdr);
++		/* Cache the whole header so as to use next time rather than resolving
++		 * and building it every time
++		 */
++		if (ieee80211_hw_check(&sdata->local->hw, SUPPORT_FAST_XMIT))
++			mesh_cache_hdr(sdata, skb, mpath);
+ 		return 0;
+ 	}
+ 
+--- a/net/mac80211/mesh_pathtbl.c
++++ b/net/mac80211/mesh_pathtbl.c
+@@ -14,6 +14,7 @@
+ #include "wme.h"
+ #include "ieee80211_i.h"
+ #include "mesh.h"
++#include <linux/rhashtable.h>
+ 
+ static void mesh_path_free_rcu(struct mesh_table *tbl, struct mesh_path *mpath);
+ 
+@@ -32,6 +33,41 @@ static const struct rhashtable_params me
+ 	.hashfn = mesh_table_hash,
+ };
+ 
++static const struct rhashtable_params mesh_hdr_rht_params = {
++	.nelem_hint = 10,
++	.automatic_shrinking = true,
++	.key_len =  ETH_ALEN,
++	.key_offset = offsetof(struct mhdr_cache_entry, addr_key),
++	.head_offset = offsetof(struct mhdr_cache_entry, rhash),
++	.hashfn = mesh_table_hash,
++};
++
++static void __mesh_hdr_cache_entry_free(void *ptr, void *tblptr)
++{
++	struct mhdr_cache_entry *mhdr = ptr;
++
++	kfree_rcu(mhdr, rcu);
++}
++
++static void mesh_hdr_cache_deinit(struct ieee80211_sub_if_data *sdata)
++{
++	struct mesh_hdr_cache *cache;
++
++	cache = &sdata->u.mesh.hdr_cache;
++	rhashtable_free_and_destroy(&cache->rhead,
++				    __mesh_hdr_cache_entry_free, NULL);
++}
++
++static void mesh_hdr_cache_init(struct ieee80211_sub_if_data *sdata)
++{
++	struct mesh_hdr_cache *cache;
++
++	cache = &sdata->u.mesh.hdr_cache;
++	rhashtable_init(&cache->rhead, &mesh_hdr_rht_params);
++	INIT_HLIST_HEAD(&cache->walk_head);
++	spin_lock_init(&cache->walk_lock);
++}
++
+ static inline bool mpath_expired(struct mesh_path *mpath)
+ {
+ 	return (mpath->flags & MESH_PATH_ACTIVE) &&
+@@ -381,6 +417,211 @@ struct mesh_path *mesh_path_new(struct i
+ 	return new_mpath;
+ }
+ 
++struct mhdr_cache_entry *
++mesh_get_cached_hdr(struct ieee80211_sub_if_data *sdata, const u8 *addr)
++{
++	struct mesh_path *mpath, *mppath;
++	struct mhdr_cache_entry *entry;
++	struct mesh_hdr_cache *cache;
++
++	cache = &sdata->u.mesh.hdr_cache;
++	entry = rhashtable_lookup(&cache->rhead, addr, mesh_hdr_rht_params);
++	if (!entry)
++		return NULL;
++
++	mpath = rcu_dereference(entry->mpath);
++	mppath = rcu_dereference(entry->mppath);
++	if (!(mpath->flags & MESH_PATH_ACTIVE) || mpath_expired(mpath))
++		return NULL;
++
++	mesh_refresh_path(sdata, mpath, NULL);
++	if (mppath)
++		mppath->exp_time = jiffies;
++	entry->timestamp = jiffies;
++
++	return entry;
++}
++
++void mesh_cache_hdr(struct ieee80211_sub_if_data *sdata,
++		    struct sk_buff *skb, struct mesh_path *mpath)
++{
++	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
++	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
++	struct mesh_hdr_cache *cache;
++	struct mhdr_cache_entry *mhdr, *old_mhdr;
++	struct ieee80211s_hdr *meshhdr;
++	struct sta_info *next_hop;
++	struct ieee80211_key *key;
++	struct mesh_path *mppath;
++	u16 meshhdr_len;
++	u8 pn_offs = 0;
++	int hdrlen;
++
++	if (sdata->noack_map)
++		return;
++
++	if (!ieee80211_is_data_qos(hdr->frame_control))
++		return;
++
++	hdrlen = ieee80211_hdrlen(hdr->frame_control);
++	meshhdr = (struct ieee80211s_hdr *)(skb->data + hdrlen);
++	meshhdr_len = ieee80211_get_mesh_hdrlen(meshhdr);
++
++	cache = &sdata->u.mesh.hdr_cache;
++	if (atomic_read(&cache->rhead.nelems) >= MESH_HEADER_CACHE_MAX_SIZE)
++		return;
++
++	next_hop = rcu_dereference(mpath->next_hop);
++	if (!next_hop)
++		return;
++
++	if ((meshhdr->flags & MESH_FLAGS_AE) == MESH_FLAGS_AE_A5_A6) {
++		/* This is required to keep the mppath alive */
++		mppath = mpp_path_lookup(sdata, meshhdr->eaddr1);
++		if (!mppath)
++			return;
++	} else if (ieee80211_has_a4(hdr->frame_control)) {
++		mppath = mpath;
++	} else {
++		return;
++	}
++
++	/* rate limit, in case fast xmit can't be enabled */
++	if (mppath->fast_xmit_check == jiffies)
++		return;
++
++	mppath->fast_xmit_check = jiffies;
++
++	key = rcu_access_pointer(next_hop->ptk[next_hop->ptk_idx]);
++	if (!key)
++		key = rcu_access_pointer(sdata->default_unicast_key);
++
++	if (key) {
++		bool gen_iv, iv_spc;
++
++		gen_iv = key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV;
++		iv_spc = key->conf.flags & IEEE80211_KEY_FLAG_PUT_IV_SPACE;
++
++		if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) ||
++		    (key->flags & KEY_FLAG_TAINTED))
++			return;
++
++		switch (key->conf.cipher) {
++		case WLAN_CIPHER_SUITE_CCMP:
++		case WLAN_CIPHER_SUITE_CCMP_256:
++			if (gen_iv)
++				pn_offs = hdrlen;
++			if (gen_iv || iv_spc)
++				hdrlen += IEEE80211_CCMP_HDR_LEN;
++			break;
++		case WLAN_CIPHER_SUITE_GCMP:
++		case WLAN_CIPHER_SUITE_GCMP_256:
++			if (gen_iv)
++				pn_offs = hdrlen;
++			if (gen_iv || iv_spc)
++				hdrlen += IEEE80211_GCMP_HDR_LEN;
++			break;
++		default:
++			return;
++		}
++	}
++
++	if (WARN_ON_ONCE(hdrlen + meshhdr_len + sizeof(rfc1042_header) >
++			 MESH_HEADER_MAX_LEN))
++		return;
++
++	mhdr = kzalloc(sizeof(*mhdr), GFP_ATOMIC);
++	if (!mhdr)
++		return;
++
++	memcpy(mhdr->addr_key, mppath->dst, ETH_ALEN);
++	mhdr->machdr_len = hdrlen;
++	mhdr->hdrlen = mhdr->machdr_len + meshhdr_len + sizeof(rfc1042_header);
++	rcu_assign_pointer(mhdr->mpath, mpath);
++	if (meshhdr->flags & MESH_FLAGS_AE)
++		rcu_assign_pointer(mhdr->mppath, mppath);
++	rcu_assign_pointer(mhdr->key, key);
++	mhdr->timestamp = jiffies;
++	mhdr->band = info->band;
++	mhdr->pn_offs = pn_offs;
++
++	if (pn_offs) {
++		memcpy(mhdr->hdr, skb->data, pn_offs);
++		memcpy(mhdr->hdr + mhdr->machdr_len, skb->data + pn_offs,
++		       mhdr->hdrlen - mhdr->machdr_len);
++	} else {
++		memcpy(mhdr->hdr, skb->data, mhdr->hdrlen);
++	}
++
++	if (key) {
++		hdr = (struct ieee80211_hdr *)mhdr->hdr;
++		hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PROTECTED);
++	}
++
++	spin_lock_bh(&cache->walk_lock);
++	old_mhdr = rhashtable_lookup_get_insert_fast(&cache->rhead,
++						     &mhdr->rhash,
++						     mesh_hdr_rht_params);
++	if (likely(!old_mhdr))
++		hlist_add_head(&mhdr->walk_list, &cache->walk_head);
++	else
++		kfree(mhdr);
++	spin_unlock_bh(&cache->walk_lock);
++}
++
++static void mesh_hdr_cache_entry_free(struct mesh_hdr_cache *cache,
++				      struct mhdr_cache_entry *entry)
++{
++	hlist_del_rcu(&entry->walk_list);
++	rhashtable_remove_fast(&cache->rhead, &entry->rhash, mesh_hdr_rht_params);
++	kfree_rcu(entry, rcu);
++}
++
++void mesh_hdr_cache_gc(struct ieee80211_sub_if_data *sdata)
++{
++	unsigned long timeout = msecs_to_jiffies(MESH_HEADER_CACHE_TIMEOUT);
++	struct mesh_hdr_cache *cache;
++	struct mhdr_cache_entry *entry;
++	struct hlist_node *n;
++
++	cache = &sdata->u.mesh.hdr_cache;
++	if (atomic_read(&cache->rhead.nelems) < MESH_HEADER_CACHE_THRESHOLD_SIZE)
++		return;
++
++	spin_lock_bh(&cache->walk_lock);
++	hlist_for_each_entry_safe(entry, n, &cache->walk_head, walk_list)
++		if (!time_is_after_jiffies(entry->timestamp + timeout))
++			mesh_hdr_cache_entry_free(cache, entry);
++	spin_unlock_bh(&cache->walk_lock);
++}
++
++void mesh_hdr_cache_flush(struct ieee80211_sub_if_data *sdata, const u8 *addr,
++			  bool is_mpp)
++{
++	struct mesh_hdr_cache *cache = &sdata->u.mesh.hdr_cache;
++	struct mhdr_cache_entry *entry;
++	struct hlist_node *n;
++
++	cache = &sdata->u.mesh.hdr_cache;
++	spin_lock_bh(&cache->walk_lock);
++
++	/* Only one header per mpp address is expected in the header cache */
++	if (is_mpp) {
++		entry = rhashtable_lookup(&cache->rhead, addr,
++					  mesh_hdr_rht_params);
++		if (entry)
++			mesh_hdr_cache_entry_free(cache, entry);
++		goto out;
++	}
++
++	hlist_for_each_entry_safe(entry, n, &cache->walk_head, walk_list)
++		if (ether_addr_equal(entry->mpath->dst, addr))
++			mesh_hdr_cache_entry_free(cache, entry);
++
++out:
++	spin_unlock_bh(&cache->walk_lock);
++}
++
+ /**
+  * mesh_path_add - allocate and add a new path to the mesh path table
+  * @dst: destination address of the path (ETH_ALEN length)
+@@ -521,6 +762,8 @@ static void mesh_path_free_rcu(struct me
+ 
+ static void __mesh_path_del(struct mesh_table *tbl, struct mesh_path *mpath)
+ {
++	mesh_hdr_cache_flush(mpath->sdata, mpath->dst,
++			     tbl == &mpath->sdata->u.mesh.mpp_paths);
+ 	hlist_del_rcu(&mpath->walk_list);
+ 	rhashtable_remove_fast(&tbl->rhead, &mpath->rhash, mesh_rht_params);
+ 	mesh_path_free_rcu(tbl, mpath);
+@@ -747,6 +990,7 @@ void mesh_path_fix_nexthop(struct mesh_p
+ 	mpath->exp_time = 0;
+ 	mpath->flags = MESH_PATH_FIXED | MESH_PATH_SN_VALID;
+ 	mesh_path_activate(mpath);
++	mesh_hdr_cache_flush(mpath->sdata, mpath->dst, false);
+ 	spin_unlock_bh(&mpath->state_lock);
+ 	ewma_mesh_fail_avg_init(&next_hop->mesh->fail_avg);
+ 	/* init it at a low value - 0 start is tricky */
+@@ -758,6 +1002,7 @@ void mesh_pathtbl_init(struct ieee80211_
+ {
+ 	mesh_table_init(&sdata->u.mesh.mesh_paths);
+ 	mesh_table_init(&sdata->u.mesh.mpp_paths);
++	mesh_hdr_cache_init(sdata);
+ }
+ 
+ static
+@@ -785,6 +1030,7 @@ void mesh_path_expire(struct ieee80211_s
+ 
+ void mesh_pathtbl_unregister(struct ieee80211_sub_if_data *sdata)
+ {
++	mesh_hdr_cache_deinit(sdata);
+ 	mesh_table_free(&sdata->u.mesh.mesh_paths);
+ 	mesh_table_free(&sdata->u.mesh.mpp_paths);
+ }
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -2791,6 +2791,7 @@ ieee80211_rx_mesh_data(struct ieee80211_
+ 	if (mesh_hdr->flags & MESH_FLAGS_AE) {
+ 		struct mesh_path *mppath;
+ 		char *proxied_addr;
++		bool update = false;
+ 
+ 		if (multicast)
+ 			proxied_addr = mesh_hdr->eaddr1;
+@@ -2806,11 +2807,18 @@ ieee80211_rx_mesh_data(struct ieee80211_
+ 			mpp_path_add(sdata, proxied_addr, eth->h_source);
+ 		} else {
+ 			spin_lock_bh(&mppath->state_lock);
+-			if (!ether_addr_equal(mppath->mpp, eth->h_source))
++			if (!ether_addr_equal(mppath->mpp, eth->h_source)) {
+ 				memcpy(mppath->mpp, eth->h_source, ETH_ALEN);
++				update = true;
++			}
+ 			mppath->exp_time = jiffies;
+ 			spin_unlock_bh(&mppath->state_lock);
+ 		}
++
++		/* flush fast xmit cache if the address path changed */
++		if (update)
++			mesh_hdr_cache_flush(sdata, proxied_addr, true);
++
+ 		rcu_read_unlock();
+ 	}
+ 
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -3021,6 +3021,9 @@ void ieee80211_check_fast_xmit(struct st
+ 	if (!ieee80211_hw_check(&local->hw, SUPPORT_FAST_XMIT))
+ 		return;
+ 
++	if (ieee80211_vif_is_mesh(&sdata->vif))
++		mesh_hdr_cache_flush(sdata, sta->addr, false);
++
+ 	/* Locking here protects both the pointer itself, and against concurrent
+ 	 * invocations winning data access races to, e.g., the key pointer that
+ 	 * is used.
+@@ -3723,6 +3726,155 @@ free:
+ 	kfree_skb(skb);
+ }
+ 
++void __ieee80211_mesh_xmit_fast(struct ieee80211_sub_if_data *sdata,
++				struct mhdr_cache_entry *entry,
++				struct sk_buff *skb)
++{
++	struct ieee80211_local *local = sdata->local;
++	struct ieee80211_tx_data tx = {};
++	struct ieee80211_tx_info *info;
++	struct ieee80211_key *key;
++	struct ieee80211_hdr *hdr;
++	struct mesh_path *mpath;
++	ieee80211_tx_result r;
++	struct sta_info *sta;
++	u8 tid;
++
++	if (!IS_ENABLED(CPTCFG_MAC80211_MESH))
++		return;
++
++	info = IEEE80211_SKB_CB(skb);
++	memset(info, 0, sizeof(*info));
++	info->band = entry->band;
++	info->control.vif = &sdata->vif;
++	info->flags = IEEE80211_TX_CTL_FIRST_FRAGMENT |
++		      IEEE80211_TX_CTL_DONTFRAG;
++
++	info->control.flags = IEEE80211_TX_CTRL_FAST_XMIT;
++
++#ifdef CONFIG_MAC80211_DEBUGFS
++	if (local->force_tx_status)
++		info->flags |= IEEE80211_TX_CTL_REQ_TX_STATUS;
++#endif
++
++	mpath = entry->mpath;
++	key = entry->key;
++	sta = rcu_dereference(mpath->next_hop);
++
++	__skb_queue_head_init(&tx.skbs);
++
++	tx.flags = IEEE80211_TX_UNICAST;
++	tx.local = local;
++	tx.sdata = sdata;
++	tx.sta = sta;
++	tx.key = key;
++	tx.skb = skb;
++
++	hdr = (struct ieee80211_hdr *)skb->data;
++	tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
++	*ieee80211_get_qos_ctl(hdr) = tid;
++
++	ieee80211_aggr_check(sdata, sta, skb);
++
++	if (ieee80211_queue_skb(local, sdata, sta, skb))
++		return;
++
++	r = ieee80211_xmit_fast_finish(sdata, sta, entry->pn_offs, key, &tx);
++	if (r == TX_DROP) {
++		kfree_skb(skb);
++		return;
++	}
++
++	__skb_queue_tail(&tx.skbs, skb);
++	ieee80211_tx_frags(local, &sdata->vif, sta, &tx.skbs, false);
++}
++
++
++static bool ieee80211_mesh_xmit_fast(struct ieee80211_sub_if_data *sdata,
++				     struct sk_buff *skb, u32 ctrl_flags)
++{
++	struct ieee80211_local *local = sdata->local;
++	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
++	struct mhdr_cache_entry *entry;
++	struct ieee80211s_hdr *meshhdr;
++	u8 sa[ETH_ALEN] __aligned(2);
++	struct sta_info *sta;
++	bool copy_sa = false;
++	u16 ethertype;
++
++	if (ctrl_flags & IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP)
++		return false;
++
++	if (ifmsh->mshcfg.dot11MeshNolearn)
++		return false;
++
++	if (!ieee80211_hw_check(&local->hw, SUPPORT_FAST_XMIT))
++		return false;
++
++	/* Add support for these cases later */
++	if (ifmsh->ps_peers_light_sleep || ifmsh->ps_peers_deep_sleep)
++		return false;
++
++	if (is_multicast_ether_addr(skb->data))
++		return false;
++
++	ethertype = (skb->data[12] << 8) | skb->data[13];
++	if (ethertype < ETH_P_802_3_MIN)
++		return false;
++
++	if (skb->sk && skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS)
++		return false;
++
++	if (skb->ip_summed == CHECKSUM_PARTIAL) {
++		skb_set_transport_header(skb, skb_checksum_start_offset(skb));
++		if (skb_checksum_help(skb))
++			return false;
++	}
++
++	entry = mesh_get_cached_hdr(sdata, skb->data);
++	if (!entry)
++		return false;
++
++	/* Avoid extra work in this path */
++	if (skb_headroom(skb) < (entry->hdrlen - ETH_HLEN + 2))
++		return false;
++
++	/* If the skb is shared we need to obtain our own copy */
++	if (skb_shared(skb)) {
++		struct sk_buff *oskb = skb;
++
++		skb = skb_clone(skb, GFP_ATOMIC);
++		if (!skb)
++			return false;
++
++		kfree_skb(oskb);
++	}
++
++	sta = rcu_dereference(entry->mpath->next_hop);
++	skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, sta, skb));
++
++	meshhdr = (struct ieee80211s_hdr *)(entry->hdr + entry->machdr_len);
++	if ((meshhdr->flags & MESH_FLAGS_AE) == MESH_FLAGS_AE_A5_A6) {
++		/* preserve SA from eth header for 6-addr frames */
++		ether_addr_copy(sa, skb->data + ETH_ALEN);
++		copy_sa = true;
++	}
++
++	memcpy(skb_push(skb, entry->hdrlen - 2 * ETH_ALEN), entry->hdr,
++	       entry->hdrlen);
++
++	meshhdr = (struct ieee80211s_hdr *)(skb->data + entry->machdr_len);
++	put_unaligned_le32(atomic_inc_return(&sdata->u.mesh.mesh_seqnum),
++			   &meshhdr->seqnum);
++	meshhdr->ttl = sdata->u.mesh.mshcfg.dot11MeshTTL;
++	if (copy_sa)
++	    ether_addr_copy(meshhdr->eaddr2, sa);
++
++	__ieee80211_mesh_xmit_fast(sdata, entry, skb);
++
++	return true;
++}
++
+ static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
+ 				struct sta_info *sta,
+ 				struct ieee80211_fast_tx *fast_tx,
+@@ -4244,8 +4396,14 @@ void __ieee80211_subif_start_xmit(struct
+ 		return;
+ 	}
+ 
++	sk_pacing_shift_update(skb->sk, sdata->local->hw.tx_sk_pacing_shift);
++
+ 	rcu_read_lock();
+ 
++	if (ieee80211_vif_is_mesh(&sdata->vif) &&
++	    ieee80211_mesh_xmit_fast(sdata, skb, ctrl_flags))
++		goto out;
++
+ 	if (ieee80211_lookup_ra_sta(sdata, skb, &sta))
+ 		goto out_free;
+ 
+@@ -4255,8 +4413,6 @@ void __ieee80211_subif_start_xmit(struct
+ 	skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, sta, skb));
+ 	ieee80211_aggr_check(sdata, sta, skb);
+ 
+-	sk_pacing_shift_update(skb->sk, sdata->local->hw.tx_sk_pacing_shift);
+-
+ 	if (sta) {
+ 		struct ieee80211_fast_tx *fast_tx;
+ 
diff --git a/package/kernel/mac80211/patches/subsys/320-wifi-mac80211-use-mesh-header-cache-to-speed-up-mesh.patch b/package/kernel/mac80211/patches/subsys/320-wifi-mac80211-use-mesh-header-cache-to-speed-up-mesh.patch
new file mode 100644
index 0000000000..e0d4e60ed7
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/320-wifi-mac80211-use-mesh-header-cache-to-speed-up-mesh.patch
@@ -0,0 +1,70 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Thu, 16 Feb 2023 11:07:30 +0100
+Subject: [PATCH] wifi: mac80211: use mesh header cache to speed up mesh
+ forwarding
+
+Use it to look up the next hop address + sta pointer + key and call
+__ieee80211_mesh_xmit_fast to queue the tx frame.
+
+Significantly reduces mesh forwarding path CPU usage and enables the
+use of iTXQ.
+
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -2731,6 +2731,7 @@ ieee80211_rx_mesh_data(struct ieee80211_
+ 	struct ieee80211_hdr hdr = {
+ 		.frame_control = cpu_to_le16(fc)
+ 	};
++	struct mhdr_cache_entry *entry = NULL;
+ 	struct ieee80211_hdr *fwd_hdr;
+ 	struct ieee80211s_hdr *mesh_hdr;
+ 	struct ieee80211_tx_info *info;
+@@ -2788,7 +2789,12 @@ ieee80211_rx_mesh_data(struct ieee80211_
+ 		return RX_DROP_MONITOR;
+ 	}
+ 
+-	if (mesh_hdr->flags & MESH_FLAGS_AE) {
++	if ((mesh_hdr->flags & MESH_FLAGS_AE) == MESH_FLAGS_AE_A5_A6)
++		entry = mesh_get_cached_hdr(sdata, mesh_hdr->eaddr1);
++	else if (!(mesh_hdr->flags & MESH_FLAGS_AE))
++		entry = mesh_get_cached_hdr(sdata, eth->h_dest);
++
++	if (!entry && (mesh_hdr->flags & MESH_FLAGS_AE)) {
+ 		struct mesh_path *mppath;
+ 		char *proxied_addr;
+ 		bool update = false;
+@@ -2862,11 +2868,23 @@ ieee80211_rx_mesh_data(struct ieee80211_
+ 	info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
+ 	info->control.vif = &sdata->vif;
+ 	info->control.jiffies = jiffies;
++	fwd_skb->dev = sdata->dev;
+ 	if (multicast) {
+ 		IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_mcast);
+ 		memcpy(fwd_hdr->addr2, sdata->vif.addr, ETH_ALEN);
+ 		/* update power mode indication when forwarding */
+ 		ieee80211_mps_set_frame_flags(sdata, NULL, fwd_hdr);
++	} else if (entry) {
++		struct ieee80211_hdr *ehdr = (struct ieee80211_hdr *)entry->hdr;
++
++		ether_addr_copy(fwd_hdr->addr1, ehdr->addr1);
++		ether_addr_copy(fwd_hdr->addr2, sdata->vif.addr);
++		IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_unicast);
++		IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_frames);
++		qos[0] = fwd_skb->priority;
++		qos[1] = ieee80211_get_qos_ctl(ehdr)[1];
++		__ieee80211_mesh_xmit_fast(sdata, entry, fwd_skb);
++		return RX_QUEUED;
+ 	} else if (!mesh_nexthop_lookup(sdata, fwd_skb)) {
+ 		/* mesh power mode flags updated in mesh_nexthop_lookup */
+ 		IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_unicast);
+@@ -2883,7 +2901,6 @@ ieee80211_rx_mesh_data(struct ieee80211_
+ 	}
+ 
+ 	IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_frames);
+-	fwd_skb->dev = sdata->dev;
+ 	ieee80211_add_pending_skb(local, fwd_skb);
+ 
+ rx_accept:
diff --git a/package/kernel/mac80211/patches/subsys/321-mac80211-fix-mesh-forwarding.patch b/package/kernel/mac80211/patches/subsys/321-mac80211-fix-mesh-forwarding.patch
new file mode 100644
index 0000000000..d9af8c7929
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/321-mac80211-fix-mesh-forwarding.patch
@@ -0,0 +1,32 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Mon, 20 Feb 2023 12:50:50 +0100
+Subject: [PATCH] mac80211: fix mesh forwarding
+
+Linearize packets (needed for forwarding A-MSDU subframes).
+Fix network header offset to fix flow dissector (and fair queueing).
+
+Fixes: 986e43b19ae9 ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces")
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -2847,6 +2847,9 @@ ieee80211_rx_mesh_data(struct ieee80211_
+ 
+ 		if (skb_cow_head(fwd_skb, hdrlen - sizeof(struct ethhdr)))
+ 			return RX_DROP_UNUSABLE;
++
++		if (skb_linearize(fwd_skb))
++			return RX_DROP_UNUSABLE;
+ 	}
+ 
+ 	fwd_hdr = skb_push(fwd_skb, hdrlen - sizeof(struct ethhdr));
+@@ -2861,7 +2864,7 @@ ieee80211_rx_mesh_data(struct ieee80211_
+ 		hdrlen += ETH_ALEN;
+ 	else
+ 		fwd_skb->protocol = htons(fwd_skb->len - hdrlen);
+-	skb_set_network_header(fwd_skb, hdrlen);
++	skb_set_network_header(fwd_skb, hdrlen + 2);
+ 
+ 	info = IEEE80211_SKB_CB(fwd_skb);
+ 	memset(info, 0, sizeof(*info));
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 70d4e89c90..817be9e4d2 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
@@ -87,7 +87,7 @@
  	CFG80211_TESTMODE_DUMP(ieee80211_testmode_dump)
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -1520,6 +1520,7 @@ struct ieee80211_local {
+@@ -1536,6 +1536,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  Mon Feb 20 04:31:36 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 20 Feb 2023 07:31:36 -0500
Subject: [openwrt/openwrt]  image: update LZMA_XZ_OPTIONS with new squashfs4
 tool
In-Reply-To: <167689629530.2213860.8257797553313892921@git-01.infra.openwrt.org>
References: <167689629530.2213860.8257797553313892921@git-01.infra.openwrt.org>
Message-ID: <mailman.17552.1676896300.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/a33b97dcb1bd6e68f01c571e92ef02c3ab721523

commit a33b97dcb1bd6e68f01c571e92ef02c3ab721523
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Mon Feb 6 23:28:14 2023 +0100

    image: update LZMA_XZ_OPTIONS with new squashfs4 tool
    
    The -Xpreset option changed format and dropped the -Xe and just require
    the extreme string to be passed to the -Xpreset option.
    
    Update the LZMA_XZ_OPTIONS to reflect this change.
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 include/image.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/image.mk b/include/image.mk
index b801ef993c..ef242db96e 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -77,7 +77,7 @@ SQUASHFSOPT := -b $(SQUASHFS_BLOCKSIZE)
 SQUASHFSOPT += -p '/dev d 755 0 0' -p '/dev/console c 600 0 0 5 1'
 SQUASHFSOPT += $(if $(CONFIG_SELINUX),-xattrs,-no-xattrs)
 SQUASHFSCOMP := gzip
-LZMA_XZ_OPTIONS := -Xpreset 9 -Xe -Xlc 0 -Xlp 2 -Xpb 2
+LZMA_XZ_OPTIONS := -Xpreset extreme -Xlc 0 -Xlp 2 -Xpb 2
 ifeq ($(CONFIG_SQUASHFS_XZ),y)
   ifneq ($(filter arm x86 powerpc sparc,$(LINUX_KARCH)),)
     BCJ_FILTER:=-Xbcj $(LINUX_KARCH)



From lede-commits at lists.infradead.org  Mon Feb 20 04:31:37 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 20 Feb 2023 07:31:37 -0500
Subject: [openwrt/openwrt]  tools/squashfskit4: drop unused tool
In-Reply-To: <167689629530.2213860.8257797553313892921@git-01.infra.openwrt.org>
References: <167689629530.2213860.8257797553313892921@git-01.infra.openwrt.org>
Message-ID: <mailman.17553.1676896300.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/eac6fe6f742c7da980799b5583819183a9f33c01

commit eac6fe6f742c7da980799b5583819183a9f33c01
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Fri Oct 14 17:36:21 2022 +0200

    tools/squashfskit4: drop unused tool
    
    Drop squashfskit4 tool as it got replaced by new version of squashfs4
    tool.
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 tools/squashfskit4/Makefile                        | 41 ----------------------
 .../squashfskit4/patches/0001-fix-version.sh.patch | 21 -----------
 .../0002-fix-build-failure-against-gcc-10.patch    | 41 ----------------------
 tools/squashfskit4/patches/0010-portability.patch  | 37 -------------------
 tools/squashfskit4/patches/0020-big-endian.patch   | 14 --------
 5 files changed, 154 deletions(-)

diff --git a/tools/squashfskit4/Makefile b/tools/squashfskit4/Makefile
deleted file mode 100644
index 1800306d33..0000000000
--- a/tools/squashfskit4/Makefile
+++ /dev/null
@@ -1,41 +0,0 @@
-#
-# Copyright (C) 2009-2012 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:=squashfskit4
-PKG_VERSION:=4.14
-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
-
-HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/squashfskit-v$(PKG_VERSION)
-
-include $(INCLUDE_DIR)/host-build.mk
-
-define Host/Compile
-	+$(HOST_MAKE_VARS) \
-	$(MAKE) -C $(HOST_BUILD_DIR)/squashfs-tools \
-		XZ_SUPPORT=1 \
-		LZMA_XZ_SUPPORT=1 \
-		XATTR_SUPPORT=1 \
-		LZMA_LIB="$(STAGING_DIR_HOST)/lib/liblzma.a" \
-		EXTRA_CFLAGS="-I$(STAGING_DIR_HOST)/include" \
-		mksquashfs unsquashfs
-endef
-
-define Host/Install
-	$(INSTALL_BIN) $(HOST_BUILD_DIR)/squashfs-tools/mksquashfs $(STAGING_DIR_HOST)/bin/mksquashfs4
-	$(INSTALL_BIN) $(HOST_BUILD_DIR)/squashfs-tools/unsquashfs $(STAGING_DIR_HOST)/bin/unsquashfs4
-endef
-
-define Host/Clean
-	rm -f $(STAGING_DIR_HOST)/bin/mksquashfs4
-	rm -f $(STAGING_DIR_HOST)/bin/unsquashfs4
-endef
-
-$(eval $(call HostBuild))
diff --git a/tools/squashfskit4/patches/0001-fix-version.sh.patch b/tools/squashfskit4/patches/0001-fix-version.sh.patch
deleted file mode 100644
index 5f0894bc17..0000000000
--- a/tools/squashfskit4/patches/0001-fix-version.sh.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/squashfs-tools/version.sh
-+++ b/squashfs-tools/version.sh
-@@ -27,13 +27,11 @@ if [ -z "$OUTPUT" ] ; then
- fi
- 
- our_date() {
--case $(uname) in
--NetBSD|OpenBSD|DragonFly|FreeBSD|Darwin)
--        date -r "$1" "$2"
--        ;;
--*)
--        date -d "@$1" "$2"
--esac
-+	if date --version 2>&1 | grep -q "GNU coreutils"; then
-+		date -d "@$1" "$2"
-+	else
-+		date -r "$1" "$2"
-+	fi
- }
- 
- try_version() {
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
deleted file mode 100644
index de77299978..0000000000
--- a/tools/squashfskit4/patches/0002-fix-build-failure-against-gcc-10.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From fe2f5da4b0f8994169c53e84b7cb8a0feefc97b5 Mon Sep 17 00:00:00 2001
-From: Sergei Trofimovich <slyfox at gentoo.org>
-Date: Sun, 26 Jan 2020 18:35:13 +0000
-Subject: [PATCH] squashfs-tools: fix build failure against gcc-10
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-On gcc-10 (and gcc-9 -fno-common) build fails as:
-
-```
-cc ... -o mksquashfs
-ld: read_fs.o:(.bss+0x0):
-  multiple definition of `fwriter_buffer'; mksquashfs.o:(.bss+0x400c90): first defined here
-ld: read_fs.o:(.bss+0x8):
-  multiple definition of `bwriter_buffer'; mksquashfs.o:(.bss+0x400c98): first defined here
-```
-
-gcc-10 will change the default from -fcommon to fno-common:
-https://gcc.gnu.org/PR85678.
-
-The error also happens if CFLAGS=-fno-common passed explicitly.
-
-Reported-by: Toralf F?rster
-Bug: https://bugs.gentoo.org/706456
-Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>
----
- squashfs-tools/mksquashfs.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/squashfs-tools/mksquashfs.h
-+++ b/squashfs-tools/mksquashfs.h
-@@ -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,
- 	       *locked_fragment, *to_process_frag;
- extern struct append_file **file_mapping;
diff --git a/tools/squashfskit4/patches/0010-portability.patch b/tools/squashfskit4/patches/0010-portability.patch
deleted file mode 100644
index 2cc50ae8f0..0000000000
--- a/tools/squashfskit4/patches/0010-portability.patch
+++ /dev/null
@@ -1,37 +0,0 @@
---- a/squashfs-tools/xattr.c
-+++ b/squashfs-tools/xattr.c
-@@ -113,6 +113,7 @@ static int get_prefix(struct xattr_list
- 
- static int read_xattrs_from_system(char *filename, struct xattr_list **xattrs)
- {
-+#if defined(linux)
- 	ssize_t size, vsize;
- 	char *xattr_names, *p;
- 	int i;
-@@ -222,6 +223,10 @@ failed:
- 	free(xattr_list);
- 	free(xattr_names);
- 	return 0;
-+#else
-+	*xattrs = NULL;
-+	return 0;
-+#endif
- }
- 
- 
---- a/squashfs-tools/unsquashfs_xattr.c
-+++ b/squashfs-tools/unsquashfs_xattr.c
-@@ -34,6 +34,7 @@ extern int user_xattrs;
- 
- void write_xattr(char *pathname, unsigned int xattr)
- {
-+#if defined(linux)
- 	unsigned int count;
- 	struct xattr_list *xattr_list;
- 	int i;
-@@ -136,4 +137,5 @@ void write_xattr(char *pathname, unsigne
- 	}
- 
- 	free_xattr(xattr_list, count);
-+#endif
- }
diff --git a/tools/squashfskit4/patches/0020-big-endian.patch b/tools/squashfskit4/patches/0020-big-endian.patch
deleted file mode 100644
index b388cb4d12..0000000000
--- a/tools/squashfskit4/patches/0020-big-endian.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- 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  Mon Feb 20 04:31:35 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 20 Feb 2023 07:31:35 -0500
Subject: [openwrt/openwrt]  tools/squashfs4: add new tool for squashfs4 images
In-Reply-To: <167689629530.2213860.8257797553313892921@git-01.infra.openwrt.org>
References: <167689629530.2213860.8257797553313892921@git-01.infra.openwrt.org>
Message-ID: <mailman.17554.1676896303.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/30f2d516ba7be08f06f7ca8767472c3ea5678706

commit 30f2d516ba7be08f06f7ca8767472c3ea5678706
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Mon Feb 6 23:22:43 2023 +0100

    tools/squashfs4: add new tool for squashfs4 images
    
    squashfs tool is finally reborn and correctly maintained.
    
    Introduce the new version as a replacement for squasfs4kit as it was a
    fork and also abandoned.
    
    Add additional patch to add the missing feature present in squashfskit4
    but still missing on this new project.
    
    Backport each required patch that fix compilation error on macos.
    
    Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
 tools/Makefile                                     |   6 +-
 tools/squashfs4/Makefile                           |  41 +++++
 ...Add-and-make-some-header-includes-conditi.patch |  39 +++++
 .../002-Mksquashfs-Make-sysinfo-conditional.patch  |  30 ++++
 .../patches/003-Only-use-available-CPUs.patch      |  92 ++++++++++
 ...rework-strdupa-with-POSIX-strdup-and-free.patch |  37 ++++
 ...sigwaitinfo-sigtimedwait-if-not-supported.patch | 192 +++++++++++++++++++++
 ...o.h-into-the-linux-only-section-should-fi.patch |  49 ++++++
 ...fix-compilation-error-for-missing-sysctl..patch |  26 +++
 tools/squashfs4/patches/100-portability.patch      |  37 ++++
 ...support-multiple-lzma-configuration-optio.patch | 167 ++++++++++++++++++
 11 files changed, 713 insertions(+), 3 deletions(-)

diff --git a/tools/Makefile b/tools/Makefile
index aa80ee4ba6..bdd9f0a257 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -59,7 +59,7 @@ tools-y += patch-image
 tools-y += patchelf
 tools-y += pkgconf
 tools-y += quilt
-tools-y += squashfskit4
+tools-y += squashfs4
 tools-y += sstrip
 tools-y += zip
 tools-y += zlib
@@ -117,11 +117,11 @@ $(curdir)/pkgconf/compile := $(curdir)/meson/compile
 $(curdir)/quilt/compile := $(curdir)/autoconf/compile $(curdir)/findutils/compile
 $(curdir)/sdcc/compile := $(curdir)/bison/compile
 $(curdir)/squashfs3-lzma/compile := $(curdir)/lzma-old/compile
-$(curdir)/squashfskit4/compile := $(curdir)/xz/compile $(curdir)/zlib/compile
+$(curdir)/squashfs4/compile := $(curdir)/xz/compile $(curdir)/zlib/compile
 $(curdir)/zstd/compile := $(curdir)/meson/compile
 
 ifneq ($(HOST_OS),Linux)
-  $(curdir)/squashfskit4/compile += $(curdir)/coreutils/compile
+  $(curdir)/squashfs4/compile += $(curdir)/coreutils/compile
   tools-y += coreutils
 endif
 ifeq ($(HOST_OS),Darwin)
diff --git a/tools/squashfs4/Makefile b/tools/squashfs4/Makefile
new file mode 100644
index 0000000000..9d4f6babfc
--- /dev/null
+++ b/tools/squashfs4/Makefile
@@ -0,0 +1,41 @@
+#
+# Copyright (C) 2006-2012 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:=squashfs4
+PKG_CPE_ID:=cpe:/a:phillip_lougher:squashfs
+PKG_VERSION:=4.5.1
+PKG_RELEASE=1
+
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_URL:=https://github.com/plougher/squashfs-tools
+PKG_SOURCE_DATE:=2022-03-17
+PKG_SOURCE_VERSION:=afdd63fc386919b4aa40d573b0a6069414d14317
+PKG_MIRROR_HASH:=caedb66cf6dcbdcee0d1525923e203d003ef15f34a13a328686794666f16171f
+
+include $(INCLUDE_DIR)/host-build.mk
+
+define Host/Compile
+	+$(HOST_MAKE_VARS) \
+	$(MAKE) -C $(HOST_BUILD_DIR)/squashfs-tools \
+		XZ_SUPPORT=1 \
+		LZMA_XZ_SUPPORT=1 \
+		EXTRA_CFLAGS="-I$(STAGING_DIR_HOST)/include" \
+		mksquashfs unsquashfs
+endef
+
+define Host/Install
+	$(INSTALL_BIN) $(HOST_BUILD_DIR)/squashfs-tools/mksquashfs $(STAGING_DIR_HOST)/bin/mksquashfs4
+	$(INSTALL_BIN) $(HOST_BUILD_DIR)/squashfs-tools/unsquashfs $(STAGING_DIR_HOST)/bin/unsquashfs4
+endef
+
+define Host/Clean
+	rm -f $(STAGING_DIR_HOST)/bin/mksquashfs4
+	rm -f $(STAGING_DIR_HOST)/bin/unsquashfs4
+endef
+
+$(eval $(call HostBuild))
diff --git a/tools/squashfs4/patches/001-Unsquashfs-Add-and-make-some-header-includes-conditi.patch b/tools/squashfs4/patches/001-Unsquashfs-Add-and-make-some-header-includes-conditi.patch
new file mode 100644
index 0000000000..2fdb509492
--- /dev/null
+++ b/tools/squashfs4/patches/001-Unsquashfs-Add-and-make-some-header-includes-conditi.patch
@@ -0,0 +1,39 @@
+From a9119c969af0a5aa961d56978d5dd4f3eb952667 Mon Sep 17 00:00:00 2001
+From: Phillip Lougher <phillip at squashfs.org.uk>
+Date: Mon, 15 Aug 2022 17:04:43 +0100
+Subject: [PATCH 1/1] Unsquashfs: Add and make some header includes conditional
+
+Fixes https://github.com/plougher/squashfs-tools/issues/122
+
+Signed-off-by: Phillip Lougher <phillip at squashfs.org.uk>
+---
+ squashfs-tools/reader.c     | 1 +
+ squashfs-tools/unsquashfs.c | 5 +++++
+ 2 files changed, 6 insertions(+)
+
+--- a/squashfs-tools/reader.c
++++ b/squashfs-tools/reader.c
+@@ -38,6 +38,7 @@
+ #include <errno.h>
+ #include <stdlib.h>
+ #include <stdio.h>
++#include <signal.h>
+ #include "squashfs_fs.h"
+ #include "mksquashfs.h"
+ #include "caches-queues-lists.h"
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -32,8 +32,13 @@
+ #include "stdarg.h"
+ #include "fnmatch_compat.h"
+ 
++#ifdef __linux__
+ #include <sys/sysinfo.h>
+ #include <sys/sysmacros.h>
++#elif defined __FreeBSD__
++#include <sys/sysctl.h>
++#endif
++
+ #include <sys/types.h>
+ #include <sys/time.h>
+ #include <sys/resource.h>
diff --git a/tools/squashfs4/patches/002-Mksquashfs-Make-sysinfo-conditional.patch b/tools/squashfs4/patches/002-Mksquashfs-Make-sysinfo-conditional.patch
new file mode 100644
index 0000000000..d152181f8a
--- /dev/null
+++ b/tools/squashfs4/patches/002-Mksquashfs-Make-sysinfo-conditional.patch
@@ -0,0 +1,30 @@
+From 374e39a786a5acda841056bec26fd0e0c4d40dac Mon Sep 17 00:00:00 2001
+From: Phillip Lougher <phillip at squashfs.org.uk>
+Date: Mon, 15 Aug 2022 17:09:05 +0100
+Subject: [PATCH 1/1] Mksquashfs: Make sysinfo() conditional
+
+Fixes https://github.com/plougher/squashfs-tools/issues/123
+
+Signed-off-by: Phillip Lougher <phillip at squashfs.org.uk>
+---
+ squashfs-tools/mksquashfs.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -5802,6 +5802,7 @@ static int get_physical_memory()
+ 	long long page_size = sysconf(_SC_PAGESIZE);
+ 	int phys_mem;
+ 
++#ifdef __linux__
+ 	if(num_pages == -1 || page_size == -1) {
+ 		struct sysinfo sys;
+ 		int res = sysinfo(&sys);
+@@ -5812,6 +5813,7 @@ static int get_physical_memory()
+ 		num_pages = sys.totalram;
+ 		page_size = sys.mem_unit;
+ 	}
++#endif
+ 
+ 	phys_mem = num_pages * page_size >> 20;
+ 
diff --git a/tools/squashfs4/patches/003-Only-use-available-CPUs.patch b/tools/squashfs4/patches/003-Only-use-available-CPUs.patch
new file mode 100644
index 0000000000..4f608b9ed6
--- /dev/null
+++ b/tools/squashfs4/patches/003-Only-use-available-CPUs.patch
@@ -0,0 +1,92 @@
+From bc8e655a420d2f62bb0597947e96dce7b4d3fb36 Mon Sep 17 00:00:00 2001
+From: Wessel Dankers <wsl at fruit.je>
+Date: Sun, 30 Oct 2022 19:29:28 +0100
+Subject: [PATCH] Only use available CPUs
+
+Not all online CPUs may be available for the current process,
+especially when CPU affinity is involved. In such cases too many
+threads will be created, which will then compete unnecessarily
+for CPU time.
+
+Use sched_getaffinity() to determine the correct number of threads
+to create.
+---
+ squashfs-tools/mksquashfs.c | 16 ++++++++++++----
+ squashfs-tools/unsquashfs.c | 13 ++++++++++---
+ 2 files changed, 22 insertions(+), 7 deletions(-)
+
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -52,7 +52,9 @@
+ #include <ctype.h>
+ #include <sys/sysinfo.h>
+ 
+-#ifndef linux
++#ifdef linux
++#include <sched.h>
++#else
+ #include <sys/sysctl.h>
+ #endif
+ 
+@@ -5079,7 +5081,15 @@ static void initialise_threads(int readq
+ 		BAD_ERROR("Failed to set signal mask in intialise_threads\n");
+ 
+ 	if(processors == -1) {
+-#ifndef linux
++#ifdef linux
++		cpu_set_t cpu_set;
++		CPU_ZERO(&cpu_set);
++
++		if(sched_getaffinity(0, sizeof cpu_set, &cpu_set) == -1)
++			processors = sysconf(_SC_NPROCESSORS_ONLN);
++		else
++			processors = CPU_COUNT(&cpu_set);
++#else
+ 		int mib[2];
+ 		size_t len = sizeof(processors);
+ 
+@@ -5096,8 +5106,6 @@ static void initialise_threads(int readq
+ 			ERROR_EXIT("  Defaulting to 1\n");
+ 			processors = 1;
+ 		}
+-#else
+-		processors = sysconf(_SC_NPROCESSORS_ONLN);
+ #endif
+ 	}
+ 
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -33,6 +33,7 @@
+ #include "fnmatch_compat.h"
+ 
+ #ifdef __linux__
++#include <sched.h>
+ #include <sys/sysinfo.h>
+ #include <sys/sysmacros.h>
+ #elif defined __FreeBSD__
+@@ -2719,7 +2720,15 @@ void initialise_threads(int fragment_buf
+ 	}
+ 
+ 	if(processors == -1) {
+-#ifndef linux
++#ifdef linux
++		cpu_set_t cpu_set;
++		CPU_ZERO(&cpu_set);
++
++		if(sched_getaffinity(0, sizeof cpu_set, &cpu_set) == -1)
++			processors = sysconf(_SC_NPROCESSORS_ONLN);
++		else
++			processors = CPU_COUNT(&cpu_set);
++#else
+ 		int mib[2];
+ 		size_t len = sizeof(processors);
+ 
+@@ -2735,8 +2744,6 @@ void initialise_threads(int fragment_buf
+ 				"Defaulting to 1\n");
+ 			processors = 1;
+ 		}
+-#else
+-		processors = sysconf(_SC_NPROCESSORS_ONLN);
+ #endif
+ 	}
+ 
diff --git a/tools/squashfs4/patches/004-action-rework-strdupa-with-POSIX-strdup-and-free.patch b/tools/squashfs4/patches/004-action-rework-strdupa-with-POSIX-strdup-and-free.patch
new file mode 100644
index 0000000000..3d6f696c8e
--- /dev/null
+++ b/tools/squashfs4/patches/004-action-rework-strdupa-with-POSIX-strdup-and-free.patch
@@ -0,0 +1,37 @@
+From 92e628ec0e26cf091d82356e3b74f73bedf4cfc8 Mon Sep 17 00:00:00 2001
+From: Christian Marangi <ansuelsmth at gmail.com>
+Date: Sat, 15 Oct 2022 00:11:20 +0200
+Subject: [PATCH] action: rework strdupa with POSIX strdup and free
+
+strdupa is not POSIX and cause compilation error on macos.
+Fix this by using strdup and free.
+
+Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
+Signed-off-by: Phillip Lougher <phillip at squashfs.org.uk>
+---
+ squashfs-tools/action.c | 14 +++++++++++---
+ 1 file changed, 11 insertions(+), 3 deletions(-)
+
+--- a/squashfs-tools/action.c
++++ b/squashfs-tools/action.c
+@@ -2415,9 +2415,17 @@ static char *get_start(char *s, int n)
+ 
+ static int subpathname_fn(struct atom *atom, struct action_data *action_data)
+ {
+-	return fnmatch(atom->argv[0], get_start(strdupa(action_data->subpath),
+-		count_components(atom->argv[0])),
+-		FNM_PATHNAME|FNM_EXTMATCH) == 0;
++	char *s, *tmp;
++	int ret;
++
++	s = tmp = strdup(action_data->subpath);
++	tmp = get_start(tmp, count_components(atom->argv[0]));
++
++	ret = fnmatch(atom->argv[0], tmp, FNM_PATHNAME|FNM_EXTMATCH);
++
++	free(s);
++
++	return ret == 0;
+ }
+ 
+ /*
diff --git a/tools/squashfs4/patches/005-Don-t-use-sigwaitinfo-sigtimedwait-if-not-supported.patch b/tools/squashfs4/patches/005-Don-t-use-sigwaitinfo-sigtimedwait-if-not-supported.patch
new file mode 100644
index 0000000000..80e8824c46
--- /dev/null
+++ b/tools/squashfs4/patches/005-Don-t-use-sigwaitinfo-sigtimedwait-if-not-supported.patch
@@ -0,0 +1,192 @@
+From dbe9747b4f09bd2f4d63af06e55c2c3ed35bfca1 Mon Sep 17 00:00:00 2001
+From: Phillip Lougher <phillip at squashfs.org.uk>
+Date: Tue, 7 Feb 2023 23:09:30 +0000
+Subject: [PATCH] Don't use sigwaitinfo()/sigtimedwait() if not supported
+
+If sigwaitinfo() and sigtimedwait() are not supported,
+use sigwait() instead.
+
+This will disable the queue/caches dump if ^\ (SIGQUIT)
+is hit twice within a second.
+
+But the queue/caches dump is still available if SIGHUP
+is sent to the program.
+
+Currently this check is applied to MAC OS X.  FreeBSD and
+NetBSD appear to have these functions.
+
+Signed-off-by: Phillip Lougher <phillip at squashfs.org.uk>
+---
+ squashfs-tools/info.c            | 25 ++-------------
+ squashfs-tools/signals.h         | 54 ++++++++++++++++++++++++++++++++
+ squashfs-tools/unsquashfs_info.c | 25 ++-------------
+ 3 files changed, 60 insertions(+), 44 deletions(-)
+ create mode 100644 squashfs-tools/signals.h
+
+--- a/squashfs-tools/info.c
++++ b/squashfs-tools/info.c
+@@ -2,7 +2,7 @@
+  * Create a squashfs filesystem.  This is a highly compressed read only
+  * filesystem.
+  *
+- * Copyright (c) 2013, 2014, 2019, 2021
++ * Copyright (c) 2013, 2014, 2019, 2021, 2022, 2023
+  * Phillip Lougher <phillip at squashfs.org.uk>
+  *
+  * This program is free software; you can redistribute it and/or
+@@ -42,6 +42,7 @@
+ #include "mksquashfs_error.h"
+ #include "progressbar.h"
+ #include "caches-queues-lists.h"
++#include "signals.h"
+ 
+ static int silent = 0;
+ static struct dir_ent *ent = NULL;
+@@ -144,7 +145,6 @@ void dump_state()
+ void *info_thrd(void *arg)
+ {
+ 	sigset_t sigmask;
+-	struct timespec timespec = { .tv_sec = 1, .tv_nsec = 0 };
+ 	int sig, waiting = 0;
+ 
+ 	sigemptyset(&sigmask);
+@@ -152,26 +152,7 @@ void *info_thrd(void *arg)
+ 	sigaddset(&sigmask, SIGHUP);
+ 
+ 	while(1) {
+-		if(waiting)
+-			sig = sigtimedwait(&sigmask, NULL, &timespec);
+-		else
+-			sig = sigwaitinfo(&sigmask, NULL);
+-
+-		if(sig == -1) {
+-			switch(errno) {
+-			case EAGAIN:
+-				/* interval timed out */
+-				waiting = 0;
+-				/* FALLTHROUGH */
+-			case EINTR:
+-				/* if waiting, the wait will be longer, but
+-				   that's OK */
+-				continue;
+-			default:
+-				BAD_ERROR("sigtimedwait/sigwaitinfo failed "
+-					"because %s\n", strerror(errno));
+-			}
+-		}
++		sig = wait_for_signal(&sigmask, &waiting);
+ 
+ 		if(sig == SIGQUIT && !waiting) {
+ 			print_filename();
+--- /dev/null
++++ b/squashfs-tools/signals.h
+@@ -0,0 +1,54 @@
++#ifndef SIGNALS_H
++#define SIGNALS_H
++/*
++ * Create a squashfs filesystem.  This is a highly compressed read only
++ * filesystem.
++ *
++ * Copyright (c) 2023
++ * Phillip Lougher <phillip at squashfs.org.uk>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License
++ * as published by the Free Software Foundation; either version 2,
++ * or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ *
++ * signals.h
++ */
++
++static inline int wait_for_signal(sigset_t *sigmask, int *waiting)
++{
++	int sig;
++
++#if defined(__APPLE__) && defined(__MACH__)
++	sigwait(sigmask, &sig);
++	*waiting = 0;
++#else
++	struct timespec timespec = { .tv_sec = 1, .tv_nsec = 0 };
++
++	while(1) {
++		if(*waiting)
++			sig = sigtimedwait(sigmask, NULL, &timespec);
++		else
++			sig = sigwaitinfo(sigmask, NULL);
++
++		if(sig != -1)
++			break;
++
++		if(errno == EAGAIN)
++			*waiting = 0;
++		else if(errno != EINTR)
++			BAD_ERROR("sigtimedwait/sigwaitinfo failed because %s\n", strerror(errno));
++	}
++#endif
++	return sig;
++}
++#endif
+--- a/squashfs-tools/unsquashfs_info.c
++++ b/squashfs-tools/unsquashfs_info.c
+@@ -2,7 +2,7 @@
+  * Create a squashfs filesystem.  This is a highly compressed read only
+  * filesystem.
+  *
+- * Copyright (c) 2013, 2021
++ * Copyright (c) 2013, 2021, 2023
+  * Phillip Lougher <phillip at squashfs.org.uk>
+  *
+  * This program is free software; you can redistribute it and/or
+@@ -40,6 +40,7 @@
+ #include "squashfs_fs.h"
+ #include "unsquashfs.h"
+ #include "unsquashfs_error.h"
++#include "signals.h"
+ 
+ char *pathname = NULL;
+ 
+@@ -96,7 +97,6 @@ void dump_state()
+ void *info_thrd(void *arg)
+ {
+ 	sigset_t sigmask;
+-	struct timespec timespec = { .tv_sec = 1, .tv_nsec = 0 };
+ 	int sig, waiting = 0;
+ 
+ 	sigemptyset(&sigmask);
+@@ -104,26 +104,7 @@ void *info_thrd(void *arg)
+ 	sigaddset(&sigmask, SIGHUP);
+ 
+ 	while(1) {
+-		if(waiting)
+-			sig = sigtimedwait(&sigmask, NULL, &timespec);
+-		else
+-			sig = sigwaitinfo(&sigmask, NULL);
+-
+-		if(sig == -1) {
+-			switch(errno) {
+-			case EAGAIN:
+-				/* interval timed out */
+-				waiting = 0;
+-				/* FALLTHROUGH */
+-			case EINTR:
+-				/* if waiting, the wait will be longer, but
+-				   that's OK */
+-				continue;
+-			default:
+-				BAD_ERROR("sigtimedwait/sigwaitinfo failed "
+-					"because %s\n", strerror(errno));
+-			}
+-		}
++		sig = wait_for_signal(&sigmask, &waiting);
+ 
+ 		if(sig == SIGQUIT && !waiting) {
+ 			if(pathname)
diff --git a/tools/squashfs4/patches/006-Move-sysinfo.h-into-the-linux-only-section-should-fi.patch b/tools/squashfs4/patches/006-Move-sysinfo.h-into-the-linux-only-section-should-fi.patch
new file mode 100644
index 0000000000..364356188f
--- /dev/null
+++ b/tools/squashfs4/patches/006-Move-sysinfo.h-into-the-linux-only-section-should-fi.patch
@@ -0,0 +1,49 @@
+From b2f6454a2b2517cfba7a24cf02e9bdf3b959c86a Mon Sep 17 00:00:00 2001
+From: Tony Butler <spudz76 at gmail.com>
+Date: Sat, 18 Feb 2023 13:20:48 -0800
+Subject: [PATCH] Move sysinfo.h into the linux-only section, should fix build
+ on MacOS.
+
+All compilers set `__linux__`, but `linux` may not be defined, and usage
+was mixed.  Use `__linux__` everywhere instead.
+
+Signed-off-by: Tony Butler <spudz76 at gmail.com>
+---
+ squashfs-tools/mksquashfs.c | 6 +++---
+ squashfs-tools/unsquashfs.c | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+--- a/squashfs-tools/mksquashfs.c
++++ b/squashfs-tools/mksquashfs.c
+@@ -50,9 +50,9 @@
+ #include <sys/wait.h>
+ #include <limits.h>
+ #include <ctype.h>
+-#include <sys/sysinfo.h>
+ 
+-#ifdef linux
++#ifdef __linux__
++#include <sys/sysinfo.h>
+ #include <sched.h>
+ #else
+ #include <sys/sysctl.h>
+@@ -5081,7 +5081,7 @@ static void initialise_threads(int readq
+ 		BAD_ERROR("Failed to set signal mask in intialise_threads\n");
+ 
+ 	if(processors == -1) {
+-#ifdef linux
++#ifdef __linux__
+ 		cpu_set_t cpu_set;
+ 		CPU_ZERO(&cpu_set);
+ 
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -2720,7 +2720,7 @@ void initialise_threads(int fragment_buf
+ 	}
+ 
+ 	if(processors == -1) {
+-#ifdef linux
++#ifdef __linux__
+ 		cpu_set_t cpu_set;
+ 		CPU_ZERO(&cpu_set);
+ 
diff --git a/tools/squashfs4/patches/007-Unsquashfs-fix-compilation-error-for-missing-sysctl..patch b/tools/squashfs4/patches/007-Unsquashfs-fix-compilation-error-for-missing-sysctl..patch
new file mode 100644
index 0000000000..b7db00e4cb
--- /dev/null
+++ b/tools/squashfs4/patches/007-Unsquashfs-fix-compilation-error-for-missing-sysctl..patch
@@ -0,0 +1,26 @@
+From dcf492077ef10ed7550b6e2b38b81318645bbdd5 Mon Sep 17 00:00:00 2001
+From: Christian Marangi <ansuelsmth at gmail.com>
+Date: Sun, 19 Feb 2023 04:36:01 +0100
+Subject: [PATCH] Unsquashfs: fix compilation error for missing sysctl.h on
+ macos
+
+Currently the include of sys/sysctl.h is guarded and done only for
+FreeBSD system. Remove this to fix compilation error on macos following
+the same pattern done in mksquashfs.c
+
+Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
+---
+ squashfs-tools/unsquashfs.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/squashfs-tools/unsquashfs.c
++++ b/squashfs-tools/unsquashfs.c
+@@ -36,7 +36,7 @@
+ #include <sched.h>
+ #include <sys/sysinfo.h>
+ #include <sys/sysmacros.h>
+-#elif defined __FreeBSD__
++#else
+ #include <sys/sysctl.h>
+ #endif
+ 
diff --git a/tools/squashfs4/patches/100-portability.patch b/tools/squashfs4/patches/100-portability.patch
new file mode 100644
index 0000000000..fe804d4476
--- /dev/null
+++ b/tools/squashfs4/patches/100-portability.patch
@@ -0,0 +1,37 @@
+--- a/squashfs-tools/xattr.c
++++ b/squashfs-tools/xattr.c
+@@ -115,6 +115,7 @@ int xattr_get_prefix(struct xattr_list *
+ 	
+ static int read_xattrs_from_system(char *filename, struct xattr_list **xattrs)
+ {
++#if defined(linux)
+ 	ssize_t size, vsize;
+ 	char *xattr_names, *p;
+ 	int i;
+@@ -227,6 +228,10 @@ failed:
+ 	free(xattr_list);
+ 	free(xattr_names);
+ 	return 0;
++#else
++	*xattrs = NULL;
++	return 0;
++#endif
+ }
+ 
+ 
+--- a/squashfs-tools/unsquashfs_xattr.c
++++ b/squashfs-tools/unsquashfs_xattr.c
+@@ -36,6 +36,7 @@ extern int strict_errors;
+ 
+ int write_xattr(char *pathname, unsigned int xattr)
+ {
++#if defined(linux)
+ 	unsigned int count;
+ 	struct xattr_list *xattr_list;
+ 	int i;
+@@ -147,4 +148,5 @@ int write_xattr(char *pathname, unsigned
+ 	free_xattr(xattr_list, count);
+ 
+ 	return !failed;
++#endif
+ }
diff --git a/tools/squashfs4/patches/101-xz_wrapper-support-multiple-lzma-configuration-optio.patch b/tools/squashfs4/patches/101-xz_wrapper-support-multiple-lzma-configuration-optio.patch
new file mode 100644
index 0000000000..c882529cad
--- /dev/null
+++ b/tools/squashfs4/patches/101-xz_wrapper-support-multiple-lzma-configuration-optio.patch
@@ -0,0 +1,167 @@
+From f49793cfbd72fdc40ab75dbffef42dca774701d1 Mon Sep 17 00:00:00 2001
+From: Christian Marangi <ansuelsmth at gmail.com>
+Date: Fri, 14 Oct 2022 15:59:16 +0200
+Subject: [PATCH] xz_wrapper: support multiple lzma configuration options
+
+Add option to configure preset, lc, lp and pb lzma parameters.
+-Xpreset can be both a level or set to 'extreme' to use the lzma extreme
+compression options.
+
+New option added:
+ -Xpreset
+ -Xlc
+ -Xlp
+ -Xpb
+
+Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
+---
+ squashfs-tools/xz_wrapper.c | 112 +++++++++++++++++++++++++++++++++++-
+ 1 file changed, 109 insertions(+), 3 deletions(-)
+
+--- a/squashfs-tools/xz_wrapper.c
++++ b/squashfs-tools/xz_wrapper.c
+@@ -44,7 +44,10 @@ static struct bcj bcj[] = {
+ static int filter_count = 1;
+ static int dictionary_size = 0;
+ static float dictionary_percent = 0;
+-
++static int preset = LZMA_PRESET_DEFAULT;
++static int lc = -1;
++static int lp = -1;
++static int pb = -1;
+ 
+ /*
+  * This function is called by the options parsing code in mksquashfs.c
+@@ -53,6 +56,11 @@ static float dictionary_percent = 0;
+  * Two specific options are supported:
+  *	-Xbcj
+  *	-Xdict-size
++ *	-Xpreset
++ *	-Xe
++ *	-Xlc
++ *	-Xlp
++ *	-Xpb
+  *
+  * This function returns:
+  *	>=0 (number of additional args parsed) on success
+@@ -141,6 +149,85 @@ static int xz_options(char *argv[], int
+ 		}
+ 
+ 		return 1;
++	} else if(strcmp(argv[0], "-Xpreset") == 0) {
++		char *b;
++		long val;
++
++		if(argc < 2) {
++			fprintf(stderr, "xz: -Xpreset missing preset-level\n");
++			goto failed;
++		}
++
++		if (strcmp(argv[1], "extreme") == 0) {
++			preset = LZMA_PRESET_EXTREME;
++
++			return 1;
++		}
++
++		val = strtol(argv[1], &b, 10);
++		if ((int) val < 0 || (int) val & ~LZMA_PRESET_LEVEL_MASK) {
++			fprintf(stderr, "xz: -Xpreset can't be "
++				"negative or more than the max preset\n");
++			goto failed;
++		}
++
++		preset = (int) val;
++
++		return 1;
++	} else if(strcmp(argv[0], "-Xlc") == 0) {
++		char *b;
++		long val;
++
++		if(argc < 2) {
++			fprintf(stderr, "xz: -Xlc missing value\n");
++			goto failed;
++		}
++
++		val = strtol(argv[1], &b, 10);
++		if ((int) val < LZMA_LCLP_MIN || (int) val > LZMA_LCLP_MAX) {
++			fprintf(stderr, "xz: -Xlc invalid value\n");
++			goto failed;
++		}
++
++		lc = (int) val;
++
++		return 1;
++	} else if(strcmp(argv[0], "-Xlp") == 0) {
++		char *b;
++		long val;
++
++		if(argc < 2) {
++			fprintf(stderr, "xz: -Xlp missing value\n");
++			goto failed;
++		}
++
++		val = strtol(argv[1], &b, 10);
++		if ((int) val < LZMA_LCLP_MIN || (int) val > LZMA_LCLP_MAX) {
++			fprintf(stderr, "xz: -Xlc invalid value\n");
++			goto failed;
++		}
++
++		lp = (int) val;
++
++		return 1;
++	} else if(strcmp(argv[0], "-Xpb") == 0) {
++		char *b;
++		long val;
++
++		if(argc < 2) {
++			fprintf(stderr, "xz: -Xpb missing value\n");
++			goto failed;
++		}
++
++		val = strtol(argv[1], &b, 10);
++		if ((int) val < LZMA_PB_MIN || (int) val > LZMA_PB_MAX) {
++			fprintf(stderr, "xz: -Xlc invalid value\n");
++			goto failed;
++		}
++
++		pb = (int) val;
++
++		return 1;
+ 	}
+ 
+ 	return -1;
+@@ -446,11 +533,20 @@ static int xz_compress(void *strm, void
+ 	for(i = 0; i < stream->filters; i++) {
+ 		struct filter *filter = &stream->filter[i];
+ 
+-        	if(lzma_lzma_preset(&stream->opt, LZMA_PRESET_DEFAULT))
++        	if(lzma_lzma_preset(&stream->opt, preset))
+                 	goto failed;
+ 
+ 		stream->opt.dict_size = stream->dictionary_size;
+ 
++		if (lc >= 0)
++			stream->opt.lc = lc;
++
++		if (lp >= 0)
++			stream->opt.lp = lp;
++
++		if (pb >= 0)
++			stream->opt.pb = pb;
++
+ 		filter->length = 0;
+ 		res = lzma_stream_buffer_encode(filter->filter,
+ 			LZMA_CHECK_CRC32, NULL, src, size, filter->buffer,
+@@ -521,6 +617,12 @@ static void xz_usage(FILE *stream)
+ 	fprintf(stream, " header as either 2^n or as 2^n+2^(n+1).\n\t\t");
+ 	fprintf(stream, "Example dict-sizes are 75%%, 50%%, 37.5%%, 25%%, or");
+ 	fprintf(stream, " 32K, 16K, 8K\n\t\tetc.\n");
++	fprintf(stream, "\t  -Xpreset <preset-level or extreme>\n");
++	fprintf(stream, "\t\tUse <preset-value> as the custom preset to use");
++	fprintf(stream, "  on compress. Can be a level number or extreme.\n");
++	fprintf(stream, "\t  -Xlc <value>\n");
++	fprintf(stream, "\t  -Xlp <value>\n");
++	fprintf(stream, "\t  -Xpb <value>\n");
+ }
+ 
+ 



From lede-commits at lists.infradead.org  Mon Feb 20 08:03:47 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 20 Feb 2023 11:03:47 -0500
Subject: [openwrt/openwrt]  openssl: bump to 3.0.8
In-Reply-To: <167690902729.2403153.2978281818968293311@git-01.infra.openwrt.org>
References: <167690902729.2403153.2978281818968293311@git-01.infra.openwrt.org>
Message-ID: <mailman.17693.1676909036.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/7e7e76afca7877b97bc049d8f5a83a840a20a2af

commit 7e7e76afca7877b97bc049d8f5a83a840a20a2af
Author: Eneas U de Queiroz <cotequeiroz at gmail.com>
AuthorDate: Tue Feb 7 18:14:27 2023 -0300

    openssl: bump to 3.0.8
    
    This is a major update to the current LTS version, supported until
    2026-09-07.
    
    Changelog:
    https://github.com/openssl/openssl/blob/openssl-3.0.8/CHANGES.md
    
    Signed-off-by: Eneas U de Queiroz <cotequeiroz at gmail.com>
---
 include/openssl-engine.mk                          |    4 +-
 package/libs/openssl/Config.in                     |   40 +-
 package/libs/openssl/Makefile                      |   20 +-
 ...erlasm-ppc-xlate.pl-add-linux64v2-flavour.patch |   55 -
 .../patches/100-Configure-afalg-support.patch      |    2 +-
 .../patches/120-strip-cflags-from-binary.patch     |    8 +-
 .../openssl/patches/130-dont-build-fuzz-docs.patch |   20 +
 .../patches/130-dont-build-tests-fuzz.patch        |   29 -
 .../patches/140-allow-prefer-chacha20.patch        |   60 +-
 .../patches/150-openssl.cnf-add-engines-conf.patch |    4 +-
 ...crypto-save-ioctl-if-EVP_MD_.FLAG_ONESHOT.patch |   58 -
 ...0-eng_devcrypto-add-configuration-options.patch |  566 ----
 ...devcrypto-add-command-to-dump-driver-info.patch |  273 --
 ...crypto-make-the-dev-crypto-engine-dynamic.patch | 2718 --------------------
 ...ypto-default-to-not-use-digests-in-engine.patch |   41 -
 ...vcrypto-ignore-error-when-closing-session.patch |   24 -
 16 files changed, 87 insertions(+), 3835 deletions(-)

diff --git a/include/openssl-engine.mk b/include/openssl-engine.mk
index d8baba482e..891d284f12 100644
--- a/include/openssl-engine.mk
+++ b/include/openssl-engine.mk
@@ -1,8 +1,8 @@
 # SPDX-License-Identifier: GPL-2.0-only
 #
-# Copyright (C) 2022 En?as Ulir de Queiroz
+# Copyright (C) 2022-2023 En?as Ulir de Queiroz
 
-ENGINES_DIR=engines-1.1
+ENGINES_DIR=engines-3
 
 define Package/openssl/engine/Default
   SECTION:=libs
diff --git a/package/libs/openssl/Config.in b/package/libs/openssl/Config.in
index bc2f0584b6..6a668fe4cd 100644
--- a/package/libs/openssl/Config.in
+++ b/package/libs/openssl/Config.in
@@ -8,11 +8,9 @@ config OPENSSL_OPTIMIZE_SPEED
 	prompt "Enable optimization for speed instead of size"
 	select OPENSSL_WITH_ASM
 	help
-		Enabling this option increases code size (around 20%) and
-		performance.  The increase in performance and size depends on the
-		target CPU. EC and AES seem to benefit the most, with EC speed
-		increased by 20%-50% (mipsel & x86).
-		AES-GCM is supposed to be 3x faster on x86. YMMV.
+		Enabling this option increases code size and performance.
+		The increase in performance and size depends on the
+		target CPU. EC and AES seem to benefit the most.
 
 config OPENSSL_WITH_ASM
 	bool
@@ -22,19 +20,7 @@ config OPENSSL_WITH_ASM
 	help
 		Disabling this option will reduce code size and performance.
 		The increase in performance and size depends on the target
-		CPU and on the algorithms being optimized.  As of 1.1.0i*:
-
-		Platform  Pkg Inc. Algorithms where assembly is used - ~% Speed Increase
-		aarch64   174K     BN, aes, sha1, sha256, sha512, nist256, poly1305
-		arm       152K     BN, aes, sha1, sha256, sha512, nist256, poly1305
-		i386      183K     BN+147%, aes+300%, rc4+55%, sha1+160%, sha256+114%, sha512+270%, nist256+282%, poly1305+292%
-		mipsel      1.5K   BN+97%, aes+4%, sha1+94%, sha256+60%
-		mips64	    3.7K   BN, aes, sha1, sha256, sha512, poly1305
-		powerpc    20K     BN, aes, sha1, sha256, sha512, poly1305
-		x86_64    228K     BN+220%, aes+173%, rc4+38%, sha1+40%, sha256+64%, sha512+31%, nist256+354%, poly1305+228%
-
-		* Only most common algorithms shown. Your mileage may vary.
-		  BN (bignum) performance was measured using RSA sign/verify.
+		CPU and on the algorithms being optimized.
 
 config OPENSSL_WITH_SSE2
 	bool
@@ -42,21 +28,17 @@ config OPENSSL_WITH_SSE2
 	prompt "Enable use of x86 SSE2 instructions"
 	depends on OPENSSL_WITH_ASM && i386
 	help
-		Use of SSE2 instructions greatly increase performance (up to
-		3x faster) with a minimum (~0.2%, or 23KB) increase in package
-		size, but it will bring no benefit if your hardware does not
-		support them, such as Geode GX and LX.  In this case you may
-		save 23KB by saying yes here.  AMD Geode NX, and Intel
-		Pentium 4 and above support SSE2.
+		Use of SSE2 instructions greatly increase performance with a
+		minimum increase in package size, but it will bring no benefit
+		if your hardware does not support them, such as Geode GX and LX.
+		AMD Geode NX, and Intel Pentium 4 and above support SSE2.
 
 config OPENSSL_WITH_DEPRECATED
 	bool
 	default y
-	prompt "Include deprecated APIs (See help for a list of packages that need this)"
+	prompt "Include deprecated APIs"
 	help
-		Since openssl 1.1.x is still new to openwrt, some packages
-		requiring this option do not list it as a requirement yet:
-		 * freeswitch-stable, freeswitch, python, python3, squid.
+		This drops all deprecated API, including engine support.
 
 config OPENSSL_NO_DEPRECATED
 	bool
@@ -84,7 +66,6 @@ config OPENSSL_WITH_TLS13
 		   protocol;
 		 * to increase performance by reducing the number of round-trips
 		   when performing a full handshake.
-		It increases package size by ~4KB.
 
 config OPENSSL_WITH_DTLS
 	bool
@@ -233,6 +214,7 @@ comment "Engine/Hardware Support"
 
 config OPENSSL_ENGINE
 	bool "Enable engine support"
+	select OPENSSL_WITH_DEPRECATED
 	default y
 	help
 		This enables alternative cryptography implementations,
diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index 4883ef82ea..7dc4df0982 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -8,14 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssl
-PKG_BASE:=1.1.1
-PKG_BUGFIX:=t
-PKG_VERSION:=$(PKG_BASE)$(PKG_BUGFIX)
+PKG_VERSION:=3.0.8
 PKG_RELEASE:=1
 PKG_USE_MIPS16:=0
 
 PKG_BUILD_PARALLEL:=1
 
+PKG_BASE:=$(subst $(space),.,$(wordlist 1,2,$(subst .,$(space),$(PKG_VERSION))))
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:= \
 	http://www.openssl.org/source/ \
@@ -25,9 +24,9 @@ PKG_SOURCE_URL:= \
 	ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/ \
 	ftp://ftp.pca.dfn.de/pub/tools/net/openssl/source/old/$(PKG_BASE)/
 
-PKG_HASH:=8dee9b24bdb1dcbf0c3d1e9b02fb8f6bf22165e807f45adeb7c9677536859d3b
+PKG_HASH:=6c13d2bf38fdf31eac3ce2a347073673f5d63263398f1f69d0df4a41253e4b3e
 
-PKG_LICENSE:=OpenSSL
+PKG_LICENSE:=Apache-2.0
 PKG_LICENSE_FILES:=LICENSE
 PKG_MAINTAINER:=Eneas U de Queiroz <cotequeiroz at gmail.com>
 PKG_CPE_ID:=cpe:/a:openssl:openssl
@@ -95,9 +94,10 @@ $(call Package/openssl/Default)
   DEPENDS:=+OPENSSL_WITH_COMPRESSION:zlib \
 	   +OPENSSL_ENGINE_BUILTIN_AFALG:kmod-crypto-user \
 	   +OPENSSL_ENGINE_BUILTIN_DEVCRYPTO:kmod-cryptodev \
-	   +OPENSSL_ENGINE_BUILTIN_PADLOCK:kmod-crypto-hw-padlock
+	   +OPENSSL_ENGINE_BUILTIN_PADLOCK:kmod-crypto-hw-padlock \
+	   +(arm||armeb||mips||mipsel||ppc):libatomic
   TITLE+= (libraries)
-  ABI_VERSION:=1.1
+  ABI_VERSION:=$(firstword $(subst .,$(space),$(PKG_VERSION)))
   MENU:=1
 endef
 
@@ -186,7 +186,7 @@ and https://openwrt.org/docs/techref/hardware/cryptographic.hardware.accelerator
 The engine_id is "padlock"
 endef
 
-OPENSSL_OPTIONS:= shared
+OPENSSL_OPTIONS:= shared no-tests
 
 ifndef CONFIG_OPENSSL_WITH_BLAKE2
   OPENSSL_OPTIONS += no-blake2
@@ -272,7 +272,7 @@ ifdef CONFIG_OPENSSL_ENGINE
       OPENSSL_OPTIONS += enable-devcryptoeng
     endif
     ifndef CONFIG_OPENSSL_ENGINE_BUILTIN_PADLOCK
-      OPENSSL_OPTIONS += no-hw-padlock
+      OPENSSL_OPTIONS += no-padlockeng
     endif
   else
     ifdef CONFIG_PACKAGE_libopenssl-devcrypto
@@ -282,7 +282,7 @@ ifdef CONFIG_OPENSSL_ENGINE
       OPENSSL_OPTIONS += no-afalgeng
     endif
     ifndef CONFIG_PACKAGE_libopenssl-padlock
-      OPENSSL_OPTIONS += no-hw-padlock
+      OPENSSL_OPTIONS += no-padlockeng
     endif
   endif
 else
diff --git a/package/libs/openssl/patches/001-crypto-perlasm-ppc-xlate.pl-add-linux64v2-flavour.patch b/package/libs/openssl/patches/001-crypto-perlasm-ppc-xlate.pl-add-linux64v2-flavour.patch
deleted file mode 100644
index 3da67e25fc..0000000000
--- a/package/libs/openssl/patches/001-crypto-perlasm-ppc-xlate.pl-add-linux64v2-flavour.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Andy Polyakov <appro at openssl.org>
-Date: Sun, 5 May 2019 18:25:50 +0200
-Subject: crypto/perlasm/ppc-xlate.pl: add linux64v2 flavour
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-This is a big endian ELFv2 configuration. ELFv2 was already being
-used for little endian, and big endian was traditionally ELFv1
-but there are practical configurations that use ELFv2 with big
-endian nowadays (Ad?lie Linux, Void Linux, possibly Gentoo, etc.)
-
-Reviewed-by: Paul Dale <paul.dale at oracle.com>
-Reviewed-by: Richard Levitte <levitte at openssl.org>
-(Merged from https://github.com/openssl/openssl/pull/8883)
-
---- a/crypto/perlasm/ppc-xlate.pl
-+++ b/crypto/perlasm/ppc-xlate.pl
-@@ -49,7 +49,7 @@ my $globl = sub {
- 	/osx/		&& do { $name = "_$name";
- 				last;
- 			      };
--	/linux.*(32|64le)/
-+	/linux.*(32|64(le|v2))/
- 			&& do {	$ret .= ".globl	$name";
- 				if (!$$type) {
- 				    $ret .= "\n.type	$name,\@function";
-@@ -80,7 +80,7 @@ my $globl = sub {
- };
- my $text = sub {
-     my $ret = ($flavour =~ /aix/) ? ".csect\t.text[PR],7" : ".text";
--    $ret = ".abiversion	2\n".$ret	if ($flavour =~ /linux.*64le/);
-+    $ret = ".abiversion	2\n".$ret	if ($flavour =~ /linux.*64(le|v2)/);
-     $ret;
- };
- my $machine = sub {
-@@ -186,7 +186,7 @@ my $vmr = sub {
- 
- # Some ABIs specify vrsave, special-purpose register #256, as reserved
- # for system use.
--my $no_vrsave = ($flavour =~ /aix|linux64le/);
-+my $no_vrsave = ($flavour =~ /aix|linux64(le|v2)/);
- my $mtspr = sub {
-     my ($f,$idx,$ra) = @_;
-     if ($idx == 256 && $no_vrsave) {
-@@ -318,7 +318,7 @@ while($line=<>) {
- 	if ($label) {
- 	    my $xlated = ($GLOBALS{$label} or $label);
- 	    print "$xlated:";
--	    if ($flavour =~ /linux.*64le/) {
-+	    if ($flavour =~ /linux.*64(le|v2)/) {
- 		if ($TYPES{$label} =~ /function/) {
- 		    printf "\n.localentry	%s,0\n",$xlated;
- 		}
diff --git a/package/libs/openssl/patches/100-Configure-afalg-support.patch b/package/libs/openssl/patches/100-Configure-afalg-support.patch
index 746c50621f..e9cd7bf9c1 100644
--- a/package/libs/openssl/patches/100-Configure-afalg-support.patch
+++ b/package/libs/openssl/patches/100-Configure-afalg-support.patch
@@ -10,7 +10,7 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github at yahoo.com>
 
 --- a/Configure
 +++ b/Configure
-@@ -1548,7 +1548,9 @@ unless ($disabled{"crypto-mdebug-backtra
+@@ -1677,7 +1677,9 @@ $config{CFLAGS} = [ map { $_ eq '--ossl-
  
  unless ($disabled{afalgeng}) {
      $config{afalgeng}="";
diff --git a/package/libs/openssl/patches/120-strip-cflags-from-binary.patch b/package/libs/openssl/patches/120-strip-cflags-from-binary.patch
index 90282706d1..e9f4fc131a 100644
--- a/package/libs/openssl/patches/120-strip-cflags-from-binary.patch
+++ b/package/libs/openssl/patches/120-strip-cflags-from-binary.patch
@@ -10,12 +10,12 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github at yahoo.com>
 
 --- a/crypto/build.info
 +++ b/crypto/build.info
-@@ -10,7 +10,7 @@ EXTRA=  ../ms/uplink-x86.pl ../ms/uplink
-         ppccpuid.pl pariscid.pl alphacpuid.pl arm64cpuid.pl armv4cpuid.pl
+@@ -113,7 +113,7 @@ DEFINE[../libcrypto]=$UPLINKDEF
  
+ DEPEND[info.o]=buildinf.h
  DEPEND[cversion.o]=buildinf.h
 -GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC) $(LIB_CFLAGS) $(CPPFLAGS_Q)" "$(PLATFORM)"
 +GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(filter-out -I% -iremap% -fmacro-prefix-map% -ffile-prefix-map%,$(CC) $(LIB_CFLAGS) $(CPPFLAGS_Q))" "$(PLATFORM)"
- DEPEND[buildinf.h]=../configdata.pm
  
- GENERATE[uplink-x86.s]=../ms/uplink-x86.pl $(PERLASM_SCHEME)
+ GENERATE[uplink-x86.S]=../ms/uplink-x86.pl
+ GENERATE[uplink-x86_64.s]=../ms/uplink-x86_64.pl
diff --git a/package/libs/openssl/patches/130-dont-build-fuzz-docs.patch b/package/libs/openssl/patches/130-dont-build-fuzz-docs.patch
new file mode 100644
index 0000000000..60c4663923
--- /dev/null
+++ b/package/libs/openssl/patches/130-dont-build-fuzz-docs.patch
@@ -0,0 +1,20 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Eneas U de Queiroz <cote2004-github at yahoo.com>
+Date: Thu, 27 Sep 2018 08:34:38 -0300
+Subject: Do not build tests and fuzz directories
+
+This shortens build time.
+
+Signed-off-by: Eneas U de Queiroz <cote2004-github at yahoo.com>
+
+--- a/build.info
++++ b/build.info
+@@ -1,7 +1,7 @@
+ # Note that some of these directories are filtered in Configure.  Look for
+ # %skipdir there for further explanations.
+ 
+-SUBDIRS=crypto ssl apps util tools fuzz providers doc
++SUBDIRS=crypto ssl apps util tools providers
+ IF[{- !$disabled{tests} -}]
+   SUBDIRS=test
+ ENDIF
diff --git a/package/libs/openssl/patches/130-dont-build-tests-fuzz.patch b/package/libs/openssl/patches/130-dont-build-tests-fuzz.patch
deleted file mode 100644
index baf8bca9e1..0000000000
--- a/package/libs/openssl/patches/130-dont-build-tests-fuzz.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Eneas U de Queiroz <cote2004-github at yahoo.com>
-Date: Thu, 27 Sep 2018 08:34:38 -0300
-Subject: Do not build tests and fuzz directories
-
-This shortens build time.
-
-Signed-off-by: Eneas U de Queiroz <cote2004-github at yahoo.com>
-
---- a/Configure
-+++ b/Configure
-@@ -318,7 +318,7 @@ my $auto_threads=1;    # enable threads
- my $default_ranlib;
- 
- # Top level directories to build
--$config{dirs} = [ "crypto", "ssl", "engines", "apps", "test", "util", "tools", "fuzz" ];
-+$config{dirs} = [ "crypto", "ssl", "engines", "apps", "util", "tools" ];
- # crypto/ subdirectories to build
- $config{sdirs} = [
-     "objects",
-@@ -330,7 +330,7 @@ $config{sdirs} = [
-     "cms", "ts", "srp", "cmac", "ct", "async", "kdf", "store"
-     ];
- # test/ subdirectories to build
--$config{tdirs} = [ "ossl_shim" ];
-+$config{tdirs} = [];
- 
- # Known TLS and DTLS protocols
- my @tls = qw(ssl3 tls1 tls1_1 tls1_2 tls1_3);
diff --git a/package/libs/openssl/patches/140-allow-prefer-chacha20.patch b/package/libs/openssl/patches/140-allow-prefer-chacha20.patch
index 99afd9acf8..43fd92e388 100644
--- a/package/libs/openssl/patches/140-allow-prefer-chacha20.patch
+++ b/package/libs/openssl/patches/140-allow-prefer-chacha20.patch
@@ -14,30 +14,9 @@ when the client has it on top of its ciphersuite preference.
 
 Signed-off-by: Eneas U de Queiroz <cote2004-github at yahoo.com>
 
---- a/include/openssl/ssl.h
-+++ b/include/openssl/ssl.h
-@@ -173,9 +173,15 @@ extern "C" {
- # define SSL_DEFAULT_CIPHER_LIST "ALL:!COMPLEMENTOFDEFAULT:!eNULL"
- /* This is the default set of TLSv1.3 ciphersuites */
- # if !defined(OPENSSL_NO_CHACHA) && !defined(OPENSSL_NO_POLY1305)
--#  define TLS_DEFAULT_CIPHERSUITES "TLS_AES_256_GCM_SHA384:" \
--                                   "TLS_CHACHA20_POLY1305_SHA256:" \
--                                   "TLS_AES_128_GCM_SHA256"
-+#  ifdef OPENSSL_PREFER_CHACHA_OVER_GCM
-+#   define TLS_DEFAULT_CIPHERSUITES "TLS_CHACHA20_POLY1305_SHA256:" \
-+                                    "TLS_AES_256_GCM_SHA384:" \
-+                                    "TLS_AES_128_GCM_SHA256"
-+#  else
-+#   define TLS_DEFAULT_CIPHERSUITES "TLS_AES_256_GCM_SHA384:" \
-+                                    "TLS_CHACHA20_POLY1305_SHA256:" \
-+                                    "TLS_AES_128_GCM_SHA256"
-+#  endif
- # else
- #  define TLS_DEFAULT_CIPHERSUITES "TLS_AES_256_GCM_SHA384:" \
-                                    "TLS_AES_128_GCM_SHA256"
 --- a/ssl/ssl_ciph.c
 +++ b/ssl/ssl_ciph.c
-@@ -1465,11 +1465,29 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_
+@@ -1505,11 +1505,29 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_
      ssl_cipher_apply_rule(0, SSL_kECDHE, 0, 0, 0, 0, 0, CIPHER_DEL, -1, &head,
                            &tail);
  
@@ -67,7 +46,7 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github at yahoo.com>
  
      /*
       * ...and generally, our preferred cipher is AES.
-@@ -1525,7 +1543,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_
+@@ -1564,7 +1582,7 @@ STACK_OF(SSL_CIPHER) *ssl_create_cipher_
       * Within each group, ciphers remain sorted by strength and previous
       * preference, i.e.,
       * 1) ECDHE > DHE
@@ -76,3 +55,38 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github at yahoo.com>
       * 3) AES > rest
       * 4) TLS 1.2 > legacy
       *
+@@ -2235,7 +2253,13 @@ const char *OSSL_default_cipher_list(voi
+  */
+ const char *OSSL_default_ciphersuites(void)
+ {
++#ifdef OPENSSL_PREFER_CHACHA_OVER_GCM
++    return "TLS_CHACHA20_POLY1305_SHA256:"
++           "TLS_AES_256_GCM_SHA384:"
++           "TLS_AES_128_GCM_SHA256";
++#else
+     return "TLS_AES_256_GCM_SHA384:"
+            "TLS_CHACHA20_POLY1305_SHA256:"
+            "TLS_AES_128_GCM_SHA256";
++#endif
+ }
+--- a/include/openssl/ssl.h.in
++++ b/include/openssl/ssl.h.in
+@@ -195,9 +195,15 @@ extern "C" {
+  * DEPRECATED IN 3.0.0, in favor of OSSL_default_ciphersuites()
+  * Update both macro and function simultaneously
+  */
+-#  define TLS_DEFAULT_CIPHERSUITES "TLS_AES_256_GCM_SHA384:" \
+-                                   "TLS_CHACHA20_POLY1305_SHA256:" \
+-                                   "TLS_AES_128_GCM_SHA256"
++#  ifdef OPENSSL_PREFER_CHACHA_OVER_GCM
++#   define TLS_DEFAULT_CIPHERSUITES "TLS_CHACHA20_POLY1305_SHA256:" \
++                                    "TLS_AES_256_GCM_SHA384:" \
++                                    "TLS_AES_128_GCM_SHA256"
++#  else
++#   define TLS_DEFAULT_CIPHERSUITES "TLS_AES_256_GCM_SHA384:" \
++                                    "TLS_CHACHA20_POLY1305_SHA256:" \
++                                    "TLS_AES_128_GCM_SHA256"
++#  endif
+ # endif
+ /*
+  * As of OpenSSL 1.0.0, ssl_create_cipher_list() in ssl/ssl_ciph.c always
diff --git a/package/libs/openssl/patches/150-openssl.cnf-add-engines-conf.patch b/package/libs/openssl/patches/150-openssl.cnf-add-engines-conf.patch
index fa92fbe2ab..b1ec0cae71 100644
--- a/package/libs/openssl/patches/150-openssl.cnf-add-engines-conf.patch
+++ b/package/libs/openssl/patches/150-openssl.cnf-add-engines-conf.patch
@@ -10,7 +10,7 @@ Signed-off-by: Eneas U de Queiroz <cotequeiroz at gmail.com>
 
 --- a/apps/openssl.cnf
 +++ b/apps/openssl.cnf
-@@ -22,6 +22,16 @@ oid_section		= new_oids
+@@ -30,6 +30,16 @@ oid_section = new_oids
  # (Alternatively, use a configuration file that has only
  # X.509v3 extensions in its main [= default] section.)
  
@@ -25,5 +25,5 @@ Signed-off-by: Eneas U de Queiroz <cotequeiroz at gmail.com>
 +.include /etc/ssl/engines.cnf.d
 +
  [ new_oids ]
- 
  # We can add new OIDs in here for use by 'ca', 'req' and 'ts'.
+ # Add a simple OID like this:
diff --git a/package/libs/openssl/patches/400-eng_devcrypto-save-ioctl-if-EVP_MD_.FLAG_ONESHOT.patch b/package/libs/openssl/patches/400-eng_devcrypto-save-ioctl-if-EVP_MD_.FLAG_ONESHOT.patch
deleted file mode 100644
index ed8204c339..0000000000
--- a/package/libs/openssl/patches/400-eng_devcrypto-save-ioctl-if-EVP_MD_.FLAG_ONESHOT.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Eneas U de Queiroz <cote2004-github at yahoo.com>
-Date: Mon, 5 Nov 2018 15:54:17 -0200
-Subject: eng_devcrypto: save ioctl if EVP_MD_..FLAG_ONESHOT
-
-Since each ioctl causes a context switch, slowing things down, if
-EVP_MD_CTX_FLAG_ONESHOT is set, then:
- - call the ioctl in digest_update, saving the result; and
- - just copy the result in digest_final, instead of using another ioctl.
-
-Signed-off-by: Eneas U de Queiroz <cote2004-github at yahoo.com>
-
-Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre at ncp-e.com>
-Reviewed-by: Richard Levitte <levitte at openssl.org>
-(Merged from https://github.com/openssl/openssl/pull/7585)
-
---- a/crypto/engine/eng_devcrypto.c
-+++ b/crypto/engine/eng_devcrypto.c
-@@ -461,6 +461,7 @@ struct digest_ctx {
-     struct session_op sess;
-     /* This signals that the init function was called, not that it succeeded. */
-     int init_called;
-+    unsigned char digest_res[HASH_MAX_LEN];
- };
- 
- static const struct digest_data_st {
-@@ -564,12 +565,15 @@ static int digest_update(EVP_MD_CTX *ctx
-     if (digest_ctx == NULL)
-         return 0;
- 
--    if (digest_op(digest_ctx, data, count, NULL, COP_FLAG_UPDATE) < 0) {
--        SYSerr(SYS_F_IOCTL, errno);
--        return 0;
-+    if (EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT)) {
-+        if (digest_op(digest_ctx, data, count, digest_ctx->digest_res, 0) >= 0)
-+            return 1;
-+    } else if (digest_op(digest_ctx, data, count, NULL, COP_FLAG_UPDATE) >= 0) {
-+        return 1;
-     }
- 
--    return 1;
-+    SYSerr(SYS_F_IOCTL, errno);
-+    return 0;
- }
- 
- static int digest_final(EVP_MD_CTX *ctx, unsigned char *md)
-@@ -579,7 +583,10 @@ static int digest_final(EVP_MD_CTX *ctx,
- 
-     if (md == NULL || digest_ctx == NULL)
-         return 0;
--    if (digest_op(digest_ctx, NULL, 0, md, COP_FLAG_FINAL) < 0) {
-+
-+    if (EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT)) {
-+        memcpy(md, digest_ctx->digest_res, EVP_MD_CTX_size(ctx));
-+    } else if (digest_op(digest_ctx, NULL, 0, md, COP_FLAG_FINAL) < 0) {
-         SYSerr(SYS_F_IOCTL, errno);
-         return 0;
-     }
diff --git a/package/libs/openssl/patches/410-eng_devcrypto-add-configuration-options.patch b/package/libs/openssl/patches/410-eng_devcrypto-add-configuration-options.patch
deleted file mode 100644
index bad7a37256..0000000000
--- a/package/libs/openssl/patches/410-eng_devcrypto-add-configuration-options.patch
+++ /dev/null
@@ -1,566 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Eneas U de Queiroz <cote2004-github at yahoo.com>
-Date: Sat, 3 Nov 2018 15:41:10 -0300
-Subject: eng_devcrypto: add configuration options
-
-USE_SOFTDRIVERS: whether to use software (not accelerated) drivers
-CIPHERS: list of ciphers to enable
-DIGESTS: list of digests to enable
-
-Signed-off-by: Eneas U de Queiroz <cote2004-github at yahoo.com>
-
-Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre at ncp-e.com>
-Reviewed-by: Richard Levitte <levitte at openssl.org>
-(Merged from https://github.com/openssl/openssl/pull/7585)
-
---- a/crypto/engine/eng_devcrypto.c
-+++ b/crypto/engine/eng_devcrypto.c
-@@ -16,6 +16,7 @@
- #include <unistd.h>
- #include <assert.h>
- 
-+#include <openssl/conf.h>
- #include <openssl/evp.h>
- #include <openssl/err.h>
- #include <openssl/engine.h>
-@@ -36,6 +37,30 @@
-  * saner...  why re-open /dev/crypto for every session?
-  */
- static int cfd;
-+#define DEVCRYPTO_REQUIRE_ACCELERATED 0 /* require confirmation of acceleration */
-+#define DEVCRYPTO_USE_SOFTWARE        1 /* allow software drivers */
-+#define DEVCRYPTO_REJECT_SOFTWARE     2 /* only disallow confirmed software drivers */
-+
-+#define DEVCRYPTO_DEFAULT_USE_SOFDTRIVERS DEVCRYPTO_REJECT_SOFTWARE
-+static int use_softdrivers = DEVCRYPTO_DEFAULT_USE_SOFDTRIVERS;
-+
-+/*
-+ * cipher/digest status & acceleration definitions
-+ * Make sure the defaults are set to 0
-+ */
-+struct driver_info_st {
-+    enum devcrypto_status_t {
-+        DEVCRYPTO_STATUS_UNUSABLE       = -1, /* session open failed */
-+        DEVCRYPTO_STATUS_UNKNOWN        =  0, /* not tested yet */
-+        DEVCRYPTO_STATUS_USABLE         =  1  /* algo can be used */
-+    } status;
-+
-+    enum devcrypto_accelerated_t {
-+        DEVCRYPTO_NOT_ACCELERATED       = -1, /* software implemented */
-+        DEVCRYPTO_ACCELERATION_UNKNOWN  =  0, /* acceleration support unkown */
-+        DEVCRYPTO_ACCELERATED           =  1  /* hardware accelerated */
-+    } accelerated;
-+};
- 
- static int clean_devcrypto_session(struct session_op *sess) {
-     if (ioctl(cfd, CIOCFSESSION, &sess->ses) < 0) {
-@@ -119,13 +144,22 @@ static const struct cipher_data_st {
- #endif
- };
- 
--static size_t get_cipher_data_index(int nid)
-+static size_t find_cipher_data_index(int nid)
- {
-     size_t i;
- 
-     for (i = 0; i < OSSL_NELEM(cipher_data); i++)
-         if (nid == cipher_data[i].nid)
-             return i;
-+    return (size_t)-1;
-+}
-+
-+static size_t get_cipher_data_index(int nid)
-+{
-+    size_t i = find_cipher_data_index(nid);
-+
-+    if (i != (size_t)-1)
-+        return i;
- 
-     /*
-      * Code further down must make sure that only NIDs in the table above
-@@ -333,19 +367,40 @@ static int cipher_cleanup(EVP_CIPHER_CTX
- }
- 
- /*
-- * Keep a table of known nids and associated methods.
-+ * Keep tables of known nids, associated methods, selected ciphers, and driver
-+ * info.
-  * Note that known_cipher_nids[] isn't necessarily indexed the same way as
-- * cipher_data[] above, which known_cipher_methods[] is.
-+ * cipher_data[] above, which the other tables are.
-  */
- static int known_cipher_nids[OSSL_NELEM(cipher_data)];
- static int known_cipher_nids_amount = -1; /* -1 indicates not yet initialised */
- static EVP_CIPHER *known_cipher_methods[OSSL_NELEM(cipher_data)] = { NULL, };
-+static int selected_ciphers[OSSL_NELEM(cipher_data)];
-+static struct driver_info_st cipher_driver_info[OSSL_NELEM(cipher_data)];
-+
-+
-+static int devcrypto_test_cipher(size_t cipher_data_index)
-+{
-+    return (cipher_driver_info[cipher_data_index].status == DEVCRYPTO_STATUS_USABLE
-+            && selected_ciphers[cipher_data_index] == 1
-+            && (cipher_driver_info[cipher_data_index].accelerated
-+                    == DEVCRYPTO_ACCELERATED
-+                || use_softdrivers == DEVCRYPTO_USE_SOFTWARE
-+                || (cipher_driver_info[cipher_data_index].accelerated
-+                        != DEVCRYPTO_NOT_ACCELERATED
-+                    && use_softdrivers == DEVCRYPTO_REJECT_SOFTWARE)));
-+}
- 
- static void prepare_cipher_methods(void)
- {
-     size_t i;
-     struct session_op sess;
-     unsigned long cipher_mode;
-+#ifdef CIOCGSESSINFO
-+    struct session_info_op siop;
-+#endif
-+
-+    memset(&cipher_driver_info, 0, sizeof(cipher_driver_info));
- 
-     memset(&sess, 0, sizeof(sess));
-     sess.key = (void *)"01234567890123456789012345678901234567890123456789";
-@@ -353,15 +408,16 @@ static void prepare_cipher_methods(void)
-     for (i = 0, known_cipher_nids_amount = 0;
-          i < OSSL_NELEM(cipher_data); i++) {
- 
-+        selected_ciphers[i] = 1;
-         /*
--         * Check that the algo is really availably by trying to open and close
--         * a session.
-+         * Check that the cipher is usable
-          */
-         sess.cipher = cipher_data[i].devcryptoid;
-         sess.keylen = cipher_data[i].keylen;
--        if (ioctl(cfd, CIOCGSESSION, &sess) < 0
--            || ioctl(cfd, CIOCFSESSION, &sess.ses) < 0)
-+        if (ioctl(cfd, CIOCGSESSION, &sess) < 0) {
-+            cipher_driver_info[i].status = DEVCRYPTO_STATUS_UNUSABLE;
-             continue;
-+        }
- 
-         cipher_mode = cipher_data[i].flags & EVP_CIPH_MODE;
- 
-@@ -387,15 +443,41 @@ static void prepare_cipher_methods(void)
-                                             cipher_cleanup)
-             || !EVP_CIPHER_meth_set_impl_ctx_size(known_cipher_methods[i],
-                                                   sizeof(struct cipher_ctx))) {
-+            cipher_driver_info[i].status = DEVCRYPTO_STATUS_UNUSABLE;
-             EVP_CIPHER_meth_free(known_cipher_methods[i]);
-             known_cipher_methods[i] = NULL;
-         } else {
-+            cipher_driver_info[i].status = DEVCRYPTO_STATUS_USABLE;
-+#ifdef CIOCGSESSINFO
-+            siop.ses = sess.ses;
-+            if (ioctl(cfd, CIOCGSESSINFO, &siop) < 0)
-+                cipher_driver_info[i].accelerated = DEVCRYPTO_ACCELERATION_UNKNOWN;
-+            else if (!(siop.flags & SIOP_FLAG_KERNEL_DRIVER_ONLY))
-+                cipher_driver_info[i].accelerated = DEVCRYPTO_NOT_ACCELERATED;
-+            else
-+                cipher_driver_info[i].accelerated = DEVCRYPTO_ACCELERATED;
-+#endif /* CIOCGSESSINFO */
-+        }
-+        ioctl(cfd, CIOCFSESSION, &sess.ses);
-+        if (devcrypto_test_cipher(i)) {
-             known_cipher_nids[known_cipher_nids_amount++] =
-                 cipher_data[i].nid;
-         }
-     }
- }
- 
-+static void rebuild_known_cipher_nids(ENGINE *e)
-+{
-+    size_t i;
-+
-+    for (i = 0, known_cipher_nids_amount = 0; i < OSSL_NELEM(cipher_data); i++) {
-+        if (devcrypto_test_cipher(i))
-+            known_cipher_nids[known_cipher_nids_amount++] = cipher_data[i].nid;
-+    }
-+    ENGINE_unregister_ciphers(e);
-+    ENGINE_register_ciphers(e);
-+}
-+
- static const EVP_CIPHER *get_cipher_method(int nid)
- {
-     size_t i = get_cipher_data_index(nid);
-@@ -438,6 +520,36 @@ static int devcrypto_ciphers(ENGINE *e,
-     return *cipher != NULL;
- }
- 
-+static void devcrypto_select_all_ciphers(int *cipher_list)
-+{
-+    size_t i;
-+
-+    for (i = 0; i < OSSL_NELEM(cipher_data); i++)
-+        cipher_list[i] = 1;
-+}
-+
-+static int cryptodev_select_cipher_cb(const char *str, int len, void *usr)
-+{
-+    int *cipher_list = (int *)usr;
-+    char *name;
-+    const EVP_CIPHER *EVP;
-+    size_t i;
-+
-+    if (len == 0)
-+        return 1;
-+    if (usr == NULL || (name = OPENSSL_strndup(str, len)) == NULL)
-+        return 0;
-+    EVP = EVP_get_cipherbyname(name);
-+    if (EVP == NULL)
-+        fprintf(stderr, "devcrypto: unknown cipher %s\n", name);
-+    else if ((i = find_cipher_data_index(EVP_CIPHER_nid(EVP))) != (size_t)-1)
-+        cipher_list[i] = 1;
-+    else
-+        fprintf(stderr, "devcrypto: cipher %s not available\n", name);
-+    OPENSSL_free(name);
-+    return 1;
-+}
-+
- /*
-  * We only support digests if the cryptodev implementation supports multiple
-  * data updates and session copying.  Otherwise, we would be forced to maintain
-@@ -493,13 +605,22 @@ static const struct digest_data_st {
- #endif
- };
- 
--static size_t get_digest_data_index(int nid)
-+static size_t find_digest_data_index(int nid)
- {
-     size_t i;
- 
-     for (i = 0; i < OSSL_NELEM(digest_data); i++)
-         if (nid == digest_data[i].nid)
-             return i;
-+    return (size_t)-1;
-+}
-+
-+static size_t get_digest_data_index(int nid)
-+{
-+    size_t i = find_digest_data_index(nid);
-+
-+    if (i != (size_t)-1)
-+        return i;
- 
-     /*
-      * Code further down must make sure that only NIDs in the table above
-@@ -516,8 +637,8 @@ static const struct digest_data_st *get_
- }
- 
- /*
-- * Following are the four necessary functions to map OpenSSL functionality
-- * with cryptodev.
-+ * Following are the five necessary functions to map OpenSSL functionality
-+ * with cryptodev: init, update, final, cleanup, and copy.
-  */
- 
- static int digest_init(EVP_MD_CTX *ctx)
-@@ -630,52 +751,94 @@ static int digest_cleanup(EVP_MD_CTX *ct
-     return clean_devcrypto_session(&digest_ctx->sess);
- }
- 
--static int devcrypto_test_digest(size_t digest_data_index)
--{
--    struct session_op sess1, sess2;
--    struct cphash_op cphash;
--    int ret=0;
--
--    memset(&sess1, 0, sizeof(sess1));
--    memset(&sess2, 0, sizeof(sess2));
--    sess1.mac = digest_data[digest_data_index].devcryptoid;
--    if (ioctl(cfd, CIOCGSESSION, &sess1) < 0)
--        return 0;
--    /* Make sure the driver is capable of hash state copy */
--    sess2.mac = sess1.mac;
--    if (ioctl(cfd, CIOCGSESSION, &sess2) >= 0) {
--        cphash.src_ses = sess1.ses;
--        cphash.dst_ses = sess2.ses;
--        if (ioctl(cfd, CIOCCPHASH, &cphash) >= 0)
--            ret = 1;
--        ioctl(cfd, CIOCFSESSION, &sess2.ses);
--    }
--    ioctl(cfd, CIOCFSESSION, &sess1.ses);
--    return ret;
--}
--
- /*
-- * Keep a table of known nids and associated methods.
-+ * Keep tables of known nids, associated methods, selected digests, and
-+ * driver info.
-  * Note that known_digest_nids[] isn't necessarily indexed the same way as
-- * digest_data[] above, which known_digest_methods[] is.
-+ * digest_data[] above, which the other tables are.
-  */
- static int known_digest_nids[OSSL_NELEM(digest_data)];
- static int known_digest_nids_amount = -1; /* -1 indicates not yet initialised */
- static EVP_MD *known_digest_methods[OSSL_NELEM(digest_data)] = { NULL, };
-+static int selected_digests[OSSL_NELEM(digest_data)];
-+static struct driver_info_st digest_driver_info[OSSL_NELEM(digest_data)];
-+
-+static int devcrypto_test_digest(size_t digest_data_index)
-+{
-+    return (digest_driver_info[digest_data_index].status == DEVCRYPTO_STATUS_USABLE
-+            && selected_digests[digest_data_index] == 1
-+            && (digest_driver_info[digest_data_index].accelerated
-+                    == DEVCRYPTO_ACCELERATED
-+                || use_softdrivers == DEVCRYPTO_USE_SOFTWARE
-+                || (digest_driver_info[digest_data_index].accelerated
-+                        != DEVCRYPTO_NOT_ACCELERATED
-+                    && use_softdrivers == DEVCRYPTO_REJECT_SOFTWARE)));
-+}
-+
-+static void rebuild_known_digest_nids(ENGINE *e)
-+{
-+    size_t i;
-+
-+    for (i = 0, known_digest_nids_amount = 0; i < OSSL_NELEM(digest_data); i++) {
-+        if (devcrypto_test_digest(i))
-+            known_digest_nids[known_digest_nids_amount++] = digest_data[i].nid;
-+    }
-+    ENGINE_unregister_digests(e);
-+    ENGINE_register_digests(e);
-+}
- 
- static void prepare_digest_methods(void)
- {
-     size_t i;
-+    struct session_op sess1, sess2;
-+#ifdef CIOCGSESSINFO
-+    struct session_info_op siop;
-+#endif
-+    struct cphash_op cphash;
-+
-+    memset(&digest_driver_info, 0, sizeof(digest_driver_info));
-+
-+    memset(&sess1, 0, sizeof(sess1));
-+    memset(&sess2, 0, sizeof(sess2));
- 
-     for (i = 0, known_digest_nids_amount = 0; i < OSSL_NELEM(digest_data);
-          i++) {
- 
-+        selected_digests[i] = 1;
-+
-         /*
--         * Check that the algo is usable
-+         * Check that the digest is usable
-          */
--        if (!devcrypto_test_digest(i))
--            continue;
-+        sess1.mac = digest_data[i].devcryptoid;
-+        sess2.ses = 0;
-+        if (ioctl(cfd, CIOCGSESSION, &sess1) < 0) {
-+            digest_driver_info[i].status = DEVCRYPTO_STATUS_UNUSABLE;
-+            goto finish;
-+        }
- 
-+#ifdef CIOCGSESSINFO
-+        /* gather hardware acceleration info from the driver */
-+        siop.ses = sess1.ses;
-+        if (ioctl(cfd, CIOCGSESSINFO, &siop) < 0)
-+            digest_driver_info[i].accelerated = DEVCRYPTO_ACCELERATION_UNKNOWN;
-+        else if (siop.flags & SIOP_FLAG_KERNEL_DRIVER_ONLY)
-+            digest_driver_info[i].accelerated = DEVCRYPTO_ACCELERATED;
-+        else
-+            digest_driver_info[i].accelerated = DEVCRYPTO_NOT_ACCELERATED;
-+#endif
-+
-+        /* digest must be capable of hash state copy */
-+        sess2.mac = sess1.mac;
-+        if (ioctl(cfd, CIOCGSESSION, &sess2) < 0) {
-+            digest_driver_info[i].status = DEVCRYPTO_STATUS_UNUSABLE;
-+            goto finish;
-+        }
-+        cphash.src_ses = sess1.ses;
-+        cphash.dst_ses = sess2.ses;
-+        if (ioctl(cfd, CIOCCPHASH, &cphash) < 0) {
-+            digest_driver_info[i].status = DEVCRYPTO_STATUS_UNUSABLE;
-+            goto finish;
-+        }
-         if ((known_digest_methods[i] = EVP_MD_meth_new(digest_data[i].nid,
-                                                        NID_undef)) == NULL
-             || !EVP_MD_meth_set_input_blocksize(known_digest_methods[i],
-@@ -689,11 +852,18 @@ static void prepare_digest_methods(void)
-             || !EVP_MD_meth_set_cleanup(known_digest_methods[i], digest_cleanup)
-             || !EVP_MD_meth_set_app_datasize(known_digest_methods[i],
-                                              sizeof(struct digest_ctx))) {
-+            digest_driver_info[i].status = DEVCRYPTO_STATUS_UNUSABLE;
-             EVP_MD_meth_free(known_digest_methods[i]);
-             known_digest_methods[i] = NULL;
--        } else {
--            known_digest_nids[known_digest_nids_amount++] = digest_data[i].nid;
-+            goto finish;
-         }
-+        digest_driver_info[i].status = DEVCRYPTO_STATUS_USABLE;
-+finish:
-+        ioctl(cfd, CIOCFSESSION, &sess1.ses);
-+        if (sess2.ses != 0)
-+            ioctl(cfd, CIOCFSESSION, &sess2.ses);
-+        if (devcrypto_test_digest(i))
-+            known_digest_nids[known_digest_nids_amount++] = digest_data[i].nid;
-     }
- }
- 
-@@ -739,7 +909,153 @@ static int devcrypto_digests(ENGINE *e,
-     return *digest != NULL;
- }
- 
-+static void devcrypto_select_all_digests(int *digest_list)
-+{
-+    size_t i;
-+
-+    for (i = 0; i < OSSL_NELEM(digest_data); i++)
-+        digest_list[i] = 1;
-+}
-+
-+static int cryptodev_select_digest_cb(const char *str, int len, void *usr)
-+{
-+    int *digest_list = (int *)usr;
-+    char *name;
-+    const EVP_MD *EVP;
-+    size_t i;
-+
-+    if (len == 0)
-+        return 1;
-+    if (usr == NULL || (name = OPENSSL_strndup(str, len)) == NULL)
-+        return 0;
-+    EVP = EVP_get_digestbyname(name);
-+    if (EVP == NULL)
-+        fprintf(stderr, "devcrypto: unknown digest %s\n", name);
-+    else if ((i = find_digest_data_index(EVP_MD_type(EVP))) != (size_t)-1)
-+        digest_list[i] = 1;
-+    else
-+        fprintf(stderr, "devcrypto: digest %s not available\n", name);
-+    OPENSSL_free(name);
-+    return 1;
-+}
-+
-+#endif
-+
-+/******************************************************************************
-+ *
-+ * CONTROL COMMANDS
-+ *
-+ *****/
-+
-+#define DEVCRYPTO_CMD_USE_SOFTDRIVERS ENGINE_CMD_BASE
-+#define DEVCRYPTO_CMD_CIPHERS (ENGINE_CMD_BASE + 1)
-+#define DEVCRYPTO_CMD_DIGESTS (ENGINE_CMD_BASE + 2)
-+#define DEVCRYPTO_CMD_DUMP_INFO (ENGINE_CMD_BASE + 3)
-+
-+/* Helper macros for CPP string composition */
-+#ifndef OPENSSL_MSTR
-+# define OPENSSL_MSTR_HELPER(x) #x
-+# define OPENSSL_MSTR(x) OPENSSL_MSTR_HELPER(x)
-+#endif
-+
-+static const ENGINE_CMD_DEFN devcrypto_cmds[] = {
-+#ifdef CIOCGSESSINFO
-+   {DEVCRYPTO_CMD_USE_SOFTDRIVERS,
-+    "USE_SOFTDRIVERS",
-+    "specifies whether to use software (not accelerated) drivers ("
-+        OPENSSL_MSTR(DEVCRYPTO_REQUIRE_ACCELERATED) "=use only accelerated drivers, "
-+        OPENSSL_MSTR(DEVCRYPTO_USE_SOFTWARE) "=allow all drivers, "
-+        OPENSSL_MSTR(DEVCRYPTO_REJECT_SOFTWARE)
-+        "=use if acceleration can't be determined) [default="
-+        OPENSSL_MSTR(DEVCRYPTO_DEFAULT_USE_SOFDTRIVERS) "]",
-+    ENGINE_CMD_FLAG_NUMERIC},
-+#endif
-+
-+   {DEVCRYPTO_CMD_CIPHERS,
-+    "CIPHERS",
-+    "either ALL, NONE, or a comma-separated list of ciphers to enable [default=ALL]",
-+    ENGINE_CMD_FLAG_STRING},
-+
-+#ifdef IMPLEMENT_DIGEST
-+   {DEVCRYPTO_CMD_DIGESTS,
-+    "DIGESTS",
-+    "either ALL, NONE, or a comma-separated list of digests to enable [default=ALL]",
-+    ENGINE_CMD_FLAG_STRING},
-+#endif
-+
-+   {0, NULL, NULL, 0}
-+};
-+
-+static int devcrypto_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f) (void))
-+{
-+    int *new_list;
-+    switch (cmd) {
-+#ifdef CIOCGSESSINFO
-+    case DEVCRYPTO_CMD_USE_SOFTDRIVERS:
-+        switch (i) {
-+        case DEVCRYPTO_REQUIRE_ACCELERATED:
-+        case DEVCRYPTO_USE_SOFTWARE:
-+        case DEVCRYPTO_REJECT_SOFTWARE:
-+            break;
-+        default:
-+            fprintf(stderr, "devcrypto: invalid value (%ld) for USE_SOFTDRIVERS\n", i);
-+            return 0;
-+        }
-+        if (use_softdrivers == i)
-+            return 1;
-+        use_softdrivers = i;
-+#ifdef IMPLEMENT_DIGEST
-+        rebuild_known_digest_nids(e);
- #endif
-+        rebuild_known_cipher_nids(e);
-+        return 1;
-+#endif /* CIOCGSESSINFO */
-+
-+    case DEVCRYPTO_CMD_CIPHERS:
-+        if (p == NULL)
-+            return 1;
-+        if (strcasecmp((const char *)p, "ALL") == 0) {
-+            devcrypto_select_all_ciphers(selected_ciphers);
-+        } else if (strcasecmp((const char*)p, "NONE") == 0) {
-+            memset(selected_ciphers, 0, sizeof(selected_ciphers));
-+        } else {
-+            new_list=OPENSSL_zalloc(sizeof(selected_ciphers));
-+            if (!CONF_parse_list(p, ',', 1, cryptodev_select_cipher_cb, new_list)) {
-+                OPENSSL_free(new_list);
-+                return 0;
-+            }
-+            memcpy(selected_ciphers, new_list, sizeof(selected_ciphers));
-+            OPENSSL_free(new_list);
-+        }
-+        rebuild_known_cipher_nids(e);
-+        return 1;
-+
-+#ifdef IMPLEMENT_DIGEST
-+    case DEVCRYPTO_CMD_DIGESTS:
-+        if (p == NULL)
-+            return 1;
-+        if (strcasecmp((const char *)p, "ALL") == 0) {
-+            devcrypto_select_all_digests(selected_digests);
-+        } else if (strcasecmp((const char*)p, "NONE") == 0) {
-+            memset(selected_digests, 0, sizeof(selected_digests));
-+        } else {
-+            new_list=OPENSSL_zalloc(sizeof(selected_digests));
-+            if (!CONF_parse_list(p, ',', 1, cryptodev_select_digest_cb, new_list)) {
-+                OPENSSL_free(new_list);
-+                return 0;
-+            }
-+            memcpy(selected_digests, new_list, sizeof(selected_digests));
-+            OPENSSL_free(new_list);
-+        }
-+        rebuild_known_digest_nids(e);
-+        return 1;
-+#endif /* IMPLEMENT_DIGEST */
-+
-+    default:
-+        break;
-+    }
-+    return 0;
-+}
- 
- /******************************************************************************
-  *
-@@ -806,6 +1122,8 @@ void engine_load_devcrypto_int()
- 
-     if (!ENGINE_set_id(e, "devcrypto")
-         || !ENGINE_set_name(e, "/dev/crypto engine")
-+        || !ENGINE_set_cmd_defns(e, devcrypto_cmds)
-+        || !ENGINE_set_ctrl_function(e, devcrypto_ctrl)
- 
- /*
-  * Asymmetric ciphers aren't well supported with /dev/crypto.  Among the BSD
diff --git a/package/libs/openssl/patches/420-eng_devcrypto-add-command-to-dump-driver-info.patch b/package/libs/openssl/patches/420-eng_devcrypto-add-command-to-dump-driver-info.patch
deleted file mode 100644
index eee71c6c62..0000000000
--- a/package/libs/openssl/patches/420-eng_devcrypto-add-command-to-dump-driver-info.patch
+++ /dev/null
@@ -1,273 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Eneas U de Queiroz <cote2004-github at yahoo.com>
-Date: Tue, 6 Nov 2018 22:54:07 -0200
-Subject: eng_devcrypto: add command to dump driver info
-
-This is useful to determine the kernel driver running each algorithm.
-
-Signed-off-by: Eneas U de Queiroz <cote2004-github at yahoo.com>
-
-Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre at ncp-e.com>
-Reviewed-by: Richard Levitte <levitte at openssl.org>
-(Merged from https://github.com/openssl/openssl/pull/7585)
-
---- a/crypto/engine/eng_devcrypto.c
-+++ b/crypto/engine/eng_devcrypto.c
-@@ -50,16 +50,20 @@ static int use_softdrivers = DEVCRYPTO_D
-  */
- struct driver_info_st {
-     enum devcrypto_status_t {
--        DEVCRYPTO_STATUS_UNUSABLE       = -1, /* session open failed */
--        DEVCRYPTO_STATUS_UNKNOWN        =  0, /* not tested yet */
--        DEVCRYPTO_STATUS_USABLE         =  1  /* algo can be used */
-+        DEVCRYPTO_STATUS_FAILURE         = -3, /* unusable for other reason */
-+        DEVCRYPTO_STATUS_NO_CIOCCPHASH   = -2, /* hash state copy not supported */
-+        DEVCRYPTO_STATUS_NO_CIOCGSESSION = -1, /* session open failed */
-+        DEVCRYPTO_STATUS_UNKNOWN         =  0, /* not tested yet */
-+        DEVCRYPTO_STATUS_USABLE          =  1  /* algo can be used */
-     } status;
- 
-     enum devcrypto_accelerated_t {
--        DEVCRYPTO_NOT_ACCELERATED       = -1, /* software implemented */
--        DEVCRYPTO_ACCELERATION_UNKNOWN  =  0, /* acceleration support unkown */
--        DEVCRYPTO_ACCELERATED           =  1  /* hardware accelerated */
-+        DEVCRYPTO_NOT_ACCELERATED        = -1, /* software implemented */
-+        DEVCRYPTO_ACCELERATION_UNKNOWN   =  0, /* acceleration support unkown */
-+        DEVCRYPTO_ACCELERATED            =  1  /* hardware accelerated */
-     } accelerated;
-+
-+    char *driver_name;
- };
- 
- static int clean_devcrypto_session(struct session_op *sess) {
-@@ -415,7 +419,7 @@ static void prepare_cipher_methods(void)
-         sess.cipher = cipher_data[i].devcryptoid;
-         sess.keylen = cipher_data[i].keylen;
-         if (ioctl(cfd, CIOCGSESSION, &sess) < 0) {
--            cipher_driver_info[i].status = DEVCRYPTO_STATUS_UNUSABLE;
-+            cipher_driver_info[i].status = DEVCRYPTO_STATUS_NO_CIOCGSESSION;
-             continue;
-         }
- 
-@@ -443,19 +447,24 @@ static void prepare_cipher_methods(void)
-                                             cipher_cleanup)
-             || !EVP_CIPHER_meth_set_impl_ctx_size(known_cipher_methods[i],
-                                                   sizeof(struct cipher_ctx))) {
--            cipher_driver_info[i].status = DEVCRYPTO_STATUS_UNUSABLE;
-+            cipher_driver_info[i].status = DEVCRYPTO_STATUS_FAILURE;
-             EVP_CIPHER_meth_free(known_cipher_methods[i]);
-             known_cipher_methods[i] = NULL;
-         } else {
-             cipher_driver_info[i].status = DEVCRYPTO_STATUS_USABLE;
- #ifdef CIOCGSESSINFO
-             siop.ses = sess.ses;
--            if (ioctl(cfd, CIOCGSESSINFO, &siop) < 0)
-+            if (ioctl(cfd, CIOCGSESSINFO, &siop) < 0) {
-                 cipher_driver_info[i].accelerated = DEVCRYPTO_ACCELERATION_UNKNOWN;
--            else if (!(siop.flags & SIOP_FLAG_KERNEL_DRIVER_ONLY))
--                cipher_driver_info[i].accelerated = DEVCRYPTO_NOT_ACCELERATED;
--            else
--                cipher_driver_info[i].accelerated = DEVCRYPTO_ACCELERATED;
-+            } else {
-+                cipher_driver_info[i].driver_name =
-+                    OPENSSL_strndup(siop.cipher_info.cra_driver_name,
-+                                    CRYPTODEV_MAX_ALG_NAME);
-+                if (!(siop.flags & SIOP_FLAG_KERNEL_DRIVER_ONLY))
-+                    cipher_driver_info[i].accelerated = DEVCRYPTO_NOT_ACCELERATED;
-+                else
-+                    cipher_driver_info[i].accelerated = DEVCRYPTO_ACCELERATED;
-+            }
- #endif /* CIOCGSESSINFO */
-         }
-         ioctl(cfd, CIOCFSESSION, &sess.ses);
-@@ -505,8 +514,11 @@ static void destroy_all_cipher_methods(v
- {
-     size_t i;
- 
--    for (i = 0; i < OSSL_NELEM(cipher_data); i++)
-+    for (i = 0; i < OSSL_NELEM(cipher_data); i++) {
-         destroy_cipher_method(cipher_data[i].nid);
-+        OPENSSL_free(cipher_driver_info[i].driver_name);
-+        cipher_driver_info[i].driver_name = NULL;
-+    }
- }
- 
- static int devcrypto_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
-@@ -550,6 +562,40 @@ static int cryptodev_select_cipher_cb(co
-     return 1;
- }
- 
-+static void dump_cipher_info(void)
-+{
-+    size_t i;
-+    const char *name;
-+
-+    fprintf (stderr, "Information about ciphers supported by the /dev/crypto"
-+             " engine:\n");
-+#ifndef CIOCGSESSINFO
-+    fprintf(stderr, "CIOCGSESSINFO (session info call) unavailable\n");
-+#endif
-+    for (i = 0; i < OSSL_NELEM(cipher_data); i++) {
-+        name = OBJ_nid2sn(cipher_data[i].nid);
-+        fprintf (stderr, "Cipher %s, NID=%d, /dev/crypto info: id=%d, ",
-+                 name ? name : "unknown", cipher_data[i].nid,
-+                 cipher_data[i].devcryptoid);
-+        if (cipher_driver_info[i].status == DEVCRYPTO_STATUS_NO_CIOCGSESSION ) {
-+            fprintf (stderr, "CIOCGSESSION (session open call) failed\n");
-+            continue;
-+        }
-+        fprintf (stderr, "driver=%s ", cipher_driver_info[i].driver_name ?
-+                 cipher_driver_info[i].driver_name : "unknown");
-+        if (cipher_driver_info[i].accelerated == DEVCRYPTO_ACCELERATED)
-+            fprintf(stderr, "(hw accelerated)");
-+        else if (cipher_driver_info[i].accelerated == DEVCRYPTO_NOT_ACCELERATED)
-+            fprintf(stderr, "(software)");
-+        else
-+            fprintf(stderr, "(acceleration status unknown)");
-+        if (cipher_driver_info[i].status == DEVCRYPTO_STATUS_FAILURE)
-+            fprintf (stderr, ". Cipher setup failed");
-+        fprintf(stderr, "\n");
-+    }
-+    fprintf(stderr, "\n");
-+}
-+
- /*
-  * We only support digests if the cryptodev implementation supports multiple
-  * data updates and session copying.  Otherwise, we would be forced to maintain
-@@ -812,31 +858,36 @@ static void prepare_digest_methods(void)
-         sess1.mac = digest_data[i].devcryptoid;
-         sess2.ses = 0;
-         if (ioctl(cfd, CIOCGSESSION, &sess1) < 0) {
--            digest_driver_info[i].status = DEVCRYPTO_STATUS_UNUSABLE;
-+            digest_driver_info[i].status = DEVCRYPTO_STATUS_NO_CIOCGSESSION;
-             goto finish;
-         }
- 
- #ifdef CIOCGSESSINFO
-         /* gather hardware acceleration info from the driver */
-         siop.ses = sess1.ses;
--        if (ioctl(cfd, CIOCGSESSINFO, &siop) < 0)
-+        if (ioctl(cfd, CIOCGSESSINFO, &siop) < 0) {
-             digest_driver_info[i].accelerated = DEVCRYPTO_ACCELERATION_UNKNOWN;
--        else if (siop.flags & SIOP_FLAG_KERNEL_DRIVER_ONLY)
--            digest_driver_info[i].accelerated = DEVCRYPTO_ACCELERATED;
--        else
--            digest_driver_info[i].accelerated = DEVCRYPTO_NOT_ACCELERATED;
-+        } else {
-+            digest_driver_info[i].driver_name =
-+                OPENSSL_strndup(siop.hash_info.cra_driver_name,
-+                                CRYPTODEV_MAX_ALG_NAME);
-+            if (siop.flags & SIOP_FLAG_KERNEL_DRIVER_ONLY)
-+                digest_driver_info[i].accelerated = DEVCRYPTO_ACCELERATED;
-+            else
-+                digest_driver_info[i].accelerated = DEVCRYPTO_NOT_ACCELERATED;
-+        }
- #endif
- 
-         /* digest must be capable of hash state copy */
-         sess2.mac = sess1.mac;
-         if (ioctl(cfd, CIOCGSESSION, &sess2) < 0) {
--            digest_driver_info[i].status = DEVCRYPTO_STATUS_UNUSABLE;
-+            digest_driver_info[i].status = DEVCRYPTO_STATUS_FAILURE;
-             goto finish;
-         }
-         cphash.src_ses = sess1.ses;
-         cphash.dst_ses = sess2.ses;
-         if (ioctl(cfd, CIOCCPHASH, &cphash) < 0) {
--            digest_driver_info[i].status = DEVCRYPTO_STATUS_UNUSABLE;
-+            digest_driver_info[i].status = DEVCRYPTO_STATUS_NO_CIOCCPHASH;
-             goto finish;
-         }
-         if ((known_digest_methods[i] = EVP_MD_meth_new(digest_data[i].nid,
-@@ -852,7 +903,7 @@ static void prepare_digest_methods(void)
-             || !EVP_MD_meth_set_cleanup(known_digest_methods[i], digest_cleanup)
-             || !EVP_MD_meth_set_app_datasize(known_digest_methods[i],
-                                              sizeof(struct digest_ctx))) {
--            digest_driver_info[i].status = DEVCRYPTO_STATUS_UNUSABLE;
-+            digest_driver_info[i].status = DEVCRYPTO_STATUS_FAILURE;
-             EVP_MD_meth_free(known_digest_methods[i]);
-             known_digest_methods[i] = NULL;
-             goto finish;
-@@ -894,8 +945,11 @@ static void destroy_all_digest_methods(v
- {
-     size_t i;
- 
--    for (i = 0; i < OSSL_NELEM(digest_data); i++)
-+    for (i = 0; i < OSSL_NELEM(digest_data); i++) {
-         destroy_digest_method(digest_data[i].nid);
-+        OPENSSL_free(digest_driver_info[i].driver_name);
-+        digest_driver_info[i].driver_name = NULL;
-+    }
- }
- 
- static int devcrypto_digests(ENGINE *e, const EVP_MD **digest,
-@@ -939,6 +993,43 @@ static int cryptodev_select_digest_cb(co
-     return 1;
- }
- 
-+static void dump_digest_info(void)
-+{
-+    size_t i;
-+    const char *name;
-+
-+    fprintf (stderr, "Information about digests supported by the /dev/crypto"
-+             " engine:\n");
-+#ifndef CIOCGSESSINFO
-+    fprintf(stderr, "CIOCGSESSINFO (session info call) unavailable\n");
-+#endif
-+
-+    for (i = 0; i < OSSL_NELEM(digest_data); i++) {
-+        name = OBJ_nid2sn(digest_data[i].nid);
-+        fprintf (stderr, "Digest %s, NID=%d, /dev/crypto info: id=%d, driver=%s",
-+                 name ? name : "unknown", digest_data[i].nid,
-+                 digest_data[i].devcryptoid,
-+                 digest_driver_info[i].driver_name ? digest_driver_info[i].driver_name : "unknown");
-+        if (digest_driver_info[i].status == DEVCRYPTO_STATUS_NO_CIOCGSESSION) {
-+            fprintf (stderr, ". CIOCGSESSION (session open) failed\n");
-+            continue;
-+        }
-+        if (digest_driver_info[i].accelerated == DEVCRYPTO_ACCELERATED)
-+            fprintf(stderr, " (hw accelerated)");
-+        else if (digest_driver_info[i].accelerated == DEVCRYPTO_NOT_ACCELERATED)
-+            fprintf(stderr, " (software)");
-+        else
-+            fprintf(stderr, " (acceleration status unknown)");
-+        if (cipher_driver_info[i].status == DEVCRYPTO_STATUS_FAILURE)
-+            fprintf (stderr, ". Cipher setup failed\n");
-+        else if (digest_driver_info[i].status == DEVCRYPTO_STATUS_NO_CIOCCPHASH)
-+            fprintf(stderr, ", CIOCCPHASH failed\n");
-+        else
-+            fprintf(stderr, ", CIOCCPHASH capable\n");
-+    }
-+    fprintf(stderr, "\n");
-+}
-+
- #endif
- 
- /******************************************************************************
-@@ -983,6 +1074,11 @@ static const ENGINE_CMD_DEFN devcrypto_c
-     ENGINE_CMD_FLAG_STRING},
- #endif
- 
-+   {DEVCRYPTO_CMD_DUMP_INFO,
-+    "DUMP_INFO",
-+    "dump info about each algorithm to stderr; use 'openssl engine -pre DUMP_INFO devcrypto'",
-+    ENGINE_CMD_FLAG_NO_INPUT},
-+
-    {0, NULL, NULL, 0}
- };
- 
-@@ -1051,6 +1147,13 @@ static int devcrypto_ctrl(ENGINE *e, int
-         return 1;
- #endif /* IMPLEMENT_DIGEST */
- 
-+    case DEVCRYPTO_CMD_DUMP_INFO:
-+        dump_cipher_info();
-+#ifdef IMPLEMENT_DIGEST
-+        dump_digest_info();
-+#endif
-+        return 1;
-+
-     default:
-         break;
-     }
diff --git a/package/libs/openssl/patches/430-e_devcrypto-make-the-dev-crypto-engine-dynamic.patch b/package/libs/openssl/patches/430-e_devcrypto-make-the-dev-crypto-engine-dynamic.patch
deleted file mode 100644
index 00c74972ab..0000000000
--- a/package/libs/openssl/patches/430-e_devcrypto-make-the-dev-crypto-engine-dynamic.patch
+++ /dev/null
@@ -1,2718 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Eneas U de Queiroz <cote2004-github at yahoo.com>
-Date: Tue, 6 Nov 2018 10:57:03 -0200
-Subject: e_devcrypto: make the /dev/crypto engine dynamic
-
-Engine has been moved from crypto/engine/eng_devcrypto.c to
-engines/e_devcrypto.c.
-
-Signed-off-by: Eneas U de Queiroz <cote2004-github at yahoo.com>
-
---- a/crypto/engine/build.info
-+++ b/crypto/engine/build.info
-@@ -6,6 +6,3 @@ SOURCE[../../libcrypto]=\
-         tb_cipher.c tb_digest.c tb_pkmeth.c tb_asnmth.c tb_eckey.c \
-         eng_openssl.c eng_cnf.c eng_dyn.c \
-         eng_rdrand.c
--IF[{- !$disabled{devcryptoeng} -}]
--  SOURCE[../../libcrypto]=eng_devcrypto.c
--ENDIF
---- a/crypto/init.c
-+++ b/crypto/init.c
-@@ -328,18 +328,6 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_engine_
-     engine_load_openssl_int();
-     return 1;
- }
--# ifndef OPENSSL_NO_DEVCRYPTOENG
--static CRYPTO_ONCE engine_devcrypto = CRYPTO_ONCE_STATIC_INIT;
--DEFINE_RUN_ONCE_STATIC(ossl_init_engine_devcrypto)
--{
--#  ifdef OPENSSL_INIT_DEBUG
--    fprintf(stderr, "OPENSSL_INIT: ossl_init_engine_devcrypto: "
--                    "engine_load_devcrypto_int()\n");
--#  endif
--    engine_load_devcrypto_int();
--    return 1;
--}
--# endif
- 
- # ifndef OPENSSL_NO_RDRAND
- static CRYPTO_ONCE engine_rdrand = CRYPTO_ONCE_STATIC_INIT;
-@@ -364,6 +352,18 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_engine_
-     return 1;
- }
- # ifndef OPENSSL_NO_STATIC_ENGINE
-+#  ifndef OPENSSL_NO_DEVCRYPTOENG
-+static CRYPTO_ONCE engine_devcrypto = CRYPTO_ONCE_STATIC_INIT;
-+DEFINE_RUN_ONCE_STATIC(ossl_init_engine_devcrypto)
-+{
-+#   ifdef OPENSSL_INIT_DEBUG
-+    fprintf(stderr, "OPENSSL_INIT: ossl_init_engine_devcrypto: "
-+                    "engine_load_devcrypto_int()\n");
-+#   endif
-+    engine_load_devcrypto_int();
-+    return 1;
-+}
-+#  endif
- #  if !defined(OPENSSL_NO_HW) && !defined(OPENSSL_NO_HW_PADLOCK)
- static CRYPTO_ONCE engine_padlock = CRYPTO_ONCE_STATIC_INIT;
- DEFINE_RUN_ONCE_STATIC(ossl_init_engine_padlock)
-@@ -704,11 +704,6 @@ int OPENSSL_init_crypto(uint64_t opts, c
-     if ((opts & OPENSSL_INIT_ENGINE_OPENSSL)
-             && !RUN_ONCE(&engine_openssl, ossl_init_engine_openssl))
-         return 0;
--# if !defined(OPENSSL_NO_HW) && !defined(OPENSSL_NO_DEVCRYPTOENG)
--    if ((opts & OPENSSL_INIT_ENGINE_CRYPTODEV)
--            && !RUN_ONCE(&engine_devcrypto, ossl_init_engine_devcrypto))
--        return 0;
--# endif
- # ifndef OPENSSL_NO_RDRAND
-     if ((opts & OPENSSL_INIT_ENGINE_RDRAND)
-             && !RUN_ONCE(&engine_rdrand, ossl_init_engine_rdrand))
-@@ -718,6 +713,11 @@ int OPENSSL_init_crypto(uint64_t opts, c
-             && !RUN_ONCE(&engine_dynamic, ossl_init_engine_dynamic))
-         return 0;
- # ifndef OPENSSL_NO_STATIC_ENGINE
-+#  ifndef OPENSSL_NO_DEVCRYPTOENG
-+    if ((opts & OPENSSL_INIT_ENGINE_CRYPTODEV)
-+            && !RUN_ONCE(&engine_devcrypto, ossl_init_engine_devcrypto))
-+        return 0;
-+#  endif
- #  if !defined(OPENSSL_NO_HW) && !defined(OPENSSL_NO_HW_PADLOCK)
-     if ((opts & OPENSSL_INIT_ENGINE_PADLOCK)
-             && !RUN_ONCE(&engine_padlock, ossl_init_engine_padlock))
---- a/engines/build.info
-+++ b/engines/build.info
-@@ -11,6 +11,9 @@ IF[{- !$disabled{"engine"} -}]
-     IF[{- !$disabled{afalgeng} -}]
-       SOURCE[../libcrypto]=e_afalg.c
-     ENDIF
-+    IF[{- !$disabled{"devcryptoeng"} -}]
-+      SOURCE[../libcrypto]=e_devcrypto.c
-+    ENDIF
-   ELSE
-     IF[{- !$disabled{hw} && !$disabled{'hw-padlock'} -}]
-       ENGINES=padlock
-@@ -30,6 +33,12 @@ IF[{- !$disabled{"engine"} -}]
-       DEPEND[afalg]=../libcrypto
-       INCLUDE[afalg]= ../include
-     ENDIF
-+    IF[{- !$disabled{"devcryptoeng"} -}]
-+      ENGINES=devcrypto
-+      SOURCE[devcrypto]=e_devcrypto.c
-+      DEPEND[devcrypto]=../libcrypto
-+      INCLUDE[devcrypto]=../include
-+    ENDIF
- 
-     ENGINES_NO_INST=ossltest dasync
-     SOURCE[dasync]=e_dasync.c
---- a/crypto/engine/eng_devcrypto.c
-+++ /dev/null
-@@ -1,1277 +0,0 @@
--/*
-- * Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
-- *
-- * Licensed under the OpenSSL license (the "License").  You may not use
-- * this file except in compliance with the License.  You can obtain a copy
-- * in the file LICENSE in the source distribution or at
-- * https://www.openssl.org/source/license.html
-- */
--
--#include "e_os.h"
--#include <string.h>
--#include <sys/types.h>
--#include <sys/stat.h>
--#include <fcntl.h>
--#include <sys/ioctl.h>
--#include <unistd.h>
--#include <assert.h>
--
--#include <openssl/conf.h>
--#include <openssl/evp.h>
--#include <openssl/err.h>
--#include <openssl/engine.h>
--#include <openssl/objects.h>
--#include <crypto/cryptodev.h>
--
--#include "crypto/engine.h"
--
--/* #define ENGINE_DEVCRYPTO_DEBUG */
--
--#if CRYPTO_ALGORITHM_MIN < CRYPTO_ALGORITHM_MAX
--# define CHECK_BSD_STYLE_MACROS
--#endif
--
--/*
-- * ONE global file descriptor for all sessions.  This allows operations
-- * such as digest session data copying (see digest_copy()), but is also
-- * saner...  why re-open /dev/crypto for every session?
-- */
--static int cfd;
--#define DEVCRYPTO_REQUIRE_ACCELERATED 0 /* require confirmation of acceleration */
--#define DEVCRYPTO_USE_SOFTWARE        1 /* allow software drivers */
--#define DEVCRYPTO_REJECT_SOFTWARE     2 /* only disallow confirmed software drivers */
--
--#define DEVCRYPTO_DEFAULT_USE_SOFDTRIVERS DEVCRYPTO_REJECT_SOFTWARE
--static int use_softdrivers = DEVCRYPTO_DEFAULT_USE_SOFDTRIVERS;
--
--/*
-- * cipher/digest status & acceleration definitions
-- * Make sure the defaults are set to 0
-- */
--struct driver_info_st {
--    enum devcrypto_status_t {
--        DEVCRYPTO_STATUS_FAILURE         = -3, /* unusable for other reason */
--        DEVCRYPTO_STATUS_NO_CIOCCPHASH   = -2, /* hash state copy not supported */
--        DEVCRYPTO_STATUS_NO_CIOCGSESSION = -1, /* session open failed */
--        DEVCRYPTO_STATUS_UNKNOWN         =  0, /* not tested yet */
--        DEVCRYPTO_STATUS_USABLE          =  1  /* algo can be used */
--    } status;
--
--    enum devcrypto_accelerated_t {
--        DEVCRYPTO_NOT_ACCELERATED        = -1, /* software implemented */
--        DEVCRYPTO_ACCELERATION_UNKNOWN   =  0, /* acceleration support unkown */
--        DEVCRYPTO_ACCELERATED            =  1  /* hardware accelerated */
--    } accelerated;
--
--    char *driver_name;
--};
--
--static int clean_devcrypto_session(struct session_op *sess) {
--    if (ioctl(cfd, CIOCFSESSION, &sess->ses) < 0) {
--        SYSerr(SYS_F_IOCTL, errno);
--        return 0;
--    }
--    memset(sess, 0, sizeof(struct session_op));
--    return 1;
--}
--
--/******************************************************************************
-- *
-- * Ciphers
-- *
-- * Because they all do the same basic operation, we have only one set of
-- * method functions for them all to share, and a mapping table between
-- * NIDs and cryptodev IDs, with all the necessary size data.
-- *
-- *****/
--
--struct cipher_ctx {
--    struct session_op sess;
--    int op;                      /* COP_ENCRYPT or COP_DECRYPT */
--    unsigned long mode;          /* EVP_CIPH_*_MODE */
--
--    /* to handle ctr mode being a stream cipher */
--    unsigned char partial[EVP_MAX_BLOCK_LENGTH];
--    unsigned int blocksize, num;
--};
--
--static const struct cipher_data_st {
--    int nid;
--    int blocksize;
--    int keylen;
--    int ivlen;
--    int flags;
--    int devcryptoid;
--} cipher_data[] = {
--#ifndef OPENSSL_NO_DES
--    { NID_des_cbc, 8, 8, 8, EVP_CIPH_CBC_MODE, CRYPTO_DES_CBC },
--    { NID_des_ede3_cbc, 8, 24, 8, EVP_CIPH_CBC_MODE, CRYPTO_3DES_CBC },
--#endif
--#ifndef OPENSSL_NO_BF
--    { NID_bf_cbc, 8, 16, 8, EVP_CIPH_CBC_MODE, CRYPTO_BLF_CBC },
--#endif
--#ifndef OPENSSL_NO_CAST
--    { NID_cast5_cbc, 8, 16, 8, EVP_CIPH_CBC_MODE, CRYPTO_CAST_CBC },
--#endif
--    { NID_aes_128_cbc, 16, 128 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC },
--    { NID_aes_192_cbc, 16, 192 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC },
--    { NID_aes_256_cbc, 16, 256 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC },
--#ifndef OPENSSL_NO_RC4
--    { NID_rc4, 1, 16, 0, EVP_CIPH_STREAM_CIPHER, CRYPTO_ARC4 },
--#endif
--#if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_AES_CTR)
--    { NID_aes_128_ctr, 16, 128 / 8, 16, EVP_CIPH_CTR_MODE, CRYPTO_AES_CTR },
--    { NID_aes_192_ctr, 16, 192 / 8, 16, EVP_CIPH_CTR_MODE, CRYPTO_AES_CTR },
--    { NID_aes_256_ctr, 16, 256 / 8, 16, EVP_CIPH_CTR_MODE, CRYPTO_AES_CTR },
--#endif
--#if 0                            /* Not yet supported */
--    { NID_aes_128_xts, 16, 128 / 8 * 2, 16, EVP_CIPH_XTS_MODE, CRYPTO_AES_XTS },
--    { NID_aes_256_xts, 16, 256 / 8 * 2, 16, EVP_CIPH_XTS_MODE, CRYPTO_AES_XTS },
--#endif
--#if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_AES_ECB)
--    { NID_aes_128_ecb, 16, 128 / 8, 0, EVP_CIPH_ECB_MODE, CRYPTO_AES_ECB },
--    { NID_aes_192_ecb, 16, 192 / 8, 0, EVP_CIPH_ECB_MODE, CRYPTO_AES_ECB },
--    { NID_aes_256_ecb, 16, 256 / 8, 0, EVP_CIPH_ECB_MODE, CRYPTO_AES_ECB },
--#endif
--#if 0                            /* Not yet supported */
--    { NID_aes_128_gcm, 16, 128 / 8, 16, EVP_CIPH_GCM_MODE, CRYPTO_AES_GCM },
--    { NID_aes_192_gcm, 16, 192 / 8, 16, EVP_CIPH_GCM_MODE, CRYPTO_AES_GCM },
--    { NID_aes_256_gcm, 16, 256 / 8, 16, EVP_CIPH_GCM_MODE, CRYPTO_AES_GCM },
--#endif
--#ifndef OPENSSL_NO_CAMELLIA
--    { NID_camellia_128_cbc, 16, 128 / 8, 16, EVP_CIPH_CBC_MODE,
--      CRYPTO_CAMELLIA_CBC },
--    { NID_camellia_192_cbc, 16, 192 / 8, 16, EVP_CIPH_CBC_MODE,
--      CRYPTO_CAMELLIA_CBC },
--    { NID_camellia_256_cbc, 16, 256 / 8, 16, EVP_CIPH_CBC_MODE,
--      CRYPTO_CAMELLIA_CBC },
--#endif
--};
--
--static size_t find_cipher_data_index(int nid)
--{
--    size_t i;
--
--    for (i = 0; i < OSSL_NELEM(cipher_data); i++)
--        if (nid == cipher_data[i].nid)
--            return i;
--    return (size_t)-1;
--}
--
--static size_t get_cipher_data_index(int nid)
--{
--    size_t i = find_cipher_data_index(nid);
--
--    if (i != (size_t)-1)
--        return i;
--
--    /*
--     * Code further down must make sure that only NIDs in the table above
--     * are used.  If any other NID reaches this function, there's a grave
--     * coding error further down.
--     */
--    assert("Code that never should be reached" == NULL);
--    return -1;
--}
--
--static const struct cipher_data_st *get_cipher_data(int nid)
--{
--    return &cipher_data[get_cipher_data_index(nid)];
--}
--
--/*
-- * Following are the three necessary functions to map OpenSSL functionality
-- * with cryptodev.
-- */
--
--static int cipher_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
--                       const unsigned char *iv, int enc)
--{
--    struct cipher_ctx *cipher_ctx =
--        (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
--    const struct cipher_data_st *cipher_d =
--        get_cipher_data(EVP_CIPHER_CTX_nid(ctx));
--
--    /* cleanup a previous session */
--    if (cipher_ctx->sess.ses != 0 &&
--        clean_devcrypto_session(&cipher_ctx->sess) == 0)
--        return 0;
--
--    cipher_ctx->sess.cipher = cipher_d->devcryptoid;
--    cipher_ctx->sess.keylen = cipher_d->keylen;
--    cipher_ctx->sess.key = (void *)key;
--    cipher_ctx->op = enc ? COP_ENCRYPT : COP_DECRYPT;
--    cipher_ctx->mode = cipher_d->flags & EVP_CIPH_MODE;
--    cipher_ctx->blocksize = cipher_d->blocksize;
--    if (ioctl(cfd, CIOCGSESSION, &cipher_ctx->sess) < 0) {
--        SYSerr(SYS_F_IOCTL, errno);
--        return 0;
--    }
--
--    return 1;
--}
--
--static int cipher_do_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
--                            const unsigned char *in, size_t inl)
--{
--    struct cipher_ctx *cipher_ctx =
--        (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
--    struct crypt_op cryp;
--    unsigned char *iv = EVP_CIPHER_CTX_iv_noconst(ctx);
--#if !defined(COP_FLAG_WRITE_IV)
--    unsigned char saved_iv[EVP_MAX_IV_LENGTH];
--    const unsigned char *ivptr;
--    size_t nblocks, ivlen;
--#endif
--
--    memset(&cryp, 0, sizeof(cryp));
--    cryp.ses = cipher_ctx->sess.ses;
--    cryp.len = inl;
--    cryp.src = (void *)in;
--    cryp.dst = (void *)out;
--    cryp.iv = (void *)iv;
--    cryp.op = cipher_ctx->op;
--#if !defined(COP_FLAG_WRITE_IV)
--    cryp.flags = 0;
--
--    ivlen = EVP_CIPHER_CTX_iv_length(ctx);
--    if (ivlen > 0)
--        switch (cipher_ctx->mode) {
--        case EVP_CIPH_CBC_MODE:
--            assert(inl >= ivlen);
--            if (!EVP_CIPHER_CTX_encrypting(ctx)) {
--                ivptr = in + inl - ivlen;
--                memcpy(saved_iv, ivptr, ivlen);
--            }
--            break;
--
--        case EVP_CIPH_CTR_MODE:
--            break;
--
--        default: /* should not happen */
--            return 0;
--        }
--#else
--    cryp.flags = COP_FLAG_WRITE_IV;
--#endif
--
--    if (ioctl(cfd, CIOCCRYPT, &cryp) < 0) {
--        SYSerr(SYS_F_IOCTL, errno);
--        return 0;
--    }
--
--#if !defined(COP_FLAG_WRITE_IV)
--    if (ivlen > 0)
--        switch (cipher_ctx->mode) {
--        case EVP_CIPH_CBC_MODE:
--            assert(inl >= ivlen);
--            if (EVP_CIPHER_CTX_encrypting(ctx))
--                ivptr = out + inl - ivlen;
--            else
--                ivptr = saved_iv;
--
--            memcpy(iv, ivptr, ivlen);
--            break;
--
--        case EVP_CIPH_CTR_MODE:
--            nblocks = (inl + cipher_ctx->blocksize - 1)
--                      / cipher_ctx->blocksize;
--            do {
--                ivlen--;
--                nblocks += iv[ivlen];
--                iv[ivlen] = (uint8_t) nblocks;
--                nblocks >>= 8;
--            } while (ivlen);
--            break;
--
--        default: /* should not happen */
--            return 0;
--        }
--#endif
--
--    return 1;
--}
--
--static int ctr_do_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
--                         const unsigned char *in, size_t inl)
--{
--    struct cipher_ctx *cipher_ctx =
--        (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
--    size_t nblocks, len;
--
--    /* initial partial block */
--    while (cipher_ctx->num && inl) {
--        (*out++) = *(in++) ^ cipher_ctx->partial[cipher_ctx->num];
--        --inl;
--        cipher_ctx->num = (cipher_ctx->num + 1) % cipher_ctx->blocksize;
--    }
--
--    /* full blocks */
--    if (inl > (unsigned int) cipher_ctx->blocksize) {
--        nblocks = inl/cipher_ctx->blocksize;
--        len = nblocks * cipher_ctx->blocksize;
--        if (cipher_do_cipher(ctx, out, in, len) < 1)
--            return 0;
--        inl -= len;
--        out += len;
--        in += len;
--    }
--
--    /* final partial block */
--    if (inl) {
--        memset(cipher_ctx->partial, 0, cipher_ctx->blocksize);
--        if (cipher_do_cipher(ctx, cipher_ctx->partial, cipher_ctx->partial,
--            cipher_ctx->blocksize) < 1)
--            return 0;
--        while (inl--) {
--            out[cipher_ctx->num] = in[cipher_ctx->num]
--                                   ^ cipher_ctx->partial[cipher_ctx->num];
--            cipher_ctx->num++;
--        }
--    }
--
--    return 1;
--}
--
--static int cipher_ctrl(EVP_CIPHER_CTX *ctx, int type, int p1, void* p2)
--{
--    struct cipher_ctx *cipher_ctx =
--        (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
--    EVP_CIPHER_CTX *to_ctx = (EVP_CIPHER_CTX *)p2;
--    struct cipher_ctx *to_cipher_ctx;
--
--    switch (type) {
--    case EVP_CTRL_COPY:
--        if (cipher_ctx == NULL)
--            return 1;
--        /* when copying the context, a new session needs to be initialized */
--        to_cipher_ctx =
--            (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(to_ctx);
--        memset(&to_cipher_ctx->sess, 0, sizeof(to_cipher_ctx->sess));
--        return cipher_init(to_ctx, cipher_ctx->sess.key, EVP_CIPHER_CTX_iv(ctx),
--                           (cipher_ctx->op == COP_ENCRYPT));
--
--    case EVP_CTRL_INIT:
--        memset(&cipher_ctx->sess, 0, sizeof(cipher_ctx->sess));
--        return 1;
--
--    default:
--        break;
--    }
--
--    return -1;
--}
--
--static int cipher_cleanup(EVP_CIPHER_CTX *ctx)
--{
--    struct cipher_ctx *cipher_ctx =
--        (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
--
--    return clean_devcrypto_session(&cipher_ctx->sess);
--}
--
--/*
-- * Keep tables of known nids, associated methods, selected ciphers, and driver
-- * info.
-- * Note that known_cipher_nids[] isn't necessarily indexed the same way as
-- * cipher_data[] above, which the other tables are.
-- */
--static int known_cipher_nids[OSSL_NELEM(cipher_data)];
--static int known_cipher_nids_amount = -1; /* -1 indicates not yet initialised */
--static EVP_CIPHER *known_cipher_methods[OSSL_NELEM(cipher_data)] = { NULL, };
--static int selected_ciphers[OSSL_NELEM(cipher_data)];
--static struct driver_info_st cipher_driver_info[OSSL_NELEM(cipher_data)];
--
--
--static int devcrypto_test_cipher(size_t cipher_data_index)
--{
--    return (cipher_driver_info[cipher_data_index].status == DEVCRYPTO_STATUS_USABLE
--            && selected_ciphers[cipher_data_index] == 1
--            && (cipher_driver_info[cipher_data_index].accelerated
--                    == DEVCRYPTO_ACCELERATED
--                || use_softdrivers == DEVCRYPTO_USE_SOFTWARE
--                || (cipher_driver_info[cipher_data_index].accelerated
--                        != DEVCRYPTO_NOT_ACCELERATED
--                    && use_softdrivers == DEVCRYPTO_REJECT_SOFTWARE)));
--}
--
--static void prepare_cipher_methods(void)
--{
--    size_t i;
--    struct session_op sess;
--    unsigned long cipher_mode;
--#ifdef CIOCGSESSINFO
--    struct session_info_op siop;
--#endif
--
--    memset(&cipher_driver_info, 0, sizeof(cipher_driver_info));
--
--    memset(&sess, 0, sizeof(sess));
--    sess.key = (void *)"01234567890123456789012345678901234567890123456789";
--
--    for (i = 0, known_cipher_nids_amount = 0;
--         i < OSSL_NELEM(cipher_data); i++) {
--
--        selected_ciphers[i] = 1;
--        /*
--         * Check that the cipher is usable
--         */
--        sess.cipher = cipher_data[i].devcryptoid;
--        sess.keylen = cipher_data[i].keylen;
--        if (ioctl(cfd, CIOCGSESSION, &sess) < 0) {
--            cipher_driver_info[i].status = DEVCRYPTO_STATUS_NO_CIOCGSESSION;
--            continue;
--        }
--
--        cipher_mode = cipher_data[i].flags & EVP_CIPH_MODE;
--
--        if ((known_cipher_methods[i] =
--                 EVP_CIPHER_meth_new(cipher_data[i].nid,
--                                     cipher_mode == EVP_CIPH_CTR_MODE ? 1 :
--                                                    cipher_data[i].blocksize,
--                                     cipher_data[i].keylen)) == NULL
--            || !EVP_CIPHER_meth_set_iv_length(known_cipher_methods[i],
--                                              cipher_data[i].ivlen)
--            || !EVP_CIPHER_meth_set_flags(known_cipher_methods[i],
--                                          cipher_data[i].flags
--                                          | EVP_CIPH_CUSTOM_COPY
--                                          | EVP_CIPH_CTRL_INIT
--                                          | EVP_CIPH_FLAG_DEFAULT_ASN1)
--            || !EVP_CIPHER_meth_set_init(known_cipher_methods[i], cipher_init)
--            || !EVP_CIPHER_meth_set_do_cipher(known_cipher_methods[i],
--                                     cipher_mode == EVP_CIPH_CTR_MODE ?
--                                              ctr_do_cipher :
--                                              cipher_do_cipher)
--            || !EVP_CIPHER_meth_set_ctrl(known_cipher_methods[i], cipher_ctrl)
--            || !EVP_CIPHER_meth_set_cleanup(known_cipher_methods[i],
--                                            cipher_cleanup)
--            || !EVP_CIPHER_meth_set_impl_ctx_size(known_cipher_methods[i],
--                                                  sizeof(struct cipher_ctx))) {
--            cipher_driver_info[i].status = DEVCRYPTO_STATUS_FAILURE;
--            EVP_CIPHER_meth_free(known_cipher_methods[i]);
--            known_cipher_methods[i] = NULL;
--        } else {
--            cipher_driver_info[i].status = DEVCRYPTO_STATUS_USABLE;
--#ifdef CIOCGSESSINFO
--            siop.ses = sess.ses;
--            if (ioctl(cfd, CIOCGSESSINFO, &siop) < 0) {
--                cipher_driver_info[i].accelerated = DEVCRYPTO_ACCELERATION_UNKNOWN;
--            } else {
--                cipher_driver_info[i].driver_name =
--                    OPENSSL_strndup(siop.cipher_info.cra_driver_name,
--                                    CRYPTODEV_MAX_ALG_NAME);
--                if (!(siop.flags & SIOP_FLAG_KERNEL_DRIVER_ONLY))
--                    cipher_driver_info[i].accelerated = DEVCRYPTO_NOT_ACCELERATED;
--                else
--                    cipher_driver_info[i].accelerated = DEVCRYPTO_ACCELERATED;
--            }
--#endif /* CIOCGSESSINFO */
--        }
--        ioctl(cfd, CIOCFSESSION, &sess.ses);
--        if (devcrypto_test_cipher(i)) {
--            known_cipher_nids[known_cipher_nids_amount++] =
--                cipher_data[i].nid;
--        }
--    }
--}
--
--static void rebuild_known_cipher_nids(ENGINE *e)
--{
--    size_t i;
--
--    for (i = 0, known_cipher_nids_amount = 0; i < OSSL_NELEM(cipher_data); i++) {
--        if (devcrypto_test_cipher(i))
--            known_cipher_nids[known_cipher_nids_amount++] = cipher_data[i].nid;
--    }
--    ENGINE_unregister_ciphers(e);
--    ENGINE_register_ciphers(e);
--}
--
--static const EVP_CIPHER *get_cipher_method(int nid)
--{
--    size_t i = get_cipher_data_index(nid);
--
--    if (i == (size_t)-1)
--        return NULL;
--    return known_cipher_methods[i];
--}
--
--static int get_cipher_nids(const int **nids)
--{
--    *nids = known_cipher_nids;
--    return known_cipher_nids_amount;
--}
--
--static void destroy_cipher_method(int nid)
--{
--    size_t i = get_cipher_data_index(nid);
--
--    EVP_CIPHER_meth_free(known_cipher_methods[i]);
--    known_cipher_methods[i] = NULL;
--}
--
--static void destroy_all_cipher_methods(void)
--{
--    size_t i;
--
--    for (i = 0; i < OSSL_NELEM(cipher_data); i++) {
--        destroy_cipher_method(cipher_data[i].nid);
--        OPENSSL_free(cipher_driver_info[i].driver_name);
--        cipher_driver_info[i].driver_name = NULL;
--    }
--}
--
--static int devcrypto_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
--                             const int **nids, int nid)
--{
--    if (cipher == NULL)
--        return get_cipher_nids(nids);
--
--    *cipher = get_cipher_method(nid);
--
--    return *cipher != NULL;
--}
--
--static void devcrypto_select_all_ciphers(int *cipher_list)
--{
--    size_t i;
--
--    for (i = 0; i < OSSL_NELEM(cipher_data); i++)
--        cipher_list[i] = 1;
--}
--
--static int cryptodev_select_cipher_cb(const char *str, int len, void *usr)
--{
--    int *cipher_list = (int *)usr;
--    char *name;
--    const EVP_CIPHER *EVP;
--    size_t i;
--
--    if (len == 0)
--        return 1;
--    if (usr == NULL || (name = OPENSSL_strndup(str, len)) == NULL)
--        return 0;
--    EVP = EVP_get_cipherbyname(name);
--    if (EVP == NULL)
--        fprintf(stderr, "devcrypto: unknown cipher %s\n", name);
--    else if ((i = find_cipher_data_index(EVP_CIPHER_nid(EVP))) != (size_t)-1)
--        cipher_list[i] = 1;
--    else
--        fprintf(stderr, "devcrypto: cipher %s not available\n", name);
--    OPENSSL_free(name);
--    return 1;
--}
--
--static void dump_cipher_info(void)
--{
--    size_t i;
--    const char *name;
--
--    fprintf (stderr, "Information about ciphers supported by the /dev/crypto"
--             " engine:\n");
--#ifndef CIOCGSESSINFO
--    fprintf(stderr, "CIOCGSESSINFO (session info call) unavailable\n");
--#endif
--    for (i = 0; i < OSSL_NELEM(cipher_data); i++) {
--        name = OBJ_nid2sn(cipher_data[i].nid);
--        fprintf (stderr, "Cipher %s, NID=%d, /dev/crypto info: id=%d, ",
--                 name ? name : "unknown", cipher_data[i].nid,
--                 cipher_data[i].devcryptoid);
--        if (cipher_driver_info[i].status == DEVCRYPTO_STATUS_NO_CIOCGSESSION ) {
--            fprintf (stderr, "CIOCGSESSION (session open call) failed\n");
--            continue;
--        }
--        fprintf (stderr, "driver=%s ", cipher_driver_info[i].driver_name ?
--                 cipher_driver_info[i].driver_name : "unknown");
--        if (cipher_driver_info[i].accelerated == DEVCRYPTO_ACCELERATED)
--            fprintf(stderr, "(hw accelerated)");
--        else if (cipher_driver_info[i].accelerated == DEVCRYPTO_NOT_ACCELERATED)
--            fprintf(stderr, "(software)");
--        else
--            fprintf(stderr, "(acceleration status unknown)");
--        if (cipher_driver_info[i].status == DEVCRYPTO_STATUS_FAILURE)
--            fprintf (stderr, ". Cipher setup failed");
--        fprintf(stderr, "\n");
--    }
--    fprintf(stderr, "\n");
--}
--
--/*
-- * We only support digests if the cryptodev implementation supports multiple
-- * data updates and session copying.  Otherwise, we would be forced to maintain
-- * a cache, which is perilous if there's a lot of data coming in (if someone
-- * wants to checksum an OpenSSL tarball, for example).
-- */
--#if defined(CIOCCPHASH) && defined(COP_FLAG_UPDATE) && defined(COP_FLAG_FINAL)
--#define IMPLEMENT_DIGEST
--
--/******************************************************************************
-- *
-- * Digests
-- *
-- * Because they all do the same basic operation, we have only one set of
-- * method functions for them all to share, and a mapping table between
-- * NIDs and cryptodev IDs, with all the necessary size data.
-- *
-- *****/
--
--struct digest_ctx {
--    struct session_op sess;
--    /* This signals that the init function was called, not that it succeeded. */
--    int init_called;
--    unsigned char digest_res[HASH_MAX_LEN];
--};
--
--static const struct digest_data_st {
--    int nid;
--    int blocksize;
--    int digestlen;
--    int devcryptoid;
--} digest_data[] = {
--#ifndef OPENSSL_NO_MD5
--    { NID_md5, /* MD5_CBLOCK */ 64, 16, CRYPTO_MD5 },
--#endif
--    { NID_sha1, SHA_CBLOCK, 20, CRYPTO_SHA1 },
--#ifndef OPENSSL_NO_RMD160
--# if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_RIPEMD160)
--    { NID_ripemd160, /* RIPEMD160_CBLOCK */ 64, 20, CRYPTO_RIPEMD160 },
--# endif
--#endif
--#if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_SHA2_224)
--    { NID_sha224, SHA256_CBLOCK, 224 / 8, CRYPTO_SHA2_224 },
--#endif
--#if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_SHA2_256)
--    { NID_sha256, SHA256_CBLOCK, 256 / 8, CRYPTO_SHA2_256 },
--#endif
--#if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_SHA2_384)
--    { NID_sha384, SHA512_CBLOCK, 384 / 8, CRYPTO_SHA2_384 },
--#endif
--#if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_SHA2_512)
--    { NID_sha512, SHA512_CBLOCK, 512 / 8, CRYPTO_SHA2_512 },
--#endif
--};
--
--static size_t find_digest_data_index(int nid)
--{
--    size_t i;
--
--    for (i = 0; i < OSSL_NELEM(digest_data); i++)
--        if (nid == digest_data[i].nid)
--            return i;
--    return (size_t)-1;
--}
--
--static size_t get_digest_data_index(int nid)
--{
--    size_t i = find_digest_data_index(nid);
--
--    if (i != (size_t)-1)
--        return i;
--
--    /*
--     * Code further down must make sure that only NIDs in the table above
--     * are used.  If any other NID reaches this function, there's a grave
--     * coding error further down.
--     */
--    assert("Code that never should be reached" == NULL);
--    return -1;
--}
--
--static const struct digest_data_st *get_digest_data(int nid)
--{
--    return &digest_data[get_digest_data_index(nid)];
--}
--
--/*
-- * Following are the five necessary functions to map OpenSSL functionality
-- * with cryptodev: init, update, final, cleanup, and copy.
-- */
--
--static int digest_init(EVP_MD_CTX *ctx)
--{
--    struct digest_ctx *digest_ctx =
--        (struct digest_ctx *)EVP_MD_CTX_md_data(ctx);
--    const struct digest_data_st *digest_d =
--        get_digest_data(EVP_MD_CTX_type(ctx));
--
--    digest_ctx->init_called = 1;
--
--    memset(&digest_ctx->sess, 0, sizeof(digest_ctx->sess));
--    digest_ctx->sess.mac = digest_d->devcryptoid;
--    if (ioctl(cfd, CIOCGSESSION, &digest_ctx->sess) < 0) {
--        SYSerr(SYS_F_IOCTL, errno);
--        return 0;
--    }
--
--    return 1;
--}
--
--static int digest_op(struct digest_ctx *ctx, const void *src, size_t srclen,
--                     void *res, unsigned int flags)
--{
--    struct crypt_op cryp;
--
--    memset(&cryp, 0, sizeof(cryp));
--    cryp.ses = ctx->sess.ses;
--    cryp.len = srclen;
--    cryp.src = (void *)src;
--    cryp.dst = NULL;
--    cryp.mac = res;
--    cryp.flags = flags;
--    return ioctl(cfd, CIOCCRYPT, &cryp);
--}
--
--static int digest_update(EVP_MD_CTX *ctx, const void *data, size_t count)
--{
--    struct digest_ctx *digest_ctx =
--        (struct digest_ctx *)EVP_MD_CTX_md_data(ctx);
--
--    if (count == 0)
--        return 1;
--
--    if (digest_ctx == NULL)
--        return 0;
--
--    if (EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT)) {
--        if (digest_op(digest_ctx, data, count, digest_ctx->digest_res, 0) >= 0)
--            return 1;
--    } else if (digest_op(digest_ctx, data, count, NULL, COP_FLAG_UPDATE) >= 0) {
--        return 1;
--    }
--
--    SYSerr(SYS_F_IOCTL, errno);
--    return 0;
--}
--
--static int digest_final(EVP_MD_CTX *ctx, unsigned char *md)
--{
--    struct digest_ctx *digest_ctx =
--        (struct digest_ctx *)EVP_MD_CTX_md_data(ctx);
--
--    if (md == NULL || digest_ctx == NULL)
--        return 0;
--
--    if (EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT)) {
--        memcpy(md, digest_ctx->digest_res, EVP_MD_CTX_size(ctx));
--    } else if (digest_op(digest_ctx, NULL, 0, md, COP_FLAG_FINAL) < 0) {
--        SYSerr(SYS_F_IOCTL, errno);
--        return 0;
--    }
--
--    return 1;
--}
--
--static int digest_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from)
--{
--    struct digest_ctx *digest_from =
--        (struct digest_ctx *)EVP_MD_CTX_md_data(from);
--    struct digest_ctx *digest_to =
--        (struct digest_ctx *)EVP_MD_CTX_md_data(to);
--    struct cphash_op cphash;
--
--    if (digest_from == NULL || digest_from->init_called != 1)
--        return 1;
--
--    if (!digest_init(to)) {
--        SYSerr(SYS_F_IOCTL, errno);
--        return 0;
--    }
--
--    cphash.src_ses = digest_from->sess.ses;
--    cphash.dst_ses = digest_to->sess.ses;
--    if (ioctl(cfd, CIOCCPHASH, &cphash) < 0) {
--        SYSerr(SYS_F_IOCTL, errno);
--        return 0;
--    }
--    return 1;
--}
--
--static int digest_cleanup(EVP_MD_CTX *ctx)
--{
--    struct digest_ctx *digest_ctx =
--        (struct digest_ctx *)EVP_MD_CTX_md_data(ctx);
--
--    if (digest_ctx == NULL)
--        return 1;
--
--    return clean_devcrypto_session(&digest_ctx->sess);
--}
--
--/*
-- * Keep tables of known nids, associated methods, selected digests, and
-- * driver info.
-- * Note that known_digest_nids[] isn't necessarily indexed the same way as
-- * digest_data[] above, which the other tables are.
-- */
--static int known_digest_nids[OSSL_NELEM(digest_data)];
--static int known_digest_nids_amount = -1; /* -1 indicates not yet initialised */
--static EVP_MD *known_digest_methods[OSSL_NELEM(digest_data)] = { NULL, };
--static int selected_digests[OSSL_NELEM(digest_data)];
--static struct driver_info_st digest_driver_info[OSSL_NELEM(digest_data)];
--
--static int devcrypto_test_digest(size_t digest_data_index)
--{
--    return (digest_driver_info[digest_data_index].status == DEVCRYPTO_STATUS_USABLE
--            && selected_digests[digest_data_index] == 1
--            && (digest_driver_info[digest_data_index].accelerated
--                    == DEVCRYPTO_ACCELERATED
--                || use_softdrivers == DEVCRYPTO_USE_SOFTWARE
--                || (digest_driver_info[digest_data_index].accelerated
--                        != DEVCRYPTO_NOT_ACCELERATED
--                    && use_softdrivers == DEVCRYPTO_REJECT_SOFTWARE)));
--}
--
--static void rebuild_known_digest_nids(ENGINE *e)
--{
--    size_t i;
--
--    for (i = 0, known_digest_nids_amount = 0; i < OSSL_NELEM(digest_data); i++) {
--        if (devcrypto_test_digest(i))
--            known_digest_nids[known_digest_nids_amount++] = digest_data[i].nid;
--    }
--    ENGINE_unregister_digests(e);
--    ENGINE_register_digests(e);
--}
--
--static void prepare_digest_methods(void)
--{
--    size_t i;
--    struct session_op sess1, sess2;
--#ifdef CIOCGSESSINFO
--    struct session_info_op siop;
--#endif
--    struct cphash_op cphash;
--
--    memset(&digest_driver_info, 0, sizeof(digest_driver_info));
--
--    memset(&sess1, 0, sizeof(sess1));
--    memset(&sess2, 0, sizeof(sess2));
--
--    for (i = 0, known_digest_nids_amount = 0; i < OSSL_NELEM(digest_data);
--         i++) {
--
--        selected_digests[i] = 1;
--
--        /*
--         * Check that the digest is usable
--         */
--        sess1.mac = digest_data[i].devcryptoid;
--        sess2.ses = 0;
--        if (ioctl(cfd, CIOCGSESSION, &sess1) < 0) {
--            digest_driver_info[i].status = DEVCRYPTO_STATUS_NO_CIOCGSESSION;
--            goto finish;
--        }
--
--#ifdef CIOCGSESSINFO
--        /* gather hardware acceleration info from the driver */
--        siop.ses = sess1.ses;
--        if (ioctl(cfd, CIOCGSESSINFO, &siop) < 0) {
--            digest_driver_info[i].accelerated = DEVCRYPTO_ACCELERATION_UNKNOWN;
--        } else {
--            digest_driver_info[i].driver_name =
--                OPENSSL_strndup(siop.hash_info.cra_driver_name,
--                                CRYPTODEV_MAX_ALG_NAME);
--            if (siop.flags & SIOP_FLAG_KERNEL_DRIVER_ONLY)
--                digest_driver_info[i].accelerated = DEVCRYPTO_ACCELERATED;
--            else
--                digest_driver_info[i].accelerated = DEVCRYPTO_NOT_ACCELERATED;
--        }
--#endif
--
--        /* digest must be capable of hash state copy */
--        sess2.mac = sess1.mac;
--        if (ioctl(cfd, CIOCGSESSION, &sess2) < 0) {
--            digest_driver_info[i].status = DEVCRYPTO_STATUS_FAILURE;
--            goto finish;
--        }
--        cphash.src_ses = sess1.ses;
--        cphash.dst_ses = sess2.ses;
--        if (ioctl(cfd, CIOCCPHASH, &cphash) < 0) {
--            digest_driver_info[i].status = DEVCRYPTO_STATUS_NO_CIOCCPHASH;
--            goto finish;
--        }
--        if ((known_digest_methods[i] = EVP_MD_meth_new(digest_data[i].nid,
--                                                       NID_undef)) == NULL
--            || !EVP_MD_meth_set_input_blocksize(known_digest_methods[i],
--                                                digest_data[i].blocksize)
--            || !EVP_MD_meth_set_result_size(known_digest_methods[i],
--                                            digest_data[i].digestlen)
--            || !EVP_MD_meth_set_init(known_digest_methods[i], digest_init)
--            || !EVP_MD_meth_set_update(known_digest_methods[i], digest_update)
--            || !EVP_MD_meth_set_final(known_digest_methods[i], digest_final)
--            || !EVP_MD_meth_set_copy(known_digest_methods[i], digest_copy)
--            || !EVP_MD_meth_set_cleanup(known_digest_methods[i], digest_cleanup)
--            || !EVP_MD_meth_set_app_datasize(known_digest_methods[i],
--                                             sizeof(struct digest_ctx))) {
--            digest_driver_info[i].status = DEVCRYPTO_STATUS_FAILURE;
--            EVP_MD_meth_free(known_digest_methods[i]);
--            known_digest_methods[i] = NULL;
--            goto finish;
--        }
--        digest_driver_info[i].status = DEVCRYPTO_STATUS_USABLE;
--finish:
--        ioctl(cfd, CIOCFSESSION, &sess1.ses);
--        if (sess2.ses != 0)
--            ioctl(cfd, CIOCFSESSION, &sess2.ses);
--        if (devcrypto_test_digest(i))
--            known_digest_nids[known_digest_nids_amount++] = digest_data[i].nid;
--    }
--}
--
--static const EVP_MD *get_digest_method(int nid)
--{
--    size_t i = get_digest_data_index(nid);
--
--    if (i == (size_t)-1)
--        return NULL;
--    return known_digest_methods[i];
--}
--
--static int get_digest_nids(const int **nids)
--{
--    *nids = known_digest_nids;
--    return known_digest_nids_amount;
--}
--
--static void destroy_digest_method(int nid)
--{
--    size_t i = get_digest_data_index(nid);
--
--    EVP_MD_meth_free(known_digest_methods[i]);
--    known_digest_methods[i] = NULL;
--}
--
--static void destroy_all_digest_methods(void)
--{
--    size_t i;
--
--    for (i = 0; i < OSSL_NELEM(digest_data); i++) {
--        destroy_digest_method(digest_data[i].nid);
--        OPENSSL_free(digest_driver_info[i].driver_name);
--        digest_driver_info[i].driver_name = NULL;
--    }
--}
--
--static int devcrypto_digests(ENGINE *e, const EVP_MD **digest,
--                             const int **nids, int nid)
--{
--    if (digest == NULL)
--        return get_digest_nids(nids);
--
--    *digest = get_digest_method(nid);
--
--    return *digest != NULL;
--}
--
--static void devcrypto_select_all_digests(int *digest_list)
--{
--    size_t i;
--
--    for (i = 0; i < OSSL_NELEM(digest_data); i++)
--        digest_list[i] = 1;
--}
--
--static int cryptodev_select_digest_cb(const char *str, int len, void *usr)
--{
--    int *digest_list = (int *)usr;
--    char *name;
--    const EVP_MD *EVP;
--    size_t i;
--
--    if (len == 0)
--        return 1;
--    if (usr == NULL || (name = OPENSSL_strndup(str, len)) == NULL)
--        return 0;
--    EVP = EVP_get_digestbyname(name);
--    if (EVP == NULL)
--        fprintf(stderr, "devcrypto: unknown digest %s\n", name);
--    else if ((i = find_digest_data_index(EVP_MD_type(EVP))) != (size_t)-1)
--        digest_list[i] = 1;
--    else
--        fprintf(stderr, "devcrypto: digest %s not available\n", name);
--    OPENSSL_free(name);
--    return 1;
--}
--
--static void dump_digest_info(void)
--{
--    size_t i;
--    const char *name;
--
--    fprintf (stderr, "Information about digests supported by the /dev/crypto"
--             " engine:\n");
--#ifndef CIOCGSESSINFO
--    fprintf(stderr, "CIOCGSESSINFO (session info call) unavailable\n");
--#endif
--
--    for (i = 0; i < OSSL_NELEM(digest_data); i++) {
--        name = OBJ_nid2sn(digest_data[i].nid);
--        fprintf (stderr, "Digest %s, NID=%d, /dev/crypto info: id=%d, driver=%s",
--                 name ? name : "unknown", digest_data[i].nid,
--                 digest_data[i].devcryptoid,
--                 digest_driver_info[i].driver_name ? digest_driver_info[i].driver_name : "unknown");
--        if (digest_driver_info[i].status == DEVCRYPTO_STATUS_NO_CIOCGSESSION) {
--            fprintf (stderr, ". CIOCGSESSION (session open) failed\n");
--            continue;
--        }
--        if (digest_driver_info[i].accelerated == DEVCRYPTO_ACCELERATED)
--            fprintf(stderr, " (hw accelerated)");
--        else if (digest_driver_info[i].accelerated == DEVCRYPTO_NOT_ACCELERATED)
--            fprintf(stderr, " (software)");
--        else
--            fprintf(stderr, " (acceleration status unknown)");
--        if (cipher_driver_info[i].status == DEVCRYPTO_STATUS_FAILURE)
--            fprintf (stderr, ". Cipher setup failed\n");
--        else if (digest_driver_info[i].status == DEVCRYPTO_STATUS_NO_CIOCCPHASH)
--            fprintf(stderr, ", CIOCCPHASH failed\n");
--        else
--            fprintf(stderr, ", CIOCCPHASH capable\n");
--    }
--    fprintf(stderr, "\n");
--}
--
--#endif
--
--/******************************************************************************
-- *
-- * CONTROL COMMANDS
-- *
-- *****/
--
--#define DEVCRYPTO_CMD_USE_SOFTDRIVERS ENGINE_CMD_BASE
--#define DEVCRYPTO_CMD_CIPHERS (ENGINE_CMD_BASE + 1)
--#define DEVCRYPTO_CMD_DIGESTS (ENGINE_CMD_BASE + 2)
--#define DEVCRYPTO_CMD_DUMP_INFO (ENGINE_CMD_BASE + 3)
--
--/* Helper macros for CPP string composition */
--#ifndef OPENSSL_MSTR
--# define OPENSSL_MSTR_HELPER(x) #x
--# define OPENSSL_MSTR(x) OPENSSL_MSTR_HELPER(x)
--#endif
--
--static const ENGINE_CMD_DEFN devcrypto_cmds[] = {
--#ifdef CIOCGSESSINFO
--   {DEVCRYPTO_CMD_USE_SOFTDRIVERS,
--    "USE_SOFTDRIVERS",
--    "specifies whether to use software (not accelerated) drivers ("
--        OPENSSL_MSTR(DEVCRYPTO_REQUIRE_ACCELERATED) "=use only accelerated drivers, "
--        OPENSSL_MSTR(DEVCRYPTO_USE_SOFTWARE) "=allow all drivers, "
--        OPENSSL_MSTR(DEVCRYPTO_REJECT_SOFTWARE)
--        "=use if acceleration can't be determined) [default="
--        OPENSSL_MSTR(DEVCRYPTO_DEFAULT_USE_SOFDTRIVERS) "]",
--    ENGINE_CMD_FLAG_NUMERIC},
--#endif
--
--   {DEVCRYPTO_CMD_CIPHERS,
--    "CIPHERS",
--    "either ALL, NONE, or a comma-separated list of ciphers to enable [default=ALL]",
--    ENGINE_CMD_FLAG_STRING},
--
--#ifdef IMPLEMENT_DIGEST
--   {DEVCRYPTO_CMD_DIGESTS,
--    "DIGESTS",
--    "either ALL, NONE, or a comma-separated list of digests to enable [default=ALL]",
--    ENGINE_CMD_FLAG_STRING},
--#endif
--
--   {DEVCRYPTO_CMD_DUMP_INFO,
--    "DUMP_INFO",
--    "dump info about each algorithm to stderr; use 'openssl engine -pre DUMP_INFO devcrypto'",
--    ENGINE_CMD_FLAG_NO_INPUT},
--
--   {0, NULL, NULL, 0}
--};
--
--static int devcrypto_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f) (void))
--{
--    int *new_list;
--    switch (cmd) {
--#ifdef CIOCGSESSINFO
--    case DEVCRYPTO_CMD_USE_SOFTDRIVERS:
--        switch (i) {
--        case DEVCRYPTO_REQUIRE_ACCELERATED:
--        case DEVCRYPTO_USE_SOFTWARE:
--        case DEVCRYPTO_REJECT_SOFTWARE:
--            break;
--        default:
--            fprintf(stderr, "devcrypto: invalid value (%ld) for USE_SOFTDRIVERS\n", i);
--            return 0;
--        }
--        if (use_softdrivers == i)
--            return 1;
--        use_softdrivers = i;
--#ifdef IMPLEMENT_DIGEST
--        rebuild_known_digest_nids(e);
--#endif
--        rebuild_known_cipher_nids(e);
--        return 1;
--#endif /* CIOCGSESSINFO */
--
--    case DEVCRYPTO_CMD_CIPHERS:
--        if (p == NULL)
--            return 1;
--        if (strcasecmp((const char *)p, "ALL") == 0) {
--            devcrypto_select_all_ciphers(selected_ciphers);
--        } else if (strcasecmp((const char*)p, "NONE") == 0) {
--            memset(selected_ciphers, 0, sizeof(selected_ciphers));
--        } else {
--            new_list=OPENSSL_zalloc(sizeof(selected_ciphers));
--            if (!CONF_parse_list(p, ',', 1, cryptodev_select_cipher_cb, new_list)) {
--                OPENSSL_free(new_list);
--                return 0;
--            }
--            memcpy(selected_ciphers, new_list, sizeof(selected_ciphers));
--            OPENSSL_free(new_list);
--        }
--        rebuild_known_cipher_nids(e);
--        return 1;
--
--#ifdef IMPLEMENT_DIGEST
--    case DEVCRYPTO_CMD_DIGESTS:
--        if (p == NULL)
--            return 1;
--        if (strcasecmp((const char *)p, "ALL") == 0) {
--            devcrypto_select_all_digests(selected_digests);
--        } else if (strcasecmp((const char*)p, "NONE") == 0) {
--            memset(selected_digests, 0, sizeof(selected_digests));
--        } else {
--            new_list=OPENSSL_zalloc(sizeof(selected_digests));
--            if (!CONF_parse_list(p, ',', 1, cryptodev_select_digest_cb, new_list)) {
--                OPENSSL_free(new_list);
--                return 0;
--            }
--            memcpy(selected_digests, new_list, sizeof(selected_digests));
--            OPENSSL_free(new_list);
--        }
--        rebuild_known_digest_nids(e);
--        return 1;
--#endif /* IMPLEMENT_DIGEST */
--
--    case DEVCRYPTO_CMD_DUMP_INFO:
--        dump_cipher_info();
--#ifdef IMPLEMENT_DIGEST
--        dump_digest_info();
--#endif
--        return 1;
--
--    default:
--        break;
--    }
--    return 0;
--}
--
--/******************************************************************************
-- *
-- * LOAD / UNLOAD
-- *
-- *****/
--
--static int devcrypto_unload(ENGINE *e)
--{
--    destroy_all_cipher_methods();
--#ifdef IMPLEMENT_DIGEST
--    destroy_all_digest_methods();
--#endif
--
--    close(cfd);
--
--    return 1;
--}
--/*
-- * This engine is always built into libcrypto, so it doesn't offer any
-- * ability to be dynamically loadable.
-- */
--void engine_load_devcrypto_int()
--{
--    ENGINE *e = NULL;
--    int fd;
--
--    if ((fd = open("/dev/crypto", O_RDWR, 0)) < 0) {
--#ifndef ENGINE_DEVCRYPTO_DEBUG
--        if (errno != ENOENT)
--#endif
--            fprintf(stderr, "Could not open /dev/crypto: %s\n", strerror(errno));
--        return;
--    }
--
--#ifdef CRIOGET
--    if (ioctl(fd, CRIOGET, &cfd) < 0) {
--        fprintf(stderr, "Could not create crypto fd: %s\n", strerror(errno));
--        close(fd);
--        cfd = -1;
--        return;
--    }
--    close(fd);
--#else
--    cfd = fd;
--#endif
--
--    if ((e = ENGINE_new()) == NULL
--        || !ENGINE_set_destroy_function(e, devcrypto_unload)) {
--        ENGINE_free(e);
--        /*
--         * We know that devcrypto_unload() won't be called when one of the
--         * above two calls have failed, so we close cfd explicitly here to
--         * avoid leaking resources.
--         */
--        close(cfd);
--        return;
--    }
--
--    prepare_cipher_methods();
--#ifdef IMPLEMENT_DIGEST
--    prepare_digest_methods();
--#endif
--
--    if (!ENGINE_set_id(e, "devcrypto")
--        || !ENGINE_set_name(e, "/dev/crypto engine")
--        || !ENGINE_set_cmd_defns(e, devcrypto_cmds)
--        || !ENGINE_set_ctrl_function(e, devcrypto_ctrl)
--
--/*
-- * Asymmetric ciphers aren't well supported with /dev/crypto.  Among the BSD
-- * implementations, it seems to only exist in FreeBSD, and regarding the
-- * parameters in its crypt_kop, the manual crypto(4) has this to say:
-- *
-- *    The semantics of these arguments are currently undocumented.
-- *
-- * Reading through the FreeBSD source code doesn't give much more than
-- * their CRK_MOD_EXP implementation for ubsec.
-- *
-- * It doesn't look much better with cryptodev-linux.  They have the crypt_kop
-- * structure as well as the command (CRK_*) in cryptodev.h, but no support
-- * seems to be implemented at all for the moment.
-- *
-- * At the time of writing, it seems impossible to write proper support for
-- * FreeBSD's asym features without some very deep knowledge and access to
-- * specific kernel modules.
-- *
-- * /Richard Levitte, 2017-05-11
-- */
--#if 0
--# ifndef OPENSSL_NO_RSA
--        || !ENGINE_set_RSA(e, devcrypto_rsa)
--# endif
--# ifndef OPENSSL_NO_DSA
--        || !ENGINE_set_DSA(e, devcrypto_dsa)
--# endif
--# ifndef OPENSSL_NO_DH
--        || !ENGINE_set_DH(e, devcrypto_dh)
--# endif
--# ifndef OPENSSL_NO_EC
--        || !ENGINE_set_EC(e, devcrypto_ec)
--# endif
--#endif
--        || !ENGINE_set_ciphers(e, devcrypto_ciphers)
--#ifdef IMPLEMENT_DIGEST
--        || !ENGINE_set_digests(e, devcrypto_digests)
--#endif
--        ) {
--        ENGINE_free(e);
--        return;
--    }
--
--    ENGINE_add(e);
--    ENGINE_free(e);          /* Loose our local reference */
--    ERR_clear_error();
--}
---- /dev/null
-+++ b/engines/e_devcrypto.c
-@@ -0,0 +1,1327 @@
-+/*
-+ * Copyright 2017-2021 The OpenSSL Project Authors. All Rights Reserved.
-+ *
-+ * Licensed under the OpenSSL license (the "License").  You may not use
-+ * this file except in compliance with the License.  You can obtain a copy
-+ * in the file LICENSE in the source distribution or at
-+ * https://www.openssl.org/source/license.html
-+ */
-+
-+#include "../e_os.h"
-+#include <string.h>
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+#include <fcntl.h>
-+#include <sys/ioctl.h>
-+#include <unistd.h>
-+#include <assert.h>
-+
-+#include <openssl/conf.h>
-+#include <openssl/evp.h>
-+#include <openssl/err.h>
-+#include <openssl/engine.h>
-+#include <openssl/objects.h>
-+#include <crypto/cryptodev.h>
-+
-+#include "crypto/engine.h"
-+
-+/* #define ENGINE_DEVCRYPTO_DEBUG */
-+
-+#if CRYPTO_ALGORITHM_MIN < CRYPTO_ALGORITHM_MAX
-+# define CHECK_BSD_STYLE_MACROS
-+#endif
-+
-+#define engine_devcrypto_id "devcrypto"
-+
-+/*
-+ * ONE global file descriptor for all sessions.  This allows operations
-+ * such as digest session data copying (see digest_copy()), but is also
-+ * saner...  why re-open /dev/crypto for every session?
-+ */
-+static int cfd = -1;
-+#define DEVCRYPTO_REQUIRE_ACCELERATED 0 /* require confirmation of acceleration */
-+#define DEVCRYPTO_USE_SOFTWARE        1 /* allow software drivers */
-+#define DEVCRYPTO_REJECT_SOFTWARE     2 /* only disallow confirmed software drivers */
-+
-+#define DEVCRYPTO_DEFAULT_USE_SOFTDRIVERS DEVCRYPTO_REJECT_SOFTWARE
-+static int use_softdrivers = DEVCRYPTO_DEFAULT_USE_SOFTDRIVERS;
-+
-+/*
-+ * cipher/digest status & acceleration definitions
-+ * Make sure the defaults are set to 0
-+ */
-+struct driver_info_st {
-+    enum devcrypto_status_t {
-+        DEVCRYPTO_STATUS_FAILURE         = -3, /* unusable for other reason */
-+        DEVCRYPTO_STATUS_NO_CIOCCPHASH   = -2, /* hash state copy not supported */
-+        DEVCRYPTO_STATUS_NO_CIOCGSESSION = -1, /* session open failed */
-+        DEVCRYPTO_STATUS_UNKNOWN         =  0, /* not tested yet */
-+        DEVCRYPTO_STATUS_USABLE          =  1  /* algo can be used */
-+    } status;
-+
-+    enum devcrypto_accelerated_t {
-+        DEVCRYPTO_NOT_ACCELERATED        = -1, /* software implemented */
-+        DEVCRYPTO_ACCELERATION_UNKNOWN   =  0, /* acceleration support unkown */
-+        DEVCRYPTO_ACCELERATED            =  1  /* hardware accelerated */
-+    } accelerated;
-+
-+    char *driver_name;
-+};
-+
-+static int clean_devcrypto_session(struct session_op *sess) {
-+    if (ioctl(cfd, CIOCFSESSION, &sess->ses) < 0) {
-+        SYSerr(SYS_F_IOCTL, errno);
-+        return 0;
-+    }
-+    memset(sess, 0, sizeof(struct session_op));
-+    return 1;
-+}
-+
-+/******************************************************************************
-+ *
-+ * Ciphers
-+ *
-+ * Because they all do the same basic operation, we have only one set of
-+ * method functions for them all to share, and a mapping table between
-+ * NIDs and cryptodev IDs, with all the necessary size data.
-+ *
-+ *****/
-+
-+struct cipher_ctx {
-+    struct session_op sess;
-+    int op;                      /* COP_ENCRYPT or COP_DECRYPT */
-+    unsigned long mode;          /* EVP_CIPH_*_MODE */
-+
-+    /* to handle ctr mode being a stream cipher */
-+    unsigned char partial[EVP_MAX_BLOCK_LENGTH];
-+    unsigned int blocksize, num;
-+};
-+
-+static const struct cipher_data_st {
-+    int nid;
-+    int blocksize;
-+    int keylen;
-+    int ivlen;
-+    int flags;
-+    int devcryptoid;
-+} cipher_data[] = {
-+#ifndef OPENSSL_NO_DES
-+    { NID_des_cbc, 8, 8, 8, EVP_CIPH_CBC_MODE, CRYPTO_DES_CBC },
-+    { NID_des_ede3_cbc, 8, 24, 8, EVP_CIPH_CBC_MODE, CRYPTO_3DES_CBC },
-+#endif
-+#ifndef OPENSSL_NO_BF
-+    { NID_bf_cbc, 8, 16, 8, EVP_CIPH_CBC_MODE, CRYPTO_BLF_CBC },
-+#endif
-+#ifndef OPENSSL_NO_CAST
-+    { NID_cast5_cbc, 8, 16, 8, EVP_CIPH_CBC_MODE, CRYPTO_CAST_CBC },
-+#endif
-+    { NID_aes_128_cbc, 16, 128 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC },
-+    { NID_aes_192_cbc, 16, 192 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC },
-+    { NID_aes_256_cbc, 16, 256 / 8, 16, EVP_CIPH_CBC_MODE, CRYPTO_AES_CBC },
-+#ifndef OPENSSL_NO_RC4
-+    { NID_rc4, 1, 16, 0, EVP_CIPH_STREAM_CIPHER, CRYPTO_ARC4 },
-+#endif
-+#if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_AES_CTR)
-+    { NID_aes_128_ctr, 16, 128 / 8, 16, EVP_CIPH_CTR_MODE, CRYPTO_AES_CTR },
-+    { NID_aes_192_ctr, 16, 192 / 8, 16, EVP_CIPH_CTR_MODE, CRYPTO_AES_CTR },
-+    { NID_aes_256_ctr, 16, 256 / 8, 16, EVP_CIPH_CTR_MODE, CRYPTO_AES_CTR },
-+#endif
-+#if 0                            /* Not yet supported */
-+    { NID_aes_128_xts, 16, 128 / 8 * 2, 16, EVP_CIPH_XTS_MODE, CRYPTO_AES_XTS },
-+    { NID_aes_256_xts, 16, 256 / 8 * 2, 16, EVP_CIPH_XTS_MODE, CRYPTO_AES_XTS },
-+#endif
-+#if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_AES_ECB)
-+    { NID_aes_128_ecb, 16, 128 / 8, 0, EVP_CIPH_ECB_MODE, CRYPTO_AES_ECB },
-+    { NID_aes_192_ecb, 16, 192 / 8, 0, EVP_CIPH_ECB_MODE, CRYPTO_AES_ECB },
-+    { NID_aes_256_ecb, 16, 256 / 8, 0, EVP_CIPH_ECB_MODE, CRYPTO_AES_ECB },
-+#endif
-+#if 0                            /* Not yet supported */
-+    { NID_aes_128_gcm, 16, 128 / 8, 16, EVP_CIPH_GCM_MODE, CRYPTO_AES_GCM },
-+    { NID_aes_192_gcm, 16, 192 / 8, 16, EVP_CIPH_GCM_MODE, CRYPTO_AES_GCM },
-+    { NID_aes_256_gcm, 16, 256 / 8, 16, EVP_CIPH_GCM_MODE, CRYPTO_AES_GCM },
-+#endif
-+#ifndef OPENSSL_NO_CAMELLIA
-+    { NID_camellia_128_cbc, 16, 128 / 8, 16, EVP_CIPH_CBC_MODE,
-+      CRYPTO_CAMELLIA_CBC },
-+    { NID_camellia_192_cbc, 16, 192 / 8, 16, EVP_CIPH_CBC_MODE,
-+      CRYPTO_CAMELLIA_CBC },
-+    { NID_camellia_256_cbc, 16, 256 / 8, 16, EVP_CIPH_CBC_MODE,
-+      CRYPTO_CAMELLIA_CBC },
-+#endif
-+};
-+
-+static size_t find_cipher_data_index(int nid)
-+{
-+    size_t i;
-+
-+    for (i = 0; i < OSSL_NELEM(cipher_data); i++)
-+        if (nid == cipher_data[i].nid)
-+            return i;
-+    return (size_t)-1;
-+}
-+
-+static size_t get_cipher_data_index(int nid)
-+{
-+    size_t i = find_cipher_data_index(nid);
-+
-+    if (i != (size_t)-1)
-+        return i;
-+
-+    /*
-+     * Code further down must make sure that only NIDs in the table above
-+     * are used.  If any other NID reaches this function, there's a grave
-+     * coding error further down.
-+     */
-+    assert("Code that never should be reached" == NULL);
-+    return -1;
-+}
-+
-+static const struct cipher_data_st *get_cipher_data(int nid)
-+{
-+    return &cipher_data[get_cipher_data_index(nid)];
-+}
-+
-+/*
-+ * Following are the three necessary functions to map OpenSSL functionality
-+ * with cryptodev.
-+ */
-+
-+static int cipher_init(EVP_CIPHER_CTX *ctx, const unsigned char *key,
-+                       const unsigned char *iv, int enc)
-+{
-+    struct cipher_ctx *cipher_ctx =
-+        (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
-+    const struct cipher_data_st *cipher_d =
-+        get_cipher_data(EVP_CIPHER_CTX_nid(ctx));
-+
-+    /* cleanup a previous session */
-+    if (cipher_ctx->sess.ses != 0 &&
-+        clean_devcrypto_session(&cipher_ctx->sess) == 0)
-+        return 0;
-+
-+    cipher_ctx->sess.cipher = cipher_d->devcryptoid;
-+    cipher_ctx->sess.keylen = cipher_d->keylen;
-+    cipher_ctx->sess.key = (void *)key;
-+    cipher_ctx->op = enc ? COP_ENCRYPT : COP_DECRYPT;
-+    cipher_ctx->mode = cipher_d->flags & EVP_CIPH_MODE;
-+    cipher_ctx->blocksize = cipher_d->blocksize;
-+    if (ioctl(cfd, CIOCGSESSION, &cipher_ctx->sess) < 0) {
-+        SYSerr(SYS_F_IOCTL, errno);
-+        return 0;
-+    }
-+
-+    return 1;
-+}
-+
-+static int cipher_do_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-+                            const unsigned char *in, size_t inl)
-+{
-+    struct cipher_ctx *cipher_ctx =
-+        (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
-+    struct crypt_op cryp;
-+    unsigned char *iv = EVP_CIPHER_CTX_iv_noconst(ctx);
-+#if !defined(COP_FLAG_WRITE_IV)
-+    unsigned char saved_iv[EVP_MAX_IV_LENGTH];
-+    const unsigned char *ivptr;
-+    size_t nblocks, ivlen;
-+#endif
-+
-+    memset(&cryp, 0, sizeof(cryp));
-+    cryp.ses = cipher_ctx->sess.ses;
-+    cryp.len = inl;
-+    cryp.src = (void *)in;
-+    cryp.dst = (void *)out;
-+    cryp.iv = (void *)iv;
-+    cryp.op = cipher_ctx->op;
-+#if !defined(COP_FLAG_WRITE_IV)
-+    cryp.flags = 0;
-+
-+    ivlen = EVP_CIPHER_CTX_iv_length(ctx);
-+    if (ivlen > 0)
-+        switch (cipher_ctx->mode) {
-+        case EVP_CIPH_CBC_MODE:
-+            assert(inl >= ivlen);
-+            if (!EVP_CIPHER_CTX_encrypting(ctx)) {
-+                ivptr = in + inl - ivlen;
-+                memcpy(saved_iv, ivptr, ivlen);
-+            }
-+            break;
-+
-+        case EVP_CIPH_CTR_MODE:
-+            break;
-+
-+        default: /* should not happen */
-+            return 0;
-+        }
-+#else
-+    cryp.flags = COP_FLAG_WRITE_IV;
-+#endif
-+
-+    if (ioctl(cfd, CIOCCRYPT, &cryp) < 0) {
-+        SYSerr(SYS_F_IOCTL, errno);
-+        return 0;
-+    }
-+
-+#if !defined(COP_FLAG_WRITE_IV)
-+    if (ivlen > 0)
-+        switch (cipher_ctx->mode) {
-+        case EVP_CIPH_CBC_MODE:
-+            assert(inl >= ivlen);
-+            if (EVP_CIPHER_CTX_encrypting(ctx))
-+                ivptr = out + inl - ivlen;
-+            else
-+                ivptr = saved_iv;
-+
-+            memcpy(iv, ivptr, ivlen);
-+            break;
-+
-+        case EVP_CIPH_CTR_MODE:
-+            nblocks = (inl + cipher_ctx->blocksize - 1)
-+                      / cipher_ctx->blocksize;
-+            do {
-+                ivlen--;
-+                nblocks += iv[ivlen];
-+                iv[ivlen] = (uint8_t) nblocks;
-+                nblocks >>= 8;
-+            } while (ivlen);
-+            break;
-+
-+        default: /* should not happen */
-+            return 0;
-+        }
-+#endif
-+
-+    return 1;
-+}
-+
-+static int ctr_do_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
-+                         const unsigned char *in, size_t inl)
-+{
-+    struct cipher_ctx *cipher_ctx =
-+        (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
-+    size_t nblocks, len;
-+
-+    /* initial partial block */
-+    while (cipher_ctx->num && inl) {
-+        (*out++) = *(in++) ^ cipher_ctx->partial[cipher_ctx->num];
-+        --inl;
-+        cipher_ctx->num = (cipher_ctx->num + 1) % cipher_ctx->blocksize;
-+    }
-+
-+    /* full blocks */
-+    if (inl > (unsigned int) cipher_ctx->blocksize) {
-+        nblocks = inl/cipher_ctx->blocksize;
-+        len = nblocks * cipher_ctx->blocksize;
-+        if (cipher_do_cipher(ctx, out, in, len) < 1)
-+            return 0;
-+        inl -= len;
-+        out += len;
-+        in += len;
-+    }
-+
-+    /* final partial block */
-+    if (inl) {
-+        memset(cipher_ctx->partial, 0, cipher_ctx->blocksize);
-+        if (cipher_do_cipher(ctx, cipher_ctx->partial, cipher_ctx->partial,
-+            cipher_ctx->blocksize) < 1)
-+            return 0;
-+        while (inl--) {
-+            out[cipher_ctx->num] = in[cipher_ctx->num]
-+                                   ^ cipher_ctx->partial[cipher_ctx->num];
-+            cipher_ctx->num++;
-+        }
-+    }
-+
-+    return 1;
-+}
-+
-+static int cipher_ctrl(EVP_CIPHER_CTX *ctx, int type, int p1, void* p2)
-+{
-+    struct cipher_ctx *cipher_ctx =
-+        (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
-+    EVP_CIPHER_CTX *to_ctx = (EVP_CIPHER_CTX *)p2;
-+    struct cipher_ctx *to_cipher_ctx;
-+
-+    switch (type) {
-+    case EVP_CTRL_COPY:
-+        if (cipher_ctx == NULL)
-+            return 1;
-+        /* when copying the context, a new session needs to be initialized */
-+        to_cipher_ctx =
-+            (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(to_ctx);
-+        memset(&to_cipher_ctx->sess, 0, sizeof(to_cipher_ctx->sess));
-+        return cipher_init(to_ctx, cipher_ctx->sess.key, EVP_CIPHER_CTX_iv(ctx),
-+                           (cipher_ctx->op == COP_ENCRYPT));
-+
-+    case EVP_CTRL_INIT:
-+        memset(&cipher_ctx->sess, 0, sizeof(cipher_ctx->sess));
-+        return 1;
-+
-+    default:
-+        break;
-+    }
-+
-+    return -1;
-+}
-+
-+static int cipher_cleanup(EVP_CIPHER_CTX *ctx)
-+{
-+    struct cipher_ctx *cipher_ctx =
-+        (struct cipher_ctx *)EVP_CIPHER_CTX_get_cipher_data(ctx);
-+
-+    return clean_devcrypto_session(&cipher_ctx->sess);
-+}
-+
-+/*
-+ * Keep tables of known nids, associated methods, selected ciphers, and driver
-+ * info.
-+ * Note that known_cipher_nids[] isn't necessarily indexed the same way as
-+ * cipher_data[] above, which the other tables are.
-+ */
-+static int known_cipher_nids[OSSL_NELEM(cipher_data)];
-+static int known_cipher_nids_amount = -1; /* -1 indicates not yet initialised */
-+static EVP_CIPHER *known_cipher_methods[OSSL_NELEM(cipher_data)] = { NULL, };
-+static int selected_ciphers[OSSL_NELEM(cipher_data)];
-+static struct driver_info_st cipher_driver_info[OSSL_NELEM(cipher_data)];
-+
-+
-+static int devcrypto_test_cipher(size_t cipher_data_index)
-+{
-+    return (cipher_driver_info[cipher_data_index].status == DEVCRYPTO_STATUS_USABLE
-+            && selected_ciphers[cipher_data_index] == 1
-+            && (cipher_driver_info[cipher_data_index].accelerated
-+                    == DEVCRYPTO_ACCELERATED
-+                || use_softdrivers == DEVCRYPTO_USE_SOFTWARE
-+                || (cipher_driver_info[cipher_data_index].accelerated
-+                        != DEVCRYPTO_NOT_ACCELERATED
-+                    && use_softdrivers == DEVCRYPTO_REJECT_SOFTWARE)));
-+}
-+
-+static void prepare_cipher_methods(void)
-+{
-+    size_t i;
-+    struct session_op sess;
-+    unsigned long cipher_mode;
-+#ifdef CIOCGSESSINFO
-+    struct session_info_op siop;
-+#endif
-+
-+    memset(&cipher_driver_info, 0, sizeof(cipher_driver_info));
-+
-+    memset(&sess, 0, sizeof(sess));
-+    sess.key = (void *)"01234567890123456789012345678901234567890123456789";
-+
-+    for (i = 0, known_cipher_nids_amount = 0;
-+         i < OSSL_NELEM(cipher_data); i++) {
-+
-+        selected_ciphers[i] = 1;
-+        /*
-+         * Check that the cipher is usable
-+         */
-+        sess.cipher = cipher_data[i].devcryptoid;
-+        sess.keylen = cipher_data[i].keylen;
-+        if (ioctl(cfd, CIOCGSESSION, &sess) < 0) {
-+            cipher_driver_info[i].status = DEVCRYPTO_STATUS_NO_CIOCGSESSION;
-+            continue;
-+        }
-+
-+        cipher_mode = cipher_data[i].flags & EVP_CIPH_MODE;
-+
-+        if ((known_cipher_methods[i] =
-+                 EVP_CIPHER_meth_new(cipher_data[i].nid,
-+                                     cipher_mode == EVP_CIPH_CTR_MODE ? 1 :
-+                                                    cipher_data[i].blocksize,
-+                                     cipher_data[i].keylen)) == NULL
-+            || !EVP_CIPHER_meth_set_iv_length(known_cipher_methods[i],
-+                                              cipher_data[i].ivlen)
-+            || !EVP_CIPHER_meth_set_flags(known_cipher_methods[i],
-+                                          cipher_data[i].flags
-+                                          | EVP_CIPH_CUSTOM_COPY
-+                                          | EVP_CIPH_CTRL_INIT
-+                                          | EVP_CIPH_FLAG_DEFAULT_ASN1)
-+            || !EVP_CIPHER_meth_set_init(known_cipher_methods[i], cipher_init)
-+            || !EVP_CIPHER_meth_set_do_cipher(known_cipher_methods[i],
-+                                     cipher_mode == EVP_CIPH_CTR_MODE ?
-+                                              ctr_do_cipher :
-+                                              cipher_do_cipher)
-+            || !EVP_CIPHER_meth_set_ctrl(known_cipher_methods[i], cipher_ctrl)
-+            || !EVP_CIPHER_meth_set_cleanup(known_cipher_methods[i],
-+                                            cipher_cleanup)
-+            || !EVP_CIPHER_meth_set_impl_ctx_size(known_cipher_methods[i],
-+                                                  sizeof(struct cipher_ctx))) {
-+            cipher_driver_info[i].status = DEVCRYPTO_STATUS_FAILURE;
-+            EVP_CIPHER_meth_free(known_cipher_methods[i]);
-+            known_cipher_methods[i] = NULL;
-+        } else {
-+            cipher_driver_info[i].status = DEVCRYPTO_STATUS_USABLE;
-+#ifdef CIOCGSESSINFO
-+            siop.ses = sess.ses;
-+            if (ioctl(cfd, CIOCGSESSINFO, &siop) < 0) {
-+                cipher_driver_info[i].accelerated = DEVCRYPTO_ACCELERATION_UNKNOWN;
-+            } else {
-+                cipher_driver_info[i].driver_name =
-+                    OPENSSL_strndup(siop.cipher_info.cra_driver_name,
-+                                    CRYPTODEV_MAX_ALG_NAME);
-+                if (!(siop.flags & SIOP_FLAG_KERNEL_DRIVER_ONLY))
-+                    cipher_driver_info[i].accelerated = DEVCRYPTO_NOT_ACCELERATED;
-+                else
-+                    cipher_driver_info[i].accelerated = DEVCRYPTO_ACCELERATED;
-+            }
-+#endif /* CIOCGSESSINFO */
-+        }
-+        ioctl(cfd, CIOCFSESSION, &sess.ses);
-+        if (devcrypto_test_cipher(i)) {
-+            known_cipher_nids[known_cipher_nids_amount++] =
-+                cipher_data[i].nid;
-+        }
-+    }
-+}
-+
-+static void rebuild_known_cipher_nids(ENGINE *e)
-+{
-+    size_t i;
-+
-+    for (i = 0, known_cipher_nids_amount = 0; i < OSSL_NELEM(cipher_data); i++) {
-+        if (devcrypto_test_cipher(i))
-+            known_cipher_nids[known_cipher_nids_amount++] = cipher_data[i].nid;
-+    }
-+    ENGINE_unregister_ciphers(e);
-+    ENGINE_register_ciphers(e);
-+}
-+
-+static const EVP_CIPHER *get_cipher_method(int nid)
-+{
-+    size_t i = get_cipher_data_index(nid);
-+
-+    if (i == (size_t)-1)
-+        return NULL;
-+    return known_cipher_methods[i];
-+}
-+
-+static int get_cipher_nids(const int **nids)
-+{
-+    *nids = known_cipher_nids;
-+    return known_cipher_nids_amount;
-+}
-+
-+static void destroy_cipher_method(int nid)
-+{
-+    size_t i = get_cipher_data_index(nid);
-+
-+    EVP_CIPHER_meth_free(known_cipher_methods[i]);
-+    known_cipher_methods[i] = NULL;
-+}
-+
-+static void destroy_all_cipher_methods(void)
-+{
-+    size_t i;
-+
-+    for (i = 0; i < OSSL_NELEM(cipher_data); i++) {
-+        destroy_cipher_method(cipher_data[i].nid);
-+        OPENSSL_free(cipher_driver_info[i].driver_name);
-+        cipher_driver_info[i].driver_name = NULL;
-+    }
-+}
-+
-+static int devcrypto_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
-+                             const int **nids, int nid)
-+{
-+    if (cipher == NULL)
-+        return get_cipher_nids(nids);
-+
-+    *cipher = get_cipher_method(nid);
-+
-+    return *cipher != NULL;
-+}
-+
-+static void devcrypto_select_all_ciphers(int *cipher_list)
-+{
-+    size_t i;
-+
-+    for (i = 0; i < OSSL_NELEM(cipher_data); i++)
-+        cipher_list[i] = 1;
-+}
-+
-+static int cryptodev_select_cipher_cb(const char *str, int len, void *usr)
-+{
-+    int *cipher_list = (int *)usr;
-+    char *name;
-+    const EVP_CIPHER *EVP;
-+    size_t i;
-+
-+    if (len == 0)
-+        return 1;
-+    if (usr == NULL || (name = OPENSSL_strndup(str, len)) == NULL)
-+        return 0;
-+    EVP = EVP_get_cipherbyname(name);
-+    if (EVP == NULL)
-+        fprintf(stderr, "devcrypto: unknown cipher %s\n", name);
-+    else if ((i = find_cipher_data_index(EVP_CIPHER_nid(EVP))) != (size_t)-1)
-+        cipher_list[i] = 1;
-+    else
-+        fprintf(stderr, "devcrypto: cipher %s not available\n", name);
-+    OPENSSL_free(name);
-+    return 1;
-+}
-+
-+static void dump_cipher_info(void)
-+{
-+    size_t i;
-+    const char *name;
-+
-+    fprintf (stderr, "Information about ciphers supported by the /dev/crypto"
-+             " engine:\n");
-+#ifndef CIOCGSESSINFO
-+    fprintf(stderr, "CIOCGSESSINFO (session info call) unavailable\n");
-+#endif
-+    for (i = 0; i < OSSL_NELEM(cipher_data); i++) {
-+        name = OBJ_nid2sn(cipher_data[i].nid);
-+        fprintf (stderr, "Cipher %s, NID=%d, /dev/crypto info: id=%d, ",
-+                 name ? name : "unknown", cipher_data[i].nid,
-+                 cipher_data[i].devcryptoid);
-+        if (cipher_driver_info[i].status == DEVCRYPTO_STATUS_NO_CIOCGSESSION ) {
-+            fprintf (stderr, "CIOCGSESSION (session open call) failed\n");
-+            continue;
-+        }
-+        fprintf (stderr, "driver=%s ", cipher_driver_info[i].driver_name ?
-+                 cipher_driver_info[i].driver_name : "unknown");
-+        if (cipher_driver_info[i].accelerated == DEVCRYPTO_ACCELERATED)
-+            fprintf(stderr, "(hw accelerated)");
-+        else if (cipher_driver_info[i].accelerated == DEVCRYPTO_NOT_ACCELERATED)
-+            fprintf(stderr, "(software)");
-+        else
-+            fprintf(stderr, "(acceleration status unknown)");
-+        if (cipher_driver_info[i].status == DEVCRYPTO_STATUS_FAILURE)
-+            fprintf (stderr, ". Cipher setup failed");
-+        fprintf(stderr, "\n");
-+    }
-+    fprintf(stderr, "\n");
-+}
-+
-+/*
-+ * We only support digests if the cryptodev implementation supports multiple
-+ * data updates and session copying.  Otherwise, we would be forced to maintain
-+ * a cache, which is perilous if there's a lot of data coming in (if someone
-+ * wants to checksum an OpenSSL tarball, for example).
-+ */
-+#if defined(CIOCCPHASH) && defined(COP_FLAG_UPDATE) && defined(COP_FLAG_FINAL)
-+#define IMPLEMENT_DIGEST
-+
-+/******************************************************************************
-+ *
-+ * Digests
-+ *
-+ * Because they all do the same basic operation, we have only one set of
-+ * method functions for them all to share, and a mapping table between
-+ * NIDs and cryptodev IDs, with all the necessary size data.
-+ *
-+ *****/
-+
-+struct digest_ctx {
-+    struct session_op sess;
-+    /* This signals that the init function was called, not that it succeeded. */
-+    int init_called;
-+    unsigned char digest_res[HASH_MAX_LEN];
-+};
-+
-+static const struct digest_data_st {
-+    int nid;
-+    int blocksize;
-+    int digestlen;
-+    int devcryptoid;
-+} digest_data[] = {
-+#ifndef OPENSSL_NO_MD5
-+    { NID_md5, /* MD5_CBLOCK */ 64, 16, CRYPTO_MD5 },
-+#endif
-+    { NID_sha1, SHA_CBLOCK, 20, CRYPTO_SHA1 },
-+#ifndef OPENSSL_NO_RMD160
-+# if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_RIPEMD160)
-+    { NID_ripemd160, /* RIPEMD160_CBLOCK */ 64, 20, CRYPTO_RIPEMD160 },
-+# endif
-+#endif
-+#if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_SHA2_224)
-+    { NID_sha224, SHA256_CBLOCK, 224 / 8, CRYPTO_SHA2_224 },
-+#endif
-+#if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_SHA2_256)
-+    { NID_sha256, SHA256_CBLOCK, 256 / 8, CRYPTO_SHA2_256 },
-+#endif
-+#if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_SHA2_384)
-+    { NID_sha384, SHA512_CBLOCK, 384 / 8, CRYPTO_SHA2_384 },
-+#endif
-+#if !defined(CHECK_BSD_STYLE_MACROS) || defined(CRYPTO_SHA2_512)
-+    { NID_sha512, SHA512_CBLOCK, 512 / 8, CRYPTO_SHA2_512 },
-+#endif
-+};
-+
-+static size_t find_digest_data_index(int nid)
-+{
-+    size_t i;
-+
-+    for (i = 0; i < OSSL_NELEM(digest_data); i++)
-+        if (nid == digest_data[i].nid)
-+            return i;
-+    return (size_t)-1;
-+}
-+
-+static size_t get_digest_data_index(int nid)
-+{
-+    size_t i = find_digest_data_index(nid);
-+
-+    if (i != (size_t)-1)
-+        return i;
-+
-+    /*
-+     * Code further down must make sure that only NIDs in the table above
-+     * are used.  If any other NID reaches this function, there's a grave
-+     * coding error further down.
-+     */
-+    assert("Code that never should be reached" == NULL);
-+    return -1;
-+}
-+
-+static const struct digest_data_st *get_digest_data(int nid)
-+{
-+    return &digest_data[get_digest_data_index(nid)];
-+}
-+
-+/*
-+ * Following are the five necessary functions to map OpenSSL functionality
-+ * with cryptodev: init, update, final, cleanup, and copy.
-+ */
-+
-+static int digest_init(EVP_MD_CTX *ctx)
-+{
-+    struct digest_ctx *digest_ctx =
-+        (struct digest_ctx *)EVP_MD_CTX_md_data(ctx);
-+    const struct digest_data_st *digest_d =
-+        get_digest_data(EVP_MD_CTX_type(ctx));
-+
-+    digest_ctx->init_called = 1;
-+
-+    memset(&digest_ctx->sess, 0, sizeof(digest_ctx->sess));
-+    digest_ctx->sess.mac = digest_d->devcryptoid;
-+    if (ioctl(cfd, CIOCGSESSION, &digest_ctx->sess) < 0) {
-+        SYSerr(SYS_F_IOCTL, errno);
-+        return 0;
-+    }
-+
-+    return 1;
-+}
-+
-+static int digest_op(struct digest_ctx *ctx, const void *src, size_t srclen,
-+                     void *res, unsigned int flags)
-+{
-+    struct crypt_op cryp;
-+
-+    memset(&cryp, 0, sizeof(cryp));
-+    cryp.ses = ctx->sess.ses;
-+    cryp.len = srclen;
-+    cryp.src = (void *)src;
-+    cryp.dst = NULL;
-+    cryp.mac = res;
-+    cryp.flags = flags;
-+    return ioctl(cfd, CIOCCRYPT, &cryp);
-+}
-+
-+static int digest_update(EVP_MD_CTX *ctx, const void *data, size_t count)
-+{
-+    struct digest_ctx *digest_ctx =
-+        (struct digest_ctx *)EVP_MD_CTX_md_data(ctx);
-+
-+    if (count == 0)
-+        return 1;
-+
-+    if (digest_ctx == NULL)
-+        return 0;
-+
-+    if (EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT)) {
-+        if (digest_op(digest_ctx, data, count, digest_ctx->digest_res, 0) >= 0)
-+            return 1;
-+    } else if (digest_op(digest_ctx, data, count, NULL, COP_FLAG_UPDATE) >= 0) {
-+        return 1;
-+    }
-+
-+    SYSerr(SYS_F_IOCTL, errno);
-+    return 0;
-+}
-+
-+static int digest_final(EVP_MD_CTX *ctx, unsigned char *md)
-+{
-+    struct digest_ctx *digest_ctx =
-+        (struct digest_ctx *)EVP_MD_CTX_md_data(ctx);
-+
-+    if (md == NULL || digest_ctx == NULL)
-+        return 0;
-+
-+    if (EVP_MD_CTX_test_flags(ctx, EVP_MD_CTX_FLAG_ONESHOT)) {
-+        memcpy(md, digest_ctx->digest_res, EVP_MD_CTX_size(ctx));
-+    } else if (digest_op(digest_ctx, NULL, 0, md, COP_FLAG_FINAL) < 0) {
-+        SYSerr(SYS_F_IOCTL, errno);
-+        return 0;
-+    }
-+
-+    return 1;
-+}
-+
-+static int digest_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from)
-+{
-+    struct digest_ctx *digest_from =
-+        (struct digest_ctx *)EVP_MD_CTX_md_data(from);
-+    struct digest_ctx *digest_to =
-+        (struct digest_ctx *)EVP_MD_CTX_md_data(to);
-+    struct cphash_op cphash;
-+
-+    if (digest_from == NULL || digest_from->init_called != 1)
-+        return 1;
-+
-+    if (!digest_init(to)) {
-+        SYSerr(SYS_F_IOCTL, errno);
-+        return 0;
-+    }
-+
-+    cphash.src_ses = digest_from->sess.ses;
-+    cphash.dst_ses = digest_to->sess.ses;
-+    if (ioctl(cfd, CIOCCPHASH, &cphash) < 0) {
-+        SYSerr(SYS_F_IOCTL, errno);
-+        return 0;
-+    }
-+    return 1;
-+}
-+
-+static int digest_cleanup(EVP_MD_CTX *ctx)
-+{
-+    struct digest_ctx *digest_ctx =
-+        (struct digest_ctx *)EVP_MD_CTX_md_data(ctx);
-+
-+    if (digest_ctx == NULL)
-+        return 1;
-+
-+    return clean_devcrypto_session(&digest_ctx->sess);
-+}
-+
-+/*
-+ * Keep tables of known nids, associated methods, selected digests, and
-+ * driver info.
-+ * Note that known_digest_nids[] isn't necessarily indexed the same way as
-+ * digest_data[] above, which the other tables are.
-+ */
-+static int known_digest_nids[OSSL_NELEM(digest_data)];
-+static int known_digest_nids_amount = -1; /* -1 indicates not yet initialised */
-+static EVP_MD *known_digest_methods[OSSL_NELEM(digest_data)] = { NULL, };
-+static int selected_digests[OSSL_NELEM(digest_data)];
-+static struct driver_info_st digest_driver_info[OSSL_NELEM(digest_data)];
-+
-+static int devcrypto_test_digest(size_t digest_data_index)
-+{
-+    return (digest_driver_info[digest_data_index].status == DEVCRYPTO_STATUS_USABLE
-+            && selected_digests[digest_data_index] == 1
-+            && (digest_driver_info[digest_data_index].accelerated
-+                    == DEVCRYPTO_ACCELERATED
-+                || use_softdrivers == DEVCRYPTO_USE_SOFTWARE
-+                || (digest_driver_info[digest_data_index].accelerated
-+                        != DEVCRYPTO_NOT_ACCELERATED
-+                    && use_softdrivers == DEVCRYPTO_REJECT_SOFTWARE)));
-+}
-+
-+static void rebuild_known_digest_nids(ENGINE *e)
-+{
-+    size_t i;
-+
-+    for (i = 0, known_digest_nids_amount = 0; i < OSSL_NELEM(digest_data); i++) {
-+        if (devcrypto_test_digest(i))
-+            known_digest_nids[known_digest_nids_amount++] = digest_data[i].nid;
-+    }
-+    ENGINE_unregister_digests(e);
-+    ENGINE_register_digests(e);
-+}
-+
-+static void prepare_digest_methods(void)
-+{
-+    size_t i;
-+    struct session_op sess1, sess2;
-+#ifdef CIOCGSESSINFO
-+    struct session_info_op siop;
-+#endif
-+    struct cphash_op cphash;
-+
-+    memset(&digest_driver_info, 0, sizeof(digest_driver_info));
-+
-+    memset(&sess1, 0, sizeof(sess1));
-+    memset(&sess2, 0, sizeof(sess2));
-+
-+    for (i = 0, known_digest_nids_amount = 0; i < OSSL_NELEM(digest_data);
-+         i++) {
-+
-+        selected_digests[i] = 1;
-+
-+        /*
-+         * Check that the digest is usable
-+         */
-+        sess1.mac = digest_data[i].devcryptoid;
-+        sess2.ses = 0;
-+        if (ioctl(cfd, CIOCGSESSION, &sess1) < 0) {
-+            digest_driver_info[i].status = DEVCRYPTO_STATUS_NO_CIOCGSESSION;
-+            goto finish;
-+        }
-+
-+#ifdef CIOCGSESSINFO
-+        /* gather hardware acceleration info from the driver */
-+        siop.ses = sess1.ses;
-+        if (ioctl(cfd, CIOCGSESSINFO, &siop) < 0) {
-+            digest_driver_info[i].accelerated = DEVCRYPTO_ACCELERATION_UNKNOWN;
-+        } else {
-+            digest_driver_info[i].driver_name =
-+                OPENSSL_strndup(siop.hash_info.cra_driver_name,
-+                                CRYPTODEV_MAX_ALG_NAME);
-+            if (siop.flags & SIOP_FLAG_KERNEL_DRIVER_ONLY)
-+                digest_driver_info[i].accelerated = DEVCRYPTO_ACCELERATED;
-+            else
-+                digest_driver_info[i].accelerated = DEVCRYPTO_NOT_ACCELERATED;
-+        }
-+#endif
-+
-+        /* digest must be capable of hash state copy */
-+        sess2.mac = sess1.mac;
-+        if (ioctl(cfd, CIOCGSESSION, &sess2) < 0) {
-+            digest_driver_info[i].status = DEVCRYPTO_STATUS_FAILURE;
-+            goto finish;
-+        }
-+        cphash.src_ses = sess1.ses;
-+        cphash.dst_ses = sess2.ses;
-+        if (ioctl(cfd, CIOCCPHASH, &cphash) < 0) {
-+            digest_driver_info[i].status = DEVCRYPTO_STATUS_NO_CIOCCPHASH;
-+            goto finish;
-+        }
-+        if ((known_digest_methods[i] = EVP_MD_meth_new(digest_data[i].nid,
-+                                                       NID_undef)) == NULL
-+            || !EVP_MD_meth_set_input_blocksize(known_digest_methods[i],
-+                                                digest_data[i].blocksize)
-+            || !EVP_MD_meth_set_result_size(known_digest_methods[i],
-+                                            digest_data[i].digestlen)
-+            || !EVP_MD_meth_set_init(known_digest_methods[i], digest_init)
-+            || !EVP_MD_meth_set_update(known_digest_methods[i], digest_update)
-+            || !EVP_MD_meth_set_final(known_digest_methods[i], digest_final)
-+            || !EVP_MD_meth_set_copy(known_digest_methods[i], digest_copy)
-+            || !EVP_MD_meth_set_cleanup(known_digest_methods[i], digest_cleanup)
-+            || !EVP_MD_meth_set_app_datasize(known_digest_methods[i],
-+                                             sizeof(struct digest_ctx))) {
-+            digest_driver_info[i].status = DEVCRYPTO_STATUS_FAILURE;
-+            EVP_MD_meth_free(known_digest_methods[i]);
-+            known_digest_methods[i] = NULL;
-+            goto finish;
-+        }
-+        digest_driver_info[i].status = DEVCRYPTO_STATUS_USABLE;
-+finish:
-+        ioctl(cfd, CIOCFSESSION, &sess1.ses);
-+        if (sess2.ses != 0)
-+            ioctl(cfd, CIOCFSESSION, &sess2.ses);
-+        if (devcrypto_test_digest(i))
-+            known_digest_nids[known_digest_nids_amount++] = digest_data[i].nid;
-+    }
-+}
-+
-+static const EVP_MD *get_digest_method(int nid)
-+{
-+    size_t i = get_digest_data_index(nid);
-+
-+    if (i == (size_t)-1)
-+        return NULL;
-+    return known_digest_methods[i];
-+}
-+
-+static int get_digest_nids(const int **nids)
-+{
-+    *nids = known_digest_nids;
-+    return known_digest_nids_amount;
-+}
-+
-+static void destroy_digest_method(int nid)
-+{
-+    size_t i = get_digest_data_index(nid);
-+
-+    EVP_MD_meth_free(known_digest_methods[i]);
-+    known_digest_methods[i] = NULL;
-+}
-+
-+static void destroy_all_digest_methods(void)
-+{
-+    size_t i;
-+
-+    for (i = 0; i < OSSL_NELEM(digest_data); i++) {
-+        destroy_digest_method(digest_data[i].nid);
-+        OPENSSL_free(digest_driver_info[i].driver_name);
-+        digest_driver_info[i].driver_name = NULL;
-+    }
-+}
-+
-+static int devcrypto_digests(ENGINE *e, const EVP_MD **digest,
-+                             const int **nids, int nid)
-+{
-+    if (digest == NULL)
-+        return get_digest_nids(nids);
-+
-+    *digest = get_digest_method(nid);
-+
-+    return *digest != NULL;
-+}
-+
-+static void devcrypto_select_all_digests(int *digest_list)
-+{
-+    size_t i;
-+
-+    for (i = 0; i < OSSL_NELEM(digest_data); i++)
-+        digest_list[i] = 1;
-+}
-+
-+static int cryptodev_select_digest_cb(const char *str, int len, void *usr)
-+{
-+    int *digest_list = (int *)usr;
-+    char *name;
-+    const EVP_MD *EVP;
-+    size_t i;
-+
-+    if (len == 0)
-+        return 1;
-+    if (usr == NULL || (name = OPENSSL_strndup(str, len)) == NULL)
-+        return 0;
-+    EVP = EVP_get_digestbyname(name);
-+    if (EVP == NULL)
-+        fprintf(stderr, "devcrypto: unknown digest %s\n", name);
-+    else if ((i = find_digest_data_index(EVP_MD_type(EVP))) != (size_t)-1)
-+        digest_list[i] = 1;
-+    else
-+        fprintf(stderr, "devcrypto: digest %s not available\n", name);
-+    OPENSSL_free(name);
-+    return 1;
-+}
-+
-+static void dump_digest_info(void)
-+{
-+    size_t i;
-+    const char *name;
-+
-+    fprintf (stderr, "Information about digests supported by the /dev/crypto"
-+             " engine:\n");
-+#ifndef CIOCGSESSINFO
-+    fprintf(stderr, "CIOCGSESSINFO (session info call) unavailable\n");
-+#endif
-+
-+    for (i = 0; i < OSSL_NELEM(digest_data); i++) {
-+        name = OBJ_nid2sn(digest_data[i].nid);
-+        fprintf (stderr, "Digest %s, NID=%d, /dev/crypto info: id=%d, driver=%s",
-+                 name ? name : "unknown", digest_data[i].nid,
-+                 digest_data[i].devcryptoid,
-+                 digest_driver_info[i].driver_name ? digest_driver_info[i].driver_name : "unknown");
-+        if (digest_driver_info[i].status == DEVCRYPTO_STATUS_NO_CIOCGSESSION) {
-+            fprintf (stderr, ". CIOCGSESSION (session open) failed\n");
-+            continue;
-+        }
-+        if (digest_driver_info[i].accelerated == DEVCRYPTO_ACCELERATED)
-+            fprintf(stderr, " (hw accelerated)");
-+        else if (digest_driver_info[i].accelerated == DEVCRYPTO_NOT_ACCELERATED)
-+            fprintf(stderr, " (software)");
-+        else
-+            fprintf(stderr, " (acceleration status unknown)");
-+        if (cipher_driver_info[i].status == DEVCRYPTO_STATUS_FAILURE)
-+            fprintf (stderr, ". Cipher setup failed\n");
-+        else if (digest_driver_info[i].status == DEVCRYPTO_STATUS_NO_CIOCCPHASH)
-+            fprintf(stderr, ", CIOCCPHASH failed\n");
-+        else
-+            fprintf(stderr, ", CIOCCPHASH capable\n");
-+    }
-+    fprintf(stderr, "\n");
-+}
-+
-+#endif
-+
-+/******************************************************************************
-+ *
-+ * CONTROL COMMANDS
-+ *
-+ *****/
-+
-+#define DEVCRYPTO_CMD_USE_SOFTDRIVERS ENGINE_CMD_BASE
-+#define DEVCRYPTO_CMD_CIPHERS (ENGINE_CMD_BASE + 1)
-+#define DEVCRYPTO_CMD_DIGESTS (ENGINE_CMD_BASE + 2)
-+#define DEVCRYPTO_CMD_DUMP_INFO (ENGINE_CMD_BASE + 3)
-+
-+/* Helper macros for CPP string composition */
-+#ifndef OPENSSL_MSTR
-+# define OPENSSL_MSTR_HELPER(x) #x
-+# define OPENSSL_MSTR(x) OPENSSL_MSTR_HELPER(x)
-+#endif
-+
-+static const ENGINE_CMD_DEFN devcrypto_cmds[] = {
-+#ifdef CIOCGSESSINFO
-+   {DEVCRYPTO_CMD_USE_SOFTDRIVERS,
-+    "USE_SOFTDRIVERS",
-+    "specifies whether to use software (not accelerated) drivers ("
-+        OPENSSL_MSTR(DEVCRYPTO_REQUIRE_ACCELERATED) "=use only accelerated drivers, "
-+        OPENSSL_MSTR(DEVCRYPTO_USE_SOFTWARE) "=allow all drivers, "
-+        OPENSSL_MSTR(DEVCRYPTO_REJECT_SOFTWARE)
-+        "=use if acceleration can't be determined) [default="
-+        OPENSSL_MSTR(DEVCRYPTO_DEFAULT_USE_SOFTDRIVERS) "]",
-+    ENGINE_CMD_FLAG_NUMERIC},
-+#endif
-+
-+   {DEVCRYPTO_CMD_CIPHERS,
-+    "CIPHERS",
-+    "either ALL, NONE, or a comma-separated list of ciphers to enable [default=ALL]",
-+    ENGINE_CMD_FLAG_STRING},
-+
-+#ifdef IMPLEMENT_DIGEST
-+   {DEVCRYPTO_CMD_DIGESTS,
-+    "DIGESTS",
-+    "either ALL, NONE, or a comma-separated list of digests to enable [default=ALL]",
-+    ENGINE_CMD_FLAG_STRING},
-+#endif
-+
-+   {DEVCRYPTO_CMD_DUMP_INFO,
-+    "DUMP_INFO",
-+    "dump info about each algorithm to stderr; use 'openssl engine -pre DUMP_INFO devcrypto'",
-+    ENGINE_CMD_FLAG_NO_INPUT},
-+
-+   {0, NULL, NULL, 0}
-+};
-+
-+static int devcrypto_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f) (void))
-+{
-+    int *new_list;
-+    switch (cmd) {
-+#ifdef CIOCGSESSINFO
-+    case DEVCRYPTO_CMD_USE_SOFTDRIVERS:
-+        switch (i) {
-+        case DEVCRYPTO_REQUIRE_ACCELERATED:
-+        case DEVCRYPTO_USE_SOFTWARE:
-+        case DEVCRYPTO_REJECT_SOFTWARE:
-+            break;
-+        default:
-+            fprintf(stderr, "devcrypto: invalid value (%ld) for USE_SOFTDRIVERS\n", i);
-+            return 0;
-+        }
-+        if (use_softdrivers == i)
-+            return 1;
-+        use_softdrivers = i;
-+#ifdef IMPLEMENT_DIGEST
-+        rebuild_known_digest_nids(e);
-+#endif
-+        rebuild_known_cipher_nids(e);
-+        return 1;
-+#endif /* CIOCGSESSINFO */
-+
-+    case DEVCRYPTO_CMD_CIPHERS:
-+        if (p == NULL)
-+            return 1;
-+        if (strcasecmp((const char *)p, "ALL") == 0) {
-+            devcrypto_select_all_ciphers(selected_ciphers);
-+        } else if (strcasecmp((const char*)p, "NONE") == 0) {
-+            memset(selected_ciphers, 0, sizeof(selected_ciphers));
-+        } else {
-+            new_list=OPENSSL_zalloc(sizeof(selected_ciphers));
-+            if (!CONF_parse_list(p, ',', 1, cryptodev_select_cipher_cb, new_list)) {
-+                OPENSSL_free(new_list);
-+                return 0;
-+            }
-+            memcpy(selected_ciphers, new_list, sizeof(selected_ciphers));
-+            OPENSSL_free(new_list);
-+        }
-+        rebuild_known_cipher_nids(e);
-+        return 1;
-+
-+#ifdef IMPLEMENT_DIGEST
-+    case DEVCRYPTO_CMD_DIGESTS:
-+        if (p == NULL)
-+            return 1;
-+        if (strcasecmp((const char *)p, "ALL") == 0) {
-+            devcrypto_select_all_digests(selected_digests);
-+        } else if (strcasecmp((const char*)p, "NONE") == 0) {
-+            memset(selected_digests, 0, sizeof(selected_digests));
-+        } else {
-+            new_list=OPENSSL_zalloc(sizeof(selected_digests));
-+            if (!CONF_parse_list(p, ',', 1, cryptodev_select_digest_cb, new_list)) {
-+                OPENSSL_free(new_list);
-+                return 0;
-+            }
-+            memcpy(selected_digests, new_list, sizeof(selected_digests));
-+            OPENSSL_free(new_list);
-+        }
-+        rebuild_known_digest_nids(e);
-+        return 1;
-+#endif /* IMPLEMENT_DIGEST */
-+
-+    case DEVCRYPTO_CMD_DUMP_INFO:
-+        dump_cipher_info();
-+#ifdef IMPLEMENT_DIGEST
-+        dump_digest_info();
-+#endif
-+        return 1;
-+
-+    default:
-+        break;
-+    }
-+    return 0;
-+}
-+
-+/******************************************************************************
-+ *
-+ * LOAD / UNLOAD
-+ *
-+ *****/
-+
-+/*
-+ * Opens /dev/crypto
-+ */
-+static int open_devcrypto(void)
-+{
-+    int fd;
-+
-+    if (cfd >= 0)
-+        return 1;
-+
-+    if ((fd = open("/dev/crypto", O_RDWR, 0)) < 0) {
-+#ifndef ENGINE_DEVCRYPTO_DEBUG
-+        if (errno != ENOENT)
-+#endif
-+            fprintf(stderr, "Could not open /dev/crypto: %s\n", strerror(errno));
-+        return 0;
-+    }
-+
-+#ifdef CRIOGET
-+    if (ioctl(fd, CRIOGET, &cfd) < 0) {
-+        fprintf(stderr, "Could not create crypto fd: %s\n", strerror(errno));
-+        close(fd);
-+        cfd = -1;
-+        return 0;
-+    }
-+    close(fd);
-+#else
-+    cfd = fd;
-+#endif
-+
-+    return 1;
-+}
-+
-+static int close_devcrypto(void)
-+{
-+    int ret;
-+
-+    if (cfd < 0)
-+        return 1;
-+    ret = close(cfd);
-+    cfd = -1;
-+    if (ret != 0) {
-+        fprintf(stderr, "Error closing /dev/crypto: %s\n", strerror(errno));
-+        return 0;
-+    }
-+    return 1;
-+}
-+
-+static int devcrypto_unload(ENGINE *e)
-+{
-+    destroy_all_cipher_methods();
-+#ifdef IMPLEMENT_DIGEST
-+    destroy_all_digest_methods();
-+#endif
-+
-+    close_devcrypto();
-+
-+    return 1;
-+}
-+
-+static int bind_devcrypto(ENGINE *e) {
-+
-+    if (!ENGINE_set_id(e, engine_devcrypto_id)
-+        || !ENGINE_set_name(e, "/dev/crypto engine")
-+        || !ENGINE_set_destroy_function(e, devcrypto_unload)
-+        || !ENGINE_set_cmd_defns(e, devcrypto_cmds)
-+        || !ENGINE_set_ctrl_function(e, devcrypto_ctrl))
-+        return 0;
-+
-+    prepare_cipher_methods();
-+#ifdef IMPLEMENT_DIGEST
-+    prepare_digest_methods();
-+#endif
-+
-+    return (ENGINE_set_ciphers(e, devcrypto_ciphers)
-+#ifdef IMPLEMENT_DIGEST
-+        && ENGINE_set_digests(e, devcrypto_digests)
-+#endif
-+/*
-+ * Asymmetric ciphers aren't well supported with /dev/crypto.  Among the BSD
-+ * implementations, it seems to only exist in FreeBSD, and regarding the
-+ * parameters in its crypt_kop, the manual crypto(4) has this to say:
-+ *
-+ *    The semantics of these arguments are currently undocumented.
-+ *
-+ * Reading through the FreeBSD source code doesn't give much more than
-+ * their CRK_MOD_EXP implementation for ubsec.
-+ *
-+ * It doesn't look much better with cryptodev-linux.  They have the crypt_kop
-+ * structure as well as the command (CRK_*) in cryptodev.h, but no support
-+ * seems to be implemented at all for the moment.
-+ *
-+ * At the time of writing, it seems impossible to write proper support for
-+ * FreeBSD's asym features without some very deep knowledge and access to
-+ * specific kernel modules.
-+ *
-+ * /Richard Levitte, 2017-05-11
-+ */
-+#if 0
-+# ifndef OPENSSL_NO_RSA
-+        && ENGINE_set_RSA(e, devcrypto_rsa)
-+# endif
-+# ifndef OPENSSL_NO_DSA
-+        && ENGINE_set_DSA(e, devcrypto_dsa)
-+# endif
-+# ifndef OPENSSL_NO_DH
-+        && ENGINE_set_DH(e, devcrypto_dh)
-+# endif
-+# ifndef OPENSSL_NO_EC
-+        && ENGINE_set_EC(e, devcrypto_ec)
-+# endif
-+#endif
-+        );
-+}
-+
-+#ifdef OPENSSL_NO_DYNAMIC_ENGINE
-+/*
-+ * In case this engine is built into libcrypto, then it doesn't offer any
-+ * ability to be dynamically loadable.
-+ */
-+void engine_load_devcrypto_int(void)
-+{
-+    ENGINE *e = NULL;
-+
-+    if (!open_devcrypto())
-+        return;
-+
-+    if ((e = ENGINE_new()) == NULL
-+        || !bind_devcrypto(e)) {
-+        close_devcrypto();
-+        ENGINE_free(e);
-+        return;
-+    }
-+
-+    ENGINE_add(e);
-+    ENGINE_free(e);          /* Loose our local reference */
-+    ERR_clear_error();
-+}
-+
-+#else
-+
-+static int bind_helper(ENGINE *e, const char *id)
-+{
-+    if ((id && (strcmp(id, engine_devcrypto_id) != 0))
-+        || !open_devcrypto())
-+        return 0;
-+    if (!bind_devcrypto(e)) {
-+        close_devcrypto();
-+        return 0;
-+    }
-+    return 1;
-+}
-+
-+IMPLEMENT_DYNAMIC_CHECK_FN()
-+IMPLEMENT_DYNAMIC_BIND_FN(bind_helper)
-+
-+#endif
diff --git a/package/libs/openssl/patches/500-e_devcrypto-default-to-not-use-digests-in-engine.patch b/package/libs/openssl/patches/500-e_devcrypto-default-to-not-use-digests-in-engine.patch
deleted file mode 100644
index df5c16d8d2..0000000000
--- a/package/libs/openssl/patches/500-e_devcrypto-default-to-not-use-digests-in-engine.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Eneas U de Queiroz <cote2004-github at yahoo.com>
-Date: Mon, 11 Mar 2019 09:29:13 -0300
-Subject: e_devcrypto: default to not use digests in engine
-
-Digests are almost always slower when using /dev/crypto because of the
-cost of the context switches.  Only for large blocks it is worth it.
-
-Also, when forking, the open context structures are duplicated, but the
-internal kernel sessions are still shared between forks, which means an
-update/close operation in one fork affects all processes using that
-session.
-
-This affects digests, especially for HMAC, where the session with the
-key hash is used as a source for subsequent operations.  At least one
-popular application does this across a fork.  Disabling digests by
-default will mitigate the problem, while still allowing the user to
-turn them on if it is safe and fast enough.
-
-Signed-off-by: Eneas U de Queiroz <cote2004-github at yahoo.com>
-
---- a/engines/e_devcrypto.c
-+++ b/engines/e_devcrypto.c
-@@ -852,7 +852,7 @@ static void prepare_digest_methods(void)
-     for (i = 0, known_digest_nids_amount = 0; i < OSSL_NELEM(digest_data);
-          i++) {
- 
--        selected_digests[i] = 1;
-+        selected_digests[i] = 0;
- 
-         /*
-          * Check that the digest is usable
-@@ -1072,7 +1072,7 @@ static const ENGINE_CMD_DEFN devcrypto_c
- #ifdef IMPLEMENT_DIGEST
-    {DEVCRYPTO_CMD_DIGESTS,
-     "DIGESTS",
--    "either ALL, NONE, or a comma-separated list of digests to enable [default=ALL]",
-+    "either ALL, NONE, or a comma-separated list of digests to enable [default=NONE]",
-     ENGINE_CMD_FLAG_STRING},
- #endif
- 
diff --git a/package/libs/openssl/patches/510-e_devcrypto-ignore-error-when-closing-session.patch b/package/libs/openssl/patches/510-e_devcrypto-ignore-error-when-closing-session.patch
deleted file mode 100644
index 87792cf9d0..0000000000
--- a/package/libs/openssl/patches/510-e_devcrypto-ignore-error-when-closing-session.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Eneas U de Queiroz <cote2004-github at yahoo.com>
-Date: Mon, 11 Mar 2019 10:15:14 -0300
-Subject: e_devcrypto: ignore error when closing session
-
-In cipher_init, ignore an eventual error when closing the previous
-session.  It may have been closed by another process after a fork.
-
-Signed-off-by: Eneas U de Queiroz <cote2004-github at yahoo.com>
-
---- a/engines/e_devcrypto.c
-+++ b/engines/e_devcrypto.c
-@@ -195,9 +195,8 @@ static int cipher_init(EVP_CIPHER_CTX *c
-         get_cipher_data(EVP_CIPHER_CTX_nid(ctx));
- 
-     /* cleanup a previous session */
--    if (cipher_ctx->sess.ses != 0 &&
--        clean_devcrypto_session(&cipher_ctx->sess) == 0)
--        return 0;
-+    if (cipher_ctx->sess.ses != 0)
-+        clean_devcrypto_session(&cipher_ctx->sess);
- 
-     cipher_ctx->sess.cipher = cipher_d->devcryptoid;
-     cipher_ctx->sess.keylen = cipher_d->keylen;



From lede-commits at lists.infradead.org  Mon Feb 20 08:41:15 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 20 Feb 2023 11:41:15 -0500
Subject: [openwrt/openwrt]  mpc85xx: refresh kernel config
In-Reply-To: <167691127578.2436469.3520824104129429561@git-01.infra.openwrt.org>
References: <167691127578.2436469.3520824104129429561@git-01.infra.openwrt.org>
Message-ID: <mailman.17704.1676911289.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/f56ef4c0401dd586be19002e27a64257c6b4184c

commit f56ef4c0401dd586be19002e27a64257c6b4184c
Author: Pawel Dembicki <paweldembicki at gmail.com>
AuthorDate: Thu Sep 29 15:18:48 2022 +0200

    mpc85xx: refresh kernel config
    
    It was done by "make kernel_oldconfig" command for 5.10 and 5.15.
    
    Signed-off-by: Pawel Dembicki <paweldembicki at gmail.com>
---
 target/linux/mpc85xx/config-5.10 | 10 +++-------
 target/linux/mpc85xx/config-5.15 | 32 ++++++++++++--------------------
 2 files changed, 15 insertions(+), 27 deletions(-)

diff --git a/target/linux/mpc85xx/config-5.10 b/target/linux/mpc85xx/config-5.10
index e45f9df3b0..ab2ca05f9c 100644
--- a/target/linux/mpc85xx/config-5.10
+++ b/target/linux/mpc85xx/config-5.10
@@ -36,15 +36,12 @@ CONFIG_COMPAT_32BIT_TIME=y
 # CONFIG_CPM2 is not set
 CONFIG_CPU_BIG_ENDIAN=y
 # CONFIG_CRYPTO_AES_PPC_SPE is not set
-CONFIG_CRYPTO_AKCIPHER=y
-CONFIG_CRYPTO_AKCIPHER2=y
 CONFIG_CRYPTO_AUTHENC=y
 CONFIG_CRYPTO_BLAKE2S=y
 CONFIG_CRYPTO_HW=y
 CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
 CONFIG_CRYPTO_LIB_POLY1305_RSIZE=1
 # CONFIG_CRYPTO_MD5_PPC is not set
-CONFIG_CRYPTO_NULL=y
 CONFIG_CRYPTO_RNG=y
 CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_RSA=y
@@ -84,7 +81,6 @@ CONFIG_GENERIC_ATOMIC64=y
 CONFIG_GENERIC_BUG=y
 CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_CMOS_UPDATE=y
-CONFIG_GENERIC_CPU=y
 CONFIG_GENERIC_CPU_AUTOPROBE=y
 CONFIG_GENERIC_CPU_VULNERABILITIES=y
 CONFIG_GENERIC_EARLY_IOREMAP=y
@@ -106,7 +102,6 @@ CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT_MAP=y
 # CONFIG_HIVEAP_330 is not set
 CONFIG_HW_RANDOM=y
-# CONFIG_HW_RANDOM_XIPHERA is not set
 CONFIG_HZ_PERIODIC=y
 CONFIG_I2C=y
 CONFIG_I2C_BOARDINFO=y
@@ -130,8 +125,8 @@ CONFIG_LXT_PHY=y
 # CONFIG_MATH_EMULATION is not set
 CONFIG_MDIO_BUS=y
 CONFIG_MDIO_DEVICE=y
+CONFIG_MDIO_DEVRES=y
 CONFIG_MEMFD_CREATE=y
-# CONFIG_MFD_ROHM_BD71828 is not set
 CONFIG_MIGRATION=y
 CONFIG_MMU_GATHER_PAGE_SIZE=y
 CONFIG_MODULES_USE_ELF_RELA=y
@@ -224,7 +219,6 @@ CONFIG_RAS=y
 # CONFIG_RED_15W_REV1 is not set
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_GENERIC=y
-# CONFIG_RTC_DRV_RV3032 is not set
 CONFIG_RTC_I2C_AND_SPI=y
 CONFIG_RTC_MC146818_LIB=y
 # CONFIG_SBC8548 is not set
@@ -249,6 +243,8 @@ CONFIG_SRCU=y
 CONFIG_SWCONFIG=y
 CONFIG_SWPHY=y
 CONFIG_SYSCTL_EXCEPTION_TRACE=y
+CONFIG_TARGET_CPU="8540"
+CONFIG_TARGET_CPU_BOOL=y
 CONFIG_TASK_SIZE=0xc0000000
 CONFIG_THREAD_INFO_IN_TASK=y
 CONFIG_THREAD_SHIFT=13
diff --git a/target/linux/mpc85xx/config-5.15 b/target/linux/mpc85xx/config-5.15
index 8734038d33..9e143d7b87 100644
--- a/target/linux/mpc85xx/config-5.15
+++ b/target/linux/mpc85xx/config-5.15
@@ -14,7 +14,7 @@ CONFIG_ARCH_MMAP_RND_BITS_MAX=17
 CONFIG_ARCH_MMAP_RND_BITS_MIN=11
 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=17
 CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
-CONFIG_ARCH_OPTIONAL_KERNEL_RWX=y
+CONFIG_ARCH_STACKWALK=y
 CONFIG_ARCH_SUSPEND_POSSIBLE=y
 CONFIG_ARCH_WEAK_RELEASE_ACQUIRE=y
 CONFIG_ASN1=y
@@ -36,15 +36,11 @@ CONFIG_COMPAT_32BIT_TIME=y
 # CONFIG_CPM2 is not set
 CONFIG_CPU_BIG_ENDIAN=y
 # CONFIG_CRYPTO_AES_PPC_SPE is not set
-CONFIG_CRYPTO_AKCIPHER=y
-CONFIG_CRYPTO_AKCIPHER2=y
 CONFIG_CRYPTO_AUTHENC=y
-CONFIG_CRYPTO_BLAKE2S=y
 CONFIG_CRYPTO_HW=y
 CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
 CONFIG_CRYPTO_LIB_POLY1305_RSIZE=1
 # CONFIG_CRYPTO_MD5_PPC is not set
-CONFIG_CRYPTO_NULL=y
 CONFIG_CRYPTO_RNG=y
 CONFIG_CRYPTO_RNG2=y
 CONFIG_CRYPTO_RSA=y
@@ -55,11 +51,8 @@ CONFIG_DATA_SHIFT=12
 CONFIG_DEBUG_BUGVERBOSE=y
 CONFIG_DNOTIFY=y
 CONFIG_DTC=y
-# CONFIG_E200 is not set
 CONFIG_E500=y
 CONFIG_E500_CPU=y
-# CONFIG_E5500_CPU is not set
-# CONFIG_E6500_CPU is not set
 CONFIG_EARLY_PRINTK=y
 CONFIG_EDAC=y
 CONFIG_EDAC_ATOMIC_SCRUB=y
@@ -67,7 +60,6 @@ CONFIG_EDAC_ATOMIC_SCRUB=y
 CONFIG_EDAC_LEGACY_SYSFS=y
 CONFIG_EDAC_MPC85XX=y
 CONFIG_EDAC_SUPPORT=y
-CONFIG_ENABLE_MUST_CHECK=y
 CONFIG_ETHERNET_PACKET_MANGLE=y
 CONFIG_FIXED_PHY=y
 CONFIG_FSL_BOOKE=y
@@ -79,16 +71,18 @@ CONFIG_FSL_PCI=y
 CONFIG_FSL_PQ_MDIO=y
 CONFIG_FSL_SOC=y
 CONFIG_FSL_SOC_BOOKE=y
+CONFIG_FWNODE_MDIO=y
 CONFIG_FW_LOADER_PAGED_BUF=y
 CONFIG_GENERIC_ALLOCATOR=y
 CONFIG_GENERIC_ATOMIC64=y
 CONFIG_GENERIC_BUG=y
+CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
 CONFIG_GENERIC_CLOCKEVENTS=y
 CONFIG_GENERIC_CMOS_UPDATE=y
-CONFIG_GENERIC_CPU=y
 CONFIG_GENERIC_CPU_AUTOPROBE=y
 CONFIG_GENERIC_CPU_VULNERABILITIES=y
 CONFIG_GENERIC_EARLY_IOREMAP=y
+CONFIG_GENERIC_GETTIMEOFDAY=y
 CONFIG_GENERIC_IRQ_SHOW=y
 CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
 CONFIG_GENERIC_ISA_DMA=y
@@ -100,6 +94,7 @@ CONFIG_GENERIC_TIME_VSYSCALL=y
 CONFIG_GEN_RTC=y
 # CONFIG_GE_IMP3A is not set
 CONFIG_GIANFAR=y
+CONFIG_GPIO_CDEV=y
 CONFIG_GPIO_GENERIC=y
 CONFIG_GPIO_MPC8XXX=y
 CONFIG_HAS_DMA=y
@@ -107,7 +102,6 @@ CONFIG_HAS_IOMEM=y
 CONFIG_HAS_IOPORT_MAP=y
 # CONFIG_HIVEAP_330 is not set
 CONFIG_HW_RANDOM=y
-# CONFIG_HW_RANDOM_XIPHERA is not set
 CONFIG_HZ_PERIODIC=y
 CONFIG_I2C=y
 CONFIG_I2C_BOARDINFO=y
@@ -131,8 +125,8 @@ CONFIG_LXT_PHY=y
 # CONFIG_MATH_EMULATION is not set
 CONFIG_MDIO_BUS=y
 CONFIG_MDIO_DEVICE=y
+CONFIG_MDIO_DEVRES=y
 CONFIG_MEMFD_CREATE=y
-# CONFIG_MFD_ROHM_BD71828 is not set
 CONFIG_MIGRATION=y
 CONFIG_MMU_GATHER_PAGE_SIZE=y
 CONFIG_MODULES_USE_ELF_RELA=y
@@ -156,7 +150,9 @@ CONFIG_MTD_SPI_NOR=y
 # CONFIG_MVME2500 is not set
 CONFIG_NEED_PER_CPU_KM=y
 CONFIG_NEED_SG_DMA_LENGTH=y
+CONFIG_NET_SELFTESTS=y
 CONFIG_NLS=y
+CONFIG_NR_CPUS=1
 CONFIG_NR_IRQS=512
 CONFIG_NVMEM=y
 CONFIG_OF=y
@@ -168,7 +164,6 @@ CONFIG_OF_GPIO=y
 CONFIG_OF_IRQ=y
 CONFIG_OF_KOBJ=y
 CONFIG_OF_MDIO=y
-CONFIG_OF_NET=y
 CONFIG_OLD_SIGACTION=y
 CONFIG_OLD_SIGSUSPEND=y
 # CONFIG_P1010_RDB is not set
@@ -196,7 +191,6 @@ CONFIG_PHYSICAL_START=0x00000000
 CONFIG_PPC=y
 CONFIG_PPC32=y
 # CONFIG_PPC64 is not set
-# CONFIG_PPC_BOOK3S_32 is not set
 CONFIG_PPC_85xx=y
 # CONFIG_PPC_8xx is not set
 CONFIG_PPC_ADV_DEBUG_DACS=2
@@ -205,31 +199,27 @@ CONFIG_PPC_ADV_DEBUG_IACS=2
 CONFIG_PPC_ADV_DEBUG_REGS=y
 CONFIG_PPC_BARRIER_NOSPEC=y
 CONFIG_PPC_BOOK3E_MMU=y
-# CONFIG_PPC_BOOK3S_6xx is not set
+# CONFIG_PPC_BOOK3S_32 is not set
 CONFIG_PPC_DOORBELL=y
 # CONFIG_PPC_E500MC is not set
 # CONFIG_PPC_EARLY_DEBUG is not set
 CONFIG_PPC_FSL_BOOK3E=y
 CONFIG_PPC_INDIRECT_PCI=y
-# CONFIG_PPC_IRQ_SOFT_MASK_DEBUG is not set
 CONFIG_PPC_MMU_NOHASH=y
-CONFIG_PPC_MMU_NOHASH_32=y
 CONFIG_PPC_PAGE_SHIFT=12
-# CONFIG_PPC_PTDUMP is not set
 # CONFIG_PPC_QEMU_E500 is not set
 CONFIG_PPC_SMP_MUXED_IPI=y
 CONFIG_PPC_UDBG_16550=y
 CONFIG_PPC_WERROR=y
+CONFIG_PTP_1588_CLOCK_OPTIONAL=y
 CONFIG_QE_GPIO=y
 CONFIG_QUICC_ENGINE=y
 CONFIG_RAS=y
 # CONFIG_RED_15W_REV1 is not set
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_GENERIC=y
-# CONFIG_RTC_DRV_RV3032 is not set
 CONFIG_RTC_I2C_AND_SPI=y
 CONFIG_RTC_MC146818_LIB=y
-# CONFIG_SBC8548 is not set
 # CONFIG_SCOM_DEBUGFS is not set
 CONFIG_SERIAL_8250_EXTENDED=y
 CONFIG_SERIAL_8250_FSL=y
@@ -251,6 +241,8 @@ CONFIG_SRCU=y
 CONFIG_SWCONFIG=y
 CONFIG_SWPHY=y
 CONFIG_SYSCTL_EXCEPTION_TRACE=y
+CONFIG_TARGET_CPU="8540"
+CONFIG_TARGET_CPU_BOOL=y
 CONFIG_TASK_SIZE=0xc0000000
 CONFIG_THREAD_INFO_IN_TASK=y
 CONFIG_THREAD_SHIFT=13



From lede-commits at lists.infradead.org  Mon Feb 20 08:41:16 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 20 Feb 2023 11:41:16 -0500
Subject: [openwrt/openwrt]  mcp85xx: Switch TP-Link TL-WDR4900 v1 to DSA
In-Reply-To: <167691127578.2436469.3520824104129429561@git-01.infra.openwrt.org>
References: <167691127578.2436469.3520824104129429561@git-01.infra.openwrt.org>
Message-ID: <mailman.17705.1676911293.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/bfa5e4e4eba36757826d0b5d463558f6916d3456

commit bfa5e4e4eba36757826d0b5d463558f6916d3456
Author: Pawel Dembicki <paweldembicki at gmail.com>
AuthorDate: Thu Sep 29 22:25:24 2022 +0200

    mcp85xx: Switch TP-Link TL-WDR4900 v1 to DSA
    
    This patch introduces DSA support for TP-Link TL-WDR4900 v1 switch.
    Swconfig driver for QCA8327 switch is removed because this router is
    only one device which use Qualcom swconfig switch.
    
    Signed-off-by: Pawel Dembicki <paweldembicki at gmail.com>
    Tested-by: Nick Hainke <vincent at systemli.org> # TP Link WDR4900 v1 (5.15)
---
 .../mpc85xx/base-files/etc/board.d/02_network      |  3 +-
 .../base-files/etc/board.d/05_compat-version       | 15 ++++
 target/linux/mpc85xx/config-5.10                   |  4 -
 target/linux/mpc85xx/config-5.15                   |  4 -
 .../files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts  | 92 ++++++++++++++++++----
 target/linux/mpc85xx/image/p1010.mk                |  2 +
 target/linux/mpc85xx/p1010/config-default          |  9 +++
 target/linux/mpc85xx/p1020/config-default          |  1 +
 8 files changed, 105 insertions(+), 25 deletions(-)

diff --git a/target/linux/mpc85xx/base-files/etc/board.d/02_network b/target/linux/mpc85xx/base-files/etc/board.d/02_network
index 03153b73d0..7a677ee96f 100644
--- a/target/linux/mpc85xx/base-files/etc/board.d/02_network
+++ b/target/linux/mpc85xx/base-files/etc/board.d/02_network
@@ -18,8 +18,7 @@ ocedo,panda)
 		"0:lan" "1:lan" "2:lan" "3:lan" "4:lan" "5:lan" "6:lan" "7:lan" "8u at eth0"
 	;;
 tplink,tl-wdr4900-v1)
-	ucidef_add_switch "switch0" \
-		"0 at eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan"
+	ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
 	ucidef_set_interface_macaddr "wan" "$(macaddr_add $(mtd_get_mac_binary u-boot 0x4fc00) 1)"
 	;;
 *)
diff --git a/target/linux/mpc85xx/base-files/etc/board.d/05_compat-version b/target/linux/mpc85xx/base-files/etc/board.d/05_compat-version
new file mode 100644
index 0000000000..bcc03e9502
--- /dev/null
+++ b/target/linux/mpc85xx/base-files/etc/board.d/05_compat-version
@@ -0,0 +1,15 @@
+
+. /lib/functions.sh
+. /lib/functions/uci-defaults.sh
+
+board_config_update
+
+case "$(board_name)" in
+	tplink,tl-wdr4900-v1)
+		ucidef_set_compat_version "1.1"
+		;;
+esac
+
+board_config_flush
+
+exit 0
diff --git a/target/linux/mpc85xx/config-5.10 b/target/linux/mpc85xx/config-5.10
index ab2ca05f9c..909cd53092 100644
--- a/target/linux/mpc85xx/config-5.10
+++ b/target/linux/mpc85xx/config-5.10
@@ -1,8 +1,6 @@
 # CONFIG_40x is not set
 # CONFIG_44x is not set
 # CONFIG_ADVANCED_OPTIONS is not set
-CONFIG_AR8216_PHY=y
-CONFIG_AR8216_PHY_LEDS=y
 CONFIG_ARCH_32BIT_OFF_T=y
 CONFIG_ARCH_HIBERNATION_POSSIBLE=y
 CONFIG_ARCH_KEEP_MEMBLOCK=y
@@ -65,7 +63,6 @@ CONFIG_EDAC_LEGACY_SYSFS=y
 CONFIG_EDAC_MPC85XX=y
 CONFIG_EDAC_SUPPORT=y
 CONFIG_ENABLE_MUST_CHECK=y
-CONFIG_ETHERNET_PACKET_MANGLE=y
 CONFIG_FIXED_PHY=y
 CONFIG_FSL_BOOKE=y
 CONFIG_FSL_EMB_PERFMON=y
@@ -240,7 +237,6 @@ CONFIG_SPI_MEM=y
 CONFIG_SRCU=y
 # CONFIG_STRIP_ASM_SYMS is not set
 # CONFIG_STX_GP3 is not set
-CONFIG_SWCONFIG=y
 CONFIG_SWPHY=y
 CONFIG_SYSCTL_EXCEPTION_TRACE=y
 CONFIG_TARGET_CPU="8540"
diff --git a/target/linux/mpc85xx/config-5.15 b/target/linux/mpc85xx/config-5.15
index 9e143d7b87..5700a247de 100644
--- a/target/linux/mpc85xx/config-5.15
+++ b/target/linux/mpc85xx/config-5.15
@@ -1,8 +1,6 @@
 # CONFIG_40x is not set
 # CONFIG_44x is not set
 # CONFIG_ADVANCED_OPTIONS is not set
-CONFIG_AR8216_PHY=y
-CONFIG_AR8216_PHY_LEDS=y
 CONFIG_ARCH_32BIT_OFF_T=y
 CONFIG_ARCH_HIBERNATION_POSSIBLE=y
 CONFIG_ARCH_KEEP_MEMBLOCK=y
@@ -60,7 +58,6 @@ CONFIG_EDAC_ATOMIC_SCRUB=y
 CONFIG_EDAC_LEGACY_SYSFS=y
 CONFIG_EDAC_MPC85XX=y
 CONFIG_EDAC_SUPPORT=y
-CONFIG_ETHERNET_PACKET_MANGLE=y
 CONFIG_FIXED_PHY=y
 CONFIG_FSL_BOOKE=y
 # CONFIG_FSL_DPAA2_SWITCH is not set
@@ -238,7 +235,6 @@ CONFIG_SPI_MEM=y
 CONFIG_SRCU=y
 # CONFIG_STRIP_ASM_SYMS is not set
 # CONFIG_STX_GP3 is not set
-CONFIG_SWCONFIG=y
 CONFIG_SWPHY=y
 CONFIG_SYSCTL_EXCEPTION_TRACE=y
 CONFIG_TARGET_CPU="8540"
diff --git a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
index 12281808aa..c54cb53f94 100644
--- a/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
+++ b/target/linux/mpc85xx/files/arch/powerpc/boot/dts/tl-wdr4900-v1.dts
@@ -102,20 +102,78 @@
 		};
 
 		mdio at 24000 {
-			phy0: ethernet-phy at 0 {
-				reg = <0x0>;
-				qca,ar8327-initvals = <
-					0x00004 0x07600000 /* PAD0_MODE */
-					0x00008 0x00000000 /* PAD5_MODE */
-					0x0000c 0x01000000 /* PAD6_MODE */
-					0x00010 0x40000000 /* POWER_ON_STRAP */
-					0x00050 0xcf35cf35 /* LED_CTRL0 */
-					0x00054 0xcf35cf35 /* LED_CTRL1 */
-					0x00058 0xcf35cf35 /* LED_CTRL2 */
-					0x0005c 0x03ffff00 /* LED_CTRL3 */
-					0x0007c 0x0000007e /* PORT0_STATUS */
-					0x00094 0x00000200 /* PORT6_STATUS */
-				>;
+
+			phy_port1: phy at 0 {
+				reg = <0>;
+			};
+
+			phy_port2: phy at 1 {
+				reg = <1>;
+			};
+
+			phy_port3: phy at 2 {
+				reg = <2>;
+			};
+
+			phy_port4: phy at 3 {
+				reg = <3>;
+			};
+
+			phy_port5: phy at 4 {
+				reg = <4>;
+			};
+
+			switch at 0 {
+				compatible = "qca,qca8327";
+				#address-cells = <1>;
+				#size-cells = <0>;
+				reg = <0x10>;
+
+				ports {
+					#address-cells = <1>;
+					#size-cells = <0>;
+
+					port at 0 {
+						reg = <0>;
+						ethernet = <&enet0>;
+						phy-mode = "rgmii-id";
+
+						fixed-link {
+							speed = <1000>;
+							full-duplex;
+						};
+					};
+
+					port at 1 {
+						reg = <1>;
+						label = "wan";
+						phy-handle = <&phy_port1>;
+					};
+
+					port at 2 {
+						reg = <2>;
+						label = "lan1";
+						phy-handle = <&phy_port2>;
+					};
+
+					port at 3 {
+						reg = <3>;
+						label = "lan2";
+						phy-handle = <&phy_port3>;
+					};
+
+					port at 4 {
+						reg = <4>;
+						label = "lan3";
+						phy-handle = <&phy_port4>;
+					};
+
+					port at 5 {
+						reg = <5>;
+						label = "lan4";
+						phy-handle = <&phy_port5>;
+					};
+				};
 			};
 		};
 
@@ -128,10 +186,14 @@
 		};
 
 		enet0: ethernet at b0000 {
-			phy-handle = <&phy0>;
 			phy-connection-type = "rgmii-id";
 			nvmem-cells = <&macaddr_uboot_4fc00>;
 			nvmem-cell-names = "mac-address";
+
+			fixed-link {
+				speed = <1000>;
+				full-duplex;
+			};
 		};
 
 		enet1: ethernet at b1000 {
diff --git a/target/linux/mpc85xx/image/p1010.mk b/target/linux/mpc85xx/image/p1010.mk
index a18cd6d178..92cad3d035 100644
--- a/target/linux/mpc85xx/image/p1010.mk
+++ b/target/linux/mpc85xx/image/p1010.mk
@@ -18,6 +18,8 @@ define Device/tplink_tl-wdr4900-v1
   DEVICE_VENDOR := TP-Link
   DEVICE_MODEL := TL-WDR4900
   DEVICE_VARIANT := v1
+  DEVICE_COMPAT_VERSION := 1.1
+  DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA
   TPLINK_HEADER_VERSION := 1
   TPLINK_HWID := 0x49000001
   TPLINK_HWREV := 1
diff --git a/target/linux/mpc85xx/p1010/config-default b/target/linux/mpc85xx/p1010/config-default
index 8a065f7944..5ca65812d7 100644
--- a/target/linux/mpc85xx/p1010/config-default
+++ b/target/linux/mpc85xx/p1010/config-default
@@ -1,3 +1,4 @@
+CONFIG_AT803X_PHY=y
 # CONFIG_FSL_CORENET_CF is not set
 CONFIG_MTD_NAND_FSL_IFC=y
 CONFIG_MTD_SPLIT_FIRMWARE=y
@@ -6,7 +7,15 @@ CONFIG_MTD_UBI=y
 CONFIG_MTD_UBI_BEB_LIMIT=20
 CONFIG_MTD_UBI_BLOCK=y
 CONFIG_MTD_UBI_WL_THRESHOLD=4096
+CONFIG_NET_DEVLINK=y
+CONFIG_NET_DSA=y
+CONFIG_NET_DSA_QCA8K=y
+CONFIG_NET_DSA_TAG_QCA=y
+CONFIG_NET_SWITCHDEV=y
+CONFIG_PHYLINK=y
 CONFIG_REALTEK_PHY=y
 CONFIG_RED_15W_REV1=y
+CONFIG_REGMAP=y
+CONFIG_REGULATOR=y
 CONFIG_TL_WDR4900_V1=y
 CONFIG_UBIFS_FS=y
diff --git a/target/linux/mpc85xx/p1020/config-default b/target/linux/mpc85xx/p1020/config-default
index 73176a87dc..65b40e1d7d 100644
--- a/target/linux/mpc85xx/p1020/config-default
+++ b/target/linux/mpc85xx/p1020/config-default
@@ -43,6 +43,7 @@ CONFIG_RPS=y
 CONFIG_RWSEM_SPIN_ON_OWNER=y
 CONFIG_SMP=y
 CONFIG_SPI_GPIO=y
+CONFIG_SWCONFIG=y
 CONFIG_SWCONFIG_B53=y
 # CONFIG_SWCONFIG_B53_MMAP_DRIVER is not set
 CONFIG_SWCONFIG_B53_PHY_DRIVER=y



From lede-commits at lists.infradead.org  Tue Feb 21 03:09:30 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 21 Feb 2023 06:09:30 -0500
Subject: [openwrt/openwrt]  kernel: update NVMEM subsystem to the v6.3
In-Reply-To: <167697777085.3358513.8806303243692354724@git-01.infra.openwrt.org>
References: <167697777085.3358513.8806303243692354724@git-01.infra.openwrt.org>
Message-ID: <mailman.17845.1676977789.3064139.lede-commits@lists.infradead.org>

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

commit 52ddb3846975cbb1c3cb504ffde6efdd69bb5622
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Tue Feb 21 11:25:49 2023 +0100

    kernel: update NVMEM subsystem to the v6.3
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 ...01-nvmem-core-remove-spurious-white-space.patch |  26 +
 ...m-core-add-an-index-parameter-to-the-cell.patch | 180 +++++++
 ...move-struct-nvmem_cell_info-to-nvmem-prov.patch |  78 +++
 ...drop-the-removal-of-the-cells-in-nvmem_ad.patch |  65 +++
 ....3-0005-nvmem-core-add-nvmem_add_one_cell.patch | 122 +++++
 ...use-nvmem_add_one_cell-in-nvmem_add_cells.patch |  93 ++++
 ...m-stm32-add-OP-TEE-support-for-STM32MP13x.patch | 562 +++++++++++++++++++++
 ...2-detect-bsec-pta-presence-for-STM32MP15x.patch |  85 ++++
 ...-sp-eeprm-fix-kernel-doc-bad-line-warning.patch |  32 ++
 ...om-spmi-sdam-register-at-device-init-time.patch |  43 ++
 ...6.3-0011-nvmem-stm32-fix-OPTEE-dependency.patch |  46 ++
 ...01-nvmem-core-remove-spurious-white-space.patch |  26 +
 ...m-core-add-an-index-parameter-to-the-cell.patch | 180 +++++++
 ...move-struct-nvmem_cell_info-to-nvmem-prov.patch |  78 +++
 ...drop-the-removal-of-the-cells-in-nvmem_ad.patch |  65 +++
 ....3-0005-nvmem-core-add-nvmem_add_one_cell.patch | 122 +++++
 ...use-nvmem_add_one_cell-in-nvmem_add_cells.patch |  93 ++++
 ...m-stm32-add-OP-TEE-support-for-STM32MP13x.patch | 562 +++++++++++++++++++++
 ...2-detect-bsec-pta-presence-for-STM32MP15x.patch |  85 ++++
 ...-sp-eeprm-fix-kernel-doc-bad-line-warning.patch |  32 ++
 ...om-spmi-sdam-register-at-device-init-time.patch |  43 ++
 ...6.3-0011-nvmem-stm32-fix-OPTEE-dependency.patch |  46 ++
 ...oot-env-align-endianness-of-crc32-values.patch} |   0
 ...oot-env-align-endianness-of-crc32-values.patch} |   0
 24 files changed, 2664 insertions(+)

diff --git a/target/linux/generic/backport-5.10/813-v6.3-0001-nvmem-core-remove-spurious-white-space.patch b/target/linux/generic/backport-5.10/813-v6.3-0001-nvmem-core-remove-spurious-white-space.patch
new file mode 100644
index 0000000000..01400fd490
--- /dev/null
+++ b/target/linux/generic/backport-5.10/813-v6.3-0001-nvmem-core-remove-spurious-white-space.patch
@@ -0,0 +1,26 @@
+From 2e8dc541ae207349b51c65391be625ffe1f86e0c Mon Sep 17 00:00:00 2001
+From: "Russell King (Oracle)" <rmk+kernel at armlinux.org.uk>
+Date: Mon, 6 Feb 2023 13:43:41 +0000
+Subject: [PATCH] nvmem: core: remove spurious white space
+
+Remove a spurious white space in for the ida_alloc() call.
+
+Signed-off-by: Russell King (Oracle) <rmk+kernel at armlinux.org.uk>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-8-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/nvmem/core.c
++++ b/drivers/nvmem/core.c
+@@ -764,7 +764,7 @@ struct nvmem_device *nvmem_register(cons
+ 	if (!nvmem)
+ 		return ERR_PTR(-ENOMEM);
+ 
+-	rval  = ida_alloc(&nvmem_ida, GFP_KERNEL);
++	rval = ida_alloc(&nvmem_ida, GFP_KERNEL);
+ 	if (rval < 0) {
+ 		kfree(nvmem);
+ 		return ERR_PTR(rval);
diff --git a/target/linux/generic/backport-5.10/813-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch b/target/linux/generic/backport-5.10/813-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch
new file mode 100644
index 0000000000..4f1bfac806
--- /dev/null
+++ b/target/linux/generic/backport-5.10/813-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch
@@ -0,0 +1,180 @@
+From 5d8e6e6c10a3d37486d263b16ddc15991a7e4a88 Mon Sep 17 00:00:00 2001
+From: Michael Walle <michael at walle.cc>
+Date: Mon, 6 Feb 2023 13:43:46 +0000
+Subject: [PATCH] nvmem: core: add an index parameter to the cell
+
+Sometimes a cell can represend multiple values. For example, a base
+ethernet address stored in the NVMEM can be expanded into multiple
+discreet ones by adding an offset.
+
+For this use case, introduce an index parameter which is then used to
+distiguish between values. This parameter will then be passed to the
+post process hook which can then use it to create different values
+during reading.
+
+At the moment, there is only support for the device tree path. You can
+add the index to the phandle, e.g.
+
+  &net {
+          nvmem-cells = <&base_mac_address 2>;
+          nvmem-cell-names = "mac-address";
+  };
+
+  &nvmem_provider {
+          base_mac_address: base-mac-address at 0 {
+                  #nvmem-cell-cells = <1>;
+                  reg = <0 6>;
+          };
+  };
+
+Signed-off-by: Michael Walle <michael at walle.cc>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-13-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/core.c           | 37 ++++++++++++++++++++++++----------
+ drivers/nvmem/imx-ocotp.c      |  4 ++--
+ include/linux/nvmem-provider.h |  4 ++--
+ 3 files changed, 30 insertions(+), 15 deletions(-)
+
+--- a/drivers/nvmem/core.c
++++ b/drivers/nvmem/core.c
+@@ -60,6 +60,7 @@ struct nvmem_cell_entry {
+ struct nvmem_cell {
+ 	struct nvmem_cell_entry *entry;
+ 	const char		*id;
++	int			index;
+ };
+ 
+ static DEFINE_MUTEX(nvmem_mutex);
+@@ -1127,7 +1128,8 @@ struct nvmem_device *devm_nvmem_device_g
+ }
+ EXPORT_SYMBOL_GPL(devm_nvmem_device_get);
+ 
+-static struct nvmem_cell *nvmem_create_cell(struct nvmem_cell_entry *entry, const char *id)
++static struct nvmem_cell *nvmem_create_cell(struct nvmem_cell_entry *entry,
++					    const char *id, int index)
+ {
+ 	struct nvmem_cell *cell;
+ 	const char *name = NULL;
+@@ -1146,6 +1148,7 @@ static struct nvmem_cell *nvmem_create_c
+ 
+ 	cell->id = name;
+ 	cell->entry = entry;
++	cell->index = index;
+ 
+ 	return cell;
+ }
+@@ -1184,7 +1187,7 @@ nvmem_cell_get_from_lookup(struct device
+ 				__nvmem_device_put(nvmem);
+ 				cell = ERR_PTR(-ENOENT);
+ 			} else {
+-				cell = nvmem_create_cell(cell_entry, con_id);
++				cell = nvmem_create_cell(cell_entry, con_id, 0);
+ 				if (IS_ERR(cell))
+ 					__nvmem_device_put(nvmem);
+ 			}
+@@ -1232,15 +1235,27 @@ struct nvmem_cell *of_nvmem_cell_get(str
+ 	struct nvmem_device *nvmem;
+ 	struct nvmem_cell_entry *cell_entry;
+ 	struct nvmem_cell *cell;
++	struct of_phandle_args cell_spec;
+ 	int index = 0;
++	int cell_index = 0;
++	int ret;
+ 
+ 	/* if cell name exists, find index to the name */
+ 	if (id)
+ 		index = of_property_match_string(np, "nvmem-cell-names", id);
+ 
+-	cell_np = of_parse_phandle(np, "nvmem-cells", index);
+-	if (!cell_np)
+-		return ERR_PTR(-ENOENT);
++	ret = of_parse_phandle_with_optional_args(np, "nvmem-cells",
++						  "#nvmem-cell-cells",
++						  index, &cell_spec);
++	if (ret)
++		return ERR_PTR(ret);
++
++	if (cell_spec.args_count > 1)
++		return ERR_PTR(-EINVAL);
++
++	cell_np = cell_spec.np;
++	if (cell_spec.args_count)
++		cell_index = cell_spec.args[0];
+ 
+ 	nvmem_np = of_get_next_parent(cell_np);
+ 	if (!nvmem_np)
+@@ -1257,7 +1272,7 @@ struct nvmem_cell *of_nvmem_cell_get(str
+ 		return ERR_PTR(-ENOENT);
+ 	}
+ 
+-	cell = nvmem_create_cell(cell_entry, id);
++	cell = nvmem_create_cell(cell_entry, id, cell_index);
+ 	if (IS_ERR(cell))
+ 		__nvmem_device_put(nvmem);
+ 
+@@ -1410,8 +1425,8 @@ static void nvmem_shift_read_buffer_in_p
+ }
+ 
+ static int __nvmem_cell_read(struct nvmem_device *nvmem,
+-		      struct nvmem_cell_entry *cell,
+-		      void *buf, size_t *len, const char *id)
++			     struct nvmem_cell_entry *cell,
++			     void *buf, size_t *len, const char *id, int index)
+ {
+ 	int rc;
+ 
+@@ -1425,7 +1440,7 @@ static int __nvmem_cell_read(struct nvme
+ 		nvmem_shift_read_buffer_in_place(cell, buf);
+ 
+ 	if (nvmem->cell_post_process) {
+-		rc = nvmem->cell_post_process(nvmem->priv, id,
++		rc = nvmem->cell_post_process(nvmem->priv, id, index,
+ 					      cell->offset, buf, cell->bytes);
+ 		if (rc)
+ 			return rc;
+@@ -1460,7 +1475,7 @@ void *nvmem_cell_read(struct nvmem_cell
+ 	if (!buf)
+ 		return ERR_PTR(-ENOMEM);
+ 
+-	rc = __nvmem_cell_read(nvmem, cell->entry, buf, len, cell->id);
++	rc = __nvmem_cell_read(nvmem, cell->entry, buf, len, cell->id, cell->index);
+ 	if (rc) {
+ 		kfree(buf);
+ 		return ERR_PTR(rc);
+@@ -1773,7 +1788,7 @@ ssize_t nvmem_device_cell_read(struct nv
+ 	if (rc)
+ 		return rc;
+ 
+-	rc = __nvmem_cell_read(nvmem, &cell, buf, &len, NULL);
++	rc = __nvmem_cell_read(nvmem, &cell, buf, &len, NULL, 0);
+ 	if (rc)
+ 		return rc;
+ 
+--- a/drivers/nvmem/imx-ocotp.c
++++ b/drivers/nvmem/imx-ocotp.c
+@@ -222,8 +222,8 @@ read_end:
+ 	return ret;
+ }
+ 
+-static int imx_ocotp_cell_pp(void *context, const char *id, unsigned int offset,
+-			     void *data, size_t bytes)
++static int imx_ocotp_cell_pp(void *context, const char *id, int index,
++			     unsigned int offset, void *data, size_t bytes)
+ {
+ 	struct ocotp_priv *priv = context;
+ 
+--- a/include/linux/nvmem-provider.h
++++ b/include/linux/nvmem-provider.h
+@@ -20,8 +20,8 @@ typedef int (*nvmem_reg_read_t)(void *pr
+ typedef int (*nvmem_reg_write_t)(void *priv, unsigned int offset,
+ 				 void *val, size_t bytes);
+ /* used for vendor specific post processing of cell data */
+-typedef int (*nvmem_cell_post_process_t)(void *priv, const char *id, unsigned int offset,
+-					  void *buf, size_t bytes);
++typedef int (*nvmem_cell_post_process_t)(void *priv, const char *id, int index,
++					 unsigned int offset, void *buf, size_t bytes);
+ 
+ enum nvmem_type {
+ 	NVMEM_TYPE_UNKNOWN = 0,
diff --git a/target/linux/generic/backport-5.10/813-v6.3-0003-nvmem-core-move-struct-nvmem_cell_info-to-nvmem-prov.patch b/target/linux/generic/backport-5.10/813-v6.3-0003-nvmem-core-move-struct-nvmem_cell_info-to-nvmem-prov.patch
new file mode 100644
index 0000000000..f3829b3e17
--- /dev/null
+++ b/target/linux/generic/backport-5.10/813-v6.3-0003-nvmem-core-move-struct-nvmem_cell_info-to-nvmem-prov.patch
@@ -0,0 +1,78 @@
+From fbd03d27776c6121a483921601418e3c8f0ff37e Mon Sep 17 00:00:00 2001
+From: Michael Walle <michael at walle.cc>
+Date: Mon, 6 Feb 2023 13:43:47 +0000
+Subject: [PATCH] nvmem: core: move struct nvmem_cell_info to nvmem-provider.h
+
+struct nvmem_cell_info is used to describe a cell. Thus this should
+really be in the nvmem-provider's header. There are two (unused) nvmem
+access methods which use the nvmem_cell_info to describe the cell to be
+accesses. One can argue, that they will create a cell before accessing,
+thus they are both a provider and a consumer.
+
+struct nvmem_cell_info will get used more and more by nvmem-providers,
+don't force them to also include the consumer header, although they are
+not.
+
+Signed-off-by: Michael Walle <michael at walle.cc>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-14-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ include/linux/nvmem-consumer.h | 10 +---------
+ include/linux/nvmem-provider.h | 19 ++++++++++++++++++-
+ 2 files changed, 19 insertions(+), 10 deletions(-)
+
+--- a/include/linux/nvmem-consumer.h
++++ b/include/linux/nvmem-consumer.h
+@@ -18,15 +18,7 @@ struct device_node;
+ /* consumer cookie */
+ struct nvmem_cell;
+ struct nvmem_device;
+-
+-struct nvmem_cell_info {
+-	const char		*name;
+-	unsigned int		offset;
+-	unsigned int		bytes;
+-	unsigned int		bit_offset;
+-	unsigned int		nbits;
+-	struct device_node	*np;
+-};
++struct nvmem_cell_info;
+ 
+ /**
+  * struct nvmem_cell_lookup - cell lookup entry
+--- a/include/linux/nvmem-provider.h
++++ b/include/linux/nvmem-provider.h
+@@ -14,7 +14,6 @@
+ #include <linux/gpio/consumer.h>
+ 
+ struct nvmem_device;
+-struct nvmem_cell_info;
+ typedef int (*nvmem_reg_read_t)(void *priv, unsigned int offset,
+ 				void *val, size_t bytes);
+ typedef int (*nvmem_reg_write_t)(void *priv, unsigned int offset,
+@@ -48,6 +47,24 @@ struct nvmem_keepout {
+ };
+ 
+ /**
++ * struct nvmem_cell_info - NVMEM cell description
++ * @name:	Name.
++ * @offset:	Offset within the NVMEM device.
++ * @bytes:	Length of the cell.
++ * @bit_offset:	Bit offset if cell is smaller than a byte.
++ * @nbits:	Number of bits.
++ * @np:		Optional device_node pointer.
++ */
++struct nvmem_cell_info {
++	const char		*name;
++	unsigned int		offset;
++	unsigned int		bytes;
++	unsigned int		bit_offset;
++	unsigned int		nbits;
++	struct device_node	*np;
++};
++
++/**
+  * struct nvmem_config - NVMEM device configuration
+  *
+  * @dev:	Parent device.
diff --git a/target/linux/generic/backport-5.10/813-v6.3-0004-nvmem-core-drop-the-removal-of-the-cells-in-nvmem_ad.patch b/target/linux/generic/backport-5.10/813-v6.3-0004-nvmem-core-drop-the-removal-of-the-cells-in-nvmem_ad.patch
new file mode 100644
index 0000000000..8f996eab34
--- /dev/null
+++ b/target/linux/generic/backport-5.10/813-v6.3-0004-nvmem-core-drop-the-removal-of-the-cells-in-nvmem_ad.patch
@@ -0,0 +1,65 @@
+From cc5bdd323dde6494623f3ffe3a5b887fa21cd375 Mon Sep 17 00:00:00 2001
+From: Michael Walle <michael at walle.cc>
+Date: Mon, 6 Feb 2023 13:43:48 +0000
+Subject: [PATCH] nvmem: core: drop the removal of the cells in
+ nvmem_add_cells()
+
+If nvmem_add_cells() fails, the whole nvmem_register() will fail
+and the cells will then be removed anyway. This is a preparation
+to introduce a nvmem_add_one_cell() which can then be used by
+nvmem_add_cells().
+
+This is then the same to what nvmem_add_cells_from_table() and
+nvmem_add_cells_from_of() do.
+
+Signed-off-by: Michael Walle <michael at walle.cc>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-15-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/core.c | 14 ++++----------
+ 1 file changed, 4 insertions(+), 10 deletions(-)
+
+--- a/drivers/nvmem/core.c
++++ b/drivers/nvmem/core.c
+@@ -515,7 +515,7 @@ static int nvmem_add_cells(struct nvmem_
+ 		    int ncells)
+ {
+ 	struct nvmem_cell_entry **cells;
+-	int i, rval;
++	int i, rval = 0;
+ 
+ 	cells = kcalloc(ncells, sizeof(*cells), GFP_KERNEL);
+ 	if (!cells)
+@@ -525,28 +525,22 @@ static int nvmem_add_cells(struct nvmem_
+ 		cells[i] = kzalloc(sizeof(**cells), GFP_KERNEL);
+ 		if (!cells[i]) {
+ 			rval = -ENOMEM;
+-			goto err;
++			goto out;
+ 		}
+ 
+ 		rval = nvmem_cell_info_to_nvmem_cell_entry(nvmem, &info[i], cells[i]);
+ 		if (rval) {
+ 			kfree(cells[i]);
+-			goto err;
++			goto out;
+ 		}
+ 
+ 		nvmem_cell_entry_add(cells[i]);
+ 	}
+ 
++out:
+ 	/* remove tmp array */
+ 	kfree(cells);
+ 
+-	return 0;
+-err:
+-	while (i--)
+-		nvmem_cell_entry_drop(cells[i]);
+-
+-	kfree(cells);
+-
+ 	return rval;
+ }
+ 
diff --git a/target/linux/generic/backport-5.10/813-v6.3-0005-nvmem-core-add-nvmem_add_one_cell.patch b/target/linux/generic/backport-5.10/813-v6.3-0005-nvmem-core-add-nvmem_add_one_cell.patch
new file mode 100644
index 0000000000..2f3d5bb1f2
--- /dev/null
+++ b/target/linux/generic/backport-5.10/813-v6.3-0005-nvmem-core-add-nvmem_add_one_cell.patch
@@ -0,0 +1,122 @@
+From 2ded6830d376d5e7bf43d59f7f7fdf1a59abc676 Mon Sep 17 00:00:00 2001
+From: Michael Walle <michael at walle.cc>
+Date: Mon, 6 Feb 2023 13:43:49 +0000
+Subject: [PATCH] nvmem: core: add nvmem_add_one_cell()
+
+Add a new function to add exactly one cell. This will be used by the
+nvmem layout drivers to add custom cells. In contrast to the
+nvmem_add_cells(), this has the advantage that we don't have to assemble
+a list of cells on runtime.
+
+Signed-off-by: Michael Walle <michael at walle.cc>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-16-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/core.c           | 59 ++++++++++++++++++++--------------
+ include/linux/nvmem-provider.h |  8 +++++
+ 2 files changed, 43 insertions(+), 24 deletions(-)
+
+--- a/drivers/nvmem/core.c
++++ b/drivers/nvmem/core.c
+@@ -502,6 +502,36 @@ static int nvmem_cell_info_to_nvmem_cell
+ }
+ 
+ /**
++ * nvmem_add_one_cell() - Add one cell information to an nvmem device
++ *
++ * @nvmem: nvmem device to add cells to.
++ * @info: nvmem cell info to add to the device
++ *
++ * Return: 0 or negative error code on failure.
++ */
++int nvmem_add_one_cell(struct nvmem_device *nvmem,
++		       const struct nvmem_cell_info *info)
++{
++	struct nvmem_cell_entry *cell;
++	int rval;
++
++	cell = kzalloc(sizeof(*cell), GFP_KERNEL);
++	if (!cell)
++		return -ENOMEM;
++
++	rval = nvmem_cell_info_to_nvmem_cell_entry(nvmem, info, cell);
++	if (rval) {
++		kfree(cell);
++		return rval;
++	}
++
++	nvmem_cell_entry_add(cell);
++
++	return 0;
++}
++EXPORT_SYMBOL_GPL(nvmem_add_one_cell);
++
++/**
+  * nvmem_add_cells() - Add cell information to an nvmem device
+  *
+  * @nvmem: nvmem device to add cells to.
+@@ -514,34 +544,15 @@ static int nvmem_add_cells(struct nvmem_
+ 		    const struct nvmem_cell_info *info,
+ 		    int ncells)
+ {
+-	struct nvmem_cell_entry **cells;
+-	int i, rval = 0;
+-
+-	cells = kcalloc(ncells, sizeof(*cells), GFP_KERNEL);
+-	if (!cells)
+-		return -ENOMEM;
++	int i, rval;
+ 
+ 	for (i = 0; i < ncells; i++) {
+-		cells[i] = kzalloc(sizeof(**cells), GFP_KERNEL);
+-		if (!cells[i]) {
+-			rval = -ENOMEM;
+-			goto out;
+-		}
+-
+-		rval = nvmem_cell_info_to_nvmem_cell_entry(nvmem, &info[i], cells[i]);
+-		if (rval) {
+-			kfree(cells[i]);
+-			goto out;
+-		}
+-
+-		nvmem_cell_entry_add(cells[i]);
++		rval = nvmem_add_one_cell(nvmem, &info[i]);
++		if (rval)
++			return rval;
+ 	}
+ 
+-out:
+-	/* remove tmp array */
+-	kfree(cells);
+-
+-	return rval;
++	return 0;
+ }
+ 
+ /**
+--- a/include/linux/nvmem-provider.h
++++ b/include/linux/nvmem-provider.h
+@@ -155,6 +155,9 @@ struct nvmem_device *devm_nvmem_register
+ void nvmem_add_cell_table(struct nvmem_cell_table *table);
+ void nvmem_del_cell_table(struct nvmem_cell_table *table);
+ 
++int nvmem_add_one_cell(struct nvmem_device *nvmem,
++		       const struct nvmem_cell_info *info);
++
+ #else
+ 
+ static inline struct nvmem_device *nvmem_register(const struct nvmem_config *c)
+@@ -172,6 +175,11 @@ devm_nvmem_register(struct device *dev,
+ 
+ static inline void nvmem_add_cell_table(struct nvmem_cell_table *table) {}
+ static inline void nvmem_del_cell_table(struct nvmem_cell_table *table) {}
++static inline int nvmem_add_one_cell(struct nvmem_device *nvmem,
++				     const struct nvmem_cell_info *info)
++{
++	return -EOPNOTSUPP;
++}
+ 
+ #endif /* CONFIG_NVMEM */
+ #endif  /* ifndef _LINUX_NVMEM_PROVIDER_H */
diff --git a/target/linux/generic/backport-5.10/813-v6.3-0006-nvmem-core-use-nvmem_add_one_cell-in-nvmem_add_cells.patch b/target/linux/generic/backport-5.10/813-v6.3-0006-nvmem-core-use-nvmem_add_one_cell-in-nvmem_add_cells.patch
new file mode 100644
index 0000000000..e1791e5c83
--- /dev/null
+++ b/target/linux/generic/backport-5.10/813-v6.3-0006-nvmem-core-use-nvmem_add_one_cell-in-nvmem_add_cells.patch
@@ -0,0 +1,93 @@
+From 50014d659617dc58780a5d31ceb76c82779a9d8b Mon Sep 17 00:00:00 2001
+From: Michael Walle <michael at walle.cc>
+Date: Mon, 6 Feb 2023 13:43:50 +0000
+Subject: [PATCH] nvmem: core: use nvmem_add_one_cell() in
+ nvmem_add_cells_from_of()
+
+Convert nvmem_add_cells_from_of() to use the new nvmem_add_one_cell().
+This will remove duplicate code and it will make it possible to add a
+hook to a nvmem layout in between, which can change fields before the
+cell is finally added.
+
+Signed-off-by: Michael Walle <michael at walle.cc>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-17-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/core.c | 45 ++++++++++++++------------------------------
+ 1 file changed, 14 insertions(+), 31 deletions(-)
+
+--- a/drivers/nvmem/core.c
++++ b/drivers/nvmem/core.c
+@@ -688,15 +688,14 @@ static int nvmem_validate_keepouts(struc
+ 
+ static int nvmem_add_cells_from_of(struct nvmem_device *nvmem)
+ {
+-	struct device_node *parent, *child;
+ 	struct device *dev = &nvmem->dev;
+-	struct nvmem_cell_entry *cell;
++	struct device_node *child;
+ 	const __be32 *addr;
+-	int len;
++	int len, ret;
+ 
+-	parent = dev->of_node;
++	for_each_child_of_node(dev->of_node, child) {
++		struct nvmem_cell_info info = {0};
+ 
+-	for_each_child_of_node(parent, child) {
+ 		addr = of_get_property(child, "reg", &len);
+ 		if (!addr)
+ 			continue;
+@@ -706,40 +705,24 @@ static int nvmem_add_cells_from_of(struc
+ 			return -EINVAL;
+ 		}
+ 
+-		cell = kzalloc(sizeof(*cell), GFP_KERNEL);
+-		if (!cell) {
+-			of_node_put(child);
+-			return -ENOMEM;
+-		}
+-
+-		cell->nvmem = nvmem;
+-		cell->offset = be32_to_cpup(addr++);
+-		cell->bytes = be32_to_cpup(addr);
+-		cell->name = kasprintf(GFP_KERNEL, "%pOFn", child);
++		info.offset = be32_to_cpup(addr++);
++		info.bytes = be32_to_cpup(addr);
++		info.name = kasprintf(GFP_KERNEL, "%pOFn", child);
+ 
+ 		addr = of_get_property(child, "bits", &len);
+ 		if (addr && len == (2 * sizeof(u32))) {
+-			cell->bit_offset = be32_to_cpup(addr++);
+-			cell->nbits = be32_to_cpup(addr);
++			info.bit_offset = be32_to_cpup(addr++);
++			info.nbits = be32_to_cpup(addr);
+ 		}
+ 
+-		if (cell->nbits)
+-			cell->bytes = DIV_ROUND_UP(
+-					cell->nbits + cell->bit_offset,
+-					BITS_PER_BYTE);
+-
+-		if (!IS_ALIGNED(cell->offset, nvmem->stride)) {
+-			dev_err(dev, "cell %s unaligned to nvmem stride %d\n",
+-				cell->name, nvmem->stride);
+-			/* Cells already added will be freed later. */
+-			kfree_const(cell->name);
+-			kfree(cell);
++		info.np = of_node_get(child);
++
++		ret = nvmem_add_one_cell(nvmem, &info);
++		kfree(info.name);
++		if (ret) {
+ 			of_node_put(child);
+-			return -EINVAL;
++			return ret;
+ 		}
+-
+-		cell->np = of_node_get(child);
+-		nvmem_cell_entry_add(cell);
+ 	}
+ 
+ 	return 0;
diff --git a/target/linux/generic/backport-5.10/813-v6.3-0007-nvmem-stm32-add-OP-TEE-support-for-STM32MP13x.patch b/target/linux/generic/backport-5.10/813-v6.3-0007-nvmem-stm32-add-OP-TEE-support-for-STM32MP13x.patch
new file mode 100644
index 0000000000..172a78b76a
--- /dev/null
+++ b/target/linux/generic/backport-5.10/813-v6.3-0007-nvmem-stm32-add-OP-TEE-support-for-STM32MP13x.patch
@@ -0,0 +1,562 @@
+From 6a0bc3522e746025e2d9a63ab2cb5d7062c2d39c Mon Sep 17 00:00:00 2001
+From: Patrick Delaunay <patrick.delaunay at foss.st.com>
+Date: Mon, 6 Feb 2023 13:43:51 +0000
+Subject: [PATCH] nvmem: stm32: add OP-TEE support for STM32MP13x
+
+For boot with OP-TEE on STM32MP13, the communication with the secure
+world no more use STMicroelectronics SMC but communication with the
+STM32MP BSEC TA, for data access (read/write) or lock operation:
+- all the request are sent to OP-TEE trusted application,
+- for upper OTP with ECC protection and with word programming only
+  each OTP are permanently locked when programmed to avoid ECC error
+  on the second write operation
+
+Signed-off-by: Patrick Delaunay <patrick.delaunay at foss.st.com>
+Reviewed-by: Etienne Carriere <etienne.carriere at linaro.org>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-18-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/Kconfig               |  11 +
+ drivers/nvmem/Makefile              |   1 +
+ drivers/nvmem/stm32-bsec-optee-ta.c | 298 ++++++++++++++++++++++++++++
+ drivers/nvmem/stm32-bsec-optee-ta.h |  80 ++++++++
+ drivers/nvmem/stm32-romem.c         |  54 ++++-
+ 5 files changed, 441 insertions(+), 3 deletions(-)
+ create mode 100644 drivers/nvmem/stm32-bsec-optee-ta.c
+ create mode 100644 drivers/nvmem/stm32-bsec-optee-ta.h
+
+--- a/drivers/nvmem/Kconfig
++++ b/drivers/nvmem/Kconfig
+@@ -290,9 +290,20 @@ config NVMEM_SPRD_EFUSE
+ 	  This driver can also be built as a module. If so, the module
+ 	  will be called nvmem-sprd-efuse.
+ 
++config NVMEM_STM32_BSEC_OPTEE_TA
++	bool "STM32MP BSEC OP-TEE TA support for nvmem-stm32-romem driver"
++	depends on OPTEE
++	help
++	  Say y here to enable the accesses to STM32MP SoC OTPs by the OP-TEE
++	  trusted application STM32MP BSEC.
++
++	  This library is a used by stm32-romem driver or included in the module
++	  called nvmem-stm32-romem.
++
+ config NVMEM_STM32_ROMEM
+ 	tristate "STMicroelectronics STM32 factory-programmed memory support"
+ 	depends on ARCH_STM32 || COMPILE_TEST
++	imply NVMEM_STM32_BSEC_OPTEE_TA
+ 	help
+ 	  Say y here to enable read-only access for STMicroelectronics STM32
+ 	  factory-programmed memory area.
+--- a/drivers/nvmem/Makefile
++++ b/drivers/nvmem/Makefile
+@@ -61,6 +61,7 @@ obj-$(CONFIG_NVMEM_SPRD_EFUSE)		+= nvmem
+ nvmem_sprd_efuse-y			:= sprd-efuse.o
+ obj-$(CONFIG_NVMEM_STM32_ROMEM)		+= nvmem_stm32_romem.o
+ nvmem_stm32_romem-y 			:= stm32-romem.o
++nvmem_stm32_romem-$(CONFIG_NVMEM_STM32_BSEC_OPTEE_TA) += stm32-bsec-optee-ta.o
+ obj-$(CONFIG_NVMEM_SUNPLUS_OCOTP)	+= nvmem_sunplus_ocotp.o
+ nvmem_sunplus_ocotp-y			:= sunplus-ocotp.o
+ obj-$(CONFIG_NVMEM_SUNXI_SID)		+= nvmem_sunxi_sid.o
+--- /dev/null
++++ b/drivers/nvmem/stm32-bsec-optee-ta.c
+@@ -0,0 +1,298 @@
++// SPDX-License-Identifier: GPL-2.0-or-later
++/*
++ * OP-TEE STM32MP BSEC PTA interface, used by STM32 ROMEM driver
++ *
++ * Copyright (C) 2022, STMicroelectronics - All Rights Reserved
++ */
++
++#include <linux/tee_drv.h>
++
++#include "stm32-bsec-optee-ta.h"
++
++/*
++ * Read OTP memory
++ *
++ * [in]		value[0].a		OTP start offset in byte
++ * [in]		value[0].b		Access type (0:shadow, 1:fuse, 2:lock)
++ * [out]	memref[1].buffer	Output buffer to store read values
++ * [out]	memref[1].size		Size of OTP to be read
++ *
++ * Return codes:
++ * TEE_SUCCESS - Invoke command success
++ * TEE_ERROR_BAD_PARAMETERS - Incorrect input param
++ * TEE_ERROR_ACCESS_DENIED - OTP not accessible by caller
++ */
++#define PTA_BSEC_READ_MEM		0x0
++
++/*
++ * Write OTP memory
++ *
++ * [in]		value[0].a		OTP start offset in byte
++ * [in]		value[0].b		Access type (0:shadow, 1:fuse, 2:lock)
++ * [in]		memref[1].buffer	Input buffer to read values
++ * [in]		memref[1].size		Size of OTP to be written
++ *
++ * Return codes:
++ * TEE_SUCCESS - Invoke command success
++ * TEE_ERROR_BAD_PARAMETERS - Incorrect input param
++ * TEE_ERROR_ACCESS_DENIED - OTP not accessible by caller
++ */
++#define PTA_BSEC_WRITE_MEM		0x1
++
++/* value of PTA_BSEC access type = value[in] b */
++#define SHADOW_ACCESS	0
++#define FUSE_ACCESS	1
++#define LOCK_ACCESS	2
++
++/* Bitfield definition for LOCK status */
++#define LOCK_PERM			BIT(30)
++
++/* OP-TEE STM32MP BSEC TA UUID */
++static const uuid_t stm32mp_bsec_ta_uuid =
++	UUID_INIT(0x94cf71ad, 0x80e6, 0x40b5,
++		  0xa7, 0xc6, 0x3d, 0xc5, 0x01, 0xeb, 0x28, 0x03);
++
++/*
++ * Check whether this driver supports the BSEC TA in the TEE instance
++ * represented by the params (ver/data) to this function.
++ */
++static int stm32_bsec_optee_ta_match(struct tee_ioctl_version_data *ver,
++				     const void *data)
++{
++	/* Currently this driver only supports GP compliant, OP-TEE based TA */
++	if ((ver->impl_id == TEE_IMPL_ID_OPTEE) &&
++		(ver->gen_caps & TEE_GEN_CAP_GP))
++		return 1;
++	else
++		return 0;
++}
++
++/* Open a session to OP-TEE for STM32MP BSEC TA */
++static int stm32_bsec_ta_open_session(struct tee_context *ctx, u32 *id)
++{
++	struct tee_ioctl_open_session_arg sess_arg;
++	int rc;
++
++	memset(&sess_arg, 0, sizeof(sess_arg));
++	export_uuid(sess_arg.uuid, &stm32mp_bsec_ta_uuid);
++	sess_arg.clnt_login = TEE_IOCTL_LOGIN_REE_KERNEL;
++	sess_arg.num_params = 0;
++
++	rc = tee_client_open_session(ctx, &sess_arg, NULL);
++	if ((rc < 0) || (sess_arg.ret != 0)) {
++		pr_err("%s: tee_client_open_session failed err:%#x, ret:%#x\n",
++		       __func__, sess_arg.ret, rc);
++		if (!rc)
++			rc = -EINVAL;
++	} else {
++		*id = sess_arg.session;
++	}
++
++	return rc;
++}
++
++/* close a session to OP-TEE for STM32MP BSEC TA */
++static void stm32_bsec_ta_close_session(void *ctx, u32 id)
++{
++	tee_client_close_session(ctx, id);
++}
++
++/* stm32_bsec_optee_ta_open() - initialize the STM32MP BSEC TA */
++int stm32_bsec_optee_ta_open(struct tee_context **ctx)
++{
++	struct tee_context *tee_ctx;
++	u32 session_id;
++	int rc;
++
++	/* Open context with TEE driver */
++	tee_ctx = tee_client_open_context(NULL, stm32_bsec_optee_ta_match, NULL, NULL);
++	if (IS_ERR(tee_ctx)) {
++		rc = PTR_ERR(tee_ctx);
++		if (rc == -ENOENT)
++			return -EPROBE_DEFER;
++		pr_err("%s: tee_client_open_context failed (%d)\n", __func__, rc);
++
++		return rc;
++	}
++
++	/* Check STM32MP BSEC TA presence */
++	rc = stm32_bsec_ta_open_session(tee_ctx, &session_id);
++	if (rc) {
++		tee_client_close_context(tee_ctx);
++		return rc;
++	}
++
++	stm32_bsec_ta_close_session(tee_ctx, session_id);
++
++	*ctx = tee_ctx;
++
++	return 0;
++}
++
++/* stm32_bsec_optee_ta_open() - release the PTA STM32MP BSEC TA */
++void stm32_bsec_optee_ta_close(void *ctx)
++{
++	tee_client_close_context(ctx);
++}
++
++/* stm32_bsec_optee_ta_read() - nvmem read access using PTA client driver */
++int stm32_bsec_optee_ta_read(struct tee_context *ctx, unsigned int offset,
++			     void *buf, size_t bytes)
++{
++	struct tee_shm *shm;
++	struct tee_ioctl_invoke_arg arg;
++	struct tee_param param[2];
++	u8 *shm_buf;
++	u32 start, num_bytes;
++	int ret;
++	u32 session_id;
++
++	ret = stm32_bsec_ta_open_session(ctx, &session_id);
++	if (ret)
++		return ret;
++
++	memset(&arg, 0, sizeof(arg));
++	memset(&param, 0, sizeof(param));
++
++	arg.func = PTA_BSEC_READ_MEM;
++	arg.session = session_id;
++	arg.num_params = 2;
++
++	/* align access on 32bits */
++	start = ALIGN_DOWN(offset, 4);
++	num_bytes = round_up(offset + bytes - start, 4);
++	param[0].attr = TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT;
++	param[0].u.value.a = start;
++	param[0].u.value.b = SHADOW_ACCESS;
++
++	shm = tee_shm_alloc_kernel_buf(ctx, num_bytes);
++	if (IS_ERR(shm)) {
++		ret = PTR_ERR(shm);
++		goto out_tee_session;
++	}
++
++	param[1].attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT;
++	param[1].u.memref.shm = shm;
++	param[1].u.memref.size = num_bytes;
++
++	ret = tee_client_invoke_func(ctx, &arg, param);
++	if (ret < 0 || arg.ret != 0) {
++		pr_err("TA_BSEC invoke failed TEE err:%#x, ret:%#x\n",
++			arg.ret, ret);
++		if (!ret)
++			ret = -EIO;
++	}
++	if (!ret) {
++		shm_buf = tee_shm_get_va(shm, 0);
++		if (IS_ERR(shm_buf)) {
++			ret = PTR_ERR(shm_buf);
++			pr_err("tee_shm_get_va failed for transmit (%d)\n", ret);
++		} else {
++			/* read data from 32 bits aligned buffer */
++			memcpy(buf, &shm_buf[offset % 4], bytes);
++		}
++	}
++
++	tee_shm_free(shm);
++
++out_tee_session:
++	stm32_bsec_ta_close_session(ctx, session_id);
++
++	return ret;
++}
++
++/* stm32_bsec_optee_ta_write() - nvmem write access using PTA client driver */
++int stm32_bsec_optee_ta_write(struct tee_context *ctx, unsigned int lower,
++			      unsigned int offset, void *buf, size_t bytes)
++{	struct tee_shm *shm;
++	struct tee_ioctl_invoke_arg arg;
++	struct tee_param param[2];
++	u8 *shm_buf;
++	int ret;
++	u32 session_id;
++
++	ret = stm32_bsec_ta_open_session(ctx, &session_id);
++	if (ret)
++		return ret;
++
++	/* Allow only writing complete 32-bits aligned words */
++	if ((bytes % 4) || (offset % 4))
++		return -EINVAL;
++
++	memset(&arg, 0, sizeof(arg));
++	memset(&param, 0, sizeof(param));
++
++	arg.func = PTA_BSEC_WRITE_MEM;
++	arg.session = session_id;
++	arg.num_params = 2;
++
++	param[0].attr = TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT;
++	param[0].u.value.a = offset;
++	param[0].u.value.b = FUSE_ACCESS;
++
++	shm = tee_shm_alloc_kernel_buf(ctx, bytes);
++	if (IS_ERR(shm)) {
++		ret = PTR_ERR(shm);
++		goto out_tee_session;
++	}
++
++	param[1].attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT;
++	param[1].u.memref.shm = shm;
++	param[1].u.memref.size = bytes;
++
++	shm_buf = tee_shm_get_va(shm, 0);
++	if (IS_ERR(shm_buf)) {
++		ret = PTR_ERR(shm_buf);
++		pr_err("tee_shm_get_va failed for transmit (%d)\n", ret);
++		tee_shm_free(shm);
++
++		goto out_tee_session;
++	}
++
++	memcpy(shm_buf, buf, bytes);
++
++	ret = tee_client_invoke_func(ctx, &arg, param);
++	if (ret < 0 || arg.ret != 0) {
++		pr_err("TA_BSEC invoke failed TEE err:%#x, ret:%#x\n", arg.ret, ret);
++		if (!ret)
++			ret = -EIO;
++	}
++	pr_debug("Write OTPs %d to %zu, ret=%d\n", offset / 4, (offset + bytes) / 4, ret);
++
++	/* Lock the upper OTPs with ECC protection, word programming only */
++	if (!ret && ((offset + bytes) >= (lower * 4))) {
++		u32 start, nb_lock;
++		u32 *lock = (u32 *)shm_buf;
++		int i;
++
++		/*
++		 * don't lock the lower OTPs, no ECC protection and incremental
++		 * bit programming, a second write is allowed
++		 */
++		start = max_t(u32, offset, lower * 4);
++		nb_lock = (offset + bytes - start) / 4;
++
++		param[0].u.value.a = start;
++		param[0].u.value.b = LOCK_ACCESS;
++		param[1].u.memref.size = nb_lock * 4;
++
++		for (i = 0; i < nb_lock; i++)
++			lock[i] = LOCK_PERM;
++
++		ret = tee_client_invoke_func(ctx, &arg, param);
++		if (ret < 0 || arg.ret != 0) {
++			pr_err("TA_BSEC invoke failed TEE err:%#x, ret:%#x\n", arg.ret, ret);
++			if (!ret)
++				ret = -EIO;
++		}
++		pr_debug("Lock upper OTPs %d to %d, ret=%d\n",
++			 start / 4, start / 4 + nb_lock, ret);
++	}
++
++	tee_shm_free(shm);
++
++out_tee_session:
++	stm32_bsec_ta_close_session(ctx, session_id);
++
++	return ret;
++}
+--- /dev/null
++++ b/drivers/nvmem/stm32-bsec-optee-ta.h
+@@ -0,0 +1,80 @@
++/* SPDX-License-Identifier: GPL-2.0-or-later */
++/*
++ * OP-TEE STM32MP BSEC PTA interface, used by STM32 ROMEM driver
++ *
++ * Copyright (C) 2022, STMicroelectronics - All Rights Reserved
++ */
++
++#if IS_ENABLED(CONFIG_NVMEM_STM32_BSEC_OPTEE_TA)
++/**
++ * stm32_bsec_optee_ta_open() - initialize the STM32 BSEC TA
++ * @ctx: the OP-TEE context on success
++ *
++ * Return:
++ *	On success, 0. On failure, -errno.
++ */
++int stm32_bsec_optee_ta_open(struct tee_context **ctx);
++
++/**
++ * stm32_bsec_optee_ta_close() - release the STM32 BSEC TA
++ * @ctx: the OP-TEE context
++ *
++ * This function used to clean the OP-TEE resources initialized in
++ * stm32_bsec_optee_ta_open(); it can be used as callback to
++ * devm_add_action_or_reset()
++ */
++void stm32_bsec_optee_ta_close(void *ctx);
++
++/**
++ * stm32_bsec_optee_ta_read() - nvmem read access using TA client driver
++ * @ctx: the OP-TEE context provided by stm32_bsec_optee_ta_open
++ * @offset: nvmem offset
++ * @buf: buffer to fill with nvem values
++ * @bytes: number of bytes to read
++ *
++ * Return:
++ *	On success, 0. On failure, -errno.
++ */
++int stm32_bsec_optee_ta_read(struct tee_context *ctx, unsigned int offset,
++			     void *buf, size_t bytes);
++
++/**
++ * stm32_bsec_optee_ta_write() - nvmem write access using TA client driver
++ * @ctx: the OP-TEE context provided by stm32_bsec_optee_ta_open
++ * @lower: number of lower OTP, not protected by ECC
++ * @offset: nvmem offset
++ * @buf: buffer with nvem values
++ * @bytes: number of bytes to write
++ *
++ * Return:
++ *	On success, 0. On failure, -errno.
++ */
++int stm32_bsec_optee_ta_write(struct tee_context *ctx, unsigned int lower,
++			      unsigned int offset, void *buf, size_t bytes);
++
++#else
++
++static inline int stm32_bsec_optee_ta_open(struct tee_context **ctx)
++{
++	return -EOPNOTSUPP;
++}
++
++static inline void stm32_bsec_optee_ta_close(void *ctx)
++{
++}
++
++static inline int stm32_bsec_optee_ta_read(struct tee_context *ctx,
++					   unsigned int offset, void *buf,
++					   size_t bytes)
++{
++	return -EOPNOTSUPP;
++}
++
++static inline int stm32_bsec_optee_ta_write(struct tee_context *ctx,
++					    unsigned int lower,
++					    unsigned int offset, void *buf,
++					    size_t bytes)
++{
++	return -EOPNOTSUPP;
++}
++#endif /* CONFIG_NVMEM_STM32_BSEC_OPTEE_TA */
+--- a/drivers/nvmem/stm32-romem.c
++++ b/drivers/nvmem/stm32-romem.c
+@@ -11,6 +11,9 @@
+ #include <linux/module.h>
+ #include <linux/nvmem-provider.h>
+ #include <linux/of_device.h>
++#include <linux/tee_drv.h>
++
++#include "stm32-bsec-optee-ta.h"
+ 
+ /* BSEC secure service access from non-secure */
+ #define STM32_SMC_BSEC			0x82001003
+@@ -25,12 +28,14 @@
+ struct stm32_romem_cfg {
+ 	int size;
+ 	u8 lower;
++	bool ta;
+ };
+ 
+ struct stm32_romem_priv {
+ 	void __iomem *base;
+ 	struct nvmem_config cfg;
+ 	u8 lower;
++	struct tee_context *ctx;
+ };
+ 
+ static int stm32_romem_read(void *context, unsigned int offset, void *buf,
+@@ -138,12 +143,29 @@ static int stm32_bsec_write(void *contex
+ 	return 0;
+ }
+ 
++static int stm32_bsec_pta_read(void *context, unsigned int offset, void *buf,
++			       size_t bytes)
++{
++	struct stm32_romem_priv *priv = context;
++
++	return stm32_bsec_optee_ta_read(priv->ctx, offset, buf, bytes);
++}
++
++static int stm32_bsec_pta_write(void *context, unsigned int offset, void *buf,
++				size_t bytes)
++{
++	struct stm32_romem_priv *priv = context;
++
++	return stm32_bsec_optee_ta_write(priv->ctx, priv->lower, offset, buf, bytes);
++}
++
+ static int stm32_romem_probe(struct platform_device *pdev)
+ {
+ 	const struct stm32_romem_cfg *cfg;
+ 	struct device *dev = &pdev->dev;
+ 	struct stm32_romem_priv *priv;
+ 	struct resource *res;
++	int rc;
+ 
+ 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+ 	if (!priv)
+@@ -173,15 +195,31 @@ static int stm32_romem_probe(struct plat
+ 	} else {
+ 		priv->cfg.size = cfg->size;
+ 		priv->lower = cfg->lower;
+-		priv->cfg.reg_read = stm32_bsec_read;
+-		priv->cfg.reg_write = stm32_bsec_write;
++		if (cfg->ta) {
++			rc = stm32_bsec_optee_ta_open(&priv->ctx);
++			/* wait for OP-TEE client driver to be up and ready */
++			if (rc)
++				return rc;
++		}
++		if (priv->ctx) {
++			rc = devm_add_action_or_reset(dev, stm32_bsec_optee_ta_close, priv->ctx);
++			if (rc) {
++				dev_err(dev, "devm_add_action_or_reset() failed (%d)\n", rc);
++				return rc;
++			}
++			priv->cfg.reg_read = stm32_bsec_pta_read;
++			priv->cfg.reg_write = stm32_bsec_pta_write;
++		} else {
++			priv->cfg.reg_read = stm32_bsec_read;
++			priv->cfg.reg_write = stm32_bsec_write;
++		}
+ 	}
+ 
+ 	return PTR_ERR_OR_ZERO(devm_nvmem_register(dev, &priv->cfg));
+ }
+ 
+ /*
+- * STM32MP15 BSEC OTP regions: 4096 OTP bits (with 3072 effective bits)
++ * STM32MP15/13 BSEC OTP regions: 4096 OTP bits (with 3072 effective bits)
+  * => 96 x 32-bits data words
+  * - Lower: 1K bits, 2:1 redundancy, incremental bit programming
+  *   => 32 (x 32-bits) lower shadow registers = words 0 to 31
+@@ -191,6 +229,13 @@ static int stm32_romem_probe(struct plat
+ static const struct stm32_romem_cfg stm32mp15_bsec_cfg = {
+ 	.size = 384,
+ 	.lower = 32,
++	.ta = false,
++};
++
++static const struct stm32_romem_cfg stm32mp13_bsec_cfg = {
++	.size = 384,
++	.lower = 32,
++	.ta = true,
+ };
+ 
+ static const struct of_device_id stm32_romem_of_match[] = {
+@@ -198,7 +243,10 @@ static const struct of_device_id stm32_r
+ 		.compatible = "st,stm32mp15-bsec",
+ 		.data = (void *)&stm32mp15_bsec_cfg,
+ 	}, {
++		.compatible = "st,stm32mp13-bsec",
++		.data = (void *)&stm32mp13_bsec_cfg,
+ 	},
++	{ /* sentinel */ },
+ };
+ MODULE_DEVICE_TABLE(of, stm32_romem_of_match);
+ 
diff --git a/target/linux/generic/backport-5.10/813-v6.3-0008-nvmem-stm32-detect-bsec-pta-presence-for-STM32MP15x.patch b/target/linux/generic/backport-5.10/813-v6.3-0008-nvmem-stm32-detect-bsec-pta-presence-for-STM32MP15x.patch
new file mode 100644
index 0000000000..cea8e93858
--- /dev/null
+++ b/target/linux/generic/backport-5.10/813-v6.3-0008-nvmem-stm32-detect-bsec-pta-presence-for-STM32MP15x.patch
@@ -0,0 +1,85 @@
+From df2f34ef1d924125ffaf29dfdaf7cdbd3183c321 Mon Sep 17 00:00:00 2001
+From: Patrick Delaunay <patrick.delaunay at foss.st.com>
+Date: Mon, 6 Feb 2023 13:43:52 +0000
+Subject: [PATCH] nvmem: stm32: detect bsec pta presence for STM32MP15x
+
+On STM32MP15x SoC, the SMC backend is optional when OP-TEE is used;
+the PTA BSEC should be used as it is done on STM32MP13x platform,
+but the BSEC SMC can be also used: it is a legacy mode in OP-TEE,
+not recommended but used in previous OP-TEE firmware.
+
+The presence of OP-TEE is dynamically detected in STM32MP15x device tree
+and the supported NVMEM backend is dynamically detected:
+- PTA with stm32_bsec_pta_find
+- SMC with stm32_bsec_check
+
+With OP-TEE but without PTA and SMC detection, the probe is deferred for
+STM32MP15x devices.
+
+On STM32MP13x platform, only the PTA is supported with cfg->ta = true
+and this detection is skipped.
+
+Signed-off-by: Patrick Delaunay <patrick.delaunay at foss.st.com>
+Reviewed-by: Etienne Carriere <etienne.carriere at linaro.org>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-19-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/stm32-romem.c | 38 +++++++++++++++++++++++++++++++++----
+ 1 file changed, 34 insertions(+), 4 deletions(-)
+
+--- a/drivers/nvmem/stm32-romem.c
++++ b/drivers/nvmem/stm32-romem.c
+@@ -159,6 +159,31 @@ static int stm32_bsec_pta_write(void *co
+ 	return stm32_bsec_optee_ta_write(priv->ctx, priv->lower, offset, buf, bytes);
+ }
+ 
++static bool stm32_bsec_smc_check(void)
++{
++	u32 val;
++	int ret;
++
++	/* check that the OP-TEE support the BSEC SMC (legacy mode) */
++	ret = stm32_bsec_smc(STM32_SMC_READ_SHADOW, 0, 0, &val);
++
++	return !ret;
++}
++
++static bool optee_presence_check(void)
++{
++	struct device_node *np;
++	bool tee_detected = false;
++
++	/* check that the OP-TEE node is present and available. */
++	np = of_find_compatible_node(NULL, NULL, "linaro,optee-tz");
++	if (np && of_device_is_available(np))
++		tee_detected = true;
++	of_node_put(np);
++
++	return tee_detected;
++}
++
+ static int stm32_romem_probe(struct platform_device *pdev)
+ {
+ 	const struct stm32_romem_cfg *cfg;
+@@ -195,11 +220,16 @@ static int stm32_romem_probe(struct plat
+ 	} else {
+ 		priv->cfg.size = cfg->size;
+ 		priv->lower = cfg->lower;
+-		if (cfg->ta) {
++		if (cfg->ta || optee_presence_check()) {
+ 			rc = stm32_bsec_optee_ta_open(&priv->ctx);
+-			/* wait for OP-TEE client driver to be up and ready */
+-			if (rc)
+-				return rc;
++			if (rc) {
++				/* wait for OP-TEE client driver to be up and ready */
++				if (rc == -EPROBE_DEFER)
++					return -EPROBE_DEFER;
++				/* BSEC PTA is required or SMC not supported */
++				if (cfg->ta || !stm32_bsec_smc_check())
++					return rc;
++			}
+ 		}
+ 		if (priv->ctx) {
+ 			rc = devm_add_action_or_reset(dev, stm32_bsec_optee_ta_close, priv->ctx);
diff --git a/target/linux/generic/backport-5.10/813-v6.3-0009-nvmem-rave-sp-eeprm-fix-kernel-doc-bad-line-warning.patch b/target/linux/generic/backport-5.10/813-v6.3-0009-nvmem-rave-sp-eeprm-fix-kernel-doc-bad-line-warning.patch
new file mode 100644
index 0000000000..9d6275a737
--- /dev/null
+++ b/target/linux/generic/backport-5.10/813-v6.3-0009-nvmem-rave-sp-eeprm-fix-kernel-doc-bad-line-warning.patch
@@ -0,0 +1,32 @@
+From 3e5ac22aa564026e99defc3a8e02082521a5b231 Mon Sep 17 00:00:00 2001
+From: Randy Dunlap <rdunlap at infradead.org>
+Date: Mon, 6 Feb 2023 13:43:53 +0000
+Subject: [PATCH] nvmem: rave-sp-eeprm: fix kernel-doc bad line warning
+
+Convert an empty line to " *" to avoid a kernel-doc warning:
+
+drivers/nvmem/rave-sp-eeprom.c:48: warning: bad line:
+
+Signed-off-by: Randy Dunlap <rdunlap at infradead.org>
+Cc: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Cc: Andrey Vostrikov <andrey.vostrikov at cogentembedded.com>
+Cc: Nikita Yushchenko <nikita.yoush at cogentembedded.com>
+Cc: Andrey Smirnov <andrew.smirnov at gmail.com>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-20-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/rave-sp-eeprom.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/nvmem/rave-sp-eeprom.c
++++ b/drivers/nvmem/rave-sp-eeprom.c
+@@ -45,7 +45,7 @@ enum rave_sp_eeprom_header_size {
+  * @type:	Access type (see enum rave_sp_eeprom_access_type)
+  * @success:	Success flag (Success = 1, Failure = 0)
+  * @data:	Read data
+-
++ *
+  * Note this structure corresponds to RSP_*_EEPROM payload from RAVE
+  * SP ICD
+  */
diff --git a/target/linux/generic/backport-5.10/813-v6.3-0010-nvmem-qcom-spmi-sdam-register-at-device-init-time.patch b/target/linux/generic/backport-5.10/813-v6.3-0010-nvmem-qcom-spmi-sdam-register-at-device-init-time.patch
new file mode 100644
index 0000000000..1ab9e609d3
--- /dev/null
+++ b/target/linux/generic/backport-5.10/813-v6.3-0010-nvmem-qcom-spmi-sdam-register-at-device-init-time.patch
@@ -0,0 +1,43 @@
+From eb7dda20f42a9137e9ee53d5ed3b743d49338cb5 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan+linaro at kernel.org>
+Date: Mon, 6 Feb 2023 13:43:54 +0000
+Subject: [PATCH] nvmem: qcom-spmi-sdam: register at device init time
+
+There are currently no in-tree users of the Qualcomm SDAM nvmem driver
+and there is generally no point in registering a driver that can be
+built as a module at subsys init time.
+
+Register the driver at the normal device init time instead and let
+driver core sort out the probe order.
+
+Signed-off-by: Johan Hovold <johan+linaro at kernel.org>
+Reviewed-by: Bjorn Andersson <andersson at kernel.org>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-21-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/qcom-spmi-sdam.c | 13 +------------
+ 1 file changed, 1 insertion(+), 12 deletions(-)
+
+--- a/drivers/nvmem/qcom-spmi-sdam.c
++++ b/drivers/nvmem/qcom-spmi-sdam.c
+@@ -175,18 +175,7 @@ static struct platform_driver sdam_drive
+ 	},
+ 	.probe		= sdam_probe,
+ };
+-
+-static int __init sdam_init(void)
+-{
+-	return platform_driver_register(&sdam_driver);
+-}
+-subsys_initcall(sdam_init);
+-
+-static void __exit sdam_exit(void)
+-{
+-	return platform_driver_unregister(&sdam_driver);
+-}
+-module_exit(sdam_exit);
++module_platform_driver(sdam_driver);
+ 
+ MODULE_DESCRIPTION("QCOM SPMI SDAM driver");
+ MODULE_LICENSE("GPL v2");
diff --git a/target/linux/generic/backport-5.10/813-v6.3-0011-nvmem-stm32-fix-OPTEE-dependency.patch b/target/linux/generic/backport-5.10/813-v6.3-0011-nvmem-stm32-fix-OPTEE-dependency.patch
new file mode 100644
index 0000000000..dcf704c6ff
--- /dev/null
+++ b/target/linux/generic/backport-5.10/813-v6.3-0011-nvmem-stm32-fix-OPTEE-dependency.patch
@@ -0,0 +1,46 @@
+From 1dc7e37bb0ec1c997fac82031332a38c7610352f Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd at arndb.de>
+Date: Mon, 6 Feb 2023 13:43:56 +0000
+Subject: [PATCH] nvmem: stm32: fix OPTEE dependency
+
+The stm32 nvmem driver fails to link as built-in when OPTEE
+is a loadable module:
+
+aarch64-linux-ld: drivers/nvmem/stm32-bsec-optee-ta.o: in function `stm32_bsec:
+stm32-bsec-optee-ta.c:(.text+0xc8): undefined reference to `tee_client_open_session'
+aarch64-linux-ld: drivers/nvmem/stm32-bsec-optee-ta.o: in function `stm32_bsec:
+stm32-bsec-optee-ta.c:(.text+0x1fc): undefined reference to `tee_client_open_context'
+
+Change the CONFIG_NVMEM_STM32_ROMEM definition so it can only
+be built-in if OPTEE is either built-in or disabled, and
+make NVMEM_STM32_BSEC_OPTEE_TA a hidden symbol instead.
+
+Signed-off-by: Arnd Bergmann <arnd at arndb.de>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-23-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/Kconfig | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+--- a/drivers/nvmem/Kconfig
++++ b/drivers/nvmem/Kconfig
+@@ -291,8 +291,7 @@ config NVMEM_SPRD_EFUSE
+ 	  will be called nvmem-sprd-efuse.
+ 
+ config NVMEM_STM32_BSEC_OPTEE_TA
+-	bool "STM32MP BSEC OP-TEE TA support for nvmem-stm32-romem driver"
+-	depends on OPTEE
++	def_bool NVMEM_STM32_ROMEM && OPTEE
+ 	help
+ 	  Say y here to enable the accesses to STM32MP SoC OTPs by the OP-TEE
+ 	  trusted application STM32MP BSEC.
+@@ -303,7 +302,7 @@ config NVMEM_STM32_BSEC_OPTEE_TA
+ config NVMEM_STM32_ROMEM
+ 	tristate "STMicroelectronics STM32 factory-programmed memory support"
+ 	depends on ARCH_STM32 || COMPILE_TEST
+-	imply NVMEM_STM32_BSEC_OPTEE_TA
++	depends on OPTEE || !OPTEE
+ 	help
+ 	  Say y here to enable read-only access for STMicroelectronics STM32
+ 	  factory-programmed memory area.
diff --git a/target/linux/generic/backport-5.15/809-v6.3-0001-nvmem-core-remove-spurious-white-space.patch b/target/linux/generic/backport-5.15/809-v6.3-0001-nvmem-core-remove-spurious-white-space.patch
new file mode 100644
index 0000000000..01400fd490
--- /dev/null
+++ b/target/linux/generic/backport-5.15/809-v6.3-0001-nvmem-core-remove-spurious-white-space.patch
@@ -0,0 +1,26 @@
+From 2e8dc541ae207349b51c65391be625ffe1f86e0c Mon Sep 17 00:00:00 2001
+From: "Russell King (Oracle)" <rmk+kernel at armlinux.org.uk>
+Date: Mon, 6 Feb 2023 13:43:41 +0000
+Subject: [PATCH] nvmem: core: remove spurious white space
+
+Remove a spurious white space in for the ida_alloc() call.
+
+Signed-off-by: Russell King (Oracle) <rmk+kernel at armlinux.org.uk>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-8-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/nvmem/core.c
++++ b/drivers/nvmem/core.c
+@@ -764,7 +764,7 @@ struct nvmem_device *nvmem_register(cons
+ 	if (!nvmem)
+ 		return ERR_PTR(-ENOMEM);
+ 
+-	rval  = ida_alloc(&nvmem_ida, GFP_KERNEL);
++	rval = ida_alloc(&nvmem_ida, GFP_KERNEL);
+ 	if (rval < 0) {
+ 		kfree(nvmem);
+ 		return ERR_PTR(rval);
diff --git a/target/linux/generic/backport-5.15/809-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch b/target/linux/generic/backport-5.15/809-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch
new file mode 100644
index 0000000000..d6b3057e48
--- /dev/null
+++ b/target/linux/generic/backport-5.15/809-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch
@@ -0,0 +1,180 @@
+From 5d8e6e6c10a3d37486d263b16ddc15991a7e4a88 Mon Sep 17 00:00:00 2001
+From: Michael Walle <michael at walle.cc>
+Date: Mon, 6 Feb 2023 13:43:46 +0000
+Subject: [PATCH] nvmem: core: add an index parameter to the cell
+
+Sometimes a cell can represend multiple values. For example, a base
+ethernet address stored in the NVMEM can be expanded into multiple
+discreet ones by adding an offset.
+
+For this use case, introduce an index parameter which is then used to
+distiguish between values. This parameter will then be passed to the
+post process hook which can then use it to create different values
+during reading.
+
+At the moment, there is only support for the device tree path. You can
+add the index to the phandle, e.g.
+
+  &net {
+          nvmem-cells = <&base_mac_address 2>;
+          nvmem-cell-names = "mac-address";
+  };
+
+  &nvmem_provider {
+          base_mac_address: base-mac-address at 0 {
+                  #nvmem-cell-cells = <1>;
+                  reg = <0 6>;
+          };
+  };
+
+Signed-off-by: Michael Walle <michael at walle.cc>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-13-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/core.c           | 37 ++++++++++++++++++++++++----------
+ drivers/nvmem/imx-ocotp.c      |  4 ++--
+ include/linux/nvmem-provider.h |  4 ++--
+ 3 files changed, 30 insertions(+), 15 deletions(-)
+
+--- a/drivers/nvmem/core.c
++++ b/drivers/nvmem/core.c
+@@ -60,6 +60,7 @@ struct nvmem_cell_entry {
+ struct nvmem_cell {
+ 	struct nvmem_cell_entry *entry;
+ 	const char		*id;
++	int			index;
+ };
+ 
+ static DEFINE_MUTEX(nvmem_mutex);
+@@ -1125,7 +1126,8 @@ struct nvmem_device *devm_nvmem_device_g
+ }
+ EXPORT_SYMBOL_GPL(devm_nvmem_device_get);
+ 
+-static struct nvmem_cell *nvmem_create_cell(struct nvmem_cell_entry *entry, const char *id)
++static struct nvmem_cell *nvmem_create_cell(struct nvmem_cell_entry *entry,
++					    const char *id, int index)
+ {
+ 	struct nvmem_cell *cell;
+ 	const char *name = NULL;
+@@ -1144,6 +1146,7 @@ static struct nvmem_cell *nvmem_create_c
+ 
+ 	cell->id = name;
+ 	cell->entry = entry;
++	cell->index = index;
+ 
+ 	return cell;
+ }
+@@ -1182,7 +1185,7 @@ nvmem_cell_get_from_lookup(struct device
+ 				__nvmem_device_put(nvmem);
+ 				cell = ERR_PTR(-ENOENT);
+ 			} else {
+-				cell = nvmem_create_cell(cell_entry, con_id);
++				cell = nvmem_create_cell(cell_entry, con_id, 0);
+ 				if (IS_ERR(cell))
+ 					__nvmem_device_put(nvmem);
+ 			}
+@@ -1230,15 +1233,27 @@ struct nvmem_cell *of_nvmem_cell_get(str
+ 	struct nvmem_device *nvmem;
+ 	struct nvmem_cell_entry *cell_entry;
+ 	struct nvmem_cell *cell;
++	struct of_phandle_args cell_spec;
+ 	int index = 0;
++	int cell_index = 0;
++	int ret;
+ 
+ 	/* if cell name exists, find index to the name */
+ 	if (id)
+ 		index = of_property_match_string(np, "nvmem-cell-names", id);
+ 
+-	cell_np = of_parse_phandle(np, "nvmem-cells", index);
+-	if (!cell_np)
+-		return ERR_PTR(-ENOENT);
++	ret = of_parse_phandle_with_optional_args(np, "nvmem-cells",
++						  "#nvmem-cell-cells",
++						  index, &cell_spec);
++	if (ret)
++		return ERR_PTR(ret);
++
++	if (cell_spec.args_count > 1)
++		return ERR_PTR(-EINVAL);
++
++	cell_np = cell_spec.np;
++	if (cell_spec.args_count)
++		cell_index = cell_spec.args[0];
+ 
+ 	nvmem_np = of_get_next_parent(cell_np);
+ 	if (!nvmem_np)
+@@ -1255,7 +1270,7 @@ struct nvmem_cell *of_nvmem_cell_get(str
+ 		return ERR_PTR(-ENOENT);
+ 	}
+ 
+-	cell = nvmem_create_cell(cell_entry, id);
++	cell = nvmem_create_cell(cell_entry, id, cell_index);
+ 	if (IS_ERR(cell))
+ 		__nvmem_device_put(nvmem);
+ 
+@@ -1408,8 +1423,8 @@ static void nvmem_shift_read_buffer_in_p
+ }
+ 
+ static int __nvmem_cell_read(struct nvmem_device *nvmem,
+-		      struct nvmem_cell_entry *cell,
+-		      void *buf, size_t *len, const char *id)
++			     struct nvmem_cell_entry *cell,
++			     void *buf, size_t *len, const char *id, int index)
+ {
+ 	int rc;
+ 
+@@ -1423,7 +1438,7 @@ static int __nvmem_cell_read(struct nvme
+ 		nvmem_shift_read_buffer_in_place(cell, buf);
+ 
+ 	if (nvmem->cell_post_process) {
+-		rc = nvmem->cell_post_process(nvmem->priv, id,
++		rc = nvmem->cell_post_process(nvmem->priv, id, index,
+ 					      cell->offset, buf, cell->bytes);
+ 		if (rc)
+ 			return rc;
+@@ -1458,7 +1473,7 @@ void *nvmem_cell_read(struct nvmem_cell
+ 	if (!buf)
+ 		return ERR_PTR(-ENOMEM);
+ 
+-	rc = __nvmem_cell_read(nvmem, cell->entry, buf, len, cell->id);
++	rc = __nvmem_cell_read(nvmem, cell->entry, buf, len, cell->id, cell->index);
+ 	if (rc) {
+ 		kfree(buf);
+ 		return ERR_PTR(rc);
+@@ -1771,7 +1786,7 @@ ssize_t nvmem_device_cell_read(struct nv
+ 	if (rc)
+ 		return rc;
+ 
+-	rc = __nvmem_cell_read(nvmem, &cell, buf, &len, NULL);
++	rc = __nvmem_cell_read(nvmem, &cell, buf, &len, NULL, 0);
+ 	if (rc)
+ 		return rc;
+ 
+--- a/drivers/nvmem/imx-ocotp.c
++++ b/drivers/nvmem/imx-ocotp.c
+@@ -222,8 +222,8 @@ read_end:
+ 	return ret;
+ }
+ 
+-static int imx_ocotp_cell_pp(void *context, const char *id, unsigned int offset,
+-			     void *data, size_t bytes)
++static int imx_ocotp_cell_pp(void *context, const char *id, int index,
++			     unsigned int offset, void *data, size_t bytes)
+ {
+ 	struct ocotp_priv *priv = context;
+ 
+--- a/include/linux/nvmem-provider.h
++++ b/include/linux/nvmem-provider.h
+@@ -20,8 +20,8 @@ typedef int (*nvmem_reg_read_t)(void *pr
+ typedef int (*nvmem_reg_write_t)(void *priv, unsigned int offset,
+ 				 void *val, size_t bytes);
+ /* used for vendor specific post processing of cell data */
+-typedef int (*nvmem_cell_post_process_t)(void *priv, const char *id, unsigned int offset,
+-					  void *buf, size_t bytes);
++typedef int (*nvmem_cell_post_process_t)(void *priv, const char *id, int index,
++					 unsigned int offset, void *buf, size_t bytes);
+ 
+ enum nvmem_type {
+ 	NVMEM_TYPE_UNKNOWN = 0,
diff --git a/target/linux/generic/backport-5.15/809-v6.3-0003-nvmem-core-move-struct-nvmem_cell_info-to-nvmem-prov.patch b/target/linux/generic/backport-5.15/809-v6.3-0003-nvmem-core-move-struct-nvmem_cell_info-to-nvmem-prov.patch
new file mode 100644
index 0000000000..f3829b3e17
--- /dev/null
+++ b/target/linux/generic/backport-5.15/809-v6.3-0003-nvmem-core-move-struct-nvmem_cell_info-to-nvmem-prov.patch
@@ -0,0 +1,78 @@
+From fbd03d27776c6121a483921601418e3c8f0ff37e Mon Sep 17 00:00:00 2001
+From: Michael Walle <michael at walle.cc>
+Date: Mon, 6 Feb 2023 13:43:47 +0000
+Subject: [PATCH] nvmem: core: move struct nvmem_cell_info to nvmem-provider.h
+
+struct nvmem_cell_info is used to describe a cell. Thus this should
+really be in the nvmem-provider's header. There are two (unused) nvmem
+access methods which use the nvmem_cell_info to describe the cell to be
+accesses. One can argue, that they will create a cell before accessing,
+thus they are both a provider and a consumer.
+
+struct nvmem_cell_info will get used more and more by nvmem-providers,
+don't force them to also include the consumer header, although they are
+not.
+
+Signed-off-by: Michael Walle <michael at walle.cc>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-14-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ include/linux/nvmem-consumer.h | 10 +---------
+ include/linux/nvmem-provider.h | 19 ++++++++++++++++++-
+ 2 files changed, 19 insertions(+), 10 deletions(-)
+
+--- a/include/linux/nvmem-consumer.h
++++ b/include/linux/nvmem-consumer.h
+@@ -18,15 +18,7 @@ struct device_node;
+ /* consumer cookie */
+ struct nvmem_cell;
+ struct nvmem_device;
+-
+-struct nvmem_cell_info {
+-	const char		*name;
+-	unsigned int		offset;
+-	unsigned int		bytes;
+-	unsigned int		bit_offset;
+-	unsigned int		nbits;
+-	struct device_node	*np;
+-};
++struct nvmem_cell_info;
+ 
+ /**
+  * struct nvmem_cell_lookup - cell lookup entry
+--- a/include/linux/nvmem-provider.h
++++ b/include/linux/nvmem-provider.h
+@@ -14,7 +14,6 @@
+ #include <linux/gpio/consumer.h>
+ 
+ struct nvmem_device;
+-struct nvmem_cell_info;
+ typedef int (*nvmem_reg_read_t)(void *priv, unsigned int offset,
+ 				void *val, size_t bytes);
+ typedef int (*nvmem_reg_write_t)(void *priv, unsigned int offset,
+@@ -48,6 +47,24 @@ struct nvmem_keepout {
+ };
+ 
+ /**
++ * struct nvmem_cell_info - NVMEM cell description
++ * @name:	Name.
++ * @offset:	Offset within the NVMEM device.
++ * @bytes:	Length of the cell.
++ * @bit_offset:	Bit offset if cell is smaller than a byte.
++ * @nbits:	Number of bits.
++ * @np:		Optional device_node pointer.
++ */
++struct nvmem_cell_info {
++	const char		*name;
++	unsigned int		offset;
++	unsigned int		bytes;
++	unsigned int		bit_offset;
++	unsigned int		nbits;
++	struct device_node	*np;
++};
++
++/**
+  * struct nvmem_config - NVMEM device configuration
+  *
+  * @dev:	Parent device.
diff --git a/target/linux/generic/backport-5.15/809-v6.3-0004-nvmem-core-drop-the-removal-of-the-cells-in-nvmem_ad.patch b/target/linux/generic/backport-5.15/809-v6.3-0004-nvmem-core-drop-the-removal-of-the-cells-in-nvmem_ad.patch
new file mode 100644
index 0000000000..8f996eab34
--- /dev/null
+++ b/target/linux/generic/backport-5.15/809-v6.3-0004-nvmem-core-drop-the-removal-of-the-cells-in-nvmem_ad.patch
@@ -0,0 +1,65 @@
+From cc5bdd323dde6494623f3ffe3a5b887fa21cd375 Mon Sep 17 00:00:00 2001
+From: Michael Walle <michael at walle.cc>
+Date: Mon, 6 Feb 2023 13:43:48 +0000
+Subject: [PATCH] nvmem: core: drop the removal of the cells in
+ nvmem_add_cells()
+
+If nvmem_add_cells() fails, the whole nvmem_register() will fail
+and the cells will then be removed anyway. This is a preparation
+to introduce a nvmem_add_one_cell() which can then be used by
+nvmem_add_cells().
+
+This is then the same to what nvmem_add_cells_from_table() and
+nvmem_add_cells_from_of() do.
+
+Signed-off-by: Michael Walle <michael at walle.cc>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-15-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/core.c | 14 ++++----------
+ 1 file changed, 4 insertions(+), 10 deletions(-)
+
+--- a/drivers/nvmem/core.c
++++ b/drivers/nvmem/core.c
+@@ -515,7 +515,7 @@ static int nvmem_add_cells(struct nvmem_
+ 		    int ncells)
+ {
+ 	struct nvmem_cell_entry **cells;
+-	int i, rval;
++	int i, rval = 0;
+ 
+ 	cells = kcalloc(ncells, sizeof(*cells), GFP_KERNEL);
+ 	if (!cells)
+@@ -525,28 +525,22 @@ static int nvmem_add_cells(struct nvmem_
+ 		cells[i] = kzalloc(sizeof(**cells), GFP_KERNEL);
+ 		if (!cells[i]) {
+ 			rval = -ENOMEM;
+-			goto err;
++			goto out;
+ 		}
+ 
+ 		rval = nvmem_cell_info_to_nvmem_cell_entry(nvmem, &info[i], cells[i]);
+ 		if (rval) {
+ 			kfree(cells[i]);
+-			goto err;
++			goto out;
+ 		}
+ 
+ 		nvmem_cell_entry_add(cells[i]);
+ 	}
+ 
++out:
+ 	/* remove tmp array */
+ 	kfree(cells);
+ 
+-	return 0;
+-err:
+-	while (i--)
+-		nvmem_cell_entry_drop(cells[i]);
+-
+-	kfree(cells);
+-
+ 	return rval;
+ }
+ 
diff --git a/target/linux/generic/backport-5.15/809-v6.3-0005-nvmem-core-add-nvmem_add_one_cell.patch b/target/linux/generic/backport-5.15/809-v6.3-0005-nvmem-core-add-nvmem_add_one_cell.patch
new file mode 100644
index 0000000000..711ce229b2
--- /dev/null
+++ b/target/linux/generic/backport-5.15/809-v6.3-0005-nvmem-core-add-nvmem_add_one_cell.patch
@@ -0,0 +1,122 @@
+From 2ded6830d376d5e7bf43d59f7f7fdf1a59abc676 Mon Sep 17 00:00:00 2001
+From: Michael Walle <michael at walle.cc>
+Date: Mon, 6 Feb 2023 13:43:49 +0000
+Subject: [PATCH] nvmem: core: add nvmem_add_one_cell()
+
+Add a new function to add exactly one cell. This will be used by the
+nvmem layout drivers to add custom cells. In contrast to the
+nvmem_add_cells(), this has the advantage that we don't have to assemble
+a list of cells on runtime.
+
+Signed-off-by: Michael Walle <michael at walle.cc>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-16-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/core.c           | 59 ++++++++++++++++++++--------------
+ include/linux/nvmem-provider.h |  8 +++++
+ 2 files changed, 43 insertions(+), 24 deletions(-)
+
+--- a/drivers/nvmem/core.c
++++ b/drivers/nvmem/core.c
+@@ -502,6 +502,36 @@ static int nvmem_cell_info_to_nvmem_cell
+ }
+ 
+ /**
++ * nvmem_add_one_cell() - Add one cell information to an nvmem device
++ *
++ * @nvmem: nvmem device to add cells to.
++ * @info: nvmem cell info to add to the device
++ *
++ * Return: 0 or negative error code on failure.
++ */
++int nvmem_add_one_cell(struct nvmem_device *nvmem,
++		       const struct nvmem_cell_info *info)
++{
++	struct nvmem_cell_entry *cell;
++	int rval;
++
++	cell = kzalloc(sizeof(*cell), GFP_KERNEL);
++	if (!cell)
++		return -ENOMEM;
++
++	rval = nvmem_cell_info_to_nvmem_cell_entry(nvmem, info, cell);
++	if (rval) {
++		kfree(cell);
++		return rval;
++	}
++
++	nvmem_cell_entry_add(cell);
++
++	return 0;
++}
++EXPORT_SYMBOL_GPL(nvmem_add_one_cell);
++
++/**
+  * nvmem_add_cells() - Add cell information to an nvmem device
+  *
+  * @nvmem: nvmem device to add cells to.
+@@ -514,34 +544,15 @@ static int nvmem_add_cells(struct nvmem_
+ 		    const struct nvmem_cell_info *info,
+ 		    int ncells)
+ {
+-	struct nvmem_cell_entry **cells;
+-	int i, rval = 0;
+-
+-	cells = kcalloc(ncells, sizeof(*cells), GFP_KERNEL);
+-	if (!cells)
+-		return -ENOMEM;
++	int i, rval;
+ 
+ 	for (i = 0; i < ncells; i++) {
+-		cells[i] = kzalloc(sizeof(**cells), GFP_KERNEL);
+-		if (!cells[i]) {
+-			rval = -ENOMEM;
+-			goto out;
+-		}
+-
+-		rval = nvmem_cell_info_to_nvmem_cell_entry(nvmem, &info[i], cells[i]);
+-		if (rval) {
+-			kfree(cells[i]);
+-			goto out;
+-		}
+-
+-		nvmem_cell_entry_add(cells[i]);
++		rval = nvmem_add_one_cell(nvmem, &info[i]);
++		if (rval)
++			return rval;
+ 	}
+ 
+-out:
+-	/* remove tmp array */
+-	kfree(cells);
+-
+-	return rval;
++	return 0;
+ }
+ 
+ /**
+--- a/include/linux/nvmem-provider.h
++++ b/include/linux/nvmem-provider.h
+@@ -153,6 +153,9 @@ struct nvmem_device *devm_nvmem_register
+ void nvmem_add_cell_table(struct nvmem_cell_table *table);
+ void nvmem_del_cell_table(struct nvmem_cell_table *table);
+ 
++int nvmem_add_one_cell(struct nvmem_device *nvmem,
++		       const struct nvmem_cell_info *info);
++
+ #else
+ 
+ static inline struct nvmem_device *nvmem_register(const struct nvmem_config *c)
+@@ -170,6 +173,11 @@ devm_nvmem_register(struct device *dev,
+ 
+ static inline void nvmem_add_cell_table(struct nvmem_cell_table *table) {}
+ static inline void nvmem_del_cell_table(struct nvmem_cell_table *table) {}
++static inline int nvmem_add_one_cell(struct nvmem_device *nvmem,
++				     const struct nvmem_cell_info *info)
++{
++	return -EOPNOTSUPP;
++}
+ 
+ #endif /* CONFIG_NVMEM */
+ #endif  /* ifndef _LINUX_NVMEM_PROVIDER_H */
diff --git a/target/linux/generic/backport-5.15/809-v6.3-0006-nvmem-core-use-nvmem_add_one_cell-in-nvmem_add_cells.patch b/target/linux/generic/backport-5.15/809-v6.3-0006-nvmem-core-use-nvmem_add_one_cell-in-nvmem_add_cells.patch
new file mode 100644
index 0000000000..e1791e5c83
--- /dev/null
+++ b/target/linux/generic/backport-5.15/809-v6.3-0006-nvmem-core-use-nvmem_add_one_cell-in-nvmem_add_cells.patch
@@ -0,0 +1,93 @@
+From 50014d659617dc58780a5d31ceb76c82779a9d8b Mon Sep 17 00:00:00 2001
+From: Michael Walle <michael at walle.cc>
+Date: Mon, 6 Feb 2023 13:43:50 +0000
+Subject: [PATCH] nvmem: core: use nvmem_add_one_cell() in
+ nvmem_add_cells_from_of()
+
+Convert nvmem_add_cells_from_of() to use the new nvmem_add_one_cell().
+This will remove duplicate code and it will make it possible to add a
+hook to a nvmem layout in between, which can change fields before the
+cell is finally added.
+
+Signed-off-by: Michael Walle <michael at walle.cc>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-17-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/core.c | 45 ++++++++++++++------------------------------
+ 1 file changed, 14 insertions(+), 31 deletions(-)
+
+--- a/drivers/nvmem/core.c
++++ b/drivers/nvmem/core.c
+@@ -688,15 +688,14 @@ static int nvmem_validate_keepouts(struc
+ 
+ static int nvmem_add_cells_from_of(struct nvmem_device *nvmem)
+ {
+-	struct device_node *parent, *child;
+ 	struct device *dev = &nvmem->dev;
+-	struct nvmem_cell_entry *cell;
++	struct device_node *child;
+ 	const __be32 *addr;
+-	int len;
++	int len, ret;
+ 
+-	parent = dev->of_node;
++	for_each_child_of_node(dev->of_node, child) {
++		struct nvmem_cell_info info = {0};
+ 
+-	for_each_child_of_node(parent, child) {
+ 		addr = of_get_property(child, "reg", &len);
+ 		if (!addr)
+ 			continue;
+@@ -706,40 +705,24 @@ static int nvmem_add_cells_from_of(struc
+ 			return -EINVAL;
+ 		}
+ 
+-		cell = kzalloc(sizeof(*cell), GFP_KERNEL);
+-		if (!cell) {
+-			of_node_put(child);
+-			return -ENOMEM;
+-		}
+-
+-		cell->nvmem = nvmem;
+-		cell->offset = be32_to_cpup(addr++);
+-		cell->bytes = be32_to_cpup(addr);
+-		cell->name = kasprintf(GFP_KERNEL, "%pOFn", child);
++		info.offset = be32_to_cpup(addr++);
++		info.bytes = be32_to_cpup(addr);
++		info.name = kasprintf(GFP_KERNEL, "%pOFn", child);
+ 
+ 		addr = of_get_property(child, "bits", &len);
+ 		if (addr && len == (2 * sizeof(u32))) {
+-			cell->bit_offset = be32_to_cpup(addr++);
+-			cell->nbits = be32_to_cpup(addr);
++			info.bit_offset = be32_to_cpup(addr++);
++			info.nbits = be32_to_cpup(addr);
+ 		}
+ 
+-		if (cell->nbits)
+-			cell->bytes = DIV_ROUND_UP(
+-					cell->nbits + cell->bit_offset,
+-					BITS_PER_BYTE);
+-
+-		if (!IS_ALIGNED(cell->offset, nvmem->stride)) {
+-			dev_err(dev, "cell %s unaligned to nvmem stride %d\n",
+-				cell->name, nvmem->stride);
+-			/* Cells already added will be freed later. */
+-			kfree_const(cell->name);
+-			kfree(cell);
++		info.np = of_node_get(child);
++
++		ret = nvmem_add_one_cell(nvmem, &info);
++		kfree(info.name);
++		if (ret) {
+ 			of_node_put(child);
+-			return -EINVAL;
++			return ret;
+ 		}
+-
+-		cell->np = of_node_get(child);
+-		nvmem_cell_entry_add(cell);
+ 	}
+ 
+ 	return 0;
diff --git a/target/linux/generic/backport-5.15/809-v6.3-0007-nvmem-stm32-add-OP-TEE-support-for-STM32MP13x.patch b/target/linux/generic/backport-5.15/809-v6.3-0007-nvmem-stm32-add-OP-TEE-support-for-STM32MP13x.patch
new file mode 100644
index 0000000000..172a78b76a
--- /dev/null
+++ b/target/linux/generic/backport-5.15/809-v6.3-0007-nvmem-stm32-add-OP-TEE-support-for-STM32MP13x.patch
@@ -0,0 +1,562 @@
+From 6a0bc3522e746025e2d9a63ab2cb5d7062c2d39c Mon Sep 17 00:00:00 2001
+From: Patrick Delaunay <patrick.delaunay at foss.st.com>
+Date: Mon, 6 Feb 2023 13:43:51 +0000
+Subject: [PATCH] nvmem: stm32: add OP-TEE support for STM32MP13x
+
+For boot with OP-TEE on STM32MP13, the communication with the secure
+world no more use STMicroelectronics SMC but communication with the
+STM32MP BSEC TA, for data access (read/write) or lock operation:
+- all the request are sent to OP-TEE trusted application,
+- for upper OTP with ECC protection and with word programming only
+  each OTP are permanently locked when programmed to avoid ECC error
+  on the second write operation
+
+Signed-off-by: Patrick Delaunay <patrick.delaunay at foss.st.com>
+Reviewed-by: Etienne Carriere <etienne.carriere at linaro.org>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-18-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/Kconfig               |  11 +
+ drivers/nvmem/Makefile              |   1 +
+ drivers/nvmem/stm32-bsec-optee-ta.c | 298 ++++++++++++++++++++++++++++
+ drivers/nvmem/stm32-bsec-optee-ta.h |  80 ++++++++
+ drivers/nvmem/stm32-romem.c         |  54 ++++-
+ 5 files changed, 441 insertions(+), 3 deletions(-)
+ create mode 100644 drivers/nvmem/stm32-bsec-optee-ta.c
+ create mode 100644 drivers/nvmem/stm32-bsec-optee-ta.h
+
+--- a/drivers/nvmem/Kconfig
++++ b/drivers/nvmem/Kconfig
+@@ -290,9 +290,20 @@ config NVMEM_SPRD_EFUSE
+ 	  This driver can also be built as a module. If so, the module
+ 	  will be called nvmem-sprd-efuse.
+ 
++config NVMEM_STM32_BSEC_OPTEE_TA
++	bool "STM32MP BSEC OP-TEE TA support for nvmem-stm32-romem driver"
++	depends on OPTEE
++	help
++	  Say y here to enable the accesses to STM32MP SoC OTPs by the OP-TEE
++	  trusted application STM32MP BSEC.
++
++	  This library is a used by stm32-romem driver or included in the module
++	  called nvmem-stm32-romem.
++
+ config NVMEM_STM32_ROMEM
+ 	tristate "STMicroelectronics STM32 factory-programmed memory support"
+ 	depends on ARCH_STM32 || COMPILE_TEST
++	imply NVMEM_STM32_BSEC_OPTEE_TA
+ 	help
+ 	  Say y here to enable read-only access for STMicroelectronics STM32
+ 	  factory-programmed memory area.
+--- a/drivers/nvmem/Makefile
++++ b/drivers/nvmem/Makefile
+@@ -61,6 +61,7 @@ obj-$(CONFIG_NVMEM_SPRD_EFUSE)		+= nvmem
+ nvmem_sprd_efuse-y			:= sprd-efuse.o
+ obj-$(CONFIG_NVMEM_STM32_ROMEM)		+= nvmem_stm32_romem.o
+ nvmem_stm32_romem-y 			:= stm32-romem.o
++nvmem_stm32_romem-$(CONFIG_NVMEM_STM32_BSEC_OPTEE_TA) += stm32-bsec-optee-ta.o
+ obj-$(CONFIG_NVMEM_SUNPLUS_OCOTP)	+= nvmem_sunplus_ocotp.o
+ nvmem_sunplus_ocotp-y			:= sunplus-ocotp.o
+ obj-$(CONFIG_NVMEM_SUNXI_SID)		+= nvmem_sunxi_sid.o
+--- /dev/null
++++ b/drivers/nvmem/stm32-bsec-optee-ta.c
+@@ -0,0 +1,298 @@
++// SPDX-License-Identifier: GPL-2.0-or-later
++/*
++ * OP-TEE STM32MP BSEC PTA interface, used by STM32 ROMEM driver
++ *
++ * Copyright (C) 2022, STMicroelectronics - All Rights Reserved
++ */
++
++#include <linux/tee_drv.h>
++
++#include "stm32-bsec-optee-ta.h"
++
++/*
++ * Read OTP memory
++ *
++ * [in]		value[0].a		OTP start offset in byte
++ * [in]		value[0].b		Access type (0:shadow, 1:fuse, 2:lock)
++ * [out]	memref[1].buffer	Output buffer to store read values
++ * [out]	memref[1].size		Size of OTP to be read
++ *
++ * Return codes:
++ * TEE_SUCCESS - Invoke command success
++ * TEE_ERROR_BAD_PARAMETERS - Incorrect input param
++ * TEE_ERROR_ACCESS_DENIED - OTP not accessible by caller
++ */
++#define PTA_BSEC_READ_MEM		0x0
++
++/*
++ * Write OTP memory
++ *
++ * [in]		value[0].a		OTP start offset in byte
++ * [in]		value[0].b		Access type (0:shadow, 1:fuse, 2:lock)
++ * [in]		memref[1].buffer	Input buffer to read values
++ * [in]		memref[1].size		Size of OTP to be written
++ *
++ * Return codes:
++ * TEE_SUCCESS - Invoke command success
++ * TEE_ERROR_BAD_PARAMETERS - Incorrect input param
++ * TEE_ERROR_ACCESS_DENIED - OTP not accessible by caller
++ */
++#define PTA_BSEC_WRITE_MEM		0x1
++
++/* value of PTA_BSEC access type = value[in] b */
++#define SHADOW_ACCESS	0
++#define FUSE_ACCESS	1
++#define LOCK_ACCESS	2
++
++/* Bitfield definition for LOCK status */
++#define LOCK_PERM			BIT(30)
++
++/* OP-TEE STM32MP BSEC TA UUID */
++static const uuid_t stm32mp_bsec_ta_uuid =
++	UUID_INIT(0x94cf71ad, 0x80e6, 0x40b5,
++		  0xa7, 0xc6, 0x3d, 0xc5, 0x01, 0xeb, 0x28, 0x03);
++
++/*
++ * Check whether this driver supports the BSEC TA in the TEE instance
++ * represented by the params (ver/data) to this function.
++ */
++static int stm32_bsec_optee_ta_match(struct tee_ioctl_version_data *ver,
++				     const void *data)
++{
++	/* Currently this driver only supports GP compliant, OP-TEE based TA */
++	if ((ver->impl_id == TEE_IMPL_ID_OPTEE) &&
++		(ver->gen_caps & TEE_GEN_CAP_GP))
++		return 1;
++	else
++		return 0;
++}
++
++/* Open a session to OP-TEE for STM32MP BSEC TA */
++static int stm32_bsec_ta_open_session(struct tee_context *ctx, u32 *id)
++{
++	struct tee_ioctl_open_session_arg sess_arg;
++	int rc;
++
++	memset(&sess_arg, 0, sizeof(sess_arg));
++	export_uuid(sess_arg.uuid, &stm32mp_bsec_ta_uuid);
++	sess_arg.clnt_login = TEE_IOCTL_LOGIN_REE_KERNEL;
++	sess_arg.num_params = 0;
++
++	rc = tee_client_open_session(ctx, &sess_arg, NULL);
++	if ((rc < 0) || (sess_arg.ret != 0)) {
++		pr_err("%s: tee_client_open_session failed err:%#x, ret:%#x\n",
++		       __func__, sess_arg.ret, rc);
++		if (!rc)
++			rc = -EINVAL;
++	} else {
++		*id = sess_arg.session;
++	}
++
++	return rc;
++}
++
++/* close a session to OP-TEE for STM32MP BSEC TA */
++static void stm32_bsec_ta_close_session(void *ctx, u32 id)
++{
++	tee_client_close_session(ctx, id);
++}
++
++/* stm32_bsec_optee_ta_open() - initialize the STM32MP BSEC TA */
++int stm32_bsec_optee_ta_open(struct tee_context **ctx)
++{
++	struct tee_context *tee_ctx;
++	u32 session_id;
++	int rc;
++
++	/* Open context with TEE driver */
++	tee_ctx = tee_client_open_context(NULL, stm32_bsec_optee_ta_match, NULL, NULL);
++	if (IS_ERR(tee_ctx)) {
++		rc = PTR_ERR(tee_ctx);
++		if (rc == -ENOENT)
++			return -EPROBE_DEFER;
++		pr_err("%s: tee_client_open_context failed (%d)\n", __func__, rc);
++
++		return rc;
++	}
++
++	/* Check STM32MP BSEC TA presence */
++	rc = stm32_bsec_ta_open_session(tee_ctx, &session_id);
++	if (rc) {
++		tee_client_close_context(tee_ctx);
++		return rc;
++	}
++
++	stm32_bsec_ta_close_session(tee_ctx, session_id);
++
++	*ctx = tee_ctx;
++
++	return 0;
++}
++
++/* stm32_bsec_optee_ta_open() - release the PTA STM32MP BSEC TA */
++void stm32_bsec_optee_ta_close(void *ctx)
++{
++	tee_client_close_context(ctx);
++}
++
++/* stm32_bsec_optee_ta_read() - nvmem read access using PTA client driver */
++int stm32_bsec_optee_ta_read(struct tee_context *ctx, unsigned int offset,
++			     void *buf, size_t bytes)
++{
++	struct tee_shm *shm;
++	struct tee_ioctl_invoke_arg arg;
++	struct tee_param param[2];
++	u8 *shm_buf;
++	u32 start, num_bytes;
++	int ret;
++	u32 session_id;
++
++	ret = stm32_bsec_ta_open_session(ctx, &session_id);
++	if (ret)
++		return ret;
++
++	memset(&arg, 0, sizeof(arg));
++	memset(&param, 0, sizeof(param));
++
++	arg.func = PTA_BSEC_READ_MEM;
++	arg.session = session_id;
++	arg.num_params = 2;
++
++	/* align access on 32bits */
++	start = ALIGN_DOWN(offset, 4);
++	num_bytes = round_up(offset + bytes - start, 4);
++	param[0].attr = TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT;
++	param[0].u.value.a = start;
++	param[0].u.value.b = SHADOW_ACCESS;
++
++	shm = tee_shm_alloc_kernel_buf(ctx, num_bytes);
++	if (IS_ERR(shm)) {
++		ret = PTR_ERR(shm);
++		goto out_tee_session;
++	}
++
++	param[1].attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT;
++	param[1].u.memref.shm = shm;
++	param[1].u.memref.size = num_bytes;
++
++	ret = tee_client_invoke_func(ctx, &arg, param);
++	if (ret < 0 || arg.ret != 0) {
++		pr_err("TA_BSEC invoke failed TEE err:%#x, ret:%#x\n",
++			arg.ret, ret);
++		if (!ret)
++			ret = -EIO;
++	}
++	if (!ret) {
++		shm_buf = tee_shm_get_va(shm, 0);
++		if (IS_ERR(shm_buf)) {
++			ret = PTR_ERR(shm_buf);
++			pr_err("tee_shm_get_va failed for transmit (%d)\n", ret);
++		} else {
++			/* read data from 32 bits aligned buffer */
++			memcpy(buf, &shm_buf[offset % 4], bytes);
++		}
++	}
++
++	tee_shm_free(shm);
++
++out_tee_session:
++	stm32_bsec_ta_close_session(ctx, session_id);
++
++	return ret;
++}
++
++/* stm32_bsec_optee_ta_write() - nvmem write access using PTA client driver */
++int stm32_bsec_optee_ta_write(struct tee_context *ctx, unsigned int lower,
++			      unsigned int offset, void *buf, size_t bytes)
++{	struct tee_shm *shm;
++	struct tee_ioctl_invoke_arg arg;
++	struct tee_param param[2];
++	u8 *shm_buf;
++	int ret;
++	u32 session_id;
++
++	ret = stm32_bsec_ta_open_session(ctx, &session_id);
++	if (ret)
++		return ret;
++
++	/* Allow only writing complete 32-bits aligned words */
++	if ((bytes % 4) || (offset % 4))
++		return -EINVAL;
++
++	memset(&arg, 0, sizeof(arg));
++	memset(&param, 0, sizeof(param));
++
++	arg.func = PTA_BSEC_WRITE_MEM;
++	arg.session = session_id;
++	arg.num_params = 2;
++
++	param[0].attr = TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT;
++	param[0].u.value.a = offset;
++	param[0].u.value.b = FUSE_ACCESS;
++
++	shm = tee_shm_alloc_kernel_buf(ctx, bytes);
++	if (IS_ERR(shm)) {
++		ret = PTR_ERR(shm);
++		goto out_tee_session;
++	}
++
++	param[1].attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT;
++	param[1].u.memref.shm = shm;
++	param[1].u.memref.size = bytes;
++
++	shm_buf = tee_shm_get_va(shm, 0);
++	if (IS_ERR(shm_buf)) {
++		ret = PTR_ERR(shm_buf);
++		pr_err("tee_shm_get_va failed for transmit (%d)\n", ret);
++		tee_shm_free(shm);
++
++		goto out_tee_session;
++	}
++
++	memcpy(shm_buf, buf, bytes);
++
++	ret = tee_client_invoke_func(ctx, &arg, param);
++	if (ret < 0 || arg.ret != 0) {
++		pr_err("TA_BSEC invoke failed TEE err:%#x, ret:%#x\n", arg.ret, ret);
++		if (!ret)
++			ret = -EIO;
++	}
++	pr_debug("Write OTPs %d to %zu, ret=%d\n", offset / 4, (offset + bytes) / 4, ret);
++
++	/* Lock the upper OTPs with ECC protection, word programming only */
++	if (!ret && ((offset + bytes) >= (lower * 4))) {
++		u32 start, nb_lock;
++		u32 *lock = (u32 *)shm_buf;
++		int i;
++
++		/*
++		 * don't lock the lower OTPs, no ECC protection and incremental
++		 * bit programming, a second write is allowed
++		 */
++		start = max_t(u32, offset, lower * 4);
++		nb_lock = (offset + bytes - start) / 4;
++
++		param[0].u.value.a = start;
++		param[0].u.value.b = LOCK_ACCESS;
++		param[1].u.memref.size = nb_lock * 4;
++
++		for (i = 0; i < nb_lock; i++)
++			lock[i] = LOCK_PERM;
++
++		ret = tee_client_invoke_func(ctx, &arg, param);
++		if (ret < 0 || arg.ret != 0) {
++			pr_err("TA_BSEC invoke failed TEE err:%#x, ret:%#x\n", arg.ret, ret);
++			if (!ret)
++				ret = -EIO;
++		}
++		pr_debug("Lock upper OTPs %d to %d, ret=%d\n",
++			 start / 4, start / 4 + nb_lock, ret);
++	}
++
++	tee_shm_free(shm);
++
++out_tee_session:
++	stm32_bsec_ta_close_session(ctx, session_id);
++
++	return ret;
++}
+--- /dev/null
++++ b/drivers/nvmem/stm32-bsec-optee-ta.h
+@@ -0,0 +1,80 @@
++/* SPDX-License-Identifier: GPL-2.0-or-later */
++/*
++ * OP-TEE STM32MP BSEC PTA interface, used by STM32 ROMEM driver
++ *
++ * Copyright (C) 2022, STMicroelectronics - All Rights Reserved
++ */
++
++#if IS_ENABLED(CONFIG_NVMEM_STM32_BSEC_OPTEE_TA)
++/**
++ * stm32_bsec_optee_ta_open() - initialize the STM32 BSEC TA
++ * @ctx: the OP-TEE context on success
++ *
++ * Return:
++ *	On success, 0. On failure, -errno.
++ */
++int stm32_bsec_optee_ta_open(struct tee_context **ctx);
++
++/**
++ * stm32_bsec_optee_ta_close() - release the STM32 BSEC TA
++ * @ctx: the OP-TEE context
++ *
++ * This function used to clean the OP-TEE resources initialized in
++ * stm32_bsec_optee_ta_open(); it can be used as callback to
++ * devm_add_action_or_reset()
++ */
++void stm32_bsec_optee_ta_close(void *ctx);
++
++/**
++ * stm32_bsec_optee_ta_read() - nvmem read access using TA client driver
++ * @ctx: the OP-TEE context provided by stm32_bsec_optee_ta_open
++ * @offset: nvmem offset
++ * @buf: buffer to fill with nvem values
++ * @bytes: number of bytes to read
++ *
++ * Return:
++ *	On success, 0. On failure, -errno.
++ */
++int stm32_bsec_optee_ta_read(struct tee_context *ctx, unsigned int offset,
++			     void *buf, size_t bytes);
++
++/**
++ * stm32_bsec_optee_ta_write() - nvmem write access using TA client driver
++ * @ctx: the OP-TEE context provided by stm32_bsec_optee_ta_open
++ * @lower: number of lower OTP, not protected by ECC
++ * @offset: nvmem offset
++ * @buf: buffer with nvem values
++ * @bytes: number of bytes to write
++ *
++ * Return:
++ *	On success, 0. On failure, -errno.
++ */
++int stm32_bsec_optee_ta_write(struct tee_context *ctx, unsigned int lower,
++			      unsigned int offset, void *buf, size_t bytes);
++
++#else
++
++static inline int stm32_bsec_optee_ta_open(struct tee_context **ctx)
++{
++	return -EOPNOTSUPP;
++}
++
++static inline void stm32_bsec_optee_ta_close(void *ctx)
++{
++}
++
++static inline int stm32_bsec_optee_ta_read(struct tee_context *ctx,
++					   unsigned int offset, void *buf,
++					   size_t bytes)
++{
++	return -EOPNOTSUPP;
++}
++
++static inline int stm32_bsec_optee_ta_write(struct tee_context *ctx,
++					    unsigned int lower,
++					    unsigned int offset, void *buf,
++					    size_t bytes)
++{
++	return -EOPNOTSUPP;
++}
++#endif /* CONFIG_NVMEM_STM32_BSEC_OPTEE_TA */
+--- a/drivers/nvmem/stm32-romem.c
++++ b/drivers/nvmem/stm32-romem.c
+@@ -11,6 +11,9 @@
+ #include <linux/module.h>
+ #include <linux/nvmem-provider.h>
+ #include <linux/of_device.h>
++#include <linux/tee_drv.h>
++
++#include "stm32-bsec-optee-ta.h"
+ 
+ /* BSEC secure service access from non-secure */
+ #define STM32_SMC_BSEC			0x82001003
+@@ -25,12 +28,14 @@
+ struct stm32_romem_cfg {
+ 	int size;
+ 	u8 lower;
++	bool ta;
+ };
+ 
+ struct stm32_romem_priv {
+ 	void __iomem *base;
+ 	struct nvmem_config cfg;
+ 	u8 lower;
++	struct tee_context *ctx;
+ };
+ 
+ static int stm32_romem_read(void *context, unsigned int offset, void *buf,
+@@ -138,12 +143,29 @@ static int stm32_bsec_write(void *contex
+ 	return 0;
+ }
+ 
++static int stm32_bsec_pta_read(void *context, unsigned int offset, void *buf,
++			       size_t bytes)
++{
++	struct stm32_romem_priv *priv = context;
++
++	return stm32_bsec_optee_ta_read(priv->ctx, offset, buf, bytes);
++}
++
++static int stm32_bsec_pta_write(void *context, unsigned int offset, void *buf,
++				size_t bytes)
++{
++	struct stm32_romem_priv *priv = context;
++
++	return stm32_bsec_optee_ta_write(priv->ctx, priv->lower, offset, buf, bytes);
++}
++
+ static int stm32_romem_probe(struct platform_device *pdev)
+ {
+ 	const struct stm32_romem_cfg *cfg;
+ 	struct device *dev = &pdev->dev;
+ 	struct stm32_romem_priv *priv;
+ 	struct resource *res;
++	int rc;
+ 
+ 	priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
+ 	if (!priv)
+@@ -173,15 +195,31 @@ static int stm32_romem_probe(struct plat
+ 	} else {
+ 		priv->cfg.size = cfg->size;
+ 		priv->lower = cfg->lower;
+-		priv->cfg.reg_read = stm32_bsec_read;
+-		priv->cfg.reg_write = stm32_bsec_write;
++		if (cfg->ta) {
++			rc = stm32_bsec_optee_ta_open(&priv->ctx);
++			/* wait for OP-TEE client driver to be up and ready */
++			if (rc)
++				return rc;
++		}
++		if (priv->ctx) {
++			rc = devm_add_action_or_reset(dev, stm32_bsec_optee_ta_close, priv->ctx);
++			if (rc) {
++				dev_err(dev, "devm_add_action_or_reset() failed (%d)\n", rc);
++				return rc;
++			}
++			priv->cfg.reg_read = stm32_bsec_pta_read;
++			priv->cfg.reg_write = stm32_bsec_pta_write;
++		} else {
++			priv->cfg.reg_read = stm32_bsec_read;
++			priv->cfg.reg_write = stm32_bsec_write;
++		}
+ 	}
+ 
+ 	return PTR_ERR_OR_ZERO(devm_nvmem_register(dev, &priv->cfg));
+ }
+ 
+ /*
+- * STM32MP15 BSEC OTP regions: 4096 OTP bits (with 3072 effective bits)
++ * STM32MP15/13 BSEC OTP regions: 4096 OTP bits (with 3072 effective bits)
+  * => 96 x 32-bits data words
+  * - Lower: 1K bits, 2:1 redundancy, incremental bit programming
+  *   => 32 (x 32-bits) lower shadow registers = words 0 to 31
+@@ -191,6 +229,13 @@ static int stm32_romem_probe(struct plat
+ static const struct stm32_romem_cfg stm32mp15_bsec_cfg = {
+ 	.size = 384,
+ 	.lower = 32,
++	.ta = false,
++};
++
++static const struct stm32_romem_cfg stm32mp13_bsec_cfg = {
++	.size = 384,
++	.lower = 32,
++	.ta = true,
+ };
+ 
+ static const struct of_device_id stm32_romem_of_match[] = {
+@@ -198,7 +243,10 @@ static const struct of_device_id stm32_r
+ 		.compatible = "st,stm32mp15-bsec",
+ 		.data = (void *)&stm32mp15_bsec_cfg,
+ 	}, {
++		.compatible = "st,stm32mp13-bsec",
++		.data = (void *)&stm32mp13_bsec_cfg,
+ 	},
++	{ /* sentinel */ },
+ };
+ MODULE_DEVICE_TABLE(of, stm32_romem_of_match);
+ 
diff --git a/target/linux/generic/backport-5.15/809-v6.3-0008-nvmem-stm32-detect-bsec-pta-presence-for-STM32MP15x.patch b/target/linux/generic/backport-5.15/809-v6.3-0008-nvmem-stm32-detect-bsec-pta-presence-for-STM32MP15x.patch
new file mode 100644
index 0000000000..cea8e93858
--- /dev/null
+++ b/target/linux/generic/backport-5.15/809-v6.3-0008-nvmem-stm32-detect-bsec-pta-presence-for-STM32MP15x.patch
@@ -0,0 +1,85 @@
+From df2f34ef1d924125ffaf29dfdaf7cdbd3183c321 Mon Sep 17 00:00:00 2001
+From: Patrick Delaunay <patrick.delaunay at foss.st.com>
+Date: Mon, 6 Feb 2023 13:43:52 +0000
+Subject: [PATCH] nvmem: stm32: detect bsec pta presence for STM32MP15x
+
+On STM32MP15x SoC, the SMC backend is optional when OP-TEE is used;
+the PTA BSEC should be used as it is done on STM32MP13x platform,
+but the BSEC SMC can be also used: it is a legacy mode in OP-TEE,
+not recommended but used in previous OP-TEE firmware.
+
+The presence of OP-TEE is dynamically detected in STM32MP15x device tree
+and the supported NVMEM backend is dynamically detected:
+- PTA with stm32_bsec_pta_find
+- SMC with stm32_bsec_check
+
+With OP-TEE but without PTA and SMC detection, the probe is deferred for
+STM32MP15x devices.
+
+On STM32MP13x platform, only the PTA is supported with cfg->ta = true
+and this detection is skipped.
+
+Signed-off-by: Patrick Delaunay <patrick.delaunay at foss.st.com>
+Reviewed-by: Etienne Carriere <etienne.carriere at linaro.org>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-19-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/stm32-romem.c | 38 +++++++++++++++++++++++++++++++++----
+ 1 file changed, 34 insertions(+), 4 deletions(-)
+
+--- a/drivers/nvmem/stm32-romem.c
++++ b/drivers/nvmem/stm32-romem.c
+@@ -159,6 +159,31 @@ static int stm32_bsec_pta_write(void *co
+ 	return stm32_bsec_optee_ta_write(priv->ctx, priv->lower, offset, buf, bytes);
+ }
+ 
++static bool stm32_bsec_smc_check(void)
++{
++	u32 val;
++	int ret;
++
++	/* check that the OP-TEE support the BSEC SMC (legacy mode) */
++	ret = stm32_bsec_smc(STM32_SMC_READ_SHADOW, 0, 0, &val);
++
++	return !ret;
++}
++
++static bool optee_presence_check(void)
++{
++	struct device_node *np;
++	bool tee_detected = false;
++
++	/* check that the OP-TEE node is present and available. */
++	np = of_find_compatible_node(NULL, NULL, "linaro,optee-tz");
++	if (np && of_device_is_available(np))
++		tee_detected = true;
++	of_node_put(np);
++
++	return tee_detected;
++}
++
+ static int stm32_romem_probe(struct platform_device *pdev)
+ {
+ 	const struct stm32_romem_cfg *cfg;
+@@ -195,11 +220,16 @@ static int stm32_romem_probe(struct plat
+ 	} else {
+ 		priv->cfg.size = cfg->size;
+ 		priv->lower = cfg->lower;
+-		if (cfg->ta) {
++		if (cfg->ta || optee_presence_check()) {
+ 			rc = stm32_bsec_optee_ta_open(&priv->ctx);
+-			/* wait for OP-TEE client driver to be up and ready */
+-			if (rc)
+-				return rc;
++			if (rc) {
++				/* wait for OP-TEE client driver to be up and ready */
++				if (rc == -EPROBE_DEFER)
++					return -EPROBE_DEFER;
++				/* BSEC PTA is required or SMC not supported */
++				if (cfg->ta || !stm32_bsec_smc_check())
++					return rc;
++			}
+ 		}
+ 		if (priv->ctx) {
+ 			rc = devm_add_action_or_reset(dev, stm32_bsec_optee_ta_close, priv->ctx);
diff --git a/target/linux/generic/backport-5.15/809-v6.3-0009-nvmem-rave-sp-eeprm-fix-kernel-doc-bad-line-warning.patch b/target/linux/generic/backport-5.15/809-v6.3-0009-nvmem-rave-sp-eeprm-fix-kernel-doc-bad-line-warning.patch
new file mode 100644
index 0000000000..9d6275a737
--- /dev/null
+++ b/target/linux/generic/backport-5.15/809-v6.3-0009-nvmem-rave-sp-eeprm-fix-kernel-doc-bad-line-warning.patch
@@ -0,0 +1,32 @@
+From 3e5ac22aa564026e99defc3a8e02082521a5b231 Mon Sep 17 00:00:00 2001
+From: Randy Dunlap <rdunlap at infradead.org>
+Date: Mon, 6 Feb 2023 13:43:53 +0000
+Subject: [PATCH] nvmem: rave-sp-eeprm: fix kernel-doc bad line warning
+
+Convert an empty line to " *" to avoid a kernel-doc warning:
+
+drivers/nvmem/rave-sp-eeprom.c:48: warning: bad line:
+
+Signed-off-by: Randy Dunlap <rdunlap at infradead.org>
+Cc: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Cc: Andrey Vostrikov <andrey.vostrikov at cogentembedded.com>
+Cc: Nikita Yushchenko <nikita.yoush at cogentembedded.com>
+Cc: Andrey Smirnov <andrew.smirnov at gmail.com>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-20-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/rave-sp-eeprom.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/nvmem/rave-sp-eeprom.c
++++ b/drivers/nvmem/rave-sp-eeprom.c
+@@ -45,7 +45,7 @@ enum rave_sp_eeprom_header_size {
+  * @type:	Access type (see enum rave_sp_eeprom_access_type)
+  * @success:	Success flag (Success = 1, Failure = 0)
+  * @data:	Read data
+-
++ *
+  * Note this structure corresponds to RSP_*_EEPROM payload from RAVE
+  * SP ICD
+  */
diff --git a/target/linux/generic/backport-5.15/809-v6.3-0010-nvmem-qcom-spmi-sdam-register-at-device-init-time.patch b/target/linux/generic/backport-5.15/809-v6.3-0010-nvmem-qcom-spmi-sdam-register-at-device-init-time.patch
new file mode 100644
index 0000000000..1ab9e609d3
--- /dev/null
+++ b/target/linux/generic/backport-5.15/809-v6.3-0010-nvmem-qcom-spmi-sdam-register-at-device-init-time.patch
@@ -0,0 +1,43 @@
+From eb7dda20f42a9137e9ee53d5ed3b743d49338cb5 Mon Sep 17 00:00:00 2001
+From: Johan Hovold <johan+linaro at kernel.org>
+Date: Mon, 6 Feb 2023 13:43:54 +0000
+Subject: [PATCH] nvmem: qcom-spmi-sdam: register at device init time
+
+There are currently no in-tree users of the Qualcomm SDAM nvmem driver
+and there is generally no point in registering a driver that can be
+built as a module at subsys init time.
+
+Register the driver at the normal device init time instead and let
+driver core sort out the probe order.
+
+Signed-off-by: Johan Hovold <johan+linaro at kernel.org>
+Reviewed-by: Bjorn Andersson <andersson at kernel.org>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-21-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/qcom-spmi-sdam.c | 13 +------------
+ 1 file changed, 1 insertion(+), 12 deletions(-)
+
+--- a/drivers/nvmem/qcom-spmi-sdam.c
++++ b/drivers/nvmem/qcom-spmi-sdam.c
+@@ -175,18 +175,7 @@ static struct platform_driver sdam_drive
+ 	},
+ 	.probe		= sdam_probe,
+ };
+-
+-static int __init sdam_init(void)
+-{
+-	return platform_driver_register(&sdam_driver);
+-}
+-subsys_initcall(sdam_init);
+-
+-static void __exit sdam_exit(void)
+-{
+-	return platform_driver_unregister(&sdam_driver);
+-}
+-module_exit(sdam_exit);
++module_platform_driver(sdam_driver);
+ 
+ MODULE_DESCRIPTION("QCOM SPMI SDAM driver");
+ MODULE_LICENSE("GPL v2");
diff --git a/target/linux/generic/backport-5.15/809-v6.3-0011-nvmem-stm32-fix-OPTEE-dependency.patch b/target/linux/generic/backport-5.15/809-v6.3-0011-nvmem-stm32-fix-OPTEE-dependency.patch
new file mode 100644
index 0000000000..dcf704c6ff
--- /dev/null
+++ b/target/linux/generic/backport-5.15/809-v6.3-0011-nvmem-stm32-fix-OPTEE-dependency.patch
@@ -0,0 +1,46 @@
+From 1dc7e37bb0ec1c997fac82031332a38c7610352f Mon Sep 17 00:00:00 2001
+From: Arnd Bergmann <arnd at arndb.de>
+Date: Mon, 6 Feb 2023 13:43:56 +0000
+Subject: [PATCH] nvmem: stm32: fix OPTEE dependency
+
+The stm32 nvmem driver fails to link as built-in when OPTEE
+is a loadable module:
+
+aarch64-linux-ld: drivers/nvmem/stm32-bsec-optee-ta.o: in function `stm32_bsec:
+stm32-bsec-optee-ta.c:(.text+0xc8): undefined reference to `tee_client_open_session'
+aarch64-linux-ld: drivers/nvmem/stm32-bsec-optee-ta.o: in function `stm32_bsec:
+stm32-bsec-optee-ta.c:(.text+0x1fc): undefined reference to `tee_client_open_context'
+
+Change the CONFIG_NVMEM_STM32_ROMEM definition so it can only
+be built-in if OPTEE is either built-in or disabled, and
+make NVMEM_STM32_BSEC_OPTEE_TA a hidden symbol instead.
+
+Signed-off-by: Arnd Bergmann <arnd at arndb.de>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230206134356.839737-23-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/Kconfig | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+--- a/drivers/nvmem/Kconfig
++++ b/drivers/nvmem/Kconfig
+@@ -291,8 +291,7 @@ config NVMEM_SPRD_EFUSE
+ 	  will be called nvmem-sprd-efuse.
+ 
+ config NVMEM_STM32_BSEC_OPTEE_TA
+-	bool "STM32MP BSEC OP-TEE TA support for nvmem-stm32-romem driver"
+-	depends on OPTEE
++	def_bool NVMEM_STM32_ROMEM && OPTEE
+ 	help
+ 	  Say y here to enable the accesses to STM32MP SoC OTPs by the OP-TEE
+ 	  trusted application STM32MP BSEC.
+@@ -303,7 +302,7 @@ config NVMEM_STM32_BSEC_OPTEE_TA
+ config NVMEM_STM32_ROMEM
+ 	tristate "STMicroelectronics STM32 factory-programmed memory support"
+ 	depends on ARCH_STM32 || COMPILE_TEST
+-	imply NVMEM_STM32_BSEC_OPTEE_TA
++	depends on OPTEE || !OPTEE
+ 	help
+ 	  Say y here to enable read-only access for STMicroelectronics STM32
+ 	  factory-programmed memory area.
diff --git a/target/linux/generic/backport-5.10/813-nvmem-u-boot-env-align-endianness-of-crc32-values.patch b/target/linux/generic/pending-5.10/802-nvmem-u-boot-env-align-endianness-of-crc32-values.patch
similarity index 100%
rename from target/linux/generic/backport-5.10/813-nvmem-u-boot-env-align-endianness-of-crc32-values.patch
rename to target/linux/generic/pending-5.10/802-nvmem-u-boot-env-align-endianness-of-crc32-values.patch
diff --git a/target/linux/generic/backport-5.15/809-nvmem-u-boot-env-align-endianness-of-crc32-values.patch b/target/linux/generic/pending-5.15/802-nvmem-u-boot-env-align-endianness-of-crc32-values.patch
similarity index 100%
rename from target/linux/generic/backport-5.15/809-nvmem-u-boot-env-align-endianness-of-crc32-values.patch
rename to target/linux/generic/pending-5.15/802-nvmem-u-boot-env-align-endianness-of-crc32-values.patch



From lede-commits at lists.infradead.org  Tue Feb 21 17:21:50 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 21 Feb 2023 20:21:50 -0500
Subject: [openwrt/openwrt]  mvebu: mochabin: enlarge PCI memory window
In-Reply-To: <167702891043.4038372.7369266167012584816@git-01.infra.openwrt.org>
References: <167702891043.4038372.7369266167012584816@git-01.infra.openwrt.org>
Message-ID: <mailman.18116.1677028917.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/00c5276659cb9929fc5010ebe2f2f10b4d4cf9ef

commit 00c5276659cb9929fc5010ebe2f2f10b4d4cf9ef
Author: Robert Marko <robert.marko at sartura.hr>
AuthorDate: Sun Feb 19 12:58:56 2023 +0100

    mvebu: mochabin: enlarge PCI memory window
    
    Armada 7040 uses a rather small 15MB memory window for every PCI adapter,
    however this is not sufficient for Qualcomm QCA6390 802.11ax cards that
    are shipped along with the OpenWrt WLAN model of MOCHAbin as ath11k
    requires at least 16MB of memory.
    
    So, similar to what MACCHIATOBin has been doing for years, lets move
    to using the second PCIe 2 memory window and expand it to 128MB to
    make it future proof.
    
    This has been already sent upstream [1].
    [1] https://lore.kernel.org/linux-arm-kernel/20230219121418.1395401-1-robert.marko at sartura.hr/
    
    Signed-off-by: Robert Marko <robert.marko at sartura.hr>
---
 .../mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-mochabin.dts     | 1 +
 1 file changed, 1 insertion(+)

diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-mochabin.dts b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-mochabin.dts
index c198061af7..c4e11b5049 100644
--- a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-mochabin.dts
+++ b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-mochabin.dts
@@ -445,4 +445,5 @@
 	phys = <&cp0_comphy5 2>;
 	phy-names = "cp0-pcie2-x1-phy";
 	reset-gpio = <&cp0_gpio1 9 GPIO_ACTIVE_LOW>;
+	ranges = <0x82000000 0x0 0xc0000000 0x0 0xc0000000 0x0 0x8000000>;
 };



From lede-commits at lists.infradead.org  Wed Feb 22 06:15:28 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 22 Feb 2023 09:15:28 -0500
Subject: [openwrt/openwrt]  openssl: fix powerpc & arc libatomic dependencies
In-Reply-To: <167707532820.581927.8027082982811765736@git-01.infra.openwrt.org>
References: <167707532820.581927.8027082982811765736@git-01.infra.openwrt.org>
Message-ID: <mailman.18329.1677075341.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/595509cc781e7d45d19ddead24a0c424c610b5c0

commit 595509cc781e7d45d19ddead24a0c424c610b5c0
Author: Eneas U de Queiroz <cotequeiroz at gmail.com>
AuthorDate: Tue Feb 21 17:55:26 2023 -0300

    openssl: fix powerpc & arc libatomic dependencies
    
    PowerPC CONFIG_ARCH is defined as powerpc, not ppc.  Fix that in the
    DEPENDS condition.
    
    Arc needs to be built with libatomic.  Change the OpenSSL configuration
    file, and add it to the libatomic DEPENDS condition.
    
    Fixes: 7e7e76afca "openssl: bump to 3.0.8"
    Signed-off-by: Eneas U de Queiroz <cotequeiroz at gmail.com>
---
 package/libs/openssl/Makefile                          | 4 ++--
 package/libs/openssl/patches/110-openwrt_targets.patch | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/libs/openssl/Makefile b/package/libs/openssl/Makefile
index 7dc4df0982..153d14a446 100644
--- a/package/libs/openssl/Makefile
+++ b/package/libs/openssl/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=openssl
 PKG_VERSION:=3.0.8
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 PKG_USE_MIPS16:=0
 
 PKG_BUILD_PARALLEL:=1
@@ -95,7 +95,7 @@ $(call Package/openssl/Default)
 	   +OPENSSL_ENGINE_BUILTIN_AFALG:kmod-crypto-user \
 	   +OPENSSL_ENGINE_BUILTIN_DEVCRYPTO:kmod-cryptodev \
 	   +OPENSSL_ENGINE_BUILTIN_PADLOCK:kmod-crypto-hw-padlock \
-	   +(arm||armeb||mips||mipsel||ppc):libatomic
+	   +(arm||armeb||mips||mipsel||powerpc||arc):libatomic
   TITLE+= (libraries)
   ABI_VERSION:=$(firstword $(subst .,$(space),$(PKG_VERSION)))
   MENU:=1
diff --git a/package/libs/openssl/patches/110-openwrt_targets.patch b/package/libs/openssl/patches/110-openwrt_targets.patch
index 6b4fbad0a7..5abedd400e 100644
--- a/package/libs/openssl/patches/110-openwrt_targets.patch
+++ b/package/libs/openssl/patches/110-openwrt_targets.patch
@@ -23,7 +23,7 @@ Signed-off-by: Eneas U de Queiroz <cote2004-github at yahoo.com>
 +        inherit_from    => [ "linux-aarch64", "openwrt" ],
 +    },
 +    "linux-arc-openwrt" => {
-+        inherit_from    => [ "linux-generic32", "openwrt" ],
++        inherit_from    => [ "linux-latomic", "openwrt" ],
 +    },
 +    "linux-arm-openwrt" => {
 +        inherit_from    => [ "linux-armv4", "openwrt" ],



From lede-commits at lists.infradead.org  Wed Feb 22 14:39:30 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 22 Feb 2023 17:39:30 -0500
Subject: [openwrt/openwrt]  mpc85xx: switch default kernel to 5.15
In-Reply-To: <167710557013.989320.6728526937906577234@git-01.infra.openwrt.org>
References: <167710557013.989320.6728526937906577234@git-01.infra.openwrt.org>
Message-ID: <mailman.18443.1677105582.3064139.lede-commits@lists.infradead.org>

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

commit 9837f81baedaeda6a334d5ffead7bc1c731ae2df
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Wed Feb 1 11:42:57 2023 +0100

    mpc85xx: switch default kernel to 5.15
    
    The default kernel should be switched to 5.15 in order to enable testing
    by a broader audience.
    
    Tested on TP-Link TL-WDR4900 v1.
    
    Acked-by: Josef Schlehofer <pepe.schlehofer at gmail.com>
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 target/linux/mpc85xx/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/target/linux/mpc85xx/Makefile b/target/linux/mpc85xx/Makefile
index 31d0d45f4f..7e84be8624 100644
--- a/target/linux/mpc85xx/Makefile
+++ b/target/linux/mpc85xx/Makefile
@@ -11,8 +11,7 @@ CPU_TYPE:=8548
 FEATURES:=squashfs ramdisk nand
 SUBTARGETS:=p1010 p1020 p2020
 
-KERNEL_PATCHVER:=5.10
-KERNEL_TESTING_PATCHVER:=5.15
+KERNEL_PATCHVER:=5.15
 
 KERNELNAME:=zImage
 



From lede-commits at lists.infradead.org  Thu Feb 23 00:50:48 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 23 Feb 2023 03:50:48 -0500
Subject: [openwrt/openwrt]  kernel: backport NVMEM late fixes from v6.2
In-Reply-To: <167714224882.1508786.1732071899284084132@git-01.infra.openwrt.org>
References: <167714224882.1508786.1732071899284084132@git-01.infra.openwrt.org>
Message-ID: <mailman.18508.1677142258.3064139.lede-commits@lists.infradead.org>

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

commit b4ae914037e0ce900be53525c7058543e1ff9d64
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Thu Feb 23 09:47:39 2023 +0100

    kernel: backport NVMEM late fixes from v6.2
    
    They were backported to stable kernels but we backport more stuff on our
    own so we have to pick up few remaining.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 ...nvram-provide-NVMEM-content-to-the-NVRAM-.patch |  2 +-
 ...nvram-provide-NVMEM-content-to-the-NVRAM-.patch |  2 +-
 ...07-nvmem-brcm_nvram-Add-check-for-kzalloc.patch | 30 ++++++++++++
 ...em-sunxi_sid-Always-use-32-bit-MMIO-reads.patch | 55 ++++++++++++++++++++++
 ...13-nvmem-core-fix-device-node-refcounting.patch | 48 +++++++++++++++++++
 ...m-core-add-an-index-parameter-to-the-cell.patch | 14 +++---
 ...07-nvmem-brcm_nvram-Add-check-for-kzalloc.patch | 30 ++++++++++++
 ...em-sunxi_sid-Always-use-32-bit-MMIO-reads.patch | 55 ++++++++++++++++++++++
 ...13-nvmem-core-fix-device-node-refcounting.patch | 48 +++++++++++++++++++
 ...m-core-add-an-index-parameter-to-the-cell.patch | 14 +++---
 10 files changed, 282 insertions(+), 16 deletions(-)

diff --git a/target/linux/bcm53xx/patches-5.10/800-0002-nvmem-brcm_nvram-provide-NVMEM-content-to-the-NVRAM-.patch b/target/linux/bcm53xx/patches-5.10/800-0002-nvmem-brcm_nvram-provide-NVMEM-content-to-the-NVRAM-.patch
index ecc5f3974e..6648874bcf 100644
--- a/target/linux/bcm53xx/patches-5.10/800-0002-nvmem-brcm_nvram-provide-NVMEM-content-to-the-NVRAM-.patch
+++ b/target/linux/bcm53xx/patches-5.10/800-0002-nvmem-brcm_nvram-provide-NVMEM-content-to-the-NVRAM-.patch
@@ -20,7 +20,7 @@ Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
  #include <linux/io.h>
  #include <linux/mod_devicetable.h>
  #include <linux/module.h>
-@@ -136,6 +137,8 @@ static int brcm_nvram_probe(struct platf
+@@ -139,6 +140,8 @@ static int brcm_nvram_probe(struct platf
  	if (err)
  		return err;
  
diff --git a/target/linux/bcm53xx/patches-5.15/800-0002-nvmem-brcm_nvram-provide-NVMEM-content-to-the-NVRAM-.patch b/target/linux/bcm53xx/patches-5.15/800-0002-nvmem-brcm_nvram-provide-NVMEM-content-to-the-NVRAM-.patch
index ecc5f3974e..6648874bcf 100644
--- a/target/linux/bcm53xx/patches-5.15/800-0002-nvmem-brcm_nvram-provide-NVMEM-content-to-the-NVRAM-.patch
+++ b/target/linux/bcm53xx/patches-5.15/800-0002-nvmem-brcm_nvram-provide-NVMEM-content-to-the-NVRAM-.patch
@@ -20,7 +20,7 @@ Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
  #include <linux/io.h>
  #include <linux/mod_devicetable.h>
  #include <linux/module.h>
-@@ -136,6 +137,8 @@ static int brcm_nvram_probe(struct platf
+@@ -139,6 +140,8 @@ static int brcm_nvram_probe(struct platf
  	if (err)
  		return err;
  
diff --git a/target/linux/generic/backport-5.10/812-v6.2-0007-nvmem-brcm_nvram-Add-check-for-kzalloc.patch b/target/linux/generic/backport-5.10/812-v6.2-0007-nvmem-brcm_nvram-Add-check-for-kzalloc.patch
new file mode 100644
index 0000000000..14108b5927
--- /dev/null
+++ b/target/linux/generic/backport-5.10/812-v6.2-0007-nvmem-brcm_nvram-Add-check-for-kzalloc.patch
@@ -0,0 +1,30 @@
+From b0576ade3aaf24b376ea1a4406ae138e2a22b0c0 Mon Sep 17 00:00:00 2001
+From: Jiasheng Jiang <jiasheng at iscas.ac.cn>
+Date: Fri, 27 Jan 2023 10:40:06 +0000
+Subject: [PATCH] nvmem: brcm_nvram: Add check for kzalloc
+
+Add the check for the return value of kzalloc in order to avoid
+NULL pointer dereference.
+
+Fixes: 6e977eaa8280 ("nvmem: brcm_nvram: parse NVRAM content into NVMEM cells")
+Cc: stable at vger.kernel.org
+Signed-off-by: Jiasheng Jiang <jiasheng at iscas.ac.cn>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230127104015.23839-2-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/brcm_nvram.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/nvmem/brcm_nvram.c
++++ b/drivers/nvmem/brcm_nvram.c
+@@ -97,6 +97,9 @@ static int brcm_nvram_parse(struct brcm_
+ 	len = le32_to_cpu(header.len);
+ 
+ 	data = kzalloc(len, GFP_KERNEL);
++	if (!data)
++		return -ENOMEM;
++
+ 	memcpy_fromio(data, priv->base, len);
+ 	data[len - 1] = '\0';
+ 
diff --git a/target/linux/generic/backport-5.10/812-v6.2-0008-nvmem-sunxi_sid-Always-use-32-bit-MMIO-reads.patch b/target/linux/generic/backport-5.10/812-v6.2-0008-nvmem-sunxi_sid-Always-use-32-bit-MMIO-reads.patch
new file mode 100644
index 0000000000..632b01cb2a
--- /dev/null
+++ b/target/linux/generic/backport-5.10/812-v6.2-0008-nvmem-sunxi_sid-Always-use-32-bit-MMIO-reads.patch
@@ -0,0 +1,55 @@
+From c151d5ed8e8fe0474bd61dce7f2076ca5916c683 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel at sholland.org>
+Date: Fri, 27 Jan 2023 10:40:07 +0000
+Subject: [PATCH] nvmem: sunxi_sid: Always use 32-bit MMIO reads
+
+The SID SRAM on at least some SoCs (A64 and D1) returns different values
+when read with bus cycles narrower than 32 bits. This is not immediately
+obvious, because memcpy_fromio() uses word-size accesses as long as
+enough data is being copied.
+
+The vendor driver always uses 32-bit MMIO reads, so do the same here.
+This is faster than the register-based method, which is currently used
+as a workaround on A64. And it fixes the values returned on D1, where
+the SRAM method was being used.
+
+The special case for the last word is needed to maintain .word_size == 1
+for sysfs ABI compatibility, as noted previously in commit de2a3eaea552
+("nvmem: sunxi_sid: Optimize register read-out method").
+
+Fixes: 07ae4fde9efa ("nvmem: sunxi_sid: Add support for D1 variant")
+Cc: stable at vger.kernel.org
+Tested-by: Heiko Stuebner <heiko at sntech.de>
+Signed-off-by: Samuel Holland <samuel at sholland.org>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230127104015.23839-3-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/sunxi_sid.c | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+--- a/drivers/nvmem/sunxi_sid.c
++++ b/drivers/nvmem/sunxi_sid.c
+@@ -41,8 +41,21 @@ static int sunxi_sid_read(void *context,
+ 			  void *val, size_t bytes)
+ {
+ 	struct sunxi_sid *sid = context;
++	u32 word;
+ 
+-	memcpy_fromio(val, sid->base + sid->value_offset + offset, bytes);
++	/* .stride = 4 so offset is guaranteed to be aligned */
++	__ioread32_copy(val, sid->base + sid->value_offset + offset, bytes / 4);
++
++	val += round_down(bytes, 4);
++	offset += round_down(bytes, 4);
++	bytes = bytes % 4;
++
++	if (!bytes)
++		return 0;
++
++	/* Handle any trailing bytes */
++	word = readl_relaxed(sid->base + sid->value_offset + offset);
++	memcpy(val, &word, bytes);
+ 
+ 	return 0;
+ }
diff --git a/target/linux/generic/backport-5.10/812-v6.2-0013-nvmem-core-fix-device-node-refcounting.patch b/target/linux/generic/backport-5.10/812-v6.2-0013-nvmem-core-fix-device-node-refcounting.patch
new file mode 100644
index 0000000000..53a8fed7ad
--- /dev/null
+++ b/target/linux/generic/backport-5.10/812-v6.2-0013-nvmem-core-fix-device-node-refcounting.patch
@@ -0,0 +1,48 @@
+From edcf2fb660526b5ed29f93bd17328a2b4835c8b2 Mon Sep 17 00:00:00 2001
+From: Michael Walle <michael at walle.cc>
+Date: Fri, 27 Jan 2023 10:40:12 +0000
+Subject: [PATCH] nvmem: core: fix device node refcounting
+
+In of_nvmem_cell_get(), of_get_next_parent() is used on cell_np. This
+will decrement the refcount on cell_np, but cell_np is still used later
+in the code. Use of_get_parent() instead and of_node_put() in the
+appropriate places.
+
+Fixes: 69aba7948cbe ("nvmem: Add a simple NVMEM framework for consumers")
+Fixes: 7ae6478b304b ("nvmem: core: rework nvmem cell instance creation")
+Cc: stable at vger.kernel.org
+Signed-off-by: Michael Walle <michael at walle.cc>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230127104015.23839-8-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/core.c | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+--- a/drivers/nvmem/core.c
++++ b/drivers/nvmem/core.c
+@@ -1242,16 +1242,21 @@ struct nvmem_cell *of_nvmem_cell_get(str
+ 	if (!cell_np)
+ 		return ERR_PTR(-ENOENT);
+ 
+-	nvmem_np = of_get_next_parent(cell_np);
+-	if (!nvmem_np)
++	nvmem_np = of_get_parent(cell_np);
++	if (!nvmem_np) {
++		of_node_put(cell_np);
+ 		return ERR_PTR(-EINVAL);
++	}
+ 
+ 	nvmem = __nvmem_device_get(nvmem_np, device_match_of_node);
+ 	of_node_put(nvmem_np);
+-	if (IS_ERR(nvmem))
++	if (IS_ERR(nvmem)) {
++		of_node_put(cell_np);
+ 		return ERR_CAST(nvmem);
++	}
+ 
+ 	cell_entry = nvmem_find_cell_entry_by_node(nvmem, cell_np);
++	of_node_put(cell_np);
+ 	if (!cell_entry) {
+ 		__nvmem_device_put(nvmem);
+ 		return ERR_PTR(-ENOENT);
diff --git a/target/linux/generic/backport-5.10/813-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch b/target/linux/generic/backport-5.10/813-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch
index 4f1bfac806..b512085598 100644
--- a/target/linux/generic/backport-5.10/813-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch
+++ b/target/linux/generic/backport-5.10/813-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch
@@ -103,9 +103,9 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
 +	if (cell_spec.args_count)
 +		cell_index = cell_spec.args[0];
  
- 	nvmem_np = of_get_next_parent(cell_np);
- 	if (!nvmem_np)
-@@ -1257,7 +1272,7 @@ struct nvmem_cell *of_nvmem_cell_get(str
+ 	nvmem_np = of_get_parent(cell_np);
+ 	if (!nvmem_np) {
+@@ -1262,7 +1277,7 @@ struct nvmem_cell *of_nvmem_cell_get(str
  		return ERR_PTR(-ENOENT);
  	}
  
@@ -114,7 +114,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  	if (IS_ERR(cell))
  		__nvmem_device_put(nvmem);
  
-@@ -1410,8 +1425,8 @@ static void nvmem_shift_read_buffer_in_p
+@@ -1415,8 +1430,8 @@ static void nvmem_shift_read_buffer_in_p
  }
  
  static int __nvmem_cell_read(struct nvmem_device *nvmem,
@@ -125,7 +125,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  {
  	int rc;
  
-@@ -1425,7 +1440,7 @@ static int __nvmem_cell_read(struct nvme
+@@ -1430,7 +1445,7 @@ static int __nvmem_cell_read(struct nvme
  		nvmem_shift_read_buffer_in_place(cell, buf);
  
  	if (nvmem->cell_post_process) {
@@ -134,7 +134,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  					      cell->offset, buf, cell->bytes);
  		if (rc)
  			return rc;
-@@ -1460,7 +1475,7 @@ void *nvmem_cell_read(struct nvmem_cell
+@@ -1465,7 +1480,7 @@ void *nvmem_cell_read(struct nvmem_cell
  	if (!buf)
  		return ERR_PTR(-ENOMEM);
  
@@ -143,7 +143,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  	if (rc) {
  		kfree(buf);
  		return ERR_PTR(rc);
-@@ -1773,7 +1788,7 @@ ssize_t nvmem_device_cell_read(struct nv
+@@ -1778,7 +1793,7 @@ ssize_t nvmem_device_cell_read(struct nv
  	if (rc)
  		return rc;
  
diff --git a/target/linux/generic/backport-5.15/808-v6.2-0007-nvmem-brcm_nvram-Add-check-for-kzalloc.patch b/target/linux/generic/backport-5.15/808-v6.2-0007-nvmem-brcm_nvram-Add-check-for-kzalloc.patch
new file mode 100644
index 0000000000..14108b5927
--- /dev/null
+++ b/target/linux/generic/backport-5.15/808-v6.2-0007-nvmem-brcm_nvram-Add-check-for-kzalloc.patch
@@ -0,0 +1,30 @@
+From b0576ade3aaf24b376ea1a4406ae138e2a22b0c0 Mon Sep 17 00:00:00 2001
+From: Jiasheng Jiang <jiasheng at iscas.ac.cn>
+Date: Fri, 27 Jan 2023 10:40:06 +0000
+Subject: [PATCH] nvmem: brcm_nvram: Add check for kzalloc
+
+Add the check for the return value of kzalloc in order to avoid
+NULL pointer dereference.
+
+Fixes: 6e977eaa8280 ("nvmem: brcm_nvram: parse NVRAM content into NVMEM cells")
+Cc: stable at vger.kernel.org
+Signed-off-by: Jiasheng Jiang <jiasheng at iscas.ac.cn>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230127104015.23839-2-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/brcm_nvram.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/nvmem/brcm_nvram.c
++++ b/drivers/nvmem/brcm_nvram.c
+@@ -97,6 +97,9 @@ static int brcm_nvram_parse(struct brcm_
+ 	len = le32_to_cpu(header.len);
+ 
+ 	data = kzalloc(len, GFP_KERNEL);
++	if (!data)
++		return -ENOMEM;
++
+ 	memcpy_fromio(data, priv->base, len);
+ 	data[len - 1] = '\0';
+ 
diff --git a/target/linux/generic/backport-5.15/808-v6.2-0008-nvmem-sunxi_sid-Always-use-32-bit-MMIO-reads.patch b/target/linux/generic/backport-5.15/808-v6.2-0008-nvmem-sunxi_sid-Always-use-32-bit-MMIO-reads.patch
new file mode 100644
index 0000000000..632b01cb2a
--- /dev/null
+++ b/target/linux/generic/backport-5.15/808-v6.2-0008-nvmem-sunxi_sid-Always-use-32-bit-MMIO-reads.patch
@@ -0,0 +1,55 @@
+From c151d5ed8e8fe0474bd61dce7f2076ca5916c683 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel at sholland.org>
+Date: Fri, 27 Jan 2023 10:40:07 +0000
+Subject: [PATCH] nvmem: sunxi_sid: Always use 32-bit MMIO reads
+
+The SID SRAM on at least some SoCs (A64 and D1) returns different values
+when read with bus cycles narrower than 32 bits. This is not immediately
+obvious, because memcpy_fromio() uses word-size accesses as long as
+enough data is being copied.
+
+The vendor driver always uses 32-bit MMIO reads, so do the same here.
+This is faster than the register-based method, which is currently used
+as a workaround on A64. And it fixes the values returned on D1, where
+the SRAM method was being used.
+
+The special case for the last word is needed to maintain .word_size == 1
+for sysfs ABI compatibility, as noted previously in commit de2a3eaea552
+("nvmem: sunxi_sid: Optimize register read-out method").
+
+Fixes: 07ae4fde9efa ("nvmem: sunxi_sid: Add support for D1 variant")
+Cc: stable at vger.kernel.org
+Tested-by: Heiko Stuebner <heiko at sntech.de>
+Signed-off-by: Samuel Holland <samuel at sholland.org>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230127104015.23839-3-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/sunxi_sid.c | 15 ++++++++++++++-
+ 1 file changed, 14 insertions(+), 1 deletion(-)
+
+--- a/drivers/nvmem/sunxi_sid.c
++++ b/drivers/nvmem/sunxi_sid.c
+@@ -41,8 +41,21 @@ static int sunxi_sid_read(void *context,
+ 			  void *val, size_t bytes)
+ {
+ 	struct sunxi_sid *sid = context;
++	u32 word;
+ 
+-	memcpy_fromio(val, sid->base + sid->value_offset + offset, bytes);
++	/* .stride = 4 so offset is guaranteed to be aligned */
++	__ioread32_copy(val, sid->base + sid->value_offset + offset, bytes / 4);
++
++	val += round_down(bytes, 4);
++	offset += round_down(bytes, 4);
++	bytes = bytes % 4;
++
++	if (!bytes)
++		return 0;
++
++	/* Handle any trailing bytes */
++	word = readl_relaxed(sid->base + sid->value_offset + offset);
++	memcpy(val, &word, bytes);
+ 
+ 	return 0;
+ }
diff --git a/target/linux/generic/backport-5.15/808-v6.2-0013-nvmem-core-fix-device-node-refcounting.patch b/target/linux/generic/backport-5.15/808-v6.2-0013-nvmem-core-fix-device-node-refcounting.patch
new file mode 100644
index 0000000000..99a9907f6f
--- /dev/null
+++ b/target/linux/generic/backport-5.15/808-v6.2-0013-nvmem-core-fix-device-node-refcounting.patch
@@ -0,0 +1,48 @@
+From edcf2fb660526b5ed29f93bd17328a2b4835c8b2 Mon Sep 17 00:00:00 2001
+From: Michael Walle <michael at walle.cc>
+Date: Fri, 27 Jan 2023 10:40:12 +0000
+Subject: [PATCH] nvmem: core: fix device node refcounting
+
+In of_nvmem_cell_get(), of_get_next_parent() is used on cell_np. This
+will decrement the refcount on cell_np, but cell_np is still used later
+in the code. Use of_get_parent() instead and of_node_put() in the
+appropriate places.
+
+Fixes: 69aba7948cbe ("nvmem: Add a simple NVMEM framework for consumers")
+Fixes: 7ae6478b304b ("nvmem: core: rework nvmem cell instance creation")
+Cc: stable at vger.kernel.org
+Signed-off-by: Michael Walle <michael at walle.cc>
+Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla at linaro.org>
+Link: https://lore.kernel.org/r/20230127104015.23839-8-srinivas.kandagatla at linaro.org
+Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
+---
+ drivers/nvmem/core.c | 11 ++++++++---
+ 1 file changed, 8 insertions(+), 3 deletions(-)
+
+--- a/drivers/nvmem/core.c
++++ b/drivers/nvmem/core.c
+@@ -1240,16 +1240,21 @@ struct nvmem_cell *of_nvmem_cell_get(str
+ 	if (!cell_np)
+ 		return ERR_PTR(-ENOENT);
+ 
+-	nvmem_np = of_get_next_parent(cell_np);
+-	if (!nvmem_np)
++	nvmem_np = of_get_parent(cell_np);
++	if (!nvmem_np) {
++		of_node_put(cell_np);
+ 		return ERR_PTR(-EINVAL);
++	}
+ 
+ 	nvmem = __nvmem_device_get(nvmem_np, device_match_of_node);
+ 	of_node_put(nvmem_np);
+-	if (IS_ERR(nvmem))
++	if (IS_ERR(nvmem)) {
++		of_node_put(cell_np);
+ 		return ERR_CAST(nvmem);
++	}
+ 
+ 	cell_entry = nvmem_find_cell_entry_by_node(nvmem, cell_np);
++	of_node_put(cell_np);
+ 	if (!cell_entry) {
+ 		__nvmem_device_put(nvmem);
+ 		return ERR_PTR(-ENOENT);
diff --git a/target/linux/generic/backport-5.15/809-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch b/target/linux/generic/backport-5.15/809-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch
index d6b3057e48..cefc4c89c7 100644
--- a/target/linux/generic/backport-5.15/809-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch
+++ b/target/linux/generic/backport-5.15/809-v6.3-0002-nvmem-core-add-an-index-parameter-to-the-cell.patch
@@ -103,9 +103,9 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
 +	if (cell_spec.args_count)
 +		cell_index = cell_spec.args[0];
  
- 	nvmem_np = of_get_next_parent(cell_np);
- 	if (!nvmem_np)
-@@ -1255,7 +1270,7 @@ struct nvmem_cell *of_nvmem_cell_get(str
+ 	nvmem_np = of_get_parent(cell_np);
+ 	if (!nvmem_np) {
+@@ -1260,7 +1275,7 @@ struct nvmem_cell *of_nvmem_cell_get(str
  		return ERR_PTR(-ENOENT);
  	}
  
@@ -114,7 +114,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  	if (IS_ERR(cell))
  		__nvmem_device_put(nvmem);
  
-@@ -1408,8 +1423,8 @@ static void nvmem_shift_read_buffer_in_p
+@@ -1413,8 +1428,8 @@ static void nvmem_shift_read_buffer_in_p
  }
  
  static int __nvmem_cell_read(struct nvmem_device *nvmem,
@@ -125,7 +125,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  {
  	int rc;
  
-@@ -1423,7 +1438,7 @@ static int __nvmem_cell_read(struct nvme
+@@ -1428,7 +1443,7 @@ static int __nvmem_cell_read(struct nvme
  		nvmem_shift_read_buffer_in_place(cell, buf);
  
  	if (nvmem->cell_post_process) {
@@ -134,7 +134,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  					      cell->offset, buf, cell->bytes);
  		if (rc)
  			return rc;
-@@ -1458,7 +1473,7 @@ void *nvmem_cell_read(struct nvmem_cell
+@@ -1463,7 +1478,7 @@ void *nvmem_cell_read(struct nvmem_cell
  	if (!buf)
  		return ERR_PTR(-ENOMEM);
  
@@ -143,7 +143,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
  	if (rc) {
  		kfree(buf);
  		return ERR_PTR(rc);
-@@ -1771,7 +1786,7 @@ ssize_t nvmem_device_cell_read(struct nv
+@@ -1776,7 +1791,7 @@ ssize_t nvmem_device_cell_read(struct nv
  	if (rc)
  		return rc;
  



From lede-commits at lists.infradead.org  Thu Feb 23 06:22:30 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 23 Feb 2023 09:22:30 -0500
Subject: [openwrt/openwrt]  mac80211: ath11k: sync with ath-next
In-Reply-To: <167716215073.1741173.12953840357100683896@git-01.infra.openwrt.org>
References: <167716215073.1741173.12953840357100683896@git-01.infra.openwrt.org>
Message-ID: <mailman.18609.1677162176.3064139.lede-commits@lists.infradead.org>

ansuel pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/524704e677f7bf5758d41180c05ff32c20c6a48c

commit 524704e677f7bf5758d41180c05ff32c20c6a48c
Author: Robert Marko <robimarko at gmail.com>
AuthorDate: Wed Feb 22 18:04:39 2023 +0100

    mac80211: ath11k: sync with ath-next
    
    Synchronize the ath11k backports with the current ath-next tree.
    
    This backports several memory leak issues, PCI IRQ fixup, peer add locking
    fix as well as IPQ5018 support, though IPQ5018 support is unused for now.
    
    This allows to easily backport further fixes as cherry picking them has
    started requiring manual conflict resolution.
    
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 ...-wifi-ath11k-update-hw-params-for-IPQ5018.patch | 125 ++++++++
 ...h11k-update-ce-configurations-for-IPQ5018.patch | 246 +++++++++++++++
 ...th11k-remap-ce-register-space-for-IPQ5018.patch | 351 +++++++++++++++++++++
 ...i-ath11k-update-hal-srng-regs-for-IPQ5018.patch | 130 ++++++++
 ...wifi-ath11k-initialize-hw_ops-for-IPQ5018.patch |  90 ++++++
 ...-add-new-hw-ops-for-IPQ5018-to-get-rx-des.patch |  84 +++++
 ...25-wifi-ath11k-add-ipq5018-device-support.patch |  31 ++
 ...Fix-scan-request-param-frame-size-warnin.patch} |   0
 ...fi-ath11k-fix-monitor-mode-bringup-crash.patch} |   0
 ...debugfs-fix-to-work-with-multiple-PCI-de.patch} |   2 +-
 ...-Add-support-to-configure-FTM-responder-r.patch | 169 ++++++++++
 ...k-add-channel-177-into-5-GHz-channel-list.patch |  41 +++
 ...11k-fix-ce-memory-mapping-for-ahb-devices.patch | 114 +++++++
 ...-Fix-memory-leak-in-ath11k_peer_rx_frag_s.patch |  28 ++
 ...-Set-ext-passive-scan-flag-to-adjust-pass.patch |  73 +++++
 ...-fix-return-value-check-in-ath11k_ahb_pro.patch |  27 ++
 ...-Use-platform_get_irq-to-get-the-interrup.patch |  50 +++
 ...-fix-SAC-bug-on-peer-addition-with-sta-ba.patch |  53 ++++
 ...-Disable-coldboot-calibration-for-IPQ8074.patch |   2 +-
 ...11k-support-setting-FW-memory-mode-via-DT.patch |   4 +-
 20 files changed, 1616 insertions(+), 4 deletions(-)

diff --git a/package/kernel/mac80211/patches/ath11k/0019-wifi-ath11k-update-hw-params-for-IPQ5018.patch b/package/kernel/mac80211/patches/ath11k/0019-wifi-ath11k-update-hw-params-for-IPQ5018.patch
new file mode 100644
index 0000000000..25d39ddb0d
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath11k/0019-wifi-ath11k-update-hw-params-for-IPQ5018.patch
@@ -0,0 +1,125 @@
+From 8dfe875aa24aec68baf6702018633c84c2c1feca Mon Sep 17 00:00:00 2001
+From: Sriram R <quic_srirrama at quicinc.com>
+Date: Fri, 2 Dec 2022 23:37:13 +0200
+Subject: [PATCH] wifi: ath11k: update hw params for IPQ5018
+
+Add new compatible string for IPQ5018 and add
+required hw params for IPQ5018. The hw descriptors size and
+datapath ops are similar to QCN9074, hence reuse the same.
+
+Tested-on: IPQ5018 hw1.0 AHB WLAN.HK.2.6.0.1-00861-QCAHKSWPL_SILICONZ-1
+
+Signed-off-by: Sriram R <quic_srirrama at quicinc.com>
+Co-developed-by: Karthikeyan Kathirvel <quic_kathirve at quicinc.com>
+Signed-off-by: Karthikeyan Kathirvel <quic_kathirve at quicinc.com>
+Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>
+Link: https://lore.kernel.org/r/20221122132152.17771-3-quic_kathirve at quicinc.com
+---
+ drivers/net/wireless/ath/ath11k/core.c | 71 ++++++++++++++++++++++++++
+ drivers/net/wireless/ath/ath11k/core.h |  8 +++
+ 2 files changed, 79 insertions(+)
+
+--- a/drivers/net/wireless/ath/ath11k/core.c
++++ b/drivers/net/wireless/ath/ath11k/core.c
+@@ -604,6 +604,77 @@ static const struct ath11k_hw_params ath
+ 		.smp2p_wow_exit = true,
+ 		.support_fw_mac_sequence = true,
+ 	},
++	{
++		.hw_rev = ATH11K_HW_IPQ5018_HW10,
++		.name = "ipq5018 hw1.0",
++		.fw = {
++			.dir = "IPQ5018/hw1.0",
++			.board_size = 256 * 1024,
++			.cal_offset = 128 * 1024,
++		},
++		.max_radios = MAX_RADIOS_5018,
++		.bdf_addr = 0x4BA00000,
++		/* hal_desc_sz and hw ops are similar to qcn9074 */
++		.hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074),
++		.qmi_service_ins_id = ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074,
++		.ring_mask = &ath11k_hw_ring_mask_ipq8074,
++		.credit_flow = false,
++		.max_tx_ring = 1,
++		.spectral = {
++			.fft_sz = 2,
++			.fft_pad_sz = 0,
++			.summary_pad_sz = 16,
++			.fft_hdr_len = 24,
++			.max_fft_bins = 1024,
++		},
++		.internal_sleep_clock = false,
++		.host_ce_config = ath11k_host_ce_config_qcn9074,
++		.ce_count = CE_CNT_5018,
++		.rxdma1_enable = true,
++		.num_rxmda_per_pdev = RXDMA_PER_PDEV_5018,
++		.rx_mac_buf_ring = false,
++		.vdev_start_delay = false,
++		.htt_peer_map_v2 = true,
++		.interface_modes = BIT(NL80211_IFTYPE_STATION) |
++			BIT(NL80211_IFTYPE_AP) |
++			BIT(NL80211_IFTYPE_MESH_POINT),
++		.supports_monitor = false,
++		.supports_sta_ps = false,
++		.supports_shadow_regs = false,
++		.fw_mem_mode = 0,
++		.num_vdevs = 16 + 1,
++		.num_peers = 512,
++		.supports_regdb = false,
++		.idle_ps = false,
++		.supports_suspend = false,
++		.hal_params = &ath11k_hw_hal_params_ipq8074,
++		.single_pdev_only = false,
++		.cold_boot_calib = true,
++		.fix_l1ss = true,
++		.supports_dynamic_smps_6ghz = false,
++		.alloc_cacheable_memory = true,
++		.supports_rssi_stats = false,
++		.fw_wmi_diag_event = false,
++		.current_cc_support = false,
++		.dbr_debug_support = true,
++		.global_reset = false,
++		.bios_sar_capa = NULL,
++		.m3_fw_support = false,
++		.fixed_bdf_addr = true,
++		.fixed_mem_region = true,
++		.static_window_map = false,
++		.hybrid_bus_type = false,
++		.fixed_fw_mem = false,
++		.support_off_channel_tx = false,
++		.supports_multi_bssid = false,
++
++		.sram_dump = {},
++
++		.tcl_ring_retry = true,
++		.tx_ring_size = DP_TCL_DATA_RING_SIZE,
++		.smp2p_wow_exit = false,
++		.support_fw_mac_sequence = false,
++	},
+ };
+ 
+ static inline struct ath11k_pdev *ath11k_core_get_single_pdev(struct ath11k_base *ab)
+--- a/drivers/net/wireless/ath/ath11k/core.h
++++ b/drivers/net/wireless/ath/ath11k/core.h
+@@ -142,6 +142,7 @@ enum ath11k_hw_rev {
+ 	ATH11K_HW_WCN6855_HW20,
+ 	ATH11K_HW_WCN6855_HW21,
+ 	ATH11K_HW_WCN6750_HW10,
++	ATH11K_HW_IPQ5018_HW10,
+ };
+ 
+ enum ath11k_firmware_mode {
+@@ -230,6 +231,13 @@ struct ath11k_he {
+ 
+ #define MAX_RADIOS 3
+ 
++/* ipq5018 hw param macros */
++#define MAX_RADIOS_5018	1
++#define CE_CNT_5018	6
++#define TARGET_CE_CNT_5018	9
++#define SVC_CE_MAP_LEN_5018	17
++#define RXDMA_PER_PDEV_5018	1
++
+ enum {
+ 	WMI_HOST_TP_SCALE_MAX   = 0,
+ 	WMI_HOST_TP_SCALE_50    = 1,
diff --git a/package/kernel/mac80211/patches/ath11k/0020-wifi-ath11k-update-ce-configurations-for-IPQ5018.patch b/package/kernel/mac80211/patches/ath11k/0020-wifi-ath11k-update-ce-configurations-for-IPQ5018.patch
new file mode 100644
index 0000000000..9a16349b28
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath11k/0020-wifi-ath11k-update-ce-configurations-for-IPQ5018.patch
@@ -0,0 +1,246 @@
+From 26af7aabd2d8225c6b2056234626ba5099610871 Mon Sep 17 00:00:00 2001
+From: Sriram R <quic_srirrama at quicinc.com>
+Date: Fri, 2 Dec 2022 23:37:14 +0200
+Subject: [PATCH] wifi: ath11k: update ce configurations for IPQ5018
+
+IPQ5018 is a single pdev device. Update host
+and target CE configurations accordingly.
+
+Tested-on: IPQ5018 hw1.0 AHB WLAN.HK.2.6.0.1-00861-QCAHKSWPL_SILICONZ-1
+
+Signed-off-by: Sriram R <quic_srirrama at quicinc.com>
+Co-developed-by: Karthikeyan Kathirvel <quic_kathirve at quicinc.com>
+Signed-off-by: Karthikeyan Kathirvel <quic_kathirve at quicinc.com>
+Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>
+Link: https://lore.kernel.org/r/20221122132152.17771-4-quic_kathirve at quicinc.com
+---
+ drivers/net/wireless/ath/ath11k/core.c |   4 +
+ drivers/net/wireless/ath/ath11k/core.h |   3 +
+ drivers/net/wireless/ath/ath11k/hw.c   | 191 +++++++++++++++++++++++++
+ 3 files changed, 198 insertions(+)
+
+--- a/drivers/net/wireless/ath/ath11k/core.c
++++ b/drivers/net/wireless/ath/ath11k/core.c
+@@ -630,6 +630,10 @@ static const struct ath11k_hw_params ath
+ 		.internal_sleep_clock = false,
+ 		.host_ce_config = ath11k_host_ce_config_qcn9074,
+ 		.ce_count = CE_CNT_5018,
++		.target_ce_config = ath11k_target_ce_config_wlan_ipq5018,
++		.target_ce_count = TARGET_CE_CNT_5018,
++		.svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_ipq5018,
++		.svc_to_ce_map_len = SVC_CE_MAP_LEN_5018,
+ 		.rxdma1_enable = true,
+ 		.num_rxmda_per_pdev = RXDMA_PER_PDEV_5018,
+ 		.rx_mac_buf_ring = false,
+--- a/drivers/net/wireless/ath/ath11k/core.h
++++ b/drivers/net/wireless/ath/ath11k/core.h
+@@ -1146,6 +1146,9 @@ extern const struct service_to_pipe ath1
+ extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qca6390[];
+ extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qca6390[];
+ 
++extern const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq5018[];
++extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq5018[];
++
+ extern const struct ce_pipe_config ath11k_target_ce_config_wlan_qcn9074[];
+ extern const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_qcn9074[];
+ int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab);
+--- a/drivers/net/wireless/ath/ath11k/hw.c
++++ b/drivers/net/wireless/ath/ath11k/hw.c
+@@ -1972,6 +1972,197 @@ const struct ath11k_hw_ring_mask ath11k_
+ 	},
+ };
+ 
++/* Target firmware's Copy Engine configuration for IPQ5018 */
++const struct ce_pipe_config ath11k_target_ce_config_wlan_ipq5018[] = {
++	/* CE0: host->target HTC control and raw streams */
++	{
++		.pipenum = __cpu_to_le32(0),
++		.pipedir = __cpu_to_le32(PIPEDIR_OUT),
++		.nentries = __cpu_to_le32(32),
++		.nbytes_max = __cpu_to_le32(2048),
++		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
++		.reserved = __cpu_to_le32(0),
++	},
++
++	/* CE1: target->host HTT + HTC control */
++	{
++		.pipenum = __cpu_to_le32(1),
++		.pipedir = __cpu_to_le32(PIPEDIR_IN),
++		.nentries = __cpu_to_le32(32),
++		.nbytes_max = __cpu_to_le32(2048),
++		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
++		.reserved = __cpu_to_le32(0),
++	},
++
++	/* CE2: target->host WMI */
++	{
++		.pipenum = __cpu_to_le32(2),
++		.pipedir = __cpu_to_le32(PIPEDIR_IN),
++		.nentries = __cpu_to_le32(32),
++		.nbytes_max = __cpu_to_le32(2048),
++		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
++		.reserved = __cpu_to_le32(0),
++	},
++
++	/* CE3: host->target WMI */
++	{
++		.pipenum = __cpu_to_le32(3),
++		.pipedir = __cpu_to_le32(PIPEDIR_OUT),
++		.nentries = __cpu_to_le32(32),
++		.nbytes_max = __cpu_to_le32(2048),
++		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
++		.reserved = __cpu_to_le32(0),
++	},
++
++	/* CE4: host->target HTT */
++	{
++		.pipenum = __cpu_to_le32(4),
++		.pipedir = __cpu_to_le32(PIPEDIR_OUT),
++		.nentries = __cpu_to_le32(256),
++		.nbytes_max = __cpu_to_le32(256),
++		.flags = __cpu_to_le32(CE_ATTR_FLAGS | CE_ATTR_DIS_INTR),
++		.reserved = __cpu_to_le32(0),
++	},
++
++	/* CE5: target->host Pktlog */
++	{
++		.pipenum = __cpu_to_le32(5),
++		.pipedir = __cpu_to_le32(PIPEDIR_IN),
++		.nentries = __cpu_to_le32(32),
++		.nbytes_max = __cpu_to_le32(2048),
++		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
++		.reserved = __cpu_to_le32(0),
++	},
++
++	/* CE6: Reserved for target autonomous hif_memcpy */
++	{
++		.pipenum = __cpu_to_le32(6),
++		.pipedir = __cpu_to_le32(PIPEDIR_INOUT),
++		.nentries = __cpu_to_le32(32),
++		.nbytes_max = __cpu_to_le32(16384),
++		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
++		.reserved = __cpu_to_le32(0),
++	},
++
++	/* CE7 used only by Host */
++	{
++		.pipenum = __cpu_to_le32(7),
++		.pipedir = __cpu_to_le32(PIPEDIR_OUT),
++		.nentries = __cpu_to_le32(32),
++		.nbytes_max = __cpu_to_le32(2048),
++		.flags = __cpu_to_le32(0x2000),
++		.reserved = __cpu_to_le32(0),
++	},
++
++	/* CE8 target->host used only by IPA */
++	{
++		.pipenum = __cpu_to_le32(8),
++		.pipedir = __cpu_to_le32(PIPEDIR_INOUT),
++		.nentries = __cpu_to_le32(32),
++		.nbytes_max = __cpu_to_le32(16384),
++		.flags = __cpu_to_le32(CE_ATTR_FLAGS),
++		.reserved = __cpu_to_le32(0),
++	},
++};
++
++/* Map from service/endpoint to Copy Engine for IPQ5018.
++ * This table is derived from the CE TABLE, above.
++ * It is passed to the Target at startup for use by firmware.
++ */
++const struct service_to_pipe ath11k_target_service_to_ce_map_wlan_ipq5018[] = {
++	{
++		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO),
++		.pipedir = __cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
++		.pipenum = __cpu_to_le32(3),
++	},
++	{
++		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VO),
++		.pipedir = __cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
++		.pipenum = __cpu_to_le32(2),
++	},
++	{
++		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK),
++		.pipedir = __cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
++		.pipenum = __cpu_to_le32(3),
++	},
++	{
++		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BK),
++		.pipedir = __cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
++		.pipenum = __cpu_to_le32(2),
++	},
++	{
++		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE),
++		.pipedir = __cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
++		.pipenum = __cpu_to_le32(3),
++	},
++	{
++		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_BE),
++		.pipedir = __cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
++		.pipenum = __cpu_to_le32(2),
++	},
++	{
++		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI),
++		.pipedir = __cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
++		.pipenum = __cpu_to_le32(3),
++	},
++	{
++		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_DATA_VI),
++		.pipedir = __cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
++		.pipenum = __cpu_to_le32(2),
++	},
++	{
++		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL),
++		.pipedir = __cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
++		.pipenum = __cpu_to_le32(3),
++	},
++	{
++		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_WMI_CONTROL),
++		.pipedir = __cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
++		.pipenum = __cpu_to_le32(2),
++	},
++
++	{
++		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL),
++		.pipedir = __cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
++		.pipenum = __cpu_to_le32(0),
++	},
++	{
++		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_RSVD_CTRL),
++		.pipedir = __cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
++		.pipenum = __cpu_to_le32(1),
++	},
++
++	{
++		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_TEST_RAW_STREAMS),
++		.pipedir = __cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
++		.pipenum = __cpu_to_le32(0),
++	},
++	{
++		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_TEST_RAW_STREAMS),
++		.pipedir = __cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
++		.pipenum = __cpu_to_le32(1),
++	},
++	{
++		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG),
++		.pipedir = __cpu_to_le32(PIPEDIR_OUT),	/* out = UL = host -> target */
++		.pipenum = __cpu_to_le32(4),
++	},
++	{
++		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_HTT_DATA_MSG),
++		.pipedir = __cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
++		.pipenum = __cpu_to_le32(1),
++	},
++	{
++		.service_id = __cpu_to_le32(ATH11K_HTC_SVC_ID_PKT_LOG),
++		.pipedir = __cpu_to_le32(PIPEDIR_IN),	/* in = DL = target -> host */
++		.pipenum = __cpu_to_le32(5),
++	},
++
++       /* (Additions here) */
++
++	{ /* terminator entry */ }
++};
++
+ const struct ath11k_hw_regs ipq8074_regs = {
+ 	/* SW2TCL(x) R0 ring configuration address */
+ 	.hal_tcl1_ring_base_lsb = 0x00000510,
diff --git a/package/kernel/mac80211/patches/ath11k/0021-wifi-ath11k-remap-ce-register-space-for-IPQ5018.patch b/package/kernel/mac80211/patches/ath11k/0021-wifi-ath11k-remap-ce-register-space-for-IPQ5018.patch
new file mode 100644
index 0000000000..d07a258ac2
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath11k/0021-wifi-ath11k-remap-ce-register-space-for-IPQ5018.patch
@@ -0,0 +1,351 @@
+From b42b3678c91f3ca6e0888bf5a15c1e8678fd5f2d Mon Sep 17 00:00:00 2001
+From: Sriram R <quic_srirrama at quicinc.com>
+Date: Fri, 2 Dec 2022 23:37:14 +0200
+Subject: [PATCH] wifi: ath11k: remap ce register space for IPQ5018
+
+In IPQ5018 ce register space is moved out of wcss unlike
+ipq8074 or ipq6018 and the space is not contiguous,
+hence remap the CE registers to a new space to access them.
+
+Register read/write is modified to check if the register to be written
+falls in the CE register space and corresponding register is written.
+Also adjust the interrupt register address to ce irq enable/disable.
+
+Tested-on: IPQ5018 hw1.0 AHB WLAN.HK.2.6.0.1-00861-QCAHKSWPL_SILICONZ-1
+
+Signed-off-by: Sriram R <quic_srirrama at quicinc.com>
+Co-developed-by: Karthikeyan Kathirvel <quic_kathirve at quicinc.com>
+Signed-off-by: Karthikeyan Kathirvel <quic_kathirve at quicinc.com>
+Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>
+Link: https://lore.kernel.org/r/20221122132152.17771-5-quic_kathirve at quicinc.com
+---
+ drivers/net/wireless/ath/ath11k/ahb.c  | 44 ++++++++++++++++++++++----
+ drivers/net/wireless/ath/ath11k/ce.h   | 16 ++++++++++
+ drivers/net/wireless/ath/ath11k/core.c |  8 +++++
+ drivers/net/wireless/ath/ath11k/core.h |  1 +
+ drivers/net/wireless/ath/ath11k/hal.c  | 17 ++++++----
+ drivers/net/wireless/ath/ath11k/hal.h  |  5 +++
+ drivers/net/wireless/ath/ath11k/hw.c   | 17 ++++++++++
+ drivers/net/wireless/ath/ath11k/hw.h   |  9 ++++++
+ drivers/net/wireless/ath/ath11k/pci.c  |  2 ++
+ 9 files changed, 107 insertions(+), 12 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath11k/ahb.c
++++ b/drivers/net/wireless/ath/ath11k/ahb.c
+@@ -267,30 +267,42 @@ static void ath11k_ahb_clearbit32(struct
+ static void ath11k_ahb_ce_irq_enable(struct ath11k_base *ab, u16 ce_id)
+ {
+ 	const struct ce_attr *ce_attr;
++	const struct ce_ie_addr *ce_ie_addr = ab->hw_params.ce_ie_addr;
++	u32 ie1_reg_addr, ie2_reg_addr, ie3_reg_addr;
++
++	ie1_reg_addr = ce_ie_addr->ie1_reg_addr + ATH11K_CE_OFFSET(ab);
++	ie2_reg_addr = ce_ie_addr->ie2_reg_addr + ATH11K_CE_OFFSET(ab);
++	ie3_reg_addr = ce_ie_addr->ie3_reg_addr + ATH11K_CE_OFFSET(ab);
+ 
+ 	ce_attr = &ab->hw_params.host_ce_config[ce_id];
+ 	if (ce_attr->src_nentries)
+-		ath11k_ahb_setbit32(ab, ce_id, CE_HOST_IE_ADDRESS);
++		ath11k_ahb_setbit32(ab, ce_id, ie1_reg_addr);
+ 
+ 	if (ce_attr->dest_nentries) {
+-		ath11k_ahb_setbit32(ab, ce_id, CE_HOST_IE_2_ADDRESS);
++		ath11k_ahb_setbit32(ab, ce_id, ie2_reg_addr);
+ 		ath11k_ahb_setbit32(ab, ce_id + CE_HOST_IE_3_SHIFT,
+-				    CE_HOST_IE_3_ADDRESS);
++				    ie3_reg_addr);
+ 	}
+ }
+ 
+ static void ath11k_ahb_ce_irq_disable(struct ath11k_base *ab, u16 ce_id)
+ {
+ 	const struct ce_attr *ce_attr;
++	const struct ce_ie_addr *ce_ie_addr = ab->hw_params.ce_ie_addr;
++	u32 ie1_reg_addr, ie2_reg_addr, ie3_reg_addr;
++
++	ie1_reg_addr = ce_ie_addr->ie1_reg_addr + ATH11K_CE_OFFSET(ab);
++	ie2_reg_addr = ce_ie_addr->ie2_reg_addr + ATH11K_CE_OFFSET(ab);
++	ie3_reg_addr = ce_ie_addr->ie3_reg_addr + ATH11K_CE_OFFSET(ab);
+ 
+ 	ce_attr = &ab->hw_params.host_ce_config[ce_id];
+ 	if (ce_attr->src_nentries)
+-		ath11k_ahb_clearbit32(ab, ce_id, CE_HOST_IE_ADDRESS);
++		ath11k_ahb_clearbit32(ab, ce_id, ie1_reg_addr);
+ 
+ 	if (ce_attr->dest_nentries) {
+-		ath11k_ahb_clearbit32(ab, ce_id, CE_HOST_IE_2_ADDRESS);
++		ath11k_ahb_clearbit32(ab, ce_id, ie2_reg_addr);
+ 		ath11k_ahb_clearbit32(ab, ce_id + CE_HOST_IE_3_SHIFT,
+-				      CE_HOST_IE_3_ADDRESS);
++				      ie3_reg_addr);
+ 	}
+ }
+ 
+@@ -1142,10 +1154,26 @@ static int ath11k_ahb_probe(struct platf
+ 		goto err_core_free;
+ 	}
+ 
++	ab->mem_ce = ab->mem;
++
+ 	ret = ath11k_core_pre_init(ab);
+ 	if (ret)
+ 		goto err_core_free;
+ 
++	if (ab->hw_params.ce_remap) {
++		const struct ce_remap *ce_remap = ab->hw_params.ce_remap;
++		/* ce register space is moved out of wcss unlike ipq8074 or ipq6018
++		 * and the space is not contiguous, hence remapping the CE registers
++		 * to a new space for accessing them.
++		 */
++		ab->mem_ce = ioremap(ce_remap->base, ce_remap->size);
++		if (IS_ERR(ab->mem_ce)) {
++			dev_err(&pdev->dev, "ce ioremap error\n");
++			ret = -ENOMEM;
++			goto err_core_free;
++		}
++	}
++
+ 	ret = ath11k_ahb_setup_resources(ab);
+ 	if (ret)
+ 		goto err_core_free;
+@@ -1236,6 +1264,10 @@ static void ath11k_ahb_free_resources(st
+ 	ath11k_ahb_release_smp2p_handle(ab);
+ 	ath11k_ahb_fw_resource_deinit(ab);
+ 	ath11k_ce_free_pipes(ab);
++
++	if (ab->hw_params.ce_remap)
++		iounmap(ab->mem_ce);
++
+ 	ath11k_core_free(ab);
+ 	platform_set_drvdata(pdev, NULL);
+ }
+--- a/drivers/net/wireless/ath/ath11k/ce.h
++++ b/drivers/net/wireless/ath/ath11k/ce.h
+@@ -49,6 +49,11 @@ void ath11k_ce_byte_swap(void *mem, u32
+ #define CE_HOST_IE_2_ADDRESS	0x00A18040
+ #define CE_HOST_IE_3_ADDRESS	CE_HOST_IE_ADDRESS
+ 
++/* CE IE registers are different for IPQ5018 */
++#define CE_HOST_IPQ5018_IE_ADDRESS		0x0841804C
++#define CE_HOST_IPQ5018_IE_2_ADDRESS		0x08418050
++#define CE_HOST_IPQ5018_IE_3_ADDRESS		CE_HOST_IPQ5018_IE_ADDRESS
++
+ #define CE_HOST_IE_3_SHIFT	0xC
+ 
+ #define CE_RING_IDX_INCR(nentries_mask, idx) (((idx) + 1) & (nentries_mask))
+@@ -84,6 +89,17 @@ struct ce_pipe_config {
+ 	__le32 reserved;
+ };
+ 
++struct ce_ie_addr {
++	u32 ie1_reg_addr;
++	u32 ie2_reg_addr;
++	u32 ie3_reg_addr;
++};
++
++struct ce_remap {
++	u32 base;
++	u32 size;
++};
++
+ struct ce_attr {
+ 	/* CE_ATTR_* values */
+ 	unsigned int flags;
+--- a/drivers/net/wireless/ath/ath11k/core.c
++++ b/drivers/net/wireless/ath/ath11k/core.c
+@@ -54,6 +54,7 @@ static const struct ath11k_hw_params ath
+ 		.target_ce_count = 11,
+ 		.svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_ipq8074,
+ 		.svc_to_ce_map_len = 21,
++		.ce_ie_addr = &ath11k_ce_ie_addr_ipq8074,
+ 		.single_pdev_only = false,
+ 		.rxdma1_enable = true,
+ 		.num_rxmda_per_pdev = 1,
+@@ -137,6 +138,7 @@ static const struct ath11k_hw_params ath
+ 		.target_ce_count = 11,
+ 		.svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_ipq6018,
+ 		.svc_to_ce_map_len = 19,
++		.ce_ie_addr = &ath11k_ce_ie_addr_ipq8074,
+ 		.single_pdev_only = false,
+ 		.rxdma1_enable = true,
+ 		.num_rxmda_per_pdev = 1,
+@@ -218,6 +220,7 @@ static const struct ath11k_hw_params ath
+ 		.target_ce_count = 9,
+ 		.svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_qca6390,
+ 		.svc_to_ce_map_len = 14,
++		.ce_ie_addr = &ath11k_ce_ie_addr_ipq8074,
+ 		.single_pdev_only = true,
+ 		.rxdma1_enable = false,
+ 		.num_rxmda_per_pdev = 2,
+@@ -301,6 +304,7 @@ static const struct ath11k_hw_params ath
+ 		.target_ce_count = 9,
+ 		.svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_qcn9074,
+ 		.svc_to_ce_map_len = 18,
++		.ce_ie_addr = &ath11k_ce_ie_addr_ipq8074,
+ 		.rxdma1_enable = true,
+ 		.num_rxmda_per_pdev = 1,
+ 		.rx_mac_buf_ring = false,
+@@ -381,6 +385,7 @@ static const struct ath11k_hw_params ath
+ 		.target_ce_count = 9,
+ 		.svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_qca6390,
+ 		.svc_to_ce_map_len = 14,
++		.ce_ie_addr = &ath11k_ce_ie_addr_ipq8074,
+ 		.single_pdev_only = true,
+ 		.rxdma1_enable = false,
+ 		.num_rxmda_per_pdev = 2,
+@@ -546,6 +551,7 @@ static const struct ath11k_hw_params ath
+ 		.target_ce_count = 9,
+ 		.svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_qca6390,
+ 		.svc_to_ce_map_len = 14,
++		.ce_ie_addr = &ath11k_ce_ie_addr_ipq8074,
+ 		.single_pdev_only = true,
+ 		.rxdma1_enable = false,
+ 		.num_rxmda_per_pdev = 1,
+@@ -634,6 +640,8 @@ static const struct ath11k_hw_params ath
+ 		.target_ce_count = TARGET_CE_CNT_5018,
+ 		.svc_to_ce_map = ath11k_target_service_to_ce_map_wlan_ipq5018,
+ 		.svc_to_ce_map_len = SVC_CE_MAP_LEN_5018,
++		.ce_ie_addr = &ath11k_ce_ie_addr_ipq5018,
++		.ce_remap = &ath11k_ce_remap_ipq5018,
+ 		.rxdma1_enable = true,
+ 		.num_rxmda_per_pdev = RXDMA_PER_PDEV_5018,
+ 		.rx_mac_buf_ring = false,
+--- a/drivers/net/wireless/ath/ath11k/core.h
++++ b/drivers/net/wireless/ath/ath11k/core.h
+@@ -851,6 +851,7 @@ struct ath11k_base {
+ 	struct ath11k_dp dp;
+ 
+ 	void __iomem *mem;
++	void __iomem *mem_ce;
+ 	unsigned long mem_len;
+ 
+ 	struct {
+--- a/drivers/net/wireless/ath/ath11k/hal.c
++++ b/drivers/net/wireless/ath/ath11k/hal.c
+@@ -1220,16 +1220,20 @@ static int ath11k_hal_srng_create_config
+ 	s->reg_start[1] = HAL_SEQ_WCSS_UMAC_TCL_REG + HAL_TCL_STATUS_RING_HP;
+ 
+ 	s = &hal->srng_config[HAL_CE_SRC];
+-	s->reg_start[0] = HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab) + HAL_CE_DST_RING_BASE_LSB;
+-	s->reg_start[1] = HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab) + HAL_CE_DST_RING_HP;
++	s->reg_start[0] = HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab) + HAL_CE_DST_RING_BASE_LSB +
++		ATH11K_CE_OFFSET(ab);
++	s->reg_start[1] = HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab) + HAL_CE_DST_RING_HP +
++		ATH11K_CE_OFFSET(ab);
+ 	s->reg_size[0] = HAL_SEQ_WCSS_UMAC_CE1_SRC_REG(ab) -
+ 		HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab);
+ 	s->reg_size[1] = HAL_SEQ_WCSS_UMAC_CE1_SRC_REG(ab) -
+ 		HAL_SEQ_WCSS_UMAC_CE0_SRC_REG(ab);
+ 
+ 	s = &hal->srng_config[HAL_CE_DST];
+-	s->reg_start[0] = HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab) + HAL_CE_DST_RING_BASE_LSB;
+-	s->reg_start[1] = HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab) + HAL_CE_DST_RING_HP;
++	s->reg_start[0] = HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab) + HAL_CE_DST_RING_BASE_LSB +
++		ATH11K_CE_OFFSET(ab);
++	s->reg_start[1] = HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab) + HAL_CE_DST_RING_HP +
++		ATH11K_CE_OFFSET(ab);
+ 	s->reg_size[0] = HAL_SEQ_WCSS_UMAC_CE1_DST_REG(ab) -
+ 		HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab);
+ 	s->reg_size[1] = HAL_SEQ_WCSS_UMAC_CE1_DST_REG(ab) -
+@@ -1237,8 +1241,9 @@ static int ath11k_hal_srng_create_config
+ 
+ 	s = &hal->srng_config[HAL_CE_DST_STATUS];
+ 	s->reg_start[0] = HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab) +
+-		HAL_CE_DST_STATUS_RING_BASE_LSB;
+-	s->reg_start[1] = HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab) + HAL_CE_DST_STATUS_RING_HP;
++		HAL_CE_DST_STATUS_RING_BASE_LSB + ATH11K_CE_OFFSET(ab);
++	s->reg_start[1] = HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab) + HAL_CE_DST_STATUS_RING_HP +
++		ATH11K_CE_OFFSET(ab);
+ 	s->reg_size[0] = HAL_SEQ_WCSS_UMAC_CE1_DST_REG(ab) -
+ 		HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab);
+ 	s->reg_size[1] = HAL_SEQ_WCSS_UMAC_CE1_DST_REG(ab) -
+--- a/drivers/net/wireless/ath/ath11k/hal.h
++++ b/drivers/net/wireless/ath/ath11k/hal.h
+@@ -321,6 +321,10 @@ struct ath11k_base;
+ #define HAL_WBM2SW_RELEASE_RING_BASE_MSB_RING_SIZE	0x000fffff
+ #define HAL_RXDMA_RING_MAX_SIZE				0x0000ffff
+ 
++/* IPQ5018 ce registers */
++#define HAL_IPQ5018_CE_WFSS_REG_BASE		0x08400000
++#define HAL_IPQ5018_CE_SIZE			0x200000
++
+ /* Add any other errors here and return them in
+  * ath11k_hal_rx_desc_get_err().
+  */
+@@ -519,6 +523,7 @@ enum hal_srng_dir {
+ #define HAL_SRNG_FLAGS_MSI_INTR			0x00020000
+ #define HAL_SRNG_FLAGS_CACHED                   0x20000000
+ #define HAL_SRNG_FLAGS_LMAC_RING		0x80000000
++#define HAL_SRNG_FLAGS_REMAP_CE_RING        0x10000000
+ 
+ #define HAL_SRNG_TLV_HDR_TAG		GENMASK(9, 1)
+ #define HAL_SRNG_TLV_HDR_LEN		GENMASK(25, 10)
+--- a/drivers/net/wireless/ath/ath11k/hw.c
++++ b/drivers/net/wireless/ath/ath11k/hw.c
+@@ -2163,6 +2163,23 @@ const struct service_to_pipe ath11k_targ
+ 	{ /* terminator entry */ }
+ };
+ 
++const struct ce_ie_addr ath11k_ce_ie_addr_ipq8074 = {
++	.ie1_reg_addr = CE_HOST_IE_ADDRESS,
++	.ie2_reg_addr = CE_HOST_IE_2_ADDRESS,
++	.ie3_reg_addr = CE_HOST_IE_3_ADDRESS,
++};
++
++const struct ce_ie_addr ath11k_ce_ie_addr_ipq5018 = {
++	.ie1_reg_addr = CE_HOST_IPQ5018_IE_ADDRESS - HAL_IPQ5018_CE_WFSS_REG_BASE,
++	.ie2_reg_addr = CE_HOST_IPQ5018_IE_2_ADDRESS - HAL_IPQ5018_CE_WFSS_REG_BASE,
++	.ie3_reg_addr = CE_HOST_IPQ5018_IE_3_ADDRESS - HAL_IPQ5018_CE_WFSS_REG_BASE,
++};
++
++const struct ce_remap ath11k_ce_remap_ipq5018 = {
++	.base = HAL_IPQ5018_CE_WFSS_REG_BASE,
++	.size = HAL_IPQ5018_CE_SIZE,
++};
++
+ const struct ath11k_hw_regs ipq8074_regs = {
+ 	/* SW2TCL(x) R0 ring configuration address */
+ 	.hal_tcl1_ring_base_lsb = 0x00000510,
+--- a/drivers/net/wireless/ath/ath11k/hw.h
++++ b/drivers/net/wireless/ath/ath11k/hw.h
+@@ -80,6 +80,8 @@
+ #define ATH11K_M3_FILE			"m3.bin"
+ #define ATH11K_REGDB_FILE_NAME		"regdb.bin"
+ 
++#define ATH11K_CE_OFFSET(ab)	(ab->mem_ce - ab->mem)
++
+ enum ath11k_hw_rate_cck {
+ 	ATH11K_HW_RATE_CCK_LP_11M = 0,
+ 	ATH11K_HW_RATE_CCK_LP_5_5M,
+@@ -158,6 +160,8 @@ struct ath11k_hw_params {
+ 	u32 target_ce_count;
+ 	const struct service_to_pipe *svc_to_ce_map;
+ 	u32 svc_to_ce_map_len;
++	const struct ce_ie_addr *ce_ie_addr;
++	const struct ce_remap *ce_remap;
+ 
+ 	bool single_pdev_only;
+ 
+@@ -277,6 +281,11 @@ extern const struct ath11k_hw_ring_mask
+ extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qcn9074;
+ extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_wcn6750;
+ 
++extern const struct ce_ie_addr ath11k_ce_ie_addr_ipq8074;
++extern const struct ce_ie_addr ath11k_ce_ie_addr_ipq5018;
++
++extern const struct ce_remap ath11k_ce_remap_ipq5018;
++
+ extern const struct ath11k_hw_hal_params ath11k_hw_hal_params_ipq8074;
+ extern const struct ath11k_hw_hal_params ath11k_hw_hal_params_qca6390;
+ extern const struct ath11k_hw_hal_params ath11k_hw_hal_params_wcn6750;
+--- a/drivers/net/wireless/ath/ath11k/pci.c
++++ b/drivers/net/wireless/ath/ath11k/pci.c
+@@ -543,6 +543,8 @@ static int ath11k_pci_claim(struct ath11
+ 		goto clear_master;
+ 	}
+ 
++	ab->mem_ce = ab->mem;
++
+ 	ath11k_dbg(ab, ATH11K_DBG_BOOT, "boot pci_mem 0x%pK\n", ab->mem);
+ 	return 0;
+ 
diff --git a/package/kernel/mac80211/patches/ath11k/0022-wifi-ath11k-update-hal-srng-regs-for-IPQ5018.patch b/package/kernel/mac80211/patches/ath11k/0022-wifi-ath11k-update-hal-srng-regs-for-IPQ5018.patch
new file mode 100644
index 0000000000..35ea20a3c4
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath11k/0022-wifi-ath11k-update-hal-srng-regs-for-IPQ5018.patch
@@ -0,0 +1,130 @@
+From 711b80acbdfb9667a9cf8374e13320a6e624ce73 Mon Sep 17 00:00:00 2001
+From: Sriram R <quic_srirrama at quicinc.com>
+Date: Fri, 2 Dec 2022 23:37:14 +0200
+Subject: [PATCH] wifi: ath11k: update hal srng regs for IPQ5018
+
+IPQ5018 hal srng register address & offsets are not
+similar to IPQ8074/IPQ6018/QCN9074, hence define a
+new set of srng register group data for IPQ5018.
+
+Tested-on: IPQ5018 hw1.0 AHB WLAN.HK.2.6.0.1-00861-QCAHKSWPL_SILICONZ-1
+
+Signed-off-by: Sriram R <quic_srirrama at quicinc.com>
+Co-developed-by: Karthikeyan Kathirvel <quic_kathirve at quicinc.com>
+Signed-off-by: Karthikeyan Kathirvel <quic_kathirve at quicinc.com>
+Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>
+Link: https://lore.kernel.org/r/20221122132152.17771-6-quic_kathirve at quicinc.com
+---
+ drivers/net/wireless/ath/ath11k/core.c |  1 +
+ drivers/net/wireless/ath/ath11k/hw.c   | 79 ++++++++++++++++++++++++++
+ drivers/net/wireless/ath/ath11k/hw.h   |  1 +
+ 3 files changed, 81 insertions(+)
+
+--- a/drivers/net/wireless/ath/ath11k/core.c
++++ b/drivers/net/wireless/ath/ath11k/core.c
+@@ -634,6 +634,7 @@ static const struct ath11k_hw_params ath
+ 			.max_fft_bins = 1024,
+ 		},
+ 		.internal_sleep_clock = false,
++		.regs = &ipq5018_regs,
+ 		.host_ce_config = ath11k_host_ce_config_qcn9074,
+ 		.ce_count = CE_CNT_5018,
+ 		.target_ce_config = ath11k_target_ce_config_wlan_ipq5018,
+--- a/drivers/net/wireless/ath/ath11k/hw.c
++++ b/drivers/net/wireless/ath/ath11k/hw.c
+@@ -2645,6 +2645,85 @@ static const struct ath11k_hw_tcl2wbm_rb
+ 	},
+ };
+ 
++const struct ath11k_hw_regs ipq5018_regs = {
++	/* SW2TCL(x) R0 ring configuration address */
++	.hal_tcl1_ring_base_lsb = 0x00000694,
++	.hal_tcl1_ring_base_msb = 0x00000698,
++	.hal_tcl1_ring_id =	0x0000069c,
++	.hal_tcl1_ring_misc = 0x000006a4,
++	.hal_tcl1_ring_tp_addr_lsb = 0x000006b0,
++	.hal_tcl1_ring_tp_addr_msb = 0x000006b4,
++	.hal_tcl1_ring_consumer_int_setup_ix0 = 0x000006c4,
++	.hal_tcl1_ring_consumer_int_setup_ix1 = 0x000006c8,
++	.hal_tcl1_ring_msi1_base_lsb = 0x000006dc,
++	.hal_tcl1_ring_msi1_base_msb = 0x000006e0,
++	.hal_tcl1_ring_msi1_data = 0x000006e4,
++	.hal_tcl2_ring_base_lsb = 0x000006ec,
++	.hal_tcl_ring_base_lsb = 0x0000079c,
++
++	/* TCL STATUS ring address */
++	.hal_tcl_status_ring_base_lsb = 0x000008a4,
++
++	/* REO2SW(x) R0 ring configuration address */
++	.hal_reo1_ring_base_lsb = 0x000001ec,
++	.hal_reo1_ring_base_msb = 0x000001f0,
++	.hal_reo1_ring_id = 0x000001f4,
++	.hal_reo1_ring_misc = 0x000001fc,
++	.hal_reo1_ring_hp_addr_lsb = 0x00000200,
++	.hal_reo1_ring_hp_addr_msb = 0x00000204,
++	.hal_reo1_ring_producer_int_setup = 0x00000210,
++	.hal_reo1_ring_msi1_base_lsb = 0x00000234,
++	.hal_reo1_ring_msi1_base_msb = 0x00000238,
++	.hal_reo1_ring_msi1_data = 0x0000023c,
++	.hal_reo2_ring_base_lsb = 0x00000244,
++	.hal_reo1_aging_thresh_ix_0 = 0x00000564,
++	.hal_reo1_aging_thresh_ix_1 = 0x00000568,
++	.hal_reo1_aging_thresh_ix_2 = 0x0000056c,
++	.hal_reo1_aging_thresh_ix_3 = 0x00000570,
++
++	/* REO2SW(x) R2 ring pointers (head/tail) address */
++	.hal_reo1_ring_hp = 0x00003028,
++	.hal_reo1_ring_tp = 0x0000302c,
++	.hal_reo2_ring_hp = 0x00003030,
++
++	/* REO2TCL R0 ring configuration address */
++	.hal_reo_tcl_ring_base_lsb = 0x000003fc,
++	.hal_reo_tcl_ring_hp = 0x00003058,
++
++	/* SW2REO ring address */
++	.hal_sw2reo_ring_base_lsb = 0x0000013c,
++	.hal_sw2reo_ring_hp = 0x00003018,
++
++	/* REO CMD ring address */
++	.hal_reo_cmd_ring_base_lsb = 0x000000e4,
++	.hal_reo_cmd_ring_hp = 0x00003010,
++
++	/* REO status address */
++	.hal_reo_status_ring_base_lsb = 0x00000504,
++	.hal_reo_status_hp = 0x00003070,
++
++	/* WCSS relative address */
++	.hal_seq_wcss_umac_ce0_src_reg = 0x08400000
++		- HAL_IPQ5018_CE_WFSS_REG_BASE,
++	.hal_seq_wcss_umac_ce0_dst_reg = 0x08401000
++		- HAL_IPQ5018_CE_WFSS_REG_BASE,
++	.hal_seq_wcss_umac_ce1_src_reg = 0x08402000
++		- HAL_IPQ5018_CE_WFSS_REG_BASE,
++	.hal_seq_wcss_umac_ce1_dst_reg = 0x08403000
++		- HAL_IPQ5018_CE_WFSS_REG_BASE,
++
++	/* WBM Idle address */
++	.hal_wbm_idle_link_ring_base_lsb = 0x00000874,
++	.hal_wbm_idle_link_ring_misc = 0x00000884,
++
++	/* SW2WBM release address */
++	.hal_wbm_release_ring_base_lsb = 0x000001ec,
++
++	/* WBM2SW release address */
++	.hal_wbm0_release_ring_base_lsb = 0x00000924,
++	.hal_wbm1_release_ring_base_lsb = 0x0000097c,
++};
++
+ const struct ath11k_hw_hal_params ath11k_hw_hal_params_ipq8074 = {
+ 	.rx_buf_rbm = HAL_RX_BUF_RBM_SW3_BM,
+ 	.tcl2wbm_rbm_map = ath11k_hw_tcl2wbm_rbm_map_ipq8074,
+--- a/drivers/net/wireless/ath/ath11k/hw.h
++++ b/drivers/net/wireless/ath/ath11k/hw.h
+@@ -415,6 +415,7 @@ extern const struct ath11k_hw_regs qca63
+ extern const struct ath11k_hw_regs qcn9074_regs;
+ extern const struct ath11k_hw_regs wcn6855_regs;
+ extern const struct ath11k_hw_regs wcn6750_regs;
++extern const struct ath11k_hw_regs ipq5018_regs;
+ 
+ static inline const char *ath11k_bd_ie_type_str(enum ath11k_bd_ie_type type)
+ {
diff --git a/package/kernel/mac80211/patches/ath11k/0023-wifi-ath11k-initialize-hw_ops-for-IPQ5018.patch b/package/kernel/mac80211/patches/ath11k/0023-wifi-ath11k-initialize-hw_ops-for-IPQ5018.patch
new file mode 100644
index 0000000000..5ef701a445
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath11k/0023-wifi-ath11k-initialize-hw_ops-for-IPQ5018.patch
@@ -0,0 +1,90 @@
+From ba60f2793d3a37a00da14bb56a26558a902d2831 Mon Sep 17 00:00:00 2001
+From: Sriram R <quic_srirrama at quicinc.com>
+Date: Fri, 2 Dec 2022 23:37:14 +0200
+Subject: [PATCH] wifi: ath11k: initialize hw_ops for IPQ5018
+
+The ipq5018_ops is initialized for IPQ5018. This is different from
+other platforms.
+
+Tested-on: IPQ5018 hw1.0 AHB WLAN.HK.2.6.0.1-00861-QCAHKSWPL_SILICONZ-1
+
+Signed-off-by: Sriram R <quic_srirrama at quicinc.com>
+Co-developed-by: Karthikeyan Kathirvel <quic_kathirve at quicinc.com>
+Signed-off-by: Karthikeyan Kathirvel <quic_kathirve at quicinc.com>
+Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>
+Link: https://lore.kernel.org/r/20221122132152.17771-7-quic_kathirve at quicinc.com
+---
+ drivers/net/wireless/ath/ath11k/core.c |  1 +
+ drivers/net/wireless/ath/ath11k/hw.c   | 40 ++++++++++++++++++++++++++
+ drivers/net/wireless/ath/ath11k/hw.h   |  1 +
+ 3 files changed, 42 insertions(+)
+
+--- a/drivers/net/wireless/ath/ath11k/core.c
++++ b/drivers/net/wireless/ath/ath11k/core.c
+@@ -635,6 +635,7 @@ static const struct ath11k_hw_params ath
+ 		},
+ 		.internal_sleep_clock = false,
+ 		.regs = &ipq5018_regs,
++		.hw_ops = &ipq5018_ops,
+ 		.host_ce_config = ath11k_host_ce_config_qcn9074,
+ 		.ce_count = CE_CNT_5018,
+ 		.target_ce_config = ath11k_target_ce_config_wlan_ipq5018,
+--- a/drivers/net/wireless/ath/ath11k/hw.c
++++ b/drivers/net/wireless/ath/ath11k/hw.c
+@@ -1084,6 +1084,46 @@ const struct ath11k_hw_ops wcn6750_ops =
+ 	.get_ring_selector = ath11k_hw_wcn6750_get_tcl_ring_selector,
+ };
+ 
++/* IPQ5018 hw ops is similar to QCN9074 except for the dest ring remap */
++const struct ath11k_hw_ops ipq5018_ops = {
++	.get_hw_mac_from_pdev_id = ath11k_hw_ipq6018_mac_from_pdev_id,
++	.wmi_init_config = ath11k_init_wmi_config_ipq8074,
++	.mac_id_to_pdev_id = ath11k_hw_mac_id_to_pdev_id_ipq8074,
++	.mac_id_to_srng_id = ath11k_hw_mac_id_to_srng_id_ipq8074,
++	.tx_mesh_enable = ath11k_hw_qcn9074_tx_mesh_enable,
++	.rx_desc_get_first_msdu = ath11k_hw_qcn9074_rx_desc_get_first_msdu,
++	.rx_desc_get_last_msdu = ath11k_hw_qcn9074_rx_desc_get_last_msdu,
++	.rx_desc_get_l3_pad_bytes = ath11k_hw_qcn9074_rx_desc_get_l3_pad_bytes,
++	.rx_desc_get_hdr_status = ath11k_hw_qcn9074_rx_desc_get_hdr_status,
++	.rx_desc_encrypt_valid = ath11k_hw_qcn9074_rx_desc_encrypt_valid,
++	.rx_desc_get_encrypt_type = ath11k_hw_qcn9074_rx_desc_get_encrypt_type,
++	.rx_desc_get_decap_type = ath11k_hw_qcn9074_rx_desc_get_decap_type,
++	.rx_desc_get_mesh_ctl = ath11k_hw_qcn9074_rx_desc_get_mesh_ctl,
++	.rx_desc_get_ldpc_support = ath11k_hw_qcn9074_rx_desc_get_ldpc_support,
++	.rx_desc_get_mpdu_seq_ctl_vld = ath11k_hw_qcn9074_rx_desc_get_mpdu_seq_ctl_vld,
++	.rx_desc_get_mpdu_fc_valid = ath11k_hw_qcn9074_rx_desc_get_mpdu_fc_valid,
++	.rx_desc_get_mpdu_start_seq_no = ath11k_hw_qcn9074_rx_desc_get_mpdu_start_seq_no,
++	.rx_desc_get_msdu_len = ath11k_hw_qcn9074_rx_desc_get_msdu_len,
++	.rx_desc_get_msdu_sgi = ath11k_hw_qcn9074_rx_desc_get_msdu_sgi,
++	.rx_desc_get_msdu_rate_mcs = ath11k_hw_qcn9074_rx_desc_get_msdu_rate_mcs,
++	.rx_desc_get_msdu_rx_bw = ath11k_hw_qcn9074_rx_desc_get_msdu_rx_bw,
++	.rx_desc_get_msdu_freq = ath11k_hw_qcn9074_rx_desc_get_msdu_freq,
++	.rx_desc_get_msdu_pkt_type = ath11k_hw_qcn9074_rx_desc_get_msdu_pkt_type,
++	.rx_desc_get_msdu_nss = ath11k_hw_qcn9074_rx_desc_get_msdu_nss,
++	.rx_desc_get_mpdu_tid = ath11k_hw_qcn9074_rx_desc_get_mpdu_tid,
++	.rx_desc_get_mpdu_peer_id = ath11k_hw_qcn9074_rx_desc_get_mpdu_peer_id,
++	.rx_desc_copy_attn_end_tlv = ath11k_hw_qcn9074_rx_desc_copy_attn_end,
++	.rx_desc_get_mpdu_start_tag = ath11k_hw_qcn9074_rx_desc_get_mpdu_start_tag,
++	.rx_desc_get_mpdu_ppdu_id = ath11k_hw_qcn9074_rx_desc_get_mpdu_ppdu_id,
++	.rx_desc_set_msdu_len = ath11k_hw_qcn9074_rx_desc_set_msdu_len,
++	.rx_desc_get_attention = ath11k_hw_qcn9074_rx_desc_get_attention,
++	.rx_desc_get_msdu_payload = ath11k_hw_qcn9074_rx_desc_get_msdu_payload,
++	.mpdu_info_get_peerid = ath11k_hw_ipq8074_mpdu_info_get_peerid,
++	.rx_desc_mac_addr2_valid = ath11k_hw_ipq9074_rx_desc_mac_addr2_valid,
++	.rx_desc_mpdu_start_addr2 = ath11k_hw_ipq9074_rx_desc_mpdu_start_addr2,
++
++};
++
+ #define ATH11K_TX_RING_MASK_0 BIT(0)
+ #define ATH11K_TX_RING_MASK_1 BIT(1)
+ #define ATH11K_TX_RING_MASK_2 BIT(2)
+--- a/drivers/net/wireless/ath/ath11k/hw.h
++++ b/drivers/net/wireless/ath/ath11k/hw.h
+@@ -275,6 +275,7 @@ extern const struct ath11k_hw_ops qca639
+ extern const struct ath11k_hw_ops qcn9074_ops;
+ extern const struct ath11k_hw_ops wcn6855_ops;
+ extern const struct ath11k_hw_ops wcn6750_ops;
++extern const struct ath11k_hw_ops ipq5018_ops;
+ 
+ extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_ipq8074;
+ extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qca6390;
diff --git a/package/kernel/mac80211/patches/ath11k/0024-wifi-ath11k-add-new-hw-ops-for-IPQ5018-to-get-rx-des.patch b/package/kernel/mac80211/patches/ath11k/0024-wifi-ath11k-add-new-hw-ops-for-IPQ5018-to-get-rx-des.patch
new file mode 100644
index 0000000000..64531f13f8
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath11k/0024-wifi-ath11k-add-new-hw-ops-for-IPQ5018-to-get-rx-des.patch
@@ -0,0 +1,84 @@
+From 69968f88f1770d61cae0febef805fd00d66cf6a1 Mon Sep 17 00:00:00 2001
+From: Sriram R <quic_srirrama at quicinc.com>
+Date: Fri, 2 Dec 2022 23:37:15 +0200
+Subject: [PATCH] wifi: ath11k: add new hw ops for IPQ5018 to get rx dest ring
+ hashmap
+
+The Destination ring control register is different
+for IPQ5018 when compared to IPQ8074/IPQ6018/QCN9074.
+Hence create a new hw ops to fetch the hash ring map
+for different device variants. ipq5018 hw ops
+is similar to qcn9074 except for this change, so reuse
+all the qcn9074 ops for ipq5018.
+
+Tested-on: IPQ5018 hw1.0 AHB WLAN.HK.2.6.0.1-00861-QCAHKSWPL_SILICONZ-1
+
+Signed-off-by: Sriram R <quic_srirrama at quicinc.com>
+Co-developed-by: Karthikeyan Kathirvel <quic_kathirve at quicinc.com>
+Signed-off-by: Karthikeyan Kathirvel <quic_kathirve at quicinc.com>
+Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>
+Link: https://lore.kernel.org/r/20221122132152.17771-8-quic_kathirve at quicinc.com
+---
+ drivers/net/wireless/ath/ath11k/hw.c | 44 ++++++++++++++++++++++++++++
+ 1 file changed, 44 insertions(+)
+
+--- a/drivers/net/wireless/ath/ath11k/hw.c
++++ b/drivers/net/wireless/ath/ath11k/hw.c
+@@ -791,6 +791,49 @@ static void ath11k_hw_wcn6855_reo_setup(
+ 			   ring_hash_map);
+ }
+ 
++static void ath11k_hw_ipq5018_reo_setup(struct ath11k_base *ab)
++{
++	u32 reo_base = HAL_SEQ_WCSS_UMAC_REO_REG;
++	u32 val;
++
++	/* Each hash entry uses three bits to map to a particular ring. */
++	u32 ring_hash_map = HAL_HASH_ROUTING_RING_SW1 << 0 |
++		HAL_HASH_ROUTING_RING_SW2 << 4 |
++		HAL_HASH_ROUTING_RING_SW3 << 8 |
++		HAL_HASH_ROUTING_RING_SW4 << 12 |
++		HAL_HASH_ROUTING_RING_SW1 << 16 |
++		HAL_HASH_ROUTING_RING_SW2 << 20 |
++		HAL_HASH_ROUTING_RING_SW3 << 24 |
++		HAL_HASH_ROUTING_RING_SW4 << 28;
++
++	val = ath11k_hif_read32(ab, reo_base + HAL_REO1_GEN_ENABLE);
++
++	val &= ~HAL_REO1_GEN_ENABLE_FRAG_DST_RING;
++	val |= FIELD_PREP(HAL_REO1_GEN_ENABLE_FRAG_DST_RING,
++			HAL_SRNG_RING_ID_REO2SW1) |
++		FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_LIST_ENABLE, 1) |
++		FIELD_PREP(HAL_REO1_GEN_ENABLE_AGING_FLUSH_ENABLE, 1);
++	ath11k_hif_write32(ab, reo_base + HAL_REO1_GEN_ENABLE, val);
++
++	ath11k_hif_write32(ab, reo_base + HAL_REO1_AGING_THRESH_IX_0(ab),
++			   HAL_DEFAULT_REO_TIMEOUT_USEC);
++	ath11k_hif_write32(ab, reo_base + HAL_REO1_AGING_THRESH_IX_1(ab),
++			   HAL_DEFAULT_REO_TIMEOUT_USEC);
++	ath11k_hif_write32(ab, reo_base + HAL_REO1_AGING_THRESH_IX_2(ab),
++			   HAL_DEFAULT_REO_TIMEOUT_USEC);
++	ath11k_hif_write32(ab, reo_base + HAL_REO1_AGING_THRESH_IX_3(ab),
++			   HAL_DEFAULT_REO_TIMEOUT_USEC);
++
++	ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_0,
++			   ring_hash_map);
++	ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_1,
++			   ring_hash_map);
++	ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_2,
++			   ring_hash_map);
++	ath11k_hif_write32(ab, reo_base + HAL_REO1_DEST_RING_CTRL_IX_3,
++			   ring_hash_map);
++}
++
+ static u16 ath11k_hw_ipq8074_mpdu_info_get_peerid(u8 *tlv_data)
+ {
+ 	u16 peer_id = 0;
+@@ -1117,6 +1160,7 @@ const struct ath11k_hw_ops ipq5018_ops =
+ 	.rx_desc_get_mpdu_ppdu_id = ath11k_hw_qcn9074_rx_desc_get_mpdu_ppdu_id,
+ 	.rx_desc_set_msdu_len = ath11k_hw_qcn9074_rx_desc_set_msdu_len,
+ 	.rx_desc_get_attention = ath11k_hw_qcn9074_rx_desc_get_attention,
++	.reo_setup = ath11k_hw_ipq5018_reo_setup,
+ 	.rx_desc_get_msdu_payload = ath11k_hw_qcn9074_rx_desc_get_msdu_payload,
+ 	.mpdu_info_get_peerid = ath11k_hw_ipq8074_mpdu_info_get_peerid,
+ 	.rx_desc_mac_addr2_valid = ath11k_hw_ipq9074_rx_desc_mac_addr2_valid,
diff --git a/package/kernel/mac80211/patches/ath11k/0025-wifi-ath11k-add-ipq5018-device-support.patch b/package/kernel/mac80211/patches/ath11k/0025-wifi-ath11k-add-ipq5018-device-support.patch
new file mode 100644
index 0000000000..5b930e8d4f
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath11k/0025-wifi-ath11k-add-ipq5018-device-support.patch
@@ -0,0 +1,31 @@
+From 25edca7bb18a2a40cc7e54c6f522e9b3c917e2c5 Mon Sep 17 00:00:00 2001
+From: Sriram R <quic_srirrama at quicinc.com>
+Date: Fri, 2 Dec 2022 23:37:15 +0200
+Subject: [PATCH] wifi: ath11k: add ipq5018 device support
+
+ipq5018 is a ahb 2ghz device, enable the compatible support for
+ipq5018 in ahb.
+
+Tested-on: IPQ5018 hw1.0 AHB WLAN.HK.2.6.0.1-00861-QCAHKSWPL_SILICONZ-1
+
+Signed-off-by: Sriram R <quic_srirrama at quicinc.com>
+Co-developed-by: Karthikeyan Kathirvel <quic_kathirve at quicinc.com>
+Signed-off-by: Karthikeyan Kathirvel <quic_kathirve at quicinc.com>
+Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>
+Link: https://lore.kernel.org/r/20221122132152.17771-9-quic_kathirve at quicinc.com
+---
+ drivers/net/wireless/ath/ath11k/ahb.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/drivers/net/wireless/ath/ath11k/ahb.c
++++ b/drivers/net/wireless/ath/ath11k/ahb.c
+@@ -32,6 +32,9 @@ static const struct of_device_id ath11k_
+ 	{ .compatible = "qcom,wcn6750-wifi",
+ 	  .data = (void *)ATH11K_HW_WCN6750_HW10,
+ 	},
++	{ .compatible = "qcom,ipq5018-wifi",
++	  .data = (void *)ATH11K_HW_IPQ5018_HW10,
++	},
+ 	{ }
+ };
+ 
diff --git a/package/kernel/mac80211/patches/ath11k/0019-wifi-ath11k-Fix-scan-request-param-frame-size-warnin.patch b/package/kernel/mac80211/patches/ath11k/0026-wifi-ath11k-Fix-scan-request-param-frame-size-warnin.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath11k/0019-wifi-ath11k-Fix-scan-request-param-frame-size-warnin.patch
rename to package/kernel/mac80211/patches/ath11k/0026-wifi-ath11k-Fix-scan-request-param-frame-size-warnin.patch
diff --git a/package/kernel/mac80211/patches/ath11k/0020-wifi-ath11k-fix-monitor-mode-bringup-crash.patch b/package/kernel/mac80211/patches/ath11k/0027-wifi-ath11k-fix-monitor-mode-bringup-crash.patch
similarity index 100%
rename from package/kernel/mac80211/patches/ath11k/0020-wifi-ath11k-fix-monitor-mode-bringup-crash.patch
rename to package/kernel/mac80211/patches/ath11k/0027-wifi-ath11k-fix-monitor-mode-bringup-crash.patch
diff --git a/package/kernel/mac80211/patches/ath11k/0021-wifi-ath11k-debugfs-fix-to-work-with-multiple-PCI-de.patch b/package/kernel/mac80211/patches/ath11k/0028-wifi-ath11k-debugfs-fix-to-work-with-multiple-PCI-de.patch
similarity index 99%
rename from package/kernel/mac80211/patches/ath11k/0021-wifi-ath11k-debugfs-fix-to-work-with-multiple-PCI-de.patch
rename to package/kernel/mac80211/patches/ath11k/0028-wifi-ath11k-debugfs-fix-to-work-with-multiple-PCI-de.patch
index bd72b6314b..225c4b4316 100644
--- a/package/kernel/mac80211/patches/ath11k/0021-wifi-ath11k-debugfs-fix-to-work-with-multiple-PCI-de.patch
+++ b/package/kernel/mac80211/patches/ath11k/0028-wifi-ath11k-debugfs-fix-to-work-with-multiple-PCI-de.patch
@@ -60,7 +60,7 @@ Link: https://lore.kernel.org/r/20221220121231.20120-1-kvalo at kernel.org
 
 --- a/drivers/net/wireless/ath/ath11k/core.h
 +++ b/drivers/net/wireless/ath/ath11k/core.h
-@@ -912,7 +912,6 @@ struct ath11k_base {
+@@ -921,7 +921,6 @@ struct ath11k_base {
  	enum ath11k_dfs_region dfs_region;
  #ifdef CPTCFG_ATH11K_DEBUGFS
  	struct dentry *debugfs_soc;
diff --git a/package/kernel/mac80211/patches/ath11k/0029-wifi-ath11k-Add-support-to-configure-FTM-responder-r.patch b/package/kernel/mac80211/patches/ath11k/0029-wifi-ath11k-Add-support-to-configure-FTM-responder-r.patch
new file mode 100644
index 0000000000..f652d689b5
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath11k/0029-wifi-ath11k-Add-support-to-configure-FTM-responder-r.patch
@@ -0,0 +1,169 @@
+From a27c6a5853eb9d4f293b99be73a6891fe88263c7 Mon Sep 17 00:00:00 2001
+From: Sowmiya Sree Elavalagan <quic_ssreeela at quicinc.com>
+Date: Tue, 10 Jan 2023 15:30:57 +0200
+Subject: [PATCH] wifi: ath11k: Add support to configure FTM responder role
+
+Fine Timing Measurement(FTM) support is used to measure round trip
+time between two nodes.
+
+Enable FTM responder feature using hw_params on supported device.
+Since FTM functionality is offloaded to firmware, adding the
+interface allows user space to enable or disable FTM responder.
+Also add support for advertising the same in extended capabilities.
+
+QCA6390, WCN6855 and WCN6750 do not support this feature.
+
+Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
+Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
+
+Signed-off-by: Sowmiya Sree Elavalagan <quic_ssreeela at quicinc.com>
+Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag at quicinc.com>
+Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>
+Link: https://lore.kernel.org/r/20221220044435.10506-1-quic_rajkbhag at quicinc.com
+---
+ drivers/net/wireless/ath/ath11k/core.c |  8 ++++++++
+ drivers/net/wireless/ath/ath11k/core.h |  1 +
+ drivers/net/wireless/ath/ath11k/hw.h   |  1 +
+ drivers/net/wireless/ath/ath11k/mac.c  | 20 +++++++++++++++++++-
+ drivers/net/wireless/ath/ath11k/wmi.h  |  1 +
+ 5 files changed, 30 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/ath/ath11k/core.c
++++ b/drivers/net/wireless/ath/ath11k/core.c
+@@ -116,6 +116,7 @@ static const struct ath11k_hw_params ath
+ 		.tcl_ring_retry = true,
+ 		.tx_ring_size = DP_TCL_DATA_RING_SIZE,
+ 		.smp2p_wow_exit = false,
++		.ftm_responder = true,
+ 	},
+ 	{
+ 		.hw_rev = ATH11K_HW_IPQ6018_HW10,
+@@ -198,6 +199,7 @@ static const struct ath11k_hw_params ath
+ 		.tx_ring_size = DP_TCL_DATA_RING_SIZE,
+ 		.smp2p_wow_exit = false,
+ 		.support_fw_mac_sequence = false,
++		.ftm_responder = true,
+ 	},
+ 	{
+ 		.name = "qca6390 hw2.0",
+@@ -282,6 +284,7 @@ static const struct ath11k_hw_params ath
+ 		.tx_ring_size = DP_TCL_DATA_RING_SIZE,
+ 		.smp2p_wow_exit = false,
+ 		.support_fw_mac_sequence = true,
++		.ftm_responder = false,
+ 	},
+ 	{
+ 		.name = "qcn9074 hw1.0",
+@@ -363,6 +366,7 @@ static const struct ath11k_hw_params ath
+ 		.tx_ring_size = DP_TCL_DATA_RING_SIZE,
+ 		.smp2p_wow_exit = false,
+ 		.support_fw_mac_sequence = false,
++		.ftm_responder = true,
+ 	},
+ 	{
+ 		.name = "wcn6855 hw2.0",
+@@ -447,6 +451,7 @@ static const struct ath11k_hw_params ath
+ 		.tx_ring_size = DP_TCL_DATA_RING_SIZE,
+ 		.smp2p_wow_exit = false,
+ 		.support_fw_mac_sequence = true,
++		.ftm_responder = false,
+ 	},
+ 	{
+ 		.name = "wcn6855 hw2.1",
+@@ -529,6 +534,7 @@ static const struct ath11k_hw_params ath
+ 		.tx_ring_size = DP_TCL_DATA_RING_SIZE,
+ 		.smp2p_wow_exit = false,
+ 		.support_fw_mac_sequence = true,
++		.ftm_responder = false,
+ 	},
+ 	{
+ 		.name = "wcn6750 hw1.0",
+@@ -609,6 +615,7 @@ static const struct ath11k_hw_params ath
+ 		.tx_ring_size = DP_TCL_DATA_RING_SIZE_WCN6750,
+ 		.smp2p_wow_exit = true,
+ 		.support_fw_mac_sequence = true,
++		.ftm_responder = false,
+ 	},
+ 	{
+ 		.hw_rev = ATH11K_HW_IPQ5018_HW10,
+@@ -688,6 +695,7 @@ static const struct ath11k_hw_params ath
+ 		.tx_ring_size = DP_TCL_DATA_RING_SIZE,
+ 		.smp2p_wow_exit = false,
+ 		.support_fw_mac_sequence = false,
++		.ftm_responder = true,
+ 	},
+ };
+ 
+--- a/drivers/net/wireless/ath/ath11k/core.h
++++ b/drivers/net/wireless/ath/ath11k/core.h
+@@ -346,6 +346,7 @@ struct ath11k_vif {
+ 
+ 	bool is_started;
+ 	bool is_up;
++	bool ftm_responder;
+ 	bool spectral_enabled;
+ 	bool ps;
+ 	u32 aid;
+--- a/drivers/net/wireless/ath/ath11k/hw.h
++++ b/drivers/net/wireless/ath/ath11k/hw.h
+@@ -224,6 +224,7 @@ struct ath11k_hw_params {
+ 	u32 tx_ring_size;
+ 	bool smp2p_wow_exit;
+ 	bool support_fw_mac_sequence;
++	bool ftm_responder;
+ };
+ 
+ struct ath11k_hw_ops {
+--- a/drivers/net/wireless/ath/ath11k/mac.c
++++ b/drivers/net/wireless/ath/ath11k/mac.c
+@@ -3110,7 +3110,7 @@ static void ath11k_mac_op_bss_info_chang
+ 	u16 bitrate;
+ 	int ret = 0;
+ 	u8 rateidx;
+-	u32 rate;
++	u32 rate, param;
+ 	u32 ipv4_cnt;
+ 
+ 	mutex_lock(&ar->conf_mutex);
+@@ -3412,6 +3412,20 @@ static void ath11k_mac_op_bss_info_chang
+ 		}
+ 	}
+ 
++	if (changed & BSS_CHANGED_FTM_RESPONDER &&
++	    arvif->ftm_responder != info->ftm_responder &&
++	    ar->ab->hw_params.ftm_responder &&
++	    (vif->type == NL80211_IFTYPE_AP ||
++	     vif->type == NL80211_IFTYPE_MESH_POINT)) {
++		arvif->ftm_responder = info->ftm_responder;
++		param = WMI_VDEV_PARAM_ENABLE_DISABLE_RTT_RESPONDER_ROLE;
++		ret = ath11k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, param,
++						    arvif->ftm_responder);
++		if (ret)
++			ath11k_warn(ar->ab, "Failed to set ftm responder %i: %d\n",
++				    arvif->vdev_id, ret);
++	}
++
+ 	if (changed & BSS_CHANGED_FILS_DISCOVERY ||
+ 	    changed & BSS_CHANGED_UNSOL_BCAST_PROBE_RESP)
+ 		ath11k_mac_fils_discovery(arvif, info);
+@@ -9113,6 +9127,10 @@ static int __ath11k_mac_register(struct
+ 	wiphy_ext_feature_set(ar->hw->wiphy,
+ 			      NL80211_EXT_FEATURE_SET_SCAN_DWELL);
+ 
++	if (ab->hw_params.ftm_responder)
++		wiphy_ext_feature_set(ar->hw->wiphy,
++				      NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER);
++
+ 	ath11k_reg_init(ar);
+ 
+ 	if (!test_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags)) {
+--- a/drivers/net/wireless/ath/ath11k/wmi.h
++++ b/drivers/net/wireless/ath/ath11k/wmi.h
+@@ -1073,6 +1073,7 @@ enum wmi_tlv_vdev_param {
+ 	WMI_VDEV_PARAM_ENABLE_BCAST_PROBE_RESPONSE,
+ 	WMI_VDEV_PARAM_FILS_MAX_CHANNEL_GUARD_TIME,
+ 	WMI_VDEV_PARAM_HE_LTF = 0x74,
++	WMI_VDEV_PARAM_ENABLE_DISABLE_RTT_RESPONDER_ROLE = 0x7d,
+ 	WMI_VDEV_PARAM_BA_MODE = 0x7e,
+ 	WMI_VDEV_PARAM_AUTORATE_MISC_CFG = 0x80,
+ 	WMI_VDEV_PARAM_SET_HE_SOUNDING_MODE = 0x87,
diff --git a/package/kernel/mac80211/patches/ath11k/0030-wifi-ath11k-add-channel-177-into-5-GHz-channel-list.patch b/package/kernel/mac80211/patches/ath11k/0030-wifi-ath11k-add-channel-177-into-5-GHz-channel-list.patch
new file mode 100644
index 0000000000..d0ed9c54b8
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath11k/0030-wifi-ath11k-add-channel-177-into-5-GHz-channel-list.patch
@@ -0,0 +1,41 @@
+From e5e94d10c85653609a2893c8d0ef24a27471b68f Mon Sep 17 00:00:00 2001
+From: Wen Gong <quic_wgong at quicinc.com>
+Date: Tue, 10 Jan 2023 15:30:58 +0200
+Subject: [PATCH] wifi: ath11k: add channel 177 into 5 GHz channel list
+
+Add support for the 5 GHz channel 177 with center frequency 5885 MHz and
+operating class 125 per IEEE Std 802.11ax-2021, Table E-4.
+
+Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
+
+Signed-off-by: Wen Gong <quic_wgong at quicinc.com>
+Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>
+Link: https://lore.kernel.org/r/20221220101912.30816-1-quic_wgong at quicinc.com
+---
+ drivers/net/wireless/ath/ath11k/core.h | 4 ++--
+ drivers/net/wireless/ath/ath11k/mac.c  | 1 +
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath11k/core.h
++++ b/drivers/net/wireless/ath/ath11k/core.h
+@@ -521,8 +521,8 @@ struct ath11k_sta {
+ #define ATH11K_MIN_5G_FREQ 4150
+ #define ATH11K_MIN_6G_FREQ 5925
+ #define ATH11K_MAX_6G_FREQ 7115
+-#define ATH11K_NUM_CHANS 101
+-#define ATH11K_MAX_5G_CHAN 173
++#define ATH11K_NUM_CHANS 102
++#define ATH11K_MAX_5G_CHAN 177
+ 
+ enum ath11k_state {
+ 	ATH11K_STATE_OFF,
+--- a/drivers/net/wireless/ath/ath11k/mac.c
++++ b/drivers/net/wireless/ath/ath11k/mac.c
+@@ -96,6 +96,7 @@ static const struct ieee80211_channel at
+ 	CHAN5G(165, 5825, 0),
+ 	CHAN5G(169, 5845, 0),
+ 	CHAN5G(173, 5865, 0),
++	CHAN5G(177, 5885, 0),
+ };
+ 
+ static const struct ieee80211_channel ath11k_6ghz_channels[] = {
diff --git a/package/kernel/mac80211/patches/ath11k/0031-wifi-ath11k-fix-ce-memory-mapping-for-ahb-devices.patch b/package/kernel/mac80211/patches/ath11k/0031-wifi-ath11k-fix-ce-memory-mapping-for-ahb-devices.patch
new file mode 100644
index 0000000000..2786799972
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath11k/0031-wifi-ath11k-fix-ce-memory-mapping-for-ahb-devices.patch
@@ -0,0 +1,114 @@
+From 53a998c4d7284debd77734d01e1466e59a1d03b2 Mon Sep 17 00:00:00 2001
+From: Raj Kumar Bhagat <quic_rajkbhag at quicinc.com>
+Date: Fri, 13 Jan 2023 12:02:09 +0530
+Subject: [PATCH] wifi: ath11k: fix ce memory mapping for ahb devices
+
+Currently ath11k_ahb module is not loaded successfully and the wifi
+interface is not created. Kernel trace is seen while loading the
+ath11k_ahb module. The issue is seen in all ath11k AHB devices except
+in IPQ5018.
+
+This happens because in ath11k_ahb_probe(), ab->mem_ce is initialized
+with the value of ab->mem. However, at this instant ab->mem is not
+yet set.
+
+Later, during write to a particular memory via ath11k_ahb_write32()
+this ab->mem_ce is used with particular offset. Since ab->mem_ce is
+not set properly this possibly leads to memory conflict to handle
+kernel paging request and the below trace is seen.
+
+[   93.035047] Unable to handle kernel paging request at virtual address ffff800100a00000
+[   93.035083] Mem abort info:
+[   93.041869]   ESR = 0x0000000096000045
+[   93.044561]   EC = 0x25: DABT (current EL), IL = 32 bits
+[   93.048377]   SET = 0, FnV = 0
+[   93.053840]   EA = 0, S1PTW = 0
+[   93.056704]   FSC = 0x05: level 1 translation fault
+[   93.059745] Data abort info:
+[   93.064603]   ISV = 0, ISS = 0x00000045
+[   93.067729]   CM = 0, WnR = 1
+[   93.071287] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000042219000
+[   93.074409] [ffff800100a00000] pgd=100000007ffff003, p4d=100000007ffff003, pud=0000000000000000
+[   93.081195] Internal error: Oops: 0000000096000045 [#1] PREEMPT SMP
+[   93.089598] Modules linked in: ath11k_ahb ath11k_pci ath11k qmi_helpers
+[   93.095851] CPU: 2 PID: 66 Comm: kworker/u8:3 Not tainted 6.1.0-rc8-wt-ath-658126-g58e4b9df840c-dirty #2
+[   93.102454] Hardware name: Qualcomm Technologies, Inc. IPQ8074/AP-HK14 (DT)
+[   93.112171] Workqueue: ath11k_qmi_driver_event ath11k_qmi_driver_event_work [ath11k]
+[   93.118856] pstate: 40000005 (nZcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
+[   93.126838] pc : ath11k_ahb_write32+0xc/0x18 [ath11k_ahb]
+[   93.133520] lr : ath11k_hal_srng_setup+0x860/0x8f0 [ath11k]
+[   93.139075] sp : ffff80000aaebb70
+[   93.144452] x29: ffff80000aaebb70 x28: 0000000000000020 x27: ffff80000aaebc50
+[   93.147934] x26: ffff000004923750 x25: ffff000004921200 x24: ffff000004928000
+[   93.155051] x23: 0000000000000020 x22: ffff000004930000 x21: ffff000004923200
+[   93.162170] x20: ffff000004920000 x19: 00000000eea00000 x18: ffff0000049200f0
+[   93.169288] x17: 0000000000000000 x16: 0000000000000000 x15: 000000000000025e
+[   93.176405] x14: ffff000003c414f0 x13: 0000000000000000 x12: 0000000000000008
+[   93.183524] x11: ffff000003c41488 x10: 0000000000000040 x9 : 0000000000000000
+[   93.190641] x8 : ffff80000a9dd100 x7 : 0000000000000000 x6 : 000000000000003f
+[   93.197759] x5 : ffff800100a00400 x4 : ffff8000031f4018 x3 : 0000000000000004
+[   93.204877] x2 : 0000000047b62000 x1 : ffff800100a00000 x0 : ffff800012000000
+[   93.211996] Call trace:
+[   93.219104]  ath11k_ahb_write32+0xc/0x18 [ath11k_ahb]
+[   93.221366]  ath11k_ce_init_ring+0x184/0x278 [ath11k]
+[   93.226576]  ath11k_ce_init_pipes+0x4c/0x1a0 [ath11k]
+[   93.231610]  ath11k_core_qmi_firmware_ready+0x3c/0x568 [ath11k]
+[   93.236646]  ath11k_qmi_driver_event_work+0x168/0x4f8 [ath11k]
+[   93.242376]  process_one_work+0x144/0x350
+[   93.248275]  worker_thread+0x120/0x430
+[   93.252352]  kthread+0xf4/0x110
+[   93.255997]  ret_from_fork+0x10/0x20
+[   93.259043] Code: d503201f f94e1c00 8b214001 d50332bf (b9000022)
+[   93.262863] ---[ end trace 0000000000000000 ]---
+
+However, for the device IPQ5018 ath11k_hw_params .ce_remap is
+defined. This parameter is used to recalculate ab->mem_ce and hence,
+this issue is not seen in IPQ5018.
+
+Hence, fix this by initializing ab->mem_ce after ab->mem is set.
+ab->mem is set inside the ath11k_ahb_setup_resources() therefore
+initialize ab->mem_ce after ath11k_ahb_setup_resources().
+
+Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
+
+Fixes: b42b3678c91f ("wifi: ath11k: remap ce register space for IPQ5018")
+
+Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag at quicinc.com>
+Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>
+Link: https://lore.kernel.org/r/20230113063209.7256-1-quic_rajkbhag at quicinc.com
+---
+ drivers/net/wireless/ath/ath11k/ahb.c | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath11k/ahb.c
++++ b/drivers/net/wireless/ath/ath11k/ahb.c
+@@ -1157,12 +1157,16 @@ static int ath11k_ahb_probe(struct platf
+ 		goto err_core_free;
+ 	}
+ 
+-	ab->mem_ce = ab->mem;
+-
+ 	ret = ath11k_core_pre_init(ab);
+ 	if (ret)
+ 		goto err_core_free;
+ 
++	ret = ath11k_ahb_setup_resources(ab);
++	if (ret)
++		goto err_core_free;
++
++	ab->mem_ce = ab->mem;
++
+ 	if (ab->hw_params.ce_remap) {
+ 		const struct ce_remap *ce_remap = ab->hw_params.ce_remap;
+ 		/* ce register space is moved out of wcss unlike ipq8074 or ipq6018
+@@ -1177,10 +1181,6 @@ static int ath11k_ahb_probe(struct platf
+ 		}
+ 	}
+ 
+-	ret = ath11k_ahb_setup_resources(ab);
+-	if (ret)
+-		goto err_core_free;
+-
+ 	ret = ath11k_ahb_fw_resources_init(ab);
+ 	if (ret)
+ 		goto err_core_free;
diff --git a/package/kernel/mac80211/patches/ath11k/0032-wifi-ath11k-Fix-memory-leak-in-ath11k_peer_rx_frag_s.patch b/package/kernel/mac80211/patches/ath11k/0032-wifi-ath11k-Fix-memory-leak-in-ath11k_peer_rx_frag_s.patch
new file mode 100644
index 0000000000..40b0630af8
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath11k/0032-wifi-ath11k-Fix-memory-leak-in-ath11k_peer_rx_frag_s.patch
@@ -0,0 +1,28 @@
+From ed3f83b3459a67a3ab9d806490ac304b567b1c2d Mon Sep 17 00:00:00 2001
+From: Miaoqian Lin <linmq006 at gmail.com>
+Date: Mon, 2 Jan 2023 12:11:42 +0400
+Subject: [PATCH] wifi: ath11k: Fix memory leak in ath11k_peer_rx_frag_setup
+
+crypto_alloc_shash() allocates resources, which should be released by
+crypto_free_shash(). When ath11k_peer_find() fails, there has memory
+leak. Add missing crypto_free_shash() to fix this.
+
+Fixes: 243874c64c81 ("ath11k: handle RX fragments")
+Signed-off-by: Miaoqian Lin <linmq006 at gmail.com>
+Reviewed-by: Leon Romanovsky <leonro at nvidia.com>
+Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>
+Link: https://lore.kernel.org/r/20230102081142.3937570-1-linmq006 at gmail.com
+---
+ drivers/net/wireless/ath/ath11k/dp_rx.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
++++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
+@@ -3126,6 +3126,7 @@ int ath11k_peer_rx_frag_setup(struct ath
+ 	if (!peer) {
+ 		ath11k_warn(ab, "failed to find the peer to set up fragment info\n");
+ 		spin_unlock_bh(&ab->base_lock);
++		crypto_free_shash(tfm);
+ 		return -ENOENT;
+ 	}
+ 
diff --git a/package/kernel/mac80211/patches/ath11k/0033-wifi-ath11k-Set-ext-passive-scan-flag-to-adjust-pass.patch b/package/kernel/mac80211/patches/ath11k/0033-wifi-ath11k-Set-ext-passive-scan-flag-to-adjust-pass.patch
new file mode 100644
index 0000000000..79b79e1053
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath11k/0033-wifi-ath11k-Set-ext-passive-scan-flag-to-adjust-pass.patch
@@ -0,0 +1,73 @@
+From cf8f3d4deb02a8fdc806c46d4112b69868544697 Mon Sep 17 00:00:00 2001
+From: Tamizh Chelvam Raja <quic_tamizhr at quicinc.com>
+Date: Wed, 15 Feb 2023 20:31:36 +0200
+Subject: [PATCH] wifi: ath11k: Set ext passive scan flag to adjust passive
+ scan start time
+
+Set the WMI_SCAN_FLAG_EXT_PASSIVE_SCAN_START_TIME_ENHANCE flag
+while sending the scan command.  If this flag is enabled when the
+incoming scan request comes with a strict start time and its duration
+overlaps with next TBTT, then target adjust the start time accordingly
+for passive scan. Target supporting this feature will advertise
+WMI_TLV_SERVICE_PASSIVE_SCAN_START_TIME_ENHANCE.
+
+Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.4.0.1-01467-QCAHKSWPL_SILICONZ-1
+
+Signed-off-by: Tamizh Chelvam Raja <quic_tamizhr at quicinc.com>
+Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>
+Link: https://lore.kernel.org/r/20221222131720.11368-1-quic_tamizhr at quicinc.com
+---
+ drivers/net/wireless/ath/ath11k/wmi.c | 8 ++++++++
+ drivers/net/wireless/ath/ath11k/wmi.h | 3 +++
+ 2 files changed, 11 insertions(+)
+
+--- a/drivers/net/wireless/ath/ath11k/wmi.c
++++ b/drivers/net/wireless/ath/ath11k/wmi.c
+@@ -2068,6 +2068,12 @@ void ath11k_wmi_start_scan_init(struct a
+ 				  WMI_SCAN_EVENT_FOREIGN_CHAN |
+ 				  WMI_SCAN_EVENT_DEQUEUED;
+ 	arg->scan_flags |= WMI_SCAN_CHAN_STAT_EVENT;
++
++	if (test_bit(WMI_TLV_SERVICE_PASSIVE_SCAN_START_TIME_ENHANCE,
++		     ar->ab->wmi_ab.svc_map))
++		arg->scan_ctrl_flags_ext |=
++			WMI_SCAN_FLAG_EXT_PASSIVE_SCAN_START_TIME_ENHANCE;
++
+ 	arg->num_bssid = 1;
+ 
+ 	/* fill bssid_list[0] with 0xff, otherwise bssid and RA will be
+@@ -2149,6 +2155,8 @@ ath11k_wmi_copy_scan_event_cntrl_flags(s
+ 	/* for adaptive scan mode using 3 bits (21 - 23 bits) */
+ 	WMI_SCAN_SET_DWELL_MODE(cmd->scan_ctrl_flags,
+ 				param->adaptive_dwell_time_mode);
++
++	cmd->scan_ctrl_flags_ext = param->scan_ctrl_flags_ext;
+ }
+ 
+ int ath11k_wmi_send_scan_start_cmd(struct ath11k *ar,
+--- a/drivers/net/wireless/ath/ath11k/wmi.h
++++ b/drivers/net/wireless/ath/ath11k/wmi.h
+@@ -2093,6 +2093,7 @@ enum wmi_tlv_service {
+ 	WMI_TLV_SERVICE_EXT2_MSG = 220,
+ 	WMI_TLV_SERVICE_PEER_POWER_SAVE_DURATION_SUPPORT = 246,
+ 	WMI_TLV_SERVICE_SRG_SRP_SPATIAL_REUSE_SUPPORT = 249,
++	WMI_TLV_SERVICE_PASSIVE_SCAN_START_TIME_ENHANCE = 263,
+ 
+ 	/* The second 128 bits */
+ 	WMI_MAX_EXT_SERVICE = 256,
+@@ -3223,6 +3224,7 @@ struct  wmi_start_scan_cmd {
+ 
+ #define WMI_SCAN_DWELL_MODE_MASK 0x00E00000
+ #define WMI_SCAN_DWELL_MODE_SHIFT        21
++#define WMI_SCAN_FLAG_EXT_PASSIVE_SCAN_START_TIME_ENHANCE   0x00000800
+ 
+ enum {
+ 	WMI_SCAN_DWELL_MODE_DEFAULT      = 0,
+@@ -3270,6 +3272,7 @@ struct scan_req_params {
+ 		};
+ 		u32 scan_events;
+ 	};
++	u32 scan_ctrl_flags_ext;
+ 	u32 dwell_time_active;
+ 	u32 dwell_time_active_2g;
+ 	u32 dwell_time_passive;
diff --git a/package/kernel/mac80211/patches/ath11k/0034-wifi-ath11k-fix-return-value-check-in-ath11k_ahb_pro.patch b/package/kernel/mac80211/patches/ath11k/0034-wifi-ath11k-fix-return-value-check-in-ath11k_ahb_pro.patch
new file mode 100644
index 0000000000..59132913bd
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath11k/0034-wifi-ath11k-fix-return-value-check-in-ath11k_ahb_pro.patch
@@ -0,0 +1,27 @@
+From 342fcde9d91460f01f65707e16368a1571271a3a Mon Sep 17 00:00:00 2001
+From: Yang Yingliang <yangyingliang at huawei.com>
+Date: Fri, 17 Feb 2023 11:00:31 +0800
+Subject: [PATCH] wifi: ath11k: fix return value check in ath11k_ahb_probe()
+
+ioremap() returns NULL pointer not PTR_ERR() when it fails,
+so replace the IS_ERR() check with NULL pointer check.
+
+Fixes: b42b3678c91f ("wifi: ath11k: remap ce register space for IPQ5018")
+Signed-off-by: Yang Yingliang <yangyingliang at huawei.com>
+Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>
+Link: https://lore.kernel.org/r/20230217030031.4021289-1-yangyingliang at huawei.com
+---
+ drivers/net/wireless/ath/ath11k/ahb.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/ath/ath11k/ahb.c
++++ b/drivers/net/wireless/ath/ath11k/ahb.c
+@@ -1174,7 +1174,7 @@ static int ath11k_ahb_probe(struct platf
+ 		 * to a new space for accessing them.
+ 		 */
+ 		ab->mem_ce = ioremap(ce_remap->base, ce_remap->size);
+-		if (IS_ERR(ab->mem_ce)) {
++		if (!ab->mem_ce) {
+ 			dev_err(&pdev->dev, "ce ioremap error\n");
+ 			ret = -ENOMEM;
+ 			goto err_core_free;
diff --git a/package/kernel/mac80211/patches/ath11k/0035-wifi-ath11k-Use-platform_get_irq-to-get-the-interrup.patch b/package/kernel/mac80211/patches/ath11k/0035-wifi-ath11k-Use-platform_get_irq-to-get-the-interrup.patch
new file mode 100644
index 0000000000..93a9da8fc2
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath11k/0035-wifi-ath11k-Use-platform_get_irq-to-get-the-interrup.patch
@@ -0,0 +1,50 @@
+From f117276638b7600b981b3fe28550823cfbe1ef23 Mon Sep 17 00:00:00 2001
+From: Douglas Anderson <dianders at chromium.org>
+Date: Wed, 1 Feb 2023 08:54:42 -0800
+Subject: [PATCH] wifi: ath11k: Use platform_get_irq() to get the interrupt
+
+As of commit a1a2b7125e10 ("of/platform: Drop static setup of IRQ
+resource from DT core"), we need to use platform_get_irq() instead of
+platform_get_resource() to get our IRQs because
+platform_get_resource() simply won't get them anymore.
+
+This was already fixed in several other Atheros WiFi drivers,
+apparently in response to Zeal Robot reports. An example of another
+fix is commit 9503a1fc123d ("ath9k: Use platform_get_irq() to get the
+interrupt"). ath11k seems to have been missed in this effort, though.
+
+Without this change, WiFi wasn't coming up on my Qualcomm sc7280-based
+hardware. Specifically, "platform_get_resource(pdev, IORESOURCE_IRQ,
+i)" was failing even for i=0.
+
+Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1
+
+Fixes: a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT core")
+Fixes: 00402f49d26f ("ath11k: Add support for WCN6750 device")
+Signed-off-by: Douglas Anderson <dianders at chromium.org>
+Tested-by: Jun Yu <junyuu at chromium.org>
+Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj at bp.renesas.com>
+Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>
+Link: https://lore.kernel.org/r/20230201084131.v2.1.I69cf3d56c97098287fe3a70084ee515098390b70 at changeid
+---
+ drivers/net/wireless/ath/ath11k/ahb.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath11k/ahb.c
++++ b/drivers/net/wireless/ath/ath11k/ahb.c
+@@ -874,11 +874,11 @@ static int ath11k_ahb_setup_msi_resource
+ 	ab->pci.msi.ep_base_data = int_prop + 32;
+ 
+ 	for (i = 0; i < ab->pci.msi.config->total_vectors; i++) {
+-		res = platform_get_resource(pdev, IORESOURCE_IRQ, i);
+-		if (!res)
+-			return -ENODEV;
++		ret = platform_get_irq(pdev, i);
++		if (ret < 0)
++			return ret;
+ 
+-		ab->pci.msi.irqs[i] = res->start;
++		ab->pci.msi.irqs[i] = ret;
+ 	}
+ 
+ 	set_bit(ATH11K_FLAG_MULTI_MSI_VECTORS, &ab->dev_flags);
diff --git a/package/kernel/mac80211/patches/ath11k/0036-wifi-ath11k-fix-SAC-bug-on-peer-addition-with-sta-ba.patch b/package/kernel/mac80211/patches/ath11k/0036-wifi-ath11k-fix-SAC-bug-on-peer-addition-with-sta-ba.patch
new file mode 100644
index 0000000000..b37f070ba6
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath11k/0036-wifi-ath11k-fix-SAC-bug-on-peer-addition-with-sta-ba.patch
@@ -0,0 +1,53 @@
+From 60b7d62ba8cdbd073997bff0f1cdae8d844002c0 Mon Sep 17 00:00:00 2001
+From: Christian Marangi <ansuelsmth at gmail.com>
+Date: Thu, 9 Feb 2023 23:26:22 +0100
+Subject: [PATCH] wifi: ath11k: fix SAC bug on peer addition with sta band
+ migration
+
+Fix sleep in atomic context warning detected by Smatch static checker
+analyzer.
+
+Following the locking pattern for peer_rhash_add lock tbl_mtx_lock mutex
+always even if sta is not transitioning to another band.
+This is peer_add function and a more secure locking should not cause
+performance regression.
+
+Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01208-QCAHKSWPL_SILICONZ-1
+
+Fixes: d673cb6fe6c0 ("wifi: ath11k: fix peer addition/deletion error on sta band migration")
+Reported-by: Dan Carpenter <error27 at gmail.com>
+Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
+Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>
+Link: https://lore.kernel.org/r/20230209222622.1751-1-ansuelsmth at gmail.com
+---
+ drivers/net/wireless/ath/ath11k/peer.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/wireless/ath/ath11k/peer.c
++++ b/drivers/net/wireless/ath/ath11k/peer.c
+@@ -382,22 +382,23 @@ int ath11k_peer_create(struct ath11k *ar
+ 		return -ENOBUFS;
+ 	}
+ 
++	mutex_lock(&ar->ab->tbl_mtx_lock);
+ 	spin_lock_bh(&ar->ab->base_lock);
+ 	peer = ath11k_peer_find_by_addr(ar->ab, param->peer_addr);
+ 	if (peer) {
+ 		if (peer->vdev_id == param->vdev_id) {
+ 			spin_unlock_bh(&ar->ab->base_lock);
++			mutex_unlock(&ar->ab->tbl_mtx_lock);
+ 			return -EINVAL;
+ 		}
+ 
+ 		/* Assume sta is transitioning to another band.
+ 		 * Remove here the peer from rhash.
+ 		 */
+-		mutex_lock(&ar->ab->tbl_mtx_lock);
+ 		ath11k_peer_rhash_delete(ar->ab, peer);
+-		mutex_unlock(&ar->ab->tbl_mtx_lock);
+ 	}
+ 	spin_unlock_bh(&ar->ab->base_lock);
++	mutex_unlock(&ar->ab->tbl_mtx_lock);
+ 
+ 	ret = ath11k_wmi_send_peer_create_cmd(ar, param);
+ 	if (ret) {
diff --git a/package/kernel/mac80211/patches/ath11k/902-ath11k-Disable-coldboot-calibration-for-IPQ8074.patch b/package/kernel/mac80211/patches/ath11k/902-ath11k-Disable-coldboot-calibration-for-IPQ8074.patch
index bf51c01cb2..01f2bb4848 100644
--- a/package/kernel/mac80211/patches/ath11k/902-ath11k-Disable-coldboot-calibration-for-IPQ8074.patch
+++ b/package/kernel/mac80211/patches/ath11k/902-ath11k-Disable-coldboot-calibration-for-IPQ8074.patch
@@ -13,7 +13,7 @@ Signed-off-by: Robert Marko <robimarko at gmail.com>
 
 --- a/drivers/net/wireless/ath/ath11k/core.c
 +++ b/drivers/net/wireless/ath/ath11k/core.c
-@@ -81,7 +81,7 @@ static const struct ath11k_hw_params ath
+@@ -82,7 +82,7 @@ static const struct ath11k_hw_params ath
  		.supports_shadow_regs = false,
  		.idle_ps = false,
  		.supports_sta_ps = false,
diff --git a/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch b/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch
index c854de586a..87cbcbe315 100644
--- a/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch
+++ b/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch
@@ -31,7 +31,7 @@ Signed-off-by: Robert Marko <robimarko at gmail.com>
  	{
  		.hw_rev = ATH11K_HW_IPQ8074,
  		.name = "ipq8074 hw2.0",
-@@ -1826,7 +1826,8 @@ static void ath11k_core_reset(struct wor
+@@ -1919,7 +1919,8 @@ static void ath11k_core_reset(struct wor
  static int ath11k_init_hw_params(struct ath11k_base *ab)
  {
  	const struct ath11k_hw_params *hw_params = NULL;
@@ -41,7 +41,7 @@ Signed-off-by: Robert Marko <robimarko at gmail.com>
  
  	for (i = 0; i < ARRAY_SIZE(ath11k_hw_params); i++) {
  		hw_params = &ath11k_hw_params[i];
-@@ -1842,7 +1843,30 @@ static int ath11k_init_hw_params(struct
+@@ -1935,7 +1936,30 @@ static int ath11k_init_hw_params(struct
  
  	ab->hw_params = *hw_params;
  



From lede-commits at lists.infradead.org  Thu Feb 23 13:23:42 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Thu, 23 Feb 2023 16:23:42 -0500
Subject: [openwrt/openwrt]  kernel: Add CONFIG_PPC_QUEUED_SPINLOCKS
 configuration option
In-Reply-To: <167718742199.2123041.15247429245480567855@git-01.infra.openwrt.org>
References: <167718742199.2123041.15247429245480567855@git-01.infra.openwrt.org>
Message-ID: <mailman.18707.1677187429.3064139.lede-commits@lists.infradead.org>

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

commit 218f425b6165953c8adace91ac368a2db010357b
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Tue Feb 21 23:13:27 2023 +0100

    kernel: Add CONFIG_PPC_QUEUED_SPINLOCKS configuration option
    
    The CONFIG_PPC_QUEUED_SPINLOCKS configuration option is not defined for
    kernel 5.15, it is defined for kernel 5.10.
    
    This fixes the compilation of mpc85xx/p2020 with kernel 5.15.
    
    Reviewed-by: Robert Marko <robimarko at gmail.com>
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/generic/config-5.15          | 1 +
 target/linux/mpc85xx/p1020/config-default | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15
index bd27f74d73..8334117975 100644
--- a/target/linux/generic/config-5.15
+++ b/target/linux/generic/config-5.15
@@ -4779,6 +4779,7 @@ CONFIG_PPC_4K_PAGES=y
 # CONFIG_PPC_DISABLE_WERROR is not set
 # CONFIG_PPC_EMULATED_STATS is not set
 # CONFIG_PPC_EPAPR_HV_BYTECHAN is not set
+# CONFIG_PPC_QUEUED_SPINLOCKS is not set
 # CONFIG_PPP is not set
 # CONFIG_PPPOATM is not set
 # CONFIG_PPPOE is not set
diff --git a/target/linux/mpc85xx/p1020/config-default b/target/linux/mpc85xx/p1020/config-default
index 65b40e1d7d..573ff362f9 100644
--- a/target/linux/mpc85xx/p1020/config-default
+++ b/target/linux/mpc85xx/p1020/config-default
@@ -34,7 +34,6 @@ CONFIG_MUTEX_SPIN_ON_OWNER=y
 CONFIG_NET_FLOW_LIMIT=y
 CONFIG_NR_CPUS=2
 CONFIG_PADATA=y
-# CONFIG_PPC_QUEUED_SPINLOCKS is not set
 CONFIG_REGMAP_IRQ=y
 CONFIG_REGULATOR=y
 CONFIG_RFS_ACCEL=y



From lede-commits at lists.infradead.org  Fri Feb 24 03:06:31 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 24 Feb 2023 06:06:31 -0500
Subject: [openwrt/openwrt]  bcm47xx: relocate LZMA loader #2
In-Reply-To: <167723679188.2714392.972085045515233578@git-01.infra.openwrt.org>
References: <167723679188.2714392.972085045515233578@git-01.infra.openwrt.org>
Message-ID: <mailman.18853.1677236798.3064139.lede-commits@lists.infradead.org>

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

commit ee85786b43344b8ed5f722ffd3639f1e0563fd36
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Tue Feb 7 15:06:50 2023 +0100

    bcm47xx: relocate LZMA loader #2
    
    Increased size of the 5.15 kernel requires bumping BZ_TEXT_START again.
    Without this CFE hangs at the:
    Starting program at 0x80001000
    
    This fixes booting 5.15 based mips74k images on:
    1. BCM4706 (Luxul XWR-1750)
    2. BCM5357B0 (Linksys E1000 V2.1)
    3. BCM47186B0 (Luxul XWR-600)
    4. BCM5358 (Linksys E2500 V3)
    
    It isn't needed but also doesn't break:
    1. BCM5354 (Asus WL-500gP V2)
    
    Ref: 4cd97e476089 ("bcm47xx: relocate LZMA loader")
    Cc: Hauke Mehrtens <hauke at hauke-m.de>
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
    Acked-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 target/linux/bcm47xx/image/lzma-loader/src/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/bcm47xx/image/lzma-loader/src/Makefile b/target/linux/bcm47xx/image/lzma-loader/src/Makefile
index a3e7ae1c92..0bad8dd9bb 100644
--- a/target/linux/bcm47xx/image/lzma-loader/src/Makefile
+++ b/target/linux/bcm47xx/image/lzma-loader/src/Makefile
@@ -18,8 +18,8 @@
 #
 
 TEXT_START	:= 0x80001000
-BZ_TEXT_START	:= 0x80700000
-BZ_STACK_START	:= 0x80800000
+BZ_TEXT_START	:= 0x80d00000
+BZ_STACK_START	:= 0x80e00000
 
 OBJCOPY		:= $(CROSS_COMPILE)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S
 



From lede-commits at lists.infradead.org  Fri Feb 24 03:06:32 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 24 Feb 2023 06:06:32 -0500
Subject: [openwrt/openwrt]  bcm47xx: switch default kernel to the 5.15
In-Reply-To: <167723679188.2714392.972085045515233578@git-01.infra.openwrt.org>
References: <167723679188.2714392.972085045515233578@git-01.infra.openwrt.org>
Message-ID: <mailman.18854.1677236799.3064139.lede-commits@lists.infradead.org>

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

commit eaf5c85fd3d7d8f35dd80e6816c79dc35016a83f
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Fri Feb 24 12:06:10 2023 +0100

    bcm47xx: switch default kernel to the 5.15
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 target/linux/bcm47xx/Makefile | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/target/linux/bcm47xx/Makefile b/target/linux/bcm47xx/Makefile
index ca09aea981..a56c53ca6d 100644
--- a/target/linux/bcm47xx/Makefile
+++ b/target/linux/bcm47xx/Makefile
@@ -10,8 +10,7 @@ BOARDNAME:=Broadcom BCM47xx/53xx (MIPS)
 FEATURES:=squashfs usb
 SUBTARGETS:=generic mips74k legacy
 
-KERNEL_PATCHVER:=5.10
-KERNEL_TESTING_PATCHVER:=5.15
+KERNEL_PATCHVER:=5.15
 
 define Target/Description
 	Build firmware images for Broadcom based BCM47xx/53xx routers with MIPS CPU, *not* ARM.



From lede-commits at lists.infradead.org  Fri Feb 24 14:57:11 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 24 Feb 2023 17:57:11 -0500
Subject: [openwrt/openwrt]  base-files: add support for retrieving IPv6
 assignments
In-Reply-To: <167727943168.3278884.13852531435301156961@git-01.infra.openwrt.org>
References: <167727943168.3278884.13852531435301156961@git-01.infra.openwrt.org>
Message-ID: <mailman.19032.1677279444.3064139.lede-commits@lists.infradead.org>

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

commit f35e2422b8774a2a70c8c3cd87c4289b17b7d4a3
Author: Mark Baker <mark at vpost.net>
AuthorDate: Wed Feb 1 20:30:57 2023 -0500

    base-files: add support for retrieving IPv6 assignments
    
    In DHCPv6-PD enabled environments, addresses are assigned to interfaces.
    These new functions retrieve the IPv6 assigned prefix(es).
    
    Signed-off-by: Mark Baker <mark at vpost.net>
---
 package/base-files/files/lib/functions/network.sh | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/package/base-files/files/lib/functions/network.sh b/package/base-files/files/lib/functions/network.sh
index 055f18c11e..4851a5817a 100644
--- a/package/base-files/files/lib/functions/network.sh
+++ b/package/base-files/files/lib/functions/network.sh
@@ -90,6 +90,13 @@ network_get_prefix6() {
 	__network_ifstatus "$1" "$2" "['ipv6-prefix'][0]['address','mask']" "/"
 }
 
+# determine first IPv6 prefix assignment of given logical interface
+# 1: destination variable
+# 2: interface
+network_get_prefix_assignment6() {
+	__network_ifstatus "$1" "$2" "['ipv6-prefix-assignment'][0]['address','mask']" "/"
+}
+
 # determine all IPv4 addresses of given logical interface
 # 1: destination variable
 # 2: interface
@@ -187,6 +194,13 @@ network_get_prefixes6() {
 	__network_ifstatus "$1" "$2" "['ipv6-prefix'][*]['address','mask']" "/ "
 }
 
+# determine all IPv6 prefix assignments of given logical interface
+# 1: destination variable
+# 2: interface
+network_get_prefix_assignments6() {
+	__network_ifstatus "$1" "$2" "['ipv6-prefix-assignment'][*]['address','mask']" "/ "
+}
+
 # determine IPv4 gateway of given logical interface
 # 1: destination variable
 # 2: interface



From lede-commits at lists.infradead.org  Fri Feb 24 15:15:42 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Fri, 24 Feb 2023 18:15:42 -0500
Subject: [openwrt/openwrt]  libcap: update to 2.67
In-Reply-To: <167728054208.3290574.15024577647433409916@git-01.infra.openwrt.org>
References: <167728054208.3290574.15024577647433409916@git-01.infra.openwrt.org>
Message-ID: <mailman.19033.1677280546.3064139.lede-commits@lists.infradead.org>

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

commit 530f5c2fda1893ee1e0ae8b1f5bea5eda0850a40
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Sun Feb 5 21:38:19 2023 +0100

    libcap: update to 2.67
    
    Release notes:
    https://sites.google.com/site/fullycapable/release-notes-for-libcap#h.o8papfkfh1x9
    
    While working on it, remove $(AUTORELEASE).
    
    Tested-by: Linhui Liu liulinhui36 at gmail.com # Xiaomi AX3600
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 package/libs/libcap/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/libs/libcap/Makefile b/package/libs/libcap/Makefile
index afc66d7c09..a35b5e394f 100644
--- a/package/libs/libcap/Makefile
+++ b/package/libs/libcap/Makefile
@@ -6,12 +6,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libcap
-PKG_VERSION:=2.66
-PKG_RELEASE:=$(AUTORELEASE)
+PKG_VERSION:=2.67
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/libs/security/linux-privs/libcap2
-PKG_HASH:=15c40ededb3003d70a283fe587a36b7d19c8b3b554e33f86129c059a4bb466b2
+PKG_HASH:=ce9b22fdc271beb6dae7543da5f74cf24cb82e6848cfd088a5a069dec5ea5198
 
 PKG_MAINTAINER:=Paul Wassi <p.wassi at gmx.at>
 PKG_LICENSE:=GPL-2.0-only



From lede-commits at lists.infradead.org  Sat Feb 25 04:30:11 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 25 Feb 2023 07:30:11 -0500
Subject: [openwrt/openwrt]  ethtool: update to 6.2
In-Reply-To: <167732821101.3794970.8341360317946595814@git-01.infra.openwrt.org>
References: <167732821101.3794970.8341360317946595814@git-01.infra.openwrt.org>
Message-ID: <mailman.19067.1677328222.3064139.lede-commits@lists.infradead.org>

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

commit c98a202446848f162ae59c85a7f3f08da88a35e0
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Wed Feb 22 15:50:43 2023 +0100

    ethtool: update to 6.2
    
    Release notes:
    - Feature: link down event statistics (no option)
    - Feature: JSON output for coalesce (-c)
    - Feature: new link modes (no option)
    - Feature: JSON output for ring (-g)
    - Feature: netlink handler for RSS get (-x)
    - Fix: fix boolean value output in JSON output
    - Fix: fix build errors and warnings
    
    Remove upstreamed patches:
    - 100-uapi-Bring-in-if-h.patch
    - 101-netlink-Fix-maybe-uninitialized-meters-variable.patch
    - 102-raw-marvell-c-Fix-build-with-musl-libc.patch
    
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 package/network/utils/ethtool/Makefile             |   4 +-
 .../ethtool/patches/100-uapi-Bring-in-if-h.patch   | 465 ---------------------
 ...k-Fix-maybe-uninitialized-meters-variable.patch |  25 --
 ...02-raw-marvell-c-Fix-build-with-musl-libc.patch |  63 ---
 4 files changed, 2 insertions(+), 555 deletions(-)

diff --git a/package/network/utils/ethtool/Makefile b/package/network/utils/ethtool/Makefile
index bec26cd364..b18320bf05 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:=6.1
+PKG_VERSION:=6.2
 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:=c41fc881ffa5a40432d2dd829eb44c64a49dee482e716baacf9262c64daa8f90
+PKG_HASH:=86df0114064d4d73f6bf72bf03e85c33964a519ee0c1d1ba65005ad2d0e570e1
 
 PKG_LICENSE:=GPL-2.0
 PKG_LICENSE_FILES:=COPYING
diff --git a/package/network/utils/ethtool/patches/100-uapi-Bring-in-if-h.patch b/package/network/utils/ethtool/patches/100-uapi-Bring-in-if-h.patch
deleted file mode 100644
index 09be05c1f6..0000000000
--- a/package/network/utils/ethtool/patches/100-uapi-Bring-in-if-h.patch
+++ /dev/null
@@ -1,465 +0,0 @@
-From:   Florian Fainelli <f.fainelli at gmail.com>
-To:     netdev at vger.kernel.org
-Subject: [PATCH ethtool v2 1/3] uapi: Bring in if.h
-Date:   Sat, 14 Jan 2023 08:34:09 -0800
-
-Bring in if.h from commit eec517cdb481 ("net: Add IF_OPER_TESTING") as
-well as uapi/linux/hdlc/ioctl.h. Ensure that we define all of the
-necessary guards to provide updated definitions of ifmap, ifreq and
-IFNAMSIZ. This resolves build issues with kernel headers < 4.11 which
-lacked 2618be7dccf8739b89e1906b64bd8d551af351e6 ("uapi: fix linux/if.h
-userspace compilation errors").
-
-Fixes: 1fa60003a8b8 ("misc: header includes cleanup")
-Reported-by: Markus Mayer <mmayer at broadcom.com>
-Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
----
- Makefile.am             |   6 +-
- internal.h              |   7 +-
- uapi/linux/hdlc/ioctl.h |  94 +++++++++++++
- uapi/linux/if.h         | 296 ++++++++++++++++++++++++++++++++++++++++
- 4 files changed, 397 insertions(+), 6 deletions(-)
- create mode 100644 uapi/linux/hdlc/ioctl.h
- create mode 100644 uapi/linux/if.h
-
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -7,7 +7,8 @@ EXTRA_DIST = LICENSE ethtool.8 ethtool.s
- 
- sbin_PROGRAMS = ethtool
- ethtool_SOURCES = ethtool.c uapi/linux/ethtool.h internal.h \
--		  uapi/linux/net_tstamp.h rxclass.c common.c common.h \
-+		  uapi/linux/net_tstamp.h uapi/linux/if.h uapi/linux/hdlc/ioctl.h \
-+		  rxclass.c common.c common.h \
- 		  json_writer.c json_writer.h json_print.c json_print.h \
- 		  list.h
- if ETHTOOL_ENABLE_PRETTY_DUMP
-@@ -43,7 +44,8 @@ ethtool_SOURCES += \
- 		  netlink/desc-rtnl.c netlink/cable_test.c netlink/tunnels.c \
- 		  uapi/linux/ethtool_netlink.h \
- 		  uapi/linux/netlink.h uapi/linux/genetlink.h \
--		  uapi/linux/rtnetlink.h uapi/linux/if_link.h
-+		  uapi/linux/rtnetlink.h uapi/linux/if_link.h \
-+		  uapi/linux/if.h uapi/linux/hdlc/ioctl.h
- AM_CPPFLAGS += @MNL_CFLAGS@
- LDADD += @MNL_LIBS@
- endif
---- a/internal.h
-+++ b/internal.h
-@@ -21,6 +21,9 @@
- #include <unistd.h>
- #include <endian.h>
- #include <sys/ioctl.h>
-+#define __UAPI_DEF_IF_IFNAMSIZ	1
-+#define __UAPI_DEF_IF_IFMAP	1
-+#define __UAPI_DEF_IF_IFREQ	1
- #include <linux/if.h>
- 
- #include "json_writer.h"
-@@ -52,10 +55,6 @@ typedef int32_t s32;
- #define __KERNEL_DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))
- #endif
- 
--#ifndef ALTIFNAMSIZ
--#define ALTIFNAMSIZ 128
--#endif
--
- #include <linux/ethtool.h>
- #include <linux/net_tstamp.h>
- 
---- /dev/null
-+++ b/uapi/linux/hdlc/ioctl.h
-@@ -0,0 +1,94 @@
-+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-+#ifndef __HDLC_IOCTL_H__
-+#define __HDLC_IOCTL_H__
-+
-+
-+#define GENERIC_HDLC_VERSION 4	/* For synchronization with sethdlc utility */
-+
-+#define CLOCK_DEFAULT   0	/* Default setting */
-+#define CLOCK_EXT	1	/* External TX and RX clock - DTE */
-+#define CLOCK_INT	2	/* Internal TX and RX clock - DCE */
-+#define CLOCK_TXINT	3	/* Internal TX and external RX clock */
-+#define CLOCK_TXFROMRX	4	/* TX clock derived from external RX clock */
-+
-+
-+#define ENCODING_DEFAULT	0 /* Default setting */
-+#define ENCODING_NRZ		1
-+#define ENCODING_NRZI		2
-+#define ENCODING_FM_MARK	3
-+#define ENCODING_FM_SPACE	4
-+#define ENCODING_MANCHESTER	5
-+
-+
-+#define PARITY_DEFAULT		0 /* Default setting */
-+#define PARITY_NONE		1 /* No parity */
-+#define PARITY_CRC16_PR0	2 /* CRC16, initial value 0x0000 */
-+#define PARITY_CRC16_PR1	3 /* CRC16, initial value 0xFFFF */
-+#define PARITY_CRC16_PR0_CCITT	4 /* CRC16, initial 0x0000, ITU-T version */
-+#define PARITY_CRC16_PR1_CCITT	5 /* CRC16, initial 0xFFFF, ITU-T version */
-+#define PARITY_CRC32_PR0_CCITT	6 /* CRC32, initial value 0x00000000 */
-+#define PARITY_CRC32_PR1_CCITT	7 /* CRC32, initial value 0xFFFFFFFF */
-+
-+#define LMI_DEFAULT		0 /* Default setting */
-+#define LMI_NONE		1 /* No LMI, all PVCs are static */
-+#define LMI_ANSI		2 /* ANSI Annex D */
-+#define LMI_CCITT		3 /* ITU-T Annex A */
-+#define LMI_CISCO		4 /* The "original" LMI, aka Gang of Four */
-+
-+#ifndef __ASSEMBLY__
-+
-+typedef struct {
-+	unsigned int clock_rate; /* bits per second */
-+	unsigned int clock_type; /* internal, external, TX-internal etc. */
-+	unsigned short loopback;
-+} sync_serial_settings;          /* V.35, V.24, X.21 */
-+
-+typedef struct {
-+	unsigned int clock_rate; /* bits per second */
-+	unsigned int clock_type; /* internal, external, TX-internal etc. */
-+	unsigned short loopback;
-+	unsigned int slot_map;
-+} te1_settings;                  /* T1, E1 */
-+
-+typedef struct {
-+	unsigned short encoding;
-+	unsigned short parity;
-+} raw_hdlc_proto;
-+
-+typedef struct {
-+	unsigned int t391;
-+	unsigned int t392;
-+	unsigned int n391;
-+	unsigned int n392;
-+	unsigned int n393;
-+	unsigned short lmi;
-+	unsigned short dce; /* 1 for DCE (network side) operation */
-+} fr_proto;
-+
-+typedef struct {
-+	unsigned int dlci;
-+} fr_proto_pvc;          /* for creating/deleting FR PVCs */
-+
-+typedef struct {
-+	unsigned int dlci;
-+	char master[IFNAMSIZ];	/* Name of master FRAD device */
-+}fr_proto_pvc_info;		/* for returning PVC information only */
-+
-+typedef struct {
-+    unsigned int interval;
-+    unsigned int timeout;
-+} cisco_proto;
-+
-+typedef struct {
-+	unsigned short dce; /* 1 for DCE (network side) operation */
-+	unsigned int modulo; /* modulo (8 = basic / 128 = extended) */
-+	unsigned int window; /* frame window size */
-+	unsigned int t1; /* timeout t1 */
-+	unsigned int t2; /* timeout t2 */
-+	unsigned int n2; /* frame retry counter */
-+} x25_hdlc_proto;
-+
-+/* PPP doesn't need any info now - supply length = 0 to ioctl */
-+
-+#endif /* __ASSEMBLY__ */
-+#endif /* __HDLC_IOCTL_H__ */
---- /dev/null
-+++ b/uapi/linux/if.h
-@@ -0,0 +1,296 @@
-+/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
-+/*
-+ * INET		An implementation of the TCP/IP protocol suite for the LINUX
-+ *		operating system.  INET is implemented using the  BSD Socket
-+ *		interface as the means of communication with the user level.
-+ *
-+ *		Global definitions for the INET interface module.
-+ *
-+ * Version:	@(#)if.h	1.0.2	04/18/93
-+ *
-+ * Authors:	Original taken from Berkeley UNIX 4.3, (c) UCB 1982-1988
-+ *		Ross Biro
-+ *		Fred N. van Kempen, <waltje at uWalt.NL.Mugnet.ORG>
-+ *
-+ *		This program is free software; you can redistribute it and/or
-+ *		modify it under the terms of the GNU General Public License
-+ *		as published by the Free Software Foundation; either version
-+ *		2 of the License, or (at your option) any later version.
-+ */
-+#ifndef _LINUX_IF_H
-+#define _LINUX_IF_H
-+
-+#include <linux/libc-compat.h>          /* for compatibility with glibc */
-+#include <linux/types.h>		/* for "__kernel_caddr_t" et al	*/
-+#include <linux/socket.h>		/* for "struct sockaddr" et al	*/
-+		/* for "__user" et al           */
-+
-+#include <sys/socket.h>			/* for struct sockaddr.		*/
-+
-+#if __UAPI_DEF_IF_IFNAMSIZ
-+#define	IFNAMSIZ	16
-+#endif /* __UAPI_DEF_IF_IFNAMSIZ */
-+#define	IFALIASZ	256
-+#define	ALTIFNAMSIZ	128
-+#include <linux/hdlc/ioctl.h>
-+
-+/* For glibc compatibility. An empty enum does not compile. */
-+#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 || \
-+    __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0
-+/**
-+ * enum net_device_flags - &struct net_device flags
-+ *
-+ * These are the &struct net_device flags, they can be set by drivers, the
-+ * kernel and some can be triggered by userspace. Userspace can query and
-+ * set these flags using userspace utilities but there is also a sysfs
-+ * entry available for all dev flags which can be queried and set. These flags
-+ * are shared for all types of net_devices. The sysfs entries are available
-+ * via /sys/class/net/<dev>/flags. Flags which can be toggled through sysfs
-+ * are annotated below, note that only a few flags can be toggled and some
-+ * other flags are always preserved from the original net_device flags
-+ * even if you try to set them via sysfs. Flags which are always preserved
-+ * are kept under the flag grouping @IFF_VOLATILE. Flags which are __volatile__
-+ * are annotated below as such.
-+ *
-+ * You should have a pretty good reason to be extending these flags.
-+ *
-+ * @IFF_UP: interface is up. Can be toggled through sysfs.
-+ * @IFF_BROADCAST: broadcast address valid. Volatile.
-+ * @IFF_DEBUG: turn on debugging. Can be toggled through sysfs.
-+ * @IFF_LOOPBACK: is a loopback net. Volatile.
-+ * @IFF_POINTOPOINT: interface is has p-p link. Volatile.
-+ * @IFF_NOTRAILERS: avoid use of trailers. Can be toggled through sysfs.
-+ *	Volatile.
-+ * @IFF_RUNNING: interface RFC2863 OPER_UP. Volatile.
-+ * @IFF_NOARP: no ARP protocol. Can be toggled through sysfs. Volatile.
-+ * @IFF_PROMISC: receive all packets. Can be toggled through sysfs.
-+ * @IFF_ALLMULTI: receive all multicast packets. Can be toggled through
-+ *	sysfs.
-+ * @IFF_MASTER: master of a load balancer. Volatile.
-+ * @IFF_SLAVE: slave of a load balancer. Volatile.
-+ * @IFF_MULTICAST: Supports multicast. Can be toggled through sysfs.
-+ * @IFF_PORTSEL: can set media type. Can be toggled through sysfs.
-+ * @IFF_AUTOMEDIA: auto media select active. Can be toggled through sysfs.
-+ * @IFF_DYNAMIC: dialup device with changing addresses. Can be toggled
-+ *	through sysfs.
-+ * @IFF_LOWER_UP: driver signals L1 up. Volatile.
-+ * @IFF_DORMANT: driver signals dormant. Volatile.
-+ * @IFF_ECHO: echo sent packets. Volatile.
-+ */
-+enum net_device_flags {
-+/* for compatibility with glibc net/if.h */
-+#if __UAPI_DEF_IF_NET_DEVICE_FLAGS
-+	IFF_UP				= 1<<0,  /* sysfs */
-+	IFF_BROADCAST			= 1<<1,  /* __volatile__ */
-+	IFF_DEBUG			= 1<<2,  /* sysfs */
-+	IFF_LOOPBACK			= 1<<3,  /* __volatile__ */
-+	IFF_POINTOPOINT			= 1<<4,  /* __volatile__ */
-+	IFF_NOTRAILERS			= 1<<5,  /* sysfs */
-+	IFF_RUNNING			= 1<<6,  /* __volatile__ */
-+	IFF_NOARP			= 1<<7,  /* sysfs */
-+	IFF_PROMISC			= 1<<8,  /* sysfs */
-+	IFF_ALLMULTI			= 1<<9,  /* sysfs */
-+	IFF_MASTER			= 1<<10, /* __volatile__ */
-+	IFF_SLAVE			= 1<<11, /* __volatile__ */
-+	IFF_MULTICAST			= 1<<12, /* sysfs */
-+	IFF_PORTSEL			= 1<<13, /* sysfs */
-+	IFF_AUTOMEDIA			= 1<<14, /* sysfs */
-+	IFF_DYNAMIC			= 1<<15, /* sysfs */
-+#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS */
-+#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
-+	IFF_LOWER_UP			= 1<<16, /* __volatile__ */
-+	IFF_DORMANT			= 1<<17, /* __volatile__ */
-+	IFF_ECHO			= 1<<18, /* __volatile__ */
-+#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */
-+};
-+#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 || __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0 */
-+
-+/* for compatibility with glibc net/if.h */
-+#if __UAPI_DEF_IF_NET_DEVICE_FLAGS
-+#define IFF_UP				IFF_UP
-+#define IFF_BROADCAST			IFF_BROADCAST
-+#define IFF_DEBUG			IFF_DEBUG
-+#define IFF_LOOPBACK			IFF_LOOPBACK
-+#define IFF_POINTOPOINT			IFF_POINTOPOINT
-+#define IFF_NOTRAILERS			IFF_NOTRAILERS
-+#define IFF_RUNNING			IFF_RUNNING
-+#define IFF_NOARP			IFF_NOARP
-+#define IFF_PROMISC			IFF_PROMISC
-+#define IFF_ALLMULTI			IFF_ALLMULTI
-+#define IFF_MASTER			IFF_MASTER
-+#define IFF_SLAVE			IFF_SLAVE
-+#define IFF_MULTICAST			IFF_MULTICAST
-+#define IFF_PORTSEL			IFF_PORTSEL
-+#define IFF_AUTOMEDIA			IFF_AUTOMEDIA
-+#define IFF_DYNAMIC			IFF_DYNAMIC
-+#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS */
-+
-+#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO
-+#define IFF_LOWER_UP			IFF_LOWER_UP
-+#define IFF_DORMANT			IFF_DORMANT
-+#define IFF_ECHO			IFF_ECHO
-+#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */
-+
-+#define IFF_VOLATILE	(IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO|\
-+		IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
-+
-+#define IF_GET_IFACE	0x0001		/* for querying only */
-+#define IF_GET_PROTO	0x0002
-+
-+/* For definitions see hdlc.h */
-+#define IF_IFACE_V35	0x1000		/* V.35 serial interface	*/
-+#define IF_IFACE_V24	0x1001		/* V.24 serial interface	*/
-+#define IF_IFACE_X21	0x1002		/* X.21 serial interface	*/
-+#define IF_IFACE_T1	0x1003		/* T1 telco serial interface	*/
-+#define IF_IFACE_E1	0x1004		/* E1 telco serial interface	*/
-+#define IF_IFACE_SYNC_SERIAL 0x1005	/* can't be set by software	*/
-+#define IF_IFACE_X21D   0x1006          /* X.21 Dual Clocking (FarSite) */
-+
-+/* For definitions see hdlc.h */
-+#define IF_PROTO_HDLC	0x2000		/* raw HDLC protocol		*/
-+#define IF_PROTO_PPP	0x2001		/* PPP protocol			*/
-+#define IF_PROTO_CISCO	0x2002		/* Cisco HDLC protocol		*/
-+#define IF_PROTO_FR	0x2003		/* Frame Relay protocol		*/
-+#define IF_PROTO_FR_ADD_PVC 0x2004	/*    Create FR PVC		*/
-+#define IF_PROTO_FR_DEL_PVC 0x2005	/*    Delete FR PVC		*/
-+#define IF_PROTO_X25	0x2006		/* X.25				*/
-+#define IF_PROTO_HDLC_ETH 0x2007	/* raw HDLC, Ethernet emulation	*/
-+#define IF_PROTO_FR_ADD_ETH_PVC 0x2008	/*  Create FR Ethernet-bridged PVC */
-+#define IF_PROTO_FR_DEL_ETH_PVC 0x2009	/*  Delete FR Ethernet-bridged PVC */
-+#define IF_PROTO_FR_PVC	0x200A		/* for reading PVC status	*/
-+#define IF_PROTO_FR_ETH_PVC 0x200B
-+#define IF_PROTO_RAW    0x200C          /* RAW Socket                   */
-+
-+/* RFC 2863 operational status */
-+enum {
-+	IF_OPER_UNKNOWN,
-+	IF_OPER_NOTPRESENT,
-+	IF_OPER_DOWN,
-+	IF_OPER_LOWERLAYERDOWN,
-+	IF_OPER_TESTING,
-+	IF_OPER_DORMANT,
-+	IF_OPER_UP,
-+};
-+
-+/* link modes */
-+enum {
-+	IF_LINK_MODE_DEFAULT,
-+	IF_LINK_MODE_DORMANT,	/* limit upward transition to dormant */
-+	IF_LINK_MODE_TESTING,	/* limit upward transition to testing */
-+};
-+
-+/*
-+ *	Device mapping structure. I'd just gone off and designed a 
-+ *	beautiful scheme using only loadable modules with arguments
-+ *	for driver options and along come the PCMCIA people 8)
-+ *
-+ *	Ah well. The get() side of this is good for WDSETUP, and it'll
-+ *	be handy for debugging things. The set side is fine for now and
-+ *	being very small might be worth keeping for clean configuration.
-+ */
-+
-+/* for compatibility with glibc net/if.h */
-+#if __UAPI_DEF_IF_IFMAP
-+struct ifmap {
-+	unsigned long mem_start;
-+	unsigned long mem_end;
-+	unsigned short base_addr; 
-+	unsigned char irq;
-+	unsigned char dma;
-+	unsigned char port;
-+	/* 3 bytes spare */
-+};
-+#endif /* __UAPI_DEF_IF_IFMAP */
-+
-+struct if_settings {
-+	unsigned int type;	/* Type of physical device or protocol */
-+	unsigned int size;	/* Size of the data allocated by the caller */
-+	union {
-+		/* {atm/eth/dsl}_settings anyone ? */
-+		raw_hdlc_proto		*raw_hdlc;
-+		cisco_proto		*cisco;
-+		fr_proto		*fr;
-+		fr_proto_pvc		*fr_pvc;
-+		fr_proto_pvc_info	*fr_pvc_info;
-+		x25_hdlc_proto		*x25;
-+
-+		/* interface settings */
-+		sync_serial_settings	*sync;
-+		te1_settings		*te1;
-+	} ifs_ifsu;
-+};
-+
-+/*
-+ * Interface request structure used for socket
-+ * ioctl's.  All interface ioctl's must have parameter
-+ * definitions which begin with ifr_name.  The
-+ * remainder may be interface specific.
-+ */
-+
-+/* for compatibility with glibc net/if.h */
-+#if __UAPI_DEF_IF_IFREQ
-+struct ifreq {
-+#define IFHWADDRLEN	6
-+	union
-+	{
-+		char	ifrn_name[IFNAMSIZ];		/* if name, e.g. "en0" */
-+	} ifr_ifrn;
-+	
-+	union {
-+		struct	sockaddr ifru_addr;
-+		struct	sockaddr ifru_dstaddr;
-+		struct	sockaddr ifru_broadaddr;
-+		struct	sockaddr ifru_netmask;
-+		struct  sockaddr ifru_hwaddr;
-+		short	ifru_flags;
-+		int	ifru_ivalue;
-+		int	ifru_mtu;
-+		struct  ifmap ifru_map;
-+		char	ifru_slave[IFNAMSIZ];	/* Just fits the size */
-+		char	ifru_newname[IFNAMSIZ];
-+		void *	ifru_data;
-+		struct	if_settings ifru_settings;
-+	} ifr_ifru;
-+};
-+#endif /* __UAPI_DEF_IF_IFREQ */
-+
-+#define ifr_name	ifr_ifrn.ifrn_name	/* interface name 	*/
-+#define ifr_hwaddr	ifr_ifru.ifru_hwaddr	/* MAC address 		*/
-+#define	ifr_addr	ifr_ifru.ifru_addr	/* address		*/
-+#define	ifr_dstaddr	ifr_ifru.ifru_dstaddr	/* other end of p-p lnk	*/
-+#define	ifr_broadaddr	ifr_ifru.ifru_broadaddr	/* broadcast address	*/
-+#define	ifr_netmask	ifr_ifru.ifru_netmask	/* interface net mask	*/
-+#define	ifr_flags	ifr_ifru.ifru_flags	/* flags		*/
-+#define	ifr_metric	ifr_ifru.ifru_ivalue	/* metric		*/
-+#define	ifr_mtu		ifr_ifru.ifru_mtu	/* mtu			*/
-+#define ifr_map		ifr_ifru.ifru_map	/* device map		*/
-+#define ifr_slave	ifr_ifru.ifru_slave	/* slave device		*/
-+#define	ifr_data	ifr_ifru.ifru_data	/* for use by interface	*/
-+#define ifr_ifindex	ifr_ifru.ifru_ivalue	/* interface index	*/
-+#define ifr_bandwidth	ifr_ifru.ifru_ivalue    /* link bandwidth	*/
-+#define ifr_qlen	ifr_ifru.ifru_ivalue	/* Queue length 	*/
-+#define ifr_newname	ifr_ifru.ifru_newname	/* New name		*/
-+#define ifr_settings	ifr_ifru.ifru_settings	/* Device/proto settings*/
-+
-+/*
-+ * Structure used in SIOCGIFCONF request.
-+ * Used to retrieve interface configuration
-+ * for machine (useful for programs which
-+ * must know all networks accessible).
-+ */
-+
-+/* for compatibility with glibc net/if.h */
-+#if __UAPI_DEF_IF_IFCONF
-+struct ifconf  {
-+	int	ifc_len;			/* size of buffer	*/
-+	union {
-+		char *ifcu_buf;
-+		struct ifreq *ifcu_req;
-+	} ifc_ifcu;
-+};
-+#endif /* __UAPI_DEF_IF_IFCONF */
-+
-+#define	ifc_buf	ifc_ifcu.ifcu_buf		/* buffer address	*/
-+#define	ifc_req	ifc_ifcu.ifcu_req		/* array of structures	*/
-+
-+#endif /* _LINUX_IF_H */
diff --git a/package/network/utils/ethtool/patches/101-netlink-Fix-maybe-uninitialized-meters-variable.patch b/package/network/utils/ethtool/patches/101-netlink-Fix-maybe-uninitialized-meters-variable.patch
deleted file mode 100644
index 381b949ede..0000000000
--- a/package/network/utils/ethtool/patches/101-netlink-Fix-maybe-uninitialized-meters-variable.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From:   Florian Fainelli <f.fainelli at gmail.com>
-To:     netdev at vger.kernel.org
-Subject: [PATCH ethtool v2 2/3] netlink: Fix maybe uninitialized 'meters' variable
-Date:   Sat, 14 Jan 2023 08:34:10 -0800
-
-GCC12 warns that 'meters' may be uninitialized, initialize it
-accordingly.
-
-Fixes: 9561db9b76f4 ("Add cable test TDR support")
-Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
----
- netlink/parser.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/netlink/parser.c
-+++ b/netlink/parser.c
-@@ -237,7 +237,7 @@ int nl_parse_direct_m2cm(struct nl_conte
- 			 struct nl_msg_buff *msgbuff, void *dest)
- {
- 	const char *arg = *nlctx->argp;
--	float meters;
-+	float meters = 0.0;
- 	uint32_t cm;
- 	int ret;
- 
diff --git a/package/network/utils/ethtool/patches/102-raw-marvell-c-Fix-build-with-musl-libc.patch b/package/network/utils/ethtool/patches/102-raw-marvell-c-Fix-build-with-musl-libc.patch
deleted file mode 100644
index 33b1715967..0000000000
--- a/package/network/utils/ethtool/patches/102-raw-marvell-c-Fix-build-with-musl-libc.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-From:   Florian Fainelli <f.fainelli at gmail.com>
-To:     netdev at vger.kernel.org
-Subject: [PATCH ethtool v2 3/3] marvell.c: Fix build with musl-libc
-Date:   Sat, 14 Jan 2023 08:34:11 -0800
-
-After commit 1fa60003a8b8 ("misc: header includes cleanup") we stopped
-including net/if.h which resolved the proper defines to pull in
-sys/types.h and provide a definition for u_int32_t. With musl-libc we
-would need to define _GNU_SOURCE to ensure that sys/types.h does provide a
-definition for u_int32_t.
-
-Rather, just replace u_uint{16,32}_t with the more standard
-uint{16,32}_t types from stdint.h
-
-Fixes: 1fa60003a8b8 ("misc: header includes cleanup")
-Signed-off-by: Florian Fainelli <f.fainelli at gmail.com>
----
- marvell.c | 34 +++++++++++++++++-----------------
- 1 file changed, 17 insertions(+), 17 deletions(-)
-
---- a/marvell.c
-+++ b/marvell.c
-@@ -31,23 +31,23 @@ static void dump_timer(const char *name,
- static void dump_queue(const char *name, const void *a, int rx)
- {
- 	struct desc {
--		u_int32_t		ctl;
--		u_int32_t		next;
--		u_int32_t		data_lo;
--		u_int32_t		data_hi;
--		u_int32_t		status;
--		u_int32_t		timestamp;
--		u_int16_t		csum2;
--		u_int16_t		csum1;
--		u_int16_t		csum2_start;
--		u_int16_t		csum1_start;
--		u_int32_t		addr_lo;
--		u_int32_t		addr_hi;
--		u_int32_t		count_lo;
--		u_int32_t		count_hi;
--		u_int32_t               byte_count;
--		u_int32_t               csr;
--		u_int32_t               flag;
-+		uint32_t		ctl;
-+		uint32_t		next;
-+		uint32_t		data_lo;
-+		uint32_t		data_hi;
-+		uint32_t		status;
-+		uint32_t		timestamp;
-+		uint16_t		csum2;
-+		uint16_t		csum1;
-+		uint16_t		csum2_start;
-+		uint16_t		csum1_start;
-+		uint32_t		addr_lo;
-+		uint32_t		addr_hi;
-+		uint32_t		count_lo;
-+		uint32_t		count_hi;
-+		uint32_t		byte_count;
-+		uint32_t		csr;
-+		uint32_t		flag;
- 	};
- 	const struct desc *d = a;
- 



From lede-commits at lists.infradead.org  Sat Feb 25 04:33:37 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 25 Feb 2023 07:33:37 -0500
Subject: [openwrt/openwrt]  iproute2: update to 6.2
In-Reply-To: <167732841716.3800632.11260247380300339123@git-01.infra.openwrt.org>
References: <167732841716.3800632.11260247380300339123@git-01.infra.openwrt.org>
Message-ID: <mailman.19070.1677328424.3064139.lede-commits@lists.infradead.org>

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

commit 638ebd306794397975bdf8035f6b23b61bc5c1c8
Author: Nick Hainke <vincent at systemli.org>
AuthorDate: Wed Feb 22 15:56:25 2023 +0100

    iproute2: update to 6.2
    
    Release Notes:
    https://lwn.net/Articles/923952/
    
    Refresh patches:
    - 110-darwin_fixes.patch
    - 115-add-config-xtlibdir.patch
    - 140-allow_pfifo_fast.patch
    - 140-keep_libmnl_optional.patch
    - 145-keep_libelf_optional.patch
    - 150-keep_libcap_optional.patch
    - 155-keep_tirpc_optional.patch
    - 170-ip_tiny.patch
    - 175-reduce-dynamic-syms.patch
    - 180-drop_FAILED_POLICY.patch
    - 190-fix-nls-rpath-link.patch
    - 195-build_variant_ip_tc.patch
    - 200-drop_libbsd_dependency.patch
    - 300-selinux-configurable.patch
    
    Remove upstreamed:
    - 320-configure-Remove-include-sys-stat.h.patch
    
    While working on it remove AUTORELEASE.
    
    Signed-off-by: Nick Hainke <vincent at systemli.org>
---
 package/network/utils/iproute2/Makefile            |  6 +--
 .../utils/iproute2/patches/110-darwin_fixes.patch  |  8 ++--
 .../iproute2/patches/115-add-config-xtlibdir.patch |  2 +-
 .../iproute2/patches/140-allow_pfifo_fast.patch    |  2 +-
 .../patches/140-keep_libmnl_optional.patch         |  2 +-
 .../patches/145-keep_libelf_optional.patch         |  2 +-
 .../patches/150-keep_libcap_optional.patch         |  2 +-
 .../iproute2/patches/155-keep_tirpc_optional.patch |  2 +-
 .../utils/iproute2/patches/170-ip_tiny.patch       |  4 +-
 .../iproute2/patches/175-reduce-dynamic-syms.patch |  8 ++--
 .../iproute2/patches/180-drop_FAILED_POLICY.patch  |  4 +-
 .../iproute2/patches/190-fix-nls-rpath-link.patch  |  4 +-
 .../iproute2/patches/195-build_variant_ip_tc.patch |  2 +-
 .../patches/200-drop_libbsd_dependency.patch       |  2 +-
 .../patches/300-selinux-configurable.patch         |  2 +-
 .../320-configure-Remove-include-sys-stat.h.patch  | 43 ----------------------
 16 files changed, 26 insertions(+), 69 deletions(-)

diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile
index 39c94bd6e2..302d57bf8b 100644
--- a/package/network/utils/iproute2/Makefile
+++ b/package/network/utils/iproute2/Makefile
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=iproute2
-PKG_VERSION:=6.1.0
-PKG_RELEASE:=$(AUTORELEASE)
+PKG_VERSION:=6.2.0
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2
-PKG_HASH:=5ce12a0fec6b212725ef218735941b2dab76244db7e72646a76021b0537b43ab
+PKG_HASH:=4d72730200ec5b2aabaa1a2f20553c6748292f065d9a154c7d5e22559df9fd62
 PKG_BUILD_PARALLEL:=1
 PKG_BUILD_DEPENDS:=iptables
 PKG_LICENSE:=GPL-2.0
diff --git a/package/network/utils/iproute2/patches/110-darwin_fixes.patch b/package/network/utils/iproute2/patches/110-darwin_fixes.patch
index 1f3eb101ea..06ae59f8b4 100644
--- a/package/network/utils/iproute2/patches/110-darwin_fixes.patch
+++ b/package/network/utils/iproute2/patches/110-darwin_fixes.patch
@@ -1,6 +1,6 @@
 --- a/netem/maketable.c
 +++ b/netem/maketable.c
-@@ -10,7 +10,9 @@
+@@ -11,7 +11,9 @@
  #include <stdio.h>
  #include <stdlib.h>
  #include <math.h>
@@ -12,7 +12,7 @@
  #include <sys/stat.h>
 --- a/netem/normal.c
 +++ b/netem/normal.c
-@@ -8,8 +8,12 @@
+@@ -9,8 +9,12 @@
  #include <string.h>
  #include <limits.h>
  
@@ -27,7 +27,7 @@
  #define TABLEFACTOR NETEM_DIST_SCALE
 --- a/netem/pareto.c
 +++ b/netem/pareto.c
-@@ -7,8 +7,12 @@
+@@ -8,8 +8,12 @@
  #include <math.h>
  #include <limits.h>
  
@@ -42,7 +42,7 @@
  #define TABLESIZE	16384
 --- a/netem/paretonormal.c
 +++ b/netem/paretonormal.c
-@@ -14,10 +14,13 @@
+@@ -15,10 +15,13 @@
  #include <string.h>
  #include <math.h>
  #include <limits.h>
diff --git a/package/network/utils/iproute2/patches/115-add-config-xtlibdir.patch b/package/network/utils/iproute2/patches/115-add-config-xtlibdir.patch
index 8702d5fd2d..03df7809f7 100644
--- a/package/network/utils/iproute2/patches/115-add-config-xtlibdir.patch
+++ b/package/network/utils/iproute2/patches/115-add-config-xtlibdir.patch
@@ -1,6 +1,6 @@
 --- a/tc/Makefile
 +++ b/tc/Makefile
-@@ -128,6 +128,9 @@ CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PR
+@@ -127,6 +127,9 @@ CFLAGS += -DCONFIG_GACT -DCONFIG_GACT_PR
  ifneq ($(IPT_LIB_DIR),)
  	CFLAGS += -DIPT_LIB_DIR=\"$(IPT_LIB_DIR)\"
  endif
diff --git a/package/network/utils/iproute2/patches/140-allow_pfifo_fast.patch b/package/network/utils/iproute2/patches/140-allow_pfifo_fast.patch
index 13de48f412..8f5a7d352e 100644
--- a/package/network/utils/iproute2/patches/140-allow_pfifo_fast.patch
+++ b/package/network/utils/iproute2/patches/140-allow_pfifo_fast.patch
@@ -1,6 +1,6 @@
 --- a/tc/q_fifo.c
 +++ b/tc/q_fifo.c
-@@ -95,5 +95,6 @@ struct qdisc_util pfifo_head_drop_qdisc_
+@@ -90,5 +90,6 @@ struct qdisc_util pfifo_head_drop_qdisc_
  
  struct qdisc_util pfifo_fast_qdisc_util = {
  	.id = "pfifo_fast",
diff --git a/package/network/utils/iproute2/patches/140-keep_libmnl_optional.patch b/package/network/utils/iproute2/patches/140-keep_libmnl_optional.patch
index 7f68f43616..a8cdd103ba 100644
--- a/package/network/utils/iproute2/patches/140-keep_libmnl_optional.patch
+++ b/package/network/utils/iproute2/patches/140-keep_libmnl_optional.patch
@@ -1,6 +1,6 @@
 --- a/configure
 +++ b/configure
-@@ -412,7 +412,7 @@ check_tirpc()
+@@ -411,7 +411,7 @@ check_tirpc()
  
  check_mnl()
  {
diff --git a/package/network/utils/iproute2/patches/145-keep_libelf_optional.patch b/package/network/utils/iproute2/patches/145-keep_libelf_optional.patch
index 2eaae88198..0c5c3f59ed 100644
--- a/package/network/utils/iproute2/patches/145-keep_libelf_optional.patch
+++ b/package/network/utils/iproute2/patches/145-keep_libelf_optional.patch
@@ -1,6 +1,6 @@
 --- a/configure
 +++ b/configure
-@@ -267,7 +267,7 @@ EOF
+@@ -266,7 +266,7 @@ EOF
  
  check_elf()
  {
diff --git a/package/network/utils/iproute2/patches/150-keep_libcap_optional.patch b/package/network/utils/iproute2/patches/150-keep_libcap_optional.patch
index c574840fa8..4cce2c3ca6 100644
--- a/package/network/utils/iproute2/patches/150-keep_libcap_optional.patch
+++ b/package/network/utils/iproute2/patches/150-keep_libcap_optional.patch
@@ -1,6 +1,6 @@
 --- a/configure
 +++ b/configure
-@@ -470,7 +470,7 @@ EOF
+@@ -469,7 +469,7 @@ EOF
  
  check_cap()
  {
diff --git a/package/network/utils/iproute2/patches/155-keep_tirpc_optional.patch b/package/network/utils/iproute2/patches/155-keep_tirpc_optional.patch
index 4ee6245d3b..28ba7e5217 100644
--- a/package/network/utils/iproute2/patches/155-keep_tirpc_optional.patch
+++ b/package/network/utils/iproute2/patches/155-keep_tirpc_optional.patch
@@ -1,6 +1,6 @@
 --- a/configure
 +++ b/configure
-@@ -399,7 +399,7 @@ check_selinux()
+@@ -398,7 +398,7 @@ check_selinux()
  
  check_tirpc()
  {
diff --git a/package/network/utils/iproute2/patches/170-ip_tiny.patch b/package/network/utils/iproute2/patches/170-ip_tiny.patch
index eef5e38229..71081c36bc 100644
--- a/package/network/utils/iproute2/patches/170-ip_tiny.patch
+++ b/package/network/utils/iproute2/patches/170-ip_tiny.patch
@@ -25,7 +25,7 @@
  		sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \
 --- a/ip/ip.c
 +++ b/ip/ip.c
-@@ -65,11 +65,17 @@ static void usage(void)
+@@ -61,11 +61,17 @@ static void usage(void)
  	fprintf(stderr,
  		"Usage: ip [ OPTIONS ] OBJECT { COMMAND | help }\n"
  		"       ip [ -force ] -batch filename\n"
@@ -43,7 +43,7 @@
  		"       OPTIONS := { -V[ersion] | -s[tatistics] | -d[etails] | -r[esolve] |\n"
  		"                    -h[uman-readable] | -iec | -j[son] | -p[retty] |\n"
  		"                    -f[amily] { inet | inet6 | mpls | bridge | link } |\n"
-@@ -92,37 +98,49 @@ static const struct cmd {
+@@ -88,37 +94,49 @@ static const struct cmd {
  	int (*func)(int argc, char **argv);
  } cmds[] = {
  	{ "address",	do_ipaddr },
diff --git a/package/network/utils/iproute2/patches/175-reduce-dynamic-syms.patch b/package/network/utils/iproute2/patches/175-reduce-dynamic-syms.patch
index c3892e5a0e..d0914848d5 100644
--- a/package/network/utils/iproute2/patches/175-reduce-dynamic-syms.patch
+++ b/package/network/utils/iproute2/patches/175-reduce-dynamic-syms.patch
@@ -1,6 +1,6 @@
 --- a/tc/Makefile
 +++ b/tc/Makefile
-@@ -114,7 +114,7 @@ LDLIBS += -L. -lm
+@@ -113,7 +113,7 @@ LDLIBS += -L. -lm
  
  ifeq ($(SHARED_LIBS),y)
  LDLIBS += -ldl
@@ -9,7 +9,7 @@
  endif
  
  TCLIB := tc_core.o
-@@ -144,7 +144,7 @@ MODDESTDIR := $(DESTDIR)$(LIBDIR)/tc
+@@ -143,7 +143,7 @@ MODDESTDIR := $(DESTDIR)$(LIBDIR)/tc
  all: tc $(TCSO)
  
  tc: $(TCOBJ) $(LIBNETLINK) libtc.a
@@ -18,7 +18,7 @@
  
  libtc.a: $(TCLIB)
  	$(QUIET_AR)$(AR) rcs $@ $^
-@@ -166,6 +166,7 @@ install: all
+@@ -165,6 +165,7 @@ install: all
  clean:
  	rm -f $(TCOBJ) $(TCLIB) libtc.a tc *.so emp_ematch.tab.h; \
  	rm -f emp_ematch.tab.*
@@ -26,7 +26,7 @@
  
  q_atm.so: q_atm.c
  	$(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fpic -o q_atm.so q_atm.c -latm
-@@ -205,4 +206,16 @@ static-syms.h: $(wildcard *.c)
+@@ -204,4 +205,16 @@ static-syms.h: $(wildcard *.c)
  		sed -n '/'$$s'[^ ]* =/{s:.* \([^ ]*'$$s'[^ ]*\) .*:extern char \1[] __attribute__((weak)); if (!strcmp(sym, "\1")) return \1;:;p}' $$files ; \
  	done > $@
  
diff --git a/package/network/utils/iproute2/patches/180-drop_FAILED_POLICY.patch b/package/network/utils/iproute2/patches/180-drop_FAILED_POLICY.patch
index 094ff393a6..9ce7dd9a13 100644
--- a/package/network/utils/iproute2/patches/180-drop_FAILED_POLICY.patch
+++ b/package/network/utils/iproute2/patches/180-drop_FAILED_POLICY.patch
@@ -11,7 +11,7 @@ Subject: [PATCH] add support for dropping with FAILED_POLICY
 
 --- a/ip/rtm_map.c
 +++ b/ip/rtm_map.c
-@@ -54,6 +54,8 @@ char *rtnl_rtntype_n2a(int id, char *buf
+@@ -49,6 +49,8 @@ char *rtnl_rtntype_n2a(int id, char *buf
  		return "nat";
  	case RTN_XRESOLVE:
  		return "xresolve";
@@ -20,7 +20,7 @@ Subject: [PATCH] add support for dropping with FAILED_POLICY
  	default:
  		snprintf(buf, len, "%d", id);
  		return buf;
-@@ -89,6 +91,8 @@ int rtnl_rtntype_a2n(int *id, char *arg)
+@@ -84,6 +86,8 @@ int rtnl_rtntype_a2n(int *id, char *arg)
  		res = RTN_UNICAST;
  	else if (strcmp(arg, "throw") == 0)
  		res = RTN_THROW;
diff --git a/package/network/utils/iproute2/patches/190-fix-nls-rpath-link.patch b/package/network/utils/iproute2/patches/190-fix-nls-rpath-link.patch
index 2f3f90fe1a..c7fceb2e22 100644
--- a/package/network/utils/iproute2/patches/190-fix-nls-rpath-link.patch
+++ b/package/network/utils/iproute2/patches/190-fix-nls-rpath-link.patch
@@ -1,6 +1,6 @@
 --- a/configure
 +++ b/configure
-@@ -291,7 +291,7 @@ int main(int argc, char **argv) {
+@@ -290,7 +290,7 @@ int main(int argc, char **argv) {
  }
  EOF
  
@@ -9,7 +9,7 @@
      local ret=$?
  
      rm -f $TMPDIR/libbpf_test.c $TMPDIR/libbpf_test
-@@ -309,7 +309,7 @@ int main(int argc, char **argv) {
+@@ -308,7 +308,7 @@ int main(int argc, char **argv) {
  }
  EOF
  
diff --git a/package/network/utils/iproute2/patches/195-build_variant_ip_tc.patch b/package/network/utils/iproute2/patches/195-build_variant_ip_tc.patch
index dc9c0b2969..141763460d 100644
--- a/package/network/utils/iproute2/patches/195-build_variant_ip_tc.patch
+++ b/package/network/utils/iproute2/patches/195-build_variant_ip_tc.patch
@@ -11,7 +11,7 @@
  
 --- a/tc/Makefile
 +++ b/tc/Makefile
-@@ -141,7 +141,7 @@ MODDESTDIR := $(DESTDIR)$(LIBDIR)/tc
+@@ -140,7 +140,7 @@ MODDESTDIR := $(DESTDIR)$(LIBDIR)/tc
  	$(QUIET_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -shared -fpic $< -o $@
  
  
diff --git a/package/network/utils/iproute2/patches/200-drop_libbsd_dependency.patch b/package/network/utils/iproute2/patches/200-drop_libbsd_dependency.patch
index 052bdd84eb..d1948860e8 100644
--- a/package/network/utils/iproute2/patches/200-drop_libbsd_dependency.patch
+++ b/package/network/utils/iproute2/patches/200-drop_libbsd_dependency.patch
@@ -1,6 +1,6 @@
 --- a/configure
 +++ b/configure
-@@ -456,14 +456,8 @@ EOF
+@@ -455,14 +455,8 @@ EOF
      if $CC -I$INCLUDE -o $TMPDIR/strtest $TMPDIR/strtest.c >/dev/null 2>&1; then
  	echo "no"
      else
diff --git a/package/network/utils/iproute2/patches/300-selinux-configurable.patch b/package/network/utils/iproute2/patches/300-selinux-configurable.patch
index adfa405c7f..817abf7d17 100644
--- a/package/network/utils/iproute2/patches/300-selinux-configurable.patch
+++ b/package/network/utils/iproute2/patches/300-selinux-configurable.patch
@@ -1,6 +1,6 @@
 --- a/configure
 +++ b/configure
-@@ -386,7 +386,7 @@ check_libbpf()
+@@ -385,7 +385,7 @@ check_libbpf()
  check_selinux()
  # SELinux is a compile time option in the ss utility
  {
diff --git a/package/network/utils/iproute2/patches/320-configure-Remove-include-sys-stat.h.patch b/package/network/utils/iproute2/patches/320-configure-Remove-include-sys-stat.h.patch
deleted file mode 100644
index 02bb20297d..0000000000
--- a/package/network/utils/iproute2/patches/320-configure-Remove-include-sys-stat.h.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 3a3a2f6be704c970938eb8dac4eb0118f1c2fb06 Mon Sep 17 00:00:00 2001
-From: Hauke Mehrtens <hauke at hauke-m.de>
-Date: Wed, 21 Dec 2022 23:26:28 +0100
-Subject: [PATCH iproute2 v2] configure: Remove include <sys/stat.h>
-
-The check_name_to_handle_at() function in the configure script is
-including sys/stat.h. This include fails with glibc 2.36 like this:
-````
-In file included from /linux-5.15.84/include/uapi/linux/stat.h:5,
-                 from /toolchain-x86_64_gcc-12.2.0_glibc/include/bits/statx.h:31,
-                 from /toolchain-x86_64_gcc-12.2.0_glibc/include/sys/stat.h:465,
-                 from config.YExfMc/name_to_handle_at_test.c:3:
-/linux-5.15.84/include/uapi/linux/types.h:10:2: warning: #warning "Attempt to use kernel headers from user space, see https://kernelnewbies.org/KernelHeaders" [-Wcpp]
-   10 | #warning "Attempt to use kernel headers from user space, see https://kernelnewbies.org/KernelHeaders"
-      |  ^~~~~~~
-In file included from /linux-5.15.84/include/uapi/linux/posix_types.h:5,
-                 from /linux-5.15.84/include/uapi/linux/types.h:14:
-/linux-5.15.84/include/uapi/linux/stddef.h:5:10: fatal error: linux/compiler_types.h: No such file or directory
-    5 | #include <linux/compiler_types.h>
-      |          ^~~~~~~~~~~~~~~~~~~~~~~~
-compilation terminated.
-````
-
-Just removing the include works, the manpage of name_to_handle_at() says
-only fcntl.h is needed.
-
-Fixes: c5b72cc56bf8 ("lib/fs: fix issue when {name,open}_to_handle_at() is not implemented")
-Tested-by: Heiko Thiery <heiko.thiery at gmail.com>
-Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
----
- configure | 1 -
- 1 file changed, 1 deletion(-)
-
---- a/configure
-+++ b/configure
-@@ -215,7 +215,6 @@ check_name_to_handle_at()
-     cat >$TMPDIR/name_to_handle_at_test.c <<EOF
- #define _GNU_SOURCE
- #include <sys/types.h>
--#include <sys/stat.h>
- #include <fcntl.h>
- int main(int argc, char **argv)
- {



From lede-commits at lists.infradead.org  Sat Feb 25 04:49:18 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 25 Feb 2023 07:49:18 -0500
Subject: [openwrt/openwrt]  toolchain: remove references to $(LIBC)/utils
 subtarget
In-Reply-To: <167732935658.3811286.2597347122058882459@git-01.infra.openwrt.org>
References: <167732935658.3811286.2597347122058882459@git-01.infra.openwrt.org>
Message-ID: <mailman.19071.1677329364.3064139.lede-commits@lists.infradead.org>

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

commit b2d7cdaea9fdbd4a05c90c252ef0abdeaaea4381
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Tue Feb 21 14:58:20 2023 -0500

    toolchain: remove references to $(LIBC)/utils subtarget
    
    The utils subtarget was used for uClibc and eglibc
    which are both obsolete and replaced in Openwrt by mainline
    musl and glibc, which do not have a utils Makefile target.
    
    Ref: 5d19a38d8 ("toolchain: sync eglibc headers/build split with uclibc changes")
    Fixes: 63fb17520 ("toolchain: remove uClibc-ng")
    Suggested-by: Andre Heider <a.heider at gmail.com>
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 toolchain/Makefile | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/toolchain/Makefile b/toolchain/Makefile
index 60e3507250..c0046293c9 100644
--- a/toolchain/Makefile
+++ b/toolchain/Makefile
@@ -21,8 +21,6 @@
 #    build & install the final libc
 # 7) toolchain/gcc/final/compile
 #    build & install the final gcc
-# 8) toolchain/libc/utils/compile
-#    build & install libc utilities
 #
 # For musl, steps 2 and 4 are skipped, and step 3 is done after 5
 
@@ -46,7 +44,6 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
 
   $(curdir)/$(LIBC)/compile:=$(curdir)/gcc/initial/compile $(curdir)/kernel-headers/compile
   $(curdir)/gcc/final/compile:=$(curdir)/$(LIBC)/compile
-  $(curdir)/$(LIBC)/utils/compile:=$(curdir)/gcc/final/compile
 endif
 
 ifndef DUMP_TARGET_DB



From lede-commits at lists.infradead.org  Sat Feb 25 04:49:17 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 25 Feb 2023 07:49:17 -0500
Subject: [openwrt/openwrt]  toolchain: cleanup dependencies
In-Reply-To: <167732935658.3811286.2597347122058882459@git-01.infra.openwrt.org>
References: <167732935658.3811286.2597347122058882459@git-01.infra.openwrt.org>
Message-ID: <mailman.19072.1677329364.3064139.lede-commits@lists.infradead.org>

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

commit 6a7cde15000832ce0164dc27d85822b2e2dd9fe6
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Wed Aug 10 17:56:41 2022 -0400

    toolchain: cleanup dependencies
    
    Reorganize dependencies between toolchain targets to save a line.
    This also puts them in a linear order which is easier to read.
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 toolchain/Makefile | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/toolchain/Makefile b/toolchain/Makefile
index 19b144ee36..60e3507250 100644
--- a/toolchain/Makefile
+++ b/toolchain/Makefile
@@ -34,8 +34,8 @@ $(curdir)/builddirs := $(if $(CONFIG_GDB),gdb) $(if $(CONFIG_EXTERNAL_TOOLCHAIN)
 # builddir dependencies
 ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
   ifdef CONFIG_USE_MUSL
+    $(curdir)/gcc/initial/compile:=$(curdir)/binutils/compile
     $(curdir)/kernel-headers/compile:=$(curdir)/gcc/initial/compile
-    $(curdir)/$(LIBC)/compile:=$(curdir)/kernel-headers/compile
   else
     $(curdir)/builddirs += $(LIBC)/headers gcc/minimal
     $(curdir)/gcc/minimal/compile:=$(curdir)/binutils/compile
@@ -44,9 +44,8 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
     $(curdir)/gcc/initial/compile:=$(curdir)/$(LIBC)/headers/compile
   endif
 
-  $(curdir)/gcc/initial/compile+=$(curdir)/binutils/compile
-  $(curdir)/$(LIBC)/compile:=$(curdir)/gcc/initial/compile
-  $(curdir)/gcc/final/compile:=$(curdir)/$(LIBC)/compile $(curdir)/kernel-headers/compile
+  $(curdir)/$(LIBC)/compile:=$(curdir)/gcc/initial/compile $(curdir)/kernel-headers/compile
+  $(curdir)/gcc/final/compile:=$(curdir)/$(LIBC)/compile
   $(curdir)/$(LIBC)/utils/compile:=$(curdir)/gcc/final/compile
 endif
 



From lede-commits at lists.infradead.org  Sat Feb 25 04:49:16 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 25 Feb 2023 07:49:16 -0500
Subject: [openwrt/openwrt]  toolchain: fix stampfile dependency
In-Reply-To: <167732935658.3811286.2597347122058882459@git-01.infra.openwrt.org>
References: <167732935658.3811286.2597347122058882459@git-01.infra.openwrt.org>
Message-ID: <mailman.19073.1677329366.3064139.lede-commits@lists.infradead.org>

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

commit 743c4ad6824a17a5ec102ef009684a70801bda62
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Fri Sep 9 21:43:18 2022 -0400

    toolchain: fix stampfile dependency
    
    Use the gcc/final/install target stampfile as the prerequisite
    for the toolchain/compile target stampfile.
    
    The previous filename was also incorrect,
    the stampfile name format was changed (see reference)
    but was never updated here.
    
    The issue was never noticed
    because the usage of timestamp.pl was broken
    (fixed in previous commit)
    causing the extra prereq files passed to 'call stampfile'
    to never get checked at all.
    
    Fixes: 5149ed151 ("gcc: split up the build process into three distinct stages")
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
---
 toolchain/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/toolchain/Makefile b/toolchain/Makefile
index 5dccf8f829..19b144ee36 100644
--- a/toolchain/Makefile
+++ b/toolchain/Makefile
@@ -85,12 +85,12 @@ $(curdir)/ := .config prereq
 $(curdir)//compile = $(STAGING_DIR)/.prepared $(TOOLCHAIN_DIR)/info.mk $(tools/stamp-compile)
 
 ifndef DUMP_TARGET_DB
-$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed:
+$(TOOLCHAIN_DIR)/stamp/.gcc_final_installed:
 endif
 
 $(curdir)/install: $(curdir)/compile
 
-$(eval $(call stampfile,$(curdir),toolchain,compile,$(TOOLCHAIN_DIR)/stamp/.gcc-initial_installed,,$(TOOLCHAIN_DIR)))
+$(eval $(call stampfile,$(curdir),toolchain,compile,$(TOOLCHAIN_DIR)/stamp/.gcc_final_installed,,$(TOOLCHAIN_DIR)))
 $(eval $(call stampfile,$(curdir),toolchain,check,$(TMP_DIR)/.build))
 $(eval $(call subdir,$(curdir)))
 



From lede-commits at lists.infradead.org  Sat Feb 25 05:33:00 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 25 Feb 2023 08:33:00 -0500
Subject: [openwrt/openwrt]  ath79: add support for GL.iNet GL-X1200
In-Reply-To: <167733197999.3839984.14857860310309810353@git-01.infra.openwrt.org>
References: <167733197999.3839984.14857860310309810353@git-01.infra.openwrt.org>
Message-ID: <mailman.19074.1677331991.3064139.lede-commits@lists.infradead.org>

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

commit dd8a4a8c34c0b721000198ff01f2ff5158f32414
Author: Xinfa Deng <xinfa.deng at gl-inet.com>
AuthorDate: Thu Feb 9 15:37:30 2023 +0800

    ath79: add support for GL.iNet GL-X1200
    
    This patch adds supports for GL-X1200.
    
    Specification:
            - SOC: QCA9563 (775MHz)
            - Flash: 16 MiB
            - RAM: 128 MiB DDR2
            - Ethernet: 4x 1Gbps LAN + 1x 1Gbps WAN
            - Wireless: QCA9563(2.4GHz) and QCA9886(5GHz)
            - SIM: 2x SIM card slots
            - MicroSD: 1x microSD slot
            - Antenna: 2x external 5dBi antennas
            - USB: 1x USB 2.0 port
            - Button: 1x reset button
            - LED: 16x LEDs (3x GPIO controllable)
            - UART: 1x UART on PCB (JP1: 3.3V, RX, TX, GND)
            - OEM U-Boot supplies HTTP/GUI access
    
    Implementation Notes
    ====================
    
    Both the NOR and NAND variants boot off a NOR-based kernel,
    consistent with the OEM's firmware.
    
    The mode LEDs are
        * Boot, Running   system
        * Failsafe        2G
        * Upgrade         5G
    
    Installation
    ============
    
    Using sysupgrade
    ----------------
    
    sysupgrade may be used to install a NAND image on a device running
    a NAND image or a NOR image on a device running a NOR image. It is
    recommended to *not* preserve config when upgrading from OEM firmware
    or previous versions of OpenWrt. No supported sysupgrade path should
    require "force". Transitioning from NOR to NAND can be accomplished
    
    Using U-Boot
    ------------
    
    The OEM U-Boot can be put into a graphical, firmware-upload mode by
    holding down the button on the side of the router while applying power
    and for a bit more than five seconds following with the current OEM
    U-Boot. The power LED will come on, then the 5G LED will flash five
    times, about once a second.  When the 5G LED stops flashing and the
    2G LED lights solid, the router's U-Boot will provide an upload page
    at http://192.168.1.1/ Either a browser may be used to upload an image,
    or a utility such as curl may be used:
    
    curl -X POST -F gl_firmware=\@*-nand-squashfs-factory.img \
             http://192.168.1.1/index.html
    or
        curl -X POST -F gl_firmware=\@*-nor-squashfs-sysupgrade.bin \
             http://192.168.1.1/index.html
    
    Note that NOR vs. NAND is based on the file name extension.
    
    Signed-off-by: Xinfa Deng <xinfa.deng at gl-inet.com>
---
 .../ath79/dts/qca9563_glinet_gl-x1200-nor-nand.dts |  29 +++
 .../ath79/dts/qca9563_glinet_gl-x1200-nor.dts      |  16 ++
 .../linux/ath79/dts/qca9563_glinet_gl-x1200.dtsi   | 209 +++++++++++++++++++++
 target/linux/ath79/image/nand.mk                   |  29 +++
 .../ath79/nand/base-files/etc/board.d/02_network   |  10 +
 .../ath79/nand/base-files/lib/upgrade/platform.sh  |   4 +-
 6 files changed, 296 insertions(+), 1 deletion(-)

diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-x1200-nor-nand.dts b/target/linux/ath79/dts/qca9563_glinet_gl-x1200-nor-nand.dts
new file mode 100644
index 0000000000..2a26d959c9
--- /dev/null
+++ b/target/linux/ath79/dts/qca9563_glinet_gl-x1200-nor-nand.dts
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qca9563_glinet_gl-x1200.dtsi"
+
+/ {
+	compatible = "glinet,gl-x1200-nor-nand", "qca,qca9563";
+	model = "GL.iNet GL-X1200 (NOR/NAND)";
+};
+
+&nor_partitions {
+	partition at 60000 {
+		label = "kernel";
+		reg = <0x060000 0x400000>;
+
+		/*
+		 * U-Boot bootcmd is "bootm 0x9f060000".
+		 * So this might be possible to resize in the future.
+		 */
+	};
+
+	partition at 460000 {
+		label = "nor_reserved";
+		reg = <0x460000 0xba0000>;
+	};
+};
+
+&nand_ubi {
+	label = "ubi";
+};
diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-x1200-nor.dts b/target/linux/ath79/dts/qca9563_glinet_gl-x1200-nor.dts
new file mode 100644
index 0000000000..dfce3818b0
--- /dev/null
+++ b/target/linux/ath79/dts/qca9563_glinet_gl-x1200-nor.dts
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "qca9563_glinet_gl-x1200.dtsi"
+
+/ {
+	compatible = "glinet,gl-x1200-nor", "qca,qca9563";
+	model = "GL.iNet GL-X1200 (NOR)";
+};
+
+&nor_partitions {
+	partition at 60000 {
+		compatible = "denx,uimage";
+		label = "firmware";
+		reg = <0x060000 0xfa0000>;
+	};
+};
diff --git a/target/linux/ath79/dts/qca9563_glinet_gl-x1200.dtsi b/target/linux/ath79/dts/qca9563_glinet_gl-x1200.dtsi
new file mode 100644
index 0000000000..8980f772e7
--- /dev/null
+++ b/target/linux/ath79/dts/qca9563_glinet_gl-x1200.dtsi
@@ -0,0 +1,209 @@
+// 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>
+
+/ {
+	aliases {
+		led-boot = &led_system;
+		led-failsafe = &led_system;
+		led-running = &led_system;
+		led-upgrade = &led_system;
+		label-mac-device = &eth0;
+	};
+
+	keys {
+		compatible = "gpio-keys";
+
+		pinctrl-names = "default";
+		pinctrl-0 = <&jtag_disable_pins>;
+
+		reset {
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+
+		led_system: system {
+			label = "red:system";
+			gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
+			default-state = "keep";
+		};
+
+		wlan2g {
+			label = "green:wlan2g";
+			gpios = <&gpio 19 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy1tpt";
+		};
+
+		wlan5g {
+			label = "green:wlan5g";
+			gpios = <&gpio 20 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "phy0tpt";
+		};
+	};
+
+	gpio-export {
+		compatible = "gpio-export";
+
+		gpio_modem1_power {
+			gpio-export,name = "gl-x1200:4g1:power";
+			gpio-export,output = <0>;
+			gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
+		};
+
+		gpio_modem2_power {
+			gpio-export,name = "gl-x1200:4g2:power";
+			gpio-export,output = <0>;
+			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&spi {
+	status = "okay";
+
+	flash at 0 {
+		compatible = "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <25000000>;
+
+		nor_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 = "art";
+				reg = <0x050000 0x010000>;
+				read-only;
+
+				compatible = "nvmem-cells";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				calibration_ath9k: calibration at 1000 {
+					reg = <0x1000 0x440>;
+				};
+
+				calibration_ath10k: calibration at 5000 {
+					reg = <0x5000 0x2f20>;
+				};
+
+				macaddr_art_0: macaddr at 0 {
+					reg = <0x0 0x6>;
+				};
+
+				macaddr_art_1002: macaddr at 1002 {
+					reg = <0x1002 0x6>;
+				};
+
+				macaddr_art_5006: macaddr at 5006 {
+					reg = <0x5006 0x6>;
+				};
+			};
+
+			/* Firmware / Kernel flash type specific */
+		};
+	};
+
+	flash at 1 {
+		compatible = "spi-nand";
+		reg = <1>;
+		spi-max-frequency = <25000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			nand_ubi: partition at 0 {
+				label = "nand_ubi";
+				reg = <0x000000 0x8000000>;
+			};
+		};
+	};
+};
+
+&eth0 {
+	status = "okay";
+
+	phy-handle = <&phy0>;
+
+	nvmem-cells = <&macaddr_art_0>;
+	nvmem-cell-names = "mac-address";
+};
+
+&gpio {
+	usb_vbus {
+		gpio-hog;
+		gpios = <7 GPIO_ACTIVE_HIGH>;
+		output-high;
+		line-name = "usb-vbus";
+	};
+};
+
+&mdio0 {
+	status = "okay";
+
+	phy0: ethernet-phy at 0 {
+		reg = <0>;
+		phy-mode = "sgmii";
+		qca,ar8327-initvals = <
+			0x04 0x00080080 /* PORT0 PAD MODE CTRL */
+			0x7c 0x0000007e /* PORT0_STATUS */
+		>;
+	};
+};
+
+&pcie {
+	status = "okay";
+
+	wifi at 0,0 {
+		compatible = "qcom,ath10k";
+		reg = <0 0 0 0 0>;
+
+		nvmem-cells = <&macaddr_art_5006>, <&calibration_ath10k>;
+		nvmem-cell-names = "mac-address", "pre-calibration";
+	};
+};
+
+&usb0 {
+	status = "okay";
+};
+
+&usb1 {
+	status = "okay";
+};
+
+&usb_phy0 {
+	status = "okay";
+};
+
+&usb_phy1 {
+	status = "okay";
+};
+
+&wmac {
+	status = "okay";
+
+	nvmem-cells = <&macaddr_art_1002>, <&calibration_ath9k>;
+	nvmem-cell-names = "mac-address", "calibration";
+};
diff --git a/target/linux/ath79/image/nand.mk b/target/linux/ath79/image/nand.mk
index c83beef952..40c57d8b06 100644
--- a/target/linux/ath79/image/nand.mk
+++ b/target/linux/ath79/image/nand.mk
@@ -212,6 +212,35 @@ define Device/glinet_gl-xe300
 endef
 TARGET_DEVICES += glinet_gl-xe300
 
+define Device/glinet_gl-x1200-common
+  SOC := qca9563
+  DEVICE_VENDOR := GL.iNet
+  DEVICE_MODEL := GL-X1200
+  DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct-htt kmod-usb2 \
+	kmod-usb-storage block-mount kmod-usb-net-qmi-wwan uqmi
+  IMAGE_SIZE := 16000k
+endef
+
+define Device/glinet_gl-x1200-nor-nand
+  $(Device/glinet_gl-x1200-common)
+  DEVICE_VARIANT := NOR/NAND
+  KERNEL_SIZE := 4096k
+  IMAGE_SIZE := 131072k
+  PAGESIZE := 2048
+  VID_HDR_OFFSET := 2048
+  BLOCKSIZE := 128k
+  IMAGES += factory.img
+  IMAGE/factory.img := append-kernel | pad-to $$$$(KERNEL_SIZE) | append-ubi
+  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
+endef
+TARGET_DEVICES += glinet_gl-x1200-nor-nand
+
+define Device/glinet_gl-x1200-nor
+  $(Device/glinet_gl-x1200-common)
+  DEVICE_VARIANT := NOR
+endef
+TARGET_DEVICES += glinet_gl-x1200-nor
+
 define Device/linksys_ea4500-v3
   SOC := qca9558
   DEVICE_VENDOR := Linksys
diff --git a/target/linux/ath79/nand/base-files/etc/board.d/02_network b/target/linux/ath79/nand/base-files/etc/board.d/02_network
index b163b29db1..137f3aa11b 100644
--- a/target/linux/ath79/nand/base-files/etc/board.d/02_network
+++ b/target/linux/ath79/nand/base-files/etc/board.d/02_network
@@ -30,6 +30,11 @@ ath79_setup_interfaces()
 		ucidef_add_switch "switch0" \
 			"0 at eth0" "4:lan"
 		;;
+	glinet,gl-x1200-nor|\
+	glinet,gl-x1200-nor-nand)
+		ucidef_add_switch "switch0" \
+			"0 at eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" "5:wan"
+		;;
 	linksys,ea4500-v3)
 		ucidef_add_switch "switch0" \
 			"6 at eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan" "0 at eth0"
@@ -88,6 +93,11 @@ ath79_setup_macs()
 		wan_mac=$(mtd_get_mac_binary art 0x0)
 		label_mac=$wan_mac
 		;;
+	glinet,gl-x1200-nor|\
+	glinet,gl-x1200-nor-nand)
+		wan_mac=$(mtd_get_mac_binary art 0x0)
+		lan_mac=$(macaddr_add "$wan_mac" 1)
+		;;
 	netgear,wndr3700-v4|\
 	netgear,wndr4300|\
 	netgear,wndr4300sw|\
diff --git a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh
index ea77345b06..5a4f76ba51 100644
--- a/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh
+++ b/target/linux/ath79/nand/base-files/lib/upgrade/platform.sh
@@ -19,7 +19,9 @@ platform_do_upgrade() {
 		glinet_nand_nor_do_upgrade "$1"
 		;;
 	glinet,gl-ar750s-nor|\
-	glinet,gl-ar750s-nor-nand)
+	glinet,gl-ar750s-nor-nand|\
+	glinet,gl-x1200-nor|\
+	glinet,gl-x1200-nor-nand)
 		nand_nor_do_upgrade "$1"
 		;;
 	*)



From lede-commits at lists.infradead.org  Sat Feb 25 10:58:37 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 25 Feb 2023 13:58:37 -0500
Subject: [openwrt/openwrt]  netifd: update to the latest version
In-Reply-To: <167735151664.4079402.18305968926080391422@git-01.infra.openwrt.org>
References: <167735151664.4079402.18305968926080391422@git-01.infra.openwrt.org>
Message-ID: <mailman.19103.1677351522.3064139.lede-commits@lists.infradead.org>

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

commit 2a104365dc50e3df5d63809aee16497402278f02
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sat Feb 25 19:56:12 2023 +0100

    netifd: update to the latest version
    
    ed65a00 netifd: bridge: Fix format string position
    19372d8 netifd: Fix multiple -Wsign-compare warnings
    8ebf033 netifd: Do not return values in void function
    c77417a netifd: Explicitly zero initialize variables
    463a120 netifd: Activate -Wextra compile warnings
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/network/config/netifd/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile
index f40a990b42..d9d1bce26f 100644
--- a/package/network/config/netifd/Makefile
+++ b/package/network/config/netifd/Makefile
@@ -1,13 +1,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=netifd
-PKG_RELEASE:=2
+PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git
-PKG_SOURCE_DATE:=2022-12-30
-PKG_SOURCE_VERSION:=81c1fbcba2f27f687c2a471f341502d47679f401
-PKG_MIRROR_HASH:=41d19f2804759aa42708942e27116bec78b169abee639d97c2ec7f0f62fa7739
+PKG_SOURCE_DATE:=2023-02-25
+PKG_SOURCE_VERSION:=463a1207f0766417866e2c28316e58a96f84370b
+PKG_MIRROR_HASH:=1d407847282637f6e069b482368f2f8fc0126e66f3b37e4258e1fc1d19dd1ce5
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
 
 PKG_LICENSE:=GPL-2.0



From lede-commits at lists.infradead.org  Sat Feb 25 10:58:36 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 25 Feb 2023 13:58:36 -0500
Subject: [openwrt/openwrt]  ustream-ssl: update to Git version 2023-02-25
In-Reply-To: <167735151664.4079402.18305968926080391422@git-01.infra.openwrt.org>
References: <167735151664.4079402.18305968926080391422@git-01.infra.openwrt.org>
Message-ID: <mailman.19104.1677351525.3064139.lede-commits@lists.infradead.org>

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

commit 32a9fdfc02c9146b108c39a2f21679b6c64cb3e2
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Sat Feb 25 18:37:26 2023 +0100

    ustream-ssl: update to Git version 2023-02-25
    
    498f6e2 ustream-mbedtls: Use getrandom() instead of /dev/urandom
    
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/libs/ustream-ssl/Makefile | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/package/libs/ustream-ssl/Makefile b/package/libs/ustream-ssl/Makefile
index c94e9a97ca..ae5c8026c2 100644
--- a/package/libs/ustream-ssl/Makefile
+++ b/package/libs/ustream-ssl/Makefile
@@ -1,13 +1,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ustream-ssl
-PKG_RELEASE:=2
+PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/ustream-ssl.git
-PKG_SOURCE_DATE:=2022-12-08
-PKG_SOURCE_VERSION:=9217ab46536353c7c792951b57163063f5ec7a3b
-PKG_MIRROR_HASH:=cd4dc6a6c18290348b1f8b1c01df3320e4954dc46d714c797bef066f7a91248d
+PKG_SOURCE_DATE:=2023-02-25
+PKG_SOURCE_VERSION:=498f6e268d4d2b0ad33b430f4ba1abe397d31496
+PKG_MIRROR_HASH:=a201d065dd613e30886c9f13a0851cec79538192cfe591b6f8ecd88724d55fb1
 CMAKE_INSTALL:=1
 
 PKG_LICENSE:=ISC



From lede-commits at lists.infradead.org  Sat Feb 25 11:21:07 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 25 Feb 2023 14:21:07 -0500
Subject: [openwrt/openwrt]  mvebu: puzzle: fix fan thermal cooling driver
In-Reply-To: <167735286718.4100578.8484165538569469672@git-01.infra.openwrt.org>
References: <167735286718.4100578.8484165538569469672@git-01.infra.openwrt.org>
Message-ID: <mailman.19105.1677352877.3064139.lede-commits@lists.infradead.org>

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

commit ea33a5def506b0ba647f779e60e6ccca03c29a17
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Sat Feb 25 02:35:16 2023 +0000

    mvebu: puzzle: fix fan thermal cooling driver
    
    Several fixes for the Puzzle WT61P803 hwmon driver were needed to make
    it behave well as thermal cooling device:
     - wire-up cooling device with OF node in device tree
     - properly parse cooling-levels (u32 with range check vs. u8)
     - actually use cooling-levels
     - keep current state and only write to uC if state has changed
       (avoids flooding the uC with commands which will result in uC crashing)
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 ...on-Add-the-IEI-WT61P803-PUZZLE-HWMON-driv.patch | 78 +++++++++++++++-------
 ...on-Add-the-IEI-WT61P803-PUZZLE-HWMON-driv.patch | 78 +++++++++++++++-------
 2 files changed, 110 insertions(+), 46 deletions(-)

diff --git a/target/linux/mvebu/patches-5.10/903-drivers-hwmon-Add-the-IEI-WT61P803-PUZZLE-HWMON-driv.patch b/target/linux/mvebu/patches-5.10/903-drivers-hwmon-Add-the-IEI-WT61P803-PUZZLE-HWMON-driv.patch
index 684f09c800..d31709fd85 100644
--- a/target/linux/mvebu/patches-5.10/903-drivers-hwmon-Add-the-IEI-WT61P803-PUZZLE-HWMON-driv.patch
+++ b/target/linux/mvebu/patches-5.10/903-drivers-hwmon-Add-the-IEI-WT61P803-PUZZLE-HWMON-driv.patch
@@ -53,7 +53,7 @@ Cc: Robert Marko <robert.marko at sartura.hr>
  obj-$(CONFIG_SENSORS_IBMPOWERNV)+= ibmpowernv.o
 --- /dev/null
 +++ b/drivers/hwmon/iei-wt61p803-puzzle-hwmon.c
-@@ -0,0 +1,413 @@
+@@ -0,0 +1,445 @@
 +// SPDX-License-Identifier: GPL-2.0-only
 +/* IEI WT61P803 PUZZLE MCU HWMON Driver
 + *
@@ -84,13 +84,17 @@ Cc: Robert Marko <robert.marko at sartura.hr>
 + * @name:		Thermal cooling device name
 + * @pwm_channel:	Controlled PWM channel (0 or 1)
 + * @cooling_levels:	Thermal cooling device cooling levels (DT)
++ * @cur_level:		Current cooling level
++ * @num_levels:	Number of cooling levels
 + */
 +struct iei_wt61p803_puzzle_thermal_cooling_device {
 +	struct iei_wt61p803_puzzle_hwmon *mcu_hwmon;
 +	struct thermal_cooling_device *tcdev;
 +	char name[THERMAL_NAME_LENGTH];
 +	int pwm_channel;
-+	u8 *cooling_levels;
++	u32 *cooling_levels;
++	int cur_level;
++	u8 num_levels;
 +};
 +
 +/**
@@ -326,8 +330,12 @@ Cc: Robert Marko <robert.marko at sartura.hr>
 +static int iei_wt61p803_puzzle_get_max_state(struct thermal_cooling_device *tcdev,
 +					     unsigned long *state)
 +{
-+	*state = IEI_WT61P803_PUZZLE_HWMON_MAX_PWM_VAL;
++	struct iei_wt61p803_puzzle_thermal_cooling_device *cdev = tcdev->devdata;
++
++	if (!cdev)
++		return -EINVAL;
 +
++	*state = cdev->num_levels - 1;
 +	return 0;
 +}
 +
@@ -335,14 +343,14 @@ Cc: Robert Marko <robert.marko at sartura.hr>
 +					     unsigned long *state)
 +{
 +	struct iei_wt61p803_puzzle_thermal_cooling_device *cdev = tcdev->devdata;
-+	struct iei_wt61p803_puzzle_hwmon *mcu_hwmon = cdev->mcu_hwmon;
-+	long value;
-+	int ret;
 +
-+	ret = iei_wt61p803_puzzle_read_pwm_channel(mcu_hwmon, cdev->pwm_channel, &value);
-+	if (ret)
-+		return ret;
-+	*state = value;
++	if (!cdev)
++		return -EINVAL;
++
++	if (cdev->cur_level < 0)
++		return -EAGAIN;
++
++	*state = cdev->cur_level;
 +	return 0;
 +}
 +
@@ -350,9 +358,21 @@ Cc: Robert Marko <robert.marko at sartura.hr>
 +					     unsigned long state)
 +{
 +	struct iei_wt61p803_puzzle_thermal_cooling_device *cdev = tcdev->devdata;
-+	struct iei_wt61p803_puzzle_hwmon *mcu_hwmon = cdev->mcu_hwmon;
++	u8 pwm_level;
++
++	if (!cdev)
++		return -EINVAL;
 +
-+	return iei_wt61p803_puzzle_write_pwm_channel(mcu_hwmon, cdev->pwm_channel, state);
++	if (state >= cdev->num_levels)
++		return -EINVAL;
++
++	if (state == cdev->cur_level)
++		return 0;
++
++	cdev->cur_level = state;
++	pwm_level = cdev->cooling_levels[state];
++
++	return iei_wt61p803_puzzle_write_pwm_channel(cdev->mcu_hwmon, cdev->pwm_channel, pwm_level);
 +}
 +
 +static const struct thermal_cooling_device_ops iei_wt61p803_puzzle_cooling_ops = {
@@ -369,7 +389,7 @@ Cc: Robert Marko <robert.marko at sartura.hr>
 +	struct iei_wt61p803_puzzle_thermal_cooling_device *cdev;
 +	u32 pwm_channel;
 +	u8 num_levels;
-+	int ret;
++	int i, ret;
 +
 +	ret = fwnode_property_read_u32(child, "reg", &pwm_channel);
 +	if (ret)
@@ -377,7 +397,7 @@ Cc: Robert Marko <robert.marko at sartura.hr>
 +
 +	mcu_hwmon->thermal_cooling_dev_present[pwm_channel] = true;
 +
-+	num_levels = fwnode_property_count_u8(child, "cooling-levels");
++	num_levels = fwnode_property_count_u32(child, "cooling-levels");
 +	if (!num_levels)
 +		return -EINVAL;
 +
@@ -385,28 +405,40 @@ Cc: Robert Marko <robert.marko at sartura.hr>
 +	if (!cdev)
 +		return -ENOMEM;
 +
-+	cdev->cooling_levels = devm_kmalloc_array(dev, num_levels, sizeof(u8), GFP_KERNEL);
++	cdev->cooling_levels = devm_kmalloc_array(dev, num_levels, sizeof(u32), GFP_KERNEL);
 +	if (!cdev->cooling_levels)
 +		return -ENOMEM;
 +
-+	ret = fwnode_property_read_u8_array(child, "cooling-levels",
-+					    cdev->cooling_levels,
-+					    num_levels);
++	ret = fwnode_property_read_u32_array(child, "cooling-levels",
++					     cdev->cooling_levels,
++					     num_levels);
 +	if (ret) {
 +		dev_err(dev, "Couldn't read property 'cooling-levels'\n");
 +		return ret;
 +	}
 +
-+	snprintf(cdev->name, THERMAL_NAME_LENGTH, "wt61p803_puzzle_%d", pwm_channel);
-+	cdev->tcdev = devm_thermal_of_cooling_device_register(dev, NULL, cdev->name, cdev,
-+							      &iei_wt61p803_puzzle_cooling_ops);
-+	if (IS_ERR(cdev->tcdev))
-+		return PTR_ERR(cdev->tcdev);
++	for (i = 0; i < num_levels; i++) {
++		if (cdev->cooling_levels[i] >
++		    IEI_WT61P803_PUZZLE_HWMON_MAX_PWM_VAL) {
++			dev_err(dev, "iei_wt61p803_fan state[%d]:%d > %d\n", i,
++				cdev->cooling_levels[i],
++				IEI_WT61P803_PUZZLE_HWMON_MAX_PWM_VAL);
++			return -EINVAL;
++		}
++	}
 +
 +	cdev->mcu_hwmon = mcu_hwmon;
 +	cdev->pwm_channel = pwm_channel;
++	cdev->num_levels = num_levels;
++	cdev->cur_level = -1;
 +	mcu_hwmon->cdev[pwm_channel] = cdev;
 +
++	snprintf(cdev->name, THERMAL_NAME_LENGTH, "wt61p803_puzzle_%d", pwm_channel);
++	cdev->tcdev = devm_thermal_of_cooling_device_register(dev, to_of_node(child), cdev->name,
++							      cdev, &iei_wt61p803_puzzle_cooling_ops);
++	if (IS_ERR(cdev->tcdev))
++		return PTR_ERR(cdev->tcdev);
++
 +	return 0;
 +}
 +
diff --git a/target/linux/mvebu/patches-5.15/903-drivers-hwmon-Add-the-IEI-WT61P803-PUZZLE-HWMON-driv.patch b/target/linux/mvebu/patches-5.15/903-drivers-hwmon-Add-the-IEI-WT61P803-PUZZLE-HWMON-driv.patch
index c22314e41c..023495373b 100644
--- a/target/linux/mvebu/patches-5.15/903-drivers-hwmon-Add-the-IEI-WT61P803-PUZZLE-HWMON-driv.patch
+++ b/target/linux/mvebu/patches-5.15/903-drivers-hwmon-Add-the-IEI-WT61P803-PUZZLE-HWMON-driv.patch
@@ -53,7 +53,7 @@ Cc: Robert Marko <robert.marko at sartura.hr>
  obj-$(CONFIG_SENSORS_IBMPOWERNV)+= ibmpowernv.o
 --- /dev/null
 +++ b/drivers/hwmon/iei-wt61p803-puzzle-hwmon.c
-@@ -0,0 +1,413 @@
+@@ -0,0 +1,445 @@
 +// SPDX-License-Identifier: GPL-2.0-only
 +/* IEI WT61P803 PUZZLE MCU HWMON Driver
 + *
@@ -84,13 +84,17 @@ Cc: Robert Marko <robert.marko at sartura.hr>
 + * @name:		Thermal cooling device name
 + * @pwm_channel:	Controlled PWM channel (0 or 1)
 + * @cooling_levels:	Thermal cooling device cooling levels (DT)
++ * @cur_level:		Current cooling level
++ * @num_levels:	Number of cooling levels
 + */
 +struct iei_wt61p803_puzzle_thermal_cooling_device {
 +	struct iei_wt61p803_puzzle_hwmon *mcu_hwmon;
 +	struct thermal_cooling_device *tcdev;
 +	char name[THERMAL_NAME_LENGTH];
 +	int pwm_channel;
-+	u8 *cooling_levels;
++	u32 *cooling_levels;
++	int cur_level;
++	u8 num_levels;
 +};
 +
 +/**
@@ -326,8 +330,12 @@ Cc: Robert Marko <robert.marko at sartura.hr>
 +static int iei_wt61p803_puzzle_get_max_state(struct thermal_cooling_device *tcdev,
 +					     unsigned long *state)
 +{
-+	*state = IEI_WT61P803_PUZZLE_HWMON_MAX_PWM_VAL;
++	struct iei_wt61p803_puzzle_thermal_cooling_device *cdev = tcdev->devdata;
++
++	if (!cdev)
++		return -EINVAL;
 +
++	*state = cdev->num_levels - 1;
 +	return 0;
 +}
 +
@@ -335,14 +343,14 @@ Cc: Robert Marko <robert.marko at sartura.hr>
 +					     unsigned long *state)
 +{
 +	struct iei_wt61p803_puzzle_thermal_cooling_device *cdev = tcdev->devdata;
-+	struct iei_wt61p803_puzzle_hwmon *mcu_hwmon = cdev->mcu_hwmon;
-+	long value;
-+	int ret;
 +
-+	ret = iei_wt61p803_puzzle_read_pwm_channel(mcu_hwmon, cdev->pwm_channel, &value);
-+	if (ret)
-+		return ret;
-+	*state = value;
++	if (!cdev)
++		return -EINVAL;
++
++	if (cdev->cur_level < 0)
++		return -EAGAIN;
++
++	*state = cdev->cur_level;
 +	return 0;
 +}
 +
@@ -350,9 +358,21 @@ Cc: Robert Marko <robert.marko at sartura.hr>
 +					     unsigned long state)
 +{
 +	struct iei_wt61p803_puzzle_thermal_cooling_device *cdev = tcdev->devdata;
-+	struct iei_wt61p803_puzzle_hwmon *mcu_hwmon = cdev->mcu_hwmon;
++	u8 pwm_level;
++
++	if (!cdev)
++		return -EINVAL;
 +
-+	return iei_wt61p803_puzzle_write_pwm_channel(mcu_hwmon, cdev->pwm_channel, state);
++	if (state >= cdev->num_levels)
++		return -EINVAL;
++
++	if (state == cdev->cur_level)
++		return 0;
++
++	cdev->cur_level = state;
++	pwm_level = cdev->cooling_levels[state];
++
++	return iei_wt61p803_puzzle_write_pwm_channel(cdev->mcu_hwmon, cdev->pwm_channel, pwm_level);
 +}
 +
 +static const struct thermal_cooling_device_ops iei_wt61p803_puzzle_cooling_ops = {
@@ -369,7 +389,7 @@ Cc: Robert Marko <robert.marko at sartura.hr>
 +	struct iei_wt61p803_puzzle_thermal_cooling_device *cdev;
 +	u32 pwm_channel;
 +	u8 num_levels;
-+	int ret;
++	int i, ret;
 +
 +	ret = fwnode_property_read_u32(child, "reg", &pwm_channel);
 +	if (ret)
@@ -377,7 +397,7 @@ Cc: Robert Marko <robert.marko at sartura.hr>
 +
 +	mcu_hwmon->thermal_cooling_dev_present[pwm_channel] = true;
 +
-+	num_levels = fwnode_property_count_u8(child, "cooling-levels");
++	num_levels = fwnode_property_count_u32(child, "cooling-levels");
 +	if (!num_levels)
 +		return -EINVAL;
 +
@@ -385,28 +405,40 @@ Cc: Robert Marko <robert.marko at sartura.hr>
 +	if (!cdev)
 +		return -ENOMEM;
 +
-+	cdev->cooling_levels = devm_kmalloc_array(dev, num_levels, sizeof(u8), GFP_KERNEL);
++	cdev->cooling_levels = devm_kmalloc_array(dev, num_levels, sizeof(u32), GFP_KERNEL);
 +	if (!cdev->cooling_levels)
 +		return -ENOMEM;
 +
-+	ret = fwnode_property_read_u8_array(child, "cooling-levels",
-+					    cdev->cooling_levels,
-+					    num_levels);
++	ret = fwnode_property_read_u32_array(child, "cooling-levels",
++					     cdev->cooling_levels,
++					     num_levels);
 +	if (ret) {
 +		dev_err(dev, "Couldn't read property 'cooling-levels'\n");
 +		return ret;
 +	}
 +
-+	snprintf(cdev->name, THERMAL_NAME_LENGTH, "wt61p803_puzzle_%d", pwm_channel);
-+	cdev->tcdev = devm_thermal_of_cooling_device_register(dev, NULL, cdev->name, cdev,
-+							      &iei_wt61p803_puzzle_cooling_ops);
-+	if (IS_ERR(cdev->tcdev))
-+		return PTR_ERR(cdev->tcdev);
++	for (i = 0; i < num_levels; i++) {
++		if (cdev->cooling_levels[i] >
++		    IEI_WT61P803_PUZZLE_HWMON_MAX_PWM_VAL) {
++			dev_err(dev, "iei_wt61p803_fan state[%d]:%d > %d\n", i,
++				cdev->cooling_levels[i],
++				IEI_WT61P803_PUZZLE_HWMON_MAX_PWM_VAL);
++			return -EINVAL;
++		}
++	}
 +
 +	cdev->mcu_hwmon = mcu_hwmon;
 +	cdev->pwm_channel = pwm_channel;
++	cdev->num_levels = num_levels;
++	cdev->cur_level = -1;
 +	mcu_hwmon->cdev[pwm_channel] = cdev;
 +
++	snprintf(cdev->name, THERMAL_NAME_LENGTH, "wt61p803_puzzle_%d", pwm_channel);
++	cdev->tcdev = devm_thermal_of_cooling_device_register(dev, to_of_node(child), cdev->name,
++							      cdev, &iei_wt61p803_puzzle_cooling_ops);
++	if (IS_ERR(cdev->tcdev))
++		return PTR_ERR(cdev->tcdev);
++
 +	return 0;
 +}
 +



From lede-commits at lists.infradead.org  Sat Feb 25 11:21:09 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 25 Feb 2023 14:21:09 -0500
Subject: [openwrt/openwrt]  tools/squashfs4: fix PKG_MIRROR_HASH
In-Reply-To: <167735286718.4100578.8484165538569469672@git-01.infra.openwrt.org>
References: <167735286718.4100578.8484165538569469672@git-01.infra.openwrt.org>
Message-ID: <mailman.19106.1677352879.3064139.lede-commits@lists.infradead.org>

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

commit af5e230c2036af07ef0fca6795ee259849b51e59
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Sat Feb 25 17:49:10 2023 +0000

    tools/squashfs4: fix PKG_MIRROR_HASH
    
    The hash currently matches neither the SHA256 of the Github download
    nor the hash of the archive generated by the OpenWrt build system.
    (and yes, they differ...)
    
    Set hash of Github-generated tarball.
    
    Fixes: 30f2d516ba ("tools/squashfs4: add new tool for squashfs4 images")
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 tools/squashfs4/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/squashfs4/Makefile b/tools/squashfs4/Makefile
index 9d4f6babfc..7c8bcf1a72 100644
--- a/tools/squashfs4/Makefile
+++ b/tools/squashfs4/Makefile
@@ -15,7 +15,7 @@ PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://github.com/plougher/squashfs-tools
 PKG_SOURCE_DATE:=2022-03-17
 PKG_SOURCE_VERSION:=afdd63fc386919b4aa40d573b0a6069414d14317
-PKG_MIRROR_HASH:=caedb66cf6dcbdcee0d1525923e203d003ef15f34a13a328686794666f16171f
+PKG_MIRROR_HASH:=59c294e00ddfc1f4bda658c7567584ce35fdd479c413ebdb1376981b27737be1
 
 include $(INCLUDE_DIR)/host-build.mk
 



From lede-commits at lists.infradead.org  Sat Feb 25 11:21:08 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 25 Feb 2023 14:21:08 -0500
Subject: [openwrt/openwrt]  mvebu: setup effective thermal zones on Puzzle
 M901 and M902
In-Reply-To: <167735286718.4100578.8484165538569469672@git-01.infra.openwrt.org>
References: <167735286718.4100578.8484165538569469672@git-01.infra.openwrt.org>
Message-ID: <mailman.19107.1677352881.3064139.lede-commits@lists.infradead.org>

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

commit aa41f4a395bda69cb6ef0ef423e2a4077284fbcd
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Sat Feb 25 17:42:23 2023 +0000

    mvebu: setup effective thermal zones on Puzzle M901 and M902
    
    Assign fan with 4 active cooling levels to be used for the main CPU as
    well as external SerDes units.
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 .../arm64/boot/dts/marvell/cn9131-puzzle-m901.dts  | 27 +++++++-------
 .../arm64/boot/dts/marvell/cn9132-puzzle-m902.dts  | 32 +++++++++--------
 .../arm64/boot/dts/marvell/puzzle-thermal.dtsi     | 41 ++++++++++++++++++++++
 3 files changed, 70 insertions(+), 30 deletions(-)

diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/cn9131-puzzle-m901.dts b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/cn9131-puzzle-m901.dts
index 80d876b4ad..0ad25fafbb 100644
--- a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/cn9131-puzzle-m901.dts
+++ b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/cn9131-puzzle-m901.dts
@@ -6,6 +6,7 @@
  */
 
 #include "cn9130.dtsi"
+#include "puzzle-thermal.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
@@ -109,26 +110,18 @@
 			chassis_fan_group0: fan-group at 0 {
 				#cooling-cells = <2>;
 				reg = <0x00>;
-				cooling-levels = <64 102 170 230 250>;
+				cooling-levels = <80 102 170 230 255>;
 			};
 		};
 	};
 };
 
-&ap_thermal_cpu1 {
-	trips {
-		cpu_active: cpu-active {
-			temperature = <44000>;
-			hysteresis = <2000>;
-			type = "active";
-		};
-	};
-	cooling-maps {
-		fan-map {
-			trip = <&cpu_active>;
-			cooling-device = <&chassis_fan_group0 64 THERMAL_NO_LIMIT>;
-		};
-	};
+&ap_thermal_ic {
+	PUZZLE_FAN_THERMAL(ic, &chassis_fan_group0);
+};
+
+&cp0_thermal_ic {
+	PUZZLE_FAN_THERMAL(cp0, &chassis_fan_group0);
 };
 
 /* on-board eMMC - U9 */
@@ -396,6 +389,10 @@
 	};
 };
 
+&cp1_thermal_ic {
+	PUZZLE_FAN_THERMAL(cp1, &chassis_fan_group0);
+};
+
 &cp1_usb3_1 {
 	status = "okay";
 	phys = <&cp1_comphy3 1>;
diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/cn9132-puzzle-m902.dts b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/cn9132-puzzle-m902.dts
index fd99eb2d13..398e53a5f9 100644
--- a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/cn9132-puzzle-m902.dts
+++ b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/cn9132-puzzle-m902.dts
@@ -6,6 +6,7 @@
  */
 
 #include "cn9130.dtsi"
+#include "puzzle-thermal.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
@@ -154,28 +155,21 @@
 			chassis_fan_group0: fan-group at 0 {
 				#cooling-cells = <2>;
 				reg = <0x00>;
-				cooling-levels = <64 102 170 230 250>;
+				cooling-levels = <80 102 170 230 255>;
 			};
 		};
 	};
 };
 
-&ap_thermal_cpu1 {
-	trips {
-		cpu_active: cpu-active {
-			temperature = <44000>;
-			hysteresis = <2000>;
-			type = "active";
-		};
-	};
-	cooling-maps {
-		fan-map {
-			trip = <&cpu_active>;
-			cooling-device = <&chassis_fan_group0 64 THERMAL_NO_LIMIT>;
-		};
-	};
+&ap_thermal_ic {
+	PUZZLE_FAN_THERMAL(ic, &chassis_fan_group0);
+};
+
+&cp0_thermal_ic {
+	PUZZLE_FAN_THERMAL(cp0, &chassis_fan_group0);
 };
 
+
 /* on-board eMMC - U9 */
 &ap_sdhci0 {
 	pinctrl-names = "default";
@@ -447,6 +441,10 @@
 	};
 };
 
+&cp1_thermal_ic {
+	PUZZLE_FAN_THERMAL(cp1, &chassis_fan_group0);
+};
+
 /*
  * Instantiate the second connected CP115
  */
@@ -562,3 +560,7 @@
 		};
 	};
 };
+
+&cp2_thermal_ic {
+	PUZZLE_FAN_THERMAL(cp2, &chassis_fan_group0);
+};
diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/puzzle-thermal.dtsi b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/puzzle-thermal.dtsi
new file mode 100644
index 0000000000..94677532f2
--- /dev/null
+++ b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/puzzle-thermal.dtsi
@@ -0,0 +1,41 @@
+#define PUZZLE_FAN_THERMAL(_cname, _fan)					\
+	trips {									\
+		_cname##_active_high: cpu-active-high {				\
+			temperature = <80000>;					\
+			hysteresis = <2000>;					\
+			type = "active";					\
+		};								\
+		_cname##_active_med: cpu-active-med {				\
+			temperature = <72000>;					\
+			hysteresis = <2000>;					\
+			type = "active";					\
+		};								\
+		_cname##_active_low: cpu-active-low {				\
+			temperature = <65000>;					\
+			hysteresis = <2000>;					\
+			type = "active";					\
+		};								\
+		_cname##_active_idle: cpu-active-idle {				\
+			temperature = <60000>;					\
+			hysteresis = <2000>;					\
+			type = "active";					\
+		};								\
+	};									\
+	cooling-maps {								\
+		cpu-active-high {						\
+			trip = <&_cname##_active_high>;				\
+			cooling-device = <_fan 3 THERMAL_NO_LIMIT>;		\
+		};								\
+		cpu-active-med {						\
+			trip = <&_cname##_active_med>;				\
+			cooling-device = <_fan 2 THERMAL_NO_LIMIT>;		\
+		};								\
+		cpu-active-low {						\
+			trip = <&_cname##_active_low>;				\
+			cooling-device = <_fan 1 THERMAL_NO_LIMIT>;		\
+		};								\
+		cpu-active-idle {						\
+			trip = <&_cname##_active_idle>;				\
+			cooling-device = <_fan 0 THERMAL_NO_LIMIT>;		\
+		};								\
+	}



From lede-commits at lists.infradead.org  Sat Feb 25 11:23:01 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 25 Feb 2023 14:23:01 -0500
Subject: [openwrt/openwrt]  ramips: correct the PCIe port number for some
 mt7621 devices
In-Reply-To: <167735298118.4102326.3395755581384270569@git-01.infra.openwrt.org>
References: <167735298118.4102326.3395755581384270569@git-01.infra.openwrt.org>
Message-ID: <mailman.19110.1677353008.3064139.lede-commits@lists.infradead.org>

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

commit 688697889c9ceb9d2d8d413d1abcc5fa7edb402b
Author: Felix Baumann <felix.bau at gmx.de>
AuthorDate: Mon Feb 20 03:40:20 2023 +0100

    ramips: correct the PCIe port number for some mt7621 devices
    
    MT7621 uses a new PCIe driver in the 5.15+ kernel. Allocating wrong PCIe
    port will cause the PCIe NIC to not work properly. This commit fixes
    the wrong port numbers on Netgear R6220, WAC104 and WNDR3700 v5.
    
    According to bootlog, MT7612E (5GHz) is connected to pcie0, and
    MT7603E (2GHz) is connected to pcie2:
    [2.758986] mt7621-pci 1e140000.pcie: pcie1 no card, disable it (RST & CLK)
    [2.772862] mt7621-pci 1e140000.pcie: PCIE0 enabled
    [2.782579] mt7621-pci 1e140000.pcie: PCIE2 enabled
    ...
    [3.009151] pci 0000:01:00.0: [14c3:7662] type 00 class 0x028000
    [3.125715] pci 0000:02:00.0: [14c3:7603] type 00 class 0x028000
    
    Tested-by: Maximilian Baumgartner <aufhaxer at googlemail.com>
    Signed-off-by: Shiji Yang <yangshiji66 at qq.com>
    [felix.bau at gmx.de: adjust commit message for Netgear devices]
    Signed-off-by: Felix Baumann <felix.bau at gmx.de>
---
 target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi | 2 +-
 target/linux/ramips/dts/mt7621_netgear_wac104.dts       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi b/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi
index 0ae6ab46f7..691aba1063 100644
--- a/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi
+++ b/target/linux/ramips/dts/mt7621_netgear_sercomm_ayx.dtsi
@@ -96,7 +96,7 @@
 	};
 };
 
-&pcie1 {
+&pcie2 {
 	wifi at 0,0 {
 		compatible = "mediatek,mt76";
 		reg = <0x0 0 0 0 0>;
diff --git a/target/linux/ramips/dts/mt7621_netgear_wac104.dts b/target/linux/ramips/dts/mt7621_netgear_wac104.dts
index 3b5d6ae2d9..97aa4a90d1 100644
--- a/target/linux/ramips/dts/mt7621_netgear_wac104.dts
+++ b/target/linux/ramips/dts/mt7621_netgear_wac104.dts
@@ -122,7 +122,7 @@
 	};
 };
 
-&pcie1 {
+&pcie2 {
 	wifi at 0,0 {
 		compatible = "mediatek,mt76";
 		reg = <0x0 0 0 0 0>;



From lede-commits at lists.infradead.org  Sat Feb 25 11:34:55 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 25 Feb 2023 14:34:55 -0500
Subject: [openwrt/openwrt]  ipq40xx: Linksys MR8300: fix the USB port power
In-Reply-To: <167735369568.4111008.6629555453575307449@git-01.infra.openwrt.org>
References: <167735369568.4111008.6629555453575307449@git-01.infra.openwrt.org>
Message-ID: <mailman.19111.1677353700.3064139.lede-commits@lists.infradead.org>

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

commit ed64c3323590e3c9fa8b423bf37689023a7a101f
Author: Daniel Gonz?lez Cabanelas <dgcbueu at gmail.com>
AuthorDate: Thu Feb 16 23:04:20 2023 +0100

    ipq40xx: Linksys MR8300: fix the USB port power
    
    The USB port on the MR8300 randomly fails to feed bus-powered devices.
    
    This is caused by a misconfigured pinmux. The GPIO68 should be used to
    enable the USB power (active low), but it's inside the NAND pinmux.
    
    This GPIO pin was found in the original firmware at a startup script in
    both MR8300 and EA8300. Therefore apply the fix for both boards.
    
    Signed-off-by: Daniel Gonz?lez Cabanelas <dgcbueu at gmail.com>
    Reviewed-by: Robert Marko <robimarko at gmail.com>
---
 .../ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi
index db9ca1e725..141ea60442 100644
--- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi
+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-xx8300.dtsi
@@ -100,6 +100,16 @@
 			status = "okay";
 		};
 	};
+
+	regulator-usb-vbus {
+		compatible = "regulator-fixed";
+		regulator-name = "USB_VBUS";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+		regulator-boot-on;
+		gpio = <&tlmm 68 GPIO_ACTIVE_LOW>;
+	};
 };
 
 
@@ -268,7 +278,7 @@
 			pins =  "gpio55", "gpio56", "gpio57",
 				"gpio60", "gpio62", "gpio63",
 				"gpio64", "gpio65", "gpio66",
-				"gpio67", "gpio68", "gpio69";
+				"gpio67", "gpio69";
 			function = "qpic";
 			bias-pull-down;
 		};



From lede-commits at lists.infradead.org  Sat Feb 25 12:49:53 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 25 Feb 2023 15:49:53 -0500
Subject: [openwrt/openwrt]  dnsmasq: bump to v2.89
In-Reply-To: <167735819324.4190862.11114677754506320225@git-01.infra.openwrt.org>
References: <167735819324.4190862.11114677754506320225@git-01.infra.openwrt.org>
Message-ID: <mailman.19115.1677358225.3064139.lede-commits@lists.infradead.org>

ldir pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/c9df2d5c640a056a7b2443f5155b275d74117cbe

commit c9df2d5c640a056a7b2443f5155b275d74117cbe
Author: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
AuthorDate: Wed Jan 18 09:39:18 2023 +0000

    dnsmasq: bump to v2.89
    
    Signed-off-by: Kevin Darbyshire-Bryant <ldir at darbyshire-bryant.me.uk>
---
 package/network/services/dnsmasq/Makefile                             | 4 ++--
 .../dnsmasq/patches/100-remove-old-runtime-kernel-support.patch       | 4 ++--
 package/network/services/dnsmasq/patches/200-ubus_dns.patch           | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index 65ef9da3a9..f555712a7f 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.88
+PKG_UPSTREAM_VERSION:=2.89
 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:=https://thekelleys.org.uk/dnsmasq/
-PKG_HASH:=23544deda10340c053bea6f15a93fed6ea7f5aaa85316bfc671ffa6d22fbc1b3
+PKG_HASH:=02bd230346cf0b9d5909f5e151df168b2707103785eb616b56685855adebb609
 
 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 76065375bd..59b8d02c0e 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
-@@ -1247,7 +1247,7 @@ extern struct daemon {
+@@ -1248,7 +1248,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
-@@ -1452,9 +1452,6 @@ int read_write(int fd, unsigned char *pa
+@@ -1453,9 +1453,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);
diff --git a/package/network/services/dnsmasq/patches/200-ubus_dns.patch b/package/network/services/dnsmasq/patches/200-ubus_dns.patch
index f88763f94a..8a70bb8bdf 100644
--- a/package/network/services/dnsmasq/patches/200-ubus_dns.patch
+++ b/package/network/services/dnsmasq/patches/200-ubus_dns.patch
@@ -1,6 +1,6 @@
 --- a/src/dnsmasq.h
 +++ b/src/dnsmasq.h
-@@ -1630,14 +1630,26 @@ void emit_dbus_signal(int action, struct
+@@ -1631,14 +1631,26 @@ void emit_dbus_signal(int action, struct
  
  /* ubus.c */
  #ifdef HAVE_UBUS



From lede-commits at lists.infradead.org  Sat Feb 25 16:12:13 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sat, 25 Feb 2023 19:12:13 -0500
Subject: [openwrt/openwrt]  ncurses: add alacritty terminfo
In-Reply-To: <167737033374.127379.17048074948766546355@git-01.infra.openwrt.org>
References: <167737033374.127379.17048074948766546355@git-01.infra.openwrt.org>
Message-ID: <mailman.19118.1677370342.3064139.lede-commits@lists.infradead.org>

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

commit 888b207f1a6cde4c954e1b3b34f8c2ba60b14cd1
Author: Tobias Hilbig <web.tobias at hilbig-ffb.de>
AuthorDate: Sat Feb 25 11:40:37 2023 +0100

    ncurses: add alacritty terminfo
    
    Add terminfo file for the terminal emulator alacritty.
    
    https://github.com/alacritty/alacritty
    
    Signed-off-by: Tobias Hilbig <web.tobias at hilbig-ffb.de>
---
 package/libs/ncurses/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/libs/ncurses/Makefile b/package/libs/ncurses/Makefile
index 29261a4cd0..4d8e685f35 100644
--- a/package/libs/ncurses/Makefile
+++ b/package/libs/ncurses/Makefile
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=ncurses
 PKG_CPE_ID:=cpe:/a:gnu:ncurses
 PKG_VERSION:=6.4
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/$(PKG_NAME)
@@ -123,6 +123,7 @@ ifneq ($(HOST_OS),FreeBSD)
 	)
 	for file in \
 		a/ansi \
+		a/alacritty \
 		d/dumb \
 		l/linux \
 		r/rxvt \



From lede-commits at lists.infradead.org  Sat Feb 25 23:13:59 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 26 Feb 2023 02:13:59 -0500
Subject: [openwrt/openwrt]  mac80211: fix mesh fast xmit header cache flush
In-Reply-To: <167739563973.397265.7225657314789661820@git-01.infra.openwrt.org>
References: <167739563973.397265.7225657314789661820@git-01.infra.openwrt.org>
Message-ID: <mailman.19132.1677395647.3064139.lede-commits@lists.infradead.org>

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

commit 1d82a47b497e11e2474703ab8e3ef6994d33809d
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Feb 23 15:06:14 2023 +0100

    mac80211: fix mesh fast xmit header cache flush
    
    split into multiple functions depending on sta, mpath or mpp
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../319-wifi-mac80211-mesh-fast-xmit-support.patch | 230 ++++++++++++++-------
 1 file changed, 159 insertions(+), 71 deletions(-)

diff --git a/package/kernel/mac80211/patches/subsys/319-wifi-mac80211-mesh-fast-xmit-support.patch b/package/kernel/mac80211/patches/subsys/319-wifi-mac80211-mesh-fast-xmit-support.patch
index 4bd3d4c092..f18e1bb377 100644
--- a/package/kernel/mac80211/patches/subsys/319-wifi-mac80211-mesh-fast-xmit-support.patch
+++ b/package/kernel/mac80211/patches/subsys/319-wifi-mac80211-mesh-fast-xmit-support.patch
@@ -132,7 +132,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +	u16 hdrlen;
 +	u8 pn_offs;
 +	u8 band;
-+	struct ieee80211_key __rcu *key;
++	struct ieee80211_key *key;
 +	struct hlist_node walk_list;
 +	struct rhash_head rhash;
 +	struct mesh_path *mpath, *mppath;
@@ -143,7 +143,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  /* Recent multicast cache */
  /* RMC_BUCKETS must be a power of 2, maximum 256 */
  #define RMC_BUCKETS		256
-@@ -298,6 +336,15 @@ void mesh_path_discard_frame(struct ieee
+@@ -298,6 +336,18 @@ void mesh_path_discard_frame(struct ieee
  void mesh_path_tx_root_frame(struct ieee80211_sub_if_data *sdata);
  
  bool mesh_action_is_path_sel(struct ieee80211_mgmt *mgmt);
@@ -152,8 +152,11 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +void mesh_cache_hdr(struct ieee80211_sub_if_data *sdata,
 +		    struct sk_buff *skb, struct mesh_path *mpath);
 +void mesh_hdr_cache_gc(struct ieee80211_sub_if_data *sdata);
-+void mesh_hdr_cache_flush(struct ieee80211_sub_if_data *sdata, const u8 *addr,
-+			  bool is_mpp);
++void mesh_hdr_cache_flush_mpp(struct ieee80211_sub_if_data *sdata,
++			      const u8 *addr);
++void mesh_hdr_cache_flush_mpath(struct mesh_path *mpath);
++void mesh_hdr_cache_flush_sta(struct ieee80211_sub_if_data *sdata,
++			      struct sta_info *sta);
 +void mesh_refresh_path(struct ieee80211_sub_if_data *sdata,
 +		       struct mesh_path *mpath, const u8 *addr);
  
@@ -161,33 +164,57 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static inline
 --- a/net/mac80211/mesh_hwmp.c
 +++ b/net/mac80211/mesh_hwmp.c
-@@ -491,8 +491,11 @@ static u32 hwmp_route_info_get(struct ie
+@@ -394,6 +394,7 @@ static u32 hwmp_route_info_get(struct ie
+ 	u32 orig_sn, orig_metric;
+ 	unsigned long orig_lifetime, exp_time;
+ 	u32 last_hop_metric, new_metric;
++	bool flush_mpath = false;
+ 	bool process = true;
+ 	u8 hopcount;
+ 
+@@ -491,8 +492,10 @@ static u32 hwmp_route_info_get(struct ie
  		}
  
  		if (fresh_info) {
 -			if (rcu_access_pointer(mpath->next_hop) != sta)
 +			if (rcu_access_pointer(mpath->next_hop) != sta) {
  				mpath->path_change_count++;
-+				mesh_hdr_cache_flush(mpath->sdata, mpath->dst,
-+						     false);
++				flush_mpath = true;
 +			}
  			mesh_path_assign_nexthop(mpath, sta);
  			mpath->flags |= MESH_PATH_SN_VALID;
  			mpath->metric = new_metric;
-@@ -539,8 +542,11 @@ static u32 hwmp_route_info_get(struct ie
+@@ -502,6 +505,8 @@ static u32 hwmp_route_info_get(struct ie
+ 			mpath->hop_count = hopcount;
+ 			mesh_path_activate(mpath);
+ 			spin_unlock_bh(&mpath->state_lock);
++			if (flush_mpath)
++				mesh_hdr_cache_flush_mpath(mpath);
+ 			ewma_mesh_fail_avg_init(&sta->mesh->fail_avg);
+ 			/* init it at a low value - 0 start is tricky */
+ 			ewma_mesh_fail_avg_add(&sta->mesh->fail_avg, 1);
+@@ -539,8 +544,10 @@ static u32 hwmp_route_info_get(struct ie
  		}
  
  		if (fresh_info) {
 -			if (rcu_access_pointer(mpath->next_hop) != sta)
 +			if (rcu_access_pointer(mpath->next_hop) != sta) {
  				mpath->path_change_count++;
-+				mesh_hdr_cache_flush(mpath->sdata, mpath->dst,
-+						     false);
++				flush_mpath = true;
 +			}
  			mesh_path_assign_nexthop(mpath, sta);
  			mpath->metric = last_hop_metric;
  			mpath->exp_time = time_after(mpath->exp_time, exp_time)
-@@ -977,7 +983,7 @@ free:
+@@ -548,6 +555,8 @@ static u32 hwmp_route_info_get(struct ie
+ 			mpath->hop_count = 1;
+ 			mesh_path_activate(mpath);
+ 			spin_unlock_bh(&mpath->state_lock);
++			if (flush_mpath)
++				mesh_hdr_cache_flush_mpath(mpath);
+ 			ewma_mesh_fail_avg_init(&sta->mesh->fail_avg);
+ 			/* init it at a low value - 0 start is tricky */
+ 			ewma_mesh_fail_avg_add(&sta->mesh->fail_avg, 1);
+@@ -977,7 +986,7 @@ free:
   * Locking: the function must be called from within a rcu read lock block.
   *
   */
@@ -196,7 +223,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  {
  	struct ieee80211_sub_if_data *sdata = mpath->sdata;
  	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
-@@ -1215,6 +1221,20 @@ static int mesh_nexthop_lookup_nolearn(s
+@@ -1215,6 +1224,20 @@ static int mesh_nexthop_lookup_nolearn(s
  	return 0;
  }
  
@@ -217,7 +244,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  /**
   * mesh_nexthop_lookup - put the appropriate next hop on a mesh frame. Calling
   * this function is considered "using" the associated mpath, so preempt a path
-@@ -1242,19 +1262,18 @@ int mesh_nexthop_lookup(struct ieee80211
+@@ -1242,19 +1265,18 @@ int mesh_nexthop_lookup(struct ieee80211
  	if (!mpath || !(mpath->flags & MESH_PATH_ACTIVE))
  		return -ENOENT;
  
@@ -295,14 +322,21 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static inline bool mpath_expired(struct mesh_path *mpath)
  {
  	return (mpath->flags & MESH_PATH_ACTIVE) &&
-@@ -381,6 +417,211 @@ struct mesh_path *mesh_path_new(struct i
+@@ -381,6 +417,254 @@ struct mesh_path *mesh_path_new(struct i
  	return new_mpath;
  }
  
++static void mesh_hdr_cache_entry_free(struct mesh_hdr_cache *cache,
++				      struct mhdr_cache_entry *entry)
++{
++	hlist_del_rcu(&entry->walk_list);
++	rhashtable_remove_fast(&cache->rhead, &entry->rhash, mesh_hdr_rht_params);
++	kfree_rcu(entry, rcu);
++}
++
 +struct mhdr_cache_entry *
 +mesh_get_cached_hdr(struct ieee80211_sub_if_data *sdata, const u8 *addr)
 +{
-+	struct mesh_path *mpath, *mppath;
 +	struct mhdr_cache_entry *entry;
 +	struct mesh_hdr_cache *cache;
 +
@@ -311,14 +345,19 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +	if (!entry)
 +		return NULL;
 +
-+	mpath = rcu_dereference(entry->mpath);
-+	mppath = rcu_dereference(entry->mppath);
-+	if (!(mpath->flags & MESH_PATH_ACTIVE) || mpath_expired(mpath))
++	if (!(entry->mpath->flags & MESH_PATH_ACTIVE) ||
++	    mpath_expired(entry->mpath)) {
++		spin_lock_bh(&cache->walk_lock);
++		entry = rhashtable_lookup(&cache->rhead, addr, mesh_hdr_rht_params);
++		if (entry)
++		    mesh_hdr_cache_entry_free(cache, entry);
++		spin_unlock_bh(&cache->walk_lock);
 +		return NULL;
++	}
 +
-+	mesh_refresh_path(sdata, mpath, NULL);
-+	if (mppath)
-+		mppath->exp_time = jiffies;
++	mesh_refresh_path(sdata, entry->mpath, NULL);
++	if (entry->mppath)
++		entry->mppath->exp_time = jiffies;
 +	entry->timestamp = jiffies;
 +
 +	return entry;
@@ -332,7 +371,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +	struct mesh_hdr_cache *cache;
 +	struct mhdr_cache_entry *mhdr, *old_mhdr;
 +	struct ieee80211s_hdr *meshhdr;
-+	struct sta_info *next_hop;
++	struct sta_info *sta;
 +	struct ieee80211_key *key;
 +	struct mesh_path *mppath;
 +	u16 meshhdr_len;
@@ -353,8 +392,8 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +	if (atomic_read(&cache->rhead.nelems) >= MESH_HEADER_CACHE_MAX_SIZE)
 +		return;
 +
-+	next_hop = rcu_dereference(mpath->next_hop);
-+	if (!next_hop)
++	sta = rcu_dereference(mpath->next_hop);
++	if (!sta)
 +		return;
 +
 +	if ((meshhdr->flags & MESH_FLAGS_AE) == MESH_FLAGS_AE_A5_A6) {
@@ -374,7 +413,12 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +
 +	mppath->fast_xmit_check = jiffies;
 +
-+	key = rcu_access_pointer(next_hop->ptk[next_hop->ptk_idx]);
++	/*
++	 * Same use of the sta lock as in ieee80211_check_fast_xmit, in order
++	 * to protect against concurrent sta key updates.
++	 */
++	spin_lock_bh(&sta->lock);
++	key = rcu_access_pointer(sta->ptk[sta->ptk_idx]);
 +	if (!key)
 +		key = rcu_access_pointer(sdata->default_unicast_key);
 +
@@ -386,7 +430,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +
 +		if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) ||
 +		    (key->flags & KEY_FLAG_TAINTED))
-+			return;
++			goto unlock_sta;
 +
 +		switch (key->conf.cipher) {
 +		case WLAN_CIPHER_SUITE_CCMP:
@@ -404,25 +448,25 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +				hdrlen += IEEE80211_GCMP_HDR_LEN;
 +			break;
 +		default:
-+			return;
++			goto unlock_sta;
 +		}
 +	}
 +
 +	if (WARN_ON_ONCE(hdrlen + meshhdr_len + sizeof(rfc1042_header) >
 +			 MESH_HEADER_MAX_LEN))
-+		return;
++		goto unlock_sta;
 +
 +	mhdr = kzalloc(sizeof(*mhdr), GFP_ATOMIC);
 +	if (!mhdr)
-+		return;
++		goto unlock_sta;
 +
 +	memcpy(mhdr->addr_key, mppath->dst, ETH_ALEN);
 +	mhdr->machdr_len = hdrlen;
 +	mhdr->hdrlen = mhdr->machdr_len + meshhdr_len + sizeof(rfc1042_header);
-+	rcu_assign_pointer(mhdr->mpath, mpath);
++	mhdr->mpath = mpath;
 +	if (meshhdr->flags & MESH_FLAGS_AE)
-+		rcu_assign_pointer(mhdr->mppath, mppath);
-+	rcu_assign_pointer(mhdr->key, key);
++		mhdr->mppath = mppath;
++	mhdr->key = key;
 +	mhdr->timestamp = jiffies;
 +	mhdr->band = info->band;
 +	mhdr->pn_offs = pn_offs;
@@ -444,19 +488,28 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +	old_mhdr = rhashtable_lookup_get_insert_fast(&cache->rhead,
 +						     &mhdr->rhash,
 +						     mesh_hdr_rht_params);
-+	if (likely(!old_mhdr))
-+		hlist_add_head(&mhdr->walk_list, &cache->walk_head);
-+	else
++	if (unlikely(IS_ERR(old_mhdr))) {
 +		kfree(mhdr);
-+	spin_unlock_bh(&cache->walk_lock);
-+}
++		goto unlock_cache;
++	}
 +
-+static void mesh_hdr_cache_entry_free(struct mesh_hdr_cache *cache,
-+				      struct mhdr_cache_entry *entry)
-+{
-+	hlist_del_rcu(&entry->walk_list);
-+	rhashtable_remove_fast(&cache->rhead, &entry->rhash, mesh_hdr_rht_params);
-+	kfree_rcu(entry, rcu);
++	/*
++	 * replace any previous entry in the hash table, in case we're
++	 * replacing it with a different type (e.g. mpath -> mpp)
++	 */
++	if (unlikely(old_mhdr)) {
++		rhashtable_replace_fast(&cache->rhead, &old_mhdr->rhash,
++					&mhdr->rhash, mesh_hdr_rht_params);
++		hlist_del_rcu(&old_mhdr->walk_list);
++		kfree_rcu(old_mhdr, rcu);
++	}
++
++	hlist_add_head(&mhdr->walk_list, &cache->walk_head);
++
++unlock_cache:
++	spin_unlock_bh(&cache->walk_lock);
++unlock_sta:
++	spin_unlock_bh(&sta->lock);
 +}
 +
 +void mesh_hdr_cache_gc(struct ieee80211_sub_if_data *sdata)
@@ -477,54 +530,82 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +	spin_unlock_bh(&cache->walk_lock);
 +}
 +
-+void mesh_hdr_cache_flush(struct ieee80211_sub_if_data *sdata, const u8 *addr,
-+			  bool is_mpp)
++void mesh_hdr_cache_flush_mpath(struct mesh_path *mpath)
 +{
++	struct ieee80211_sub_if_data *sdata = mpath->sdata;
 +	struct mesh_hdr_cache *cache = &sdata->u.mesh.hdr_cache;
 +	struct mhdr_cache_entry *entry;
 +	struct hlist_node *n;
 +
 +	cache = &sdata->u.mesh.hdr_cache;
 +	spin_lock_bh(&cache->walk_lock);
-+
-+	/* Only one header per mpp address is expected in the header cache */
-+	if (is_mpp) {
-+		entry = rhashtable_lookup(&cache->rhead, addr,
-+					  mesh_hdr_rht_params);
-+		if (entry)
++	hlist_for_each_entry_safe(entry, n, &cache->walk_head, walk_list)
++		if (entry->mpath == mpath)
 +			mesh_hdr_cache_entry_free(cache, entry);
-+		goto out;
-+	}
++	spin_unlock_bh(&cache->walk_lock);
++}
 +
++void mesh_hdr_cache_flush_sta(struct ieee80211_sub_if_data *sdata,
++			      struct sta_info *sta)
++{
++	struct mesh_hdr_cache *cache = &sdata->u.mesh.hdr_cache;
++	struct mhdr_cache_entry *entry;
++	struct hlist_node *n;
++
++	cache = &sdata->u.mesh.hdr_cache;
++	spin_lock_bh(&cache->walk_lock);
 +	hlist_for_each_entry_safe(entry, n, &cache->walk_head, walk_list)
-+		if (ether_addr_equal(entry->mpath->dst, addr))
++		if (rcu_access_pointer(entry->mpath->next_hop) == sta)
 +			mesh_hdr_cache_entry_free(cache, entry);
++	spin_unlock_bh(&cache->walk_lock);
++}
++
++void mesh_hdr_cache_flush_mpp(struct ieee80211_sub_if_data *sdata,
++			      const u8 *addr)
++{
++	struct mesh_hdr_cache *cache = &sdata->u.mesh.hdr_cache;
++	struct mhdr_cache_entry *entry;
 +
-+out:
++	cache = &sdata->u.mesh.hdr_cache;
++	spin_lock_bh(&cache->walk_lock);
++	entry = rhashtable_lookup(&cache->rhead, addr, mesh_hdr_rht_params);
++	if (entry)
++		mesh_hdr_cache_entry_free(cache, entry);
 +	spin_unlock_bh(&cache->walk_lock);
 +}
 +
  /**
   * mesh_path_add - allocate and add a new path to the mesh path table
   * @dst: destination address of the path (ETH_ALEN length)
-@@ -521,6 +762,8 @@ static void mesh_path_free_rcu(struct me
+@@ -464,6 +748,8 @@ int mpp_path_add(struct ieee80211_sub_if
  
- static void __mesh_path_del(struct mesh_table *tbl, struct mesh_path *mpath)
+ 	if (ret)
+ 		kfree(new_mpath);
++	else
++		mesh_hdr_cache_flush_mpp(sdata, dst);
+ 
+ 	sdata->u.mesh.mpp_paths_generation++;
+ 	return ret;
+@@ -523,6 +809,10 @@ static void __mesh_path_del(struct mesh_
  {
-+	mesh_hdr_cache_flush(mpath->sdata, mpath->dst,
-+			     tbl == &mpath->sdata->u.mesh.mpp_paths);
  	hlist_del_rcu(&mpath->walk_list);
  	rhashtable_remove_fast(&tbl->rhead, &mpath->rhash, mesh_rht_params);
++	if (tbl == &mpath->sdata->u.mesh.mpp_paths)
++		mesh_hdr_cache_flush_mpp(mpath->sdata, mpath->dst);
++	else
++		mesh_hdr_cache_flush_mpath(mpath);
  	mesh_path_free_rcu(tbl, mpath);
-@@ -747,6 +990,7 @@ void mesh_path_fix_nexthop(struct mesh_p
+ }
+ 
+@@ -747,6 +1037,7 @@ void mesh_path_fix_nexthop(struct mesh_p
  	mpath->exp_time = 0;
  	mpath->flags = MESH_PATH_FIXED | MESH_PATH_SN_VALID;
  	mesh_path_activate(mpath);
-+	mesh_hdr_cache_flush(mpath->sdata, mpath->dst, false);
++	mesh_hdr_cache_flush_mpath(mpath);
  	spin_unlock_bh(&mpath->state_lock);
  	ewma_mesh_fail_avg_init(&next_hop->mesh->fail_avg);
  	/* init it at a low value - 0 start is tricky */
-@@ -758,6 +1002,7 @@ void mesh_pathtbl_init(struct ieee80211_
+@@ -758,6 +1049,7 @@ void mesh_pathtbl_init(struct ieee80211_
  {
  	mesh_table_init(&sdata->u.mesh.mesh_paths);
  	mesh_table_init(&sdata->u.mesh.mpp_paths);
@@ -532,7 +613,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  }
  
  static
-@@ -785,6 +1030,7 @@ void mesh_path_expire(struct ieee80211_s
+@@ -785,6 +1077,7 @@ void mesh_path_expire(struct ieee80211_s
  
  void mesh_pathtbl_unregister(struct ieee80211_sub_if_data *sdata)
  {
@@ -565,7 +646,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +
 +		/* flush fast xmit cache if the address path changed */
 +		if (update)
-+			mesh_hdr_cache_flush(sdata, proxied_addr, true);
++			mesh_hdr_cache_flush_mpp(sdata, proxied_addr);
 +
  		rcu_read_unlock();
  	}
@@ -577,12 +658,12 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		return;
  
 +	if (ieee80211_vif_is_mesh(&sdata->vif))
-+		mesh_hdr_cache_flush(sdata, sta->addr, false);
++		mesh_hdr_cache_flush_sta(sdata, sta);
 +
  	/* Locking here protects both the pointer itself, and against concurrent
  	 * invocations winning data access races to, e.g., the key pointer that
  	 * is used.
-@@ -3723,6 +3726,155 @@ free:
+@@ -3723,6 +3726,162 @@ free:
  	kfree_skb(skb);
  }
  
@@ -593,6 +674,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +	struct ieee80211_local *local = sdata->local;
 +	struct ieee80211_tx_data tx = {};
 +	struct ieee80211_tx_info *info;
++	struct tid_ampdu_tx *tid_tx;
 +	struct ieee80211_key *key;
 +	struct ieee80211_hdr *hdr;
 +	struct mesh_path *mpath;
@@ -633,6 +715,12 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +	hdr = (struct ieee80211_hdr *)skb->data;
 +	tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
 +	*ieee80211_get_qos_ctl(hdr) = tid;
++	tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]);
++	if (tid_tx) {
++		if (tid_tx->timeout)
++			tid_tx->last_tx = jiffies;
++		info->flags |= IEEE80211_TX_CTL_AMPDU;
++	}
 +
 +	ieee80211_aggr_check(sdata, sta, skb);
 +
@@ -662,13 +750,13 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +	bool copy_sa = false;
 +	u16 ethertype;
 +
-+	if (ctrl_flags & IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP)
++	if (!ieee80211_hw_check(&local->hw, SUPPORT_FAST_XMIT))
 +		return false;
 +
-+	if (ifmsh->mshcfg.dot11MeshNolearn)
++	if (ctrl_flags & IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP)
 +		return false;
 +
-+	if (!ieee80211_hw_check(&local->hw, SUPPORT_FAST_XMIT))
++	if (ifmsh->mshcfg.dot11MeshNolearn)
 +		return false;
 +
 +	/* Add support for these cases later */
@@ -738,7 +826,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
  				struct sta_info *sta,
  				struct ieee80211_fast_tx *fast_tx,
-@@ -4244,8 +4396,14 @@ void __ieee80211_subif_start_xmit(struct
+@@ -4244,8 +4403,14 @@ void __ieee80211_subif_start_xmit(struct
  		return;
  	}
  
@@ -753,7 +841,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (ieee80211_lookup_ra_sta(sdata, skb, &sta))
  		goto out_free;
  
-@@ -4255,8 +4413,6 @@ void __ieee80211_subif_start_xmit(struct
+@@ -4255,8 +4420,6 @@ void __ieee80211_subif_start_xmit(struct
  	skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, sta, skb));
  	ieee80211_aggr_check(sdata, sta, skb);
  



From lede-commits at lists.infradead.org  Sun Feb 26 08:47:24 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 26 Feb 2023 11:47:24 -0500
Subject: [openwrt/openwrt]  ramips: Alternative name Asus RT-AC750L for Asus
 RT-AC1200V2
In-Reply-To: <167743004463.799891.5129292511260281921@git-01.infra.openwrt.org>
References: <167743004463.799891.5129292511260281921@git-01.infra.openwrt.org>
Message-ID: <mailman.19168.1677430052.3064139.lede-commits@lists.infradead.org>

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

commit 5c04c3943e748fb497c12fdf9809f0da437a2ae4
Author: Karl Chan <exkc at exkc.moe>
AuthorDate: Thu Feb 16 18:47:21 2023 +0800

    ramips: Alternative name Asus RT-AC750L for Asus RT-AC1200V2
    
    The Asus RT-AC750L is identical to the already supported Asus RT-AC1200V2. Use the ALT0 buildroot tags to show both devices.
    
    Reference : https://forum.openwrt.org/t/asus-rt-ac750l-is-the-same-as-rt-ac1200-v2/151783
    
    Signed-off-by: Karl Chan <exkc at exkc.moe>
---
 target/linux/ramips/image/mt76x8.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/linux/ramips/image/mt76x8.mk b/target/linux/ramips/image/mt76x8.mk
index 156aa634be..296b80d03f 100644
--- a/target/linux/ramips/image/mt76x8.mk
+++ b/target/linux/ramips/image/mt76x8.mk
@@ -55,6 +55,8 @@ define Device/asus_rt-ac1200-v2
   DEVICE_VENDOR := ASUS
   DEVICE_MODEL := RT-AC1200
   DEVICE_VARIANT := V2
+  DEVICE_ALT0_VENDOR := ASUS
+  DEVICE_ALT0_MODEL := RT-AC750L
   IMAGES += factory.bin
   IMAGE/factory.bin := append-kernel | pad-to $$$$(BLOCKSIZE) | \
 	append-rootfs | pad-rootfs



From lede-commits at lists.infradead.org  Sun Feb 26 09:17:58 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 26 Feb 2023 12:17:58 -0500
Subject: [openwrt/openwrt]  octeontx: switch to Kernel 5.15
In-Reply-To: <167743187821.820327.12889315127404898459@git-01.infra.openwrt.org>
References: <167743187821.820327.12889315127404898459@git-01.infra.openwrt.org>
Message-ID: <mailman.19171.1677431889.3064139.lede-commits@lists.infradead.org>

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

commit 107f7374c9ef3e3ea6d589b187671cd3e138e63c
Author: Tim Harvey <tharvey at gateworks.com>
AuthorDate: Tue Feb 21 12:35:05 2023 -0800

    octeontx: switch to Kernel 5.15
    
    Switch over from testing version.
    
    Signed-off-by: Tim Harvey <tharvey at gateworks.com>
---
 target/linux/octeontx/Makefile                     |   3 +-
 target/linux/octeontx/config-5.10                  | 413 ---------------------
 ...rk-for-Gateworks-PLX-PEX860x-switch-with-.patch |  59 ---
 3 files changed, 1 insertion(+), 474 deletions(-)

diff --git a/target/linux/octeontx/Makefile b/target/linux/octeontx/Makefile
index 50c5cd6d21..5260291d05 100644
--- a/target/linux/octeontx/Makefile
+++ b/target/linux/octeontx/Makefile
@@ -10,8 +10,7 @@ BOARDNAME:=Octeon-TX
 FEATURES:=squashfs ramdisk targz pcie gpio rtc usb fpu
 SUBTARGETS:=generic
 
-KERNEL_PATCHVER:=5.10
-KERNEL_TESTING_PATCHVER:=5.15
+KERNEL_PATCHVER:=5.15
 
 define Target/Description
 	Build images for Octeon-TX CN80XX/CN81XX based boards
diff --git a/target/linux/octeontx/config-5.10 b/target/linux/octeontx/config-5.10
deleted file mode 100644
index 19a8c258d9..0000000000
--- a/target/linux/octeontx/config-5.10
+++ /dev/null
@@ -1,413 +0,0 @@
-CONFIG_64BIT=y
-CONFIG_ARCH_DMA_ADDR_T_64BIT=y
-CONFIG_ARCH_HIBERNATION_HEADER=y
-CONFIG_ARCH_HIBERNATION_POSSIBLE=y
-CONFIG_ARCH_KEEP_MEMBLOCK=y
-CONFIG_ARCH_MMAP_RND_BITS=18
-CONFIG_ARCH_MMAP_RND_BITS_MAX=33
-CONFIG_ARCH_MMAP_RND_BITS_MIN=18
-CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
-CONFIG_ARCH_PROC_KCORE_TEXT=y
-CONFIG_ARCH_SELECT_MEMORY_MODEL=y
-CONFIG_ARCH_SPARSEMEM_DEFAULT=y
-CONFIG_ARCH_SPARSEMEM_ENABLE=y
-CONFIG_ARCH_STACKWALK=y
-CONFIG_ARCH_SUSPEND_POSSIBLE=y
-CONFIG_ARCH_THUNDER=y
-CONFIG_ARM64=y
-CONFIG_ARM64_4K_PAGES=y
-CONFIG_ARM64_CNP=y
-CONFIG_ARM64_CRYPTO=y
-CONFIG_ARM64_ERRATUM_819472=y
-CONFIG_ARM64_ERRATUM_824069=y
-CONFIG_ARM64_ERRATUM_826319=y
-CONFIG_ARM64_ERRATUM_827319=y
-CONFIG_ARM64_ERRATUM_843419=y
-CONFIG_ARM64_HW_AFDBM=y
-CONFIG_ARM64_MODULE_PLTS=y
-CONFIG_ARM64_PAGE_SHIFT=12
-CONFIG_ARM64_PAN=y
-CONFIG_ARM64_PA_BITS=48
-CONFIG_ARM64_PA_BITS_48=y
-CONFIG_ARM64_PTR_AUTH=y
-CONFIG_ARM64_SVE=y
-CONFIG_ARM64_TAGGED_ADDR_ABI=y
-CONFIG_ARM64_UAO=y
-CONFIG_ARM64_VA_BITS=48
-# CONFIG_ARM64_VA_BITS_39 is not set
-CONFIG_ARM64_VA_BITS_48=y
-CONFIG_ARM64_VHE=y
-CONFIG_ARM64_WORKAROUND_CLEAN_CACHE=y
-CONFIG_ARM_AMBA=y
-CONFIG_ARM_ARCH_TIMER=y
-CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
-CONFIG_ARM_CPUIDLE=y
-CONFIG_ARM_GIC=y
-CONFIG_ARM_GIC_V2M=y
-CONFIG_ARM_GIC_V3=y
-CONFIG_ARM_GIC_V3_ITS=y
-CONFIG_ARM_GIC_V3_ITS_PCI=y
-CONFIG_ARM_PSCI_FW=y
-CONFIG_ARM_SBSA_WATCHDOG=y
-CONFIG_ATA=y
-# CONFIG_ATA_SFF is not set
-CONFIG_AUDIT_ARCH_COMPAT_GENERIC=y
-CONFIG_BALLOON_COMPACTION=y
-CONFIG_BLK_DEV_BSG=y
-CONFIG_BLK_DEV_BSGLIB=y
-CONFIG_BLK_DEV_LOOP=y
-CONFIG_BLK_MQ_PCI=y
-CONFIG_BLK_MQ_VIRTIO=y
-CONFIG_BLK_PM=y
-CONFIG_BLK_SCSI_REQUEST=y
-CONFIG_CAVIUM_ERRATUM_22375=y
-CONFIG_CAVIUM_ERRATUM_23144=y
-CONFIG_CAVIUM_ERRATUM_23154=y
-CONFIG_CAVIUM_ERRATUM_27456=y
-CONFIG_CAVIUM_ERRATUM_30115=y
-CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
-CONFIG_CLKDEV_LOOKUP=y
-CONFIG_CLONE_BACKWARDS=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_COMMON_CLK_CS2000_CP=y
-# CONFIG_COMPAT_32BIT_TIME is not set
-CONFIG_CONFIGFS_FS=y
-CONFIG_CONTIG_ALLOC=y
-CONFIG_CPU_IDLE=y
-CONFIG_CPU_IDLE_GOV_MENU=y
-CONFIG_CPU_IDLE_MULTIPLE_DRIVERS=y
-CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_CPU_PM=y
-CONFIG_CPU_RMAP=y
-CONFIG_CRASH_CORE=y
-CONFIG_CRASH_DUMP=y
-CONFIG_CRC16=y
-CONFIG_CRC7=y
-CONFIG_CRC_ITU_T=y
-CONFIG_CRC_T10DIF=y
-CONFIG_CRYPTO_AES_ARM64=y
-CONFIG_CRYPTO_AES_ARM64_CE=y
-CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
-CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
-CONFIG_CRYPTO_ANSI_CPRNG=y
-CONFIG_CRYPTO_BLAKE2S=y
-CONFIG_CRYPTO_CRC32=y
-CONFIG_CRYPTO_CRC32C=y
-CONFIG_CRYPTO_CRCT10DIF=y
-CONFIG_CRYPTO_CRCT10DIF_ARM64_CE=y
-CONFIG_CRYPTO_CRYPTD=y
-CONFIG_CRYPTO_DRBG=y
-CONFIG_CRYPTO_DRBG_HMAC=y
-CONFIG_CRYPTO_DRBG_MENU=y
-CONFIG_CRYPTO_ECHAINIV=y
-CONFIG_CRYPTO_GHASH_ARM64_CE=y
-CONFIG_CRYPTO_HMAC=y
-CONFIG_CRYPTO_JITTERENTROPY=y
-CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
-CONFIG_CRYPTO_LIB_SHA256=y
-CONFIG_CRYPTO_RNG=y
-CONFIG_CRYPTO_RNG2=y
-CONFIG_CRYPTO_RNG_DEFAULT=y
-CONFIG_CRYPTO_SHA1=y
-CONFIG_CRYPTO_SHA1_ARM64_CE=y
-CONFIG_CRYPTO_SHA256=y
-CONFIG_CRYPTO_SHA256_ARM64=y
-CONFIG_CRYPTO_SHA2_ARM64_CE=y
-CONFIG_CRYPTO_SIMD=y
-CONFIG_DCACHE_WORD_ACCESS=y
-CONFIG_DMADEVICES=y
-CONFIG_DMA_CMA=y
-CONFIG_DMA_DIRECT_REMAP=y
-CONFIG_DMA_ENGINE=y
-CONFIG_DMA_OF=y
-CONFIG_DMA_PERNUMA_CMA=y
-CONFIG_DMA_REMAP=y
-CONFIG_DMA_SHARED_BUFFER=y
-CONFIG_DTC=y
-CONFIG_DT_IDLE_STATES=y
-CONFIG_EDAC=y
-# CONFIG_EDAC_DEBUG is not set
-# CONFIG_EDAC_DMC520 is not set
-CONFIG_EDAC_LEGACY_SYSFS=y
-CONFIG_EDAC_SUPPORT=y
-CONFIG_EDAC_THUNDERX=y
-# CONFIG_EDAC_XGENE is not set
-CONFIG_EEPROM_AT24=y
-CONFIG_FAT_FS=y
-CONFIG_FIXED_PHY=y
-CONFIG_FIX_EARLYCON_MEM=y
-CONFIG_FRAME_POINTER=y
-CONFIG_FREEZER=y
-CONFIG_FW_CACHE=y
-CONFIG_FW_LOADER_PAGED_BUF=y
-CONFIG_GENERIC_ALLOCATOR=y
-CONFIG_GENERIC_ARCH_TOPOLOGY=y
-CONFIG_GENERIC_BUG=y
-CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
-CONFIG_GENERIC_CLOCKEVENTS=y
-CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
-CONFIG_GENERIC_CPU_AUTOPROBE=y
-CONFIG_GENERIC_CPU_VULNERABILITIES=y
-CONFIG_GENERIC_CSUM=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
-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_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_IRQCHIP=y
-CONFIG_GPIO_PCA953X=y
-CONFIG_GPIO_PCA953X_IRQ=y
-CONFIG_GPIO_THUNDERX=y
-CONFIG_HANDLE_DOMAIN_IRQ=y
-CONFIG_HARDIRQS_SW_RESEND=y
-CONFIG_HAS_DMA=y
-CONFIG_HAS_IOMEM=y
-CONFIG_HAS_IOPORT_MAP=y
-CONFIG_HIBERNATE_CALLBACKS=y
-CONFIG_HIBERNATION=y
-CONFIG_HIBERNATION_SNAPSHOT_DEV=y
-CONFIG_HOLES_IN_ZONE=y
-CONFIG_HOTPLUG_CPU=y
-CONFIG_HUGETLBFS=y
-CONFIG_HUGETLB_PAGE=y
-CONFIG_HWSPINLOCK=y
-CONFIG_HW_RANDOM=y
-CONFIG_HW_RANDOM_CAVIUM=y
-CONFIG_HW_RANDOM_OPTEE=y
-CONFIG_I2C=y
-CONFIG_I2C_ALGOBIT=y
-CONFIG_I2C_BOARDINFO=y
-CONFIG_I2C_CHARDEV=y
-CONFIG_I2C_MUX=y
-CONFIG_I2C_SMBUS=y
-CONFIG_I2C_THUNDERX=y
-CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
-CONFIG_INITRAMFS_SOURCE=""
-CONFIG_IRQCHIP=y
-CONFIG_IRQ_DOMAIN=y
-CONFIG_IRQ_DOMAIN_HIERARCHY=y
-CONFIG_IRQ_FASTEOI_HIERARCHY_HANDLERS=y
-CONFIG_IRQ_FORCED_THREADING=y
-CONFIG_IRQ_TIME_ACCOUNTING=y
-CONFIG_IRQ_WORK=y
-# CONFIG_ISDN is not set
-CONFIG_JUMP_LABEL=y
-CONFIG_KEXEC=y
-CONFIG_KEXEC_CORE=y
-CONFIG_KSM=y
-CONFIG_LIBFDT=y
-CONFIG_LOCK_DEBUGGING_SUPPORT=y
-CONFIG_LOCK_SPIN_ON_OWNER=y
-CONFIG_LZO_COMPRESS=y
-CONFIG_LZO_DECOMPRESS=y
-CONFIG_MAGIC_SYSRQ=y
-CONFIG_MAILBOX=y
-# CONFIG_MAILBOX_TEST is not set
-CONFIG_MDIO_BUS=y
-CONFIG_MDIO_CAVIUM=y
-CONFIG_MDIO_DEVICE=y
-CONFIG_MDIO_DEVRES=y
-CONFIG_MDIO_THUNDER=y
-CONFIG_MEMFD_CREATE=y
-CONFIG_MEMORY_BALLOON=y
-CONFIG_MEMORY_ISOLATION=y
-CONFIG_MEMTEST=y
-CONFIG_MFD_SYSCON=y
-CONFIG_MIGRATION=y
-CONFIG_MMC=y
-CONFIG_MMC_BLOCK=y
-CONFIG_MMC_CAVIUM_THUNDERX=y
-CONFIG_MODULES_USE_ELF_RELA=y
-CONFIG_MSDOS_FS=y
-# CONFIG_MTD is not set
-CONFIG_MUTEX_SPIN_ON_OWNER=y
-CONFIG_NEED_DMA_MAP_STATE=y
-CONFIG_NEED_MULTIPLE_NODES=y
-CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y
-CONFIG_NEED_SG_DMA_LENGTH=y
-CONFIG_NET_FLOW_LIMIT=y
-CONFIG_NLS=y
-CONFIG_NLS_CODEPAGE_437=y
-CONFIG_NLS_ISO8859_1=y
-CONFIG_NODES_SHIFT=2
-CONFIG_NO_HZ_COMMON=y
-CONFIG_NO_HZ_IDLE=y
-CONFIG_NR_CPUS=64
-CONFIG_NUMA=y
-CONFIG_NUMA_BALANCING=y
-CONFIG_NUMA_BALANCING_DEFAULT_ENABLED=y
-CONFIG_NVMEM=y
-CONFIG_NVMEM_SYSFS=y
-CONFIG_OF=y
-CONFIG_OF_ADDRESS=y
-CONFIG_OF_EARLY_FLATTREE=y
-CONFIG_OF_FLATTREE=y
-CONFIG_OF_GPIO=y
-CONFIG_OF_IRQ=y
-CONFIG_OF_KOBJ=y
-CONFIG_OF_MDIO=y
-CONFIG_OF_NET=y
-CONFIG_OF_NUMA=y
-CONFIG_OPTEE=y
-CONFIG_OPTEE_SHM_NUM_PRIV_PAGES=1
-CONFIG_PADATA=y
-CONFIG_PAGE_REPORTING=y
-CONFIG_PARAVIRT=y
-CONFIG_PARTITION_PERCPU=y
-CONFIG_PCI=y
-CONFIG_PCIEAER=y
-CONFIG_PCIEPORTBUS=y
-CONFIG_PCIE_PME=y
-CONFIG_PCI_ATS=y
-CONFIG_PCI_DOMAINS=y
-CONFIG_PCI_DOMAINS_GENERIC=y
-CONFIG_PCI_ECAM=y
-CONFIG_PCI_HOST_COMMON=y
-CONFIG_PCI_HOST_GENERIC=y
-CONFIG_PCI_HOST_THUNDER_ECAM=y
-CONFIG_PCI_HOST_THUNDER_PEM=y
-CONFIG_PCI_IOV=y
-CONFIG_PCI_MSI=y
-CONFIG_PCI_MSI_IRQ_DOMAIN=y
-CONFIG_PGTABLE_LEVELS=4
-CONFIG_PHYLIB=y
-CONFIG_PHYS_ADDR_T_64BIT=y
-CONFIG_PM=y
-CONFIG_PM_CLK=y
-CONFIG_PM_SLEEP=y
-CONFIG_PM_SLEEP_SMP=y
-CONFIG_PM_STD_PARTITION=""
-CONFIG_POSIX_MQUEUE=y
-CONFIG_POSIX_MQUEUE_SYSCTL=y
-CONFIG_POWER_RESET=y
-CONFIG_POWER_RESET_SYSCON=y
-CONFIG_POWER_RESET_XGENE=y
-CONFIG_POWER_SUPPLY=y
-CONFIG_PROC_VMCORE=y
-CONFIG_QUEUED_RWLOCKS=y
-CONFIG_QUEUED_SPINLOCKS=y
-CONFIG_RAS=y
-CONFIG_RATIONAL=y
-# CONFIG_RAVE_SP_CORE is not set
-CONFIG_REBOOT_MODE=y
-CONFIG_REGMAP=y
-CONFIG_REGMAP_I2C=y
-CONFIG_REGMAP_MMIO=y
-CONFIG_RESET_CONTROLLER=y
-CONFIG_RFS_ACCEL=y
-CONFIG_RODATA_FULL_DEFAULT_ENABLED=y
-CONFIG_RPS=y
-CONFIG_RTC_CLASS=y
-CONFIG_RTC_DRV_DS1672=y
-CONFIG_RTC_I2C_AND_SPI=y
-CONFIG_RWSEM_SPIN_ON_OWNER=y
-CONFIG_SATA_AHCI=y
-CONFIG_SATA_AHCI_PLATFORM=y
-CONFIG_SATA_HOST=y
-CONFIG_SCHED_INFO=y
-CONFIG_SCHED_MC=y
-CONFIG_SCSI=y
-# CONFIG_SCSI_LOWLEVEL is not set
-# CONFIG_SCSI_PROC_FS is not set
-CONFIG_SCSI_SAS_ATA=y
-CONFIG_SCSI_SAS_ATTRS=y
-CONFIG_SCSI_SAS_HOST_SMP=y
-CONFIG_SCSI_SAS_LIBSAS=y
-CONFIG_SECCOMP=y
-CONFIG_SECCOMP_FILTER=y
-CONFIG_SERIAL_8250_DW=y
-CONFIG_SERIAL_8250_DWLIB=y
-CONFIG_SERIAL_8250_EXTENDED=y
-CONFIG_SERIAL_8250_FSL=y
-CONFIG_SERIAL_8250_SHARE_IRQ=y
-CONFIG_SERIAL_AMBA_PL011=y
-CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
-CONFIG_SERIAL_DEV_BUS=y
-CONFIG_SERIAL_DEV_CTRL_TTYPORT=y
-CONFIG_SERIAL_MCTRL_GPIO=y
-CONFIG_SERIAL_OF_PLATFORM=y
-CONFIG_SERIAL_XILINX_PS_UART=y
-CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y
-CONFIG_SG_POOL=y
-CONFIG_SMP=y
-CONFIG_SPARSEMEM=y
-CONFIG_SPARSEMEM_EXTREME=y
-CONFIG_SPARSEMEM_MANUAL=y
-CONFIG_SPARSEMEM_VMEMMAP=y
-CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
-CONFIG_SPARSE_IRQ=y
-CONFIG_SPI=y
-CONFIG_SPI_MASTER=y
-CONFIG_SPI_THUNDERX=y
-CONFIG_SRAM=y
-CONFIG_SRCU=y
-CONFIG_SWIOTLB=y
-CONFIG_SWPHY=y
-CONFIG_SYNC_FILE=y
-CONFIG_SYSCON_REBOOT_MODE=y
-CONFIG_SYSCTL_EXCEPTION_TRACE=y
-CONFIG_SYS_SUPPORTS_HUGETLBFS=y
-CONFIG_TASKSTATS=y
-CONFIG_TASK_DELAY_ACCT=y
-CONFIG_TASK_IO_ACCOUNTING=y
-CONFIG_TASK_XACCT=y
-CONFIG_TEE=y
-CONFIG_THREAD_INFO_IN_TASK=y
-CONFIG_THUNDER_NIC_BGX=y
-CONFIG_THUNDER_NIC_PF=y
-CONFIG_THUNDER_NIC_RGX=y
-CONFIG_THUNDER_NIC_VF=y
-CONFIG_TICK_CPU_ACCOUNTING=y
-CONFIG_TIMER_OF=y
-CONFIG_TIMER_PROBE=y
-CONFIG_TRANSPARENT_HUGEPAGE=y
-CONFIG_TRANSPARENT_HUGEPAGE_ALWAYS=y
-# CONFIG_TRANSPARENT_HUGEPAGE_MADVISE is not set
-CONFIG_TREE_RCU=y
-CONFIG_TREE_SRCU=y
-CONFIG_UNMAP_KERNEL_AT_EL0=y
-CONFIG_USB=y
-CONFIG_USB_COMMON=y
-CONFIG_USB_PCI=y
-CONFIG_USB_SUPPORT=y
-# CONFIG_USB_UHCI_HCD is not set
-CONFIG_USB_XHCI_HCD=y
-CONFIG_USB_XHCI_PCI=y
-CONFIG_USB_XHCI_PLATFORM=y
-CONFIG_USE_PERCPU_NUMA_NODE_ID=y
-CONFIG_VIRTIO=y
-CONFIG_VIRTIO_BALLOON=y
-# CONFIG_VIRTIO_BLK is not set
-CONFIG_VIRTIO_MMIO=y
-# CONFIG_VIRTIO_NET is not set
-CONFIG_VIRTIO_PCI=y
-CONFIG_VIRTIO_PCI_LEGACY=y
-CONFIG_VMAP_STACK=y
-CONFIG_WATCHDOG_CORE=y
-CONFIG_XARRAY_MULTI=y
-CONFIG_XPS=y
-CONFIG_XXHASH=y
-CONFIG_ZONE_DMA32=y
diff --git a/target/linux/octeontx/patches-5.10/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch b/target/linux/octeontx/patches-5.10/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch
deleted file mode 100644
index 28502d393f..0000000000
--- a/target/linux/octeontx/patches-5.10/0004-PCI-add-quirk-for-Gateworks-PLX-PEX860x-switch-with-.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From d0ff7a1bcfe886cab1a237895b08ac51ecfe10e7 Mon Sep 17 00:00:00 2001
-From: Tim Harvey <tharvey at gateworks.com>
-Date: Wed, 10 Apr 2019 08:00:47 -0700
-Subject: [PATCH 04/12] PCI: add quirk for Gateworks PLX PEX860x switch with
- GPIO PERST#
-
-Gateworks boards use PLX PEX860x switches where downstream ports
-have their PERST# driven from the PEX GPIO.
-
-Signed-off-by: Tim Harvey <tharvey at gateworks.com>
----
- drivers/pci/quirks.c | 32 ++++++++++++++++++++++++++++++++
- 1 file changed, 32 insertions(+)
-
---- a/drivers/pci/quirks.c
-+++ b/drivers/pci/quirks.c
-@@ -25,6 +25,7 @@
- #include <linux/ktime.h>
- #include <linux/mm.h>
- #include <linux/nvme.h>
-+#include <linux/of.h>
- #include <linux/platform_data/x86/apple.h>
- #include <linux/pm_runtime.h>
- #include <linux/suspend.h>
-@@ -5787,3 +5788,34 @@ static void nvidia_ion_ahci_fixup(struct
- 	pdev->dev_flags |= PCI_DEV_FLAGS_HAS_MSI_MASKING;
- }
- DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, 0x0ab8, nvidia_ion_ahci_fixup);
-+
-+#ifdef CONFIG_PCI_HOST_THUNDER_PEM
-+/*
-+ * fixup for PLX PEX8909 bridge to configure GPIO1-7 as output High
-+ * as they are used for slots1-7 PERST#
-+ */
-+static void newport_pciesw_early_fixup(struct pci_dev *dev)
-+{
-+	u32 dw;
-+
-+	if (!of_machine_is_compatible("gw,newport"))
-+		return;
-+
-+	if (dev->devfn != 0)
-+		return;
-+
-+	dev_info(&dev->dev, "de-asserting PERST#\n");
-+	pci_read_config_dword(dev, 0x62c, &dw);
-+	dw |= 0xaaa8; /* GPIO1-7 outputs */
-+	pci_write_config_dword(dev, 0x62c, dw);
-+
-+	pci_read_config_dword(dev, 0x644, &dw);
-+	dw |= 0xfe;   /* GPIO1-7 output high */
-+	pci_write_config_dword(dev, 0x644, dw);
-+
-+	msleep(100);
-+}
-+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8609, newport_pciesw_early_fixup);
-+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8606, newport_pciesw_early_fixup);
-+DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_PLX, 0x8604, newport_pciesw_early_fixup);
-+#endif /* CONFIG_PCI_HOST_THUNDER_PEM */



From lede-commits at lists.infradead.org  Sun Feb 26 09:19:55 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 26 Feb 2023 12:19:55 -0500
Subject: [openwrt/openwrt]  kernel: can: fix MCP251x CAN controller module
 autoload
In-Reply-To: <167743199552.821776.6023349071894056719@git-01.infra.openwrt.org>
References: <167743199552.821776.6023349071894056719@git-01.infra.openwrt.org>
Message-ID: <mailman.19172.1677431999.3064139.lede-commits@lists.infradead.org>

hauke pushed a commit to openwrt/openwrt.git, branch openwrt-22.03:
https://git.openwrt.org/cfce8ab388f10b9c463464b3f61d86260e17116e

commit cfce8ab388f10b9c463464b3f61d86260e17116e
Author: Tim Harvey <tharvey at gateworks.com>
AuthorDate: Fri Feb 17 16:53:18 2023 -0800

    kernel: can: fix MCP251x CAN controller module autoload
    
    Fix autoload module name for can-mcp251x kmod.
    
    Signed-off-by: Tim Harvey <tharvey at gateworks.com>
    (cherry picked from commit 29d02d8ce584fa7e420204e04dde1e17e14e009c)
---
 package/kernel/linux/modules/can.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/kernel/linux/modules/can.mk b/package/kernel/linux/modules/can.mk
index 9cdebb9091..4ff85d1c01 100644
--- a/package/kernel/linux/modules/can.mk
+++ b/package/kernel/linux/modules/can.mk
@@ -152,7 +152,7 @@ define KernelPackage/can-mcp251x
 	CONFIG_SPI=y \
 	CONFIG_CAN_MCP251X
   FILES:=$(LINUX_DIR)/drivers/net/can/spi/mcp251x.ko
-  AUTOLOAD:=$(call AutoProbe,can-mcp251x)
+  AUTOLOAD:=$(call AutoProbe,mcp251x)
   $(call AddDepends/can)
 endef
 



From lede-commits at lists.infradead.org  Sun Feb 26 14:45:01 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 26 Feb 2023 17:45:01 -0500
Subject: [openwrt/openwrt]  bcm53xx: Add D-Link DWL-8610AP board settings
In-Reply-To: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
References: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
Message-ID: <mailman.19191.1677451503.3064139.lede-commits@lists.infradead.org>

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

commit d51c44a3ba34940ffd4ff0592875bffa23b7cec7
Author: Linus Walleij <linus.walleij at linaro.org>
AuthorDate: Fri Dec 16 21:52:44 2022 +0100

    bcm53xx: Add D-Link DWL-8610AP board settings
    
    The D-Link DWL-8610AP does not make use of the B53 switch
    like most equipment. It lies dormant and the machine is using
    eth0 and eth1 directly.
    
    Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
---
 target/linux/bcm53xx/base-files/etc/board.d/02_network | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/target/linux/bcm53xx/base-files/etc/board.d/02_network b/target/linux/bcm53xx/base-files/etc/board.d/02_network
index c2e5afc5ed..6bec600540 100644
--- a/target/linux/bcm53xx/base-files/etc/board.d/02_network
+++ b/target/linux/bcm53xx/base-files/etc/board.d/02_network
@@ -16,6 +16,9 @@ bcm53xx_setup_interfaces()
 	asus,rt-ac88u)
 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 extsw" "wan"
 		;;
+	dlink,dwl-8610ap)
+		ucidef_set_interface_lan "eth0 eth1" "dhcp"
+		;;
 	linksys,panamera)
 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 lan5 lan6 lan7 lan8 extsw" "wan"
 		;;



From lede-commits at lists.infradead.org  Sun Feb 26 14:45:00 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 26 Feb 2023 17:45:00 -0500
Subject: [openwrt/openwrt]  bcm53xx: Add support for D-Link DWL-8610AP
In-Reply-To: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
References: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
Message-ID: <mailman.19192.1677451506.3064139.lede-commits@lists.infradead.org>

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

commit 4d903a50099b5c35063b92b39d196e34e1a14ec6
Author: Linus Walleij <linus.walleij at linaro.org>
AuthorDate: Fri Dec 16 21:52:27 2022 +0100

    bcm53xx: Add support for D-Link DWL-8610AP
    
    The D-Link DWL-8610AP is a pretty straight-forward BC53016
    device, D-Link has invented a firmware package format which
    is a tar file, and we implement this for the factory image.
    
    Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
---
 target/linux/bcm53xx/image/Makefile | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/target/linux/bcm53xx/image/Makefile b/target/linux/bcm53xx/image/Makefile
index ed2e9c6821..1cb08effce 100644
--- a/target/linux/bcm53xx/image/Makefile
+++ b/target/linux/bcm53xx/image/Makefile
@@ -105,6 +105,22 @@ define Build/seama-nand
 		-i $@.entity
 endef
 
+define Build/dwl8610ap-image
+	mkdir -p $@.tmptar
+	# The DWL8610AP pretends to be a Broadcom reference design
+	echo "bcm953012er" > $@.tmptar/board
+	echo "LVL7" > $@.tmptar/model
+	# Something high beyond what D-Link has put out
+	echo "5.0.0.0" > $@.tmptar/version
+	# Create rootfs.bin, this is just a NAND image including everything
+	cp $@ $@.tmptar/rootfs.bin
+	# Hash the rootfs.bin
+	cat $@.tmptar/rootfs.bin | md5sum > $@.tmptar/rootfs.md5
+	cd $@.tmptar && tar -c -f $@.new *
+	rm -rf $@.tmptar
+	mv $@.new $@
+endef
+
 DEVICE_VARS += ASUS_PRODUCTID
 DEVICE_VARS += BUFFALO_TAG_PLATFORM BUFFALO_TAG_VERSION BUFFALO_TAG_MINOR
 DEVICE_VARS += SIGNATURE
@@ -250,6 +266,15 @@ define Device/dlink_dir-885l
 endef
 TARGET_DEVICES += dlink_dir-885l
 
+define Device/dlink_dwl-8610ap
+  DEVICE_VENDOR := D-Link
+  DEVICE_MODEL := DWL-8610AP
+  DEVICE_PACKAGES := $(B43)
+  IMAGES := factory.tar
+  IMAGE/factory.tar := append-ubi | trx-nand | dwl8610ap-image
+endef
+TARGET_DEVICES += dlink_dwl-8610ap
+
 define Device/linksys_ea6300-v1
   DEVICE_VENDOR := Linksys
   DEVICE_MODEL := EA6300



From lede-commits at lists.infradead.org  Sun Feb 26 14:45:03 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 26 Feb 2023 17:45:03 -0500
Subject: [openwrt/openwrt]  build: fix for sourcing targets image config
 installed via feeds
In-Reply-To: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
References: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
Message-ID: <mailman.19193.1677451506.3064139.lede-commits@lists.infradead.org>

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

commit 522a60cd31686a3d1b6d7ed1229eb68568aa89ac
Author: Prasun Maiti <prasunmaiti87 at gmail.com>
AuthorDate: Wed Nov 16 16:33:33 2022 +0530

    build: fix for sourcing targets image config installed via feeds
    
    Sourcing of image/Config.in will not happen
    When a target is installed from target/linux/feeds/
    
    Signed-off-by: Prasun Maiti <prasunmaiti87 at gmail.com>
    Acked-by: Petr ?tetiar <ynezz at true.cz>
---
 config/Config-images.in | 1 +
 1 file changed, 1 insertion(+)

diff --git a/config/Config-images.in b/config/Config-images.in
index 0768c5a483..8c4616f37c 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -284,6 +284,7 @@ menu "Target Images"
 	comment "Image Options"
 
 	source "target/linux/*/image/Config.in"
+	source "target/linux/*/*/image/Config.in"
 
 	config TARGET_KERNEL_PARTSIZE
 		int "Kernel partition size (in MiB)"



From lede-commits at lists.infradead.org  Sun Feb 26 14:44:57 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 26 Feb 2023 17:44:57 -0500
Subject: [openwrt/openwrt]  x86: remove bootloader upgrade from preinit
In-Reply-To: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
References: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
Message-ID: <mailman.19194.1677451506.3064139.lede-commits@lists.infradead.org>

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

commit 909cc6ef5f38fdb65dbbbf67318fbfbe566848c7
Author: Tomasz Maciej Nowak <tmn505 at gmail.com>
AuthorDate: Mon Jan 23 14:44:49 2023 +0100

    x86: remove bootloader upgrade from preinit
    
    This hack was to bring all existing installations to the newest GRUB
    version as fast as possible. Since 19.07.x is EoL we can assume this
    task is completed. Now sysupgrade will solely be responsible for
    bootloader upgrade.
    
    Signed-off-by: Tomasz Maciej Nowak <tmn505 at gmail.com>
---
 .../x86/base-files/lib/preinit/81_upgrade_bootloader   | 18 ------------------
 target/linux/x86/base-files/lib/upgrade/platform.sh    |  3 +--
 2 files changed, 1 insertion(+), 20 deletions(-)

diff --git a/target/linux/x86/base-files/lib/preinit/81_upgrade_bootloader b/target/linux/x86/base-files/lib/preinit/81_upgrade_bootloader
deleted file mode 100644
index 42f04d76a7..0000000000
--- a/target/linux/x86/base-files/lib/preinit/81_upgrade_bootloader
+++ /dev/null
@@ -1,18 +0,0 @@
-upgrade_bootloader() {
-	local diskdev
-
-	. /lib/upgrade/common.sh
-
-	if [ ! -f /boot/grub/upgraded ] && export_bootdevice && export_partdevice diskdev 0; then
-		part_magic_efi "/dev/$diskdev" && return 0
-		echo "(hd0) /dev/$diskdev" > /tmp/device.map
-		/usr/sbin/grub-bios-setup \
-			-m "/tmp/device.map" \
-			-d "/boot/grub" \
-			-r "hd0,msdos1" \
-			"/dev/$diskdev" \
-		&& touch /boot/grub/upgraded
-	fi
-}
-
-[ "$INITRAMFS" = "1" ] || boot_hook_add preinit_main upgrade_bootloader
diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh b/target/linux/x86/base-files/lib/upgrade/platform.sh
index d8f2eba97e..5dad7a538a 100644
--- a/target/linux/x86/base-files/lib/upgrade/platform.sh
+++ b/target/linux/x86/base-files/lib/upgrade/platform.sh
@@ -62,8 +62,7 @@ platform_do_bootloader_upgrade() {
 			-m "/tmp/device.map" \
 			-d "/tmp/boot/boot/grub" \
 			-r "hd0,${parttable}1" \
-			"/dev/$diskdev" \
-		&& touch /tmp/boot/boot/grub/upgraded
+			"/dev/$diskdev"
 
 		umount /tmp/boot
 	fi



From lede-commits at lists.infradead.org  Sun Feb 26 14:45:05 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 26 Feb 2023 17:45:05 -0500
Subject: [openwrt/openwrt]  ath79: add support for MikroTik RouterBOARD 911
 Lite2/Lite5
In-Reply-To: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
References: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
Message-ID: <mailman.19195.1677451506.3064139.lede-commits@lists.infradead.org>

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

commit 43c7132bf8e7dc0756b527f985a1ac6056007f62
Author: Tomasz Maciej Nowak <tmn505 at gmail.com>
AuthorDate: Wed Aug 24 18:05:58 2022 +0200

    ath79: add support for MikroTik RouterBOARD 911 Lite2/Lite5
    
    Forward-port from ar71xx target the board introduced in commit
    eb9e3651dd1a (" ar71xx: add support for the MikroTik RB911-2Hn/5Hn
    boards"). Citing:
    
    The patch adds support for the MikroTik RB911-2Hn (911 Lite2)
    and the RB911-5Hn (911 Lite5) boards:
    
      https://mikrotik.com/product/RB911-2Hn
      https://mikrotik.com/product/RB911-5Hn
    
    The two boards are using the same hardware design, the only difference
    between the two is the supported wireless band.
    
    Specifications:
      * SoC: Atheros AR9344 (600MHz)
      * RAM: 64MiB
      * Storage: 16 MiB SPI NOR flash
      * Ethernet: 1x100M (Passive PoE in)
      * Wireless: AR9344 built-in wireless MAC, single chain
                  802.11b/g/n (911-2Hn) or 802.11a/g/n (911-5Hn)
    
    Notes:
      * Older versions of these boards might be equipped with a NAND
        flash chip instead of the SPI NOR device. Those boards are not
        supported (yet).[1]
      * The MikroTik RB911-5HnD (911 Lite5 Dual) board also uses the
        same hardware. Support for that can be added later with little
        effort probably.[2]
    
    End of citation.
    
    Follow intallation instruction from that commit message, using
    openwrt-ath79-mikrotik-mikrotik_routerboard-911-lite-initramfs-kernel.bin
    and
    openwrt-ath79-mikrotik-mikrotik_routerboard-911-lite-squashfs-sysupgrade.bin
    images found in ath79/mikrotik directory. Be advised that the board
    accepts 10-30 V on PoE input.
    
    Known issues
    Compared to ar71xx target image, there is still small leak of current to
    user LED, which makes it lit, although weaker, even if brightness is set
    to 0. The cause of that is still unknown.
    
    1. https://github.com/openwrt/openwrt/pull/3652
    2. RB911-5HnD should work with this commit or with [1], depending on
       what flash topology was used.
    
    Signed-off-by: Tomasz Maciej Nowak <tmn505 at gmail.com>
---
 .../dts/ar9344_mikrotik_routerboard-911-lite.dts   | 36 ++++++++++++++++++++++
 target/linux/ath79/image/mikrotik.mk               | 10 ++++++
 .../ath79/mikrotik/base-files/etc/board.d/01_leds  | 19 ++++++------
 .../mikrotik/base-files/etc/board.d/02_network     |  2 ++
 .../etc/hotplug.d/firmware/10-ath9k-eeprom         |  1 +
 5 files changed, 59 insertions(+), 9 deletions(-)

diff --git a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-911-lite.dts b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-911-lite.dts
new file mode 100644
index 0000000000..d77078c5a2
--- /dev/null
+++ b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-911-lite.dts
@@ -0,0 +1,36 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "ar9344_mikrotik_routerboard.dtsi"
+#include "ar9344_mikrotik_routerboard-16m-nor.dtsi"
+
+/ {
+	model = "MikroTik RouterBOARD 911-2Hn/5Hn (Lite2/Lite5)";
+	compatible = "mikrotik,routerboard-911-lite", "qca,ar9344";
+};
+
+&leds {
+	pinctrl-names = "default";
+	pinctrl-0 = <&enable_gpio_20>;
+
+	lan {
+		label = "green:lan";
+		gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
+	};
+
+	power {
+		label = "green:power";
+		gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
+		default-state = "on";
+	};
+
+	led_user: user {
+		label = "green:user";
+		gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
+	};
+};
+
+&pinmux {
+	enable_gpio_20: pinmux_gpio_out_function5 {
+		pinctrl-single,bits = <0x14 0x0 0xff>;
+	};
+};
diff --git a/target/linux/ath79/image/mikrotik.mk b/target/linux/ath79/image/mikrotik.mk
index c90579fbb5..fb0035fb65 100644
--- a/target/linux/ath79/image/mikrotik.mk
+++ b/target/linux/ath79/image/mikrotik.mk
@@ -9,6 +9,16 @@ define Device/mikrotik_routerboard-493g
 endef
 TARGET_DEVICES += mikrotik_routerboard-493g
 
+define Device/mikrotik_routerboard-911-lite
+  $(Device/mikrotik_nor)
+  SOC := ar9344
+  DEVICE_MODEL := RouterBOARD 911 Lite2/Lite5 (2Hn/5Hn)
+  DEVICE_PACKAGES += rssileds
+  IMAGE_SIZE := 16256k
+  SUPPORTED_DEVICES += rb-911-2hn rb-911-5hn
+endef
+TARGET_DEVICES += mikrotik_routerboard-911-lite
+
 define Device/mikrotik_routerboard-912uag-2hpnd
   $(Device/mikrotik_nand)
   SOC := ar9342
diff --git a/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds b/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds
index 76b91a54a5..4c1b98fff2 100644
--- a/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds
+++ b/target/linux/ath79/mikrotik/base-files/etc/board.d/01_leds
@@ -6,6 +6,16 @@ board_config_update
 board=$(board_name)
 
 case "$board" in
+mikrotik,routerboard-911-lite|\
+mikrotik,routerboard-lhg-5nd)
+	ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0"
+	ucidef_set_rssimon "wlan0" "200000" "1"
+	ucidef_set_led_rssi "rssilow" "rssilow" "green:rssilow" "wlan0" "1" "100"
+	ucidef_set_led_rssi "rssimediumlow" "rssimediumlow" "green:rssimediumlow" "wlan0" "20" "100"
+	ucidef_set_led_rssi "rssimedium" "rssimedium" "green:rssimedium" "wlan0" "40" "100"
+	ucidef_set_led_rssi "rssimediumhigh" "rssimediumhigh" "green:rssimediumhigh" "wlan0" "60" "100"
+	ucidef_set_led_rssi "rssihigh" "rssihigh" "green:rssihigh" "wlan0" "80" "100"
+	;;
 mikrotik,routerboard-951ui-2nd|\
 mikrotik,routerboard-952ui-5ac2nd)
 	ucidef_set_led_netdev "port1" "port1" "green:port1" "eth1"
@@ -19,15 +29,6 @@ mikrotik,routerboard-mapl-2nd|\
 mikrotik,routerboard-wap-2nd)
 	ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0"
 	;;
-mikrotik,routerboard-lhg-5nd)
-	ucidef_set_led_netdev "lan" "lan" "green:lan" "eth0"
-	ucidef_set_rssimon "wlan0" "200000" "1"
-	ucidef_set_led_rssi "rssilow" "rssilow" "green:rssilow" "wlan0" "1" "100"
-	ucidef_set_led_rssi "rssimediumlow" "rssimediumlow" "green:rssimediumlow" "wlan0" "20" "100"
-	ucidef_set_led_rssi "rssimedium" "rssimedium" "green:rssimedium" "wlan0" "40" "100"
-	ucidef_set_led_rssi "rssimediumhigh" "rssimediumhigh" "green:rssimediumhigh" "wlan0" "60" "100"
-	ucidef_set_led_rssi "rssihigh" "rssihigh" "green:rssihigh" "wlan0" "80" "100"
-	;;
 mikrotik,routerboard-map-2nd)
 	ucidef_set_led_netdev "eth_1" "eth_1" "green:eth_1" "eth1"
 	ucidef_set_led_switch "eth_2" "eth_2" "green:eth_2" "switch0" "0x4"
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 5646d8cf68..da63347c3c 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-911-lite|\
 	mikrotik,routerboard-912uag-2hpnd|\
 	mikrotik,routerboard-lhg-2nd|\
 	mikrotik,routerboard-lhg-5nd|\
@@ -52,6 +53,7 @@ ath79_setup_macs()
 	local mac_base="$(cat /sys/firmware/mikrotik/hard_config/mac_base)"
 
 	case "$board" in
+	mikrotik,routerboard-911-lite|\
 	mikrotik,routerboard-912uag-2hpnd|\
 	mikrotik,routerboard-lhg-2nd|\
 	mikrotik,routerboard-lhg-5nd|\
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 aa5354bfdb..e0bf1e47ef 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-911-lite|\
 	mikrotik,routerboard-912uag-2hpnd|\
 	mikrotik,routerboard-lhg-2nd|\
 	mikrotik,routerboard-lhg-5nd|\



From lede-commits at lists.infradead.org  Sun Feb 26 14:45:02 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 26 Feb 2023 17:45:02 -0500
Subject: [openwrt/openwrt]  treewide: remove label = "cpu" from DSA dt-binding
In-Reply-To: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
References: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
Message-ID: <mailman.19196.1677451506.3064139.lede-commits@lists.infradead.org>

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

commit 9df035b3ea674279bdf1d1c6bfeffe7eb52bb69f
Author: Ar?n? ?NAL <arinc.unal at arinc9.com>
AuthorDate: Wed Nov 30 21:00:13 2022 +0300

    treewide: remove label = "cpu" from DSA dt-binding
    
    This is not used by the DSA dt-binding, so remove it from all devicetrees.
    
    Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9cc115d8d6f73dd260de1609182f3645844d6907
    Signed-off-by: Ar?n? ?NAL <arinc.unal at arinc9.com>
---
 target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts                   | 1 -
 target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts                    | 1 -
 target/linux/bmips/dts/bcm6318.dtsi                                     | 1 -
 target/linux/bmips/dts/bcm63268.dtsi                                    | 1 -
 target/linux/bmips/dts/bcm6328.dtsi                                     | 1 -
 target/linux/bmips/dts/bcm6362.dtsi                                     | 1 -
 target/linux/bmips/dts/bcm6368.dtsi                                     | 1 -
 target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-4i-edge-200.dts  | 1 -
 target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-ea3500.dts       | 1 -
 target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9.dtsi            | 1 -
 target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dts               | 1 -
 target/linux/mediatek/dts/mt7622-linksys-e8450.dtsi                     | 1 -
 target/linux/mediatek/dts/mt7622-netgear-wax206.dts                     | 1 -
 target/linux/mediatek/dts/mt7622-ruijie-rg-ew3200.dtsi                  | 1 -
 target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts           | 1 -
 target/linux/mediatek/dts/mt7623a-unielec-u7623-02.dtsi                 | 1 -
 target/linux/mediatek/dts/mt7629-iptime-a6004mx.dts                     | 1 -
 target/linux/mediatek/dts/mt7986a-bananapi-bpi-r3.dts                   | 1 -
 target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000.dtsi       | 1 -
 .../mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtsi   | 1 -
 .../mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts    | 1 -
 .../files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts | 1 -
 .../mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts   | 1 -
 .../mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-mochabin.dts    | 1 -
 .../qoriq/files/arch/powerpc/boot/dts/fsl/watchguard-firebox-m300.dts   | 2 --
 target/linux/ramips/dts/mt7621.dtsi                                     | 1 -
 26 files changed, 27 deletions(-)

diff --git a/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts
index 915b4414dd..2ee7ab56c5 100644
--- a/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts
+++ b/target/linux/ath79/dts/ar7242_ubnt_edgeswitch-8xp.dts
@@ -160,7 +160,6 @@
 
 			phy0: port8 at 8 {
 				reg = <8>;
-				label = "cpu";
 				ethernet = <&eth0>;
 
 				fixed-link {
diff --git a/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts b/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts
index 58586eb036..106ca56e7e 100644
--- a/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts
+++ b/target/linux/ath79/dts/ar9132_tplink_tl-wr941-v2.dts
@@ -99,7 +99,6 @@
 
 			port at 5 {
 				reg = <5>;
-				label = "cpu";
 				ethernet = <&eth0>;
 			};
 		};
diff --git a/target/linux/bmips/dts/bcm6318.dtsi b/target/linux/bmips/dts/bcm6318.dtsi
index 9f613ad47a..13e1bf1144 100644
--- a/target/linux/bmips/dts/bcm6318.dtsi
+++ b/target/linux/bmips/dts/bcm6318.dtsi
@@ -400,7 +400,6 @@
 
 				port at 8 {
 					reg = <8>;
-					label = "cpu";
 
 					phy-mode = "internal";
 					ethernet = <&ethernet>;
diff --git a/target/linux/bmips/dts/bcm63268.dtsi b/target/linux/bmips/dts/bcm63268.dtsi
index 2ab14e5a33..2bc86d26f9 100644
--- a/target/linux/bmips/dts/bcm63268.dtsi
+++ b/target/linux/bmips/dts/bcm63268.dtsi
@@ -521,7 +521,6 @@
 
 				port at 8 {
 					reg = <8>;
-					label = "cpu";
 
 					phy-mode = "internal";
 					ethernet = <&ethernet>;
diff --git a/target/linux/bmips/dts/bcm6328.dtsi b/target/linux/bmips/dts/bcm6328.dtsi
index c8e9138ccb..dfd603b7c6 100644
--- a/target/linux/bmips/dts/bcm6328.dtsi
+++ b/target/linux/bmips/dts/bcm6328.dtsi
@@ -418,7 +418,6 @@
 
 				port at 8 {
 					reg = <8>;
-					label = "cpu";
 
 					phy-mode = "internal";
 					ethernet = <&ethernet>;
diff --git a/target/linux/bmips/dts/bcm6362.dtsi b/target/linux/bmips/dts/bcm6362.dtsi
index 77473c22bb..d66a602df7 100644
--- a/target/linux/bmips/dts/bcm6362.dtsi
+++ b/target/linux/bmips/dts/bcm6362.dtsi
@@ -515,7 +515,6 @@
 
 				port at 8 {
 					reg = <8>;
-					label = "cpu";
 
 					phy-mode = "internal";
 					ethernet = <&ethernet>;
diff --git a/target/linux/bmips/dts/bcm6368.dtsi b/target/linux/bmips/dts/bcm6368.dtsi
index b50a572fd0..5ba9092193 100644
--- a/target/linux/bmips/dts/bcm6368.dtsi
+++ b/target/linux/bmips/dts/bcm6368.dtsi
@@ -529,7 +529,6 @@
 
 				port at 8 {
 					reg = <8>;
-					label = "cpu";
 
 					phy-mode = "internal";
 					ethernet = <&ethernet>;
diff --git a/target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-4i-edge-200.dts b/target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-4i-edge-200.dts
index 143dac97fe..8e6c198c5e 100644
--- a/target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-4i-edge-200.dts
+++ b/target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-4i-edge-200.dts
@@ -112,7 +112,6 @@
 
 			port at 5 {
 				reg = <5>;
-				label = "cpu";
 				phy-mode = "rgmii-id";
 				ethernet = <&eth0port>;
 
diff --git a/target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-ea3500.dts b/target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-ea3500.dts
index f8f940dfc6..d0f2e35343 100644
--- a/target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-ea3500.dts
+++ b/target/linux/kirkwood/files/arch/arm/boot/dts/kirkwood-ea3500.dts
@@ -125,7 +125,6 @@
 
 			port at 5 {
 				reg = <5>;
-				label = "cpu";
 				ethernet = <&eth0port>;
 				fixed-link {
 					speed = <1000>;
diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9.dtsi
index 7fa2fac1ef..e4c9be8f87 100644
--- a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9.dtsi
+++ b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9.dtsi
@@ -447,7 +447,6 @@
 
 				port at 6 {
 					reg = <0x6>;
-					label = "cpu";
 					phy-mode = "internal";
 					ethernet = <&eth0>;
 
diff --git a/target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dts b/target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dts
index fdbcbc18bc..c7e11c80b0 100644
--- a/target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dts
+++ b/target/linux/mediatek/dts/mt7622-elecom-wrc-x3200gst3.dts
@@ -258,7 +258,6 @@
 
 				port at 6 {
 					reg = <6>;
-					label = "cpu";
 					ethernet = <&gmac0>;
 					phy-mode = "2500base-x";
 
diff --git a/target/linux/mediatek/dts/mt7622-linksys-e8450.dtsi b/target/linux/mediatek/dts/mt7622-linksys-e8450.dtsi
index 1fe839575e..abac02a72d 100644
--- a/target/linux/mediatek/dts/mt7622-linksys-e8450.dtsi
+++ b/target/linux/mediatek/dts/mt7622-linksys-e8450.dtsi
@@ -181,7 +181,6 @@
 
 				port at 6 {
 					reg = <6>;
-					label = "cpu";
 					ethernet = <&gmac0>;
 					phy-mode = "2500base-x";
 
diff --git a/target/linux/mediatek/dts/mt7622-netgear-wax206.dts b/target/linux/mediatek/dts/mt7622-netgear-wax206.dts
index 181abb915c..3846fabbed 100644
--- a/target/linux/mediatek/dts/mt7622-netgear-wax206.dts
+++ b/target/linux/mediatek/dts/mt7622-netgear-wax206.dts
@@ -191,7 +191,6 @@
 
 				port at 6 {
 					ethernet = <&gmac0>;
-					label = "cpu";
 					phy-mode = "2500base-x";
 					reg = <6>;
 
diff --git a/target/linux/mediatek/dts/mt7622-ruijie-rg-ew3200.dtsi b/target/linux/mediatek/dts/mt7622-ruijie-rg-ew3200.dtsi
index 5a1cd99f61..a240f9bfce 100644
--- a/target/linux/mediatek/dts/mt7622-ruijie-rg-ew3200.dtsi
+++ b/target/linux/mediatek/dts/mt7622-ruijie-rg-ew3200.dtsi
@@ -137,7 +137,6 @@
 
 				port at 6 {
 					reg = <6>;
-					label = "cpu";
 					ethernet = <&gmac0>;
 					phy-mode = "2500base-x";
 
diff --git a/target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts b/target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts
index 9661d0c7fb..ecc25fd328 100644
--- a/target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts
+++ b/target/linux/mediatek/dts/mt7622-xiaomi-redmi-router-ax6s.dts
@@ -196,7 +196,6 @@
 
 				port at 6 {
 					reg = <6>;
-					label = "cpu";
 					ethernet = <&gmac0>;
 					phy-mode = "2500base-x";
 
diff --git a/target/linux/mediatek/dts/mt7623a-unielec-u7623-02.dtsi b/target/linux/mediatek/dts/mt7623a-unielec-u7623-02.dtsi
index 50c7f3e88e..a4e443a0fb 100644
--- a/target/linux/mediatek/dts/mt7623a-unielec-u7623-02.dtsi
+++ b/target/linux/mediatek/dts/mt7623a-unielec-u7623-02.dtsi
@@ -178,7 +178,6 @@
 
 		cpu_port0: port at 6 {
 			reg = <6>;
-			label = "cpu";
 			ethernet = <&gmac0>;
 			phy-mode = "trgmii";
 
diff --git a/target/linux/mediatek/dts/mt7629-iptime-a6004mx.dts b/target/linux/mediatek/dts/mt7629-iptime-a6004mx.dts
index b40ac52848..dc1868a066 100644
--- a/target/linux/mediatek/dts/mt7629-iptime-a6004mx.dts
+++ b/target/linux/mediatek/dts/mt7629-iptime-a6004mx.dts
@@ -161,7 +161,6 @@
 
 				port at 6 {
 					reg = <6>;
-					label = "cpu";
 					ethernet = <&gmac0>;
 					phy-mode = "2500base-x";
 
diff --git a/target/linux/mediatek/dts/mt7986a-bananapi-bpi-r3.dts b/target/linux/mediatek/dts/mt7986a-bananapi-bpi-r3.dts
index 8e47cb8579..4d118b0fbc 100644
--- a/target/linux/mediatek/dts/mt7986a-bananapi-bpi-r3.dts
+++ b/target/linux/mediatek/dts/mt7986a-bananapi-bpi-r3.dts
@@ -223,7 +223,6 @@
 
 		port at 6 {
 			reg = <6>;
-			label = "cpu";
 			ethernet = <&gmac0>;
 			phy-mode = "2500base-x";
 
diff --git a/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000.dtsi b/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000.dtsi
index cd74fbec74..101b81f8a9 100644
--- a/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000.dtsi
+++ b/target/linux/mediatek/dts/mt7986a-xiaomi-redmi-router-ax6000.dtsi
@@ -234,7 +234,6 @@
 
 		port at 6 {
 			reg = <6>;
-			label = "cpu";
 			ethernet = <&gmac0>;
 			phy-mode = "2500base-x";
 
diff --git a/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtsi b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtsi
index 3fbe288dae..b63692c161 100644
--- a/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtsi
+++ b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986a-rfb.dtsi
@@ -350,7 +350,6 @@
 
 		port at 6 {
 			reg = <6>;
-			label = "cpu";
 			ethernet = <&gmac0>;
 			phy-mode = "2500base-x";
 
diff --git a/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts
index 52b6c152fe..85465223cf 100644
--- a/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts
+++ b/target/linux/mediatek/files-5.15/arch/arm64/boot/dts/mediatek/mt7986b-rfb.dts
@@ -139,7 +139,6 @@
 
 				port at 6 {
 					reg = <6>;
-					label = "cpu";
 					ethernet = <&gmac0>;
 					phy-mode = "2500base-x";
 
diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
index 669b67e5a9..1a6594e3cd 100644
--- a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
+++ b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dts
@@ -184,7 +184,6 @@
 
 			switch0port0: port at 0 {
 				reg = <0>;
-				label = "cpu";
 				ethernet = <&eth0>;
 			};
 
diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts
index 72d7267ccd..8d163059a0 100644
--- a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts
+++ b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dts
@@ -175,7 +175,6 @@
 
 			port at 0 {
 				reg = <0>;
-				label = "cpu";
 				ethernet = <&eth0>;
 			};
 
diff --git a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-mochabin.dts b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-mochabin.dts
index c4e11b5049..26804a4875 100644
--- a/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-mochabin.dts
+++ b/target/linux/mvebu/files/arch/arm64/boot/dts/marvell/armada-7040-mochabin.dts
@@ -339,7 +339,6 @@
 
 			port at 5 {
 				reg = <5>;
-				label = "cpu";
 				ethernet = <&cp0_eth1>;
 				phy-mode = "2500base-x";
 				managed = "in-band-status";
diff --git a/target/linux/qoriq/files/arch/powerpc/boot/dts/fsl/watchguard-firebox-m300.dts b/target/linux/qoriq/files/arch/powerpc/boot/dts/fsl/watchguard-firebox-m300.dts
index 15dc5f445e..c611263099 100644
--- a/target/linux/qoriq/files/arch/powerpc/boot/dts/fsl/watchguard-firebox-m300.dts
+++ b/target/linux/qoriq/files/arch/powerpc/boot/dts/fsl/watchguard-firebox-m300.dts
@@ -269,7 +269,6 @@
 				status = "disabled";
 
 				reg = "<5>";
-				label = "cpu";
 				ethernet = <&enet2>;
 				phy-mode = "rgmii-id";
 
@@ -281,7 +280,6 @@
 
 			port at 6 {
 				reg = <6>;
-				label = "cpu";
 				ethernet = <&enet3>;
 				phy-mode = "rgmii-id";
 
diff --git a/target/linux/ramips/dts/mt7621.dtsi b/target/linux/ramips/dts/mt7621.dtsi
index 0eae4bb871..0f513f313c 100644
--- a/target/linux/ramips/dts/mt7621.dtsi
+++ b/target/linux/ramips/dts/mt7621.dtsi
@@ -558,7 +558,6 @@
 
 					port at 6 {
 						reg = <6>;
-						label = "cpu";
 						ethernet = <&gmac0>;
 						phy-mode = "rgmii";
 



From lede-commits at lists.infradead.org  Sun Feb 26 14:44:56 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 26 Feb 2023 17:44:56 -0500
Subject: [openwrt/openwrt]  mvebu: add support for Buffalo LinkStation LS220DE
In-Reply-To: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
References: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
Message-ID: <mailman.19199.1677451506.3064139.lede-commits@lists.infradead.org>

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

commit be0f1c1b268a99ea25c9797a4ed725835ca79fea
Author: Daniel Gonz?lez Cabanelas <dgcbueu at gmail.com>
AuthorDate: Tue Feb 21 00:43:55 2023 +0100

    mvebu: add support for Buffalo LinkStation LS220DE
    
    The Buffalo LinkStation LS220DE is a dual bay NAS, based on Marvell
    Armada 370
    
    Hardware:
       SoC:         Marvell Armada 88F6707
       CPU:         Cortex-A9 800 MHz, 1 core
       Flash 1:     SPI-NOR 1 MiB (U-Boot)
       Flash 2:     NAND 512 MiB (OS)
       RAM:         DDR3 256 MiB
       Ethernet:    1x 1GbE
       USB:         1x 2.0
       SATA:        2x 3Gb/s
       LEDs/Input:  5x / 2x (1x button, 1x slide-switch)
       Fan:         1x casing
    
    Flash instructions, from hard drive:
      1. Get access to the "boot" partition at the hard drive where the stock
         firmware is installed. It can be done with acp-commander or by
         plugging the hard drive to a computer.
      2. Backup the stock uImage:
             mv /boot/uImage.buffalo /boot/uImage.buffalo.bak
      3. Move and rename the Openwrt initramfs image to the boot partition:
             mv openwrt-initramfs-kernel.bin /boot/uImage.buffalo
      4. Power on the Linkstation with the hardrive inside. Now Openwrt will
         boot, but still not installed.
      5. Connect via ssh to OpenWrt:
             ssh root at 192.168.1.1
      6. Rename boot files inside boot partition
             mount -t ext3 /dev/sda1 /mnt
             mv /mnt/uImage.buffalo /mnt/uImage.buffalo.openwrt.bak
             mv /mnt/initrd.buffalo /mnt/initrd.buffalo.bak
      7. Format ubi partitions at the NAND flash ("kernel_ubi" and "ubi"):
             ubiformat /dev/mtd0 -y
             ubidetach -p /dev/mtd1
             ubiformat /dev/mtd1 -y
      8. Flash the sysupgrade image:
             sysupgrade -n openwrt-squashfs-sysupgrade.bin
      9. Wait until it finish, the device will reboot with OpenWrt installed
         on the NAND flash.
    
    Restore the stock firmware:
      1. Take the hard drive used for the installation and restore boot backup
         files to their original names:
             mount -t ext3 /dev/sda1 /mnt
             mv /mnt/uImage.buffalo.bak /mnt/uImage.buffalo
             mv /mnt/initrd.buffalo.bak /mnt/initrd.buffalo
      2. Boot from the hard drive and perform a stock firmware update using
         the Buffalo utility. The NAND will be restored to the original
         state.
    
    Signed-off-by: Daniel Gonz?lez Cabanelas <dgcbueu at gmail.com>
---
 package/boot/uboot-envtools/files/mvebu            |   1 +
 .../cortexa9/base-files/etc/board.d/02_network     |   1 +
 .../cortexa9/base-files/lib/upgrade/platform.sh    |   7 +
 .../arm/boot/dts/armada-370-buffalo-ls220de.dts    | 380 +++++++++++++++++++++
 target/linux/mvebu/image/Makefile                  |  10 +
 target/linux/mvebu/image/cortexa9.mk               |  15 +
 ...er-reset-linkstation-poweroff-add-ls220de.patch |  15 +
 7 files changed, 429 insertions(+)

diff --git a/package/boot/uboot-envtools/files/mvebu b/package/boot/uboot-envtools/files/mvebu
index cc1c648f24..63b5132608 100644
--- a/package/boot/uboot-envtools/files/mvebu
+++ b/package/boot/uboot-envtools/files/mvebu
@@ -13,6 +13,7 @@ touch /etc/config/ubootenv
 board=$(board_name)
 
 case "$board" in
+buffalo,ls220de|\
 buffalo,ls421de)
 	ubootenv_add_uci_config "/dev/mtd3" "0x0" "0x10000"
 	;;
diff --git a/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network b/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network
index c613a3cd60..d2229fe6bf 100644
--- a/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network
+++ b/target/linux/mvebu/cortexa9/base-files/etc/board.d/02_network
@@ -61,6 +61,7 @@ mvebu_setup_macs()
 	local label_mac=""
 
 	case "$board" in
+	buffalo,ls220de|\
 	buffalo,ls421de)
 		lan_mac=$(mtd_get_mac_ascii u-boot-env eth1addr)
 		;;
diff --git a/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh
index 18b978d437..9019c1aeff 100755
--- a/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh
+++ b/target/linux/mvebu/cortexa9/base-files/lib/upgrade/platform.sh
@@ -25,6 +25,13 @@ platform_check_image() {
 
 platform_do_upgrade() {
 	case "$(board_name)" in
+	buffalo,ls220de)
+		# Kernel UBI volume name must be "boot"
+		CI_KERNPART=boot
+		CI_KERN_UBIPART=ubi_kernel
+		CI_ROOT_UBIPART=ubi
+		nand_do_upgrade "$1"
+		;;
 	buffalo,ls421de)
 		nand_do_upgrade "$1"
 		;;
diff --git a/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls220de.dts b/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls220de.dts
new file mode 100644
index 0000000000..3de9ac5473
--- /dev/null
+++ b/target/linux/mvebu/files/arch/arm/boot/dts/armada-370-buffalo-ls220de.dts
@@ -0,0 +1,380 @@
+// SPDX-License-Identifier: (GPL-2.0-or-later OR MIT)
+/*
+ * Device Tree file for Buffalo LinkStation LS220DE
+ *
+ * Copyright (C) 2023 Daniel Gonz?lez Cabanelas <dgcbueu at gmail.com>
+ */
+
+/dts-v1/;
+
+#include "armada-370.dtsi"
+#include "mvebu-linkstation-fan.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/thermal/thermal.h>
+
+/ {
+	model = "Buffalo LinkStation LS220DE";
+	compatible = "buffalo,ls220de", "marvell,armada370", "marvell,armada-370-xp";
+
+	aliases {
+		led-boot = &led_boot;
+		led-failsafe = &led_failsafe;
+		led-running = &led_power;
+		led-upgrade = &led_upgrade;
+	};
+
+	chosen {
+		bootargs = "earlycon";
+		stdout-path = "serial0:115200n8";
+		append-rootblock = "nullparameter="; /* override the bootloader args */
+	};
+
+	memory {
+		device_type = "memory";
+		reg = <0x00000000 0x10000000>; /* 256 MB */
+	};
+
+	soc {
+		ranges = <MBUS_ID(0xf0, 0x01) 0 0xd0000000 0x100000
+			  MBUS_ID(0x01, 0xe0) 0 0xfff00000 0x100000
+			  MBUS_ID(0x09, 0x01) 0 0xf1100000 0x10000>;
+	};
+
+	system_fan: gpio_fan {
+		gpios = <&gpio0 13 GPIO_ACTIVE_HIGH
+			 &gpio0 14 GPIO_ACTIVE_HIGH>;
+		alarm-gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>;
+
+		#cooling-cells = <2>;
+	};
+
+	thermal-zones {
+		hdd-thermal {
+			polling-delay = <20000>;
+			polling-delay-passive = <2000>;
+
+			thermal-sensors = <&hdd0_temp>; /* only one drivetemp sensor is supported */
+
+			trips {
+				hdd_alert1: trip1 {
+					temperature = <34000>;
+					hysteresis = <2000>;
+					type = "active";
+				};
+				hdd_alert2: trip2 {
+					temperature = <40000>;
+					hysteresis = <2000>;
+					type = "active";
+				};
+				hdd_alert3: trip3 {
+					temperature = <45000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+				hdd_hot {
+					temperature = <50000>;
+					hysteresis = <2000>;
+					type = "hot";
+				};
+				hdd_crit {
+					temperature = <60000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+
+			cooling-maps {
+				map1 {
+					trip = <&hdd_alert1>;
+					cooling-device = <&system_fan THERMAL_NO_LIMIT 1>;
+				};
+				map2 {
+					trip = <&hdd_alert2>;
+					cooling-device = <&system_fan 2 2>;
+				};
+				map3 {
+					trip = <&hdd_alert3>;
+					cooling-device = <&system_fan 3 THERMAL_NO_LIMIT>;
+				};
+			};
+		};
+	};
+
+	gpio_keys {
+		compatible = "gpio-keys";
+		pinctrl-0 = <&pmx_buttons>;
+		pinctrl-names = "default";
+
+		power {
+			label = "Power Switch";
+			linux,code = <KEY_POWER>;
+			linux,input-type = <EV_SW>;
+			gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
+		};
+
+		function {
+			label = "Function Button";
+			linux,code = <KEY_CONFIG>;
+			gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	gpio_leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pmx_leds1 &pmx_leds2>;
+
+		indicator_red {
+			function = LED_FUNCTION_INDICATOR;
+			color = <LED_COLOR_ID_RED>;
+			gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
+			panic-indicator;
+		};
+
+		led_power: power_white {
+			label = "white:power";
+			function = LED_FUNCTION_POWER;
+			color = <LED_COLOR_ID_WHITE>;
+			gpios = <&gpio1 22 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
+		};
+
+		led_failsafe: power_red {
+			label = "red:power";
+			function = LED_FUNCTION_POWER;
+			color = <LED_COLOR_ID_RED>;
+			gpios = <&gpio1 23 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_upgrade: power_orange {
+			label = "amber:power";
+			function = LED_FUNCTION_POWER;
+			color = <LED_COLOR_ID_AMBER>;
+			gpios = <&gpio1 25 GPIO_ACTIVE_HIGH>;
+		};
+
+		led_boot: indicator_white {
+			label = "white:indicator";
+			function = LED_FUNCTION_INDICATOR;
+			color = <LED_COLOR_ID_WHITE>;
+			gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>;
+		};
+
+		hdd1_red {
+			function = LED_FUNCTION_DISK;
+			color = <LED_COLOR_ID_RED>;
+			gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "ata1";
+			function-enumerator = <1>;
+		};
+
+		hdd2_red {
+			function = LED_FUNCTION_DISK;
+			color = <LED_COLOR_ID_RED>;
+			gpios = <&gpio1 30 GPIO_ACTIVE_HIGH>;
+			linux,default-trigger = "ata2";
+			function-enumerator = <2>;
+		};
+	};
+
+	regulators {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		pinctrl-0 = <&pmx_power_hdd1 &pmx_power_hdd2>;
+		pinctrl-names = "default";
+
+		sata1_power: regulator at 1 {
+			compatible = "regulator-fixed";
+			reg = <1>;
+			regulator-name = "HDD1";
+			regulator-min-microvolt = <12000000>;
+			regulator-max-microvolt = <12000000>;
+			startup-delay-us = <2000000>;
+			enable-active-high;
+			regulator-always-on;
+			regulator-boot-on;
+			gpio = <&gpio0 8 GPIO_ACTIVE_HIGH>;
+		};
+
+		sata2_power: regulator at 2 {
+			compatible = "regulator-fixed";
+			reg = <2>;
+			regulator-name = "HDD2";
+			regulator-min-microvolt = <12000000>;
+			regulator-max-microvolt = <12000000>;
+			startup-delay-us = <4000000>;
+			enable-active-high;
+			regulator-always-on;
+			regulator-boot-on;
+			gpio = <&gpio0 2 GPIO_ACTIVE_HIGH>;
+		};
+	};
+};
+
+&coherencyfab {
+	broken-idle;
+};
+
+&eth1 {
+	pinctrl-0 = <&ge1_rgmii_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+	phy-handle = <&ethphy0>;
+	phy-connection-type = "rgmii-id";
+};
+
+&mdio {
+	pinctrl-0 = <&mdio_pins>;
+	pinctrl-names = "default";
+
+	ethphy0: ethernet-phy at 0 { /* Marvell 88E1318 */
+		reg = <0>;
+		marvell,reg-init = <0x3 0x10 0xf000 0x091A>, /* LED function */
+				   <0x3 0x11 0x0000 0x4401>, /* LED polarity */
+				   <0x3 0x12 0x0000 0x4905>; /* LED timer */
+		#thermal-sensor-cells = <0>;
+	};
+};
+
+&nand_controller {
+	status = "okay";
+
+	nand at 0 {
+		reg = <0>;
+		label = "pxa3xx_nand-0";
+		nand-rb = <0>;
+		marvell,nand-keep-config;
+		nand-on-flash-bbt;
+		nand-ecc-strength = <4>;
+		nand-ecc-step-size = <512>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				label = "ubi_kernel";
+				reg = <0x00000000 0x02000000>; /* 32 MiB */
+			};
+
+			partition at 2000000 {
+				label = "ubi";
+				reg = <0x02000000 0x1df00000>; /* 479 MiB */
+			};
+		};
+	};
+};
+
+&sata {
+	nr-ports = <2>;
+	status = "okay";
+	#address-cells = <1>;
+	#size-cells = <0>;
+
+	hdd0_temp: sata-port at 0 {
+		reg = <0>;
+		#thermal-sensor-cells = <0>;
+	};
+
+	hdd1_temp: sata-port at 1 {
+		reg = <1>;
+		#thermal-sensor-cells = <0>;
+	};
+};
+
+&spi0 {
+	status = "okay";
+	pinctrl-0 = <&spi0_pins2>;
+	pinctrl-names = "default";
+
+	spi-flash at 0 {
+		compatible = "mxicy,mx25l8005", "jedec,spi-nor";
+		reg = <0>;
+		spi-max-frequency = <50000000>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition at 0 {
+				reg = <0x00000 0xf0000>; /* 960 KiB*/
+				label = "u-boot";
+				read-only;
+			};
+			partition at f0000 {
+				reg = <0xf0000 0x10000>; /* 64 KiB */
+				label = "u-boot-env";
+			};
+		};
+	};
+};
+
+&pmsu {
+	pinctrl-0 = <&pmx_power_cpu>;
+	pinctrl-names = "default";
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&usb0 {
+	status = "okay";
+};
+
+&pinctrl {
+	pmx_power_hdd2: pmx-power-hdd2 {
+		marvell,pins = "mpp2";
+		marvell,function = "gpio";
+	};
+
+	pmx_power_cpu: pmx-power-cpu {
+		marvell,pins = "mpp4";
+		marvell,function = "vdd";
+	};
+
+	pmx_power_hdd1: pmx-power-hdd1 {
+		marvell,pins = "mpp8";
+		marvell,function = "gpio";
+	};
+
+	pmx_fan_lock: pmx-fan-lock {
+		marvell,pins = "mpp10";
+		marvell,function = "gpio";
+	};
+
+	pmx_hdd_present: pmx-hdd-present {
+		marvell,pins = "mpp11", "mpp12";
+		marvell,function = "gpio";
+	};
+
+	pmx_fan_high: pmx-fan-high {
+		marvell,pins = "mpp13";
+		marvell,function = "gpio";
+	};
+
+	pmx_fan_low: pmx-fan-low {
+		marvell,pins = "mpp14";
+		marvell,function = "gpio";
+	};
+
+	pmx_buttons: pmx-buttons {
+		marvell,pins = "mpp15", "mpp16";
+		marvell,function = "gpio";
+	};
+
+	pmx_leds1: pmx-leds {
+		marvell,pins = "mpp7", "mpp54", "mpp59", "mpp61";
+		marvell,function = "gpo";
+	};
+
+	pmx_leds2: pmx-leds {
+		marvell,pins = "mpp55", "mpp57", "mpp62";
+		marvell,function = "gpio";
+	};
+};
diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile
index b0498d34c9..57129d2dcb 100644
--- a/target/linux/mvebu/image/Makefile
+++ b/target/linux/mvebu/image/Makefile
@@ -53,6 +53,16 @@ define Build/buffalo-kernel-jffs2
 	rm -rf $(KDIR)/kernel_jffs2 $@.fakerd
 endef
 
+define Build/buffalo-kernel-ubifs
+	rm -rf $@-ubidir
+	mkdir -p $@-ubidir
+	mv $@ $@-ubidir/uImage.buffalo
+	touch $@
+	$(call Build/append-uImage-fakehdr, ramdisk)
+	mv $@ $@-ubidir/initrd.buffalo
+	$(STAGING_DIR_HOST)/bin/mkfs.ubifs $(KERNEL_UBIFS_OPTS) -r $@-ubidir $@
+endef
+
 # Some info about Ctera firmware:
 # 1. It's simple tar file (GNU standard), but it must have ".firm" suffix.
 # 2. It contains two images: kernel and romdisk. Both are required.
diff --git a/target/linux/mvebu/image/cortexa9.mk b/target/linux/mvebu/image/cortexa9.mk
index aed1d47646..56381ab5f8 100644
--- a/target/linux/mvebu/image/cortexa9.mk
+++ b/target/linux/mvebu/image/cortexa9.mk
@@ -14,6 +14,21 @@ define Device/kernel-size-migration
 	Upgrade via sysupgrade mechanism is not possible, so new installation via factory style image is required.
 endef
 
+define Device/buffalo_ls220de
+  $(Device/NAND-128K)
+  DEVICE_VENDOR := Buffalo
+  DEVICE_MODEL := LinkStation LS220DE
+  KERNEL_UBIFS_OPTS = -m $$(PAGESIZE) -e 124KiB -c 172 -x none
+  KERNEL := kernel-bin | append-dtb | uImage none | buffalo-kernel-ubifs
+  KERNEL_INITRAMFS := kernel-bin | append-dtb | uImage none
+  DEVICE_DTS := armada-370-buffalo-ls220de
+  DEVICE_PACKAGES :=  \
+    kmod-hwmon-gpiofan kmod-hwmon-drivetemp kmod-linkstation-poweroff \
+    kmod-md-mod kmod-md-raid0 kmod-md-raid1 kmod-md-raid10 kmod-fs-xfs \
+    mdadm mkf2fs e2fsprogs partx-utils
+endef
+TARGET_DEVICES += buffalo_ls220de
+
 define Device/buffalo_ls421de
   $(Device/NAND-128K)
   DEVICE_VENDOR := Buffalo
diff --git a/target/linux/mvebu/patches-5.15/105-power-reset-linkstation-poweroff-add-ls220de.patch b/target/linux/mvebu/patches-5.15/105-power-reset-linkstation-poweroff-add-ls220de.patch
new file mode 100644
index 0000000000..3223861234
--- /dev/null
+++ b/target/linux/mvebu/patches-5.15/105-power-reset-linkstation-poweroff-add-ls220de.patch
@@ -0,0 +1,15 @@
+--- a/drivers/power/reset/linkstation-poweroff.c
++++ b/drivers/power/reset/linkstation-poweroff.c
+@@ -142,6 +142,12 @@ static void linkstation_poweroff(void)
+ }
+ 
+ static const struct of_device_id ls_poweroff_of_match[] = {
++	{ .compatible = "buffalo,ls220d",
++	  .data = &linkstation_power_off_cfg,
++	},
++	{ .compatible = "buffalo,ls220de",
++	  .data = &linkstation_power_off_cfg,
++	},
+ 	{ .compatible = "buffalo,ls421d",
+ 	  .data = &linkstation_power_off_cfg,
+ 	},



From lede-commits at lists.infradead.org  Sun Feb 26 14:44:59 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 26 Feb 2023 17:44:59 -0500
Subject: [openwrt/openwrt]  sunxi: enable CONFIG_NVMEM_SYSFS
In-Reply-To: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
References: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
Message-ID: <mailman.19200.1677451506.3064139.lede-commits@lists.infradead.org>

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

commit 1e138ca70381c71915b7fb918d4294dcb7ba0cb2
Author: Jan-Niklas Burfeind <git at aiyionpri.me>
AuthorDate: Fri Dec 30 03:41:17 2022 +0100

    sunxi: enable CONFIG_NVMEM_SYSFS
    
    in both the stable and the testing kernel
    
    h2+/h3/h5 devices have a Secure ID that can be read from
    `/sys/bus/nvmem/devices/sunxi-sid0/nvmem`.
    Enabling CONFIG_NVMEM_SYSFS grants sysfs access from userspace.
    
    Signed-off-by: Jan-Niklas Burfeind <git at aiyionpri.me>
---
 target/linux/sunxi/config-5.15           | 1 +
 target/linux/sunxi/cortexa53/config-5.15 | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/sunxi/config-5.15 b/target/linux/sunxi/config-5.15
index c7dbc5a9f1..17c4d910c8 100644
--- a/target/linux/sunxi/config-5.15
+++ b/target/linux/sunxi/config-5.15
@@ -307,6 +307,7 @@ CONFIG_NO_HZ_IDLE=y
 CONFIG_NR_CPUS=8
 CONFIG_NVMEM=y
 CONFIG_NVMEM_SUNXI_SID=y
+CONFIG_NVMEM_SYSFS=y
 CONFIG_OF=y
 CONFIG_OF_ADDRESS=y
 CONFIG_OF_EARLY_FLATTREE=y
diff --git a/target/linux/sunxi/cortexa53/config-5.15 b/target/linux/sunxi/cortexa53/config-5.15
index b93abf0765..85ace5d928 100644
--- a/target/linux/sunxi/cortexa53/config-5.15
+++ b/target/linux/sunxi/cortexa53/config-5.15
@@ -52,7 +52,6 @@ CONFIG_MUSB_PIO_ONLY=y
 CONFIG_NEED_SG_DMA_LENGTH=y
 CONFIG_NOP_USB_XCEIV=y
 CONFIG_NO_IOPORT_MAP=y
-CONFIG_NVMEM_SYSFS=y
 CONFIG_PARTITION_PERCPU=y
 CONFIG_PHY_SUN50I_USB3=y
 CONFIG_PINCTRL_SUN50I_A100=y



From lede-commits at lists.infradead.org  Sun Feb 26 14:44:58 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 26 Feb 2023 17:44:58 -0500
Subject: [openwrt/openwrt]  grub2: re-add test module
In-Reply-To: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
References: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
Message-ID: <mailman.19201.1677451506.3064139.lede-commits@lists.infradead.org>

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

commit bdd78897c33b25a4954f6e41e26f57bab5284129
Author: Tomasz Maciej Nowak <tmn505 at gmail.com>
AuthorDate: Mon Jan 23 14:44:50 2023 +0100

    grub2: re-add test module
    
    It seems more hardware needs early load of firmware when initialised
    to work properly (at least Intel hardware). One of previous case is CPU
    microcode, which this series[1] tried to change. The second one is Intel
    graphics IC, which needs firmware for controlling DMC circuit (switch
    conncted display to DC6 power state). As it stands, the i915 module is
    built-in and it seems the hardware can't cope with firmware loaded
    later from rootfs, it needs to be supplied when the module is loaded.
    Unfortunately we need bootloader to handle the load of firmware in this
    case, but as previously mentioned series[1], there was an error when
    initrd was hardcoded, instead of testing existence for it and then
    loading. To remedy this in later the 55b808e0c4be ('x86: image: add test
    module to bootloader') was commited. Which was later accidentally
    dropped when grub2 image creation was moved to packages. Therefore bring
    back test module, so we can test for cases of existing firmware in
    grub.cfg.
    
    1. https://patchwork.ozlabs.org/project/openwrt/cover/20181120162044.16371-1-tomek_n at o2.pl
    
    Fixes: 5a5df62d95f5 ("x86/grub2: move grub2 image creation to package")
    Signed-off-by: Tomasz Maciej Nowak <tmn505 at gmail.com>
---
 package/boot/grub2/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/boot/grub2/Makefile b/package/boot/grub2/Makefile
index c4cc43de2e..7d6cfd5395 100644
--- a/package/boot/grub2/Makefile
+++ b/package/boot/grub2/Makefile
@@ -122,14 +122,14 @@ define Package/grub2/install
 		-O i386-pc \
 		-c $(PKG_BUILD_DIR)/grub-early.cfg \
 		-o $(STAGING_DIR_IMAGE)/grub2/gpt-core.img \
-		at_keyboard biosdisk boot chain configfile fat linux ls part_gpt reboot search serial vga
+		at_keyboard biosdisk boot chain configfile fat linux ls part_gpt reboot search serial test vga
 	$(STAGING_DIR_HOST)/bin/grub-mkimage \
 		-d $(PKG_BUILD_DIR)/grub-core \
 		-p /boot/grub \
 		-O i386-pc \
 		-c ./files/grub-early.cfg \
 		-o $(STAGING_DIR_IMAGE)/grub2/generic-core.img \
-		at_keyboard biosdisk boot chain configfile ext2 linux ls part_msdos reboot search serial vga
+		at_keyboard biosdisk boot chain configfile ext2 linux ls part_msdos reboot search serial test vga
 	$(STAGING_DIR_HOST)/bin/grub-mkimage \
 		-d $(PKG_BUILD_DIR)/grub-core \
 		-p /boot/grub \
@@ -154,7 +154,7 @@ define Package/grub2-efi/install
 		-O $(CONFIG_ARCH)-efi \
 		-c $(PKG_BUILD_DIR)/grub-early.cfg \
 		-o $(STAGING_DIR_IMAGE)/grub2/boot$(if $(CONFIG_x86_64),x64,ia32).efi \
-		at_keyboard boot chain configfile fat linux ls part_gpt reboot serial efi_gop efi_uga
+		at_keyboard boot chain configfile fat linux ls part_gpt reboot serial test efi_gop efi_uga
 	$(STAGING_DIR_HOST)/bin/grub-mkimage \
 		-d $(PKG_BUILD_DIR)/grub-core \
 		-p /boot/grub \



From lede-commits at lists.infradead.org  Sun Feb 26 14:45:04 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 26 Feb 2023 17:45:04 -0500
Subject: [openwrt/openwrt]  ath79: mikrotik: stack ar9344 devices to single
 dtsi
In-Reply-To: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
References: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
Message-ID: <mailman.19202.1677451510.3064139.lede-commits@lists.infradead.org>

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

commit 173d8642532125f7ba24ef6b6de34e6ca1a0935c
Author: Tomasz Maciej Nowak <tmn505 at gmail.com>
AuthorDate: Wed Aug 24 18:05:57 2022 +0200

    ath79: mikrotik: stack ar9344 devices to single dtsi
    
    Most of boards from MikroTik with AR9344 SoC (supported and
    un-supported) replicate the same schematic, so stack common device nodes
    to a single dtsi.
    
    ar9344_mikrotik_routerboard-16m-nor.dtsi:
    - remove include paragraph and wmac node, make it single nor flash node
      for others dts to include
    
    ar9344_mikrotik_routerboard-lhg-5nd.dts:
    - move all of the nodes to new file ar9344_mikrotik_routerboard.dtsi
      and leave only power, user and lan LEDs which differ from sxt-5nd-r2
      and other yet unsupported devices
    
    ar9344_mikrotik_routerboard-sxt-5n.dtsi:
    - remove, it made no sense to keep it, as only
      ar9344_mikrotik_routerboard-sxt-5nd-r2.dts included this file and
      added only compatible and model
    
    ar9344_mikrotik_routerboard-sxt-5nd-r2.dts:
    - include ar9344_mikrotik_routerboard.dtsi
    - add nand gpio activating node, beeper, additional LEDs and flash chips
      which previously have been in ar9344_mikrotik_routerboard-sxt-5n.dtsi
    
    ar9344_mikrotik_routerboard.dtsi:
    - inherited most of the content from ar9344_mikrotik_routerboard-lhg-5nd.dts
      except three LEDs
    - add wmac node, removed from ar9344_mikrotik_routerboard-16m-nor.dtsi
    
    Signed-off-by: Tomasz Maciej Nowak <tmn505 at gmail.com>
---
 .../dts/ar9344_mikrotik_routerboard-16m-nor.dtsi   |   8 -
 .../dts/ar9344_mikrotik_routerboard-lhg-5nd.dts    |  90 ++--------
 .../dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi    | 185 ---------------------
 .../dts/ar9344_mikrotik_routerboard-sxt-5nd-r2.dts | 108 +++++++++++-
 ...hg-5nd.dts => ar9344_mikrotik_routerboard.dtsi} |  49 ++----
 5 files changed, 138 insertions(+), 302 deletions(-)

diff --git a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-16m-nor.dtsi b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-16m-nor.dtsi
index 7cc4bb689c..b915dd5a72 100644
--- a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-16m-nor.dtsi
+++ b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-16m-nor.dtsi
@@ -1,7 +1,5 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "ar9344.dtsi"
-
 &spi {
 	status = "okay";
 
@@ -55,9 +53,3 @@
 		};
 	};
 };
-
-&wmac {
-	status = "okay";
-
-	qca,no-eeprom;
-};
diff --git a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-lhg-5nd.dts b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-lhg-5nd.dts
index 194a789fb2..b6de8c4b7b 100644
--- a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-lhg-5nd.dts
+++ b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-lhg-5nd.dts
@@ -1,91 +1,27 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
+#include "ar9344_mikrotik_routerboard.dtsi"
 #include "ar9344_mikrotik_routerboard-16m-nor.dtsi"
 
-#include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
-
 / {
 	compatible = "mikrotik,routerboard-lhg-5nd", "qca,ar9344";
 	model = "MikroTik RouterBOARD LHG 5nD";
+};
 
-	aliases {
-		led-boot = &led_user;
-		led-failsafe = &led_user;
-		led-running = &led_user;
-		led-upgrade = &led_user;
-	};
-
-	leds {
-		compatible = "gpio-leds";
-
-		power {
-			label = "blue:power";
-			gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
-			default-state = "on";
-		};
-
-		rssilow {
-			label = "green:rssilow";
-			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
-		};
-
-		rssimediumlow {
-			label = "green:rssimediumlow";
-			gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
-		};
-
-		rssimedium {
-			label = "green:rssimedium";
-			gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
-		};
-
-		rssimediumhigh {
-			label = "green:rssimediumhigh";
-			gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
-		};
-
-		rssihigh {
-			label = "green:rssihigh";
-			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
-		};
-
-		led_user: user {
-			label = "white:user";
-			gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
-		};
-
-		lan {
-			label = "green:lan";
-			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
-		};
+&leds {
+	power {
+		label = "blue:power";
+		gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
+		default-state = "on";
 	};
 
-	keys {
-		compatible = "gpio-keys";
-
-		reset {
-			label = "reset";
-			linux,code = <KEY_RESTART>;
-			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
-			debounce-interval = <60>;
-		};
+	led_user: user {
+		label = "white:user";
+		gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
 	};
-};
-
-&eth0 {
-	status = "okay";
 
-	phy-handle = <&swphy0>;
-
-	gmac-config {
-		device = <&gmac>;
-		switch-phy-swap = <1>;
+	lan {
+		label = "green:lan";
+		gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
 	};
 };
-
-&eth1 {
-	status = "okay";
-
-	compatible = "syscon", "simple-mfd";
-};
diff --git a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi
deleted file mode 100644
index 6cf84c98b3..0000000000
--- a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5n.dtsi
+++ /dev/null
@@ -1,185 +0,0 @@
-// 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>
-
-/ {
-	compatible = "mikrotik,routerboard-sxt-5n", "qca,ar9344";
-	model = "MikroTik SXT 5N platform";
-
-	aliases {
-		led-boot = &led_user;
-		led-failsafe = &led_user;
-		led-running = &led_user;
-		led-upgrade = &led_user;
-	};
-
-	leds {
-		compatible = "gpio-leds";
-
-		power {
-			label = "green:power";
-			gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
-			default-state = "on";
-		};
-
-		rssilow {
-			label = "green:rssilow";
-			gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
-		};
-
-		rssimediumlow {
-			label = "green:rssimediumlow";
-			gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
-		};
-
-		rssimedium {
-			label = "green:rssimedium";
-			gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
-		};
-
-		rssimediumhigh {
-			label = "green:rssimediumhigh";
-			gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
-		};
-
-		rssihigh {
-			label = "green:rssihigh";
-			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
-		};
-
-		led_user: user {
-			label = "green:user";
-			gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
-		};
-	};
-
-	keys {
-		compatible = "gpio-keys";
-
-		reset {
-			label = "reset";
-			linux,code = <KEY_RESTART>;
-			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
-			debounce-interval = <60>;
-		};
-	};
-
-	gpio-export {
-		compatible = "gpio-export";
-
-		gpio_nand_power {
-			gpio-export,name = "sxt5n:power:nand";
-			gpio-export,output = <0>;
-			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
-		};
-	};
-
-	beeper {
-		compatible = "gpio-beeper";
-		gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
-	};
-};
-
-&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 = "RouterBoot";
-				reg = <0x0 0x20000>;
-				compatible = "mikrotik,routerboot-partitions";
-				#address-cells = <1>;
-				#size-cells = <1>;
-
-				partition at 0 {
-					label = "bootloader1";
-					reg = <0x0 0x0>;
-					read-only;
-				};
-
-				hard_config {
-					read-only;
-				};
-
-				bios {
-					size = <0x1000>;
-					read-only;
-				};
-
-				soft_config {
-				};
-
-				partition at 10000 {
-					label = "bootloader2";
-					reg = <0x10000 0x10000>;
-					read-only;
-				};
-			};
-		};
-	};
-};
-
-&nand {
-	status = "okay";
-
-	nand-ecc-mode = "soft";
-	qca,nand-swap-dma;
-	qca,nand-scan-fixup;
-
-	partitions {
-		compatible = "fixed-partitions";
-		#address-cells = <1>;
-		#size-cells = <1>;
-
-		partition at 0 {
-			label = "booter";
-			reg = <0x0000000 0x0040000>;
-			read-only;
-		};
-
-		partition at 40000 {
-			label = "kernel";
-			reg = <0x0040000 0x03c0000>;
-		};
-
-		partition at 400000 {
-			label = "ubi";
-			reg = <0x0400000 0x7c00000>;
-		};
-	};
-};
-
-&eth0 {
-	status = "okay";
-
-	phy-handle = <&swphy0>;
-
-	gmac-config {
-		device = <&gmac>;
-		switch-phy-swap = <1>;
-	};
-};
-
-&eth1 {
-	status = "okay";
-
-	compatible = "syscon", "simple-mfd";
-};
-
-&wmac {
-	status = "okay";
-
-	qca,no-eeprom;
-};
diff --git a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5nd-r2.dts b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5nd-r2.dts
index 3d0b941c24..c8b1183d70 100644
--- a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5nd-r2.dts
+++ b/target/linux/ath79/dts/ar9344_mikrotik_routerboard-sxt-5nd-r2.dts
@@ -1,8 +1,114 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "ar9344_mikrotik_routerboard-sxt-5n.dtsi"
+#include "ar9344_mikrotik_routerboard.dtsi"
 
 / {
 	compatible = "mikrotik,routerboard-sxt-5nd-r2", "qca,ar9344";
 	model = "MikroTik RouterBOARD SXT 5nD r2 (SXT Lite5)";
+
+	gpio-export {
+		compatible = "gpio-export";
+
+		gpio_nand_power {
+			gpio-export,name = "sxt5n:power:nand";
+			gpio-export,output = <0>;
+			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	beeper {
+		compatible = "gpio-beeper";
+		gpios = <&gpio 19 GPIO_ACTIVE_HIGH>;
+	};
+};
+
+&leds {
+	power {
+		label = "green:power";
+		gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
+		default-state = "on";
+	};
+
+	led_user: user {
+		label = "green:user";
+		gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
+	};
+};
+
+&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 = "RouterBoot";
+				reg = <0x0 0x20000>;
+				compatible = "mikrotik,routerboot-partitions";
+				#address-cells = <1>;
+				#size-cells = <1>;
+
+				partition at 0 {
+					label = "bootloader1";
+					reg = <0x0 0x0>;
+					read-only;
+				};
+
+				hard_config {
+					read-only;
+				};
+
+				bios {
+					size = <0x1000>;
+					read-only;
+				};
+
+				soft_config {
+				};
+
+				partition at 10000 {
+					label = "bootloader2";
+					reg = <0x10000 0x10000>;
+					read-only;
+				};
+			};
+		};
+	};
+};
+
+&nand {
+	status = "okay";
+
+	nand-ecc-mode = "soft";
+	qca,nand-swap-dma;
+	qca,nand-scan-fixup;
+
+	partitions {
+		compatible = "fixed-partitions";
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition at 0 {
+			label = "booter";
+			reg = <0x0000000 0x0040000>;
+			read-only;
+		};
+
+		partition at 40000 {
+			label = "kernel";
+			reg = <0x0040000 0x03c0000>;
+		};
+
+		partition at 400000 {
+			label = "ubi";
+			reg = <0x0400000 0x7c00000>;
+		};
+	};
 };
diff --git a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-lhg-5nd.dts b/target/linux/ath79/dts/ar9344_mikrotik_routerboard.dtsi
similarity index 72%
copy from target/linux/ath79/dts/ar9344_mikrotik_routerboard-lhg-5nd.dts
copy to target/linux/ath79/dts/ar9344_mikrotik_routerboard.dtsi
index 194a789fb2..10233e3d4e 100644
--- a/target/linux/ath79/dts/ar9344_mikrotik_routerboard-lhg-5nd.dts
+++ b/target/linux/ath79/dts/ar9344_mikrotik_routerboard.dtsi
@@ -1,14 +1,11 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
 
-#include "ar9344_mikrotik_routerboard-16m-nor.dtsi"
+#include "ar9344.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/input/input.h>
 
 / {
-	compatible = "mikrotik,routerboard-lhg-5nd", "qca,ar9344";
-	model = "MikroTik RouterBOARD LHG 5nD";
-
 	aliases {
 		led-boot = &led_user;
 		led-failsafe = &led_user;
@@ -16,14 +13,19 @@
 		led-upgrade = &led_user;
 	};
 
-	leds {
-		compatible = "gpio-leds";
+	keys {
+		compatible = "gpio-keys";
 
-		power {
-			label = "blue:power";
-			gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
-			default-state = "on";
+		reset {
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+			debounce-interval = <60>;
 		};
+	};
+
+	leds: leds {
+		compatible = "gpio-leds";
 
 		rssilow {
 			label = "green:rssilow";
@@ -49,27 +51,6 @@
 			label = "green:rssihigh";
 			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
 		};
-
-		led_user: user {
-			label = "white:user";
-			gpios = <&gpio 20 GPIO_ACTIVE_LOW>;
-		};
-
-		lan {
-			label = "green:lan";
-			gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
-		};
-	};
-
-	keys {
-		compatible = "gpio-keys";
-
-		reset {
-			label = "reset";
-			linux,code = <KEY_RESTART>;
-			gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
-			debounce-interval = <60>;
-		};
 	};
 };
 
@@ -89,3 +70,9 @@
 
 	compatible = "syscon", "simple-mfd";
 };
+
+&wmac {
+	status = "okay";
+
+	qca,no-eeprom;
+};



From lede-commits at lists.infradead.org  Sun Feb 26 14:45:38 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 26 Feb 2023 17:45:38 -0500
Subject: [openwrt/openwrt]  mac80211: fix mesh path discovery based on unicast
 packets
In-Reply-To: <167745153699.1084154.6978913655132380002@git-01.infra.openwrt.org>
References: <167745153699.1084154.6978913655132380002@git-01.infra.openwrt.org>
Message-ID: <mailman.19205.1677451541.3064139.lede-commits@lists.infradead.org>

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

commit 1272cb0a0dec0917f20adc79b8146e7ef19d3d95
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Feb 26 20:35:40 2023 +0100

    mac80211: fix mesh path discovery based on unicast packets
    
    If a packet has reached its intended destination, it was bumped to the code
    that accepts it, without first checking if a mesh_path needs to be created
    based on the discovered source.
    Fix this by moving the destination address check further down
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 ...11-fix-mesh-path-discovery-based-on-unica.patch | 52 ++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/package/kernel/mac80211/patches/subsys/322-wifi-mac80211-fix-mesh-path-discovery-based-on-unica.patch b/package/kernel/mac80211/patches/subsys/322-wifi-mac80211-fix-mesh-path-discovery-based-on-unica.patch
new file mode 100644
index 0000000000..292a89ef92
--- /dev/null
+++ b/package/kernel/mac80211/patches/subsys/322-wifi-mac80211-fix-mesh-path-discovery-based-on-unica.patch
@@ -0,0 +1,52 @@
+From: Felix Fietkau <nbd at nbd.name>
+Date: Sun, 26 Feb 2023 20:30:20 +0100
+Subject: [PATCH] wifi: mac80211: fix mesh path discovery based on unicast
+ packets
+
+If a packet has reached its intended destination, it was bumped to the code
+that accepts it, without first checking if a mesh_path needs to be created
+based on the discovered source.
+Fix this by moving the destination address check further down
+
+Fixes: 986e43b19ae9 ("wifi: mac80211: fix receiving A-MSDU frames on mesh interfaces")
+Signed-off-by: Felix Fietkau <nbd at nbd.name>
+---
+
+--- a/net/mac80211/rx.c
++++ b/net/mac80211/rx.c
+@@ -2824,17 +2824,6 @@ ieee80211_rx_mesh_data(struct ieee80211_
+ 	    mesh_rmc_check(sdata, eth->h_source, mesh_hdr))
+ 		return RX_DROP_MONITOR;
+ 
+-	/* Frame has reached destination.  Don't forward */
+-	if (ether_addr_equal(sdata->vif.addr, eth->h_dest))
+-		goto rx_accept;
+-
+-	if (!ifmsh->mshcfg.dot11MeshForwarding) {
+-		if (is_multicast_ether_addr(eth->h_dest))
+-			goto rx_accept;
+-
+-		return RX_DROP_MONITOR;
+-	}
+-
+ 	/* forward packet */
+ 	if (sdata->crypto_tx_tailroom_needed_cnt)
+ 		tailroom = IEEE80211_ENCRYPT_TAILROOM;
+@@ -2881,6 +2870,17 @@ ieee80211_rx_mesh_data(struct ieee80211_
+ 		rcu_read_unlock();
+ 	}
+ 
++	/* Frame has reached destination.  Don't forward */
++	if (ether_addr_equal(sdata->vif.addr, eth->h_dest))
++		goto rx_accept;
++
++	if (!ifmsh->mshcfg.dot11MeshForwarding) {
++		if (is_multicast_ether_addr(eth->h_dest))
++			goto rx_accept;
++
++		return RX_DROP_MONITOR;
++	}
++
+ 	skb_set_queue_mapping(skb, ieee802_1d_to_ac[skb->priority]);
+ 
+ 	if (!multicast &&



From lede-commits at lists.infradead.org  Sun Feb 26 14:45:37 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 26 Feb 2023 17:45:37 -0500
Subject: [openwrt/openwrt]  mac80211: rework mesh fast xmit implementation
In-Reply-To: <167745153699.1084154.6978913655132380002@git-01.infra.openwrt.org>
References: <167745153699.1084154.6978913655132380002@git-01.infra.openwrt.org>
Message-ID: <mailman.19206.1677451550.3064139.lede-commits@lists.infradead.org>

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

commit 2f96580c5282cd138d2bb858f7f27f539c8a63e1
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Feb 26 13:36:58 2023 +0100

    mac80211: rework mesh fast xmit implementation
    
    Refactor in order to make use of generic fast xmit functions
    Fix issues with mesh SA/DA addressing
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../319-wifi-mac80211-mesh-fast-xmit-support.patch | 791 +++++++++++----------
 ...11-use-mesh-header-cache-to-speed-up-mesh.patch | 140 +++-
 .../subsys/321-mac80211-fix-mesh-forwarding.patch  |   4 +-
 .../500-mac80211_configure_antenna_gain.patch      |   2 +-
 4 files changed, 506 insertions(+), 431 deletions(-)

diff --git a/package/kernel/mac80211/patches/subsys/319-wifi-mac80211-mesh-fast-xmit-support.patch b/package/kernel/mac80211/patches/subsys/319-wifi-mac80211-mesh-fast-xmit-support.patch
index f18e1bb377..b802960103 100644
--- a/package/kernel/mac80211/patches/subsys/319-wifi-mac80211-mesh-fast-xmit-support.patch
+++ b/package/kernel/mac80211/patches/subsys/319-wifi-mac80211-mesh-fast-xmit-support.patch
@@ -1,33 +1,32 @@
-From: Sriram R <quic_srirrama at quicinc.com>
-Date: Thu, 18 Aug 2022 12:35:42 +0530
+From: Felix Fietkau <nbd at nbd.name>
+Date: Sun, 26 Feb 2023 13:53:08 +0100
 Subject: [PATCH] wifi: mac80211: mesh fast xmit support
 
-Currently fast xmit is supported in AP, STA and other device types where
-the destination doesn't change for the lifetime of its association by
-caching the static parts of the header that can be reused directly for
-every Tx such as addresses and updates only mutable header fields such as
-PN.
-This technique is not directly applicable for a Mesh device type due
-to the dynamic nature of the topology and protocol. The header is built
-based on the destination mesh device which is proxying a certain external
-device and based on the Mesh destination the next hop changes.
-And the RA/A1 which is the next hop for reaching the destination can
-vary during runtime as per the best route based on airtime.  To accommodate
-these changes and to come up with a solution to avoid overhead during header
-generation, the headers comprising the MAC, Mesh and LLC part are cached
-whenever data for a certain external destination is sent.
-This cached header is reused every time a data is sent to that external
-destination.
+Previously, fast xmit only worked on interface types where initially a
+sta lookup is performed, and a cached header can be attached to the sta,
+requiring only some fields to be updated at runtime.
+
+This technique is not directly applicable for a mesh device type due
+to the dynamic nature of the topology and protocol. There are more
+addresses that need to be filled, and there is an extra header with a
+dynamic length based on the addressing mode.
+
+Change the code to cache entries contain a copy of the mesh subframe header +
+bridge tunnel header, as well as an embedded struct ieee80211_fast_tx, which
+contains the information for building the 802.11 header.
+
+Add a mesh specific early fast xmit call, which looks up a cached entry and
+adds only the mesh subframe header, before passing it over to the generic
+fast xmit code.
 
 To ensure the changes in network are reflected in these cached headers,
 flush affected cached entries on path changes, as well as other conditions
 that currently trigger a fast xmit check in other modes (key changes etc.)
 
-In order to keep the cache small, use a short timeout for expiring cache
-entries.
+This code is loosely based on a previous implementation by:
+Sriram R <quic_srirrama at quicinc.com>
 
-Co-developed-by: Felix Fietkau <nbd at nbd.name>
-Signed-off-by: Sriram R <quic_srirrama at quicinc.com>
+Signed-off-by: Ryder Lee <ryder.lee at mediatek.com>
 Signed-off-by: Felix Fietkau <nbd at nbd.name>
 ---
 
@@ -37,24 +36,23 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  extern const struct cfg80211_ops mac80211_config_ops;
  
  struct ieee80211_local;
-+struct mhdr_cache_entry;
++struct ieee80211_mesh_fast_tx;
  
  /* Maximum number of broadcast/multicast frames to buffer when some of the
   * associated stations are using power saving. */
-@@ -655,6 +656,20 @@ struct mesh_table {
+@@ -655,6 +656,19 @@ struct mesh_table {
  	atomic_t entries;		/* Up to MAX_MESH_NEIGHBOURS */
  };
  
 +/**
-+ * struct mesh_hdr_cache - mesh fast xmit header cache
++ * struct mesh_tx_cache - mesh fast xmit header cache
 + *
-+ * @rhead: hash table containing struct mhdr_cache_entry, using skb DA as key
-+ * @walk_head: linked list containing all mhdr_cache_entry objects
-+ * @walk_lock: lock protecting walk_head and rhead
-+ * @enabled: indicates if header cache is initialized
++ * @rht: hash table containing struct ieee80211_mesh_fast_tx, using skb DA as key
++ * @walk_head: linked list containing all ieee80211_mesh_fast_tx objects
++ * @walk_lock: lock protecting walk_head and rht
 + */
-+struct mesh_hdr_cache {
-+	struct rhashtable rhead;
++struct mesh_tx_cache {
++	struct rhashtable rht;
 +	struct hlist_head walk_head;
 +	spinlock_t walk_lock;
 +};
@@ -62,102 +60,209 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  struct ieee80211_if_mesh {
  	struct timer_list housekeeping_timer;
  	struct timer_list mesh_path_timer;
-@@ -733,6 +748,7 @@ struct ieee80211_if_mesh {
+@@ -733,6 +747,7 @@ struct ieee80211_if_mesh {
  	struct mesh_table mpp_paths; /* Store paths for MPP&MAP */
  	int mesh_paths_generation;
  	int mpp_paths_generation;
-+	struct mesh_hdr_cache hdr_cache;
++	struct mesh_tx_cache tx_cache;
  };
  
  #ifdef CPTCFG_MAC80211_MESH
-@@ -1998,6 +2014,9 @@ int ieee80211_tx_control_port(struct wip
+@@ -1998,6 +2013,11 @@ int ieee80211_tx_control_port(struct wip
  			      int link_id, u64 *cookie);
  int ieee80211_probe_mesh_link(struct wiphy *wiphy, struct net_device *dev,
  			      const u8 *buf, size_t len);
-+void __ieee80211_mesh_xmit_fast(struct ieee80211_sub_if_data *sdata,
-+				struct mhdr_cache_entry *entry,
-+				struct sk_buff *skb);
++void __ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
++			   struct sta_info *sta,
++			   struct ieee80211_fast_tx *fast_tx,
++			   struct sk_buff *skb, bool ampdu,
++			   const u8 *da, const u8 *sa);
  
  /* HT */
  void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
 --- a/net/mac80211/mesh.c
 +++ b/net/mac80211/mesh.c
-@@ -780,6 +780,8 @@ static void ieee80211_mesh_housekeeping(
+@@ -10,6 +10,7 @@
+ #include <asm/unaligned.h>
+ #include "ieee80211_i.h"
+ #include "mesh.h"
++#include "wme.h"
+ #include "driver-ops.h"
+ 
+ static int mesh_allocated;
+@@ -698,6 +699,102 @@ ieee80211_mesh_update_bss_params(struct
+ 			__le32_to_cpu(he_oper->he_oper_params);
+ }
+ 
++bool ieee80211_mesh_xmit_fast(struct ieee80211_sub_if_data *sdata,
++			      struct sk_buff *skb, u32 ctrl_flags)
++{
++	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
++	struct ieee80211_mesh_fast_tx *entry;
++	struct ieee80211s_hdr *meshhdr;
++	u8 sa[ETH_ALEN] __aligned(2);
++	struct tid_ampdu_tx *tid_tx;
++	struct sta_info *sta;
++	bool copy_sa = false;
++	u16 ethertype;
++	u8 tid;
++
++	if (ctrl_flags & IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP)
++		return false;
++
++	if (ifmsh->mshcfg.dot11MeshNolearn)
++		return false;
++
++	/* Add support for these cases later */
++	if (ifmsh->ps_peers_light_sleep || ifmsh->ps_peers_deep_sleep)
++		return false;
++
++	if (is_multicast_ether_addr(skb->data))
++		return false;
++
++	ethertype = (skb->data[12] << 8) | skb->data[13];
++	if (ethertype < ETH_P_802_3_MIN)
++		return false;
++
++	if (skb->sk && skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS)
++		return false;
++
++	if (skb->ip_summed == CHECKSUM_PARTIAL) {
++		skb_set_transport_header(skb, skb_checksum_start_offset(skb));
++		if (skb_checksum_help(skb))
++			return false;
++	}
++
++	entry = mesh_fast_tx_get(sdata, skb->data);
++	if (!entry)
++		return false;
++
++	if (skb_headroom(skb) + 2 * ETH_ALEN < entry->hdrlen +
++					       entry->fast_tx.hdr_len)
++		return false;
++
++	sta = rcu_dereference(entry->mpath->next_hop);
++	if (!sta)
++		return false;
++
++	tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
++	tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]);
++	if (tid_tx) {
++		if (!test_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state))
++			return false;
++		if (tid_tx->timeout)
++			tid_tx->last_tx = jiffies;
++	}
++
++	/* If the skb is shared we need to obtain our own copy */
++	if (skb_shared(skb)) {
++		struct sk_buff *oskb = skb;
++
++		skb = skb_clone(skb, GFP_ATOMIC);
++		if (!skb)
++			return false;
++
++		kfree_skb(oskb);
++	}
++
++	skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, sta, skb));
++
++	meshhdr = (struct ieee80211s_hdr *)entry->hdr;
++	if ((meshhdr->flags & MESH_FLAGS_AE) == MESH_FLAGS_AE_A5_A6) {
++		/* preserve SA from eth header for 6-addr frames */
++		ether_addr_copy(sa, skb->data + ETH_ALEN);
++		copy_sa = true;
++	}
++
++	memcpy(skb_push(skb, entry->hdrlen - 2 * ETH_ALEN), entry->hdr,
++	       entry->hdrlen);
++
++	meshhdr = (struct ieee80211s_hdr *)skb->data;
++	put_unaligned_le32(atomic_inc_return(&sdata->u.mesh.mesh_seqnum),
++			   &meshhdr->seqnum);
++	meshhdr->ttl = sdata->u.mesh.mshcfg.dot11MeshTTL;
++	if (copy_sa)
++	    ether_addr_copy(meshhdr->eaddr2, sa);
++
++	__ieee80211_xmit_fast(sdata, sta, &entry->fast_tx, skb, tid_tx,
++			      entry->mpath->dst, sdata->vif.addr);
++
++	return true;
++}
++
+ /**
+  * ieee80211_fill_mesh_addresses - fill addresses of a locally originated mesh frame
+  * @hdr:	802.11 frame header
+@@ -780,6 +877,8 @@ static void ieee80211_mesh_housekeeping(
  	changed = mesh_accept_plinks_update(sdata);
  	ieee80211_mbss_info_change_notify(sdata, changed);
  
-+	mesh_hdr_cache_gc(sdata);
++	mesh_fast_tx_gc(sdata);
 +
  	mod_timer(&ifmsh->housekeeping_timer,
  		  round_jiffies(jiffies +
  				IEEE80211_MESH_HOUSEKEEPING_INTERVAL));
 --- a/net/mac80211/mesh.h
 +++ b/net/mac80211/mesh.h
-@@ -122,11 +122,49 @@ struct mesh_path {
+@@ -122,11 +122,41 @@ struct mesh_path {
  	u8 rann_snd_addr[ETH_ALEN];
  	u32 rann_metric;
  	unsigned long last_preq_to_root;
-+	unsigned long fast_xmit_check;
++	unsigned long fast_tx_check;
  	bool is_root;
  	bool is_gate;
  	u32 path_change_count;
  };
  
-+#define MESH_HEADER_CACHE_MAX_SIZE		512
-+#define MESH_HEADER_CACHE_THRESHOLD_SIZE	384
-+#define MESH_HEADER_CACHE_TIMEOUT		8000 /* msecs */
-+#define MESH_HEADER_MAX_LEN			68   /* mac+mesh+rfc1042 hdr */
++#define MESH_FAST_TX_CACHE_MAX_SIZE		512
++#define MESH_FAST_TX_CACHE_THRESHOLD_SIZE	384
++#define MESH_FAST_TX_CACHE_TIMEOUT		8000 /* msecs */
 +
 +/**
-+ * struct mhdr_cache_entry - Cached Mesh header entry
-+ * @addr_key: The Ethernet DA which is the key for this entry
-+ * @hdr: The cached header
-+ * @machdr_len: Total length of the mac header
-+ * @hdrlen: Length of this header entry
-+ * @key: Key corresponding to the nexthop stored in the header
-+ * @pn_offs: Offset to PN which is updated for every xmit
-+ * @band:  band used for tx
-+ * @walk_list: list containing all the cached header entries
++ * struct ieee80211_mesh_fast_tx - cached mesh fast tx entry
 + * @rhash: rhashtable pointer
-+ * @mpath: The Mesh path corresponding to the Mesh DA
-+ * @mppath: The MPP entry corresponding to this DA
++ * @addr_key: The Ethernet DA which is the key for this entry
++ * @fast_tx: base fast_tx data
++ * @hdr: cached mesh and rfc1042 headers
++ * @hdrlen: length of mesh + rfc1042
++ * @walk_list: list containing all the fast tx entries
++ * @mpath: mesh path corresponding to the Mesh DA
++ * @mppath: MPP entry corresponding to this DA
 + * @timestamp: Last used time of this entry
-+ * @rcu: rcu to free this entry
-+ * @path_change_count: Stored path change value corresponding to the mpath
 + */
-+struct mhdr_cache_entry {
++struct ieee80211_mesh_fast_tx {
++	struct rhash_head rhash;
 +	u8 addr_key[ETH_ALEN] __aligned(2);
-+	u8 hdr[MESH_HEADER_MAX_LEN];
-+	u16 machdr_len;
++
++	struct ieee80211_fast_tx fast_tx;
++	u8 hdr[sizeof(struct ieee80211s_hdr) + sizeof(rfc1042_header)];
 +	u16 hdrlen;
-+	u8 pn_offs;
-+	u8 band;
-+	struct ieee80211_key *key;
-+	struct hlist_node walk_list;
-+	struct rhash_head rhash;
++
 +	struct mesh_path *mpath, *mppath;
++	struct hlist_node walk_list;
 +	unsigned long timestamp;
-+	struct rcu_head rcu;
 +};
 +
  /* Recent multicast cache */
  /* RMC_BUCKETS must be a power of 2, maximum 256 */
  #define RMC_BUCKETS		256
-@@ -298,6 +336,18 @@ void mesh_path_discard_frame(struct ieee
+@@ -298,6 +328,20 @@ void mesh_path_discard_frame(struct ieee
  void mesh_path_tx_root_frame(struct ieee80211_sub_if_data *sdata);
  
  bool mesh_action_is_path_sel(struct ieee80211_mgmt *mgmt);
-+struct mhdr_cache_entry *
-+mesh_get_cached_hdr(struct ieee80211_sub_if_data *sdata, const u8 *addr);
-+void mesh_cache_hdr(struct ieee80211_sub_if_data *sdata,
-+		    struct sk_buff *skb, struct mesh_path *mpath);
-+void mesh_hdr_cache_gc(struct ieee80211_sub_if_data *sdata);
-+void mesh_hdr_cache_flush_mpp(struct ieee80211_sub_if_data *sdata,
-+			      const u8 *addr);
-+void mesh_hdr_cache_flush_mpath(struct mesh_path *mpath);
-+void mesh_hdr_cache_flush_sta(struct ieee80211_sub_if_data *sdata,
-+			      struct sta_info *sta);
-+void mesh_refresh_path(struct ieee80211_sub_if_data *sdata,
++struct ieee80211_mesh_fast_tx *
++mesh_fast_tx_get(struct ieee80211_sub_if_data *sdata, const u8 *addr);
++bool ieee80211_mesh_xmit_fast(struct ieee80211_sub_if_data *sdata,
++			      struct sk_buff *skb, u32 ctrl_flags);
++void mesh_fast_tx_cache(struct ieee80211_sub_if_data *sdata,
++			struct sk_buff *skb, struct mesh_path *mpath);
++void mesh_fast_tx_gc(struct ieee80211_sub_if_data *sdata);
++void mesh_fast_tx_flush_addr(struct ieee80211_sub_if_data *sdata,
++			     const u8 *addr);
++void mesh_fast_tx_flush_mpath(struct mesh_path *mpath);
++void mesh_fast_tx_flush_sta(struct ieee80211_sub_if_data *sdata,
++			    struct sta_info *sta);
++void mesh_path_refresh(struct ieee80211_sub_if_data *sdata,
 +		       struct mesh_path *mpath, const u8 *addr);
  
  #ifdef CPTCFG_MAC80211_MESH
@@ -189,7 +294,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  			mesh_path_activate(mpath);
  			spin_unlock_bh(&mpath->state_lock);
 +			if (flush_mpath)
-+				mesh_hdr_cache_flush_mpath(mpath);
++				mesh_fast_tx_flush_mpath(mpath);
  			ewma_mesh_fail_avg_init(&sta->mesh->fail_avg);
  			/* init it at a low value - 0 start is tricky */
  			ewma_mesh_fail_avg_add(&sta->mesh->fail_avg, 1);
@@ -210,24 +315,15 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  			mesh_path_activate(mpath);
  			spin_unlock_bh(&mpath->state_lock);
 +			if (flush_mpath)
-+				mesh_hdr_cache_flush_mpath(mpath);
++				mesh_fast_tx_flush_mpath(mpath);
  			ewma_mesh_fail_avg_init(&sta->mesh->fail_avg);
  			/* init it at a low value - 0 start is tricky */
  			ewma_mesh_fail_avg_add(&sta->mesh->fail_avg, 1);
-@@ -977,7 +986,7 @@ free:
-  * Locking: the function must be called from within a rcu read lock block.
-  *
-  */
--static void mesh_queue_preq(struct mesh_path *mpath, u8 flags)
-+void mesh_queue_preq(struct mesh_path *mpath, u8 flags)
- {
- 	struct ieee80211_sub_if_data *sdata = mpath->sdata;
- 	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
 @@ -1215,6 +1224,20 @@ static int mesh_nexthop_lookup_nolearn(s
  	return 0;
  }
  
-+void mesh_refresh_path(struct ieee80211_sub_if_data *sdata,
++void mesh_path_refresh(struct ieee80211_sub_if_data *sdata,
 +		       struct mesh_path *mpath, const u8 *addr)
 +{
 +	if (mpath->flags & (MESH_PATH_REQ_QUEUED | MESH_PATH_FIXED |
@@ -244,7 +340,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  /**
   * mesh_nexthop_lookup - put the appropriate next hop on a mesh frame. Calling
   * this function is considered "using" the associated mpath, so preempt a path
-@@ -1242,19 +1265,18 @@ int mesh_nexthop_lookup(struct ieee80211
+@@ -1242,19 +1265,15 @@ int mesh_nexthop_lookup(struct ieee80211
  	if (!mpath || !(mpath->flags & MESH_PATH_ACTIVE))
  		return -ENOENT;
  
@@ -255,18 +351,15 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 -	    !(mpath->flags & MESH_PATH_RESOLVING) &&
 -	    !(mpath->flags & MESH_PATH_FIXED))
 -		mesh_queue_preq(mpath, PREQ_Q_F_START | PREQ_Q_F_REFRESH);
-+	mesh_refresh_path(sdata, mpath, hdr->addr4);
++	mesh_path_refresh(sdata, mpath, hdr->addr4);
  
  	next_hop = rcu_dereference(mpath->next_hop);
  	if (next_hop) {
  		memcpy(hdr->addr1, next_hop->sta.addr, ETH_ALEN);
  		memcpy(hdr->addr2, sdata->vif.addr, ETH_ALEN);
  		ieee80211_mps_set_frame_flags(sdata, next_hop, hdr);
-+		/* Cache the whole header so as to use next time rather than resolving
-+		 * and building it every time
-+		 */
 +		if (ieee80211_hw_check(&sdata->local->hw, SUPPORT_FAST_XMIT))
-+			mesh_cache_hdr(sdata, skb, mpath);
++			mesh_fast_tx_cache(sdata, skb, mpath);
  		return 0;
  	}
  
@@ -284,37 +377,37 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	.hashfn = mesh_table_hash,
  };
  
-+static const struct rhashtable_params mesh_hdr_rht_params = {
++static const struct rhashtable_params fast_tx_rht_params = {
 +	.nelem_hint = 10,
 +	.automatic_shrinking = true,
-+	.key_len =  ETH_ALEN,
-+	.key_offset = offsetof(struct mhdr_cache_entry, addr_key),
-+	.head_offset = offsetof(struct mhdr_cache_entry, rhash),
++	.key_len = ETH_ALEN,
++	.key_offset = offsetof(struct ieee80211_mesh_fast_tx, addr_key),
++	.head_offset = offsetof(struct ieee80211_mesh_fast_tx, rhash),
 +	.hashfn = mesh_table_hash,
 +};
 +
-+static void __mesh_hdr_cache_entry_free(void *ptr, void *tblptr)
++static void __mesh_fast_tx_entry_free(void *ptr, void *tblptr)
 +{
-+	struct mhdr_cache_entry *mhdr = ptr;
++	struct ieee80211_mesh_fast_tx *entry = ptr;
 +
-+	kfree_rcu(mhdr, rcu);
++	kfree_rcu(entry, fast_tx.rcu_head);
 +}
 +
-+static void mesh_hdr_cache_deinit(struct ieee80211_sub_if_data *sdata)
++static void mesh_fast_tx_deinit(struct ieee80211_sub_if_data *sdata)
 +{
-+	struct mesh_hdr_cache *cache;
++	struct mesh_tx_cache *cache;
 +
-+	cache = &sdata->u.mesh.hdr_cache;
-+	rhashtable_free_and_destroy(&cache->rhead,
-+				    __mesh_hdr_cache_entry_free, NULL);
++	cache = &sdata->u.mesh.tx_cache;
++	rhashtable_free_and_destroy(&cache->rht,
++				    __mesh_fast_tx_entry_free, NULL);
 +}
 +
-+static void mesh_hdr_cache_init(struct ieee80211_sub_if_data *sdata)
++static void mesh_fast_tx_init(struct ieee80211_sub_if_data *sdata)
 +{
-+	struct mesh_hdr_cache *cache;
++	struct mesh_tx_cache *cache;
 +
-+	cache = &sdata->u.mesh.hdr_cache;
-+	rhashtable_init(&cache->rhead, &mesh_hdr_rht_params);
++	cache = &sdata->u.mesh.tx_cache;
++	rhashtable_init(&cache->rht, &fast_tx_rht_params);
 +	INIT_HLIST_HEAD(&cache->walk_head);
 +	spin_lock_init(&cache->walk_lock);
 +}
@@ -322,40 +415,40 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  static inline bool mpath_expired(struct mesh_path *mpath)
  {
  	return (mpath->flags & MESH_PATH_ACTIVE) &&
-@@ -381,6 +417,254 @@ struct mesh_path *mesh_path_new(struct i
+@@ -381,6 +417,243 @@ struct mesh_path *mesh_path_new(struct i
  	return new_mpath;
  }
  
-+static void mesh_hdr_cache_entry_free(struct mesh_hdr_cache *cache,
-+				      struct mhdr_cache_entry *entry)
++static void mesh_fast_tx_entry_free(struct mesh_tx_cache *cache,
++				    struct ieee80211_mesh_fast_tx *entry)
 +{
 +	hlist_del_rcu(&entry->walk_list);
-+	rhashtable_remove_fast(&cache->rhead, &entry->rhash, mesh_hdr_rht_params);
-+	kfree_rcu(entry, rcu);
++	rhashtable_remove_fast(&cache->rht, &entry->rhash, fast_tx_rht_params);
++	kfree_rcu(entry, fast_tx.rcu_head);
 +}
 +
-+struct mhdr_cache_entry *
-+mesh_get_cached_hdr(struct ieee80211_sub_if_data *sdata, const u8 *addr)
++struct ieee80211_mesh_fast_tx *
++mesh_fast_tx_get(struct ieee80211_sub_if_data *sdata, const u8 *addr)
 +{
-+	struct mhdr_cache_entry *entry;
-+	struct mesh_hdr_cache *cache;
++	struct ieee80211_mesh_fast_tx *entry;
++	struct mesh_tx_cache *cache;
 +
-+	cache = &sdata->u.mesh.hdr_cache;
-+	entry = rhashtable_lookup(&cache->rhead, addr, mesh_hdr_rht_params);
++	cache = &sdata->u.mesh.tx_cache;
++	entry = rhashtable_lookup(&cache->rht, addr, fast_tx_rht_params);
 +	if (!entry)
 +		return NULL;
 +
 +	if (!(entry->mpath->flags & MESH_PATH_ACTIVE) ||
 +	    mpath_expired(entry->mpath)) {
 +		spin_lock_bh(&cache->walk_lock);
-+		entry = rhashtable_lookup(&cache->rhead, addr, mesh_hdr_rht_params);
++		entry = rhashtable_lookup(&cache->rht, addr, fast_tx_rht_params);
 +		if (entry)
-+		    mesh_hdr_cache_entry_free(cache, entry);
++		    mesh_fast_tx_entry_free(cache, entry);
 +		spin_unlock_bh(&cache->walk_lock);
 +		return NULL;
 +	}
 +
-+	mesh_refresh_path(sdata, entry->mpath, NULL);
++	mesh_path_refresh(sdata, entry->mpath, NULL);
 +	if (entry->mppath)
 +		entry->mppath->exp_time = jiffies;
 +	entry->timestamp = jiffies;
@@ -363,33 +456,30 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +	return entry;
 +}
 +
-+void mesh_cache_hdr(struct ieee80211_sub_if_data *sdata,
-+		    struct sk_buff *skb, struct mesh_path *mpath)
++void mesh_fast_tx_cache(struct ieee80211_sub_if_data *sdata,
++			struct sk_buff *skb, struct mesh_path *mpath)
 +{
 +	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
 +	struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
-+	struct mesh_hdr_cache *cache;
-+	struct mhdr_cache_entry *mhdr, *old_mhdr;
++	struct ieee80211_mesh_fast_tx *entry, *prev;
++	struct ieee80211_mesh_fast_tx build = {};
 +	struct ieee80211s_hdr *meshhdr;
-+	struct sta_info *sta;
++	struct mesh_tx_cache *cache;
 +	struct ieee80211_key *key;
 +	struct mesh_path *mppath;
-+	u16 meshhdr_len;
-+	u8 pn_offs = 0;
-+	int hdrlen;
-+
-+	if (sdata->noack_map)
-+		return;
++	struct sta_info *sta;
++	u8 *qc;
 +
-+	if (!ieee80211_is_data_qos(hdr->frame_control))
++	if (sdata->noack_map ||
++	    !ieee80211_is_data_qos(hdr->frame_control))
 +		return;
 +
-+	hdrlen = ieee80211_hdrlen(hdr->frame_control);
-+	meshhdr = (struct ieee80211s_hdr *)(skb->data + hdrlen);
-+	meshhdr_len = ieee80211_get_mesh_hdrlen(meshhdr);
++	build.fast_tx.hdr_len = ieee80211_hdrlen(hdr->frame_control);
++	meshhdr = (struct ieee80211s_hdr *)(skb->data + build.fast_tx.hdr_len);
++	build.hdrlen = ieee80211_get_mesh_hdrlen(meshhdr);
 +
-+	cache = &sdata->u.mesh.hdr_cache;
-+	if (atomic_read(&cache->rhead.nelems) >= MESH_HEADER_CACHE_MAX_SIZE)
++	cache = &sdata->u.mesh.tx_cache;
++	if (atomic_read(&cache->rht.nelems) >= MESH_FAST_TX_CACHE_MAX_SIZE)
 +		return;
 +
 +	sta = rcu_dereference(mpath->next_hop);
@@ -401,6 +491,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +		mppath = mpp_path_lookup(sdata, meshhdr->eaddr1);
 +		if (!mppath)
 +			return;
++		build.mppath = mppath;
 +	} else if (ieee80211_has_a4(hdr->frame_control)) {
 +		mppath = mpath;
 +	} else {
@@ -408,10 +499,10 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +	}
 +
 +	/* rate limit, in case fast xmit can't be enabled */
-+	if (mppath->fast_xmit_check == jiffies)
++	if (mppath->fast_tx_check == jiffies)
 +		return;
 +
-+	mppath->fast_xmit_check = jiffies;
++	mppath->fast_tx_check = jiffies;
 +
 +	/*
 +	 * Same use of the sta lock as in ieee80211_check_fast_xmit, in order
@@ -421,6 +512,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +	key = rcu_access_pointer(sta->ptk[sta->ptk_idx]);
 +	if (!key)
 +		key = rcu_access_pointer(sdata->default_unicast_key);
++	build.fast_tx.key = key;
 +
 +	if (key) {
 +		bool gen_iv, iv_spc;
@@ -436,60 +528,50 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +		case WLAN_CIPHER_SUITE_CCMP:
 +		case WLAN_CIPHER_SUITE_CCMP_256:
 +			if (gen_iv)
-+				pn_offs = hdrlen;
++				build.fast_tx.pn_offs = build.fast_tx.hdr_len;
 +			if (gen_iv || iv_spc)
-+				hdrlen += IEEE80211_CCMP_HDR_LEN;
++				build.fast_tx.hdr_len += IEEE80211_CCMP_HDR_LEN;
 +			break;
 +		case WLAN_CIPHER_SUITE_GCMP:
 +		case WLAN_CIPHER_SUITE_GCMP_256:
 +			if (gen_iv)
-+				pn_offs = hdrlen;
++				build.fast_tx.pn_offs = build.fast_tx.hdr_len;
 +			if (gen_iv || iv_spc)
-+				hdrlen += IEEE80211_GCMP_HDR_LEN;
++				build.fast_tx.hdr_len += IEEE80211_GCMP_HDR_LEN;
 +			break;
 +		default:
 +			goto unlock_sta;
 +		}
 +	}
 +
-+	if (WARN_ON_ONCE(hdrlen + meshhdr_len + sizeof(rfc1042_header) >
-+			 MESH_HEADER_MAX_LEN))
-+		goto unlock_sta;
-+
-+	mhdr = kzalloc(sizeof(*mhdr), GFP_ATOMIC);
-+	if (!mhdr)
-+		goto unlock_sta;
++	memcpy(build.addr_key, mppath->dst, ETH_ALEN);
++	build.timestamp = jiffies;
++	build.fast_tx.band = info->band;
++	build.fast_tx.da_offs = offsetof(struct ieee80211_hdr, addr3);
++	build.fast_tx.sa_offs = offsetof(struct ieee80211_hdr, addr4);
++	build.mpath = mpath;
++	memcpy(build.hdr, meshhdr, build.hdrlen);
++	memcpy(build.hdr + build.hdrlen, rfc1042_header, sizeof(rfc1042_header));
++	build.hdrlen += sizeof(rfc1042_header);
++	memcpy(build.fast_tx.hdr, hdr, build.fast_tx.hdr_len);
++
++	hdr = (struct ieee80211_hdr *)build.fast_tx.hdr;
++	if (build.fast_tx.key)
++		hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PROTECTED);
 +
-+	memcpy(mhdr->addr_key, mppath->dst, ETH_ALEN);
-+	mhdr->machdr_len = hdrlen;
-+	mhdr->hdrlen = mhdr->machdr_len + meshhdr_len + sizeof(rfc1042_header);
-+	mhdr->mpath = mpath;
-+	if (meshhdr->flags & MESH_FLAGS_AE)
-+		mhdr->mppath = mppath;
-+	mhdr->key = key;
-+	mhdr->timestamp = jiffies;
-+	mhdr->band = info->band;
-+	mhdr->pn_offs = pn_offs;
-+
-+	if (pn_offs) {
-+		memcpy(mhdr->hdr, skb->data, pn_offs);
-+		memcpy(mhdr->hdr + mhdr->machdr_len, skb->data + pn_offs,
-+		       mhdr->hdrlen - mhdr->machdr_len);
-+	} else {
-+		memcpy(mhdr->hdr, skb->data, mhdr->hdrlen);
-+	}
++	qc = ieee80211_get_qos_ctl(hdr);
++	qc[1] |= IEEE80211_QOS_CTL_MESH_CONTROL_PRESENT >> 8;
 +
-+	if (key) {
-+		hdr = (struct ieee80211_hdr *)mhdr->hdr;
-+		hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PROTECTED);
-+	}
++	entry = kmemdup(&build, sizeof(build), GFP_ATOMIC);
++	if (!entry)
++		goto unlock_sta;
 +
 +	spin_lock_bh(&cache->walk_lock);
-+	old_mhdr = rhashtable_lookup_get_insert_fast(&cache->rhead,
-+						     &mhdr->rhash,
-+						     mesh_hdr_rht_params);
-+	if (unlikely(IS_ERR(old_mhdr))) {
-+		kfree(mhdr);
++	prev = rhashtable_lookup_get_insert_fast(&cache->rht,
++						 &entry->rhash,
++						 fast_tx_rht_params);
++	if (unlikely(IS_ERR(prev))) {
++		kfree(entry);
 +		goto unlock_cache;
 +	}
 +
@@ -497,14 +579,14 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +	 * replace any previous entry in the hash table, in case we're
 +	 * replacing it with a different type (e.g. mpath -> mpp)
 +	 */
-+	if (unlikely(old_mhdr)) {
-+		rhashtable_replace_fast(&cache->rhead, &old_mhdr->rhash,
-+					&mhdr->rhash, mesh_hdr_rht_params);
-+		hlist_del_rcu(&old_mhdr->walk_list);
-+		kfree_rcu(old_mhdr, rcu);
++	if (unlikely(prev)) {
++		rhashtable_replace_fast(&cache->rht, &prev->rhash,
++					&entry->rhash, fast_tx_rht_params);
++		hlist_del_rcu(&prev->walk_list);
++		kfree_rcu(prev, fast_tx.rcu_head);
 +	}
 +
-+	hlist_add_head(&mhdr->walk_list, &cache->walk_head);
++	hlist_add_head(&entry->walk_list, &cache->walk_head);
 +
 +unlock_cache:
 +	spin_unlock_bh(&cache->walk_lock);
@@ -512,112 +594,112 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +	spin_unlock_bh(&sta->lock);
 +}
 +
-+void mesh_hdr_cache_gc(struct ieee80211_sub_if_data *sdata)
++void mesh_fast_tx_gc(struct ieee80211_sub_if_data *sdata)
 +{
-+	unsigned long timeout = msecs_to_jiffies(MESH_HEADER_CACHE_TIMEOUT);
-+	struct mesh_hdr_cache *cache;
-+	struct mhdr_cache_entry *entry;
++	unsigned long timeout = msecs_to_jiffies(MESH_FAST_TX_CACHE_TIMEOUT);
++	struct mesh_tx_cache *cache;
++	struct ieee80211_mesh_fast_tx *entry;
 +	struct hlist_node *n;
 +
-+	cache = &sdata->u.mesh.hdr_cache;
-+	if (atomic_read(&cache->rhead.nelems) < MESH_HEADER_CACHE_THRESHOLD_SIZE)
++	cache = &sdata->u.mesh.tx_cache;
++	if (atomic_read(&cache->rht.nelems) < MESH_FAST_TX_CACHE_THRESHOLD_SIZE)
 +		return;
 +
 +	spin_lock_bh(&cache->walk_lock);
 +	hlist_for_each_entry_safe(entry, n, &cache->walk_head, walk_list)
 +		if (!time_is_after_jiffies(entry->timestamp + timeout))
-+			mesh_hdr_cache_entry_free(cache, entry);
++			mesh_fast_tx_entry_free(cache, entry);
 +	spin_unlock_bh(&cache->walk_lock);
 +}
 +
-+void mesh_hdr_cache_flush_mpath(struct mesh_path *mpath)
++void mesh_fast_tx_flush_mpath(struct mesh_path *mpath)
 +{
 +	struct ieee80211_sub_if_data *sdata = mpath->sdata;
-+	struct mesh_hdr_cache *cache = &sdata->u.mesh.hdr_cache;
-+	struct mhdr_cache_entry *entry;
++	struct mesh_tx_cache *cache = &sdata->u.mesh.tx_cache;
++	struct ieee80211_mesh_fast_tx *entry;
 +	struct hlist_node *n;
 +
-+	cache = &sdata->u.mesh.hdr_cache;
++	cache = &sdata->u.mesh.tx_cache;
 +	spin_lock_bh(&cache->walk_lock);
 +	hlist_for_each_entry_safe(entry, n, &cache->walk_head, walk_list)
 +		if (entry->mpath == mpath)
-+			mesh_hdr_cache_entry_free(cache, entry);
++			mesh_fast_tx_entry_free(cache, entry);
 +	spin_unlock_bh(&cache->walk_lock);
 +}
 +
-+void mesh_hdr_cache_flush_sta(struct ieee80211_sub_if_data *sdata,
-+			      struct sta_info *sta)
++void mesh_fast_tx_flush_sta(struct ieee80211_sub_if_data *sdata,
++			    struct sta_info *sta)
 +{
-+	struct mesh_hdr_cache *cache = &sdata->u.mesh.hdr_cache;
-+	struct mhdr_cache_entry *entry;
++	struct mesh_tx_cache *cache = &sdata->u.mesh.tx_cache;
++	struct ieee80211_mesh_fast_tx *entry;
 +	struct hlist_node *n;
 +
-+	cache = &sdata->u.mesh.hdr_cache;
++	cache = &sdata->u.mesh.tx_cache;
 +	spin_lock_bh(&cache->walk_lock);
 +	hlist_for_each_entry_safe(entry, n, &cache->walk_head, walk_list)
 +		if (rcu_access_pointer(entry->mpath->next_hop) == sta)
-+			mesh_hdr_cache_entry_free(cache, entry);
++			mesh_fast_tx_entry_free(cache, entry);
 +	spin_unlock_bh(&cache->walk_lock);
 +}
 +
-+void mesh_hdr_cache_flush_mpp(struct ieee80211_sub_if_data *sdata,
-+			      const u8 *addr)
++void mesh_fast_tx_flush_addr(struct ieee80211_sub_if_data *sdata,
++			     const u8 *addr)
 +{
-+	struct mesh_hdr_cache *cache = &sdata->u.mesh.hdr_cache;
-+	struct mhdr_cache_entry *entry;
++	struct mesh_tx_cache *cache = &sdata->u.mesh.tx_cache;
++	struct ieee80211_mesh_fast_tx *entry;
 +
-+	cache = &sdata->u.mesh.hdr_cache;
++	cache = &sdata->u.mesh.tx_cache;
 +	spin_lock_bh(&cache->walk_lock);
-+	entry = rhashtable_lookup(&cache->rhead, addr, mesh_hdr_rht_params);
++	entry = rhashtable_lookup(&cache->rht, addr, fast_tx_rht_params);
 +	if (entry)
-+		mesh_hdr_cache_entry_free(cache, entry);
++		mesh_fast_tx_entry_free(cache, entry);
 +	spin_unlock_bh(&cache->walk_lock);
 +}
 +
  /**
   * mesh_path_add - allocate and add a new path to the mesh path table
   * @dst: destination address of the path (ETH_ALEN length)
-@@ -464,6 +748,8 @@ int mpp_path_add(struct ieee80211_sub_if
+@@ -464,6 +737,8 @@ int mpp_path_add(struct ieee80211_sub_if
  
  	if (ret)
  		kfree(new_mpath);
 +	else
-+		mesh_hdr_cache_flush_mpp(sdata, dst);
++		mesh_fast_tx_flush_addr(sdata, dst);
  
  	sdata->u.mesh.mpp_paths_generation++;
  	return ret;
-@@ -523,6 +809,10 @@ static void __mesh_path_del(struct mesh_
+@@ -523,6 +798,10 @@ static void __mesh_path_del(struct mesh_
  {
  	hlist_del_rcu(&mpath->walk_list);
  	rhashtable_remove_fast(&tbl->rhead, &mpath->rhash, mesh_rht_params);
 +	if (tbl == &mpath->sdata->u.mesh.mpp_paths)
-+		mesh_hdr_cache_flush_mpp(mpath->sdata, mpath->dst);
++		mesh_fast_tx_flush_addr(mpath->sdata, mpath->dst);
 +	else
-+		mesh_hdr_cache_flush_mpath(mpath);
++		mesh_fast_tx_flush_mpath(mpath);
  	mesh_path_free_rcu(tbl, mpath);
  }
  
-@@ -747,6 +1037,7 @@ void mesh_path_fix_nexthop(struct mesh_p
+@@ -747,6 +1026,7 @@ void mesh_path_fix_nexthop(struct mesh_p
  	mpath->exp_time = 0;
  	mpath->flags = MESH_PATH_FIXED | MESH_PATH_SN_VALID;
  	mesh_path_activate(mpath);
-+	mesh_hdr_cache_flush_mpath(mpath);
++	mesh_fast_tx_flush_mpath(mpath);
  	spin_unlock_bh(&mpath->state_lock);
  	ewma_mesh_fail_avg_init(&next_hop->mesh->fail_avg);
  	/* init it at a low value - 0 start is tricky */
-@@ -758,6 +1049,7 @@ void mesh_pathtbl_init(struct ieee80211_
+@@ -758,6 +1038,7 @@ void mesh_pathtbl_init(struct ieee80211_
  {
  	mesh_table_init(&sdata->u.mesh.mesh_paths);
  	mesh_table_init(&sdata->u.mesh.mpp_paths);
-+	mesh_hdr_cache_init(sdata);
++	mesh_fast_tx_init(sdata);
  }
  
  static
-@@ -785,6 +1077,7 @@ void mesh_path_expire(struct ieee80211_s
+@@ -785,6 +1066,7 @@ void mesh_path_expire(struct ieee80211_s
  
  void mesh_pathtbl_unregister(struct ieee80211_sub_if_data *sdata)
  {
-+	mesh_hdr_cache_deinit(sdata);
++	mesh_fast_tx_deinit(sdata);
  	mesh_table_free(&sdata->u.mesh.mesh_paths);
  	mesh_table_free(&sdata->u.mesh.mpp_paths);
  }
@@ -646,7 +728,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +
 +		/* flush fast xmit cache if the address path changed */
 +		if (update)
-+			mesh_hdr_cache_flush_mpp(sdata, proxied_addr);
++			mesh_fast_tx_flush_addr(sdata, proxied_addr);
 +
  		rcu_read_unlock();
  	}
@@ -658,175 +740,105 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  		return;
  
 +	if (ieee80211_vif_is_mesh(&sdata->vif))
-+		mesh_hdr_cache_flush_sta(sdata, sta);
++		mesh_fast_tx_flush_sta(sdata, sta);
 +
  	/* Locking here protects both the pointer itself, and against concurrent
  	 * invocations winning data access races to, e.g., the key pointer that
  	 * is used.
-@@ -3723,6 +3726,162 @@ free:
- 	kfree_skb(skb);
- }
+@@ -3402,6 +3405,9 @@ static bool ieee80211_amsdu_aggregate(st
+ 	if (sdata->vif.offload_flags & IEEE80211_OFFLOAD_ENCAP_ENABLED)
+ 		return false;
  
-+void __ieee80211_mesh_xmit_fast(struct ieee80211_sub_if_data *sdata,
-+				struct mhdr_cache_entry *entry,
-+				struct sk_buff *skb)
-+{
-+	struct ieee80211_local *local = sdata->local;
-+	struct ieee80211_tx_data tx = {};
-+	struct ieee80211_tx_info *info;
-+	struct tid_ampdu_tx *tid_tx;
-+	struct ieee80211_key *key;
-+	struct ieee80211_hdr *hdr;
-+	struct mesh_path *mpath;
-+	ieee80211_tx_result r;
-+	struct sta_info *sta;
-+	u8 tid;
-+
-+	if (!IS_ENABLED(CPTCFG_MAC80211_MESH))
-+		return;
-+
-+	info = IEEE80211_SKB_CB(skb);
-+	memset(info, 0, sizeof(*info));
-+	info->band = entry->band;
-+	info->control.vif = &sdata->vif;
-+	info->flags = IEEE80211_TX_CTL_FIRST_FRAGMENT |
-+		      IEEE80211_TX_CTL_DONTFRAG;
-+
-+	info->control.flags = IEEE80211_TX_CTRL_FAST_XMIT;
-+
-+#ifdef CONFIG_MAC80211_DEBUGFS
-+	if (local->force_tx_status)
-+		info->flags |= IEEE80211_TX_CTL_REQ_TX_STATUS;
-+#endif
-+
-+	mpath = entry->mpath;
-+	key = entry->key;
-+	sta = rcu_dereference(mpath->next_hop);
-+
-+	__skb_queue_head_init(&tx.skbs);
-+
-+	tx.flags = IEEE80211_TX_UNICAST;
-+	tx.local = local;
-+	tx.sdata = sdata;
-+	tx.sta = sta;
-+	tx.key = key;
-+	tx.skb = skb;
-+
-+	hdr = (struct ieee80211_hdr *)skb->data;
-+	tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
-+	*ieee80211_get_qos_ctl(hdr) = tid;
-+	tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]);
-+	if (tid_tx) {
-+		if (tid_tx->timeout)
-+			tid_tx->last_tx = jiffies;
-+		info->flags |= IEEE80211_TX_CTL_AMPDU;
-+	}
-+
-+	ieee80211_aggr_check(sdata, sta, skb);
-+
-+	if (ieee80211_queue_skb(local, sdata, sta, skb))
-+		return;
-+
-+	r = ieee80211_xmit_fast_finish(sdata, sta, entry->pn_offs, key, &tx);
-+	if (r == TX_DROP) {
-+		kfree_skb(skb);
-+		return;
-+	}
-+
-+	__skb_queue_tail(&tx.skbs, skb);
-+	ieee80211_tx_frags(local, &sdata->vif, sta, &tx.skbs, false);
-+}
-+
-+
-+static bool ieee80211_mesh_xmit_fast(struct ieee80211_sub_if_data *sdata,
-+				     struct sk_buff *skb, u32 ctrl_flags)
-+{
-+	struct ieee80211_local *local = sdata->local;
-+	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
-+	struct mhdr_cache_entry *entry;
-+	struct ieee80211s_hdr *meshhdr;
-+	u8 sa[ETH_ALEN] __aligned(2);
-+	struct sta_info *sta;
-+	bool copy_sa = false;
-+	u16 ethertype;
-+
-+	if (!ieee80211_hw_check(&local->hw, SUPPORT_FAST_XMIT))
-+		return false;
-+
-+	if (ctrl_flags & IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP)
-+		return false;
-+
-+	if (ifmsh->mshcfg.dot11MeshNolearn)
-+		return false;
-+
-+	/* Add support for these cases later */
-+	if (ifmsh->ps_peers_light_sleep || ifmsh->ps_peers_deep_sleep)
-+		return false;
-+
-+	if (is_multicast_ether_addr(skb->data))
-+		return false;
-+
-+	ethertype = (skb->data[12] << 8) | skb->data[13];
-+	if (ethertype < ETH_P_802_3_MIN)
-+		return false;
-+
-+	if (skb->sk && skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS)
-+		return false;
-+
-+	if (skb->ip_summed == CHECKSUM_PARTIAL) {
-+		skb_set_transport_header(skb, skb_checksum_start_offset(skb));
-+		if (skb_checksum_help(skb))
-+			return false;
-+	}
-+
-+	entry = mesh_get_cached_hdr(sdata, skb->data);
-+	if (!entry)
-+		return false;
-+
-+	/* Avoid extra work in this path */
-+	if (skb_headroom(skb) < (entry->hdrlen - ETH_HLEN + 2))
++	if (ieee80211_vif_is_mesh(&sdata->vif))
 +		return false;
 +
-+	/* If the skb is shared we need to obtain our own copy */
-+	if (skb_shared(skb)) {
-+		struct sk_buff *oskb = skb;
-+
-+		skb = skb_clone(skb, GFP_ATOMIC);
-+		if (!skb)
-+			return false;
-+
-+		kfree_skb(oskb);
-+	}
-+
-+	sta = rcu_dereference(entry->mpath->next_hop);
-+	skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, sta, skb));
-+
-+	meshhdr = (struct ieee80211s_hdr *)(entry->hdr + entry->machdr_len);
-+	if ((meshhdr->flags & MESH_FLAGS_AE) == MESH_FLAGS_AE_A5_A6) {
-+		/* preserve SA from eth header for 6-addr frames */
-+		ether_addr_copy(sa, skb->data + ETH_ALEN);
-+		copy_sa = true;
-+	}
-+
-+	memcpy(skb_push(skb, entry->hdrlen - 2 * ETH_ALEN), entry->hdr,
-+	       entry->hdrlen);
-+
-+	meshhdr = (struct ieee80211s_hdr *)(skb->data + entry->machdr_len);
-+	put_unaligned_le32(atomic_inc_return(&sdata->u.mesh.mesh_seqnum),
-+			   &meshhdr->seqnum);
-+	meshhdr->ttl = sdata->u.mesh.mshcfg.dot11MeshTTL;
-+	if (copy_sa)
-+	    ether_addr_copy(meshhdr->eaddr2, sa);
-+
-+	__ieee80211_mesh_xmit_fast(sdata, entry, skb);
-+
-+	return true;
-+}
+ 	if (skb_is_gso(skb))
+ 		return false;
+ 
+@@ -3634,10 +3640,11 @@ free:
+ 	return NULL;
+ }
+ 
+-static void __ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
+-				  struct sta_info *sta,
+-				  struct ieee80211_fast_tx *fast_tx,
+-				  struct sk_buff *skb, u8 tid, bool ampdu)
++void __ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
++			   struct sta_info *sta,
++			   struct ieee80211_fast_tx *fast_tx,
++			   struct sk_buff *skb, bool ampdu,
++			   const u8 *da, const u8 *sa)
+ {
+ 	struct ieee80211_local *local = sdata->local;
+ 	struct ieee80211_hdr *hdr = (void *)fast_tx->hdr;
+@@ -3645,8 +3652,6 @@ static void __ieee80211_xmit_fast(struct
+ 	struct ieee80211_tx_data tx;
+ 	ieee80211_tx_result r;
+ 	int hw_headroom = sdata->local->hw.extra_tx_headroom;
+-	int extra_head = fast_tx->hdr_len - (ETH_HLEN - 2);
+-	struct ethhdr eth;
+ 
+ 	skb = skb_share_check(skb, GFP_ATOMIC);
+ 	if (unlikely(!skb))
+@@ -3661,16 +3666,15 @@ static void __ieee80211_xmit_fast(struct
+ 	 * more room than we already have in 'extra_head'
+ 	 */
+ 	if (unlikely(ieee80211_skb_resize(sdata, skb,
+-					  max_t(int, extra_head + hw_headroom -
++					  max_t(int, fast_tx->hdr_len + hw_headroom -
+ 						     skb_headroom(skb), 0),
+ 					  ENCRYPT_NO)))
+ 		goto free;
+ 
+-	memcpy(&eth, skb->data, ETH_HLEN - 2);
+-	hdr = skb_push(skb, extra_head);
++	hdr = skb_push(skb, fast_tx->hdr_len);
+ 	memcpy(skb->data, fast_tx->hdr, fast_tx->hdr_len);
+-	memcpy(skb->data + fast_tx->da_offs, eth.h_dest, ETH_ALEN);
+-	memcpy(skb->data + fast_tx->sa_offs, eth.h_source, ETH_ALEN);
++	memcpy(skb->data + fast_tx->da_offs, da, ETH_ALEN);
++	memcpy(skb->data + fast_tx->sa_offs, sa, ETH_ALEN);
+ 
+ 	info = IEEE80211_SKB_CB(skb);
+ 	memset(info, 0, sizeof(*info));
+@@ -3689,7 +3693,7 @@ static void __ieee80211_xmit_fast(struct
+ #endif
+ 
+ 	if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) {
+-		tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
++		u8 tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
+ 		*ieee80211_get_qos_ctl(hdr) = tid;
+ 	}
+ 
+@@ -3732,6 +3736,7 @@ static bool ieee80211_xmit_fast(struct i
+ 	struct ieee80211_hdr *hdr = (void *)fast_tx->hdr;
+ 	struct tid_ampdu_tx *tid_tx = NULL;
+ 	struct sk_buff *next;
++	struct ethhdr eth;
+ 	u8 tid = IEEE80211_NUM_TIDS;
+ 
+ 	/* control port protocol needs a lot of special handling */
+@@ -3757,14 +3762,18 @@ static bool ieee80211_xmit_fast(struct i
+ 		}
+ 	}
+ 
++	memcpy(&eth, skb->data, ETH_HLEN - 2);
 +
- static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
- 				struct sta_info *sta,
- 				struct ieee80211_fast_tx *fast_tx,
-@@ -4244,8 +4403,14 @@ void __ieee80211_subif_start_xmit(struct
+ 	/* after this point (skb is modified) we cannot return false */
++	skb_pull(skb, ETH_HLEN - 2);
+ 	skb = ieee80211_tx_skb_fixup(skb, ieee80211_sdata_netdev_features(sdata));
+ 	if (!skb)
+ 		return true;
+ 
+ 	skb_list_walk_safe(skb, skb, next) {
+ 		skb_mark_not_on_list(skb);
+-		__ieee80211_xmit_fast(sdata, sta, fast_tx, skb, tid, tid_tx);
++		__ieee80211_xmit_fast(sdata, sta, fast_tx, skb, tid_tx,
++				      eth.h_dest, eth.h_source);
+ 	}
+ 
+ 	return true;
+@@ -4244,8 +4253,15 @@ void __ieee80211_subif_start_xmit(struct
  		return;
  	}
  
@@ -835,13 +847,14 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	rcu_read_lock();
  
 +	if (ieee80211_vif_is_mesh(&sdata->vif) &&
++	    ieee80211_hw_check(&local->hw, SUPPORT_FAST_XMIT) &&
 +	    ieee80211_mesh_xmit_fast(sdata, skb, ctrl_flags))
 +		goto out;
 +
  	if (ieee80211_lookup_ra_sta(sdata, skb, &sta))
  		goto out_free;
  
-@@ -4255,8 +4420,6 @@ void __ieee80211_subif_start_xmit(struct
+@@ -4255,8 +4271,6 @@ void __ieee80211_subif_start_xmit(struct
  	skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, sta, skb));
  	ieee80211_aggr_check(sdata, sta, skb);
  
diff --git a/package/kernel/mac80211/patches/subsys/320-wifi-mac80211-use-mesh-header-cache-to-speed-up-mesh.patch b/package/kernel/mac80211/patches/subsys/320-wifi-mac80211-use-mesh-header-cache-to-speed-up-mesh.patch
index e0d4e60ed7..3b0bae67a5 100644
--- a/package/kernel/mac80211/patches/subsys/320-wifi-mac80211-use-mesh-header-cache-to-speed-up-mesh.patch
+++ b/package/kernel/mac80211/patches/subsys/320-wifi-mac80211-use-mesh-header-cache-to-speed-up-mesh.patch
@@ -3,40 +3,92 @@ Date: Thu, 16 Feb 2023 11:07:30 +0100
 Subject: [PATCH] wifi: mac80211: use mesh header cache to speed up mesh
  forwarding
 
-Use it to look up the next hop address + sta pointer + key and call
-__ieee80211_mesh_xmit_fast to queue the tx frame.
-
 Significantly reduces mesh forwarding path CPU usage and enables the
-use of iTXQ.
+direct use of iTXQ.
 
 Signed-off-by: Felix Fietkau <nbd at nbd.name>
 ---
 
 --- a/net/mac80211/rx.c
 +++ b/net/mac80211/rx.c
-@@ -2731,6 +2731,7 @@ ieee80211_rx_mesh_data(struct ieee80211_
- 	struct ieee80211_hdr hdr = {
- 		.frame_control = cpu_to_le16(fc)
- 	};
-+	struct mhdr_cache_entry *entry = NULL;
- 	struct ieee80211_hdr *fwd_hdr;
- 	struct ieee80211s_hdr *mesh_hdr;
- 	struct ieee80211_tx_info *info;
-@@ -2788,7 +2789,12 @@ ieee80211_rx_mesh_data(struct ieee80211_
- 		return RX_DROP_MONITOR;
+@@ -2720,6 +2720,65 @@ ieee80211_deliver_skb(struct ieee80211_r
  	}
+ }
  
--	if (mesh_hdr->flags & MESH_FLAGS_AE) {
++#ifdef CPTCFG_MAC80211_MESH
++static bool
++ieee80211_rx_mesh_fast_forward(struct ieee80211_sub_if_data *sdata,
++			       struct sk_buff *skb, int hdrlen)
++{
++	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
++	struct ieee80211_mesh_fast_tx *entry = NULL;
++	struct ieee80211s_hdr *mesh_hdr;
++	struct tid_ampdu_tx *tid_tx;
++	struct sta_info *sta;
++	struct ethhdr eth;
++	u8 tid;
++
++	mesh_hdr = (struct ieee80211s_hdr *)(skb->data + sizeof(eth));
 +	if ((mesh_hdr->flags & MESH_FLAGS_AE) == MESH_FLAGS_AE_A5_A6)
-+		entry = mesh_get_cached_hdr(sdata, mesh_hdr->eaddr1);
++		entry = mesh_fast_tx_get(sdata, mesh_hdr->eaddr1);
 +	else if (!(mesh_hdr->flags & MESH_FLAGS_AE))
-+		entry = mesh_get_cached_hdr(sdata, eth->h_dest);
++		entry = mesh_fast_tx_get(sdata, skb->data);
++	if (!entry)
++		return false;
++
++	sta = rcu_dereference(entry->mpath->next_hop);
++	if (!sta)
++		return false;
++
++	if (skb_linearize(skb))
++		return false;
++
++	tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
++	tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]);
++	if (tid_tx) {
++		if (!test_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state))
++			return false;
++
++		if (tid_tx->timeout)
++			tid_tx->last_tx = jiffies;
++	}
++
++	ieee80211_aggr_check(sdata, sta, skb);
++
++	if (ieee80211_get_8023_tunnel_proto(skb->data + hdrlen,
++					    &skb->protocol))
++		hdrlen += ETH_ALEN;
++	else
++		skb->protocol = htons(skb->len - hdrlen);
++	skb_set_network_header(skb, hdrlen + 2);
++
++	skb->dev = sdata->dev;
++	memcpy(&eth, skb->data, ETH_HLEN - 2);
++	skb_pull(skb, sizeof(eth));
++	__ieee80211_xmit_fast(sdata, sta, &entry->fast_tx, skb, tid_tx,
++			      eth.h_dest, eth.h_source);
++	IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_unicast);
++	IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_frames);
 +
-+	if (!entry && (mesh_hdr->flags & MESH_FLAGS_AE)) {
- 		struct mesh_path *mppath;
- 		char *proxied_addr;
- 		bool update = false;
-@@ -2862,11 +2868,23 @@ ieee80211_rx_mesh_data(struct ieee80211_
++	return true;
++}
++#endif
++
+ static ieee80211_rx_result
+ ieee80211_rx_mesh_data(struct ieee80211_sub_if_data *sdata, struct sta_info *sta,
+ 		       struct sk_buff *skb)
+@@ -2824,6 +2883,10 @@ ieee80211_rx_mesh_data(struct ieee80211_
+ 
+ 	skb_set_queue_mapping(skb, ieee802_1d_to_ac[skb->priority]);
+ 
++	if (!multicast &&
++	    ieee80211_rx_mesh_fast_forward(sdata, skb, mesh_hdrlen))
++		return RX_QUEUED;
++
+ 	ieee80211_fill_mesh_addresses(&hdr, &hdr.frame_control,
+ 				      eth->h_dest, eth->h_source);
+ 	hdrlen = ieee80211_hdrlen(hdr.frame_control);
+@@ -2862,6 +2925,7 @@ ieee80211_rx_mesh_data(struct ieee80211_
  	info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
  	info->control.vif = &sdata->vif;
  	info->control.jiffies = jiffies;
@@ -44,23 +96,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	if (multicast) {
  		IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_mcast);
  		memcpy(fwd_hdr->addr2, sdata->vif.addr, ETH_ALEN);
- 		/* update power mode indication when forwarding */
- 		ieee80211_mps_set_frame_flags(sdata, NULL, fwd_hdr);
-+	} else if (entry) {
-+		struct ieee80211_hdr *ehdr = (struct ieee80211_hdr *)entry->hdr;
-+
-+		ether_addr_copy(fwd_hdr->addr1, ehdr->addr1);
-+		ether_addr_copy(fwd_hdr->addr2, sdata->vif.addr);
-+		IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_unicast);
-+		IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_frames);
-+		qos[0] = fwd_skb->priority;
-+		qos[1] = ieee80211_get_qos_ctl(ehdr)[1];
-+		__ieee80211_mesh_xmit_fast(sdata, entry, fwd_skb);
-+		return RX_QUEUED;
- 	} else if (!mesh_nexthop_lookup(sdata, fwd_skb)) {
- 		/* mesh power mode flags updated in mesh_nexthop_lookup */
- 		IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_unicast);
-@@ -2883,7 +2901,6 @@ ieee80211_rx_mesh_data(struct ieee80211_
+@@ -2883,7 +2947,6 @@ ieee80211_rx_mesh_data(struct ieee80211_
  	}
  
  	IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_frames);
@@ -68,3 +104,29 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	ieee80211_add_pending_skb(local, fwd_skb);
  
  rx_accept:
+--- a/net/mac80211/ieee80211_i.h
++++ b/net/mac80211/ieee80211_i.h
+@@ -2018,6 +2018,8 @@ void __ieee80211_xmit_fast(struct ieee80
+ 			   struct ieee80211_fast_tx *fast_tx,
+ 			   struct sk_buff *skb, bool ampdu,
+ 			   const u8 *da, const u8 *sa);
++void ieee80211_aggr_check(struct ieee80211_sub_if_data *sdata,
++			  struct sta_info *sta, struct sk_buff *skb);
+ 
+ /* HT */
+ void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
+--- a/net/mac80211/tx.c
++++ b/net/mac80211/tx.c
+@@ -1191,10 +1191,8 @@ 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)
++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;
diff --git a/package/kernel/mac80211/patches/subsys/321-mac80211-fix-mesh-forwarding.patch b/package/kernel/mac80211/patches/subsys/321-mac80211-fix-mesh-forwarding.patch
index d9af8c7929..e2b268ae4c 100644
--- a/package/kernel/mac80211/patches/subsys/321-mac80211-fix-mesh-forwarding.patch
+++ b/package/kernel/mac80211/patches/subsys/321-mac80211-fix-mesh-forwarding.patch
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/net/mac80211/rx.c
 +++ b/net/mac80211/rx.c
-@@ -2847,6 +2847,9 @@ ieee80211_rx_mesh_data(struct ieee80211_
+@@ -2904,6 +2904,9 @@ ieee80211_rx_mesh_data(struct ieee80211_
  
  		if (skb_cow_head(fwd_skb, hdrlen - sizeof(struct ethhdr)))
  			return RX_DROP_UNUSABLE;
@@ -21,7 +21,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	}
  
  	fwd_hdr = skb_push(fwd_skb, hdrlen - sizeof(struct ethhdr));
-@@ -2861,7 +2864,7 @@ ieee80211_rx_mesh_data(struct ieee80211_
+@@ -2918,7 +2921,7 @@ ieee80211_rx_mesh_data(struct ieee80211_
  		hdrlen += ETH_ALEN;
  	else
  		fwd_skb->protocol = htons(fwd_skb->len - hdrlen);
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 817be9e4d2..80ffb493b8 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
@@ -87,7 +87,7 @@
  	CFG80211_TESTMODE_DUMP(ieee80211_testmode_dump)
 --- a/net/mac80211/ieee80211_i.h
 +++ b/net/mac80211/ieee80211_i.h
-@@ -1536,6 +1536,7 @@ struct ieee80211_local {
+@@ -1535,6 +1535,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 Feb 26 14:45:06 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 26 Feb 2023 17:45:06 -0500
Subject: [openwrt/openwrt]  octeontx: add default packages for on-board
 devices
In-Reply-To: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
References: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
Message-ID: <mailman.19209.1677451588.3064139.lede-commits@lists.infradead.org>

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

commit fb2480df36fa4f8faed9732ed06ac2093a060c28
Author: Tim Harvey <tharvey at gateworks.com>
AuthorDate: Fri Feb 17 17:06:41 2023 -0800

    octeontx: add default packages for on-board devices
    
    The Gateworks Newport boards supported by the octeontx target have
    the following on-board devices:
     - Gateworks System Controller
     - GPIO buttons
     - GPIO leds
     - GPS PPS
     - Accelerometer
     - MCP251X CAN controller
    
    Add kernel drivers for these devices in DEFAULT_PACKAGES
    
    Signed-off-by: Tim Harvey <tharvey at gateworks.com>
---
 target/linux/octeontx/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/target/linux/octeontx/Makefile b/target/linux/octeontx/Makefile
index 5260291d05..25096c90ba 100644
--- a/target/linux/octeontx/Makefile
+++ b/target/linux/octeontx/Makefile
@@ -20,4 +20,8 @@ include $(INCLUDE_DIR)/target.mk
 
 KERNELNAME:=Image
 
+DEFAULT_PACKAGES += kmod-hwmon-gsc kmod-leds-gpio kmod-pps-gpio \
+		    kmod-gpio-button-hotplug kmod-input-evdev kmod-rtc-ds1672 \
+		    kmod-can kmod-can-mcp251x
+
 $(eval $(call BuildTarget))



From lede-commits at lists.infradead.org  Sun Feb 26 14:45:07 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Sun, 26 Feb 2023 17:45:07 -0500
Subject: [openwrt/openwrt]  octeontx: add f2fs and ext4 support
In-Reply-To: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
References: <167745149691.1083460.2317210777650935564@git-01.infra.openwrt.org>
Message-ID: <mailman.19210.1677451721.3064139.lede-commits@lists.infradead.org>

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

commit 026004d5301a273005390f0a0cd26539fbee09f1
Author: Tim Harvey <tharvey at gateworks.com>
AuthorDate: Tue Feb 21 15:08:29 2023 -0800

    octeontx: add f2fs and ext4 support
    
    Add both ext4 and f2fs support for overlayfs. The fstools mount_root
    application will choose f2fs if the overlay volume space available
    exceeds 100MB, otherwise ext4 is used.
    
    Signed-off-by: Tim Harvey <tharvey at gateworks.com>
---
 target/linux/octeontx/Makefile    | 3 ++-
 target/linux/octeontx/config-5.15 | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/target/linux/octeontx/Makefile b/target/linux/octeontx/Makefile
index 25096c90ba..57250a5e01 100644
--- a/target/linux/octeontx/Makefile
+++ b/target/linux/octeontx/Makefile
@@ -20,7 +20,8 @@ include $(INCLUDE_DIR)/target.mk
 
 KERNELNAME:=Image
 
-DEFAULT_PACKAGES += kmod-hwmon-gsc kmod-leds-gpio kmod-pps-gpio \
+DEFAULT_PACKAGES += uboot-envtools mkf2fs e2fsprogs blkid \
+		    kmod-hwmon-gsc kmod-leds-gpio kmod-pps-gpio \
 		    kmod-gpio-button-hotplug kmod-input-evdev kmod-rtc-ds1672 \
 		    kmod-can kmod-can-mcp251x
 
diff --git a/target/linux/octeontx/config-5.15 b/target/linux/octeontx/config-5.15
index 36402b70eb..40cab28f60 100644
--- a/target/linux/octeontx/config-5.15
+++ b/target/linux/octeontx/config-5.15
@@ -145,6 +145,8 @@ CONFIG_EDAC_SUPPORT=y
 CONFIG_EDAC_THUNDERX=y
 # CONFIG_EDAC_XGENE is not set
 CONFIG_EEPROM_AT24=y
+CONFIG_EXT4_FS=y
+CONFIG_F2FS_FS=y
 CONFIG_FAT_FS=y
 CONFIG_FIXED_PHY=y
 CONFIG_FIX_EARLYCON_MEM=y



From lede-commits at lists.infradead.org  Mon Feb 27 00:11:42 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 27 Feb 2023 03:11:42 -0500
Subject: [openwrt/openwrt]  bcm47xx: add pending devices support
In-Reply-To: <167748550109.1571519.9074044730486783751@git-01.infra.openwrt.org>
References: <167748550109.1571519.9074044730486783751@git-01.infra.openwrt.org>
Message-ID: <mailman.19291.1677485513.3064139.lede-commits@lists.infradead.org>

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

commit 84576368689cef5491a34eb76ae2a1dfd2a0a3ba
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Mon Feb 27 07:44:12 2023 +0000

    bcm47xx: add pending devices support
    
    This includes Lines E2500 V2 and Huawei B593u-12.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 ...-BCM47XX-Add-support-for-Linksys-E2500-V3.patch | 65 ++++++++++++++++++++++
 ...S-BCM47XX-Add-support-for-Huawei-B593u-12.patch | 61 ++++++++++++++++++++
 ...-BCM47XX-Add-support-for-Linksys-E2500-V3.patch | 65 ++++++++++++++++++++++
 ...S-BCM47XX-Add-support-for-Huawei-B593u-12.patch | 61 ++++++++++++++++++++
 4 files changed, 252 insertions(+)

diff --git a/target/linux/bcm47xx/patches-5.10/032-v6.3-MIPS-BCM47XX-Add-support-for-Linksys-E2500-V3.patch b/target/linux/bcm47xx/patches-5.10/032-v6.3-MIPS-BCM47XX-Add-support-for-Linksys-E2500-V3.patch
new file mode 100644
index 0000000000..4faecdc7d5
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.10/032-v6.3-MIPS-BCM47XX-Add-support-for-Linksys-E2500-V3.patch
@@ -0,0 +1,65 @@
+From fc605b914167de75432c3b5aae239fb191e84a31 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Wed, 8 Feb 2023 08:03:01 +0100
+Subject: [PATCH] MIPS: BCM47XX: Add support for Linksys E2500 V3
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It's a BCM5358 based home WiFi router. 16 MiB flash, 64 MiB RAM, BCM5325
+switch, on-SoC 802.11n radio.
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
+---
+ arch/mips/bcm47xx/board.c                          | 1 +
+ arch/mips/bcm47xx/buttons.c                        | 9 +++++++++
+ arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h | 1 +
+ 3 files changed, 11 insertions(+)
+
+--- a/arch/mips/bcm47xx/board.c
++++ b/arch/mips/bcm47xx/board.c
+@@ -130,6 +130,7 @@ struct bcm47xx_board_type_list2 bcm47xx_
+ 	{{BCM47XX_BOARD_LINKSYS_E1000V21, "Linksys E1000 V2.1"}, "E1000", "2.1"},
+ 	{{BCM47XX_BOARD_LINKSYS_E1200V2, "Linksys E1200 V2"}, "E1200", "2.0"},
+ 	{{BCM47XX_BOARD_LINKSYS_E2000V1, "Linksys E2000 V1"}, "Linksys E2000", "1.0"},
++	{{BCM47XX_BOARD_LINKSYS_E2500V3, "Linksys E2500 V3"}, "E2500", "1.0"},
+ 	/* like WRT610N v2.0 */
+ 	{{BCM47XX_BOARD_LINKSYS_E3000V1, "Linksys E3000 V1"}, "E300", "1.0"},
+ 	{{BCM47XX_BOARD_LINKSYS_E3200V1, "Linksys E3200 V1"}, "E3200", "1.0"},
+--- a/arch/mips/bcm47xx/buttons.c
++++ b/arch/mips/bcm47xx/buttons.c
+@@ -223,6 +223,12 @@ bcm47xx_buttons_linksys_e2000v1[] __init
+ };
+ 
+ static const struct gpio_keys_button
++bcm47xx_buttons_linksys_e2500v3[] __initconst = {
++	BCM47XX_GPIO_KEY(9, KEY_WPS_BUTTON),
++	BCM47XX_GPIO_KEY(10, KEY_RESTART),
++};
++
++static const struct gpio_keys_button
+ bcm47xx_buttons_linksys_e3000v1[] __initconst = {
+ 	BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
+ 	BCM47XX_GPIO_KEY(6, KEY_RESTART),
+@@ -617,6 +623,9 @@ int __init bcm47xx_buttons_register(void
+ 	case BCM47XX_BOARD_LINKSYS_E2000V1:
+ 		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e2000v1);
+ 		break;
++	case BCM47XX_BOARD_LINKSYS_E2500V3:
++		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e2500v3);
++		break;
+ 	case BCM47XX_BOARD_LINKSYS_E3000V1:
+ 		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e3000v1);
+ 		break;
+--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
++++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
+@@ -61,6 +61,7 @@ enum bcm47xx_board {
+ 	BCM47XX_BOARD_LINKSYS_E1000V21,
+ 	BCM47XX_BOARD_LINKSYS_E1200V2,
+ 	BCM47XX_BOARD_LINKSYS_E2000V1,
++	BCM47XX_BOARD_LINKSYS_E2500V3,
+ 	BCM47XX_BOARD_LINKSYS_E3000V1,
+ 	BCM47XX_BOARD_LINKSYS_E3200V1,
+ 	BCM47XX_BOARD_LINKSYS_E4200V1,
diff --git a/target/linux/bcm47xx/patches-5.10/130-MIPS-BCM47XX-Add-support-for-Huawei-B593u-12.patch b/target/linux/bcm47xx/patches-5.10/130-MIPS-BCM47XX-Add-support-for-Huawei-B593u-12.patch
new file mode 100644
index 0000000000..333c3d7b87
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.10/130-MIPS-BCM47XX-Add-support-for-Huawei-B593u-12.patch
@@ -0,0 +1,61 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Mon, 27 Feb 2023 07:44:38 +0100
+Subject: [PATCH] MIPS: BCM47XX: Add support for Huawei B593u-12
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It's a BCM5358 based home router. One of very few bcm47xx devices with
+cellular modems (here: LTE).
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+---
+ arch/mips/bcm47xx/board.c                          | 1 +
+ arch/mips/bcm47xx/leds.c                           | 8 ++++++++
+ arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h | 1 +
+ 3 files changed, 10 insertions(+)
+
+--- a/arch/mips/bcm47xx/board.c
++++ b/arch/mips/bcm47xx/board.c
+@@ -193,6 +193,7 @@ struct bcm47xx_board_type_list1 bcm47xx_
+ /* boardtype, boardnum, boardrev */
+ static const
+ struct bcm47xx_board_type_list3 bcm47xx_board_list_board[] __initconst = {
++	{{BCM47XX_BOARD_HUAWEI_B593U_12, "Huawei B593u-12"}, "0x053d", "1234", "0x1301"},
+ 	{{BCM47XX_BOARD_HUAWEI_E970, "Huawei E970"}, "0x048e", "0x5347", "0x11"},
+ 	{{BCM47XX_BOARD_PHICOMM_M1, "Phicomm M1"}, "0x0590", "80", "0x1104"},
+ 	{{BCM47XX_BOARD_ZTE_H218N, "ZTE H218N"}, "0x053d", "1234", "0x1305"},
+--- a/arch/mips/bcm47xx/leds.c
++++ b/arch/mips/bcm47xx/leds.c
+@@ -223,6 +223,11 @@ bcm47xx_leds_dlink_dir330[] __initconst
+ /* Huawei */
+ 
+ static const struct gpio_led
++bcm47xx_leds_huawei_b593u_12[] __initconst = {
++	BCM47XX_GPIO_LED(5, "blue", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
++};
++
++static const struct gpio_led
+ bcm47xx_leds_huawei_e970[] __initconst = {
+ 	BCM47XX_GPIO_LED(0, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
+ };
+@@ -672,6 +677,9 @@ void __init bcm47xx_leds_register(void)
+ 		bcm47xx_set_pdata(bcm47xx_leds_dlink_dir330);
+ 		break;
+ 
++	case BCM47XX_BOARD_HUAWEI_B593U_12:
++		bcm47xx_set_pdata(bcm47xx_leds_huawei_b593u_12);
++		break;
+ 	case BCM47XX_BOARD_HUAWEI_E970:
+ 		bcm47xx_set_pdata(bcm47xx_leds_huawei_e970);
+ 		break;
+--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
++++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
+@@ -53,6 +53,7 @@ enum bcm47xx_board {
+ 	BCM47XX_BOARD_DLINK_DIR130,
+ 	BCM47XX_BOARD_DLINK_DIR330,
+ 
++	BCM47XX_BOARD_HUAWEI_B593U_12,
+ 	BCM47XX_BOARD_HUAWEI_E970,
+ 
+ 	BCM47XX_BOARD_LINKSYS_E900V1,
diff --git a/target/linux/bcm47xx/patches-5.15/032-v6.3-MIPS-BCM47XX-Add-support-for-Linksys-E2500-V3.patch b/target/linux/bcm47xx/patches-5.15/032-v6.3-MIPS-BCM47XX-Add-support-for-Linksys-E2500-V3.patch
new file mode 100644
index 0000000000..4faecdc7d5
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/032-v6.3-MIPS-BCM47XX-Add-support-for-Linksys-E2500-V3.patch
@@ -0,0 +1,65 @@
+From fc605b914167de75432c3b5aae239fb191e84a31 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Wed, 8 Feb 2023 08:03:01 +0100
+Subject: [PATCH] MIPS: BCM47XX: Add support for Linksys E2500 V3
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It's a BCM5358 based home WiFi router. 16 MiB flash, 64 MiB RAM, BCM5325
+switch, on-SoC 802.11n radio.
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
+---
+ arch/mips/bcm47xx/board.c                          | 1 +
+ arch/mips/bcm47xx/buttons.c                        | 9 +++++++++
+ arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h | 1 +
+ 3 files changed, 11 insertions(+)
+
+--- a/arch/mips/bcm47xx/board.c
++++ b/arch/mips/bcm47xx/board.c
+@@ -130,6 +130,7 @@ struct bcm47xx_board_type_list2 bcm47xx_
+ 	{{BCM47XX_BOARD_LINKSYS_E1000V21, "Linksys E1000 V2.1"}, "E1000", "2.1"},
+ 	{{BCM47XX_BOARD_LINKSYS_E1200V2, "Linksys E1200 V2"}, "E1200", "2.0"},
+ 	{{BCM47XX_BOARD_LINKSYS_E2000V1, "Linksys E2000 V1"}, "Linksys E2000", "1.0"},
++	{{BCM47XX_BOARD_LINKSYS_E2500V3, "Linksys E2500 V3"}, "E2500", "1.0"},
+ 	/* like WRT610N v2.0 */
+ 	{{BCM47XX_BOARD_LINKSYS_E3000V1, "Linksys E3000 V1"}, "E300", "1.0"},
+ 	{{BCM47XX_BOARD_LINKSYS_E3200V1, "Linksys E3200 V1"}, "E3200", "1.0"},
+--- a/arch/mips/bcm47xx/buttons.c
++++ b/arch/mips/bcm47xx/buttons.c
+@@ -223,6 +223,12 @@ bcm47xx_buttons_linksys_e2000v1[] __init
+ };
+ 
+ static const struct gpio_keys_button
++bcm47xx_buttons_linksys_e2500v3[] __initconst = {
++	BCM47XX_GPIO_KEY(9, KEY_WPS_BUTTON),
++	BCM47XX_GPIO_KEY(10, KEY_RESTART),
++};
++
++static const struct gpio_keys_button
+ bcm47xx_buttons_linksys_e3000v1[] __initconst = {
+ 	BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON),
+ 	BCM47XX_GPIO_KEY(6, KEY_RESTART),
+@@ -617,6 +623,9 @@ int __init bcm47xx_buttons_register(void
+ 	case BCM47XX_BOARD_LINKSYS_E2000V1:
+ 		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e2000v1);
+ 		break;
++	case BCM47XX_BOARD_LINKSYS_E2500V3:
++		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e2500v3);
++		break;
+ 	case BCM47XX_BOARD_LINKSYS_E3000V1:
+ 		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e3000v1);
+ 		break;
+--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
++++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
+@@ -61,6 +61,7 @@ enum bcm47xx_board {
+ 	BCM47XX_BOARD_LINKSYS_E1000V21,
+ 	BCM47XX_BOARD_LINKSYS_E1200V2,
+ 	BCM47XX_BOARD_LINKSYS_E2000V1,
++	BCM47XX_BOARD_LINKSYS_E2500V3,
+ 	BCM47XX_BOARD_LINKSYS_E3000V1,
+ 	BCM47XX_BOARD_LINKSYS_E3200V1,
+ 	BCM47XX_BOARD_LINKSYS_E4200V1,
diff --git a/target/linux/bcm47xx/patches-5.15/130-MIPS-BCM47XX-Add-support-for-Huawei-B593u-12.patch b/target/linux/bcm47xx/patches-5.15/130-MIPS-BCM47XX-Add-support-for-Huawei-B593u-12.patch
new file mode 100644
index 0000000000..333c3d7b87
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/130-MIPS-BCM47XX-Add-support-for-Huawei-B593u-12.patch
@@ -0,0 +1,61 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Mon, 27 Feb 2023 07:44:38 +0100
+Subject: [PATCH] MIPS: BCM47XX: Add support for Huawei B593u-12
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It's a BCM5358 based home router. One of very few bcm47xx devices with
+cellular modems (here: LTE).
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+---
+ arch/mips/bcm47xx/board.c                          | 1 +
+ arch/mips/bcm47xx/leds.c                           | 8 ++++++++
+ arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h | 1 +
+ 3 files changed, 10 insertions(+)
+
+--- a/arch/mips/bcm47xx/board.c
++++ b/arch/mips/bcm47xx/board.c
+@@ -193,6 +193,7 @@ struct bcm47xx_board_type_list1 bcm47xx_
+ /* boardtype, boardnum, boardrev */
+ static const
+ struct bcm47xx_board_type_list3 bcm47xx_board_list_board[] __initconst = {
++	{{BCM47XX_BOARD_HUAWEI_B593U_12, "Huawei B593u-12"}, "0x053d", "1234", "0x1301"},
+ 	{{BCM47XX_BOARD_HUAWEI_E970, "Huawei E970"}, "0x048e", "0x5347", "0x11"},
+ 	{{BCM47XX_BOARD_PHICOMM_M1, "Phicomm M1"}, "0x0590", "80", "0x1104"},
+ 	{{BCM47XX_BOARD_ZTE_H218N, "ZTE H218N"}, "0x053d", "1234", "0x1305"},
+--- a/arch/mips/bcm47xx/leds.c
++++ b/arch/mips/bcm47xx/leds.c
+@@ -223,6 +223,11 @@ bcm47xx_leds_dlink_dir330[] __initconst
+ /* Huawei */
+ 
+ static const struct gpio_led
++bcm47xx_leds_huawei_b593u_12[] __initconst = {
++	BCM47XX_GPIO_LED(5, "blue", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
++};
++
++static const struct gpio_led
+ bcm47xx_leds_huawei_e970[] __initconst = {
+ 	BCM47XX_GPIO_LED(0, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
+ };
+@@ -672,6 +677,9 @@ void __init bcm47xx_leds_register(void)
+ 		bcm47xx_set_pdata(bcm47xx_leds_dlink_dir330);
+ 		break;
+ 
++	case BCM47XX_BOARD_HUAWEI_B593U_12:
++		bcm47xx_set_pdata(bcm47xx_leds_huawei_b593u_12);
++		break;
+ 	case BCM47XX_BOARD_HUAWEI_E970:
+ 		bcm47xx_set_pdata(bcm47xx_leds_huawei_e970);
+ 		break;
+--- a/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
++++ b/arch/mips/include/asm/mach-bcm47xx/bcm47xx_board.h
+@@ -53,6 +53,7 @@ enum bcm47xx_board {
+ 	BCM47XX_BOARD_DLINK_DIR130,
+ 	BCM47XX_BOARD_DLINK_DIR330,
+ 
++	BCM47XX_BOARD_HUAWEI_B593U_12,
+ 	BCM47XX_BOARD_HUAWEI_E970,
+ 
+ 	BCM47XX_BOARD_LINKSYS_E900V1,



From lede-commits at lists.infradead.org  Mon Feb 27 00:11:41 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 27 Feb 2023 03:11:41 -0500
Subject: [openwrt/openwrt]  bcm47xx: reorder MIPS BCM47XX patches
In-Reply-To: <167748550109.1571519.9074044730486783751@git-01.infra.openwrt.org>
References: <167748550109.1571519.9074044730486783751@git-01.infra.openwrt.org>
Message-ID: <mailman.19292.1677485516.3064139.lede-commits@lists.infradead.org>

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

commit b894fbdfe00fc5d413e95ab5e1551f7ad8601938
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Mon Feb 27 06:30:58 2023 +0000

    bcm47xx: reorder MIPS BCM47XX patches
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 ....17-0001-MIPS-BCM47XX-Define-Linksys-WRT310N-V2-buttons.patch} | 8 ++++----
 ...002-MIPS-BCM47XX-Add-board-entry-for-Linksys-WRT320N-v1.patch} | 8 ++++----
 ...0003-MIPS-BCM47XX-Add-LEDs-and-buttons-for-Asus-RTN-10U.patch} | 4 ++--
 ...5.17-0004-MIPS-BCM47XX-Add-support-for-Netgear-R6300-v1.patch} | 4 ++--
 ...005-MIPS-BCM47XX-Add-support-for-Netgear-WN2500RP-v1-v2.patch} | 4 ++--
 ...1-v6.0-MIPS-BCM47XX-Add-support-for-Netgear-WNR3500L-v2.patch} | 8 ++++----
 ....17-0001-MIPS-BCM47XX-Define-Linksys-WRT310N-V2-buttons.patch} | 8 ++++----
 ...002-MIPS-BCM47XX-Add-board-entry-for-Linksys-WRT320N-v1.patch} | 8 ++++----
 ...0003-MIPS-BCM47XX-Add-LEDs-and-buttons-for-Asus-RTN-10U.patch} | 4 ++--
 ...5.17-0004-MIPS-BCM47XX-Add-support-for-Netgear-R6300-v1.patch} | 4 ++--
 ...005-MIPS-BCM47XX-Add-support-for-Netgear-WN2500RP-v1-v2.patch} | 4 ++--
 ...1-v6.0-MIPS-BCM47XX-Add-support-for-Netgear-WNR3500L-v2.patch} | 8 ++++----
 12 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/target/linux/bcm47xx/patches-5.15/325-v5.17-MIPS-BCM47XX-Define-Linksys-WRT310N-V2-buttons.patch b/target/linux/bcm47xx/patches-5.10/030-v5.17-0001-MIPS-BCM47XX-Define-Linksys-WRT310N-V2-buttons.patch
similarity index 84%
rename from target/linux/bcm47xx/patches-5.15/325-v5.17-MIPS-BCM47XX-Define-Linksys-WRT310N-V2-buttons.patch
rename to target/linux/bcm47xx/patches-5.10/030-v5.17-0001-MIPS-BCM47XX-Define-Linksys-WRT310N-V2-buttons.patch
index 0c23e8aaf5..921825be5c 100644
--- a/target/linux/bcm47xx/patches-5.15/325-v5.17-MIPS-BCM47XX-Define-Linksys-WRT310N-V2-buttons.patch
+++ b/target/linux/bcm47xx/patches-5.10/030-v5.17-0001-MIPS-BCM47XX-Define-Linksys-WRT310N-V2-buttons.patch
@@ -15,7 +15,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
 
 --- a/arch/mips/bcm47xx/buttons.c
 +++ b/arch/mips/bcm47xx/buttons.c
-@@ -289,6 +289,12 @@ bcm47xx_buttons_linksys_wrt320n_v1[] __i
+@@ -277,6 +277,12 @@ bcm47xx_buttons_linksys_wrt310nv1[] __in
  };
  
  static const struct gpio_keys_button
@@ -28,9 +28,9 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
  	BCM47XX_GPIO_KEY(5, KEY_WIMAX),
  	BCM47XX_GPIO_KEY(6, KEY_RESTART),
-@@ -644,6 +650,9 @@ int __init bcm47xx_buttons_register(void
- 	case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
- 		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt320n_v1);
+@@ -608,6 +614,9 @@ int __init bcm47xx_buttons_register(void
+ 	case BCM47XX_BOARD_LINKSYS_WRT310NV1:
+ 		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1);
  		break;
 +	case BCM47XX_BOARD_LINKSYS_WRT310NV2:
 +		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310n_v2);
diff --git a/target/linux/bcm47xx/patches-5.10/320-v5.17-MIPS-BCM47XX-Add-board-entry-for-Linksys-WRT320N-v1.patch b/target/linux/bcm47xx/patches-5.10/030-v5.17-0002-MIPS-BCM47XX-Add-board-entry-for-Linksys-WRT320N-v1.patch
similarity index 93%
rename from target/linux/bcm47xx/patches-5.10/320-v5.17-MIPS-BCM47XX-Add-board-entry-for-Linksys-WRT320N-v1.patch
rename to target/linux/bcm47xx/patches-5.10/030-v5.17-0002-MIPS-BCM47XX-Add-board-entry-for-Linksys-WRT320N-v1.patch
index f34336edd5..3fb013a585 100644
--- a/target/linux/bcm47xx/patches-5.10/320-v5.17-MIPS-BCM47XX-Add-board-entry-for-Linksys-WRT320N-v1.patch
+++ b/target/linux/bcm47xx/patches-5.10/030-v5.17-0002-MIPS-BCM47XX-Add-board-entry-for-Linksys-WRT320N-v1.patch
@@ -28,7 +28,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  	{{BCM47XX_BOARD_LINKSYS_WRT610NV2, "Linksys WRT610N V2"}, "WRT610N", "2.0"},
 --- a/arch/mips/bcm47xx/buttons.c
 +++ b/arch/mips/bcm47xx/buttons.c
-@@ -277,6 +277,12 @@ bcm47xx_buttons_linksys_wrt310nv1[] __in
+@@ -283,6 +283,12 @@ bcm47xx_buttons_linksys_wrt310n_v2[] __i
  };
  
  static const struct gpio_keys_button
@@ -41,9 +41,9 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
  	BCM47XX_GPIO_KEY(5, KEY_WIMAX),
  	BCM47XX_GPIO_KEY(6, KEY_RESTART),
-@@ -608,6 +614,9 @@ int __init bcm47xx_buttons_register(void
- 	case BCM47XX_BOARD_LINKSYS_WRT310NV1:
- 		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1);
+@@ -617,6 +623,9 @@ int __init bcm47xx_buttons_register(void
+ 	case BCM47XX_BOARD_LINKSYS_WRT310NV2:
+ 		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310n_v2);
  		break;
 +	case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
 +		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt320n_v1);
diff --git a/target/linux/bcm47xx/patches-5.15/324-v5.17-MIPS-BCM47XX-Add-LEDs-and-buttons-for-Asus-RTN-10U.patch b/target/linux/bcm47xx/patches-5.10/030-v5.17-0003-MIPS-BCM47XX-Add-LEDs-and-buttons-for-Asus-RTN-10U.patch
similarity index 94%
rename from target/linux/bcm47xx/patches-5.15/324-v5.17-MIPS-BCM47XX-Add-LEDs-and-buttons-for-Asus-RTN-10U.patch
rename to target/linux/bcm47xx/patches-5.10/030-v5.17-0003-MIPS-BCM47XX-Add-LEDs-and-buttons-for-Asus-RTN-10U.patch
index 23d50ad902..c09140e99d 100644
--- a/target/linux/bcm47xx/patches-5.15/324-v5.17-MIPS-BCM47XX-Add-LEDs-and-buttons-for-Asus-RTN-10U.patch
+++ b/target/linux/bcm47xx/patches-5.10/030-v5.17-0003-MIPS-BCM47XX-Add-LEDs-and-buttons-for-Asus-RTN-10U.patch
@@ -28,7 +28,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  bcm47xx_buttons_asus_rtn12[] __initconst = {
  	BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
  	BCM47XX_GPIO_KEY(1, KEY_RESTART),
-@@ -502,6 +508,9 @@ int __init bcm47xx_buttons_register(void
+@@ -490,6 +496,9 @@ int __init bcm47xx_buttons_register(void
  	int err;
  
  	switch (board) {
@@ -55,7 +55,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  bcm47xx_leds_asus_rtn12[] __initconst = {
  	BCM47XX_GPIO_LED(2, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
  	BCM47XX_GPIO_LED(7, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
-@@ -571,6 +579,9 @@ void __init bcm47xx_leds_register(void)
+@@ -563,6 +571,9 @@ void __init bcm47xx_leds_register(void)
  	enum bcm47xx_board board = bcm47xx_board_get();
  
  	switch (board) {
diff --git a/target/linux/bcm47xx/patches-5.15/321-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-R6300-v1.patch b/target/linux/bcm47xx/patches-5.10/030-v5.17-0004-MIPS-BCM47XX-Add-support-for-Netgear-R6300-v1.patch
similarity index 95%
rename from target/linux/bcm47xx/patches-5.15/321-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-R6300-v1.patch
rename to target/linux/bcm47xx/patches-5.10/030-v5.17-0004-MIPS-BCM47XX-Add-support-for-Netgear-R6300-v1.patch
index 6631e79048..8740942d6f 100644
--- a/target/linux/bcm47xx/patches-5.15/321-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-R6300-v1.patch
+++ b/target/linux/bcm47xx/patches-5.10/030-v5.17-0004-MIPS-BCM47XX-Add-support-for-Netgear-R6300-v1.patch
@@ -26,7 +26,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  	{{BCM47XX_BOARD_NETGEAR_WGR614_V10, "Netgear WGR614 V10"}, "U12H139T01_NETGEAR"},
 --- a/arch/mips/bcm47xx/buttons.c
 +++ b/arch/mips/bcm47xx/buttons.c
-@@ -398,6 +398,11 @@ bcm47xx_buttons_netgear_r6200_v1[] __ini
+@@ -410,6 +410,11 @@ bcm47xx_buttons_netgear_r6200_v1[] __ini
  };
  
  static const struct gpio_keys_button
@@ -38,7 +38,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  bcm47xx_buttons_netgear_wndr3400v1[] __initconst = {
  	BCM47XX_GPIO_KEY(4, KEY_RESTART),
  	BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
-@@ -683,6 +688,9 @@ int __init bcm47xx_buttons_register(void
+@@ -701,6 +706,9 @@ int __init bcm47xx_buttons_register(void
  	case BCM47XX_BOARD_NETGEAR_R6200_V1:
  		err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6200_v1);
  		break;
diff --git a/target/linux/bcm47xx/patches-5.10/322-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-WN2500RP-v1-v2.patch b/target/linux/bcm47xx/patches-5.10/030-v5.17-0005-MIPS-BCM47XX-Add-support-for-Netgear-WN2500RP-v1-v2.patch
similarity index 95%
rename from target/linux/bcm47xx/patches-5.10/322-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-WN2500RP-v1-v2.patch
rename to target/linux/bcm47xx/patches-5.10/030-v5.17-0005-MIPS-BCM47XX-Add-support-for-Netgear-WN2500RP-v1-v2.patch
index 8f66aee192..6975bce952 100644
--- a/target/linux/bcm47xx/patches-5.10/322-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-WN2500RP-v1-v2.patch
+++ b/target/linux/bcm47xx/patches-5.10/030-v5.17-0005-MIPS-BCM47XX-Add-support-for-Netgear-WN2500RP-v1-v2.patch
@@ -27,7 +27,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  	{{BCM47XX_BOARD_NETGEAR_WNDR3400V2, "Netgear WNDR3400 V2"}, "U12H187T00_NETGEAR"},
 --- a/arch/mips/bcm47xx/buttons.c
 +++ b/arch/mips/bcm47xx/buttons.c
-@@ -403,6 +403,12 @@ bcm47xx_buttons_netgear_r6300_v1[] __ini
+@@ -415,6 +415,12 @@ bcm47xx_buttons_netgear_r6300_v1[] __ini
  };
  
  static const struct gpio_keys_button
@@ -40,7 +40,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  bcm47xx_buttons_netgear_wndr3400v1[] __initconst = {
  	BCM47XX_GPIO_KEY(4, KEY_RESTART),
  	BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
-@@ -691,6 +697,9 @@ int __init bcm47xx_buttons_register(void
+@@ -709,6 +715,9 @@ int __init bcm47xx_buttons_register(void
  	case BCM47XX_BOARD_NETGEAR_R6300_V1:
  		err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6300_v1);
  		break;
diff --git a/target/linux/bcm47xx/patches-5.15/323-v6.0-MIPS-BCM47XX-Add-support-for-Netgear-WNR3500L-v2.patch b/target/linux/bcm47xx/patches-5.10/031-v6.0-MIPS-BCM47XX-Add-support-for-Netgear-WNR3500L-v2.patch
similarity index 94%
rename from target/linux/bcm47xx/patches-5.15/323-v6.0-MIPS-BCM47XX-Add-support-for-Netgear-WNR3500L-v2.patch
rename to target/linux/bcm47xx/patches-5.10/031-v6.0-MIPS-BCM47XX-Add-support-for-Netgear-WNR3500L-v2.patch
index 272a74933b..8c2233c804 100644
--- a/target/linux/bcm47xx/patches-5.15/323-v6.0-MIPS-BCM47XX-Add-support-for-Netgear-WNR3500L-v2.patch
+++ b/target/linux/bcm47xx/patches-5.10/031-v6.0-MIPS-BCM47XX-Add-support-for-Netgear-WNR3500L-v2.patch
@@ -36,7 +36,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  	{{BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0708, "Linksys WRT54G/GS/GL"}, "0x0708", "42", "0x10"},
 --- a/arch/mips/bcm47xx/buttons.c
 +++ b/arch/mips/bcm47xx/buttons.c
-@@ -448,6 +448,13 @@ bcm47xx_buttons_netgear_wnr3500lv1[] __i
+@@ -460,6 +460,13 @@ bcm47xx_buttons_netgear_wnr3500lv1[] __i
  };
  
  static const struct gpio_keys_button
@@ -50,7 +50,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  bcm47xx_buttons_netgear_wnr834bv2[] __initconst = {
  	BCM47XX_GPIO_KEY(6, KEY_RESTART),
  };
-@@ -718,6 +725,9 @@ int __init bcm47xx_buttons_register(void
+@@ -736,6 +743,9 @@ int __init bcm47xx_buttons_register(void
  	case BCM47XX_BOARD_NETGEAR_WNR3500L:
  		err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr3500lv1);
  		break;
@@ -62,7 +62,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  		break;
 --- a/arch/mips/bcm47xx/leds.c
 +++ b/arch/mips/bcm47xx/leds.c
-@@ -520,6 +520,14 @@ bcm47xx_leds_netgear_wnr3500lv1[] __init
+@@ -528,6 +528,14 @@ bcm47xx_leds_netgear_wnr3500lv1[] __init
  };
  
  static const struct gpio_led
@@ -77,7 +77,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  bcm47xx_leds_netgear_wnr834bv2[] __initconst = {
  	BCM47XX_GPIO_LED(2, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON),
  	BCM47XX_GPIO_LED(3, "amber", "power", 0, LEDS_GPIO_DEFSTATE_OFF),
-@@ -780,6 +788,9 @@ void __init bcm47xx_leds_register(void)
+@@ -791,6 +799,9 @@ void __init bcm47xx_leds_register(void)
  	case BCM47XX_BOARD_NETGEAR_WNR3500L:
  		bcm47xx_set_pdata(bcm47xx_leds_netgear_wnr3500lv1);
  		break;
diff --git a/target/linux/bcm47xx/patches-5.10/325-v5.17-MIPS-BCM47XX-Define-Linksys-WRT310N-V2-buttons.patch b/target/linux/bcm47xx/patches-5.15/030-v5.17-0001-MIPS-BCM47XX-Define-Linksys-WRT310N-V2-buttons.patch
similarity index 84%
rename from target/linux/bcm47xx/patches-5.10/325-v5.17-MIPS-BCM47XX-Define-Linksys-WRT310N-V2-buttons.patch
rename to target/linux/bcm47xx/patches-5.15/030-v5.17-0001-MIPS-BCM47XX-Define-Linksys-WRT310N-V2-buttons.patch
index 0c23e8aaf5..921825be5c 100644
--- a/target/linux/bcm47xx/patches-5.10/325-v5.17-MIPS-BCM47XX-Define-Linksys-WRT310N-V2-buttons.patch
+++ b/target/linux/bcm47xx/patches-5.15/030-v5.17-0001-MIPS-BCM47XX-Define-Linksys-WRT310N-V2-buttons.patch
@@ -15,7 +15,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
 
 --- a/arch/mips/bcm47xx/buttons.c
 +++ b/arch/mips/bcm47xx/buttons.c
-@@ -289,6 +289,12 @@ bcm47xx_buttons_linksys_wrt320n_v1[] __i
+@@ -277,6 +277,12 @@ bcm47xx_buttons_linksys_wrt310nv1[] __in
  };
  
  static const struct gpio_keys_button
@@ -28,9 +28,9 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
  	BCM47XX_GPIO_KEY(5, KEY_WIMAX),
  	BCM47XX_GPIO_KEY(6, KEY_RESTART),
-@@ -644,6 +650,9 @@ int __init bcm47xx_buttons_register(void
- 	case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
- 		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt320n_v1);
+@@ -608,6 +614,9 @@ int __init bcm47xx_buttons_register(void
+ 	case BCM47XX_BOARD_LINKSYS_WRT310NV1:
+ 		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1);
  		break;
 +	case BCM47XX_BOARD_LINKSYS_WRT310NV2:
 +		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310n_v2);
diff --git a/target/linux/bcm47xx/patches-5.15/320-v5.17-MIPS-BCM47XX-Add-board-entry-for-Linksys-WRT320N-v1.patch b/target/linux/bcm47xx/patches-5.15/030-v5.17-0002-MIPS-BCM47XX-Add-board-entry-for-Linksys-WRT320N-v1.patch
similarity index 93%
rename from target/linux/bcm47xx/patches-5.15/320-v5.17-MIPS-BCM47XX-Add-board-entry-for-Linksys-WRT320N-v1.patch
rename to target/linux/bcm47xx/patches-5.15/030-v5.17-0002-MIPS-BCM47XX-Add-board-entry-for-Linksys-WRT320N-v1.patch
index f34336edd5..3fb013a585 100644
--- a/target/linux/bcm47xx/patches-5.15/320-v5.17-MIPS-BCM47XX-Add-board-entry-for-Linksys-WRT320N-v1.patch
+++ b/target/linux/bcm47xx/patches-5.15/030-v5.17-0002-MIPS-BCM47XX-Add-board-entry-for-Linksys-WRT320N-v1.patch
@@ -28,7 +28,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  	{{BCM47XX_BOARD_LINKSYS_WRT610NV2, "Linksys WRT610N V2"}, "WRT610N", "2.0"},
 --- a/arch/mips/bcm47xx/buttons.c
 +++ b/arch/mips/bcm47xx/buttons.c
-@@ -277,6 +277,12 @@ bcm47xx_buttons_linksys_wrt310nv1[] __in
+@@ -283,6 +283,12 @@ bcm47xx_buttons_linksys_wrt310n_v2[] __i
  };
  
  static const struct gpio_keys_button
@@ -41,9 +41,9 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = {
  	BCM47XX_GPIO_KEY(5, KEY_WIMAX),
  	BCM47XX_GPIO_KEY(6, KEY_RESTART),
-@@ -608,6 +614,9 @@ int __init bcm47xx_buttons_register(void
- 	case BCM47XX_BOARD_LINKSYS_WRT310NV1:
- 		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1);
+@@ -617,6 +623,9 @@ int __init bcm47xx_buttons_register(void
+ 	case BCM47XX_BOARD_LINKSYS_WRT310NV2:
+ 		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310n_v2);
  		break;
 +	case BCM47XX_BOARD_LINKSYS_WRT320N_V1:
 +		err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt320n_v1);
diff --git a/target/linux/bcm47xx/patches-5.10/324-v5.17-MIPS-BCM47XX-Add-LEDs-and-buttons-for-Asus-RTN-10U.patch b/target/linux/bcm47xx/patches-5.15/030-v5.17-0003-MIPS-BCM47XX-Add-LEDs-and-buttons-for-Asus-RTN-10U.patch
similarity index 94%
rename from target/linux/bcm47xx/patches-5.10/324-v5.17-MIPS-BCM47XX-Add-LEDs-and-buttons-for-Asus-RTN-10U.patch
rename to target/linux/bcm47xx/patches-5.15/030-v5.17-0003-MIPS-BCM47XX-Add-LEDs-and-buttons-for-Asus-RTN-10U.patch
index 23d50ad902..c09140e99d 100644
--- a/target/linux/bcm47xx/patches-5.10/324-v5.17-MIPS-BCM47XX-Add-LEDs-and-buttons-for-Asus-RTN-10U.patch
+++ b/target/linux/bcm47xx/patches-5.15/030-v5.17-0003-MIPS-BCM47XX-Add-LEDs-and-buttons-for-Asus-RTN-10U.patch
@@ -28,7 +28,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  bcm47xx_buttons_asus_rtn12[] __initconst = {
  	BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON),
  	BCM47XX_GPIO_KEY(1, KEY_RESTART),
-@@ -502,6 +508,9 @@ int __init bcm47xx_buttons_register(void
+@@ -490,6 +496,9 @@ int __init bcm47xx_buttons_register(void
  	int err;
  
  	switch (board) {
@@ -55,7 +55,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  bcm47xx_leds_asus_rtn12[] __initconst = {
  	BCM47XX_GPIO_LED(2, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON),
  	BCM47XX_GPIO_LED(7, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF),
-@@ -571,6 +579,9 @@ void __init bcm47xx_leds_register(void)
+@@ -563,6 +571,9 @@ void __init bcm47xx_leds_register(void)
  	enum bcm47xx_board board = bcm47xx_board_get();
  
  	switch (board) {
diff --git a/target/linux/bcm47xx/patches-5.10/321-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-R6300-v1.patch b/target/linux/bcm47xx/patches-5.15/030-v5.17-0004-MIPS-BCM47XX-Add-support-for-Netgear-R6300-v1.patch
similarity index 95%
rename from target/linux/bcm47xx/patches-5.10/321-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-R6300-v1.patch
rename to target/linux/bcm47xx/patches-5.15/030-v5.17-0004-MIPS-BCM47XX-Add-support-for-Netgear-R6300-v1.patch
index 6631e79048..8740942d6f 100644
--- a/target/linux/bcm47xx/patches-5.10/321-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-R6300-v1.patch
+++ b/target/linux/bcm47xx/patches-5.15/030-v5.17-0004-MIPS-BCM47XX-Add-support-for-Netgear-R6300-v1.patch
@@ -26,7 +26,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  	{{BCM47XX_BOARD_NETGEAR_WGR614_V10, "Netgear WGR614 V10"}, "U12H139T01_NETGEAR"},
 --- a/arch/mips/bcm47xx/buttons.c
 +++ b/arch/mips/bcm47xx/buttons.c
-@@ -398,6 +398,11 @@ bcm47xx_buttons_netgear_r6200_v1[] __ini
+@@ -410,6 +410,11 @@ bcm47xx_buttons_netgear_r6200_v1[] __ini
  };
  
  static const struct gpio_keys_button
@@ -38,7 +38,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  bcm47xx_buttons_netgear_wndr3400v1[] __initconst = {
  	BCM47XX_GPIO_KEY(4, KEY_RESTART),
  	BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
-@@ -683,6 +688,9 @@ int __init bcm47xx_buttons_register(void
+@@ -701,6 +706,9 @@ int __init bcm47xx_buttons_register(void
  	case BCM47XX_BOARD_NETGEAR_R6200_V1:
  		err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6200_v1);
  		break;
diff --git a/target/linux/bcm47xx/patches-5.15/322-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-WN2500RP-v1-v2.patch b/target/linux/bcm47xx/patches-5.15/030-v5.17-0005-MIPS-BCM47XX-Add-support-for-Netgear-WN2500RP-v1-v2.patch
similarity index 95%
rename from target/linux/bcm47xx/patches-5.15/322-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-WN2500RP-v1-v2.patch
rename to target/linux/bcm47xx/patches-5.15/030-v5.17-0005-MIPS-BCM47XX-Add-support-for-Netgear-WN2500RP-v1-v2.patch
index 8f66aee192..6975bce952 100644
--- a/target/linux/bcm47xx/patches-5.15/322-v5.17-MIPS-BCM47XX-Add-support-for-Netgear-WN2500RP-v1-v2.patch
+++ b/target/linux/bcm47xx/patches-5.15/030-v5.17-0005-MIPS-BCM47XX-Add-support-for-Netgear-WN2500RP-v1-v2.patch
@@ -27,7 +27,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  	{{BCM47XX_BOARD_NETGEAR_WNDR3400V2, "Netgear WNDR3400 V2"}, "U12H187T00_NETGEAR"},
 --- a/arch/mips/bcm47xx/buttons.c
 +++ b/arch/mips/bcm47xx/buttons.c
-@@ -403,6 +403,12 @@ bcm47xx_buttons_netgear_r6300_v1[] __ini
+@@ -415,6 +415,12 @@ bcm47xx_buttons_netgear_r6300_v1[] __ini
  };
  
  static const struct gpio_keys_button
@@ -40,7 +40,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  bcm47xx_buttons_netgear_wndr3400v1[] __initconst = {
  	BCM47XX_GPIO_KEY(4, KEY_RESTART),
  	BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON),
-@@ -691,6 +697,9 @@ int __init bcm47xx_buttons_register(void
+@@ -709,6 +715,9 @@ int __init bcm47xx_buttons_register(void
  	case BCM47XX_BOARD_NETGEAR_R6300_V1:
  		err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6300_v1);
  		break;
diff --git a/target/linux/bcm47xx/patches-5.10/323-v6.0-MIPS-BCM47XX-Add-support-for-Netgear-WNR3500L-v2.patch b/target/linux/bcm47xx/patches-5.15/031-v6.0-MIPS-BCM47XX-Add-support-for-Netgear-WNR3500L-v2.patch
similarity index 94%
rename from target/linux/bcm47xx/patches-5.10/323-v6.0-MIPS-BCM47XX-Add-support-for-Netgear-WNR3500L-v2.patch
rename to target/linux/bcm47xx/patches-5.15/031-v6.0-MIPS-BCM47XX-Add-support-for-Netgear-WNR3500L-v2.patch
index 272a74933b..8c2233c804 100644
--- a/target/linux/bcm47xx/patches-5.10/323-v6.0-MIPS-BCM47XX-Add-support-for-Netgear-WNR3500L-v2.patch
+++ b/target/linux/bcm47xx/patches-5.15/031-v6.0-MIPS-BCM47XX-Add-support-for-Netgear-WNR3500L-v2.patch
@@ -36,7 +36,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  	{{BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0708, "Linksys WRT54G/GS/GL"}, "0x0708", "42", "0x10"},
 --- a/arch/mips/bcm47xx/buttons.c
 +++ b/arch/mips/bcm47xx/buttons.c
-@@ -448,6 +448,13 @@ bcm47xx_buttons_netgear_wnr3500lv1[] __i
+@@ -460,6 +460,13 @@ bcm47xx_buttons_netgear_wnr3500lv1[] __i
  };
  
  static const struct gpio_keys_button
@@ -50,7 +50,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  bcm47xx_buttons_netgear_wnr834bv2[] __initconst = {
  	BCM47XX_GPIO_KEY(6, KEY_RESTART),
  };
-@@ -718,6 +725,9 @@ int __init bcm47xx_buttons_register(void
+@@ -736,6 +743,9 @@ int __init bcm47xx_buttons_register(void
  	case BCM47XX_BOARD_NETGEAR_WNR3500L:
  		err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr3500lv1);
  		break;
@@ -62,7 +62,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  		break;
 --- a/arch/mips/bcm47xx/leds.c
 +++ b/arch/mips/bcm47xx/leds.c
-@@ -520,6 +520,14 @@ bcm47xx_leds_netgear_wnr3500lv1[] __init
+@@ -528,6 +528,14 @@ bcm47xx_leds_netgear_wnr3500lv1[] __init
  };
  
  static const struct gpio_led
@@ -77,7 +77,7 @@ Signed-off-by: Thomas Bogendoerfer <tsbogend at alpha.franken.de>
  bcm47xx_leds_netgear_wnr834bv2[] __initconst = {
  	BCM47XX_GPIO_LED(2, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON),
  	BCM47XX_GPIO_LED(3, "amber", "power", 0, LEDS_GPIO_DEFSTATE_OFF),
-@@ -780,6 +788,9 @@ void __init bcm47xx_leds_register(void)
+@@ -791,6 +799,9 @@ void __init bcm47xx_leds_register(void)
  	case BCM47XX_BOARD_NETGEAR_WNR3500L:
  		bcm47xx_set_pdata(bcm47xx_leds_netgear_wnr3500lv1);
  		break;



From lede-commits at lists.infradead.org  Mon Feb 27 02:12:02 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Mon, 27 Feb 2023 05:12:02 -0500
Subject: [openwrt/openwrt]  bcm47xx: fix bgmac support for BCM5358
In-Reply-To: <167749272219.1684982.17979314990243676865@git-01.infra.openwrt.org>
References: <167749272219.1684982.17979314990243676865@git-01.infra.openwrt.org>
Message-ID: <mailman.19337.1677492732.3064139.lede-commits@lists.infradead.org>

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

commit 5e48c534f7c6b3a861f4a2dbb81d7bfcd9606f61
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Mon Feb 27 09:46:14 2023 +0000

    bcm47xx: fix bgmac support for BCM5358
    
    Fix two long-standing regressions.
    
    Fixes: https://github.com/openwrt/openwrt/issues/8278
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 ...ix-BCM5358-support-by-setting-correct-fla.patch | 46 +++++++++++++
 ...fix-initial-chip-reset-to-support-BCM5358.patch | 76 ++++++++++++++++++++++
 ...ix-BCM5358-support-by-setting-correct-fla.patch | 46 +++++++++++++
 ...fix-initial-chip-reset-to-support-BCM5358.patch | 76 ++++++++++++++++++++++
 4 files changed, 244 insertions(+)

diff --git a/target/linux/bcm47xx/patches-5.10/070-net-bgmac-fix-BCM5358-support-by-setting-correct-fla.patch b/target/linux/bcm47xx/patches-5.10/070-net-bgmac-fix-BCM5358-support-by-setting-correct-fla.patch
new file mode 100644
index 0000000000..f93fc0cd8d
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.10/070-net-bgmac-fix-BCM5358-support-by-setting-correct-fla.patch
@@ -0,0 +1,46 @@
+From d61615c366a489646a1bfe5b33455f916762d5f4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Wed, 8 Feb 2023 10:16:37 +0100
+Subject: [PATCH] net: bgmac: fix BCM5358 support by setting correct flags
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Code blocks handling BCMA_CHIP_ID_BCM5357 and BCMA_CHIP_ID_BCM53572 were
+incorrectly unified. Chip package values are not unique and cannot be
+checked independently. They are meaningful only in a context of a given
+chip.
+
+Packages BCM5358 and BCM47188 share the same value but then belong to
+different chips. Code unification resulted in treating BCM5358 as
+BCM47188 and broke its initialization.
+
+Link: https://github.com/openwrt/openwrt/issues/8278
+Fixes: cb1b0f90acfe ("net: ethernet: bgmac: unify code of the same family")
+Cc: Jon Mason <jdmason at kudzu.us>
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Link: https://lore.kernel.org/r/20230208091637.16291-1-zajec5 at gmail.com
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
+---
+ drivers/net/ethernet/broadcom/bgmac-bcma.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
++++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
+@@ -240,12 +240,12 @@ static int bgmac_probe(struct bcma_devic
+ 		bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST;
+ 		bgmac->feature_flags |= BGMAC_FEAT_FLW_CTRL1;
+ 		bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_PHY;
+-		if (ci->pkg == BCMA_PKG_ID_BCM47188 ||
+-		    ci->pkg == BCMA_PKG_ID_BCM47186) {
++		if ((ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM47186) ||
++		    (ci->id == BCMA_CHIP_ID_BCM53572 && ci->pkg == BCMA_PKG_ID_BCM47188)) {
+ 			bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_RGMII;
+ 			bgmac->feature_flags |= BGMAC_FEAT_IOST_ATTACHED;
+ 		}
+-		if (ci->pkg == BCMA_PKG_ID_BCM5358)
++		if (ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM5358)
+ 			bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_EPHYRMII;
+ 		break;
+ 	case BCMA_CHIP_ID_BCM53573:
diff --git a/target/linux/bcm47xx/patches-5.10/170-bgmac-fix-initial-chip-reset-to-support-BCM5358.patch b/target/linux/bcm47xx/patches-5.10/170-bgmac-fix-initial-chip-reset-to-support-BCM5358.patch
new file mode 100644
index 0000000000..91611d8004
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.10/170-bgmac-fix-initial-chip-reset-to-support-BCM5358.patch
@@ -0,0 +1,76 @@
+From 327dabbd0111910a7d174b0b812d608d6b67bead Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Mon, 8 Aug 2022 23:05:25 +0200
+Subject: [PATCH] bgmac: fix *initial* chip reset to support BCM5358
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+While bringing hardware up we should perform a full reset including the
+switch bit (BGMAC_BCMA_IOCTL_SW_RESET aka SICF_SWRST). It's what
+specification says and what reference driver does.
+
+This seems to be critical for the BCM5358. Without this hardware doesn't
+get initialized properly and doesn't seem to transmit or receive any
+packets.
+
+Originally bgmac was calling bgmac_chip_reset() before setting
+"has_robosw" property which resulted in expected behaviour. That has
+changed as a side effect of adding platform device support which
+regressed BCM5358 support.
+
+Fixes: f6a95a24957a ("net: ethernet: bgmac: Add platform device support")
+Cc: Jon Mason <jdmason at kudzu.us>
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+---
+ drivers/net/ethernet/broadcom/bgmac.c | 8 ++++++--
+ drivers/net/ethernet/broadcom/bgmac.h | 2 ++
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/ethernet/broadcom/bgmac.c
++++ b/drivers/net/ethernet/broadcom/bgmac.c
+@@ -891,13 +891,13 @@ static void bgmac_chip_reset_idm_config(
+ 
+ 		if (iost & BGMAC_BCMA_IOST_ATTACHED) {
+ 			flags = BGMAC_BCMA_IOCTL_SW_CLKEN;
+-			if (!bgmac->has_robosw)
++			if (bgmac->in_init || !bgmac->has_robosw)
+ 				flags |= BGMAC_BCMA_IOCTL_SW_RESET;
+ 		}
+ 		bgmac_clk_enable(bgmac, flags);
+ 	}
+ 
+-	if (iost & BGMAC_BCMA_IOST_ATTACHED && !bgmac->has_robosw)
++	if (iost & BGMAC_BCMA_IOST_ATTACHED && (bgmac->in_init || !bgmac->has_robosw))
+ 		bgmac_idm_write(bgmac, BCMA_IOCTL,
+ 				bgmac_idm_read(bgmac, BCMA_IOCTL) &
+ 				~BGMAC_BCMA_IOCTL_SW_RESET);
+@@ -1502,6 +1502,8 @@ int bgmac_enet_probe(struct bgmac *bgmac
+ 	struct net_device *net_dev = bgmac->net_dev;
+ 	int err;
+ 
++	bgmac->in_init = true;
++
+ 	bgmac_chip_intrs_off(bgmac);
+ 
+ 	net_dev->irq = bgmac->irq;
+@@ -1562,6 +1564,8 @@ int bgmac_enet_probe(struct bgmac *bgmac
+ 			bgmac->b53_device = &bgmac_b53_dev;
+ 	}
+ 
++	bgmac->in_init = false;
++
+ 	err = register_netdev(bgmac->net_dev);
+ 	if (err) {
+ 		dev_err(bgmac->dev, "Cannot register net device\n");
+--- a/drivers/net/ethernet/broadcom/bgmac.h
++++ b/drivers/net/ethernet/broadcom/bgmac.h
+@@ -513,6 +513,8 @@ struct bgmac {
+ 	int irq;
+ 	u32 int_mask;
+ 
++	bool in_init;
++
+ 	/* Current MAC state */
+ 	int mac_speed;
+ 	int mac_duplex;
diff --git a/target/linux/bcm47xx/patches-5.15/070-net-bgmac-fix-BCM5358-support-by-setting-correct-fla.patch b/target/linux/bcm47xx/patches-5.15/070-net-bgmac-fix-BCM5358-support-by-setting-correct-fla.patch
new file mode 100644
index 0000000000..f93fc0cd8d
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/070-net-bgmac-fix-BCM5358-support-by-setting-correct-fla.patch
@@ -0,0 +1,46 @@
+From d61615c366a489646a1bfe5b33455f916762d5f4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Wed, 8 Feb 2023 10:16:37 +0100
+Subject: [PATCH] net: bgmac: fix BCM5358 support by setting correct flags
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Code blocks handling BCMA_CHIP_ID_BCM5357 and BCMA_CHIP_ID_BCM53572 were
+incorrectly unified. Chip package values are not unique and cannot be
+checked independently. They are meaningful only in a context of a given
+chip.
+
+Packages BCM5358 and BCM47188 share the same value but then belong to
+different chips. Code unification resulted in treating BCM5358 as
+BCM47188 and broke its initialization.
+
+Link: https://github.com/openwrt/openwrt/issues/8278
+Fixes: cb1b0f90acfe ("net: ethernet: bgmac: unify code of the same family")
+Cc: Jon Mason <jdmason at kudzu.us>
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+Reviewed-by: Florian Fainelli <f.fainelli at gmail.com>
+Link: https://lore.kernel.org/r/20230208091637.16291-1-zajec5 at gmail.com
+Signed-off-by: Jakub Kicinski <kuba at kernel.org>
+---
+ drivers/net/ethernet/broadcom/bgmac-bcma.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
++++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
+@@ -240,12 +240,12 @@ static int bgmac_probe(struct bcma_devic
+ 		bgmac->feature_flags |= BGMAC_FEAT_CLKCTLST;
+ 		bgmac->feature_flags |= BGMAC_FEAT_FLW_CTRL1;
+ 		bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_PHY;
+-		if (ci->pkg == BCMA_PKG_ID_BCM47188 ||
+-		    ci->pkg == BCMA_PKG_ID_BCM47186) {
++		if ((ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM47186) ||
++		    (ci->id == BCMA_CHIP_ID_BCM53572 && ci->pkg == BCMA_PKG_ID_BCM47188)) {
+ 			bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_RGMII;
+ 			bgmac->feature_flags |= BGMAC_FEAT_IOST_ATTACHED;
+ 		}
+-		if (ci->pkg == BCMA_PKG_ID_BCM5358)
++		if (ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg == BCMA_PKG_ID_BCM5358)
+ 			bgmac->feature_flags |= BGMAC_FEAT_SW_TYPE_EPHYRMII;
+ 		break;
+ 	case BCMA_CHIP_ID_BCM53573:
diff --git a/target/linux/bcm47xx/patches-5.15/170-bgmac-fix-initial-chip-reset-to-support-BCM5358.patch b/target/linux/bcm47xx/patches-5.15/170-bgmac-fix-initial-chip-reset-to-support-BCM5358.patch
new file mode 100644
index 0000000000..f5f998e0f5
--- /dev/null
+++ b/target/linux/bcm47xx/patches-5.15/170-bgmac-fix-initial-chip-reset-to-support-BCM5358.patch
@@ -0,0 +1,76 @@
+From 327dabbd0111910a7d174b0b812d608d6b67bead Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Mon, 8 Aug 2022 23:05:25 +0200
+Subject: [PATCH] bgmac: fix *initial* chip reset to support BCM5358
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+While bringing hardware up we should perform a full reset including the
+switch bit (BGMAC_BCMA_IOCTL_SW_RESET aka SICF_SWRST). It's what
+specification says and what reference driver does.
+
+This seems to be critical for the BCM5358. Without this hardware doesn't
+get initialized properly and doesn't seem to transmit or receive any
+packets.
+
+Originally bgmac was calling bgmac_chip_reset() before setting
+"has_robosw" property which resulted in expected behaviour. That has
+changed as a side effect of adding platform device support which
+regressed BCM5358 support.
+
+Fixes: f6a95a24957a ("net: ethernet: bgmac: Add platform device support")
+Cc: Jon Mason <jdmason at kudzu.us>
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+---
+ drivers/net/ethernet/broadcom/bgmac.c | 8 ++++++--
+ drivers/net/ethernet/broadcom/bgmac.h | 2 ++
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/ethernet/broadcom/bgmac.c
++++ b/drivers/net/ethernet/broadcom/bgmac.c
+@@ -891,13 +891,13 @@ static void bgmac_chip_reset_idm_config(
+ 
+ 		if (iost & BGMAC_BCMA_IOST_ATTACHED) {
+ 			flags = BGMAC_BCMA_IOCTL_SW_CLKEN;
+-			if (!bgmac->has_robosw)
++			if (bgmac->in_init || !bgmac->has_robosw)
+ 				flags |= BGMAC_BCMA_IOCTL_SW_RESET;
+ 		}
+ 		bgmac_clk_enable(bgmac, flags);
+ 	}
+ 
+-	if (iost & BGMAC_BCMA_IOST_ATTACHED && !bgmac->has_robosw)
++	if (iost & BGMAC_BCMA_IOST_ATTACHED && (bgmac->in_init || !bgmac->has_robosw))
+ 		bgmac_idm_write(bgmac, BCMA_IOCTL,
+ 				bgmac_idm_read(bgmac, BCMA_IOCTL) &
+ 				~BGMAC_BCMA_IOCTL_SW_RESET);
+@@ -1502,6 +1502,8 @@ int bgmac_enet_probe(struct bgmac *bgmac
+ 	struct net_device *net_dev = bgmac->net_dev;
+ 	int err;
+ 
++	bgmac->in_init = true;
++
+ 	bgmac_chip_intrs_off(bgmac);
+ 
+ 	net_dev->irq = bgmac->irq;
+@@ -1562,6 +1564,8 @@ int bgmac_enet_probe(struct bgmac *bgmac
+ 			bgmac->b53_device = &bgmac_b53_dev;
+ 	}
+ 
++	bgmac->in_init = false;
++
+ 	err = register_netdev(bgmac->net_dev);
+ 	if (err) {
+ 		dev_err(bgmac->dev, "Cannot register net device\n");
+--- a/drivers/net/ethernet/broadcom/bgmac.h
++++ b/drivers/net/ethernet/broadcom/bgmac.h
+@@ -475,6 +475,8 @@ struct bgmac {
+ 	int irq;
+ 	u32 int_mask;
+ 
++	bool in_init;
++
+ 	/* Current MAC state */
+ 	int mac_speed;
+ 	int mac_duplex;



From lede-commits at lists.infradead.org  Tue Feb 28 01:05:54 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Tue, 28 Feb 2023 04:05:54 -0500
Subject: [openwrt/openwrt]  fstools: update to the latest master
In-Reply-To: <167757515450.2736633.2671588160978959494@git-01.infra.openwrt.org>
References: <167757515450.2736633.2671588160978959494@git-01.infra.openwrt.org>
Message-ID: <mailman.19680.1677575172.3064139.lede-commits@lists.infradead.org>

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

commit fdd1af9a448c23fa4adb515f09b7d2848003fbf7
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Tue Feb 28 10:04:56 2023 +0100

    fstools: update to the latest master
    
    bfe882d libblkid-tiny: add exfat superblock support
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 package/system/fstools/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/system/fstools/Makefile b/package/system/fstools/Makefile
index b08fe541bd..912ed80ba2 100644
--- a/package/system/fstools/Makefile
+++ b/package/system/fstools/Makefile
@@ -12,9 +12,9 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(PROJECT_GIT)/project/fstools.git
-PKG_MIRROR_HASH:=dbb3d721eb606606c2fc0875067449e5c882d22affaa8dc70367daff7c198152
-PKG_SOURCE_DATE:=2023-02-15
-PKG_SOURCE_VERSION:=12155d3881b9bdd44b8682970638dbfd9f55e2cb
+PKG_MIRROR_HASH:=4ec370a1cdc9fa69131f1403b064d2e05d54ee865411917410d7540454265319
+PKG_SOURCE_DATE:=2023-02-28
+PKG_SOURCE_VERSION:=bfe882d5ff4eeebb8f57c8a0f9b9e767a57870d8
 CMAKE_INSTALL:=1
 
 PKG_LICENSE:=GPL-2.0



From lede-commits at lists.infradead.org  Tue Feb 28 23:55:05 2023
From: lede-commits at lists.infradead.org (LEDE Commits)
Date: Wed, 01 Mar 2023 02:55:05 -0500
Subject: [openwrt/openwrt]  kernel: support "linux,default-trigger" in
 leds-bcm63138
In-Reply-To: <167765730561.3794716.11324577277093602120@git-01.infra.openwrt.org>
References: <167765730561.3794716.11324577277093602120@git-01.infra.openwrt.org>
Message-ID: <mailman.19937.1677657313.3064139.lede-commits@lists.infradead.org>

rmilecki pushed a commit to openwrt/openwrt.git, branch openwrt-21.02:
https://git.openwrt.org/f86f8e568461681fc85caf3c972489045367030e

commit f86f8e568461681fc85caf3c972489045367030e
Author: Rafa? Mi?ecki <rafal at milecki.pl>
AuthorDate: Wed Mar 1 08:52:26 2023 +0100

    kernel: support "linux,default-trigger" in leds-bcm63138
    
    This driver is backported from the v6.0 which deals with
    "linux,default-trigger" in leds core. For kernel 5.4 we need
    leds-bcm63138 to read trigger on its own.
    
    Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
---
 ...eds-bcm63138-read-default-trigger-from-OF.patch | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/target/linux/generic/hack-5.4/800-leds-leds-bcm63138-read-default-trigger-from-OF.patch b/target/linux/generic/hack-5.4/800-leds-leds-bcm63138-read-default-trigger-from-OF.patch
new file mode 100644
index 0000000000..684bb9f842
--- /dev/null
+++ b/target/linux/generic/hack-5.4/800-leds-leds-bcm63138-read-default-trigger-from-OF.patch
@@ -0,0 +1,26 @@
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal at milecki.pl>
+Date: Tue, 28 Feb 2023 23:38:30 +0100
+Subject: [PATCH] leds: leds-bcm63138: read default trigger from OF
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It's needed in kernels older than 5.10 due to the missing commit
+c49d6cab0d7f ("leds: parse linux,default-trigger DT property in LED
+core").
+
+Signed-off-by: Rafa? Mi?ecki <rafal at milecki.pl>
+---
+ drivers/leds/blink/leds-bcm63138.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/leds/blink/leds-bcm63138.c
++++ b/drivers/leds/blink/leds-bcm63138.c
+@@ -228,6 +228,7 @@ static void bcm63138_leds_create_led(str
+ 	led->cdev.max_brightness = BCM63138_MAX_BRIGHTNESS;
+ 	led->cdev.brightness_set = bcm63138_leds_brightness_set;
+ 	led->cdev.blink_set = bcm63138_leds_blink_set;
++	led->cdev.default_trigger = of_get_property(np, "linux,default-trigger", NULL);
+ 
+ 	err = devm_led_classdev_register_ext(dev, &led->cdev, &init_data);
+ 	if (err) {



