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)
Feb 14 2024, 7:24 AM
Unknown Object (File)
Jan 11 2024, 12:39 PM
Unknown Object (File)
Dec 25 2023, 9:21 AM
Unknown Object (File)
Dec 22 2023, 1:56 PM
Unknown Object (File)
Dec 20 2023, 1:47 AM
Unknown Object (File)
Dec 12 2023, 5:19 PM
Unknown Object (File)
Nov 24 2023, 4:58 PM
Unknown Object (File)
Nov 22 2023, 4:25 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.