]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: rtw88: Fix download_firmware_validate() for RTL8814AU
authorBitterblue Smith <rtl8821cerfe2@gmail.com>
Tue, 4 Feb 2025 18:37:36 +0000 (20:37 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 4 Jun 2025 12:38:03 +0000 (14:38 +0200)
[ Upstream commit 9e8243025cc06abc975c876dffda052073207ab3 ]

After the firmware is uploaded, download_firmware_validate() checks some
bits in REG_MCUFW_CTRL to see if everything went okay. The
RTL8814AU power on sequence sets bits 13 and 12 to 2, which this
function does not expect, so it thinks the firmware upload failed.

Make download_firmware_validate() ignore bits 13 and 12.

Signed-off-by: Bitterblue Smith <rtl8821cerfe2@gmail.com>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/049d2887-22fc-47b7-9e59-62627cb525f8@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/realtek/rtw88/reg.h

index c0fb1e446245f42f05fd6e7b11e19c7767b8c81b..3e5bd64bc09c0d0c489d8fc34499ae281a6a54b1 100644 (file)
 #define BIT_SHIFT_ROM_PGE      16
 #define BIT_FW_INIT_RDY                BIT(15)
 #define BIT_FW_DW_RDY          BIT(14)
+#define BIT_CPU_CLK_SEL                (BIT(12) | BIT(13))
 #define BIT_RPWM_TOGGLE                BIT(7)
 #define BIT_RAM_DL_SEL         BIT(7)  /* legacy only */
 #define BIT_DMEM_CHKSUM_OK     BIT(6)
                                 BIT_CHECK_SUM_OK)
 #define FW_READY_LEGACY                (BIT_MCUFWDL_RDY | BIT_FWDL_CHK_RPT |          \
                                 BIT_WINTINI_RDY | BIT_RAM_DL_SEL)
-#define FW_READY_MASK          0xffff
+#define FW_READY_MASK          (0xffff & ~BIT_CPU_CLK_SEL)
 
 #define REG_MCU_TST_CFG                0x84
 #define VAL_FW_TRIGGER         0x1