The driver we are currently using seems to be playing very safe by restricting the size of a FLASH command to the size of a FIFO. Furthermore, the size of these FIFOs may have been inherited from an early Vybrid implementation: TX is configured to 64 bytes, which RX is configured to 128 bytes. If you consider the case of a Page Program command, on a large Flash requiring 4-bytes address, the largest possible PP command you could send at a time is:
[02][a3][a2][a1][a0][59 bytes of data]
where a3-a0 represents the address in big Endian. Considering that we are using a Spansion S25FL512S, we could technically program a full 512-bytes page at a time, but we are restricted to 59 bytes due to the driver implementation. However, we still need to stay within a page boundary in a PP command, so programming a full 512-bytes page would be cut into the following sequence: 59, 59, 59, 59, 59. 59, 59, 59, 59, 40. That does not seem very efficient.
I read chapter 28 (QuadSPI) of the LS1021A reference manual multiple times, especially section 28.6.3.6 about Flash Programming, and it would seem that we could indeed do better. The TX and RX buffers are not only FIFOs, but they are circular FIFOs. If I understand correctly the Flash Programming sequence in section 26.6.3.6, we could improve our driver by doing the following:
Before jumping to implement such a thing, I'd like to verify 2 things:
Thank you!
Your understanding is generally correct. The only remark I can add
is, that in the step 4 you can fill up to 32x4 byte Tx buffer entries.
QuadSPI Linux driver, if you want to use it as a reference, can be
found here:
http://git.freescale.com/git/cgit.cgi/ppc/sdk/linux.git/tree/drivers/mtd/spi-nor/fsl-quadspi.c
Additional information on the driver can be found in the SDK online
documentation:
Have a great day,
Platon
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------