Page MenuHomeFreeBSD

arm: Add ARM PL022 Synchronous Serial Port driver
Needs ReviewPublic

Authored by jhibbits on May 15 2024, 6:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jul 10, 9:06 AM
Unknown Object (File)
Sat, Jul 6, 8:36 PM
Unknown Object (File)
Sun, Jun 30, 10:25 AM
Unknown Object (File)
Sun, Jun 30, 2:30 AM
Unknown Object (File)
Fri, Jun 28, 7:20 PM
Unknown Object (File)
Thu, Jun 27, 8:54 PM
Unknown Object (File)
Thu, Jun 27, 8:54 PM
Unknown Object (File)
Thu, Jun 27, 4:08 PM

Details

Reviewers
andrew
manu
Group Reviewers
ARM
Summary

ARM pl022 is a general purpose synchronous serial port controller,
implementing SPI, SSI, and National Microwire frame formats. The driver
currently only supports SPI format.

One limitation of the driver is that hardware only raises an interrupt
if the RX queue contains at least 4 characters, so fewer than 4
characters in the queue may result in data never being received.

Obtained from: Juniper Networks, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 58132
Build 55020: arc lint + arc unit

Event Timeline

br added inline comments.
sys/arm/arm/pl022.h
47

For the bit definition I usually omit prefix (i.e. PL022_), and put extra space after tab.
that allows easier navigation with bare eye.
example sys/arm64/iommu/smmureg.h

One limitation of the driver is that hardware only raises an interrupt if the RX queue contains at least 4 characters, so fewer than 4 characters in the queue may result in data never being received.

Do you not receive the SSPRTINTR interrupt?

sys/arm/arm/pl022.c
136
217
230

ditto

One limitation of the driver is that hardware only raises an interrupt if the RX queue contains at least 4 characters, so fewer than 4 characters in the queue may result in data never being received.

Do you not receive the SSPRTINTR interrupt?

Nope, and it's documented in the reference (DDI0194H):

3.4.1
SSPRXINTR
The receive interrupt is asserted when there are four or more valid entries in the receive FIFO.

sys/arm/arm/pl022.c
136

Oops, and I'm usually the one to give grief over style(9), myself. Will take a closer pass, along with the others.

3.4.1
SSPRXINTR
The receive interrupt is asserted when there are four or more valid entries in the receive FIFO.

That's a different interrupt, see 3.4.4 SSPRTINTR of the same document.

3.4.1
SSPRXINTR
The receive interrupt is asserted when there are four or more valid entries in the receive FIFO.

That's a different interrupt, see 3.4.4 SSPRTINTR of the same document.

Ah, sorry, I had misread. Apparently I don't get the SSPRTINTR on the device I have, as it seems to time out (2 second timeout) on 3-byte messages, and the interrupt is enabled. Maybe it's an issue with my particular device?

Do you need interrupts in this driver? It looks like Linux only uses them when using DMA to transfer data to/from the device.

Do you need interrupts in this driver? It looks like Linux only uses them when using DMA to transfer data to/from the device.

Maybe not, but this is consistent with every other SPI driver in the tree.