From patchwork Wed Apr 19 19:05:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 85530 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp612615vqo; Wed, 19 Apr 2023 12:18:14 -0700 (PDT) X-Google-Smtp-Source: AKy350Z+430D8VVAg8yZISb01i60jdqtBe0BeKOVcz0XU5aGi5K1BNyjMffAg1V6wuN7SrpLElGw X-Received: by 2002:a17:903:650:b0:1a8:1798:11d0 with SMTP id kh16-20020a170903065000b001a8179811d0mr3421699plb.18.1681931894368; Wed, 19 Apr 2023 12:18:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681931894; cv=none; d=google.com; s=arc-20160816; b=kIFv5XoGlCi0MRuV/u5FCrmZN/LcGqqf9AOE33rYoecy+Hch4zk6OFrqgkvj2kU31f QcdXjEX05iqvxPtjvBXIPGmlrU+19Udb7vc+WqU4KD4owVX2euJ0UCG/50mzUwUhH2Ut MQ4OXrBRCECyXGudRecS8GkT8jPTDxZVFWCcPwX37JRcTNLx7MrqV0AE3QKNanHB2v/p 5HaKAQGTiXeUXHJA98X5hL0o+1caI8tKCdo/HZLiOowH7qzj/jWZIMM0y/j2G2IBI2k3 odpZagmDetdFK9T7CD/fm2mUG5Ot/ZmzDDm8dh+JCUSea0TpOEdcoT0hcFyaYt2e7z72 n62g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date; bh=F45UzTj4xsAwlT7Xf12zmKoApQ324lriJEm4bTv4O2s=; b=JKoP8HwFG1t1Q+UMjxEoGvidmrLOHbuO4V3uKUN5V/FQNm3x4YB9aMMd1yQzpU9vKx jYx4TDs0vf5KB+w82BjmOHnI3mIoN6t0IFXo1WbCEz1RLtmFBqQsnc7KmSPZHmMe51XF zy+HvD8NLAAHQz6R0dnPLf/wfB49H9T0sbfri2JnP464EcR8FBR69M4UUhkuETbyUgMb o/1ubfFz19qhg8X5I6Dqw/C4vo3G6RvDct/WbmlYjK1Q30DGR2rd3Qz1x3tjh365xV1u Sq2vUeynIcgvGYhLMC4SDGgFEbUhXELUjcr77+eRGzrDEacfWWg8/rYmpuc3vLK8bYlX lMfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d12-20020a170902cecc00b001a81e552dc7si2296093plg.637.2023.04.19.12.18.01; Wed, 19 Apr 2023 12:18:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231572AbjDSTFl (ORCPT + 99 others); Wed, 19 Apr 2023 15:05:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231577AbjDSTFi (ORCPT ); Wed, 19 Apr 2023 15:05:38 -0400 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B48749E7; Wed, 19 Apr 2023 12:05:25 -0700 (PDT) Received: from local by fudo.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1ppD7K-0003n3-2L; Wed, 19 Apr 2023 21:05:22 +0200 Date: Wed, 19 Apr 2023 20:05:16 +0100 From: Daniel Golle To: netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Felix Fietkau , John Crispin , Sean Wang , Mark Lee , Lorenzo Bianconi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno Subject: [PATCH net-next 2/2] net: ethernet: mtk_eth_soc: use WO firmware for MT7981 Message-ID: <2651cfd1427175ac1ad08d5b7be146c55d94b674.1681930898.git.daniel@makrotopia.org> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763633418439805626?= X-GMAIL-MSGID: =?utf-8?q?1763633418439805626?= 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 --- 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"