Skip to content

Commit 7e29789

Browse files
author
Patrice Chotard
committed
spi: stm32-ospi: Increase read throughput in indirect mode
Schedule() is called every u8/u16 or u32 read accesses which is overkill. Move schedule() from stm32_ospi_read_fifo() to stm32_ospi_tx_poll() and call schedule() only every 1MB chunk of data. Test performed by reading 64MB on sNOR on stm32mp257f-ev1 board: before after ratio Read : 10.6MB/s 14.2MB/s +34% Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Change-Id: I5552e21bfd8d8a68a7148c9dbf96039a66e946db Reviewed-on: https://gerrit.st.com/c/mpu/oe/st/u-boot/+/518998 ACI: CITOOLS <MDG-smet-aci-reviews@list.st.com> Domain-Review: Christophe KERELLO <christophe.kerello@st.com> ACI: CIBUILD <MDG-smet-aci-builds@list.st.com>
1 parent 805e71d commit 7e29789

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

drivers/memory/stm32-omi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ static void stm32_omi_read_fifo(void *val, phys_addr_t addr, u8 len)
298298
case sizeof(u8):
299299
*((u8 *)val) = readb_relaxed(addr);
300300
};
301-
schedule();
302301
}
303302

304303
static void stm32_omi_write_fifo(void *val, phys_addr_t addr, u8 len)
@@ -358,6 +357,9 @@ int stm32_omi_tx_poll(struct udevice *dev, void *buf, u32 len, bool read)
358357
fifo(buf, regs_base + OSPI_DR, step);
359358
len -= step;
360359
buf += step;
360+
361+
if (!(len % SZ_1M))
362+
schedule();
361363
}
362364

363365
return 0;

0 commit comments

Comments
 (0)