]> git.ipfire.org Git - thirdparty/u-boot.git/commit
mtd: spi-nor: Fix write protection error with 1-byte length
authorT Karthik Reddy <t.karthik.reddy@xilinx.com>
Mon, 16 Aug 2021 06:42:28 +0000 (00:42 -0600)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 17 Aug 2021 05:10:07 +0000 (07:10 +0200)
commitea7e68d1439c04200d7877423656f4f7f3bc04b7
tree9ae945c92fd53a537ec55aab31e6234bab94c777
parent9f0dd876de1c23dcbc4c9b33d49ee4464a39a8cb
mtd: spi-nor: Fix write protection error with 1-byte length

Incase of write operation at offset 0 and with data length 1, we are
observing write protection error.

sf write 0x400000 0 1
device 0 offset 0x0, size 0x1
offset 0x0 is protected and cannot be written
SF: 1 bytes @ 0x0 Written: ERROR -22

This is happening due to return of incorrect status of locked sectors
due to shifting of length in dual parallel connection.
Resolve this issue by avoiding data shift when data length is 1.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Acked-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
drivers/mtd/spi/spi-nor-core.c