In current implementation WBPR is being written without setting write
enable latch. So fix this issue by setting write enable latch before
accessing WBPR. Also wait till the Write In Progress(WIP) bit is set.
Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
if (ctl == SST26_CTL_CHECK)
return 0;
+ write_enable(nor);
+
ret = nor->write_reg(nor, SPINOR_OP_WRITE_BPR, bpr_buff, bpr_size);
if (ret < 0) {
dev_err(nor->dev, "fail to write block-protection register\n");
return ret;
}
- return 0;
+ return spi_nor_wait_till_ready(nor);
}
static int sst26_unlock(struct spi_nor *nor, loff_t ofs, uint64_t len)