Commit 9cb2ff11 authored by Apurva Nandan's avatar Apurva Nandan Committed by Mark Brown

spi: cadence-quadspi: Disable Auto-HW polling

cadence-quadspi has a builtin Auto-HW polling funtionality using which
it keep tracks of completion of write operations. When Auto-HW polling
is enabled, it automatically initiates status register read operation,
until the flash clears its busy bit.

cadence-quadspi controller doesn't allow an address phase when
auto-polling the busy bit on the status register. Unlike SPI NOR
flashes, SPI NAND flashes do require the address of status register
when polling the busy bit using the read register operation. As
Auto-HW polling is enabled by default, cadence-quadspi returns a
timeout for every write operation after an indefinite amount of
polling on SPI NAND flashes.

Disable Auto-HW polling completely as the spi-nor core, spinand core,
etc. take care of polling the busy bit on their own.
Signed-off-by: default avatarApurva Nandan <a-nandan@ti.com>
Link: https://lore.kernel.org/r/20210713125743.1540-2-a-nandan@ti.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0e85ee89
...@@ -800,19 +800,20 @@ static int cqspi_write_setup(struct cqspi_flash_pdata *f_pdata, ...@@ -800,19 +800,20 @@ static int cqspi_write_setup(struct cqspi_flash_pdata *f_pdata,
reg = cqspi_calc_rdreg(f_pdata); reg = cqspi_calc_rdreg(f_pdata);
writel(reg, reg_base + CQSPI_REG_RD_INSTR); writel(reg, reg_base + CQSPI_REG_RD_INSTR);
if (f_pdata->dtr) { /*
/* * SPI NAND flashes require the address of the status register to be
* Some flashes like the cypress Semper flash expect a 4-byte * passed in the Read SR command. Also, some SPI NOR flashes like the
* dummy address with the Read SR command in DTR mode, but this * cypress Semper flash expect a 4-byte dummy address in the Read SR
* controller does not support sending address with the Read SR * command in DTR mode.
* command. So, disable write completion polling on the *
* controller's side. spi-nor will take care of polling the * But this controller does not support address phase in the Read SR
* status register. * command when doing auto-HW polling. So, disable write completion
*/ * polling on the controller's side. spinand and spi-nor will take
reg = readl(reg_base + CQSPI_REG_WR_COMPLETION_CTRL); * care of polling the status register.
reg |= CQSPI_REG_WR_DISABLE_AUTO_POLL; */
writel(reg, reg_base + CQSPI_REG_WR_COMPLETION_CTRL); reg = readl(reg_base + CQSPI_REG_WR_COMPLETION_CTRL);
} reg |= CQSPI_REG_WR_DISABLE_AUTO_POLL;
writel(reg, reg_base + CQSPI_REG_WR_COMPLETION_CTRL);
reg = readl(reg_base + CQSPI_REG_SIZE); reg = readl(reg_base + CQSPI_REG_SIZE);
reg &= ~CQSPI_REG_SIZE_ADDRESS_MASK; reg &= ~CQSPI_REG_SIZE_ADDRESS_MASK;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment