diff mbox

[U-Boot,v2,1/7] mtd/st_smi: Clear error flags while initiating a fresh write

Message ID acb46f6c779dc8f6c8b1bb2f21a100a1f561e0f0.1354783388.git.vipin.kumar@st.com
State Deferred
Delegated to: Heiko Schocher
Headers show

Commit Message

Vipin Kumar Dec. 6, 2012, 8:47 a.m. UTC
SMI controller reports an error when the code tries to write on the flash area
with Write Enable command not issued or the bank has come out of the write mode.

This error is reported even with a fresh write once the ERF1 or ERF2 is set.
Clear these flags while initiating a fresh write

Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
---
 drivers/mtd/st_smi.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Stefan Roese Dec. 6, 2012, 11:39 a.m. UTC | #1
On 12/06/2012 09:47 AM, Vipin Kumar wrote:
> SMI controller reports an error when the code tries to write on the flash area
> with Write Enable command not issued or the bank has come out of the write mode.
> 
> This error is reported even with a fresh write once the ERF1 or ERF2 is set.
> Clear these flags while initiating a fresh write
> 
> Signed-off-by: Vipin Kumar <vipin.kumar@st.com>

Acked-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan
diff mbox

Patch

diff --git a/drivers/mtd/st_smi.c b/drivers/mtd/st_smi.c
index 7507e5d..63b10fc 100644
--- a/drivers/mtd/st_smi.c
+++ b/drivers/mtd/st_smi.c
@@ -392,6 +392,8 @@  static int smi_write(unsigned int *src_addr, unsigned int *dst_addr,
 		return -1;
 	}
 
+	clrbits_le32(&smicntl->smi_sr, ERF1 | ERF2);
+
 	if (smi_wait_till_ready(banknum, CONFIG_SYS_FLASH_WRITE_TOUT))
 		return -EBUSY;