rtw89: 8852c: add RF calibration
Ping-Ke Shih
maintainerv3 cover rtw89: 8852c: add RF calibration
These RFK (RF calibration) can be called once interface is going up, or when we are going to connect to AP in certain channel, or band is changed. The general steps of calibration are to backup registers (optional) and set a set of registers before doing calibration according to channels or something else, and then trigger the calibration and poll if calibration is complete. Then, check the result is positive or not to decide to adjust parameters and re-trigger again. If the result is okay, set registers accordingly, and restore registers we backup before (optional).
v3:
- shrink number of patches from 16 to 8
- add blank lines to make code more readable
- use upper case for macros name with proper prefix
- move const tables upward to top of .c file
v2: add patch 15 to fix clang warning
Ping-Ke Shih (8):
rtw89: 8852c: rfk: add RFK tables
rtw89: 8852c: rfk: add DACK
rtw89: 8852c: rfk: add LCK
rtw89: 8852c: rfk: add TSSI
rtw89: 8852c: rfk: add RCK
rtw89: 8852c: rfk: add RX DCK
rtw89: 8852c: rfk: add IQK
rtw89: 8852c: rfk: add DPK
drivers/net/wireless/realtek/rtw89/core.h | 19 +- drivers/net/wireless/realtek/rtw89/reg.h | 211 +- .../net/wireless/realtek/rtw89/rtw8852a_rfk.c | 8 +- drivers/net/wireless/realtek/rtw89/rtw8852c.c | 34 + .../net/wireless/realtek/rtw89/rtw8852c_rfk.c | 3825 ++++++++++++++++- .../net/wireless/realtek/rtw89/rtw8852c_rfk.h | 13 + .../realtek/rtw89/rtw8852c_rfk_table.c | 781 ++++ .../realtek/rtw89/rtw8852c_rfk_table.h | 67 + 8 files changed, 4930 insertions(+), 28 deletions(-) create mode 100644 drivers/net/wireless/realtek/rtw89/rtw8852c_rfk_table.c create mode 100644 drivers/net/wireless/realtek/rtw89/rtw8852c_rfk_table.h
Signature · 1 line
2.25.1
Ping-Ke Shih
maintainerPATCH v3 1/8 rtw89: 8852c: rfk: add RFK tables
These tables are used by RFK (RF calibration) to set parameters. These parameters can trigger certain calibration, or configure/reset settings before and after RF calibrations.
--- .../realtek/rtw89/rtw8852c_rfk_table.c | 781 ++++++++++++++++++ .../realtek/rtw89/rtw8852c_rfk_table.h | 67 ++ 2 files changed, 848 insertions(+) create mode 100644 drivers/net/wireless/realtek/rtw89/rtw8852c_rfk_table.c create mode 100644 drivers/net/wireless/realtek/rtw89/rtw8852c_rfk_table.h
drivers/net/wireless/realtek/rtw89/rtw8852c_rfk_table.c new file +781 -0
@@ -0,0 +1,781 @@ +// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause +/* Copyright(c) 2019-2022 Realtek Corporation +*/ + +#include "rtw8852c_rfk_table.h" + +static const struct rtw89_reg5_def rtw8852c_dack_reload_defs[] = { +RTW89_DECL_RFK_WM (0xc004 ,BIT (17 ),0x1 ), +RTW89_DECL_RFK_WM (0xc024 ,BIT (17 ),0x1 ), +RTW89_DECL_RFK_WM (0xc104 ,BIT (17 ),0x1 ), +RTW89_DECL_RFK_WM (0xc124 ,BIT (17 ),0x1 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_dack_reload_defs); + +static const struct rtw89_reg5_def rtw8852c_dack_reset_defs_a[] = { +RTW89_DECL_RFK_WM (0xc000 ,BIT (17 ),0x0 ), +RTW89_DECL_RFK_WM (0xc000 ,BIT (17 ),0x1 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_dack_reset_defs_a); + +static const struct rtw89_reg5_def rtw8852c_dack_reset_defs_b[] = { +RTW89_DECL_RFK_WM (0xc100 ,BIT (17 ),0x0 ), +RTW89_DECL_RFK_WM (0xc100 ,BIT (17 ),0x1 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_dack_reset_defs_b); + +static const struct rtw89_reg5_def rtw8852c_dack_defs_s0[] = { +RTW89_DECL_RFK_WM (0x12b8 ,BIT (30 ),0x1 ), +RTW89_DECL_RFK_WM (0x030c ,BIT (28 ),0x1 ), +RTW89_DECL_RFK_WM (0x032c ,0x80000000 ,0x0 ), +RTW89_DECL_RFK_WM (0xc004 ,0xfff00000 ,0x30 ), +RTW89_DECL_RFK_WM (0xc024 ,0xfff00000 ,0x30 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_dack_defs_s0); + +static const struct rtw89_reg5_def rtw8852c_dack_defs_s1[] = { +RTW89_DECL_RFK_WM (0x32b8 ,BIT (30 ),0x1 ), +RTW89_DECL_RFK_WM (0x030c ,BIT (28 ),0x1 ), +RTW89_DECL_RFK_WM (0x032c ,0x80000000 ,0x0 ), +RTW89_DECL_RFK_WM (0xc104 ,0xfff00000 ,0x30 ), +RTW89_DECL_RFK_WM (0xc124 ,0xfff00000 ,0x30 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_dack_defs_s1); + +static const struct rtw89_reg5_def rtw8852c_drck_defs[] = { +RTW89_DECL_RFK_WM (0xc0c4 ,BIT (6 ),0x0 ), +RTW89_DECL_RFK_WM (0xc094 ,BIT (9 ),0x1 ), +RTW89_DECL_RFK_DELAY (1 ), +RTW89_DECL_RFK_WM (0xc094 ,BIT (9 ),0x0 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_drck_defs); + +static const struct rtw89_reg5_def rtw8852c_iqk_rxk_cfg_defs[] = { +RTW89_DECL_RFK_WM (0x030c ,0xff000000 ,0x0f ), +RTW89_DECL_RFK_WM (0x030c ,0xff000000 ,0x03 ), +RTW89_DECL_RFK_WM (0x032c ,0xffff0000 ,0x0001 ), +RTW89_DECL_RFK_WM (0x032c ,0xffff0000 ,0x0041 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_iqk_rxk_cfg_defs); + +static const struct rtw89_reg5_def rtw8852c_iqk_afebb_restore_defs_a[] = { +RTW89_DECL_RFK_WM (0x12b8 ,0x40000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x20fc ,0x00010000 ,0x1 ), +RTW89_DECL_RFK_WM (0x20fc ,0x00100000 ,0x0 ), +RTW89_DECL_RFK_WM (0x20fc ,0x01000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x20fc ,0x10000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x5670 ,MASKDWORD ,0x00000000 ), +RTW89_DECL_RFK_WM (0x12a0 ,0x000ff000 ,0x00 ), +RTW89_DECL_RFK_WM (0x20fc ,0x00010000 ,0x0 ), +RTW89_DECL_RFK_WM (0x20fc ,0x01000000 ,0x0 ), +RTW89_DECL_RFK_WRF (RF_PATH_A ,0x10005 ,0x00001 ,0x1 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_iqk_afebb_restore_defs_a); + +static const struct rtw89_reg5_def rtw8852c_iqk_afebb_restore_defs_b[] = { +RTW89_DECL_RFK_WM (0x32b8 ,0x40000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x20fc ,0x00020000 ,0x1 ), +RTW89_DECL_RFK_WM (0x20fc ,0x00200000 ,0x0 ), +RTW89_DECL_RFK_WM (0x20fc ,0x02000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x20fc ,0x20000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x7670 ,MASKDWORD ,0x00000000 ), +RTW89_DECL_RFK_WM (0x32a0 ,0x000ff000 ,0x00 ), +RTW89_DECL_RFK_WM (0x20fc ,0x00020000 ,0x0 ), +RTW89_DECL_RFK_WM (0x20fc ,0x02000000 ,0x0 ), +RTW89_DECL_RFK_WRF (RF_PATH_B ,0x10005 ,0x00001 ,0x1 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_iqk_afebb_restore_defs_b); + +static const struct rtw89_reg5_def rtw8852c_read_rxsram_pre_defs[] = { +RTW89_DECL_RFK_WM (0x80e8 ,BIT (7 ),0x1 ), +RTW89_DECL_RFK_WM (0x8074 ,BIT (31 ),0x1 ), +RTW89_DECL_RFK_WM (0x80d4 ,MASKDWORD ,0x00020000 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_read_rxsram_pre_defs); + +static const struct rtw89_reg5_def rtw8852c_read_rxsram_post_defs[] = { +RTW89_DECL_RFK_WM (0x80e8 ,BIT (7 ),0x0 ), +RTW89_DECL_RFK_WM (0x8074 ,BIT (31 ),0x0 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_read_rxsram_post_defs); + +static const struct rtw89_reg5_def rtw8852c_dpk_mdpd_order0_defs[] = { +RTW89_DECL_RFK_WM (0x80a0 ,BIT (1 ) |BIT (0 ),0x0 ), +RTW89_DECL_RFK_WM (0x809c ,BIT (10 ) |BIT (9 ),0x2 ), +RTW89_DECL_RFK_WM (0x80a0 ,0x00001F00 ,0x4 ), +RTW89_DECL_RFK_WM (0x8070 ,0x70000000 ,0x1 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_dpk_mdpd_order0_defs); + +static const struct rtw89_reg5_def rtw8852c_dpk_mdpd_order1_defs[] = { +RTW89_DECL_RFK_WM (0x80a0 ,BIT (1 ) |BIT (0 ),0x1 ), +RTW89_DECL_RFK_WM (0x809c ,BIT (10 ) |BIT (9 ),0x1 ), +RTW89_DECL_RFK_WM (0x80a0 ,0x00001F00 ,0x0 ), +RTW89_DECL_RFK_WM (0x8070 ,0x70000000 ,0x0 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_dpk_mdpd_order1_defs); + +static const struct rtw89_reg5_def rtw8852c_dpk_mdpd_order2_defs[] = { +RTW89_DECL_RFK_WM (0x80a0 ,BIT (1 ) |BIT (0 ),0x2 ), +RTW89_DECL_RFK_WM (0x809c ,BIT (10 ) |BIT (9 ),0x0 ), +RTW89_DECL_RFK_WM (0x80a0 ,0x00001F00 ,0x0 ), +RTW89_DECL_RFK_WM (0x8070 ,0x70000000 ,0x0 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_dpk_mdpd_order2_defs); + +static const struct rtw89_reg5_def rtw8852c_dpk_mdpd_order3_defs[] = { +RTW89_DECL_RFK_WM (0x80a0 ,BIT (1 ) |BIT (0 ),0x3 ), +RTW89_DECL_RFK_WM (0x809c ,BIT (10 ) |BIT (9 ),0x3 ), +RTW89_DECL_RFK_WM (0x80a0 ,0x00001F00 ,0x4 ), +RTW89_DECL_RFK_WM (0x8070 ,0x70000000 ,0x1 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_dpk_mdpd_order3_defs); + +static const struct rtw89_reg5_def rtw8852c_dpk_kip_pwr_clk_on_defs[] = { +RTW89_DECL_RFK_WM (0x8008 ,MASKDWORD ,0x00000080 ), +RTW89_DECL_RFK_WM (0x8088 ,MASKDWORD ,0x807f030a ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_dpk_kip_pwr_clk_on_defs); + +static const struct rtw89_reg5_def rtw8852c_dpk_kip_pwr_clk_off_defs[] = { +RTW89_DECL_RFK_WM (0x8008 ,MASKDWORD ,0x00000000 ), +RTW89_DECL_RFK_WM (0x8088 ,MASKDWORD ,0x80000000 ), +RTW89_DECL_RFK_WM (0x80f4 ,BIT (18 ),0x1 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_dpk_kip_pwr_clk_off_defs); + +static const struct rtw89_reg5_def rtw8852c_tssi_sys_defs[] = { +RTW89_DECL_RFK_WM (0x12bc ,0x000ffff0 ,0xb5b5 ), +RTW89_DECL_RFK_WM (0x32bc ,0x000ffff0 ,0xb5b5 ), +RTW89_DECL_RFK_WM (0x0300 ,0xff000000 ,0x16 ), +RTW89_DECL_RFK_WM (0x0304 ,0x0000ffff ,0x1f19 ), +RTW89_DECL_RFK_WM (0x0308 ,0xff000000 ,0x1c ), +RTW89_DECL_RFK_WM (0x0314 ,0xffff0000 ,0x2041 ), +RTW89_DECL_RFK_WM (0x0318 ,0xffffffff ,0x20012041 ), +RTW89_DECL_RFK_WM (0x0324 ,0xffff0000 ,0x2001 ), +RTW89_DECL_RFK_WM (0x0020 ,0x00006000 ,0x3 ), +RTW89_DECL_RFK_WM (0x0024 ,0x00006000 ,0x3 ), +RTW89_DECL_RFK_WM (0x0704 ,0xffff0000 ,0x601e ), +RTW89_DECL_RFK_WM (0x2704 ,0xffff0000 ,0x601e ), +RTW89_DECL_RFK_WM (0x0700 ,0xf0000000 ,0x4 ), +RTW89_DECL_RFK_WM (0x2700 ,0xf0000000 ,0x4 ), +RTW89_DECL_RFK_WM (0x0650 ,0x3c000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x2650 ,0x3c000000 ,0x0 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_sys_defs); + +static const struct rtw89_reg5_def rtw8852c_tssi_sys_defs_2g_a[] = { +RTW89_DECL_RFK_WM (0x120c ,0x000000ff ,0x33 ), +RTW89_DECL_RFK_WM (0x12c0 ,0x0ff00000 ,0x33 ), +RTW89_DECL_RFK_WM (0x58f8 ,0x40000000 ,0x1 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_sys_defs_2g_a); + +static const struct rtw89_reg5_def rtw8852c_tssi_sys_defs_2g_b[] = { +RTW89_DECL_RFK_WM (0x320c ,0x000000ff ,0x33 ), +RTW89_DECL_RFK_WM (0x32c0 ,0x0ff00000 ,0x33 ), +RTW89_DECL_RFK_WM (0x78f8 ,0x40000000 ,0x1 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_sys_defs_2g_b); + +static const struct rtw89_reg5_def rtw8852c_tssi_sys_defs_5g_a[] = { +RTW89_DECL_RFK_WM (0x120c ,0x000000ff ,0x44 ), +RTW89_DECL_RFK_WM (0x12c0 ,0x0ff00000 ,0x44 ), +RTW89_DECL_RFK_WM (0x58f8 ,0x40000000 ,0x0 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_sys_defs_5g_a); + +static const struct rtw89_reg5_def rtw8852c_tssi_sys_defs_5g_b[] = { +RTW89_DECL_RFK_WM (0x320c ,0x000000ff ,0x44 ), +RTW89_DECL_RFK_WM (0x32c0 ,0x0ff00000 ,0x44 ), +RTW89_DECL_RFK_WM (0x78f8 ,0x40000000 ,0x0 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_sys_defs_5g_b); + +static const struct rtw89_reg5_def rtw8852c_tssi_txpwr_ctrl_bb_defs_a[] = { +RTW89_DECL_RFK_WM (0x566c ,0x00001000 ,0x0 ), +RTW89_DECL_RFK_WM (0x5800 ,0xffffffff ,0x003f807f ), +RTW89_DECL_RFK_WM (0x580c ,0x0000007f ,0x40 ), +RTW89_DECL_RFK_WM (0x580c ,0x0fffff00 ,0x00040 ), +RTW89_DECL_RFK_WM (0x5810 ,0xffffffff ,0x59010000 ), +RTW89_DECL_RFK_WM (0x5814 ,0x01ffffff ,0x026d000 ), +RTW89_DECL_RFK_WM (0x5814 ,0xf8000000 ,0x00 ), +RTW89_DECL_RFK_WM (0x5818 ,0xffffffff ,0x002c1800 ), +RTW89_DECL_RFK_WM (0x581c ,0x3fffffff ,0x3dc80280 ), +RTW89_DECL_RFK_WM (0x5820 ,0xffffffff ,0x00000080 ), +RTW89_DECL_RFK_WM (0x58e8 ,0x0000003f ,0x03 ), +RTW89_DECL_RFK_WM (0x580c ,0x10000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x580c ,0x40000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x5834 ,0x3fffffff ,0x000115f2 ), +RTW89_DECL_RFK_WM (0x5838 ,0x7fffffff ,0x0000121 ), +RTW89_DECL_RFK_WM (0x5854 ,0x3fffffff ,0x000115f2 ), +RTW89_DECL_RFK_WM (0x5858 ,0x7fffffff ,0x0000121 ), +RTW89_DECL_RFK_WM (0x5860 ,0x80000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x5864 ,0x07ffffff ,0x00801ff ), +RTW89_DECL_RFK_WM (0x5898 ,0xffffffff ,0x00000000 ), +RTW89_DECL_RFK_WM (0x589c ,0xffffffff ,0x00000000 ), +RTW89_DECL_RFK_WM (0x58a4 ,0x000000ff ,0x16 ), +RTW89_DECL_RFK_WM (0x58b4 ,0x7fffffff ,0x0a002000 ), +RTW89_DECL_RFK_WM (0x58b8 ,0x7fffffff ,0x00007628 ), +RTW89_DECL_RFK_WM (0x58bc ,0x07ffffff ,0x7a7807f ), +RTW89_DECL_RFK_WM (0x58c0 ,0xfffe0000 ,0x003f ), +RTW89_DECL_RFK_WM (0x58c4 ,0xffffffff ,0x0003ffff ), +RTW89_DECL_RFK_WM (0x58c8 ,0x00ffffff ,0x000000 ), +RTW89_DECL_RFK_WM (0x58c8 ,0xf0000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x58cc ,0xffffffff ,0x00000000 ), +RTW89_DECL_RFK_WM (0x58d0 ,0x07ffffff ,0x2008101 ), +RTW89_DECL_RFK_WM (0x58d4 ,0x000000ff ,0x00 ), +RTW89_DECL_RFK_WM (0x58d4 ,0x0003fe00 ,0x0ff ), +RTW89_DECL_RFK_WM (0x58d4 ,0x07fc0000 ,0x100 ), +RTW89_DECL_RFK_WM (0x58d8 ,0xffffffff ,0x8008016c ), +RTW89_DECL_RFK_WM (0x58dc ,0x0001ffff ,0x0807f ), +RTW89_DECL_RFK_WM (0x58dc ,0xfff00000 ,0x800 ), +RTW89_DECL_RFK_WM (0x58f0 ,0x0003ffff ,0x001ff ), +RTW89_DECL_RFK_WM (0x58f4 ,0x000fffff ,0x000 ), +RTW89_DECL_RFK_WM (0x58f8 ,0x000fffff ,0x000 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_txpwr_ctrl_bb_defs_a); + +static const struct rtw89_reg5_def rtw8852c_tssi_txpwr_ctrl_bb_defs_b[] = { +RTW89_DECL_RFK_WM (0x566c ,0x00001000 ,0x0 ), +RTW89_DECL_RFK_WM (0x7800 ,0xffffffff ,0x003f807f ), +RTW89_DECL_RFK_WM (0x780c ,0x0000007f ,0x40 ), +RTW89_DECL_RFK_WM (0x780c ,0x0fffff00 ,0x00040 ), +RTW89_DECL_RFK_WM (0x7810 ,0xffffffff ,0x59010000 ), +RTW89_DECL_RFK_WM (0x7814 ,0x01ffffff ,0x026d000 ), +RTW89_DECL_RFK_WM (0x7814 ,0xf8000000 ,0x00 ), +RTW89_DECL_RFK_WM (0x7818 ,0xffffffff ,0x002c1800 ), +RTW89_DECL_RFK_WM (0x781c ,0x3fffffff ,0x3dc80280 ), +RTW89_DECL_RFK_WM (0x7820 ,0xffffffff ,0x00000080 ), +RTW89_DECL_RFK_WM (0x78e8 ,0x0000003f ,0x03 ), +RTW89_DECL_RFK_WM (0x780c ,0x10000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x780c ,0x40000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x7834 ,0x3fffffff ,0x000115f2 ), +RTW89_DECL_RFK_WM (0x7838 ,0x7fffffff ,0x0000121 ), +RTW89_DECL_RFK_WM (0x7854 ,0x3fffffff ,0x000115f2 ), +RTW89_DECL_RFK_WM (0x7858 ,0x7fffffff ,0x0000121 ), +RTW89_DECL_RFK_WM (0x7860 ,0x80000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x7864 ,0x07ffffff ,0x00801ff ), +RTW89_DECL_RFK_WM (0x7898 ,0xffffffff ,0x00000000 ), +RTW89_DECL_RFK_WM (0x789c ,0xffffffff ,0x00000000 ), +RTW89_DECL_RFK_WM (0x78a4 ,0x000000ff ,0x16 ), +RTW89_DECL_RFK_WM (0x78b4 ,0x7fffffff ,0x0a002000 ), +RTW89_DECL_RFK_WM (0x78b8 ,0x7fffffff ,0x00007628 ), +RTW89_DECL_RFK_WM (0x78bc ,0x07ffffff ,0x7a7807f ), +RTW89_DECL_RFK_WM (0x78c0 ,0xfffe0000 ,0x003f ), +RTW89_DECL_RFK_WM (0x78c4 ,0xffffffff ,0x0003ffff ), +RTW89_DECL_RFK_WM (0x78c8 ,0x00ffffff ,0x000000 ), +RTW89_DECL_RFK_WM (0x78c8 ,0xf0000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x78cc ,0xffffffff ,0x00000000 ), +RTW89_DECL_RFK_WM (0x78d0 ,0x07ffffff ,0x2008101 ), +RTW89_DECL_RFK_WM (0x78d4 ,0x000000ff ,0x00 ), +RTW89_DECL_RFK_WM (0x78d4 ,0x0003fe00 ,0x0ff ), +RTW89_DECL_RFK_WM (0x78d4 ,0x07fc0000 ,0x100 ), +RTW89_DECL_RFK_WM (0x78d8 ,0xffffffff ,0x8008016c ), +RTW89_DECL_RFK_WM (0x78dc ,0x0001ffff ,0x0807f ), +RTW89_DECL_RFK_WM (0x78dc ,0xfff00000 ,0x800 ), +RTW89_DECL_RFK_WM (0x78f0 ,0x0003ffff ,0x001ff ), +RTW89_DECL_RFK_WM (0x78f4 ,0x000fffff ,0x000 ), +RTW89_DECL_RFK_WM (0x78f8 ,0x000fffff ,0x000 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_txpwr_ctrl_bb_defs_b); + +static const struct rtw89_reg5_def rtw8852c_tssi_txpwr_ctrl_bb_he_tb_defs_a[] = { +RTW89_DECL_RFK_WM (0x58a0 ,0xffffffff ,0x000000fe ), +RTW89_DECL_RFK_WM (0x58e4 ,0x0000007f ,0x1f ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_txpwr_ctrl_bb_he_tb_defs_a); + +static const struct rtw89_reg5_def rtw8852c_tssi_txpwr_ctrl_bb_he_tb_defs_b[] = { +RTW89_DECL_RFK_WM (0x78a0 ,0xffffffff ,0x000000fe ), +RTW89_DECL_RFK_WM (0x78e4 ,0x0000007f ,0x1f ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_txpwr_ctrl_bb_he_tb_defs_b); + +static const struct rtw89_reg5_def rtw8852c_tssi_dck_defs_a[] = { +RTW89_DECL_RFK_WM (0x58c4 ,0x3ffc0000 ,0x0 ), +RTW89_DECL_RFK_WM (0x58c8 ,0x00000fff ,0x0 ), +RTW89_DECL_RFK_WM (0x58c8 ,0x00fff000 ,0x0 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_dck_defs_a); + +static const struct rtw89_reg5_def rtw8852c_tssi_dck_defs_b[] = { +RTW89_DECL_RFK_WM (0x78c4 ,0x3ffc0000 ,0x0 ), +RTW89_DECL_RFK_WM (0x78c8 ,0x00000fff ,0x0 ), +RTW89_DECL_RFK_WM (0x78c8 ,0x00fff000 ,0x0 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_dck_defs_b); + +static const struct rtw89_reg5_def rtw8852c_tssi_dck_defs_2g_a[] = { +RTW89_DECL_RFK_WM (0x580c ,0x0fff0000 ,0x000 ), +RTW89_DECL_RFK_WM (0x5814 ,0x003ff000 ,0x1af ), +RTW89_DECL_RFK_WM (0x5814 ,0x18000000 ,0x0 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_dck_defs_2g_a); + +static const struct rtw89_reg5_def rtw8852c_tssi_dck_defs_2g_b[] = { +RTW89_DECL_RFK_WM (0x780c ,0x0fff0000 ,0x000 ), +RTW89_DECL_RFK_WM (0x7814 ,0x003ff000 ,0x1af ), +RTW89_DECL_RFK_WM (0x7814 ,0x18000000 ,0x0 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_dck_defs_2g_b); + +static const struct rtw89_reg5_def rtw8852c_tssi_dck_defs_5g_a[] = { +RTW89_DECL_RFK_WM (0x580c ,0x0fff0000 ,0x000 ), +RTW89_DECL_RFK_WM (0x5814 ,0x00001000 ,0x1 ), +RTW89_DECL_RFK_WM (0x5814 ,0x0003c000 ,0xb ), +RTW89_DECL_RFK_WM (0x5814 ,0x00002000 ,0x1 ), +RTW89_DECL_RFK_WM (0x5814 ,0x003c0000 ,0x6 ), +RTW89_DECL_RFK_WM (0x5814 ,0x18000000 ,0x0 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_dck_defs_5g_a); + +static const struct rtw89_reg5_def rtw8852c_tssi_dck_defs_5g_b[] = { +RTW89_DECL_RFK_WM (0x780c ,0x0fff0000 ,0x000 ), +RTW89_DECL_RFK_WM (0x7814 ,0x00001000 ,0x1 ), +RTW89_DECL_RFK_WM (0x7814 ,0x0003c000 ,0xb ), +RTW89_DECL_RFK_WM (0x7814 ,0x00002000 ,0x1 ), +RTW89_DECL_RFK_WM (0x7814 ,0x003c0000 ,0x6 ), +RTW89_DECL_RFK_WM (0x7814 ,0x18000000 ,0x0 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_dck_defs_5g_b); + +static const struct rtw89_reg5_def rtw8852c_tssi_set_bbgain_split_a[] = { +RTW89_DECL_RFK_WM (0x5818 ,0x08000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x58d4 ,0xf0000000 ,0x7 ), +RTW89_DECL_RFK_WM (0x58f0 ,0x000c0000 ,0x1 ), +RTW89_DECL_RFK_WM (0x58f0 ,0xfff00000 ,0x400 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_set_bbgain_split_a); + +static const struct rtw89_reg5_def rtw8852c_tssi_set_bbgain_split_b[] = { +RTW89_DECL_RFK_WM (0x7818 ,0x08000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x78d4 ,0xf0000000 ,0x7 ), +RTW89_DECL_RFK_WM (0x78f0 ,0x000c0000 ,0x1 ), +RTW89_DECL_RFK_WM (0x78f0 ,0xfff00000 ,0x400 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_set_bbgain_split_b); + +static const struct rtw89_reg5_def rtw8852c_tssi_slope_cal_org_defs_2g_a[] = { +RTW89_DECL_RFK_WM (0x5608 ,0x07ffffff ,0x0201008 ), +RTW89_DECL_RFK_WM (0x560c ,0x07ffffff ,0x0201008 ), +RTW89_DECL_RFK_WM (0x5610 ,0x07ffffff ,0x0201020 ), +RTW89_DECL_RFK_WM (0x5614 ,0x07ffffff ,0x0201008 ), +RTW89_DECL_RFK_WM (0x5618 ,0x07ffffff ,0x0801008 ), +RTW89_DECL_RFK_WM (0x561c ,0x000001ff ,0x008 ), +RTW89_DECL_RFK_WM (0x561c ,0xffff0000 ,0x0808 ), +RTW89_DECL_RFK_WM (0x5620 ,0xffffffff ,0x08080808 ), +RTW89_DECL_RFK_WM (0x5624 ,0xffffffff ,0x0808081e ), +RTW89_DECL_RFK_WM (0x5628 ,0xffffffff ,0x08080808 ), +RTW89_DECL_RFK_WM (0x562c ,0x0000ffff ,0x081d ), +RTW89_DECL_RFK_WM (0x581c ,0x00100000 ,0x1 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_slope_cal_org_defs_2g_a); + +static const struct rtw89_reg5_def rtw8852c_tssi_slope_cal_org_defs_2g_b[] = { +RTW89_DECL_RFK_WM (0x7608 ,0x07ffffff ,0x0201008 ), +RTW89_DECL_RFK_WM (0x760c ,0x07ffffff ,0x0201008 ), +RTW89_DECL_RFK_WM (0x7610 ,0x07ffffff ,0x0204020 ), +RTW89_DECL_RFK_WM (0x7614 ,0x07ffffff ,0x0201008 ), +RTW89_DECL_RFK_WM (0x7618 ,0x07ffffff ,0x0801008 ), +RTW89_DECL_RFK_WM (0x761c ,0x000001ff ,0x020 ), +RTW89_DECL_RFK_WM (0x761c ,0xffff0000 ,0x0808 ), +RTW89_DECL_RFK_WM (0x7620 ,0xffffffff ,0x08080808 ), +RTW89_DECL_RFK_WM (0x7624 ,0xffffffff ,0x08081e21 ), +RTW89_DECL_RFK_WM (0x7628 ,0xffffffff ,0x08080808 ), +RTW89_DECL_RFK_WM (0x762c ,0x0000ffff ,0x1d23 ), +RTW89_DECL_RFK_WM (0x781c ,0x00100000 ,0x1 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_slope_cal_org_defs_2g_b); + +static const struct rtw89_reg5_def rtw8852c_tssi_slope_cal_org_defs_5g_a[] = { +RTW89_DECL_RFK_WM (0x5608 ,0x07ffffff ,0x0201008 ), +RTW89_DECL_RFK_WM (0x560c ,0x07ffffff ,0x0201008 ), +RTW89_DECL_RFK_WM (0x5610 ,0x07ffffff ,0x0201008 ), +RTW89_DECL_RFK_WM (0x5614 ,0x07ffffff ,0x0201008 ), +RTW89_DECL_RFK_WM (0x5618 ,0x07ffffff ,0x0201008 ), +RTW89_DECL_RFK_WM (0x561c ,0x000001ff ,0x008 ), +RTW89_DECL_RFK_WM (0x561c ,0xffff0000 ,0x0808 ), +RTW89_DECL_RFK_WM (0x5620 ,0xffffffff ,0x08080808 ), +RTW89_DECL_RFK_WM (0x5624 ,0xffffffff ,0x08080808 ), +RTW89_DECL_RFK_WM (0x5628 ,0xffffffff ,0x08080808 ), +RTW89_DECL_RFK_WM (0x562c ,0x0000ffff ,0x0808 ), +RTW89_DECL_RFK_WM (0x581c ,0x00100000 ,0x0 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_slope_cal_org_defs_5g_a); + +static const struct rtw89_reg5_def rtw8852c_tssi_slope_cal_org_defs_5g_b[] = { +RTW89_DECL_RFK_WM (0x7608 ,0x07ffffff ,0x0201008 ), +RTW89_DECL_RFK_WM (0x760c ,0x07ffffff ,0x0201008 ), +RTW89_DECL_RFK_WM (0x7610 ,0x07ffffff ,0x0201008 ), +RTW89_DECL_RFK_WM (0x7614 ,0x07ffffff ,0x0201008 ), +RTW89_DECL_RFK_WM (0x7618 ,0x07ffffff ,0x0201008 ), +RTW89_DECL_RFK_WM (0x761c ,0x000001ff ,0x008 ), +RTW89_DECL_RFK_WM (0x761c ,0xffff0000 ,0x0808 ), +RTW89_DECL_RFK_WM (0x7620 ,0xffffffff ,0x08080808 ), +RTW89_DECL_RFK_WM (0x7624 ,0xffffffff ,0x08080808 ), +RTW89_DECL_RFK_WM (0x7628 ,0xffffffff ,0x08080808 ), +RTW89_DECL_RFK_WM (0x762c ,0x0000ffff ,0x0808 ), +RTW89_DECL_RFK_WM (0x781c ,0x00100000 ,0x0 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_slope_cal_org_defs_5g_b); + +static const struct rtw89_reg5_def rtw8852c_tssi_set_aligk_default_defs_2g_a[] = { +RTW89_DECL_RFK_WM (0x5604 ,0x80000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x5600 ,0x3fffffff ,0x000000 ), +RTW89_DECL_RFK_WM (0x5604 ,0x003fffff ,0x2d2721 ), +RTW89_DECL_RFK_WM (0x5630 ,0x3fffffff ,0x00000000 ), +RTW89_DECL_RFK_WM (0x5634 ,0x000003ff ,0x000 ), +RTW89_DECL_RFK_WM (0x5634 ,0x000ffc00 ,0x3b8 ), +RTW89_DECL_RFK_WM (0x5634 ,0x3ff00000 ,0x3d2 ), +RTW89_DECL_RFK_WM (0x5638 ,0x000003ff ,0x042 ), +RTW89_DECL_RFK_WM (0x5638 ,0x000ffc00 ,0x06b ), +RTW89_DECL_RFK_WM (0x563c ,0x3fffffff ,0x00000000 ), +RTW89_DECL_RFK_WM (0x5640 ,0x000003ff ,0x000 ), +RTW89_DECL_RFK_WM (0x5640 ,0x000ffc00 ,0x3bc ), +RTW89_DECL_RFK_WM (0x5640 ,0x3ff00000 ,0x3d6 ), +RTW89_DECL_RFK_WM (0x5644 ,0x000003ff ,0x03e ), +RTW89_DECL_RFK_WM (0x5644 ,0x000ffc00 ,0x06b ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_set_aligk_default_defs_2g_a); + +static const struct rtw89_reg5_def rtw8852c_tssi_set_aligk_default_defs_2g_b[] = { +RTW89_DECL_RFK_WM (0x7604 ,0x80000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x7600 ,0x3fffffff ,0x000000 ), +RTW89_DECL_RFK_WM (0x7604 ,0x003fffff ,0x2d2721 ), +RTW89_DECL_RFK_WM (0x7630 ,0x3fffffff ,0x00000000 ), +RTW89_DECL_RFK_WM (0x7634 ,0x000003ff ,0x000 ), +RTW89_DECL_RFK_WM (0x7634 ,0x000ffc00 ,0x3c0 ), +RTW89_DECL_RFK_WM (0x7634 ,0x3ff00000 ,0x3da ), +RTW89_DECL_RFK_WM (0x7638 ,0x000003ff ,0x002 ), +RTW89_DECL_RFK_WM (0x7638 ,0x000ffc00 ,0x071 ), +RTW89_DECL_RFK_WM (0x763c ,0x3fffffff ,0x00000000 ), +RTW89_DECL_RFK_WM (0x7640 ,0x000003ff ,0x000 ), +RTW89_DECL_RFK_WM (0x7640 ,0x000ffc00 ,0x3c8 ), +RTW89_DECL_RFK_WM (0x7640 ,0x3ff00000 ,0x3e2 ), +RTW89_DECL_RFK_WM (0x7644 ,0x000003ff ,0x00c ), +RTW89_DECL_RFK_WM (0x7644 ,0x000ffc00 ,0x071 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_set_aligk_default_defs_2g_b); + +static const struct rtw89_reg5_def rtw8852c_tssi_set_aligk_default_defs_5g_a[] = { +RTW89_DECL_RFK_WM (0x5604 ,0x80000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x5600 ,0x3fffffff ,0x000000 ), +RTW89_DECL_RFK_WM (0x5604 ,0x003fffff ,0x312600 ), +RTW89_DECL_RFK_WM (0x5630 ,0x3fffffff ,0x00000000 ), +RTW89_DECL_RFK_WM (0x5634 ,0x000003ff ,0x000 ), +RTW89_DECL_RFK_WM (0x5634 ,0x000ffc00 ,0x000 ), +RTW89_DECL_RFK_WM (0x5634 ,0x3ff00000 ,0x3e9 ), +RTW89_DECL_RFK_WM (0x5638 ,0x000003ff ,0x039 ), +RTW89_DECL_RFK_WM (0x5638 ,0x000ffc00 ,0x07d ), +RTW89_DECL_RFK_WM (0x563c ,0x3fffffff ,0x00000000 ), +RTW89_DECL_RFK_WM (0x5640 ,0x000003ff ,0x000 ), +RTW89_DECL_RFK_WM (0x5640 ,0x000ffc00 ,0x000 ), +RTW89_DECL_RFK_WM (0x5640 ,0x3ff00000 ,0x000 ), +RTW89_DECL_RFK_WM (0x5644 ,0x000003ff ,0x000 ), +RTW89_DECL_RFK_WM (0x5644 ,0x000ffc00 ,0x000 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_set_aligk_default_defs_5g_a); + +static const struct rtw89_reg5_def rtw8852c_tssi_set_aligk_default_defs_5g_b[] = { +RTW89_DECL_RFK_WM (0x7604 ,0x80000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x7600 ,0x3fffffff ,0x000000 ), +RTW89_DECL_RFK_WM (0x7604 ,0x003fffff ,0x312600 ), +RTW89_DECL_RFK_WM (0x7630 ,0x3fffffff ,0x00000000 ), +RTW89_DECL_RFK_WM (0x7634 ,0x000003ff ,0x000 ), +RTW89_DECL_RFK_WM (0x7634 ,0x000ffc00 ,0x000 ), +RTW89_DECL_RFK_WM (0x7634 ,0x3ff00000 ,0x3e9 ), +RTW89_DECL_RFK_WM (0x7638 ,0x000003ff ,0x039 ), +RTW89_DECL_RFK_WM (0x7638 ,0x000ffc00 ,0x07d ), +RTW89_DECL_RFK_WM (0x763c ,0x3fffffff ,0x00000000 ), +RTW89_DECL_RFK_WM (0x7640 ,0x000003ff ,0x000 ), +RTW89_DECL_RFK_WM (0x7640 ,0x000ffc00 ,0x000 ), +RTW89_DECL_RFK_WM (0x7640 ,0x3ff00000 ,0x000 ), +RTW89_DECL_RFK_WM (0x7644 ,0x000003ff ,0x000 ), +RTW89_DECL_RFK_WM (0x7644 ,0x000ffc00 ,0x000 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_set_aligk_default_defs_5g_b); + +static const struct rtw89_reg5_def rtw8852c_tssi_set_aligk_default_defs_6g_a[] = { +RTW89_DECL_RFK_WM (0x5604 ,0x80000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x5600 ,0x3fffffff ,0x000000 ), +RTW89_DECL_RFK_WM (0x5604 ,0x003fffff ,0x312600 ), +RTW89_DECL_RFK_WM (0x5630 ,0x3fffffff ,0x00000000 ), +RTW89_DECL_RFK_WM (0x5634 ,0x000003ff ,0x000 ), +RTW89_DECL_RFK_WM (0x5634 ,0x000ffc00 ,0x000 ), +RTW89_DECL_RFK_WM (0x5634 ,0x3ff00000 ,0x3e9 ), +RTW89_DECL_RFK_WM (0x5638 ,0x000003ff ,0x039 ), +RTW89_DECL_RFK_WM (0x5638 ,0x000ffc00 ,0x080 ), +RTW89_DECL_RFK_WM (0x563c ,0x3fffffff ,0x00000000 ), +RTW89_DECL_RFK_WM (0x5640 ,0x000003ff ,0x000 ), +RTW89_DECL_RFK_WM (0x5640 ,0x000ffc00 ,0x000 ), +RTW89_DECL_RFK_WM (0x5640 ,0x3ff00000 ,0x000 ), +RTW89_DECL_RFK_WM (0x5644 ,0x000003ff ,0x000 ), +RTW89_DECL_RFK_WM (0x5644 ,0x000ffc00 ,0x000 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_set_aligk_default_defs_6g_a); + +static const struct rtw89_reg5_def rtw8852c_tssi_set_aligk_default_defs_6g_b[] = { +RTW89_DECL_RFK_WM (0x7604 ,0x80000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x7600 ,0x3fffffff ,0x000000 ), +RTW89_DECL_RFK_WM (0x7604 ,0x003fffff ,0x312600 ), +RTW89_DECL_RFK_WM (0x7630 ,0x3fffffff ,0x00000000 ), +RTW89_DECL_RFK_WM (0x7634 ,0x000003ff ,0x000 ), +RTW89_DECL_RFK_WM (0x7634 ,0x000ffc00 ,0x000 ), +RTW89_DECL_RFK_WM (0x7634 ,0x3ff00000 ,0x3e9 ), +RTW89_DECL_RFK_WM (0x7638 ,0x000003ff ,0x039 ), +RTW89_DECL_RFK_WM (0x7638 ,0x000ffc00 ,0x080 ), +RTW89_DECL_RFK_WM (0x763c ,0x3fffffff ,0x00000000 ), +RTW89_DECL_RFK_WM (0x7640 ,0x000003ff ,0x000 ), +RTW89_DECL_RFK_WM (0x7640 ,0x000ffc00 ,0x000 ), +RTW89_DECL_RFK_WM (0x7640 ,0x3ff00000 ,0x000 ), +RTW89_DECL_RFK_WM (0x7644 ,0x000003ff ,0x000 ), +RTW89_DECL_RFK_WM (0x7644 ,0x000ffc00 ,0x000 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_set_aligk_default_defs_6g_b); + +static const struct rtw89_reg5_def rtw8852c_tssi_slope_defs_a[] = { +RTW89_DECL_RFK_WM (0x5820 ,0x80000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x5818 ,0x10000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x5814 ,0x00000800 ,0x1 ), +RTW89_DECL_RFK_WM (0x581c ,0x20000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x58e8 ,0x0000003f ,0x0f ), +RTW89_DECL_RFK_WM (0x581c ,0x000003ff ,0x280 ), +RTW89_DECL_RFK_WM (0x581c ,0x000ffc00 ,0x200 ), +RTW89_DECL_RFK_WM (0x58b8 ,0x007f0000 ,0x00 ), +RTW89_DECL_RFK_WM (0x58b8 ,0x7f000000 ,0x00 ), +RTW89_DECL_RFK_WM (0x58b4 ,0x7f000000 ,0x0a ), +RTW89_DECL_RFK_WM (0x58b8 ,0x0000007f ,0x28 ), +RTW89_DECL_RFK_WM (0x58b8 ,0x00007f00 ,0x76 ), +RTW89_DECL_RFK_WM (0x5810 ,0x20000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x5814 ,0x20000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x580c ,0x10000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x580c ,0x40000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x5834 ,0x0003ffff ,0x115f2 ), +RTW89_DECL_RFK_WM (0x5834 ,0x3ffc0000 ,0x000 ), +RTW89_DECL_RFK_WM (0x5838 ,0x00000fff ,0x121 ), +RTW89_DECL_RFK_WM (0x5838 ,0x003ff000 ,0x000 ), +RTW89_DECL_RFK_WM (0x5854 ,0x0003ffff ,0x115f2 ), +RTW89_DECL_RFK_WM (0x5854 ,0x3ffc0000 ,0x000 ), +RTW89_DECL_RFK_WM (0x5858 ,0x00000fff ,0x121 ), +RTW89_DECL_RFK_WM (0x5858 ,0x003ff000 ,0x000 ), +RTW89_DECL_RFK_WM (0x5824 ,0x0003ffff ,0x115f2 ), +RTW89_DECL_RFK_WM (0x5824 ,0x3ffc0000 ,0x000 ), +RTW89_DECL_RFK_WM (0x5828 ,0x00000fff ,0x121 ), +RTW89_DECL_RFK_WM (0x5828 ,0x003ff000 ,0x000 ), +RTW89_DECL_RFK_WM (0x582c ,0x0003ffff ,0x115f2 ), +RTW89_DECL_RFK_WM (0x582c ,0x3ffc0000 ,0x000 ), +RTW89_DECL_RFK_WM (0x5830 ,0x00000fff ,0x121 ), +RTW89_DECL_RFK_WM (0x5830 ,0x003ff000 ,0x000 ), +RTW89_DECL_RFK_WM (0x583c ,0x0003ffff ,0x115f2 ), +RTW89_DECL_RFK_WM (0x583c ,0x3ffc0000 ,0x000 ), +RTW89_DECL_RFK_WM (0x5840 ,0x00000fff ,0x121 ), +RTW89_DECL_RFK_WM (0x5840 ,0x003ff000 ,0x000 ), +RTW89_DECL_RFK_WM (0x5844 ,0x0003ffff ,0x115f2 ), +RTW89_DECL_RFK_WM (0x5844 ,0x3ffc0000 ,0x000 ), +RTW89_DECL_RFK_WM (0x5848 ,0x00000fff ,0x121 ), +RTW89_DECL_RFK_WM (0x5848 ,0x003ff000 ,0x000 ), +RTW89_DECL_RFK_WM (0x584c ,0x0003ffff ,0x115f2 ), +RTW89_DECL_RFK_WM (0x584c ,0x3ffc0000 ,0x000 ), +RTW89_DECL_RFK_WM (0x5850 ,0x00000fff ,0x121 ), +RTW89_DECL_RFK_WM (0x5850 ,0x003ff000 ,0x000 ), +RTW89_DECL_RFK_WM (0x585c ,0x0003ffff ,0x115f2 ), +RTW89_DECL_RFK_WM (0x585c ,0x3ffc0000 ,0x000 ), +RTW89_DECL_RFK_WM (0x5860 ,0x00000fff ,0x121 ), +RTW89_DECL_RFK_WM (0x5860 ,0x003ff000 ,0x000 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_slope_defs_a); + +static const struct rtw89_reg5_def rtw8852c_tssi_slope_defs_b[] = { +RTW89_DECL_RFK_WM (0x7820 ,0x80000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x7818 ,0x10000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x7814 ,0x00000800 ,0x1 ), +RTW89_DECL_RFK_WM (0x781c ,0x20000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x78e8 ,0x0000003f ,0x0f ), +RTW89_DECL_RFK_WM (0x781c ,0x000003ff ,0x280 ), +RTW89_DECL_RFK_WM (0x781c ,0x000ffc00 ,0x200 ), +RTW89_DECL_RFK_WM (0x78b8 ,0x007f0000 ,0x00 ), +RTW89_DECL_RFK_WM (0x78b8 ,0x7f000000 ,0x00 ), +RTW89_DECL_RFK_WM (0x78b4 ,0x7f000000 ,0x0a ), +RTW89_DECL_RFK_WM (0x78b8 ,0x0000007f ,0x28 ), +RTW89_DECL_RFK_WM (0x78b8 ,0x00007f00 ,0x76 ), +RTW89_DECL_RFK_WM (0x7810 ,0x20000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x7814 ,0x20000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x780c ,0x10000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x780c ,0x40000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x7834 ,0x0003ffff ,0x115f2 ), +RTW89_DECL_RFK_WM (0x7834 ,0x3ffc0000 ,0x000 ), +RTW89_DECL_RFK_WM (0x7838 ,0x00000fff ,0x121 ), +RTW89_DECL_RFK_WM (0x7838 ,0x003ff000 ,0x000 ), +RTW89_DECL_RFK_WM (0x7854 ,0x0003ffff ,0x115f2 ), +RTW89_DECL_RFK_WM (0x7854 ,0x3ffc0000 ,0x000 ), +RTW89_DECL_RFK_WM (0x7858 ,0x00000fff ,0x121 ), +RTW89_DECL_RFK_WM (0x7858 ,0x003ff000 ,0x000 ), +RTW89_DECL_RFK_WM (0x7824 ,0x0003ffff ,0x115f2 ), +RTW89_DECL_RFK_WM (0x7824 ,0x3ffc0000 ,0x000 ), +RTW89_DECL_RFK_WM (0x7828 ,0x00000fff ,0x121 ), +RTW89_DECL_RFK_WM (0x7828 ,0x003ff000 ,0x000 ), +RTW89_DECL_RFK_WM (0x782c ,0x0003ffff ,0x115f2 ), +RTW89_DECL_RFK_WM (0x782c ,0x3ffc0000 ,0x000 ), +RTW89_DECL_RFK_WM (0x7830 ,0x00000fff ,0x121 ), +RTW89_DECL_RFK_WM (0x7830 ,0x003ff000 ,0x000 ), +RTW89_DECL_RFK_WM (0x783c ,0x0003ffff ,0x115f2 ), +RTW89_DECL_RFK_WM (0x783c ,0x3ffc0000 ,0x000 ), +RTW89_DECL_RFK_WM (0x7840 ,0x00000fff ,0x121 ), +RTW89_DECL_RFK_WM (0x7840 ,0x003ff000 ,0x000 ), +RTW89_DECL_RFK_WM (0x7844 ,0x0003ffff ,0x115f2 ), +RTW89_DECL_RFK_WM (0x7844 ,0x3ffc0000 ,0x000 ), +RTW89_DECL_RFK_WM (0x7848 ,0x00000fff ,0x121 ), +RTW89_DECL_RFK_WM (0x7848 ,0x003ff000 ,0x000 ), +RTW89_DECL_RFK_WM (0x784c ,0x0003ffff ,0x115f2 ), +RTW89_DECL_RFK_WM (0x784c ,0x3ffc0000 ,0x000 ), +RTW89_DECL_RFK_WM (0x7850 ,0x00000fff ,0x121 ), +RTW89_DECL_RFK_WM (0x7850 ,0x003ff000 ,0x000 ), +RTW89_DECL_RFK_WM (0x785c ,0x0003ffff ,0x115f2 ), +RTW89_DECL_RFK_WM (0x785c ,0x3ffc0000 ,0x000 ), +RTW89_DECL_RFK_WM (0x7860 ,0x00000fff ,0x121 ), +RTW89_DECL_RFK_WM (0x7860 ,0x003ff000 ,0x000 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_slope_defs_b); + +static const struct rtw89_reg5_def rtw8852c_tssi_run_slope_defs_a[] = { +RTW89_DECL_RFK_WM (0x5820 ,0x80000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x5820 ,0x80000000 ,0x1 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_run_slope_defs_a); + +static const struct rtw89_reg5_def rtw8852c_tssi_run_slope_defs_b[] = { +RTW89_DECL_RFK_WM (0x7820 ,0x80000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x7820 ,0x80000000 ,0x1 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_run_slope_defs_b); + +static const struct rtw89_reg5_def rtw8852c_tssi_track_defs_a[] = { +RTW89_DECL_RFK_WM (0x5820 ,0x80000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x5818 ,0x10000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x5814 ,0x00000800 ,0x0 ), +RTW89_DECL_RFK_WM (0x581c ,0x20000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x5864 ,0x000003ff ,0x1ff ), +RTW89_DECL_RFK_WM (0x5864 ,0x000ffc00 ,0x200 ), +RTW89_DECL_RFK_WM (0x5820 ,0x00000fff ,0x080 ), +RTW89_DECL_RFK_WM (0x5814 ,0x01000000 ,0x0 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_track_defs_a); + +static const struct rtw89_reg5_def rtw8852c_tssi_track_defs_b[] = { +RTW89_DECL_RFK_WM (0x7820 ,0x80000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x7818 ,0x10000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x7814 ,0x00000800 ,0x0 ), +RTW89_DECL_RFK_WM (0x781c ,0x20000000 ,0x1 ), +RTW89_DECL_RFK_WM (0x7864 ,0x000003ff ,0x1ff ), +RTW89_DECL_RFK_WM (0x7864 ,0x000ffc00 ,0x200 ), +RTW89_DECL_RFK_WM (0x7820 ,0x00000fff ,0x080 ), +RTW89_DECL_RFK_WM (0x7814 ,0x01000000 ,0x0 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_track_defs_b); + +static const struct rtw89_reg5_def rtw8852c_tssi_txagc_ofst_mv_avg_defs_a[] = { +RTW89_DECL_RFK_WM (0x58e4 ,0x00003800 ,0x1 ), +RTW89_DECL_RFK_WM (0x58e4 ,0x00004000 ,0x0 ), +RTW89_DECL_RFK_WM (0x58e4 ,0x00008000 ,0x1 ), +RTW89_DECL_RFK_WM (0x58e4 ,0x000f0000 ,0x0 ), +RTW89_DECL_RFK_WM (0x58e8 ,0x0000003f ,0x03 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_txagc_ofst_mv_avg_defs_a); + +static const struct rtw89_reg5_def rtw8852c_tssi_txagc_ofst_mv_avg_defs_b[] = { +RTW89_DECL_RFK_WM (0x78e4 ,0x00003800 ,0x1 ), +RTW89_DECL_RFK_WM (0x78e4 ,0x00004000 ,0x0 ), +RTW89_DECL_RFK_WM (0x78e4 ,0x00008000 ,0x1 ), +RTW89_DECL_RFK_WM (0x78e4 ,0x000f0000 ,0x0 ), +RTW89_DECL_RFK_WM (0x78e8 ,0x0000003f ,0x03 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_txagc_ofst_mv_avg_defs_b); + +static const struct rtw89_reg5_def rtw8852c_tssi_enable_defs_a[] = { +RTW89_DECL_RFK_WM (0x58e4 ,0x00004000 ,0x0 ), +RTW89_DECL_RFK_WM (0x5820 ,0x80000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x5820 ,0x80000000 ,0x1 ), +RTW89_DECL_RFK_WRF (0x0 ,0x10055 ,0x00080 ,0x1 ), +RTW89_DECL_RFK_WM (0x5818 ,0x10000000 ,0x1 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_enable_defs_a); + +static const struct rtw89_reg5_def rtw8852c_tssi_enable_defs_b[] = { +RTW89_DECL_RFK_WM (0x78e4 ,0x00004000 ,0x0 ), +RTW89_DECL_RFK_WM (0x7820 ,0x80000000 ,0x0 ), +RTW89_DECL_RFK_WM (0x7820 ,0x80000000 ,0x1 ), +RTW89_DECL_RFK_WRF (0x1 ,0x10055 ,0x00080 ,0x1 ), +RTW89_DECL_RFK_WM (0x7818 ,0x10000000 ,0x1 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_enable_defs_b); + +static const struct rtw89_reg5_def rtw8852c_tssi_disable_defs_a[] = { +RTW89_DECL_RFK_WM (0x5820 ,0x80000000 ,0x00000000 ), +RTW89_DECL_RFK_WM (0x5818 ,0x10000000 ,0x00000000 ), +RTW89_DECL_RFK_WM (0x58e4 ,0x00004000 ,0x00000001 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_disable_defs_a); + +static const struct rtw89_reg5_def rtw8852c_tssi_disable_defs_b[] = { +RTW89_DECL_RFK_WM (0x7820 ,0x80000000 ,0x00000000 ), +RTW89_DECL_RFK_WM (0x7818 ,0x10000000 ,0x00000000 ), +RTW89_DECL_RFK_WM (0x78e4 ,0x00004000 ,0x00000001 ), +}; + +RTW89_DECLARE_RFK_TBL (rtw8852c_tssi_disable_defs_b);
drivers/net/wireless/realtek/rtw89/rtw8852c_rfk_table.h new file +67 -0
67 lines not on this page · raw message
Signature · 1 line
2.25.1
Re: [PATCH v3 1/8] rtw89: 8852c: rfk: add RFK tables
Quoted 5 lines · Ping-Ke Shih
These tables are used by RFK (RF calibration) to set parameters. These parameters can trigger certain calibration, or configure/reset settings before and after RF calibrations.
Signed-off-by Ping-Ke Shih <[email protected]>
8 patches applied to wireless-next.git, thanks.
ec424639d41b rtw89: 8852c: rfk: add RFK tables 76599a8d0b7d rtw89: 8852c: rfk: add DACK fb8177d729f2 rtw89: 8852c: rfk: add LCK e5efc4d55c20 rtw89: 8852c: rfk: add TSSI 30052c5a1c99 rtw89: 8852c: rfk: add RCK ac91be975616 rtw89: 8852c: rfk: add RX DCK 2da8109d9885 rtw89: 8852c: rfk: add IQK da4cea16cb13 rtw89: 8852c: rfk: add DPK
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Ping-Ke Shih
maintainerPATCH v3 2/8 rtw89: 8852c: rfk: add DACK
In reply to Ping-Ke ShihDACK (digital-to-analog converters calibration) is used to calibrate DAC to output analog signals as expected.
--- drivers/net/wireless/realtek/rtw89/reg.h | 96 +++- drivers/net/wireless/realtek/rtw89/rtw8852c.c | 2 + .../net/wireless/realtek/rtw89/rtw8852c_rfk.c | 446 ++++++++++++++++++ .../net/wireless/realtek/rtw89/rtw8852c_rfk.h | 1 + 4 files changed, 538 insertions(+), 7 deletions(-)
drivers/net/wireless/realtek/rtw89/reg.h +89 -7
@@ -3484,9 +3484,12 @@#define R_S0_HW_SI_DIS 0x1200#define B_S0_HW_SI_DIS_W_R_TRIG GENMASK(30, 28)#define R_P0_RXCK 0x12A0 -#define B_P0_RXCK_VAL GENMASK(18, 16) -#define B_P0_RXCK_ON BIT(19)#define B_P0_RXCK_BW3 BIT(30) +#define B_P0_TXCK_ALL GENMASK(19, 12) +#define B_P0_RXCK_ON BIT(19) +#define B_P0_RXCK_VAL GENMASK(18, 16) +#define B_P0_TXCK_ON BIT(15) +#define B_P0_TXCK_VAL GENMASK(14, 12)#define R_P0_NRBW 0x12B8#define B_P0_NRBW_DBG BIT(30)#define R_S0_RXDC 0x12D4
@@ -4035,19 +4038,98 @@#define R_IQKINF2 0x9FE8#define B_IQKINF2_FCNT GENMASK(23, 16)#define B_IQKINF2_KCNT GENMASK(15, 8) -#define B_IQKINF2_NCTLV GENMAKS(7, 0) +#define B_IQKINF2_NCTLV GENMASK(7, 0) +#define R_DCOF0 0xC000 +#define B_DCOF0_V GENMASK(4, 1) +#define R_DCOF1 0xC004 +#define B_DCOF1_S BIT(0) +#define R_DCOF8 0xC020 +#define B_DCOF8_V GENMASK(4, 1) +#define R_DACK_S0P0 0xC040 +#define B_DACK_S0P0_OK BIT(31) +#define R_DACK_BIAS00 0xc048 +#define B_DACK_BIAS00 GENMASK(11, 2) +#define R_DACK_S0P2 0xC05C +#define B_DACK_S0M0 GENMASK(31, 24) +#define B_DACK_S0P2_OK BIT(2) +#define R_DACK_DADCK00 0xC060 +#define B_DACK_DADCK00 GENMASK(31, 24) +#define R_DACK_S0P1 0xC064 +#define B_DACK_S0P1_OK BIT(31) +#define R_DACK_BIAS01 0xC06C +#define B_DACK_BIAS01 GENMASK(11, 2) +#define R_DACK_S0P3 0xC080 +#define B_DACK_S0M1 GENMASK(31, 24) +#define B_DACK_S0P3_OK BIT(2) +#define R_DACK_DADCK01 0xC084 +#define B_DACK_DADCK01 GENMASK(31, 24) +#define R_DRCK 0xC0C4 +#define B_DRCK_IDLE BIT(9) +#define B_DRCK_EN BIT(6) +#define B_DRCK_VAL GENMASK(4, 0) +#define R_DRCK_RES 0xC0C8 +#define B_DRCK_RES GENMASK(19, 15) +#define B_DRCK_POL BIT(3)#define R_PATH0_SAMPL_DLY_T_V1 0xC0D4#define B_PATH0_SAMPL_DLY_T_MSK_V1 GENMASK(27, 26) +#define R_P0_CFCH_BW0 0xC0D4 +#define B_P0_CFCH_BW0 GENMASK(27, 26) +#define R_P0_CFCH_BW1 0xC0D8 +#define B_P0_CFCH_BW1 GENMASK(8, 5) +#define R_ADDCK0 0xC0F4 +#define B_ADDCK0 GENMASK(9, 8) +#define B_ADDCK0_EN BIT(4) +#define B_ADDCK0_RST BIT(2) +#define R_ADDCK0_RL 0xC0F8 +#define B_ADDCK0_RLS GENMASK(29, 28) +#define B_ADDCK0_RL1 GENMASK(27, 18) +#define B_ADDCK0_RL0 GENMASK(17, 8) +#define R_ADDCKR0 0xC0FC +#define B_ADDCKR0_A0 GENMASK(19, 10) +#define B_ADDCKR0_A1 GENMASK(9, 0) +#define R_DACK10 0xC100 +#define B_DACK10 GENMASK(4, 1) +#define R_DACK1_K 0xc104 +#define B_DACK1_EN BIT(0) +#define R_DACK11 0xC120 +#define B_DACK11 GENMASK(4, 1) +#define R_DACK_S1P0 0xC140 +#define B_DACK_S1P0_OK BIT(31) +#define R_DACK_BIAS10 0xC148 +#define B_DACK_BIAS10 GENMASK(11, 2) +#define R_DACK10S 0xC15C +#define B_DACK10S GENMASK(31, 24) +#define R_DACK_S1P2 0xC15C +#define B_DACK_S1P2_OK BIT(2) +#define R_DACK_DADCK10 0xC160 +#define B_DACK_DADCK10 GENMASK(31, 24) +#define R_DACK_S1P1 0xC164 +#define B_DACK_S1P1_OK BIT(31) +#define R_DACK_BIAS11 0xC16C +#define B_DACK_BIAS11 GENMASK(11, 2) +#define R_DACK11S 0xC180 +#define B_DACK11S GENMASK(31, 24) +#define R_DACK_S1P3 0xC180 +#define B_DACK_S1P3_OK BIT(2) +#define R_DACK_DADCK11 0xC184 +#define B_DACK_DADCK11 GENMASK(31, 24)#define R_PATH1_SAMPL_DLY_T_V1 0xC1D4#define B_PATH1_SAMPL_DLY_T_MSK_V1 GENMASK(27, 26)#define R_PATH0_BW_SEL_V1 0xC0D8#define B_PATH0_BW_SEL_MSK_V1 GENMASK(8, 5)#define R_PATH1_BW_SEL_V1 0xC1D8#define B_PATH1_BW_SEL_MSK_V1 GENMASK(8, 5) -#define R_P0_CFCH_BW0 0xC0D4 -#define B_P0_CFCH_BW0 GENMASK(27, 26) -#define R_P0_CFCH_BW1 0xC0D8 -#define B_P0_CFCH_BW1 GENMASK(8, 5) +#define R_ADDCK1 0xC1F4 +#define B_ADDCK1 GENMASK(9, 8) +#define B_ADDCK1_EN BIT(4) +#define B_ADDCK1_RST BIT(2) +#define R_ADDCK1_RL 0xC1F8 +#define B_ADDCK1_RLS GENMASK(29, 28) +#define B_ADDCK1_RL1 GENMASK(27, 18) +#define B_ADDCK1_RL0 GENMASK(17, 8) +#define R_ADDCKR1 0xC1fC +#define B_ADDCKR1_A0 GENMASK(19, 10) +#define B_ADDCKR1_A1 GENMASK(9, 0)/* WiFi CPU local domain */ #define R_AX_WDT_CTRL 0x0040
drivers/net/wireless/realtek/rtw89/rtw8852c.c +2 -0
@@ -1771,6 +1771,8 @@ static void rtw8852c_rfk_init(struct rtw89_dev *rtwdev)struct rtw89_mcc_info *mcc_info = &rtwdev->mcc;memset (mcc_info,0 ,sizeof (*mcc_info)); + +rtw8852c_dack (rtwdev); }static void rtw8852c_rfk_channel (struct rtw89_dev *rtwdev)
drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c +446 -0
466 lines not on this page · raw message
drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.h +1 -0
@@ -7,6 +7,7 @@#include "core.h" +void rtw8852c_dack (struct rtw89_dev *rtwdev);void rtw8852c_set_channel_rf (struct rtw89_dev *rtwdev,struct rtw89_channel_params *param,enum rtw89_phy_idx phy_idx);
Signature · 1 line
2.25.1
Ping-Ke Shih
maintainerPATCH v3 3/8 rtw89: 8852c: rfk: add LCK
In reply to Ping-Ke ShihLCK is short fro LC Tank calibration. Do this calibration once driver loads RF parameters table. Since the characteristic can be changed by temperature, we do this calibration again if difference of thermal value is over a threshold.
--- drivers/net/wireless/realtek/rtw89/core.h | 5 ++ drivers/net/wireless/realtek/rtw89/reg.h | 2 + drivers/net/wireless/realtek/rtw89/rtw8852c.c | 7 +++ .../net/wireless/realtek/rtw89/rtw8852c_rfk.c | 63 +++++++++++++++++++ .../net/wireless/realtek/rtw89/rtw8852c_rfk.h | 2 + 5 files changed, 79 insertions(+)
drivers/net/wireless/realtek/rtw89/core.h +5 -0
@@ -2642,6 +2642,10 @@ struct rtw89_mcc_info {u8 table_idx; }; +struct rtw89_lck_info { +u8 thermal[RF_PATH_MAX ]; +}; +struct rtw89_iqk_info {bool lok_cor_fail[RTW89_IQK_CHS_NR ][RTW89_IQK_PATH_NR ];bool lok_fin_fail[RTW89_IQK_CHS_NR ][RTW89_IQK_PATH_NR ];
@@ -3114,6 +3118,7 @@ struct rtw89_dev {struct rtw89_iqk_info iqk;struct rtw89_dpk_info dpk;struct rtw89_mcc_info mcc; +struct rtw89_lck_info lck;bool is_tssi_mode[RF_PATH_MAX ];bool is_bt_iqk_timeout;
drivers/net/wireless/realtek/rtw89/reg.h +2 -0
@@ -3327,6 +3327,8 @@#define RR_MIXER_GN GENMASK(4, 3)#define RR_XTALX2 0xb8#define RR_MALSEL 0xbe +#define RR_LCK_TRG 0xd3 +#define RR_LCK_TRGSEL BIT(8)#define RR_RCKD 0xde#define RR_RCKD_POW GENMASK(19, 13)#define RR_RCKD_BW BIT(2)
drivers/net/wireless/realtek/rtw89/rtw8852c.c +7 -0
@@ -1771,6 +1771,7 @@ static void rtw8852c_rfk_init(struct rtw89_dev *rtwdev)struct rtw89_mcc_info *mcc_info = &rtwdev->mcc;memset (mcc_info,0 ,sizeof (*mcc_info)); +rtw8852c_lck_init (rtwdev);rtw8852c_dack (rtwdev); }
@@ -1780,6 +1781,11 @@ static void rtw8852c_rfk_channel(struct rtw89_dev *rtwdev)rtw89_fw_h2c_rf_ntfy_mcc (rtwdev); } +static void rtw8852c_rfk_track (struct rtw89_dev *rtwdev) +{ +rtw8852c_lck_track (rtwdev); +} +static u32 rtw8852c_bb_cal_txpwr_ref (struct rtw89_dev *rtwdev,enum rtw89_phy_idx phy_idx,s16 ref) {
@@ -2708,6 +2714,7 @@ static const struct rtw89_chip_ops rtw8852c_chip_ops = { .read_phycap = rtw8852c_read_phycap, .rfk_init = rtw8852c_rfk_init, .rfk_channel = rtw8852c_rfk_channel, + .rfk_track = rtw8852c_rfk_track, .power_trim = rtw8852c_power_trim, .set_txpwr = rtw8852c_set_txpwr, .set_txpwr_ctrl = rtw8852c_set_txpwr_ctrl,
drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c +63 -0
69 lines not on this page · raw message
drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.h +2 -0
@@ -11,5 +11,7 @@ void rtw8852c_dack(struct rtw89_dev *rtwdev);void rtw8852c_set_channel_rf (struct rtw89_dev *rtwdev,struct rtw89_channel_params *param,enum rtw89_phy_idx phy_idx); +void rtw8852c_lck_init (struct rtw89_dev *rtwdev); +void rtw8852c_lck_track (struct rtw89_dev *rtwdev);#endif
Signature · 1 line
2.25.1
Ping-Ke Shih
maintainerPATCH v3 4/8 rtw89: 8852c: rfk: add TSSI
In reply to Ping-Ke ShihTSSI is transmitter signal strength indication, which is a close-loop hardware circuit to feedback actual transmitting power as a reference for next transmission.
When we setup channel to connect an AP, it does full calibration. When switching bands or channels, it needs to reset hardware status to prevent use wrong feedback of previous transmission.
To do TX power compensation reflecting current temperature, it loads tables of compensation values into registers according to channel and band group.
--- drivers/net/wireless/realtek/rtw89/rtw8852c.c | 19 + .../net/wireless/realtek/rtw89/rtw8852c_rfk.c | 1033 +++++++++++++++++ .../net/wireless/realtek/rtw89/rtw8852c_rfk.h | 5 + 3 files changed, 1057 insertions(+)
drivers/net/wireless/realtek/rtw89/rtw8852c.c +19 -0
@@ -1754,6 +1754,7 @@ static void rtw8852c_set_channel_help(struct rtw89_dev *rtwdev, bool enter,rtw89_chip_stop_sch_tx (rtwdev,RTW89_MAC_0 , &p->tx_en,RTW89_SCH_TX_SEL_ALL );rtw89_mac_cfg_ppdu_status (rtwdev,RTW89_MAC_0 , false);rtw8852c_dfs_en (rtwdev, false); +rtw8852c_tssi_cont_en_phyidx (rtwdev, false,RTW89_PHY_0 );rtw8852c_adc_en (rtwdev, false);fsleep (40 );rtw8852c_bb_reset_en (rtwdev, phy_idx, false);
@@ -1761,6 +1762,7 @@ static void rtw8852c_set_channel_help(struct rtw89_dev *rtwdev, bool enter,rtw89_mac_cfg_ppdu_status (rtwdev,RTW89_MAC_0 , true);rtw8852c_adc_en (rtwdev, true);rtw8852c_dfs_en (rtwdev, true); +rtw8852c_tssi_cont_en_phyidx (rtwdev, true,RTW89_PHY_0 );rtw8852c_bb_reset_en (rtwdev, phy_idx, true);rtw89_chip_resume_sch_tx (rtwdev,RTW89_MAC_0 , p->tx_en); }
@@ -1770,6 +1772,8 @@ static void rtw8852c_rfk_init(struct rtw89_dev *rtwdev) {struct rtw89_mcc_info *mcc_info = &rtwdev->mcc; + rtwdev->is_tssi_mode[RF_PATH_A ] = false; + rtwdev->is_tssi_mode[RF_PATH_B ] = false;memset (mcc_info,0 ,sizeof (*mcc_info));rtw8852c_lck_init (rtwdev);
@@ -1778,9 +1782,22 @@ static void rtw8852c_rfk_init(struct rtw89_dev *rtwdev)static void rtw8852c_rfk_channel (struct rtw89_dev *rtwdev) { +enum rtw89_phy_idx phy_idx =RTW89_PHY_0 ; + +rtw8852c_tssi (rtwdev, phy_idx);rtw89_fw_h2c_rf_ntfy_mcc (rtwdev); } +static void rtw8852c_rfk_band_changed (struct rtw89_dev *rtwdev) +{ +rtw8852c_tssi_scan (rtwdev,RTW89_PHY_0 ); +} + +static void rtw8852c_rfk_scan (struct rtw89_dev *rtwdev,bool start) +{ +rtw8852c_wifi_scan_notify (rtwdev, start,RTW89_PHY_0 ); +} +static void rtw8852c_rfk_track (struct rtw89_dev *rtwdev) {rtw8852c_lck_track (rtwdev);
@@ -2714,6 +2731,8 @@ static const struct rtw89_chip_ops rtw8852c_chip_ops = { .read_phycap = rtw8852c_read_phycap, .rfk_init = rtw8852c_rfk_init, .rfk_channel = rtw8852c_rfk_channel, + .rfk_band_changed = rtw8852c_rfk_band_changed, + .rfk_scan = rtw8852c_rfk_scan, .rfk_track = rtw8852c_rfk_track, .power_trim = rtw8852c_power_trim, .set_txpwr = rtw8852c_set_txpwr,
drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c +1033 -0
1,048 lines not on this page · raw message
drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.h +5 -0
@@ -8,6 +8,11 @@#include "core.h" void rtw8852c_dack (struct rtw89_dev *rtwdev); +void rtw8852c_tssi (struct rtw89_dev *rtwdev,enum rtw89_phy_idx phy); +void rtw8852c_tssi_scan (struct rtw89_dev *rtwdev,enum rtw89_phy_idx phy); +void rtw8852c_tssi_cont_en_phyidx (struct rtw89_dev *rtwdev,bool en,u8 phy_idx); +void rtw8852c_wifi_scan_notify (struct rtw89_dev *rtwdev,bool scan_start, +enum rtw89_phy_idx phy_idx);void rtw8852c_set_channel_rf (struct rtw89_dev *rtwdev,struct rtw89_channel_params *param,enum rtw89_phy_idx phy_idx);
Signature · 1 line
2.25.1
Ping-Ke Shih
maintainerPATCH v3 5/8 rtw89: 8852c: rfk: add RCK
In reply to Ping-Ke ShihRCK is synchronize RC calibration. It needs to be triggered only once when interface is going to up.
--- drivers/net/wireless/realtek/rtw89/rtw8852c.c | 1 + .../net/wireless/realtek/rtw89/rtw8852c_rfk.c | 43 +++++++++++++++++++ .../net/wireless/realtek/rtw89/rtw8852c_rfk.h | 1 + 3 files changed, 45 insertions(+)
drivers/net/wireless/realtek/rtw89/rtw8852c.c +1 -0
@@ -1777,6 +1777,7 @@ static void rtw8852c_rfk_init(struct rtw89_dev *rtwdev)memset (mcc_info,0 ,sizeof (*mcc_info));rtw8852c_lck_init (rtwdev); +rtw8852c_rck (rtwdev);rtw8852c_dack (rtwdev); }
drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c +43 -0
55 lines not on this page · raw message
drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.h +1 -0
@@ -7,6 +7,7 @@#include "core.h" +void rtw8852c_rck (struct rtw89_dev *rtwdev);void rtw8852c_dack (struct rtw89_dev *rtwdev);void rtw8852c_tssi (struct rtw89_dev *rtwdev,enum rtw89_phy_idx phy);void rtw8852c_tssi_scan (struct rtw89_dev *rtwdev,enum rtw89_phy_idx phy);
Signature · 1 line
2.25.1
Ping-Ke Shih
maintainerPATCH v3 6/8 rtw89: 8852c: rfk: add RX DCK
In reply to Ping-Ke ShihRX DCK is receiver DC calibration. Do this calibration when bringing up interface and going to run on AP channel.
--- drivers/net/wireless/realtek/rtw89/reg.h | 9 ++- drivers/net/wireless/realtek/rtw89/rtw8852c.c | 2 + .../net/wireless/realtek/rtw89/rtw8852c_rfk.c | 67 +++++++++++++++++++ .../net/wireless/realtek/rtw89/rtw8852c_rfk.h | 1 + 4 files changed, 78 insertions(+), 1 deletion(-)
drivers/net/wireless/realtek/rtw89/reg.h +8 -1
@@ -3312,17 +3312,24 @@#define RR_RXIQGEN_ATTL GENMASK(12, 8)#define RR_RXIQGEN_ATTH GENMASK(14, 13)#define RR_RXBB2 0x8f -#define RR_EN_TIA_IDA GENMASK(11, 10)#define RR_RXBB2_DAC_EN BIT(13) +#define RR_RXBB2_CKT BIT(12) +#define RR_EN_TIA_IDA GENMASK(11, 10) +#define RR_RXBB2_IDAC GENMASK(11, 9) +#define RR_RXBB2_EBW GENMASK(6, 5)#define RR_XALNA2 0x90#define RR_XALNA2_SW GENMASK(1, 0)#define RR_DCK 0x92 +#define RR_DCK_DONE GENMASK(7, 5)#define RR_DCK_FINE BIT(1)#define RR_DCK_LV BIT(0)#define RR_DCK1 0x93 +#define RR_DCK1_CLR GENMASK(3, 0)#define RR_DCK1_SEL BIT(3)#define RR_DCK2 0x94#define RR_DCK2_CYCLE GENMASK(7, 2) +#define RR_DCKC 0x95 +#define RR_DCKC_CHK BIT(3)#define RR_MIXER 0x9f#define RR_MIXER_GN GENMASK(4, 3)#define RR_XTALX2 0xb8
drivers/net/wireless/realtek/rtw89/rtw8852c.c +2 -0
@@ -1779,12 +1779,14 @@ static void rtw8852c_rfk_init(struct rtw89_dev *rtwdev)rtw8852c_rck (rtwdev);rtw8852c_dack (rtwdev); +rtw8852c_rx_dck (rtwdev,RTW89_PHY_0 , false); }static void rtw8852c_rfk_channel (struct rtw89_dev *rtwdev) {enum rtw89_phy_idx phy_idx =RTW89_PHY_0 ; +rtw8852c_rx_dck (rtwdev, phy_idx, false);rtw8852c_tssi (rtwdev, phy_idx);rtw89_fw_h2c_rf_ntfy_mcc (rtwdev); }
drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c +67 -0
79 lines not on this page · raw message
drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.h +1 -0
@@ -9,6 +9,7 @@void rtw8852c_rck (struct rtw89_dev *rtwdev);void rtw8852c_dack (struct rtw89_dev *rtwdev); +void rtw8852c_rx_dck (struct rtw89_dev *rtwdev,enum rtw89_phy_idx phy_idx,bool is_afe);void rtw8852c_tssi (struct rtw89_dev *rtwdev,enum rtw89_phy_idx phy);void rtw8852c_tssi_scan (struct rtw89_dev *rtwdev,enum rtw89_phy_idx phy);void rtw8852c_tssi_cont_en_phyidx (struct rtw89_dev *rtwdev,bool en,u8 phy_idx);
Signature · 1 line
2.25.1
Ping-Ke Shih
maintainerPATCH v3 7/8 rtw89: 8852c: rfk: add IQK
In reply to Ping-Ke ShihIQ signal calibration is a very important calibration to yield good RF performance. We do this calibration only if we are going to run on AP channel. During scanning phase, without this calibration RF performance is still acceptable because it transmits with low data rate at this phase.
--- drivers/net/wireless/realtek/rtw89/core.h | 3 + drivers/net/wireless/realtek/rtw89/reg.h | 55 +- drivers/net/wireless/realtek/rtw89/rtw8852c.c | 1 + .../net/wireless/realtek/rtw89/rtw8852c_rfk.c | 1043 +++++++++++++++++ .../net/wireless/realtek/rtw89/rtw8852c_rfk.h | 1 + 5 files changed, 1099 insertions(+), 4 deletions(-)
drivers/net/wireless/realtek/rtw89/core.h +3 -0
@@ -2649,6 +2649,7 @@ struct rtw89_lck_info {struct rtw89_iqk_info {bool lok_cor_fail[RTW89_IQK_CHS_NR ][RTW89_IQK_PATH_NR ];bool lok_fin_fail[RTW89_IQK_CHS_NR ][RTW89_IQK_PATH_NR ]; +bool lok_fail[RTW89_IQK_PATH_NR ];bool iqk_tx_fail[RTW89_IQK_CHS_NR ][RTW89_IQK_PATH_NR ];bool iqk_rx_fail[RTW89_IQK_CHS_NR ][RTW89_IQK_PATH_NR ];u32 iqk_fail_cnt;
@@ -2677,6 +2678,8 @@ struct rtw89_iqk_info {u32 syn1to2;u8 iqk_mcc_ch[RTW89_IQK_CHS_NR ][RTW89_IQK_PATH_NR ];u8 iqk_table_idx[RTW89_IQK_PATH_NR ]; +u32 lok_idac[RTW89_IQK_CHS_NR ][RTW89_IQK_PATH_NR ]; +u32 lok_vbuf[RTW89_IQK_CHS_NR ][RTW89_IQK_PATH_NR ]; };#define RTW89_DPK_RF_PATH 2
drivers/net/wireless/realtek/rtw89/reg.h +51 -4
151 lines not on this page · raw message
drivers/net/wireless/realtek/rtw89/rtw8852c.c +1 -0
@@ -1787,6 +1787,7 @@ static void rtw8852c_rfk_channel(struct rtw89_dev *rtwdev)enum rtw89_phy_idx phy_idx =RTW89_PHY_0 ;rtw8852c_rx_dck (rtwdev, phy_idx, false); +rtw8852c_iqk (rtwdev, phy_idx);rtw8852c_tssi (rtwdev, phy_idx);rtw89_fw_h2c_rf_ntfy_mcc (rtwdev); }
drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c +1043 -0
1,073 lines not on this page · raw message
drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.h +1 -0
@@ -9,6 +9,7 @@void rtw8852c_rck (struct rtw89_dev *rtwdev);void rtw8852c_dack (struct rtw89_dev *rtwdev); +void rtw8852c_iqk (struct rtw89_dev *rtwdev,enum rtw89_phy_idx phy_idx);void rtw8852c_rx_dck (struct rtw89_dev *rtwdev,enum rtw89_phy_idx phy_idx,bool is_afe);void rtw8852c_tssi (struct rtw89_dev *rtwdev,enum rtw89_phy_idx phy);void rtw8852c_tssi_scan (struct rtw89_dev *rtwdev,enum rtw89_phy_idx phy);
Signature · 1 line
2.25.1
Ping-Ke Shih
maintainerPATCH v3 8/8 rtw89: 8852c: rfk: add DPK
In reply to Ping-Ke ShihDPK is short for digital pre-distortion calibration. It can adjusts digital waveform according to PA linear characteristics dynamically to enhance TX EVM.
Do this calibration when we are going to run on AP channel. To prevent power offset out of boundary, it monitors thermal and set proper boundary to register.
8852c needs two backup buffers, so we enlarge the array. But, 8852a still needs only one, so it only uses first element (index zero).
--- drivers/net/wireless/realtek/rtw89/core.h | 11 +- drivers/net/wireless/realtek/rtw89/reg.h | 49 + .../net/wireless/realtek/rtw89/rtw8852a_rfk.c | 8 +- drivers/net/wireless/realtek/rtw89/rtw8852c.c | 2 + .../net/wireless/realtek/rtw89/rtw8852c_rfk.c | 1114 +++++++++++++++++ .../net/wireless/realtek/rtw89/rtw8852c_rfk.h | 2 + 6 files changed, 1178 insertions(+), 8 deletions(-)
drivers/net/wireless/realtek/rtw89/core.h +7 -4
@@ -2690,6 +2690,7 @@ struct rtw89_dpk_bkup_para {enum rtw89_bandwidth bw;u8 ch;bool path_ok; +u8 mdpd_en;u8 txagc_dpk;u8 ther_dpk;u8 gs;
@@ -2699,11 +2700,12 @@ struct rtw89_dpk_bkup_para {struct rtw89_dpk_info {bool is_dpk_enable;bool is_dpk_reload_en; -u16 dc_i[RTW89_DPK_RF_PATH ]; -u16 dc_q[RTW89_DPK_RF_PATH ]; -u8 corr_val[RTW89_DPK_RF_PATH ]; -u8 corr_idx[RTW89_DPK_RF_PATH ]; +u16 dc_i[RTW89_DPK_RF_PATH ][RTW89_DPK_BKUP_NUM ]; +u16 dc_q[RTW89_DPK_RF_PATH ][RTW89_DPK_BKUP_NUM ]; +u8 corr_val[RTW89_DPK_RF_PATH ][RTW89_DPK_BKUP_NUM ]; +u8 corr_idx[RTW89_DPK_RF_PATH ][RTW89_DPK_BKUP_NUM ];u8 cur_idx[RTW89_DPK_RF_PATH ]; +u8 cur_k_set;struct rtw89_dpk_bkup_para bp[RTW89_DPK_RF_PATH ][RTW89_DPK_BKUP_NUM ]; };
@@ -2712,6 +2714,7 @@ struct rtw89_fem_info {bool elna_5g;bool epa_2g;bool epa_5g; +bool epa_6g; };struct rtw89_phy_ch_info {
drivers/net/wireless/realtek/rtw89/reg.h +49 -0
143 lines not on this page · raw message
drivers/net/wireless/realtek/rtw89/rtw8852a_rfk.c +4 -4
@@ -2189,8 +2189,8 @@ static bool _dpk_sync_check(struct rtw89_dev *rtwdev,"[DPK] S%d Corr_idx / Corr_val = %d / %d\n" , path, corr_idx, corr_val); - dpk->corr_idx[path] = corr_idx; - dpk->corr_val[path] = corr_val; + dpk->corr_idx[path][0 ] = corr_idx; + dpk->corr_val[path][0 ] = corr_val;rtw89_phy_write32_mask (rtwdev,R_KIP_RPT1 ,B_KIP_RPT1_SEL ,0x9 );
@@ -2203,8 +2203,8 @@ static bool _dpk_sync_check(struct rtw89_dev *rtwdev,rtw89_debug (rtwdev,RTW89_DBG_RFK ,"[DPK] S%d DC I/Q, = %d / %d\n" , path, dc_i, dc_q); - dpk->dc_i[path] = dc_i; - dpk->dc_q[path] = dc_q; + dpk->dc_i[path][0 ] = dc_i; + dpk->dc_q[path][0 ] = dc_q;if (dc_i >DPK_SYNC_TH_DC_I || dc_q >DPK_SYNC_TH_DC_Q || corr_val <DPK_SYNC_TH_CORR )
drivers/net/wireless/realtek/rtw89/rtw8852c.c +2 -0
@@ -1789,6 +1789,7 @@ static void rtw8852c_rfk_channel(struct rtw89_dev *rtwdev)rtw8852c_rx_dck (rtwdev, phy_idx, false);rtw8852c_iqk (rtwdev, phy_idx);rtw8852c_tssi (rtwdev, phy_idx); +rtw8852c_dpk (rtwdev, phy_idx);rtw89_fw_h2c_rf_ntfy_mcc (rtwdev); }
@@ -1804,6 +1805,7 @@ static void rtw8852c_rfk_scan(struct rtw89_dev *rtwdev, bool start)static void rtw8852c_rfk_track (struct rtw89_dev *rtwdev) { +rtw8852c_dpk_track (rtwdev);rtw8852c_lck_track (rtwdev); }
drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c +1114 -0
1,132 lines not on this page · raw message
drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.h +2 -0
@@ -11,6 +11,8 @@ void rtw8852c_rck(struct rtw89_dev *rtwdev);void rtw8852c_dack (struct rtw89_dev *rtwdev);void rtw8852c_iqk (struct rtw89_dev *rtwdev,enum rtw89_phy_idx phy_idx);void rtw8852c_rx_dck (struct rtw89_dev *rtwdev,enum rtw89_phy_idx phy_idx,bool is_afe); +void rtw8852c_dpk (struct rtw89_dev *rtwdev,enum rtw89_phy_idx phy); +void rtw8852c_dpk_track (struct rtw89_dev *rtwdev);void rtw8852c_tssi (struct rtw89_dev *rtwdev,enum rtw89_phy_idx phy);void rtw8852c_tssi_scan (struct rtw89_dev *rtwdev,enum rtw89_phy_idx phy);void rtw8852c_tssi_cont_en_phyidx (struct rtw89_dev *rtwdev,bool en,u8 phy_idx);
Signature · 1 line
2.25.1