]> rtime.felk.cvut.cz Git - vajnamar/linux-xlnx.git/commitdiff
mtd: qspi: Corrected the sequence for accessing flash part
authorTejas Prajapati Rameshchandra <tejas.prajapati.rameshchandra@xilinx.com>
Tue, 29 Aug 2017 05:58:58 +0000 (11:28 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 29 Aug 2017 06:24:14 +0000 (08:24 +0200)
For accessing flash part using the mtd devices for architectures which
only supports 3 byte addressing need to call write_ear() for accessing
memory above 16MB. After every call to write_ear(), write_enable()
has to be called for further process.

Signed-off-by: Tejas Prajapati Rameshchandra <tejaspra@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/mtd/spi-nor/spi-nor.c

index 9ba8ce9a563cc8382503efc396f219bdc12f09c6..1c5ffcd2f21a048f747d5416306478ec65e25229 100644 (file)
@@ -557,6 +557,9 @@ static int spi_nor_erase(struct mtd_info *mtd, struct erase_info *instr)
                        ret = spi_nor_wait_till_ready(nor);
                        if (ret)
                                goto erase_err;
+
+                       write_enable(nor);
+
                        ret = spi_nor_erase_sector(nor, offset);
                        if (ret)
                                goto erase_err;