summaryrefslogtreecommitdiff
path: root/drivers/bios_emulator
diff options
context:
space:
mode:
authorPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2019-02-03 16:17:31 +0100
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>2019-05-01 00:00:04 +0200
commit8aa6c921f739f818cc1137b45a4bdca865745f37 (patch)
tree5335a0b2f4f1dd732a8eeffee00ecac8ffb04be9 /drivers/bios_emulator
parent7e0e5c552f2afcb9b6eeb2836232dfc4bbe29865 (diff)
rockchip: spi: add optimised receive-only implementation
For the RK3399-Q7 we recommend storing SPL and u-boot.itb in the on-module 32MBit (and sometimes even larger, if requested as part of a configure-to-order configuration) SPI-NOR flash that is clocked for a bitrate of 49.5MBit/s and connected in a single-IO configuration (the RK3399 only supports single-IO for SPI). Unfortunately, the existing SPI driver is excruciatingly slow at reading out large chunks of data (in fact it is just as slow for small chunks of data, but the overheads of the driver-framework make it less noticeable): before this change, the throughput on a 4MB read from SPI-NOR is 8.47MBit/s which equates a 17.11% bus-utilisation. To improve on this, this commit adds an optimised receive-only transfer (i.e.: out == NULL) handler that hooks into the main transfer function and processes data in 16bit frames (utilising the full with of each FIFO element). As of now, the receive-only handler requires the in-buffer to be 16bit aligned. Any lingering data (i.e. either if the in-buffer was not 16-bit aligned or if an odd number of bytes are to be received) will be handled by the original 8bit reader/wirter. Given that the SPI controller's documentation does not guarantuee any interlocking between the RXFIFO and the master SCLK, the transfer loop will be restarted for each chunk of 32 frames (i.e. 64 bytes). With this new receive-only transfer handler, the throughput for a 4MB read increases to 36.28MBit/s (i.e. 73.29% bus-utilisation): this is a 4x improvement over the baseline. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reported-by: Klaus Goger <klaus.goger@theobroma-systems.com> Series-Cc: Klaus Goger <klaus.goger@theobroma-systems.com> Series-Cc: Christoph Muellner <christoph.muellner@theobroma-systems.com>
Diffstat (limited to 'drivers/bios_emulator')
0 files changed, 0 insertions, 0 deletions