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

Commit bb6c8dcc authored by Vladimir Kondratiev's avatar Vladimir Kondratiev Committed by Kalle Valo
Browse files

wil6210: fix boot loader "ready" indication



Boot loader "ready" indication has changed from "bit0 set"
to "only bit0 set". This is to address hardware glitches.
Due to glitches, sometimes right after reset register reads
0xffffffff, or (rarely) other garbage.

Reflect this in the driver

Signed-off-by: default avatarVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 48c963af
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -551,7 +551,7 @@ static inline void wil_release_cpu(struct wil6210_priv *wil)
static int wil_target_reset(struct wil6210_priv *wil)
static int wil_target_reset(struct wil6210_priv *wil)
{
{
	int delay = 0;
	int delay = 0;
	u32 x;
	u32 x, x1 = 0;


	wil_dbg_misc(wil, "Resetting \"%s\"...\n", wil->hw_name);
	wil_dbg_misc(wil, "Resetting \"%s\"...\n", wil->hw_name);


@@ -606,12 +606,16 @@ static int wil_target_reset(struct wil6210_priv *wil)
	do {
	do {
		msleep(RST_DELAY);
		msleep(RST_DELAY);
		x = R(RGF_USER_BL + offsetof(struct RGF_BL, ready));
		x = R(RGF_USER_BL + offsetof(struct RGF_BL, ready));
		if (x1 != x) {
			wil_dbg_misc(wil, "BL.ready 0x%08x => 0x%08x\n", x1, x);
			x1 = x;
		}
		if (delay++ > RST_COUNT) {
		if (delay++ > RST_COUNT) {
			wil_err(wil, "Reset not completed, bl.ready 0x%08x\n",
			wil_err(wil, "Reset not completed, bl.ready 0x%08x\n",
				x);
				x);
			return -ETIME;
			return -ETIME;
		}
		}
	} while (!(x & BIT_BL_READY));
	} while (x != BIT_BL_READY);


	C(RGF_USER_CLKS_CTL_0, BIT_USER_CLKS_RST_PWGD);
	C(RGF_USER_CLKS_CTL_0, BIT_USER_CLKS_RST_PWGD);