From patchwork Thu Jun 29 07:29:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AceLan Kao X-Patchwork-Id: 1801391 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20221208 header.b=cP4O+IN2; dkim-atps=neutral Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Qs98V55q6z20ZC for ; Thu, 29 Jun 2023 17:30:17 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1qEm6T-0000Ng-U0; Thu, 29 Jun 2023 07:30:09 +0000 Received: from mail-pj1-f43.google.com ([209.85.216.43]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1qEm6D-0000Kd-Ay for kernel-team@lists.ubuntu.com; Thu, 29 Jun 2023 07:29:53 +0000 Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-262fa79e9b3so188176a91.0 for ; Thu, 29 Jun 2023 00:29:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688023791; x=1690615791; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=GLEESYG1nc+wIz7PUg1EjOEnR85zF4GBqTXErLvwHjw=; b=cP4O+IN2FbJYCXQnDnfM6Vtb8iW76wA33cs4bZVHWrxGzH8seVbCv+knPw5dPB1Wx3 DyTTIQLo0v2I0k4sqNzuLK1+5+tS1SWpBruSofJwZtnGUmtPSL+Y064p1/B5pDObL2gS NH+aXTZcEsFbMWXwey/i6yRD3DyKJyVKaWZmOOQbLsyMFQMaUg6P3bfUtnNQj+U5VNoF yATiSzPpQJZoLSmZq1z5CCvCVcwgWigktZGBgy5EjuHNWSG3g+5ET1duE0liHOWGegah wCQuLYPZ8ZKQiK8AyIBc6uRAnVEqWqOCL+dMkvGf957eQbxWh8VAJrQHWSRJr8qWG5iU /uZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688023791; x=1690615791; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:sender:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=GLEESYG1nc+wIz7PUg1EjOEnR85zF4GBqTXErLvwHjw=; b=dsdV+XpJd4cHqO8YAY0jFahxYa+V+KwiyvcP1XDxTExrqVJGPGB3rAO3V5TzP2Bt7s PzDPNXbThYStFpun/VqsLwsRpjEcQ3RnStimX4xbma657HqKeJgI+q3OWyQbIbKWj7hW YHwvxC6NncZ4NxpZct72RhXe11QLLYnsGDafejTvCqpIVzJ8R+YC8B+tAozvmVOjNMf0 jj7yHNbu6M0W5ryqNpgMrmYG23OmNzVAH1XvIMAd+yuid5h9SneWAbCuxH1ABGZkQXqd sx1LKRC9Yr+FV/j90+9DFgGvaSuIdAM15ByPnqi2wHKc/qBrc+2yvA/VSrG/nXqE6dyh QlhA== X-Gm-Message-State: AC+VfDweacvKgdzWhOP8x1cHXKI9kisNrbFCV6p/iZmNnudsdp0AIT2s aq6VweuWsPuhd5LVBotThbdQMUDF7gw= X-Google-Smtp-Source: ACHHUZ5XXGdqb/XkBJ4ERfa4+uAGcGJyooFY3rZQheBmTuDsfAl2FkBV4kq4uZ4dA6vNrpBPRc1cQg== X-Received: by 2002:a17:90b:3141:b0:259:548b:d394 with SMTP id ip1-20020a17090b314100b00259548bd394mr26878430pjb.28.1688023790760; Thu, 29 Jun 2023 00:29:50 -0700 (PDT) Received: from localhost (220-135-95-34.hinet-ip.hinet.net. [220.135.95.34]) by smtp.gmail.com with ESMTPSA id bb2-20020a17090b008200b00262fb769a10sm5730998pjb.11.2023.06.29.00.29.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jun 2023 00:29:50 -0700 (PDT) From: AceLan Kao To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/5][SRU][L][M] wifi: rtw89: 8851b: add 8851B basic chip_info Date: Thu, 29 Jun 2023 15:29:40 +0800 Message-Id: <20230629072943.477754-3-acelan.kao@canonical.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230629072943.477754-1-acelan.kao@canonical.com> References: <20230629072943.477754-1-acelan.kao@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.216.43; envelope-from=acelan@gmail.com; helo=mail-pj1-f43.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Ping-Ke Shih BugLink: https://launchpad.net/bugs/2023952 8851B is a 1x1 80 MHz bandwidth chip working on 2/5 GHz. Add these basic information, and more settings will be added by functions. Signed-off-by: Ping-Ke Shih Signed-off-by: Kalle Valo Link: https://lore.kernel.org/r/20230421024551.29994-2-pkshih@realtek.com (cherry picked from commit c8d89bf6b82f421dda16526233aba264d1331332) Signed-off-by: Chia-Lin Kao (AceLan) --- drivers/net/wireless/realtek/rtw89/rtw8851b.c | 101 ++++++++++++++++++ drivers/net/wireless/realtek/rtw89/rtw8851b.h | 15 +++ 2 files changed, 116 insertions(+) create mode 100644 drivers/net/wireless/realtek/rtw89/rtw8851b.c create mode 100644 drivers/net/wireless/realtek/rtw89/rtw8851b.h diff --git a/drivers/net/wireless/realtek/rtw89/rtw8851b.c b/drivers/net/wireless/realtek/rtw89/rtw8851b.c new file mode 100644 index 000000000000..a0aaac74b0ec --- /dev/null +++ b/drivers/net/wireless/realtek/rtw89/rtw8851b.c @@ -0,0 +1,101 @@ +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause +/* Copyright(c) 2022-2023 Realtek Corporation + */ + +#include "coex.h" +#include "fw.h" +#include "mac.h" +#include "phy.h" +#include "reg.h" +#include "rtw8851b.h" +#include "rtw8851b_table.h" +#include "txrx.h" +#include "util.h" + +#define RTW8851B_FW_FORMAT_MAX 0 +#define RTW8851B_FW_BASENAME "rtw89/rtw8851b_fw" +#define RTW8851B_MODULE_FIRMWARE \ + RTW8851B_FW_BASENAME ".bin" + +static const struct rtw89_chip_ops rtw8851b_chip_ops = { + .fem_setup = NULL, + .fill_txdesc = rtw89_core_fill_txdesc, + .fill_txdesc_fwcmd = rtw89_core_fill_txdesc, + .h2c_dctl_sec_cam = NULL, +}; + +const struct rtw89_chip_info rtw8851b_chip_info = { + .chip_id = RTL8851B, + .ops = &rtw8851b_chip_ops, + .fw_basename = RTW8851B_FW_BASENAME, + .fw_format_max = RTW8851B_FW_FORMAT_MAX, + .try_ce_fw = true, + .fifo_size = 196608, + .dle_scc_rsvd_size = 98304, + .max_amsdu_limit = 3500, + .dis_2g_40m_ul_ofdma = true, + .rsvd_ple_ofst = 0x2f800, + .wde_qempty_acq_num = 4, + .wde_qempty_mgq_sel = 4, + .rf_base_addr = {0xe000}, + .pwr_on_seq = NULL, + .pwr_off_seq = NULL, + .bb_table = &rtw89_8851b_phy_bb_table, + .bb_gain_table = &rtw89_8851b_phy_bb_gain_table, + .rf_table = {&rtw89_8851b_phy_radioa_table,}, + .nctl_table = &rtw89_8851b_phy_nctl_table, + .byr_table = &rtw89_8851b_byr_table, + .dflt_parms = &rtw89_8851b_dflt_parms, + .rfe_parms_conf = rtw89_8851b_rfe_parms_conf, + .txpwr_factor_rf = 2, + .txpwr_factor_mac = 1, + .dig_table = NULL, + .tssi_dbw_table = NULL, + .support_chanctx_num = 0, + .support_bands = BIT(NL80211_BAND_2GHZ) | + BIT(NL80211_BAND_5GHZ), + .support_bw160 = false, + .support_ul_tb_ctrl = true, + .hw_sec_hdr = false, + .rf_path_num = 1, + .tx_nss = 1, + .rx_nss = 1, + .acam_num = 32, + .bcam_num = 20, + .scam_num = 128, + .bacam_num = 2, + .bacam_dynamic_num = 4, + .bacam_v1 = false, + .sec_ctrl_efuse_size = 4, + .physical_efuse_size = 1216, + .logical_efuse_size = 2048, + .limit_efuse_size = 1280, + .dav_phy_efuse_size = 0, + .dav_log_efuse_size = 0, + .phycap_addr = 0x580, + .phycap_size = 128, + .para_ver = 0, + .wlcx_desired = 0x06000000, + .btcx_desired = 0x7, + .scbd = 0x1, + .mailbox = 0x1, + + .ps_mode_supported = BIT(RTW89_PS_MODE_RFOFF) | + BIT(RTW89_PS_MODE_CLK_GATED), + .low_power_hci_modes = 0, + .h2c_cctl_func_id = H2C_FUNC_MAC_CCTLINFO_UD, + .hci_func_en_addr = R_AX_HCI_FUNC_EN, + .h2c_desc_size = sizeof(struct rtw89_txwd_body), + .txwd_body_size = sizeof(struct rtw89_txwd_body), + .bss_clr_map_reg = R_BSS_CLR_MAP_V1, + .dma_ch_mask = BIT(RTW89_DMA_ACH4) | BIT(RTW89_DMA_ACH5) | + BIT(RTW89_DMA_ACH6) | BIT(RTW89_DMA_ACH7) | + BIT(RTW89_DMA_B1MG) | BIT(RTW89_DMA_B1HI), + .edcca_lvl_reg = R_SEG0R_EDCCA_LVL_V1, +}; +EXPORT_SYMBOL(rtw8851b_chip_info); + +MODULE_FIRMWARE(RTW8851B_MODULE_FIRMWARE); +MODULE_AUTHOR("Realtek Corporation"); +MODULE_DESCRIPTION("Realtek 802.11ax wireless 8851B driver"); +MODULE_LICENSE("Dual BSD/GPL"); diff --git a/drivers/net/wireless/realtek/rtw89/rtw8851b.h b/drivers/net/wireless/realtek/rtw89/rtw8851b.h new file mode 100644 index 000000000000..e34b7d09ad6d --- /dev/null +++ b/drivers/net/wireless/realtek/rtw89/rtw8851b.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ +/* Copyright(c) 2022-2023 Realtek Corporation + */ + +#ifndef __RTW89_8851B_H__ +#define __RTW89_8851B_H__ + +#include "core.h" + +#define RF_PATH_NUM_8851B 1 +#define BB_PATH_NUM_8851B 1 + +extern const struct rtw89_chip_info rtw8851b_chip_info; + +#endif