Unverified Commit d4f43a2d authored by Dhruva Gole's avatar Dhruva Gole Committed by Mark Brown
Browse files

spi: cadence-quadspi: Reset CMD_CTRL Reg on cmd r/w completion



If one leaves the CQSPI_REG_CMDCTRL in an unclean state this may cause
issues in future command reads. This issue came to light when some flash
reads in STIG mode were coming back dirty.

Signed-off-by: default avatarDhruva Gole <d-gole@ti.com>
Link: https://lore.kernel.org/r/20230125081023.1573712-2-d-gole@ti.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 937ca916
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -549,6 +549,9 @@ static int cqspi_command_read(struct cqspi_flash_pdata *f_pdata,
		memcpy(rxbuf, &reg, read_len);
	}

	/* Reset CMD_CTRL Reg once command read completes */
	writel(0, reg_base + CQSPI_REG_CMDCTRL);

	return 0;
}

@@ -613,7 +616,12 @@ static int cqspi_command_write(struct cqspi_flash_pdata *f_pdata,
		}
	}

	return cqspi_exec_flash_cmd(cqspi, reg);
	ret = cqspi_exec_flash_cmd(cqspi, reg);

	/* Reset CMD_CTRL Reg once command write completes */
	writel(0, reg_base + CQSPI_REG_CMDCTRL);

	return ret;
}

static int cqspi_read_setup(struct cqspi_flash_pdata *f_pdata,