Received: by 2002:a05:7412:1492:b0:e2:908c:2ebd with SMTP id s18csp711539rdh; Tue, 22 Aug 2023 08:32:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEa7Aq1WedN3QK5eZybErdGKDw4YOzqPdF3PyAHdAly9yDoPhe9BQ4j3obrLeZsaUVjiL/D X-Received: by 2002:a17:906:304a:b0:9a1:a134:8cb4 with SMTP id d10-20020a170906304a00b009a1a1348cb4mr3913432ejd.32.1692718354041; Tue, 22 Aug 2023 08:32:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692718354; cv=none; d=google.com; s=arc-20160816; b=UZ8VGEVzLIOzECHt6j7HIKQpOAtqnnBtwyrTy5LMIaYSfBhlT9xmeu9OUKNN2sUOD4 m+cpLisMk71a8gL83dCMobZ296exl/TGT1DNu6Sea2WOPZ2Vxqdvr0lsT7ODJFIe0Oay XOps2ZRqlOidW2iFp4BMsEj6Gee4F15VIt7hQW1g9vFGHiEW5v1Fo3YK1DHjkhe8xwgc 8a6hzjIsPoaBGsX3xUwP2wkp2iha5nWX67X8TSaM1LgGg3yHGgJVrLOtI10oHEfkqBTQ Il+hwW5CfPazyjePiGE0TKKrO/mNP5yfLVjMFWSh9kDIb2sKM4UKxDAJBzwfaW594HT7 VMPQ== 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=HDDholjXt2iPgCe6iFTb5rv7O5UNxYF8N6KA2aykfDc=; fh=sXNIEkNmo9jCtfiV2xqLAUddHEJcWancobpfhY2naUM=; b=E1pUkbldrrLjE+aEKIMKD10wVxSuyi3KIR9oKF9oy5CzhRKVFO+5Qprtlu8A21sX+8 Cn5oi/MRhqmCsZcgCCeCGIHfdI7k53UCWTZoyHRI4ncPAmB7DPnd3daF6YIYKZi49Y+8 6axqXxLYl/aqGjpN9NMG8u57DcUWlyRk8RvgTZFSLDSIAqmIjLudCp1sLkxXTS0AFppb FUYogwVAJ7ej9L02hr47aVGBcJbkkoR5GrnMnCYbNIw8gitjruC9l0PYFNhAQbuDoWjC wl2FxYXBNWx9YpRvaBVk02MnoX+K2CNljgzJfAtkRS5iOms93q6Pm/Q8/JeBIetEelJu jQ8w== 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 d5-20020a1709067f0500b0098d1c816d43si6663975ejr.85.2023.08.22.08.31.51; Tue, 22 Aug 2023 08:32:34 -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 S235924AbjHVM7W (ORCPT + 55 others); Tue, 22 Aug 2023 08:59:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235923AbjHVM7V (ORCPT ); Tue, 22 Aug 2023 08:59:21 -0400 Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6260ECD0 for ; Tue, 22 Aug 2023 05:59:19 -0700 (PDT) Authenticated-By: X-SpamFilter-By: ArmorX SpamTrap 5.77 with qID 37MCwmpR7022521, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36505.realtek.com.tw[172.21.6.25]) by rtits2.realtek.com.tw (8.15.2/2.81/5.90) with ESMTPS id 37MCwmpR7022521 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 22 Aug 2023 20:58:48 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36505.realtek.com.tw (172.21.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.32; Tue, 22 Aug 2023 20:59:10 +0800 Received: from [127.0.1.1] (172.16.23.216) 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; Tue, 22 Aug 2023 20:59:09 +0800 From: Ping-Ke Shih To: CC: , Subject: [PATCH 0/6] wifi: rtw89: introduce struct {mac,phy}_gen_def to define register address for WiFi 6 and 7 chips Date: Tue, 22 Aug 2023 20:58:16 +0800 Message-ID: <20230822125822.23817-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.16.23.216] 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-KSE-ServerInfo: RTEXH36505.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,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 The address space of WiFi 7 chips is changed from WiFi 6, and the layout looks like below. +---------------------+ 0x0_0000 MAC base address (WiFi 6: 0x0_0000 the same) | | | | | +-----------+ ----|-------+ | | BAND0 | | | offset = 0x0_4000 (WiFi 6: 0x0_2000) | +-----------+ <---|-------+ | | BAND1 | | | +-----------+ | | | +---------------------+ 0x2_0000 PHY0 base address (WiFi 6: 0x1_0000) | | | | +---------------------+ 0x4_0000 PHY1 base address (WiFi 6: not simple offset) | | | | +---------------------+ Thus, introduce struct {mac,phy}_gen_def to define these addresses, and also registers addresses are changed after WiFi 7, so add fields to the struct to reuse codes. More functions will be added into the struct afterward, because register settings and flows are also changed. Currently, we add mac_be.c and phy_be.c for WiFi 7 chips, and the share code and WiFi 6 specified code still locate on existing mac.c and phy.c. In the future, we might move WiFi 6 part into mac_ax.c and phy_ax.c in one go if needed. Cheng-Chieh Hsieh (1): wifi: rtw89: phy: modify register setting of ENV_MNTR, PHYSTS and DIG Ping-Ke Shih (5): wifi: rtw89: mac: add mac_gen_def::band1_offset to map MAC band1 register address wifi: rtw89: mac: generalize code to indirectly access WiFi internal memory wifi: rtw89: mac: define internal memory address for WiFi 7 chip wifi: rtw89: mac: define register address of rx_filter to generalize code wifi: rtw89: phy: add phy_gen_def::cr_base to support WiFi 7 chips drivers/net/wireless/realtek/rtw89/core.c | 6 +- drivers/net/wireless/realtek/rtw89/core.h | 8 + drivers/net/wireless/realtek/rtw89/debug.c | 13 +- drivers/net/wireless/realtek/rtw89/fw.c | 6 +- drivers/net/wireless/realtek/rtw89/mac.c | 197 ++++++++------- drivers/net/wireless/realtek/rtw89/mac.h | 69 ++++- drivers/net/wireless/realtek/rtw89/mac80211.c | 7 +- drivers/net/wireless/realtek/rtw89/mac_be.c | 38 +++ drivers/net/wireless/realtek/rtw89/phy.c | 239 +++++++++++++----- drivers/net/wireless/realtek/rtw89/phy.h | 114 ++++++++- drivers/net/wireless/realtek/rtw89/phy_be.c | 77 ++++++ drivers/net/wireless/realtek/rtw89/reg.h | 34 +++ drivers/net/wireless/realtek/rtw89/rtw8851b.c | 18 +- drivers/net/wireless/realtek/rtw89/rtw8852a.c | 19 +- drivers/net/wireless/realtek/rtw89/rtw8852b.c | 18 +- drivers/net/wireless/realtek/rtw89/rtw8852c.c | 24 +- drivers/net/wireless/realtek/rtw89/ser.c | 20 +- drivers/net/wireless/realtek/rtw89/wow.c | 3 +- 18 files changed, 680 insertions(+), 230 deletions(-) create mode 100644 drivers/net/wireless/realtek/rtw89/mac_be.c create mode 100644 drivers/net/wireless/realtek/rtw89/phy_be.c -- 2.25.1