Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 260e6951 authored by Vladimir Kondratiev's avatar Vladimir Kondratiev Committed by John W. Linville
Browse files

wil6210: add memory barriers for the reset flow



make sure reset flow executed in order

Signed-off-by: default avatarVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d28bcc30
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -289,19 +289,23 @@ static void wil_target_reset(struct wil6210_priv *wil)
	S(RGF_USER_CLKS_CTL_SW_RST_MASK_0, BIT(6));
	/* car_perst_rst_src_n_mask */
	S(RGF_USER_CLKS_CTL_SW_RST_MASK_0, BIT(7));
	wmb(); /* order is important here */

	W(RGF_USER_MAC_CPU_0,  BIT(1)); /* mac_cpu_man_rst */
	W(RGF_USER_USER_CPU_0, BIT(1)); /* user_cpu_man_rst */
	wmb(); /* order is important here */

	W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0xFE000000);
	W(RGF_USER_CLKS_CTL_SW_RST_VEC_1, 0x0000003F);
	W(RGF_USER_CLKS_CTL_SW_RST_VEC_3, 0x00000170);
	W(RGF_USER_CLKS_CTL_SW_RST_VEC_0, 0xFFE7FC00);
	wmb(); /* order is important here */

	W(RGF_USER_CLKS_CTL_SW_RST_VEC_3, 0);
	W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0);
	W(RGF_USER_CLKS_CTL_SW_RST_VEC_1, 0);
	W(RGF_USER_CLKS_CTL_SW_RST_VEC_0, 0);
	wmb(); /* order is important here */

	W(RGF_USER_CLKS_CTL_SW_RST_VEC_3, 0x00000001);
	if (rev_id == 1) {
@@ -311,6 +315,7 @@ static void wil_target_reset(struct wil6210_priv *wil)
		W(RGF_USER_CLKS_CTL_SW_RST_VEC_2, 0x00008000);
	}
	W(RGF_USER_CLKS_CTL_SW_RST_VEC_0, 0);
	wmb(); /* order is important here */

	/* wait until device ready */
	do {
@@ -327,6 +332,7 @@ static void wil_target_reset(struct wil6210_priv *wil)
		W(RGF_PCIE_LOS_COUNTER_CTL, BIT(8));

	C(RGF_USER_CLKS_CTL_0, BIT_USER_CLKS_RST_PWGD);
	wmb(); /* order is important here */

	wil_dbg_misc(wil, "Reset completed in %d ms\n", delay);