Commit d0c820cc authored by Ping-Ke Shih's avatar Ping-Ke Shih Committed by Kalle Valo

wifi: rtw89: 8852b: set proper configuration before loading NCTL

Before loading RF NCTL table, we need to configure IQK/DPK clock and reset
them, and then polling NCTL state ready. Since 8852BE needs additional
one setting, add it by this patch. Also, give them proper names.
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20221005083212.45683-4-pkshih@realtek.com
parent 0935bb15
...@@ -1368,13 +1368,15 @@ static void rtw89_phy_init_rf_nctl(struct rtw89_dev *rtwdev) ...@@ -1368,13 +1368,15 @@ static void rtw89_phy_init_rf_nctl(struct rtw89_dev *rtwdev)
int ret; int ret;
/* IQK/DPK clock & reset */ /* IQK/DPK clock & reset */
rtw89_phy_write32_set(rtwdev, 0x0c60, 0x3); rtw89_phy_write32_set(rtwdev, R_IOQ_IQK_DPK, 0x3);
rtw89_phy_write32_set(rtwdev, 0x0c6c, 0x1); rtw89_phy_write32_set(rtwdev, R_GNT_BT_WGT_EN, 0x1);
rtw89_phy_write32_set(rtwdev, 0x58ac, 0x8000000); rtw89_phy_write32_set(rtwdev, R_P0_PATH_RST, 0x8000000);
rtw89_phy_write32_set(rtwdev, 0x78ac, 0x8000000); rtw89_phy_write32_set(rtwdev, R_P1_PATH_RST, 0x8000000);
if (chip->chip_id == RTL8852B)
rtw89_phy_write32_set(rtwdev, R_IOQ_IQK_DPK, 0x2);
/* check 0x8080 */ /* check 0x8080 */
rtw89_phy_write32(rtwdev, 0x8000, 0x8); rtw89_phy_write32(rtwdev, R_NCTL_CFG, 0x8);
ret = read_poll_timeout(rtw89_phy_nctl_poll, val, val == 0x4, 10, ret = read_poll_timeout(rtw89_phy_nctl_poll, val, val == 0x4, 10,
1000, false, rtwdev); 1000, false, rtwdev);
......
...@@ -4039,6 +4039,7 @@ ...@@ -4039,6 +4039,7 @@
#define B_P0_RFM_TX_OPT BIT(6) #define B_P0_RFM_TX_OPT BIT(6)
#define B_P0_RFM_BT_EN BIT(5) #define B_P0_RFM_BT_EN BIT(5)
#define B_P0_RFM_OUT GENMASK(4, 0) #define B_P0_RFM_OUT GENMASK(4, 0)
#define R_P0_PATH_RST 0x58AC
#define R_P0_TXDPD 0x58D4 #define R_P0_TXDPD 0x58D4
#define B_P0_TXDPD GENMASK(31, 28) #define B_P0_TXDPD GENMASK(31, 28)
#define R_P0_TXPW_RSTB 0x58DC #define R_P0_TXPW_RSTB 0x58DC
...@@ -4083,6 +4084,7 @@ ...@@ -4083,6 +4084,7 @@
#define R_P1_RFCTM 0x7864 #define R_P1_RFCTM 0x7864
#define R_P1_RFCTM_RDY BIT(26) #define R_P1_RFCTM_RDY BIT(26)
#define B_P1_RFCTM_VAL GENMASK(25, 20) #define B_P1_RFCTM_VAL GENMASK(25, 20)
#define R_P1_PATH_RST 0x78AC
#define R_P1_TXPW_RSTB 0x78DC #define R_P1_TXPW_RSTB 0x78DC
#define B_P1_TXPW_RSTB_MANON BIT(30) #define B_P1_TXPW_RSTB_MANON BIT(30)
#define B_P1_TXPW_RSTB_TSSI BIT(31) #define B_P1_TXPW_RSTB_TSSI BIT(31)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment