wifi: rtw89: phy: calling BB pre-init by chips with/without BB MCU

The existing flow is doing BB pre-init before downloading BB MCU firmware,
because existing chip RTL8922A has BB MCU. However, the coming chips don't
have this, and BB pre-init configuring registers can affect downloading
WiFi-CPU firmware. Therefore, calling BB pre-init afterward for new coming
chips without BB MCU.

For existing WiFi 6 chips, no BB pre-init. For RTL8922A, don't change
the logic.

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20251114060128.35363-5-pkshih@realtek.com
This commit is contained in:
Ping-Ke Shih
2025-11-14 14:01:18 +08:00
parent a2a64fe234
commit 12e84effcb
3 changed files with 18 additions and 6 deletions

View File

@@ -5615,6 +5615,7 @@ EXPORT_SYMBOL(rtw89_check_quirks);
int rtw89_core_start(struct rtw89_dev *rtwdev)
{
bool no_bbmcu = !rtwdev->chip->bbmcu_nr;
int ret;
ret = rtw89_mac_preinit(rtwdev);
@@ -5623,6 +5624,9 @@ int rtw89_core_start(struct rtw89_dev *rtwdev)
return ret;
}
if (no_bbmcu)
rtw89_chip_bb_preinit(rtwdev);
rtw89_phy_init_bb_afe(rtwdev);
/* above do preinit before downloading firmware */

View File

@@ -7039,12 +7039,17 @@ static inline void rtw89_chip_rfk_hw_init(struct rtw89_dev *rtwdev)
}
static inline
void rtw89_chip_bb_preinit(struct rtw89_dev *rtwdev, enum rtw89_phy_idx phy_idx)
void rtw89_chip_bb_preinit(struct rtw89_dev *rtwdev)
{
const struct rtw89_chip_info *chip = rtwdev->chip;
if (chip->ops->bb_preinit)
chip->ops->bb_preinit(rtwdev, phy_idx);
if (!chip->ops->bb_preinit)
return;
chip->ops->bb_preinit(rtwdev, RTW89_PHY_0);
if (rtwdev->dbcc_en)
chip->ops->bb_preinit(rtwdev, RTW89_PHY_1);
}
static inline

View File

@@ -4104,9 +4104,12 @@ int rtw89_mac_partial_init(struct rtw89_dev *rtwdev, bool include_bb)
rtw89_mac_ctrl_hci_dma_trx(rtwdev, true);
if (include_bb) {
rtw89_chip_bb_preinit(rtwdev, RTW89_PHY_0);
if (rtwdev->dbcc_en)
rtw89_chip_bb_preinit(rtwdev, RTW89_PHY_1);
/* Only call BB preinit including configuration of BB MCU for
* the chips which need to download BB MCU firmware. Otherwise,
* calling preinit later to prevent touching registers affecting
* download firmware.
*/
rtw89_chip_bb_preinit(rtwdev);
}
ret = rtw89_mac_dmac_pre_init(rtwdev);