]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
spi: cadence-quadspi: Reset CMD_CTRL Reg on cmd r/w completion
authorDhruva Gole <d-gole@ti.com>
Wed, 12 Apr 2023 10:58:56 +0000 (16:28 +0530)
committerJagan Teki <jagan@amarulasolutions.com>
Wed, 26 Apr 2023 08:07:39 +0000 (13:37 +0530)
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.

Co-developed-by: Apurva Nandan <a-nandan@ti.com>
Signed-off-by: Apurva Nandan <a-nandan@ti.com>
Signed-off-by: Dhruva Gole <d-gole@ti.com>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
drivers/spi/cadence_qspi_apb.c

index 4c055a05807ede16f6d49cb1e91acb5fa339dde7..9ce2c0f254f3410a3b6373543698d9f6c6c5b09d 100644 (file)
@@ -376,6 +376,9 @@ int cadence_qspi_apb_exec_flash_cmd(void *reg_base, unsigned int reg)
        if (!cadence_qspi_wait_idle(reg_base))
                return -EIO;
 
+       /* Flush the CMDCTRL reg after the execution */
+       writel(0, reg_base + CQSPI_REG_CMDCTRL);
+
        return 0;
 }