Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp361435rwb; Thu, 10 Nov 2022 01:44:56 -0800 (PST) X-Google-Smtp-Source: AA0mqf4uyJns6VywA7zaHlU2226Cq9QX5ftszeQVTuUPO3V2OqTD320Rg/tAoT3mMiJVB87V3qng X-Received: by 2002:a17:907:6e09:b0:7ae:68c7:a722 with SMTP id sd9-20020a1709076e0900b007ae68c7a722mr15928552ejc.455.1668073496235; Thu, 10 Nov 2022 01:44:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668073496; cv=none; d=google.com; s=arc-20160816; b=S2RXvD6+YcyB8yYIl/yfMq8dvs7Mp5SVaUGUz6lau4DKG5SoSzEdOiyITGpMKQ9uGh R7haUSh2q/P1lNNAtdaKiadnKE2kXlxORV4MayubkW/MHei11mM/v6YR8hYwrvJBD7/F sylo29OxwWR0gsRSpwnHKySZFvv01ggodC6NBDrV7hAEB2Mw7btoyakl+iO8RJsJ+aD/ m4o/3FkMkzCzhOmYXf87NvEMqb+D1xy6kuG65wDpiZIK2fVDYsU5sO3APDNM1+28/Q8k YBkyw3aOa2IgdJZkOK5h/iuEfvAFtmhXFvNeYZ3dcXOTYzZ6r96qbJQewuMbLfvRgOvB 9jbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=mLEes6JhlpKSfYiTYgnjO3nzfxNcrWSPX/riGgw6u94=; b=iSiXda/74D+/kEhnIsjkxZHxZCKwsuptqsiQtEkO6wUWk5e0i6a6DXgsw3URv9G/oR iwQ1FivT9C7GGqId3x+i5bM7/4MeaTawFZqDdbvPOlxyZL/KWwbvWGStI2R72US43anc psLMV5LoImuFkXSGurChnQZSdf9lv6KSZwie/9soUpJmIIRrQeCRdk6et3L/YTz4+DBV 9Cy4NDgInF3pt6B1mPQnQg2ZrF+f/NfhOmf4iW3ywQ3ePlZqY4WcQ9lC8EAqTjhdWNg4 udvbOHc0RdPFvFaYxQJ541j3WZGY2hLsM6KQdzPvf6Tw1gfcuUvTtXboXsQRm3AZWLdb XtwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=CmsBbrs6; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js3-20020a17090797c300b0073d8e4e8c77si19707288ejc.1005.2022.11.10.01.44.38; Thu, 10 Nov 2022 01:44:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-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; dkim=pass header.i=@mediatek.com header.s=dk header.b=CmsBbrs6; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230028AbiKJJhK (ORCPT + 66 others); Thu, 10 Nov 2022 04:37:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230003AbiKJJhF (ORCPT ); Thu, 10 Nov 2022 04:37:05 -0500 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4599D6A753 for ; Thu, 10 Nov 2022 01:37:02 -0800 (PST) X-UUID: c200d1a7386c4eefb0d212bb028045a3-20221110 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=mLEes6JhlpKSfYiTYgnjO3nzfxNcrWSPX/riGgw6u94=; b=CmsBbrs6qo2rdhzltsVhLF0VmTw6rg6xvBiFAV725tRhnc29EzfR7E2XXdfztooIpJIEltNae3yBYwrKP5dcaGc9fb3EgCFbvD1Ud1dKB/h3zbkI5FnFWi/ki5/9+P0Kiy4DAGxB03PDRcEJpNKxIq+jyGDUIKgAeZv240iAk0M=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.12,REQID:02a13a91-446b-4c6f-9acf-4b3733840d76,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:62cd327,CLOUDID:b9d9e485-088c-4756-8f76-577be701e693,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: c200d1a7386c4eefb0d212bb028045a3-20221110 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1118159262; Thu, 10 Nov 2022 17:36:52 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs11n1.mediatek.inc (172.21.101.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Thu, 10 Nov 2022 17:36:51 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Thu, 10 Nov 2022 17:36:51 +0800 From: Shayne Chen To: Felix Fietkau CC: linux-wireless , Lorenzo Bianconi , Ryder Lee , Evelyn Tsai , Bo Jiao , linux-mediatek , Shayne Chen Subject: [PATCH v2 8/9] wifi: mt76: connac: introduce helper for mt7996 chipset Date: Thu, 10 Nov 2022 17:35:24 +0800 Message-ID: <20221110093525.29649-9-shayne.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20221110093525.29649-1-shayne.chen@mediatek.com> References: <20221110093525.29649-1-shayne.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,UNPARSEABLE_RELAY 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-wireless@vger.kernel.org Introduce is_mt7996() helper for new chipset. This is a preliminary patch to support mt7996 driver. Signed-off-by: Shayne Chen --- drivers/net/wireless/mediatek/mt76/mt76_connac.h | 5 +++++ drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac.h b/drivers/net/wireless/mediatek/mt76/mt76_connac.h index 0915eb579539..8ba883b03e50 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac.h +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac.h @@ -187,6 +187,11 @@ static inline bool is_mt7986(struct mt76_dev *dev) return mt76_chip(dev) == 0x7986; } +static inline bool is_mt7996(struct mt76_dev *dev) +{ + return mt76_chip(dev) == 0x7990; +} + static inline bool is_mt7622(struct mt76_dev *dev) { if (!IS_ENABLED(CONFIG_MT7622_WMAC)) diff --git a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c index 9bba18d24c71..aa8e7f7e9b50 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c @@ -65,7 +65,8 @@ int mt76_connac_mcu_init_download(struct mt76_dev *dev, u32 addr, u32 len, int cmd; if ((!is_connac_v1(dev) && addr == MCU_PATCH_ADDRESS) || - (is_mt7921(dev) && addr == 0x900000)) + (is_mt7921(dev) && addr == 0x900000) || + (is_mt7996(dev) && addr == 0x900000)) cmd = MCU_CMD(PATCH_START_REQ); else cmd = MCU_CMD(TARGET_ADDRESS_LEN_REQ); -- 2.25.1