Received: by 2002:a05:7412:3210:b0:e2:908c:2ebd with SMTP id eu16csp854200rdb; Fri, 1 Sep 2023 06:15:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHWCwS8MiqmYuGyxcbJ7Hl3P+PiWX7vbIRPMM/20mTk4RdkwX7x6nfnf3RgGt2twROsWOo2 X-Received: by 2002:ac2:44b2:0:b0:500:bb9a:7e11 with SMTP id c18-20020ac244b2000000b00500bb9a7e11mr1568680lfm.48.1693574117904; Fri, 01 Sep 2023 06:15:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693574117; cv=none; d=google.com; s=arc-20160816; b=wS+kP0/5/BijdynPGhgi2wmLIeo3iEQSD8CQKDdnnojHZNQ4XKmHYZM+hNMRS9yKH2 oxjX55FDPq+8l9JZcJ67nB4wPr1+vJ+u6iPZrq1m7F4xOu+Idbs4h5L9YgVmHQPvRJgW RlyQhSZ9r/7oJmmN0t2Hemll7PbZpcYhRliPiK9wsRe51TxVH/CGEzBMYLoZnxBf0lUi kQwk4NRz/bccOZJ3rbetApqq8mE98jAP0RqaXUGiQfaQP+MTvbTQXu6T6xXgmr8mxO4V Uu5b+k9BEkLyI4EqP92YotnEOOGQ+JlrUdOC+1VEliYouMOiFCMGCl+h51AnaW7OFFkd oMcw== 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=gp4jbrqPEcEBtNk9LPyDWCZy7eN3wK16p5tgtTsBY8Q=; fh=119R0DZRwIns1LRpqAK2A6izyPVjL4TEe6VydCwW0T8=; b=fyUBAaq8uEyfhQbBbe4qfWKMu+yfwM0766Ir6wVL7lDmhbARlaqRYXhyt1xPPFZNVM Yn4kalzSIGUfJHSxLYLoRDKfDYYhRk6ypjWmkYCKyca+16yanNhNWU2oVxump/uPFtMr 82cP9vyfjoSl3JgxQDS25ry2GiurE2X5RyPZLleU6GuWUkGVDOQ1s4myZ9D1cpUgxw9E aqUAbUm5EcCS/cuP4lktt1LmXY1eGw9AzxCbtM/R6Sj3aSQvGvWniJ5PgSMuW/lNSf/o y7LtAIRI4ofUudghs17G7wjLW+Kfted80gEtUU2yKHuaDsD+c9PjaBfjv3FA7o+8X+BB ugBw== 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 g23-20020a056402321700b0052c6cae2de0si400340eda.626.2023.09.01.06.15.02; Fri, 01 Sep 2023 06:15:17 -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 S1345834AbjIAHlH (ORCPT + 50 others); Fri, 1 Sep 2023 03:41:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233646AbjIAHlH (ORCPT ); Fri, 1 Sep 2023 03:41:07 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A8A24E7F for ; Fri, 1 Sep 2023 00:41:01 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 3817eRCY1006856, 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 3817eRCY1006856 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 1 Sep 2023 15:40:27 +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 15:40:53 +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 15:40:52 +0800 From: Ping-Ke Shih To: CC: Subject: [PATCH v2 0/8] wifi: rtw89: generalize download firmware flow to support WiFi 7 chips Date: Fri, 1 Sep 2023 15:39:48 +0800 Message-ID: <20230901073956.54203-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 v2: - correct patch 3/8 that I miss a change from internal commit 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 | 156 ++++++++++++++++++ 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, 429 insertions(+), 53 deletions(-) -- 2.25.1