Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

wil6210: target reset flow update

Use 'real' indication for hardware state.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Vladimir Kondratiev and committed by
John W. Linville
d28bcc30 b5998e6a

+8 -6
+6 -5
drivers/net/wireless/ath/wil6210/main.c
··· 269 269 static void wil_target_reset(struct wil6210_priv *wil) 270 270 { 271 271 int delay = 0; 272 - u32 baud_rate; 272 + u32 hw_state; 273 273 u32 rev_id; 274 274 275 275 wil_dbg_misc(wil, "Resetting...\n"); ··· 312 312 } 313 313 W(RGF_USER_CLKS_CTL_SW_RST_VEC_0, 0); 314 314 315 - /* wait until device ready. Use baud rate */ 315 + /* wait until device ready */ 316 316 do { 317 317 msleep(1); 318 - baud_rate = R(RGF_USER_SERIAL_BAUD_RATE); 318 + hw_state = R(RGF_USER_HW_MACHINE_STATE); 319 319 if (delay++ > 100) { 320 - wil_err(wil, "Reset not completed\n"); 320 + wil_err(wil, "Reset not completed, hw_state 0x%08x\n", 321 + hw_state); 321 322 return; 322 323 } 323 - } while (baud_rate != 0x15e); 324 + } while (hw_state != HW_MACHINE_BOOT_DONE); 324 325 325 326 if (rev_id == 2) 326 327 W(RGF_PCIE_LOS_COUNTER_CTL, BIT(8));
+2 -1
drivers/net/wireless/ath/wil6210/wil6210.h
··· 74 74 } __packed; 75 75 76 76 /* registers - FW addresses */ 77 - #define RGF_USER_SERIAL_BAUD_RATE (0x880050) 77 + #define RGF_USER_HW_MACHINE_STATE (0x8801dc) 78 + #define HW_MACHINE_BOOT_DONE (0x3fffffd) 78 79 #define RGF_USER_USER_CPU_0 (0x8801e0) 79 80 #define RGF_USER_MAC_CPU_0 (0x8801fc) 80 81 #define RGF_USER_USER_SCRATCH_PAD (0x8802bc)