HomeFreeBSD

aw_spi: improve I/O stability

Description

aw_spi: improve I/O stability

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.

Reviewed by: manu
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D33558

Details

Provenance
avgAuthored on Dec 20 2021, 10:40 AM
Reviewer
manu
Differential Revision
D33558: aw_spi: improve I/O stability
Parents
rG46aec7fae47e: tests/libalias: Make inline functions static inline
Branches
Unknown
Tags
Unknown