mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-09-28 17:21:36 +02:00
driver: mtd: sf_ops: claim bus while doing memcpy
claim spi bus while doing memory copy, this will set up the spi controller device control register before doing a memory read. Signed-off-by: Sourav Poddar <sourav.poddar@ti.com> Tested-by: Yebio Mesfin <ymesfin@ti.com> Reviewed-by: Jagannadha Sutradharudu Teki <jaganna@xilinx.com>
This commit is contained in:
parent
2c57b03bab
commit
ac5cce38de
@ -273,9 +273,15 @@ int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 offset,
|
|||||||
|
|
||||||
/* Handle memory-mapped SPI */
|
/* Handle memory-mapped SPI */
|
||||||
if (flash->memory_map) {
|
if (flash->memory_map) {
|
||||||
|
ret = spi_claim_bus(flash->spi);
|
||||||
|
if (ret) {
|
||||||
|
debug("SF: unable to claim SPI bus\n");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
spi_xfer(flash->spi, 0, NULL, NULL, SPI_XFER_MMAP);
|
spi_xfer(flash->spi, 0, NULL, NULL, SPI_XFER_MMAP);
|
||||||
memcpy(data, flash->memory_map + offset, len);
|
memcpy(data, flash->memory_map + offset, len);
|
||||||
spi_xfer(flash->spi, 0, NULL, NULL, SPI_XFER_MMAP_END);
|
spi_xfer(flash->spi, 0, NULL, NULL, SPI_XFER_MMAP_END);
|
||||||
|
spi_release_bus(flash->spi);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user