Hi Edward,
1. IP read is not practical for data reads, only to be used when reading status of flash write, chip ID etc. Of course HW works well, so perhaps Linux driver is broken.
From the very beginning the post was related to Linux kernel driver.
The link in the original message points me to the following comment:
/*
* The IC guy suggests we use the "AHB Command Read" which is faster * then the "IP Command Read". (What's more is * that there is a bug in * the "IP Command Read" in the Vybrid.)
*/
I was just curious what is the bug as NXP employee wrote this comment when he added the code. For my setup there is indeed an issue described in those patches:
[RFC/RFT,v1,2/9] mtd: qspi: Provide quirk to read only half of RX buffer (NXP's vybrid) - Patchwork
[RFC/RFT,v1,8/9] mtd: spi: Allocate memory corresponding to maximal fsl-quadspi.c controller area - ...
2. Question is little weird. In AHB mode you read kilobytes and megabytes. If you mean AHB buffer size specified in command LUT, 128 bytes (32 x 32bit words) in bare metal works perfectly well. So again, perhaps something in Linux driver is broken.
Do you run Linux on Vybrid or somethig smaller/lighter (like some RTOS) ?
- What is the recommended size for AHB memory transfer size for QSPI?
It depends on how fragmented are your reads, as well on cache hits and misses. For sequential read top size is the best. For fragmented: say you execute from QSPI (AHB of course), you read few instruction from one AHB buffer frame and need to jump to another buffer frame. Reading 128 bytes at once while you need only 20 bytes from specific AHB frame you waste time on unused bytes read. Cache won't remember unused lines, so next time jumping back to previous frame whole frame will be re-read from QSPI again. Reducing bytes to read could be faster, but reading smaller amounts you waste time on sending frame address to QSPI memory. Optimal value may be lower than 128.
What is the transfer size for your application? From the above I deduce that it is 128B ? And I don't care (for now) about the performance as I cannot read 256B (with dd on /dev/mtdX) without reading some consecutive 0xFFs (on the old fsl-quadspi.c driver).