Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp740225rwr; Wed, 19 Apr 2023 12:21:01 -0700 (PDT) X-Google-Smtp-Source: AKy350Z9/7VUfnovufBc7jFhIkmpbHUaMoAD+4bLs+VUdMlnhVSyjg/oNuRXgyHAZjqw4HqztKXx X-Received: by 2002:a05:6a20:ba20:b0:f0:c858:2d68 with SMTP id fa32-20020a056a20ba2000b000f0c8582d68mr4183786pzb.35.1681932060891; Wed, 19 Apr 2023 12:21:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681932060; cv=none; d=google.com; s=arc-20160816; b=rFuFFfCPUXSDd7W65ZJtlUGxaeakr1mTN68H7e64bo7sqZ9XzhDbSDhdB1dJg87aer pZvJFC318/LNYIdJ9FsBpJutIz06QU7nCkXVDFFVtBerdWHy9/8wHIW+pXRKW9uDwD3Y kdbDUVhgTA9w2Ko7wgrTJ1im9G7EUdEgr1kRU/uGrswIgZAs05HyRfQ6D1fu/gxzRDIW vkev8CyN7JQxGK3+/3ZqXtNWn3P9vcw8zfZ0PRc75NC4AIRui+5+SjPyITJNXslIdJhc XE/kZHJgwyUQAmfllbKXCrZL4sFovVPIKR6Vvp97K0D1M+0fQPTe6knZlC4qo+AA+xTd 5k/w== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a21-20020a63e855000000b00502d75b6681si17742277pgk.228.2023.04.19.12.20.43; Wed, 19 Apr 2023 12:21:00 -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 S231551AbjDSTFl (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-Type: text/plain; charset=us-ascii 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 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" -- 2.40.0