Received: by 2002:a05:7412:3210:b0:e2:908c:2ebd with SMTP id eu16csp1018864rdb; Fri, 1 Sep 2023 10:14:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF4+SNxUAOT7+mFY9sCDKsy8fwfH1QHcDl/g3gFHnWg6fR3xV+GLFXWn7o3UIjUmaMFL3L2 X-Received: by 2002:a05:6a20:12c8:b0:12e:4d86:c017 with SMTP id v8-20020a056a2012c800b0012e4d86c017mr4355905pzg.10.1693588452595; Fri, 01 Sep 2023 10:14:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693588452; cv=none; d=google.com; s=arc-20160816; b=CH5ZjLdKrPc++F23d+zo8hFw1SBSU2ByI6qK8FobMk1wUFSaCXYViQHFOby8yYUNzJ kTcxIdN1us4mghU37cHsFTlVcuapw2rmphR0csBr8fmjiovqiGuIWqWAmVbTzfdW3+68 duWo29ityGuo8CthoJ1I6pBzLpCq2janSmz4lSf2j662ySP80N9myEjqJUEj3u/xjYDi 5zMeYlLqoZvpnRLUiu03khFLY1s7buhgAgYPpOY/o0Ggd5sjlwNtk5A0kqFb+yin/MWF VsCMo2dbzvQDBeVRzwY3ZCmkV3FegIrN03Q72IbnmTpSUwd5hvbYOK+wFezVwc6R3Hf9 233g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:authenticated-by; bh=dGaB1NPPTGZzuB3azbx0vCo7Sb5L9zj5h2yW5Azj/X8=; fh=119R0DZRwIns1LRpqAK2A6izyPVjL4TEe6VydCwW0T8=; b=hc5pHEMNq8+VFdIavYHcf56DxQiSiQWvFwllPCcdDGxz1JUqET+EqWSnFIDONfGaIp yySPo9JW1kt5+6yEaciS41P/DHRB6ph5Ceeflhzk0TKXycejX8cItPJD3qGkKGdlurAL M6dWkB/nPTMmsT2iA482KN6xEQAA+hUBCnRbvqXUWFdGLCa4Vsw4zGaYAxrHpQThn3vH JTGT5U63PwQz2QpOZ51lroDcgo+s36ufwCI+HMh85EScfvZ3eZNkLaMVSTxs3HF8bIzs G/ppQA24AF5jfCwEMbMozAcLCscOXo36vFsuI+C1y6zl4NXAtP5b2mdpAxU0t53D4yHY MVQA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s1-20020a63dc01000000b0055bd8c2b3bdsi3093520pgg.153.2023.09.01.10.14.03; Fri, 01 Sep 2023 10:14:12 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233441AbjIAGQW (ORCPT + 48 others); Fri, 1 Sep 2023 02:16:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232985AbjIAGQW (ORCPT ); Fri, 1 Sep 2023 02:16:22 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D79A412F for ; Thu, 31 Aug 2023 23:16:19 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 3816FeVB2003773, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 3816FeVB2003773 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 1 Sep 2023 14:15:40 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.17; Fri, 1 Sep 2023 14:16:05 +0800 Received: from [127.0.1.1] (172.21.69.25) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.7; Fri, 1 Sep 2023 14:16:05 +0800 From: Ping-Ke Shih To: CC: Subject: [PATCH 0/8] wifi: rtw89: generalize download firmware flow to support WiFi 7 chips Date: Fri, 1 Sep 2023 14:14:59 +0800 Message-ID: <20230901061507.34312-1-pkshih@realtek.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [172.21.69.25] X-ClientProxiedBy: RTEXMBS02.realtek.com.tw (172.21.6.95) To RTEXMBS04.realtek.com.tw (172.21.6.97) X-KSE-ServerInfo: RTEXMBS04.realtek.com.tw, 9 X-KSE-AntiSpam-Interceptor-Info: fallback X-KSE-Antivirus-Interceptor-Info: fallback X-KSE-AntiSpam-Interceptor-Info: fallback X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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 WiFi 7 chips can download BB MCU firmware via the same path as existing WiFi CPU firmware, and we need to check them successful after downloading, so use a corresponding hardware bit to confirm certain firmware is ready. To reuse the flow, uses mac_gen pointers to adapt WiFi 6/7 chips with different settings and checking rules. Also, refine flow to support download firmware one by one. Then, changes of flow look like 1. initial setup --> no logic change 2. download WiFi CPU firmware --> 2. for all firmware suits 2.1. download WiFi CPU firmware & check ready 2.2. download BB MCU firmware & check ready 3. check ready by status code --> no logic change Ping-Ke Shih (8): wifi: rtw89: fw: move polling function of firmware path ready to an individual function wifi: rtw89: fw: generalize download firmware flow by mac_gen pointers wifi: rtw89: fw: implement supported functions of download firmware for WiFi 7 chips wifi: rtw89: fw: add checking type for variant type of firmware wifi: rtw89: fw: propagate an argument include_bb for BB MCU firmware wifi: rtw89: 8922a: add chip_ops::bb_preinit to enable BB before downloading firmware wifi: rtw89: fw: refine download flow to support variant firmware suits wifi: rtw89: 8922a: set memory heap address for secure firmware drivers/net/wireless/realtek/rtw89/core.c | 2 +- drivers/net/wireless/realtek/rtw89/core.h | 19 +++ drivers/net/wireless/realtek/rtw89/fw.c | 122 +++++++++----- drivers/net/wireless/realtek/rtw89/fw.h | 7 +- drivers/net/wireless/realtek/rtw89/mac.c | 45 +++++- drivers/net/wireless/realtek/rtw89/mac.h | 10 +- drivers/net/wireless/realtek/rtw89/mac_be.c | 151 ++++++++++++++++++ drivers/net/wireless/realtek/rtw89/reg.h | 109 +++++++++++++ drivers/net/wireless/realtek/rtw89/rtw8851b.c | 2 + drivers/net/wireless/realtek/rtw89/rtw8852a.c | 2 + drivers/net/wireless/realtek/rtw89/rtw8852b.c | 2 + drivers/net/wireless/realtek/rtw89/rtw8852c.c | 2 + drivers/net/wireless/realtek/rtw89/wow.c | 4 +- 13 files changed, 424 insertions(+), 53 deletions(-) -- 2.25.1