[][mac80211][wifi6][mt76][Bring-up hardware path for Cheetah MT76]
[Description]
Add hardware path support for Cheetah MT76 driver.
If without this patch, Cheetah MT76 driver is not able
to accelerate WLAN<->ETH traffic in hardware path.
[Release-log]
N/A
Change-Id: Ib0e2b44c4e36bea6be0eb4368e1faf32879b43bf
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/8086776
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3002-dts-mt7986-wed-changes.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3002-dts-netsys2-wed-changes.patch
similarity index 68%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3002-dts-mt7986-wed-changes.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3002-dts-netsys2-wed-changes.patch
index 97a66ba..eacae85 100644
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3002-dts-mt7986-wed-changes.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3002-dts-netsys2-wed-changes.patch
@@ -118,6 +118,62 @@
#reset-cells = <1>;
#address-cells = <1>;
#size-cells = <0>;
+diff --git a/arch/arm64/boot/dts/mediatek/mt7981.dtsi b/arch/arm64/boot/dts/mediatek/mt7981.dtsi
+index ccaf0ad0..b2f53b13 100644
+--- a/arch/arm64/boot/dts/mediatek/mt7981.dtsi
++++ b/arch/arm64/boot/dts/mediatek/mt7981.dtsi
+@@ -90,22 +90,12 @@
+ #io-channel-cells = <1>;
+ };
+
+- wed: wed@15010000 {
+- compatible = "mediatek,wed";
+- wed_num = <2>;
+- /* add this property for wed get the pci slot number. */
+- pci_slot_map = <0>, <1>;
+- reg = <0 0x15010000 0 0x1000>,
+- <0 0x15011000 0 0x1000>;
++ wed0: wed@15010000 {
++ compatible = "mediatek,mt7981-wed",
++ "syscon";
++ reg = <0 0x15010000 0 0x1000>;
+ interrupt-parent = <&gic>;
+- interrupts = <GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH>,
+- <GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH>;
+- };
+-
+- wdma: wdma@15104800 {
+- compatible = "mediatek,wed-wdma";
+- reg = <0 0x15104800 0 0x400>,
+- <0 0x15104c00 0 0x400>;
++ interrupts = <GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH>;
+ };
+
+ ap2woccif: ap2woccif@151A5000 {
+@@ -423,6 +413,7 @@
+ mediatek,ethsys = <ðsys>;
+ mediatek,sgmiisys = <&sgmiisys0>, <&sgmiisys1>;
+ mediatek,infracfg = <&topmisc>;
++ mediatek,wed = <&wed0>;
+ #reset-cells = <1>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+diff --git a/arch/arm64/boot/dts/mediatek/mt7981-spim-nor-rfb.dts b/arch/arm64/boot/dts/mediatek/mt7981-spim-nor-rfb.dts
+index 3fa55a07..f5c70a4e 100755
+--- a/arch/arm64/boot/dts/mediatek/mt7981-spim-nor-rfb.dts
++++ b/arch/arm64/boot/dts/mediatek/mt7981-spim-nor-rfb.dts
+@@ -211,11 +211,3 @@
+ &xhci {
+ status = "okay";
+ };
+-
+-&wed {
+- dy_txbm_enable = "true";
+- dy_txbm_budget = <8>;
+- txbm_init_sz = <8>;
+- txbm_max_sz = <32>;
+- status = "okay";
+-};
--
2.18.0
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3004-ethernet-update-ppe-from-mt7622-to-mt7986.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3004-ethernet-update-ppe-from-netsys1-to-netsys2.patch
similarity index 100%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3004-ethernet-update-ppe-from-mt7622-to-mt7986.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3004-ethernet-update-ppe-from-netsys1-to-netsys2.patch
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3006-add-wed-tx-support-for-mt7986.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3006-add-wed-tx-support-for-netsys2.patch
similarity index 98%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3006-add-wed-tx-support-for-mt7986.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3006-add-wed-tx-support-for-netsys2.patch
index 3e0a0f1..1cfa774 100644
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3006-add-wed-tx-support-for-mt7986.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3006-add-wed-tx-support-for-netsys2.patch
@@ -55,6 +55,18 @@
};
ap2woccif: ap2woccif@151A5000 {
+diff --git a/arch/arm64/boot/dts/mediatek/mt7981.dtsi b/arch/arm64/boot/dts/mediatek/mt7981.dtsi
+index b2f53b13..d34943e7 100644
+--- a/arch/arm64/boot/dts/mediatek/mt7981.dtsi
++++ b/arch/arm64/boot/dts/mediatek/mt7981.dtsi
+@@ -96,6 +96,7 @@
+ reg = <0 0x15010000 0 0x1000>;
+ interrupt-parent = <&gic>;
+ interrupts = <GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH>;
++ mediatek,wed_pcie = <&wed_pcie>;
+ };
+
+ ap2woccif: ap2woccif@151A5000 {
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index ee5e0c6..2cab49a 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3007-add-wed-tx-wds-support-for-mt7986.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3007-add-wed-tx-wds-support-for-netsys2.patch
similarity index 100%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3007-add-wed-tx-wds-support-for-mt7986.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3007-add-wed-tx-wds-support-for-netsys2.patch
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3008-add-wed-rx-support-for-mt7896.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3008-add-wed-rx-support-for-netsys2.patch
similarity index 97%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3008-add-wed-rx-support-for-mt7896.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3008-add-wed-rx-support-for-netsys2.patch
index 92f50bf..7efa9df 100644
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3008-add-wed-rx-support-for-mt7896.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3008-add-wed-rx-support-for-netsys2.patch
@@ -168,6 +168,50 @@
resets = <ðsysrst 0>;
reset-names = "wocpu_rst";
+diff --git a/arch/arm64/boot/dts/mediatek/mt7981.dtsi b/arch/arm64/boot/dts/mediatek/mt7981.dtsi
+index d34943e7..512fb5d6 100644
+--- a/arch/arm64/boot/dts/mediatek/mt7981.dtsi
++++ b/arch/arm64/boot/dts/mediatek/mt7981.dtsi
+@@ -97,26 +97,29 @@
+ interrupt-parent = <&gic>;
+ interrupts = <GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH>;
+ mediatek,wed_pcie = <&wed_pcie>;
++ mediatek,ap2woccif = <&ap2woccif0>;
++ mediatek,wocpu_ilm = <&wocpu0_ilm>;
++ mediatek,wocpu_dlm = <&wocpu0_dlm>;
++ mediatek,wocpu_boot = <&cpu_boot>;
++ mediatek,wocpu_emi = <&wocpu0_emi>;
++ mediatek,wocpu_data = <&wocpu_data>;
+ };
+
+- ap2woccif: ap2woccif@151A5000 {
+- compatible = "mediatek,ap2woccif";
+- reg = <0 0x151A5000 0 0x1000>,
+- <0 0x151AD000 0 0x1000>;
++ ap2woccif0: ap2woccif@151A5000 {
++ compatible = "mediatek,ap2woccif", "syscon";
++ reg = <0 0x151A5000 0 0x1000>;
+ interrupt-parent = <&gic>;
+- interrupts = <GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH>,
+- <GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH>;
+- };
++ interrupts = <GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH>;
++ };
+
+ wocpu0_ilm: wocpu0_ilm@151E0000 {
+ compatible = "mediatek,wocpu0_ilm";
+ reg = <0 0x151E0000 0 0x8000>;
+ };
+
+- wocpu_dlm: wocpu_dlm@151E8000 {
++ wocpu0_dlm: wocpu_dlm@151E8000 {
+ compatible = "mediatek,wocpu_dlm";
+- reg = <0 0x151E8000 0 0x2000>,
+- <0 0x151F8000 0 0x2000>;
++ reg = <0 0x151E8000 0 0x2000>;
+
+ resets = <ðsysrst 0>;
+ reset-names = "wocpu_rst";
diff --git a/drivers/net/ethernet/mediatek/Makefile b/drivers/net/ethernet/mediatek/Makefile
index 4090132..fdbb90f 100644
--- a/drivers/net/ethernet/mediatek/Makefile
@@ -1610,7 +1654,7 @@
index 0000000..96e30a3
--- /dev/null
+++ b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
-@@ -0,0 +1,586 @@
+@@ -0,0 +1,590 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include <linux/skbuff.h>
@@ -1855,7 +1899,11 @@
+ u32 ofs = 0;
+ u32 boot_cr, val;
+
-+ mcu = wo->hw->index ? MT7986_FIRMWARE_WO_2 : MT7986_FIRMWARE_WO_1;
++ if (of_device_is_compatible(wo->hw->node, "mediatek,mt7981-wed"))
++ mcu = MT7981_FIRMWARE_WO;
++ else
++ mcu = wo->hw->index ? MT7986_FIRMWARE_WO_2 :
++ MT7986_FIRMWARE_WO_1;
+
+ ret = request_firmware(&fw, mcu, wo->hw->dev);
+ if (ret)
@@ -2202,7 +2250,7 @@
index 0000000..19e1199
--- /dev/null
+++ b/drivers/net/ethernet/mediatek/mtk_wed_mcu.h
-@@ -0,0 +1,96 @@
+@@ -0,0 +1,97 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#ifndef __MTK_WED_MCU_H
@@ -2221,6 +2269,7 @@
+#define WARP_OK_STATUS (0)
+#define WARP_ALREADY_DONE_STATUS (1)
+
++#define MT7981_FIRMWARE_WO "mediatek/mt7981_wo.bin"
+#define MT7986_FIRMWARE_WO_1 "mediatek/mt7986_wo_0.bin"
+#define MT7986_FIRMWARE_WO_2 "mediatek/mt7986_wo_1.bin"
+
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3015-ethernet-update-ppe-from-mt7986-to-mt7988.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3015-ethernet-update-ppe-from-netsys2-to-netsys3.patch
similarity index 100%
rename from autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3015-ethernet-update-ppe-from-mt7986-to-mt7988.patch
rename to autobuild_mac80211_release/target/linux/mediatek/patches-5.4/999-3015-ethernet-update-ppe-from-netsys2-to-netsys3.patch