2023-04-20 16:04:58

by Daniel Golle

[permalink] [raw]
Subject: [PATCH v2 0/2] net: ethernet: mtk_eth_soc: use WO firmware for MT7981

In order to support wireless offloading on MT7981 we need to load the
appropriate firmware. Recognize MT7981 by introducing a new DT compatible
and load mt7981_wo.bin if it is set.

Changes since v1:
* retain alphabetic order in dt-bindings

Daniel Golle (2):
dt-bindings: net: mediatek: add WED RX binding for MT7981 eth driver
net: ethernet: mtk_eth_soc: use WO firmware for MT7981

.../bindings/arm/mediatek/mediatek,mt7622-wed.yaml | 1 +
drivers/net/ethernet/mediatek/mtk_wed_mcu.c | 7 ++++++-
drivers/net/ethernet/mediatek/mtk_wed_wo.h | 1 +
3 files changed, 8 insertions(+), 1 deletion(-)

--
2.40.0


2023-04-20 16:06:05

by Daniel Golle

[permalink] [raw]
Subject: [PATCH v2 1/2] dt-bindings: net: mediatek: add WED RX binding for MT7981 eth driver

Add compatible string for mediatek,mt7981-wed as MT7981 also supports
RX WED just like MT7986, but needs a different firmware file.

Signed-off-by: Daniel Golle <[email protected]>
---
Changes since v1:
* maintain alphabetic order

.../devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml
index 5c223cb063d48..f7d578a171a4f 100644
--- a/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml
+++ b/Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml
@@ -20,6 +20,7 @@ properties:
items:
- enum:
- mediatek,mt7622-wed
+ - mediatek,mt7981-wed
- mediatek,mt7986-wed
- const: syscon

--
2.40.0

2023-04-20 16:06:28

by Daniel Golle

[permalink] [raw]
Subject: [PATCH v2 2/2] net: ethernet: mtk_eth_soc: use WO firmware for MT7981

In order to support wireless offloading on MT7981 we need to load the
appropriate firmware. Recognize MT7981 and load mt7981_wo.bin.

Signed-off-by: Daniel Golle <[email protected]>
---
No changes since v1.

drivers/net/ethernet/mediatek/mtk_wed_mcu.c | 7 ++++++-
drivers/net/ethernet/mediatek/mtk_wed_wo.h | 1 +
2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
index 6bad0d262f286..071ed3dea860d 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
@@ -326,7 +326,11 @@ mtk_wed_mcu_load_firmware(struct mtk_wed_wo *wo)
wo->hw->index + 1);

/* load firmware */
- fw_name = wo->hw->index ? MT7986_FIRMWARE_WO1 : MT7986_FIRMWARE_WO0;
+ if (of_device_is_compatible(wo->hw->node, "mediatek,mt7981-wed"))
+ fw_name = MT7981_FIRMWARE_WO;
+ else
+ fw_name = wo->hw->index ? MT7986_FIRMWARE_WO1 : MT7986_FIRMWARE_WO0;
+
ret = request_firmware(&fw, fw_name, wo->hw->dev);
if (ret)
return ret;
@@ -386,5 +390,6 @@ int mtk_wed_mcu_init(struct mtk_wed_wo *wo)
100, MTK_FW_DL_TIMEOUT);
}

+MODULE_FIRMWARE(MT7981_FIRMWARE_WO);
MODULE_FIRMWARE(MT7986_FIRMWARE_WO0);
MODULE_FIRMWARE(MT7986_FIRMWARE_WO1);
diff --git a/drivers/net/ethernet/mediatek/mtk_wed_wo.h b/drivers/net/ethernet/mediatek/mtk_wed_wo.h
index dbcf42ce9173c..7a1a2a28f1acb 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed_wo.h
+++ b/drivers/net/ethernet/mediatek/mtk_wed_wo.h
@@ -88,6 +88,7 @@ enum mtk_wed_dummy_cr_idx {
MTK_WED_DUMMY_CR_WO_STATUS,
};

+#define MT7981_FIRMWARE_WO "mediatek/mt7981_wo.bin"
#define MT7986_FIRMWARE_WO0 "mediatek/mt7986_wo_0.bin"
#define MT7986_FIRMWARE_WO1 "mediatek/mt7986_wo_1.bin"

--
2.40.0

2023-04-21 16:51:01

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] dt-bindings: net: mediatek: add WED RX binding for MT7981 eth driver

On 20/04/2023 18:04, Daniel Golle wrote:
> Add compatible string for mediatek,mt7981-wed as MT7981 also supports
> RX WED just like MT7986, but needs a different firmware file.
>
> Signed-off-by: Daniel Golle <[email protected]>
> ---

Acked-by: Krzysztof Kozlowski <[email protected]>

Best regards,
Krzysztof

2023-04-22 13:24:09

by patchwork-bot+netdevbpf

[permalink] [raw]
Subject: Re: [PATCH v2 0/2] net: ethernet: mtk_eth_soc: use WO firmware for MT7981

Hello:

This series was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:

On Thu, 20 Apr 2023 17:04:02 +0100 you wrote:
> In order to support wireless offloading on MT7981 we need to load the
> appropriate firmware. Recognize MT7981 by introducing a new DT compatible
> and load mt7981_wo.bin if it is set.
>
> Changes since v1:
> * retain alphabetic order in dt-bindings
>
> [...]

Here is the summary with links:
- [v2,1/2] dt-bindings: net: mediatek: add WED RX binding for MT7981 eth driver
https://git.kernel.org/netdev/net/c/cf88231d9739
- [v2,2/2] net: ethernet: mtk_eth_soc: use WO firmware for MT7981
https://git.kernel.org/netdev/net/c/86ce0d09e424

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html