Allwinner ARM Boards With SATA See Big Speed Boost From Single Line Patch

Written by Michael Larabel in Hardware on 15 May 2019 at 07:58 AM EDT. 29 Comments
HARDWARE
Right now the low-end Allwinner ARM SBC boards featuring a SATA port have been running at a measly 36~45MB/s but with changing around a single line of kernel code, that can jump to 120MB/s.

ARM SBCs are notorious with slow I/O particularly when piggybacking off USB or just relying upon a microSD card, but for those using SATA HDD/SSD storage with Allwinner boards, that performance is about to get a whole lot better. Uenal Mutlu discovered that by changing around some bits for increasing the SATA/AHCI DMA TX/RX FIFOs, the performance can improve by multiple times for hardware relying upon the Linux kernel's AHCI_SUNXI driver.
- sunxi_clrsetbits(hpriv->mmio + AHCI_P0DMACR, 0x0000ff00, 0x00004400);
+ sunxi_clrsetbits(hpriv->mmio + AHCI_P0DMACR, 0x0000ffff, 0x00004433);

With changing around that line of code, he's seeing write speeds increase from just 36~45MB/s now to ~120MB/s write speeds while read performance is around 200MB/s. His testing was done on Banana Pi boards featuring Allwinner A20 SoCs.


Given the vast number of Allwinner boards on the market, many of which do offer SATA ports, feedback from using the patched driver is welcome. Uenal Mutlu explained in an email to Phoronix that slow Allwinner SATA performance has hindered these boards now for more than five years.

While a small tweak was all that was needed, it was a lot of work to get there. Uenal explained to Phoronix, "The company of these SoCs, Allwinner Technology, was unfortunately not cooperative to provide me information on their SATA/AHCI implementation in their SoCs So, I was forced to research secondary literature from other vendors like Texas Instruments (thanks TI!) and Intel, and also studying very old source codes in the old Linux repositories (as it differs much from the current version) going back to the year 2014, and had to do many (blind) experiments until I found the solution."

For now the patch is on the kernel mailing list but hopefully will be deemed reliable enough for making it into Linux 5.3.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week