This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BIOS PSP C6748 SATA Driver Performance

BIOS PSP Version

01.30.00.05

I have a small application which uses the BIOS PSP SATA driver to measure I/O performance using a Western Digital 1 TB HDD, which can achieve approximately 124 MB/s of sustained performance between the drive and a host, according to the specification.  In using the SATA driver within my application to perform reads of 128 KB per read, I am only seeing around 12 MB/s of read performance.  I am using _itoll (TSCH, TSCL) calls around my read loop to measure the number of cycles to complete a read of 100 MB total.  It's measuring 3,684,961,345 cycles to complete the 100 MB read with a 456 MHz clock rate (comes out to about 8 seconds, and around 12 MB/s throughput).

I have my read buffer mapped to internal SRAM (L2), and L2 is configured such that 32 KB is surrendered as cache space (the remaining 224 KB of the 256 KB SRAM area is being claimed by my application).  My external memory region where my code is run from is being made cacheable through the appropriate MAR register, although I'm not sure that caching of my code is doing much good since the driver has several layers to it (ATA/ATAPI driver, AHCI driver, block media driver), and jumps all over the place through several function calls to perform a read.

Is this kind of performance expected?  The datasheet for the BIOS PSP claims around 120 MB/s of read performance (I understand the HDD used in the measure was different).  If my performance is unexpected, do you have any suggestions as to how to improve it?  Any ideas of where to look or what I might be doing wrong?

  • Dave,

    We have solved exact same problem in Linux on DM814x platform before. We were trying "write" instead of "read". I'm not familiar with BIOS, so I may not be able to tell you specifics.

    It should almost give at least 80MB/sec performance even if it is 128KB, if caching is enabled. Have you performed the following experiments?

    1. Have you tried bigger chunk sizes (~1MB) and saw any performance difference?

    2. Which is the mode in which the file is opened? (O_RDONLY etc..) ? If possible share the test application routine. 

  • Renjith,

    Caching is enabled.  I have not tried bigger chunk sizes because it looks like the driver limits you to reads of 256 sectors at a time (my HDD sector size is 512 bytes, which limits me to 128 KB per read at 256 sectors).  I'm not sure if my HDD allows for a bigger sector size to be configured, otherwise I would try that.

    As far as your second question goes, I'm not actually using a file system to manage interaction with the drive.  I'm one layer below that, interacting with the drive at the block media layer, using the block media driver along with the lower-level SATA drivers (ATA/ATAPI Interface driver and AHCI driver).  It could be that perhaps I'm not setting up the block media layer correctly?

    Dave

  • Dave,

    Just go ahead and try bigger chunk sizes as the driver should take care of splitting it up if required. Also is DMA enabled in your driver or is it working in PIO mode? 

    I won't be able to help you out in debugging the block layer code over this forum, due to my lack of expertise in BIOS platform. 

  • Renjith,

    That did the trick.  Using larger chunk sizes increased the performance significantly.  Thanks for the tip.

    Dave