Page MenuHomeFreeBSD

aw_spi: improve I/O stability
ClosedPublic

Authored by avg on Dec 19 2021, 9:44 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jan 9, 9:14 AM
Unknown Object (File)
Dec 10 2024, 5:54 PM
Unknown Object (File)
Dec 3 2024, 5:56 PM
Unknown Object (File)
Dec 3 2024, 5:56 PM
Unknown Object (File)
Dec 3 2024, 5:56 PM
Unknown Object (File)
Dec 3 2024, 5:34 PM
Unknown Object (File)
Nov 28 2024, 2:58 AM
Unknown Object (File)
Nov 11 2024, 7:01 PM
Subscribers

Details

Summary

This driver does not use DMA at the moment, so some care is needed to
prevent TX FIFO underruns and RX FIFO overflows.
Several improvements are done in oder to minimize chances of those.

First, the interrupt handling is moved to a filter to minimize latency.
Second, FIFO trigger thresholds are configured for both FIFOs.
The TX FIFO threshold is set to 3/4-th of its size and the RX FIFO
threshold is set to 1/4-th of its size.
The interrupt conditions are changed from the empty FIFO and full FIFO
for the TX and RX correspondingly to going below and above the thresholds.

While here I renamed AW_SPI_IER_RF_ERQ to AW_SPI_IER_RF_RDY which is
closer to what the documentation uses, RF_RDY_INT_EN in the interrupt
control register and RX_RDY in the interrupt status register.

Test Plan

Tested on Orange Pi PC Plus by driving a stick of 8 WS2812 addressable RGB LEDs using SPI MOSI signal.
The LEDs are quite sensitive to timing, so any jitter / stretching is visible.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

avg requested review of this revision.Dec 19 2021, 9:44 AM

Thanks,
My only use was spi flash and it clearly doesn't care that much as RGB leds about timing.

This revision is now accepted and ready to land.Dec 19 2021, 10:14 AM
This revision was automatically updated to reflect the committed changes.