Linux-mmc Archive mirror
 help / color / mirror / Atom feed
From: Fiona Klute <fiona.klute@gmx.de>
To: linux-wireless@vger.kernel.org, Ping-Ke Shih <pkshih@realtek.com>
Cc: "Kalle Valo" <kvalo@kernel.org>,
	"Ulf Hansson" <ulf.hansson@linaro.org>,
	linux-mmc@vger.kernel.org, "Pavel Machek" <pavel@ucw.cz>,
	"Ondřej Jirman" <megi@xff.cz>, "Fiona Klute" <fiona.klute@gmx.de>
Subject: [PATCH 4/9] wifi: rtw88: Add rtw8703b.h
Date: Fri,  2 Feb 2024 13:10:43 +0100	[thread overview]
Message-ID: <20240202121050.977223-5-fiona.klute@gmx.de> (raw)
In-Reply-To: <20240202121050.977223-1-fiona.klute@gmx.de>

This is the main header for the new rtw88_8703b chip driver.

Signed-off-by: Fiona Klute <fiona.klute@gmx.de>
---
 drivers/net/wireless/realtek/rtw88/rtw8703b.h | 62 +++++++++++++++++++
 1 file changed, 62 insertions(+)
 create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8703b.h

diff --git a/drivers/net/wireless/realtek/rtw88/rtw8703b.h b/drivers/net/wireless/realtek/rtw88/rtw8703b.h
new file mode 100644
index 0000000000..f5ff23f2ee
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.h
@@ -0,0 +1,62 @@
+/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
+/* Copyright Fiona Klute <fiona.klute@gmx.de> */
+
+#ifndef __RTW8703B_H__
+#define __RTW8703B_H__
+
+extern const struct rtw_chip_info rtw8703b_hw_spec;
+
+/* phy status parsing */
+#define GET_PHY_STAT_AGC_GAIN_A(phy_stat)                                   \
+	(le32_get_bits(*((__le32 *)(phy_stat) + 0x00), GENMASK(6, 0)))
+
+#define GET_PHY_STAT_PWDB(phy_stat)                                         \
+	le32_get_bits(*((__le32 *)(phy_stat) + 0x01), GENMASK(7, 0))
+#define GET_PHY_STAT_VGA(phy_stat)                                          \
+	le32_get_bits(*((__le32 *)(phy_stat) + 0x01), GENMASK(12, 8))
+#define GET_PHY_STAT_LNA_L(phy_stat)                                        \
+	le32_get_bits(*((__le32 *)(phy_stat) + 0x01), GENMASK(15, 13))
+/* the high LNA stat bit if 4 bit format is used */
+#define GET_PHY_STAT_LNA_H(phy_stat)                                        \
+	le32_get_bits(*((__le32 *)(phy_stat) + 0x01), BIT(23))
+#define BIT_LNA_H_MASK BIT(3)
+#define BIT_LNA_L_MASK GENMASK(2, 0)
+
+#define GET_PHY_STAT_CFO_TAIL_A(phy_stat)                                   \
+	(le32_get_bits(*((__le32 *)(phy_stat) + 0x02), GENMASK(15, 8)))
+#define GET_PHY_STAT_RXEVM_A(phy_stat)                                      \
+	(le32_get_bits(*((__le32 *)(phy_stat) + 0x03), GENMASK(15, 8)))
+#define GET_PHY_STAT_RXSNR_A(phy_stat)                                      \
+	(le32_get_bits(*((__le32 *)(phy_stat) + 0x03), GENMASK(31, 24)))
+
+/* Baseband registers */
+#define REG_BB_PWR_SAV5_11N 0x0818
+/* BIT(11) should be 1 for 8703B *and* 8723D, which means LNA uses 4
+ * bit for CCK rates in report, not 3. Vendor driver logs a warning if
+ * it's 0, but handles the case.
+ *
+ * Purpose of other parts of this register is unknown, 8723cs driver
+ * code indicates some other chips use certain bits for antenna
+ * diversity.
+ */
+#define REG_BB_AMP 0x0950
+#define BIT_MASK_RX_LNA (BIT(11))
+
+/* 0xaXX: 40MHz channel settings */
+#define REG_CCK_TXSF2 0x0a24  /* CCK TX filter 2 */
+#define REG_CCK_DBG 0x0a28  /* debug port */
+#define REG_OFDM0_A_TX_AFE 0x0c84
+#define REG_TXIQK_MATRIXB_LSB2_11N 0x0c9c
+#define REG_OFDM0_TX_PSD_NOISE 0x0ce4  /* TX pseudo noise weighting */
+/* is != 0 when IQK is done */
+#define REG_IQK_RDY 0x0e90
+
+/* RF registers */
+#define RF_RCK1 0x1E
+
+#define AGG_BURST_NUM 3
+#define AGG_BURST_SIZE 0 /* 1K */
+#define BIT_MASK_AGG_BURST_NUM (GENMASK(3, 2))
+#define BIT_MASK_AGG_BURST_SIZE (GENMASK(5, 4))
+
+#endif /* __RTW8703B_H__ */
--
2.43.0


  parent reply	other threads:[~2024-02-02 12:11 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-02 12:10 [PATCH 0/9] rtw88: Add support for RTL8723CS/RTL8703B Fiona Klute
2024-02-02 12:10 ` [PATCH 1/9] wifi: rtw88: Shared module for rtw8723x devices Fiona Klute
2024-02-03 14:20   ` kernel test robot
2024-02-03 15:04   ` kernel test robot
2024-02-03 21:47   ` kernel test robot
2024-02-04 10:03   ` kernel test robot
2024-02-05  1:45   ` Ping-Ke Shih
2024-02-05 16:47     ` Fiona Klute
2024-02-06  0:59       ` Ping-Ke Shih
2024-02-02 12:10 ` [PATCH 2/9] wifi: rtw88: Debug output for rtw8723x EFUSE Fiona Klute
2024-02-05  2:17   ` Ping-Ke Shih
2024-02-05 17:10     ` Fiona Klute
2024-02-02 12:10 ` [PATCH 3/9] wifi: rtw88: Add definitions for 8703b chip Fiona Klute
2024-02-02 12:10 ` Fiona Klute [this message]
2024-02-05  2:24   ` [PATCH 4/9] wifi: rtw88: Add rtw8703b.h Ping-Ke Shih
2024-02-06  1:08     ` Fiona Klute
2024-02-06  2:02       ` Ping-Ke Shih
2024-02-02 12:10 ` [PATCH 5/9] wifi: rtw88: Add rtw8703b.c Fiona Klute
2024-02-05  3:01   ` Ping-Ke Shih
2024-02-05 19:06     ` Fiona Klute
2024-02-06  1:37       ` Ping-Ke Shih
2024-02-06  8:12         ` Pavel Machek
2024-02-07  5:58         ` Ping-Ke Shih
2024-02-02 12:10 ` [PATCH 6/9] wifi: rtw88: Add rtw8703b_tables.h Fiona Klute
2024-02-02 12:10 ` [PATCH 7/9] wifi: rtw88: Add rtw8703b_tables.c Fiona Klute
2024-02-02 12:10 ` [PATCH 8/9] wifi: rtw88: Reset 8703b firmware before download Fiona Klute
2024-02-05  3:05   ` Ping-Ke Shih
2024-02-02 12:10 ` [PATCH 9/9] wifi: rtw88: SDIO device driver for RTL8723CS Fiona Klute
2024-02-05  3:10   ` Ping-Ke Shih
2024-02-05 16:07   ` Ulf Hansson
2024-02-02 13:13 ` [PATCH 0/9] rtw88: Add support for RTL8723CS/RTL8703B Dmitry Antipov
2024-02-02 13:27   ` Fiona Klute
2024-02-02 13:54     ` Dmitry Antipov
2024-02-02 14:13       ` Fiona Klute
2024-02-02 20:19 ` Pavel Machek
2024-02-03  0:36   ` Fiona Klute
2024-02-02 20:44 ` Pavel Machek
2024-02-02 20:52 ` Pavel Machek
2024-02-03 11:33   ` Fiona Klute

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240202121050.977223-5-fiona.klute@gmx.de \
    --to=fiona.klute@gmx.de \
    --cc=kvalo@kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=megi@xff.cz \
    --cc=pavel@ucw.cz \
    --cc=pkshih@realtek.com \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).