Home
last modified time | relevance | path

Searched hist:"0 b841403dfae54bb102f86a1dc88a2d9b79a158f" (Results 1 – 1 of 1) sorted by relevance

/rk3399_rockchip-uboot/drivers/mtd/spi/
H A Dspi-nor-core.c0b841403dfae54bb102f86a1dc88a2d9b79a158f Fri Apr 26 09:22:19 UTC 2019 Weijie Gao <weijie.gao@mediatek.com> UPSTREAM: mtd: spi-nor: fix page program issue when using spi-mem driver

Some SPI controllers can't write nor->page_size bytes in a single step
because their TX FIFO is too small, but when that happens we should
make sure a WRITE_EN command before each write access and READ_SR command
after each write access is issued.

We should allow nor->write() to return a size that is smaller than the
requested write size to gracefully handle this case.

Also, the spi_nor_write_data() should return the actual number of bytes
that were written during the spi_mem_exec_op() operation.

This patch is a combination of two commits backported from kernel:

commit 630d6bd8a3b4 ("mtd: spi-nor: Support controllers with limit ...")
commit 3baa8ec88c2f ("mtd: devices: m25p80: Make sure WRITE_EN is ...")

Cc: Vignesh R <vigneshr@ti.com>
Change-Id: I352142d4325b15c52eb04ac929b9e2bcd3648472
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
Acked-by: Vignesh R <vigneshr@ti.com>
Tested-by: Shyam Saini <shyam.saini@amarulasolutions.com> # microzed
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
(cherry picked from commit 60e2bf46784ebbd30ff29b3d3c7c97e56b11e86a)