u-boot/drivers
Andre Przywara 9faae5457f mmc: sunxi: Increase MMIO FIFO read performance
To avoid the complexity of DMA operations (with chained descriptors), we
use repeated MMIO reads and writes to the SD_FIFO_REG, which allows us
to drain or fill the MMC data buffer FIFO very easily.

However those MMIO accesses are somewhat costly, so this limits our MMC
performance, to between 17 and 22 MB/s, but down to 9.5 MB/s on the H6
(partly due to the lower AHB1 frequency).

As it turns out we read the FIFO status register after *every* word we
read or write, which effectively doubles the number of MMIO accesses,
thus effectively more than halving our performance.

To avoid this overhead, we can make use of the FIFO level bits, which are
in the very same FIFO status registers.
So for a read request, we now can collect as many words as the FIFO
level originally indicated, and only then need to update the status
register.

We don't know for sure the size of the FIFO (and it seems to differ
across SoCs anyway), so writing is more fragile, which is why we still
use the old method for that. If we find a minimum FIFO size available on
all SoCs, we could use that, in a later optimisation.

This patch increases the eMMC read speed on a Pine64-LTS from about
22MB/s to 44 MB/s. SD card reads don't gain that much, but with 23 MB/s
we now reach the practical limit for 3.3V SD cards.
On the H6 we double our transfer speed, from 9.5 MB/s to 19.7 MB/s.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2021-07-10 01:22:09 +01:00
..
adc dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
ata various minor sandbox improvements 2021-07-07 13:34:42 -04:00
axi dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
bios_emulator treewide: Convert macro and uses of __section(foo) to __section("foo") 2021-05-24 14:21:30 -04:00
block dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
bootcount dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
bus bus: ti-sysc: change in a normal driver 2021-03-22 19:23:27 +13:00
button dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
cache dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
clk various minor sandbox improvements 2021-07-07 13:34:42 -04:00
core remove struct uclass_driver::ops 2021-07-06 10:38:03 -06:00
cpu dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
crypto dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
ddr ppc: Remove T4160RDB board 2021-07-07 19:52:24 -04:00
demo common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
dfu dfu: add error callback 2021-06-18 10:09:41 +02:00
dma dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
fastboot fastboot: Fix possible buffer overrun 2021-04-12 17:44:55 -04:00
firmware dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
fpga arm: socfpga: Move Stratix10 and Agilex to use TARGET_SOCFPGA_SOC64 2021-03-08 10:59:10 +08:00
gpio arm: Remove spear600 boards and the rest of SPEAr support 2021-07-07 22:22:42 -04:00
hwspinlock dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
i2c arm: Remove spear600 boards and the rest of SPEAr support 2021-07-07 22:22:42 -04:00
input dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
led dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
mailbox dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
memory memory: stm32-fmc2: migrate trace to dev and log macro 2021-01-13 09:52:58 +01:00
misc sandbox: cros-ec: Add tests for the Chromium OS EC PWM driver 2021-07-06 10:38:03 -06:00
mmc mmc: sunxi: Increase MMIO FIFO read performance 2021-07-10 01:22:09 +01:00
mtd arm: Remove spear600 boards and the rest of SPEAr support 2021-07-07 22:22:42 -04:00
mux dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
net ppc: Remove T4160RDB board 2021-07-07 19:52:24 -04:00
nvme dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
pch dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
pci ppc: Remove caddy2 / vme8349 boards 2021-07-07 19:52:23 -04:00
pci_endpoint dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
phy phy: sun4i-usb: Fix PHY0 routing and passby configuration for MUSB 2021-07-10 01:22:09 +01:00
pinctrl various minor sandbox improvements 2021-07-07 13:34:42 -04:00
power dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
pwm dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
qe ppc: Remove TARGET_T1040QDS references 2021-04-10 08:04:42 -04:00
ram dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
remoteproc dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
reset dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
rng dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
rtc dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
scsi dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
serial arm: Remove edb9315a board 2021-07-07 22:22:42 -04:00
smem dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
soc dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
sound dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
spi various minor sandbox improvements 2021-07-07 13:34:42 -04:00
spmi dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
sysinfo dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
sysreset sysreset: provide type of reset in do_reset cmd 2021-04-20 07:31:12 -04:00
tee dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
thermal dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
timer dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
tpm tpm: Correct warning on 32-bit build 2021-03-13 13:14:52 -05:00
ufs dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
usb arm: Remove spear600 boards and the rest of SPEAr support 2021-07-07 22:22:42 -04:00
video dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
virtio dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
w1 various minor sandbox improvements 2021-07-07 13:34:42 -04:00
w1-eeprom dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
watchdog dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
xen dm: define LOG_CATEGORY for all uclass 2021-07-06 10:38:03 -06:00
Kconfig board: Rename uclass to sysinfo 2020-11-06 10:18:20 +08:00
Makefile cpu: Rename SPL_CPU_SUPPORT to SPL_CPU 2021-03-27 15:04:31 +13:00