From patchwork Thu Apr 20 16:05:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 85943 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp451893vqo; Thu, 20 Apr 2023 09:12:21 -0700 (PDT) X-Google-Smtp-Source: AKy350Z7nvNgBEBPrma/353K0Yf4inUUPeOkpHwzYE5xwK5PkPtcnNP1n46Xha98Sur7H5p/rI/e X-Received: by 2002:a17:902:ea07:b0:19b:64bb:d546 with SMTP id s7-20020a170902ea0700b0019b64bbd546mr2131696plg.18.1682007141611; Thu, 20 Apr 2023 09:12:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682007141; cv=none; d=google.com; s=arc-20160816; b=TO3ufnObOLxCGEImpeUQ2Y9JrX/DvEGexUy7lClYXbM+HDTPac7ZGu3azK28dsVGzt R5e/32bF3VNYTc/Lg5JaorHVhLfLAo/1Uh8AZIGDKzC2gO8h9lXqVlHzpUDU2Zc15XP/ nr6doJmAc06ySPc2Xc3ISuOWYZjm9oBluqAKOcThO3fVbU/ZKiiugYA5edfEMuOCp13N DJsYRilOUHE7kpt680P4jyVfBs3qho57Y5fM71nicnXB0I13bicMeNy+G1DNLOLua+Ai VYGEPrfAB+HUSyRJJr0uOslyIjqYQ1qAzyy7TfF+ZYhJKqJ94SJM1pDF8CmQN0rM/6D6 RFyg== 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=mPAEQqxirGwH+UA8sSDguE11rcFDc1BhoBI+tcmNm6s=; b=QPiB/RPsXn2AnEdf8qb0zmdAXi+eDZ4soQ8eaoaEK19k3GoaXDvIGUUQ9vl2LUUPSS F4+ivdanVUj5gAqH8jDSbxbWJpRIsJqvYXIuZiMgoFDFYlBTqV0Fs+IYb0rrWOlBheQ+ +b1qTHSo1FbGZDkdZDCsGaJnHavvua8lc8IAKKDsa/sdtmswiwKJIlkDvcy7H9dhR2Xq U8hnToqcYvy/+vdhp5AsAbr+Eq3jUuzLf3MBgDeXp+Onph+zwHLQ3KpFHMkt8F17ANJf L115v5jG0zSHEuRw4dD4QCzjpbZ17tiqx8tZbxHTjKb9IvhNhAdbOrBWNCdn6ACdyLL7 KdoQ== 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 q9-20020a170902a3c900b0019c93e0dce0si2046893plb.254.2023.04.20.09.12.08; Thu, 20 Apr 2023 09:12:21 -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 S234127AbjDTQF0 (ORCPT + 99 others); Thu, 20 Apr 2023 12:05:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231435AbjDTQFY (ORCPT ); Thu, 20 Apr 2023 12:05:24 -0400 Received: from fudo.makrotopia.org (fudo.makrotopia.org [IPv6:2a07:2ec0:3002::71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDCE335BF; Thu, 20 Apr 2023 09:05:17 -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 1ppWmZ-0000JE-12; Thu, 20 Apr 2023 18:05:15 +0200 Date: Thu, 20 Apr 2023 17:05:05 +0100 From: Daniel Golle To: devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , 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 v2 2/2] net: ethernet: mtk_eth_soc: use WO firmware for MT7981 Message-ID: <4d6b2807f0878a63991d5fc0937e707a27fa0dd1.1681994362.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?1763712194860210807?= X-GMAIL-MSGID: =?utf-8?q?1763712320469734929?= 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 --- 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"