Page MenuHomeFreeBSD

ti_sdhci: offload the MMC data phase to EDMA3
Needs ReviewPublic

Authored by rick_sloservers.com on Aug 23 2026, 1:40 PM.
Tags
Referenced Files
Unknown Object (File)
Sun, Oct 4, 10:45 AM
Unknown Object (File)
Thu, Oct 1, 2:32 PM
Unknown Object (File)
Thu, Oct 1, 4:24 AM
Unknown Object (File)
Tue, Sep 29, 12:31 AM
Unknown Object (File)
Mon, Sep 28, 10:31 PM
Unknown Object (File)
Sun, Sep 27, 2:39 AM
Unknown Object (File)
Sat, Sep 26, 3:09 AM
Unknown Object (File)
Thu, Sep 24, 6:36 AM
Subscribers
None

Details

Summary

ti_sdhci only does PIO, so reading from microSD on am335x keeps the CPU
about 90% busy, mostly in interrupt context. sdhci(4) DMA can't be used
instead, since master DMA is not available on this SoC (AM335x TRM,
Table 18-1).

Use the sdhci(4) platform transfer hooks to move the data phase with
EDMA3, the way bcm2835_sdhci uses its own DMA engine. The controller
and channels come from the node's "dmas" property. Reads now use about
6% CPU at the same speed.

Test Plan

Tested on a BeagleBone Black Rev B3 with microSD and eMMC. Reads are about as fast as with PIO, around 20 MB/s, but use about 6% CPU instead of 93%. Data written with PIO reads back the same through DMA and the other way around, on both the microSD and the eMMC. No DMA errors were logged and the board rebooted cleanly several times.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped